|
|
@@ -802,11 +802,19 @@ func OrderUpdateState(c *gin.Context) { |
|
|
|
for _, v1 := range flow { |
|
|
|
v1.SuccessNum += v.Num |
|
|
|
v1.WaitSortingNum -= v.Num |
|
|
|
v1.WaitBakingNum -= v.Num |
|
|
|
v1.WaitMakeNum -= v.Num |
|
|
|
if v1.WaitSortingNum < 0 { |
|
|
|
v1.WaitSortingNum = 0 |
|
|
|
} |
|
|
|
if v1.WaitMakeNum < 0 { |
|
|
|
v1.WaitMakeNum = 0 |
|
|
|
} |
|
|
|
if v1.WaitBakingNum < 0 { |
|
|
|
v1.WaitBakingNum = 0 |
|
|
|
} |
|
|
|
sess5 := sess |
|
|
|
_, err = sess5.Where("id=?", v1.Id).Cols("success_num,wait_sorting_num").Update(&v1) |
|
|
|
_, err = sess5.Where("id=?", v1.Id).AllCols().Update(&v1) |
|
|
|
if err != nil { |
|
|
|
sess.Rollback() |
|
|
|
e.OutErr(c, 400, e.NewErr(400, "操作失败")) |
|
|
|