Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

user5 4 éve
szülő
commit
7e179755c0

+ 161 - 5
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageNewService.java

@@ -7,10 +7,7 @@ import com.google.common.collect.Maps;
 import com.google.gson.Gson;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
-import com.jeeplus.common.utils.Collections3;
-import com.jeeplus.common.utils.DateUtils;
-import com.jeeplus.common.utils.MenuStatusEnum;
-import com.jeeplus.common.utils.MyBeanUtils;
+import com.jeeplus.common.utils.*;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.historical.entity.HistoricalData;
@@ -619,7 +616,12 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                 projectcontentinfo.setProject(projectRecord);
                 if (type == 2) {
                     //启动流程
-                    String str = this.saveRuralProject(projectReportData, variables, processInstanceId, projectcontentinfo.getProject().getProjectLeaders());
+                    String str="";
+                    if (StringUtils.isNotBlank(projectcontentinfo.getEdit()) && projectcontentinfo.getEdit().equals("reviewAgain")){
+                        str = this.saveReRural(projectReportData, variables, processInstanceId, projectcontentinfo.getProject().getProjectLeaders());
+                    }else{
+                        str = this.saveRuralProject(projectReportData, variables, processInstanceId, projectcontentinfo.getProject().getProjectLeaders());
+                    }
                     if (!str.equals("true")){
                         return str;
                     }
@@ -1504,6 +1506,160 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
         return "true";
     }
 
+
+
+    /**
+     * 提交存储
+     * @param projectReportData
+     * @param variables
+     */
+    @Transactional(readOnly = false)
+    public String saveReRural(ProjectReportData projectReportData,Map<String, Object> variables,String processInstanceId,List<User> masters) {
+        User user = UserUtils.get(projectReportData.getCreateBy().getId());
+        Boolean insert = false;
+        if (StringUtils.isBlank(projectReportData.getId())){
+            projectReportData.preInsert();
+            insert = true;
+        }
+        String num = projectReportData.getNumber();
+        if(com.jeeplus.common.utils.StringUtils.isNotBlank(num)){
+            projectReportNumService.updateNum(num);
+        }
+        ProjectRecords projectRecords = dao.getRuralProjectRecords(projectReportData.getProject().getId());
+        Office recordsOffice =officeService.get(projectRecords.getOffice());
+        String title = "项目【"+projectRecords.getProjectName()+"】报告质量复核待审批";
+        String str =  "项目【"+projectRecords.getProjectName()+"】报告质量复核待审批";
+        // 用来设置启动流程的人员ID,引擎会自动把用户ID保存到activiti:initiator中
+        identityService.setAuthenticatedUserId(user.getId());
+        // 启动流程
+        String businessKey = projectReportData.getId().toString();
+        WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("9764872f45b84acd893010e66a3db2c8", recordsOffice);
+        // 启动流程
+        String processType = workActivityMenu.getProcessType();
+        StringBuffer buffer = new StringBuffer();
+        Activity activity = new Activity();
+        WorkProjectNotify workProjectNotify = UtilNotify
+                .saveNotify(projectReportData.getId(),
+                        null,
+                        projectReportData.getCompanyId(),
+                        title,
+                        str,
+                        "96",
+                        "0",
+                        "待审批",
+                        ""
+                );
+        List<User> users = new ArrayList<>();
+
+        //总工
+        List<User> bzshbs = new ArrayList<>();
+        User bzshbsUser = UserUtils.get(projectReportData.getBzshbUserId());
+        if(null != bzshbsUser){
+            bzshbs.add(bzshbsUser);
+        }
+
+        if (insert) {
+            projectReportDataService.insert(projectReportData);
+        }else {
+            projectReportDataService.save(projectReportData);
+        }
+        if (com.jeeplus.common.utils.StringUtils.isNotBlank(workActivityMenu.getId())) {
+            workProjectNotify.setNotifyRole("");
+            workActivityMenu = workActivityMenuService.get(workActivityMenu.getId());
+            List<Activity> activities = workActivityMenu.getActivities();
+            for (Activity a : activities) {
+                String encount = a.getEncount();
+                String enlist = a.getEnlist();
+                if (a.getRole()!=null && com.jeeplus.common.utils.StringUtils.isNotBlank(a.getRole().getEnname())){
+                    List enusers = UserUtils.getByRoleActivityEnnames(a.getRole().getEnname(),recordsOffice.getId(),"8",projectReportData.getCreateBy());
+                    if (enusers.size()==0){
+                        projectReportData.setStatus("1");
+                        projectReportDataService.save(projectReportData);
+                        return "流程审批人不能为空,角色"+a.getRole().getName()+"下无用户,请联系管理员!";
+                    }
+                    variables.put(encount, enusers.size());
+                    variables.put(enlist, enusers);
+                }
+                if (a.getDelFlag().equals("0") && a.getCount() == 1) {
+                    activity = a;
+                }
+            }
+            buffer.append(activity.getRole().getEnname());
+            if (activity != null && com.jeeplus.common.utils.StringUtils.isNotBlank(activity.getId())) {
+                //人员审批
+                if (com.jeeplus.common.utils.StringUtils.isNotBlank(activity.getUser().getId())) {
+                    users.add(activity.getUser());
+                }
+                //角色审批
+                if (com.jeeplus.common.utils.StringUtils.isNotBlank(activity.getRole().getEnname())) {
+                    users = UserUtils.getByRoleActivityEnnames(activity.getRole().getEnname(),recordsOffice.getId(),"8",projectReportData.getCreateBy());
+                }
+            }
+            workProjectNotify.setId("");
+        } else {
+            if (bzshbs.size()==0 ){
+                projectReportData.setStatus("1");
+                projectReportDataService.save(projectReportData);
+            }
+            if (bzshbs.size()==0){
+                return "流程审批人不能为空,总工下无用户,请联系管理员!";
+            }
+            processType = "newFirstReportAudit";
+            users.addAll(bzshbs);
+            variables.put("bzshbList", bzshbs);
+            variables.put("bzshbcount", bzshbs.size());
+        }
+        for (User u : users){
+            workProjectNotify.setUser(u);
+            workProjectNotify.setNotifyRole("部门主任审批");
+            workProjectNotify.setId("");
+            workProjectNotifyService
+                    .save(workProjectNotify);
+            Map<String,Object> extras = new HashMap<>();
+            extras.put("type","7001");
+            extras.put("id",workProjectNotify.getId());
+            extras.put("procDefKey","96");
+            UserUtils.pushInfoToApp(title,str,extras,u.getId());
+            UserUtils.pushIm(u.getId(),str);
+        }
+        variables.put("type", processType);
+        variables.put("busId", businessKey);
+        variables.put("title", "审批单:" + projectReportData.getNumber());//设置标题;
+
+        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
+        projectReportData.setProcessInstance(processInstance);
+        if (com.jeeplus.common.utils.StringUtils.isNotBlank(processInstanceId)) {
+            workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
+            workActivityProcessService.deleteProcessInstanceId(processInstanceId);
+            workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
+        }
+        // 更新流程实例ID
+        projectReportData.setProcessInstanceId(processInstance.getId());
+        projectReportDataDao.updateProcessInstanceId(projectReportData);
+        //通知添加流程实例ID
+        workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotifyService.save(workProjectNotify);
+        List<Activity> list = workActivityMenu.getActivities();
+        if (list != null && list.size() != 0) {
+            workActivityProcessService.saveList(list, processInstance.getId());
+        } else {
+            WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+            workActivityProcess.setProcessKey(processType);
+            workActivityProcess.setCount(1);
+            workActivityProcess.setProcessInstanceId(processInstance.getId());
+            workActivityProcess.setIsApproval("0");
+            workActivityProcess.setCreateBy(user);
+            workActivityProcess.setUpdateBy(user);
+            if (StringUtils.isBlank(workActivityProcess.getId())){
+                workActivityProcess.setId(IdGen.uuid());
+            }
+            workActivityProcess.setUpdateDate(new Date());
+            workActivityProcess.setCreateDate(new Date());
+            workActivityProcessService.insert(workActivityProcess);
+            workActivityProcessService.insertAuditsByType(bzshbs,processInstance.getId(),1,1);
+        }
+        return "true";
+    }
     public ProjectReportRecord getProjectReportRecord(String reportId){
         ProjectReportRecord projectReportRecord = dao.getProjectReportRecord(reportId);
         if(projectReportRecord != null){

+ 213 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageNewController.java

@@ -1483,4 +1483,217 @@ public class RuralCostProjectMessageNewController extends BaseController {
             return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectMessage/?repage";
         }
     }
+
+    /**
+     * 跳转新增报告页面
+     * @param projectcontentinfo
+     * @param request
+     * @param response
+     * @param model
+     * @param attr
+     * @return
+     */
+    @RequestMapping(value = {"reviewForm"})
+    public String reviewForm(RuralProjectcontentinfo projectcontentinfo,Double reviewFee, HttpServletRequest request, HttpServletResponse response, Model model, RedirectAttributes attr) {
+        //查询“配农网”工程类型id
+        String engineeringId = engineeringService.getEngineeringId("202");
+        Projectcontentinfo projectcontentinfo1 = projectcontentinfoService.getByProjectId(projectcontentinfo.getProjectId());
+        model.addAttribute("parentIds", projectcontentinfo1.getParentIds());
+        String dictType = projectcontentinfo.getDictType();
+        RuralProjectRecords records = projectRecordsService.getQueryProjectUsers(projectcontentinfo1.getProject().getId());
+
+        projectcontentinfo.setProject(records);
+        //根据项目id查询报告信息
+        ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(records.getId());
+        if(null == projectReportData){
+            projectReportData = new ProjectReportData();
+        }else{
+            projectcontentinfo.setProjectReportData(projectReportData);
+        }
+        projectReportData.setType(dictType);
+        if (StringUtils.isNotBlank(projectcontentinfo1.getInfoId()) && StringUtils.isBlank(projectReportData.getId())){
+            projectReportData = projectReportDataService.get(projectcontentinfo1.getInfoId());
+        }else if (projectcontentinfo.getProjectReportData()!=null && StringUtils.isNotBlank(projectcontentinfo.getProjectReportData().getId())) {
+            projectReportData = projectReportDataService.get(projectcontentinfo.getProjectReportData().getId());
+        }else {
+            projectReportData.setNumber("");
+        }
+        if (projectReportData.getMaster()==null || StringUtils.isBlank(projectReportData.getMaster().getId())){
+            projectReportData.setMaster(UserUtils.getUser());
+        }
+        if (StringUtils.isBlank(projectReportData.getStatus())){
+            projectReportData.setFileStatus("1");
+        }
+        if(null != reviewFee){
+            projectReportData.setReviewFee(String.valueOf(reviewFee));
+        }
+        projectcontentinfo.setProjectReportData(projectReportData);
+
+        ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
+        //添加项目类型
+        relateInfo.setAttachmentProjectType(records.getProjectType());
+        relateInfo.setAttachmentProjectSort(records.getAttachmentProjectSort());
+        //判断是否为打包项目,打包项目无需查看项目送审金额是否为500w以上判定
+        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;
+        }
+
+        //添加报告类型
+        relateInfo.setRequiredStage(1);
+        relateInfo.setId(records.getId());
+        //查询报告文件、依据性文件、其他文件必填列表以及数据
+        List<MainDictDetail> mainDictDetails = projectTemplateService.attachmentTemplateList();
+        for (MainDictDetail mainDict : mainDictDetails) {
+            relateInfo.setAttachType(mainDict.getValue());
+            switch (mainDict.getValue()) {
+                case "11":
+                    List<ProjectTemplateInfo> fileAttachmentList = projectTemplateService.getProjectTemplateList(relateInfo);
+                    for (ProjectTemplateInfo info: fileAttachmentList) {
+                        info.setAttachTypes(info.getAttachTypes().toLowerCase());
+                        if(engineeringId.equals(records.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");
+                                }
+                            }
+                        }
+                    }
+                    projectcontentinfo.setFileAttachmentList(fileAttachmentList);
+                    break;
+                case "12":
+                    List<ProjectTemplateInfo> projectTemplateList = projectTemplateService.getProjectTemplateList(relateInfo);
+                    for (ProjectTemplateInfo info: projectTemplateList) {
+                        info.setAttachTypes(info.getAttachTypes().toLowerCase());
+                        if(engineeringId.equals(records.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");
+                                }
+                            }
+                        }
+                    }
+                    projectcontentinfo.setFileGistdataList(projectTemplateList);
+                    break;
+                case "13":
+                    projectcontentinfo.setFileOtherList(projectTemplateService.getProjectTemplateList(relateInfo));
+                    break;
+            }
+
+        }
+
+        //查询总审人员信息
+        List<User> auditUserList = userService.getAuditUserList();
+        records.setBzshbUserList(auditUserList);
+        if(null == projectcontentinfo.getProjectReportData().getConsultant()){
+            projectcontentinfo.getProjectReportData().setConsultant(UserUtils.getUser());
+        }
+        if(null == projectcontentinfo.getProjectReportData().getPrincipal()){
+            projectcontentinfo.getProjectReportData().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();
+        if (StringUtils.isNotBlank(projectcontentinfo.getView()) && projectcontentinfo.getView().equals("reloadReport")){
+            if(StringUtils.isNotBlank(projectcontentinfo.getProjectReportData().getBzshbUserId())){
+                zongshen.setZixunyuan(projectReportData.getBzshbUserId());
+            }
+        }
+
+        //根据项目id查找报告咨询员信息
+        List<RuralReportConsultant> consultantList = ruralProjectMessageService.getConsultantsList(projectcontentinfo.getProjectId());
+        //使用迭代器去除重复信息
+        //排除 重新申请|撤销
+        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);
+        model.addAttribute("info", consultants);
+
+        //添加当前文件服务器类型
+        projectcontentinfo.setUploadMode(uploadMode);
+        model.addAttribute("projectRecords", records);
+        model.addAttribute("projectcontentinfo", projectcontentinfo);
+        model.addAttribute("projectReportData", projectcontentinfo.getProjectReportData());
+        if (projectReportData != null && projectReportData.getCreateBy() != null && StringUtils.isNotBlank(projectReportData.getCreateBy().getId())) {
+            return "modules/ruralprojectrecords/cost/projectcontentinfo/new/reportForm";
+        } else if (projectReportData == null || StringUtils.isBlank(projectReportData.getId())) {
+            return "modules/ruralprojectrecords/cost/projectcontentinfo/new/reportForm";
+        } else {
+            return "modules/ruralprojectrecords/cost/projectcontentinfo/reportView";
+        }
+    }
 }

+ 208 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageNewController.java

@@ -1496,5 +1496,213 @@ public class RuralProjectMessageNewController extends BaseController {
             return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectMessage/?repage";
         }
     }
+    /**
+     * 管理员重新复核
+     * 跳转新增报告页面
+     * @param projectcontentinfo
+     * @param request
+     * @param response
+     * @param model
+     * @param attr
+     * @return
+     */
+    @RequestMapping(value = {"reviewForm"})
+    public String reviewForm(RuralProjectcontentinfo projectcontentinfo,Double reviewFee, HttpServletRequest request, HttpServletResponse response, Model model, RedirectAttributes attr) {
+        //查询“配农网”工程类型id
+        String engineeringId = engineeringService.getEngineeringId("202");
+        Projectcontentinfo projectcontentinfo1 = projectcontentinfoService.getByProjectId(projectcontentinfo.getProjectId());
+        model.addAttribute("parentIds", projectcontentinfo1.getParentIds());
+        String dictType = projectcontentinfo.getDictType();
+        RuralProjectRecords records = projectRecordsService.getQueryProjectUsers(projectcontentinfo1.getProject().getId());
+
+        projectcontentinfo.setProject(records);
+        //根据项目id查询报告信息
+        ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(records.getId());
+        if(null == projectReportData){
+            projectReportData = new ProjectReportData();
+        }else{
+            projectcontentinfo.setProjectReportData(projectReportData);
+        }
+        projectReportData.setType(dictType);
+        if (StringUtils.isNotBlank(projectcontentinfo1.getInfoId()) && StringUtils.isBlank(projectReportData.getId())){
+            projectReportData = projectReportDataService.get(projectcontentinfo1.getInfoId());
+        }else if (projectcontentinfo.getProjectReportData()!=null && StringUtils.isNotBlank(projectcontentinfo.getProjectReportData().getId())) {
+            projectReportData = projectReportDataService.get(projectcontentinfo.getProjectReportData().getId());
+        }else {
+            projectReportData.setNumber("");
+        }
+        if (projectReportData.getMaster()==null || StringUtils.isBlank(projectReportData.getMaster().getId())){
+            projectReportData.setMaster(UserUtils.get(projectReportData.getCreateBy().getId()));
+        }
+        if (StringUtils.isBlank(projectReportData.getStatus())){
+            projectReportData.setFileStatus("1");
+        }
+        if(null != reviewFee){
+            projectReportData.setReviewFee(String.valueOf(reviewFee));
+        }
+        projectcontentinfo.setProjectReportData(projectReportData);
+
+        ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
+        //添加项目类型
+        relateInfo.setAttachmentProjectType(records.getProjectType());
+        relateInfo.setAttachmentProjectSort(records.getAttachmentProjectSort());
+        //判断是否为打包项目,打包项目无需查看项目送审金额是否为500w以上判定
+        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;
+        }
 
+        //添加报告类型
+        relateInfo.setRequiredStage(1);
+        relateInfo.setId(records.getId());
+        //查询报告文件、依据性文件、其他文件必填列表以及数据
+        List<MainDictDetail> mainDictDetails = projectTemplateService.attachmentTemplateList();
+        for (MainDictDetail mainDict : mainDictDetails) {
+            relateInfo.setAttachType(mainDict.getValue());
+            switch (mainDict.getValue()) {
+                case "11":
+                    List<ProjectTemplateInfo> fileAttachmentList = projectTemplateService.getProjectTemplateList(relateInfo);
+                    for (ProjectTemplateInfo info: fileAttachmentList) {
+                        info.setAttachTypes(info.getAttachTypes().toLowerCase());
+                        if(engineeringId.equals(records.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");
+                                }
+                            }
+                        }
+                    }
+                    projectcontentinfo.setFileAttachmentList(fileAttachmentList);
+                    break;
+                case "12":
+                    List<ProjectTemplateInfo> projectTemplateList = projectTemplateService.getProjectTemplateList(relateInfo);
+                    for (ProjectTemplateInfo info: projectTemplateList) {
+                        info.setAttachTypes(info.getAttachTypes().toLowerCase());
+                        if(engineeringId.equals(records.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");
+                                }
+                            }
+                        }
+                    }
+                    projectcontentinfo.setFileGistdataList(projectTemplateList);
+                    break;
+                case "13":
+                    projectcontentinfo.setFileOtherList(projectTemplateService.getProjectTemplateList(relateInfo));
+                    break;
+            }
+
+        }
+
+        //查询总审人员信息
+        List<User> auditUserList = userService.getAuditUserList();
+        records.setBzshbUserList(auditUserList);
+        if(null == projectcontentinfo.getProjectReportData().getConsultant()){
+            projectcontentinfo.getProjectReportData().setConsultant(UserUtils.getUser());
+        }
+        if(null == projectcontentinfo.getProjectReportData().getPrincipal()){
+            projectcontentinfo.getProjectReportData().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();
+        if (StringUtils.isNotBlank(projectcontentinfo.getView()) && projectcontentinfo.getView().equals("reloadReport")){
+            if(StringUtils.isNotBlank(projectcontentinfo.getProjectReportData().getBzshbUserId())){
+                zongshen.setZixunyuan(projectReportData.getBzshbUserId());
+            }
+        }
+        //根据项目id查找报告咨询员信息
+        List<RuralReportConsultant> consultantList = ruralProjectMessageService.getConsultantsList(projectcontentinfo.getProjectId());
+        //使用迭代器去除重复信息
+        //排除 重新申请|撤销
+        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);
+        model.addAttribute("info", consultants);
+        //添加当前文件服务器类型
+        projectcontentinfo.setUploadMode(uploadMode);
+        model.addAttribute("projectRecords", records);
+        model.addAttribute("projectcontentinfo", projectcontentinfo);
+        model.addAttribute("projectReportData", projectcontentinfo.getProjectReportData());
+        if (projectReportData != null && projectReportData.getCreateBy() != null && StringUtils.isNotBlank(projectReportData.getCreateBy().getId())) {
+            return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/reportForm";
+        } else if (projectReportData == null || StringUtils.isBlank(projectReportData.getId())) {
+            return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/reportForm";
+        } else {
+            return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/reportView";
+        }
+    }
 }

+ 3 - 1
src/main/java/com/jeeplus/modules/workactivity/service/WorkActivityProcessService.java

@@ -58,7 +58,9 @@ public class WorkActivityProcessService extends CrudService<WorkActivityProcessD
 	}
 	@Transactional(readOnly = false)
 	public void insert(WorkActivityProcess workActivityProcess) {
-		workActivityProcess.preInsert();
+		if (StringUtils.isBlank(workActivityProcess.getId())){
+			workActivityProcess.preInsert();
+		}
 		dao.insert(workActivityProcess);
 	}
 

+ 6 - 3
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectMessageLists.jsp

@@ -1012,9 +1012,7 @@
 						<%--xml+="<a href=\"${ctx}/ruralProject/ruralCostProjectMessage/deleteReport?projectId=" + d.id + "\" onclick=\"return confirmx('确认要删除该项目报告质量复核吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\" > 删除报告</a>";--%>
 					}
 					if(d.projectReportStatus == 5){
-						if (d.projectReportStatusTwo != 5 && d.projectReportStatusTwo != 2){
-							xml+="<a href=\"#\" onclick=\"openDialogre('修改报告信息', '${ctx}/ruralProject/ruralCostProjectMessageNew/form?projectId=" + d.id +"&view=reloadReport','95%', '95%','','送审,暂存,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 重新复核</a>";
-						}
+
 						if(d.projectReportStatusTwo == 0){
 							xml+="<a href=\"#\" onclick=\"openDialogre('报告签发', '${ctx}/ruralProject/ruralProjectMessageNewTwo/form?projectId=" + d.id +"&view=costLiu','95%', '95%','','送审,暂存,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 报告签发</a>";
 						}
@@ -1127,6 +1125,11 @@
 					if ('0'!=d.projectReportStatus){
 						xml+="<a href=\"#\" onclick=\"openDialogre('修改质量复核', '${ctx}/ruralProject/ruralCostProjectMessage/adminEditForm?projectId=" + d.id + "','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" > 修改质量复核</a>";
 					}
+					if(d.projectReportStatus == 5){
+						if (d.projectReportStatusTwo != 5 && d.projectReportStatusTwo != 2){
+							xml+="<a href=\"#\" onclick=\"openDialogre('修改报告信息', '${ctx}/ruralProject/ruralCostProjectMessageNew/reviewForm?projectId=" + d.id +"&view=reloadReport&edit=reviewAgain','95%', '95%','','送审,暂存,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 重新复核</a>";
+						}
+					}
 				</shiro:hasPermission>
 				xml+="</div>";
 				return[xml].join('');

+ 6 - 3
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/ruralProjectMessageLists.jsp

@@ -1012,9 +1012,6 @@
 						//xml+="<a href=\"${ctx}/ruralProject/ruralProjectMessage/deleteReport?projectId=" + d.id + "\" onclick=\"return confirmx('确认要删除该项目报告吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\" > 删除报告</a>";
 					}
                     if(d.projectReportStatus == 5){
-                    	if (d.projectReportStatusTwo != 5 && d.projectReportStatusTwo != 2){
-							xml+="<a href=\"#\" onclick=\"openDialogre('修改报告质量复核信息', '${ctx}/ruralProject/ruralProjectMessageNew/form?projectId=" + d.id +"&view=reloadReport','95%', '95%','','送审,暂存,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 重新复核</a>";
-						}
 						if(d.projectReportStatusTwo == 0){
 							xml+="<a href=\"#\" onclick=\"openDialogre('报告签发', '${ctx}/ruralProject/ruralProjectMessageNewTwo/form?projectId=" + d.id +"','95%', '95%','','送审,暂存,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" > 报告签发</a>";
 						}
@@ -1126,7 +1123,13 @@
 				if ('0'!=d.projectReportStatus){
 					xml+="<a href=\"#\" onclick=\"openDialogre('修改质量复核', '${ctx}/ruralProject/ruralProjectMessage/adminEditForm?projectId=" + d.id + "','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" > 修改质量复核</a>";
 				}
+				if(d.projectReportStatus == 5){
+					if (d.projectReportStatusTwo != 5 && d.projectReportStatusTwo != 2){
+						xml+="<a href=\"#\" onclick=\"openDialogre('修改报告质量复核信息', '${ctx}/ruralProject/ruralProjectMessageNew/reviewForm?projectId=" + d.id +"&view=reloadReport&edit=reviewAgain','95%', '95%','','送审,暂存,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 重新复核</a>";
+					}
+				}
 				</shiro:hasPermission>
+
 				xml+="</div>"
 				return[xml].join('');
 			}else{