/// <summary> /// 保存表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="entity">实体对象</param> /// <returns></returns> public void SaveForm(string keyValue, QuestionReformEntity entity) { try { service.SaveForm(keyValue, entity); } catch (Exception) { throw; } }
public ActionResult PointSubmitForm(string keyValue, QuestionVerifyEntity qEntity) { Operator curUser = OperatorProvider.Provider.Current(); try { string wfFlag = string.Empty; //流程标识 string participant = string.Empty; //获取流程下一节点的参与人员 (取验收人) QuestionInfoEntity baseEntity = questioninfobll.GetEntity(keyValue); QuestionReformEntity reformEntity = questionreformbll.GetEntityByBid(keyValue); QuestionVerifyEntity aptEntity = questionverifybll.GetEntityByBid(keyValue); aptEntity.VERIFYRESULT = qEntity.VERIFYRESULT; aptEntity.VERIFYOPINION = qEntity.VERIFYOPINION; aptEntity.MODIFYDATE = DateTime.Now; aptEntity.MODIFYUSERID = curUser.UserId; aptEntity.MODIFYUSERNAME = curUser.UserName; //验证信息 qEntity.QUESTIONID = keyValue; questionverifybll.SaveForm("", qEntity); //返回操作结果成功 if (baseEntity.FLOWSTATE == "流程结束") { wfFlag = "1"; //指定到验证阶段 participant = qEntity.VERIFYPEOPLE; //验证人 if (!string.IsNullOrEmpty(participant)) { int count = htworkflowbll.SubmitWorkFlow(keyValue, participant, wfFlag, curUser.UserId); if (count > 0) { htworkflowbll.UpdateFlowStateByObjectId("bis_questioninfo", "flowstate", keyValue); //更新业务流程状态 } } else { return(Error("请选择验证人!")); } } } catch (Exception ex) { return(Error(ex.Message)); } return(Success("提交成功!")); }
public ActionResult SaveForm(string keyValue, QuestionReformEntity entity) { Operator curUser = OperatorProvider.Provider.Current(); QuestionReformEntity rEntity = questionreformbll.GetEntityByBid(keyValue); rEntity.REFORMFINISHDATE = entity.REFORMFINISHDATE; rEntity.REFORMMEASURE = entity.REFORMMEASURE; rEntity.REFORMSTATUS = entity.REFORMSTATUS; rEntity.MODIFYDATE = DateTime.Now; rEntity.MODIFYUSERID = curUser.UserId; rEntity.MODIFYUSERNAME = curUser.UserName; rEntity.REFORMPIC = entity.REFORMPIC; rEntity.REFORMSIGN = !string.IsNullOrEmpty(entity.REFORMSIGN) ? HttpUtility.UrlDecode(entity.REFORMSIGN) :""; rEntity.REFORMDESCRIBE = entity.REFORMDESCRIBE; rEntity.REFORMFINISHDATE = entity.REFORMFINISHDATE; rEntity.REFORMPIC = entity.REFORMPIC; rEntity.REFORMREASON = entity.REFORMREASON; questionreformbll.SaveForm(rEntity.ID, rEntity); return(Success("操作成功。")); }
public ActionResult ToTargetContent(string keyValue, int mode) { //当前用户 Operator curUser = OperatorProvider.Provider.Current(); var entity = findquestioninfobll.GetEntity(keyValue); //发现问题对象 var userInfo = userbll.GetUserInfoEntity(entity.CREATEUSERID); //创建人对象 List <FileInfoEntity> filelist = fileinfobll.GetImageListByObject(entity.QUESTIONPIC).ToList(); //问题图片集合 string resultMsg = string.Empty; //返回结果信息 bool isSucess = false; //创建流程是否成功 bool isSucessful = true; //返回流程推进结果 string wfFlag = string.Empty; //流程流转标记 string participant = string.Empty; //下一步流程参与者 string workFlow = string.Empty; //流程实例代码 string applicationId = string.Empty; //关联的应用id string applicationType = string.Empty; //关联的应用类型 WfControlObj wfentity = new WfControlObj(); WfControlResult result = new WfControlResult(); switch (mode) { //转隐患 case 0: applicationType = "yh"; #region 转隐患 string HidCode = DateTime.Now.ToString("yyyyMMddHHmmssfff").ToString(); try { #region 隐患基本信息 HTBaseInfoEntity bentity = new HTBaseInfoEntity(); bentity.ADDTYPE = "0"; bentity.CREATEUSERID = userInfo.UserId; bentity.CREATEUSERNAME = userInfo.RealName; bentity.CREATEUSERDEPTCODE = userInfo.DepartmentCode; bentity.CREATEUSERORGCODE = userInfo.OrganizeCode; bentity.HIDCODE = HidCode; bentity.HIDDEPART = userInfo.OrganizeId; bentity.HIDDEPARTNAME = userInfo.OrganizeName; bentity.HIDPHOTO = Guid.NewGuid().ToString(); //图片 foreach (FileInfoEntity fentity in filelist) { string sourcefile = Server.MapPath(fentity.FilePath); string targetFileName = Guid.NewGuid().ToString() + "." + fentity.FileType; string targetUrl = fentity.FilePath.Substring(0, fentity.FilePath.LastIndexOf("/")); if (System.IO.File.Exists(sourcefile)) { System.IO.FileInfo sfileInfo = new System.IO.FileInfo(sourcefile); string targetDir = sfileInfo.DirectoryName; string targetFile = targetDir + "\\" + targetFileName; System.IO.File.Copy(sourcefile, targetFile); } FileInfoEntity newfileEntity = new FileInfoEntity(); newfileEntity = fentity; newfileEntity.FilePath = targetUrl + "/" + targetFileName; newfileEntity.FileId = string.Empty; newfileEntity.RecId = bentity.HIDPHOTO; fileinfobll.SaveForm("", newfileEntity); } bentity.HIDBMID = entity.DEPTID; //所属部门id bentity.HIDBMNAME = entity.DEPTNAME; //所属部门名称 bentity.HIDDESCRIBE = entity.QUESTIONCONTENT; //隐患描述(问题内容) //排查信息 bentity.CHECKDATE = DateTime.Now; bentity.CHECKMAN = userInfo.UserId; bentity.CHECKMANNAME = userInfo.RealName; bentity.CHECKDEPARTID = userInfo.DepartmentCode; bentity.CHECKDEPARTNAME = userInfo.DeptName; //bentity.CHECKTYPE = dataitemdetailbll.GetDataItemListByItemCode("'SaftyCheckType'").Where(p => p.ItemName.Contains("日常")).FirstOrDefault().ItemDetailId; //检查类型 //添加 htbaseinfobll.SaveForm("", bentity); applicationId = bentity.ID; #endregion #region 创建隐患流程 workFlow = "01"; //隐患处理 isSucess = htworkflowbll.CreateWorkFlowObj(workFlow, applicationId, userInfo.UserId); if (isSucess) { htworkflowbll.UpdateWorkStreamByObjectId(applicationId); //更新业务流程状态 } #endregion #region 整改信息 HTChangeInfoEntity centity = new HTChangeInfoEntity(); centity.HIDCODE = HidCode; htchangeinfobll.SaveForm("", centity); #endregion #region 验收信息 HTAcceptInfoEntity aentity = new HTAcceptInfoEntity(); aentity.HIDCODE = HidCode; htacceptinfobll.SaveForm("", aentity); #endregion #region 推进流程 wfentity.businessid = applicationId; //隐患主键 wfentity.argument1 = string.Empty; //专业分类 wfentity.argument2 = userInfo.DepartmentId; //当前部门 wfentity.argument3 = string.Empty; //隐患类别 wfentity.argument4 = bentity.HIDBMID; //所属部门 wfentity.startflow = "隐患登记"; wfentity.submittype = "提交"; wfentity.rankid = string.Empty; wfentity.spuser = userInfo; wfentity.mark = "厂级隐患排查"; wfentity.organizeid = bentity.HIDDEPART; //对应电厂id //获取下一流程的操作人 result = wfcontrolbll.GetWfControl(wfentity); //处理成功 if (result.code == WfCode.Sucess) { participant = result.actionperson; wfFlag = result.wfflag; if (!string.IsNullOrEmpty(participant)) { int count = htworkflowbll.SubmitWorkFlow(wfentity, result, applicationId, participant, wfFlag, userInfo.UserId); if (count > 0) { htworkflowbll.UpdateWorkStreamByObjectId(applicationId); //更新业务流程状态 } } else { isSucessful = false; resultMsg = "请联系系统管理员,添加本单位及相关单位评估人员!"; } resultMsg = "已成功转为隐患,并进入对应流程,请知晓"; } else { isSucessful = false; resultMsg = result.message; } #endregion } catch (Exception ex) { isSucessful = false; resultMsg = ex.Message; } #endregion break; //转违章 case 1: applicationType = "wz"; #region 转违章 try { #region 违章基础信息 string lenNum = !string.IsNullOrEmpty(dataitemdetailbll.GetItemValue("LllegalSerialNumberLen")) ? dataitemdetailbll.GetItemValue("LllegalSerialNumberLen") : "3"; LllegalRegisterEntity wzentity = new LllegalRegisterEntity(); wzentity.ADDTYPE = "0"; wzentity.LLLEGALNUMBER = lllegalregisterbll.GenerateHidCode("bis_lllegalregister", "lllegalnumber", int.Parse(lenNum)); //违章编码 wzentity.CREATEUSERID = userInfo.UserId; wzentity.CREATEUSERNAME = userInfo.RealName; wzentity.CREATEUSERDEPTCODE = userInfo.DepartmentCode; wzentity.CREATEUSERORGCODE = userInfo.OrganizeCode; wzentity.CREATEDEPTID = userInfo.DepartmentId; wzentity.CREATEDEPTNAME = userInfo.DeptName; //所属单位 wzentity.BELONGDEPARTID = userInfo.OrganizeId; wzentity.BELONGDEPART = userInfo.OrganizeName; wzentity.LLLEGALPIC = Guid.NewGuid().ToString(); foreach (FileInfoEntity fentity in filelist) { string sourcefile = Server.MapPath(fentity.FilePath); string targetFileName = Guid.NewGuid().ToString() + "." + fentity.FileType; string targetUrl = fentity.FilePath.Substring(0, fentity.FilePath.LastIndexOf("/")); if (System.IO.File.Exists(sourcefile)) { System.IO.FileInfo sfileInfo = new System.IO.FileInfo(sourcefile); string targetDir = sfileInfo.DirectoryName; string targetFile = targetDir + "\\" + targetFileName; System.IO.File.Copy(sourcefile, targetFile); } FileInfoEntity newfileEntity = new FileInfoEntity(); newfileEntity = fentity; newfileEntity.FilePath = targetUrl + "/" + targetFileName; newfileEntity.FileId = string.Empty; newfileEntity.RecId = wzentity.LLLEGALPIC; fileinfobll.SaveForm("", newfileEntity); } wzentity.LLLEGALDESCRIBE = entity.QUESTIONCONTENT; lllegalregisterbll.SaveForm("", wzentity); applicationId = wzentity.ID; #endregion #region 创建流程 workFlow = "03"; isSucess = htworkflowbll.CreateWorkFlowObj(workFlow, applicationId, userInfo.UserId); if (isSucess) { lllegalregisterbll.UpdateFlowStateByObjectId("bis_lllegalregister", "flowstate", applicationId); //更新业务流程状态 } #endregion if (!string.IsNullOrEmpty(wzentity.ID)) { wzentity = lllegalregisterbll.GetEntity(wzentity.ID); } #region 违章整改信息 LllegalReformEntity reformEntity = new LllegalReformEntity(); reformEntity.LLLEGALID = applicationId; lllegalreformbll.SaveForm("", reformEntity); #endregion #region 违章验收信息 LllegalAcceptEntity acceptEntity = new LllegalAcceptEntity(); acceptEntity.LLLEGALID = applicationId; lllegalacceptbll.SaveForm("", acceptEntity); #endregion #region 推进流程 wfentity.businessid = applicationId; //主键 wfentity.argument3 = userInfo.DepartmentId; //当前部门id wfentity.startflow = wzentity.FLOWSTATE; wfentity.submittype = "提交"; wfentity.rankid = null; wfentity.spuser = userInfo; wfentity.mark = "厂级违章流程"; wfentity.organizeid = wzentity.BELONGDEPARTID; //对应电厂id //获取下一流程的操作人 result = wfcontrolbll.GetWfControl(wfentity); //处理成功 if (result.code == WfCode.Sucess) { participant = result.actionperson; wfFlag = result.wfflag; //提交流程到下一节点 if (!string.IsNullOrEmpty(participant)) { int count = htworkflowbll.SubmitWorkFlow(wfentity, result, applicationId, participant, wfFlag, userInfo.UserId); if (count > 0) { htworkflowbll.UpdateFlowStateByObjectId("bis_lllegalregister", "flowstate", applicationId); //更新业务流程状态 } } resultMsg = "已成功转为违章,并进入对应流程,请知晓"; } else { isSucessful = false; resultMsg = result.message; } #endregion } catch (Exception ex) { isSucessful = false; resultMsg = ex.Message; } #endregion break; //转问题 case 2: applicationType = "wt"; #region 转问题 try { #region 基础信息 QuestionInfoEntity qtEntity = new QuestionInfoEntity(); qtEntity.QUESTIONNUMBER = questioninfobll.GenerateCode("bis_questioninfo", "questionnumber", 4); qtEntity.CREATEUSERID = userInfo.UserId; qtEntity.CREATEUSERNAME = userInfo.RealName; qtEntity.CREATEUSERDEPTCODE = userInfo.DepartmentCode; qtEntity.CREATEUSERORGCODE = userInfo.OrganizeCode; qtEntity.BELONGDEPTID = userInfo.OrganizeId; qtEntity.BELONGDEPTNAME = userInfo.OrganizeName; qtEntity.QUESTIONPIC = Guid.NewGuid().ToString(); foreach (FileInfoEntity fentity in filelist) { string sourcefile = Server.MapPath(fentity.FilePath); string targetFileName = Guid.NewGuid().ToString() + "." + fentity.FileType; string targetUrl = fentity.FilePath.Substring(0, fentity.FilePath.LastIndexOf("/")); if (System.IO.File.Exists(sourcefile)) { System.IO.FileInfo sfileInfo = new System.IO.FileInfo(sourcefile); string targetDir = sfileInfo.DirectoryName; string targetFile = targetDir + "\\" + targetFileName; System.IO.File.Copy(sourcefile, targetFile); } FileInfoEntity newfileEntity = new FileInfoEntity(); newfileEntity = fentity; newfileEntity.FilePath = targetUrl + "/" + targetFileName; newfileEntity.FileId = string.Empty; newfileEntity.RecId = qtEntity.QUESTIONPIC; fileinfobll.SaveForm("", newfileEntity); } qtEntity.QUESTIONDESCRIBE = entity.QUESTIONCONTENT; qtEntity.CHECKDATE = DateTime.Now; qtEntity.CHECKPERSONID = userInfo.UserId; qtEntity.CHECKPERSONNAME = userInfo.RealName; qtEntity.CHECKDEPTID = userInfo.DepartmentId; qtEntity.CHECKDEPTNAME = userInfo.DeptName; //qtEntity.CHECKTYPE = dataitemdetailbll.GetDataItemListByItemCode("'SaftyCheckType'").Where(p => p.ItemName.Contains("日常")).FirstOrDefault().ItemDetailId; //检查类型 questioninfobll.SaveForm("", qtEntity); applicationId = qtEntity.ID; #endregion #region 创建流程 workFlow = "09"; //问题处理 isSucess = htworkflowbll.CreateWorkFlowObj(workFlow, applicationId, userInfo.UserId); if (isSucess) { htworkflowbll.UpdateFlowStateByObjectId("bis_questioninfo", "flowstate", applicationId); //更新业务流程状态 } #endregion #region 整改信息 QuestionReformEntity qtreformEntity = new QuestionReformEntity(); qtreformEntity.QUESTIONID = applicationId; questionreformbll.SaveForm("", qtreformEntity); #endregion //极光消息推送 JPushApi.PushMessage(userInfo.Account, userInfo.RealName, "WT001", "您有一条问题需完善,请到问题登记进行处理", "您" + entity.CREATEDATE.Value.ToString("yyyy-MM-dd") + "发现的问题已确定为问题,请您到问题登记下对该问题进行完善并指定对应整改责任人。", applicationId); resultMsg = "已成功转为问题,并进入对应流程,请知晓"; } catch (Exception ex) { isSucessful = false; resultMsg = ex.Message; } #endregion break; } try { if (isSucessful) { //评估阶段转 if (entity.FLOWSTATE == "评估") { #region 推进发现问题流程 wfentity = new WfControlObj(); wfentity.businessid = keyValue; // wfentity.startflow = entity.FLOWSTATE; wfentity.submittype = "提交"; wfentity.rankid = string.Empty; wfentity.user = curUser; wfentity.spuser = null; wfentity.mark = "发现问题流程"; wfentity.organizeid = entity.ORGANIZEID; //对应电厂id //获取下一流程的操作人 result = wfcontrolbll.GetWfControl(wfentity); //处理成功 if (result.code == WfCode.Sucess) { participant = result.actionperson; wfFlag = result.wfflag; //提交流程到下一节点 if (!string.IsNullOrEmpty(participant)) { int count = htworkflowbll.SubmitWorkFlow(wfentity, result, keyValue, participant, wfFlag, curUser.UserId); if (count > 0) { //返回成功的结果 #region 返回成功的结果 FindQuestionHandleEntity qentity = new FindQuestionHandleEntity(); if (mode == 0) { qentity.HANDLESTATUS = "已转隐患"; } else if (mode == 1) { qentity.HANDLESTATUS = "已转违章"; } else if (mode == 2) { qentity.HANDLESTATUS = "已转问题"; } qentity.HANDLEDATE = DateTime.Now; qentity.HANDLERID = curUser.UserId; qentity.HANDLERNAME = curUser.UserName; qentity.QUESTIONID = keyValue; qentity.RELEVANCEID = applicationId; qentity.RELEVANCETYPE = applicationType; qentity.APPSIGN = "Web"; findquestionhandlebll.SaveForm("", qentity); #endregion htworkflowbll.UpdateFlowStateByObjectId("bis_findquestioninfo", "flowstate", keyValue); //更新业务流程状态 } } return(Success(resultMsg)); } else { return(Error(result.message)); } #endregion } else //结束阶段转 列表转 { //返回成功的结果 #region 返回成功的结果 FindQuestionHandleEntity qentity = new FindQuestionHandleEntity(); if (mode == 0) { qentity.HANDLESTATUS = "已转隐患"; } else if (mode == 1) { qentity.HANDLESTATUS = "已转违章"; } else if (mode == 2) { qentity.HANDLESTATUS = "已转问题"; } qentity.HANDLEDATE = DateTime.Now; qentity.HANDLERID = curUser.UserId; qentity.HANDLERNAME = curUser.UserName; qentity.QUESTIONID = keyValue; qentity.RELEVANCEID = applicationId; qentity.RELEVANCETYPE = applicationType; qentity.APPSIGN = "Web"; findquestionhandlebll.SaveForm("", qentity); #endregion return(Success(resultMsg)); } } else { return(Error(resultMsg)); } } catch (Exception ex) { return(Error(ex.Message)); } }
public ActionResult SubmitForm(string keyValue, QuestionInfoEntity entity, QuestionReformEntity rEntity, QuestionVerifyEntity aEntity) { Operator curUser = OperatorProvider.Provider.Current(); string participant = string.Empty; string wfFlag = string.Empty; WfControlResult result = new WfControlResult(); try { //保存退回操作信息 QuestionInfoEntity baseentity = questioninfobll.GetEntity(keyValue); questioninfobll.SaveForm(keyValue, baseentity); //整改信息 QuestionReformEntity rfEntity = questionreformbll.GetEntityByBid(keyValue); rfEntity.REFORMDESCRIBE = rEntity.REFORMDESCRIBE; //整改情况描述 rfEntity.REFORMFINISHDATE = rEntity.REFORMFINISHDATE; //整改结束时间 rfEntity.REFORMMEASURE = rEntity.REFORMMEASURE; //整改措施 rfEntity.REFORMSTATUS = rEntity.REFORMSTATUS; //整改完成情况 rfEntity.REFORMSIGN = !string.IsNullOrEmpty(rEntity.REFORMSIGN) ? HttpUtility.UrlDecode(rEntity.REFORMSIGN) : ""; rfEntity.REFORMREASON = rEntity.REFORMREASON; //未完成原因 rfEntity.MODIFYDATE = DateTime.Now; rfEntity.MODIFYUSERID = curUser.UserId; rfEntity.MODIFYUSERNAME = curUser.UserName; rfEntity.REFORMPIC = rEntity.REFORMPIC; //整改图片 #region MyRegion WfControlObj wfentity = new WfControlObj(); wfentity.businessid = keyValue; wfentity.startflow = "问题整改"; wfentity.rankid = null; wfentity.user = curUser; wfentity.argument1 = curUser.UserId; wfentity.organizeid = baseentity.BELONGDEPTID; //对应电厂id wfentity.mark = "厂级问题流程"; wfentity.submittype = "提交"; //获取下一流程的操作人 result = wfcontrolbll.GetWfControl(wfentity); //处理成功 if (result.code == WfCode.Sucess) { //参与者 participant = result.actionperson; //状态 wfFlag = result.wfflag; //提交流程到下一节点 if (!string.IsNullOrEmpty(participant)) { int count = htworkflowbll.SubmitWorkFlow(wfentity, result, keyValue, participant, wfFlag, curUser.UserId); if (count > 0) { //更新整改内容 //rfEntity.REFORMDEPTCODE = curUser.DeptCode; //当前人 //rfEntity.REFORMDEPTID = curUser.DeptId; //rfEntity.REFORMDEPTNAME = curUser.DeptName; rfEntity.REFORMPEOPLE = curUser.Account; rfEntity.REFORMPEOPLENAME = curUser.UserName; questionreformbll.SaveForm(rfEntity.ID, rfEntity); htworkflowbll.UpdateFlowStateByObjectId("bis_questioninfo", "flowstate", keyValue); //更新业务流程状态 } } else { return(Error("请联系系统管理员,确认提交问题!")); } } else if (result.code == WfCode.NoInstance || result.code == WfCode.NoEnable) { wfFlag = "1"; //到验证阶段 participant = aEntity.VERIFYPEOPLE; //验证人 if (!string.IsNullOrEmpty(participant)) { int count = htworkflowbll.SubmitWorkFlow(keyValue, participant, wfFlag, curUser.UserId); if (count > 0) { //更新整改内容 //rfEntity.REFORMDEPTCODE = curUser.DeptCode; //当前人 //rfEntity.REFORMDEPTID = curUser.DeptId; //rfEntity.REFORMDEPTNAME = curUser.DeptName; rfEntity.REFORMPEOPLE = curUser.Account; rfEntity.REFORMPEOPLENAME = curUser.UserName; questionreformbll.SaveForm(rfEntity.ID, rfEntity); htworkflowbll.UpdateFlowStateByObjectId("bis_questioninfo", "flowstate", keyValue); //更新业务流程状态 } return(Success("操作成功!")); } else { return(Success("操作失败,请联系管理员!")); } } if (result.code == WfCode.Sucess) { return(Success(result.message)); } else //其他返回状态 { return(Error(result.message)); } #endregion } catch (Exception ex) { return(Error(ex.Message)); } }
public ActionResult SubmitForm(string keyValue, QuestionVerifyEntity qEntity) { Operator curUser = OperatorProvider.Provider.Current(); WfControlResult result = new WfControlResult(); try { string wfFlag = string.Empty; //流程标识 string participant = string.Empty; //获取流程下一节点的参与人员 (取验收人) QuestionInfoEntity baseEntity = questioninfobll.GetEntity(keyValue); QuestionReformEntity reformEntity = questionreformbll.GetEntityByBid(keyValue); QuestionVerifyEntity aptEntity = questionverifybll.GetEntityByBid(keyValue); if (null == aptEntity) { aptEntity = new QuestionVerifyEntity(); } aptEntity.QUESTIONID = keyValue; aptEntity.VERIFYRESULT = qEntity.VERIFYRESULT; aptEntity.VERIFYOPINION = qEntity.VERIFYOPINION; aptEntity.MODIFYDATE = DateTime.Now; aptEntity.MODIFYUSERID = curUser.UserId; aptEntity.MODIFYUSERNAME = curUser.UserName; aptEntity.VERIFYSIGN = !string.IsNullOrEmpty(qEntity.VERIFYSIGN) ? HttpUtility.UrlDecode(qEntity.VERIFYSIGN) : ""; aptEntity.VERIFYDATE = qEntity.VERIFYDATE; WfControlObj wfentity = new WfControlObj(); wfentity.businessid = keyValue; wfentity.startflow = baseEntity.FLOWSTATE; wfentity.rankid = null; wfentity.user = curUser; wfentity.argument1 = curUser.UserId; wfentity.organizeid = baseEntity.BELONGDEPTID; //对应电厂id //厂级 wfentity.mark = "厂级问题流程"; //验证通过 if (qEntity.VERIFYRESULT == "1") { wfentity.submittype = "提交"; } else //验证不通过 { wfentity.submittype = "退回"; } //获取下一流程的操作人 result = wfcontrolbll.GetWfControl(wfentity); //返回操作结果成功(配置流程的情况下) if (result.code == WfCode.Sucess) { participant = result.actionperson; wfFlag = result.wfflag; //如果是更改状态 #region 如果是更改状态 if (result.ischangestatus) { //提交流程到下一节点 if (!string.IsNullOrEmpty(participant)) { int count = htworkflowbll.SubmitWorkFlow(wfentity, result, keyValue, participant, wfFlag, curUser.UserId); if (count > 0) { //添加问题验证记录 aptEntity.ID = null; aptEntity.VERIFYDEPTID = curUser.DeptId; aptEntity.VERIFYDEPTCODE = curUser.DeptCode; aptEntity.VERIFYDEPTNAME = curUser.DeptName; aptEntity.VERIFYPEOPLE = curUser.Account; aptEntity.VERIFYPEOPLENAME = curUser.UserName; questionverifybll.SaveForm("", aptEntity); //退回则重新添加验证记录 if (wfFlag == "2") { QuestionReformEntity newEntity = new QuestionReformEntity(); newEntity = reformEntity; newEntity.CREATEDATE = DateTime.Now; newEntity.MODIFYDATE = DateTime.Now; newEntity.MODIFYUSERID = curUser.UserId; newEntity.MODIFYUSERNAME = curUser.UserName; newEntity.REFORMPIC = null; //重新生成图片GUID newEntity.REFORMSTATUS = null; //整改完成情况 newEntity.REFORMDESCRIBE = null; //整改情况描述 newEntity.REFORMFINISHDATE = null; //整改完成时间 newEntity.ID = ""; questionreformbll.SaveForm("", newEntity); //验证记录记录 QuestionVerifyEntity cptEntity = new QuestionVerifyEntity(); cptEntity = aptEntity; cptEntity.ID = null; cptEntity.CREATEDATE = DateTime.Now; cptEntity.MODIFYDATE = DateTime.Now; cptEntity.VERIFYRESULT = null; cptEntity.VERIFYOPINION = null; cptEntity.VERIFYSIGN = null; questionverifybll.SaveForm("", cptEntity); } htworkflowbll.UpdateFlowStateByObjectId("bis_questioninfo", "flowstate", keyValue); //更新业务流程状态 } else { return(Error("当前用户无评估权限!")); } } else { return(Error(result.message)); } } #endregion #region 更改状态的情况下 else //不更改状态的情况下 { //保存隐患评估信息 #region 提交流程到下一节点 if (!string.IsNullOrEmpty(participant)) { //添加问题验证记录 aptEntity.ID = null; aptEntity.VERIFYDEPTID = curUser.DeptId; aptEntity.VERIFYDEPTCODE = curUser.DeptCode; aptEntity.VERIFYDEPTNAME = curUser.DeptName; aptEntity.VERIFYPEOPLE = curUser.Account; aptEntity.VERIFYPEOPLENAME = curUser.UserName; questionverifybll.SaveForm("", aptEntity); htworkflowbll.SubmitWorkFlowNoChangeStatus(wfentity, result, keyValue, participant, curUser.UserId); } else { return(Error(result.message)); } #endregion } #endregion } //不按照配置 else if (result.code == WfCode.NoInstance || result.code == WfCode.NoEnable) { //验证通过 if (qEntity.VERIFYRESULT == "1") { wfFlag = "1"; participant = curUser.Account; } else //验证不通过 { wfFlag = "2"; participant = reformEntity.REFORMPEOPLE; //整改人 } if (!string.IsNullOrEmpty(participant)) { int count = htworkflowbll.SubmitWorkFlow(keyValue, participant, wfFlag, curUser.UserId); if (count > 0) { //添加问题验证记录 aptEntity.VERIFYDEPTID = curUser.DeptId; aptEntity.VERIFYDEPTCODE = curUser.DeptCode; aptEntity.VERIFYDEPTNAME = curUser.DeptName; aptEntity.VERIFYPEOPLE = curUser.Account; aptEntity.VERIFYPEOPLENAME = curUser.UserName; questionverifybll.SaveForm(aptEntity.ID, aptEntity); //退回则重新添加验证记录 if (wfFlag == "2") { QuestionReformEntity newEntity = new QuestionReformEntity(); newEntity = reformEntity; newEntity.CREATEDATE = DateTime.Now; newEntity.MODIFYDATE = DateTime.Now; newEntity.MODIFYUSERID = curUser.UserId; newEntity.MODIFYUSERNAME = curUser.UserName; newEntity.REFORMPIC = null; //重新生成图片GUID newEntity.REFORMSTATUS = null; //整改完成情况 newEntity.REFORMDESCRIBE = null; //整改情况描述 newEntity.REFORMFINISHDATE = null; //整改完成时间 newEntity.ID = ""; questionreformbll.SaveForm("", newEntity); //验证记录记录 QuestionVerifyEntity cptEntity = new QuestionVerifyEntity(); cptEntity = aptEntity; cptEntity.ID = null; cptEntity.CREATEDATE = DateTime.Now; cptEntity.MODIFYDATE = DateTime.Now; cptEntity.VERIFYRESULT = null; cptEntity.VERIFYOPINION = null; cptEntity.VERIFYSIGN = null; questionverifybll.SaveForm("", cptEntity); } htworkflowbll.UpdateFlowStateByObjectId("bis_questioninfo", "flowstate", keyValue); //更新业务流程状态 } result.message = "操作成功!"; } else { return(Error("操作失败,请联系管理员!")); } } } catch (Exception ex) { return(Error(ex.Message)); } return(Success(result.message)); }