|
@@ -174,6 +174,11 @@ public class RepairSaleService {
|
|
HashMap<Integer,Part> partMap = partService.getHashMap();
|
|
HashMap<Integer,Part> partMap = partService.getHashMap();
|
|
HashMap<Integer,LaborCost> laborMap = laborCostService.getHashMap();
|
|
HashMap<Integer,LaborCost> laborMap = laborCostService.getHashMap();
|
|
|
|
|
|
|
|
+ List<PriceList> priceLists = priceListService.getByRepairId(repair.getRepairId());
|
|
|
|
+ List<PriceList> collect = priceLists.stream().filter(entity -> entity.getType() == 0).collect(Collectors.toList());
|
|
|
|
+ HashMap<Integer,PriceList> partMapDb = new HashMap<>();
|
|
|
|
+ collect.forEach(entity -> partMapDb.put(entity.getPartId(),entity));
|
|
|
|
+
|
|
priceListService.delNoCm(repair.getRepairId());
|
|
priceListService.delNoCm(repair.getRepairId());
|
|
for (PriceList priceList : param.getPriceLists()) {
|
|
for (PriceList priceList : param.getPriceLists()) {
|
|
if(priceList.getType() == null){
|
|
if(priceList.getType() == null){
|
|
@@ -183,6 +188,11 @@ public class RepairSaleService {
|
|
if(priceList.getPartId() == null || partMap.get(priceList.getPartId()) == null || priceList.getDiscount() == null){
|
|
if(priceList.getPartId() == null || partMap.get(priceList.getPartId()) == null || priceList.getDiscount() == null){
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
}
|
|
}
|
|
|
|
+ PriceList priceListDb = partMapDb.get(priceList.getPartId());
|
|
|
|
+ if(priceListDb != null){
|
|
|
|
+ priceList.setPriceListId(priceListDb.getPriceListId());
|
|
|
|
+ priceList.setOutStatus(priceListDb.getOutStatus());
|
|
|
|
+ }
|
|
Part part = partMap.get(priceList.getPartId());
|
|
Part part = partMap.get(priceList.getPartId());
|
|
priceList.setPrice(part.getPartPrice());
|
|
priceList.setPrice(part.getPartPrice());
|
|
priceList.setPriceDiscount(part.getPartPriceDiscount());
|
|
priceList.setPriceDiscount(part.getPartPriceDiscount());
|