| | |
| | | using MES.Service.Modes; |
| | | using MES.Service.util; |
| | | using SqlSugar; |
| | | using System.Data; |
| | | using DbType = System.Data.DbType; |
| | | |
| | | namespace MES.Service.service.QC; |
| | | |
| | |
| | | StringUtil.IsNotNullOrEmpty(queryObj.Result) && |
| | | !"未完成".Equals(queryObj.Result), |
| | | a => a.Result != "未完成") |
| | | //加筛选条件,根据供应商,物料编码,物料名称搜索 |
| | | //.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.Daa003.ToLower().Contains(queryObj.SearchValue.ToLower()) |
| | | || a.ItemNo.ToLower().Contains(queryObj.SearchValue.ToLower()))) |
| | | .OrderBy(a => a.BillNo, OrderByType.Desc) |
| | | .ToPageList(queryObj.PageIndex, queryObj.Limit); |
| | | |
| | |
| | | // result = "未检测" |
| | | // }).ToList(); |
| | | // } |
| | | public List<QsItemIpiItem> SetQSItems(string itemNo) |
| | | public List<QsItemIpiItem> SetQSItems(string itemNo,string lineNo) |
| | | { |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | |
| | | |
| | | //根据线体编号获取工序ID |
| | | |
| | | |
| | | decimal? procid = db.Queryable<MesLine>().Where(s => s.LineNo == lineNo).Select(s => s.ProcId).First(); |
| | | |
| | | if (procid == null) { procid = 99999999; }; |
| | | |
| | | var count = db.Queryable<MesQa>().Where(s => s.QsType == "1" |
| | | && s.ItemNo == itemNo && s.Fsubmit == 1).Count(); |
| | | && s.ItemNo == itemNo && s.Fsubmit == 1 && s.procid == procid).Count(); |
| | | |
| | | if (count <= 0) return []; |
| | | |
| | | return db |
| | | .Queryable<MesQualityStandard>() |
| | | .Where(b => b.QsType == "1" && b.ItemNo == itemNo).Select( |
| | | .Where(b => b.QsType == "1" && b.ItemNo == itemNo && b.ProcId == procid).Select( |
| | | b => new QsItemIpiItem |
| | | { |
| | | ProjName = b.ProjName, |
| | |
| | | |
| | | return withOracle; |
| | | } |
| | | |
| | | public bool QaSubmit(LLJDto dto) |
| | | { |
| | | |
| | | try |
| | | { |
| | | // 定义输出参数 |
| | | var outputResult = new SugarParameter("C_RES", null, |
| | | DbType.Int32, ParameterDirection.Output, |
| | | 4000); |
| | | |
| | | var outputMessage = new SugarParameter("C_MSG", null,DbType.String, |
| | | ParameterDirection.Output, 4000); |
| | | |
| | | // 定义输入参数 |
| | | var parameters = new List<SugarParameter> |
| | | { |
| | | |
| | | new("P_ID", dto.id, DbType.String, |
| | | ParameterDirection.Input), |
| | | new("P_USER", dto.userNo, DbType.String, |
| | | ParameterDirection.Input), |
| | | outputResult, |
| | | outputMessage |
| | | }; |
| | | |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | |
| | | // 使用 SqlSugar 执行存储过程 |
| | | db.Ado.ExecuteCommand( |
| | | "BEGIN PRC_FPI_OK_GEN_IPI(:P_ID, :P_USER, :C_RES, :C_MSG); END;", |
| | | parameters.ToArray()); |
| | | |
| | | // 获取输出参数的值 |
| | | var resultValue = outputResult.Value?.ToString(); |
| | | var messageValue = outputMessage.Value?.ToString(); |
| | | |
| | | if ("1".Equals(resultValue)) throw new Exception(messageValue); |
| | | |
| | | return true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception(ex.Message); |
| | | } |
| | | } |
| | | } |