From fe7d837479da733dfb7b0e6ae0c814d59863dc87 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期五, 21 十一月 2025 16:11:23 +0800
Subject: [PATCH] 调机报工与生产报工
---
Services/MesInvItemBarcodesManager.cs | 53 +++++++++++++++++++++++++++++++++--------------------
1 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/Services/MesInvItemBarcodesManager.cs b/Services/MesInvItemBarcodesManager.cs
index 66f895b..b9b29e1 100644
--- a/Services/MesInvItemBarcodesManager.cs
+++ b/Services/MesInvItemBarcodesManager.cs
@@ -288,37 +288,50 @@
.Where(s => s.Daa001 == query.orderNo)
.First();
- if (womdaa == null) throw new Exception("宸ュ崟鍗曞彿涓嶅瓨鍦�");
+ if (womdaa.Daa018 != "寮�宸�" && query.type != "tiaoji") throw new Exception("宸ュ崟鏈紑宸�");
+ if (womdaa.Daa018 == "寮�宸�" && query.type == "tiaoji") throw new Exception("宸ュ崟宸插紑宸�");
- if (womdaa.Daa018 != "寮�宸�") throw new Exception("宸ュ崟鏈紑宸�");
+ if (womdaa == null) throw new Exception("宸ュ崟鍗曞彿涓嶅瓨鍦�");
var okQty = query.currentCjNum - query.initCjNum - query.bf;//鑹搧鏁伴噺
+ // 鍒ゆ柇鏄惁涓鸿皟鏈烘姤宸�
+ string remark = "";
+ if (query.type == "tiaoji")
+ remark = "璋冩満鎶ュ伐";
+ else
+ remark = "鐢熶骇鎶ュ伐";
+
// 鍒涘缓鎶ュ伐璁板綍
var mesReporting = new MesReporting
- {
- CheckType = 1,
- // ItemNoCade = itemBarCode,
- // CreateBy = strings[0],
- BgDate = DateTime.Now,
- // BgPerson = strings[0],
- AddressCode = womdaa.AddressCode,
- MachineNo = womdaa.MachineNo,
- BfQty = query.bf,//涓嶈壇鏁伴噺
- OkQty = okQty,//鑹搧鏁伴噺
- CsQty = query.initCjNum,//鍒濆閲囬泦鏁�
- CjQty = query.currentCjNum,//鎶ュ伐鏃堕噰闆嗘暟
- ItemNo = womdaa.Daa002,
- BillNo = womdaa.Daa001,
- BgPerson = query.staffNo // 鏂板锛氭姤宸ヤ汉缂栧彿
- };
+ {
+ CheckType = 1,
+ // ItemNoCade = itemBarCode,
+ // CreateBy = strings[0],
+ BgDate = DateTime.Now,
+ // BgPerson = strings[0],
+ AddressCode = womdaa.AddressCode,
+ MachineNo = womdaa.MachineNo,
+ BfQty = query.bf,//涓嶈壇鏁伴噺
+ OkQty = okQty,//鑹搧鏁伴噺
+ CsQty = query.initCjNum,//鍒濆閲囬泦鏁�
+ CjQty = query.currentCjNum,//鎶ュ伐鏃堕噰闆嗘暟
+ ItemNo = womdaa.Daa002,
+ BillNo = womdaa.Daa001,
+ BgPerson = query.staffNo,
+ Remark = remark // 鏂板锛氳皟鏈烘姤宸ユ椂鍐欏叆澶囨敞
+ };
- // 鏇存柊宸ュ崟Daa011涓哄師鍊煎姞涓婃湰娆¤壇鍝佹暟閲忥紝Daa012涓哄師鍊煎姞涓婃湰娆′笉鑹搧鏁伴噺
- Db.Updateable<Womdaa>()
+ //闈炶皟鏈烘姤宸ヨЕ鍙戞洿鏂板伐鍗曡壇鍝佸拰涓嶈壇鍝佹暟閲�
+ if (query.type != "tiaoji")
+ {
+ // 鏇存柊宸ュ崟Daa011涓哄師鍊煎姞涓婃湰娆¤壇鍝佹暟閲忥紝Daa012涓哄師鍊煎姞涓婃湰娆′笉鑹搧鏁伴噺
+ Db.Updateable<Womdaa>()
.SetColumns(x => x.Daa011 == (womdaa.Daa011 ?? 0) + (okQty ?? 0))
.SetColumns(x => x.Daa012 == (womdaa.Daa012 ?? 0) + (query.bf ?? 0))
.Where(x => x.Daa001 == womdaa.Daa001)
.ExecuteCommand();
+ }
// 鍒ゆ柇鏄惁鍏ㄩ儴瀹屽伐锛岃嫢鏄垯鍐欏叆瀹為檯瀹屽伐鏃ユ湡
var womdaaAfter = Db.Queryable<Womdaa>()
--
Gitblit v1.9.3