Commit 7bbe1167 authored by huyf's avatar huyf

提货箱数、提货率、提货状态回填

parent 82f89051
...@@ -17,6 +17,7 @@ alter table `ecw_order` ...@@ -17,6 +17,7 @@ alter table `ecw_order`
add column `pick_num` int DEFAULT 0 COMMENT '提货箱数'; add column `pick_num` int DEFAULT 0 COMMENT '提货箱数';
-- 批量刷新订单提货数量、提货率、提货状态 -- 批量刷新订单提货数量、提货率、提货状态
update ecw_order t LEFT JOIN (select a.order_id,sum(a.pick_num) as pickNum from ecw_order_pickup a where a.deleted=0 GROUP BY a.order_id) t1 on t.order_no=t1.order_id set t.pick_num=t1.pickNum,t.pick_ratio=ROUND(t1.pickNum/t.sum_num,2)*100,t.pick_state=(case when t1.pickNum is null then 0 when t1.pickNum=t.sum_num then 2 else 1 end);
update ecw_order t LEFT JOIN (select a.order_id,sum(a.pick_num) as pickNum from ecw_order_pickup a where a.deleted=0 GROUP BY a.order_id) t1 on t.order_no=t1.order_id set t.pick_num=t1.pickNum,t.pick_ratio=ROUND(t1.pickNum/t.sum_num,2)*100,t.pick_state=(case when t1.pickNum is null then 0 when t1.pickNum=t.sum_num then 3 else 2 end); update ecw_order t LEFT JOIN (select a.order_id,sum(a.pick_num) as pickNum from ecw_order_pickup a where a.deleted=0 GROUP BY a.order_id) t1 on t.order_no=t1.order_id set t.pick_num=t1.pickNum,t.pick_ratio=ROUND(t1.pickNum/t.sum_num,2)*100,t.pick_state=(case when t1.pickNum is null then 0 when t1.pickNum=t.sum_num then 3 else 2 end);
-- 已提货和部分提货的订单批量刷新订单主状态 -- 已提货和部分提货的订单批量刷新订单主状态
update ecw_order t set t.`status`=16 where t.`status` in (20,21); update ecw_order t set t.`status`=16 where t.`status` in (20,21);
\ No newline at end of file
...@@ -9,11 +9,9 @@ public enum PickStateEnum { ...@@ -9,11 +9,9 @@ public enum PickStateEnum {
unpick(0,"待提货"), unpick(0,"待提货"),
picking(1,"提货中"), partPick(1,"部分提货"),
partPick(2,"部分提货"), picked(2,"已提货");
picked(3,"已提货");
private Integer pickState; private Integer pickState;
......
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