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 | 89 +++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 86 insertions(+), 3 deletions(-) diff --git a/StandardPda/MES.Service/service/QC/LljService.cs b/StandardPda/MES.Service/service/QC/LljService.cs index edeabfd..2659e0b 100644 --- a/StandardPda/MES.Service/service/QC/LljService.cs +++ b/StandardPda/MES.Service/service/QC/LljService.cs @@ -7,6 +7,7 @@ using Newtonsoft.Json; using SharpCompress.Factories; using SqlSugar; +using System.ComponentModel; using System.Data; using System.Xml.Linq; using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; @@ -68,7 +69,9 @@ .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.SelectedIndex == "4" && queryObj.SearchValue != null && queryObj.SearchValue != "", (a, b, d, e) => (e.Fname.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 { @@ -434,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, @@ -696,8 +700,87 @@ 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 => @@ -764,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(); }); -- Gitblit v1.9.3