/// <summary> /// 审核更新 /// </summary> /// <param name="certEntity">凭吊证实体</param> /// <param name="auditEntity">审核实体</param> public void ApplyCheck(LifthoistcertEntity certEntity, LifthoistauditrecordEntity auditEntity) { var res = DbFactory.Base().BeginTrans(); try { List <LifthoistsafetyEntity> safetyList = certEntity.safetys; //设为null,避免数据库更新报错 certEntity.safetys = null; //起重吊装作业直接更新 res.Update(certEntity); //审核实体不为空时,才插入 if (auditEntity != null) { auditEntity.Create(); auditEntity.BUSINESSID = certEntity.ID; res.Insert(auditEntity); } SaveSafetys(certEntity.ID, safetyList, res); res.Commit(); } catch (Exception ex) { res.Rollback(); throw ex; } }
/// <summary> /// 审核更新 /// </summary> /// <param name="jobEntity">起重吊装作业实体</param> /// <param name="auditEntity">审核实体</param> public void ApplyCheck(LifthoistjobEntity jobEntity, LifthoistauditrecordEntity auditEntity) { var res = DbFactory.Base().BeginTrans(); try { //起重吊装作业直接更新 res.Update(jobEntity); //审核实体不为空时,才插入 if (auditEntity != null) { auditEntity.Create(); auditEntity.BUSINESSID = jobEntity.ID; if (auditEntity.AUDITSTATE == 0) { var list = new LifthoistauditrecordService().GetList(jobEntity.ID); foreach (var item in list) { item.DISABLE = 1; res.Update(item); } auditEntity.DISABLE = 1; } res.Insert(auditEntity); } res.Commit(); } catch (Exception ex) { res.Rollback(); throw ex; } }
public object Audit() { try { string res = HttpContext.Current.Request["json"]; var dy = JsonConvert.DeserializeAnonymousType(res, new { userid = string.Empty, data = new { id = string.Empty, pagetype = string.Empty, auditEntity = new LifthoistauditrecordEntity(), entity = new LifthoistcertEntity() } }); //获取用户Id string userId = dy.userid; OperatorProvider.AppUserId = userId; //设置当前用户 Operator curUser = OperatorProvider.Provider.Current(); if (null == curUser) { return(new { code = -1, info = "请求失败,请登录!" }); } if (dy.data == null) { return(new { code = -1, info = "请求失败,data参数为空!" }); } LifthoistauditrecordEntity auditEntity = JsonConvert.DeserializeObject <LifthoistauditrecordEntity>(JsonConvert.SerializeObject(dy.data.auditEntity)); if (dy.data.pagetype == "1") { LifthoistcertEntity certEntity = null; if (dy.data.entity != null) { certEntity = JsonConvert.DeserializeObject <LifthoistcertEntity>(JsonConvert.SerializeObject(dy.data.entity)); //负责人签字 certEntity.CHARGEPERSONSIGN = UploadifyFile(certEntity.ID + "3", "chargerersonsign", HttpContext.Current.Request.Files); //吊装区域内人员签字 certEntity.HOISTAREAPERSONSIGNS = UploadifyFile(certEntity.ID + "4", "hoistareapersonsigns", HttpContext.Current.Request.Files); } lifthoistcertbll.ApplyCheck(dy.data.id, certEntity, auditEntity); } else { if (!string.IsNullOrEmpty(auditEntity.AUDITSIGNIMG)) { string strurl = new DataItemDetailBLL().GetItemValue("imgUrl"); auditEntity.AUDITSIGNIMG = auditEntity.AUDITSIGNIMG.Replace(strurl, "../../"); } lifthoistjobbll.ApplyCheck(dy.data.id, auditEntity); } return(new { code = 0, info = "操作成功" }); } catch (Exception ex) { return(new { code = -1, info = ex.Message }); } }
/// <summary> /// 保存表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="entity">实体对象</param> /// <returns></returns> public void SaveForm(string keyValue, LifthoistauditrecordEntity entity) { try { service.SaveForm(keyValue, entity); } catch (Exception) { throw; } }
public ActionResult AuditSubmit(string keyValue, string jsonData) { try { LifthoistauditrecordEntity auditEntity = JsonConvert.DeserializeObject <LifthoistauditrecordEntity>(jsonData); lifthoistjobbll.ApplyCheck(keyValue, auditEntity); } catch (Exception ex) { return(Error("审核出错,错误信息:" + ex.Message)); } return(Success("提交成功。")); }
/// <summary> /// 起重吊装作业审核 /// </summary> /// <param name="keyValue">主键</param> /// <param name="auditEntity">审核实体</param> public void ApplyCheck(string keyValue, LifthoistauditrecordEntity auditEntity = null) { try { Operator currUser = ERCHTMS.Code.OperatorProvider.Provider.Current(); var jobEntity = service.GetEntity(keyValue); ManyPowerCheckEntity mpcEntity = null; if (jobEntity == null) { throw new ArgumentException("无法找到当前业务信息,请确认业务ID是否有误!"); } if (auditEntity != null) { //把当前业务流程节点赋值到审核记录中 auditEntity.FLOWID = jobEntity.FLOWID; } //默认30T以下流程 string moduleName = "(起重吊装作业30T以下)审核"; if (jobEntity.QUALITYTYPE != "0") { //30T以上流程 moduleName = "(起重吊装作业30T以上)审核"; } if (jobEntity.WORKDEPTTYPE == "0") { mpcEntity = peopleReviwservice.CheckAuditForNextByLiftHoist(currUser, moduleName, jobEntity.CONSTRUCTIONUNITID, jobEntity.FLOWID, false); } else { mpcEntity = peopleReviwservice.CheckAuditForNextByLiftHoist(currUser, moduleName, jobEntity.ENGINEERINGID, jobEntity.FLOWID, false); } if (auditEntity != null && auditEntity.AUDITSTATE == 0) { jobEntity.AUDITSTATE = 0; jobEntity.FLOWID = string.Empty; jobEntity.FLOWNAME = string.Empty; jobEntity.FLOWDEPTID = string.Empty; jobEntity.FLOWDEPTNAME = string.Empty; jobEntity.FLOWROLEID = string.Empty; jobEntity.FLOWROLENAME = string.Empty; jobEntity.FLOWREMARK = string.Empty; } else { if (mpcEntity != null) { jobEntity.AUDITSTATE = 1; jobEntity.FLOWID = mpcEntity.ID; jobEntity.FLOWNAME = mpcEntity.FLOWNAME; jobEntity.FLOWDEPTID = mpcEntity.CHECKDEPTID; jobEntity.FLOWDEPTNAME = mpcEntity.CHECKDEPTNAME; jobEntity.FLOWROLEID = mpcEntity.CHECKROLEID; jobEntity.FLOWROLENAME = mpcEntity.CHECKROLENAME; jobEntity.FLOWREMARK = mpcEntity.REMARK; } else { jobEntity.AUDITSTATE = 2; jobEntity.FLOWNAME = "已完结"; jobEntity.FLOWDEPTID = ""; jobEntity.FLOWDEPTNAME = ""; jobEntity.FLOWID = ""; jobEntity.FLOWREMARK = ""; jobEntity.FLOWROLEID = ""; jobEntity.FLOWROLENAME = ""; } } //处理实体,更新到数据库 service.ApplyCheck(jobEntity, auditEntity); } catch (Exception ex) { throw ex; } }
/// <summary> /// 凭吊证审核 /// </summary> /// <param name="keyValue">主键</param> /// <param name="auditEntity">审核实体</param> public void ApplyCheck(string keyValue, LifthoistcertEntity entity = null, LifthoistauditrecordEntity auditEntity = null) { Operator currUser = ERCHTMS.Code.OperatorProvider.Provider.Current(); LifthoistcertEntity certEntity = this.GetEntity(keyValue); if (certEntity == null) { throw new ArgumentException("无法找到当前业务信息,请确认业务ID是否有误!"); } ManyPowerCheckEntity mpcEntity = null; //如果外部传入的实体不为null,则说明是负责人操作 if (entity != null) { certEntity.CHARGEPERSONNAME = entity.CHARGEPERSONNAME; certEntity.CHARGEPERSONID = entity.CHARGEPERSONID; certEntity.CHARGEPERSONSIGN = entity.CHARGEPERSONSIGN; certEntity.HOISTAREAPERSONNAMES = entity.HOISTAREAPERSONNAMES; certEntity.HOISTAREAPERSONIDS = entity.HOISTAREAPERSONIDS; certEntity.HOISTAREAPERSONSIGNS = entity.HOISTAREAPERSONSIGNS; certEntity.safetys = entity.safetys; } if (auditEntity != null) { //把当前业务流程节点赋值到审核记录中 auditEntity.FLOWID = certEntity.FLOWID; } string moduleName = "(起重吊装准吊证)审核"; mpcEntity = peopleReviwservice.CheckAuditForNextByOutsourcing(currUser, moduleName, certEntity.CONSTRUCTIONUNITID, certEntity.FLOWID, false, true); if (auditEntity != null && auditEntity.AUDITSTATE == 0) { certEntity.AUDITSTATE = 0; certEntity.FLOWID = string.Empty; certEntity.FLOWNAME = currUser.UserName + "审核/批不同意"; certEntity.FLOWDEPTID = currUser.DeptId; certEntity.FLOWDEPTNAME = currUser.DeptName; certEntity.FLOWROLEID = currUser.RoleId; certEntity.FLOWROLENAME = currUser.RoleName; } else { if (mpcEntity != null) { certEntity.AUDITSTATE = 1; certEntity.FLOWID = mpcEntity.ID; certEntity.FLOWNAME = mpcEntity.FLOWNAME; certEntity.FLOWDEPTID = mpcEntity.CHECKDEPTID; certEntity.FLOWDEPTNAME = mpcEntity.CHECKDEPTNAME; certEntity.FLOWROLEID = mpcEntity.CHECKROLEID; certEntity.FLOWROLENAME = mpcEntity.CHECKROLENAME; } else { certEntity.AUDITSTATE = 2; certEntity.FLOWNAME = "已完结"; } } //处理实体,更新到数据库 service.ApplyCheck(certEntity, auditEntity); }
public ActionResult AuditCertSubmit(string keyValue, LifthoistcertEntity entity, LifthoistauditrecordEntity auditEntity) { try { lifthoistcertbll.ApplyCheck(keyValue, entity, auditEntity); } catch (Exception ex) { return(Error("审核出错,错误信息:" + ex.Message)); } return(Success("提交成功。")); }