public IActionResult ApprovePass(PlanApproveSubmitDto parm) { if (string.IsNullOrEmpty(parm.ID)) { return(toResponse(StatusCodeType.Error, "提交id不能为空,请核对")); } var userinfo = _tokenManager.GetSessionInfo(); var maincontract = _contractitemplanService.GetId(parm.ID); using (SqlSugarClient db = Core.DbContext.CurrentDB) { Core.DbContext.BeginTran(); try { List <SugarParameter> parameters = new List <SugarParameter>(); parameters.Add(new SugarParameter("UserID", userinfo.UserID)); parameters.Add(new SugarParameter("UserName", userinfo.UserName)); parameters.Add(new SugarParameter("ApproveTime", parm.ApproveTime)); //审批日期 parameters.Add(new SugarParameter("ApproveRemark", parm.ApproveRemark)); //批准备注 Step.Submit(db, maincontract, "Biz_Contract_Plan", "ID", "status", "302", parameters, UpdateBizPlanAfterSubmitted, "审批通过"); Core.DbContext.CommitTran(); return(toResponse("提交成功")); } catch (Exception ex) { Core.DbContext.RollbackTran(); return(toResponse(StatusCodeType.Error, ex.Message)); } } }
public IActionResult SubmitRectification(string id = null) { if (string.IsNullOrEmpty(id)) { return(toResponse(StatusCodeType.Error, "Id 不能为空")); } var userinfo = _tokenManager.GetSessionInfo(); var planauditor = _contractplanauditorService.GetId(id); if (planauditor == null) { return(toResponse(StatusCodeType.Error, "数据为空,请核对!")); } using (SqlSugarClient db = Core.DbContext.CurrentDB) { Core.DbContext.BeginTran(); try { List <SugarParameter> parameters = new List <SugarParameter>(); parameters.Add(new SugarParameter("UserID", userinfo.UserID)); parameters.Add(new SugarParameter("UserName", userinfo.UserName)); db.Ado.ExecuteCommand("update Biz_Contract_PlanAuditor set ProblemFlag = 0 where ID = @auditorid", new { auditorid = id }); List <Biz_ContractItem_Sub> subitemlist = db.Queryable <Biz_ContractItem_Sub>().Where(m => m.ContractPlanID == planauditor.ContractPlanID).ToList(); //提交项目至整改状态 foreach (var item in subitemlist) { Step.Submit(db, item, "Biz_ContractItem_Sub", "ID", "status", "203", parameters, UpdateItemAfterSubmitted, "提交问题已整改"); } var contractplan = _contractitemplanService.GetId(planauditor.ContractPlanID); //提交任务至整改状态 Step.Submit(db, contractplan, "Biz_Contract_Plan", "ID", "status", "308", parameters, UpdatePlanAfterSubmitted, "提交问题已整改"); Core.DbContext.CommitTran(); return(toResponse("提交成功")); } catch (Exception ex) { Core.DbContext.RollbackTran(); return(toResponse(StatusCodeType.Error, ex.Message)); } } }
public IActionResult GetPlanDetail(string id = null) { if (string.IsNullOrEmpty(id)) { return(toResponse(StatusCodeType.Error, "id不允许为空!")); } using (SqlSugarClient db = Core.DbContext.CurrentDB) { Biz_Contract_Plan plan = _contractitemplanService.GetId(id); if (plan == null) { return(toResponse(StatusCodeType.Error, "id不允许为空!")); } //任务信息 ItemPlanVM plandata = Api.Common.Helpers.ComHelper.Mapper <ItemPlanVM, Biz_Contract_Plan>(plan); List <Biz_ContractItem_Sub> subItemList = _contractitemsubService.GetWhere(m => m.ContractPlanID == plandata.ID); //审核员信息 List <Biz_Contract_PlanAuditor> planauditorlist = _contractplanauditorService.GetWhere(m => m.ContractPlanID == plandata.ID); List <PlanAuditorVM> planauditorviewlist = new List <PlanAuditorVM>(); foreach (var planauditor in planauditorlist) { PlanAuditorVM planauditorview = Api.Common.Helpers.ComHelper.Mapper <PlanAuditorVM, Biz_Contract_PlanAuditor>(planauditor); planauditorview.PlanAuditItemList = _contractplanauditoritemService.GetWhere(m => m.PlanAuditorID == planauditorview.ID); planauditorviewlist.Add(planauditorview); } plandata.ContractItem_SubList = subItemList; plandata.PlanAuditorList = planauditorviewlist; return(toResponse(plandata)); } }