|
|
@@ -4,7 +4,9 @@ import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
+import com.cyksj.mapper.InvoiceCompanyMapper;
|
|
|
import com.cyksj.mapper.UserInvoiceApplyRecordMapper;
|
|
|
+import com.cyksj.model.entity.InvoiceCompany;
|
|
|
import com.cyksj.model.entity.UserInvoiceApplyRecord;
|
|
|
import com.cyksj.model.excel.ExcelInvoiceData;
|
|
|
import com.cyksj.model.views.UserInvoiceApplyRecordView;
|
|
|
@@ -36,6 +38,8 @@ public class UserInvoiceController {
|
|
|
|
|
|
private final UserInvoiceApplyRecordMapper userInvoiceApplyRecordMapper;
|
|
|
|
|
|
+ private final InvoiceCompanyMapper invoiceCompanyMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 用户发票申请记录
|
|
|
*/
|
|
|
@@ -71,4 +75,42 @@ public class UserInvoiceController {
|
|
|
List<ExcelInvoiceData> list = beanSearcher.searchAll(ExcelInvoiceData.class, MapUtils.flatBuilder(request.getParameterMap()).orderBy(ExcelInvoiceData::getUpdateTime).desc().build());
|
|
|
EasyExcelUtils.createExcelStreamMutilByEasyExcel(response, ExcelInvoiceData.class, list, "用户发票", "用户发票", ExcelTypeEnum.XLSX, null);
|
|
|
}
|
|
|
+
|
|
|
+ //==========================================================税率管理=================================================================================
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 税率管理列表
|
|
|
+ */
|
|
|
+ @GetMapping("/get/company/taxRate")
|
|
|
+ public Result<List<InvoiceCompany>> getCompanyTaxRate() {
|
|
|
+ List<InvoiceCompany> invoiceCompanies = beanSearcher.searchAll(InvoiceCompany.class, MapUtils.flatBuilder(request.getParameterMap()).build());
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(invoiceCompanies);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增公司税率
|
|
|
+ */
|
|
|
+ @PostMapping("/post/company/taxRate")
|
|
|
+ public Result<String> insertCompanyTaxRate(@RequestBody InvoiceCompany invoiceCompany) {
|
|
|
+ invoiceCompanyMapper.insert(invoiceCompany);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 编辑公司税率
|
|
|
+ */
|
|
|
+ @PutMapping("/update/company/taxRate")
|
|
|
+ public Result<String> updateCompanyTaxRate(@RequestBody InvoiceCompany invoiceCompany) {
|
|
|
+ invoiceCompanyMapper.updateById(invoiceCompany);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除公司税率
|
|
|
+ */
|
|
|
+ @DeleteMapping("/delete/company/taxRate/{id}")
|
|
|
+ public Result<String> updateCompanyTaxRate(@PathVariable Long id) {
|
|
|
+ invoiceCompanyMapper.deleteById(id);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
}
|