public int SmassignTeam(Audit_project_wModel model, List <FileClass> list) { int userid = Convert.ToInt32(model.createuserid); approvalDetail result = bll.GetApprovalDetail(model.syncrowguid); string[] wfdidlist = { "2017070414250001", "2017070414250002", "2017070414250003", "2017070414250004", "2017070414250005" }; WorkFlowClass wf = new WorkFlowClass(); wf.FunctionName = "audit_project_w"; //行政审批表名 wf.WFID = "2017070414220001"; //工作流程编号 wf.WFDID = model.wfdid; //工作详细编号 if (result != null) { wf.WFSID = result.wfsid; wf.WFSAID = result.wfsaid; } wf.NextWFDID = model.nextwfdid; //下一步流程详细编号 wf.NextWFUSERIDS = model.nextuserid.ToString(); //下一步流程用户id wf.IsSendMsg = "false"; //是否发送短信 wf.WFCreateUserID = model.createuserid; //当前流程创建人 wf.DEALCONTENT = model.advice; //处理意见 wf.syncrowguid = model.syncrowguid; wf.Remark = model.geography; wf.files = list; if (wf.WFDID == wfdidlist[0]) { wf.Remark = model.xzxkaddress; wf.satisfaction = model.xzxkstarttime; wf.processmode = model.xzxkendtime; } else if (wf.WFDID == wfdidlist[2]) { wf.Remark = model.geography; } WorkFlowManagerBLL wfbll = new WorkFlowManagerBLL(); string wf_id = wfbll.WF_Submit(wf, model); #region 发送短信 int success = wf_id != null ? 1 : 0; if (wf.NextWFUSERIDS != null && model.isSendMsg == 1 && model.phone != null && model.phone.Length > 0) { UserBLL userbll = new UserBLL(); string phone = model.phone; //phone="18768196242"; string[] numbers = phone.Split(','); string msg = "您有一条新的行政审批数据需要处理,审批信息:" + model.projectname + "(" + model.applyername + ")"; SMSMessagesBLL smsbll = new SMSMessagesBLL(); smsbll.SendMessage(numbers, msg); } #endregion return(success); }
public HttpResponseMessage assignTeam(Audit_project_wModel model) { #region 获取上传附件 string[] fileClass = model.uploadpanelValue; List <FileClass> list = new List <FileClass>(); if (fileClass != null && fileClass.Length > 0) { foreach (var item in fileClass) { FileClass file = new FileClass(); JObject jo = new JObject(); jo = (JObject)JsonConvert.DeserializeObject(item); file.OriginalPath = jo["OriginalPath"] == null ? "" : jo["OriginalPath"].ToString(); file.OriginalName = jo["OriginalName"] == null ? "" : jo["OriginalName"].ToString(); file.OriginalType = jo["OriginalType"] == null ? "" : jo["OriginalType"].ToString(); file.size = jo["size"] == null ? 0 : (double)jo["size"]; list.Add(file); } } #endregion int userid = Convert.ToInt32(model.createuserid); //获取当前流程wfdid approvalDetail result = bll.GetApprovalDetail(model.syncrowguid); string[] wfdidlist = { "2017070414250001", "2017070414250002", "2017070414250003", "2017070414250004", "2017070414250005", "2017070414250006" }; WorkFlowClass wf = new WorkFlowClass(); wf.FunctionName = "audit_project_w"; //行政审批表名 wf.WFID = "2017070414220001"; //工作流程编号=.=固定 wf.WFDID = model.wfdid; //工作详细编号 if (result != null) { wf.WFSID = result.wfsid; wf.WFSAID = result.wfsaid; } wf.NextWFDID = model.nextwfdid; //下一步流程详细编号 wf.NextWFUSERIDS = model.nextuserid.ToString(); //下一步流程用户id wf.IsSendMsg = "false"; //是否发送短信 wf.WFCreateUserID = model.createuserid; //当前流程创建人 wf.DEALCONTENT = model.advice; //处理意见 wf.syncrowguid = model.syncrowguid; wf.files = list; if (wf.WFDID == wfdidlist[0]) { wf.Remark = model.xzxkaddress; wf.satisfaction = model.xzxkstarttime; wf.processmode = model.xzxkendtime; } else if (wf.WFDID == wfdidlist[2]) { wf.Remark = model.geography; } WorkFlowManagerBLL wfbll = new WorkFlowManagerBLL(); string wf_id = wfbll.WF_Submit(wf, model); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK); if (wf_id != null && model.isSendMsg == 1) { #region 发送短信 if (wf.NextWFUSERIDS != null && model.isSendMsg == 1 && model.phone != null && model.phone.Length > 0) { UserBLL userbll = new UserBLL(); string phone = model.phone; //phone="18768196242"; string[] numbers = phone.Split(','); string msg = "您有一条新的行政审批数据需要处理,审批信息:" + model.projectname + "(" + model.applyername + ")"; SMSMessagesBLL smsbll = new SMSMessagesBLL(); smsbll.SendMessage(numbers, msg); } #endregion response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html"); } else { response.Content = new StringContent("{\"success\":false}", Encoding.GetEncoding("UTF-8"), "text/html"); } return(response); }