提交 fe50fe05 authored 作者: huyufan's avatar huyufan

修改Bug

上级 ff0ecd5f
...@@ -229,25 +229,37 @@ public class OrderGoodsServiceImpl implements OrderGoodsService { ...@@ -229,25 +229,37 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
@Override @Override
public BigDecimal orderCancelResidueWeight(String orderNo, String optionType) { public BigDecimal orderCancelResidueWeight(String orderNo, String optionType) {
FeignOrderVO orderInfoFeign = orderFeign.getOrderInfoFeign(orderNo); FeignOrderVO orderInfoFeign = orderFeign.getOrderInfoFeign(orderNo);
List<OrderGoods> orderGoodsList = null;
BigDecimal orderGoodsResidueWeight = BigDecimal.ZERO;
switch (optionType) {
case "1":
return new BigDecimal(orderInfoFeign.getResidueWeight());
case "2":
orderGoodsList = orderGoodsDao.getOrderGoodsListByOrderNo(orderNo);
if (CollectionUtil.isNotEmpty(orderGoodsList)) {
orderGoodsResidueWeight = orderGoodsList.stream().map(OrderGoods::getResidueTransportWeight).reduce(BigDecimal.ZERO, BigDecimal::add);
}
return orderGoodsResidueWeight;
if (StringUtils.equals(optionType, "1")) { case "3":
return new BigDecimal(orderInfoFeign.getResidueWeight()); String residueWeight = orderInfoFeign.getResidueWeight();
} else { List<OrderChild> orderChildList = orderChildDao.selectResidueWeight(orderNo, OrderChildEnum.Status.ARRIVE_SEND.getCode());
String residueWeight = orderInfoFeign.getResidueWeight(); BigDecimal childResidueWeight = BigDecimal.ZERO;
List<OrderChild> orderChildList = orderChildDao.selectResidueWeight(orderNo, OrderChildEnum.Status.ARRIVE_SEND.getCode()); if (CollectionUtils.isNotEmpty(orderChildList)) {
BigDecimal childResidueWeight = BigDecimal.ZERO; childResidueWeight = orderChildList.stream().map(OrderChild::getWeight).reduce(BigDecimal.ZERO, BigDecimal::add);
if (CollectionUtils.isNotEmpty(orderChildList)) {
childResidueWeight = orderChildList.stream().map(OrderChild::getWeight).reduce(BigDecimal.ZERO, BigDecimal::add);
} }
BigDecimal orderGoodsResidueWeight = BigDecimal.ZERO; orderGoodsList = orderGoodsDao.getOrderGoodsListByOrderNo(orderNo);
List<OrderGoods> orderGoodsList = orderGoodsDao.getOrderGoodsListByOrderNo(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 new BigDecimal(residueWeight).add(orderGoodsResidueWeight).add(childResidueWeight);
return new BigDecimal(residueWeight).add(orderGoodsResidueWeight).add(childResidueWeight);
default:throw new RuntimeException("参数错误");
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论