| | |
| | | string imgPath1 = "", imgPath2 = "", AbsolutePath = ""; |
| | | HttpPostedFile file = files[i]; |
| | | string imgName = DateTime.Now.ToString("yyyyMMddhhmmss") + i.ToString(); |
| | | string keyname = files.AllKeys[i].ToString(); |
| | | string keyname = files.AllKeys[i].ToString().Substring(0, files.AllKeys[i].ToString().IndexOf(";")); |
| | | if (keyname == "files1") |
| | | { |
| | | imgPath1 = "/DeviceImage/image1/" + imgName + file.FileName; //通过此对象获取文件名 |
| | |
| | | imgPath2 = "/DeviceImage/image2/" + imgName + file.FileName; //通过此对象获取文件名 |
| | | AbsolutePath = System.Web.HttpContext.Current.Server.MapPath(imgPath2); |
| | | } |
| | | |
| | | file.SaveAs(AbsolutePath); //将上传的东西保存 |
| | | //循环写维修记录对应图片表 |
| | | sql = @"insert into TEqp_RepairImage(source_wo,wo_type,img1url,img2url) |
| | |
| | | repair_part = replaceparts, |
| | | failure_descript = faultdescr, |
| | | is_shutdown = is_stoprepair, |
| | | source_wo= docu_code |
| | | 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" } }); |
| | | 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 repair_code,string eqpcode, string wkshpcode) |
| | | public static ToMessage RepairVerificationScanDeviceDataSub(string repair_code, string eqpcode, string wkshpcode) |
| | | { |
| | | string sql = ""; |
| | | var dynamicParams = new DynamicParameters(); |
| | |
| | | from TAnDon_Roul_ConFig A |
| | | inner join TAnDonType B on A.andotype_code=B.code |
| | | inner join TEqpInfo E on A.wkshp_code=e.wksp_code |
| | | left join(select type,wkshp_code,eqp_code from TAnDon_Task_Info where eqp_code=@eqpcode and wkshp_code=@wkshpcode and status='START') F on A.wkshp_code=F.wkshp_code and E.code=F.eqp_code |
| | | left join( |
| | | select type,wkshp_code,eqp_code from TAnDon_Task_Info where eqp_code=@eqpcode and wkshp_code=@wkshpcode and status='START' |
| | | ) F on A.wkshp_code=F.wkshp_code and E.code=F.eqp_code and B.code=F.type |
| | | where A.wkshp_code=@wkshpcode and E.code=@eqpcode and A.enable='N'"; |
| | | dynamicParams.Add("@wkshpcode", wkshpcode); |
| | | dynamicParams.Add("@eqpcode", eqpcode); |
| | |
| | | mn.flag = data.Rows[i]["FLAG"].ToString(); |
| | | mn.children = new List<AnDnDateSub>(); |
| | | //根据呼叫类型id查找绑定人员 |
| | | sql = @"select U.usercode,U.username |
| | | sql = @"select U.usercode,U.username,U.rid |
| | | from TAnDon_Roul_ConFigUser A |
| | | inner join TUser U on A.usercode=U.usercode |
| | | where A.ando_cogfigid=@id"; |
| | |
| | | for (int j = 0; j < data0.Rows.Count; j++) |
| | | { |
| | | AnDnDateSub sn = new AnDnDateSub(); |
| | | sn.rid= data0.Rows[j]["RID"].ToString();//rid |
| | | sn.alias = data0.Rows[j]["RID"].ToString() + data0.Rows[j]["USERCODE"].ToString(); //别名 |
| | | sn.usercode = data0.Rows[j]["USERCODE"].ToString(); |
| | | sn.username = data0.Rows[j]["USERNAME"].ToString(); |
| | | mn.children.Add(sn); |
| | |
| | | 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>(); |
| | | List<string> list1 = new List<string>(); |
| | | 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, |
| | | alias= json[i].children[j].alias, |
| | | status = "N" |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | //极光推送 |
| | | mes = JPushManage.ExecutePushByUserId(username, wkshpcode, eqpcode, json); |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | | if (aa) |
| | | { |
| | |
| | | try |
| | | { |
| | | //获取对应设备及所属车间的安灯呼叫记录 |
| | | sql = @"select A.eqp_code,B.name as eqp_name,T.org_name,A.type as typecode,D.name as typename |
| | | sql = @"select A.eqp_code,B.name as eqp_name,T.org_code as wksp_code,T.org_name as wksp_name,A.type as typecode,D.name as typename |
| | | from TAnDon_Task_Info A |
| | | left join TEqpInfo B on A.eqp_code=B.code |
| | | left join TOrganization T on B.wksp_code=T.org_code |
| | |
| | | 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(); |