From 4758d6873110195be6df2840b20fc5c8ca85d240 Mon Sep 17 00:00:00 2001
From: zjh <2207896513@qq.com>
Date: 星期一, 12 五月 2025 10:14:04 +0800
Subject: [PATCH] 一致性代码提交
---
StandardPda/MES.Service/service/QC/LljService.cs | 577 ++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 423 insertions(+), 154 deletions(-)
diff --git a/StandardPda/MES.Service/service/QC/LljService.cs b/StandardPda/MES.Service/service/QC/LljService.cs
index 34826a8..2659e0b 100644
--- a/StandardPda/MES.Service/service/QC/LljService.cs
+++ b/StandardPda/MES.Service/service/QC/LljService.cs
@@ -1,28 +1,28 @@
-锘縰sing System.Data;
-using Masuit.Tools;
+锘縰sing Masuit.Tools;
using MES.Service.DB;
using MES.Service.Dto.service;
using MES.Service.Modes;
using MES.Service.util;
-using Microsoft.EntityFrameworkCore.Metadata.Internal;
+using MySqlConnector;
using Newtonsoft.Json;
+using SharpCompress.Factories;
using SqlSugar;
+using System.ComponentModel;
+using System.Data;
+using System.Xml.Linq;
+using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
using DbType = System.Data.DbType;
-using System.Net.Http;
-using System.Threading.Tasks;
-
namespace MES.Service.service.QC;
public class LljService
{
+ private static readonly HttpClient client = new();
+
public (List<LtsLlj> item, int TotalCount) GetPage(XJPageResult queryObj)
{
- if (queryObj.createUser.IsNullOrEmpty())
- {
- return ([], 0);
- }
+ if (queryObj.createUser.IsNullOrEmpty()) return ([], 0);
var db = SqlSugarHelper.GetInstance();
@@ -32,18 +32,21 @@
//var itemIds = GetQaItem(db, queryObj.createUser);
- var pageList = db.Queryable<LtsLlj, IqcBefore, VMesQaItemsDetect01, SysUser, IqcBeforeFrom, SysUser>((a, b,d,e,f,g) =>
+ var pageList = db
+ .Queryable<LtsLlj, IqcBefore, VMesQaItemsDetect01, SysUser,
+ IqcBeforeFrom, SysUser, InspectorChangeLog, SysUser>((a, b, d, e, f, g,h,i) =>
new JoinQueryInfos(JoinType.Left, a.ItemId == b.ItemId,
-
JoinType.Inner, a.Id == d.Id,
- JoinType.Left, a.CreateBy == e.Fcode,
- JoinType.Left,f.Id==b.PID,
- JoinType.Left, f.Sid == g.Fid
+ JoinType.Left, a.CreateBy == e.Fcode,
+ JoinType.Left, f.Id == b.PID,
+ JoinType.Left, f.Sid == g.Fid,
+ JoinType.Left,a.ReleaseNo==h.InspectionNo && h.IsValid=="Y",
+ JoinType.Left,i.Fcode==h.Inspector
))
.WhereIF(
StringUtil.IsNotNullOrEmpty(queryObj.result) &&
"鏈畬鎴�".Equals(queryObj.result),
- (a, b, d) => a.FcheckResu == null )
+ (a, b, d) => a.FcheckResu == null)
.WhereIF(
StringUtil.IsNotNullOrEmpty(queryObj.result) &&
!"鏈畬鎴�".Equals(queryObj.result),
@@ -51,26 +54,38 @@
//.WhereIF(
// itemIds is { Length: > 0 },
// (a, b, c) => itemIds.Contains(a.ItemId))
- .WhereIF(id > 0, (a, b, d) => a.Id == id )
- .WhereIF(true, (a, b,d, e,f,g) => (g.Fcode == queryObj.createUser || g.Fcode == null))
- //鍔犵瓫閫夋潯浠�,鏍规嵁渚涘簲鍟嗭紝鐗╂枡缂栫爜锛岀墿鏂欏悕绉版悳绱�
- //.WhereIF(queryObj.SearchValue!=null && queryObj.SearchValue!="", (a) => a.SuppName == queryObj.SearchValue|| a.ItemName == queryObj.SearchValue || a.ItemNo == queryObj.SearchValue )
- .WhereIF(queryObj.SearchValue != null && queryObj.SearchValue != "",
- (a) => (a.SuppName.ToLower().Contains(queryObj.SearchValue.ToLower())
- || a.ItemName.ToLower().Contains(queryObj.SearchValue.ToLower())
- || a.ItemNo.ToLower().Contains(queryObj.SearchValue.ToLower())))
- .OrderByDescending((a, b, d) => a.Id)
- .Select((a, b, d,e,f,g) => new LtsLlj
- {
- UserName = g.Fname,
- FIRST=d.First,
- CreateUserName=e.Fname,
- NewFngDesc=d.NewFngDesc
+ .WhereIF(id > 0, (a, b, d) => a.Id == id)
+ .WhereIF(queryObj.createUser!="PL017"&& queryObj.UserIndex=="0", (a, b, d, e, f, g,h, i) => (g.Fcode == queryObj.createUser || i.Fcode == queryObj.createUser))//鍒ゆ柇姝ゅ崟鐨勬楠屽憳锛屾垨鑰呮楠屼负绌哄氨鏄剧ず姝ゅ崟鎹�
+ //鍔犵瓫閫夋潯浠�,鏍规嵁渚涘簲鍟嗭紝鐗╂枡缂栫爜锛岀墿鏂欏悕绉帮紝椤圭洰鎼滅储
+ //.WhereIF(queryObj.SearchValue != null && queryObj.SearchValue != "",
+ //(a, b, d) => (a.SuppName.ToLower().Contains(queryObj.SearchValue.ToLower())
+ //|| a.ItemName.ToLower().Contains(queryObj.SearchValue.ToLower())
+ //|| a.ItemNo.ToLower().Contains(queryObj.SearchValue.ToLower())
+ //|| d.ProjectCodes.ToLower().Contains(queryObj.SearchValue.ToLower())
+ //))
+ //鏍规嵁涓嬫媺妗嗘悳绱㈡潯浠剁瓫閫夛紙0椤圭洰, 1鐗╂枡缂栧彿, 2鐗╂枡鍚嶇О, 3渚涘簲鍟�, 4閲囪喘鍛橈級
+ .WhereIF(queryObj.SelectedIndex == "0" && queryObj.SearchValue != null && queryObj.SearchValue != "", (a, b, d) => (d.ProjectCodes.ToLower().Contains(queryObj.SearchValue.ToLower())))
+ .WhereIF(queryObj.SelectedIndex == "1" && queryObj.SearchValue != null && queryObj.SearchValue != "", (a, b, d) => (a.ItemNo.ToLower().Contains(queryObj.SearchValue.ToLower())))
+ .WhereIF(queryObj.SelectedIndex == "2" && queryObj.SearchValue != null && queryObj.SearchValue != "", (a, b, d) => (a.ItemName.ToLower().Contains(queryObj.SearchValue.ToLower())))
+ .WhereIF(queryObj.SelectedIndex == "3" && queryObj.SearchValue != null && queryObj.SearchValue != "", (a, b, d) => (a.SuppName.ToLower().Contains(queryObj.SearchValue.ToLower())))
+ .WhereIF(queryObj.result== "宸插畬鎴�", (a, b, d, e) => (a.IqcDate>= queryObj.startDate.ToDateTime()&& a.IqcDate <= queryObj.endDate.ToDateTime().AddDays(1)))
+ .WhereIF(queryObj.result == "宸插畬鎴�" && queryObj.state!= "鎵�鏈夌姸鎬�",(a, b, d, e) => (a.FcheckResu == queryObj.state))
+ // .WhereIF(queryObj.result == "鏈畬鎴�" && queryObj.SearchValue != null && queryObj.SearchValue != "", (a, b, d, e) => (e.Fname.ToLower().Contains(queryObj.SearchValue.ToLower())))
+ //.OrderByDescending((a, b, d) => a.Id)
+ .Select((a, b, d, e, f, g,h,i) => new LtsLlj
+ {
+ //UserName = g.Fname,
+ //UserName = (i.Fname!=null ||i.Fname!="") ? i.Fname : g.Fname,
+ UserName = (i.Fname!=null ||i.Fname!="") ? i.Fname : g.Fname,
+ FIRST = d.First,
+ CreateUserName = e.Fname,
+ NewFngDesc = d.NewFngDesc,
+ ProjectCodes = d.ProjectCodes
}, true)
.ToPageList(queryObj.PageIndex, queryObj.Limit, ref totalCount);
-
+
return (pageList, totalCount);
}
@@ -99,98 +114,254 @@
//鏍规嵁妫�楠屾爣鍑嗘潵璁$畻妫�楠屼釜鏁�
- public List<MesQaItemsDetectDetail5> SetItems(string itemNo,
+ //public List<MesQaItemsDetectDetail5> SetItems(string itemNo,
+ // decimal quantity, string releaseNo)
+ //{
+ // var db = SqlSugarHelper.GetInstance();
+
+
+ // var count = db.Queryable<MesQaIqc>().Where(s => s.EE == 1 &&
+ // s.ISENABLED == 1
+ // && s.ItemNo == itemNo && s.FTYPE == "1").Count();
+
+ // 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;
+ //}
+
+
+ /// <summary>
+ /// 璋冪敤瀛樺偍杩囩▼锛岄噸鏂拌幏鍙栨楠岄」鐩�
+ /// </summary>
+ /// <param name="itemNo"></param>
+ /// <param name="quantity"></param>
+ /// <param name="releaseNo"></param>
+ /// <returns></returns>
+ public string[] SetItems(string 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),
+ outputResult,
+ outputMessage
+ };
+
var db = SqlSugarHelper.GetInstance();
+ // 浣跨敤 SqlSugar 鎵ц瀛樺偍杩囩▼
+ db.Ado.ExecuteCommand(
+ "BEGIN PRC_QA_ITEM_INSERT_BTN(:P_RELEASE_NO, :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 =>
- {
- string 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;
}
+
+
+
+ /// <summary>
+ /// 淇濆瓨鏂版楠屽憳
+ /// </summary>
+ /// <param name="NewStaffUserID">鏂版楠屽憳ID</param>
+ /// <param name="userID">淇敼浜�</param>
+ /// <param name="releaseNo">妫�楠屽崟鍙�</param>
+ /// <returns></returns>
+ public string[] SaveCheckBy(string NewStaffUserID, string userID, 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_FCHECK_BY", NewStaffUserID,
+ DbType.String, ParameterDirection.Input),
+ new("p_Release_No", releaseNo,
+ DbType.String, ParameterDirection.Input),
+ new("p_User", userID,
+ DbType.String, ParameterDirection.Input),
+
+ outputResult,
+ outputMessage
+ };
+
+ var db = SqlSugarHelper.GetInstance();
+
+ // 浣跨敤 SqlSugar 鎵ц瀛樺偍杩囩▼
+ db.Ado.ExecuteCommand(
+ "BEGIN Prc_Mes_Iqc_Qa_Update_CheckBy(:P_FCHECK_BY,:p_Release_No,:p_User, :o_Result, :o_Msg); END;",
+ parameters.ToArray());
+
+ // 鑾峰彇杈撳嚭鍙傛暟鐨勫��
+ var resultValue = outputResult.Value?.ToString();
+ var messageValue = outputMessage.Value?.ToString();
+ string[] msg = new string[2];
+ msg[0] = resultValue;
+ msg[1] = messageValue;
+ return msg;
+
+ }
+
+
+
+ public string[] SaveSysSubmit(SysSubmit sysSubmit)
+ {
+ // 瀹氫箟杈撳嚭鍙傛暟
+ 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("PI_BILLNO", sysSubmit.PI_BILLNO,
+ DbType.String, ParameterDirection.Input),
+ new("PI_USER", sysSubmit.PI_USER,
+ DbType.String, ParameterDirection.Input),
+ new("PI_SAMPLE_STATUS", sysSubmit.PI_SAMPLE_STATUS,
+ DbType.String, ParameterDirection.Input),
+ new("PI_SAMPLE_TYPE", sysSubmit.PI_SAMPLE_TYPE,
+ DbType.String, ParameterDirection.Input),
+ new("PI_SAMPLE_REASON", sysSubmit.PI_SAMPLE_REASON,
+ DbType.String, ParameterDirection.Input),
+ new("PI_INSPECT_TYPE", sysSubmit.PI_INSPECT_TYPE,
+ DbType.String, ParameterDirection.Input),
+ new("PI_SAMPLE_PREPARATION", sysSubmit.PI_SAMPLE_PREPARATION,
+ DbType.String, ParameterDirection.Input),
+ new("PI_URGENCY", sysSubmit.PI_URGENCY,
+ DbType.String, ParameterDirection.Input),
+ new("PI_FIRMWAREVERSION", sysSubmit.PI_FIRMWAREVERSION,
+ DbType.String, ParameterDirection.Input),
+ new("PI_HARDWAREVERSION", sysSubmit.PI_HARDWAREVERSION,
+ DbType.String, ParameterDirection.Input),
+ new("PI_REMARK", sysSubmit.PI_REMARK,
+ DbType.String, ParameterDirection.Input),
+ outputResult,
+ outputMessage
+ };
+
+ var db = SqlSugarHelper.GetInstance();
+
+ // 浣跨敤 SqlSugar 鎵ц瀛樺偍杩囩▼
+ db.Ado.ExecuteCommand(
+ "BEGIN PRC_MES_IQC_QC_SYSSUBMIT(:PI_BILLNO,:PI_USER,:PI_SAMPLE_STATUS,:PI_SAMPLE_TYPE,:PI_SAMPLE_REASON,:PI_INSPECT_TYPE,:PI_SAMPLE_PREPARATION,:PI_URGENCY,:PI_FIRMWAREVERSION,:PI_HARDWAREVERSION,:PI_REMARK, :o_Result, :o_Msg); END;",
+ parameters.ToArray());
+
+ // 鑾峰彇杈撳嚭鍙傛暟鐨勫��
+ var resultValue = outputResult.Value?.ToString();
+ var messageValue = outputMessage.Value?.ToString();
+ string[] msg = new string[2];
+ msg[0] = resultValue;
+ msg[1] = messageValue;
+ return msg;
+
+ }
private string ExtractSubstring(string input, char startChar, char endChar)
{
var startIndex = input.IndexOf(startChar);
@@ -266,6 +437,7 @@
new JoinQueryInfos(JoinType.Left, a.Id == b.MainId))
.Where((a, b) => a.ReleaseNo == releaseNo)
// .WhereIF(id > 0, (a, b) => a.Id == id)
+ .OrderByDescending((a, b) => a.FcheckItem)
.GroupBy((a, b) => new
{
a.Id,
@@ -302,9 +474,19 @@
Company = "1000",
FenterQty = SqlFunc.AggregateCount(b.Id),
FcheckResu = a.FcheckResu,
- FcheckItemDesc=a.FcheckItemDesc
+ FcheckItemDesc = a.FcheckItemDesc
}).ToList();
}
+
+
+
+ public DataTable getAllInspectors()
+ {
+ OracleSQLHelper SQLHelper = new();
+ var sql =string.Format(@"select a.USER_NAME label,U.FCODE value from IQC_BEFORE_FROM a JOIN SYS_USER U ON U.FID=A.SID");
+ return SQLHelper.ExecuteQuery(sql);
+ }
+
public int SetQSItemDetail(MesQaItemsDetectDetail12 detail)
{
@@ -509,6 +691,96 @@
return rkjDto;
}
+
+ public DataTable getFromInfo(string BarCode)
+ {
+ OracleSQLHelper SQLHelper = new();
+ var sql = string.Format(@"select b.ID,b.LOT_NO,b.RELEASE_NO,b.FSUBMIT from MES_INV_ITEM_BARCODES A
+ left join MES_QA_ITEMS_DETECT_01 B on A.BILL_NO=b.LOT_NO and A.ITEM_ID=b.ITEM_ID
+ where ITEM_BARCODE='"+ BarCode + "'");
+ return SQLHelper.ExecuteQuery(sql);
+ }
+ public DataTable getImgBDlist(string id)
+ {
+ OracleSQLHelper SQLHelper = new();
+ var sql = string.Format(@"select id,FID,IMAGE_DATA from MES_QS_IMAGE where FID="+id+"");
+ return SQLHelper.ExecuteQuery(sql);
+ }
+ /// <summary>
+ /// 涓�鑷存�ч」鐩�
+ /// </summary>
+ public class Component
+ {
+ public string Name { get; set; }
+ public List<string> Specs { get; set; }
+ public List<string> Manufacturers { get; set; }
+ public List<string> Id { get; set; }
+ public int SelectedSpec { get; set; }
+ public int SelectedMfg { get; set; }
+ }
+ public List<Component> getYzxBDlist(string id)
+ {
+ OracleSQLHelper SQLHelper = new();
+ //鏌ュ厓鍣ㄤ欢
+ var sql1 = string.Format(@"select ITEMNAME from MES_IQC_CONSISTENCY_ck where PID='"+id+"' group by ITEMNAME order by ITEMNAME");
+ //鏌ユ槑缁�
+ var sql2 = string.Format(@"select * from MES_IQC_CONSISTENCY_ck where PID='"+id+"' order by ITEMNAME,ITEMMODE,SUPPNAME");
+ DataTable dataTable1= SQLHelper.ExecuteQuery(sql1);
+ DataTable dataTable2 = SQLHelper.ExecuteQuery(sql2);
+ List<Component> Components = new List<Component>();
+
+
+
+ for (int i = 0; i <dataTable1.Rows.Count; i++)
+ {
+ Component component = new Component();
+ component.Name= dataTable1.Rows[i]["ITEMNAME"].ToString();
+ component.Specs= new List<string>();
+ component.Manufacturers = new List<string>();
+ component.Id = new List<string>();
+ component.SelectedSpec = -1;
+ component.SelectedMfg = -1;
+ int index = 0;
+ for (int j = 0; j < dataTable2.Rows.Count; j++)
+ {
+
+ if (dataTable2.Rows[j]["ITEMNAME"].ToString()== dataTable1.Rows[i]["ITEMNAME"].ToString())
+ {
+ component.Specs.Add(dataTable2.Rows[j]["ITEMMODE"].ToString());
+ component.Manufacturers.Add(dataTable2.Rows[j]["SUPPNAME"].ToString());
+ component.Id.Add(dataTable2.Rows[j]["ID"].ToString());
+ if (dataTable2.Rows[j]["ISCHACK"].ToString()=="1")
+ {
+ component.SelectedSpec = index;
+ component.SelectedMfg = index;
+ }
+ index++;
+ }
+ }
+
+ Components.Add(component);
+ }
+ return Components;
+ }
+ public void saveYzxBDlist(string id,DataTable DB)
+ {
+ OracleSQLHelper SQLHelper = new();
+ //鍏堟妸缁撴灉娓呯┖
+ var sql1 = string.Format(@"update MES_IQC_CONSISTENCY_ck set ISCHACK=0 where PID='"+ id + "' ");
+ SQLHelper.ExecuteQuery(sql1);
+ string rowId = "";
+ for (int i = 0; i < DB.Rows.Count; i++)
+ {
+ rowId += "'" + DB.Rows[i]["id"] + "',";
+ }
+ rowId = rowId.Substring(0, rowId.Length - 1);
+
+
+ //淇敼缁撴灉
+ var sql2 = string.Format(@"update MES_IQC_CONSISTENCY_ck set ISCHACK=1 where PID='" + id + "'and id in("+ rowId + ") ");
+ SQLHelper.ExecuteQuery(sql2);
+
+ }
public int UpdateQSItemDetail(MesQaItemsDetectDetail12 detail)
{
var withOracle = SqlSugarHelper.UseTransactionWithOracle(db =>
@@ -531,7 +803,7 @@
return withOracle;
}
-//鏇存柊妫�楠屾槑缁嗗凡妫�銆佷笉鍚堟牸鏁伴噺
+ //鏇存柊妫�楠屾槑缁嗗凡妫�銆佷笉鍚堟牸鏁伴噺
private int updateDetail5(MesQaItemsDetectDetail12 detail)
{
var db = SqlSugarHelper.GetInstance();
@@ -562,8 +834,8 @@
return SqlSugarHelper.UseTransactionWithOracle(db =>
{
return db.Updateable<MesQaItemsDetect01>()
- .SetColumns(it =>
- it.FngDesc == dto.Remarks) //SetColumns鏄彲浠ュ彔鍔犵殑 鍐�2涓氨2涓瓧娈佃祴鍊�
+ .SetColumns(it =>
+ it.FngDesc == dto.Remarks) //SetColumns鏄彲浠ュ彔鍔犵殑 鍐�2涓氨2涓瓧娈佃祴鍊�
.Where(it => it.ReleaseNo == dto.releaseNo)
.ExecuteCommand();
});
@@ -575,8 +847,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();
});
@@ -606,7 +878,7 @@
return withOracle;
}
- public bool IqcQaSubmit(LLJDto dto)
+ public string[] IqcQaSubmit(LLJDto dto)
{
var (factory, company) = UserUtil.GetFactory(dto.userNo);
try
@@ -645,61 +917,58 @@
// 鑾峰彇杈撳嚭鍙傛暟鐨勫��
var resultValue = outputResult.Value?.ToString();
var messageValue = outputMessage.Value?.ToString();
-
- if ("1".Equals(resultValue)) throw new Exception(messageValue);
-
- return true;
+ string[] msg = new string[2];
+ msg[0] = resultValue;
+ msg[1] = messageValue;
+ return msg;
+
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
+
/// <summary>
- /// 鏂欏彿鍥剧焊鎺ュ彛杩斿洖瀵硅薄
- /// </summary>
- public class ApiResponse
- {
- [JsonProperty("status")]
- public int Status { get; set; }
- [JsonProperty("message")]
- public string Message { get; set; }
- [JsonProperty("data")]
- public string[] Data { get; set; }
- [JsonProperty("totalCount")]
- public int TotalCount { get; set; }
- }
- private static readonly HttpClient client = new HttpClient();
- /// <summary>
- /// 浠嶶9鑾峰彇鏂欏彿鍥剧焊鍒楄〃
+ /// 浠嶶9鑾峰彇鏂欏彿鍥剧焊鍒楄〃
/// </summary>
/// <param name="Type">u9No锛歶9鐗╂枡缂栧彿</param>
/// <param name="U9No">type锛�1锛氬浘绾歌鏍间功 2锛氳繘鏂欐楠屾枃浠� </param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
- public async Task<string[]> GetFileUrlByU9List(string Type,string U9No)
+ public async Task<string[]> GetFileUrlByU9List(string Type, string U9No)
{
try
{
- var requestUrl = $"https://erp.dream-maker.com/api/public/getFileUrlByU9No?u9No={Uri.EscapeDataString(U9No)}&type={Type}";
+ var requestUrl =
+ $"https://erp.dream-maker.com/api/public/getFileUrlByU9No?u9No={Uri.EscapeDataString(U9No)}&type={Type}";
var response = await client.GetAsync(requestUrl);
response.EnsureSuccessStatusCode(); // 妫�鏌TTP鐘舵�佺爜
var responseContent = await response.Content.ReadAsStringAsync();
- var result = JsonConvert.DeserializeObject<ApiResponse>(responseContent);
+ var result =
+ JsonConvert.DeserializeObject<ApiResponse>(responseContent);
- if (result.Status == 0 && result.Data != null)
- {
- return result.Data;
- }
- else
- {
- return null;
- }
+ if (result.Status == 0 && result.Data != null) return result.Data;
+ return null;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
+
+ /// <summary>
+ /// 鏂欏彿鍥剧焊鎺ュ彛杩斿洖瀵硅薄
+ /// </summary>
+ public class ApiResponse
+ {
+ [JsonProperty("status")] public int Status { get; set; }
+
+ [JsonProperty("message")] public string Message { get; set; }
+
+ [JsonProperty("data")] public string[] Data { get; set; }
+
+ [JsonProperty("totalCount")] public int TotalCount { get; set; }
+ }
}
\ No newline at end of file
--
Gitblit v1.9.3