lyhzzz 2 年 前
コミット
05c27a5918

+ 0 - 1
src/main/java/com/fdkankan/sale/service/impl/PriceListServiceImpl.java

@@ -82,7 +82,6 @@ public class PriceListServiceImpl extends ServiceImpl<IPriceListMapper, PriceLis
     public void delNoCm(String repairId) {
         LambdaQueryWrapper<PriceList> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(PriceList::getRepairId,repairId);
-        wrapper.eq(PriceList::getStatus,0);
         this.remove(wrapper);
     }
 

+ 3 - 10
src/main/java/com/fdkankan/sale/service/impl/RepairSaleService.java

@@ -174,13 +174,13 @@ public class RepairSaleService {
         HashMap<Integer,Part> partMap = partService.getHashMap();
         HashMap<Integer,LaborCost> laborMap = laborCostService.getHashMap();
 
+        priceListService.delNoCm(repair.getRepairId());
         for (PriceList priceList : param.getPriceLists()) {
             if(priceList.getType() == null){
                 throw new BusinessException(ResultCode.PRICE_TYPE_NOT);
             }
             if(priceList.getType() == 0){
-                if(priceList.getPartId() == null ||  partMap.get(priceList.getPartId()) == null
-                        || priceList.getPriceListId() == null || priceList.getDiscount() == null){
+                if(priceList.getPartId() == null ||  partMap.get(priceList.getPartId()) == null || priceList.getDiscount() == null){
                     throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
                 }
                 Part part = partMap.get(priceList.getPartId());
@@ -199,14 +199,7 @@ public class RepairSaleService {
             }
 
             priceList.setRepairId(param.getRepairId());
-            if(priceList.getPriceListId() != null){
-                PriceList dbPriceList = priceListService.getById(priceList.getPriceListId());
-                if(dbPriceList.getStatus() != 1){
-                    priceListService.updateById(priceList);
-                }
-            }else {
-                priceListService.save(priceList);
-            }
+            priceListService.save(priceList);
 
         }
         repairLogService.saveBySysUser(userId,param.getRepairId(),RepairStatusEnum.TO_BE_CONFIRMED.status(),"维修报价");