| | |
| | | using MES.Service.util; |
| | | using SqlSugar; |
| | | using System.Data; |
| | | using System.Dynamic; |
| | | using DbType = System.Data.DbType; |
| | | |
| | | namespace MES.Service.service.QC; |
| | | |
| | |
| | | private readonly BaseService _baseService = new(); |
| | | |
| | | |
| | | private readonly string[] statusArray = ["开工", "待开工"]; |
| | | private readonly string[] statusArray = ["已开工", "待开工"]; |
| | | |
| | | //生成最新的检验单号 |
| | | public string getMaxReleaseNo() |
| | |
| | | Daa001 = a.Daa001, |
| | | Daa003 = a.Daa003, |
| | | Daa008 = a.Daa008 |
| | | }).ToList(); |
| | | }).Distinct().ToList(); |
| | | } |
| | | |
| | | public List<MesItems> getBoardItem(string lineNo) |
| | |
| | | ItemNo = b.ItemNo, |
| | | ItemName = b.ItemName, |
| | | ItemModel = b.ItemModel |
| | | }).ToList(); |
| | | }).Distinct().ToList(); |
| | | } |
| | | |
| | | //public (List<QsQaItemXj> item, int TotalCount) getPage(XJPageResult queryObj) |
| | |
| | | |
| | | |
| | | |
| | | |
| | | var sqlPass3 = $@"select ID from QS_QA_ITEM_XJ |
| | | WHERE ID = '{rkjDto.gid}' |
| | | "; |
| | | var dtPass3 = SQLHelper.ExecuteQuery(sqlPass3); |
| | | |
| | | var value4 = dtPass3.Rows[0][0]; |
| | | int sqlPass2 = Convert.ToInt32(value4); |
| | | |
| | | |
| | | if (dt.Rows.Count > 0) |
| | | { |
| | | var resu = dt.Rows[0]["FCHECK_RESU"]?.ToString(); |
| | |
| | | where ID = '" + rkjDto.gid + "'"; |
| | | SQLHelper.ExecuteNonQuery(sqlUpdate); |
| | | } |
| | | |
| | | var resu1 = dt.Rows[0]["FCHECK_RESU"]?.ToString(); |
| | | |
| | | var fsubmit2 = resu1 == "合格" ? 1 : 0; |
| | | |
| | | |
| | | if (fsubmit2 == 0) |
| | | { |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | |
| | | // ===== 输出参数 ===== |
| | | var outFlag = new SugarParameter("P_FLAG", null, |
| | | DbType.Int32, ParameterDirection.Output, 10); |
| | | |
| | | var outText = new SugarParameter("P_TEXT", null, |
| | | DbType.String, ParameterDirection.Output, 4000); |
| | | |
| | | // ===== 输入参数 ===== |
| | | var parameters = new List<SugarParameter> |
| | | { |
| | | new SugarParameter("P_ID", sqlPass2, DbType.Int64, ParameterDirection.Input), |
| | | new SugarParameter("P_USER", rkjDto.userNo, DbType.String, ParameterDirection.Input), |
| | | new SugarParameter("P_ISH", 0, DbType.Int64, ParameterDirection.Input), |
| | | new SugarParameter("P_RELEASE_NO",rkjDto.releaseNo,DbType.String,ParameterDirection.Input), |
| | | |
| | | // 输出参数必须带上 |
| | | outFlag, |
| | | outText |
| | | }; |
| | | // ===== 执行存储过程 ===== |
| | | db.Ado.ExecuteCommand( |
| | | "BEGIN PRC_XJ_GENERATE_two(:P_ID, :P_USER, :P_ISH,:P_RELEASE_NO, :P_FLAG, :P_TEXT); END;", |
| | | parameters); |
| | | |
| | | // ===== 读取输出参数并转换成 ResponseResult ===== |
| | | var result = new ResponseResult |
| | | { |
| | | status = outFlag.Value?.ToString() == "1" ? 1 : 0, // 0 表示成功,1 表示失败 |
| | | message = outText.Value?.ToString() |
| | | }; |
| | | |
| | | var useTransactionWithOracle1 = |
| | | SqlSugarHelper.UseTransactionWithOracle(db => |
| | | { |
| | | return db.Updateable<QsQaItemXj>() |
| | | .SetColumns(s => s.Fsubmit == 1) |
| | | .SetColumns(s => s.FsubmitBy == rkjDto.userNo) |
| | | .SetColumns(s => s.FsubmitDate == DateTime.Now) |
| | | .Where(s => s.Id == rkjDto.gid) |
| | | .ExecuteCommand(); |
| | | }); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "提交成功", |
| | | data = useTransactionWithOracle1 |
| | | }; |
| | | } |
| | | |
| | | |
| | | var useTransactionWithOracle = |
| | | SqlSugarHelper.UseTransactionWithOracle(db => |
| | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取巡检检单所有不良描述 |
| | | /// </summary> |
| | | /// <param name="id">检验单ID</param> |
| | | /// <returns>不良描述数据表</returns> |
| | | public DataTable ggetBlmsItem1(string id) |
| | | { |
| | | OracleSQLHelper SQLHelper = new(); |
| | | // 查询首检检验单的不良描述 |
| | | var sql1 = string.Format( |
| | | @"select PROJ_NAME, REMARKS |
| | | from QS_QA_ITEM_XJ01 f |
| | | where PID = '" + id + "' and REMARKS is not null order by PROJ_NAME"); |
| | | |
| | | return SQLHelper.ExecuteQuery(sql1); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //孙表修改备注字段 |
| | | public int saveRemarksById(XJDto dto) |
| | |
| | | .Where(it => it.Id == dto.id) |
| | | .ExecuteCommand(); |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加巡检单 |
| | | /// </summary> |
| | | public ResponseResult createInspection(CreateInspectionDto data) |
| | | { |
| | | try |
| | | { |
| | | |
| | | |
| | | OracleSQLHelper SQLHelper = new(); |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | // ===== 输出参数 ===== |
| | | var outFlag = new SugarParameter("P_FLAG", null, |
| | | DbType.Int32, ParameterDirection.Output, 10); |
| | | |
| | | var outText = new SugarParameter("P_TEXT", null, |
| | | DbType.String, ParameterDirection.Output, 4000); |
| | | |
| | | // ===== 输入参数 ===== |
| | | var parameters = new List<SugarParameter> |
| | | { |
| | | new SugarParameter("P_line_type", data.LineNo, DbType.String, ParameterDirection.Input), |
| | | new SugarParameter("P_Work_order_number", data.Daa001, DbType.String, ParameterDirection.Input), |
| | | new SugarParameter("P_coding", data.ItemNo, DbType.String, ParameterDirection.Input), |
| | | new SugarParameter("P_USER", data.account, DbType.String, ParameterDirection.Input), |
| | | new SugarParameter("P_ISH", 0, DbType.Int64, ParameterDirection.Input), |
| | | |
| | | // 输出参数必须带上 |
| | | outFlag, |
| | | outText |
| | | }; |
| | | // ===== 执行存储过程 ===== |
| | | db.Ado.ExecuteCommand( |
| | | "BEGIN PRC_XJ_GENERATE_one(:P_line_type,:P_Work_order_number,:P_coding, :P_USER, :P_ISH, :P_FLAG, :P_TEXT); END;", |
| | | parameters); |
| | | |
| | | // ===== 读取输出参数并转换成 ResponseResult ===== |
| | | var result = new ResponseResult |
| | | { |
| | | status = outFlag.Value?.ToString() == "1" ? 1 : 0, // 0 表示成功,1 表示失败 |
| | | message = outText.Value?.ToString() |
| | | }; |
| | | |
| | | |
| | | return result; |
| | | //return new ResponseResult |
| | | //{ |
| | | // status = 0, |
| | | // message = "OK", |
| | | // data = result |
| | | //}; |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | } |