出入库完成

This commit is contained in:
hoteas
2021-12-15 09:24:41 +08:00
parent ac66331535
commit 62cbf28b87
7 changed files with 307 additions and 32 deletions
+14 -12
View File
@@ -44,37 +44,39 @@ var product_spot_checkCtr = Ctr{
return
}
img := that.Req.FormValue("img")
rule := that.Req.FormValue("rule")
//img := that.Req.FormValue("img")
sn := that.Req.FormValue("sn")
rule := that.Req.FormValue("rule_spot_check")
description := that.Req.FormValue("description")
produceProductId := ObjToInt(that.Req.FormValue("produce_product_id"))
count := ObjToInt(that.Req.FormValue("count"))
//count := ObjToInt(that.Req.FormValue("count"))
state := ObjToInt(that.Req.FormValue("state"))
if rule == "" || produceProductId == 0 || count == 0 {
if rule == "" || produceProductId == 0 {
that.Display(3, "参数不足,请补充参数")
return
}
if state > 0 {
count = -count
}
produceProduct := that.Db.Get("produce_product", "*", Map{"id": produceProductId})
that.Db.Update("product", Map{"spot_check_count[#]": "spot_check_count+" + ObjToStr(count),
"spot_check_saved[#]": "spot_check_saved+" + ObjToStr(count)},
that.Db.Update("product", Map{"spot_check_count[#]": "spot_check_count+1",
"spot_check_saved[#]": "spot_check_saved+1"},
Map{"id": produceProduct.GetCeilInt("product_id")})
that.Db.Update("produce", Map{"spot_check_count[#]": "spot_check_count+" + ObjToStr(count),
"spot_check_saved[#]": "spot_check_saved+" + ObjToStr(count)},
that.Db.Update("produce", Map{"spot_check_count[#]": "spot_check_count+1",
"spot_check_saved[#]": "spot_check_saved+1"},
Map{"id": produceProduct.GetCeilInt("produce_id")})
data := Map{
"img": img,
"sn": sn,
"rule": rule,
"admin_id": adminID,
"create_time": time.Now().Unix(),
"modify_time": time.Now().Unix(),
"product_id": produceProduct.GetCeilInt("product_id"),
"produce_id": produceProduct.GetCeilInt("produce_id"),
"produce_product_id": produceProductId,
"description": description,
"state": state,
}