Browse Source

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

FengChaoYu 5 months ago
parent
commit
8f21cf1550

+ 10 - 7
mall-server-api/src/main/java/com/gree/mall/manager/logic/worker/WorkerWarrantyLogic.java

@@ -93,6 +93,7 @@ public class WorkerWarrantyLogic {
         }
 
         workerWarranty.setRefundAmount(workerWarranty.getRefundAmount().add(workerWarrantyRefund.getRefundAmount()));
+        workerWarranty.setRefundTime(new Date());
         workerWarranty.updateById();
         workerWarrantyRefund.insert();
     }
@@ -188,6 +189,12 @@ public class WorkerWarrantyLogic {
             if (!StringUtil.isEmpty((String)row.get(3))) {
                 workerWarranty.setRefundAmount(Convert.toBigDecimal(row.get(3)));
                 workerWarranty.setRefundTime(DateUtil.parse((String) row.get(2), "yyyy-MM-dd"));
+
+                WorkerWarrantyRefund workerWarrantyRefund = new WorkerWarrantyRefund();
+                workerWarrantyRefund.setWarrantyId(workerWarranty.getWarrantyId());
+                workerWarrantyRefund.setRefundAmount(workerWarranty.getRefundAmount());
+                workerWarrantyRefund.setRefundTime(workerWarranty.getRefundTime());
+                workerWarrantyRefunds.add(workerWarrantyRefund);
             }
 
 
@@ -216,11 +223,7 @@ public class WorkerWarrantyLogic {
             else
                 workerWarranty.setWarrantyId(IdWorker.getIdStr());
 
-            WorkerWarrantyRefund workerWarrantyRefund = new WorkerWarrantyRefund();
-            workerWarrantyRefund.setWarrantyId(workerWarranty.getWarrantyId());
-            workerWarrantyRefund.setRefundAmount(workerWarranty.getRefundAmount());
-            workerWarrantyRefund.setRefundTime(workerWarranty.getRefundTime());
-            workerWarrantyRefunds.add(workerWarrantyRefund);
+
 
             if (row.size() > 11) {
                 List<WorkerWarrantyPay> workerWarrantyPays1 = this.importPayAmount(row, workerWarranty.getWarrantyId(), rowIndex);
@@ -229,11 +232,11 @@ public class WorkerWarrantyLogic {
                 if (CollectionUtils.isNotEmpty(workerWarrantyListUp))
                     workerWarranty.setPayableAmount(workerWarrantyListUp.get(0).getPayableAmount());
                 for (WorkerWarrantyPay workerWarrantyPay : workerWarrantyPays1) {
-                    workerWarranty.setPayableAmount(workerWarrantyPay.getPayAmount().add(workerWarranty.getPayableAmount()));
+                    workerWarranty.setPayableAmount(workerWarrantyPay.getPayAmount().add((workerWarranty.getPayableAmount() == null?BigDecimal.ZERO:workerWarranty.getPayableAmount())));
                 }
             }
 
-            if (CollectionUtils.isNotEmpty(workerWarrantyListUp))
+            if (CollectionUtils.isNotEmpty(workerWarrantyListUp) && workerWarranty.getRefundAmount() != null)
                 workerWarranty.setRefundAmount(workerWarrantyListUp.get(0).getRefundAmount().add(workerWarranty.getRefundAmount()));
 
             workerWarranties.add(workerWarranty);

BIN
mall-server-api/src/main/resources/template/质保金新增模板.xlsx


BIN
mall-server-api/src/main/resources/template/质保金缴费模板.xlsx