| | |
| | | Daa003 = a.Daa003, |
| | | Daa004 = a.Daa004, |
| | | Daa008 = a.Daa008, |
| | | LineName = a.LineName, |
| | | LineName = d.Departmentname == "注塑车间" ? da.Daa020 : a.LineName, |
| | | SaleOrder = ca.Caa015, |
| | | DepartName = d.Departmentname, |
| | | PlanName = a.PlanName |
| | |
| | | } |
| | | |
| | | |
| | | //主表修改备注字段 |
| | | //主表修改不合格描述字段 |
| | | public int saveRemarksGid(QsItem dto) |
| | | { |
| | | return SqlSugarHelper.UseTransactionWithOracle(db => |
| | |
| | | return db.Updateable<QsItemIpiReq>() |
| | | .SetColumns(it => |
| | | it.Remarks == dto.Remarks) //SetColumns是可以叠加的 写2个就2个字段赋值 |
| | | .Where(it => it.Id == dto.gid) |
| | | .ExecuteCommand(); |
| | | }); |
| | | } |
| | | |
| | | //主表修改备注字段 |
| | | public int saveCommentGid(QsItem dto) |
| | | { |
| | | return SqlSugarHelper.UseTransactionWithOracle(db => |
| | | { |
| | | return db.Updateable<QsItemIpiReq>() |
| | | .SetColumns(it => |
| | | it.Comments == dto.Comments) //SetColumns是可以叠加的 写2个就2个字段赋值 |
| | | .Where(it => it.Id == dto.gid) |
| | | .ExecuteCommand(); |
| | | }); |
| | |
| | | } |
| | | } |
| | | |
| | | public bool SJQaReSubmit(QsItem item) |
| | | { |
| | | |
| | | if (item == null) |
| | | throw new ArgumentNullException(nameof(item), "质检项数据不能为空"); |
| | | |
| | | if (string.IsNullOrWhiteSpace(item.userNo)) |
| | | throw new ArgumentException("用户编号不能为空", nameof(item.userNo)); |
| | | |
| | | var (factory, company) = UserUtil.GetFactory(item.userNo); |
| | | try |
| | | { |
| | | // 定义输出参数 |
| | | var outputResult = new SugarParameter("o_Result", null, DbType.Int32, ParameterDirection.Output, |
| | | 4000); |
| | | |
| | | var outputMessage = new SugarParameter("o_Msg", null, DbType.String, ParameterDirection.Output, 4000); |
| | | |
| | | // 定义输入参数 |
| | | var parameters = new List<SugarParameter> |
| | | { |
| | | |
| | | new("p_Id", item.gid, DbType.Int32,ParameterDirection.Input), |
| | | new("p_Flag", 2, DbType.Int32,ParameterDirection.Input), |
| | | new("p_User", item.userNo, DbType.String, ParameterDirection.Input), |
| | | outputResult, |
| | | outputMessage |
| | | }; |
| | | |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | |
| | | // 使用 SqlSugar 执行存储过程 |
| | | db.Ado.ExecuteCommand( |
| | | "BEGIN PRC_WOMDAA_SJ_UPDATE_RES(:p_Id,:p_Flag,:p_User,:o_Result, :o_Msg); END;", |
| | | parameters.ToArray()); |
| | | |
| | | // 获取输出参数的值 |
| | | var resultValue = outputResult.Value?.ToString(); |
| | | var messageValue = outputMessage.Value?.ToString(); |
| | | |
| | | if ("1".Equals(resultValue)) { throw new Exception(messageValue); } |
| | | if ("0".Equals(resultValue)) { throw new Exception(messageValue); } |
| | | |
| | | return true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新QsItemIpiItem的IsPass值 |
| | | /// </summary> |
| | |
| | | { |
| | | return db.Updateable<QsItemIpiItemDetail>() |
| | | .SetColumns(s => s.FcheckResu == isPass.ToString()) |
| | | .SetColumns(s => s.Fstand == ((isPass == 1) ? "√" : "0")) |
| | | .SetColumns(s => s.Fstand == ((isPass == 1) ? "√" : "×")) |
| | | .Where(s => s.Pid == id) |
| | | .ExecuteCommand(); |
| | | }); |
| | |
| | | |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | |
| | | decimal numUserId = db.Queryable<DingStaff>() |
| | | string numUserId = db.Queryable<DingStaff>() |
| | | .Where(t => t.StaffName == InData.Fname) |
| | | .Select(t => t.Id) |
| | | .First(); |
| | | if (numUserId > 0) |
| | | if (numUserId is not null) |
| | | { |
| | | string UserId = Convert.ToString(numUserId); |
| | | |