|
@@ -358,18 +358,12 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
|
|
|
BigDecimal type = DataChange.dataToBigDecimal(map.get("type"));
|
|
|
|
|
|
List<Map<String, Object>> PriceValueList = new ArrayList<>();
|
|
|
- PriceValueList = amsContractTruckPriceMapper.getPriceValueList(oilTypeId);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ if (type.compareTo(new BigDecimal(1)) == 0) {
|
|
|
+ PriceValueList = amsContractTruckPriceMapper.getPriceValueList(oilTypeId);
|
|
|
+ }else if(type.compareTo(new BigDecimal(2)) == 0) {
|
|
|
+ PriceValueList = amsContractTruckPriceMapper.getPriceValueListInward(oilTypeId);
|
|
|
+ }
|
|
|
for (Map<String, Object> stringObjectMap : PriceValueList) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
if (stringObjectMap.get("haulDistance")!=null) {
|
|
|
|
|
@@ -386,17 +380,17 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
|
|
|
BigDecimal distance = DataChange.dataToBigDecimal(stringObjectMap.get("haulDistance"));
|
|
|
if (zbDistance != null && distance != null && zbDistance.intValue()!=0 && distance.intValue()!=0){
|
|
|
BigDecimal subtract = zbDistance.subtract(distance);
|
|
|
- if (subtract.intValue()>10 || subtract.intValue()<-10){
|
|
|
-
|
|
|
-
|
|
|
- continue;
|
|
|
- }else{
|
|
|
-
|
|
|
-
|
|
|
- updatePrice.put("priceId",DataChange.dataToBigDecimal(stringObjectMap.get("priceId")));
|
|
|
- updatePrice.put("priceValue",DataChange.dataToBigDecimal(zb.get("priceValue")));
|
|
|
- return amsContractTruckPriceMapper.updateByPriceId(updatePrice);*/
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -415,10 +409,10 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
|
|
|
try{
|
|
|
if(newOilPrice.compareTo(oilpriceBase)==-1){
|
|
|
|
|
|
- i+=addANewAmsContractTransportPrice(stringObjectMap,n,newOilPrice);
|
|
|
+ i+=addANewAmsContractTransportPrice(stringObjectMap,n,newOilPrice,type);
|
|
|
}else if (newOilPrice.compareTo(oilpriceBase)==1 && "1".equals(flag)){
|
|
|
|
|
|
- i+=addANewAmsContractTransportPrice(stringObjectMap,n,newOilPrice);
|
|
|
+ i+=addANewAmsContractTransportPrice(stringObjectMap,n,newOilPrice,type);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
@@ -461,7 +455,7 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public int addANewAmsContractTransportPrice(Map<String, Object> stringObjectMap,BigDecimal n,BigDecimal newOilPrice) throws ParseException {
|
|
|
+ public int addANewAmsContractTransportPrice(Map<String, Object> stringObjectMap,BigDecimal n,BigDecimal newOilPrice,BigDecimal type) throws ParseException {
|
|
|
|
|
|
BigDecimal nowPriceValue;
|
|
|
|
|
@@ -478,6 +472,15 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
|
|
|
AmsContractTransportPrice amsContractTransportPrice = amsContractTruckPriceMapper.selectByPrimaryKey(priceId);
|
|
|
|
|
|
BigDecimal i = amsContractTruckPriceMapper.selectMaxId();
|
|
|
+
|
|
|
+ if(type.compareTo(new BigDecimal(2)) == 0){
|
|
|
+ List<Map<String, Object>> amsContractMaterialData = amsContractTruckPriceMapper.getAmsContractMaterialData(priceId);
|
|
|
+ for (Map<String, Object> amsContractMaterialDatum : amsContractMaterialData) {
|
|
|
+ amsContractMaterialDatum.put("i",i);
|
|
|
+ amsContractMaterialDatum.put("priceMaterialId",amsContractTruckPriceMapper.selectPriceMaterialMaxId());
|
|
|
+ amsContractTruckPriceMapper.insertIntoAmsContractForMaterial(amsContractMaterialDatum);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
amsContractTransportPrice.setPriceId(i);
|
|
|
|