|
@@ -668,8 +668,42 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public int updatePriceByPriceId(Map<String, Object> map){
|
|
|
|
- int i = amsContractTruckPriceMapper.updatePriceByPriceId(map);
|
|
|
|
|
|
+ public int updatePriceByPriceId(Map<String, Object> mapValue){
|
|
|
|
+ int i = 0;
|
|
|
|
+ BigDecimal capacityTypeId = DataChange.dataToBigDecimal(mapValue.get("capacityTypeId"));
|
|
|
|
+ BigDecimal lineId = DataChange.dataToBigDecimal(mapValue.get("rangeId"));
|
|
|
|
+ BigDecimal formulaId = DataChange.dataToBigDecimal(mapValue.get("cargonameId"));
|
|
|
|
+ BigDecimal priceValue = DataChange.dataToBigDecimal(mapValue.get("priceValue"));
|
|
|
|
+ Date priceDate = new Date((Long)mapValue.get("priceDate"));
|
|
|
|
+ BigDecimal type = DataChange.dataToBigDecimal(mapValue.get("type"));
|
|
|
|
+ BigDecimal oilpriceBase = DataChange.dataToBigDecimal(mapValue.get("oilpriceBase"));
|
|
|
|
+ BigDecimal oilTypeId = DataChange.dataToBigDecimal(mapValue.get("oilTypeId"));
|
|
|
|
+ BigDecimal oilpriceChangeThreshold = DataChange.dataToBigDecimal(mapValue.get("oilpriceChangeThreshold"));
|
|
|
|
+ List<Map<String,Object>>mapList = (List<Map<String, Object>>) mapValue.get("mapList");
|
|
|
|
+ BigDecimal priceId=DataChange.dataToBigDecimal(mapValue.get("priceId"));
|
|
|
|
+
|
|
|
|
+ AmsContractTransportPrice amsContractTransportPrice = new AmsContractTransportPrice();
|
|
|
|
+ amsContractTransportPrice.setOilpriceBase(oilpriceBase);
|
|
|
|
+ amsContractTransportPrice.setOilTypeId(oilTypeId);
|
|
|
|
+ amsContractTransportPrice.setPriceValue(priceValue);
|
|
|
|
+ amsContractTransportPrice.setPriceDate(priceDate);
|
|
|
|
+ amsContractTransportPrice.setCargonameId(formulaId);
|
|
|
|
+ amsContractTransportPrice.setPriceId(priceId);
|
|
|
|
+ amsContractTransportPrice.setUpdateTime(new Date());
|
|
|
|
+ i = amsContractTruckPriceMapper.updateByPrimaryKeySelective(amsContractTransportPrice);
|
|
|
|
+ //把之前的全删了,然后新增
|
|
|
|
+ i = amsContaactPriceMaterialMapper.deletePriceByPriceId(mapValue.get("priceId").toString());
|
|
|
|
+ for (Map<String,Object>map:mapList
|
|
|
|
+ ) {
|
|
|
|
+ //新增
|
|
|
|
+ AmsContaactPriceMaterial amsContaactPriceMaterial = new AmsContaactPriceMaterial();
|
|
|
|
+ //设置最大主键ID
|
|
|
|
+ amsContaactPriceMaterial.setId(amsContractTruckPriceMapper.selectPriceMaterialMaxId());
|
|
|
|
+ amsContaactPriceMaterial.setMaterialId(DataChange.dataToBigDecimal(map.get("materialId")));
|
|
|
|
+ amsContaactPriceMaterial.setPriceId(amsContractTransportPrice.getPriceId());
|
|
|
|
+ amsContaactPriceMaterial.setDeleted(new BigDecimal(0));
|
|
|
|
+ i = amsContaactPriceMaterialMapper.insertSelective(amsContaactPriceMaterial);
|
|
|
|
+ }
|
|
return i;
|
|
return i;
|
|
}
|
|
}
|
|
}
|
|
}
|