|
@@ -1,5 +1,6 @@
|
|
|
package com.jeeplus.modules.ruralprojectrecords.web;
|
|
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import com.jeeplus.common.config.Global;
|
|
|
import com.jeeplus.common.utils.MyBeanUtils;
|
|
|
import com.jeeplus.common.utils.StringUtils;
|
|
@@ -17,6 +18,7 @@ import com.jeeplus.modules.projectcontentinfo.service.*;
|
|
|
import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
|
|
|
import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
|
|
|
import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
|
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageNewService;
|
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
|
|
|
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordTwoService;
|
|
@@ -28,6 +30,7 @@ import com.jeeplus.modules.sys.service.UserService;
|
|
|
import com.jeeplus.modules.sys.utils.DictUtils;
|
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
|
import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
|
|
|
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
|
|
|
import org.activiti.engine.HistoryService;
|
|
|
import org.activiti.engine.runtime.ProcessInstance;
|
|
|
import org.activiti.engine.task.Task;
|
|
@@ -37,10 +40,7 @@ import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
|
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 造价审核项目列表Controller
|
|
@@ -420,6 +420,208 @@ public class RuralCostProjectMessageNewTwoController extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * B级紧急项目驳回修改
|
|
|
+ * 查看,增加,编辑报告归档表单页面
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "formRecordUrgentModify")
|
|
|
+ public String formRecordUrgentModify(ProjectReportRecord projectReportRecord, Model model) {
|
|
|
+ //查询“配农网”工程类型id
|
|
|
+ String engineeringId = engineeringService.getEngineeringId("202");
|
|
|
+ projectReportRecord = projectReportRecordService.get(projectReportRecord.getId());
|
|
|
+ if(StringUtils.isBlank(projectReportRecord.getId())){
|
|
|
+ projectReportRecord.setCreateDate(new Date());
|
|
|
+ projectReportRecord.setCreateBy(UserUtils.getUser());
|
|
|
+ }
|
|
|
+ //根据项目id查询报告信息
|
|
|
+ ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(projectReportRecord.getReport().getProject().getId());
|
|
|
+ projectReportRecord.setReport(projectReportData);
|
|
|
+ //获取项目信息
|
|
|
+ RuralProjectRecords ruralProjectRecords = projectRecordsService.get(projectReportRecord.getReport().getProject().getId());
|
|
|
+ List<RuralReportConsultant> consultants=reConsultants(ruralProjectRecords,projectReportData);
|
|
|
+ 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(1);
|
|
|
+ relateInfo.setId(ruralProjectRecords.getId());
|
|
|
+ //查询报告文件、依据性文件、其他文件必填列表以及数据
|
|
|
+ List<MainDictDetail> mainDictDetails = projectTemplateService.attachmentTemplateList();
|
|
|
+ for (MainDictDetail mainDict : mainDictDetails) {
|
|
|
+ relateInfo.setAttachType(mainDict.getValue());
|
|
|
+ switch (mainDict.getValue()) {
|
|
|
+ case "11":
|
|
|
+ List<ProjectTemplateInfo> fileAttachmentList = projectTemplateService.getProjectTemplateUrgentList(relateInfo);
|
|
|
+ for (ProjectTemplateInfo info: fileAttachmentList) {
|
|
|
+ info.setAttachTypes(info.getAttachTypes().toLowerCase());
|
|
|
+ if(engineeringId.equals(ruralProjectRecords.getEngineeringType())){
|
|
|
+ if("审定单".equals(info.getAttachName()) || "咨询报告书正文(含附件) 附件一:工程预算或结算汇总表 附件二:编制或审核说明 附件三:工程预算或结算审定单 附件四:工程预算或结算书".equals(info.getAttachName()) ){
|
|
|
+ if(!info.getAttachTypes().contains("zip")){
|
|
|
+ info.setAttachTypes(info.getAttachTypes()+",zip");
|
|
|
+ }
|
|
|
+ if(!info.getAttachTypes().contains("rar")){
|
|
|
+ info.setAttachTypes(info.getAttachTypes()+",rar");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ projectReportRecord.setFileAttachmentList(fileAttachmentList);
|
|
|
+ break;
|
|
|
+ case "12":
|
|
|
+ List<ProjectTemplateInfo> projectTemplateList = projectTemplateService.getProjectTemplateUrgentList(relateInfo);
|
|
|
+ for (ProjectTemplateInfo info: projectTemplateList) {
|
|
|
+ info.setAttachTypes(info.getAttachTypes().toLowerCase());
|
|
|
+ if(engineeringId.equals(ruralProjectRecords.getEngineeringType())){
|
|
|
+ if("投标文件、中标通知书、工程承包合同(协议书记专用条款部分)、补充协议".equals(info.getAttachName()) || "送审工程预算、结算书".equals(info.getAttachName()) ){
|
|
|
+ if(!info.getAttachTypes().contains("zip")){
|
|
|
+ info.setAttachTypes(info.getAttachTypes()+",zip");
|
|
|
+ }
|
|
|
+ if(!info.getAttachTypes().contains("rar")){
|
|
|
+ info.setAttachTypes(info.getAttachTypes()+",rar");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ projectReportRecord.setFileGistdataList(projectTemplateList);
|
|
|
+ break;
|
|
|
+ case "13":
|
|
|
+ projectReportRecord.setFileOtherList(projectTemplateService.getProjectTemplateUrgentList(relateInfo));
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ ProjectRecords projectRecords = new ProjectRecords();
|
|
|
+ try {
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(ruralProjectRecords, projectRecords);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ //获取合同信息
|
|
|
+ WorkContractInfo projectContractInfo = ruralProjectMessageService.getProjectContractInfo(ruralProjectRecords.getWorkContractInfo().getId());
|
|
|
+ projectRecords.setWorkContractInfo(projectContractInfo);
|
|
|
+ projectReportRecord.getReport().setProject(projectRecords);
|
|
|
+ projectReportRecord.setView("modify");
|
|
|
+ model.addAttribute("info", consultants);
|
|
|
+ model.addAttribute("projectReportData", projectReportData);
|
|
|
+ model.addAttribute("projectReportRecord", projectReportRecord);
|
|
|
+ model.addAttribute("workClientInfoName", projectReportRecord.getClientName());
|
|
|
+ model.addAttribute("project", projectReportRecord.getReport().getProject());
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(projectReportRecord.getProcessInstanceId())){
|
|
|
+ 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/ruralprojectrecords/record/cost/recordTwo/projectReportRecordUrgentModify";
|
|
|
+
|
|
|
+ }
|
|
|
+ public List<RuralReportConsultant> reConsultants(RuralProjectRecords records,ProjectReportData projectReportData){
|
|
|
+ //查询总审人员信息
|
|
|
+ List<User> auditUserList = userService.getAuditUserListByType(records.getSubmitMoney());
|
|
|
+ records.setBzshbUserList(auditUserList);
|
|
|
+ if(null == projectReportData.getConsultant()){
|
|
|
+ projectReportData.setConsultant(UserUtils.getUser());
|
|
|
+ }
|
|
|
+ if(null == projectReportData.getPrincipal()){
|
|
|
+ projectReportData.setPrincipal(UserUtils.getUser());
|
|
|
+ }
|
|
|
+ List<RuralReportConsultant> consultants = Lists.newArrayList();
|
|
|
+ //将自己添加到咨询员数据中
|
|
|
+ //根据用户查询技能信息
|
|
|
+ RuralReportConsultant currentConsultant = new RuralReportConsultant();
|
|
|
+ List<WorkStaffCertificate> userCertificateList = Lists.newArrayList();
|
|
|
+ if(StringUtils.isNotBlank(records.getProjectMasterId())){
|
|
|
+ userCertificateList = ruralProjectMessageService.getCertificateByUser(records.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(records.getProjectMasterId());
|
|
|
+ currentConsultant.setZixunyuanName(currentUser.getName());
|
|
|
+ currentConsultant.setZixunyuan(currentUser.getId());
|
|
|
+ currentConsultant.setRole("负责人");
|
|
|
+ consultants.add(currentConsultant);
|
|
|
+ }
|
|
|
+ //总审
|
|
|
+ RuralReportConsultant zongshen = new RuralReportConsultant();
|
|
|
+ zongshen.setZixunyuan(projectReportData.getBzshbUserId());
|
|
|
+ //根据项目id查找报告咨询员信息
|
|
|
+ List<RuralReportConsultant> consultantList = ruralProjectMessageService.getConsultantsList(records.getId());
|
|
|
+ //使用迭代器去除重复信息
|
|
|
+ //排除 重新申请|撤销
|
|
|
+ Iterator<RuralReportConsultant> it = consultantList.iterator();
|
|
|
+ while(it.hasNext()){
|
|
|
+ RuralReportConsultant consultant = it.next();
|
|
|
+ //判定重新复核中总审人员信息去除展示
|
|
|
+ if(consultant.getZixunyuan().equals(zongshen.getZixunyuan())){
|
|
|
+ it.remove();
|
|
|
+ }else 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());
|
|
|
+ consultant.setZixunyuanName(user.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ consultants.addAll(consultantList);
|
|
|
+ return consultants;
|
|
|
+ }
|
|
|
+ /**
|
|
|
* 保存报告归档
|
|
|
*/
|
|
|
@RequestMapping(value = "saveRecord")
|