public ActionResult SaveAppForm(string keyValue, string recordData, IntromissionEntity entity) { JArray arr = (JArray)JsonConvert.DeserializeObject(recordData); //只更新审查内容 for (int i = 0; i < arr.Count(); i++) { string id = arr[i]["id"].ToString(); //主键 string result = arr[i]["result"].ToString(); //结果 string people = arr[i]["people"].ToString(); //选择的人员 string peopleid = arr[i]["peopleid"].ToString(); //选择的人员 string signpic = string.IsNullOrWhiteSpace(arr[i]["signpic"].ToString()) ? "" : arr[i]["signpic"].ToString().Replace("../..", ""); if (!string.IsNullOrEmpty(id)) { var scEntity = investigatedtrecordbll.GetEntity(id); //审查内容项 scEntity.INVESTIGATERESULT = result; scEntity.INVESTIGATEPEOPLE = people; scEntity.INVESTIGATEPEOPLEID = peopleid; scEntity.SIGNPIC = signpic; investigatedtrecordbll.SaveForm(id, scEntity); } } return(Success("操作成功。")); }
public ActionResult SaveForm(string keyValue, IntromissionEntity entity) { entity.INVESTIGATESTATE = "0"; if (string.IsNullOrEmpty(keyValue)) { entity.APPLYTIME = DateTime.Now; } intromissionbll.SaveForm(keyValue, entity); return(Success("操作成功。")); }
/// <summary> /// 保存表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="entity">实体对象</param> /// <returns></returns> public void SaveForm(string keyValue, IntromissionEntity entity) { try { service.SaveForm(keyValue, entity); } catch (Exception) { throw; } }
public ActionResult SubmitAppForm(string keyValue, string state, string recordData, IntromissionEntity entity, AptitudeinvestigateauditEntity aentity) { int noDoneCount = 0; //未完成个数 bool isUseSetting = true; int isBack = 0; string newKeyValue = string.Empty; Operator curUser = ERCHTMS.Code.OperatorProvider.Provider.Current(); string status = ""; //更改申请信息状态 ManyPowerCheckEntity mpcEntity = peoplereviewbll.CheckAuditPower(curUser, out status, "入厂许可审查", entity.OUTENGINEERID, false, entity.FLOWID); JArray arr = new JArray(); if (!recordData.IsEmpty()) { arr = (JArray)JsonConvert.DeserializeObject(recordData); } //审查状态下更新审查内容 if (state == "1") { //只更新审查内容 for (int i = 0; i < arr.Count(); i++) { string id = arr[i]["id"].ToString(); //主键 string result = arr[i]["result"].ToString(); //结果 string people = arr[i]["people"].ToString(); //选择的人员 string peopleid = arr[i]["peopleid"].ToString(); //选择的人员 string signpic = string.IsNullOrWhiteSpace(arr[i]["signpic"].ToString()) ? "" : HttpUtility.UrlDecode(arr[i]["signpic"].ToString()).Replace("../..", ""); if (!string.IsNullOrEmpty(id)) { var scEntity = investigatedtrecordbll.GetEntity(id); //审查内容项 scEntity.INVESTIGATERESULT = result; if (result == "未完成") { noDoneCount += 1; } //存在未完成的则累加 scEntity.INVESTIGATEPEOPLE = people; scEntity.INVESTIGATEPEOPLEID = peopleid; scEntity.SIGNPIC = HttpUtility.UrlDecode(signpic); //更新当前流程进行中的审查内容 investigatedtrecordbll.SaveForm(id, scEntity); } } //退回操作(审查退回) if (noDoneCount > 0) { entity.FLOWDEPT = " "; entity.FLOWDEPTNAME = " "; entity.FLOWROLE = " "; entity.FLOWROLENAME = " "; entity.FLOWID = " "; entity.INVESTIGATESTATE = "0"; //更改状态为登记状态 entity.FLOWNAME = ""; isBack = 1; //审查退回 var applyUser = new UserBLL().GetEntity(entity.APPLYPEOPLEID); if (applyUser != null) { JPushApi.PushMessage(applyUser.Account, entity.CREATEUSERNAME, "WB012", entity.ID); } // AddBackData(keyValue, out newKeyValue); } else { if (null != mpcEntity) { entity.FLOWDEPT = mpcEntity.CHECKDEPTID; entity.FLOWDEPTNAME = mpcEntity.CHECKDEPTNAME; entity.FLOWROLE = mpcEntity.CHECKROLEID; entity.FLOWROLENAME = mpcEntity.CHECKROLENAME; entity.FLOWID = mpcEntity.ID; DataTable dt = new UserBLL().GetUserAccountByRoleAndDept(curUser.OrganizeId, mpcEntity.CHECKDEPTID, mpcEntity.CHECKROLENAME); var userAccount = dt.Rows[0]["account"].ToString(); var userName = dt.Rows[0]["realname"].ToString(); JPushApi.PushMessage(userAccount, userName, "WB013", entity.ID); } entity.FLOWNAME = "审核中"; entity.INVESTIGATESTATE = "2"; //更改状态为审核 } } else { //同意进行下一步 if (aentity.AUDITRESULT == "0") { //下一步流程不为空 if (null != mpcEntity) { entity.FLOWDEPT = mpcEntity.CHECKDEPTID; entity.FLOWDEPTNAME = mpcEntity.CHECKDEPTNAME; entity.FLOWROLE = mpcEntity.CHECKROLEID; entity.FLOWROLENAME = mpcEntity.CHECKROLENAME; entity.FLOWID = mpcEntity.ID; DataTable dt = new UserBLL().GetUserAccountByRoleAndDept(curUser.OrganizeId, mpcEntity.CHECKDEPTID, mpcEntity.CHECKROLENAME); var userAccount = dt.Rows[0]["account"].ToString(); var userName = dt.Rows[0]["realname"].ToString(); JPushApi.PushMessage(userAccount, userName, "WB013", entity.ID); } else { entity.FLOWDEPT = " "; entity.FLOWDEPTNAME = " "; entity.FLOWROLE = " "; entity.FLOWROLENAME = " "; entity.FLOWID = " "; entity.FLOWNAME = "已完结"; entity.INVESTIGATESTATE = "3"; //更改状态为完结状态 } //添加审核记录 aentity.APTITUDEID = keyValue; //关联id aentity.AUDITSIGNIMG = HttpUtility.UrlDecode(aentity.AUDITSIGNIMG); aentity.AUDITSIGNIMG = string.IsNullOrWhiteSpace(aentity.AUDITSIGNIMG) ? "" : aentity.AUDITSIGNIMG.ToString().Replace("../..", ""); aptitudeinvestigateauditbll.SaveForm("", aentity); } else //退回到申请人 (审核退回) { entity.FLOWDEPT = " "; entity.FLOWDEPTNAME = " "; entity.FLOWROLE = " "; entity.FLOWROLENAME = " "; entity.FLOWID = " "; entity.INVESTIGATESTATE = "0"; //更改状态为登记状态 entity.FLOWNAME = ""; isBack = 2; //审核退回 var applyUser = new UserBLL().GetEntity(entity.APPLYPEOPLEID); if (applyUser != null) { JPushApi.PushMessage(applyUser.Account, entity.CREATEUSERNAME, "WB012", entity.ID); } // AddBackData(keyValue, out newKeyValue); //添加历史记录 } } //更改入厂许可申请单 intromissionbll.SaveForm(keyValue, entity); //退回操作 if (isBack > 0) { //添加历史记录 AddBackData(keyValue, out newKeyValue); //审核退回 if (isBack > 1) { //获取当前业务对象的所有历史审核记录 var shlist = aptitudeinvestigateauditbll.GetAuditList(keyValue); //批量更新审核记录关联ID foreach (AptitudeinvestigateauditEntity mode in shlist) { mode.APTITUDEID = newKeyValue; //对应新的关联ID aptitudeinvestigateauditbll.SaveForm(mode.ID, mode); } //添加审核记录 aentity.APTITUDEID = newKeyValue; //关联id aentity.AUDITSIGNIMG = HttpUtility.UrlDecode(aentity.AUDITSIGNIMG); aentity.AUDITSIGNIMG = string.IsNullOrWhiteSpace(aentity.AUDITSIGNIMG) ? "" : aentity.AUDITSIGNIMG.ToString().Replace("../..", ""); aptitudeinvestigateauditbll.SaveForm("", aentity); } } return(Success("操作成功。")); }
public ActionResult SubmitForm(string keyValue, IntromissionEntity entity) { Operator curUser = ERCHTMS.Code.OperatorProvider.Provider.Current(); string deptid = string.Empty; string deptname = string.Empty; string roleid = string.Empty; string rolename = string.Empty; bool isMulti = false; //保存信息 entity.INVESTIGATESTATE = "0"; if (string.IsNullOrEmpty(keyValue)) { entity.APPLYTIME = DateTime.Now; } intromissionbll.SaveForm(keyValue, entity); string moduleName = "入厂许可审查"; string outengineerid = entity.OUTENGINEERID; //判断是否需要审查(审查配置表) var list = investigatebll.GetList(curUser.OrganizeId).Where(p => p.SETTINGTYPE == "入厂许可").ToList(); ManyPowerCheckEntity mpcEntity = null; InvestigateEntity investigateEntity = null; bool isUseSetting = true; if (list.Count() > 0) { investigateEntity = list.FirstOrDefault(); } //审查配置不为空 if (null != investigateEntity) { //启用审查 if (investigateEntity.ISUSE == "是") { entity.FLOWNAME = "审查中"; entity.INVESTIGATESTATE = "1"; //审查状态 //新增审查记录 InvestigateRecordEntity rcEntity = new InvestigateRecordEntity(); rcEntity.INTOFACTORYID = entity.ID; rcEntity.INVESTIGATETYPE = "0";//当前记录标识 investigaterecordbll.SaveForm("", rcEntity); //获取审查内容 var contentList = investigatecontentbll.GetList(investigateEntity.ID).ToList(); //批量增加审查内容到审查记录中 foreach (InvestigateContentEntity icEntity in contentList) { InvestigateDtRecordEntity dtEntity = new InvestigateDtRecordEntity(); dtEntity.INVESTIGATERECORDID = rcEntity.ID; dtEntity.INVESTIGATECONTENT = icEntity.INVESTIGATECONTENT; dtEntity.INVESTIGATECONTENTID = icEntity.ID; investigatedtrecordbll.SaveForm("", dtEntity); } } else //未启用审查,直接跳转到审核 { entity.FLOWNAME = "审核中"; entity.INVESTIGATESTATE = "2"; //审核状态 } } else { //如果没有审查配置,直接到审核 isUseSetting = false; entity.FLOWNAME = "审核中"; entity.INVESTIGATESTATE = "2"; //审核状态 } string status = ""; //更改申请信息状态 mpcEntity = peoplereviewbll.CheckAuditPower(curUser, out status, moduleName, outengineerid, false, entity.FLOWID); if (null != mpcEntity) { entity.FLOWDEPT = mpcEntity.CHECKDEPTID; entity.FLOWDEPTNAME = mpcEntity.CHECKDEPTNAME; entity.FLOWROLE = mpcEntity.CHECKROLEID; entity.FLOWROLENAME = mpcEntity.CHECKROLENAME; entity.FLOWID = mpcEntity.ID; DataTable dt = new UserBLL().GetUserAccountByRoleAndDept(curUser.OrganizeId, mpcEntity.CHECKDEPTID, mpcEntity.CHECKROLENAME); var userAccount = dt.Rows[0]["account"].ToString(); var userName = dt.Rows[0]["realname"].ToString(); JPushApi.PushMessage(userAccount, userName, "WB013", entity.ID); } else { entity.FLOWNAME = "已完结"; entity.INVESTIGATESTATE = "3"; //完结状态 } intromissionbll.SaveForm(entity.ID, entity); //推送到下一个流程 return(Success("操作成功。")); }