Quellcode durchsuchen

全过程项目功能开发

user5 vor 3 Jahren
Ursprung
Commit
813dc6a155
27 geänderte Dateien mit 13705 neuen und 56 gelöschten Zeilen
  1. 45 0
      src/main/java/com/jeeplus/modules/projectConstruction/dao/ContractDao.java
  2. 684 0
      src/main/java/com/jeeplus/modules/projectConstruction/service/FollowArchiveService.java
  3. 708 0
      src/main/java/com/jeeplus/modules/projectConstruction/service/FollowService.java
  4. 59 6
      src/main/java/com/jeeplus/modules/projectConstruction/web/ContractController.java
  5. 349 0
      src/main/java/com/jeeplus/modules/projectConstruction/web/FollowArchiveController.java
  6. 363 0
      src/main/java/com/jeeplus/modules/projectConstruction/web/FollowController.java
  7. 54 0
      src/main/java/com/jeeplus/modules/projectrecord/dao/ProjectFollowReportDao.java
  8. 66 0
      src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectFollowArchiveInfo.java
  9. 92 0
      src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectFollowReport.java
  10. 67 0
      src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectFollowReportInfo.java
  11. 45 0
      src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectRecordTreeData.java
  12. 90 0
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  13. 116 0
      src/main/resources/mappings/modules/constructionContract/contractDao.xml
  14. 105 2
      src/main/resources/mappings/modules/projectrecord/ProjectFollowReport/ProjectFollowReport.xml
  15. 14 14
      src/main/resources/mappings/modules/projectreportnum/ProjectReportNumDao.xml
  16. 188 4
      src/main/webapp/webpage/modules/ProjectFollowReport/ProjectFollowReportList.jsp
  17. 18 6
      src/main/webapp/webpage/modules/projectConstruction/projectConstructionForm.jsp
  18. 1526 0
      src/main/webapp/webpage/modules/projectrecord/follow/workFollowArchiveAudit.jsp
  19. 1566 0
      src/main/webapp/webpage/modules/projectrecord/follow/workFollowArchiveForm.jsp
  20. 1560 0
      src/main/webapp/webpage/modules/projectrecord/follow/workFollowArchiveModify.jsp
  21. 1526 0
      src/main/webapp/webpage/modules/projectrecord/follow/workFollowReportAudit.jsp
  22. 1566 0
      src/main/webapp/webpage/modules/projectrecord/follow/workFollowReportForm.jsp
  23. 1560 0
      src/main/webapp/webpage/modules/projectrecord/follow/workFollowReportModify.jsp
  24. 318 6
      src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowAudit.jsp
  25. 374 7
      src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowForm.jsp
  26. 328 5
      src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowModify.jsp
  27. 318 6
      src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowView.jsp

+ 45 - 0
src/main/java/com/jeeplus/modules/projectConstruction/dao/ContractDao.java

@@ -6,6 +6,8 @@ package com.jeeplus.modules.projectConstruction.dao;
 import com.jeeplus.common.persistence.CrudDao;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
 import com.jeeplus.modules.projectConstruction.entity.ConstructionContract;
+import com.jeeplus.modules.projectrecord.entity.ProjectFollowArchiveInfo;
+import com.jeeplus.modules.projectrecord.entity.ProjectFollowReportInfo;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
@@ -43,4 +45,47 @@ public interface ContractDao extends CrudDao<ConstructionContract> {
      * @return
      */
     ProjectRecords getRecords(String projectId);
+
+    /**
+     * 根据followId查询数据信息
+     * @param followId
+     * @return
+     */
+    ProjectFollowReportInfo getProjectFollowReportInfo(String followId);
+    /**
+     * 根据followId查询数据信息
+     * @param followId
+     * @return
+     */
+    ProjectFollowArchiveInfo getProjectFollowArchiveInfo(String followId);
+
+    /**
+     * 修改质量复核表
+     * @param projectFollowReportInfo
+     * @return
+     */
+    Integer updateReportInfo(ProjectFollowReportInfo projectFollowReportInfo);
+
+    /**
+     * 新增质量复核表
+     * @param projectFollowReportInfo
+     * @return
+     */
+    Integer insertReportInfo(ProjectFollowReportInfo projectFollowReportInfo);
+
+    /**
+     * 新增质量复核表
+     * @param projectFollowReportInfo
+     * @return
+     */
+    Integer insertArchiveInfo(ProjectFollowArchiveInfo projectFollowReportInfo);
+
+
+    /**
+     * 修改归档表
+     * @param projectFollowReportInfo
+     * @return
+     */
+    Integer updateArchiveInfo(ProjectFollowArchiveInfo projectFollowReportInfo);
+
 }

+ 684 - 0
src/main/java/com/jeeplus/modules/projectConstruction/service/FollowArchiveService.java

@@ -0,0 +1,684 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.projectConstruction.service;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.act.entity.Act;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.projectConstruction.dao.ContractDao;
+import com.jeeplus.modules.projectConstruction.entity.ConstructionContract;
+import com.jeeplus.modules.projectType.dao.ProjectTypeDao;
+import com.jeeplus.modules.projectcontentinfo.dao.ProjectBasedDataDao;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectContentDataService;
+import com.jeeplus.modules.projectrecord.dao.ProjectFollowReportDao;
+import com.jeeplus.modules.projectrecord.dao.WorkProjectUserDao;
+import com.jeeplus.modules.projectrecord.dao.monthly.MonthlyConsultationReportDao;
+import com.jeeplus.modules.projectrecord.entity.ProjectFollowArchiveInfo;
+import com.jeeplus.modules.projectrecord.entity.ProjectFollowReport;
+import com.jeeplus.modules.projectrecord.entity.ProjectFollowReportInfo;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
+import com.jeeplus.modules.projectreportnum.dao.ProjectReportNumDao;
+import com.jeeplus.modules.sys.dao.WorkattachmentDao;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.service.OfficeService;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workactivity.dao.WorkActivityProcessDao;
+import com.jeeplus.modules.workactivity.entity.Activity;
+import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
+import com.jeeplus.modules.workactivity.service.ActivityService;
+import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
+import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
+import com.jeeplus.modules.workactivitymenu.service.WorkActivityMenuService;
+import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
+import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
+import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
+import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
+import org.activiti.engine.HistoryService;
+import org.activiti.engine.IdentityService;
+import org.activiti.engine.RuntimeService;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 全过程跟踪咨询管理Service
+ * @author 徐滕
+ * @version 2021-10-05 13:47
+ */
+@Service
+@Transactional(readOnly = true)
+public class FollowArchiveService extends CrudService<ContractDao,ConstructionContract> {
+    @Autowired
+    private ContractDao contractDao;
+    @Autowired
+    private ProjectFollowReportDao projectFollowReportDao;
+    @Autowired
+    private IdentityService identityService;
+    @Autowired
+    private OfficeService officeService;
+    @Autowired
+    private WorkActivityMenuService workActivityMenuService;
+    @Autowired
+    private RuntimeService runtimeService;
+    @Autowired
+    private WorkActivityProcessService workActivityProcessService;
+    @Autowired
+    private WorkProjectNotifyService workProjectNotifyService;
+    @Autowired
+    protected HistoryService historyService;
+    @Autowired
+    private ActTaskService actTaskService;
+    @Autowired
+    private ActivityService activityService;
+    @Autowired
+    private WorkActivityProcessDao workActivityProcessDao;
+
+    /**
+     * 通过id获取跟踪咨询报告的基础信息
+     */
+    public ProjectFollowReport getReportFollowByArchiveId(String id) {
+        return projectFollowReportDao.getReportFollowByArchiveId(id);
+    }
+    /**
+     * 暂存跟踪咨询报告信息
+     * @param projectFollowReport
+     * @throws Exception
+     */
+    @Transactional(readOnly = false)
+    public void storFollow(ProjectFollowReport projectFollowReport) {
+        ///根据followId查询该项目的归档老数据
+        ProjectFollowArchiveInfo followReportInfo = contractDao.getProjectFollowArchiveInfo(projectFollowReport.getId());
+        ProjectFollowArchiveInfo projectFollowReportInfo =  new ProjectFollowArchiveInfo();
+        projectFollowReportInfo.setArchiveStatus(ProjectStatusEnum.TSTORE.getValue());
+        projectFollowReportInfo.setFollowId(projectFollowReport.getId());
+        projectFollowReportInfo.setProject(projectFollowReport.getProject());
+        projectFollowReportInfo.setBzshbUserId(projectFollowReport.getBzshbUserId());
+        projectFollowReportInfo.setProjectFollowName(projectFollowReport.getProjectFollowName());
+        if(null != followReportInfo && StringUtils.isNotBlank(followReportInfo.getId())){
+            projectFollowReportInfo.preUpdate();
+            projectFollowReportInfo.setId(followReportInfo.getId());
+            contractDao.updateArchiveInfo(projectFollowReportInfo);
+        }else{
+            projectFollowReportInfo.preInsert();
+            contractDao.insertArchiveInfo(projectFollowReportInfo);
+        }
+
+    }
+
+    /**
+     * 新增跟踪咨询报告信息
+     * @param projectFollowReport
+     * @throws Exception
+     */
+    @Transactional(readOnly = false)
+    public void insertFollow(ProjectFollowReport projectFollowReport) throws Exception {
+        ///根据followId查询该项目的归档老数据
+        ProjectFollowArchiveInfo followReportInfo = contractDao.getProjectFollowArchiveInfo(projectFollowReport.getId());
+
+        ProjectFollowArchiveInfo projectFollowReportInfo =  new ProjectFollowArchiveInfo();
+        projectFollowReportInfo.setArchiveStatus(ProjectStatusEnum.IN_APRL.getValue());
+        projectFollowReportInfo.setFollowId(projectFollowReport.getId());
+        projectFollowReportInfo.setProject(projectFollowReport.getProject());
+        projectFollowReportInfo.setBzshbUserId(projectFollowReport.getBzshbUserId());
+        projectFollowReportInfo.setProjectFollowName(projectFollowReport.getProjectFollowName());
+        projectFollowReportInfo.preInsert();
+        //获取原有的审核数据
+        Integer oldStatus = null;
+        if(null != followReportInfo && StringUtils.isNotBlank(followReportInfo.getId())){
+            followReportInfo.getArchiveStatus();
+            projectFollowReportInfo.preUpdate();
+            projectFollowReportInfo.setId(followReportInfo.getId());
+            contractDao.updateArchiveInfo(projectFollowReportInfo);
+        }else{
+            projectFollowReportInfo.preInsert();
+            contractDao.insertArchiveInfo(projectFollowReportInfo);
+        }
+        //启动审批流程
+        if (projectFollowReportInfo.getArchiveStatus()== ProjectStatusEnum.IN_APRL.getValue() &&(oldStatus==null||ProjectStatusEnum.REJECTED.getValue()!=oldStatus)) {
+            this.startAudit(projectFollowReportInfo,projectFollowReportInfo.getProcessInstanceId());
+        }
+
+    }
+
+    /**
+     * 启动审批流程
+     *
+     * @param projectFollowReport
+     */
+    private void startAudit(ProjectFollowArchiveInfo projectFollowReport, String processInstanceId) throws Exception {
+        try{
+            Map<String, Object> variables = new HashMap<String, Object>();
+            identityService.setAuthenticatedUserId(projectFollowReport.getCurrentUser().getId());
+            Office office = projectFollowReport.getProject().getOffice();
+            office = officeService.get(office.getId());
+            projectFollowReport.getProject().setOffice(office);
+
+            String titleStr = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果归档待审批";
+            String contentStr = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果归档审批通过,跟踪咨询名称:" + projectFollowReport.getProjectFollowName();
+
+            String businessKey = projectFollowReport.getId();
+
+            WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("7854872f45b84acd893010e66a3db2c8", office);
+            // 启动流程
+            String processType = workActivityMenu.getProcessType();
+            StringBuffer buffer = new StringBuffer();
+            Activity activity = new Activity();
+            WorkProjectNotify workProjectNotify = UtilNotify
+                    .saveNotify(projectFollowReport.getId(),
+                            null,
+                            UserUtils.getSelectCompany().getId(),
+                            titleStr,
+                            contentStr,
+                            "142",
+                            "0",
+                            "待审批",
+                            ""
+                    );
+
+            //获取初始审核人员list信息
+            List<User> users = new ArrayList<>();
+            //List<User> bmzrs = UserUtils.getByRoleActivityEnname("bzshb",3,office.getId(),"4",projectFollowReport.getCreateBy());
+            List<User> bmzrs = Lists.newArrayList();
+            //总工
+            User bzshbsUser = UserUtils.get(projectFollowReport.getBzshbUserId());
+            if(null != bzshbsUser){
+                bmzrs.add(bzshbsUser);
+            }
+            if (StringUtils.isNotBlank(workActivityMenu.getId())) {
+                processType = workActivityMenu.getProcessType();
+                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 && StringUtils.isNotBlank(a.getRole().getEnname())){
+                        List enusers = UserUtils.getByRoleActivityEnnames(a.getRole().getEnname(),office.getId(),"8",projectFollowReport.getCreateBy());
+                        if (enusers.size()==0){
+                            throw new Exception("流程审批人不能为空,角色"+a.getRole().getName()+"下无用户,请联系管理员!");
+                        }
+                        variables.put(enlist, enusers);
+                        variables.put(encount, enusers.size());
+                    }
+                    if (a.getDelFlag().equals("0") && a.getCount() == 1) {
+                        activity = a;
+                    }
+                }
+                buffer.append(activity.getRole().getEnname());
+                if (activity != null && StringUtils.isNotBlank(activity.getId())) {
+                    //角色审批
+                    if (StringUtils.isNotBlank(activity.getRole().getEnname())) {
+                        users = UserUtils.getByRoleActivityEnnames(activity.getRole().getEnname(),office.getId(),"4",projectFollowReport.getCreateBy());
+                    }
+                    //人员审批
+                    if (StringUtils.isNotBlank(activity.getUser().getId())) {
+                        users.add(activity.getUser());
+                    }
+                }
+                workProjectNotify.setId("");
+            } else {
+                if (bmzrs==null||bmzrs.size()==0){
+                    throw new Exception("流程审批人不能为空,角色部门负责人下无用户,请联系管理员!");
+                }
+                processType = "projectFollow";
+                variables.put("applyUserId", projectFollowReport.getCreateBy().getId());
+                variables.put("bmzrCount",bmzrs.size());
+                variables.put("bmzrList",bmzrs);
+                users.addAll(bmzrs);
+            }
+            List<String> userIds = new ArrayList<>(users.size());
+            for (User u : users){
+                userIds.add(u.getId());
+                workProjectNotify.setUser(u);
+                workProjectNotify.setId("");
+                workProjectNotify.setNotifyRole("总审室审批");
+                workProjectNotifyService.save(workProjectNotify);
+                Map<String,Object> extras = new HashMap<>();
+                extras.put("type","7003");
+                extras.put("procDefKey","142");
+                extras.put("id",workProjectNotify.getId());
+                UserUtils.pushInfoToApp(titleStr,contentStr,extras,u.getId());
+            }
+
+            long t1 = System.currentTimeMillis();
+            UserUtils.pushIm(userIds,contentStr);
+            logger.info("推送消息耗时:{}ms",System.currentTimeMillis()-t1);
+            variables.put("busId", businessKey);
+            variables.put("type", processType);
+            variables.put("title", "审批单:" + projectFollowReport.getProjectFollowName());//设置标题;
+
+            ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
+            if (StringUtils.isNotBlank(processInstanceId)) {
+                workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
+                workActivityProcessService.deleteProcessInstanceId(processInstanceId);
+                workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
+            }
+            //通知添加流程实例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");
+                workActivityProcessService.save(workActivityProcess);
+                workActivityProcessService.insertAuditsByType(bmzrs,processInstance.getId(),1,1);
+            }
+            projectFollowReport.setProcessInstanceId(processInstance.getId());
+            projectFollowReport.setArchiveStatus(ProjectStatusEnum.IN_APRL.getValue());
+            projectFollowReportDao.updateArchiveProcessIdAndStatus(projectFollowReport);
+        }catch (Exception e){
+            logger.error("启动审批流程异常:",e);
+            throw e;
+        }
+    }
+
+    @Transactional(readOnly = false)
+    public String auditSave(ProjectFollowReport projectFollowReport,List<User> auditUsers) throws Exception {
+
+        String projectStatus = projectFollowReport.getOverAllArchiveStatus();
+        String taskDefKey = projectFollowReport.getAct().getTaskDefKey();
+        if (!"modifyApply".equals(taskDefKey) && !taskDefKey.contains("audit") ) {
+            actTaskService.claim(projectFollowReport.getAct().getTaskId(), UserUtils.getUser().getId());
+            List<User> leaders = projectFollowReport.getProjectLeaders();
+        }else {
+            projectFollowReport.getAct().setFlag("yes");
+            //updateFollow(projectFollowReport);
+        }
+
+        String comment = "";
+        if ( projectStatus.equals(ProjectStatusEnum.REJECTED.getValue())) {
+            comment = ("yes".equals(projectFollowReport.getAct().getFlag())?"[重新申请] ":"[已撤销] ");
+        }else {
+            comment = ("yes".equals(projectFollowReport.getAct().getFlag())?"[同意] ":"[驳回] ")+projectFollowReport.getAct().getComment();
+        }
+
+        if (!"yes".equals(projectFollowReport.getAct().getFlag())) {
+            projectFollowReport.setOverAllArchiveStatus(String.valueOf(ProjectStatusEnum.REJECTED.getValue()));
+        }
+
+        User createUser = UserUtils.get(projectFollowReport.getCreateBy().getId());
+
+        Map<String, Object> vars = Maps.newHashMap();
+        String notifyRole = "";
+        //业务逻辑对应的条件表达式
+        User user = null;
+        List<Activity> activitieList = activityService.getByProcessInstanceId(projectFollowReport.getArchiveProcessInstanceId());
+        WorkActivityMenu workActivityMenu = new WorkActivityMenu();
+        if (activitieList != null && activitieList.size() != 0) {
+            workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
+            workActivityMenu.setActivities(activitieList);
+        }
+
+        WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+        WorkActivityProcess selectProcess = new WorkActivityProcess();
+        selectProcess.setProcessInstanceId(projectFollowReport.getArchiveProcessInstanceId());
+        List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
+        List<Activity> activities = workActivityMenu.getActivities();
+        String  taskCount = "1";
+        String enname = "";
+        Office office = projectFollowReport.getProject().getOffice();
+        office = officeService.get(office.getId());
+        projectFollowReport.getProject().setOffice(office);
+        String notifyStr = "项目编号:"+projectFollowReport.getProjectFollowId()+",项目名称:"+ projectFollowReport.getProjectFollowName();
+        String str = notifyStr+",创建人:"+projectFollowReport.getCreateBy().getName()+",所属部门:"+projectFollowReport.getProject().getOffice().getName();
+        String titleStr = "项目名称:"+ projectFollowReport.getProjectFollowName();
+        int key = 0;
+        if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("projectFollow")) {
+            key = 1;
+            for (int i = 0; i < workActivityProcesses.size(); i++) {
+                WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+                if (taskDefKey.equals("modifyApply")) {
+                    taskCount = "0";
+                    workActivityProcess.setId("");
+                    workActivityProcess.setCount(0);
+                    if (!"yes".equals(projectFollowReport.getAct().getFlag())) {
+                        projectFollowReport.setOverAllArchiveStatus(String.valueOf(ProjectStatusEnum.RECALL.getValue()));
+                        workActivityProcess.setIsApproval("2");
+                        vars.put("pass", false);
+                    } else {
+                        vars.put("pass", true);
+                        workActivityProcess.setIsApproval("1");
+                    }
+                    break;
+                } else {
+                    taskCount = activityProcess.getCount()+"";
+                    workActivityProcess = activityProcess;
+                    if (!workActivityProcess.getIsApproval().equals("0")) {
+                        workActivityProcess.setId("");
+                    }
+                    for (Activity activity : activities) {
+                        if (activity.getCount() == activityProcess.getCount()) {
+                            notifyRole = activity.getName();
+                            break;
+                        }
+                    }
+                    if (!"yes".equals(projectFollowReport.getAct().getFlag())) {
+                        notifyRole = "调整项目";
+                        projectFollowReport.setOverAllArchiveStatus(String.valueOf(ProjectStatusEnum.REJECTED.getValue()));
+                        workActivityProcess.setIsApproval("2");
+                        String returnBack = "-1";
+                        for (Activity activity : activities) {
+                            if (activity.getCount() == activityProcess.getCount()) {
+                                returnBack = activity.getReturnBack();
+                                break;
+                            }
+                        }
+                        if (returnBack.equals("0")) {
+                            workActivityProcess.setId("");
+                        }
+                        vars.put("pass", false);
+                    } else {
+                        workActivityProcess.setIsApproval("1");
+                        vars.put("pass", true);
+                    }
+                    break;
+                }
+            }
+        }else {
+            workActivityMenu.setProcessType("projectFollow");
+            for (int i = 0; i < workActivityProcesses.size(); i++) {
+                WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+                String count = String.valueOf(activityProcess.getCount());
+                workActivityProcess = activityProcess;
+                if (!workActivityProcess.getIsApproval().equals("0")) {
+                    workActivityProcess.setId("");
+                }
+                // 审核环节
+                if ("bmzr".equals(taskDefKey) && "1".equals(count)) {
+                    taskCount = count;
+                    if ("yes".equals(projectFollowReport.getAct().getFlag())) {
+                        workActivityProcess.setIsApproval("1");
+                        vars.put("pass", true);
+                        vars.put("passs", true);
+                        notifyRole = "审批通过";
+                    } else {
+                        workActivityProcess.setIsApproval("2");
+                        vars.put("pass", false);
+                        vars.put("passs",false);
+                        user = createUser;
+                        notifyRole = "调整项目";
+                    }
+                    break;
+                } else if ("modifyApply".equals(taskDefKey) && "0".equals(count)) {
+                    notifyRole = "总审室审批";
+                    taskCount = "0";
+                    enname = "bmzr";
+                    workActivityProcess.setCount(0);
+                    if("yes".equals(projectFollowReport.getAct().getFlag())){
+                        workActivityProcess.setIsApproval("1");
+                        projectFollowReport.setOverAllArchiveStatus(String.valueOf(ProjectStatusEnum.IN_APRL.getValue()));
+                        vars.put("pass",true);
+                        vars.put("passs",true);
+                    }else{
+                        workActivityProcess.setIsApproval("2");
+                        projectFollowReport.setOverAllArchiveStatus(String.valueOf(ProjectStatusEnum.RECALL.getValue()));
+                        vars.put("pass",false);
+                        vars.put("passs",false);
+                    }
+                    break;
+                }
+            }
+        }
+        workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,projectFollowReport.getArchiveProcessInstanceId(),taskDefKey,"modifyApply",projectFollowReport.getAct().getFlag(),comment, activities);
+        // 设置意见
+        projectFollowReport.getAct().setComment(comment);
+        projectFollowReport.preUpdate();
+        // 提交流程任务
+        //actTaskService.complete(projectFollowReport.getAct().getTaskId(), projectFollowReport.getAct().getProcInsId(), projectFollowReport.getAct().getComment(), vars);
+        //判断是否是审核通过
+        if("yes".equals(projectFollowReport.getAct().getFlag())){
+            actTaskService.complete(projectFollowReport.getAct().getTaskId(), projectFollowReport.getAct().getProcInsId(), projectFollowReport.getAct().getComment(), vars);
+        }else{
+            //不通过需要查询审核组角色id
+            List<Act> list2 = actTaskService.toMyStartedList(projectFollowReport.getArchiveProcessInstanceId());
+            // 提交流程任务
+            //如果是驳回,并且审核角色为多个,需要对每个角色的审核流都进行处理
+            for (Act actInfo: list2) {
+                actTaskService.complete(actInfo.getTask().getId(), actInfo.getProcInsId(), projectFollowReport.getAct().getComment(), vars);
+            }
+        }
+        boolean state = actTaskService.isProcessEnd(projectFollowReport.getAct().getProcInsId());
+        List<User> users = new ArrayList<>();
+        List<User> userList = new ArrayList<>();
+        if(!state) {
+            users.add(projectFollowReport.getCreateBy());
+            if ("yes".equals(projectFollowReport.getAct().getFlag())) {
+                titleStr = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果审批通过";
+                notifyStr = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果审批通过,跟踪咨询名称:" + projectFollowReport.getProjectFollowName();
+                projectFollowReport.setOverAllArchiveStatus(String.valueOf(ProjectStatusEnum.SIGNED.getValue()));
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectFollowReport.getArchiveId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                users.add(projectFollowReport.getCreateBy());
+                workProjectNotifyService
+                        .save(UtilNotify
+                                .saveNotify(projectFollowReport.getArchiveId(),
+                                        projectFollowReport.getCreateBy(),
+                                        UserUtils.getSelectCompany().getId(),
+                                        titleStr,
+                                        notifyStr,
+                                        "142",
+                                        "0",
+                                        "待通知",
+                                        notifyRole));
+            } else {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectFollowReport.getArchiveId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                users.add(projectFollowReport.getCreateBy());
+                if (!projectFollowReport.getOverAllReportStatus().equals(ProjectStatusEnum.RECALL.getValue())){
+                    projectFollowReport.setOverAllArchiveStatus(String.valueOf(ProjectStatusEnum.REJECTED.getValue()));
+					/*workProjectNotifyService
+							.save(UtilNotify
+									.saveNotify(projectRecords.getId(),
+											projectRecords.getCreateBy(),
+											projectRecords.getCompany().getId(),
+											titleStr,
+											notifyStr,
+											"39",
+											"0",
+											"待通知",
+											notifyRole));*/
+                }
+            }
+            workActivityProcessService.deleteProcessIdAuditUsers(projectFollowReport.getArchiveProcessInstanceId());
+
+        }else{
+            if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("projectFollow")) {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectFollowReport.getArchiveId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                WorkProjectNotify workProjectNotify = UtilNotify
+                        .saveNotify(projectFollowReport.getArchiveId(),
+                                new User(),
+                                projectFollowReport.getProject().getCompany().getId(),
+                                titleStr,
+                                str,
+                                "142",
+                                "0",
+                                "待审批",
+                                notifyRole);
+                String count = taskDefKey.replace("audit","").replace("task","");
+                List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
+                        activities,
+                        workProjectNotify,
+                        taskDefKey,
+                        projectFollowReport.getAct().getFlag(),
+                        count,
+                        projectFollowReport.getCreateBy(),
+                        projectFollowReport.getProject().getOffice().getId(),
+                        "4");
+                for (WorkProjectNotify workProjectNotify1:workProjectNotifys){
+                    users.add(workProjectNotify1.getUser());
+                    workProjectNotify1.setId("");
+                    workProjectNotify1.setIsNewRecord(false);
+                    workProjectNotifyService.save(workProjectNotify1);
+                }
+            }else {
+                if (!"yes".equals(projectFollowReport.getAct().getFlag())) {//驳回待办
+                    titleStr = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果被驳回";
+                    str = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果被驳回,请选择重新申请或作废";
+                    WorkProjectNotify notify = new WorkProjectNotify();
+                    notify.setNotifyId(projectFollowReport.getArchiveId());
+                    userList = workProjectNotifyService.readByNotifyId(notify);
+                    users.add(user);
+                    WorkProjectNotify workProjectNotify = UtilNotify
+                            .saveNotify(projectFollowReport.getArchiveId(),
+                                    user,
+                                    projectFollowReport.getProject().getCompany().getId(),
+                                    titleStr,
+                                    str,
+                                    "142",
+                                    "0",
+                                    "重新申请",
+                                    notifyRole);
+                    workProjectNotifyService.save(workProjectNotify);
+                } else {
+                    if (org.apache.commons.lang3.StringUtils.isNotBlank(enname)) {//驳回重新申请待办
+                        titleStr = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果重新申请,待审批";
+                        str = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果重新申请,待审批,跟踪咨询名称:" + projectFollowReport.getProjectFollowName();
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(projectFollowReport.getArchiveId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        WorkProjectNotify workProjectNotify = UtilNotify
+                                .saveNotify(projectFollowReport.getArchiveId(),
+                                        new User(),
+                                        projectFollowReport.getProject().getCompany().getId(),
+                                        titleStr,
+                                        str,
+                                        "142",
+                                        "0",
+                                        "待审批",
+                                        notifyRole);
+                        for (User user1:auditUsers){
+                            users.add(user1);
+                            workProjectNotify.setUser(user1);
+                            workProjectNotify.setId("");
+                            workProjectNotify.setIsNewRecord(false);
+                            workProjectNotifyService.save(workProjectNotify);
+                            Map<String,Object> extras = new HashMap<>();
+                            extras.put("type","7003");
+                            extras.put("procDefKey","142");
+                            extras.put("id",workProjectNotify.getId());
+                            UserUtils.pushInfoToApp(titleStr,str,extras,user1.getId());
+                        }
+                    }else {
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(projectFollowReport.getArchiveId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        users.add(projectFollowReport.getCreateBy());
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(projectFollowReport.getArchiveId(),
+                                                projectFollowReport.getCreateBy(),
+                                                projectFollowReport.getProject().getCompany().getId(),
+                                                titleStr,
+                                                str,
+                                                "142",
+                                                "0",
+                                                "重新申请",
+                                                notifyRole));
+                    }
+                }
+            }
+        }
+
+        if (users!=null && users.size()!=0) {
+            List<String> userIds = new ArrayList<>(users.size());
+            for (User u : users) {
+                userIds.add(u.getId());
+            }
+            UserUtils.pushIm(userIds,titleStr);
+        }
+        if (userList!=null && userList.size()!=0) {
+            for (User u : userList) {
+                UserUtils.pushMeIm(u.getId());
+            }
+        }
+        projectFollowReportDao.updateArchive(projectFollowReport);
+        return "保存审核意见成功!";
+    }
+
+
+    /**
+     * 删除操作
+     * @param projectFollowReport
+     */
+    @Transactional(readOnly = false)
+    public void deleteFollow(ProjectFollowReport projectFollowReport) {
+        projectFollowReportDao.deleteArchive(projectFollowReport);
+    }
+
+    /**
+     * 撤回操作
+     * @param projectFollowReport
+     * @throws Exception
+     */
+    @Transactional(readOnly = false)
+    public void cancelProcess(ProjectFollowReport projectFollowReport) throws Exception {
+        //创建工作流审批信息
+        WorkActivityProcess process = new WorkActivityProcess();
+        process.setProcessInstanceId(projectFollowReport.getArchiveProcessInstanceId());
+        process.setIsApproval("0");
+        WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+        workActivityProcess.setProcessInstanceId(projectFollowReport.getArchiveProcessInstanceId());
+        //获取工作流审批信息集合
+        List<WorkActivityProcess> processList = workActivityProcessService.findList(workActivityProcess);
+        WorkProjectNotify notify = new WorkProjectNotify();
+        notify.setNotifyId(projectFollowReport.getArchiveId());
+        List<User> userList = workProjectNotifyService.readByNotifyId(notify);
+        if (userList!=null && userList.size()!=0) {
+            for (User u : userList) {
+                User user = UserUtils.get(u.getId());
+                UserUtils.pushIm(u.getId(),"申请人 "+user.getName() +",跟踪咨询报告审批:"+projectFollowReport.getProjectFollowName() +" 强制撤销!");
+            }
+        }
+        if(processList!=null && processList.size()>0) {
+            for (int i = 0; i < processList.size(); i++) {
+                WorkActivityProcess p = processList.get(i);
+                if (org.apache.commons.lang3.StringUtils.isNotBlank(p.getIsApproval()) && "0".equals(p.getIsApproval())) {
+                    p.setIsApproval("-1");
+                    p.setDelFlag("1");
+                    workActivityProcessDao.updateDelFlagAndIsApproval(p);
+                }
+            }
+            WorkActivityProcess pro = new WorkActivityProcess();
+            pro.setId("");
+            pro.setDelFlag("0");
+            pro.preInsert();
+            pro.setRemarks("[强制撤销]");
+            pro.setProcessKey(processList.get(0).getProcessKey());
+            pro.setIsApproval("1");
+            pro.setProcessInstanceId(processList.get(0).getProcessInstanceId());
+            pro.setCount(0);
+            workActivityProcessDao.insert(pro);
+
+            //结束该流程,设为"撤销"状态月
+            ProjectRecords records = new ProjectRecords();
+            records.setId(projectFollowReport.getProjectId());
+            projectFollowReport.setOverAllArchiveStatus(String.valueOf(ProjectStatusEnum.RECALL.getValue()));
+            projectFollowReport.setProject(records);
+            projectFollowReport.preUpdate();
+            projectFollowReportDao.updateArchive(projectFollowReport);
+            actTaskService.endProcessInstance(projectFollowReport.getArchiveProcessInstanceId(), "跟踪咨询报告归档-撤回");
+        }
+    }
+}

+ 708 - 0
src/main/java/com/jeeplus/modules/projectConstruction/service/FollowService.java

@@ -0,0 +1,708 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.projectConstruction.service;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.act.entity.Act;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.projectConstruction.dao.ContractDao;
+import com.jeeplus.modules.projectConstruction.entity.ConstructionContract;
+import com.jeeplus.modules.projectType.dao.ProjectTypeDao;
+import com.jeeplus.modules.projectcontentinfo.dao.ProjectBasedDataDao;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectBasedData;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectContentData;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectContentDataService;
+import com.jeeplus.modules.projectrecord.dao.ProjectFollowReportDao;
+import com.jeeplus.modules.projectrecord.dao.WorkProjectUserDao;
+import com.jeeplus.modules.projectrecord.dao.monthly.MonthlyConsultationReportDao;
+import com.jeeplus.modules.projectrecord.entity.ProjectFollowReport;
+import com.jeeplus.modules.projectrecord.entity.ProjectFollowReportInfo;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
+import com.jeeplus.modules.projectreportnum.dao.ProjectReportNumDao;
+import com.jeeplus.modules.projectreportnum.entity.ReportNum;
+import com.jeeplus.modules.sys.dao.WorkattachmentDao;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.service.OfficeService;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workactivity.dao.WorkActivityProcessDao;
+import com.jeeplus.modules.workactivity.entity.Activity;
+import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
+import com.jeeplus.modules.workactivity.service.ActivityService;
+import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
+import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
+import com.jeeplus.modules.workactivitymenu.service.WorkActivityMenuService;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
+import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
+import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
+import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
+import org.activiti.engine.HistoryService;
+import org.activiti.engine.IdentityService;
+import org.activiti.engine.RuntimeService;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 全过程跟踪咨询管理Service
+ * @author 徐滕
+ * @version 2021-10-05 13:47
+ */
+@Service
+@Transactional(readOnly = true)
+public class FollowService extends CrudService<ContractDao,ConstructionContract> {
+    @Autowired
+    private ContractDao contractDao;
+    @Autowired
+    private WorkContractInfoService contractInfoService;
+    @Autowired
+    private ProjectTypeDao projectTypeDao;
+    @Autowired
+    private WorkProjectUserDao workProjectUserDao;
+    @Autowired
+    private ProjectFollowReportDao projectFollowReportDao;
+    @Autowired
+    private ProjectReportNumDao projectReportNumDao;
+    @Autowired
+    private ProjectContentDataService projectContentDataService;
+    @Autowired
+    private MonthlyConsultationReportDao monthlyConsultationReportDao;
+    @Autowired
+    private WorkattachmentDao workattachmentDao;
+    @Autowired
+    private ProjectBasedDataDao projectBasedDataDao;
+    @Autowired
+    private IdentityService identityService;
+    @Autowired
+    private OfficeService officeService;
+    @Autowired
+    private WorkActivityMenuService workActivityMenuService;
+    @Autowired
+    private RuntimeService runtimeService;
+    @Autowired
+    private WorkActivityProcessService workActivityProcessService;
+    @Autowired
+    private WorkProjectNotifyService workProjectNotifyService;
+    @Autowired
+    protected HistoryService historyService;
+    @Autowired
+    private ActTaskService actTaskService;
+    @Autowired
+    private ActivityService activityService;
+    @Autowired
+    private WorkActivityProcessDao workActivityProcessDao;
+    @Autowired
+    private WorkattachmentService workattachmentService;
+
+    /**
+     * 通过id获取跟踪咨询报告的基础信息
+     */
+    public ProjectFollowReport getReportFollowById(String id) {
+        return projectFollowReportDao.getReportFollowById(id);
+    }
+    /**
+     * 暂存跟踪咨询报告信息
+     * @param projectFollowReport
+     * @throws Exception
+     */
+    @Transactional(readOnly = false)
+    public void storFollow(ProjectFollowReport projectFollowReport) {
+        ///根据followId查询该项目的质量复核老数据
+        ProjectFollowReportInfo followReportInfo = contractDao.getProjectFollowReportInfo(projectFollowReport.getId());
+        ProjectFollowReportInfo projectFollowReportInfo =  new ProjectFollowReportInfo();
+        projectFollowReportInfo.setReportStatus(ProjectStatusEnum.TSTORE.getValue());
+        projectFollowReportInfo.setFollowId(projectFollowReport.getId());
+        projectFollowReportInfo.setProject(projectFollowReport.getProject());
+        projectFollowReportInfo.setBzshbUserId(projectFollowReport.getBzshbUserId());
+        projectFollowReportInfo.setProjectFollowName(projectFollowReport.getProjectFollowName());
+        if(null != followReportInfo && StringUtils.isNotBlank(followReportInfo.getId())){
+            projectFollowReportInfo.preUpdate();
+            projectFollowReportInfo.setId(followReportInfo.getId());
+            contractDao.updateReportInfo(projectFollowReportInfo);
+        }else{
+            projectFollowReportInfo.preInsert();
+            contractDao.insertReportInfo(projectFollowReportInfo);
+        }
+
+    }
+
+    /**
+     * 新增跟踪咨询报告信息
+     * @param projectFollowReport
+     * @throws Exception
+     */
+    @Transactional(readOnly = false)
+    public void insertFollow(ProjectFollowReport projectFollowReport) throws Exception {
+        ///根据followId查询该项目的质量复核老数据
+        ProjectFollowReportInfo followReportInfo = contractDao.getProjectFollowReportInfo(projectFollowReport.getId());
+
+        ProjectFollowReportInfo projectFollowReportInfo =  new ProjectFollowReportInfo();
+        projectFollowReportInfo.setReportStatus(ProjectStatusEnum.IN_APRL.getValue());
+        projectFollowReportInfo.setFollowId(projectFollowReport.getId());
+        projectFollowReportInfo.setProject(projectFollowReport.getProject());
+        projectFollowReportInfo.setBzshbUserId(projectFollowReport.getBzshbUserId());
+        projectFollowReportInfo.setProjectFollowName(projectFollowReport.getProjectFollowName());
+        projectFollowReportInfo.preInsert();
+        //获取原有的审核数据
+        Integer oldStatus = null;
+        if(null != followReportInfo && StringUtils.isNotBlank(followReportInfo.getId())){
+            followReportInfo.getReportStatus();
+            projectFollowReportInfo.preUpdate();
+            projectFollowReportInfo.setId(followReportInfo.getId());
+            contractDao.updateReportInfo(projectFollowReportInfo);
+        }else{
+            projectFollowReportInfo.preInsert();
+            contractDao.insertReportInfo(projectFollowReportInfo);
+        }
+        //启动审批流程
+        if (projectFollowReportInfo.getReportStatus()== ProjectStatusEnum.IN_APRL.getValue() &&(oldStatus==null||ProjectStatusEnum.REJECTED.getValue()!=oldStatus)) {
+            this.startAudit(projectFollowReportInfo,projectFollowReportInfo.getProcessInstanceId());
+        }
+
+    }
+
+    /**
+     * 启动审批流程
+     *
+     * @param projectFollowReport
+     */
+    private void startAudit(ProjectFollowReportInfo projectFollowReport, String processInstanceId) throws Exception {
+        try{
+            Map<String, Object> variables = new HashMap<String, Object>();
+            identityService.setAuthenticatedUserId(projectFollowReport.getCurrentUser().getId());
+            Office office = projectFollowReport.getProject().getOffice();
+            office = officeService.get(office.getId());
+            projectFollowReport.getProject().setOffice(office);
+
+            String titleStr = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果质量复核待审批";
+            String contentStr = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果质量复核审批通过,跟踪咨询名称:" + projectFollowReport.getProjectFollowName();
+
+            String businessKey = projectFollowReport.getId();
+
+            WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("7854872f45b84acd893010e66a3db2c8", office);
+            // 启动流程
+            String processType = workActivityMenu.getProcessType();
+            StringBuffer buffer = new StringBuffer();
+            Activity activity = new Activity();
+            WorkProjectNotify workProjectNotify = UtilNotify
+                    .saveNotify(projectFollowReport.getId(),
+                            null,
+                            UserUtils.getSelectCompany().getId(),
+                            titleStr,
+                            contentStr,
+                            "141",
+                            "0",
+                            "待审批",
+                            ""
+                    );
+
+            //获取初始审核人员list信息
+            List<User> users = new ArrayList<>();
+            //List<User> bmzrs = UserUtils.getByRoleActivityEnname("bzshb",3,office.getId(),"4",projectFollowReport.getCreateBy());
+            List<User> bmzrs = Lists.newArrayList();
+            //总工
+            User bzshbsUser = UserUtils.get(projectFollowReport.getBzshbUserId());
+            if(null != bzshbsUser){
+                bmzrs.add(bzshbsUser);
+            }
+            if (StringUtils.isNotBlank(workActivityMenu.getId())) {
+                processType = workActivityMenu.getProcessType();
+                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 && StringUtils.isNotBlank(a.getRole().getEnname())){
+                        List enusers = UserUtils.getByRoleActivityEnnames(a.getRole().getEnname(),office.getId(),"8",projectFollowReport.getCreateBy());
+                        if (enusers.size()==0){
+                            throw new Exception("流程审批人不能为空,角色"+a.getRole().getName()+"下无用户,请联系管理员!");
+                        }
+                        variables.put(enlist, enusers);
+                        variables.put(encount, enusers.size());
+                    }
+                    if (a.getDelFlag().equals("0") && a.getCount() == 1) {
+                        activity = a;
+                    }
+                }
+                buffer.append(activity.getRole().getEnname());
+                if (activity != null && StringUtils.isNotBlank(activity.getId())) {
+                    //角色审批
+                    if (StringUtils.isNotBlank(activity.getRole().getEnname())) {
+                        users = UserUtils.getByRoleActivityEnnames(activity.getRole().getEnname(),office.getId(),"4",projectFollowReport.getCreateBy());
+                    }
+                    //人员审批
+                    if (StringUtils.isNotBlank(activity.getUser().getId())) {
+                        users.add(activity.getUser());
+                    }
+                }
+                workProjectNotify.setId("");
+            } else {
+                if (bmzrs==null||bmzrs.size()==0){
+                    throw new Exception("流程审批人不能为空,角色部门负责人下无用户,请联系管理员!");
+                }
+                processType = "projectFollow";
+                variables.put("applyUserId", projectFollowReport.getCreateBy().getId());
+                variables.put("bmzrCount",bmzrs.size());
+                variables.put("bmzrList",bmzrs);
+                users.addAll(bmzrs);
+            }
+            List<String> userIds = new ArrayList<>(users.size());
+            for (User u : users){
+                userIds.add(u.getId());
+                workProjectNotify.setUser(u);
+                workProjectNotify.setId("");
+                workProjectNotify.setNotifyRole("总审室审批");
+                workProjectNotifyService.save(workProjectNotify);
+                Map<String,Object> extras = new HashMap<>();
+                extras.put("type","7003");
+                extras.put("procDefKey","141");
+                extras.put("id",workProjectNotify.getId());
+                UserUtils.pushInfoToApp(titleStr,contentStr,extras,u.getId());
+            }
+
+            long t1 = System.currentTimeMillis();
+            UserUtils.pushIm(userIds,contentStr);
+            logger.info("推送消息耗时:{}ms",System.currentTimeMillis()-t1);
+            variables.put("busId", businessKey);
+            variables.put("type", processType);
+            variables.put("title", "审批单:" + projectFollowReport.getProjectFollowName());//设置标题;
+
+            ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
+            if (StringUtils.isNotBlank(processInstanceId)) {
+                workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
+                workActivityProcessService.deleteProcessInstanceId(processInstanceId);
+                workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
+            }
+            //通知添加流程实例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");
+                workActivityProcessService.save(workActivityProcess);
+                workActivityProcessService.insertAuditsByType(bmzrs,processInstance.getId(),1,1);
+            }
+            projectFollowReport.setProcessInstanceId(processInstance.getId());
+            projectFollowReport.setReportStatus(ProjectStatusEnum.IN_APRL.getValue());
+            projectFollowReportDao.updateReportProcessIdAndStatus(projectFollowReport);
+        }catch (Exception e){
+            logger.error("启动审批流程异常:",e);
+            throw e;
+        }
+    }
+
+    @Transactional(readOnly = false)
+    public String auditSave(ProjectFollowReport projectFollowReport,List<User> auditUsers) throws Exception {
+
+        String projectStatus = projectFollowReport.getOverAllReportStatus();
+        String taskDefKey = projectFollowReport.getAct().getTaskDefKey();
+        if (!"modifyApply".equals(taskDefKey) && !taskDefKey.contains("audit") ) {
+            actTaskService.claim(projectFollowReport.getAct().getTaskId(), UserUtils.getUser().getId());
+            List<User> leaders = projectFollowReport.getProjectLeaders();
+        }else {
+            projectFollowReport.getAct().setFlag("yes");
+            //updateFollow(projectFollowReport);
+        }
+
+        String comment = "";
+        if ( projectStatus.equals(ProjectStatusEnum.REJECTED.getValue())) {
+            comment = ("yes".equals(projectFollowReport.getAct().getFlag())?"[重新申请] ":"[已撤销] ");
+        }else {
+            comment = ("yes".equals(projectFollowReport.getAct().getFlag())?"[同意] ":"[驳回] ")+projectFollowReport.getAct().getComment();
+        }
+
+        if (!"yes".equals(projectFollowReport.getAct().getFlag())) {
+            projectFollowReport.setOverAllReportStatus(String.valueOf(ProjectStatusEnum.REJECTED.getValue()));
+        }
+
+        User createUser = UserUtils.get(projectFollowReport.getCreateBy().getId());
+
+        Map<String, Object> vars = Maps.newHashMap();
+        String notifyRole = "";
+        //业务逻辑对应的条件表达式
+        User user = null;
+        List<Activity> activitieList = activityService.getByProcessInstanceId(projectFollowReport.getReportProcessInstanceId());
+        WorkActivityMenu workActivityMenu = new WorkActivityMenu();
+        if (activitieList != null && activitieList.size() != 0) {
+            workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
+            workActivityMenu.setActivities(activitieList);
+        }
+
+        WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+        WorkActivityProcess selectProcess = new WorkActivityProcess();
+        selectProcess.setProcessInstanceId(projectFollowReport.getReportProcessInstanceId());
+        List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
+        List<Activity> activities = workActivityMenu.getActivities();
+        String  taskCount = "1";
+        String enname = "";
+        Office office = projectFollowReport.getProject().getOffice();
+        office = officeService.get(office.getId());
+        projectFollowReport.getProject().setOffice(office);
+        String notifyStr = "项目编号:"+projectFollowReport.getProjectFollowId()+",项目名称:"+ projectFollowReport.getProjectFollowName();
+        String str = notifyStr+",创建人:"+projectFollowReport.getCreateBy().getName()+",所属部门:"+projectFollowReport.getProject().getOffice().getName();
+        String titleStr = "项目名称:"+ projectFollowReport.getProjectFollowName();
+        int key = 0;
+        if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("projectFollow")) {
+            key = 1;
+            for (int i = 0; i < workActivityProcesses.size(); i++) {
+                WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+                if (taskDefKey.equals("modifyApply")) {
+                    taskCount = "0";
+                    workActivityProcess.setId("");
+                    workActivityProcess.setCount(0);
+                    if (!"yes".equals(projectFollowReport.getAct().getFlag())) {
+                        projectFollowReport.setOverAllReportStatus(String.valueOf(ProjectStatusEnum.RECALL.getValue()));
+                        workActivityProcess.setIsApproval("2");
+                        vars.put("pass", false);
+                    } else {
+                        vars.put("pass", true);
+                        workActivityProcess.setIsApproval("1");
+                    }
+                    break;
+                } else {
+                    taskCount = activityProcess.getCount()+"";
+                    workActivityProcess = activityProcess;
+                    if (!workActivityProcess.getIsApproval().equals("0")) {
+                        workActivityProcess.setId("");
+                    }
+                    for (Activity activity : activities) {
+                        if (activity.getCount() == activityProcess.getCount()) {
+                            notifyRole = activity.getName();
+                            break;
+                        }
+                    }
+                    if (!"yes".equals(projectFollowReport.getAct().getFlag())) {
+                        notifyRole = "调整项目";
+                        projectFollowReport.setOverAllReportStatus(String.valueOf(ProjectStatusEnum.REJECTED.getValue()));
+                        workActivityProcess.setIsApproval("2");
+                        String returnBack = "-1";
+                        for (Activity activity : activities) {
+                            if (activity.getCount() == activityProcess.getCount()) {
+                                returnBack = activity.getReturnBack();
+                                break;
+                            }
+                        }
+                        if (returnBack.equals("0")) {
+                            workActivityProcess.setId("");
+                        }
+                        vars.put("pass", false);
+                    } else {
+                        workActivityProcess.setIsApproval("1");
+                        vars.put("pass", true);
+                    }
+                    break;
+                }
+            }
+        }else {
+            workActivityMenu.setProcessType("projectFollow");
+            for (int i = 0; i < workActivityProcesses.size(); i++) {
+                WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+                String count = String.valueOf(activityProcess.getCount());
+                workActivityProcess = activityProcess;
+                if (!workActivityProcess.getIsApproval().equals("0")) {
+                    workActivityProcess.setId("");
+                }
+                // 审核环节
+                if ("bmzr".equals(taskDefKey) && "1".equals(count)) {
+                    taskCount = count;
+                    if ("yes".equals(projectFollowReport.getAct().getFlag())) {
+                        workActivityProcess.setIsApproval("1");
+                        vars.put("pass", true);
+                        vars.put("passs", true);
+                        notifyRole = "审批通过";
+                    } else {
+                        workActivityProcess.setIsApproval("2");
+                        vars.put("pass", false);
+                        vars.put("passs",false);
+                        user = createUser;
+                        notifyRole = "调整项目";
+                    }
+                    break;
+                } else if ("modifyApply".equals(taskDefKey) && "0".equals(count)) {
+                    notifyRole = "总审室审批";
+                    taskCount = "0";
+                    enname = "bmzr";
+                    workActivityProcess.setCount(0);
+                    if("yes".equals(projectFollowReport.getAct().getFlag())){
+                        workActivityProcess.setIsApproval("1");
+                        projectFollowReport.setOverAllReportStatus(String.valueOf(ProjectStatusEnum.IN_APRL.getValue()));
+                        vars.put("pass",true);
+                        vars.put("passs",true);
+                    }else{
+                        workActivityProcess.setIsApproval("2");
+                        projectFollowReport.setOverAllReportStatus(String.valueOf(ProjectStatusEnum.RECALL.getValue()));
+                        vars.put("pass",false);
+                        vars.put("passs",false);
+                    }
+                    break;
+                }
+            }
+        }
+        workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,projectFollowReport.getReportProcessInstanceId(),taskDefKey,"modifyApply",projectFollowReport.getAct().getFlag(),comment, activities);
+        // 设置意见
+        projectFollowReport.getAct().setComment(comment);
+        projectFollowReport.preUpdate();
+        // 提交流程任务
+        //actTaskService.complete(projectFollowReport.getAct().getTaskId(), projectFollowReport.getAct().getProcInsId(), projectFollowReport.getAct().getComment(), vars);
+        //判断是否是审核通过
+        if("yes".equals(projectFollowReport.getAct().getFlag())){
+            actTaskService.complete(projectFollowReport.getAct().getTaskId(), projectFollowReport.getAct().getProcInsId(), projectFollowReport.getAct().getComment(), vars);
+        }else{
+            //不通过需要查询审核组角色id
+            List<Act> list2 = actTaskService.toMyStartedList(projectFollowReport.getReportProcessInstanceId());
+            // 提交流程任务
+            //如果是驳回,并且审核角色为多个,需要对每个角色的审核流都进行处理
+            for (Act actInfo: list2) {
+                actTaskService.complete(actInfo.getTask().getId(), actInfo.getProcInsId(), projectFollowReport.getAct().getComment(), vars);
+            }
+        }
+        boolean state = actTaskService.isProcessEnd(projectFollowReport.getAct().getProcInsId());
+        List<User> users = new ArrayList<>();
+        List<User> userList = new ArrayList<>();
+        if(!state) {
+            users.add(projectFollowReport.getCreateBy());
+            if ("yes".equals(projectFollowReport.getAct().getFlag())) {
+                titleStr = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果审批通过";
+                notifyStr = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果审批通过,跟踪咨询名称:" + projectFollowReport.getProjectFollowName();
+                projectFollowReport.setOverAllReportStatus(String.valueOf(ProjectStatusEnum.SIGNED.getValue()));
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectFollowReport.getReportId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                users.add(projectFollowReport.getCreateBy());
+                workProjectNotifyService
+                        .save(UtilNotify
+                                .saveNotify(projectFollowReport.getReportId(),
+                                        projectFollowReport.getCreateBy(),
+                                        UserUtils.getSelectCompany().getId(),
+                                        titleStr,
+                                        notifyStr,
+                                        "141",
+                                        "0",
+                                        "待通知",
+                                        notifyRole));
+            } else {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectFollowReport.getReportId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                users.add(projectFollowReport.getCreateBy());
+                if (!projectFollowReport.getOverAllReportStatus().equals(ProjectStatusEnum.RECALL.getValue())){
+                    projectFollowReport.setOverAllReportStatus(String.valueOf(ProjectStatusEnum.REJECTED.getValue()));
+					/*workProjectNotifyService
+							.save(UtilNotify
+									.saveNotify(projectRecords.getId(),
+											projectRecords.getCreateBy(),
+											projectRecords.getCompany().getId(),
+											titleStr,
+											notifyStr,
+											"39",
+											"0",
+											"待通知",
+											notifyRole));*/
+                }
+            }
+            workActivityProcessService.deleteProcessIdAuditUsers(projectFollowReport.getReportProcessInstanceId());
+
+        }else{
+            if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("projectFollow")) {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectFollowReport.getReportId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                WorkProjectNotify workProjectNotify = UtilNotify
+                        .saveNotify(projectFollowReport.getReportId(),
+                                new User(),
+                                projectFollowReport.getProject().getCompany().getId(),
+                                titleStr,
+                                str,
+                                "141",
+                                "0",
+                                "待审批",
+                                notifyRole);
+                String count = taskDefKey.replace("audit","").replace("task","");
+                List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
+                        activities,
+                        workProjectNotify,
+                        taskDefKey,
+                        projectFollowReport.getAct().getFlag(),
+                        count,
+                        projectFollowReport.getCreateBy(),
+                        projectFollowReport.getProject().getOffice().getId(),
+                        "4");
+                for (WorkProjectNotify workProjectNotify1:workProjectNotifys){
+                    users.add(workProjectNotify1.getUser());
+                    workProjectNotify1.setId("");
+                    workProjectNotify1.setIsNewRecord(false);
+                    workProjectNotifyService.save(workProjectNotify1);
+                }
+            }else {
+                if (!"yes".equals(projectFollowReport.getAct().getFlag())) {//驳回待办
+                    titleStr = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果被驳回";
+                    str = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果被驳回,请选择重新申请或作废";
+                    WorkProjectNotify notify = new WorkProjectNotify();
+                    notify.setNotifyId(projectFollowReport.getReportId());
+                    userList = workProjectNotifyService.readByNotifyId(notify);
+                    users.add(user);
+                    WorkProjectNotify workProjectNotify = UtilNotify
+                            .saveNotify(projectFollowReport.getReportId(),
+                                    user,
+                                    projectFollowReport.getProject().getCompany().getId(),
+                                    titleStr,
+                                    str,
+                                    "141",
+                                    "0",
+                                    "重新申请",
+                                    notifyRole);
+                    workProjectNotifyService.save(workProjectNotify);
+                } else {
+                    if (org.apache.commons.lang3.StringUtils.isNotBlank(enname)) {//驳回重新申请待办
+                        titleStr = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果重新申请,待审批";
+                        str = "全过程项目【"+ projectFollowReport.getProject().getProjectName()+"】咨询成果重新申请,待审批,跟踪咨询名称:" + projectFollowReport.getProjectFollowName();
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(projectFollowReport.getReportId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        WorkProjectNotify workProjectNotify = UtilNotify
+                                .saveNotify(projectFollowReport.getReportId(),
+                                        new User(),
+                                        projectFollowReport.getProject().getCompany().getId(),
+                                        titleStr,
+                                        str,
+                                        "141",
+                                        "0",
+                                        "待审批",
+                                        notifyRole);
+                        for (User user1:auditUsers){
+                            users.add(user1);
+                            workProjectNotify.setUser(user1);
+                            workProjectNotify.setId("");
+                            workProjectNotify.setIsNewRecord(false);
+                            workProjectNotifyService.save(workProjectNotify);
+                            Map<String,Object> extras = new HashMap<>();
+                            extras.put("type","7003");
+                            extras.put("procDefKey","141");
+                            extras.put("id",workProjectNotify.getId());
+                            UserUtils.pushInfoToApp(titleStr,str,extras,user1.getId());
+                        }
+                    }else {
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(projectFollowReport.getReportId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        users.add(projectFollowReport.getCreateBy());
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(projectFollowReport.getReportId(),
+                                                projectFollowReport.getCreateBy(),
+                                                projectFollowReport.getProject().getCompany().getId(),
+                                                titleStr,
+                                                str,
+                                                "141",
+                                                "0",
+                                                "重新申请",
+                                                notifyRole));
+                    }
+                }
+            }
+        }
+
+        if (users!=null && users.size()!=0) {
+            List<String> userIds = new ArrayList<>(users.size());
+            for (User u : users) {
+                userIds.add(u.getId());
+            }
+            UserUtils.pushIm(userIds,titleStr);
+        }
+        if (userList!=null && userList.size()!=0) {
+            for (User u : userList) {
+                UserUtils.pushMeIm(u.getId());
+            }
+        }
+        projectFollowReportDao.updateReport(projectFollowReport);
+        return "保存审核意见成功!";
+    }
+
+
+    /**
+     * 删除操作
+     * @param projectFollowReport
+     */
+    @Transactional(readOnly = false)
+    public void deleteFollow(ProjectFollowReport projectFollowReport) {
+        projectFollowReportDao.deleteReport(projectFollowReport);
+    }
+
+    /**
+     * 撤回操作
+     * @param projectFollowReport
+     * @throws Exception
+     */
+    @Transactional(readOnly = false)
+    public void cancelProcess(ProjectFollowReport projectFollowReport) throws Exception {
+        //创建工作流审批信息
+        WorkActivityProcess process = new WorkActivityProcess();
+        process.setProcessInstanceId(projectFollowReport.getReportProcessInstanceId());
+        process.setIsApproval("0");
+        WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+        workActivityProcess.setProcessInstanceId(projectFollowReport.getReportProcessInstanceId());
+        //获取工作流审批信息集合
+        List<WorkActivityProcess> processList = workActivityProcessService.findList(workActivityProcess);
+        WorkProjectNotify notify = new WorkProjectNotify();
+        notify.setNotifyId(projectFollowReport.getReportId());
+        List<User> userList = workProjectNotifyService.readByNotifyId(notify);
+        if (userList!=null && userList.size()!=0) {
+            for (User u : userList) {
+                User user = UserUtils.get(u.getId());
+                UserUtils.pushIm(u.getId(),"申请人 "+user.getName() +",跟踪咨询报告审批:"+projectFollowReport.getProjectFollowName() +" 强制撤销!");
+            }
+        }
+        if(processList!=null && processList.size()>0) {
+            for (int i = 0; i < processList.size(); i++) {
+                WorkActivityProcess p = processList.get(i);
+                if (org.apache.commons.lang3.StringUtils.isNotBlank(p.getIsApproval()) && "0".equals(p.getIsApproval())) {
+                    p.setIsApproval("-1");
+                    p.setDelFlag("1");
+                    workActivityProcessDao.updateDelFlagAndIsApproval(p);
+                }
+            }
+            WorkActivityProcess pro = new WorkActivityProcess();
+            pro.setId("");
+            pro.setDelFlag("0");
+            pro.preInsert();
+            pro.setRemarks("[强制撤销]");
+            pro.setProcessKey(processList.get(0).getProcessKey());
+            pro.setIsApproval("1");
+            pro.setProcessInstanceId(processList.get(0).getProcessInstanceId());
+            pro.setCount(0);
+            workActivityProcessDao.insert(pro);
+
+            //结束该流程,设为"撤销"状态月
+            ProjectRecords records = new ProjectRecords();
+            records.setId(projectFollowReport.getProjectId());
+            projectFollowReport.setOverAllReportStatus(String.valueOf(ProjectStatusEnum.RECALL.getValue()));
+            projectFollowReport.setProject(records);
+            projectFollowReport.preUpdate();
+            projectFollowReportDao.updateReport(projectFollowReport);
+            actTaskService.endProcessInstance(projectFollowReport.getReportProcessInstanceId(), "跟踪咨询报告质量复核-撤回");
+        }
+    }
+}

+ 59 - 6
src/main/java/com/jeeplus/modules/projectConstruction/web/ContractController.java

@@ -18,6 +18,7 @@ import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.act.utils.ActUtils;
 import com.jeeplus.modules.project.entity.Project;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
 import com.jeeplus.modules.projectConstruction.entity.ConstructionContract;
 import com.jeeplus.modules.projectConstruction.service.ContractService;
 import com.jeeplus.modules.projectType.entity.ProjectTemplateType;
@@ -107,6 +108,8 @@ public class ContractController extends BaseController {
     private MonthlyConsultationReportDao monthlyConsultationReportDao;
     @Autowired
     private ProjectReportNumDao projectReportNumDao;
+    @Autowired
+    private ProjectBasedDataService projectBasedDataService;
 
     private static byte[] SYN_BYTE = new byte[0];
 
@@ -236,7 +239,11 @@ public class ContractController extends BaseController {
                     treeNew.setPid(records1.getId());//子类父id也就是项目Id
                     treeNew.setProjectId(contract.getCnumber());
                     treeNew.setProjectName(contract.getContractName());
-                    treeNew.setContCate(contract.getContCate());
+                    if(StringUtils.isNotBlank(contract.getContCate())){
+                        treeNew.setContCate(contract.getContCate());
+                    }else{
+                        treeNew.setContCate("");
+                    }
                     treeNew.setTrueAmt(contract.getTrueAmt());
                     treeNew.setProjectLeader(projectLeader);
                     treeNew.setProjectRegistrant(contract.getCreateName());
@@ -499,6 +506,11 @@ public class ContractController extends BaseController {
                         treeNew.setCreateDate(report.getCreateDate());
                         treeNew.setProjectLeader(projectLeader);
                         treeNew.setStatus(report.getStatus().toString());
+                        treeNew.setProjectContentDataNewId(report.getProjectContentDataNewId());
+                        treeNew.setOverAllReportStatus(report.getOverAllReportStatus());
+                        treeNew.setReportProcessInstanceId(report.getReportProcessInstanceId());
+                        treeNew.setOverAllArchiveStatus(report.getOverAllArchiveStatus());
+                        treeNew.setArchiveProcessInstanceId(report.getArchiveProcessInstanceId());
                         treeNew.setProcessInstanceId(report.getProcessInstanceId());
                         User user = UserUtils.get(report.getCreateBy().getId());
                         treeNew.setProjectRegistrant(user.getName());
@@ -562,15 +574,34 @@ public class ContractController extends BaseController {
         if (null != id && !"".equals(id)) {
             //通过id获取跟踪咨询报告信息
             ProjectFollowReport follow = projectImplementEarlyService.getFollow(projectFollowReport);
+            if(StringUtils.isNotBlank(follow.getProjectContentDataNewId())){
+                projectFollowReport.setProjectContentDataNewId(follow.getProjectContentDataNewId());
+            }
             //判断是否有project.Id值
             //有project.Id需要查询
             if (null == follow.getProject()) {
                 follow.setProject(records);
             }
+            //查询工作内容和依据资料引用关联关系
+            List<ProjectTemplateInfo> contentBasedInfoList = projectBasedDataService.getContentBasedInfoList(projectFollowReport.getProjectContentDataNewId());
+            //添加导入或者写入的文件信息
+            follow.setOverAllFileGistdataList(contentBasedInfoList);
+
+            //处理成果文件信息
+            //查询工作内容和成果文件引用关联关系
+            List<ProjectTemplateInfo> projectAchievementFileDataList = projectBasedDataService.getAchievementFileDataById(projectFollowReport.getProjectContentDataNewId());
+            follow.setProjectAchievementFileDataList(projectAchievementFileDataList);
 
             ProjectContentData projectContentData = new ProjectContentData();
+            //如果没有工作内容详情信息 则创建一个新的id留着为之后的成果文件的工作内容详情进行修改
+            projectContentData.preInsert();
+            if(StringUtils.isBlank(projectFollowReport.getProjectContentDataNewId())){
+                follow.setProjectContentDataNewId(projectContentData.getId());
+            }
+            projectContentData.setId(null);
+
             //获取依据性文件信息
-            projectContentData.setProjectBasedDataList(projectImplementEarlyService.getBasedData(projectFollowReport));
+            /*projectContentData.setProjectBasedDataList(projectImplementEarlyService.getBasedData(projectFollowReport));*/
             /**获取项目的附件信息*/
             follow.setWorkAttachments(projectImplementEarlyService.getWorkattachment(projectFollowReport));
             follow.setProjectContentData(projectContentData);
@@ -619,10 +650,23 @@ public class ContractController extends BaseController {
         List<User> auditUserList = userService.getAuditUserListByType("2");
         projectFollowReport.setBzshbUserList(auditUserList);
 
-        //查询是否含有上传或者引用的依据性文件信息
-        if(StringUtils.isNotBlank(id)){
-            List<ProjectControlTable> controlData = projectControlTableService.getControlData(id,"");
+        //查询工作内容和依据资料引用关联关系
+        List<ProjectTemplateInfo> contentBasedInfoList = projectBasedDataService.getContentBasedInfoList(projectFollowReport.getProjectContentDataNewId());
+        //添加导入或者写入的文件信息
+        projectFollowReport.setOverAllFileGistdataList(contentBasedInfoList);
+
+        //处理成果文件信息
+        //查询工作内容和成果文件引用关联关系
+        List<ProjectTemplateInfo> projectAchievementFileDataList = projectBasedDataService.getAchievementFileDataById(projectFollowReport.getProjectContentDataNewId());
+        projectFollowReport.setProjectAchievementFileDataList(projectAchievementFileDataList);
+        ProjectContentData projectContentData = new ProjectContentData();
+        //如果没有工作内容详情信息 则创建一个新的id留着为之后的成果文件的工作内容详情进行修改
+        projectContentData.preInsert();
+        if(StringUtils.isBlank(projectFollowReport.getProjectContentDataNewId())){
+            projectFollowReport.setProjectContentDataNewId(projectContentData.getId());
         }
+
+        projectContentData.setId(null);
         projectFollowReport.setProject(records);
         projectFollowReport.setDictType("");
         projectFollowReport.setParentIds("");
@@ -755,7 +799,16 @@ public class ContractController extends BaseController {
 
         ProjectContentData projectContentData = new ProjectContentData();
         //获取依据性文件信息
-        projectContentData.setProjectBasedDataList(projectImplementEarlyService.getBasedData(projectFollowReport));
+        //projectContentData.setProjectBasedDataList(projectImplementEarlyService.getBasedData(projectFollowReport));
+        //处理成果文件信息
+        //查询工作内容和依据资料引用关联关系
+        List<ProjectTemplateInfo> contentBasedInfoList = projectBasedDataService.getContentBasedInfoList(projectFollowReport.getProjectContentDataNewId());
+        //添加导入或者写入的文件信息
+        projectFollowReport.setOverAllFileGistdataList(contentBasedInfoList);
+        //查询工作内容和成果文件引用关联关系
+        List<ProjectTemplateInfo> projectAchievementFileDataList = projectBasedDataService.getAchievementFileDataById(projectFollowReport.getProjectContentDataNewId());
+        projectFollowReport.setProjectAchievementFileDataList(projectAchievementFileDataList);
+
         /**获取项目的附件信息*/
         projectFollowReport.setWorkAttachments(projectImplementEarlyService.getWorkattachment(projectFollowReport));
         projectFollowReport.setProjectContentData(projectContentData);

+ 349 - 0
src/main/java/com/jeeplus/modules/projectConstruction/web/FollowArchiveController.java

@@ -0,0 +1,349 @@
+package com.jeeplus.modules.projectConstruction.web;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.act.entity.Act;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
+import com.jeeplus.modules.projectConstruction.service.ContractService;
+import com.jeeplus.modules.projectConstruction.service.FollowArchiveService;
+import com.jeeplus.modules.projectConstruction.service.FollowService;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectContentData;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectBasedDataService;
+import com.jeeplus.modules.projectcontroltable.service.ProjectControlTableService;
+import com.jeeplus.modules.projectrecord.dao.monthly.MonthlyConsultationReportDao;
+import com.jeeplus.modules.projectrecord.entity.ProjectFollowReport;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.projectrecord.service.ProjectImplementEarlyService;
+import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
+import com.jeeplus.modules.projectreportnum.dao.ProjectReportNumDao;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.service.UserService;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.activiti.engine.task.Task;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 全过程咨询报告的质量复核和归档操作
+ * @author: 徐滕
+ * @create: 2021-10-05 12:53
+ **/
+@Controller
+@RequestMapping(value = "${adminPath}/followArchive/followArchive")
+public class FollowArchiveController extends BaseController {
+
+    @Autowired
+    private ProjectRecordsService projectRecordsService;
+    @Autowired
+    private ProjectImplementEarlyService projectImplementEarlyService;
+    @Autowired
+    private FollowArchiveService followArchiveService;
+    @Autowired
+    private ActTaskService actTaskService;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private ProjectBasedDataService projectBasedDataService;
+
+    private static byte[] SYN_BYTE = new byte[0];
+
+
+    /**
+     * 跳转新增页
+     * @param projectFollowReport
+     * @param request
+     * @param response
+     * @param model
+     * @param attr
+     * @return
+     */
+    @RequestMapping(value = "followArchiveForm")
+    public String followArchiveForm(ProjectFollowReport projectFollowReport, HttpServletRequest request, HttpServletResponse response, Model model, RedirectAttributes attr) {
+        //获取id
+        String id = projectFollowReport.getId();
+        //获取项目信息
+        ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
+        //通过id获取跟踪咨询报告信息
+        ProjectFollowReport follow = projectImplementEarlyService.getFollow(projectFollowReport);
+        if(StringUtils.isNotBlank(follow.getProjectContentDataNewId())){
+            projectFollowReport.setProjectContentDataNewId(follow.getProjectContentDataNewId());
+        }
+        //判断是否有project.Id值
+        //有project.Id需要查询
+        if (null == follow.getProject()) {
+            follow.setProject(records);
+        }
+        //查询工作内容和依据资料引用关联关系
+        List<ProjectTemplateInfo> contentBasedInfoList = projectBasedDataService.getContentBasedInfoList(projectFollowReport.getProjectContentDataNewId());
+        //添加导入或者写入的文件信息
+        follow.setOverAllFileGistdataList(contentBasedInfoList);
+
+        //处理成果文件信息
+        //查询工作内容和成果文件引用关联关系
+        List<ProjectTemplateInfo> projectAchievementFileDataList = projectBasedDataService.getAchievementFileDataById(projectFollowReport.getProjectContentDataNewId());
+        follow.setProjectAchievementFileDataList(projectAchievementFileDataList);
+
+        ProjectContentData projectContentData = new ProjectContentData();
+        //如果没有工作内容详情信息 则创建一个新的id留着为之后的成果文件的工作内容详情进行修改
+        projectContentData.preInsert();
+        if(StringUtils.isBlank(projectFollowReport.getProjectContentDataNewId())){
+            follow.setProjectContentDataNewId(projectContentData.getId());
+        }
+        projectContentData.setId(null);
+
+        /**获取项目的附件信息*/
+        follow.setWorkAttachments(projectImplementEarlyService.getWorkattachment(projectFollowReport));
+        follow.setProjectContentData(projectContentData);
+
+        //查询真实总审人员信息
+        List<User> auditUserList = userService.getAuditUserListByType("2");
+        follow.setBzshbUserList(auditUserList);
+
+        /**获取项目的附件信息*/
+        model.addAttribute("projectFollowReport", follow);
+        if("view".equals(projectFollowReport.getView())){
+            return "modules/projectrecord/workContentFromAndView/workFollowView";
+        }
+        return "modules/projectrecord/follow/workFollowArchiveForm";
+
+    }
+
+    /**
+     * 暂存操作
+     * @param projectFollowReport
+     * @param model
+     * @param redirectAttributes
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping(value = "storFollow")
+    public String storFollowArchive(ProjectFollowReport projectFollowReport, Model model, RedirectAttributes redirectAttributes) throws Exception {
+        //查询项目信息
+        ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
+        //将项目信息放入跟踪咨询报告中
+        projectFollowReport.setProject(records);
+        //进行新增操作
+        synchronized (SYN_BYTE) {
+            followArchiveService.storFollow(projectFollowReport);
+        }
+        return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
+    }
+
+    /**
+     * 新增操作
+     * @param projectFollowReport
+     * @param model
+     * @param redirectAttributes
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping(value = "saveFollow")
+    public String saveFollowArchive(ProjectFollowReport projectFollowReport, Model model, RedirectAttributes redirectAttributes) throws Exception {
+        //查询项目信息
+        ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
+        //将项目信息放入跟踪咨询报告中
+        projectFollowReport.setProject(records);
+        //判断咨询报告id是否为空
+        if (null != projectFollowReport.getId() && !"".equals(projectFollowReport.getId())) {
+            //修改
+            //获取跟踪咨询报告信息
+            ProjectFollowReport followReport = projectImplementEarlyService.getFollow(projectFollowReport);
+            //添加流程id
+            projectFollowReport.setProcessInstanceId(followReport.getProcessInstanceId());
+            //添加创建人等信息
+            projectFollowReport.setCreateBy(followReport.getCreateBy());
+            projectFollowReport.setCreateDate(followReport.getCreateDate());
+            projectFollowReport.setUpdateBy(followReport.getUpdateBy());
+            projectFollowReport.setUpdateDate(followReport.getUpdateDate());
+            projectFollowReport.setStatus(followReport.getStatus());
+            //添加项目信息
+            projectFollowReport.setProject(records);
+            //进行修改操作
+            followArchiveService.insertFollow(projectFollowReport);
+        } else {
+            //进行新增操作
+            synchronized (SYN_BYTE) {
+                followArchiveService.insertFollow(projectFollowReport);
+            }
+        }
+        return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
+    }
+
+    /**
+     * 获取跟踪咨询报告信息
+     * @param projectFollowReport
+     * @param model
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "getProcess")
+    public String getProcess(ProjectFollowReport projectFollowReport, Model model,HttpServletRequest request){
+        projectFollowReport = projectImplementEarlyService.getFollow(projectFollowReport);
+        model.addAttribute("processInstanceId", projectFollowReport.getArchiveProcessInstanceId());
+        return "modules/projectrecord/projectRecordsTask";
+    }
+
+    /**
+     * 审批
+     * @param redirectAttributes
+     * @return
+     */
+    @RequestMapping("saveArchiveAudit")
+    public String saveAudit(ProjectFollowReport projectFollowReport, RedirectAttributes redirectAttributes){
+        //获取项目信息
+        ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
+        //获取跟踪咨询报告信息
+        ProjectFollowReport followReport = projectImplementEarlyService.getFollow(projectFollowReport);
+        projectFollowReport.setArchiveProcessInstanceId(followReport.getArchiveProcessInstanceId());
+        projectFollowReport.setCreateBy(followReport.getCreateBy());
+        projectFollowReport.setCreateDate(followReport.getCreateDate());
+        projectFollowReport.setUpdateBy(followReport.getUpdateBy());
+        projectFollowReport.setUpdateDate(followReport.getUpdateDate());
+        projectFollowReport.setOverAllArchiveStatus(followReport.getOverAllArchiveStatus());
+        projectFollowReport.setArchiveId(followReport.getArchiveId());
+        projectFollowReport.setProject(records);
+        String home = projectFollowReport.getHome();
+        try {
+            String taskDefKey = projectFollowReport.getAct().getTaskDefKey();
+            //当状态为未通过时,重新修改数据
+            if ("modifyApply".equals(taskDefKey)) {
+                projectFollowReport.getAct().setComment("重新申请");
+            }
+            List<User>  users = Lists.newArrayList();
+            //添加总审人员
+            User auditUser = UserUtils.get(projectFollowReport.getBzshbUserId());
+            users.add(auditUser);
+            String flag = projectFollowReport.getAct().getFlag();
+            if ("yes".equals(flag) && (users==null || users.size()==0)){
+                addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
+            }else {
+                //进行审核操作
+                String str = followArchiveService.auditSave(projectFollowReport,users);
+                addMessage(redirectAttributes, str);
+            }
+        }catch (Exception e){
+            addMessage(redirectAttributes, "跟踪咨询报告质量复核流程审批失败");
+        }
+
+        if (StringUtils.isNotBlank(home) && "home".equals(home)){
+            return "redirect:" + Global.getAdminPath() + "/home/?repage";
+        }else {
+            return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
+        }
+    }
+
+    /**
+     * 驳回修改方法
+     */
+    @RequestMapping(value = "modify")
+    public String modify(ProjectFollowReport projectFollowReport, Model model,RedirectAttributes redirectAttributes) {
+        //获取跟踪咨询报告信息
+        projectFollowReport = projectImplementEarlyService.getFollow(projectFollowReport);
+        //获取项目信息
+        ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProjectId());
+        //项目信息添加到跟踪咨询报告信息中
+        projectFollowReport.setProject(records);
+
+        ProjectContentData projectContentData = new ProjectContentData();
+        //获取依据性文件信息
+        //projectContentData.setProjectBasedDataList(projectImplementEarlyService.getBasedData(projectFollowReport));
+        //处理成果文件信息
+        //查询工作内容和依据资料引用关联关系
+        List<ProjectTemplateInfo> contentBasedInfoList = projectBasedDataService.getContentBasedInfoList(projectFollowReport.getProjectContentDataNewId());
+        //添加导入或者写入的文件信息
+        projectFollowReport.setOverAllFileGistdataList(contentBasedInfoList);
+        //查询工作内容和成果文件引用关联关系
+        List<ProjectTemplateInfo> projectAchievementFileDataList = projectBasedDataService.getAchievementFileDataById(projectFollowReport.getProjectContentDataNewId());
+        projectFollowReport.setProjectAchievementFileDataList(projectAchievementFileDataList);
+
+        /**获取项目的附件信息*/
+        projectFollowReport.setWorkAttachments(projectImplementEarlyService.getWorkattachment(projectFollowReport));
+        projectFollowReport.setProjectContentData(projectContentData);
+
+        //查询工作流信息
+        ProcessInstance processInstance = actTaskService.getProcIns(projectFollowReport.getArchiveProcessInstanceId());
+        if (processInstance!=null) {
+            //获取当前节点信息
+            Task taskInfok = actTaskService.getCurrentTaskInfo(processInstance);
+            Act act = new Act();
+            act.setTaskId(taskInfok.getId());
+            act.setTaskName(taskInfok.getName());
+            act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
+            act.setProcDefId(taskInfok.getProcessDefinitionId());
+            act.setProcInsId(taskInfok.getProcessInstanceId());
+            act.setTask(taskInfok);
+            projectFollowReport.setAct(act);
+        }
+
+        //查询真实总审人员信息
+        List<User> auditUserList = userService.getAuditUserListByType("2");
+        projectFollowReport.setBzshbUserList(auditUserList);
+        model.addAttribute("projectFollowReport", projectFollowReport);
+        return "modules/projectrecord/follow/workFollowArchiveModify";
+    }
+
+    /**
+     * 删除依据性资料
+     */
+    @RequestMapping(value = "deleteFollow")
+    @ResponseBody
+    public Map<String, Object> deleteFollow(ProjectFollowReport projectFollowReport, RedirectAttributes redirectAttributes) {
+        Map<String, Object> j = new HashMap<>();
+        try {
+            //删除操作
+            followArchiveService.deleteFollow(projectFollowReport);
+            j.put("status", true);
+            j.put("msg", "删除成功");
+            addMessage(redirectAttributes, "删除成功");
+        } catch (Exception e) {
+            j.put("status", false);
+            j.put("msg", "删除失败");
+            addMessage(redirectAttributes, "删除失败");
+        }
+        return j;
+    }
+    /**
+     * 撤回操作
+     * @param request
+     * @param redirectAttributes
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping(value = "revoke")
+    public String revoke(HttpServletRequest request, RedirectAttributes redirectAttributes) throws Exception {
+        HashMap<String, String> requestMap = findRequestMap(request);
+        String id = requestMap.get("id");
+        /*try {*/
+        //获取跟踪咨询报告信息
+        ProjectFollowReport projectFollowReport = projectImplementEarlyService.getFollowById(id);
+        if("5".equals( projectFollowReport.getOverAllArchiveStatus())){
+            addMessage(redirectAttributes, "跟踪咨询报告质量复核已审批通过,无法撤回");
+            return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
+        }
+        //撤回操作
+        followArchiveService.cancelProcess(projectFollowReport);
+        addMessage(redirectAttributes, "撤回跟踪咨询报告质量复核成功");
+        /*}catch (Exception e){
+            logger.info(e.getMessage());
+            addMessage(redirectAttributes, "撤回跟踪咨询报告失败");
+        }*/
+        return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
+    }
+
+}

+ 363 - 0
src/main/java/com/jeeplus/modules/projectConstruction/web/FollowController.java

@@ -0,0 +1,363 @@
+package com.jeeplus.modules.projectConstruction.web;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.act.entity.Act;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
+import com.jeeplus.modules.projectConstruction.service.ContractService;
+import com.jeeplus.modules.projectConstruction.service.FollowService;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectContentData;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectBasedDataService;
+import com.jeeplus.modules.projectcontroltable.service.ProjectControlTableService;
+import com.jeeplus.modules.projectrecord.dao.monthly.MonthlyConsultationReportDao;
+import com.jeeplus.modules.projectrecord.entity.ProjectFollowReport;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.projectrecord.service.ProjectImplementEarlyService;
+import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
+import com.jeeplus.modules.projectreportnum.dao.ProjectReportNumDao;
+import com.jeeplus.modules.projectreportnum.entity.ReportNum;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.service.UserService;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.activiti.engine.task.Task;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 全过程咨询报告的质量复核和归档操作
+ * @author: 徐滕
+ * @create: 2021-10-05 12:53
+ **/
+@Controller
+@RequestMapping(value = "${adminPath}/follow/follow")
+public class FollowController extends BaseController {
+
+    @Autowired
+    private ContractService contractService;
+    @Autowired
+    private ProjectRecordsService projectRecordsService;
+    @Autowired
+    private ProjectImplementEarlyService projectImplementEarlyService;
+    @Autowired
+    private FollowService followService;
+    @Autowired
+    private WorkClientAttachmentDao workClientAttachmentDao;
+    @Autowired
+    private WorkattachmentService workattachmentService;
+    @Autowired
+    private ProjectControlTableService projectControlTableService;
+    @Autowired
+    private ActTaskService actTaskService;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private MonthlyConsultationReportDao monthlyConsultationReportDao;
+    @Autowired
+    private ProjectReportNumDao projectReportNumDao;
+    @Autowired
+    private ProjectBasedDataService projectBasedDataService;
+
+    private static byte[] SYN_BYTE = new byte[0];
+
+
+    /**
+     * 跳转新增页
+     * @param projectFollowReport
+     * @param request
+     * @param response
+     * @param model
+     * @param attr
+     * @return
+     */
+    @RequestMapping(value = "followReportForm")
+    public String followReportForm(ProjectFollowReport projectFollowReport, HttpServletRequest request, HttpServletResponse response, Model model, RedirectAttributes attr) {
+        //获取id
+        String id = projectFollowReport.getId();
+        //获取项目信息
+        ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
+        //通过id获取跟踪咨询报告信息
+        ProjectFollowReport follow = projectImplementEarlyService.getFollow(projectFollowReport);
+        if(StringUtils.isNotBlank(follow.getProjectContentDataNewId())){
+            projectFollowReport.setProjectContentDataNewId(follow.getProjectContentDataNewId());
+        }
+        //判断是否有project.Id值
+        //有project.Id需要查询
+        if (null == follow.getProject()) {
+            follow.setProject(records);
+        }
+        //查询工作内容和依据资料引用关联关系
+        List<ProjectTemplateInfo> contentBasedInfoList = projectBasedDataService.getContentBasedInfoList(projectFollowReport.getProjectContentDataNewId());
+        //添加导入或者写入的文件信息
+        follow.setOverAllFileGistdataList(contentBasedInfoList);
+
+        //处理成果文件信息
+        //查询工作内容和成果文件引用关联关系
+        List<ProjectTemplateInfo> projectAchievementFileDataList = projectBasedDataService.getAchievementFileDataById(projectFollowReport.getProjectContentDataNewId());
+        follow.setProjectAchievementFileDataList(projectAchievementFileDataList);
+
+        ProjectContentData projectContentData = new ProjectContentData();
+        //如果没有工作内容详情信息 则创建一个新的id留着为之后的成果文件的工作内容详情进行修改
+        projectContentData.preInsert();
+        if(StringUtils.isBlank(projectFollowReport.getProjectContentDataNewId())){
+            follow.setProjectContentDataNewId(projectContentData.getId());
+        }
+        projectContentData.setId(null);
+
+        //获取依据性文件信息
+        /*projectContentData.setProjectBasedDataList(projectImplementEarlyService.getBasedData(projectFollowReport));*/
+        /**获取项目的附件信息*/
+        follow.setWorkAttachments(projectImplementEarlyService.getWorkattachment(projectFollowReport));
+        follow.setProjectContentData(projectContentData);
+
+        //查询真实总审人员信息
+        List<User> auditUserList = userService.getAuditUserListByType("2");
+        follow.setBzshbUserList(auditUserList);
+
+        /**获取项目的附件信息*/
+        model.addAttribute("projectFollowReport", follow);
+        if("view".equals(projectFollowReport.getView())){
+            return "modules/projectrecord/workContentFromAndView/workFollowView";
+        }
+        return "modules/projectrecord/follow/workFollowReportForm";
+
+    }
+
+    /**
+     * 暂存操作
+     * @param projectFollowReport
+     * @param model
+     * @param redirectAttributes
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping(value = "storFollowReport")
+    public String storFollowReport(ProjectFollowReport projectFollowReport, Model model, RedirectAttributes redirectAttributes) throws Exception {
+        //查询项目信息
+        ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
+        //将项目信息放入跟踪咨询报告中
+        projectFollowReport.setProject(records);
+        //进行新增操作
+        synchronized (SYN_BYTE) {
+            followService.storFollow(projectFollowReport);
+        }
+        return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
+    }
+
+    /**
+     * 新增操作
+     * @param projectFollowReport
+     * @param model
+     * @param redirectAttributes
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping(value = "saveFollowReport")
+    public String saveFollowReport(ProjectFollowReport projectFollowReport, Model model, RedirectAttributes redirectAttributes) throws Exception {
+        //查询项目信息
+        ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
+        //将项目信息放入跟踪咨询报告中
+        projectFollowReport.setProject(records);
+        //判断咨询报告id是否为空
+        if (null != projectFollowReport.getId() && !"".equals(projectFollowReport.getId())) {
+            //修改
+            //获取跟踪咨询报告信息
+            ProjectFollowReport followReport = projectImplementEarlyService.getFollow(projectFollowReport);
+            //添加流程id
+            projectFollowReport.setProcessInstanceId(followReport.getProcessInstanceId());
+            //添加创建人等信息
+            projectFollowReport.setCreateBy(followReport.getCreateBy());
+            projectFollowReport.setCreateDate(followReport.getCreateDate());
+            projectFollowReport.setUpdateBy(followReport.getUpdateBy());
+            projectFollowReport.setUpdateDate(followReport.getUpdateDate());
+            projectFollowReport.setStatus(followReport.getStatus());
+            //添加项目信息
+            projectFollowReport.setProject(records);
+            //进行修改操作
+            followService.insertFollow(projectFollowReport);
+        } else {
+            //进行新增操作
+            synchronized (SYN_BYTE) {
+                followService.insertFollow(projectFollowReport);
+            }
+        }
+        return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
+    }
+
+    /**
+     * 获取跟踪咨询报告信息
+     * @param projectFollowReport
+     * @param model
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "getReportProcess")
+    public String getReportProcess(ProjectFollowReport projectFollowReport, Model model,HttpServletRequest request){
+        projectFollowReport = projectImplementEarlyService.getFollow(projectFollowReport);
+        model.addAttribute("processInstanceId", projectFollowReport.getReportProcessInstanceId());
+        return "modules/projectrecord/projectRecordsTask";
+    }
+
+    /**
+     * 审批
+     * @param redirectAttributes
+     * @return
+     */
+    @RequestMapping("saveReportAudit")
+    public String saveAudit(ProjectFollowReport projectFollowReport, RedirectAttributes redirectAttributes){
+        //获取项目信息
+        ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
+        //获取跟踪咨询报告信息
+        ProjectFollowReport followReport = projectImplementEarlyService.getFollow(projectFollowReport);
+        projectFollowReport.setReportProcessInstanceId(followReport.getReportProcessInstanceId());
+        projectFollowReport.setCreateBy(followReport.getCreateBy());
+        projectFollowReport.setCreateDate(followReport.getCreateDate());
+        projectFollowReport.setUpdateBy(followReport.getUpdateBy());
+        projectFollowReport.setUpdateDate(followReport.getUpdateDate());
+        projectFollowReport.setOverAllReportStatus(followReport.getOverAllReportStatus());
+        projectFollowReport.setReportId(followReport.getReportId());
+        projectFollowReport.setProject(records);
+        String home = projectFollowReport.getHome();
+        try {
+            String taskDefKey = projectFollowReport.getAct().getTaskDefKey();
+            //当状态为未通过时,重新修改数据
+            if ("modifyApply".equals(taskDefKey)) {
+                projectFollowReport.getAct().setComment("重新申请");
+            }
+            List<User>  users = Lists.newArrayList();
+            //添加总审人员
+            User auditUser = UserUtils.get(projectFollowReport.getBzshbUserId());
+            users.add(auditUser);
+            String flag = projectFollowReport.getAct().getFlag();
+            if ("yes".equals(flag) && (users==null || users.size()==0)){
+                addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
+            }else {
+                //进行审核操作
+                String str = followService.auditSave(projectFollowReport,users);
+                addMessage(redirectAttributes, str);
+            }
+        }catch (Exception e){
+            addMessage(redirectAttributes, "跟踪咨询报告质量复核流程审批失败");
+        }
+
+        if (StringUtils.isNotBlank(home) && "home".equals(home)){
+            return "redirect:" + Global.getAdminPath() + "/home/?repage";
+        }else {
+            return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
+        }
+    }
+
+    /**
+     * 驳回修改方法
+     */
+    @RequestMapping(value = "modify")
+    public String modify(ProjectFollowReport projectFollowReport, Model model,RedirectAttributes redirectAttributes) {
+        //获取跟踪咨询报告信息
+        projectFollowReport = projectImplementEarlyService.getFollow(projectFollowReport);
+        //获取项目信息
+        ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProjectId());
+        //项目信息添加到跟踪咨询报告信息中
+        projectFollowReport.setProject(records);
+
+        ProjectContentData projectContentData = new ProjectContentData();
+        //获取依据性文件信息
+        //projectContentData.setProjectBasedDataList(projectImplementEarlyService.getBasedData(projectFollowReport));
+        //处理成果文件信息
+        //查询工作内容和依据资料引用关联关系
+        List<ProjectTemplateInfo> contentBasedInfoList = projectBasedDataService.getContentBasedInfoList(projectFollowReport.getProjectContentDataNewId());
+        //添加导入或者写入的文件信息
+        projectFollowReport.setOverAllFileGistdataList(contentBasedInfoList);
+        //查询工作内容和成果文件引用关联关系
+        List<ProjectTemplateInfo> projectAchievementFileDataList = projectBasedDataService.getAchievementFileDataById(projectFollowReport.getProjectContentDataNewId());
+        projectFollowReport.setProjectAchievementFileDataList(projectAchievementFileDataList);
+
+        /**获取项目的附件信息*/
+        projectFollowReport.setWorkAttachments(projectImplementEarlyService.getWorkattachment(projectFollowReport));
+        projectFollowReport.setProjectContentData(projectContentData);
+
+        //查询工作流信息
+        ProcessInstance processInstance = actTaskService.getProcIns(projectFollowReport.getReportProcessInstanceId());
+        if (processInstance!=null) {
+            //获取当前节点信息
+            Task taskInfok = actTaskService.getCurrentTaskInfo(processInstance);
+            Act act = new Act();
+            act.setTaskId(taskInfok.getId());
+            act.setTaskName(taskInfok.getName());
+            act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
+            act.setProcDefId(taskInfok.getProcessDefinitionId());
+            act.setProcInsId(taskInfok.getProcessInstanceId());
+            act.setTask(taskInfok);
+            projectFollowReport.setAct(act);
+        }
+
+        //查询真实总审人员信息
+        List<User> auditUserList = userService.getAuditUserListByType("2");
+        projectFollowReport.setBzshbUserList(auditUserList);
+        model.addAttribute("projectFollowReport", projectFollowReport);
+        return "modules/projectrecord/follow/workFollowReportModify";
+    }
+
+    /**
+     * 删除依据性资料
+     */
+    @RequestMapping(value = "deleteFollow")
+    @ResponseBody
+    public Map<String, Object> deleteFollow(ProjectFollowReport projectFollowReport, RedirectAttributes redirectAttributes) {
+        Map<String, Object> j = new HashMap<>();
+        try {
+            //删除操作
+            followService.deleteFollow(projectFollowReport);
+            j.put("status", true);
+            j.put("msg", "删除成功");
+            addMessage(redirectAttributes, "删除成功");
+        } catch (Exception e) {
+            j.put("status", false);
+            j.put("msg", "删除失败");
+            addMessage(redirectAttributes, "删除失败");
+        }
+        return j;
+    }
+    /**
+     * 撤回操作
+     * @param request
+     * @param redirectAttributes
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping(value = "revoke")
+    public String revoke(HttpServletRequest request, RedirectAttributes redirectAttributes) throws Exception {
+        HashMap<String, String> requestMap = findRequestMap(request);
+        String id = requestMap.get("id");
+        /*try {*/
+        //获取跟踪咨询报告信息
+        ProjectFollowReport projectFollowReport = projectImplementEarlyService.getFollowById(id);
+        if("5".equals( projectFollowReport.getOverAllReportStatus())){
+            addMessage(redirectAttributes, "跟踪咨询报告质量复核已审批通过,无法撤回");
+            return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
+        }
+        //撤回操作
+        followService.cancelProcess(projectFollowReport);
+        addMessage(redirectAttributes, "撤回跟踪咨询报告质量复核成功");
+        /*}catch (Exception e){
+            logger.info(e.getMessage());
+            addMessage(redirectAttributes, "撤回跟踪咨询报告失败");
+        }*/
+        return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
+    }
+
+}

+ 54 - 0
src/main/java/com/jeeplus/modules/projectrecord/dao/ProjectFollowReportDao.java

@@ -2,7 +2,9 @@ package com.jeeplus.modules.projectrecord.dao;
 
 import com.jeeplus.common.persistence.CrudDao;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.projectrecord.entity.ProjectFollowArchiveInfo;
 import com.jeeplus.modules.projectrecord.entity.ProjectFollowReport;
+import com.jeeplus.modules.projectrecord.entity.ProjectFollowReportInfo;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 
 import java.util.List;
@@ -33,4 +35,56 @@ public interface ProjectFollowReportDao extends CrudDao<ProjectFollowReport> {
      */
     void updateProcessIdAndStatus(ProjectFollowReport projectFollowReport);
 
+    /**
+     * 审核信息修改(质量复核)
+     * @param projectFollowReport
+     */
+    void updateReportProcessIdAndStatus(ProjectFollowReportInfo projectFollowReport);
+
+    /**
+     * 审核信息修改(归档)
+     * @param projectFollowReport
+     */
+    void updateArchiveProcessIdAndStatus(ProjectFollowArchiveInfo projectFollowReport);
+
+    /**
+     * 根据质量复核id查询信息
+     * @param id
+     * @return
+     */
+    ProjectFollowReport getReportFollowById(String id);
+
+    /**
+     * 根据归档id查询信息
+     * @param id
+     * @return
+     */
+    ProjectFollowReport getReportFollowByArchiveId(String id);
+
+    /**
+     * 修改质量复核审核信息
+     * @param projectFollowReport
+     * @return
+     */
+    Integer updateReport(ProjectFollowReport projectFollowReport);
+    /**
+     * 修改归档审核信息
+     * @param projectFollowReport
+     * @return
+     */
+    Integer updateArchive(ProjectFollowReport projectFollowReport);
+
+    /**
+     * 删除质量复核审核信息
+     * @param projectFollowReport
+     * @return
+     */
+    Integer deleteReport(ProjectFollowReport projectFollowReport);
+    /**
+     * 删除归档审核信息
+     * @param projectFollowReport
+     * @return
+     */
+    Integer deleteArchive(ProjectFollowReport projectFollowReport);
+
 }

+ 66 - 0
src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectFollowArchiveInfo.java

@@ -0,0 +1,66 @@
+package com.jeeplus.modules.projectrecord.entity;
+
+import com.jeeplus.common.persistence.ActEntity;
+
+/**
+ * @author: 大猫
+ * @create: 2021-10-06 14:59
+ **/
+public class ProjectFollowArchiveInfo extends ActEntity<ProjectFollowArchiveInfo> {
+    /**项目id*/
+    private ProjectRecords project;
+    private Integer archiveStatus;  //审核状态
+    private String processInstanceId;   //流程id
+    private String followId;    //咨询报告id
+    private String bzshbUserId;     //审核人员id
+    /**跟踪咨询报告名称*/
+    private String projectFollowName;
+
+    public ProjectRecords getProject() {
+        return project;
+    }
+
+    public void setProject(ProjectRecords project) {
+        this.project = project;
+    }
+
+    public Integer getArchiveStatus() {
+        return archiveStatus;
+    }
+
+    public void setArchiveStatus(Integer archiveStatus) {
+        this.archiveStatus = archiveStatus;
+    }
+
+    public String getProcessInstanceId() {
+        return processInstanceId;
+    }
+
+    public void setProcessInstanceId(String processInstanceId) {
+        this.processInstanceId = processInstanceId;
+    }
+
+    public String getFollowId() {
+        return followId;
+    }
+
+    public void setFollowId(String followId) {
+        this.followId = followId;
+    }
+
+    public String getBzshbUserId() {
+        return bzshbUserId;
+    }
+
+    public void setBzshbUserId(String bzshbUserId) {
+        this.bzshbUserId = bzshbUserId;
+    }
+
+    public String getProjectFollowName() {
+        return projectFollowName;
+    }
+
+    public void setProjectFollowName(String projectFollowName) {
+        this.projectFollowName = projectFollowName;
+    }
+}

+ 92 - 0
src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectFollowReport.java

@@ -3,6 +3,7 @@ package com.jeeplus.modules.projectrecord.entity;
 import com.google.common.collect.Lists;
 import com.jeeplus.common.persistence.ActEntity;
 import com.jeeplus.common.persistence.TreeEntity;
+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.projectcontroltable.entity.ProjectControlTable;
@@ -49,6 +50,17 @@ public class ProjectFollowReport extends ActEntity<ProjectFollowReport> {
     private List<Workattachment> workAttachments;
     private List<User> bzshbUserList;  //总审用户信息
     private String bzshbUserId;     //审核人员id
+    private List<ProjectTemplateInfo> overAllFileGistdataList;   //全过程依据性文件
+    private List<ProjectTemplateInfo> projectAchievementFileDataList;   //全过程依据性文件
+    private String overallProjectTypeId;		//全过程项目类型id
+    private String projectContentDataNewId;		//宜居性资料或者成果文件的id
+    private String overAllReportStatus;		//上报状态
+    private String reportProcessInstanceId;		//上报流程id
+    private String overAllArchiveStatus;		//归档状态
+    private String archiveProcessInstanceId;		//归档流程id
+    /**报告号*/
+    private String reportId;
+    private String archiveId;
 
 
     public ProjectRecords getProject() {
@@ -196,4 +208,84 @@ public class ProjectFollowReport extends ActEntity<ProjectFollowReport> {
     public void setBzshbUserId(String bzshbUserId) {
         this.bzshbUserId = bzshbUserId;
     }
+
+    public List<ProjectTemplateInfo> getOverAllFileGistdataList() {
+        return overAllFileGistdataList;
+    }
+
+    public void setOverAllFileGistdataList(List<ProjectTemplateInfo> overAllFileGistdataList) {
+        this.overAllFileGistdataList = overAllFileGistdataList;
+    }
+
+    public List<ProjectTemplateInfo> getProjectAchievementFileDataList() {
+        return projectAchievementFileDataList;
+    }
+
+    public void setProjectAchievementFileDataList(List<ProjectTemplateInfo> projectAchievementFileDataList) {
+        this.projectAchievementFileDataList = projectAchievementFileDataList;
+    }
+
+    public String getOverallProjectTypeId() {
+        return overallProjectTypeId;
+    }
+
+    public void setOverallProjectTypeId(String overallProjectTypeId) {
+        this.overallProjectTypeId = overallProjectTypeId;
+    }
+
+    public String getProjectContentDataNewId() {
+        return projectContentDataNewId;
+    }
+
+    public void setProjectContentDataNewId(String projectContentDataNewId) {
+        this.projectContentDataNewId = projectContentDataNewId;
+    }
+
+    public String getOverAllReportStatus() {
+        return overAllReportStatus;
+    }
+
+    public void setOverAllReportStatus(String overAllReportStatus) {
+        this.overAllReportStatus = overAllReportStatus;
+    }
+
+    public String getOverAllArchiveStatus() {
+        return overAllArchiveStatus;
+    }
+
+    public void setOverAllArchiveStatus(String overAllArchiveStatus) {
+        this.overAllArchiveStatus = overAllArchiveStatus;
+    }
+
+    public String getReportProcessInstanceId() {
+        return reportProcessInstanceId;
+    }
+
+    public void setReportProcessInstanceId(String reportProcessInstanceId) {
+        this.reportProcessInstanceId = reportProcessInstanceId;
+    }
+
+    public String getArchiveProcessInstanceId() {
+        return archiveProcessInstanceId;
+    }
+
+    public void setArchiveProcessInstanceId(String archiveProcessInstanceId) {
+        this.archiveProcessInstanceId = archiveProcessInstanceId;
+    }
+
+    public String getReportId() {
+        return reportId;
+    }
+
+    public void setReportId(String reportId) {
+        this.reportId = reportId;
+    }
+
+    public String getArchiveId() {
+        return archiveId;
+    }
+
+    public void setArchiveId(String archiveId) {
+        this.archiveId = archiveId;
+    }
 }

+ 67 - 0
src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectFollowReportInfo.java

@@ -0,0 +1,67 @@
+package com.jeeplus.modules.projectrecord.entity;
+
+import com.jeeplus.common.persistence.ActEntity;
+
+/**
+ * 质量复核表
+ * @author: 徐滕
+ * @create: 2021-10-05 13:24
+ **/
+public class ProjectFollowReportInfo extends ActEntity<ProjectFollowReportInfo> {
+    /**项目id*/
+    private ProjectRecords project;
+    private Integer reportStatus;  //审核状态
+    private String processInstanceId;   //流程id
+    private String followId;    //咨询报告id
+    private String bzshbUserId;     //审核人员id
+    /**跟踪咨询报告名称*/
+    private String projectFollowName;
+
+    public ProjectRecords getProject() {
+        return project;
+    }
+
+    public void setProject(ProjectRecords project) {
+        this.project = project;
+    }
+
+    public Integer getReportStatus() {
+        return reportStatus;
+    }
+
+    public void setReportStatus(Integer reportStatus) {
+        this.reportStatus = reportStatus;
+    }
+
+    public String getProcessInstanceId() {
+        return processInstanceId;
+    }
+
+    public void setProcessInstanceId(String processInstanceId) {
+        this.processInstanceId = processInstanceId;
+    }
+
+    public String getFollowId() {
+        return followId;
+    }
+
+    public void setFollowId(String followId) {
+        this.followId = followId;
+    }
+
+    public String getBzshbUserId() {
+        return bzshbUserId;
+    }
+
+    public void setBzshbUserId(String bzshbUserId) {
+        this.bzshbUserId = bzshbUserId;
+    }
+
+    public String getProjectFollowName() {
+        return projectFollowName;
+    }
+
+    public void setProjectFollowName(String projectFollowName) {
+        this.projectFollowName = projectFollowName;
+    }
+}

+ 45 - 0
src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectRecordTreeData.java

@@ -93,6 +93,11 @@ public class ProjectRecordTreeData extends DataEntity<ProjectRecordTreeData> {
     private Integer reportAuditNotifyFlag; //新增报告代办(审批)判定条件
     private Integer recordAuditNotifyFlag; //归档报告代办(审批)判定条件
     private Integer reportedAuditNotifyFlag; //上报代办判(审批)定条件
+    private String projectContentDataNewId;
+    private String overAllReportStatus;		//上报状态
+    private String reportProcessInstanceId;		//上报流程id
+    private String overAllArchiveStatus;		//归档状态
+    private String archiveProcessInstanceId;		//归档流程id
 
 
 
@@ -727,4 +732,44 @@ public class ProjectRecordTreeData extends DataEntity<ProjectRecordTreeData> {
     public void setPmdrId(String pmdrId) {
         this.pmdrId = pmdrId;
     }
+
+    public String getProjectContentDataNewId() {
+        return projectContentDataNewId;
+    }
+
+    public void setProjectContentDataNewId(String projectContentDataNewId) {
+        this.projectContentDataNewId = projectContentDataNewId;
+    }
+
+    public String getOverAllReportStatus() {
+        return overAllReportStatus;
+    }
+
+    public void setOverAllReportStatus(String overAllReportStatus) {
+        this.overAllReportStatus = overAllReportStatus;
+    }
+
+    public String getOverAllArchiveStatus() {
+        return overAllArchiveStatus;
+    }
+
+    public void setOverAllArchiveStatus(String overAllArchiveStatus) {
+        this.overAllArchiveStatus = overAllArchiveStatus;
+    }
+
+    public String getReportProcessInstanceId() {
+        return reportProcessInstanceId;
+    }
+
+    public void setReportProcessInstanceId(String reportProcessInstanceId) {
+        this.reportProcessInstanceId = reportProcessInstanceId;
+    }
+
+    public String getArchiveProcessInstanceId() {
+        return archiveProcessInstanceId;
+    }
+
+    public void setArchiveProcessInstanceId(String archiveProcessInstanceId) {
+        this.archiveProcessInstanceId = archiveProcessInstanceId;
+    }
 }

+ 90 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -42,6 +42,8 @@ import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
 import com.jeeplus.modules.projectAccessory.service.CollectAccessoryService;
 import com.jeeplus.modules.projectAccessory.service.ProjectAccessoryRelationService;
 import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
+import com.jeeplus.modules.projectConstruction.service.FollowArchiveService;
+import com.jeeplus.modules.projectConstruction.service.FollowService;
 import com.jeeplus.modules.projectEngineering.entity.ProjectEngineeringInfo;
 import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
 import com.jeeplus.modules.projectFilingBatch.dao.ProjectFilingBatchProInfoDao;
@@ -497,6 +499,12 @@ public class WorkProjectNotifyController extends BaseController {
 	private ProjectTypeService projectTypeService;
 	@Autowired
 	private DictService dictService;
+	@Autowired
+	private ProjectBasedDataService projectBasedDataService;
+	@Autowired
+	private FollowService followService;
+	@Autowired
+	private FollowArchiveService followArchiveService;
 
 	@ModelAttribute
 	public WorkProjectNotify get(@RequestParam(required=false) String id) {
@@ -1832,6 +1840,16 @@ public class WorkProjectNotifyController extends BaseController {
 					ProjectContentData projectContentData = new ProjectContentData();
 					//获取依据性文件信息
 					projectContentData.setProjectBasedDataList(projectImplementEarlyService.getBasedData(followReport));
+					//查询工作内容和依据资料引用关联关系
+					List<ProjectTemplateInfo> contentBasedInfoList = projectBasedDataService.getContentBasedInfoList(followReport.getProjectContentDataNewId());
+					//添加导入或者写入的文件信息
+					followReport.setOverAllFileGistdataList(contentBasedInfoList);
+
+					//处理成果文件信息
+					//查询工作内容和成果文件引用关联关系
+					List<ProjectTemplateInfo> projectAchievementFileDataList = projectBasedDataService.getAchievementFileDataById(followReport.getProjectContentDataNewId());
+					followReport.setProjectAchievementFileDataList(projectAchievementFileDataList);
+
 					/**获取项目的附件信息*/
 					followReport.setWorkAttachments(projectImplementEarlyService.getWorkattachment(followReport));
 					followReport.setProjectContentData(projectContentData);
@@ -1850,6 +1868,78 @@ public class WorkProjectNotifyController extends BaseController {
 						return "modules/projectrecord/workContentFromAndView/workFollowView";
 					}
 
+				}else if (workProjectNotify.getType().equals("141")) {    //全过程项目质量复核
+					ProjectFollowReport followReport = followService.getReportFollowById(workProjectNotify.getNotifyId());
+					ProjectRecords records = projectRecordsService.getQueryProjectUsers(followReport.getProject().getId());
+					followReport.setProject(records);
+
+					ProjectContentData projectContentData = new ProjectContentData();
+					//获取依据性文件信息
+					projectContentData.setProjectBasedDataList(projectImplementEarlyService.getBasedData(followReport));
+					//查询工作内容和依据资料引用关联关系
+					List<ProjectTemplateInfo> contentBasedInfoList = projectBasedDataService.getContentBasedInfoList(followReport.getProjectContentDataNewId());
+					//添加导入或者写入的文件信息
+					followReport.setOverAllFileGistdataList(contentBasedInfoList);
+
+					//处理成果文件信息
+					//查询工作内容和成果文件引用关联关系
+					List<ProjectTemplateInfo> projectAchievementFileDataList = projectBasedDataService.getAchievementFileDataById(followReport.getProjectContentDataNewId());
+					followReport.setProjectAchievementFileDataList(projectAchievementFileDataList);
+
+					/**获取项目的附件信息*/
+					followReport.setWorkAttachments(projectImplementEarlyService.getWorkattachment(followReport));
+					followReport.setProjectContentData(projectContentData);
+
+					followReport.setAct(getByAct(followReport.getReportProcessInstanceId()));
+					followReport.setHome("home");
+					model.addAttribute("processInstanceId", followReport.getReportProcessInstanceId());
+					model.addAttribute("projectFollowReport",followReport);
+					if (workProjectNotify.getRemarks().contains("待通知") || "view".equals(workProjectNotify.getView())) {
+						return "modules/projectrecord/workContentFromAndView/workFollowView";
+					}else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
+						return "modules/projectrecord/follow/workFollowReportAudit";
+					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
+						return "modules/projectrecord/follow/workFollowReportModify";
+					} else {
+						return "modules/projectrecord/workContentFromAndView/workFollowView";
+					}
+
+				}else if (workProjectNotify.getType().equals("142")) {    //全过程项目归档
+					ProjectFollowReport followReport = followArchiveService.getReportFollowByArchiveId(workProjectNotify.getNotifyId());
+					ProjectRecords records = projectRecordsService.getQueryProjectUsers(followReport.getProject().getId());
+					followReport.setProject(records);
+
+					ProjectContentData projectContentData = new ProjectContentData();
+					//获取依据性文件信息
+					projectContentData.setProjectBasedDataList(projectImplementEarlyService.getBasedData(followReport));
+					//查询工作内容和依据资料引用关联关系
+					List<ProjectTemplateInfo> contentBasedInfoList = projectBasedDataService.getContentBasedInfoList(followReport.getProjectContentDataNewId());
+					//添加导入或者写入的文件信息
+					followReport.setOverAllFileGistdataList(contentBasedInfoList);
+
+					//处理成果文件信息
+					//查询工作内容和成果文件引用关联关系
+					List<ProjectTemplateInfo> projectAchievementFileDataList = projectBasedDataService.getAchievementFileDataById(followReport.getProjectContentDataNewId());
+					followReport.setProjectAchievementFileDataList(projectAchievementFileDataList);
+
+					/**获取项目的附件信息*/
+					followReport.setWorkAttachments(projectImplementEarlyService.getWorkattachment(followReport));
+					followReport.setProjectContentData(projectContentData);
+
+					followReport.setAct(getByAct(followReport.getArchiveProcessInstanceId()));
+					followReport.setHome("home");
+					model.addAttribute("processInstanceId", followReport.getArchiveProcessInstanceId());
+					model.addAttribute("projectFollowReport",followReport);
+					if (workProjectNotify.getRemarks().contains("待通知") || "view".equals(workProjectNotify.getView())) {
+						return "modules/projectrecord/workContentFromAndView/workFollowView";
+					}else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
+						return "modules/projectrecord/follow/workFollowArchiveAudit";
+					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
+						return "modules/projectrecord/follow/workFollowArchiveModify";
+					} else {
+						return "modules/projectrecord/workContentFromAndView/workFollowView";
+					}
+
 				} else if (workProjectNotify.getType().equals("94")) {    //项目登记
 					boolean flag = false;
 					//通过通知信息id获取项目登记对象

+ 116 - 0
src/main/resources/mappings/modules/constructionContract/contractDao.xml

@@ -268,4 +268,120 @@
 				a.project_name AS "projectName"
 		from rural_project_records a where a.id=#{projectId} and a.del_flag=0
 	</select>
+
+	<select id="getProjectFollowReportInfo" resultType="ProjectFollowReportInfo">
+		select
+		  a.id AS "id",
+		  a.create_by AS "createBy.id",
+		  a.create_date AS "createDate",
+		  a.update_by AS "updateBy.id",
+		  a.update_date AS "updateDate",
+		  a.remarks AS "remarks",
+		  a.del_flag AS "delFlag",
+		  a.follow_id as "followId",
+		  a.process_instance_id as "processInstanceId",
+		  a.report_status as "reportStatus",
+		  a.report_date  as "reportDate"
+		from
+		  sj_project_report_info a
+		where a.follow_id = #{followId}
+		and a.del_flag = 0
+		limit 1
+	</select>
+
+	<select id="getProjectFollowArchiveInfo" resultType="ProjectFollowArchiveInfo">
+		select
+		  a.id AS "id",
+		  a.create_by AS "createBy.id",
+		  a.create_date AS "createDate",
+		  a.update_by AS "updateBy.id",
+		  a.update_date AS "updateDate",
+		  a.remarks AS "remarks",
+		  a.del_flag AS "delFlag",
+		  a.follow_id as "followId",
+		  a.process_instance_id as "processInstanceId",
+		  a.archive_status as "archiveStatus",
+		  a.archive_date  as "archiveDate"
+		from
+		  sj_project_archive_info a
+		where a.follow_id = #{followId}
+		and a.del_flag = 0
+		limit 1
+	</select>
+
+	<update id="updateReportInfo">
+		update
+  			sj_project_report_info
+		set
+		  update_by = #{updateBy.id},
+		  update_date = #{updateDate},
+		  report_status = #{reportStatus}
+		where id = #{id} ;
+	</update>
+
+	<insert id="insertReportInfo">
+		insert into sj_project_report_info (
+		  id,
+		  create_by,
+		  create_date,
+		  update_by,
+		  update_date,
+		  remarks,
+		  del_flag,
+		  follow_id,
+		  process_instance_id,
+		  report_status
+		)
+		values
+		  (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{followId},
+			#{processInstanceId},
+			#{reportStatus}
+		  ) ;
+	</insert>
+
+	<update id="updateArchiveInfo">
+		update
+  			sj_project_archive_info
+		set
+		  update_by = #{updateBy.id},
+		  update_date = #{updateDate},
+		  archive_status = #{archiveStatus}
+		where id = #{id} ;
+	</update>
+
+	<insert id="insertArchiveInfo">
+		insert into sj_project_archive_info (
+		  id,
+		  create_by,
+		  create_date,
+		  update_by,
+		  update_date,
+		  remarks,
+		  del_flag,
+		  follow_id,
+		  process_instance_id,
+		  archive_status
+		)
+		values
+		  (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{followId},
+			#{processInstanceId},
+			#{archiveStatus}
+		  ) ;
+	</insert>
 </mapper>

+ 105 - 2
src/main/resources/mappings/modules/projectrecord/ProjectFollowReport/ProjectFollowReport.xml

@@ -43,8 +43,17 @@
 		a.create_date AS "createDate",
 		a.update_by AS "updateBy.id",
 		a.update_date AS "updateDate"
+		,a.project_content_data_new_id AS "projectContentDataNewId"
+        ,ifnull(spri.report_status,"0") as "overAllReportStatus"
+        ,spri.process_instance_id as "reportProcessInstanceId"
+        ,spri.id as "reportId"
+        ,ifnull(spai.archive_status,"0") as "overAllArchiveStatus"
+        ,spai.process_instance_id as "archiveProcessInstanceId"
+        ,spai.id as "archiveId"
         FROM sj_project_registration a
                  LEFT JOIN sys_user su ON su.id = a.create_by
+        LEFT JOIN sj_project_report_info spri on spri.follow_id =  a.id
+        LEFT JOIN sj_project_archive_info spai on spai.follow_id =  a.id
         WHERE a.id = #{id}
     </select>
 
@@ -77,7 +86,14 @@
         a.status as "status",
         a.process_instance_id as "processInstanceId",
         a.bzshb_user_id as "bzshbUserId"
+        ,a.project_content_data_new_id as "projectContentDataNewId"
+        ,ifnull(spri.report_status,"0") as "overAllReportStatus"
+        ,spri.process_instance_id as "reportProcessInstanceId"
+        ,ifnull(spai.archive_status,"0") as "overAllArchiveStatus"
+        ,spai.process_instance_id as "archiveProcessInstanceId"
         FROM sj_project_registration a
+        LEFT JOIN sj_project_report_info spri on spri.follow_id =  a.id
+        LEFT JOIN sj_project_archive_info spai on spai.follow_id =  a.id
         <where>
             a.projectId = #{projectId}
         </where>
@@ -138,7 +154,8 @@
          projectFollowName,
          status,
          projectId,
-         bzshb_user_id)
+         bzshb_user_id,
+         project_content_data_new_id)
         VALUES (#{id},
                 #{createBy.id},
                 #{createDate},
@@ -149,7 +166,8 @@
                 #{projectFollowName},
                 #{status},
                 #{project.id},
-                #{bzshbUserId})
+                #{bzshbUserId},
+                #{projectContentDataNewId})
     </insert>
 
     <update id="update">
@@ -189,4 +207,89 @@
         WHERE id = #{id}
     </update>
 
+    <update id="updateReportProcessIdAndStatus" >
+        UPDATE  sj_project_report_info SET
+          process_instance_id = #{processInstanceId},
+          report_status = #{reportStatus}
+        WHERE id = #{id}
+    </update>
+
+    <update id="updateArchiveProcessIdAndStatus" >
+        UPDATE  sj_project_archive_info SET
+          process_instance_id = #{processInstanceId},
+          archive_status = #{archiveStatus}
+        WHERE id = #{id}
+    </update>
+
+    <select id="getReportFollowById" resultType="ProjectFollowReport">
+        SELECT
+        a.id,
+        a.projectFollowId,
+        a.projectFollowName,
+        a.projectId as `project.id`,
+        a.create_by AS "createBy.id",
+        a.create_date AS "createDate",
+        a.status as "status",
+        a.process_instance_id as "processInstanceId",
+        a.bzshb_user_id as "bzshbUserId"
+        ,a.project_content_data_new_id as "projectContentDataNewId"
+        ,ifnull(spri.report_status,"0") as "overAllReportStatus"
+        ,spri.process_instance_id as "reportProcessInstanceId"
+        ,ifnull(spai.archive_status,"0") as "overAllArchiveStatus"
+        ,spai.process_instance_id as "archiveProcessInstanceId"
+        FROM sj_project_registration a
+        LEFT JOIN sj_project_report_info spri on spri.follow_id =  a.id
+        LEFT JOIN sj_project_archive_info spai on spai.follow_id =  a.id
+        where
+            spri.id = #{id}
+    </select>
+
+    <select id="getReportFollowByArchiveId" resultType="ProjectFollowReport">
+        SELECT
+        a.id,
+        a.projectFollowId,
+        a.projectFollowName,
+        a.projectId as `project.id`,
+        a.create_by AS "createBy.id",
+        a.create_date AS "createDate",
+        a.status as "status",
+        a.process_instance_id as "processInstanceId",
+        a.bzshb_user_id as "bzshbUserId"
+        ,a.project_content_data_new_id as "projectContentDataNewId"
+        ,ifnull(spri.report_status,"0") as "overAllReportStatus"
+        ,spri.process_instance_id as "reportProcessInstanceId"
+        ,ifnull(spai.archive_status,"0") as "overAllArchiveStatus"
+        ,spai.process_instance_id as "archiveProcessInstanceId"
+        FROM sj_project_registration a
+        LEFT JOIN sj_project_report_info spri on spri.follow_id =  a.id
+        LEFT JOIN sj_project_archive_info spai on spai.follow_id =  a.id
+        where
+            spai.id = #{id}
+    </select>
+
+    <update id="updateReport">
+        UPDATE  sj_project_report_info SET
+          process_instance_id = #{reportProcessInstanceId},
+          report_status = #{overAllReportStatus}
+        WHERE follow_id = #{id}
+    </update>
+
+    <update id="updateArchive">
+        UPDATE  sj_project_archive_info SET
+          process_instance_id = #{archiveProcessInstanceId},
+          archive_status = #{overAllArchiveStatus}
+        WHERE follow_id = #{id}
+    </update>
+
+    <delete id="deleteReport">
+        DELETE
+        FROM sj_project_report_info
+        WHERE follow_id = #{id}
+    </delete>
+
+    <delete id="deleteArchive">
+        DELETE
+        FROM sj_project_archive_info
+        WHERE follow_id = #{id}
+    </delete>
 </mapper>

+ 14 - 14
src/main/resources/mappings/modules/projectreportnum/ProjectReportNumDao.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jeeplus.modules.projectreportnum.dao.ProjectReportNumDao">
-    
+
 	<sql id="infoColums">
 		a.id AS "id",
 		a.create_by AS "createBy.id",
@@ -15,20 +15,20 @@
 		a.parent_id as "parentId",
 		a.project_id as "projectId"
 	</sql>
-	
-    
+
+
 	<select id="get" resultType="ReportNum" >
-		SELECT 
+		SELECT
 			<include refid="infoColums"/>
 		FROM report_num a
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="ReportNum" >
-		SELECT 
+		SELECT
 			<include refid="infoColums"/>
 		FROM report_num a
-		
+
 		<where>
 			a.del_flag = #{DEL_FLAG_NORMAL} and a.state = '0' and a.create_by = #{userId}
 		</where>
@@ -58,9 +58,9 @@
 			create_by = #{userId} and state = '0' and num like concat(#{num},'%') and num != #{num}
 		</where>
 	</select>
-	
-	
-	
+
+
+
 	<insert id="insert">
 		INSERT INTO report_num(
 			id,
@@ -88,14 +88,14 @@
 			#{projectId}
 		)
 	</insert>
-	
+
 	<update id="updateNum">
 		UPDATE report_num SET
 			state = '1'
 		WHERE num = #{num}
 	</update>
-	
-	
+
+
 	<!--物理删除-->
 	<update id="delete">
 		DELETE FROM report_num
@@ -154,4 +154,4 @@
 	</select>
 
 
-</mapper>
+</mapper>

+ 188 - 4
src/main/webapp/webpage/modules/ProjectFollowReport/ProjectFollowReportList.jsp

@@ -439,7 +439,31 @@
 								return '';
 							}
 						}},
-					{templet: complain, align:'center', title: '操作',width:130}
+					{align:'center', title: '质量复核',  width:70,templet:function(d){
+							if(d.pid !=0){
+								var st = getAuditState(""+d.overAllReportStatus);
+								if(st.action)
+									var xml = "<span onclick=\"openDialogListView('流程追踪', '${ctx}/follow/follow/getReportProcess?id=" + d.id + "','"+d.id+"','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+								else
+									var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+								return xml;
+							}else{
+								return '';
+							}
+						}},
+					{align:'center', title: '归档',  width:70,templet:function(d){
+							if(d.pid !=0){
+								var st = getAuditState(""+d.overAllArchiveStatus);
+								if(st.action)
+									var xml = "<span onclick=\"openDialogListView('流程追踪', '${ctx}/followArchive/followArchive/getProcess?id=" + d.id + "','"+d.id+"','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+								else
+									var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+								return xml;
+							}else{
+								return '';
+							}
+						}},
+					{templet: complain, align:'center', title: '操作',width:260}
 				]],
 				done: function () {
 					layer.closeAll('loading');
@@ -510,9 +534,60 @@
 							+'</div>'
 						].join('');
 					}else if(d.status == 5){
-						return [
+						var xml = '<div class=\"layui-btn-group\">';
+						if(d.overAllReportStatus == 1){
+								xml +=
+								'<a href="javascript:void(0)" onclick="openDialogreReportAudit(\'修改跟踪咨询报告内容质量复核\', \'${ctx}/follow/follow/followReportForm?id='+d.id+'&project.id='+d.pid+ '\',\'95%\',\'95%\')" class="layui-btn layui-btn-xs layui-btn-green" >  编辑质量复核</a>'
+							xml +='<a href="${ctx}/follow/follow/deleteFollow?project.id='+d.pid+'&id='+d.id+'" onclick="return confirmxRefresh(\'确认要删除该跟踪咨询报告质量复核吗?\', this.href)"   class="layui-btn layui-btn-xs layui-bg-red"> 删除质量复核</a>'
 
-						].join('');
+
+						}else if(d.overAllReportStatus == 2){
+								xml +=
+								'<a href="${ctx}/follow/follow/revoke?id='+d.id+'&processInstanceId='+d.processInstanceId+'" onclick="return confirmx(\'确认要撤回该跟踪咨询报告质量复核吗?\', this.href)"   class="layui-btn layui-btn-xs layui-bg-blue">撤回质量复核</a>'
+
+						}else if(d.overAllReportStatus == 3){
+								xml +=
+								'<a href="javascript:void(0)" onclick="openDialogreModify(\'修改跟踪咨询报告内容质量复核\', \'${ctx}/follow/follow/followReportForm?id='+d.id+'&project.id='+d.pid+ '\',\'95%\',\'95%\')" class="layui-btn layui-btn-xs" >编辑质量复核</a>'
+							xml +='<a href="${ctx}/follow/follow/deleteFollow?project.id='+d.pid+'&id='+d.id+'" onclick="return confirmxRefresh(\'确认要删除该跟踪咨询报告质量复核吗?\', this.href)"   class="layui-btn layui-btn-xs layui-bg-red"> 删除质量复核</a>'
+
+
+						}else if(d.overAllReportStatus == 4){
+								xml +=
+								'<a href="javascript:void(0)" onclick="openDialogreModify(\'修改跟踪咨询报告质量复核\', \'${ctx}/follow/follow/modify?id='+d.id+'&project.id='+d.pid+ '\',\'95%\',\'95%\')" class="layui-btn layui-btn-xs" > 编辑质量复核</a>'
+							xml +='<a href="${ctx}/follow/follow/deleteFollow?project.id='+d.pid+'&id='+d.id+'" onclick="return confirmxRefresh(\'确认要删除该跟踪咨询报告质量复核吗?\', this.href)"   class="layui-btn layui-btn-xs layui-bg-red"> 删除质量复核</a>'
+
+						}else if(d.overAllReportStatus == 0){
+								xml +=
+								'<a href="javascript:void(0)" onclick="openDialogreReportAudit(\'新增跟踪咨询质量复核\', \'${ctx}/follow/follow/followReportForm?id='+d.id+'&project.id='+d.pid+'\',\'95%\',\'95%\')" class="layui-btn layui-btn-xs layui-bg-blue" > 新增质量复核</a>'
+
+						}
+
+						if(d.overAllArchiveStatus == 1){
+								xml +=
+								'<a href="javascript:void(0)" onclick="openDialogreArchiveAudit(\'修改跟踪咨询报告内容归档信息\', \'${ctx}/followArchive/followArchive/followArchiveForm?id='+d.id+'&project.id='+d.pid+ '\',\'95%\',\'95%\')" class="layui-btn layui-btn-xs layui-btn-green" >  编辑归档信息</a>'
+							xml +='<a href="${ctx}/followArchive/followArchive/deleteFollow?project.id='+d.pid+'&id='+d.id+'" onclick="return confirmxRefresh(\'确认要删除该跟踪咨询报告归档信息吗?\', this.href)"   class="layui-btn layui-btn-xs layui-bg-red"> 删除归档信息</a>'
+
+						}else if(d.overAllArchiveStatus == 2){
+								xml +=
+								'<a href="${ctx}/followArchive/followArchive/revoke?id='+d.id+'&processInstanceId='+d.processInstanceId+'" onclick="return confirmx(\'确认要撤回该跟踪咨询报告归档信息吗?\', this.href)"   class="layui-btn layui-btn-xs layui-bg-blue">撤回归档信息</a>'
+
+						}else if(d.overAllArchiveStatus == 3){
+								xml +=
+								'<a href="javascript:void(0)" onclick="openDialogreModify(\'修改跟踪咨询报告内容归档信息\', \'${ctx}/followArchive/followArchive/followArchiveForm?id='+d.id+'&project.id='+d.pid+ '\',\'95%\',\'95%\')" class="layui-btn layui-btn-xs" >编辑归档信息</a>'
+							xml +='<a href="${ctx}/followArchive/followArchive/deleteFollow?project.id='+d.pid+'&id='+d.id+'" onclick="return confirmxRefresh(\'确认要删除该跟踪咨询报告归档信息吗?\', this.href)"   class="layui-btn layui-btn-xs layui-bg-red"> 删除归档信息</a>'
+
+						}else if(d.overAllArchiveStatus == 4){
+								xml +=
+								'<a href="javascript:void(0)" onclick="openDialogreModify(\'修改跟踪咨询报告归档信息\', \'${ctx}/followArchive/followArchive/modify?id='+d.id+'&project.id='+d.pid+ '\',\'95%\',\'95%\')" class="layui-btn layui-btn-xs" > 编辑归档信息</a>'
+							xml +='<a href="${ctx}/followArchive/followArchive/deleteFollow?project.id='+d.pid+'&id='+d.id+'" onclick="return confirmxRefresh(\'确认要删除该跟踪咨询报告质量复核吗?\', this.href)"   class="layui-btn layui-btn-xs layui-bg-red"> 删除归档信息</a>'
+
+						}else if(d.overAllArchiveStatus == 0){
+								xml +=
+								'<a href="javascript:void(0)" onclick="openDialogreArchiveAudit(\'新增跟踪咨询归档\', \'${ctx}/followArchive/followArchive/followArchiveForm?id='+d.id+'&project.id='+d.pid+'\',\'95%\',\'95%\')" class="layui-btn layui-btn-xs layui-bg-blue" > 新增归档</a>'
+
+						}
+						xml += '</div>'
+						return[xml].join('');
 					}else{
 						return[''].join('');
 					}
@@ -649,6 +724,115 @@
 			}
 		});
 	}
+	function openDialogreReportAudit(title,url,width,height,target){
+
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin: 'three-btns',
+			maxmin: true, //开启最大化最小化按钮
+			content: url ,
+			btn: ['提交','暂存','关闭'],
+			btn1: function(index, layero){
+				var body = top.layer.getChildFrame('body', index);
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var inputForm = body.find('#inputForm');
+				var top_iframe;
+				if(target){
+					top_iframe = target;//如果指定了iframe,则在改frame中跳转
+				}else{
+					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+				}
+				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+				if(iframeWin.contentWindow.doSubmit(1) ){
+					top.layer.close(index);//关闭对话框。
+					setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+				}
+			},
+			btn2: function(index, layero){
+				var body = top.layer.getChildFrame('body', index);
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var inputForm = body.find('#inputForm');
+				var top_iframe;
+				if(target){
+					top_iframe = target;//如果指定了iframe,则在改frame中跳转
+				}else{
+					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+				}
+				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+				inputForm.attr("action","${ctx}/follow/follow/storFollowReport")
+				if(iframeWin.contentWindow.doSubmit(2) ){
+					top.layer.close(index);//关闭对话框。
+					setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+				}
+				return false;
+			},
+			btn3: function(index){
+			}
+		});
+	}
+
+	function openDialogreArchiveAudit(title,url,width,height,target){
+
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin: 'three-btns',
+			maxmin: true, //开启最大化最小化按钮
+			content: url ,
+			btn: ['提交','暂存','关闭'],
+			btn1: function(index, layero){
+				var body = top.layer.getChildFrame('body', index);
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var inputForm = body.find('#inputForm');
+				var top_iframe;
+				if(target){
+					top_iframe = target;//如果指定了iframe,则在改frame中跳转
+				}else{
+					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+				}
+				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+				if(iframeWin.contentWindow.doSubmit(1) ){
+					top.layer.close(index);//关闭对话框。
+					setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+				}
+			},
+			btn2: function(index, layero){
+				var body = top.layer.getChildFrame('body', index);
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var inputForm = body.find('#inputForm');
+				var top_iframe;
+				if(target){
+					top_iframe = target;//如果指定了iframe,则在改frame中跳转
+				}else{
+					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+				}
+				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+				inputForm.attr("action","${ctx}/followArchive/followArchive/storFollow")
+				if(iframeWin.contentWindow.doSubmit(2) ){
+					top.layer.close(index);//关闭对话框。
+					setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+				}
+				return false;
+			},
+			btn3: function(index){
+			}
+		});
+	}
 	function openDialogreModify(title,url,width,height,target){
 
 		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
@@ -714,4 +898,4 @@
 	}
 </script>
 </body>
-</html>
+</html>

+ 18 - 6
src/main/webapp/webpage/modules/projectConstruction/projectConstructionForm.jsp

@@ -290,14 +290,14 @@
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label"><span class="require-item">*</span>签约日期:</label>
                     <div class="layui-input-block">
-                        <input id="signDate" name="signDate" type="text" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon required"
+                        <input id="signDate" name="signDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon required"
                                value="<fmt:formatDate value="${constructionContract.signDate}" pattern="yyyy-MM-dd"/>"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label">生效日期:</label>
                     <div class="layui-input-block">
-                        <input id="effectDate" name="effectDate" type="text" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon "
+                        <input id="effectDate" name="effectDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon "
                                value="<fmt:formatDate value="${constructionContract.effectDate}" pattern="yyyy-MM-dd"/>"/>
                     </div>
                 </div>
@@ -322,14 +322,14 @@
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label"><span class="require-item">*</span>合同开工日期:</label>
                     <div class="layui-input-block">
-                        <input id="startWorkDate" name="startWorkDate" type="text" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon required"
+                        <input id="startWorkDate" name="startWorkDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon required"
                                value="<fmt:formatDate value="${constructionContract.startWorkDate}" pattern="yyyy-MM-dd"/>"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label">合同竣工日期:</label>
                     <div class="layui-input-block">
-                        <input id="endWorkDate" name="endWorkDate" type="text" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon "
+                        <input id="endWorkDate" name="endWorkDate" type="text" maxlength="20" readonly="readonly" class="laydate-icondate form-control layui-input layer-date laydate-icon "
                                value="<fmt:formatDate value="${constructionContract.endWorkDate}" pattern="yyyy-MM-dd"/>"/>
                     </div>
                 </div>
@@ -372,14 +372,14 @@
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label">开始日期:</label>
                     <div class="layui-input-block">
-                        <input id="startDate" name="startDate" type="text" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon "
+                        <input id="startDate" name="startDate" type="text" maxlength="20" readonly="readonly" class="laydate-icondate form-control layui-input layer-date laydate-icon "
                                value="<fmt:formatDate value="${constructionContract.startDate}" pattern="yyyy-MM-dd"/>"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label">结束日期:</label>
                     <div class="layui-input-block">
-                        <input id="endDate" name="endDate" type="text" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon "
+                        <input id="endDate" name="endDate" type="text" maxlength="20" readonly="readonly" class="laydate-icondate form-control layui-input layer-date laydate-icon "
                                value="<fmt:formatDate value="${constructionContract.endDate}" pattern="yyyy-MM-dd"/>"/>
                     </div>
                 </div>
@@ -514,26 +514,38 @@
         laydate.render({
             elem: '#signDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
             event: 'focus' //响应事件。如果没有传入event,则按照默认的click
+            ,type : 'datetime'
+            , trigger: 'click'
         });
         laydate.render({
             elem: '#effectDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
             event: 'focus' //响应事件。如果没有传入event,则按照默认的click
+            ,type : 'datetime'
+            , trigger: 'click'
         });
         laydate.render({
             elem: '#startWorkDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
             event: 'focus' //响应事件。如果没有传入event,则按照默认的click
+            ,type : 'datetime'
+            , trigger: 'click'
         });
         laydate.render({
             elem: '#endWorkDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
             event: 'focus' //响应事件。如果没有传入event,则按照默认的click
+            ,type : 'datetime'
+            , trigger: 'click'
         });
         laydate.render({
             elem: '#startDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
             event: 'focus' //响应事件。如果没有传入event,则按照默认的click
+            ,type : 'datetime'
+            , trigger: 'click'
         });
         laydate.render({
             elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
             event: 'focus' //响应事件。如果没有传入event,则按照默认的click
+            ,type : 'datetime'
+            , trigger: 'click'
         });
 
         /*var data = ${fns:toJson(workContentContractinfo.termList)};

Datei-Diff unterdrückt, da er zu groß ist
+ 1526 - 0
src/main/webapp/webpage/modules/projectrecord/follow/workFollowArchiveAudit.jsp


Datei-Diff unterdrückt, da er zu groß ist
+ 1566 - 0
src/main/webapp/webpage/modules/projectrecord/follow/workFollowArchiveForm.jsp


Datei-Diff unterdrückt, da er zu groß ist
+ 1560 - 0
src/main/webapp/webpage/modules/projectrecord/follow/workFollowArchiveModify.jsp


Datei-Diff unterdrückt, da er zu groß ist
+ 1526 - 0
src/main/webapp/webpage/modules/projectrecord/follow/workFollowReportAudit.jsp


Datei-Diff unterdrückt, da er zu groß ist
+ 1566 - 0
src/main/webapp/webpage/modules/projectrecord/follow/workFollowReportForm.jsp


Datei-Diff unterdrückt, da er zu groß ist
+ 1560 - 0
src/main/webapp/webpage/modules/projectrecord/follow/workFollowReportModify.jsp


+ 318 - 6
src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowAudit.jsp

@@ -5,6 +5,11 @@
 	<title>跟踪咨询报告详情管理</title>
 	<meta name="decorator" content="default"/>
     <script src="${ctxStatic}/layer-v2.3/layui/xmSelect.js" charset="utf-8"></script>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+    <link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
+    <script src="${ctxStatic}/common/html/js/script.js"></script>
+    <%@include file="/webpage/include/treetable.jsp" %>
     <style>
         #projectContentDataType-error{
             left:0;
@@ -200,7 +205,7 @@
             $(prefix+"_file").val(123)
         }
 
-        
+
         function changeContentDetail(obj) {
             var val = $(obj).val();
             var modify = $("#modify").val();
@@ -555,6 +560,172 @@
             }
 
         }
+        $(document).ready(function() {
+            $(".tabMove").mouseover(function(){
+                //tips层-下
+                var td=$(this)
+                var tdval=$(this).find("input").val();
+                layer.tips(tdval, td, {
+                    tips: 3
+                });
+            })
+        })
+
+        function listTr(obj){
+            var name=$(obj).attr("id");
+            var tiao="."+name;
+            var span=$(obj).find("td").eq(2);
+            // var ss=$(span).val().split(" ")[4];
+            $(span).toggle(function () {
+                $(tiao).hide();
+                $(span).find("span").eq(0).attr("class","default_shut")
+            },function () {
+                $(tiao).show();
+                $(span).find("span").eq(0).attr("class","default_open")
+            });
+        }
+
+        function setValuee(obj){
+
+            for(var i=0;i<obj.length;i++){
+                var projectContentDataNewId = $("#projectContentDataNewId").val();
+
+                $.ajax({
+                    type : "POST",
+                    url : "${ctx}/projectcontentinfo/projectBasedData/saveBasedIdAndContentId",
+                    data : {
+                        "contentId":projectContentDataNewId,"basedId":obj[i].id
+                    },
+                    //请求成功
+                    success:function(data) {
+                        //刷新当前模块
+                        var reviewFee = $("#reviewFee").val();
+                        var url = location.href;
+                        if(url.charAt(url.length-1)=="#"){
+                            url = url.substring(0,url.length-1)
+                        }
+                        $("#upTable1").load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #upTable1");
+                    }
+                });
+            }
+        }
+        function openBill2(title,url,width,height,target,formId,tableId){
+            var rows = $(this).parent().prevAll().length + 1;
+            var frameIndex = parent.layer.getFrameIndex(window.name);
+            var urls = url+"&index="+frameIndex;
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                skin:"two-btns",
+                maxmin: false, //开启最大化最小化按钮
+                content: urls ,
+                btn: ['确定','关闭'],
+                yes: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    inputForm.attr("action","${ctx}/projectAccessory/projectAccessory/saveWorkAttachmentOverAll");//表单提交成功后,从服务器返回的url在当前tab中展示
+                    var $document = iframeWin.contentWindow.document;
+
+                    formSubmit2($document,formId,index,tableId);
+
+                },
+                cancel: function(index){
+                },
+                end:function () {
+                    var reviewFee = $("#reviewFee").val();
+                    var projectContentDataNewId = $("#projectContentDataNewId").val();
+                    var url = location.href;
+                    if(url.charAt(url.length-1)=="#"){
+                        url = url.substring(0,url.length-1)
+                    }
+                    $("#"+tableId).load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #"+tableId);
+                }
+            });
+        }
+        function formSubmit2($document,inputForm,index,tableId){
+
+            var validateForm = $($document.getElementById(inputForm)).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                var action = $document.getElementById(inputForm).action;
+                var handleInfo = $($document.getElementById(inputForm)).serialize();
+                $.ajax({
+                    type : "POST",
+                    url : action,
+                    data : handleInfo,
+                    //请求成功
+                    success:function(data) {
+                        var d = data;
+                        //输出提示信息
+                        if(d.str.length>0){
+                            parent.layer.msg(d.str,{icon:1});
+                        }
+                        //刷新当前模块
+                        var reviewFee = $("#reviewFee").val();
+                        var projectContentDataNewId = $("#projectContentDataNewId").val();
+                        var url = location.href;
+                        if(url.charAt(url.length-1)=="#"){
+                            url = url.substring(0,url.length-1)
+                        }
+                        $("#"+tableId).load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #"+tableId);
+                        //关闭当前页
+                        top.layer.close(index)
+                    }
+                });
+            }
+        }
+        function setAchievementValuee(obj){
+
+            for(var i=0;i<obj.length;i++){
+                var projectContentDataNewId = $("#projectContentDataNewId").val();
+
+                $.ajax({
+                    type : "POST",
+                    url : "${ctx}/projectcontentinfo/projectBasedData/saveAchievementIdAndContentId",
+                    data : {
+                        "contentId":projectContentDataNewId,"basedId":obj[i].id
+                    },
+                    //请求成功
+                    success:function(data) {
+                        //刷新当前模块
+                        var reviewFee = $("#reviewFee").val();
+                        var url = location.href;
+                        if(url.charAt(url.length-1)=="#"){
+                            url = url.substring(0,url.length-1)
+                        }
+                        $("#upTable").load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #upTable");
+                    }
+                });
+            }
+        }
     </script>
 </head>
 <body>
@@ -615,8 +786,149 @@
                     <div id="contentDetail"></div>
                 </div>
             </div>
+
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>依据性资料明细</h2></div>
+                <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                    <table id="upTable1" class="table table-bordered table-condensed tree_table">
+                        <thead>
+                        <tr>
+                            <th width="200px">资料名称</th>
+                            <th width="200px">资料类别</th>
+                            <th width="200px">资料性质</th>
+                            <th width="35%">资料内容</th>
+                            <th width="160px">上传人</th>
+                            <th width="160px">上传日期</th>
+                            <th width="120px">文件大小(M)</th>
+                            <th width="100px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="overAllFile_attachment">
+                        <c:forEach items="${projectFollowReport.overAllFileGistdataList}" var = "fileAttachment" varStatus="status">
+                            <tr id="file_attachment_${fileAttachment.id}_tr_fu" onclick="listTr(this)">
+                                <td style="display:none"><span class="faid">${fileAttachment.id}</span></td>
+                                <td style="display:none">${fileAttachment.mustFlag}</td>
+                                <td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span>${fileAttachment.name}<input type="hidden" value="${fileAttachment.name}"/></td>
+                                <td style="white-space:normal; word-break:break-all;overflow:hidden;">${fileAttachment.attachName}</td>
+                                <td>
+                                    <div style="white-space:normal; word-break:break-all;overflow:hidden;">  ${fileAttachment.attachTypes}</div>
+                                </td>
+                                <td></td>
+                                <td></td>
+                                <td></td>
+                                <td></td>
+                                <td></td>
+                                <td style="display:none">${fileAttachment.fileFlag}</td>
+
+                            </tr>
+                            <c:forEach items="${fileAttachment.workAttachments}" var = "workClientAttachment" varStatus="status">
+                                <tr class="file_attachment_${fileAttachment.id}_tr_fu">
+                                    <td></td>
+                                    <td></td>
+                                    <td></td>
+                                    <c:choose>
+                                        <c:when test="${projectFollowReport.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                    <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${fn:containsIgnoreCase(fileOther.attachName,'rar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                    <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${fn:containsIgnoreCase(fileOther.attachName,'rar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:otherwise>
+                                    </c:choose>
+                                    <td class="op-td" style="white-space:normal; word-break:break-all;overflow:hidden;" onclick="readOpenInfo('${workClientAttachment.createName}')">${workClientAttachment.createName}</td>
+
+                                    <td class="op-td" style="text-align:center;">
+                                        <fmt:formatDate value="${workClientAttachment.createDate}" type="date"/>
+                                    </td>
+
+                                    <td class="op-td">${workClientAttachment.fileSize}</td>
+                                    <td class="op-td">
+                                        <div class="op-btn-box" >
+                                                <%--附件下载删除--%>
+                                            <c:choose>
+                                                <c:when test="${projectFollowReport.uploadMode == 2}">
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                </c:otherwise>
+                                            </c:choose>
+
+                                                <%--											<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${fileAttachment.id}&projectId=${project.id}','70%','80%',false,'inputForm','upTable',this)" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>--%>
+                                        </div>
+                                    </td>
+                                </tr>
+                            </c:forEach>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+
+            <%--<div class="form-group layui-row">
+                <div class="form-group-label"><h2>依据性资料明细</h2></div>
                 <div class="layui-item layui-col-xs12 form-table-container">
                     <table id="contentTableBase" class="table table-bordered table-condensed details">
                         <thead>
@@ -655,7 +967,7 @@
                         </tbody>
                     </table>
                 </div>
-            </div>
+            </div>--%>
             <script type="text/template" id="workBaseDataTpl">//<!--
                 <tr id="budgetList{{idx}}">
                     <td class="hide">
@@ -687,7 +999,7 @@
             <script type="text/javascript">
                 var workBaseDataTpl = $("#workBaseDataTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                 var workBaseDataRowIdx = ${fn:length(projectcontentinfo.projectReportData.projectBasedDataList)};
-                function setValuee(obj){
+                /*function setValuee(obj){
                     for(var i=0;i<obj.length;i++){
                         var idArr = $("#workBaseDataList tr:visible .clientId");
                         if(obj[i].id!=''&&!hasInArr(obj[i].id,idArr)){
@@ -695,7 +1007,7 @@
                             workBaseDataRowIdx=workBaseDataRowIdx+1;
                         }
                     }
-                }
+                }*/
                 function hasInArr(id,idArr) {
                     for(var i=0;i<idArr.length;i++){
                         if(id==$(idArr[i]).val()){
@@ -981,7 +1293,7 @@
         data: [
         ]
     })
-    
+
     function getExistingDataOnPath(val) {
         switch (val){
             case '22':
@@ -1211,4 +1523,4 @@
     }
 </script>
 </body>
-</html>
+</html>

+ 374 - 7
src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowForm.jsp

@@ -5,7 +5,11 @@
 	<title>跟踪咨询报告详情管理</title>
 	<meta name="decorator" content="default"/>
     <script src="${ctxStatic}/layer-v2.3/layui/xmSelect.js" charset="utf-8"></script>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+    <link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
     <script src="${ctxStatic}/common/html/js/script.js"></script>
+    <%@include file="/webpage/include/treetable.jsp" %>
     <style>
         #projectContentDataType-error{
             left:0;
@@ -41,7 +45,7 @@
                         parent.layer.msg("请选择审核人员!", {icon: 5});
                         return false;
                     }
-                    var length = document.getElementById("workBaseDataList");
+                    /*var length = document.getElementById("workBaseDataList");
                     var rows = length.rows.length;
                     var idList = [];
                     for (var i=0;i<rows;i++){
@@ -53,7 +57,7 @@
                                 return false;
                             }
                         }
-                    }
+                    }*/
                     var flags=judgment();
                     if (!flags){
                         return flags;
@@ -123,7 +127,7 @@
         });
 
 
-        function openDialogre(title,url,width,height,formId){
+        function openDialogre(title,url,width,height,formId,upTable1){
 
             if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
                 width='auto';
@@ -146,12 +150,57 @@
                     var top_iframe;
                     inputForm.attr("action","${ctx}/projectcontentinfo/projectcontentinfo/ajaxsaveBaseData");//表单提交成功后,从服务器返回的url在当前tab中展示
                     var $document = iframeWin.contentWindow.document;
-                    formSubmitAjax($document,formId,index);
+                    formSubmitAjax2($document,formId,index,upTable1);
                 },
                 btn2: function(index){
                 }
             });
         }
+        function formSubmitAjax2($document,inputForm,index,tableId){
+
+            var validateForm = $($document.getElementById(inputForm)).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                var action = $document.getElementById(inputForm).action;
+                var handleInfo = $($document.getElementById(inputForm)).serialize();
+                $.ajax({
+                    type : "POST",
+                    url : action,
+                    data : handleInfo,
+                    //请求成功
+                    success:function(data) {
+                        var d = data;
+                        //输出提示信息
+                        if(d.msg.length>0){
+                            parent.layer.msg(d.msg,{icon:1});
+                        }
+                        //刷新当前模块
+                        var reviewFee = $("#reviewFee").val();
+                        var projectContentDataNewId = $("#projectContentDataNewId").val();
+                        var url = location.href;
+                        if(url.charAt(url.length-1)=="#"){
+                            url = url.substring(0,url.length-1)
+                        }
+                        $("#"+tableId).load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #"+tableId);
+                        //关闭当前页
+                        top.layer.close(index)
+                    }
+                });
+            }
+        }
 
         function formSubmitAjax($document,inputForm,index){
             var validateForm = $($document.getElementById(inputForm)).validate({
@@ -574,6 +623,172 @@
             }
 
         }
+
+        $(document).ready(function() {
+            $(".tabMove").mouseover(function(){
+                //tips层-下
+                var td=$(this)
+                var tdval=$(this).find("input").val();
+                layer.tips(tdval, td, {
+                    tips: 3
+                });
+            })
+        })
+
+        function listTr(obj){
+            var name=$(obj).attr("id");
+            var tiao="."+name;
+            var span=$(obj).find("td").eq(2);
+            // var ss=$(span).val().split(" ")[4];
+            $(span).toggle(function () {
+                $(tiao).hide();
+                $(span).find("span").eq(0).attr("class","default_shut")
+            },function () {
+                $(tiao).show();
+                $(span).find("span").eq(0).attr("class","default_open")
+            });
+        }
+        function setValuee(obj){
+
+            for(var i=0;i<obj.length;i++){
+                var projectContentDataNewId = $("#projectContentDataNewId").val();
+
+                $.ajax({
+                    type : "POST",
+                    url : "${ctx}/projectcontentinfo/projectBasedData/saveBasedIdAndContentId",
+                    data : {
+                        "contentId":projectContentDataNewId,"basedId":obj[i].id
+                    },
+                    //请求成功
+                    success:function(data) {
+                        //刷新当前模块
+                        var reviewFee = $("#reviewFee").val();
+                        var url = location.href;
+                        if(url.charAt(url.length-1)=="#"){
+                            url = url.substring(0,url.length-1)
+                        }
+                        $("#upTable1").load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #upTable1");
+                    }
+                });
+            }
+        }
+        function openBill2(title,url,width,height,target,formId,tableId){
+            var rows = $(this).parent().prevAll().length + 1;
+            var frameIndex = parent.layer.getFrameIndex(window.name);
+            var urls = url+"&index="+frameIndex;
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                skin:"two-btns",
+                maxmin: false, //开启最大化最小化按钮
+                content: urls ,
+                btn: ['确定','关闭'],
+                yes: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    inputForm.attr("action","${ctx}/projectAccessory/projectAccessory/saveWorkAttachmentOverAll");//表单提交成功后,从服务器返回的url在当前tab中展示
+                    var $document = iframeWin.contentWindow.document;
+
+                    formSubmit2($document,formId,index,tableId);
+
+                },
+                cancel: function(index){
+                },
+                end:function () {
+                    var reviewFee = $("#reviewFee").val();
+                    var projectContentDataNewId = $("#projectContentDataNewId").val();
+                    var url = location.href;
+                    if(url.charAt(url.length-1)=="#"){
+                        url = url.substring(0,url.length-1)
+                    }
+                    $("#"+tableId).load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #"+tableId);
+                }
+            });
+        }
+        function formSubmit2($document,inputForm,index,tableId){
+
+            var validateForm = $($document.getElementById(inputForm)).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                var action = $document.getElementById(inputForm).action;
+                var handleInfo = $($document.getElementById(inputForm)).serialize();
+                $.ajax({
+                    type : "POST",
+                    url : action,
+                    data : handleInfo,
+                    //请求成功
+                    success:function(data) {
+                        var d = data;
+                        //输出提示信息
+                        if(d.str.length>0){
+                            parent.layer.msg(d.str,{icon:1});
+                        }
+                        //刷新当前模块
+                        var reviewFee = $("#reviewFee").val();
+                        var projectContentDataNewId = $("#projectContentDataNewId").val();
+                        var url = location.href;
+                        if(url.charAt(url.length-1)=="#"){
+                            url = url.substring(0,url.length-1)
+                        }
+                        $("#"+tableId).load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #"+tableId);
+                        //关闭当前页
+                        top.layer.close(index)
+                    }
+                });
+            }
+        }
+        function setAchievementValuee(obj){
+
+            for(var i=0;i<obj.length;i++){
+                var projectContentDataNewId = $("#projectContentDataNewId").val();
+
+                $.ajax({
+                    type : "POST",
+                    url : "${ctx}/projectcontentinfo/projectBasedData/saveAchievementIdAndContentId",
+                    data : {
+                        "contentId":projectContentDataNewId,"basedId":obj[i].id
+                    },
+                    //请求成功
+                    success:function(data) {
+                        //刷新当前模块
+                        var reviewFee = $("#reviewFee").val();
+                        var url = location.href;
+                        if(url.charAt(url.length-1)=="#"){
+                            url = url.substring(0,url.length-1)
+                        }
+                        $("#upTable").load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #upTable");
+                    }
+                });
+            }
+        }
     </script>
 </head>
 <body>
@@ -585,6 +800,7 @@
             <input type="hidden" id="contentDeta" name="projectContentData.contentDetail">
             <input type="hidden" id="dataBodyList" name="dataBodyList" value="">
             <input type="hidden" id="projectContentDataSign" name="projectContentDataSign" value="">
+            <input type="hidden" id="projectContentDataNewId" name="projectContentDataNewId" value="${projectFollowReport.projectContentDataNewId}">
             <input type="hidden" id="modify"  value="${modify}">
             <sys:message content="${message}"/>
             <div class="form-group layui-row first lw12">
@@ -638,9 +854,160 @@
                     <div id="contentDetail"></div>
                 </div>
             </div>
+
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>依据性资料明细</h2></div>
                 <div class="layui-item nav-btns">
+                    <a href="javascript:void(0)" onclick="openDialogre('新增依据性资料', '${ctx}/projectcontentinfo/projectcontentinfo/form?view=basedData&dictType=${projectFollowReport.dictType}&id=${projectFollowReport.id}&parentIds=${projectFollowReport.parentIds}&projectContentDataNewId=${projectFollowReport.projectContentDataNewId}&project.id=${projectFollowReport.project.id}','90%','90%','inputForm','upTable1')" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 新增</a>
+
+                    <sys:gridselectBaseData url="${ctx}/projectcontentinfo/projectBasedData/selectList" id="baseData" title="选择依据资料"
+                                            cssClass="form-control" projectId="${projectFollowReport.project.id}" fieldLabels="" fieldKeys=""  searchLabel="${fns:urlEncode('依据资料名称')}" searchKey="name"></sys:gridselectBaseData>
+                </div>
+                <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                    <table id="upTable1" class="table table-bordered table-condensed tree_table">
+                        <thead>
+                        <tr>
+                            <th width="200px">资料名称</th>
+                            <th width="200px">资料类别</th>
+                            <th width="200px">资料性质</th>
+                            <th width="35%">资料内容</th>
+                            <th width="160px">上传人</th>
+                            <th width="160px">上传日期</th>
+                            <th width="120px">文件大小(M)</th>
+                            <th width="100px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="overAllFile_attachment">
+                        <c:forEach items="${projectFollowReport.overAllFileGistdataList}" var = "fileAttachment" varStatus="status">
+                            <tr id="file_attachment_${fileAttachment.id}_tr_fu" onclick="listTr(this)">
+                                <td style="display:none"><span class="faid">${fileAttachment.id}</span></td>
+                                <td style="display:none">${fileAttachment.mustFlag}</td>
+                                <td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span>${fileAttachment.name}<input type="hidden" value="${fileAttachment.name}"/></td>
+                                <td style="white-space:normal; word-break:break-all;overflow:hidden;">${fileAttachment.attachName}</td>
+                                <td>
+                                    <div style="white-space:normal; word-break:break-all;overflow:hidden;">  ${fileAttachment.attachTypes}</div>
+                                </td>
+                                <td></td>
+                                <td></td>
+                                <td></td>
+                                <td></td>
+                                <td class="op-td">
+                                    <div class="op-btn-box" >
+                                        <a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/overAllWorkAttachmentForm?attachmentId=${fileAttachment.id}&projectId=${projectFollowReport.projectContentDataNewId}&uploadMode=${projectFollowReport.uploadMode}','70%','80%',false,'inputForm','upTable1')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+                                    </div>
+                                </td>
+                                <td style="display:none">${fileAttachment.fileFlag}</td>
+
+                            </tr>
+                            <c:forEach items="${fileAttachment.workAttachments}" var = "workClientAttachment" varStatus="status">
+                                <tr class="file_attachment_${fileAttachment.id}_tr_fu">
+                                    <td></td>
+                                    <td></td>
+                                    <td></td>
+                                    <c:choose>
+                                        <c:when test="${projectFollowReport.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                    <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${fn:containsIgnoreCase(fileOther.attachName,'rar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                    <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${fn:containsIgnoreCase(fileOther.attachName,'rar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:otherwise>
+                                    </c:choose>
+                                    <td class="op-td" style="white-space:normal; word-break:break-all;overflow:hidden;" onclick="readOpenInfo('${workClientAttachment.createName}')">${workClientAttachment.createName}</td>
+
+                                    <td class="op-td" style="text-align:center;">
+                                        <fmt:formatDate value="${workClientAttachment.createDate}" type="date"/>
+                                    </td>
+
+                                    <td class="op-td">${workClientAttachment.fileSize}</td>
+                                    <td class="op-td">
+                                        <div class="op-btn-box" >
+                                                <%--附件下载删除--%>
+                                            <c:choose>
+                                                <c:when test="${projectFollowReport.uploadMode == 2}">
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                </c:otherwise>
+                                            </c:choose>
+
+                                                <%--											<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${fileAttachment.id}&projectId=${project.id}','70%','80%',false,'inputForm','upTable',this)" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>--%>
+                                        </div>
+                                    </td>
+                                </tr>
+                            </c:forEach>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+
+            <%--<div class="form-group layui-row">
+                <div class="form-group-label"><h2>依据性资料明细</h2></div>
+                <div class="layui-item nav-btns">
                     <a href="javascript:void(0)" onclick="openDialogre('新增依据性资料', '${ctx}/projectcontentinfo/projectcontentinfo/form?view=basedData&dictType=${projectFollowReport.dictType}&id=${projectFollowReport.id}&parentIds=${projectFollowReport.parentIds}&project.id=${projectFollowReport.project.id}','90%','90%','inputForm')" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 新增</a>
 
                     <sys:gridselectBaseData url="${ctx}/projectcontentinfo/projectBasedData/selectList" id="baseData" title="选择依据资料"
@@ -689,7 +1056,7 @@
                         </tbody>
                     </table>
                 </div>
-            </div>
+            </div>--%>
             <script type="text/template" id="workBaseDataTpl">//<!--
                 <tr id="budgetList{{idx}}">
                     <td class="hide">
@@ -721,7 +1088,7 @@
             <script type="text/javascript">
                 var workBaseDataTpl = $("#workBaseDataTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                 var workBaseDataRowIdx = ${fn:length(projectcontentinfo.projectReportData.projectBasedDataList)};
-                function setValuee(obj){
+                /*function setValuee(obj){
                     for(var i=0;i<obj.length;i++){
                         var idArr = $("#workBaseDataList tr:visible .clientId");
                         if(obj[i].id!=''&&!hasInArr(obj[i].id,idArr)){
@@ -729,7 +1096,7 @@
                             workBaseDataRowIdx=workBaseDataRowIdx+1;
                         }
                     }
-                }
+                }*/
                 function hasInArr(id,idArr) {
                     for(var i=0;i<idArr.length;i++){
                         if(id==$(idArr[i]).val()){

+ 328 - 5
src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowModify.jsp

@@ -5,6 +5,11 @@
 	<title>跟踪咨询报告详情管理</title>
 	<meta name="decorator" content="default"/>
     <script src="${ctxStatic}/layer-v2.3/layui/xmSelect.js" charset="utf-8"></script>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+    <link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
+    <script src="${ctxStatic}/common/html/js/script.js"></script>
+    <%@include file="/webpage/include/treetable.jsp" %>
     <style>
         #projectContentDataType-error{
             left:0;
@@ -39,7 +44,7 @@
                     parent.layer.msg("请选择审核人员!", {icon: 5});
                     return false;
                 }*/
-                var length = document.getElementById("workBaseDataList");
+                /*var length = document.getElementById("workBaseDataList");
                 var rows = length.rows.length;
                 var idList = [];
                 for (var i=0;i<rows;i++){
@@ -51,7 +56,7 @@
                             return false;
                         }
                     }
-                }
+                }*/
 
                 beforeSubmit();
                 $("#inputForm").submit();
@@ -562,6 +567,173 @@
             }
 
         }
+
+        $(document).ready(function() {
+            $(".tabMove").mouseover(function(){
+                //tips层-下
+                var td=$(this)
+                var tdval=$(this).find("input").val();
+                layer.tips(tdval, td, {
+                    tips: 3
+                });
+            })
+        })
+
+        function listTr(obj){
+            var name=$(obj).attr("id");
+            var tiao="."+name;
+            var span=$(obj).find("td").eq(2);
+            // var ss=$(span).val().split(" ")[4];
+            $(span).toggle(function () {
+                $(tiao).hide();
+                $(span).find("span").eq(0).attr("class","default_shut")
+            },function () {
+                $(tiao).show();
+                $(span).find("span").eq(0).attr("class","default_open")
+            });
+        }
+
+        function setValuee(obj){
+
+            for(var i=0;i<obj.length;i++){
+                var projectContentDataNewId = $("#projectContentDataNewId").val();
+
+                $.ajax({
+                    type : "POST",
+                    url : "${ctx}/projectcontentinfo/projectBasedData/saveBasedIdAndContentId",
+                    data : {
+                        "contentId":projectContentDataNewId,"basedId":obj[i].id
+                    },
+                    //请求成功
+                    success:function(data) {
+                        //刷新当前模块
+                        var reviewFee = $("#reviewFee").val();
+                        var url = location.href;
+                        if(url.charAt(url.length-1)=="#"){
+                            url = url.substring(0,url.length-1)
+                        }
+                        $("#upTable1").load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #upTable1");
+                    }
+                });
+            }
+        }
+        function openBill2(title,url,width,height,target,formId,tableId){
+            var rows = $(this).parent().prevAll().length + 1;
+            var frameIndex = parent.layer.getFrameIndex(window.name);
+            var urls = url+"&index="+frameIndex;
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                skin:"two-btns",
+                maxmin: false, //开启最大化最小化按钮
+                content: urls ,
+                btn: ['确定','关闭'],
+                yes: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    inputForm.attr("action","${ctx}/projectAccessory/projectAccessory/saveWorkAttachmentOverAll");//表单提交成功后,从服务器返回的url在当前tab中展示
+                    var $document = iframeWin.contentWindow.document;
+
+                    formSubmit2($document,formId,index,tableId);
+
+                },
+                cancel: function(index){
+                },
+                end:function () {
+                    var reviewFee = $("#reviewFee").val();
+                    var projectContentDataNewId = $("#projectContentDataNewId").val();
+                    var url = location.href;
+                    if(url.charAt(url.length-1)=="#"){
+                        url = url.substring(0,url.length-1)
+                    }
+                    $("#"+tableId).load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #"+tableId);
+                }
+            });
+        }
+        function formSubmit2($document,inputForm,index,tableId){
+
+            var validateForm = $($document.getElementById(inputForm)).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                var action = $document.getElementById(inputForm).action;
+                var handleInfo = $($document.getElementById(inputForm)).serialize();
+                $.ajax({
+                    type : "POST",
+                    url : action,
+                    data : handleInfo,
+                    //请求成功
+                    success:function(data) {
+                        var d = data;
+                        //输出提示信息
+                        if(d.str.length>0){
+                            parent.layer.msg(d.str,{icon:1});
+                        }
+                        //刷新当前模块
+                        var reviewFee = $("#reviewFee").val();
+                        var projectContentDataNewId = $("#projectContentDataNewId").val();
+                        var url = location.href;
+                        if(url.charAt(url.length-1)=="#"){
+                            url = url.substring(0,url.length-1)
+                        }
+                        $("#"+tableId).load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #"+tableId);
+                        //关闭当前页
+                        top.layer.close(index)
+                    }
+                });
+            }
+        }
+        function setAchievementValuee(obj){
+
+            for(var i=0;i<obj.length;i++){
+                var projectContentDataNewId = $("#projectContentDataNewId").val();
+
+                $.ajax({
+                    type : "POST",
+                    url : "${ctx}/projectcontentinfo/projectBasedData/saveAchievementIdAndContentId",
+                    data : {
+                        "contentId":projectContentDataNewId,"basedId":obj[i].id
+                    },
+                    //请求成功
+                    success:function(data) {
+                        //刷新当前模块
+                        var reviewFee = $("#reviewFee").val();
+                        var url = location.href;
+                        if(url.charAt(url.length-1)=="#"){
+                            url = url.substring(0,url.length-1)
+                        }
+                        $("#upTable").load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #upTable");
+                    }
+                });
+            }
+        }
     </script>
 </head>
 <body>
@@ -573,6 +745,7 @@
             <input type="hidden" id="contentDeta" name="projectContentData.contentDetail">
             <input type="hidden" id="dataBodyList" name="dataBodyList" value="">
             <input type="hidden" id="projectContentDataSign" name="projectContentDataSign" value="">
+            <input type="hidden" id="projectContentDataNewId" name="projectContentDataNewId" value="${projectFollowReport.projectContentDataNewId}">
             <input type="hidden" id="modify"  value="${modify}">
             <form:hidden path="home"/>
             <form:hidden path="bzshbUserId"/>
@@ -634,9 +807,159 @@
                     <div id="contentDetail"></div>
                 </div>
             </div>
+
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>依据性资料明细</h2></div>
                 <div class="layui-item nav-btns">
+                    <a href="javascript:void(0)" onclick="openDialogre('新增依据性资料', '${ctx}/projectcontentinfo/projectcontentinfo/form?view=basedData&dictType=${projectFollowReport.dictType}&id=${projectFollowReport.id}&parentIds=${projectFollowReport.parentIds}&projectContentDataNewId=${projectFollowReport.projectContentDataNewId}&project.id=${projectFollowReport.project.id}','90%','90%','inputForm','upTable1')" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 新增</a>
+
+                    <sys:gridselectBaseData url="${ctx}/projectcontentinfo/projectBasedData/selectList" id="baseData" title="选择依据资料"
+                                            cssClass="form-control" projectId="${projectFollowReport.project.id}" fieldLabels="" fieldKeys=""  searchLabel="${fns:urlEncode('依据资料名称')}" searchKey="name"></sys:gridselectBaseData>
+                </div>
+                <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                    <table id="upTable1" class="table table-bordered table-condensed tree_table">
+                        <thead>
+                        <tr>
+                            <th width="200px">资料名称</th>
+                            <th width="200px">资料类别</th>
+                            <th width="200px">资料性质</th>
+                            <th width="35%">资料内容</th>
+                            <th width="160px">上传人</th>
+                            <th width="160px">上传日期</th>
+                            <th width="120px">文件大小(M)</th>
+                            <th width="100px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="overAllFile_attachment">
+                        <c:forEach items="${projectFollowReport.overAllFileGistdataList}" var = "fileAttachment" varStatus="status">
+                            <tr id="file_attachment_${fileAttachment.id}_tr_fu" onclick="listTr(this)">
+                                <td style="display:none"><span class="faid">${fileAttachment.id}</span></td>
+                                <td style="display:none">${fileAttachment.mustFlag}</td>
+                                <td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span>${fileAttachment.name}<input type="hidden" value="${fileAttachment.name}"/></td>
+                                <td style="white-space:normal; word-break:break-all;overflow:hidden;">${fileAttachment.attachName}</td>
+                                <td>
+                                    <div style="white-space:normal; word-break:break-all;overflow:hidden;">  ${fileAttachment.attachTypes}</div>
+                                </td>
+                                <td></td>
+                                <td></td>
+                                <td></td>
+                                <td></td>
+                                <td class="op-td">
+                                    <div class="op-btn-box" >
+                                        <a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/overAllWorkAttachmentForm?attachmentId=${fileAttachment.id}&projectId=${projectFollowReport.projectContentDataNewId}&uploadMode=${projectFollowReport.uploadMode}','70%','80%',false,'inputForm','upTable1')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+                                    </div>
+                                </td>
+                                <td style="display:none">${fileAttachment.fileFlag}</td>
+
+                            </tr>
+                            <c:forEach items="${fileAttachment.workAttachments}" var = "workClientAttachment" varStatus="status">
+                                <tr class="file_attachment_${fileAttachment.id}_tr_fu">
+                                    <td></td>
+                                    <td></td>
+                                    <td></td>
+                                    <c:choose>
+                                        <c:when test="${projectFollowReport.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                    <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${fn:containsIgnoreCase(fileOther.attachName,'rar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                    <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${fn:containsIgnoreCase(fileOther.attachName,'rar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:otherwise>
+                                    </c:choose>
+                                    <td class="op-td" style="white-space:normal; word-break:break-all;overflow:hidden;" onclick="readOpenInfo('${workClientAttachment.createName}')">${workClientAttachment.createName}</td>
+
+                                    <td class="op-td" style="text-align:center;">
+                                        <fmt:formatDate value="${workClientAttachment.createDate}" type="date"/>
+                                    </td>
+
+                                    <td class="op-td">${workClientAttachment.fileSize}</td>
+                                    <td class="op-td">
+                                        <div class="op-btn-box" >
+                                                <%--附件下载删除--%>
+                                            <c:choose>
+                                                <c:when test="${projectFollowReport.uploadMode == 2}">
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                </c:otherwise>
+                                            </c:choose>
+
+                                                <%--											<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${fileAttachment.id}&projectId=${project.id}','70%','80%',false,'inputForm','upTable',this)" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>--%>
+                                        </div>
+                                    </td>
+                                </tr>
+                            </c:forEach>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+            <%--<div class="form-group layui-row">
+                <div class="form-group-label"><h2>依据性资料明细</h2></div>
+                <div class="layui-item nav-btns">
                     <a href="javascript:void(0)" onclick="openDialogre('新增依据性资料', '${ctx}/projectcontentinfo/projectcontentinfo/form?view=basedData&dictType=${projectFollowReport.dictType}&id=${projectFollowReport.id}&parentIds=${projectFollowReport.parentIds}&project.id=${projectFollowReport.project.id}','90%','90%','inputForm')" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 新增</a>
 
                     <sys:gridselectBaseData url="${ctx}/projectcontentinfo/projectBasedData/selectList" id="baseData" title="选择依据资料"
@@ -685,7 +1008,7 @@
                         </tbody>
                     </table>
                 </div>
-            </div>
+            </div>--%>
             <script type="text/template" id="workBaseDataTpl">//<!--
                 <tr id="budgetList{{idx}}">
                     <td class="hide">
@@ -717,7 +1040,7 @@
             <script type="text/javascript">
                 var workBaseDataTpl = $("#workBaseDataTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                 var workBaseDataRowIdx = ${fn:length(projectcontentinfo.projectReportData.projectBasedDataList)};
-                function setValuee(obj){
+                /*function setValuee(obj){
                     for(var i=0;i<obj.length;i++){
                         var idArr = $("#workBaseDataList tr:visible .clientId");
                         if(obj[i].id!=''&&!hasInArr(obj[i].id,idArr)){
@@ -725,7 +1048,7 @@
                             workBaseDataRowIdx=workBaseDataRowIdx+1;
                         }
                     }
-                }
+                }*/
                 function hasInArr(id,idArr) {
                     for(var i=0;i<idArr.length;i++){
                         if(id==$(idArr[i]).val()){

+ 318 - 6
src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowView.jsp

@@ -5,6 +5,11 @@
 	<title>跟踪咨询报告详情管理</title>
 	<meta name="decorator" content="default"/>
     <script src="${ctxStatic}/layer-v2.3/layui/xmSelect.js" charset="utf-8"></script>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+    <link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
+    <script src="${ctxStatic}/common/html/js/script.js"></script>
+    <%@include file="/webpage/include/treetable.jsp" %>
     <style>
         #projectContentDataType-error{
             left:0;
@@ -203,7 +208,7 @@
             $(prefix+"_file").val(123)
         }
 
-        
+
         function changeContentDetail(obj) {
             var val = $(obj).val();
             var modify = $("#modify").val();
@@ -558,6 +563,172 @@
             }
 
         }
+
+        $(document).ready(function() {
+            $(".tabMove").mouseover(function(){
+                //tips层-下
+                var td=$(this)
+                var tdval=$(this).find("input").val();
+                layer.tips(tdval, td, {
+                    tips: 3
+                });
+            })
+        })
+
+        function listTr(obj){
+            var name=$(obj).attr("id");
+            var tiao="."+name;
+            var span=$(obj).find("td").eq(2);
+            // var ss=$(span).val().split(" ")[4];
+            $(span).toggle(function () {
+                $(tiao).hide();
+                $(span).find("span").eq(0).attr("class","default_shut")
+            },function () {
+                $(tiao).show();
+                $(span).find("span").eq(0).attr("class","default_open")
+            });
+        }
+        function setValuee(obj){
+
+            for(var i=0;i<obj.length;i++){
+                var projectContentDataNewId = $("#projectContentDataNewId").val();
+
+                $.ajax({
+                    type : "POST",
+                    url : "${ctx}/projectcontentinfo/projectBasedData/saveBasedIdAndContentId",
+                    data : {
+                        "contentId":projectContentDataNewId,"basedId":obj[i].id
+                    },
+                    //请求成功
+                    success:function(data) {
+                        //刷新当前模块
+                        var reviewFee = $("#reviewFee").val();
+                        var url = location.href;
+                        if(url.charAt(url.length-1)=="#"){
+                            url = url.substring(0,url.length-1)
+                        }
+                        $("#upTable1").load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #upTable1");
+                    }
+                });
+            }
+        }
+        function openBill2(title,url,width,height,target,formId,tableId){
+            var rows = $(this).parent().prevAll().length + 1;
+            var frameIndex = parent.layer.getFrameIndex(window.name);
+            var urls = url+"&index="+frameIndex;
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                skin:"two-btns",
+                maxmin: false, //开启最大化最小化按钮
+                content: urls ,
+                btn: ['确定','关闭'],
+                yes: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    inputForm.attr("action","${ctx}/projectAccessory/projectAccessory/saveWorkAttachmentOverAll");//表单提交成功后,从服务器返回的url在当前tab中展示
+                    var $document = iframeWin.contentWindow.document;
+
+                    formSubmit2($document,formId,index,tableId);
+
+                },
+                cancel: function(index){
+                },
+                end:function () {
+                    var reviewFee = $("#reviewFee").val();
+                    var projectContentDataNewId = $("#projectContentDataNewId").val();
+                    var url = location.href;
+                    if(url.charAt(url.length-1)=="#"){
+                        url = url.substring(0,url.length-1)
+                    }
+                    $("#"+tableId).load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #"+tableId);
+                }
+            });
+        }
+        function formSubmit2($document,inputForm,index,tableId){
+
+            var validateForm = $($document.getElementById(inputForm)).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                var action = $document.getElementById(inputForm).action;
+                var handleInfo = $($document.getElementById(inputForm)).serialize();
+                $.ajax({
+                    type : "POST",
+                    url : action,
+                    data : handleInfo,
+                    //请求成功
+                    success:function(data) {
+                        var d = data;
+                        //输出提示信息
+                        if(d.str.length>0){
+                            parent.layer.msg(d.str,{icon:1});
+                        }
+                        //刷新当前模块
+                        var reviewFee = $("#reviewFee").val();
+                        var projectContentDataNewId = $("#projectContentDataNewId").val();
+                        var url = location.href;
+                        if(url.charAt(url.length-1)=="#"){
+                            url = url.substring(0,url.length-1)
+                        }
+                        $("#"+tableId).load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #"+tableId);
+                        //关闭当前页
+                        top.layer.close(index)
+                    }
+                });
+            }
+        }
+        function setAchievementValuee(obj){
+
+            for(var i=0;i<obj.length;i++){
+                var projectContentDataNewId = $("#projectContentDataNewId").val();
+
+                $.ajax({
+                    type : "POST",
+                    url : "${ctx}/projectcontentinfo/projectBasedData/saveAchievementIdAndContentId",
+                    data : {
+                        "contentId":projectContentDataNewId,"basedId":obj[i].id
+                    },
+                    //请求成功
+                    success:function(data) {
+                        //刷新当前模块
+                        var reviewFee = $("#reviewFee").val();
+                        var url = location.href;
+                        if(url.charAt(url.length-1)=="#"){
+                            url = url.substring(0,url.length-1)
+                        }
+                        $("#upTable").load(url+"&reviewFee="+reviewFee+"&projectContentDataNewId="+ projectContentDataNewId + " #upTable");
+                    }
+                });
+            }
+        }
     </script>
 </head>
 <body>
@@ -611,8 +782,149 @@
                     <div id="contentDetail"></div>
                 </div>
             </div>
+
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>依据性资料明细</h2></div>
+                <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                    <table id="upTable1" class="table table-bordered table-condensed tree_table">
+                        <thead>
+                        <tr>
+                            <th width="200px">资料名称</th>
+                            <th width="200px">资料类别</th>
+                            <th width="200px">资料性质</th>
+                            <th width="35%">资料内容</th>
+                            <th width="160px">上传人</th>
+                            <th width="160px">上传日期</th>
+                            <th width="120px">文件大小(M)</th>
+                            <th width="100px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="overAllFile_attachment">
+                        <c:forEach items="${projectFollowReport.overAllFileGistdataList}" var = "fileAttachment" varStatus="status">
+                            <tr id="file_attachment_${fileAttachment.id}_tr_fu" onclick="listTr(this)">
+                                <td style="display:none"><span class="faid">${fileAttachment.id}</span></td>
+                                <td style="display:none">${fileAttachment.mustFlag}</td>
+                                <td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span>${fileAttachment.name}<input type="hidden" value="${fileAttachment.name}"/></td>
+                                <td style="white-space:normal; word-break:break-all;overflow:hidden;">${fileAttachment.attachName}</td>
+                                <td>
+                                    <div style="white-space:normal; word-break:break-all;overflow:hidden;">  ${fileAttachment.attachTypes}</div>
+                                </td>
+                                <td></td>
+                                <td></td>
+                                <td></td>
+                                <td></td>
+                                <td></td>
+                                <td style="display:none">${fileAttachment.fileFlag}</td>
+
+                            </tr>
+                            <c:forEach items="${fileAttachment.workAttachments}" var = "workClientAttachment" varStatus="status">
+                                <tr class="file_attachment_${fileAttachment.id}_tr_fu">
+                                    <td></td>
+                                    <td></td>
+                                    <td></td>
+                                    <c:choose>
+                                        <c:when test="${projectFollowReport.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                    <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${fn:containsIgnoreCase(fileOther.attachName,'rar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                    <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${fn:containsIgnoreCase(fileOther.attachName,'rar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:otherwise>
+                                    </c:choose>
+                                    <td class="op-td" style="white-space:normal; word-break:break-all;overflow:hidden;" onclick="readOpenInfo('${workClientAttachment.createName}')">${workClientAttachment.createName}</td>
+
+                                    <td class="op-td" style="text-align:center;">
+                                        <fmt:formatDate value="${workClientAttachment.createDate}" type="date"/>
+                                    </td>
+
+                                    <td class="op-td">${workClientAttachment.fileSize}</td>
+                                    <td class="op-td">
+                                        <div class="op-btn-box" >
+                                                <%--附件下载删除--%>
+                                            <c:choose>
+                                                <c:when test="${projectFollowReport.uploadMode == 2}">
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                </c:otherwise>
+                                            </c:choose>
+
+                                                <%--											<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${fileAttachment.id}&projectId=${project.id}','70%','80%',false,'inputForm','upTable',this)" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>--%>
+                                        </div>
+                                    </td>
+                                </tr>
+                            </c:forEach>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+
+            <%--<div class="form-group layui-row">
+                <div class="form-group-label"><h2>依据性资料明细</h2></div>
                 <div class="layui-item layui-col-xs12 form-table-container">
                     <table id="contentTableBase" class="table table-bordered table-condensed details">
                         <thead>
@@ -651,7 +963,7 @@
                         </tbody>
                     </table>
                 </div>
-            </div>
+            </div>--%>
             <script type="text/template" id="workBaseDataTpl">//<!--
                 <tr id="budgetList{{idx}}">
                     <td class="hide">
@@ -683,7 +995,7 @@
             <script type="text/javascript">
                 var workBaseDataTpl = $("#workBaseDataTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                 var workBaseDataRowIdx = ${fn:length(projectcontentinfo.projectReportData.projectBasedDataList)};
-                function setValuee(obj){
+                /*function setValuee(obj){
                     for(var i=0;i<obj.length;i++){
                         var idArr = $("#workBaseDataList tr:visible .clientId");
                         if(obj[i].id!=''&&!hasInArr(obj[i].id,idArr)){
@@ -691,7 +1003,7 @@
                             workBaseDataRowIdx=workBaseDataRowIdx+1;
                         }
                     }
-                }
+                }*/
                 function hasInArr(id,idArr) {
                     for(var i=0;i<idArr.length;i++){
                         if(id==$(idArr[i]).val()){
@@ -957,7 +1269,7 @@
         data: [
         ]
     })
-    
+
     function getExistingDataOnPath(val) {
         switch (val){
             case '22':
@@ -1187,4 +1499,4 @@
     }
 </script>
 </body>
-</html>
+</html>