|
@@ -10,6 +10,7 @@ import com.steerinfo.dil.model.RmsLineNodePoint;
|
|
|
import com.steerinfo.dil.model.RmsReceivePlace;
|
|
|
import com.steerinfo.dil.service.IAmsContractTruckPriceService;
|
|
|
import com.steerinfo.dil.util.DataChange;
|
|
|
+import org.apache.commons.lang.math.NumberUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -206,6 +207,8 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public int batchUpdateTransportPriceByOilPrice(Map<String,Object> map) {
|
|
|
+
|
|
|
+ String flag= (String) map.get("flag");
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
@@ -223,7 +226,14 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
|
|
|
BigDecimal n = (newOilPrice.subtract(oilpriceBase)).divide(oilpriceBase,4,4);
|
|
|
|
|
|
if(n.abs().doubleValue()>oilpriceChangeThreshold.doubleValue()){
|
|
|
- i+=addANewAmsContractTransportPrice(stringObjectMap,n,newOilPrice);
|
|
|
+
|
|
|
+ if(newOilPrice.compareTo(oilpriceBase)==-1){
|
|
|
+
|
|
|
+ i+=addANewAmsContractTransportPrice(stringObjectMap,n,newOilPrice);
|
|
|
+ }else if (newOilPrice.compareTo(oilpriceBase)==1 && "1".equals(flag)){
|
|
|
+
|
|
|
+ i+=addANewAmsContractTransportPrice(stringObjectMap,n,newOilPrice);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return i;
|
|
@@ -322,7 +332,10 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
|
|
|
|
|
|
|
|
|
|
|
|
- BigDecimal formulaId = DataChange.dataToBigDecimal(stringObjectMap.get("cargonameId"));
|
|
|
+
|
|
|
+
|
|
|
+ String s= (String) stringObjectMap.get("cargonameId");
|
|
|
+ BigDecimal formulaId = NumberUtils.createBigDecimal(s.trim());
|
|
|
amsContractTransportPrice.setCargonameId(formulaId);
|
|
|
try {
|
|
|
nowPriceValue = UpdatePureBenzenePriceValueByOilPrice(n.toString(),amsContractTransportPrice.getPriceValue(),formulaId);
|