From bc19a5eefa426702a94a68de99f7514225813bb2 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期六, 18 十月 2025 17:24:50 +0800
Subject: [PATCH] 更新工单Daa011为原值加上本次良品数量
---
Services/MesInvItemBarcodesManager.cs | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/Services/MesInvItemBarcodesManager.cs b/Services/MesInvItemBarcodesManager.cs
index 6b5e122..90d20c2 100644
--- a/Services/MesInvItemBarcodesManager.cs
+++ b/Services/MesInvItemBarcodesManager.cs
@@ -290,6 +290,8 @@
if (womdaa == null) throw new Exception("宸ュ崟鍗曞彿涓嶅瓨鍦�");
+ var okQty = query.currentCjNum - query.initCjNum - query.bf;//鑹搧鏁伴噺
+
// 鍒涘缓鎶ュ伐璁板綍
var mesReporting = new MesReporting
{
@@ -301,13 +303,20 @@
AddressCode = womdaa.AddressCode,
MachineNo = womdaa.MachineNo,
BfQty = query.bf,//涓嶈壇鏁伴噺
- OkQty = query.currentCjNum - query.initCjNum - query.bf,//鑹搧鏁伴噺
+ OkQty = okQty,//鑹搧鏁伴噺
CsQty = query.initCjNum,//鍒濆閲囬泦鏁�
- JtQty = query.currentCjNum,//鎶ュ伐鏃堕噰闆嗘暟
+ CjQty = query.currentCjNum,//鎶ュ伐鏃堕噰闆嗘暟
ItemNo = womdaa.Daa002,
BillNo = womdaa.Daa001,
BgPerson = query.staffNo // 鏂板锛氭姤宸ヤ汉缂栧彿
};
+
+ // 鏇存柊宸ュ崟Daa011涓哄師鍊煎姞涓婃湰娆¤壇鍝佹暟閲�
+ Db.Updateable<Womdaa>()
+ .SetColumns(x => x.Daa011 == (womdaa.Daa011 ?? 0) + (okQty ?? 0))
+ .Where(x => x.Daa001 == womdaa.Daa001)
+ .ExecuteCommand();
+
// 鎻掑叆鎶ュ伐璁板綍鍜屾潯鐮佽褰�
return Db.Insertable(mesReporting)
@@ -364,12 +373,12 @@
// 鏇存柊鎶ュ伐璁板綍
Db.Updateable<MesReporting>()
- .SetColumns(a => a.BlQty == BlQty.ToString())
+ .SetColumns(a => a.BlQty == BlQty)
.SetColumns(a => a.CsQty == (anchors.InitialValue ?? 0))
.SetColumns(a => a.JtQty == jt)
// .SetColumns(a => a.BfQty == bfQty)
- .SetColumns(a => a.CjQty == ljcj.ToString())
- .SetColumns(a => a.DyQty == DyQty.ToString())
+ .SetColumns(a => a.CjQty == ljcj)
+ .SetColumns(a => a.DyQty == DyQty)
.Where(a => a.ItemNoCade == mesReporting.ItemNoCade)
.ExecuteCommand();
}
--
Gitblit v1.9.3