| | |
| | | ) |
| | | ); |
| | | |
| | | // 添加线体筛选条件 |
| | | // 添加线体筛选条件(基于用户权限) |
| | | if (lineNo != null && lineNo.Length > 0) |
| | | { |
| | | query = query.Where((s, a, c, b) => lineNo.Contains(c.LineNo)); |
| | | } |
| | | |
| | | // 添加QC筛选条件:车间和线体 |
| | | if (!string.IsNullOrEmpty(queryObj.departmentId)) |
| | | { |
| | | // 如果指定了车间,筛选该车间下的线体 |
| | | query = query.Where((s, a, c, b) => c.DepotId.ToString() == queryObj.departmentId); |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(queryObj.lineId)) |
| | | { |
| | | // 如果指定了线体,直接筛选线体 |
| | | query = query.Where((s, a, c, b) => c.LineNo == queryObj.lineId); |
| | | } |
| | | |
| | | // 添加状态筛选条件 - 明确匹配前端传递的值 |
| | |
| | | var qsQaItemXj01s = db.Queryable<QsQaItemXj01>() |
| | | .WhereIF(pid > 0, a => a.Pid == pid) |
| | | .WhereIF(id > 0, a => a.Id == id) |
| | | .OrderBy(a => a.Forder ?? 0) |
| | | .ToList(); |
| | | |
| | | var array = qsQaItemXj01s.Select(s => s.Id).ToArray(); |
| | |
| | | s.imageData = Convert.ToBase64String(s.Picture); |
| | | }); |
| | | |
| | | //排序,未完成的排在前面 |
| | | qsQaItemXj01s = qsQaItemXj01s.OrderBy(s => s.isCheck).ToList(); |
| | | //排序:只按FORDER顺序排序 |
| | | qsQaItemXj01s = qsQaItemXj01s |
| | | .OrderBy(s => s.Forder ?? 0) |
| | | .ToList(); |
| | | |
| | | return qsQaItemXj01s; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | |
| | | // 直接更新Fsubmit字段为1(已提交状态) |
| | | var result = db.Updateable<QsQaItemXj>() |
| | | .SetColumns(s => s.Fsubmit == 1) |
| | | .SetColumns(s => s.FsubmitBy == dto.userNo) |
| | | .SetColumns(s => s.FsubmitDate == DateTime.Now) |
| | | .Where(s => s.Id == dto.id) |
| | | .ExecuteCommand(); |
| | | // 定义输出参数 |
| | | var outputResult = new SugarParameter("c_res", null, |
| | | System.Data.DbType.Int32, ParameterDirection.Output, |
| | | 4000); |
| | | |
| | | if (result > 0) |
| | | var outputMessage = new SugarParameter("c_msg", null, |
| | | System.Data.DbType.String, |
| | | ParameterDirection.Output, 4000); |
| | | |
| | | // 定义输入参数,固定FLAG为1(审核) |
| | | var parameters = new List<SugarParameter> |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | throw new Exception("提交失败:未找到对应的检验单"); |
| | | } |
| | | new("P_ID", dto.id, System.Data.DbType.Decimal, ParameterDirection.Input), |
| | | new("P_FLAG", 1, System.Data.DbType.Int32, ParameterDirection.Input), |
| | | new("P_USER", dto.userNo, System.Data.DbType.String, ParameterDirection.Input), |
| | | outputResult, |
| | | outputMessage |
| | | }; |
| | | |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | |
| | | // 使用 SqlSugar 执行存储过程 |
| | | db.Ado.ExecuteCommand( |
| | | "BEGIN PRC_WOMDAA_XJ_UPDATE_RES(:P_ID, :P_FLAG, :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) |
| | | { |