|
@@ -19,7 +19,6 @@ import com.jeeplus.modules.projectAccessory.dao.ProjectTemplateDao;
|
|
import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
|
|
import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
|
|
import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
|
|
import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
|
|
import com.jeeplus.modules.projectAccessory.service.ProjectAccessoryRelationService;
|
|
import com.jeeplus.modules.projectAccessory.service.ProjectAccessoryRelationService;
|
|
-import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
|
|
|
|
import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
|
|
import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
|
|
import com.jeeplus.modules.projectcontentinfo.dao.ProjectcontentinfoDao;
|
|
import com.jeeplus.modules.projectcontentinfo.dao.ProjectcontentinfoDao;
|
|
import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
|
|
import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
|
|
@@ -30,7 +29,7 @@ import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectClientLinkmanDao;
|
|
import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectRecordsDao;
|
|
import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectRecordsDao;
|
|
import com.jeeplus.modules.ruralprojectrecords.dao.RuralWorkProjectUserDao;
|
|
import com.jeeplus.modules.ruralprojectrecords.dao.RuralWorkProjectUserDao;
|
|
import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
|
|
import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
|
|
-import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecordsReported;
|
|
|
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
|
|
import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
|
|
import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
|
|
import com.jeeplus.modules.serialnum.service.SerialNumTplService;
|
|
import com.jeeplus.modules.serialnum.service.SerialNumTplService;
|
|
import com.jeeplus.modules.sys.entity.MainDictDetail;
|
|
import com.jeeplus.modules.sys.entity.MainDictDetail;
|
|
@@ -67,21 +66,16 @@ import org.activiti.engine.RuntimeService;
|
|
import org.activiti.engine.history.HistoricTaskInstance;
|
|
import org.activiti.engine.history.HistoricTaskInstance;
|
|
import org.activiti.engine.history.HistoricTaskInstanceQuery;
|
|
import org.activiti.engine.history.HistoricTaskInstanceQuery;
|
|
import org.activiti.engine.runtime.ProcessInstance;
|
|
import org.activiti.engine.runtime.ProcessInstance;
|
|
-import org.activiti.engine.task.Task;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.*;
|
|
import java.io.*;
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
-import java.util.zip.ZipEntry;
|
|
|
|
-import java.util.zip.ZipOutputStream;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 项目登记Service
|
|
* 项目登记Service
|
|
@@ -1645,4 +1639,121 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
|
|
|
|
|
|
return projectTemplateList;
|
|
return projectTemplateList;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 项目列表新增文件信息获取
|
|
|
|
+ * @param projectRecords 项目信息
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public RuralProjectcontentinfo formAccessory(RuralProjectRecords projectRecords){
|
|
|
|
+ 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());
|
|
|
|
+ //查看送审金额是否为500w以上金额
|
|
|
|
+ Integer approvalMoney = projectAccessoryRelationService.decideAttachmentProjectApprovalMoney(projectReportData.getReviewFee());
|
|
|
|
+ if(0 == approvalMoney){
|
|
|
|
+ //金额为0
|
|
|
|
+ relateInfo.setAttachmentProjectApprovalMoney(null);
|
|
|
|
+ }else if(1 == approvalMoney){
|
|
|
|
+ //500w以下金额状态
|
|
|
|
+ relateInfo.setAttachmentProjectApprovalMoney("1");
|
|
|
|
+ }else{
|
|
|
|
+ //500w以上金额状态
|
|
|
|
+ relateInfo.setAttachmentProjectApprovalMoney("2");
|
|
|
|
+ }
|
|
|
|
+ //创建阶段集合(若为归档阶段则将新增报告和归档阶段信息都添加在内)
|
|
|
|
+ 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.attachmentTemplateList();
|
|
|
|
+ for (MainDictDetail mainDict : mainDictDetails) {
|
|
|
|
+ relateInfo.setAttachType(mainDict.getValue());
|
|
|
|
+ switch (mainDict.getValue()) {
|
|
|
|
+ case "11":
|
|
|
|
+ projectcontentinfo.setFileAttachmentList(this.getProjectTemplate(relateInfo,requiredStageList));
|
|
|
|
+ break;
|
|
|
|
+ case "12":
|
|
|
|
+ projectcontentinfo.setFileGistdataList(this.getProjectTemplate(relateInfo,requiredStageList));
|
|
|
|
+ break;
|
|
|
|
+ case "13":
|
|
|
|
+ projectcontentinfo.setFileOtherList(this.getProjectTemplate(relateInfo,requiredStageList));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return projectcontentinfo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ * @param projectTemplateInfo
|
|
|
|
+ * @param requiredStageList
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public List<ProjectTemplateInfo> getProjectTemplate(ProjectAccessoryRelationInfo projectTemplateInfo,List<Integer> requiredStageList){
|
|
|
|
+ //查询所有被选择为必填项展示列,并查询附件信息
|
|
|
|
+ List<ProjectTemplateInfo> projectTemplateList = projectTemplateDao.getProjectTemplateList(projectTemplateInfo);
|
|
|
|
+ for (ProjectTemplateInfo info: projectTemplateList) {
|
|
|
|
+ WorkClientAttachment attchment = new WorkClientAttachment();
|
|
|
|
+ attchment.setProjectId(projectTemplateInfo.getId());
|
|
|
|
+ attchment.setAttachmentId(info.getId());
|
|
|
|
+ List<WorkClientAttachment> attachments = workClientAttachmentDao.getList(attchment);
|
|
|
|
+ info.setWorkAttachments(attachments);
|
|
|
|
+ //判断是否为必填项,若为必填项则添加必填判定字段
|
|
|
|
+ if(requiredStageList.contains(info.getRequiredStage())){
|
|
|
|
+ info.setMustFlag(1);
|
|
|
|
+ }else{
|
|
|
|
+ info.setMustFlag(0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //查询没有被选择必填项的数据并查询是否已经上传附件,若有则添加到展示列中
|
|
|
|
+ List<ProjectTemplateInfo> otherProjectTemplateList = projectTemplateDao.projectAccessoryListByParentId(projectTemplateInfo);
|
|
|
|
+ for (ProjectTemplateInfo otherInfo: otherProjectTemplateList) {
|
|
|
|
+ WorkClientAttachment attchment = new WorkClientAttachment();
|
|
|
|
+ attchment.setProjectId(projectTemplateInfo.getId());
|
|
|
|
+ attchment.setAttachmentId(otherInfo.getId());
|
|
|
|
+ List<WorkClientAttachment> attachments = workClientAttachmentDao.getList(attchment);
|
|
|
|
+ if(attachments.size()>0){
|
|
|
|
+ otherInfo.setWorkAttachments(attachments);
|
|
|
|
+
|
|
|
|
+ otherInfo.setMustFlag(0);
|
|
|
|
+ projectTemplateList.add(otherInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return projectTemplateList;
|
|
|
|
+ }
|
|
}
|
|
}
|