From cf5e996699836cc380b1cb469fea341475eb2b81 Mon Sep 17 00:00:00 2001 From: zjh <2207896513@qq.com> Date: 星期一, 30 六月 2025 15:11:41 +0800 Subject: [PATCH] 代码提交 --- StandardPda/MESApplication/Controllers/QC/LljController.cs | 16 +++++++++++++--- StandardPda/MES.Service/service/QC/LljService.cs | 25 +++++++++++++++++++------ 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/StandardPda/MES.Service/service/QC/LljService.cs b/StandardPda/MES.Service/service/QC/LljService.cs index df99c12..ab97fe2 100644 --- a/StandardPda/MES.Service/service/QC/LljService.cs +++ b/StandardPda/MES.Service/service/QC/LljService.cs @@ -1039,10 +1039,14 @@ { OracleSQLHelper SQLHelper = new(); //鏌ュ厓鍣ㄤ欢 + //var sql1 = + // string.Format( + // @"select ITEMNAME from MES_IQC_CONSISTENCY_ck where PID='" + + // id + "' group by ITEMNAME order by ITEMNAME"); + var sql1 = string.Format( - @"select ITEMNAME from MES_IQC_CONSISTENCY_ck where PID='" + - id + "' group by ITEMNAME order by ITEMNAME"); + @"select CASE WHEN max(MULTI_SELECT) is null THEN ''ELSE '銆�'||max(MULTI_SELECT)||'銆�' END as A,ITEMNAME as 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='" + @@ -1055,7 +1059,7 @@ for (var i = 0; i < dataTable1.Rows.Count; i++) { var component = new Component(); - component.Name = dataTable1.Rows[i]["ITEMNAME"].ToString(); + component.Name = dataTable1.Rows[i]["A"].ToString()+ dataTable1.Rows[i]["ITEMNAME"].ToString(); component.Specs = new List<string>(); component.Manufacturers = new List<string>(); component.Id = new List<string>(); @@ -1137,10 +1141,19 @@ OracleSQLHelper SQLHelper = new(); //淇敼缁撴灉 + //var sql2 = string.Format( + // @"select A.ITEMNAME from ( select 888||min(id) id,ITEMNAME from MES_IQC_CONSISTENCY_CK where pid='" + + // id + "' group by ITEMNAME) A " + + // "left join MES_QS_IMAGE b on a.id=b.fid where B.id is null order by ITEMNAME"); + + var sql2 = string.Format( - @"select A.ITEMNAME from ( select 888||min(id) id,ITEMNAME from MES_IQC_CONSISTENCY_CK where pid='" + - id + "' group by ITEMNAME) A " + - "left join MES_QS_IMAGE b on a.id=b.fid where B.id is null order by ITEMNAME"); + @"select A.ITEMNAME from ( select 888||min(id) id,ITEMNAME from MES_IQC_CONSISTENCY_CK where pid='"+id.ToString()+ "' and ITEMNAME not in(select ITEMNAME from MES_IQC_CONSISTENCY_CK where PID='"+id.ToString()+"' and MULTI_SELECT is not null)" + + "group by ITEMNAME) A" + + " left join MES_QS_IMAGE b on a.id=b.fid where B.id is null" + + " union" + + " select '鍒嗙粍锛�' || MULTI_SELECT as ITEMNAME from MES_IQC_CONSISTENCY_CK where pid = '"+id.ToString()+ "' and MULTI_SELECT is not null and MULTI_SELECT not in(select A.MULTI_SELECT as ITEMNAME from (select 888 || min(id) id, MULTI_SELECT from MES_IQC_CONSISTENCY_CK where pid = '"+id.ToString()+ "' and MULTI_SELECT is not null group by MULTI_SELECT,ITEMNAME) A left join MES_QS_IMAGE b on a.id = b.fid where B.id is not null) group by MULTI_SELECT"); + var db = SQLHelper.ExecuteQuery(sql2); if (db.Rows.Count > 0) { diff --git a/StandardPda/MESApplication/Controllers/QC/LljController.cs b/StandardPda/MESApplication/Controllers/QC/LljController.cs index 3efd2dc..7186298 100644 --- a/StandardPda/MESApplication/Controllers/QC/LljController.cs +++ b/StandardPda/MESApplication/Controllers/QC/LljController.cs @@ -1,12 +1,13 @@ -锘縰sing System.Data; -using System.Dynamic; -using MES.Service.Dto.service; +锘縰sing MES.Service.Dto.service; using MES.Service.Modes; using MES.Service.service.QC; using MES.Service.util; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore.Metadata.Internal; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using System.Data; +using System.Dynamic; namespace MESApplication.Controllers.QC; @@ -207,6 +208,15 @@ var dt = JsonConvert.DeserializeObject<DataTable>(dataDt); try { + if (!dt.Columns.Contains("id")) + { + return new ResponseResult + { + status = 1, + message = "璇峰厛閫夋嫨鏁版嵁鍐嶄繚瀛橈紒", + data = "璇峰厛閫夋嫨鏁版嵁鍐嶄繚瀛橈紒" + }; + } new LljService().saveYzxBDlist(id, dt); var msg = new LljService().YzxImgVerify(id); -- Gitblit v1.9.3