From 135599eb59bccb5f8f8a567ad174cc2af4357887 Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期五, 13 六月 2025 14:39:25 +0800
Subject: [PATCH] 1.采购退货单优化 2.采购退料单拆分 3.采购入库优化
---
service/Wom/MesWorkProdManager.cs | 28 +++++++++++++++++++---------
1 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/service/Wom/MesWorkProdManager.cs b/service/Wom/MesWorkProdManager.cs
index 75aa089..07d18e1 100644
--- a/service/Wom/MesWorkProdManager.cs
+++ b/service/Wom/MesWorkProdManager.cs
@@ -84,7 +84,7 @@
var exists = Db.Queryable<MesWorkProd, MesWorkProdCDetails>(
(a, b) =>
new JoinQueryInfos(JoinType.Inner,
- a.BillNo == b.BillNo))
+ a.Id == b.MesWorkProdId))
.Where((a, b) => b.ItemBarcode == request.ItemBarcode
&& a.BillTypeId == billTypeId
&& a.TransactionNo == transactionNo)
@@ -133,8 +133,8 @@
db.Updateable<MesInvItemBarcodes>()
.SetColumns(x => new MesInvItemBarcodes
{
- WorkFlg = true,
- Quantity = reportQty
+ WorkFlg = true
+ //Quantity = reportQty
})
.Where(x => x.Guid == barcode.Guid)
.ExecuteCommand();
@@ -147,13 +147,15 @@
DateTime.Now.Date.ToString("yyyy-MM-dd")
&& x.BillTypeId == billTypeId
&& x.TransactionNo == transactionNo
- && x.Status == 0)
+ && x.ReportBy == request.StaffNo)
.First();
+ var id = Guid.Empty;
+ var billNo = "";
if (workProd == null)
{
- var id = Guid.NewGuid();
- var billNo = BillNo.GetBillNo("BG(鎶ュ伐缂栧彿)");
+ id = Guid.NewGuid();
+ billNo = BillNo.GetBillNo("BG(鎶ュ伐)");
workProd = new MesWorkProd
{
@@ -168,11 +170,18 @@
LastupdateDate = DateTime.Now,
BillTypeId = billTypeId,
TransactionNo = transactionNo,
- TaskNo = barcode.BillNo
+ TaskNo = barcode.BillNo,
+ ReportBy = request.StaffNo,
+ ReportDate = DateTime.Now
};
db.Insertable(workProd).IgnoreColumns(true)
.ExecuteCommand();
+ }
+ else
+ {
+ id = workProd.Id;
+ billNo = workProd.BillNo;
}
// 12. 鎻掑叆鎶ュ伐鏄庣粏
@@ -180,7 +189,8 @@
db.Insertable(new MesWorkProdCDetails
{
Id = detailId,
- BillNo = workProd.BillNo,
+ MesWorkProdId = id,
+ BillNo = billNo,
ItemBarcode = request.ItemBarcode,
Quantity = (int)reportQty,
Company = barcode.Company,
@@ -194,7 +204,7 @@
SilkPqty = barcode.SilkPqty,
SilkId = barcode.SilkId,
Silk = barcode.Silk,
- BgYg = staff.Id
+ BgYg = request.StaffNo
}).IgnoreColumns(true).ExecuteCommand();
// 13. 鏇存柊宸ュ崟宸叉姤宸ユ暟閲�
--
Gitblit v1.9.3