From 707e8f07abb295629f73557759cf0e708ca6b5fa Mon Sep 17 00:00:00 2001
From: xwt <2740516069@qq.com>
Date: 星期五, 17 十月 2025 13:26:31 +0800
Subject: [PATCH] IQC破坏实验,IQC堵穴号
---
StandardInterface/MES.Service/service/QC/LljService.cs | 35 +++++++----------------------------
1 files changed, 7 insertions(+), 28 deletions(-)
diff --git a/StandardInterface/MES.Service/service/QC/LljService.cs b/StandardInterface/MES.Service/service/QC/LljService.cs
index a360c3c..6f77e61 100644
--- a/StandardInterface/MES.Service/service/QC/LljService.cs
+++ b/StandardInterface/MES.Service/service/QC/LljService.cs
@@ -1289,7 +1289,6 @@
BillNo = b.BillNo // 鍒拌揣鍗曞彿
})
.ToList();
-
// 绉婚櫎鍒拌揣鍗曞彿鏍¢獙锛岀洿鎺ヨ繑鍥炴煡璇㈢粨鏋�
return materialInfo;
}
@@ -1298,7 +1297,6 @@
throw new Exception($"鏌ヨ鐗╂枡淇℃伅澶辫触: {ex.Message}");
}
}
-
/// <summary>
/// 鏌ヨ鐮村潖瀹為獙璁板綍鏄惁瀛樺湪
/// </summary>
@@ -1313,7 +1311,7 @@
var count = db.Queryable<MesInvPhsy>()
.Where(x => x.BillNo == billNo && x.ReleaseNo == releaseNo)
.Count();
-
+
return count > 0;
}
catch (Exception ex)
@@ -1321,7 +1319,6 @@
throw new Exception($"鏌ヨ鐮村潖瀹為獙璁板綍澶辫触: {ex.Message}");
}
}
-
/// <summary>
/// 鑾峰彇鐮村潖瀹為獙璁板綍璇︾粏淇℃伅
/// </summary>
@@ -1337,22 +1334,20 @@
var phsyRecords = db.Queryable<MesInvPhsy>()
.Where(x => x.BillNo == billNo && x.ReleaseNo == releaseNo)
.ToList();
-
var result = new List<PhsyRecordInfoDto>();
-
+
foreach (var record in phsyRecords)
{
// 灏濊瘯閫氳繃鏉$爜鏌ヨ鐗╂枡淇℃伅
var materialInfo = db.Queryable<MesInvItemBarcodes>()
.LeftJoin<MesItems>((b, m) => b.ItemId == m.Id)
.Where((b, m) => b.ItemBarcode == record.ItemBarcode)
- .Select((b, m) => new {
+ .Select((b, m) => new {
ItemNo = b.ItemNo,
ItemName = m.ItemName,
ItemModel = m.ItemModel
})
.First();
-
var dto = new PhsyRecordInfoDto
{
ItemBarcode = record.ItemBarcode,
@@ -1364,10 +1359,10 @@
Cqty = record.Cqty,
CreateDate = record.CreateDate
};
-
+
result.Add(dto);
}
-
+
return result;
}
catch (Exception ex)
@@ -1375,7 +1370,6 @@
throw new Exception($"鑾峰彇鐮村潖瀹為獙璁板綍淇℃伅澶辫触: {ex.Message}");
}
}
-
/// <summary>
/// 璋冪敤鐮村潖瀹為獙瀛樺偍杩囩▼
/// </summary>
@@ -1400,19 +1394,16 @@
var inputParam5 = new SugarParameter("P_LX", lx, DbType.Int32, ParameterDirection.Input);
var inputParam6 = new SugarParameter("ITEM_ID", itemId ?? 0, DbType.Decimal, ParameterDirection.Input);
var inputParam7 = new SugarParameter("P_RELEASE_NO", releaseNo, DbType.String, ParameterDirection.Input);
-
+
// 瀹氫箟杈撳嚭鍙傛暟
var outputResult = new SugarParameter("PO_RESULT", null, DbType.Int32, ParameterDirection.Output);
var outputMessage = new SugarParameter("PO_MSG", null, DbType.String, ParameterDirection.Output, 4000);
-
// 浣跨敤SqlSugar鎵ц瀛樺偍杩囩▼
- db.Ado.ExecuteCommand("BEGIN PRC_INV_PHSYUPDATE(:P_ITEM_BARCODE, :P_YQTY, :P_CQTY, :P_BILL_NO, :P_LX, :ITEM_ID, :P_RELEASE_NO, :PO_RESULT, :PO_MSG); END;",
+ db.Ado.ExecuteCommand("BEGIN PRC_INV_PHSYUPDATE(:P_ITEM_BARCODE, :P_YQTY, :P_CQTY, :P_BILL_NO, :P_LX, :ITEM_ID, :P_RELEASE_NO, :PO_RESULT, :PO_MSG); END;",
inputParam1, inputParam2, inputParam3, inputParam4, inputParam5, inputParam6, inputParam7, outputResult, outputMessage);
-
// 鑾峰彇杈撳嚭鍙傛暟鐨勫��
var result = outputResult.Value == null ? 1 : Convert.ToInt32(outputResult.Value);
var message = outputMessage.Value?.ToString() ?? "";
-
return (result, message);
}
catch (Exception ex)
@@ -1420,7 +1411,6 @@
return (1, $"璋冪敤瀛樺偍杩囩▼澶辫触: {ex.Message}");
}
}
-
/// <summary>
/// 璁剧疆鍫电┐淇℃伅
/// </summary>
@@ -1439,30 +1429,25 @@
.Where(s => !string.IsNullOrEmpty(s))
.Select(s => int.Parse(s))
.ToList();
-
// 鑾峰彇妫�楠岄」鐩俊鎭�
var item = db.Queryable<MesQaItemsDetectDetail5>()
.Where(x => x.Id == itemId && x.ReleaseNo == releaseNo)
.First();
-
if (item == null)
{
return (1, "妫�楠岄」鐩笉瀛樺湪");
}
-
// 瑙f瀽寮�绌存暟
var holeCount = ParseHoleCount(item.FcheckItem);
if (holeCount == 0)
{
return (1, "璇ユ楠岄」鐩病鏈夌┐鏁颁俊鎭�");
}
-
// 楠岃瘉鍫电┐鏁伴噺涓嶈兘澶т簬绛変簬寮�绌存暟
if (blockedHolesList.Count >= holeCount)
{
return (1, $"鍫电┐鏁伴噺涓嶈兘澶т簬绛変簬寮�绌存暟锛坽holeCount}锛�");
}
-
// 楠岃瘉鍫电┐鍙锋槸鍚﹀湪鏈夋晥鑼冨洿鍐�
foreach (var hole in blockedHolesList)
{
@@ -1471,10 +1456,8 @@
return (1, $"鍫电┐鍙峰繀椤诲湪1-{holeCount}涔嬮棿");
}
}
-
// 璁$畻鏂扮殑妫�楠屾暟閲�
var newCheckQyt = item.CheckQyt - (item.CheckQyt / holeCount) * blockedHolesList.Count;
-
// 鏇存柊鏁版嵁搴�
var result = SqlSugarHelper.UseTransactionWithOracle(db =>
{
@@ -1484,7 +1467,6 @@
.Where(x => x.Id == itemId && x.ReleaseNo == releaseNo)
.ExecuteCommand();
});
-
if (result > 0)
{
return (0, "鍫电┐璁剧疆鎴愬姛");
@@ -1499,7 +1481,6 @@
return (1, $"璁剧疆鍫电┐澶辫触: {ex.Message}");
}
}
-
/// <summary>
/// 瑙f瀽妫�楠岄」鐩悕绉颁腑鐨勭┐鏁�
/// </summary>
@@ -1509,11 +1490,9 @@
{
if (string.IsNullOrEmpty(checkItemName))
return 0;
-
// 鍖归厤鏍煎紡锛氬昂瀵告鏌ワ紙5绌达級鎴� 灏哄妫�鏌�(5绌�)
var match = System.Text.RegularExpressions.Regex.Match(checkItemName, @"[锛�(](\d+)绌碵锛�)]");
return match.Success ? int.Parse(match.Groups[1].Value) : 0;
}
-
}
\ No newline at end of file
--
Gitblit v1.9.3