优化系统

This commit is contained in:
hoteas
2021-12-27 18:21:41 +08:00
parent 9ce4f1c603
commit a47473f245
8 changed files with 39 additions and 3575 deletions
+13 -6
View File
@@ -58,14 +58,21 @@ var product_spot_checkCtr = Ctr{
}
produceProduct := that.Db.Get("produce_product", "*", Map{"id": produceProductId})
if produceProduct == nil {
that.Display(4, "找不到成品记录,无法进行抽检")
return
}
//判断是否已经抽检了
alreadyCheck := that.Db.Get("product_spot_check", "id", Map{"produce_product_id": produceProductId})
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")})
if alreadyCheck == nil {
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")})
that.Db.Update("product", Map{"spot_check_count[#]": "spot_check_count+1"},
Map{"id": produceProduct.GetCeilInt("product_id")})
that.Db.Update("produce", Map{"spot_check_count[#]": "spot_check_count+1"},
Map{"id": produceProduct.GetCeilInt("produce_id")})
}
data := Map{
"sn": sn,