Browse Source

苏州分公司数据同步

sangwenwei 7 months atrás
parent
commit
2dd5e9504d

+ 98 - 7
src/main/java/com/jeeplus/common/szCcpm/controller/CcpmList.java

@@ -17,9 +17,7 @@ import com.jeeplus.modules.projectcontentinfo.service.ProjectContentDataService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralWorkProjectUserDao;
-import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
-import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecordsReported;
-import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
+import com.jeeplus.modules.ruralprojectrecords.entity.*;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
 import com.jeeplus.modules.ruralprojectrecords.web.RuralProjectRecordsController;
@@ -95,7 +93,7 @@ public class CcpmList{
 
 
     //获取苏州分公司下的所有项目信息
-    @RequestMapping(value = "/getAllProject",method = RequestMethod.GET)
+    @RequestMapping(value = "/getAllProject",method = RequestMethod.POST)
     @ResponseBody
     public  List<RuralProjectRecords> getAllProject(){
         List<Office> list = getList();
@@ -109,10 +107,11 @@ public class CcpmList{
                         if(org.apache.commons.lang3.StringUtils.isNotBlank(projectRecord.getBelongingDepartment()) && "其他".equals(projectRecord.getBelongingDepartment())){
                             projectRecord.setBelongingDepartmentName("其他");
                         }
+                        //委托方联系人
+                        projectRecordsService.queryLinkmanInfos(projectRecord);
+                        //设置报告
+//                        projectRecordsService.queryReportData(projectRecord);
                     }
-                    projectRecordsService.queryLinkmanInfos(projectRecord);
-                    //查询质量复核信息
-                    recordsViewController.findProjectReportData(projectRecord);
                 }
             }
 
@@ -121,6 +120,98 @@ public class CcpmList{
         return maps;
     }
 
+    //获取苏州分公司下的所有项目信息下的质量复核信息
+    @RequestMapping(value = "/getAllReview",method = RequestMethod.POST)
+    @ResponseBody
+    public List<RuralProjectRecords> getAllReview() {
+        // 获取部门列表
+        List<Office> list = getList();
+        List<RuralProjectRecords> result = new ArrayList<>();
+
+        // 获取所有项目记录
+        List<RuralProjectRecords> allProjectRecords = new ArrayList<>();
+        for (Office office : list) {
+            // 根据部门ID获取该部门下的所有项目记录
+            List<RuralProjectRecords> projectRecords = projectRecordsService.getListByOffice(office.getId());
+            if (projectRecords != null) {
+                allProjectRecords.addAll(projectRecords);  // 将该部门的项目记录加入到所有记录中
+            }
+        }
+
+        // 现在查询质量复核信息,并将其重新赋值到项目记录
+        Map<String, RuralProjectRecords> projectReportCache = new HashMap<>();
+        for (RuralProjectRecords projectRecord : allProjectRecords) {
+            // 查询质量复核信息并缓存,以避免重复查询
+            if (!projectReportCache.containsKey(projectRecord.getId())) {
+                RuralProjectRecords records = recordsViewController.findProjectReportData(projectRecord);
+                projectReportCache.put(projectRecord.getId(), records);
+            }
+        }
+
+        // 对所有项目记录进行赋值
+        for (RuralProjectRecords projectRecord : allProjectRecords) {
+            RuralProjectRecords records = projectReportCache.get(projectRecord.getId());
+            if (records != null && records.getProjectReportDataVo() != null && StringUtils.isNotBlank(records.getBzshbUserName())) {
+                RuralProjectRecords ruralProjectRecords = new RuralProjectRecords();
+                ruralProjectRecords.setProjectReportDataVo(records.getProjectReportDataVo());
+                ruralProjectRecords.setBzshbUserName(records.getBzshbUserName());
+                ruralProjectRecords.setId(projectRecord.getId());
+                ruralProjectRecords.setPrdId(records.getProjectReportDataVo().getId());
+                ruralProjectRecords.setCreateName(records.getCreateName());
+                ruralProjectRecords.setFirstAuditDate(records.getFirstAuditDate());
+                result.add(ruralProjectRecords);
+            }
+        }
+        return result;
+    }
+
+
+    //获取苏州分公司下的所有项目信息下的档案信息
+    @RequestMapping(value = "/getAllRuralProjectcontentinfo",method = RequestMethod.POST)
+    @ResponseBody
+    public List<RuralProjectcontentinfoVo> getAllRuralProjectcontentinfo() {
+        // 获取部门列表
+        List<Office> list = getList();
+        List<RuralProjectcontentinfoVo> result = new ArrayList<>();
+
+        // 获取所有项目记录
+        List<RuralProjectRecords> allProjectRecords = new ArrayList<>();
+        for (Office office : list) {
+            // 根据部门ID获取该部门下的所有项目记录
+            List<RuralProjectRecords> projectRecords = projectRecordsService.getListByOffice(office.getId());
+            if (projectRecords != null) {
+                allProjectRecords.addAll(projectRecords);  // 将该部门的项目记录加入到所有记录中
+            }
+        }
+
+        // 现在查询档案信息,并将其重新赋值到项目记录
+        Map<String, RuralProjectcontentinfo> projectReportCache = new HashMap<>();
+        for (RuralProjectRecords projectRecord : allProjectRecords) {
+            if (!projectReportCache.containsKey(projectRecord.getId())) {
+                RuralProjectcontentinfo ruralProjectcontentinfo = projectRecordsService.formAccessoryToCloud(projectRecord);
+                projectReportCache.put(projectRecord.getId(), ruralProjectcontentinfo);
+            }
+        }
+
+        // 对所有项目记录进行赋值
+        for (RuralProjectRecords projectRecord : allProjectRecords) {
+            RuralProjectcontentinfo records = projectReportCache.get(projectRecord.getId());
+            if (records != null) {
+                RuralProjectcontentinfoVo ruralProjectRecords = new RuralProjectcontentinfoVo();
+                ruralProjectRecords.setFileAttachmentList(records.getFileAttachmentList());
+                ruralProjectRecords.setFileGistdataList(records.getFileGistdataList());
+                ruralProjectRecords.setFileOtherList(records.getFileOtherList());
+                ruralProjectRecords.setAttachmentProjectSort(records.getProject().getAttachmentProjectSort());
+                ruralProjectRecords.setProjectLevel(records.getProject().getSubmitMoney());
+                ruralProjectRecords.setProjectType(records.getProject().getProjectType());
+                result.add(ruralProjectRecords);
+            }
+        }
+
+
+        return result;
+    }
+
 
     /**
      * 获取苏州分公司下的所有合同信息

+ 8 - 2
src/main/java/com/jeeplus/modules/centerservice/config/ConnectionService.java

@@ -36,7 +36,7 @@ public class ConnectionService {
 
     // 启动时调用,开始定期检查连接
     public void startCheckingConnection() {
-        scheduler.scheduleAtFixedRate(this::checkConnection, 0, 5, TimeUnit.SECONDS);
+        scheduler.scheduleAtFixedRate(this::checkConnection, 0, 1, TimeUnit.HOURS);
     }
 
     private void checkConnection() {
@@ -44,10 +44,16 @@ public class ConnectionService {
             String path = Global.getConfig("SZOA_PATH");
             String url = path+"/flowable/task/checkConnect";
             ResponseEntity<Map<String, String>> responseEntity = restTemplate.exchange(url, HttpMethod.GET, null, new ParameterizedTypeReference<Map<String, String>>() {});
+            String path1 = Global.getConfig("SZ_PATH");
+            String url1 = path1+"/transpond/checkConnect";
+            ResponseEntity<Map<String, String>> responseEntity1 = restTemplate.exchange(url1, HttpMethod.GET, null, new ParameterizedTypeReference<Map<String, String>>() {});
+
             // 从 ResponseEntity 中获取 body
             Map<String, String> responseBody = responseEntity.getBody();
             String message = responseBody.get("message");
-            if ("success".equals(message)) {
+            Map<String, String> responseBody1 = responseEntity1.getBody();
+            String message1 = responseBody1.get("message");
+            if ("success".equals(message) && "success".equals(message1)) {
                 if (!isConnected) {
                     JedisUtils.set("ccpmConnect", "true", 24);
                     System.out.println("Connected successfully.");

+ 362 - 0
src/main/java/com/jeeplus/modules/projectcontentinfo/entity/ProjectReportDataVo.java

@@ -0,0 +1,362 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.projectcontentinfo.entity;
+
+
+import com.jeeplus.common.persistence.ActEntity;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.workcontent.web.WorkContentTypeController;
+import com.jeeplus.modules.workreview.entity.WorkReviewAudit;
+import org.activiti.engine.history.HistoricProcessInstance;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.activiti.engine.task.Task;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 报告详情Entity
+ * @author yangfan
+ * @version 2018-06-05
+ */
+public class ProjectReportDataVo extends ActEntity<ProjectReportDataVo> {
+
+	private static final long serialVersionUID = 1L;
+	private String companyId;		// 公司id
+	private String officeId;		// 部门id
+	private String officeName;		// 部门id
+	private ProjectRecords project;		// 项目id
+	private String name;		// 报告名称
+	private String number;		// 报告编号
+
+	private User master;		// 负责人
+	private Date reportDate;		// 报告日期
+	private String fileStatus;		// 归档状态
+	private String downFileStatus;		// 归档状态
+	private String status;		// 报告状态 1待归档 2已归档
+	private String invalidStatus;		// 报告作废状态
+	private Date startDate;
+	private Date endDate;
+
+
+	private String reportId;
+	private String numberPath;
+
+	private String bzshbUserId; //总审用户id
+
+
+	public String getNumberPath() {
+		return numberPath;
+	}
+
+	public void setNumberPath(String numberPath) {
+		this.numberPath = numberPath;
+	}
+
+
+
+
+	private String reviewFee;  //送审价
+	private String approvalFee;  //审定价
+	private String contractFee;   //合同价
+	private String verifyFee;    //核增核减额
+	private String verifyRate;    //核增核减率
+	private String buildingRate;    //土建比例
+	private String installRate;    //安装比例
+	private String consultFee;    //咨询标的额
+	private String buildingFee;   //土建额
+	private String installFee;    //安装额
+	private String ZiXunShouRu;	//造价咨询营业收入(万元)
+	private String ziXunShou;	//造价咨询营业收入
+
+	public String getZiXunShouRu() {
+		return ZiXunShouRu;
+	}
+
+	public void setZiXunShouRu(String ziXunShouRu) {
+		ZiXunShouRu = ziXunShouRu;
+	}
+
+	public String getZiXunShou() {
+		return ziXunShou;
+	}
+
+	public void setZiXunShou(String ziXunShou) {
+		this.ziXunShou = ziXunShou;
+	}
+
+	private List<RuralReportConsultant> consultants;
+
+	public List<RuralReportConsultant> getConsultants() {
+		return consultants;
+	}
+
+	public void setConsultants(List<RuralReportConsultant> consultants) {
+		this.consultants = consultants;
+	}
+
+
+	public ProjectReportDataVo() {
+		super();
+	}
+
+	public ProjectReportDataVo(String id){
+		super(id);
+	}
+
+	public String getCompanyId() {
+		return companyId;
+	}
+
+	public void setCompanyId(String companyId) {
+		this.companyId = companyId;
+	}
+
+	public String getOfficeId() {
+		return officeId;
+	}
+
+	public void setOfficeId(String officeId) {
+		this.officeId = officeId;
+	}
+
+	@Override
+	public void setCreateDate(Date createDate) {
+		this.createDate = createDate;
+	}
+
+	public void setProject(ProjectRecords project) {
+		this.project = project;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	@ExcelField(title="报告编号", align=2, sort=1)
+	public String getNumber() {
+		return number;
+	}
+
+	@ExcelField(title="报告名称", align=2, sort=2)
+	public String getName() {
+		return name;
+	}
+
+
+	@ExcelField(title="报告状态", align=2, sort=8,dictType = "audit_state")
+	public String getStatus() {
+		return status;
+	}
+
+	@ExcelField(title="报告日期", align=2, sort=9)
+	public Date getReportDate() {
+		return reportDate;
+	}
+
+	@ExcelField(title="归档状态", align=2, sort=10,dictType = "record_state")
+	public String getFileStatus() {
+		return fileStatus;
+	}
+
+
+
+	@ExcelField(title="所属部门", align=2, sort=12)
+	public String getOfficeName() {
+		return officeName;
+	}
+
+	@ExcelField(title="创建时间", align=2, sort=13)
+	@Override
+	public Date getCreateDate() {
+		return createDate;
+	}
+
+	public ProjectRecords getProject() {
+		return project;
+	}
+
+	@ExcelField(title="所属项目", align=2, sort=14)
+	public String getProjectName() {
+		return this.project.getProjectName();
+	}
+
+
+	public void setNumber(String number) {
+		this.number = number;
+	}
+
+
+	public void setMaster(User master) {
+		this.master = master;
+	}
+
+	public void setReportDate(Date reportDate) {
+		this.reportDate = reportDate;
+	}
+
+	public void setFileStatus(String fileStatus) {
+		this.fileStatus = fileStatus;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getInvalidStatus() {
+		return invalidStatus;
+	}
+
+	public void setInvalidStatus(String invalidStatus) {
+		this.invalidStatus = invalidStatus;
+	}
+
+	public Date getStartDate() {
+		return startDate;
+	}
+
+	public void setStartDate(Date startDate) {
+		this.startDate = startDate;
+	}
+
+	public Date getEndDate() {
+		return endDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+
+
+
+	public String getReportId() {
+		return reportId;
+	}
+
+	public void setReportId(String reportId) {
+		this.reportId = reportId;
+	}
+
+
+
+	public void setOfficeName(String officeName) {
+		this.officeName = officeName;
+	}
+
+
+	public String getProjectNum() {
+		return this.project.getProjectId();
+	}
+	public User getMaster() {
+		return master;
+	}
+
+
+
+	public String getReviewFee() {
+		return reviewFee;
+	}
+
+	public void setReviewFee(String reviewFee) {
+		this.reviewFee = reviewFee;
+	}
+
+
+
+	public String getApprovalFee() {
+		return approvalFee;
+	}
+
+	public void setApprovalFee(String approvalFee) {
+		this.approvalFee = approvalFee;
+	}
+
+	public String getContractFee() {
+		return contractFee;
+	}
+
+	public void setContractFee(String contractFee) {
+		this.contractFee = contractFee;
+	}
+
+	public String getVerifyFee() {
+		return verifyFee;
+	}
+
+	public void setVerifyFee(String verifyFee) {
+		this.verifyFee = verifyFee;
+	}
+
+	public String getVerifyRate() {
+		return verifyRate;
+	}
+
+	public void setVerifyRate(String verifyRate) {
+		this.verifyRate = verifyRate;
+	}
+
+	public String getBuildingRate() {
+		return buildingRate;
+	}
+
+	public void setBuildingRate(String buildingRate) {
+		this.buildingRate = buildingRate;
+	}
+
+	public String getInstallRate() {
+		return installRate;
+	}
+
+	public void setInstallRate(String installRate) {
+		this.installRate = installRate;
+	}
+
+	public String getConsultFee() {
+		return consultFee;
+	}
+
+	public void setConsultFee(String consultFee) {
+		this.consultFee = consultFee;
+	}
+
+	public String getBuildingFee() {
+		return buildingFee;
+	}
+
+	public void setBuildingFee(String buildingFee) {
+		this.buildingFee = buildingFee;
+	}
+
+	public String getInstallFee() {
+		return installFee;
+	}
+
+	public void setInstallFee(String installFee) {
+		this.installFee = installFee;
+	}
+
+
+	public String getDownFileStatus() {
+		return downFileStatus;
+	}
+
+	public void setDownFileStatus(String downFileStatus) {
+		this.downFileStatus = downFileStatus;
+	}
+
+	public String getBzshbUserId() {
+		return bzshbUserId;
+	}
+
+	public void setBzshbUserId(String bzshbUserId) {
+		this.bzshbUserId = bzshbUserId;
+	}
+
+	}

+ 10 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java

@@ -9,6 +9,7 @@ import com.jeeplus.common.persistence.ActEntity;
 import com.jeeplus.common.utils.excel.annotation.ExcelField;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchProInfo;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportDataVo;
 import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
 import com.jeeplus.modules.sys.entity.Area;
 import com.jeeplus.modules.sys.entity.Office;
@@ -422,6 +423,15 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	private String projectMasterPhone;
 
 
+	private ProjectReportDataVo projectReportDataVo;
+
+	public ProjectReportDataVo getProjectReportDataVo() {
+		return projectReportDataVo;
+	}
+
+	public void setProjectReportDataVo(ProjectReportDataVo projectReportDataVo) {
+		this.projectReportDataVo = projectReportDataVo;
+	}
 
 	private List<String> civilProjectList = Lists.newArrayList();
 	private List<WorkClientAttachment> workAttachments = Lists.newArrayList();

+ 91 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectcontentinfoVo.java

@@ -0,0 +1,91 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.ruralprojectrecords.entity;
+
+
+import com.jeeplus.common.persistence.TreeEntity;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectBasedData;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectContentData;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportDataTwo;
+import com.jeeplus.modules.sys.entity.Workattachment;
+
+import java.util.List;
+
+/**
+ * 工作内容管理Entity
+ * @author yangfan
+ * @version 2018-06-04
+ */
+public class RuralProjectcontentinfoVo extends TreeEntity<RuralProjectcontentinfoVo> {
+
+
+
+	private List<ProjectTemplateInfo> fileAttachmentList;   //报告文件
+	private List<ProjectTemplateInfo> fileGistdataList;   //依据性文件
+	private List<ProjectTemplateInfo> fileOtherList;   //其他文件
+	private String attachmentProjectSort;   //项目类别
+	private String projectLevel; //项目等级
+	private String projectType; //项目等级
+
+	public String getProjectLevel() {
+		return projectLevel;
+	}
+
+	public void setProjectLevel(String projectLevel) {
+		this.projectLevel = projectLevel;
+	}
+
+	public String getProjectType() {
+		return projectType;
+	}
+
+	public void setProjectType(String projectType) {
+		this.projectType = projectType;
+	}
+
+	public String getAttachmentProjectSort() {
+		return attachmentProjectSort;
+	}
+
+	public void setAttachmentProjectSort(String attachmentProjectSort) {
+		this.attachmentProjectSort = attachmentProjectSort;
+	}
+
+	@Override
+	public RuralProjectcontentinfoVo getParent() {
+		return null;
+	}
+
+	@Override
+	public void setParent(RuralProjectcontentinfoVo parent) {
+
+	}
+
+	public List<ProjectTemplateInfo> getFileAttachmentList() {
+		return fileAttachmentList;
+	}
+
+	public void setFileAttachmentList(List<ProjectTemplateInfo> fileAttachmentList) {
+		this.fileAttachmentList = fileAttachmentList;
+	}
+
+	public List<ProjectTemplateInfo> getFileGistdataList() {
+		return fileGistdataList;
+	}
+
+	public void setFileGistdataList(List<ProjectTemplateInfo> fileGistdataList) {
+		this.fileGistdataList = fileGistdataList;
+	}
+
+	public List<ProjectTemplateInfo> getFileOtherList() {
+		return fileOtherList;
+	}
+
+	public void setFileOtherList(List<ProjectTemplateInfo> fileOtherList) {
+		this.fileOtherList = fileOtherList;
+	}
+}

+ 86 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -230,6 +230,14 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 	 * 获取项目附件模板类型
 	 * @return
 	 */
+	public static List<MainDictDetail> attachmentTemplateListToCloud(){
+		return  DictUtils.getMainDictListById("attachment_template_type");
+	}
+
+	/**
+	 * 获取项目附件模板类型
+	 * @return
+	 */
 	public static List<MainDictDetail> attachmentTemplateListByUserId(){
 		return  DictUtils.getMainDictListById("attachment_template_type");
 	}
@@ -2695,6 +2703,84 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 	}
 
 	/**
+	 * 档案信息获取
+	 * @param projectRecords  项目信息
+	 * @return
+	 */
+	public RuralProjectcontentinfo formAccessoryToCloud(RuralProjectRecords projectRecords){
+		//查询“配农网”工程类型id
+		String engineeringId = engineeringService.getEngineeringId("202");
+		RuralProjectcontentinfo projectcontentinfo = new RuralProjectcontentinfo();
+		//获取报告信息
+		ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(projectRecords.getId());
+
+		projectcontentinfo.setProject(projectRecords);
+		projectcontentinfo.setProjectReportData(projectReportData);
+		//声明项目与附件关系表联系
+		ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
+		//添加项目类型
+		relateInfo.setAttachmentProjectType(projectRecords.getProjectType());
+		relateInfo.setAttachmentProjectSort(projectRecords.getAttachmentProjectSort());
+
+		String money=projectcontentinfo.getProject().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;
+		}
+		//创建阶段集合(若为归档阶段则将新增报告和归档阶段信息都添加在内)
+		List<Integer> requiredStageList = Lists.newArrayList();
+		requiredStageList.add(1);
+		//添加报告类型
+		relateInfo.setRequiredStage(1);
+		relateInfo.setId(projectRecords.getId());
+
+		//声明归档状态
+		String reportRecordStatus = null;
+		//判断报告信息是否已存在
+		if(null != projectReportData){
+			//判断是否已经审批完成
+			if ("5".equals(projectReportData.getStatus())){
+				//查询归档状态信息
+				reportRecordStatus = dao.getReportRecordStatus(projectReportData.getId());
+				//如果归档状态不为空,则查询归档展示列
+				if(StringUtils.isNotBlank(reportRecordStatus)){
+					relateInfo.setRequiredStage(2);
+					requiredStageList.add(2);
+				}
+			}
+		}else{
+			//没有提交报告信息
+
+		}
+
+		//查询报告文件、依据性文件、其他文件必填列表以及数据
+		List<MainDictDetail> mainDictDetails = this.attachmentTemplateListToCloud();
+		disposeProjectFileView(mainDictDetails,relateInfo,engineeringId,projectRecords,projectcontentinfo);
+
+
+
+		//添加当前文件服务器类型
+//		projectcontentinfo.setUploadMode(uploadMode);
+		return projectcontentinfo;
+	}
+
+	/**
 	 * 项目列表新增文件信息获取
 	 * @param projectRecords  项目信息
 	 * @return

+ 167 - 238
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectViewController.java

@@ -18,10 +18,7 @@ import com.jeeplus.modules.projectEngineering.entity.ProjectEngineeringInfo;
 import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
 import com.jeeplus.modules.projectFilingBatch.service.ProjectFilingBatchService;
-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.entity.*;
 import com.jeeplus.modules.projectcontentinfo.service.*;
 import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
 import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
@@ -49,6 +46,7 @@ import com.jeeplus.modules.workreview.entity.WorkReviewAudit;
 import com.jeeplus.modules.workreview.service.WorkReviewStandardService;
 import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
 import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -1262,279 +1260,210 @@ public class RuralProjectViewController extends BaseController {
 
     /**
      * 质量复核信息
-     * @param projectRecord
+     * @param projectRecords
      */
-    public void findProjectReportData(RuralProjectRecords projectRecord) {
+    public RuralProjectRecords findProjectReportData(RuralProjectRecords projectRecords) {
 
-        Projectcontentinfo projectcontentinfo1 = projectcontentinfoService.getByProjectId(projectRecord.getId());
+        Projectcontentinfo projectcontentinfo1 = projectcontentinfoService.getByProjectId(projectRecords.getId());
         if (null !=projectcontentinfo1){
-            ProjectReportData projectReportData = projectReportDataService.getOnRural(projectcontentinfo1.getInfoId());
-            if (null !=projectReportData){
-                projectReportData = projectReportDataService.get(projectReportData.getId());
-                if(null != projectReportData.getSignatureUploadFileUser() && StringUtils.isNotBlank(projectReportData.getSignatureUploadFileUser().getId())){
-                    projectReportData.setSignatureUploadFileUser(UserUtils.get(projectReportData.getSignatureUploadFileUser().getId()));
+            if (StringUtils.isNotBlank(projectcontentinfo1.getInfoId())){
+                ProjectReportData projectReportData = projectReportDataService.getOnRural(projectcontentinfo1.getInfoId());
+                if (null !=projectReportData){
+                    projectReportData = projectReportDataService.get(projectReportData.getId());
+                    if(null != projectReportData.getSignatureUploadFileUser() && StringUtils.isNotBlank(projectReportData.getSignatureUploadFileUser().getId())){
+                        projectReportData.setSignatureUploadFileUser(UserUtils.get(projectReportData.getSignatureUploadFileUser().getId()));
+                    }
                 }
-            }
-
-            RuralProjectRecords ruralProjectRecords = projectRecordsService.getQueryProjectUsers(projectcontentinfo1.getProject().getId());
-            //获取项目负责人
-            List<User> users = workProjectUserDao.getProjectprincipalList(projectRecord.getId());
-            projectRecord.setProjectLeaders(users);
-            projectRecord.setLeaderNameStr(Collections3.extractToString(users, "name", ","));
-            projectRecord.setLeaderIds(Collections3.extractToString(users, "id", ","));
-            User loginUser = UserUtils.getUser();
+                ProjectReportDataVo projectReportDataVo = new ProjectReportDataVo();
+                BeanUtils.copyProperties(projectReportData,projectReportDataVo);
+                User user1 = UserUtils.get(projectReportData.getCreateBy().getId());
+                projectReportData.setCreateName(user1.getName());
+
+                RuralProjectRecords ruralProjectRecords = projectRecordsService.getQueryProjectUsers(projectcontentinfo1.getProject().getId());
+                //获取项目负责人
+                List<User> users = workProjectUserDao.getProjectprincipalList(projectRecords.getId());
+                projectRecords.setProjectLeaders(users);
+                projectRecords.setLeaderNameStr(Collections3.extractToString(users, "name", ","));
+                projectRecords.setLeaderIds(Collections3.extractToString(users, "id", ","));
+                User loginUser = UserUtils.getUser();
 //            if(ruralProjectRecords.getLeaderIds().contains(loginUser.getId()) || loginUser.getId().equals(ruralProjectRecords.getCreateBy().getId())){
 //                ruralProjectRecords.setOperateFlag("1");
 //            }else{
-            projectRecord.setOperateFlag("0");
+                projectRecords.setOperateFlag("0");
 //            }
 
-            Projectcontentinfo projectcontent = projectcontentinfoService.getByInfoId(projectReportData.getId());
-            projectcontent.setProjectReportData(projectReportData);
 
-            //项目与附件关系表
-            ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
-            //添加项目类型
-            relateInfo.setAttachmentProjectType(ruralProjectRecords.getProjectType());
-            relateInfo.setAttachmentProjectSort(ruralProjectRecords.getAttachmentProjectSort());
+                //项目与附件关系表
+                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;
-            }
+                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());
+                //添加报告类型
+                relateInfo.setRequiredStage(1);
+                relateInfo.setId(ruralProjectRecords.getId());
 
-            List<RuralReportConsultant> consultants = Lists.newArrayList();
-            //将自己添加到咨询员数据中
-            //根据用户查询技能信息
-            RuralReportConsultant currentConsultant = new RuralReportConsultant();
-            List<WorkStaffCertificate> userCertificateList = Lists.newArrayList();
-            if(StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
-                userCertificateList = ruralProjectMessageService.getCertificateByUser(ruralProjectRecords.getProjectMasterId());
-            }
-            //获取专业类型
-            List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("certificate_major");
-            for (WorkStaffCertificate certificateInfo: userCertificateList) {
-                if("161".equals(certificateInfo.getName()) || "171".equals(certificateInfo.getName())){
-                    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("负责人");
-                    consultants.add(currentConsultant);
-                    break;
+                List<RuralReportConsultant> consultants = Lists.newArrayList();
+                //将自己添加到咨询员数据中
+                //根据用户查询技能信息
+                RuralReportConsultant currentConsultant = new RuralReportConsultant();
+                List<WorkStaffCertificate> userCertificateList = Lists.newArrayList();
+                if(StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
+                    userCertificateList = ruralProjectMessageService.getCertificateByUser(ruralProjectRecords.getProjectMasterId());
                 }
-            }
-            //查询总审人员信息
-            RuralReportConsultant bzshbConsultant = new RuralReportConsultant();
-            //根据项目id查找报告咨询员信息
-            List<RuralReportConsultant> consultantList = ruralProjectMessageService.getConsultantsList(projectRecord.getId());
-            //使用迭代器去除重复信息
-            //排除 重新申请|撤销
-            Iterator<RuralReportConsultant> it = consultantList.iterator();
-            while(it.hasNext()){
-                RuralReportConsultant consultant = it.next();
-                //根据人员id和角色进行唯一值判定,避免出现重复值
-                if(consultant.getZixunyuan().equals(currentConsultant.getZixunyuan()) && ((StringUtils.isNotBlank(consultant.getRole()) && consultant.getRole().equals(currentConsultant.getRole())) || StringUtils.isBlank(consultant.getRole()))){
-                    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 currentUser=userService.get(ruralProjectRecords.getProjectMasterId());
+                currentConsultant.setZixunyuanName(currentUser.getName());
+                currentConsultant.setZixunyuan(currentUser.getId());
+                currentConsultant.setRole("负责人");
+                consultants.add(currentConsultant);
+                //查询总审人员信息
+                RuralReportConsultant bzshbConsultant = new RuralReportConsultant();
+                //根据项目id查找报告咨询员信息
+                List<RuralReportConsultant> consultantList = ruralProjectMessageService.getConsultantsList(projectRecords.getId());
+                //使用迭代器去除重复信息
+                //排除 重新申请|撤销
+                Iterator<RuralReportConsultant> it = consultantList.iterator();
+                while(it.hasNext()){
+                    RuralReportConsultant consultant = it.next();
+                    //根据人员id和角色进行唯一值判定,避免出现重复值
+                    if(consultant.getZixunyuan().equals(currentConsultant.getZixunyuan()) && ((StringUtils.isNotBlank(consultant.getRole()) && consultant.getRole().equals(currentConsultant.getRole())) || StringUtils.isBlank(consultant.getRole()))){
+                        try {
+                            MyBeanUtils.copyBeanNotNull2Bean(consultant, currentConsultant);
+                        } catch (Exception e) {
+                            e.printStackTrace();
                         }
-                    }
-                    User user=userService.get(consultant.getZixunyuan());
-                    if(null != user){
-                        consultant.setZixunyuanName(user.getName());
+                        it.remove();
+                    }else{
+                        //根据用户查询技能信息
+
+                        User user=userService.get(consultant.getZixunyuan());
+                        if(null != user){
+                            consultant.setZixunyuanName(user.getName());
                     /*if(StringUtils.isBlank(consultant.getRole())){
                         consultant.setRole("咨询员");
                     }*/
-                    }
-                    if(consultant.getZixunyuan().equals(projectReportData.getBzshbUserId()) && ((StringUtils.isNotBlank(consultant.getRole()) && consultant.getRole().equals("技术负责人")) || StringUtils.isBlank(consultant.getRole()))){
-                        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();
+                        if(consultant.getZixunyuan().equals(projectReportData.getBzshbUserId()) && ((StringUtils.isNotBlank(consultant.getRole()) && consultant.getRole().equals("技术负责人")) || StringUtils.isBlank(consultant.getRole()))){
+                            User chenHongXing=UserUtils.getByLoginName("陈红星");
+                            List<WorkStaffCertificate> chenHongXingCertificateList = ruralProjectMessageService.getCertificateByUser(chenHongXing.getId());
+                            //获取陈红星的造价师信息
+                            WorkStaffCertificate chenHongXingStaffCertificate = chenHongXingCertificateList.get(0);
+
+                            bzshbConsultant = consultant;
+                            bzshbConsultant.setZhucezigezhID(chenHongXingStaffCertificate.getNum());
+                            bzshbConsultant.setZixunyuanName("陈红星("+consultant.getZixunyuanName()+"代)");
+                            bzshbConsultant.setRole("技术负责人");
+                            it.remove();
+                        }
                     }
                 }
-            }
-            consultants.addAll(consultantList);
+                consultants.addAll(consultantList);
 
-            if(StringUtils.isNotBlank(bzshbConsultant.getZixunyuan())){
-                consultants.add(bzshbConsultant);
-            }else{
-                //查询总审人员信息
-                bzshbConsultant = new RuralReportConsultant();
-                List<WorkStaffCertificate> bzshbCertificateList = 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());
+                if(StringUtils.isNotBlank(bzshbConsultant.getZixunyuan())){
                     consultants.add(bzshbConsultant);
-                }
-                Iterator<RuralReportConsultant> itView = consultants.iterator();
-                while (itView.hasNext()) {
-                    RuralReportConsultant consultant = itView.next();
-                    if (bzshbCertificateList.size() > 0) {
-                        if (consultant.getZixunyuan().equals(bzshbConsultant.getZixunyuan()) && ((StringUtils.isNotBlank(consultant.getRole()) && consultant.getRole().equals("技术负责人")) || StringUtils.isBlank(consultant.getRole()) )) {
-                            try {
-                                MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
-                                bzshbConsultant.setZixunyuanName("陈红星(" + bzshbConsultant.getZixunyuanName() + "代)");
-                                bzshbConsultant.setRole("技术负责人");
-                            } catch (Exception e) {
-                                e.printStackTrace();
+                }else{
+                    //查询总审人员信息
+                    bzshbConsultant = new RuralReportConsultant();
+                    List<WorkStaffCertificate> bzshbCertificateList = Lists.newArrayList();
+                    if(StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
+                        bzshbCertificateList = ruralProjectMessageService.getCertificateByUser(projectReportData.getBzshbUserId());
+                    }
+                    for (WorkStaffCertificate certificateInfo: bzshbCertificateList) {
+                        bzshbConsultant.setZhucezigezhID(certificateInfo.getNum());
+                        bzshbConsultant.setZhucezigezhKey(certificateInfo.getName());
+
+                        User bzshbUser=userService.get(projectReportData.getBzshbUserId());
+                        bzshbConsultant.setZixunyuanName(bzshbUser.getName());
+                        bzshbConsultant.setZixunyuan(bzshbUser.getId());
+                        consultants.add(bzshbConsultant);
+                    }
+                    Iterator<RuralReportConsultant> itView = consultants.iterator();
+                    while (itView.hasNext()) {
+                        RuralReportConsultant consultant = itView.next();
+                        if (bzshbCertificateList.size() > 0) {
+                            if (consultant.getZixunyuan().equals(bzshbConsultant.getZixunyuan()) && ((StringUtils.isNotBlank(consultant.getRole()) && consultant.getRole().equals("技术负责人")) || StringUtils.isBlank(consultant.getRole()) )) {
+                                try {
+                                    MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
+                                    bzshbConsultant.setZixunyuanName("陈红星(" + bzshbConsultant.getZixunyuanName() + "代)");
+                                    bzshbConsultant.setRole("技术负责人");
+                                } catch (Exception e) {
+                                    e.printStackTrace();
+                                }
+                                itView.remove();
                             }
-                            itView.remove();
-                        }
-                    } else {
-                        if (consultant.getZixunyuan().equals(projectReportData.getBzshbUserId()) && ((StringUtils.isNotBlank(consultant.getRole()) && consultant.getRole().equals("技术负责人")) || StringUtils.isBlank(consultant.getRole()) )) {
-                            try {
-                                MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
-                                bzshbConsultant.setZixunyuanName("陈红星(" + bzshbConsultant.getZixunyuanName() + "代)");
-                                bzshbConsultant.setRole("技术负责人");
-                            } catch (Exception e) {
-                                e.printStackTrace();
+                        } else {
+                            if (consultant.getZixunyuan().equals(projectReportData.getBzshbUserId()) && ((StringUtils.isNotBlank(consultant.getRole()) && consultant.getRole().equals("技术负责人")) || StringUtils.isBlank(consultant.getRole()) )) {
+                                try {
+                                    MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
+                                    bzshbConsultant.setZixunyuanName("陈红星(" + bzshbConsultant.getZixunyuanName() + "代)");
+                                    bzshbConsultant.setRole("技术负责人");
+                                } catch (Exception e) {
+                                    e.printStackTrace();
+                                }
+                                itView.remove();
                             }
-                            itView.remove();
                         }
                     }
-                }
-                if(StringUtils.isNotBlank(bzshbConsultant.getZixunyuan())){
-                    consultants.add(bzshbConsultant);
-                }else{
-                    if(StringUtils.isNotBlank(projectReportData.getBzshbUserId())){
-                        User user=userService.get(projectReportData.getBzshbUserId());
-                        bzshbConsultant.setZixunyuanName("陈红星("+user.getName()+"代)");
-                        bzshbConsultant.setZixunyuan(user.getId());
-                        bzshbConsultant.setRole("技术负责人");
+                    if(StringUtils.isNotBlank(bzshbConsultant.getZixunyuan())){
                         consultants.add(bzshbConsultant);
+                    }else{
+                        if(StringUtils.isNotBlank(projectReportData.getBzshbUserId())){
+                            User user=userService.get(projectReportData.getBzshbUserId());
+                            bzshbConsultant.setZixunyuanName("陈红星("+user.getName()+"代)");
+                            bzshbConsultant.setZixunyuan(user.getId());
+                            bzshbConsultant.setRole("技术负责人");
+                            consultants.add(bzshbConsultant);
+                        }
                     }
                 }
-            }
-            for (RuralReportConsultant consultant : consultants) {
-                if(StringUtils.isBlank(consultant.getRole())){
-                    consultant.setRole("咨询员");
-                }
-            }
-            //展示
-            //获取自检的质量复核标准
-            String reviewId="";
-            if ("2".equals(ruralProjectRecords.getSubmitMoney())){
-                reviewId="1";
-            }else{
-                if(StringUtils.isBlank(ruralProjectRecords.getEmergencyProject()) ||"0".equals(ruralProjectRecords.getEmergencyProject())){
-                    reviewId="2";
-                }else{
-                    reviewId="3";
-                }
-            }
-            List<WorkReviewAudit> workReviewAudits = projectContentDataService.findListReview(reviewId,"质量复核");
-            WorkReviewAudit workReviewAudit = new WorkReviewAudit();
-            String type = "4";
-            workReviewAudit.setCompanyId(UserUtils.getSelectCompany().getId());
-            workReviewAudit.setType(type);
-            workReviewAudit.setReportId(projectReportData.getId());
-            List<WorkReviewAudit> audits = workReviewStandardService.findAuditList(workReviewAudit);
-            for(WorkReviewAudit reviewAudit:workReviewAudits){
-                for (WorkReviewAudit audit:audits){
-                    if (reviewAudit.getId().equals(audit.getStandardId())){
-                        reviewAudit.setDeductOption(audit.getDeductOption());
-                        break;
+                for (RuralReportConsultant consultant : consultants) {
+                    if(StringUtils.isBlank(consultant.getRole())){
+                        consultant.setRole("咨询员");
                     }
                 }
-            }
-            projectReportData.setProjectReviewList(workReviewAudits);
 
-            //查询总审人员信息
-            List<User> auditUserList = userService.getAuditUserList();
-            projectRecord.setBzshbUserList(auditUserList);
-            //项目组成员
-            projectReportData.setConsultants(consultants);
+                //查询总审人员信息
+                List<User> auditUserList = userService.getAuditUserList();
+                projectRecords.setBzshbUserList(auditUserList);
+                //项目组成员
+                projectReportDataVo.setConsultants(consultants);
 //            model.addAttribute("consultantinfo", consultants);
 
-            List<MainDictDetail> achievementTypes = DictUtils.getMainDictList("achievement_type");
-            if(null != achievementTypes){
-                for (MainDictDetail achievementType:achievementTypes) {
-                    if(achievementType.getValue().equals(projectReportData.getAchievementType())){
-                        projectReportData.setAchievementType(achievementType.getLabel());
-                        break;
-                    }
+                projectRecords.setProjectReportDataVo(projectReportDataVo);
+                //获取总审人员
+                User user=UserUtils.get(projectReportData.getBzshbUserId());
+                if(null != user){
+                    projectRecords.setBzshbUserName(user.getName());
                 }
-            }
-            projectRecord.setReportData(projectReportData);
-            //获取总审人员
-            User user=UserUtils.get(projectReportData.getBzshbUserId());
-            if(null != user){
-                projectRecord.setBzshbUserName(user.getName());
-            }
 
-        }
 
+            }
 
+        }
+        return projectRecords;
     }
 }

+ 55 - 79
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -6765,86 +6765,62 @@ GROUP BY
 
 	<select id="getListByOffice" resultType="RuralProjectRecords">
 		SELECT
-		<include refid="newProjectRecordsColumns"/>
-		,concat(ifnull( pfp.STATUS, 0 ),ifnull( ppf.STATUS, 0 )) as "downProjectReportRecordPaperFilingStatus"
-		,su.name as "leaderNameStr"
-		,su.mobile as "leaderNamePhone"
-		,sua.name as "createName"
-		,sua.mobile as "createNamePhone"
-		,su.id as "leaderNameIds"
-		,a.submit_money as "submitMoney"
-		,a.project_type as projectType,
-		wci.name AS "workContractInfo.name",
-		wct.id AS "workContractInfo.client.id",
-		wct.name AS "workContractInfo.client.name",
-		o.top_company AS "office.name",
-		ifnull(prd.number ,"") as "projectReportNumber"
-		,(case when ifnull(prd.number ,"") = '' then '0' when ifnull(prd.number ,"") != '' then '1' else '' end) as reportDataFlag
-		,ifnull(prd.status,0) as "projectReportStatus"
-		,ifnull(prd.name,"") as "projectReportName"
-		,a.project_material_storage_status as "projectMaterialStorageStatus"
-		,prr.status as "projectReportRecordStatus"
-		,prr.process_instance_id as prrProcessInstanceId
-		,prd.id as prdId
-		,prr.id as prrId
-		,prd.audit_pass_date as auditPassDate
-		,ifnull(rprr.report_status,0) as "reportStatus"
-		,ifnull(rprr.sync_status,0) as "syncStatus"
-		,rprr.process_instance_id as "reportedProcessInstanceId"
-		,ifnull(prdt.status,0) as "projectReportStatusTwo"
-		,prdt.id as prdtId
-		,prdt.process_instance_id as prdtProcessinstanceId
-		,ifnull(pmdr.status,0) as "defectRecordStatus"
-		,pmdr.process_instance_id as "pmdrProcessInstanceId"
-		,pmdr.id as pmdrId
-		,ifnull(ppf.status,0) as "paperFilingStatus"
-		,ppf.process_instance_id as "ppfProcessInstanceId"
-		,ppf.id as "ppfId"
-		,pfb.process_instance_id AS "filingProcessinstanceId"
-		,ifnull(pfp.status,0) as "filingProjectStatus"
-		,prd.audit_pass_date as "prdAuditDate"
-		,prd.ZiXunShouRu as "money"
-		,cb.case_process_id as "caseProcessId"
-		,cb.case_type as "caseType"
-		,cb.case_create_by as "caseCreateBy"
-		,if(case_status > 0 ,case_status,"0") as "caseStatus"
-		,ifnull(prrd.status,0) as "downProjectReportRecordStatus"
-		,prrd.id as "prrdId"
-		,so.name as "belongingDepartmentName"
-		,a.engineering_type as "engineeringType"
-		,supmi.name as "projectMasterName"
-		,supmi.mobile as "projectMasterPhone"
-		,a.start_date as "startDate"
-		,a.ending_date as "endDate"
-		FROM rural_project_records a
-		LEFT JOIN sys_area area ON area.id = a.area_id
-		left join rural_project_records_reported rprr on rprr.id = a.id
-		left join case_base cb on a.id = cb.project_id
-		left join
-		(select id,status,project_id,filing_batch from
-		(
-		select id,create_date,status,project_id,filing_batch
-		from project_flingbatch_relation order by create_date desc
-		)z
-		group by z.project_id desc
-		) pfp ON pfp.project_id = a.id
-
-		LEFT JOIN project_filingbatch pfb on pfb.id=pfp.filing_batch
-		LEFT JOIN sys_user sua on a.create_by = sua.id
-		LEFT JOIN work_project_user w1 on a.id = w1.project_id
-		LEFT JOIN sys_user su on w1.user_id = su.id
-		LEFT JOIN work_contract_info wci on a.contract_id = wci.id
-		LEFT JOIN work_client_info wct on wci.client_id = wct.id
-		LEFT JOIN sys_office o ON o.id = a.office_id
-		left join project_report_data prd on prd.project_id = a.id
-		left join project_report_data_two prdt on prdt.project_id = a.id
-		left join rural_project_report_record prr on prr.report_id = prd.id
-		LEFT JOIN project_material_defect_record pmdr on prd.id = pmdr.report_id
-		left join project_paper_filing ppf on ppf.project_id = a.id
-		left join rural_project_report_record_down prrd on prrd.report_id = prd.id
-		left join sys_office so on so.id = a.belonging_department
-		LEFT JOIN sys_user supmi ON supmi.id = a.project_master_id
+			a.id AS "id",
+			a.create_date AS "createDate",
+			a.update_date AS "updateDate",
+			a.contract_id AS "workContractInfo.id",
+			a.project_id AS "projectId",
+			a.project_name AS "projectName",
+			area.NAME AS "area.name",
+			su.NAME AS "leaderNameStr",
+			su.mobile AS "leaderNamePhone",
+			sua.NAME AS "createName",
+			sua.mobile AS "createNamePhone",
+			a.submit_money AS "submitMoney",
+			a.project_type AS projectType,
+			wci.NAME AS "workContractInfo.name",
+			wct.id AS "workContractInfo.client.id",
+			wct.NAME AS "workContractInfo.client.name",
+			o.top_company AS "office.name",
+			a.project_material_storage_status AS "projectMaterialStorageStatus",
+			prd.id as prdId,
+			ifnull(prd.number ,"") as "projectReportNumber",
+			ifnull(prd.status,0) as "projectReportStatus",
+			ifnull(prd.name,"") as "projectReportName",
+			prd.remarks as "remarks",
+			so.NAME AS "belongingDepartmentName",
+			a.engineering_type AS "engineeringType",
+			supmi.NAME AS "projectMasterName",
+			supmi.mobile AS "projectMasterPhone",
+			a.start_date AS "startDate",
+			a.ending_date AS "endDate",
+			a.attachment_project_sort AS "attachmentProjectSort",
+			a.engineering_type AS "engineeringType",
+			ifnull(prdt.status,0) as "projectReportStatusTwo",
+			prdt.id as prdtId,
+			prr.id As "prrid",
+			ifnull(prr.status,0) as "projectReportRecordStatus",
+			ifnull(prrd.status,0) as "downProjectReportRecordStatus",
+			prrd.id as prrdId,
+			prr.create_date as "reportRecordBeginDate",
+			prd.first_audit_date as firstAuditDate
+		FROM
+			rural_project_records a
+			LEFT JOIN sys_area area ON area.id = a.area_id
+			LEFT JOIN sys_user sua ON a.create_by = sua.id
+			LEFT JOIN work_project_user w1 ON a.id = w1.project_id
+			LEFT JOIN sys_user su ON w1.user_id = su.id
+			LEFT JOIN work_contract_info wci ON a.contract_id = wci.id
+			LEFT JOIN work_client_info wct ON wci.client_id = wct.id
+			LEFT JOIN sys_office o ON o.id = a.office_id
+			LEFT JOIN sys_office so ON so.id = a.belonging_department
+			LEFT JOIN sys_user supmi ON supmi.id = a.project_master_id
+			left join project_report_data prd on prd.project_id = a.id
+			left join project_report_data_two prdt on prdt.project_id = a.id
+			LEFT JOIN rural_project_report_record prr on prd.id = prr.report_id
+			left join rural_project_report_record_down prrd on prrd.report_id = prd.id
 		where a.office_id = #{officeId} and a.del_flag = '0'
+
 	</select>
 	<select id="findUseableByProjectName" resultType="RuralProjectRecords">
 		select

+ 1 - 0
src/main/resources/mappings/modules/workcontractinfo/WorkContractInfoDao.xml

@@ -414,6 +414,7 @@
 		a.contractTypeDoc AS "contractTypeDoc",
 		a.another_contract_num AS "anotherContractNum",
 		client.name AS "client.name",
+		client.number AS "client.number",
 		client.name as "clientName",
 		a.is_total AS "isTotal",
 		a.total_contract_id AS "totalContractId",