| | |
| | | !"未完成".Equals(queryObj.result), |
| | | (a, b, c, d, e) => a.FcheckResu != null && a.Fsubmit == 1) |
| | | .WhereIF(id > 0, (a, b, c, d, e) => a.Id == id) |
| | | .WhereIF(StringUtil.IsNotNullOrEmpty(queryObj.createUser) && queryObj.SearchIndex != null, |
| | | (a, b, c, d, e) => c.Fname.Contains(queryObj.createUser)) |
| | | .WhereIF(StringUtil.IsNotNullOrEmpty(queryObj.ItemNo), |
| | | (a, b, c, d, e) => b.ItemNo.Contains(queryObj.ItemNo)) |
| | | .WhereIF(StringUtil.IsNotNullOrEmpty(queryObj.ItemName), |
| | | (a, b, c, d, e) => b.ItemName.Contains(queryObj.ItemName)) |
| | | .WhereIF(StringUtil.IsNotNullOrEmpty(queryObj.ReleaseNo), |
| | | (a, b, c, d, e) => a.ReleaseNo.Contains(queryObj.ReleaseNo)) |
| | | .OrderByDescending((a, b, c, d, e) => a.Id) |
| | | .Select((a, b, c, d, e) => new MesOqcItemsDetect02() |
| | | { |
| | |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | public bool Regenerate(MesOqcItemsDetect02 from) |
| | | { |
| | | // 定义输出参数 |
| | | var outputResult = new SugarParameter("PO_RESULT", null, |
| | | DbType.Int32, ParameterDirection.Output, 4000); |
| | | var outputMessage = new SugarParameter("PO_TEXT", null, |
| | | DbType.String, |
| | | ParameterDirection.Output, 4000); |
| | | |
| | | // 定义输入参数 |
| | | var parameters = new List<SugarParameter> |
| | | { |
| | | new("P_RELEASE_NO", from.ReleaseNo, DbType.String, |
| | | ParameterDirection.Input), |
| | | new("P_ITEM_ID", from.ItemId, DbType.Int32, |
| | | ParameterDirection.Input), |
| | | new("P_BILL_NO ", "", DbType.String, |
| | | ParameterDirection.Input), |
| | | outputResult, |
| | | outputMessage |
| | | }; |
| | | |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | |
| | | // 使用 SqlSugar 执行存储过程 |
| | | db.Ado.ExecuteCommand( |
| | | "BEGIN PRC_OQC_ITEM_INSERT_BTN(:P_RELEASE_NO,:P_ITEM_ID,:P_BILL_NO,:PO_RESULT, :PO_TEXT); END;", |
| | | parameters.ToArray()); |
| | | |
| | | // 获取输出参数的值 |
| | | var resultValue = outputResult.Value?.ToString(); |
| | | var messageValue = outputMessage.Value?.ToString(); |
| | | |
| | | if ("1".Equals(resultValue)) |
| | | // 处理失败情况,返回错误信息 |
| | | throw new Exception($"操作失败: {messageValue}"); |
| | | |
| | | // 当 resultValue 为 "0" 时返回成功状态 |
| | | return true; |
| | | } |
| | | |
| | | public OQCDto getXjDetail02ById(decimal? id) |
| | |
| | | throw new Exception(ex.Message); |
| | | } |
| | | } |
| | | |
| | | |
| | | public int saveRemarksGid(LLJDto dto) |
| | | { |
| | | return SqlSugarHelper.UseTransactionWithOracle(db => |
| | |
| | | .ExecuteCommand(); |
| | | }); |
| | | } |
| | | |
| | | public int SetQSItemDetail(MesOqcItemsDetectDetail12 detail) |
| | | { |
| | | var oracle = SqlSugarHelper.UseTransactionWithOracle(db => |
| | | { |
| | | List<MesOqcItemsDetectDetail12> result = new(); |
| | | for (var i = 0; i < detail.count; i++) |
| | | { |
| | | var item = new MesOqcItemsDetectDetail12(); |
| | | item.MainId = detail.MainId; |
| | | item.ReleaseNo = detail.ReleaseNo; |
| | | item.Fstand = detail.Fstand; |
| | | item.FcheckResu = detail.FcheckResu; |
| | | item.CreateBy = detail.LastupdateBy; |
| | | item.CreateDate = DateTime.Now; |
| | | item.Factory = "1000"; |
| | | item.Company = "1000"; |
| | | result.Add(item); |
| | | } |
| | | |
| | | return db.Insertable(result).ExecuteCommand(); |
| | | }); |
| | | |
| | | detail.CreateBy = detail.LastupdateBy; |
| | | |
| | | autoResult(detail); |
| | | |
| | | return oracle; |
| | | } |
| | | } |