|
@@ -568,7 +568,13 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer
|
|
|
BmstruckDetailsOrder bmstruckDetailsOrder = new BmstruckDetailsOrder();
|
|
|
if(orderType.intValue() == 11 || orderType.intValue() == 20 || orderType.intValue() == 10){
|
|
|
BigDecimal weightTaskResultId = DataChange.dataToBigDecimal(map.get("weightTaskResultId"));
|
|
|
- BigDecimal netWeight = DataChange.dataToBigDecimal(map.get("netWeight"));
|
|
|
+ BigDecimal netWeight = null;
|
|
|
+ if(mapVal.get("netWeight") != null) {
|
|
|
+ netWeight = DataChange.dataToBigDecimal(mapVal.get("netWeight"));
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ netWeight = DataChange.dataToBigDecimal(map.get("netWeight"));
|
|
|
+ }
|
|
|
BigDecimal detailsAmount = new BigDecimal(priceValue.doubleValue()*netWeight.doubleValue());
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
String format = df.format(detailsAmount);
|
|
@@ -616,4 +622,24 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer
|
|
|
System.out.println(new BigDecimal(df.format(300.959999999999979536369210109114646911)));
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public int updateDetails() {
|
|
|
+ List<Map<String,Object>>mapList = bmstruckDetailsOrderMapper.selectDetailsNoAmount();
|
|
|
+ int i=0;
|
|
|
+ for (Map<String,Object>map:mapList
|
|
|
+ ) {
|
|
|
+ //获取详单ID、价格值,净重
|
|
|
+ BigDecimal detailsId = DataChange.dataToBigDecimal(map.get("detailsId"));
|
|
|
+ BigDecimal netWeight = DataChange.dataToBigDecimal(map.get("netWeight"));
|
|
|
+ BigDecimal priceValue = DataChange.dataToBigDecimal(map.get("priceValue"));
|
|
|
+ BmstruckDetailsOrder bmstruckDetailsOrder = new BmstruckDetailsOrder();
|
|
|
+ bmstruckDetailsOrder.setDetailsId(detailsId);
|
|
|
+ BigDecimal detailsAmount = new BigDecimal(priceValue.doubleValue()*netWeight.doubleValue());
|
|
|
+ DecimalFormat df = new DecimalFormat("0.00");
|
|
|
+ String format = df.format(detailsAmount);
|
|
|
+ bmstruckDetailsOrder.setDetailsAmount(new BigDecimal(format));
|
|
|
+ i += bmstruckDetailsOrderMapper.updateByPrimaryKeySelective(bmstruckDetailsOrder);
|
|
|
+ }
|
|
|
+ return i;
|
|
|
+ }
|
|
|
}
|