|
@@ -1,5 +1,8 @@
|
|
package com.jeeplus.finance.invoice.controller;
|
|
package com.jeeplus.finance.invoice.controller;
|
|
|
|
|
|
|
|
+import cn.hutool.extra.spring.SpringUtil;
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.alibaba.fastjson.TypeReference;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.jeeplus.aop.demo.annotation.DemoMode;
|
|
import com.jeeplus.aop.demo.annotation.DemoMode;
|
|
@@ -18,6 +21,7 @@ import com.jeeplus.logging.annotation.ApiLog;
|
|
import com.jeeplus.logging.constant.enums.LogTypeEnum;
|
|
import com.jeeplus.logging.constant.enums.LogTypeEnum;
|
|
//import com.jeeplus.sys.utils.DictUtils;
|
|
//import com.jeeplus.sys.utils.DictUtils;
|
|
//import com.jeeplus.sys.utils.SpringContextHolder;
|
|
//import com.jeeplus.sys.utils.SpringContextHolder;
|
|
|
|
+import com.jeeplus.sys.feign.IDictApi;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.extern.log4j.Log4j2;
|
|
import lombok.extern.log4j.Log4j2;
|
|
@@ -39,10 +43,7 @@ import java.io.OutputStream;
|
|
import java.lang.reflect.Field;
|
|
import java.lang.reflect.Field;
|
|
import java.lang.reflect.Type;
|
|
import java.lang.reflect.Type;
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Api("财务管理-发票")
|
|
@Api("财务管理-发票")
|
|
@@ -365,6 +366,116 @@ public class CwFinanceInvoiceController {
|
|
}
|
|
}
|
|
//对导出数据进行处理
|
|
//对导出数据进行处理
|
|
List<CwFinanceInvoiceDTO> resultList = cwFinanceInvoiceService.disposeExportList(result);
|
|
List<CwFinanceInvoiceDTO> resultList = cwFinanceInvoiceService.disposeExportList(result);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //获取字典数据
|
|
|
|
+ String cwWorkClientReportTypeDatas = SpringUtil.getBean ( IDictApi.class ).getDictListMapByDict ("cw_work_client_report_type");
|
|
|
|
+ Map<String,Object> cwWorkClientReportTypeValueDTOs = JSON.parseObject(cwWorkClientReportTypeDatas, new TypeReference<Map<String,Object>>() {});
|
|
|
|
+
|
|
|
|
+ String projectClassificationDatas = SpringUtil.getBean ( IDictApi.class ).getDictListMapByDict ("project_classification");
|
|
|
|
+ Map<String,Object> projectClassificationValueDTOs = JSON.parseObject(projectClassificationDatas, new TypeReference<Map<String,Object>>() {});
|
|
|
|
+
|
|
|
|
+ String invoiceBillingContentDatas = SpringUtil.getBean ( IDictApi.class ).getDictListMapByDict ("invoice_billing_content");
|
|
|
|
+ Map<String,Object> invoiceBillingContentValueDTOs = JSON.parseObject(invoiceBillingContentDatas, new TypeReference<Map<String,Object>>() {});
|
|
|
|
+
|
|
|
|
+ String invoiceTypeDatas = SpringUtil.getBean ( IDictApi.class ).getDictListMapByDict ("invoice_type");
|
|
|
|
+ Map<String,Object> invoiceTypeValueDTOs = JSON.parseObject(invoiceTypeDatas, new TypeReference<Map<String,Object>>() {});
|
|
|
|
+
|
|
|
|
+ String invoiceStatusDatas = SpringUtil.getBean ( IDictApi.class ).getDictListMapByDict ("invoice_status");
|
|
|
|
+ Map<String,Object> invoiceStatusValueDTOs = JSON.parseObject(invoiceStatusDatas, new TypeReference<Map<String,Object>>() {});
|
|
|
|
+
|
|
|
|
+ for (CwFinanceInvoiceDTO info : resultList) {
|
|
|
|
+ if(StringUtils.isNotBlank(info.getReportType())){
|
|
|
|
+ for (String key : cwWorkClientReportTypeValueDTOs.keySet()) {
|
|
|
|
+ if(info.getReportType().equals(key)){
|
|
|
|
+ info.setReportType(String.valueOf(cwWorkClientReportTypeValueDTOs.get(key)));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotBlank(info.getProjectClassification())){
|
|
|
|
+ for (String key : projectClassificationValueDTOs.keySet()) {
|
|
|
|
+ if(info.getProjectClassification().equals(key)){
|
|
|
|
+ info.setProjectClassification(String.valueOf(projectClassificationValueDTOs.get(key)));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotBlank(info.getBillingContent())){
|
|
|
|
+ for (String key : invoiceBillingContentValueDTOs.keySet()) {
|
|
|
|
+ if(info.getBillingContent().equals(key)){
|
|
|
|
+ info.setBillingContent(String.valueOf(invoiceBillingContentValueDTOs.get(key)));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotBlank(info.getType())){
|
|
|
|
+ for (String key : invoiceTypeValueDTOs.keySet()) {
|
|
|
|
+ if(info.getType().equals(key)){
|
|
|
|
+ info.setType(String.valueOf(invoiceTypeValueDTOs.get(key)));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotBlank(info.getStatus())){
|
|
|
|
+ for (String key : invoiceStatusValueDTOs.keySet()) {
|
|
|
|
+ if(info.getStatus().equals(key)){
|
|
|
|
+ info.setStatus(String.valueOf(invoiceStatusValueDTOs.get(key)));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isNotBlank(info.getReceivablesStatus())){
|
|
|
|
+ switch (info.getReceivablesStatus()){
|
|
|
|
+ case "1":
|
|
|
|
+ info.setReceivablesStatus("是");
|
|
|
|
+ break;
|
|
|
|
+ case "0":
|
|
|
|
+ info.setReceivablesStatus("否");
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ info.setReceivablesStatus("");
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ info.setReceivablesStatus("");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isNotBlank(info.getIsPreInvoice())){
|
|
|
|
+ switch (info.getIsPreInvoice()){
|
|
|
|
+ case "1":
|
|
|
|
+ info.setIsPreInvoice("是");
|
|
|
|
+ break;
|
|
|
|
+ case "0":
|
|
|
|
+ info.setIsPreInvoice("否");
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ info.setIsPreInvoice("");
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ info.setIsPreInvoice("");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isNotBlank(info.getIsCompleteInvoice())){
|
|
|
|
+ switch (info.getIsCompleteInvoice()){
|
|
|
|
+ case "1":
|
|
|
|
+ case "2":
|
|
|
|
+ info.setIsCompleteInvoice("是");
|
|
|
|
+ break;
|
|
|
|
+ case "0":
|
|
|
|
+ info.setIsCompleteInvoice("否");
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ info.setIsCompleteInvoice("");
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ info.setIsCompleteInvoice("");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
EasyPoiUtil.exportExcel ( resultList, sheetName, sheetName, CwFinanceInvoiceDTO.class, fileName, response );
|
|
EasyPoiUtil.exportExcel ( resultList, sheetName, sheetName, CwFinanceInvoiceDTO.class, fileName, response );
|
|
|
|
|
|
}
|
|
}
|