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

修改Bug

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