Pārlūkot izejas kodu

修改发票管理 重构代码

y 2 gadi atpakaļ
vecāks
revīzija
c5358595e9

+ 2 - 0
src/main/java/com/ydtech/modules/inv/model/excel/AccountExcel.java

@@ -22,6 +22,8 @@ public class AccountExcel implements Serializable {
 
 
     @ExcelProperty("编号")
     @ExcelProperty("编号")
     private String accountId;
     private String accountId;
+    @ExcelProperty("户名")
+    private String accountName;
 
 
     /**
     /**
      * 开户行名称
      * 开户行名称

+ 0 - 4
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountIncoiceServiceImpl.java

@@ -149,10 +149,6 @@ public class InvAccountIncoiceServiceImpl extends ServiceImpl<InvAccountIncoiceM
         outInvAccountOperate.setFundFen(invAccountIncoice.getFundFen());
         outInvAccountOperate.setFundFen(invAccountIncoice.getFundFen());
         outInvAccountOperate.setInvoiceId(invAccountIncoice1.getInvoiceId());
         outInvAccountOperate.setInvoiceId(invAccountIncoice1.getInvoiceId());
         outInvAccountOperate.setCreateTime(LocalDateTime.now());
         outInvAccountOperate.setCreateTime(LocalDateTime.now());
-
-        for (Map.Entry<String, Object> entry : outProfit.entrySet()) {
-            outProfit.put(entry.getKey(), new BigDecimal(String.valueOf(entry.getValue())).toString());
-        }
         outInvAccountOperate.setOutProfit(outProfit);
         outInvAccountOperate.setOutProfit(outProfit);
 
 
 
 

+ 1 - 0
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountOperateServiceImpl.java

@@ -124,6 +124,7 @@ public class InvAccountOperateServiceImpl extends ServiceImpl<InvAccountOperateM
         }
         }
 
 
         invAccountOperate.setCreateTime(LocalDateTime.now());
         invAccountOperate.setCreateTime(LocalDateTime.now());
+        invAccountOperate.setOutProfit(null);
         insAccountOperateMapper.insert(invAccountOperate);
         insAccountOperateMapper.insert(invAccountOperate);
 
 
         List<InvAccountOp> list = invAccountEntOpList(entProfit, entAccount, entAccountCard, applyAmount);
         List<InvAccountOp> list = invAccountEntOpList(entProfit, entAccount, entAccountCard, applyAmount);

+ 1 - 0
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountServiceImpl.java

@@ -247,6 +247,7 @@ public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAcco
                 invAccount.getInvAccountCardList().forEach(invAccountCard -> {
                 invAccount.getInvAccountCardList().forEach(invAccountCard -> {
                     AccountExcel accountExcel = new AccountExcel();
                     AccountExcel accountExcel = new AccountExcel();
                     accountExcel.setAccountId(invAccount.getAccountId());
                     accountExcel.setAccountId(invAccount.getAccountId());
+                    accountExcel.setAccountName(invAccount.getAccountName());
                     accountExcel.setBankName(invAccountCard.getBankName());
                     accountExcel.setBankName(invAccountCard.getBankName());
                    if (invAccount.getBusinessQuality() != null){
                    if (invAccount.getBusinessQuality() != null){
                        if (invAccount.getBusinessQuality().equals("3")){
                        if (invAccount.getBusinessQuality().equals("3")){

+ 9 - 2
src/main/java/com/ydtech/modules/inv/utils/EasyExcelUtils.java

@@ -167,7 +167,7 @@ public class EasyExcelUtils {
             data.add(invAccountOperate.getFundUse());
             data.add(invAccountOperate.getFundUse());
             data.add(invAccountOperate.getFundFen());
             data.add(invAccountOperate.getFundFen());
             data.add(invAccountOperate.getApplyAmount());
             data.add(invAccountOperate.getApplyAmount());
-            data.add(invAccountOperate.getRevenueOutlay().equals("0")?"收入":"支出");
+            data.add(invAccountOperate.getRevenueOutlay().equals("0") ? "收入" : "支出");
             invAccountProfitList.forEach(invAccountProfit -> {
             invAccountProfitList.forEach(invAccountProfit -> {
                 if (invAccountOperate.getOutProfit() != null) {
                 if (invAccountOperate.getOutProfit() != null) {
                     for (Map.Entry<String, Object> entry : invAccountOperate.getOutProfit().entrySet()) {
                     for (Map.Entry<String, Object> entry : invAccountOperate.getOutProfit().entrySet()) {
@@ -176,6 +176,13 @@ public class EasyExcelUtils {
                         }
                         }
                     }
                     }
                 }
                 }
+                if (invAccountOperate.getEntProfit() != null){
+                    for (Map.Entry<String, Object> entry : invAccountOperate.getEntProfit().entrySet()) {
+                        if (entry.getKey().equals(invAccountProfit.getProfitEng())) {
+                            data.add(entry.getValue());
+                        }
+                    }
+                }
             });
             });
             list.add(data);
             list.add(data);
         });
         });
@@ -216,7 +223,7 @@ public class EasyExcelUtils {
     /**
     /**
      * 导出资金申请模板
      * 导出资金申请模板
      */
      */
-    public String downAccountExcel(String uploadFilePath, List<InvAccountExcel> invAccountExcel,List<InvAccountProfit> invAccountProfit) {
+    public String downAccountExcel(String uploadFilePath, List<InvAccountExcel> invAccountExcel, List<InvAccountProfit> invAccountProfit) {
         // 加载模板
         // 加载模板
         String templateFile = "资金申请单模板.xlsx";
         String templateFile = "资金申请单模板.xlsx";
         List<InvAccountExcel> list = new ArrayList<>();
         List<InvAccountExcel> list = new ArrayList<>();