瀏覽代碼

1ipad端

master
huangjiajun 7 月之前
父節點
當前提交
44f43400bb
共有 1 個檔案被更改,包括 15 行新增0 行删除
  1. +15
    -0
      app/ipad/svc/svc_order_make.go

+ 15
- 0
app/ipad/svc/svc_order_make.go 查看文件

@@ -223,6 +223,11 @@ func NewOrderSortingEnd(c *gin.Context) {
return
}
makeRecord := db.GetOrderGoodsMakeStock(sess, utils.StrToInt64(args.Gid), utils.StrToInt64(args.SkuId))
if utils.StrToInt(v["num"]) > makeRecord.WaitSortingNum {
sess.Rollback()
e.OutErr(c, 400, e.NewErr(400, record.GoodsTitle+",数量只能提交"+utils.IntToStr(makeRecord.WaitSortingNum)+"个"))
return
}
makeRecord.WaitSortingNum -= utils.StrToInt(v["num"])
makeRecord.SuccessNum += utils.StrToInt(v["num"])
_, err = sess.Where("id=?", makeRecord.Id).Cols("success_num,wait_sorting_num").Update(makeRecord)
@@ -273,6 +278,11 @@ func commNewMake(c *gin.Context, args map[string]string) {

WaitMakeNum := orderGoods.WaitMakeNum
if state == 2 { //制作完成
if utils.StrToInt(args["num"]) > orderGoods.WaitMakeNum {
sess.Rollback()
e.OutErr(c, 400, e.NewErr(400, "数量只能提交"+utils.IntToStr(orderGoods.WaitMakeNum)+"个"))
return
}
orderGoods.WaitMakeNum -= utils.StrToInt(args["num"])
orderGoods.WaitBakingNum += utils.StrToInt(args["num"])
if orderGoods.WaitMakeNum < 0 {
@@ -280,6 +290,11 @@ func commNewMake(c *gin.Context, args map[string]string) {
}
}
if state == 3 { //烘焙完成
if utils.StrToInt(args["num"]) > orderGoods.WaitBakingNum {
sess.Rollback()
e.OutErr(c, 400, e.NewErr(400, "数量只能提交"+utils.IntToStr(orderGoods.WaitBakingNum)+"个"))
return
}
WaitMakeNum = orderGoods.WaitBakingNum
orderGoods.WaitBakingNum -= utils.StrToInt(args["num"])
orderGoods.WaitSortingNum += utils.StrToInt(args["num"])


Loading…
取消
儲存