提交 7a6a2111 authored 作者: huyufan's avatar huyufan

Merge remote-tracking branch 'origin/v12.2_upgradeFunction_20240424' into test

...@@ -275,17 +275,21 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea ...@@ -275,17 +275,21 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea
List<OrderGoods> orderGoodsList = null; List<OrderGoods> orderGoodsList = null;
BigDecimal orderGoodsResidueWeight = BigDecimal.ZERO; BigDecimal orderGoodsResidueWeight = BigDecimal.ZERO;
String residueWeight = orderInfoFeign.getResidueWeight(); String residueWeight = orderInfoFeign.getResidueWeight();
BigDecimal ans = new BigDecimal(residueWeight);
switch (optionType) { switch (optionType) {
case "1": case "1":
return new BigDecimal(residueWeight); return ans;
case "2": case "2":
orderGoodsList = orderGoodsDao.getOrderGoodsListByOrderNoAndStatus(orderNo); orderGoodsList = orderGoodsDao.getOrderGoodsListByOrderNoAndStatus(orderNo);
if (CollectionUtil.isNotEmpty(orderGoodsList)) { if (CollectionUtil.isNotEmpty(orderGoodsList)) {
orderGoodsResidueWeight = orderGoodsList.stream().map(OrderGoods::getResidueTransportWeight).reduce(BigDecimal.ZERO, BigDecimal::add); orderGoodsResidueWeight = orderGoodsList.stream().map(OrderGoods::getResidueTransportWeight).reduce(BigDecimal.ZERO, BigDecimal::add);
} }
return orderGoodsResidueWeight.add(new BigDecimal(residueWeight)); ans = orderGoodsResidueWeight.add(new BigDecimal(residueWeight));
if (ans.compareTo(new BigDecimal("35")) <= 0) {
return BigDecimal.ZERO;
} else {
return ans.subtract(new BigDecimal("35"));
}
case "3": case "3":
List<OrderChild> orderChildList = orderChildDao.selectResidueWeight(orderNo, OrderChildEnum.Status.ARRIVE_SEND.getCode()); List<OrderChild> orderChildList = orderChildDao.selectResidueWeight(orderNo, OrderChildEnum.Status.ARRIVE_SEND.getCode());
BigDecimal childResidueWeight = BigDecimal.ZERO; BigDecimal childResidueWeight = BigDecimal.ZERO;
...@@ -297,12 +301,15 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea ...@@ -297,12 +301,15 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea
if (CollectionUtil.isNotEmpty(orderGoodsList)) { if (CollectionUtil.isNotEmpty(orderGoodsList)) {
orderGoodsResidueWeight = orderGoodsList.stream().map(OrderGoods::getResidueTransportWeight).reduce(BigDecimal.ZERO, BigDecimal::add); orderGoodsResidueWeight = orderGoodsList.stream().map(OrderGoods::getResidueTransportWeight).reduce(BigDecimal.ZERO, BigDecimal::add);
} }
return new BigDecimal(residueWeight).add(orderGoodsResidueWeight).add(childResidueWeight); ans = ans.add(orderGoodsResidueWeight).add(childResidueWeight);
if (ans.compareTo(new BigDecimal("35")) <= 0) {
return BigDecimal.ZERO;
} else {
return ans.subtract(new BigDecimal("35"));
}
default:throw new RuntimeException("参数错误"); default:throw new RuntimeException("参数错误");
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论