| | |
| | | try |
| | | { |
| | | //获取当前扫码设备是否申请维修记录 |
| | | sql = @"select * from TEqp_RepairRequest where eqp_code=@eqpcode and status='REPA' or status='COMP'"; |
| | | sql = @"select * from TEqp_RepairRequest where eqp_code=@eqpcode and status<>'CONFIR'"; |
| | | dynamicParams.Add("@eqpcode", eqpcode); |
| | | var data0 = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (data0.Rows.Count > 0) |
| | |
| | | #endregion |
| | | |
| | | #region[设备维修提交] |
| | | public static ToMessage RepairScanDeviceSave(string username, string eqpcode, string wkshpcode, string faultdescr, string is_stoprepair, string repaircontent, string replaceparts, HttpFileCollection files) |
| | | public static ToMessage RepairScanDeviceSave(string docu_code, string username, string eqpcode, string wkshpcode, string faultdescr, string is_stoprepair, string repaircontent, string replaceparts, HttpFileCollection files) |
| | | { |
| | | var sql = ""; |
| | | string wxwo = "", numvalue = ""; |
| | |
| | | } |
| | | } |
| | | //写入维修记录表 |
| | | sql = @"insert into TEqp_Repair(repair_code,docu_date,status,wksp_code,eqp_code,repair_person,repair_date,repair_content,repair_part,failure_descript,is_shutdown) |
| | | values(@repair_code,@docu_date,@status,@wksp_code,@eqp_code,@repair_person,@repair_date,@repair_content,@repair_part,@failure_descript,@is_shutdown)"; |
| | | sql = @"insert into TEqp_Repair(repair_code,docu_date,status,wksp_code,eqp_code,repair_person,repair_date,repair_content,repair_part,failure_descript,is_shutdown,source_wo) |
| | | values(@repair_code,@docu_date,@status,@wksp_code,@eqp_code,@repair_person,@repair_date,@repair_content,@repair_part,@failure_descript,@is_shutdown,@source_wo)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | |
| | | repair_content = repaircontent, |
| | | repair_part = replaceparts, |
| | | failure_descript = faultdescr, |
| | | is_shutdown = is_stoprepair |
| | | is_shutdown = is_stoprepair, |
| | | source_wo= docu_code |
| | | } |
| | | }); |
| | | //更新维修申请单状态 |
| | | sql = @"update TEqp_RepairRequest set status=@status where docu_code=@docu_code and wksp_code=@wkshpcode and eqp_code=@eqpcode"; |
| | | list.Add(new { str = sql, parm = new { docu_code = docu_code, wkshpcode = wkshpcode, eqpcode= eqpcode, status= "COMP" } }); |
| | | |
| | | //回写字典表,更新当前流水号 |
| | | sql = @"update T_CodeRules set value=@cunm2 where rightcode=@RightCode"; |
| | |
| | | #endregion |
| | | |
| | | #region[维修验证详情信息] |
| | | public static ToMessage RepairVerificationScanDeviceDataSub(string eqpcode, string wkshpcode) |
| | | public static ToMessage RepairVerificationScanDeviceDataSub(string repair_code,string eqpcode, string wkshpcode) |
| | | { |
| | | string sql = ""; |
| | | var dynamicParams = new DynamicParameters(); |
| | |
| | | //根据设备编码\车间编码获取维修详情 |
| | | sql = @"select repair_code,failure_descript,is_shutdown,repair_content,repair_part |
| | | from TEqp_Repair |
| | | where wksp_code=@wkshpcode and eqp_code=@eqpcode"; |
| | | where repair_code=@repair_code and wksp_code=@wkshpcode and eqp_code=@eqpcode"; |
| | | dynamicParams.Add("@repair_code", repair_code); |
| | | dynamicParams.Add("@wkshpcode", wkshpcode); |
| | | dynamicParams.Add("@eqpcode", eqpcode); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | |
| | | dict.Add("repair_part", data.Rows[0]["repair_part"].ToString()); //更换备件 |
| | | |
| | | //获取更换备件上传图片 |
| | | sql = @"select img1ur2 from TEqp_RepairImage where source_wo=@source_wo and wo_type='COMP'"; |
| | | sql = @"select img2url from TEqp_RepairImage where source_wo=@source_wo and wo_type='COMP'"; |
| | | dynamicParams.Add("@source_wo", data.Rows[0]["repair_code"].ToString()); |
| | | var data1 = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (data1.Rows.Count > 0) |
| | |
| | | { |
| | | var sql = ""; |
| | | List<object> list = new List<object>(); |
| | | var dynamicParams = new DynamicParameters(); |
| | | try |
| | | { |
| | | list.Clear(); |
| | | //根据设备维修单查找源单(维修申请单) |
| | | sql = @"select source_wo from TEqp_Repair where repair_code=@repairwo"; |
| | | dynamicParams.Add("@repairwo", repairwo); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | //更新设备维修记录验证人员、验证时间、验证结果、验证状态 |
| | | sql = @"update TEqp_Repair set status=@status,is_verifi=@is_verifi,verify_result=@verify_result,verify_person=@verify_person,verify_date=@verify_date |
| | | where repair_code=@repair_code and wksp_code=@wksp_code and eqp_code=@eqp_code"; |
| | |
| | | eqp_code = eqpcode |
| | | } |
| | | }); |
| | | //更新维修申请单状态 |
| | | sql = @"update TEqp_RepairRequest set status=@status where docu_code=@docu_code and wksp_code=@wkshpcode and eqp_code=@eqpcode"; |
| | | list.Add(new { str = sql, parm = new { docu_code = data.Rows[0]["source_wo"].ToString(), wkshpcode = wkshpcode, eqpcode = eqpcode, status = "CONFIR" } }); |
| | | |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | | if (aa) |
| | |
| | | public static ToMessage AppDeviceAnDengCallSave(string username, string eqpcode, string wkshpcode, List<AnDnDate> json) |
| | | { |
| | | string sql = ""; |
| | | int AnDnID = 0; //最大id |
| | | var dynamicParams = new DynamicParameters(); |
| | | List<object> list = new List<object>(); |
| | | ChatHub chthub = new ChatHub(); |
| | | try |
| | | { |
| | | list.Clear(); |
| | | //执行消息推送 |
| | | chthub.SendByGroupList(username, wkshpcode, eqpcode, json); |
| | | for (int i = 1; i <= json.Count; i++) |
| | | //获取主表最大ID |
| | | AnDnID = DapperHelper.insertReturnId("TAnDon_Task_Info"); |
| | | for (int i = 0; i < json.Count; i++) |
| | | { |
| | | AnDnID = AnDnID + 1;//自增1 |
| | | string code = json[i].code.ToString(); |
| | | string name = json[i].name.ToString(); |
| | | sql = @"select * from TAnDon_Task_Info where wkshp_code=@wkshpcode and eqp_code=@eqpcode and type=@typecode and status='START'"; |
| | |
| | | } |
| | | else |
| | | { |
| | | //获取主表最大ID |
| | | sql = @"select ISNULL(IDENT_CURRENT('TK_Wrk_Record')+@num,1) as id"; |
| | | dynamicParams.Add("@num", i); |
| | | var dt = DapperHelper.selectdata(sql, dynamicParams); |
| | | //写入安灯呼叫表 |
| | | sql = @"insert into TAnDon_Task_Info(wkshp_code,eqp_code,type,start_date,start_user,status) |
| | | values(@wkshp_code,@eqp_code,@type,@start_date,@start_user,@status)"; |
| | |
| | | status = "START" |
| | | } |
| | | }); |
| | | |
| | | for (int j = 0; j < json[i].children.Count; j++) |
| | | { |
| | | //写入安灯记录推送人员表 |
| | |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | m_id = int.Parse(dt.Rows[0]["ID"].ToString()), |
| | | m_id = AnDnID, |
| | | //m_id = int.Parse(dt.Rows[0]["ID"].ToString()), |
| | | wkshp_code = wkshpcode, |
| | | eqp_code = eqpcode, |
| | | type = code, |
| | | resp_user = json[i].children[i].usercode, |
| | | resp_user = json[i].children[j].usercode, |
| | | status = "N" |
| | | } |
| | | }); |
| | |
| | | try |
| | | { |
| | | list.Clear(); |
| | | for (int i = 1; i <= json.Count; i++) |
| | | for (int i = 0; i <json.Count; i++) |
| | | { |
| | | string code = json[i].code.ToString(); |
| | | string name = json[i].name.ToString(); |