Browse Source

付款登记记录付款金额

lyhzzz 2 years ago
parent
commit
752689ea72
1 changed files with 11 additions and 1 deletions
  1. 11 1
      src/main/java/com/fdkankan/sale/service/impl/RepairSaleService.java

+ 11 - 1
src/main/java/com/fdkankan/sale/service/impl/RepairSaleService.java

@@ -140,7 +140,9 @@ public class RepairSaleService {
         if(repair == null){
             throw new BusinessException(ResultCode.REPAIR_NOT_EXITS);
         }
-
+        if(repair.getStatus() !=2){
+            throw new BusinessException(ResultCode.REPAIR_STATUS_NOT_EXITS);
+        }
 
         HashMap<Integer,Part> partMap = partService.getHashMap();
         HashMap<Integer,LaborCost> laborMap = laborCostService.getHashMap();
@@ -195,12 +197,17 @@ public class RepairSaleService {
         if(repair == null){
             throw new BusinessException(ResultCode.REPAIR_NOT_EXITS);
         }
+        if(repair.getStatus() !=9){
+            throw new BusinessException(ResultCode.REPAIR_STATUS_NOT_EXITS);
+        }
+        BigDecimal payAmount = priceListService.getAmountByRepairId(repair.getRepairId());
         RepairPay repairPay = new RepairPay();
         repairPay.setRepairId(repair.getRepairId());
         repairPay.setPayType(param.getPayType());
         repairPay.setPayImg(param.getPayImg());
         repairPay.setPayStatus(1);
         repairPay.setSysUserId(userId);
+        repairPay.setPayAmount(payAmount);
         repairPayService.save(repairPay);
         repairLogService.saveBySysUser(userId,param.getRepairId(),10,"付款登记");
 
@@ -214,6 +221,9 @@ public class RepairSaleService {
         if(repair == null){
             throw new BusinessException(ResultCode.REPAIR_NOT_EXITS);
         }
+        if(repair.getStatus() !=10){
+            throw new BusinessException(ResultCode.REPAIR_STATUS_NOT_EXITS);
+        }
         customerAddressService.setTrackingNumByRepairId(repair.getRepairId(),param.getTrackingNum());
         repairLogService.saveBySysUser(userId,param.getRepairId(),11,"发货登记");