Parcourir la source

全过程跟踪咨询报告

user5 il y a 4 ans
Parent
commit
819963208c
15 fichiers modifiés avec 4616 ajouts et 205 suppressions
  1. 130 17
      src/main/java/com/jeeplus/modules/projectConstruction/web/ContractController.java
  2. 6 0
      src/main/java/com/jeeplus/modules/projectrecord/dao/ProjectFollowReportDao.java
  3. 59 13
      src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectFollowReport.java
  4. 9 0
      src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectRecordTreeData.java
  5. 676 27
      src/main/java/com/jeeplus/modules/projectrecord/service/ProjectImplementEarlyService.java
  6. 2 0
      src/main/java/com/jeeplus/modules/projectrecord/service/monthly/MonthlyConsultationReportService.java
  7. 0 8
      src/main/java/com/jeeplus/modules/projectrecord/web/monthly/MonthlyConsultationReportController.java
  8. 3 1
      src/main/java/com/jeeplus/modules/projectreportnum/web/ProjectReportNumController.java
  9. 51 1
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  10. 20 3
      src/main/resources/mappings/modules/projectrecord/ProjectFollowReport/ProjectFollowReport.xml
  11. 33 21
      src/main/webapp/webpage/modules/ProjectFollowReport/ProjectFollowReportList.jsp
  12. 1189 0
      src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowAudit.jsp
  13. 84 114
      src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowForm.jsp
  14. 1189 0
      src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowModify.jsp
  15. 1165 0
      src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowView.jsp

+ 130 - 17
src/main/java/com/jeeplus/modules/projectConstruction/web/ContractController.java

@@ -33,6 +33,7 @@ import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
 import com.jeeplus.modules.projectrecord.service.ProjectImplementEarlyService;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.projectrecord.service.early.ProjectEarlyReviewService;
+import com.jeeplus.modules.projectrecord.service.monthly.MonthlyConsultationReportService;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.Role;
@@ -90,11 +91,9 @@ public class ContractController extends BaseController {
     @Autowired
     private WorkClientAttachmentDao workClientAttachmentDao;
     @Autowired
-    private ProjectContentDataService projectContentDataService;
-    @Autowired
-    private ProjectcontentinfoService projectcontentinfoService;
-    @Autowired
     private ProjectControlTableService projectControlTableService;
+    @Autowired
+    private ActTaskService actTaskService;
 
     /*@ModelAttribute
     public ConstructionContract get(@RequestParam(required=false) String id) {
@@ -456,6 +455,8 @@ public class ContractController extends BaseController {
                         treeNew.setProjectName(report.getProjectFollowName());
                         treeNew.setCreateDate(report.getCreateDate());
                         treeNew.setProjectLeader(projectLeader);
+                        treeNew.setStatus(report.getStatus().toString());
+                        treeNew.setProcessInstanceId(report.getProcessInstanceId());
                         User user = UserUtils.get(report.getCreateBy().getId());
                         treeNew.setProjectRegistrant(user.getName());
                         treeNew.setOperationSign(1);
@@ -472,40 +473,54 @@ public class ContractController extends BaseController {
     @RequestMapping(value = "followForm")
     public String followForm(ProjectFollowReport projectFollowReport, HttpServletRequest request, HttpServletResponse response, Model model, RedirectAttributes attr) {
         String id = projectFollowReport.getId();
+        ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
         if (null != id && !"".equals(id)) {
             //通过id获取跟踪咨询报告信息
             ProjectFollowReport follow = projectImplementEarlyService.getFollow(projectFollowReport);
             //判断是否有project.Id值
             //有project.Id需要查询
             if (null == follow.getProject()) {
-                ProjectRecords project = new ProjectRecords();
-                follow.setProject(project);
-                follow.getProject().setId(projectFollowReport.getProject().getId());
+                follow.setProject(records);
             }
+
+            ProjectContentData projectContentData = new ProjectContentData();
+            //获取依据性文件信息
+            projectContentData.setProjectBasedDataList(projectImplementEarlyService.getBasedData(projectFollowReport));
+            /**获取项目的附件信息*/
+            follow.setWorkAttachments(projectImplementEarlyService.getWorkattachment(projectFollowReport));
+            follow.setProjectContentData(projectContentData);
             /**获取项目的附件信息*/
-            WorkClientAttachment attchment = new WorkClientAttachment();
-            attchment.setAttachmentId(projectFollowReport.getId());
-            List<WorkClientAttachment> attachments = workClientAttachmentDao.findList(attchment);
-            follow.setWorkAttachments(attachments);
             model.addAttribute("projectFollowReport", follow);
+            if("view".equals(projectFollowReport.getView())){
+                return "modules/projectrecord/workContentFromAndView/workFollowView";
+            }
             return "modules/projectrecord/workContentFromAndView/workFollowForm";
         }
 
         //查询是否含有上传或者引用的依据性文件信息
-        if(com.jeeplus.common.utils.StringUtils.isNotBlank(id)){
+        if(StringUtils.isNotBlank(id)){
             List<ProjectControlTable> controlData = projectControlTableService.getControlData(id,"");
-//            projectFollowReport.setProjectControlTableList(controlData);
-//            projectContentDataService.queryBasedData(projectFollowReport);
         }
+        projectFollowReport.setProject(records);
+        projectFollowReport.setDictType("");
+        projectFollowReport.setParentIds("");
         model.addAttribute("projectFollowReport", projectFollowReport);
-        model.addAttribute("flag", "complement");
         return "modules/projectrecord/workContentFromAndView/workFollowForm";
     }
 
     @RequestMapping(value = "saveFollow")
-    public String saveFollow(ProjectFollowReport projectFollowReport, Model model, RedirectAttributes redirectAttributes) {
-//        projectImplementEarlyService.insertFollow(projectFollowReport);
+    public String saveFollow(ProjectFollowReport projectFollowReport, Model model, RedirectAttributes redirectAttributes) throws Exception {
+        ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
+        projectFollowReport.setProject(records);
         if (null != projectFollowReport.getId() && !"".equals(projectFollowReport.getId())) {
+            ProjectFollowReport followReport = projectImplementEarlyService.getFollow(projectFollowReport);
+            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);
             projectImplementEarlyService.updateFollow(projectFollowReport);
         } else {
             projectImplementEarlyService.insertFollow(projectFollowReport);
@@ -513,6 +528,104 @@ public class ContractController extends BaseController {
         return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
     }
 
+    /**
+     * 审批
+     * @param model
+     * @param redirectAttributes
+     * @return
+     */
+    @RequestMapping("saveAudit")
+    public String saveAudit(ProjectFollowReport projectFollowReport, Model model,
+                            RedirectAttributes redirectAttributes) throws Exception {
+        ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
+        ProjectFollowReport followReport = projectImplementEarlyService.getFollow(projectFollowReport);
+        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);
+        String home = projectFollowReport.getHome();
+        try {
+            String taskDefKey = projectFollowReport.getAct().getTaskDefKey();
+            //当状态为未通过时,重新修改数据
+            if ("modifyApply".equals(taskDefKey)) {
+                projectFollowReport.getAct().setComment("重新申请");
+            }
+            List<User> users = UserUtils.getByProssType(projectFollowReport.getProcessInstanceId(),1);
+            String flag = projectFollowReport.getAct().getFlag();
+            if ("yes".equals(flag) && (users==null || users.size()==0)){
+                addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
+            }else {
+                String str = projectImplementEarlyService.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);
+        ProcessInstance processInstance = actTaskService.getProcIns(projectFollowReport.getProcessInstanceId());
+        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);
+        }
+
+        model.addAttribute("projectFollowReport", projectFollowReport);
+        return "modules/projectrecord/workContentFromAndView/workFollowModify";
+    }
+
+
+
+    @RequestMapping(value = "getProcess")
+    public String getProcess(ProjectFollowReport projectFollowReport, Model model,HttpServletRequest request){
+        projectFollowReport = projectImplementEarlyService.getFollow(projectFollowReport);
+        model.addAttribute("processInstanceId", projectFollowReport.getProcessInstanceId());
+        return "modules/projectrecord/projectRecordsTask";
+    }
+
+    @RequestMapping(value = "revoke")
+    public String revoke(HttpServletRequest request, RedirectAttributes redirectAttributes) throws Exception {
+        HashMap<String, String> requestMap = findRequestMap(request);
+        String processInstanceId = requestMap.get("processInstanceId");
+        String id = requestMap.get("id");
+        /*try {*/
+            ProjectFollowReport projectFollowReport = projectImplementEarlyService.getFollowById(id);
+            if(5==projectFollowReport.getStatus()){
+                addMessage(redirectAttributes, "跟踪咨询报告已审批通过,无法撤回");
+                return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
+            }
+            projectImplementEarlyService.cancelProcess(projectFollowReport);
+            addMessage(redirectAttributes, "撤回跟踪咨询报告成功");
+        /*}catch (Exception e){
+            logger.info(e.getMessage());
+            addMessage(redirectAttributes, "撤回跟踪咨询报告失败");
+        }*/
+        return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
+    }
+
 
     /**
      * 删除依据性资料

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

@@ -3,6 +3,7 @@ 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.ProjectFollowReport;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 
 import java.util.List;
 
@@ -26,5 +27,10 @@ public interface ProjectFollowReportDao extends CrudDao<ProjectFollowReport> {
     void insertFollow(ProjectFollowReport projectFollowReport);
 
 
+    /**
+     * 审核信息修改
+     * @param projectFollowReport
+     */
+    void updateProcessIdAndStatus(ProjectFollowReport projectFollowReport);
 
 }

+ 59 - 13
src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectFollowReport.java

@@ -7,6 +7,7 @@ import com.jeeplus.modules.projectcontentinfo.entity.ProjectBasedData;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectContentData;
 import com.jeeplus.modules.projectcontroltable.entity.ProjectControlTable;
 import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 
 import java.util.List;
@@ -16,7 +17,7 @@ import java.util.List;
  * @author enford
  * @Version 2020-08-10
  */
-public class ProjectFollowReport extends TreeEntity<ProjectFollowReport> {
+public class ProjectFollowReport extends ActEntity<ProjectFollowReport> {
     private static final long serialVersionUID = 1L;
     /**项目id*/
     private ProjectRecords project;
@@ -34,11 +35,18 @@ public class ProjectFollowReport extends TreeEntity<ProjectFollowReport> {
     private String projectReportId;
     /**字典类型*/
     private String dictType;
+    private String view;
 
     private ProjectContentData projectContentData;
 
+    private Integer status;  //审核状态
+    private String processInstanceId;
+    private String projectId;
+    private String home;
+    private String parentIds;
 
-    private List<WorkClientAttachment> workAttachments;
+
+    private List<Workattachment> workAttachments;
 
 
     public ProjectRecords getProject() {
@@ -89,11 +97,11 @@ public class ProjectFollowReport extends TreeEntity<ProjectFollowReport> {
         this.projectRegistrationDate = projectRegistrationDate;
     }
 
-    public List<WorkClientAttachment> getWorkAttachments() {
+    public List<Workattachment> getWorkAttachments() {
         return workAttachments;
     }
 
-    public void setWorkAttachments(List<WorkClientAttachment> workAttachments) {
+    public void setWorkAttachments(List<Workattachment> workAttachments) {
         this.workAttachments = workAttachments;
     }
 
@@ -115,21 +123,59 @@ public class ProjectFollowReport extends TreeEntity<ProjectFollowReport> {
         this.projectContentData = projectContentData;
     }
 
-    @Override
-    public ProjectFollowReport getParent() {
-        return null;
+    public String getDictType() {
+        return dictType;
     }
 
-    @Override
-    public void setParent(ProjectFollowReport parent) {
+    public void setDictType(String dictType) {
+        this.dictType = dictType;
+    }
 
+    public Integer getStatus() {
+        return status;
     }
 
-    public String getDictType() {
-        return dictType;
+    public void setStatus(Integer status) {
+        this.status = status;
     }
 
-    public void setDictType(String dictType) {
-        this.dictType = dictType;
+    public String getProcessInstanceId() {
+        return processInstanceId;
+    }
+
+    public void setProcessInstanceId(String processInstanceId) {
+        this.processInstanceId = processInstanceId;
+    }
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public String getHome() {
+        return home;
+    }
+
+    public void setHome(String home) {
+        this.home = home;
+    }
+
+    public String getView() {
+        return view;
+    }
+
+    public void setView(String view) {
+        this.view = view;
+    }
+
+    public String getParentIds() {
+        return parentIds;
+    }
+
+    public void setParentIds(String parentIds) {
+        this.parentIds = parentIds;
     }
 }

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

@@ -30,6 +30,7 @@ public class ProjectRecordTreeData extends DataEntity<ProjectRecordTreeData> {
     private String projectContentId;  //工作内容id
     private String recordId;
     private String reportRecordName;   //归档信息名称
+    private String processInstanceId;
 
     private String contCate;//合同分类
     private double trueAmt;//有效合同金额
@@ -229,4 +230,12 @@ public class ProjectRecordTreeData extends DataEntity<ProjectRecordTreeData> {
     public void setDate(Date date) {
         this.date = date;
     }
+
+    public String getProcessInstanceId() {
+        return processInstanceId;
+    }
+
+    public void setProcessInstanceId(String processInstanceId) {
+        this.processInstanceId = processInstanceId;
+    }
 }

+ 676 - 27
src/main/java/com/jeeplus/modules/projectrecord/service/ProjectImplementEarlyService.java

@@ -1,32 +1,63 @@
 package com.jeeplus.modules.projectrecord.service;
 
+import com.google.common.collect.Maps;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.Collections3;
 import com.jeeplus.common.utils.MenuStatusEnum;
-import com.jeeplus.modules.projectConstruction.entity.ConstructionContract;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.projectType.dao.ProjectTypeDao;
-import com.jeeplus.modules.projectType.entity.ProjectType;
-import com.jeeplus.modules.projectrecord.dao.ProjectFollowReportDao;
-import com.jeeplus.modules.projectrecord.dao.ProjectImplementEarlyDao;
-import com.jeeplus.modules.projectrecord.dao.WorkProjectUserDao;
-import com.jeeplus.modules.projectrecord.entity.ProjectAttachmentInfo;
-import com.jeeplus.modules.projectrecord.entity.ProjectFollowReport;
-import com.jeeplus.modules.projectrecord.entity.ProjectImplementEarly;
+import com.jeeplus.modules.projectcontentinfo.dao.ProjectBasedDataDao;
+import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
+import com.jeeplus.modules.projectcontentinfo.dao.ProjectcontentinfoDao;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectBasedData;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectContentData;
+import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectContentDataService;
+import com.jeeplus.modules.projectrecord.dao.*;
+import com.jeeplus.modules.projectrecord.dao.monthly.MonthlyConsultationReportDao;
+import com.jeeplus.modules.projectrecord.entity.*;
+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.serialnum.service.SerialNumTplService;
+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.utils.DictUtils;
 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.workclientinfo.dao.WorkClientLinkmanDao;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
+import com.jeeplus.modules.workclientinfo.service.WorkClientInfoService;
+import com.jeeplus.modules.workcontractinfo.dao.WorkContractInfoDao;
 import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
-import org.apache.commons.lang3.StringUtils;
+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
@@ -46,7 +77,35 @@ public class ProjectImplementEarlyService extends CrudService<ProjectImplementEa
     @Autowired
     private ProjectFollowReportDao projectFollowReportDao;
     @Autowired
-    private WorkClientAttachmentDao workClientAttachmentDao;
+    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;
 
     public ProjectImplementEarly get(String id) {
         return super.get(id);
@@ -93,39 +152,622 @@ public class ProjectImplementEarlyService extends CrudService<ProjectImplementEa
     }
 
     @Transactional(readOnly = false)
-    public void updateFollow(ProjectFollowReport projectFollowReport) {
+    public void updateFollow(ProjectFollowReport projectFollowReport) throws Exception {
+        //获取原有的审核数据
+        Integer oldStatus = projectFollowReport.getStatus();
+        projectFollowReport.setStatus(ProjectStatusEnum.IN_APRL.getValue());
         projectFollowReportDao.update(projectFollowReport);
+
+        ProjectContentData projectContentData = projectFollowReport.getProjectContentData();
+        //保存依据资料信息
+        if(projectContentData.getProjectBasedDataList()!=null&&!projectContentData.getProjectBasedDataList().isEmpty()){
+            for (ProjectBasedData data:projectContentData.getProjectBasedDataList()) {
+                if (data.getDelFlag().equals("0")){
+                    List<ProjectBasedData> projectBasedData = new ArrayList<>();
+                    projectBasedData.add(data);
+                    projectContentDataService.saveBasedData(projectFollowReport.getId(),projectBasedData);
+                }
+            }
+        }
+        if (projectFollowReport.getWorkAttachments()!=null && !projectFollowReport.getWorkAttachments().isEmpty()) {
+            //保存附件信息
+            for (Workattachment workattachment : projectFollowReport.getWorkAttachments()) {
+                if (workattachment.getId() == null) {
+                    continue;
+                }
+                if (workattachment.DEL_FLAG_NORMAL.equals(workattachment.getDelFlag())) {
+                    workattachment.setAttachmentId(projectFollowReport.getId());
+                    workattachment.setAttachmentUser(UserUtils.getUser().getId());
+                    if (StringUtils.isBlank(workattachment.getId()) || "null".equals(workattachment.getId())) {
+                        workattachment.preInsert();
+                        workattachmentDao.insert(workattachment);
+                    } else {
+                        workattachment.preUpdate();
+                        workattachmentDao.update(workattachment);
+                    }
+                } else {
+                    workattachmentDao.delete(workattachment);
+                }
+            }
+        }
+        //启动审批流程
+        if (projectFollowReport.getStatus()== ProjectStatusEnum.IN_APRL.getValue() &&(oldStatus==null||ProjectStatusEnum.REJECTED.getValue()!=oldStatus)) {
+            this.startAudit(projectFollowReport,projectFollowReport.getProcessInstanceId());
+        }
     }
 
     @Transactional(readOnly = false)
-    public void insertFollow(ProjectFollowReport projectFollowReport) {
+    public void insertFollow(ProjectFollowReport projectFollowReport) throws Exception {
+        projectFollowReport.setStatus(ProjectStatusEnum.IN_APRL.getValue());
+        //查询项目报告号前缀
+        String projectNumPrefix = monthlyConsultationReportDao.getProjectNum(projectFollowReport.getProject().getId());
+        projectNumPrefix += "-ZX-";
+
+        //获取最后一个报告号数据信息
+        ReportNum reportNum = new ReportNum();
+        reportNum.setNum(projectNumPrefix);
+        ReportNum lastReportNum = projectReportNumDao.getLastReportNum(reportNum);
+        if (null != lastReportNum){
+            lastReportNum.getNum().lastIndexOf("-");
+            //截取最后四位流水号
+            String substring = lastReportNum.getNum().substring(lastReportNum.getNum().lastIndexOf("-")+1, lastReportNum.getNum().length());
+            //转换为数字并递增
+            Integer substringInteger = Integer.parseInt(substring)+1;
+            //生成新的流水号
+            StringBuffer newSerialNum = new StringBuffer();
+            for(int x = 0; x < (4 - substringInteger.toString().length()); x++) {
+                newSerialNum.append("0");
+            }
+            newSerialNum.append(substringInteger);
+            reportNum.setNum(reportNum.getNum()+newSerialNum);
+        }else{
+            reportNum.setNum(reportNum.getNum()+"0001");
+        }
+        reportNum.preInsert();
+        projectReportNumDao.insert(reportNum);
+        projectFollowReport.setProjectFollowId(reportNum.getNum());
+
         projectFollowReport.preInsert();
         projectFollowReportDao.insertFollow(projectFollowReport);
+        //保存月报基本信息
+        ProjectContentData projectContentData = projectFollowReport.getProjectContentData();
+        //保存依据资料信息
+        if(projectContentData.getProjectBasedDataList()!=null&&!projectContentData.getProjectBasedDataList().isEmpty()){
+            for (ProjectBasedData data:projectContentData.getProjectBasedDataList()) {
+                if (data.getDelFlag().equals("0")){
+                    List<ProjectBasedData> projectBasedData = new ArrayList<>();
+                    projectBasedData.add(data);
+                    projectContentDataService.saveBasedData(projectFollowReport.getId(),projectBasedData);
+                }
+            }
+        }
         if (projectFollowReport.getWorkAttachments()!=null && !projectFollowReport.getWorkAttachments().isEmpty()) {
             //保存附件信息
-            for (WorkClientAttachment workClientAttachment : projectFollowReport.getWorkAttachments()) {
-                if (org.apache.commons.lang3.StringUtils.isBlank(workClientAttachment.getId())&& org.apache.commons.lang3.StringUtils.isNotBlank(workClientAttachment.getAttachmentId())) {
+            for (Workattachment workattachment : projectFollowReport.getWorkAttachments()) {
+                if (workattachment.getId() == null) {
                     continue;
                 }
-                if (org.apache.commons.lang3.StringUtils.isBlank(workClientAttachment.getId())&& org.apache.commons.lang3.StringUtils.isBlank(workClientAttachment.getUrl())) {
-                    continue;
+                if (workattachment.DEL_FLAG_NORMAL.equals(workattachment.getDelFlag())) {
+                    workattachment.setAttachmentId(projectFollowReport.getId());
+                    workattachment.setAttachmentUser(UserUtils.getUser().getId());
+                    if (StringUtils.isBlank(workattachment.getId()) || "null".equals(workattachment.getId())) {
+                        workattachment.preInsert();
+                        workattachmentDao.insert(workattachment);
+                    } else {
+                        workattachment.preUpdate();
+                        workattachmentDao.update(workattachment);
+                    }
+                } else {
+                    workattachmentDao.delete(workattachment);
+                }
+            }
+        }
+        //获取原有的审核数据
+        Integer oldStatus = projectFollowReport.getStatus();
+        //启动审批流程
+        if (projectFollowReport.getStatus()== ProjectStatusEnum.IN_APRL.getValue() &&(oldStatus==null||ProjectStatusEnum.REJECTED.getValue()!=oldStatus)) {
+            this.startAudit(projectFollowReport,projectFollowReport.getProcessInstanceId());
+        }
+
+    }
+
+    /**
+     * 启动审批流程
+     *
+     * @param projectFollowReport
+     */
+    private void startAudit(ProjectFollowReport 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 contentStr = "咨询报告编号:"+projectFollowReport.getProjectFollowId()+",咨询报告名称:"+ projectFollowReport.getProjectFollowName()+",创建人:"+projectFollowReport.getCreateBy().getName();
+            String titleStr = "咨询报告名称:"+ 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,
+                            projectFollowReport.getProject().getCompany().getId(),
+                            titleStr,
+                            contentStr,
+                            "139",
+                            "0",
+                            "待审批",
+                            ""
+                    );
+
+            List<User> users = new ArrayList<>();
+            List<User> bmzrs = UserUtils.getByRoleActivityEnname("bzshb",3,office.getId(),"4",projectFollowReport.getCreateBy());
+
+            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","139");
+                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);
+            }
+            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.setStatus(ProjectStatusEnum.IN_APRL.getValue());
+            projectFollowReportDao.updateProcessIdAndStatus(projectFollowReport);
+        }catch (Exception e){
+            logger.error("启动审批流程异常:",e);
+            throw e;
+        }
+    }
+
+
+    @Transactional(readOnly = false)
+    public String auditSave(ProjectFollowReport projectFollowReport,List<User> auditUsers) throws Exception {
+
+        int projectStatus = projectFollowReport.getStatus();
+        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 == 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.setStatus(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.getProcessInstanceId());
+        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.getProcessInstanceId());
+        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.setStatus(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.setStatus(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;
                 }
-                if (WorkClientAttachment.DEL_FLAG_NORMAL.equals(workClientAttachment.getDelFlag())) {
-                    workClientAttachment.setAttachmentId(projectFollowReport.getId());
-                    workClientAttachment.setAttachmentFlag("134");
-                    workClientAttachment.setAttachmentUser(UserUtils.getUser().getId());
-                    if (StringUtils.isBlank(workClientAttachment.getId()) || "null".equals(workClientAttachment.getId())) {
-                        workClientAttachment.preInsert();
-                        workClientAttachmentDao.insert(workClientAttachment);
+            }
+        }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);
+                        notifyRole = "审批通过";
                     } else {
-                        workClientAttachment.preUpdate();
-                        workClientAttachmentDao.update(workClientAttachment);
+                        workActivityProcess.setIsApproval("2");
+                        vars.put("pass", 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");
+                        vars.put("pass",true);
+                    }else{
+                        workActivityProcess.setIsApproval("2");
+                        projectFollowReport.setStatus(ProjectStatusEnum.RECALL.getValue());
+                        vars.put("pass",false);
                     }
+                    break;
+                }
+            }
+        }
+        workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,projectFollowReport.getProcessInstanceId(),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);
+        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())) {
+                projectFollowReport.setStatus(ProjectStatusEnum.SIGNED.getValue());
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectFollowReport.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                users.add(projectFollowReport.getCreateBy());
+            } else {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectFollowReport.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                users.add(projectFollowReport.getCreateBy());
+                if (projectFollowReport.getStatus()!= ProjectStatusEnum.RECALL.getValue()){
+                    projectFollowReport.setStatus(ProjectStatusEnum.REJECTED.getValue());
+					/*workProjectNotifyService
+							.save(UtilNotify
+									.saveNotify(projectRecords.getId(),
+											projectRecords.getCreateBy(),
+											projectRecords.getCompany().getId(),
+											titleStr,
+											notifyStr,
+											"39",
+											"0",
+											"待通知",
+											notifyRole));*/
+                }
+            }
+            workActivityProcessService.deleteProcessIdAuditUsers(projectFollowReport.getProcessInstanceId());
+
+        }else{
+            if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("projectFollow")) {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectFollowReport.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                WorkProjectNotify workProjectNotify = UtilNotify
+                        .saveNotify(projectFollowReport.getId(),
+                                new User(),
+                                projectFollowReport.getProject().getCompany().getId(),
+                                titleStr,
+                                str,
+                                "139",
+                                "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())) {
+                    WorkProjectNotify notify = new WorkProjectNotify();
+                    notify.setNotifyId(projectFollowReport.getId());
+                    userList = workProjectNotifyService.readByNotifyId(notify);
+                    users.add(user);
+                    WorkProjectNotify workProjectNotify = UtilNotify
+                            .saveNotify(projectFollowReport.getId(),
+                                    user,
+                                    projectFollowReport.getProject().getCompany().getId(),
+                                    titleStr,
+                                    str,
+                                    "139",
+                                    "0",
+                                    "重新申请",
+                                    notifyRole);
+                    workProjectNotifyService.save(workProjectNotify);
                 } else {
-                    workClientAttachmentDao.delete(workClientAttachment);
+                    if (org.apache.commons.lang3.StringUtils.isNotBlank(enname)) {
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(projectFollowReport.getId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        WorkProjectNotify workProjectNotify = UtilNotify
+                                .saveNotify(projectFollowReport.getId(),
+                                        new User(),
+                                        projectFollowReport.getProject().getCompany().getId(),
+                                        titleStr,
+                                        str,
+                                        "139",
+                                        "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","139");
+                            extras.put("id",workProjectNotify.getId());
+                            UserUtils.pushInfoToApp(titleStr,str,extras,user1.getId());
+                        }
+                    }else {
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(projectFollowReport.getId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        users.add(projectFollowReport.getCreateBy());
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(projectFollowReport.getId(),
+                                                projectFollowReport.getCreateBy(),
+                                                projectFollowReport.getProject().getCompany().getId(),
+                                                titleStr,
+                                                str,
+                                                "139",
+                                                "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.update(projectFollowReport);
+        return "保存审核意见成功!";
+    }
+
+
+    @Transactional(readOnly = false)
+    public void cancelProcess(ProjectFollowReport projectFollowReport) throws Exception {
+        WorkActivityProcess process = new WorkActivityProcess();
+        process.setProcessInstanceId(projectFollowReport.getProcessInstanceId());
+        process.setIsApproval("0");
+        WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+        workActivityProcess.setProcessInstanceId(projectFollowReport.getProcessInstanceId());
+        List<WorkActivityProcess> processList = workActivityProcessService.findList(workActivityProcess);
+        WorkProjectNotify notify = new WorkProjectNotify();
+        notify.setNotifyId(projectFollowReport.getId());
+        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.setStatus(ProjectStatusEnum.RECALL.getValue());
+            projectFollowReport.setProject(records);
+            projectFollowReport.preUpdate();
+            projectFollowReportDao.update(projectFollowReport);
+            actTaskService.endProcessInstance(projectFollowReport.getProcessInstanceId(), "跟踪咨询报告-撤回");
+        }
+    }
+
+
+
+    /**
+     * 查询依据性文件
+     * @param monthly
+     * @return
+     */
+    public List<ProjectBasedData> getBasedData(ProjectFollowReport monthly){
+        if (com.jeeplus.common.utils.StringUtils.isNotBlank(monthly.getId())){
+            List<ProjectBasedData> list = projectBasedDataDao.queryListByContentId(monthly.getId());
+            return list;
+        }
+        return null;
+    }
+
+    /**
+     * 查询附件信息
+     * @param monthly
+     * @return
+     */
+    public List<Workattachment> getWorkattachment(ProjectFollowReport monthly){
+        if (com.jeeplus.common.utils.StringUtils.isNotBlank(monthly.getId())){
+            Workattachment workattachment = new Workattachment();
+            workattachment.setAttachmentId(monthly.getId());
+            List<Workattachment> list = workattachmentDao.findList(workattachment);
+            return list;
+        }
+        return null;
     }
 
     /**
@@ -210,4 +852,11 @@ public class ProjectImplementEarlyService extends CrudService<ProjectImplementEa
     public ProjectFollowReport getFollow(ProjectFollowReport projectFollowReport) {
         return projectFollowReportDao.get(projectFollowReport.getId());
     }
+
+    /**
+     * 通过id获取跟踪咨询报告的基础信息
+     */
+    public ProjectFollowReport getFollowById(String id) {
+        return projectFollowReportDao.get(id);
+    }
 }

+ 2 - 0
src/main/java/com/jeeplus/modules/projectrecord/service/monthly/MonthlyConsultationReportService.java

@@ -78,6 +78,8 @@ public class MonthlyConsultationReportService extends CrudService<MonthlyConsult
                 }else{
                     reportNum.setNum(reportNum.getNum()+"0001");
                 }
+                reportNum.preInsert();
+                projectReportNumDao.insert(reportNum);
                 monthly.setMonthlyNumber(reportNum.getNum());
                 monthly.preInsert();
                 dao.saveMonthly(monthly);

+ 0 - 8
src/main/java/com/jeeplus/modules/projectrecord/web/monthly/MonthlyConsultationReportController.java

@@ -6,15 +6,9 @@ import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.utils.MyBeanUtils;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.web.BaseController;
-import com.jeeplus.modules.projectType.service.ProjectTypeService;
-import com.jeeplus.modules.projectcontentinfo.entity.ProjectBasedData;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectContentData;
 import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
-import com.jeeplus.modules.projectcontentinfo.service.ProjectBasedDataService;
-import com.jeeplus.modules.projectcontentinfo.service.ProjectContentDataService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
-import com.jeeplus.modules.projectcontroltable.entity.ProjectControlTable;
-import com.jeeplus.modules.projectcontroltable.service.ProjectControlTableService;
 import com.jeeplus.modules.projectrecord.dao.WorkProjectUserDao;
 import com.jeeplus.modules.projectrecord.entity.MonthlyInfo;
 import com.jeeplus.modules.projectrecord.entity.ProjectImplementEarly;
@@ -31,9 +25,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 

+ 3 - 1
src/main/java/com/jeeplus/modules/projectreportnum/web/ProjectReportNumController.java

@@ -171,7 +171,9 @@ public class ProjectReportNumController extends BaseController {
 				}
 			}
 		}
-
+		for (int i=0 ; i<listNum.size(); i++){
+			listNum.get(i).setIndex(i+1+"");
+		}
 		map.put("data",listNum);
 		return map;
 	}

+ 51 - 1
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -37,6 +37,7 @@ import com.jeeplus.modules.oaperformance.entity.OaPerformance;
 import com.jeeplus.modules.oaperformance.service.OaPerformanceService;
 import com.jeeplus.modules.officeintroduce.dao.OfficeintroduceDao;
 import com.jeeplus.modules.projectType.entity.ProjectType;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectContentData;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
 import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
@@ -44,9 +45,11 @@ import com.jeeplus.modules.projectcontentinfo.service.ProjectReportChangeService
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportRecordService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
+import com.jeeplus.modules.projectrecord.entity.ProjectFollowReport;
 import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecordsAlter;
+import com.jeeplus.modules.projectrecord.service.ProjectImplementEarlyService;
 import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsAlterService;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
@@ -417,6 +420,8 @@ public class WorkProjectNotifyController extends BaseController {
 	private WorkRepayService workRepayService;
 	@Autowired
 	private ProjectPlanService projectPlanService;
+	@Autowired
+	private ProjectImplementEarlyService projectImplementEarlyService;
 
 	@ModelAttribute
 	public WorkProjectNotify get(@RequestParam(required=false) String id) {
@@ -647,6 +652,11 @@ public class WorkProjectNotifyController extends BaseController {
 					}
 				}
 			}
+			else if("139".equals(workProjectNotify.getType())){ //退票
+				ProjectFollowReport projectRecords = projectImplementEarlyService.getFollowById(workProjectNotify.getNotifyId());
+				if (projectRecords != null)
+					processInstanceId = projectRecords.getProcessInstanceId();
+			}
 			else if("41".equals(workProjectNotify.getType())){ //退票
 				ProjectRecordsAlter projectRecordsAlter = projectRecordsAlterService.get(workProjectNotify.getNotifyId());
 				if (projectRecordsAlter != null)
@@ -1124,7 +1134,31 @@ public class WorkProjectNotifyController extends BaseController {
 						}
 					}
 
-				}else if (workProjectNotify.getType().equals("131")) {    //项目计划通知
+				} else if (workProjectNotify.getType().equals("139")) {    //项目登记
+					ProjectFollowReport followReport = projectImplementEarlyService.getFollowById(workProjectNotify.getNotifyId());
+					ProjectRecords records = projectRecordsService.getQueryProjectUsers(followReport.getProjectId());
+					followReport.setProject(records);
+
+					ProjectContentData projectContentData = new ProjectContentData();
+					//获取依据性文件信息
+					projectContentData.setProjectBasedDataList(projectImplementEarlyService.getBasedData(followReport));
+					/**获取项目的附件信息*/
+					followReport.setWorkAttachments(projectImplementEarlyService.getWorkattachment(followReport));
+					followReport.setProjectContentData(projectContentData);
+
+					followReport.setAct(getByAct(followReport.getProcessInstanceId()));
+					followReport.setHome("home");
+					model.addAttribute("processInstanceId", followReport.getProcessInstanceId());
+					model.addAttribute("projectFollowReport",followReport);
+					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
+						return "modules/projectrecord/workContentFromAndView/workFollowAudit";
+					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
+						return "modules/projectrecord/workContentFromAndView/workFollowModify";
+					} else {
+						return "modules/projectrecord/workContentFromAndView/workFollowView";
+					}
+
+				} else if (workProjectNotify.getType().equals("131")) {    //项目计划通知
 					boolean flag = false;
 					//通过通知信息id获取项目登记对象
 					ProjectRecords projectRecords = projectRecordsService.get(workProjectNotify.getNotifyId());
@@ -2238,6 +2272,22 @@ public class WorkProjectNotifyController extends BaseController {
 					}
 
 				}
+				else if("139".equals(workProjectNotify.getType())){ //咨询报告
+					ProjectFollowReport followReport = projectImplementEarlyService.getFollowById(workProjectNotify.getNotifyId());
+					ProjectRecords records = projectRecordsService.getQueryProjectUsers(followReport.getProjectId());
+					followReport.setProject(records);
+
+					ProjectContentData projectContentData = new ProjectContentData();
+					//获取依据性文件信息
+					projectContentData.setProjectBasedDataList(projectImplementEarlyService.getBasedData(followReport));
+					/**获取项目的附件信息*/
+					followReport.setWorkAttachments(projectImplementEarlyService.getWorkattachment(followReport));
+					followReport.setProjectContentData(projectContentData);
+
+					followReport.setAct(getByAct(followReport.getProcessInstanceId()));
+					model.addAttribute("followReport",followReport);
+					return "modules/projectrecord/workContentFromAndView/projectFollowReportView";
+				}
 				else if("41".equals(workProjectNotify.getType())){ //项目变更
 					boolean flag = false;
 					ProjectRecordsAlter projectRecordsAlter = projectRecordsAlterService.get(workProjectNotify.getNotifyId());

+ 20 - 3
src/main/resources/mappings/modules/projectrecord/ProjectFollowReport/ProjectFollowReport.xml

@@ -39,7 +39,10 @@
 
 
     <select id="get" resultType="com.jeeplus.modules.projectrecord.entity.ProjectFollowReport">
-        SELECT *
+        SELECT *,a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate"
         FROM sj_project_registration a
                  LEFT JOIN sys_user su ON su.id = a.create_by
         WHERE a.id = #{id}
@@ -70,11 +73,14 @@
         a.projectFollowName,
         a.projectId as `project.id`,
         a.create_by AS "createBy.id",
-        a.create_date AS "createDate"
+        a.create_date AS "createDate",
+        a.status as "status",
+        a.process_instance_id as "processInstanceId"
         FROM sj_project_registration a
         <where>
             a.projectId = #{projectId}
         </where>
+        order by a.status asc, a.update_date desc
     </select>
 
     <select id="findAllList" resultType="com.jeeplus.modules.projectrecord.entity.ProjectFollowReport">
@@ -127,6 +133,7 @@
          del_flag,
          projectFollowId,
          projectFollowName,
+         status,
          projectId)
         VALUES (#{id},
                 #{createBy.id},
@@ -136,6 +143,7 @@
                 #{delFlag},
                 #{projectFollowId},
                 #{projectFollowName},
+                #{status},
                 #{project.id})
     </insert>
 
@@ -145,7 +153,8 @@
             update_date = #{updateDate},
             projectFollowId = #{projectFollowId},
             projectFollowName = #{projectFollowName},
-            projectId = #{project.id}
+            projectId = #{project.id},
+            status = #{status}
         where id = #{id};
     </update>
 
@@ -157,6 +166,14 @@
         WHERE id = #{id}
     </update>
 
+    <update id="updateProcessIdAndStatus" >
+        UPDATE  sj_project_registration SET
+          process_instance_id = #{processInstanceId},
+          status = #{status}
+        WHERE id = #{id}
+    </update>
+
+
     <!--逻辑删除-->
     <update id="deleteByLogic">
         UPDATE sj_project_registration

+ 33 - 21
src/main/webapp/webpage/modules/ProjectFollowReport/ProjectFollowReportList.jsp

@@ -294,28 +294,14 @@
 				page: false,
 				cols: [[
 					{type: 'numbers', align:'center', title: '序号' ,width:80},
-					{field: 'projectId', title: '项目编号/施工合同编号'},
+					{field: 'projectId', width:250, title: '项目编号/施工合同编号'},
 					{field: 'projectName', align:'center', title: '项目名称/施工合同名称',templet:function(d){
 							if(0 == d.pid){
 								return "<a class=\"attention-info pid\" title=\"" + d.projectName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/project/projectRecords/view?id=" + d.id +"','95%', '95%')\">" + d.projectName + "</a>";
 							}else{
-								return "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogView('查看施工合同内容', '${ctx}/project/constructionContract/view?id="+d.id+"','95%', '95%')\">" + d.projectName + "</a>";
+								return "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogView('查看跟踪咨询报告内容', '${ctx}/project/constructionContract/followForm?view=view&id="+d.id+"&project.id="+d.pid+"','95%', '95%')\">" + d.projectName + "</a>";
 							}
 						}},
-					/*{field: 'contCate', align:'center', title: '合同分类',templet: function(d){
-							if(0 == d.pid){
-								return "";
-							}else{
-								return "<font>"+d.contCate+"</font>";
-							}
-						}},
-					{field: 'trueAmt', align:'center', title: '有效合同额',templet: function(d){
-							if(0 == d.pid){
-								return "";
-							}else{
-								return "<font>"+d.trueAmt+"</font>";
-							}
-						}},*/
 					{field: 'projectLeader', align:'center', title: '项目负责人',templet: function(d){
 							if(0 == d.pid){
 								return "<font style = 'font-size:14px;font-weight:500;'>"+d.projectLeader+"</font>";
@@ -340,6 +326,18 @@
 								return "<font>"+layui.util.toDateString(date,'yyyy-MM-dd')+"</font>";
 							}
 						}},
+					{align:'center', title: '状态',  width:70,templet:function(d){
+							if(d.pid !=0){
+								var st = getAuditState(""+d.status);
+								if(st.action)
+									var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/project/constructionContract/getProcess?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:130}
 				]],
 				done: function () {
@@ -377,17 +375,31 @@
 				}
 			} else if (d.pid!="0"){
 				if(1 == d.operationSign) {
-					if(d.status ==null){
-						//子级内容
+					if(d.status == 1){
 						return [
 							'<a href="javascript:void(0)" onclick="openDialogreAudit(\'修改跟踪咨询报告内容\', \'${ctx}/project/constructionContract/followForm?id='+d.id+'&project.id='+d.pid+ '\',\'95%\',\'95%\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>',
 							'<a href="${ctx}/project/constructionContract/deleteFollow?project.id='+d.pid+'&id='+d.id+'" onclick="return confirmxRefresh(\'确认要删除该跟踪咨询报告吗?\', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>',
 						].join('');
-
-					}else{
+					}else if(d.status == 2){
 						return [
-							'',
+							'<a href="${ctx}/project/constructionContract/revoke?id='+d.id+'&processInstanceId='+d.processInstanceId+'" onclick="return confirmx(\'确认要撤回该跟踪咨询报告吗?\', this.href)"   class="op-btn op-btn-cancel"><i class="glyphicon glyphicon-share-alt"></i> 撤回</a>',
 						].join('');
+					}else if(d.status == 3){
+						return [
+							'<a href="javascript:void(0)" onclick="openDialogreAudit(\'修改跟踪咨询报告内容\', \'${ctx}/project/constructionContract/followForm?id='+d.id+'&project.id='+d.pid+ '\',\'95%\',\'95%\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>',
+							'<a href="${ctx}/project/constructionContract/deleteFollow?project.id='+d.pid+'&id='+d.id+'" onclick="return confirmxRefresh(\'确认要删除该跟踪咨询报告吗?\', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>',
+						].join('');
+					}else if(d.status == 4){
+						return [
+							'<a href="javascript:void(0)" onclick="openDialogreAudit(\'修改跟踪咨询报告内容\', \'${ctx}/project/constructionContract/modify?id='+d.id+'&project.id='+d.pid+ '\',\'95%\',\'95%\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>',
+							'<a href="${ctx}/project/constructionContract/deleteFollow?project.id='+d.pid+'&id='+d.id+'" onclick="return confirmxRefresh(\'确认要删除该跟踪咨询报告吗?\', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>',
+						].join('');
+					}else if(d.status == 5){
+						return [
+
+						].join('');
+					}else{
+						return[''].join('');
 					}
 
 				}else{

Fichier diff supprimé car celui-ci est trop grand
+ 1189 - 0
src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowAudit.jsp


+ 84 - 114
src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowForm.jsp

@@ -574,9 +574,15 @@
             <div class="form-group layui-row first lw12">
                 <div class="form-group-label"><h2>基本信息</h2></div>
                 <div class="layui-item layui-col-sm6">
-                    <label class="layui-form-label">跟踪咨询编号:</label>
+                    <label class="layui-form-label">项目名称:</label>
                     <div class="layui-input-block">
-                        <form:input path="projectFollowId" htmlEscape="false" class="form-control layui-input"/>
+                        <form:input path="project.projectName" htmlEscape="false" readonly="true" class="form-control layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">项目编号:</label>
+                    <div class="layui-input-block">
+                        <form:input path="project.projectId" htmlEscape="false" readonly="true" class="form-control layui-input"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
@@ -586,6 +592,12 @@
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">跟踪咨询编号:</label>
+                    <div class="layui-input-block">
+                        <form:input path="projectFollowId" readonly="true" htmlEscape="false" class="form-control layui-input"/>
+                    </div>
+                </div>
+                <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="createDate" name="projectContentData.createDate" type="text" readonly="true" maxlength="20" class="form-control layui-input required"
@@ -602,117 +614,85 @@
             <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=basedDataview=basedData&dictType=${projectFollowReport.dictType}&parentIds=${projectFollowReport.parentIds}&id=${projectFollowReport.id}&project.id=${projectFollowReport.project.id}','90%','90%','inputForm')" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 新增</a>
+                    <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="选择依据资料"
+                                            cssClass="form-control" projectId="${projectFollowReport.project.id}" fieldLabels="" fieldKeys=""  searchLabel="${fns:urlEncode('依据资料名称')}" searchKey="name"></sys:gridselectBaseData>
                 </div>
                 <div class="layui-item layui-col-xs12 form-table-container">
                     <table id="contentTableBase" class="table table-bordered table-condensed details">
-                <thead>
-                <tr>
-                    <th class="hide"></th>
-                    <%--<th >资料编号</th>--%>
-                    <th >资料名称</th>
-                    <th >资料类别</th>
-                    <th >资料内容</th>
-                    <th >上传人</th>
-                    <th >上传日期</th>
-                    <th>操作</th>
-                </tr>
-                </thead>
-                <tbody   id="workBaseDataList">
-                <c:forEach items="${projectcontentinfo.projectContentData.projectBasedDataList}" var="projectBasedData" varStatus="idx">
-                    <tr>
-                        <td class="hide">
-                            <input id="workBaseDataList${idx.index}_id"      name="projectReportData.projectBasedDataList[${idx.index}].id"     type="hidden" value="${projectBasedData.id}"  class="clientId">
-                            <input id="workBaseDataList${idx.index}_file" type="file" name="projectReportData.projectBasedDataList[${idx.index}].file" multiple="multiple" style="display: none;" onChange="if(this.value)insertAccording(this.value,${idx.index},'#workBaseDataList${idx.index}');"/>
-                            <input id="workBaseDataList${idx.index}_number"	 name="projectReportData.projectBasedDataList[${idx.index}].number" type="hidden" value="${projectBasedData.number}"/>
-                            <input id="workBaseDataList${idx.index}_name" 	 name="projectReportData.projectBasedDataList[${idx.index}].name"   type="hidden" value="${projectBasedData.name}"/>
-                            <input id="workBaseDataList${idx.index}_type"	 name="projectReportData.projectBasedDataList[${idx.index}].type"   type="hidden" value="${projectBasedData.type}"/>
-                            <input id="workBaseDataList${idx.index}_flag"	 name="projectReportData.projectBasedDataList[${idx.index}].flag"   type="hidden" value="132"/>
-                            <input id="workBaseDataList${idx.index}_chooseCondition"	 name="projectReportData.projectBasedDataList[${idx.index}].chooseCondition"   type="hidden" value="${projectBasedData.chooseCondition}"/>
-
-                            <input id="workBaseDataList${idx.index}_fileType"	 name="projectReportData.projectBasedDataList[${idx.index}].fileType"   type="hidden" value=""/>
-                            <input id="workBaseDataList${idx.index}_fileName"	 name="projectReportData.projectBasedDataList[${idx.index}].fileName"   type="hidden" value=""/>
-                            <input id="workBaseDataList${idx.index}_fileUrl"	 name="projectReportData.projectBasedDataList[${idx.index}].fileUrl"   type="hidden" value="${projectBasedData.fileUrl}"/>
-                            <input id="workBaseDataList${idx.index}_fileAttachmentFlag"	 name="projectReportData.projectBasedDataList[${idx.index}].fileAttachmentFlag"   type="hidden" value=""/>
-                            <input id="workBaseDataList${idx.index}_fileAttachmentId"	 name="projectReportData.projectBasedDataList[${idx.index}].fileAttachmentId"   type="hidden" value=""/>
-                        </td>
-                        <%--<td style="text-align:center;">
-                                ${projectBasedData.number}
-                        </td>--%>
-                        <td style="text-align:center;">
-                                ${projectBasedData.name}
-                        </td>
-                        <td style="text-align:center;">
-
-                                ${projectBasedData.type}
-                               <%-- ${fns:getDictLabel(projectBasedData.type, 'project_document_type', '')}--%>
-                        </td>
-                        <td style="text-align:center;">
-                            <div id="workBaseDataList${idx.index}_fileTypeDiv">
-                                <c:choose>
-                                    <c:when test="${fn:containsIgnoreCase(projectBasedData.fileName,'jpg')
-															   or fn:containsIgnoreCase(projectBasedData.fileName,'png')
-															   or fn:containsIgnoreCase(projectBasedData.fileName,'gif')
-															   or fn:containsIgnoreCase(projectBasedData.fileName,'bmp')
-															   or fn:containsIgnoreCase(projectBasedData.fileName,'jpeg')}">
-                                        <img src="${projectBasedData.fileUrl}" width="50" height="50" title ="${projectBasedData.fileName}" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${projectBasedData.fileUrl}','90%','90%')" alt="${projectBasedData.fileName}">
-                                    </c:when>
-                                    <c:otherwise>
-                                        <c:choose>
-                                            <c:when test="${fn:containsIgnoreCase(projectBasedData.fileName,'pdf')}">
-                                                <a class="attention-info" href="javascript:void(0)" title ="${projectBasedData.fileName}" onclick="preview('预览','${projectBasedData.fileUrl}','90%','90%','1')">${projectBasedData.fileName}</a>
-                                            </c:when>
-                                            <c:otherwise>
-                                                <a class="attention-info" href="javascript:void(0)" title ="${projectBasedData.fileName}" onclick="preview('预览','${projectBasedData.fileUrl}','90%','90%')">${projectBasedData.fileName}</a>
-                                            </c:otherwise>
-                                        </c:choose>
-                                    </c:otherwise>
-                                </c:choose>
-                            </div>
-                        </td>
-                        <td style="text-align:center;">
-                                ${projectBasedData.uploadUser.name}
-                        </td>
-                        <td style="text-align:center;">
-                            <fmt:formatDate value="${projectBasedData.uploadDate}" pattern="yyyy-MM-dd"/>
-                        </td>
-
-                        <td class="text-center op-td">
-                            <div id="workBaseDataList${idx.index}_operation">
-                                <c:choose>
-                                    <c:when test="${ projectBasedData.flag =='according'}">
-                                        <c:choose>
-                                            <c:when test="${not empty projectBasedData.fileUrl}">
-                                                <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${projectBasedData.fileUrl}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-                                            </c:when>
-                                            <c:otherwise>
-                                                <a href=javascript:void(0); onclick="accordingBtn(this, '#workBaseDataList${idx.index}')"   class="op-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i> 添加附件</a>
-                                            </c:otherwise>
-                                        </c:choose>
+                        <thead>
+                        <tr>
+                            <th class="hide"></th>
+                            <th >资料编号</th>
+                            <th >资料名称</th>
+                            <th >资料类别</th>
+                            <th >上传人</th>
+                            <th >上传日期</th>
+                            <th>操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="workBaseDataList">
+                        <c:forEach items="${projectFollowReport.projectContentData.projectBasedDataList}" var="projectBasedData" varStatus="idx">
+                            <tr>
+                                <td class="hide">
+                                    <input type="hidden" id="workBaseDataList${idx.index}_id" value="${projectBasedData.id}" class="clientId">
+                                </td>
+                                <td style="text-align:center;">
+                                        ${projectBasedData.number}
+                                </td>
+                                <td style="text-align:center;">
+                                        ${projectBasedData.name}
+                                </td>
+                                <td style="text-align:center;">
+                                        ${fns:getDictLabel(projectBasedData.type, 'project_document_type', '')}
+                                </td>
+                                <td style="text-align:center;">
+                                        ${projectBasedData.uploadUser.name}
+                                </td>
+                                <td style="text-align:center;">
+                                    <fmt:formatDate value="${projectBasedData.uploadDate}" pattern="yyyy-MM-dd"/>
+                                </td>
 
-                                    </c:when>
-                                    <c:otherwise>
-                                        <a href=javascript:void(0); onclick="delRowBaseData(this, '#workBaseDataList${idx.index}','${projectBasedData.uploadUser.id}')"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>
-                                    </c:otherwise>
-                                </c:choose>
-                            </div>
-                        </td>
-                    </tr>
-                </c:forEach>
-                </tbody>
-            </table>
+                                <td class="text-center op-td">
+                                    <a href=javascript:void(0); onclick="delRowBaseData(this, '#workBaseDataList${idx.index}','${projectBasedData.uploadUser.id}')"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                        </tbody>
+                    </table>
                 </div>
             </div>
-            <script type="text/template" id="workBaseDataTplFirst">
-            </script>
-            <script type="text/template" id="workBaseDataTplFirstModify">
-            </script>
-            <script type="text/template" id="workBaseDataTpl">
+            <script type="text/template" id="workBaseDataTpl">//<!--
+                <tr id="budgetList{{idx}}">
+                    <td class="hide">
+                        <input id="workBaseDataList{{idx}}_id" name="projectContentData.projectBasedDataList[{{idx}}].id" type="hidden" value="{{row.id}}" class="clientId"/>
+                        <input id="workBaseDataList{{idx}}_number" name="projectContentData.projectBasedDataList[{{idx}}].number" type="hidden" value="{{row.number}}"/>
+                        <input id="workBaseDataList{{idx}}_name" name="projectContentData.projectBasedDataList[{{idx}}].name" type="hidden" value="{{row.name}}"/>
+                        <input id="workBaseDataList{{idx}}_type" name="projectContentData.projectBasedDataList[{{idx}}].type" type="hidden" value="{{row.type}}"/>
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.number}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.name}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.typeLabel}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.uploadUser.name}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.uploadDate}}
+                    </td>
+                    <td class="text-center op-td">
+                        <a href=javascript:void(0); onclick="delRowBaseData(this, '#workBaseDataList{{idx}}','{{row.uploadUser.id}}')"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 取消</a>
+                    </td>
+                </tr>//-->
             </script>
             <script type="text/javascript">
                 var workBaseDataTpl = $("#workBaseDataTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
-                var workBaseDataTplFirst = $("#workBaseDataTplFirst").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
-                var workBaseDataTplFirstModify = $("#workBaseDataTplFirstModify").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                 var workBaseDataRowIdx = ${fn:length(projectcontentinfo.projectReportData.projectBasedDataList)};
                 function setValuee(obj){
                     for(var i=0;i<obj.length;i++){
@@ -879,16 +859,6 @@
                     </table>
                 </div>
             </div>
-            <c:if test="${projectcontentinfo.infoId !=null and projectcontentinfo.edit  == 'edit'}">
-                <div class="pull-right">
-                    <button id="btnSubmit" class="nav-btn nav-btn-add" type="submit" onclick="$('#edit').val('edit');beforeSubmit();"><i class="fa fa-chevron-up"></i> 提 交</button>
-                </div>
-            </c:if>
-            <div class="form-group layui-row page-end">
-            <br>
-            <br>
-            <br>
-            </div>
         </form:form>
     </div>
 </div>

Fichier diff supprimé car celui-ci est trop grand
+ 1189 - 0
src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowModify.jsp


Fichier diff supprimé car celui-ci est trop grand
+ 1165 - 0
src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowView.jsp