|
@@ -43,6 +43,11 @@ func NewOrderSortingEnd(c *gin.Context) { |
|
|
//修改制作记录 |
|
|
//修改制作记录 |
|
|
for _, v := range args.OrderInfo { |
|
|
for _, v := range args.OrderInfo { |
|
|
record := db.GetOrderGoods(sess, v["oid"], args.Gid, args.SkuId) |
|
|
record := db.GetOrderGoods(sess, v["oid"], args.Gid, args.SkuId) |
|
|
|
|
|
if record.MakeDate > utils.StrToInt(time.Now().Format("20060102")) { |
|
|
|
|
|
sess.Rollback() |
|
|
|
|
|
e.OutErr(c, 400, e.NewErr(400, v["oid"]+",未到制作时间,请勿提交")) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
record.SuccessNum += utils.StrToInt(v["num"]) |
|
|
record.SuccessNum += utils.StrToInt(v["num"]) |
|
|
if record.SuccessNum >= record.Num { |
|
|
if record.SuccessNum >= record.Num { |
|
|
record.State = 4 |
|
|
record.State = 4 |
|
@@ -111,6 +116,11 @@ func commNewMake(c *gin.Context, args map[string]string) { |
|
|
e.OutErr(c, 400, e.NewErr(400, "订单查找失败,请重试")) |
|
|
e.OutErr(c, 400, e.NewErr(400, "订单查找失败,请重试")) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
if orderGoods.MakeDate > utils.StrToInt(time.Now().Format("20060102")) { |
|
|
|
|
|
sess.Rollback() |
|
|
|
|
|
e.OutErr(c, 400, e.NewErr(400, "该订单未到制作时间,请勿提交")) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
WaitMakeNum := orderGoods.WaitMakeNum |
|
|
WaitMakeNum := orderGoods.WaitMakeNum |
|
|
if state == 2 { //制作完成 |
|
|
if state == 2 { //制作完成 |
|
|
if utils.StrToInt(args["num"]) > orderGoods.WaitMakeNum { |
|
|
if utils.StrToInt(args["num"]) > orderGoods.WaitMakeNum { |
|
|