Commit 129de5c0 authored by zhengyi's avatar zhengyi

放货空指针异常修复

parent a1d44d78
......@@ -18,4 +18,4 @@ alter table `ecw_order`
-- 批量刷新订单放货数量、放货率
update ecw_order t LEFT JOIN (select ccp.order_id , ifnull(sum(ccp.pick_num),0) as releaseNum from ecw_order_cargo_control_pick ccp where
ccp.status in(1,2,3,4,5,6) group by ccp.order_id) t1 on t.order_id=t1.order_id set t.release_num=t1.releaseNum, t.release_ratio=ROUND(t1.releaseNum/t.sum_num,2)*100;
\ No newline at end of file
ccp.status in(1,2,3,4,5,6) group by ccp.order_id) t1 on t.order_id=t1.order_id set t.release_num=IFNULL(t1.releaseNum,0), t.release_ratio=IFNULL(ROUND(t1.releaseNum/t.sum_num,2)*100, 0);
\ No newline at end of file
......@@ -320,8 +320,11 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
orderCargoControlPick.getConsigneeName() + "/" + (StringUtils.isNotBlank(orderCargoControlPick.getConsigneeNameEn()) ? orderCargoControlPick.getConsigneeNameEn() : "空"),
orderCargoControlPick.getConsigneeCountryCode() + orderCargoControlPick.getConsigneePhone());
}
if (Objects.isNull(orderDO.getReleaseNum())) orderDO.setReleaseNum(0);
orderDO.setReleaseNum(orderDO.getReleaseNum() + orderCargoControlPick.getPickNum());
orderDO.setReleaseRatio(new BigDecimal(orderDO.getReleaseNum()).divide(new BigDecimal(orderDO.getSumNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")));
if (Objects.nonNull(orderDO.getSumNum()) && orderDO.getSumNum() > 0) {
orderDO.setReleaseRatio(new BigDecimal(orderDO.getReleaseNum()).divide(new BigDecimal(orderDO.getSumNum()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")));
}
orderService.updateById(orderDO);
// 订单控货信息日志补充
orderBusinessService.createOrderControlLog(orderCargoControlPick.getOrderId(), 4, "订单放货", msg, 0L);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment