From 5159c3dc64fc7a783384b1c13da01f338340e5dd Mon Sep 17 00:00:00 2001
From: xwt <2740516069@qq.com>
Date: 星期五, 16 五月 2025 15:58:02 +0800
Subject: [PATCH] bug修改
---
StandardInterface/MES.Service/service/QC/LljService.cs | 136 +++++++++++++++-----------------------------
1 files changed, 47 insertions(+), 89 deletions(-)
diff --git a/StandardInterface/MES.Service/service/QC/LljService.cs b/StandardInterface/MES.Service/service/QC/LljService.cs
index f1f2206..713ea9e 100644
--- a/StandardInterface/MES.Service/service/QC/LljService.cs
+++ b/StandardInterface/MES.Service/service/QC/LljService.cs
@@ -43,7 +43,11 @@
|| a.ItemName.ToLower()
.Contains(queryObj.SearchValue.ToLower())
|| a.ItemNo.ToLower()
- .Contains(queryObj.SearchValue.ToLower()))
+ .Contains(queryObj.SearchValue.ToLower())
+ || a.LotNo.ToLower()
+ .Contains(queryObj.SearchValue.ToLower())
+ || a.ReleaseNo.ToLower()
+ .Contains(queryObj.SearchValue.ToLower()))
.OrderByDescending(a => a.Id)
.ToPageList(queryObj.PageIndex, queryObj.Limit, ref totalCount);
@@ -52,96 +56,49 @@
}
//鏍规嵁妫�楠屾爣鍑嗘潵璁$畻妫�楠屼釜鏁�
- public List<MesQaItemsDetectDetail5> SetItems(string itemNo,
- decimal quantity, string releaseNo)
+ /// <summary>
+ /// 璋冪敤瀛樺偍杩囩▼锛岄噸鏂拌幏鍙栨楠岄」鐩�
+ /// </summary>
+ /// <param name="itemNo"></param>
+ /// <param name="quantity"></param>
+ /// <param name="releaseNo"></param>
+ /// <returns></returns>
+ public string[] SetItems(decimal itemNo, decimal quantity, string releaseNo)
{
+
+ // 瀹氫箟杈撳嚭鍙傛暟
+ var outputResult = new SugarParameter("o_Result", null,
+ DbType.Int32, ParameterDirection.Output,
+ 4000);
+
+ var outputMessage = new SugarParameter("o_Msg", null,
+ DbType.String,
+ ParameterDirection.Output, 4000);
+
+ // 瀹氫箟杈撳叆鍙傛暟
+ var parameters = new List<SugarParameter>
+ {
+ new("P_RELEASE_NO", releaseNo, DbType.String, ParameterDirection.Input),
+ new("P_ITEM_ID", itemNo, DbType.String, ParameterDirection.Input),
+ outputResult,
+ outputMessage
+ };
+
var db = SqlSugarHelper.GetInstance();
+ // 浣跨敤 SqlSugar 鎵ц瀛樺偍杩囩▼
+ db.Ado.ExecuteCommand(
+ "BEGIN PRC_QA_ITEM_INSERT_BTN(:P_RELEASE_NO,:P_ITEM_ID, :o_Result, :o_Msg); END;",
+ parameters.ToArray());
- var count = db.Queryable<MesQaIqc>().Where(s => s.EE == 1 &&
- s.ISENABLED == 1
- && s.ItemNo == itemNo && s.FTYPE == "1").Count();
+ // 鑾峰彇杈撳嚭鍙傛暟鐨勫��
+ var resultValue = outputResult.Value?.ToString();
+ var messageValue = outputMessage.Value?.ToString();
+ string[] msg = new string[2];
+ msg[0] = resultValue;
+ msg[1] = messageValue;
+ return msg;
- if (count <= 0) return [];
-
- var mesQaIqcItem = db
- .Queryable<MesQaIqc>().Where(s => s.EE == 1 && s.ISENABLED == 1
- && s.ItemNo == itemNo && s.FTYPE == "1").Select(
- b => new MesQaItemsDetectDetail5
- {
- ReleaseNo = releaseNo,
- FacLevel = b.FacLevel,
- FcheckItem = b.FcheckItem,
- FdownAllow = b.FdownAllow,
- FcheckLevel = b.FREQUENCY,
- Fstand = b.FSTAND,
- FupAllow = b.FupAllow,
- SampleSizeNo = b.SampleSizeNo,
- FenterQty = 0,
- Factory = "1000",
- Company = "1000",
-
-
- // FcheckItemDesc = "0",
- // FcheckResu = "0",
- FcheckTool = b.FcheckTool,
- FspecRequ = b.FspecRequ
- // FtextType = "0",
- // Funit = "0",
- // LastupdateBy = "0",
- // ProcNo = "0",
- // WorkshopCenterCode = "0"
- }).ToList();
-
- mesQaIqcItem.ForEach(item =>
- {
- var LEV = item.FcheckLevel switch
- {
- null => "" // 榛樿鍊�
- ,
- { } s when s.Contains("S1") => "B.FLEVEL_S1",
- { } s when s.Contains("S2") => "B.FLEVEL_S2",
- { } s when s.Contains("S3") => "B.FLEVEL_S3",
- { } s when s.Contains("S4") => "B.FLEVEL_S4",
- { } s when s.Contains("(I)") => "B.FLEVEL_I",
- { } s when s.Contains("(II)") => "B.FLEVEL_II",
- { } s when s.Contains("(III)") => "B.FLEVEL_III",
- _ => ""
- };
-
- if (string.IsNullOrEmpty(LEV))
- throw new Exception(item.SampleSizeNo + "鐨勬楠屾按骞充笉姝g‘");
-
- var sql =
- "SELECT " + LEV +
- " FROM MES_QM_AQL1 A LEFT JOIN MES_QM_AQL2 B ON B.AQL1_ID=A.ID WHERE A.SAMPLE_SIZE_NO='" +
- item.SampleSizeNo + "' AND B.LOT_FROM<= " + quantity +
- " AND " +
- quantity + "<=B.LOT_TO";
-
- var maxBillNo = db.Ado.SqlQuerySingle<string>(sql);
-
- if (string.IsNullOrEmpty(maxBillNo))
- throw new Exception(item.SampleSizeNo + "涓嬬殑" + quantity +
- "杩欎釜鑼冨洿涓嬫病鏈夊尮閰嶅埌妫�楠岄」鐩�");
-
- var result = ExtractSubstring(item.FacLevel, '(', ')');
-
- if (string.IsNullOrEmpty(result))
- throw new Exception(item.SampleSizeNo + "涓嬬殑" + quantity +
- "鎷掓敹姘村钩涓嶆纭�");
-
- sql = "SELECT FSAMPLE_SIZE_WORD, " + result +
- " Result FROM MES_QM_AQL1 A LEFT JOIN MES_QM_AQL3 C ON C.AQL1_ID=A.ID WHERE A.SAMPLE_SIZE_NO= '" +
- item.SampleSizeNo + "' AND SAMPLE_SIZE_WORD= '" + maxBillNo +
- "'";
- var resultClass = db.Ado.SqlQuerySingle<ResultClass>(sql);
-
- item.CheckQyt = resultClass.FSAMPLE_SIZE_WORD;
- item.FreQty = resultClass.Result;
- });
-
- return mesQaIqcItem;
}
private string ExtractSubstring(string input, char startChar, char endChar)
@@ -255,7 +212,8 @@
Company = "1000",
FenterQty = SqlFunc.AggregateCount(b.Id),
FcheckResu = a.FcheckResu,
- FcheckItemDesc = a.FcheckItemDesc
+ // FcheckItemDesc = a.FcheckItemDesc
+ FcheckItemDesc = a.FspecRequ
}).ToList();
}
@@ -528,8 +486,8 @@
return SqlSugarHelper.UseTransactionWithOracle(db =>
{
return db.Updateable<MesQaItemsDetectDetail5>()
- // .SetColumns(it =>
- // it.Remarks == dto.Remarks) //SetColumns鏄彲浠ュ彔鍔犵殑 鍐�2涓氨2涓瓧娈佃祴鍊�
+ .SetColumns(it =>
+ it.Funit == dto.Remarks) //SetColumns鏄彲浠ュ彔鍔犵殑 鍐�2涓氨2涓瓧娈佃祴鍊�
.Where(it => it.Id == dto.pid)
.ExecuteCommand();
});
--
Gitblit v1.9.3