| | |
| | | using Newtonsoft.Json; |
| | | using SharpCompress.Factories; |
| | | using SqlSugar; |
| | | using System.ComponentModel; |
| | | using System.Data; |
| | | using System.Xml.Linq; |
| | | using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; |
| | |
| | | .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 |
| | | { |
| | |
| | | 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, |
| | |
| | | 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 => |
| | |
| | | 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(); |
| | | }); |