Просмотр исходного кода

Merge remote-tracking branch 'origin/test' into test

wks 2 лет назад
Родитель
Сommit
0aba0374cf

+ 5 - 2
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountExcelServiceImpl.java

@@ -88,8 +88,11 @@ public class InvAccountExcelServiceImpl extends ServiceImpl<InvAccountExcelMappe
         for (InvAccountExcel record : records) {
             StringBuilder a = new StringBuilder();
             String[] split = record.getPayMethod().split(",");
-            for (String i : split) {
-                a.append(InvPayMethodEnum.getNameByCode(i)).append(",");
+            for (int i = 0; i < split.length; i++) {
+                a.append(InvPayMethodEnum.getNameByCode(split[i]));
+                if (i < split.length - 1) {
+                    a.append(",");
+                }
             }
             record.setPayMethod(a.toString());
         }

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

@@ -148,6 +148,7 @@ public class InvAccountIncoiceServiceImpl extends ServiceImpl<InvAccountIncoiceM
         invAccountOperate.setEnterCardNum(entCard.getBankCardNum());
         invAccountOperate.setCreateId(baseController.getUserId());
         invAccountOperate.setCreateBy(baseController.getUserName());
+        invAccountOperate.setPayoutTime(invAccountIncoice.getPayoutTime());
 
         //支出操作记录
         InvAccountOperate outInvAccountOperate = new InvAccountOperate();
@@ -167,6 +168,7 @@ public class InvAccountIncoiceServiceImpl extends ServiceImpl<InvAccountIncoiceM
         outInvAccountOperate.setEnterCardNum(entCard.getBankCardNum());
         outInvAccountOperate.setCreateId(baseController.getUserId());
         outInvAccountOperate.setCreateBy(baseController.getUserName());
+        outInvAccountOperate.setPayoutTime(invAccountIncoice.getPayoutTime());
 
 
         //放入操作记录list中
@@ -239,6 +241,7 @@ public class InvAccountIncoiceServiceImpl extends ServiceImpl<InvAccountIncoiceM
             invAccountOperate1.setInvoiceId(invAccountIncoice1.getInvoiceId());
             invAccountOperate1.setOutProfit(outProfit);
             invAccountOperate1.setEntProfit(entProfit);
+            invAccountOperate1.setPayoutTime(invAccountIncoice.getPayoutTime());
             invAccountOperateService.insert(invAccountOperate1);
         }
 

+ 5 - 2
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountOperateServiceImpl.java

@@ -83,8 +83,11 @@ public class InvAccountOperateServiceImpl extends ServiceImpl<InvAccountOperateM
             StringBuilder a = new StringBuilder();
             if (record.getPayMethod() != null) {
                 String[] split = record.getPayMethod().split(",");
-                for (String i : split) {
-                    a.append(InvPayMethodEnum.getNameByCode(i)).append(",");
+                for (int i = 0; i < split.length; i++) {
+                    a.append(InvPayMethodEnum.getNameByCode(split[i]));
+                    if (i < split.length - 1) {
+                        a.append(",");
+                    }
                 }
                 record.setPayMethod(a.toString());
             }

+ 21 - 6
src/main/java/com/ydtech/modules/inv/utils/EasyExcelUtils.java

@@ -262,8 +262,11 @@ public class EasyExcelUtils {
             String payMethod = excel.getPayMethod();
             String[] split = payMethod.split(",");
             StringBuilder a = new StringBuilder();
-            for (String i : split) {
-                a.append(InvPayMethodEnum.getNameByCode(i)).append(",");
+            for (int i = 0; i < split.length; i++) {
+                a.append(InvPayMethodEnum.getNameByCode(split[i]));
+                if (i < split.length - 1) {
+                    a.append(",");
+                }
             }
 
             StringBuilder stringBuffer = new StringBuilder();
@@ -274,16 +277,28 @@ public class EasyExcelUtils {
                     ));
 
             for (Map.Entry<String, Object> entry : excel.getOutProfit().entrySet()) {
-                if (Integer.parseInt(entry.getValue().toString()) != 0) {
-                    stringBuffer.append(collect.get(entry.getKey()).get(0).getProfitName()).append("    ").append(entry.getValue());
+                try {
+                    double value = Double.parseDouble(entry.getValue().toString());
+                    if (value != 0) {
+                        stringBuffer.append(collect.get(entry.getKey()).get(0).getProfitName()).append("    ").append(value);
+                    }
+                } catch (NumberFormatException e) {
+                    // 处理转换异常
+                    e.printStackTrace();
                 }
             }
 
             stringBuffer.append("→");
 
             for (Map.Entry<String, Object> entry : excel.getEntProfit().entrySet()) {
-                if (Integer.parseInt(entry.getValue().toString()) != 0) {
-                    stringBuffer.append(collect.get(entry.getKey()).get(0).getProfitName()).append("   ").append(entry.getValue());
+                try {
+                    double value = Double.parseDouble(entry.getValue().toString());
+                    if (value != 0) {
+                        stringBuffer.append(collect.get(entry.getKey()).get(0).getProfitName()).append("    ").append(value);
+                    }
+                } catch (NumberFormatException e) {
+                    // 处理转换异常
+                    e.printStackTrace();
                 }
             }