|
@@ -1,18 +1,62 @@
|
|
|
package com.jeeplus.modules.ruralprojectrecords.web;
|
|
|
|
|
|
+import com.jeeplus.common.config.Global;
|
|
|
import com.jeeplus.common.persistence.Page;
|
|
|
+import com.jeeplus.common.utils.MyBeanUtils;
|
|
|
import com.jeeplus.common.utils.StringUtils;
|
|
|
import com.jeeplus.common.web.BaseController;
|
|
|
+import com.jeeplus.modules.act.entity.Act;
|
|
|
+import com.jeeplus.modules.act.service.ActTaskService;
|
|
|
+import com.jeeplus.modules.businessQuestions.entity.BusinessQuestions;
|
|
|
+import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingInfo;
|
|
|
+import com.jeeplus.modules.knowledgeSharing.service.KnowledgeSharingDetailsService;
|
|
|
+import com.jeeplus.modules.projectAccessory.dao.ProjectTemplateDao;
|
|
|
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
|
|
|
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
|
|
|
+import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
|
|
|
+import com.jeeplus.modules.projectEngineering.entity.ProjectEngineeringInfo;
|
|
|
+import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
|
|
|
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
|
|
|
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportDataTwo;
|
|
|
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
|
|
|
+import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
|
|
|
+import com.jeeplus.modules.projectcontentinfo.service.ProjectContentDataService;
|
|
|
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
|
|
|
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportRecordService;
|
|
|
+import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
|
|
|
+import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
|
|
|
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
|
|
|
+import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.entity.ProjectCaseBaseAudit;
|
|
|
import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
|
|
|
-import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsCaseBaseService;
|
|
|
-import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.entity.SubProjectInfo;
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.service.*;
|
|
|
+import com.jeeplus.modules.sys.entity.MainDictDetail;
|
|
|
+import com.jeeplus.modules.sys.entity.User;
|
|
|
+import com.jeeplus.modules.sys.entity.Workattachment;
|
|
|
+import com.jeeplus.modules.sys.service.UserService;
|
|
|
+import com.jeeplus.modules.sys.service.WorkattachmentService;
|
|
|
+import com.jeeplus.modules.sys.utils.DictUtils;
|
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
|
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
|
|
|
+import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
|
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
|
|
|
+import com.jeeplus.modules.workclientinfo.service.WorkClientInfoService;
|
|
|
import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
|
|
|
+import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
|
|
|
import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
|
|
|
import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
|
|
|
import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
|
|
|
+import com.jeeplus.modules.workreview.entity.WorkReviewAudit;
|
|
|
+import com.jeeplus.modules.workreview.service.WorkReviewStandardService;
|
|
|
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
|
|
|
import jersey.repackaged.com.google.common.collect.Lists;
|
|
|
+import org.activiti.engine.HistoryService;
|
|
|
+import org.activiti.engine.history.HistoricProcessInstance;
|
|
|
+import org.activiti.engine.runtime.ProcessInstance;
|
|
|
+import org.activiti.engine.task.Task;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
@@ -21,13 +65,12 @@ import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
|
@Controller
|
|
@@ -35,22 +78,60 @@ import java.util.Map;
|
|
|
public class RuralProjectRecordsOwnCaseBaseController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
- private RuralProjectRecordsCaseBaseService service;
|
|
|
+ private RuralProjectRecordsCaseBaseService caseBaseService;
|
|
|
+ @Autowired
|
|
|
+ private RuralProjectRecordsOwnCaseBaseService service;
|
|
|
@Autowired
|
|
|
private RuralProjectRecordsService projectRecordsService;
|
|
|
@Autowired
|
|
|
- private RuralProjectRecordsCaseBaseService caseBaseService;
|
|
|
+ private ProjectReportDataService projectReportDataService;
|
|
|
+ @Autowired
|
|
|
+ private ProjectcontentinfoService projectcontentinfoService;
|
|
|
+ @Autowired
|
|
|
+ private WorkClientInfoService workClientInfoService;
|
|
|
+ @Autowired
|
|
|
+ private ProjectContentDataService projectContentDataService;
|
|
|
+ @Autowired
|
|
|
+ private WorkReviewStandardService workReviewStandardService;
|
|
|
+ @Autowired
|
|
|
+ private SubProjectInfoService subProjectInfoService;
|
|
|
+ @Autowired
|
|
|
+ private WorkContractInfoService workContractInfoService;
|
|
|
+ @Autowired
|
|
|
+ private ProjectPlanService projectPlanService;
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
+ @Autowired
|
|
|
+ protected HistoryService historyService;
|
|
|
+ @Autowired
|
|
|
+ private ProjectEngineeringService engineeringService;
|
|
|
+ @Autowired
|
|
|
+ private RuralProjectMessageNewService ruralProjectMessageService;
|
|
|
+ @Autowired
|
|
|
+ private ProjectReportRecordService projectReportRecordService;
|
|
|
+ @Autowired
|
|
|
+ private ActTaskService actTaskService;
|
|
|
+ @Autowired
|
|
|
+ private ProjectTemplateService projectTemplateService;
|
|
|
+ @Autowired
|
|
|
+ private ProjectTemplateDao projectTemplateDao;
|
|
|
@Autowired
|
|
|
private WorkProjectNotifyService workProjectNotifyService;
|
|
|
+ @Autowired
|
|
|
+ private WorkattachmentService workattachmentService;
|
|
|
+ @Autowired
|
|
|
+ private KnowledgeSharingDetailsService knowledgeSharingDetailsService;
|
|
|
+
|
|
|
+ private static byte[] SYN_BYTE = new byte[0];
|
|
|
|
|
|
@ModelAttribute
|
|
|
- public RuralProjectRecords get(@RequestParam(required=false) String id) {
|
|
|
- RuralProjectRecords entity = null;
|
|
|
- if (StringUtils.isNotBlank(id)){
|
|
|
- entity = projectRecordsService.get(id);
|
|
|
+ public ProjectCaseBaseAudit get(@RequestParam(required = false) String id) {
|
|
|
+ ProjectCaseBaseAudit entity = null;
|
|
|
+ if (StringUtils.isNotBlank(id)) {
|
|
|
+ entity = service.get(id);
|
|
|
}
|
|
|
- if (entity == null){
|
|
|
- entity = new RuralProjectRecords();
|
|
|
+ if (entity == null) {
|
|
|
+ entity = new ProjectCaseBaseAudit();
|
|
|
}
|
|
|
return entity;
|
|
|
}
|
|
@@ -61,20 +142,20 @@ public class RuralProjectRecordsOwnCaseBaseController extends BaseController {
|
|
|
@RequiresPermissions("ruralProject:RuralProjectRecordsOwnCaseBase:list")
|
|
|
@RequestMapping(value = {"list", ""})
|
|
|
public String list(RuralProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
- if(UserUtils.isManager()){
|
|
|
- model.addAttribute("flag","1");
|
|
|
+ if (UserUtils.isManager()) {
|
|
|
+ model.addAttribute("flag", "1");
|
|
|
}
|
|
|
String oldSubmitMoney = "";
|
|
|
//进行查询之后进行任何操作,返回还是查询之后的数据页面
|
|
|
- if (StringUtils.isNotBlank(projectRecords.getToflag())){
|
|
|
- if (projectRecords.getToflag().equals("1")){
|
|
|
+ if (StringUtils.isNotBlank(projectRecords.getToflag())) {
|
|
|
+ if (projectRecords.getToflag().equals("1")) {
|
|
|
request.getSession().removeAttribute("searchprojectRecordsList");
|
|
|
- RuralProjectRecords search=projectRecords;
|
|
|
- request.getSession().setAttribute("searchprojectRecordsList",search);
|
|
|
+ RuralProjectRecords search = projectRecords;
|
|
|
+ request.getSession().setAttribute("searchprojectRecordsList", search);
|
|
|
}
|
|
|
- }else{
|
|
|
- if (request.getSession().getAttribute("searchprojectRecordsList")!=null){
|
|
|
- projectRecords= (RuralProjectRecords) request.getSession().getAttribute("searchprojectRecordsList");
|
|
|
+ } else {
|
|
|
+ if (request.getSession().getAttribute("searchprojectRecordsList") != null) {
|
|
|
+ projectRecords = (RuralProjectRecords) request.getSession().getAttribute("searchprojectRecordsList");
|
|
|
model.addAttribute("ruralProjectRecords", projectRecords);
|
|
|
}
|
|
|
}
|
|
@@ -82,21 +163,21 @@ public class RuralProjectRecordsOwnCaseBaseController extends BaseController {
|
|
|
//添加查询类型(工程咨询)
|
|
|
List<String> typeList = Lists.newArrayList();
|
|
|
String oldProjectSort = null;
|
|
|
- if (StringUtils.isBlank(projectRecords.getAttachmentProjectSort())){
|
|
|
+ if (StringUtils.isBlank(projectRecords.getAttachmentProjectSort())) {
|
|
|
typeList.add("1");
|
|
|
typeList.add("2");
|
|
|
- }else {
|
|
|
- oldProjectSort=projectRecords.getAttachmentProjectSort();
|
|
|
- String attachmentProjectSort=projectRecords.getAttachmentProjectSort();
|
|
|
+ } else {
|
|
|
+ oldProjectSort = projectRecords.getAttachmentProjectSort();
|
|
|
+ String attachmentProjectSort = projectRecords.getAttachmentProjectSort();
|
|
|
typeList.add(attachmentProjectSort.split("-")[0]);
|
|
|
projectRecords.setAttachmentProjectSort(attachmentProjectSort.split("-")[1]);
|
|
|
}
|
|
|
projectRecords.setCreateBy(UserUtils.getUser());
|
|
|
- Page<RuralProjectRecords> page = service.findPage(new Page<RuralProjectRecords>(request, response), projectRecords);
|
|
|
+ Page<RuralProjectRecords> page = caseBaseService.findPage(new Page<RuralProjectRecords>(request, response), projectRecords);
|
|
|
model.addAttribute("page", page);
|
|
|
- if(null != projectRecords.getWorkContractInfo()){
|
|
|
+ if (null != projectRecords.getWorkContractInfo()) {
|
|
|
model.addAttribute("workContractInfoName", projectRecords.getWorkContractInfo().getName());
|
|
|
- if(null != projectRecords.getWorkContractInfo().getClient()){
|
|
|
+ if (null != projectRecords.getWorkContractInfo().getClient()) {
|
|
|
model.addAttribute("workContractInfoClientName", projectRecords.getWorkContractInfo().getClient().getName());
|
|
|
}
|
|
|
}
|
|
@@ -115,7 +196,7 @@ public class RuralProjectRecordsOwnCaseBaseController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(StringUtils.isNotBlank(oldSubmitMoney)){
|
|
|
+ if (StringUtils.isNotBlank(oldSubmitMoney)) {
|
|
|
projectRecords.setSubmitMoney(oldSubmitMoney);
|
|
|
}
|
|
|
|
|
@@ -128,5 +209,746 @@ public class RuralProjectRecordsOwnCaseBaseController extends BaseController {
|
|
|
return "modules/ruralprojectrecords/cost/ruralProjectRecordsOwnCaseBaseList";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据信息获取归档信息并调转页面
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "formCaseBase")
|
|
|
+ public String formCaseBase(ProjectReportRecord projectReportRecord, Model model) throws Exception {
|
|
|
+ //查询“配农网”工程类型id
|
|
|
+ String engineeringId = engineeringService.getEngineeringId("202");
|
|
|
+ //获取项目信息
|
|
|
+ ProjectRecords projectRecords = new ProjectRecords();
|
|
|
+ RuralProjectRecords ruralProjectRecords = projectRecordsService.get(projectReportRecord.getReportId());
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(ruralProjectRecords, projectRecords);
|
|
|
+ ProjectReportData reportData = ruralProjectMessageService.getProjectReportDateByProjectId(projectReportRecord.getReportId());
|
|
|
+ if (StringUtils.isBlank(projectReportRecord.getView()) || !projectReportRecord.getView().equals("view")) {
|
|
|
+ if (StringUtils.isNotBlank(projectReportRecord.getReportId())) {
|
|
|
+ projectReportRecord = projectReportRecordService.getprojectReportRecord(reportData.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取合同信息
|
|
|
+ WorkContractInfo projectContractInfo = ruralProjectMessageService.getProjectContractInfo(projectRecords.getWorkContractInfo().getId());
|
|
|
+ projectRecords.setWorkContractInfo(projectContractInfo);
|
|
|
+ reportData.setProject(projectRecords);
|
|
|
+ projectReportRecord.setReport(reportData);
|
|
|
+ projectReportRecord.setUploadMode(uploadMode);
|
|
|
+ model.addAttribute("projectReportRecord", projectReportRecord);
|
|
|
+ model.addAttribute("project", projectReportRecord.getReport().getProject());
|
|
|
+
|
|
|
+ ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
|
|
|
+ //添加项目类型
|
|
|
+ relateInfo.setAttachmentProjectType(ruralProjectRecords.getProjectType());
|
|
|
+ relateInfo.setAttachmentProjectSort(ruralProjectRecords.getAttachmentProjectSort());
|
|
|
+ //判断是否为打包项目,打包项目无需查看项目送审金额是否为500w以上判定
|
|
|
+ String money = ruralProjectRecords.getSubmitMoney();
|
|
|
+ Integer approvalMoney = null;
|
|
|
+ if (StringUtils.isBlank(money)) {
|
|
|
+ approvalMoney = 1;
|
|
|
+ } else {
|
|
|
+ approvalMoney = Integer.parseInt(money);
|
|
|
+ }
|
|
|
+ switch (approvalMoney) {
|
|
|
+ case 0:
|
|
|
+ //金额为0
|
|
|
+ relateInfo.setAttachmentProjectApprovalMoney(null);
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ //500w以下金额状态
|
|
|
+ relateInfo.setAttachmentProjectApprovalMoney("1");
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ //500w以上金额状态
|
|
|
+ relateInfo.setAttachmentProjectApprovalMoney("2");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ //添加报告类型
|
|
|
+ relateInfo.setRequiredStage(2);
|
|
|
+ relateInfo.setId(ruralProjectRecords.getId());
|
|
|
+ //查询项目是否时案例项目
|
|
|
+ ruralProjectRecords = projectRecordsService.getCaseBaseByProjectId(ruralProjectRecords);
|
|
|
+ //查询报告文件、依据性文件、其他文件必填列表以及数据
|
|
|
+ List<MainDictDetail> mainDictDetails = projectTemplateService.attachmentTemplateList();
|
|
|
+ //文件处理
|
|
|
+ projectTemplateService.disposeProjectTemplateFile(mainDictDetails, relateInfo, engineeringId, ruralProjectRecords, projectReportRecord, "1000");
|
|
|
+
|
|
|
+ ProjectCaseBaseAudit projectCaseBaseAudit = service.getByProjectId(ruralProjectRecords.getId());
|
|
|
+ if (null == projectCaseBaseAudit) {
|
|
|
+ projectCaseBaseAudit = new ProjectCaseBaseAudit();
|
|
|
+ projectCaseBaseAudit.setProjectId(ruralProjectRecords.getId());
|
|
|
+ }
|
|
|
+ model.addAttribute("projectCaseBaseAudit", projectCaseBaseAudit);
|
|
|
+
|
|
|
+ if (null != projectContractInfo) {
|
|
|
+ if (projectContractInfo.getWorkClientInfoList().size() > 0) {
|
|
|
+ model.addAttribute("workClientInfoName", projectContractInfo.getWorkClientInfoList().get(0).getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(projectReportRecord.getView()) && projectReportRecord.getView().equals("view")) {
|
|
|
+ return "modules/ruralprojectrecords/cost/projectReportRecord/projectReportRecordView";
|
|
|
+ } else if (StringUtils.isNotBlank(projectReportRecord.getView()) && projectReportRecord.getView().equals("modiftApply")) {
|
|
|
+ ProcessInstance processInstance = actTaskService.getProcIns(projectReportRecord.getProcessInstanceId());
|
|
|
+ if (processInstance != null) {
|
|
|
+ Task taskInfok = actTaskService.getCurrentTaskInfo(processInstance);
|
|
|
+ Act act = new Act();
|
|
|
+ act.setTaskId(taskInfok.getId());
|
|
|
+ act.setTaskName(taskInfok.getName());
|
|
|
+ act.setProcDefId(taskInfok.getProcessDefinitionId());
|
|
|
+ act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
|
|
|
+ act.setProcInsId(taskInfok.getProcessInstanceId());
|
|
|
+ act.setTask(taskInfok);
|
|
|
+ projectReportRecord.setAct(act);
|
|
|
+ }
|
|
|
+ return "modules/projectcontentinfo/projectReportRecordModiftApply";
|
|
|
+ }
|
|
|
+ return "modules/projectcontentinfo/projectReportRecordCaseBaseForm";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存报告归档
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "storeCaseBaseRecord")
|
|
|
+ public String storeCaseBaseRecord(ProjectCaseBaseAudit projectCaseBaseAudit, Model model, RedirectAttributes redirectAttributes) throws Exception {
|
|
|
+ //根据项目id查询案例文件流程信息
|
|
|
+ projectCaseBaseAudit = service.getByProjectId(projectCaseBaseAudit.getProjectId());
|
|
|
+ addMessage(redirectAttributes, "案例项目文件暂存成功");
|
|
|
+
|
|
|
+ if (null != projectCaseBaseAudit) {//编辑表单保存
|
|
|
+ projectCaseBaseAudit.setIsNewRecord(false);
|
|
|
+ projectCaseBaseAudit.setStatus(1);
|
|
|
+ service.store(projectCaseBaseAudit);//保存
|
|
|
+ } else {//新增表单保存
|
|
|
+ projectCaseBaseAudit = new ProjectCaseBaseAudit();
|
|
|
+ projectCaseBaseAudit.setStatus(1);
|
|
|
+ projectCaseBaseAudit.setCompany(UserUtils.getUser().getCompany());
|
|
|
+ projectCaseBaseAudit.setOffice(UserUtils.getUser().getOffice());
|
|
|
+ projectCaseBaseAudit.setProjectId(projectCaseBaseAudit.getProjectId());
|
|
|
+ projectCaseBaseAudit.setIsNewRecord(true);
|
|
|
+ service.store(projectCaseBaseAudit);//保存
|
|
|
+ }
|
|
|
+ addMessage(redirectAttributes, "案例项目文件暂存成功");
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存项目案例文件,并进行处理
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "saveCaseBaseRecord")
|
|
|
+ public String saveCaseBaseRecord(ProjectCaseBaseAudit projectCaseBaseAudit, Model model, RedirectAttributes redirectAttributes) throws Exception {
|
|
|
+ //获取项目信息
|
|
|
+ RuralProjectRecords ruralProjectRecords = projectRecordsService.get(projectCaseBaseAudit.getProjectId());
|
|
|
+ addMessage(redirectAttributes, "案例数据保存成功");
|
|
|
+
|
|
|
+ //根据项目id查询案例文件流程信息
|
|
|
+ ProjectCaseBaseAudit t = service.getByProjectId(projectCaseBaseAudit.getProjectId());
|
|
|
+ if (null != t) {
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(projectCaseBaseAudit, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
+ t.setIsNewRecord(false);
|
|
|
+ service.save(t);//保存
|
|
|
+ } else {//新增表单保存
|
|
|
+ projectCaseBaseAudit.setCompany(UserUtils.getUser().getCompany());
|
|
|
+ projectCaseBaseAudit.setOffice(UserUtils.getUser().getOffice());
|
|
|
+ projectCaseBaseAudit.setIsNewRecord(true);
|
|
|
+ service.save(projectCaseBaseAudit);//保存
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //对上传的文件进行同步到dify
|
|
|
+ //查询案例相关的文件
|
|
|
+ //获取案例类型参数
|
|
|
+ List<ProjectTemplateInfo> caseBaseProjectTemplateList = projectTemplateDao.getCaseBaseAccessoryListByParentId("14");
|
|
|
+ List<Workattachment> attachmentAllList = com.google.common.collect.Lists.newArrayList();
|
|
|
+ for (ProjectTemplateInfo projectTemplateInfo : caseBaseProjectTemplateList) {
|
|
|
+ //根据项目id和案例类型信息查询项目案例的所有项目
|
|
|
+ Workattachment workAttachment = new Workattachment();
|
|
|
+ workAttachment.setAttachmentId(projectTemplateInfo.getId());
|
|
|
+ workAttachment.setProjectId(ruralProjectRecords.getId());
|
|
|
+ workAttachment.setAttachmentFlag("100");
|
|
|
+ List<Workattachment> attachmentList = workattachmentService.getAttList(workAttachment);
|
|
|
+ for (Workattachment workattachment : attachmentList) {
|
|
|
+ workattachment.setProjectId("");
|
|
|
+ workattachment.setId("");
|
|
|
+ workattachment.setAttachmentName(ruralProjectRecords.getProjectReportNumber() + "-" + workattachment.getAttachmentName());
|
|
|
+ }
|
|
|
+ attachmentAllList.addAll(attachmentList);
|
|
|
+ }
|
|
|
+ if(attachmentAllList.size()>0){
|
|
|
+ //先根据id查询案例资料的知识库中是否存在数据,如果存在,则将其进行删除。
|
|
|
+ List<KnowledgeSharingInfo> byProjectId = knowledgeSharingDetailsService.getByProjectId(ruralProjectRecords.getId());
|
|
|
+ for (KnowledgeSharingInfo knowledgeSharingInfo : byProjectId) {
|
|
|
+ knowledgeSharingDetailsService.delete(knowledgeSharingInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ KnowledgeSharingInfo knowledgeSharingInfo = new KnowledgeSharingInfo();
|
|
|
+ knowledgeSharingInfo.setColumnId("10");
|
|
|
+ knowledgeSharingInfo.setSubject(ruralProjectRecords.getProjectName() + "案例资料文件");
|
|
|
+ knowledgeSharingInfo.setWorkAttachments(attachmentAllList);
|
|
|
+ knowledgeSharingInfo.setCreateBy(UserUtils.getUser());
|
|
|
+ knowledgeSharingInfo.setCreateDate(new Date());
|
|
|
+ knowledgeSharingInfo.setUpdateBy(UserUtils.getUser());
|
|
|
+ knowledgeSharingInfo.setUpdateDate(new Date());
|
|
|
+ knowledgeSharingInfo.setProjectId(ruralProjectRecords.getId());
|
|
|
+ knowledgeSharingDetailsService.save(knowledgeSharingInfo);
|
|
|
+ knowledgeSharingDetailsService.saveToDify(knowledgeSharingInfo, "1");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(projectCaseBaseAudit.getHome()) && "home".equals(projectCaseBaseAudit.getHome())) {
|
|
|
+ //修改代办状态
|
|
|
+ workProjectNotifyService.updateCaseBaseNotifyStatus(ruralProjectRecords.getId(), "113");
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/home/?repage";
|
|
|
+ } else if (StringUtils.isNotBlank(projectCaseBaseAudit.getHome()) && "notifyList".equals(projectCaseBaseAudit.getHome())) {
|
|
|
+ //修改代办状态
|
|
|
+ workProjectNotifyService.updateCaseBaseNotifyStatus(ruralProjectRecords.getId(), "113");
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
|
|
|
+ }
|
|
|
+ //跳转到个人案例项目页面
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 案例文件审核
|
|
|
+ * @param projectCaseBaseAudit
|
|
|
+ * @param model
|
|
|
+ * @param redirectAttributes
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("saveAudit")
|
|
|
+ public String saveAudit(ProjectCaseBaseAudit projectCaseBaseAudit, Model model,
|
|
|
+ RedirectAttributes redirectAttributes) {
|
|
|
+ String home = projectCaseBaseAudit.getHome();
|
|
|
+ try {
|
|
|
+ String taskDefKey = projectCaseBaseAudit.getAct().getTaskDefKey();
|
|
|
+ //当状态为未通过时,重新修改数据
|
|
|
+ if ("modifyApply".equals(taskDefKey)) {
|
|
|
+ projectCaseBaseAudit.getAct().setComment("重新申请");
|
|
|
+ }
|
|
|
+ List<User> users = UserUtils.getByProssType(projectCaseBaseAudit.getProcessInstanceId(),1);
|
|
|
+ if ("alxmwjshr".equals(taskDefKey)){
|
|
|
+ users = UserUtils.getByProssType(projectCaseBaseAudit.getProcessInstanceId(),1);
|
|
|
+ if (users==null )
|
|
|
+ users = UserUtils.getByRoleActivityEnname("alxmwjshr",3,projectCaseBaseAudit.getOffice().getId(),"4",projectCaseBaseAudit.getCreateBy());
|
|
|
+ }else if ("modifyApply".equals(taskDefKey)){
|
|
|
+ users = UserUtils.getByProssType(projectCaseBaseAudit.getProcessInstanceId(),1);
|
|
|
+ }
|
|
|
+ String flag = projectCaseBaseAudit.getAct().getFlag();
|
|
|
+ if ("yes".equals(flag) && (users==null || users.size()==0)){
|
|
|
+ addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
|
|
|
+ }else {
|
|
|
+ ProjectCaseBaseAudit t = service.get(projectCaseBaseAudit.getId());//从数据库取出记录的值
|
|
|
+ if(t.getStatus() == 5){
|
|
|
+ addMessage(redirectAttributes, "案例文件审核已完成,无法再次送审");
|
|
|
+ if (StringUtils.isNotBlank(home) && "home".equals(home)) {
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/home/?repage";
|
|
|
+ }else if (StringUtils.isNotBlank(home) && "notifyList".equals(home)){
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
|
|
|
+ } else {
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String str = service.auditSave(projectCaseBaseAudit,users);
|
|
|
+ addMessage(redirectAttributes, str);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ addMessage(redirectAttributes, "案例文件审核流程审批失败");
|
|
|
+ logger.error("Exception e:"+e);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(home) && "home".equals(home)) {
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/home/?repage";
|
|
|
+ }else if (StringUtils.isNotBlank(home) && "notifyList".equals(home)){
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
|
|
|
+ } else {
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 撤回
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param redirectAttributes
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "revoke")
|
|
|
+ public String revoke(HttpServletRequest request, RedirectAttributes redirectAttributes) throws Exception {
|
|
|
+ HashMap<String, String> requestMap = findRequestMap(request);
|
|
|
+ String processInstanceId = requestMap.get("processInstanceId");
|
|
|
+ String id = requestMap.get("id");
|
|
|
+ try {
|
|
|
+ ProjectCaseBaseAudit projectCaseBaseAudit = service.get(id);
|
|
|
+ if (3 == projectCaseBaseAudit.getStatus() || 4 == projectCaseBaseAudit.getStatus()) {
|
|
|
+ addMessage(redirectAttributes, "案例项目文件审核已撤回、驳回,请勿重复操作");
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
|
|
|
+ } else if (5 == projectCaseBaseAudit.getStatus()) {
|
|
|
+ addMessage(redirectAttributes, "案例项目文件审核已审批通过,无法撤回");
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
|
|
|
+ }
|
|
|
+ service.cancelInvalidate(projectCaseBaseAudit);
|
|
|
+ addMessage(redirectAttributes, "撤回该案例项目文件审核成功");
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.info(e.getMessage());
|
|
|
+ addMessage(redirectAttributes, "撤回该案例项目文件审核失败");
|
|
|
+ }
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据信息获取归档信息并调转页面
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "modify")
|
|
|
+ public String modify(ProjectReportRecord projectReportRecord, Model model) throws Exception {
|
|
|
+ //查询“配农网”工程类型id
|
|
|
+ String engineeringId = engineeringService.getEngineeringId("202");
|
|
|
+ //获取项目信息
|
|
|
+ ProjectRecords projectRecords = new ProjectRecords();
|
|
|
+ RuralProjectRecords ruralProjectRecords = projectRecordsService.get(projectReportRecord.getReportId());
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(ruralProjectRecords, projectRecords);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //查询案例流程信息
|
|
|
+ ProjectCaseBaseAudit projectCaseBaseAudit = service.getByProjectId(ruralProjectRecords.getId());
|
|
|
+ //查询项目是否时案例项目
|
|
|
+ ruralProjectRecords = projectRecordsService.getCaseBaseByProjectId(ruralProjectRecords);
|
|
|
+ ProjectReportData projectReportData = projectReportDataService.getByNumber(ruralProjectRecords.getProjectReportNumber());
|
|
|
+ projectReportRecord = projectReportRecordService.getProjectReportRecordByProjectId(projectCaseBaseAudit.getProjectId());
|
|
|
+ Projectcontentinfo projectcontentinfo = projectcontentinfoService.getByInfoId(projectReportData.getId());
|
|
|
+ projectcontentinfo.setProjectReportData(projectReportData);
|
|
|
+ //获取子项目列表信息
|
|
|
+ List<SubProjectInfo> subProjectInfos = this.queryReportDetails(ruralProjectRecords.getId());
|
|
|
+ //获取合同信息
|
|
|
+ WorkContractInfo workContractInfo = this.queryWorkContract(ruralProjectRecords.getId());
|
|
|
+ if (null != workContractInfo) {
|
|
|
+ WorkClientInfo clientInfo = workClientInfoService.get(workContractInfo.getClient().getId());
|
|
|
+ model.addAttribute("workClientInfo", clientInfo);
|
|
|
+ if (StringUtils.isNotBlank(workContractInfo.getChargeCriterion())) {
|
|
|
+ //收费标准
|
|
|
+ String[] biao = workContractInfo.getChargeCriterion().split(",");
|
|
|
+ List<String> chargeCriterionList = new ArrayList<>();
|
|
|
+ for (int i = 0; i < biao.length; i++) {
|
|
|
+ chargeCriterionList.add(biao[i]);
|
|
|
+ }
|
|
|
+ projectReportRecord.setChargeCriterionList(chargeCriterionList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ WorkContractInfo projectContractInfo = ruralProjectMessageService.getProjectContractInfo(ruralProjectRecords.getWorkContractInfo().getId());
|
|
|
+ ruralProjectRecords.setWorkContractInfo(projectContractInfo);
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(ruralProjectRecords, projectReportRecord.getReport().getProject());//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
+ if (null != projectContractInfo) {
|
|
|
+ if (projectContractInfo.getWorkClientInfoList().size() > 0) {
|
|
|
+ model.addAttribute("workClientInfoName", projectContractInfo.getWorkClientInfoList().get(0).getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
|
|
|
+ //添加项目类型
|
|
|
+ relateInfo.setAttachmentProjectType(ruralProjectRecords.getProjectType());
|
|
|
+ relateInfo.setAttachmentProjectSort(ruralProjectRecords.getAttachmentProjectSort());
|
|
|
+ String money = ruralProjectRecords.getSubmitMoney();
|
|
|
+ Integer approvalMoney = null;
|
|
|
+ if (StringUtils.isBlank(money)) {
|
|
|
+ approvalMoney = 1;
|
|
|
+ } else {
|
|
|
+ approvalMoney = Integer.parseInt(money);
|
|
|
+ }
|
|
|
+ switch (approvalMoney) {
|
|
|
+ case 0:
|
|
|
+ //金额为0
|
|
|
+ relateInfo.setAttachmentProjectApprovalMoney(null);
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ //500w以下金额状态
|
|
|
+ relateInfo.setAttachmentProjectApprovalMoney("1");
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ //500w以上金额状态
|
|
|
+ relateInfo.setAttachmentProjectApprovalMoney("2");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ //添加报告类型
|
|
|
+ //relateInfo.setRequiredStage(2);
|
|
|
+ List<Integer> requiredStageList = com.google.common.collect.Lists.newArrayList();
|
|
|
+ requiredStageList.add(1);
|
|
|
+ requiredStageList.add(2);
|
|
|
+ relateInfo.setRequiredStageList(requiredStageList);
|
|
|
+ relateInfo.setId(ruralProjectRecords.getId());
|
|
|
+ //查询报告文件、依据性文件、其他文件必填列表以及数据
|
|
|
+ List<MainDictDetail> mainDictDetails = projectTemplateService.attachmentTemplateList();
|
|
|
+ projectTemplateService.disposeProjectTemplateFile(mainDictDetails, relateInfo, engineeringId, ruralProjectRecords, projectcontentinfo, "1000");
|
|
|
+
|
|
|
+ projectReportRecord.setUploadMode(uploadMode);
|
|
|
+ //获取项目基础信息
|
|
|
+ projectRecordsService.queryProjectDetail(ruralProjectRecords);
|
|
|
+ //工程咨询
|
|
|
+ List<MainDictDetail> mainDictList = com.google.common.collect.Lists.newArrayList();
|
|
|
+ if ("1".equals(ruralProjectRecords.getProjectType())) {
|
|
|
+ mainDictList = DictUtils.getMainDictList("attachment_project_sort");
|
|
|
+ //造价审核
|
|
|
+ } else if ("2".equals(ruralProjectRecords.getProjectType())) {
|
|
|
+ mainDictList = DictUtils.getMainDictList("attachment_project_sort_cost");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(ruralProjectRecords.getAttachmentProjectSort())) {
|
|
|
+ //处理项目类别
|
|
|
+ for (MainDictDetail info : mainDictList) {
|
|
|
+ if (ruralProjectRecords.getAttachmentProjectSort().equals(info.getValue())) {
|
|
|
+ ruralProjectRecords.setAttachmentProjectSort(info.getLabel());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ model.addAttribute("projectcontentinfo", projectcontentinfo);
|
|
|
+ model.addAttribute("projectRecords", ruralProjectRecords);
|
|
|
+ model.addAttribute("projectReportData", projectReportData);
|
|
|
+ model.addAttribute("workContractInfo", workContractInfo);
|
|
|
+ model.addAttribute("projectReportRecord", projectReportRecord);
|
|
|
+ model.addAttribute("project", projectReportRecord.getReport().getProject());
|
|
|
+ //tap页
|
|
|
+ //查询所有的工程类型
|
|
|
+ List<ProjectEngineeringInfo> projectEngineeringInfo = engineeringService.findList(new ProjectEngineeringInfo());
|
|
|
+ model.addAttribute("projectEngineeringInfo", projectEngineeringInfo);
|
|
|
+ //项目计划
|
|
|
+ RuralProjectRecords projectRecordPlans = this.planView(ruralProjectRecords.getId());
|
|
|
+ model.addAttribute("projectRecordPlans", projectRecordPlans);
|
|
|
+ //获取质量复核项目组成员
|
|
|
+ List<RuralReportConsultant> consultantinfo = this.qualityView(ruralProjectRecords, projectReportData);
|
|
|
+ model.addAttribute("consultantinfo", consultantinfo);
|
|
|
+ //获取总审人员
|
|
|
+ User user = UserUtils.get(projectReportData.getBzshbUserId());
|
|
|
+ model.addAttribute("bzshbUserName", user.getName());
|
|
|
+ //质量复核标准展示
|
|
|
+ String review = "";
|
|
|
+ if ("2".equals(ruralProjectRecords.getSubmitMoney())) {
|
|
|
+ review = "1";
|
|
|
+ }
|
|
|
+ ;
|
|
|
+ List<WorkReviewAudit> workReviewAuditList = projectContentDataService.findListReview(review, "质量复核");
|
|
|
+ WorkReviewAudit revAudit = new WorkReviewAudit();
|
|
|
+ String type = "4";
|
|
|
+ revAudit.setCompanyId(UserUtils.getSelectCompany().getId());
|
|
|
+ revAudit.setType(type);
|
|
|
+ revAudit.setReportId(projectReportData.getId());
|
|
|
+ List<WorkReviewAudit> reaudits = workReviewStandardService.findAuditList(revAudit);
|
|
|
+ for (WorkReviewAudit reAudit : workReviewAuditList) {
|
|
|
+ for (WorkReviewAudit audit : reaudits) {
|
|
|
+ if (reAudit.getId().equals(audit.getStandardId())) {
|
|
|
+ reAudit.setDeductOption(audit.getDeductOption());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ model.addAttribute("datalist", workReviewAuditList);
|
|
|
+ //拆线呢报告签发评分展示项
|
|
|
+ List<WorkReviewAudit> reviewAuditList = projectContentDataService.findListIssue(review, "报告签发");
|
|
|
+ //查询报告签发评分评论数据
|
|
|
+ WorkReviewAudit workReviewAuditTwo = new WorkReviewAudit();
|
|
|
+ type = "4";
|
|
|
+ workReviewAuditTwo.setCompanyId(UserUtils.getSelectCompany().getId());
|
|
|
+ workReviewAuditTwo.setType(type);
|
|
|
+ workReviewAuditTwo.setReportId(projectReportData.getId());
|
|
|
+ List<WorkReviewAudit> rreviewAuditList = workReviewStandardService.findAuditList(workReviewAuditTwo);
|
|
|
+ for (WorkReviewAudit reAudit : reviewAuditList) {
|
|
|
+ for (WorkReviewAudit audit : rreviewAuditList) {
|
|
|
+ if (reAudit.getId().equals(audit.getStandardId())) {
|
|
|
+ reAudit.setDeductOption(audit.getDeductOption());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ model.addAttribute("datalistTwo", reviewAuditList);
|
|
|
+ model.addAttribute("projectCaseBaseAudit", projectCaseBaseAudit);
|
|
|
+
|
|
|
+ projectReportRecord.setFileAttachmentList(projectRecordsService.disposeDataAttachment(projectcontentinfo.getFileAttachmentList()));
|
|
|
+ projectReportRecord.setFileGistdataList(projectRecordsService.disposeDataAttachment(projectcontentinfo.getFileGistdataList()));
|
|
|
+ projectReportRecord.setFileOtherList(projectRecordsService.disposeDataAttachment(projectcontentinfo.getFileOtherList()));
|
|
|
+ projectReportRecord.setFileCaseBaseList(projectcontentinfo.getFileCaseBaseList());
|
|
|
+
|
|
|
+
|
|
|
+ //ProjectReportData reportData = ruralProjectMessageService.getProjectReportDateByProjectId(projectReportRecord.getReportId());
|
|
|
+ if (StringUtils.isBlank(projectReportRecord.getView()) || !projectReportRecord.getView().equals("view")) {
|
|
|
+ if (StringUtils.isNotBlank(projectReportRecord.getReportId())) {
|
|
|
+ projectReportRecord = projectReportRecordService.getprojectReportRecord(projectReportData.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取合同信息
|
|
|
+ projectReportData.setProject(projectRecords);
|
|
|
+ projectReportRecord.setReport(projectReportData);
|
|
|
+ projectReportRecord.setUploadMode(uploadMode);
|
|
|
+ model.addAttribute("projectReportRecord", projectReportRecord);
|
|
|
+ model.addAttribute("project", projectReportRecord.getReport().getProject());
|
|
|
+
|
|
|
+
|
|
|
+ model.addAttribute("projectCaseBaseAudit", projectCaseBaseAudit);
|
|
|
+
|
|
|
+ Act act = getByAct(projectCaseBaseAudit.getProcessInstanceId());
|
|
|
+ projectCaseBaseAudit.setAct(act);
|
|
|
+
|
|
|
+ return "modules/projectcontentinfo/projectCaseBaseSupplementModify";
|
|
|
+ }
|
|
|
+
|
|
|
+ public Act getByAct(String processInstanceId){
|
|
|
+ Act act = new Act();
|
|
|
+ HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
|
|
+ ProcessInstance processInstance = actTaskService.getProcIns(processInstanceId);
|
|
|
+ if (processInstance!=null) {
|
|
|
+ List<Task> taskList = actTaskService.getCurrentTaskList(processInstance);
|
|
|
+ if(taskList!=null && taskList.size()>1){
|
|
|
+ for (Task taskInfok:taskList) {
|
|
|
+ if (taskInfok.getAssignee().equals(UserUtils.getUser().getId())) {
|
|
|
+ act.setTaskId(taskInfok.getId());
|
|
|
+ act.setTaskName(taskInfok.getName());
|
|
|
+ act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
|
|
|
+ act.setProcDefId(taskInfok.getProcessDefinitionId());
|
|
|
+ act.setProcInsId(taskInfok.getProcessInstanceId());
|
|
|
+ act.setTask(taskInfok);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ Task task = actTaskService.getCurrentTaskInfo(processInstance);
|
|
|
+ act.setTaskId(task.getId());
|
|
|
+ act.setTaskName(task.getName());
|
|
|
+ act.setTaskDefKey(task.getTaskDefinitionKey());
|
|
|
+ act.setProcDefId(task.getProcessDefinitionId());
|
|
|
+ act.setProcInsId(task.getProcessInstanceId());
|
|
|
+ act.setTask(task);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return act;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询报告审核子项目详细信息
|
|
|
+ */
|
|
|
+ public List<SubProjectInfo> queryReportDetails(String projectId) {
|
|
|
+ RuralProjectRecords projectRecords = new RuralProjectRecords();
|
|
|
+ if (null != projectId) {
|
|
|
+ projectRecords = projectRecordsService.get(projectId);
|
|
|
+ }
|
|
|
+ //获取子项目信息
|
|
|
+ SubProjectInfo subProjectInfo = new SubProjectInfo();
|
|
|
+ subProjectInfo.setParentProId(projectId);
|
|
|
+ subProjectInfo.setProjectType(projectRecords.getProjectType());
|
|
|
+ List<SubProjectInfo> recordsList = subProjectInfoService.findList(subProjectInfo);
|
|
|
+ for (SubProjectInfo info : recordsList) {
|
|
|
+ info.setProjectType(subProjectInfo.getProjectType());
|
|
|
+ }
|
|
|
+ return recordsList;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询报告审核客户合同详细信息
|
|
|
+ */
|
|
|
+ public WorkContractInfo queryWorkContract(String projectId) {
|
|
|
+ RuralProjectRecords projectRecords = new RuralProjectRecords();
|
|
|
+ if (null != projectId) {
|
|
|
+ projectRecords = projectRecordsService.get(projectId);
|
|
|
+ }
|
|
|
+ //获取合同信息
|
|
|
+ WorkContractInfo workContractInfo = workContractInfoService.getInfoById(projectRecords.getWorkContractInfo().getId());
|
|
|
+ return workContractInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //获取项目计划
|
|
|
+ public RuralProjectRecords planView(String projectId) {
|
|
|
+ //获取项目信息
|
|
|
+ //如果没有id则为新增 添加创建人信息和当前创建时间信息
|
|
|
+ RuralProjectRecords projectRecords = new RuralProjectRecords();
|
|
|
+ if (StringUtils.isNotBlank(projectId)) {
|
|
|
+ //projectRecords = ruralProjectRecordsService.get(projectRecords.getId());
|
|
|
+ projectRecords = projectRecordsService.getMasters(projectId);
|
|
|
+ } else {
|
|
|
+ projectRecords.setCreateBy(UserUtils.getUser());
|
|
|
+ projectRecords.setCreateDate(new Date());
|
|
|
+ }
|
|
|
+ ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
|
|
|
+ //将项目id放入项目计划表中
|
|
|
+ projectPlanInfo.setProjectId(projectRecords.getId());
|
|
|
+ //获取项目计划信息
|
|
|
+ List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
|
|
|
+ if (projectPlanList.size() == 0) {
|
|
|
+ //获取项目计划信息
|
|
|
+ List<MainDictDetail> mainDictList = DictUtils.getMainDictList("projectPlan");
|
|
|
+ if (mainDictList.size() > 0) {
|
|
|
+ for (MainDictDetail mainDict : mainDictList) {
|
|
|
+ ProjectPlanInfo projectPlan = new ProjectPlanInfo();
|
|
|
+ projectPlan.setProjectStage(mainDict.getLabel());
|
|
|
+ //将项目负责人添加到展示栏
|
|
|
+ if (null != projectRecords.getProjectLeaders()) {
|
|
|
+ projectPlan.setRemindName(projectRecords.getProjectLeaders().get(0).getName());
|
|
|
+ projectPlan.setRemindId(projectRecords.getProjectLeaders().get(0).getId());
|
|
|
+ }
|
|
|
+ //将项目等级人信息添加到完成人控件中
|
|
|
+ User user = UserUtils.get(projectRecords.getCreateBy().getId());
|
|
|
+ projectPlan.setFinishId(user.getId());
|
|
|
+ projectPlan.setFinishName(user.getName());
|
|
|
+ projectPlanList.add(projectPlan);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //获取 项目计划附件信息
|
|
|
+ List<WorkClientAttachment> workAttachmentList = projectPlanService.getWorkAttachment(projectRecords.getId());
|
|
|
+ projectRecords.setProjectPlanList(projectPlanList);
|
|
|
+ projectRecords.setWorkAttachments(workAttachmentList);
|
|
|
+ projectRecords.setUploadMode(uploadMode);
|
|
|
+ return projectRecords;
|
|
|
+ }
|
|
|
+ public List<RuralReportConsultant> qualityView(RuralProjectRecords ruralProjectRecords, ProjectReportData projectReportData) {
|
|
|
+ //质量复核查看
|
|
|
+ List<RuralReportConsultant> consultantinfo = com.google.common.collect.Lists.newArrayList();
|
|
|
+ //将自己添加到咨询员数据中
|
|
|
+ //根据用户查询技能信息
|
|
|
+ RuralReportConsultant currentConsultant = new RuralReportConsultant();
|
|
|
+ List<WorkStaffCertificate> userCertificateList = com.google.common.collect.Lists.newArrayList();
|
|
|
+ if (StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())) {
|
|
|
+ userCertificateList = ruralProjectMessageService.getCertificateByUser(ruralProjectRecords.getProjectMasterId());
|
|
|
+ }
|
|
|
+ //获取专业类型
|
|
|
+ List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("certificate_major");
|
|
|
+ for (WorkStaffCertificate certificateInfo : userCertificateList) {
|
|
|
+ currentConsultant.setZhucezigezhID(certificateInfo.getNum());
|
|
|
+ currentConsultant.setZhucezigezhKey(certificateInfo.getName());
|
|
|
+ for (MainDictDetail type : certificateMajor) {
|
|
|
+ if (certificateInfo.getMajor().equals(type.getValue())) {
|
|
|
+ currentConsultant.setMajor(type.getLabel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ User currentUser = userService.get(ruralProjectRecords.getProjectMasterId());
|
|
|
+ currentConsultant.setZixunyuanName(currentUser.getName());
|
|
|
+ currentConsultant.setZixunyuan(currentUser.getId());
|
|
|
+ currentConsultant.setRole("负责人");
|
|
|
+ consultantinfo.add(currentConsultant);
|
|
|
+ }
|
|
|
+ //查询总审人员信息
|
|
|
+ RuralReportConsultant bzshbConsultant = new RuralReportConsultant();
|
|
|
+ //根据项目id查找报告咨询员信息
|
|
|
+ List<RuralReportConsultant> consultantList = ruralProjectMessageService.getConsultantsList(ruralProjectRecords.getId());
|
|
|
+ //使用迭代器去除重复信息
|
|
|
+ //排除 重新申请|撤销
|
|
|
+ Iterator<RuralReportConsultant> it = consultantList.iterator();
|
|
|
+ while (it.hasNext()) {
|
|
|
+ RuralReportConsultant consultant = it.next();
|
|
|
+ if (consultant.getZixunyuan().equals(currentConsultant.getZixunyuan())) {
|
|
|
+ try {
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(consultant, currentConsultant);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ it.remove();
|
|
|
+ } else {
|
|
|
+ //根据用户查询技能信息
|
|
|
+ List<WorkStaffCertificate> certificateList = ruralProjectMessageService.getCertificateByUser(consultant.getZixunyuan());
|
|
|
+ for (WorkStaffCertificate certificateInfo : certificateList) {
|
|
|
+ if (certificateInfo.getName().equals(consultant.getZhucezigezhKey())) {
|
|
|
+ consultant.setZhucezigezhID(certificateInfo.getNum());
|
|
|
+ }
|
|
|
+ for (MainDictDetail type : certificateMajor) {
|
|
|
+ if (certificateInfo.getMajor().equals(type.getValue())) {
|
|
|
+ consultant.setMajor(type.getLabel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ User user = userService.get(consultant.getZixunyuan());
|
|
|
+ if (null != user) {
|
|
|
+ consultant.setZixunyuanName(user.getName());
|
|
|
+ consultant.setRole("咨询员");
|
|
|
+ }
|
|
|
+ if (consultant.getZixunyuan().equals(projectReportData.getBzshbUserId())) {
|
|
|
+ User chenHongXing = UserUtils.getByLoginName("陈红星");
|
|
|
+ List<WorkStaffCertificate> chenHongXingCertificateList = ruralProjectMessageService.getCertificateByUser(chenHongXing.getId());
|
|
|
+ //获取陈红星的造价师信息
|
|
|
+ WorkStaffCertificate chenHongXingStaffCertificate = chenHongXingCertificateList.get(0);
|
|
|
+
|
|
|
+ //根据用户查询技能信息
|
|
|
+ List<WorkStaffCertificate> certificateBList = ruralProjectMessageService.getCertificateByUser(consultant.getZixunyuan());
|
|
|
+ for (WorkStaffCertificate certificateInfo : certificateBList) {
|
|
|
+ for (MainDictDetail type : certificateMajor) {
|
|
|
+ if (certificateInfo.getMajor().equals(type.getValue())) {
|
|
|
+ bzshbConsultant.setMajor(type.getLabel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ bzshbConsultant = consultant;
|
|
|
+ bzshbConsultant.setZhucezigezhID(chenHongXingStaffCertificate.getNum());
|
|
|
+ bzshbConsultant.setZixunyuanName("陈红星(" + consultant.getZixunyuanName() + "代)");
|
|
|
+ bzshbConsultant.setRole("技术负责人");
|
|
|
+ it.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ consultantinfo.addAll(consultantList);
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(bzshbConsultant.getZixunyuan())) {
|
|
|
+ consultantinfo.add(bzshbConsultant);
|
|
|
+ } else {
|
|
|
+ //查询总审人员信息
|
|
|
+ bzshbConsultant = new RuralReportConsultant();
|
|
|
+ List<WorkStaffCertificate> bzshbCertificateList = com.google.common.collect.Lists.newArrayList();
|
|
|
+ if (StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())) {
|
|
|
+ bzshbCertificateList = ruralProjectMessageService.getCertificateByUser(projectReportData.getBzshbUserId());
|
|
|
+ }
|
|
|
+ for (WorkStaffCertificate certificateInfo : bzshbCertificateList) {
|
|
|
+ bzshbConsultant.setZhucezigezhID(certificateInfo.getNum());
|
|
|
+ bzshbConsultant.setZhucezigezhKey(certificateInfo.getName());
|
|
|
+ for (MainDictDetail dictType : certificateMajor) {
|
|
|
+ if (certificateInfo.getMajor().equals(dictType.getValue())) {
|
|
|
+ bzshbConsultant.setMajor(dictType.getLabel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ User bzshbUser = userService.get(projectReportData.getBzshbUserId());
|
|
|
+ bzshbConsultant.setZixunyuanName(bzshbUser.getName());
|
|
|
+ bzshbConsultant.setZixunyuan(bzshbUser.getId());
|
|
|
+ consultantinfo.add(bzshbConsultant);
|
|
|
+ }
|
|
|
+ Iterator<RuralReportConsultant> itView = consultantinfo.iterator();
|
|
|
+ while (itView.hasNext()) {
|
|
|
+ RuralReportConsultant consultant = itView.next();
|
|
|
+ if (bzshbCertificateList.size() > 0) {
|
|
|
+ if (consultant.getZixunyuan().equals(bzshbConsultant.getZixunyuan())) {
|
|
|
+ try {
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
|
|
|
+ bzshbConsultant.setZixunyuanName("陈红星(" + bzshbConsultant.getZixunyuanName() + "代)");
|
|
|
+ bzshbConsultant.setRole("技术负责人");
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ itView.remove();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (consultant.getZixunyuan().equals(projectReportData.getBzshbUserId())) {
|
|
|
+ try {
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
|
|
|
+ bzshbConsultant.setZixunyuanName("陈红星(" + bzshbConsultant.getZixunyuanName() + "代)");
|
|
|
+ bzshbConsultant.setRole("技术负责人");
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ itView.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(bzshbConsultant.getZixunyuan())) {
|
|
|
+ consultantinfo.add(bzshbConsultant);
|
|
|
+ } else {
|
|
|
+ User user = userService.get(projectReportData.getBzshbUserId());
|
|
|
+ bzshbConsultant.setZixunyuanName("陈红星(" + user.getName() + "代)");
|
|
|
+ bzshbConsultant.setZixunyuan(user.getId());
|
|
|
+ bzshbConsultant.setRole("技术负责人");
|
|
|
+ consultantinfo.add(bzshbConsultant);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return consultantinfo;
|
|
|
+ }
|
|
|
|
|
|
}
|