|
@@ -178,6 +178,9 @@ public class RepairSaleService {
|
|
|
HashMap<Integer,Part> partMap = partService.getHashMap();
|
|
|
HashMap<Integer,LaborCost> laborMap = laborCostService.getHashMap();
|
|
|
|
|
|
+ List<PriceList> priceListList = priceListService.getByRepairId(repair.getRepairId());
|
|
|
+ HashMap<Integer,PriceList> priceListHashMap = new HashMap<>();
|
|
|
+ priceListList.forEach(entity -> priceListHashMap.put(entity.getPriceListId(),entity));
|
|
|
|
|
|
priceListService.delNoCm(repair.getRepairId());
|
|
|
for (PriceList priceList : param.getPriceLists()) {
|
|
@@ -205,8 +208,12 @@ public class RepairSaleService {
|
|
|
}
|
|
|
priceList.setRepairId(param.getRepairId());
|
|
|
if(priceList.getPriceListId() != null){
|
|
|
- priceList.setRecStatus("A");
|
|
|
- priceListService.updateById(priceList);
|
|
|
+ PriceList priceList1 = priceListHashMap.get(priceList.getPriceListId());
|
|
|
+ if(priceList1 != null){
|
|
|
+ BeanUtils.copyProperties(priceList,priceList1);
|
|
|
+ priceList1.setPriceListId(null);
|
|
|
+ priceListService.save(priceList1);
|
|
|
+ }
|
|
|
}else {
|
|
|
priceListService.save(priceList);
|
|
|
}
|