Ver código fonte

修改发票管理 重构代码

y 2 anos atrás
pai
commit
f40041711e

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

@@ -25,12 +25,6 @@ public class AccountExcel implements Serializable {
     @ExcelProperty("户名")
     private String accountName;
 
-    /**
-     * 开户行名称
-     */
-    @ExcelProperty("开户行名称")
-    private String bankName;
-
     //营业性质(3一般纳税 2小规模 1个体户)
     @ExcelProperty(value = "营业性质")
     private String businessQuality;
@@ -50,12 +44,6 @@ public class AccountExcel implements Serializable {
     @ExcelProperty("剩余开票额度")
     private String invoicingAmountExcess;
 
-    /**
-     * 余额
-     */
-    @ExcelProperty("余额")
-    private String balance;
-
     @ExcelProperty("暂估")
     private String estimate;
 }

+ 22 - 26
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountServiceImpl.java

@@ -243,33 +243,29 @@ public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAcco
         List<AccountExcel> accountExcels = new ArrayList<>();
 
         collect1.forEach(invAccount -> {
-            if (invAccount.getInvAccountCardList() != null){
-                invAccount.getInvAccountCardList().forEach(invAccountCard -> {
-                    AccountExcel accountExcel = new AccountExcel();
-                    accountExcel.setAccountId(invAccount.getAccountId());
-                    accountExcel.setAccountName(invAccount.getAccountName());
-                    accountExcel.setBankName(invAccountCard.getBankName());
-                   if (invAccount.getBusinessQuality() != null){
-                       if (invAccount.getBusinessQuality().equals("3")){
-                           accountExcel.setBusinessQuality("一般纳税");
-                       }else if (invAccount.getBusinessQuality().equals("1")){
-                           accountExcel.setBusinessQuality("小规模");
-                       }else if (invAccount.getBusinessQuality().equals("2")){
-                           accountExcel.setBusinessQuality("小规模");
-                       }
-                   }
-                    accountExcel.setOwned(invAccount.getOwned());
-                    if (invAccount.getEstablishTime() != null){
-                        LocalDateTime establishTime = LocalDateTime.fromDateFields(invAccount.getEstablishTime());
-                        accountExcel.setEstablishTime(establishTime.toString().substring(0,establishTime.toString().indexOf("T")));
+            if (invAccount.getInvAccountCardList() != null) {
+                AccountExcel accountExcel = new AccountExcel();
+                accountExcel.setAccountId(invAccount.getAccountId());
+                accountExcel.setAccountName(invAccount.getAccountName());
+                if (invAccount.getBusinessQuality() != null) {
+                    if (invAccount.getBusinessQuality().equals("3")) {
+                        accountExcel.setBusinessQuality("一般纳税");
+                    } else if (invAccount.getBusinessQuality().equals("1")) {
+                        accountExcel.setBusinessQuality("小规模");
+                    } else if (invAccount.getBusinessQuality().equals("2")) {
+                        accountExcel.setBusinessQuality("小规模");
                     }
-                    accountExcel.setSumInvoicingAmount(invAccount.getSumInvoicingAmount());
-                    accountExcel.setQuarterAmountExcess(invAccount.getQuarterAmountExcess());
-                    accountExcel.setInvoicingAmountExcess(invAccount.getInvoicingAmountExcess());
-                    accountExcel.setBalance(invAccountCard.getBalance());
-                    accountExcel.setEstimate(invAccount.getTentativeEstimates());
-                    accountExcels.add(accountExcel);
-                });
+                }
+                accountExcel.setOwned(invAccount.getOwned());
+                if (invAccount.getEstablishTime() != null) {
+                    LocalDateTime establishTime = LocalDateTime.fromDateFields(invAccount.getEstablishTime());
+                    accountExcel.setEstablishTime(establishTime.toString().substring(0, establishTime.toString().indexOf("T")));
+                }
+                accountExcel.setSumInvoicingAmount(invAccount.getSumInvoicingAmount());
+                accountExcel.setQuarterAmountExcess(invAccount.getQuarterAmountExcess());
+                accountExcel.setInvoicingAmountExcess(invAccount.getInvoicingAmountExcess());
+                accountExcel.setEstimate(invAccount.getTentativeEstimates());
+                accountExcels.add(accountExcel);
             }
         });