Преглед на файлове

案例文件审核并同步到知识库部分代码提交

徐滕 преди 2 седмици
родител
ревизия
af5a79a630
променени са 23 файла, в които са добавени 9704 реда и са изтрити 582 реда
  1. 9 0
      src/main/java/com/jeeplus/modules/projectAccessory/entity/ProjectTemplateInfo.java
  2. 16 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsOwnCaseBaseDao.java
  3. 78 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/ProjectCaseBaseAudit.java
  4. 27 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java
  5. 0 11
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsCaseBaseService.java
  6. 704 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsOwnCaseBaseService.java
  7. 0 166
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageNewTwoController.java
  8. 853 31
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectRecordsOwnCaseBaseController.java
  9. 4 0
      src/main/java/com/jeeplus/modules/sys/dao/WorkattachmentDao.java
  10. 9 0
      src/main/java/com/jeeplus/modules/sys/service/WorkattachmentService.java
  11. 9 0
      src/main/java/com/jeeplus/modules/workclientinfo/entity/WorkClientAttachment.java
  12. 27 25
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  13. 5 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsCaseBaseDao.xml
  14. 86 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsOwnCaseBaseDao.xml
  15. 25 0
      src/main/resources/mappings/modules/sys/WorkattachmentDao.xml
  16. 1 0
      src/main/resources/mappings/modules/workclientinfo/WorkClientAttachmentDao.xml
  17. 2567 0
      src/main/webapp/webpage/modules/projectcontentinfo/projectCaseBaseSupplementAudit.jsp
  18. 192 189
      src/main/webapp/webpage/modules/projectcontentinfo/projectCaseBaseSupplementForm.jsp
  19. 2480 0
      src/main/webapp/webpage/modules/projectcontentinfo/projectCaseBaseSupplementModify.jsp
  20. 2423 0
      src/main/webapp/webpage/modules/projectcontentinfo/projectCaseBaseSupplementView.jsp
  21. 161 157
      src/main/webapp/webpage/modules/projectcontentinfo/projectReportRecordCaseBaseForm.jsp
  22. 27 2
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralProjectRecordsOwnCaseBaseList.jsp
  23. 1 1
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/ruralProjectMessageList.jsp

+ 9 - 0
src/main/java/com/jeeplus/modules/projectAccessory/entity/ProjectTemplateInfo.java

@@ -35,6 +35,7 @@ public class ProjectTemplateInfo extends TreeEntity<ProjectTemplateInfo>{
 	private Integer flag;
 	private String url;
 	private String temporaryUrl;		// 附件地址(临时地址)
+	private String vatTaxStatus;		// 是否被标记
 
 	private Integer fileFlag;   //判断是否有文件(1:有文件信息,0:无文件)
 
@@ -244,4 +245,12 @@ public class ProjectTemplateInfo extends TreeEntity<ProjectTemplateInfo>{
 	public void setMaterialProperties(String materialProperties) {
 		this.materialProperties = materialProperties;
 	}
+
+	public String getVatTaxStatus() {
+		return vatTaxStatus;
+	}
+
+	public void setVatTaxStatus(String vatTaxStatus) {
+		this.vatTaxStatus = vatTaxStatus;
+	}
 }

+ 16 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsOwnCaseBaseDao.java

@@ -0,0 +1,16 @@
+package com.jeeplus.modules.ruralprojectrecords.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.ruralprojectrecords.entity.ProjectCaseBaseAudit;
+
+@MyBatisDao
+public interface RuralProjectRecordsOwnCaseBaseDao extends CrudDao<ProjectCaseBaseAudit> {
+
+    /**
+     * 根据项目id查询案例项目文件流程信息
+     * @param projectId
+     * @return
+     */
+    ProjectCaseBaseAudit getByProjectId(String projectId);
+}

+ 78 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/ProjectCaseBaseAudit.java

@@ -0,0 +1,78 @@
+package com.jeeplus.modules.ruralprojectrecords.entity;
+
+import com.jeeplus.common.persistence.ActEntity;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
+import com.jeeplus.modules.sys.entity.Office;
+
+import java.util.List;
+
+/**
+ * 案例流程表
+ * @author: 徐滕
+ * @create: 2025-6-5 09:01
+ **/
+public class ProjectCaseBaseAudit extends ActEntity<ProjectCaseBaseAudit> {
+    private String projectId;   //项目id
+    private Integer status;  //状态
+    private String processInstanceId;   //流程编号
+    private Office company;
+    private Office office;
+    private String home;
+    private String selectedIds; //被选中同步的附件id集合
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getProcessInstanceId() {
+        return processInstanceId;
+    }
+
+    public void setProcessInstanceId(String processInstanceId) {
+        this.processInstanceId = processInstanceId;
+    }
+
+    public Office getCompany() {
+        return company;
+    }
+
+    public void setCompany(Office company) {
+        this.company = company;
+    }
+
+    public Office getOffice() {
+        return office;
+    }
+
+    public void setOffice(Office office) {
+        this.office = office;
+    }
+
+    public String getHome() {
+        return home;
+    }
+
+    public void setHome(String home) {
+        this.home = home;
+    }
+
+    public String getSelectedIds() {
+        return selectedIds;
+    }
+
+    public void setSelectedIds(String selectedIds) {
+        this.selectedIds = selectedIds;
+    }
+}

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

@@ -378,6 +378,9 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	private String caseCreateBy;               //案例项目 创建人id
 	private String caseStatus;				//案例项目的状态
 	private String caseProcessId;			//案例项目的流程id
+	private String caseAuditId;				//案例项目文件id
+	private String caseAuditStatus;				//案例项目文件审核的状态
+	private String caseAuditProcessId;			//案例项目文件审核流程id
 	private String ziXunBDE;			//上报中的咨询标的额
 	private Date projectReportRecordAuditDate;  //电子归档审核时间
 	private Date projectPaperAuditPassDate;  //A类项目纸质归档时间
@@ -2438,6 +2441,30 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 		this.caseProcessId = caseProcessId;
 	}
 
+	public String getCaseAuditId() {
+		return caseAuditId;
+	}
+
+	public void setCaseAuditId(String caseAuditId) {
+		this.caseAuditId = caseAuditId;
+	}
+
+	public String getCaseAuditStatus() {
+		return caseAuditStatus;
+	}
+
+	public void setCaseAuditStatus(String caseAuditStatus) {
+		this.caseAuditStatus = caseAuditStatus;
+	}
+
+	public String getCaseAuditProcessId() {
+		return caseAuditProcessId;
+	}
+
+	public void setCaseAuditProcessId(String caseAuditProcessId) {
+		this.caseAuditProcessId = caseAuditProcessId;
+	}
+
 	@ExcelField(title="标的额(万元)", align=2, sort=12)
 	public String getZiXunBDE() {
 		return ziXunBDE;

Файловите разлики са ограничени, защото са твърде много
+ 0 - 11
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsCaseBaseService.java


+ 704 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsOwnCaseBaseService.java

@@ -0,0 +1,704 @@
+package com.jeeplus.modules.ruralprojectrecords.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.knowledgeSharing.entity.KnowledgeSharingInfo;
+import com.jeeplus.modules.knowledgeSharing.service.KnowledgeSharingDetailsService;
+import com.jeeplus.modules.projectAccessory.dao.ProjectTemplateDao;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
+import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
+import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectRecordsOwnCaseBaseDao;
+import com.jeeplus.modules.ruralprojectrecords.entity.ProjectCaseBaseAudit;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
+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.workprojectnotify.entity.WorkProjectNotify;
+import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
+import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
+import org.activiti.engine.ActivitiObjectNotFoundException;
+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.*;
+
+@Service
+@Transactional(readOnly = true)
+public class RuralProjectRecordsOwnCaseBaseService extends CrudService<RuralProjectRecordsOwnCaseBaseDao, ProjectCaseBaseAudit> {
+
+    @Autowired
+    private ProjectReportDataService projectReportDataService;
+    @Autowired
+    private RuralProjectRecordsService projectRecordsService;
+    @Autowired
+    private ActTaskService actTaskService;
+    @Autowired
+    private WorkActivityMenuService workActivityMenuService;
+    @Autowired
+    private WorkProjectNotifyService workProjectNotifyService;
+    @Autowired
+    private RuntimeService runtimeService;
+    @Autowired
+    private WorkActivityProcessService workActivityProcessService;
+    @Autowired
+    private WorkActivityProcessDao workActivityProcessDao;
+    @Autowired
+    private ActivityService activityService;
+    @Autowired
+    private OfficeService officeService;
+    @Autowired
+    private WorkattachmentService workattachmentService;
+    @Autowired
+    private ProjectTemplateDao projectTemplateDao;
+    @Autowired
+    private KnowledgeSharingDetailsService knowledgeSharingDetailsService;
+
+    public ProjectCaseBaseAudit getByProjectId(String projectId) {
+        return dao.getByProjectId(projectId);
+    }
+
+
+    @Transactional(readOnly = false)
+    public void store(ProjectCaseBaseAudit projectCaseBaseAudit) {
+        super.save(projectCaseBaseAudit);
+    }
+
+    @Transactional(readOnly = false)
+    public void save(ProjectCaseBaseAudit projectCaseBaseAudit) {
+        super.save(projectCaseBaseAudit);
+        try {
+            this.startApprovalAudit(projectCaseBaseAudit,projectCaseBaseAudit.getProcessInstanceId());
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * 启动审批流程
+     *
+     * @param projectCaseBaseAudit
+     * @param processInstanceId
+     */
+    private void startApprovalAudit(ProjectCaseBaseAudit projectCaseBaseAudit, String processInstanceId) throws Exception {
+        try{
+            projectCaseBaseAudit = super.get(projectCaseBaseAudit.getId());
+            RuralProjectRecords ruralProjectRecords = projectRecordsService.get(projectCaseBaseAudit.getProjectId());
+            ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(ruralProjectRecords.getId());
+            Map<String, Object> variables = new HashMap<String, Object>();
+            Office office = projectCaseBaseAudit.getOffice();
+            String contentStr = "报告号【"+ projectReportData.getNumber()+"】案例项目文件申请待审批,项目编号:"+ruralProjectRecords.getProjectId();
+            String titleStr = "报告号【"+ projectReportData.getNumber()+"】案例项目文件申请待审批";
+
+            String businessKey = projectCaseBaseAudit.getId();
+
+            WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("7854872f45b84acd893010e66a3db2c8", office);
+            // 启动流程
+            String processType = workActivityMenu.getProcessType();
+            StringBuffer buffer = new StringBuffer();
+            Activity activity = new Activity();
+            WorkProjectNotify workProjectNotify = UtilNotify
+                    .saveNotify(projectCaseBaseAudit.getId(),
+                            null,
+                            projectCaseBaseAudit.getCompany().getId(),
+                            titleStr,
+                            contentStr,
+                            "113",
+                            "0",
+                            "待审批",
+                            ""
+                    );
+
+            List<User> users = new ArrayList<>();
+            //获取案例项目文件审核人信息
+            List<User> alxmwjshrs = UserUtils.getByRoleActivityEnname("alxmwjshr",3,office.getId(),"4",projectCaseBaseAudit.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",projectCaseBaseAudit.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",projectCaseBaseAudit.getCreateBy());
+                    }
+                    //人员审批
+                    if (StringUtils.isNotBlank(activity.getUser().getId())) {
+                        users.add(activity.getUser());
+                    }
+                }
+                workProjectNotify.setId("");
+            } else {
+                if (alxmwjshrs==null||alxmwjshrs.size()==0){
+                    throw new Exception("流程审批人不能为空,角色部门负责人下无用户,请联系管理员!");
+                }
+                processType = "projectCaseBaseAudit";
+                variables.put("applyUserId", projectCaseBaseAudit.getCreateBy().getId());
+                variables.put("alxmwjshrcount",alxmwjshrs.size());
+                variables.put("alxmwjshrList",alxmwjshrs);
+                users.addAll(alxmwjshrs);
+            }
+            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","113");
+                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", "审批单:" + ruralProjectRecords.getProjectName());//设置标题;
+
+            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(alxmwjshrs,processInstance.getId(),1,1);
+            }
+            projectCaseBaseAudit.setProcessInstanceId(processInstance.getId());
+            projectCaseBaseAudit.setStatus(ProjectStatusEnum.IN_APRL.getValue());
+            super.save(projectCaseBaseAudit);
+            //通知添加流程实例ID
+            workProjectNotify.setProcessInstanceId(processInstance.getId());
+            workProjectNotifyService.save(workProjectNotify);
+        }catch (Exception e){
+            logger.error("启动审批流程异常:",e);
+            throw e;
+        }
+    }
+
+    /**
+     * 案例项目文件审核-强制撤销
+     * @param projectCaseBaseAudit
+     */
+    @Transactional(readOnly = false)
+    public void cancelInvalidate(ProjectCaseBaseAudit projectCaseBaseAudit) {
+        try {
+            String invalidateProcessInstanceId = projectCaseBaseAudit.getProcessInstanceId();
+            //将流程图中尚未走到的task的流程追踪信息逻辑删除,添加一条"撤销"流程追踪信息
+            WorkActivityProcess process = new WorkActivityProcess();
+            process.setProcessInstanceId(projectCaseBaseAudit.getProcessInstanceId());
+            process.setIsApproval("0");
+            WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+            workActivityProcess.setProcessInstanceId(projectCaseBaseAudit.getProcessInstanceId());
+            List<WorkActivityProcess> processList = workActivityProcessService.findList(workActivityProcess);
+            WorkProjectNotify notify = new WorkProjectNotify();
+            notify.setNotifyId(projectCaseBaseAudit.getId());
+            List<User> userList = workProjectNotifyService.readByNotifyId(notify);
+            if (userList!=null && userList.size()!=0) {
+                for (User u : userList) {
+                    User user = UserUtils.get(u.getId());
+                    UserUtils.pushMeIm(user.getId());
+                }
+            }
+            if(processList!=null && processList.size()>0){
+                for (int i =0;i<processList.size();i++) {
+                    WorkActivityProcess p = processList.get(i);
+                    if(com.jeeplus.common.utils.StringUtils.isNotBlank(p.getIsApproval()) && "0".equals(p.getIsApproval())){
+                        p.setDelFlag("1");
+                        p.setIsApproval("-1");
+                        workActivityProcessDao.updateDelFlagAndIsApproval(p);
+                    }
+                }
+                WorkActivityProcess pro = new WorkActivityProcess();
+                pro.setId("");
+                pro.preInsert();
+                pro.setDelFlag("0");
+                pro.setRemarks("[强制撤销]");
+                pro.setProcessKey(processList.get(0).getProcessKey());
+                pro.setIsApproval("1");
+                pro.setProcessInstanceId(processList.get(0).getProcessInstanceId());
+                pro.setCount(0);
+                workActivityProcessDao.insert(pro);
+            }
+
+            //结束该流程,设为"撤销"状态
+            actTaskService.endProcessInstance(invalidateProcessInstanceId,"案例文件审核-强制撤销");
+            projectCaseBaseAudit.setStatus(3);
+            dao.update(projectCaseBaseAudit);
+
+        }catch (ActivitiObjectNotFoundException e){
+            System.err.println("案例文件审核撤销异常,因为这个流程已不存在!");
+            e.printStackTrace();
+            logger.error("Exception e:"+e);
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+            logger.error("Exception e:"+e);
+        }
+
+    }
+
+    @Transactional(readOnly = false)
+    public String auditSave(ProjectCaseBaseAudit projectCaseBaseAudit, List<User> auditUsers) throws Exception {
+
+        RuralProjectRecords ruralProjectRecords = projectRecordsService.get(projectCaseBaseAudit.getProjectId());
+        ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(ruralProjectRecords.getId());
+
+        int status = projectCaseBaseAudit.getStatus();
+        String taskDefKey = projectCaseBaseAudit.getAct().getTaskDefKey();
+        if (!"modifyApply".equals(taskDefKey) && !taskDefKey.contains("audit") ) {
+            actTaskService.claim(projectCaseBaseAudit.getAct().getTaskId(), UserUtils.getUser().getId());
+        }else {
+            projectCaseBaseAudit.getAct().setFlag("yes");
+            projectCaseBaseAudit.setStatus(ProjectStatusEnum.IN_APRL.getValue());
+            store(projectCaseBaseAudit);
+        }
+
+        String comment = "";
+        if ( status == ProjectStatusEnum.REJECTED.getValue()) {
+            comment = ("yes".equals(projectCaseBaseAudit.getAct().getFlag())?"[重新申请] ":"[已撤销] ");
+        }else {
+            comment = ("yes".equals(projectCaseBaseAudit.getAct().getFlag())?"[同意] ":"[驳回] ")+projectCaseBaseAudit.getAct().getComment();
+        }
+
+        if (!"yes".equals(projectCaseBaseAudit.getAct().getFlag())) {
+            projectCaseBaseAudit.setStatus(ProjectStatusEnum.REJECTED.getValue());
+        }
+
+        User createUser = UserUtils.get(projectCaseBaseAudit.getCreateBy().getId());
+
+        Map<String, Object> vars = Maps.newHashMap();
+        String notifyRole = "";
+        //业务逻辑对应的条件表达式
+        User user = null;
+        List<Activity> activitieList = activityService.getByProcessInstanceId(projectCaseBaseAudit.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(projectCaseBaseAudit.getProcessInstanceId());
+        List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
+        List<Activity> activities = workActivityMenu.getActivities();
+        String  taskCount = "1";
+        String enname = "";
+        Office office = projectCaseBaseAudit.getOffice();
+        office = officeService.get(office.getId());
+        projectCaseBaseAudit.setOffice(office);
+
+        String str = "报告号【"+ projectReportData.getNumber()+"】案例项目文件申请待审批,项目编号:"+ruralProjectRecords.getProjectId();
+        String titleStr = "报告号【"+ projectReportData.getNumber()+"】案例项目文件申请待审批";
+        int key = 0;
+        if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("projectCaseBaseAudit")) {
+            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(projectCaseBaseAudit.getAct().getFlag())) {
+                        projectCaseBaseAudit.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(projectCaseBaseAudit.getAct().getFlag())) {
+                        notifyRole = "调整案例文件";
+                        projectCaseBaseAudit.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;
+                }
+            }
+        }else {
+            workActivityMenu.setProcessType("projectCaseBaseAudit");
+            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 ("alxmwjshr".equals(taskDefKey) && "1".equals(count)) {
+                    taskCount = count;
+                    if ("yes".equals(projectCaseBaseAudit.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 = "alxmwjshr";
+                    workActivityProcess.setCount(0);
+                    if("yes".equals(projectCaseBaseAudit.getAct().getFlag())){
+                        workActivityProcess.setIsApproval("1");
+                        vars.put("pass",true);
+                        vars.put("passs",true);
+                    }else{
+                        workActivityProcess.setIsApproval("2");
+                        projectCaseBaseAudit.setStatus(ProjectStatusEnum.RECALL.getValue());
+                        vars.put("pass",false);
+                        vars.put("passs",false);
+                    }
+                    break;
+                }
+            }
+        }
+        workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,projectCaseBaseAudit.getProcessInstanceId(),taskDefKey,"modifyApply",projectCaseBaseAudit.getAct().getFlag(),comment, activities);
+        // 设置意见
+        projectCaseBaseAudit.getAct().setComment(comment);
+        projectCaseBaseAudit.preUpdate();
+        //判断是否是审核通过
+        if("yes".equals(projectCaseBaseAudit.getAct().getFlag())){
+            actTaskService.complete(projectCaseBaseAudit.getAct().getTaskId(), projectCaseBaseAudit.getAct().getProcInsId(), projectCaseBaseAudit.getAct().getComment(), vars);
+        }else{
+            //不通过需要查询审核组角色id
+            List<Act> list2 = actTaskService.toMyStartedList(projectCaseBaseAudit.getProcessInstanceId());
+            // 提交流程任务
+            //如果是驳回,并且审核角色为多个,需要对每个角色的审核流都进行处理
+            for (Act actInfo: list2) {
+                actTaskService.complete(actInfo.getTask().getId(), actInfo.getProcInsId(), projectCaseBaseAudit.getAct().getComment(), vars);
+            }
+        }
+        boolean state = actTaskService.isProcessEnd(projectCaseBaseAudit.getAct().getProcInsId());
+        List<User> users = new ArrayList<>();
+        List<User> userList = new ArrayList<>();
+        if(!state) {
+            users.add(projectCaseBaseAudit.getCreateBy());
+            //审核完成提示框
+            String title = "报告号【"+ projectReportData.getNumber()+"】案例项目文件申请登记完成";
+            String content = "报告号【"+ projectReportData.getNumber()+"】案例项目文件申请登记完成,项目编号:"+ruralProjectRecords.getProjectId();
+            if ("yes".equals(projectCaseBaseAudit.getAct().getFlag())) {
+                projectCaseBaseAudit.setStatus(ProjectStatusEnum.SIGNED.getValue());
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectCaseBaseAudit.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                users.add(projectCaseBaseAudit.getCreateBy());
+                workProjectNotifyService
+                        .save(UtilNotify
+                                .saveNotify(projectCaseBaseAudit.getId(),
+                                        projectCaseBaseAudit.getCreateBy(),
+                                        projectCaseBaseAudit.getCompany().getId(),
+                                        title,
+                                        content,
+                                        "113",
+                                        "0",
+                                        "待通知",
+                                        notifyRole));
+            } else {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectCaseBaseAudit.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                users.add(projectCaseBaseAudit.getCreateBy());
+                if (projectCaseBaseAudit.getStatus()!= ProjectStatusEnum.RECALL.getValue()){
+                    projectCaseBaseAudit.setStatus(ProjectStatusEnum.REJECTED.getValue());
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNotify(projectCaseBaseAudit.getId(),
+                                            projectCaseBaseAudit.getCreateBy(),
+                                            projectCaseBaseAudit.getCompany().getId(),
+                                            titleStr,
+                                            str,
+                                            "113",
+                                            "0",
+                                            "待通知",
+                                            notifyRole));
+                }
+            }
+            workActivityProcessService.deleteProcessIdAuditUsers(projectCaseBaseAudit.getProcessInstanceId());
+
+
+            //先根据id查询案例资料的知识库中是否存在数据,如果存在,则将其进行删除。
+            List<KnowledgeSharingInfo> byProjectId = knowledgeSharingDetailsService.getByProjectId(ruralProjectRecords.getId());
+            for (KnowledgeSharingInfo knowledgeSharingInfo : byProjectId) {
+                knowledgeSharingDetailsService.delete(knowledgeSharingInfo);
+            }
+
+            //将原有文件数据同步状态进行还原
+            List<ProjectTemplateInfo> caseBaseProjectTemplateList = projectTemplateDao.getCaseBaseAccessoryListByParentId("14");
+            List<Workattachment> attachmentAllList = Lists.newArrayList();
+            for (ProjectTemplateInfo projectTemplateInfo : caseBaseProjectTemplateList) {
+                //根据项目id和案例类型信息查询项目案例的所有项目
+                Workattachment workAttachment = new Workattachment();
+                workAttachment.setAttachmentId(projectTemplateInfo.getId());
+                workAttachment.setProjectId(ruralProjectRecords.getId());
+                workAttachment.setAttachmentFlag("100");
+                List<Workattachment> attachmentList = workattachmentService.getAttList(workAttachment);
+
+                attachmentAllList.addAll(attachmentList);
+            }
+            for (Workattachment workattachment : attachmentAllList) {
+                //调整数据同步状态
+                if("1".equals(workattachment.getSyncDifySync())){
+                    workattachment.setSyncDifySync("0");
+                    workattachmentService.updateSyncDifySync(workattachment);
+                }
+            }
+            //审核通过之后对标记同步的数据进行同步,
+            //对上传的文件进行同步到dify
+            //查询案例相关的文件
+            //获取案例类型参数
+            // 将 selectedIds 字符串按逗号分隔成数组
+            if(StringUtils.isNotBlank(projectCaseBaseAudit.getSelectedIds())){
+                String[] selectedIdsArray = projectCaseBaseAudit.getSelectedIds().split(",");
+                //对前端确认同步的文件id进行处理成List
+                List<String> synchronizationList = Arrays.asList(selectedIdsArray);
+                //根据id查询数据进行同步
+                List<Workattachment> attachmentList = workattachmentService.getByIdList(synchronizationList);
+
+
+
+                List<Workattachment> attachmentAuditList = Lists.newArrayList();
+                for (ProjectTemplateInfo projectTemplateInfo : caseBaseProjectTemplateList) {
+                    //根据项目id和案例类型信息查询项目案例的所有项目
+                    Workattachment workAttachment = new Workattachment();
+                    workAttachment.setAttachmentId(projectTemplateInfo.getId());
+                    workAttachment.setProjectId(ruralProjectRecords.getId());
+                    workAttachment.setAttachmentFlag("100");
+                    List<Workattachment> atList = workattachmentService.getAttList(workAttachment);
+                    attachmentAuditList.addAll(atList);
+                }
+                for (Workattachment workattachment : attachmentList) {
+                    for (Workattachment workattachment1 : attachmentAuditList) {
+                        if (workattachment.getId().equals(workattachment1.getId())) {
+                            //数据库中调整成已同步
+                            workattachment1.setSyncDifySync("1");
+                            workattachmentService.updateSyncDifySync(workattachment1);
+                        }
+                    }
+                }
+
+                for (Workattachment workattachment : attachmentList) {
+                    workattachment.setProjectId("");
+                    workattachment.setId("");
+                    workattachment.setSyncDifySync("1");
+                    workattachment.setAttachmentName(ruralProjectRecords.getProjectReportNumber() + "-" + workattachment.getAttachmentName());
+                }
+
+
+                if(attachmentList.size()>0){
+                    KnowledgeSharingInfo knowledgeSharingInfo = new KnowledgeSharingInfo();
+                    knowledgeSharingInfo.setColumnId("10");
+                    knowledgeSharingInfo.setSubject(ruralProjectRecords.getProjectName() + "案例资料文件");
+                    knowledgeSharingInfo.setWorkAttachments(attachmentList);
+                    knowledgeSharingInfo.setCreateBy(projectCaseBaseAudit.getCreateBy());
+                    knowledgeSharingInfo.setCreateDate(new Date());
+                    knowledgeSharingInfo.setUpdateBy(projectCaseBaseAudit.getUpdateBy());
+                    knowledgeSharingInfo.setUpdateDate(new Date());
+                    knowledgeSharingInfo.setProjectId(ruralProjectRecords.getId());
+                    knowledgeSharingDetailsService.save(knowledgeSharingInfo);
+                    knowledgeSharingDetailsService.saveToDify(knowledgeSharingInfo, "1");
+
+
+                }
+            }
+
+
+        }else{
+            if (org.apache.commons.lang3.StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("projectCaseBaseAudit")) {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectCaseBaseAudit.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                WorkProjectNotify workProjectNotify = UtilNotify
+                        .saveNotify(projectCaseBaseAudit.getId(),
+                                new User(),
+                                projectCaseBaseAudit.getCompany().getId(),
+                                titleStr,
+                                str,
+                                "113",
+                                "0",
+                                "待审批",
+                                notifyRole);
+                String count = taskDefKey.replace("audit","").replace("task","");
+                List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
+                        activities,
+                        workProjectNotify,
+                        taskDefKey,
+                        projectCaseBaseAudit.getAct().getFlag(),
+                        count,
+                        projectCaseBaseAudit.getCreateBy(),
+                        projectCaseBaseAudit.getOffice().getId(),
+                        "4");
+                for (WorkProjectNotify workProjectNotify1:workProjectNotifys){
+                    users.add(workProjectNotify1.getUser());
+                    workProjectNotify1.setId("");
+                    workProjectNotify1.setIsNewRecord(false);
+                    workProjectNotifyService.save(workProjectNotify1);
+                }
+            }else {
+                if (!"yes".equals(projectCaseBaseAudit.getAct().getFlag())) {//驳回待办提醒
+                    str = "报告号【"+ projectReportData.getNumber()+"】案例项目文件申请登记登记被驳回,请选择重新申请或作废";
+                    titleStr = "报告号【"+ projectReportData.getNumber()+"】案例项目文件申请登记登记被驳回";
+                    WorkProjectNotify notify = new WorkProjectNotify();
+                    notify.setNotifyId(projectCaseBaseAudit.getId());
+                    userList = workProjectNotifyService.readByNotifyId(notify);
+                    users.add(user);
+                    WorkProjectNotify workProjectNotify = UtilNotify
+                            .saveNotify(projectCaseBaseAudit.getId(),
+                                    user,
+                                    projectCaseBaseAudit.getCompany().getId(),
+                                    titleStr,
+                                    str,
+                                    "113",
+                                    "0",
+                                    "重新申请",
+                                    notifyRole);
+                    workProjectNotifyService.save(workProjectNotify);
+                } else {
+                    if (org.apache.commons.lang3.StringUtils.isNotBlank(enname)) {//驳回重新申请待办信息
+                        str = "报告号【"+ projectReportData.getNumber()+"】案例项目文件申请登记重新登记,待审批,项目编号:"+ruralProjectRecords.getProjectId();
+                        titleStr = "报告号【"+ projectReportData.getNumber()+"】案例项目文件申请重新登记,待审批";
+
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(projectCaseBaseAudit.getId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        WorkProjectNotify workProjectNotify = UtilNotify
+                                .saveNotify(projectCaseBaseAudit.getId(),
+                                        new User(),
+                                        projectCaseBaseAudit.getCompany().getId(),
+                                        titleStr,
+                                        str,
+                                        "113",
+                                        "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","113");
+                            extras.put("id",workProjectNotify.getId());
+                            UserUtils.pushInfoToApp(titleStr,str,extras,user1.getId());
+                        }
+                    }else {
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(projectCaseBaseAudit.getId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        users.add(projectCaseBaseAudit.getCreateBy());
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(projectCaseBaseAudit.getId(),
+                                                projectCaseBaseAudit.getCreateBy(),
+                                                projectCaseBaseAudit.getCompany().getId(),
+                                                titleStr,
+                                                str,
+                                                "113",
+                                                "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());
+            }
+        }
+        dao.update(projectCaseBaseAudit);
+        return "保存审核意见成功!";
+    }
+}

+ 0 - 166
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageNewTwoController.java

@@ -260,108 +260,6 @@ public class RuralCostProjectMessageNewTwoController extends BaseController {
     }
 
     /**
-     * 根据信息获取归档信息并调转页面
-     */
-    @RequestMapping(value = "formCaseBase")
-    public String formCaseBase(ProjectReportRecord projectReportRecord, Model model) throws Exception {
-        //查询“配农网”工程类型id
-        String engineeringId = engineeringService.getEngineeringId("202");
-        if (StringUtils.isBlank(projectReportRecord.getView()) || !projectReportRecord.getView().equals("view")){
-            if(StringUtils.isBlank(projectReportRecord.getId())){
-                projectReportRecord.setCreateDate(new Date());
-                projectReportRecord.setCreateBy(UserUtils.getUser());
-            }
-        }
-        ProjectReportData projectReportData = new ProjectReportData();
-        ProjectRecords projectRecords = new ProjectRecords();
-        projectReportData.setFileStatus("1");
-        ProjectReportData reportData = ruralProjectMessageService.getProjectReportDateByProjectId(projectReportRecord.getReportId());
-        if(null != reportData){
-            if (StringUtils.isBlank(projectReportRecord.getView()) || !projectReportRecord.getView().equals("view")){
-                synchronized (SYN_BYTE) {
-                    int count = projectReportRecordService.getNumber(reportData.getId());
-                    projectReportRecord.setRecordNum(count>9?reportData.getNumber()+"-"+count+"":reportData.getNumber()+"-"+"0"+count);
-                }
-            }else{
-                ProjectReportRecord projectReportRecordInfo =ruralProjectMessageService.getProjectReportRecord(reportData.getId());
-                MyBeanUtils.copyBeanNotNull2Bean(projectReportRecordInfo, projectReportRecord);
-            }
-        }
-        //获取项目信息
-        RuralProjectRecords ruralProjectRecords = projectRecordsService.get(projectReportRecord.getReportId());
-        MyBeanUtils.copyBeanNotNull2Bean(ruralProjectRecords, projectRecords);
-        //获取合同信息
-        WorkContractInfo projectContractInfo = ruralProjectMessageService.getProjectContractInfo(projectRecords.getWorkContractInfo().getId());
-        projectRecords.setWorkContractInfo(projectContractInfo);
-        reportData.setProject(projectRecords);
-        projectReportRecord.setReport(reportData);
-        projectReportRecord.setUploadMode(uploadMode);
-        model.addAttribute("projectReportRecord", projectReportRecord);
-        model.addAttribute("project", projectReportRecord.getReport().getProject());
-
-        ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
-        //添加项目类型
-        relateInfo.setAttachmentProjectType(ruralProjectRecords.getProjectType());
-        relateInfo.setAttachmentProjectSort(ruralProjectRecords.getAttachmentProjectSort());
-        //判断是否为打包项目,打包项目无需查看项目送审金额是否为500w以上判定
-        String money=ruralProjectRecords.getSubmitMoney();
-        Integer approvalMoney=null;
-        if(StringUtils.isBlank(money)){
-            approvalMoney=1;
-        }else{
-            approvalMoney=Integer.parseInt(money);
-        }
-        switch (approvalMoney){
-            case 0:
-                //金额为0
-                relateInfo.setAttachmentProjectApprovalMoney(null);
-                break;
-            case 1:
-                //500w以下金额状态
-                relateInfo.setAttachmentProjectApprovalMoney("1");
-                break;
-            case 2:
-                //500w以上金额状态
-                relateInfo.setAttachmentProjectApprovalMoney("2");
-                break;
-        }
-
-        //添加报告类型
-        relateInfo.setRequiredStage(2);
-        relateInfo.setId(ruralProjectRecords.getId());
-        //查询项目是否时案例项目
-        ruralProjectRecords = projectRecordsService.getCaseBaseByProjectId(ruralProjectRecords);
-        //查询报告文件、依据性文件、其他文件必填列表以及数据
-        List<MainDictDetail> mainDictDetails = projectTemplateService.attachmentTemplateList();
-        //文件处理
-        projectTemplateService.disposeProjectTemplateFile(mainDictDetails,relateInfo,engineeringId,ruralProjectRecords,projectReportRecord,"1000");
-
-        if(null != projectContractInfo){
-            if(projectContractInfo.getWorkClientInfoList().size()>0){
-                model.addAttribute("workClientInfoName", projectContractInfo.getWorkClientInfoList().get(0).getName());
-            }
-        }
-        if (StringUtils.isNotBlank(projectReportRecord.getView()) && projectReportRecord.getView().equals("view")){
-            return "modules/ruralprojectrecords/cost/projectReportRecord/projectReportRecordView";
-        }else if (StringUtils.isNotBlank(projectReportRecord.getView()) && projectReportRecord.getView().equals("modiftApply")){
-            ProcessInstance processInstance = actTaskService.getProcIns(projectReportRecord.getProcessInstanceId());
-            if (processInstance!=null) {
-                Task taskInfok = actTaskService.getCurrentTaskInfo(processInstance);
-                Act act = new Act();
-                act.setTaskId(taskInfok.getId());
-                act.setTaskName(taskInfok.getName());
-                act.setProcDefId(taskInfok.getProcessDefinitionId());
-                act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
-                act.setProcInsId(taskInfok.getProcessInstanceId());
-                act.setTask(taskInfok);
-                projectReportRecord.setAct(act);
-            }
-            return "modules/projectcontentinfo/projectReportRecordModiftApply";
-        }
-        return "modules/projectcontentinfo/projectReportRecordCaseBaseForm";
-    }
-
-    /**
      * 暂存报告归档
      * @param projectReportRecord
      * @param model
@@ -1012,70 +910,6 @@ public class RuralCostProjectMessageNewTwoController extends BaseController {
         return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
     }
 
-
-    /**
-     * 保存项目案例文件,并进行处理
-     */
-    @RequestMapping(value = "saveCaseBaseRecord")
-    public String saveCaseBaseRecord(ProjectReportRecord projectReportRecord, Model model, RedirectAttributes redirectAttributes,Integer saveAuditFlag) throws Exception{
-        //获取项目信息
-        RuralProjectRecords ruralProjectRecords = projectRecordsService.get(projectReportRecord.getReport().getProject().getId());
-        addMessage(redirectAttributes, "案例数据保存成功");
-
-
-        //对上传的文件进行同步到dify
-        //查询案例相关的文件
-        //获取案例类型参数
-        List<ProjectTemplateInfo> caseBaseProjectTemplateList = projectTemplateDao.getCaseBaseAccessoryListByParentId("14");
-        List<Workattachment> attachmentAllList = Lists.newArrayList();
-        for (ProjectTemplateInfo projectTemplateInfo : caseBaseProjectTemplateList) {
-            //根据项目id和案例类型信息查询项目案例的所有项目
-            Workattachment workAttachment = new Workattachment();
-            workAttachment.setAttachmentId(projectTemplateInfo.getId());
-            workAttachment.setProjectId(ruralProjectRecords.getId());
-            workAttachment.setAttachmentFlag("100");
-            List<Workattachment> attachmentList = workattachmentService.getAttList(workAttachment);
-            for (Workattachment workattachment : attachmentList) {
-                workattachment.setProjectId("");
-                workattachment.setId("");
-                workattachment.setAttachmentName(ruralProjectRecords.getProjectReportNumber() + "-" + workattachment.getAttachmentName());
-            }
-            attachmentAllList.addAll(attachmentList);
-        }
-        if(attachmentAllList.size()>0){
-            //先根据id查询案例资料的知识库中是否存在数据,如果存在,则将其进行删除。
-            List<KnowledgeSharingInfo> byProjectId = knowledgeSharingDetailsService.getByProjectId(ruralProjectRecords.getId());
-            for (KnowledgeSharingInfo knowledgeSharingInfo : byProjectId) {
-                knowledgeSharingDetailsService.delete(knowledgeSharingInfo);
-            }
-
-            KnowledgeSharingInfo knowledgeSharingInfo = new KnowledgeSharingInfo();
-            knowledgeSharingInfo.setColumnId("10");
-            knowledgeSharingInfo.setSubject(ruralProjectRecords.getProjectName() + "案例资料文件");
-            knowledgeSharingInfo.setWorkAttachments(attachmentAllList);
-            knowledgeSharingInfo.setCreateBy(UserUtils.getUser());
-            knowledgeSharingInfo.setCreateDate(new Date());
-            knowledgeSharingInfo.setUpdateBy(UserUtils.getUser());
-            knowledgeSharingInfo.setUpdateDate(new Date());
-            knowledgeSharingInfo.setProjectId(ruralProjectRecords.getId());
-            knowledgeSharingDetailsService.save(knowledgeSharingInfo);
-            knowledgeSharingDetailsService.saveToDify(knowledgeSharingInfo, "1");
-        }
-
-        if (StringUtils.isNotBlank(projectReportRecord.getHome()) && "home".equals(projectReportRecord.getHome())) {
-            //修改代办状态
-            workProjectNotifyService.updateCaseBaseNotifyStatus(ruralProjectRecords.getId(), "113");
-            return "redirect:" + Global.getAdminPath() + "/home/?repage";
-        }else if (StringUtils.isNotBlank(projectReportRecord.getHome()) && "notifyList".equals(projectReportRecord.getHome())) {
-            //修改代办状态
-            workProjectNotifyService.updateCaseBaseNotifyStatus(ruralProjectRecords.getId(), "113");
-            return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
-        }
-        //跳转到个人案例项目页面
-        return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
-    }
-
-
     public void sendProjectInfoDataToCloud(ProjectReportRecord reportData){
         String pathFlagStr = Global.getConfig("SZ_PATH_flag");
         boolean pathFlag = Boolean.parseBoolean(pathFlagStr);

+ 853 - 31
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectRecordsOwnCaseBaseController.java

@@ -1,18 +1,62 @@
 package com.jeeplus.modules.ruralprojectrecords.web;
 
+import com.jeeplus.common.config.Global;
 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.act.entity.Act;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.businessQuestions.entity.BusinessQuestions;
+import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingInfo;
+import com.jeeplus.modules.knowledgeSharing.service.KnowledgeSharingDetailsService;
+import com.jeeplus.modules.projectAccessory.dao.ProjectTemplateDao;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
+import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
+import com.jeeplus.modules.projectEngineering.entity.ProjectEngineeringInfo;
+import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportDataTwo;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
+import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectContentDataService;
+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.ProjectPlanInfo;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
+import com.jeeplus.modules.ruralprojectrecords.entity.ProjectCaseBaseAudit;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
-import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsCaseBaseService;
-import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
+import com.jeeplus.modules.ruralprojectrecords.entity.SubProjectInfo;
+import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
+import com.jeeplus.modules.ruralprojectrecords.service.*;
+import com.jeeplus.modules.sys.entity.MainDictDetail;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.service.UserService;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
+import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
+import com.jeeplus.modules.workclientinfo.service.WorkClientInfoService;
 import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
+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 com.jeeplus.modules.workreview.entity.WorkReviewAudit;
+import com.jeeplus.modules.workreview.service.WorkReviewStandardService;
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
 import jersey.repackaged.com.google.common.collect.Lists;
+import org.activiti.engine.HistoryService;
+import org.activiti.engine.history.HistoricProcessInstance;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.activiti.engine.task.Task;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -21,13 +65,12 @@ 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.multipart.MultipartFile;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
 @Controller
@@ -35,22 +78,60 @@ import java.util.Map;
 public class RuralProjectRecordsOwnCaseBaseController extends BaseController {
 
     @Autowired
-    private RuralProjectRecordsCaseBaseService service;
+    private RuralProjectRecordsCaseBaseService caseBaseService;
+    @Autowired
+    private RuralProjectRecordsOwnCaseBaseService service;
     @Autowired
     private RuralProjectRecordsService projectRecordsService;
     @Autowired
-    private RuralProjectRecordsCaseBaseService caseBaseService;
+    private ProjectReportDataService projectReportDataService;
+    @Autowired
+    private ProjectcontentinfoService projectcontentinfoService;
+    @Autowired
+    private WorkClientInfoService workClientInfoService;
+    @Autowired
+    private ProjectContentDataService projectContentDataService;
+    @Autowired
+    private WorkReviewStandardService workReviewStandardService;
+    @Autowired
+    private SubProjectInfoService subProjectInfoService;
+    @Autowired
+    private WorkContractInfoService workContractInfoService;
+    @Autowired
+    private ProjectPlanService projectPlanService;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    protected HistoryService historyService;
+    @Autowired
+    private ProjectEngineeringService engineeringService;
+    @Autowired
+    private RuralProjectMessageNewService ruralProjectMessageService;
+    @Autowired
+    private ProjectReportRecordService projectReportRecordService;
+    @Autowired
+    private ActTaskService actTaskService;
+    @Autowired
+    private ProjectTemplateService projectTemplateService;
+    @Autowired
+    private ProjectTemplateDao projectTemplateDao;
     @Autowired
     private WorkProjectNotifyService workProjectNotifyService;
+    @Autowired
+    private WorkattachmentService workattachmentService;
+    @Autowired
+    private KnowledgeSharingDetailsService knowledgeSharingDetailsService;
+
+    private static byte[] SYN_BYTE = new byte[0];
 
     @ModelAttribute
-    public RuralProjectRecords get(@RequestParam(required=false) String id) {
-        RuralProjectRecords entity = null;
-        if (StringUtils.isNotBlank(id)){
-            entity = projectRecordsService.get(id);
+    public ProjectCaseBaseAudit get(@RequestParam(required = false) String id) {
+        ProjectCaseBaseAudit entity = null;
+        if (StringUtils.isNotBlank(id)) {
+            entity = service.get(id);
         }
-        if (entity == null){
-            entity = new RuralProjectRecords();
+        if (entity == null) {
+            entity = new ProjectCaseBaseAudit();
         }
         return entity;
     }
@@ -61,20 +142,20 @@ public class RuralProjectRecordsOwnCaseBaseController extends BaseController {
     @RequiresPermissions("ruralProject:RuralProjectRecordsOwnCaseBase:list")
     @RequestMapping(value = {"list", ""})
     public String list(RuralProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
-        if(UserUtils.isManager()){
-            model.addAttribute("flag","1");
+        if (UserUtils.isManager()) {
+            model.addAttribute("flag", "1");
         }
         String oldSubmitMoney = "";
         //进行查询之后进行任何操作,返回还是查询之后的数据页面
-        if (StringUtils.isNotBlank(projectRecords.getToflag())){
-            if (projectRecords.getToflag().equals("1")){
+        if (StringUtils.isNotBlank(projectRecords.getToflag())) {
+            if (projectRecords.getToflag().equals("1")) {
                 request.getSession().removeAttribute("searchprojectRecordsList");
-                RuralProjectRecords search=projectRecords;
-                request.getSession().setAttribute("searchprojectRecordsList",search);
+                RuralProjectRecords search = projectRecords;
+                request.getSession().setAttribute("searchprojectRecordsList", search);
             }
-        }else{
-            if (request.getSession().getAttribute("searchprojectRecordsList")!=null){
-                projectRecords= (RuralProjectRecords) request.getSession().getAttribute("searchprojectRecordsList");
+        } else {
+            if (request.getSession().getAttribute("searchprojectRecordsList") != null) {
+                projectRecords = (RuralProjectRecords) request.getSession().getAttribute("searchprojectRecordsList");
                 model.addAttribute("ruralProjectRecords", projectRecords);
             }
         }
@@ -82,21 +163,21 @@ public class RuralProjectRecordsOwnCaseBaseController extends BaseController {
         //添加查询类型(工程咨询)
         List<String> typeList = Lists.newArrayList();
         String oldProjectSort = null;
-        if (StringUtils.isBlank(projectRecords.getAttachmentProjectSort())){
+        if (StringUtils.isBlank(projectRecords.getAttachmentProjectSort())) {
             typeList.add("1");
             typeList.add("2");
-        }else {
-            oldProjectSort=projectRecords.getAttachmentProjectSort();
-            String attachmentProjectSort=projectRecords.getAttachmentProjectSort();
+        } else {
+            oldProjectSort = projectRecords.getAttachmentProjectSort();
+            String attachmentProjectSort = projectRecords.getAttachmentProjectSort();
             typeList.add(attachmentProjectSort.split("-")[0]);
             projectRecords.setAttachmentProjectSort(attachmentProjectSort.split("-")[1]);
         }
         projectRecords.setCreateBy(UserUtils.getUser());
-        Page<RuralProjectRecords> page = service.findPage(new Page<RuralProjectRecords>(request, response), projectRecords);
+        Page<RuralProjectRecords> page = caseBaseService.findPage(new Page<RuralProjectRecords>(request, response), projectRecords);
         model.addAttribute("page", page);
-        if(null != projectRecords.getWorkContractInfo()){
+        if (null != projectRecords.getWorkContractInfo()) {
             model.addAttribute("workContractInfoName", projectRecords.getWorkContractInfo().getName());
-            if(null != projectRecords.getWorkContractInfo().getClient()){
+            if (null != projectRecords.getWorkContractInfo().getClient()) {
                 model.addAttribute("workContractInfoClientName", projectRecords.getWorkContractInfo().getClient().getName());
             }
         }
@@ -115,7 +196,7 @@ public class RuralProjectRecordsOwnCaseBaseController extends BaseController {
                 }
             }
         }
-        if(StringUtils.isNotBlank(oldSubmitMoney)){
+        if (StringUtils.isNotBlank(oldSubmitMoney)) {
             projectRecords.setSubmitMoney(oldSubmitMoney);
         }
 
@@ -128,5 +209,746 @@ public class RuralProjectRecordsOwnCaseBaseController extends BaseController {
         return "modules/ruralprojectrecords/cost/ruralProjectRecordsOwnCaseBaseList";
     }
 
+    /**
+     * 根据信息获取归档信息并调转页面
+     */
+    @RequestMapping(value = "formCaseBase")
+    public String formCaseBase(ProjectReportRecord projectReportRecord, Model model) throws Exception {
+        //查询“配农网”工程类型id
+        String engineeringId = engineeringService.getEngineeringId("202");
+        //获取项目信息
+        ProjectRecords projectRecords = new ProjectRecords();
+        RuralProjectRecords ruralProjectRecords = projectRecordsService.get(projectReportRecord.getReportId());
+        MyBeanUtils.copyBeanNotNull2Bean(ruralProjectRecords, projectRecords);
+        ProjectReportData reportData = ruralProjectMessageService.getProjectReportDateByProjectId(projectReportRecord.getReportId());
+        if (StringUtils.isBlank(projectReportRecord.getView()) || !projectReportRecord.getView().equals("view")) {
+            if (StringUtils.isNotBlank(projectReportRecord.getReportId())) {
+                projectReportRecord = projectReportRecordService.getprojectReportRecord(reportData.getId());
+            }
+        }
+
+        //获取合同信息
+        WorkContractInfo projectContractInfo = ruralProjectMessageService.getProjectContractInfo(projectRecords.getWorkContractInfo().getId());
+        projectRecords.setWorkContractInfo(projectContractInfo);
+        reportData.setProject(projectRecords);
+        projectReportRecord.setReport(reportData);
+        projectReportRecord.setUploadMode(uploadMode);
+        model.addAttribute("projectReportRecord", projectReportRecord);
+        model.addAttribute("project", projectReportRecord.getReport().getProject());
+
+        ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
+        //添加项目类型
+        relateInfo.setAttachmentProjectType(ruralProjectRecords.getProjectType());
+        relateInfo.setAttachmentProjectSort(ruralProjectRecords.getAttachmentProjectSort());
+        //判断是否为打包项目,打包项目无需查看项目送审金额是否为500w以上判定
+        String money = ruralProjectRecords.getSubmitMoney();
+        Integer approvalMoney = null;
+        if (StringUtils.isBlank(money)) {
+            approvalMoney = 1;
+        } else {
+            approvalMoney = Integer.parseInt(money);
+        }
+        switch (approvalMoney) {
+            case 0:
+                //金额为0
+                relateInfo.setAttachmentProjectApprovalMoney(null);
+                break;
+            case 1:
+                //500w以下金额状态
+                relateInfo.setAttachmentProjectApprovalMoney("1");
+                break;
+            case 2:
+                //500w以上金额状态
+                relateInfo.setAttachmentProjectApprovalMoney("2");
+                break;
+        }
+
+        //添加报告类型
+        relateInfo.setRequiredStage(2);
+        relateInfo.setId(ruralProjectRecords.getId());
+        //查询项目是否时案例项目
+        ruralProjectRecords = projectRecordsService.getCaseBaseByProjectId(ruralProjectRecords);
+        //查询报告文件、依据性文件、其他文件必填列表以及数据
+        List<MainDictDetail> mainDictDetails = projectTemplateService.attachmentTemplateList();
+        //文件处理
+        projectTemplateService.disposeProjectTemplateFile(mainDictDetails, relateInfo, engineeringId, ruralProjectRecords, projectReportRecord, "1000");
+
+        ProjectCaseBaseAudit projectCaseBaseAudit = service.getByProjectId(ruralProjectRecords.getId());
+        if (null == projectCaseBaseAudit) {
+            projectCaseBaseAudit = new ProjectCaseBaseAudit();
+            projectCaseBaseAudit.setProjectId(ruralProjectRecords.getId());
+        }
+        model.addAttribute("projectCaseBaseAudit", projectCaseBaseAudit);
+
+        if (null != projectContractInfo) {
+            if (projectContractInfo.getWorkClientInfoList().size() > 0) {
+                model.addAttribute("workClientInfoName", projectContractInfo.getWorkClientInfoList().get(0).getName());
+            }
+        }
+        if (StringUtils.isNotBlank(projectReportRecord.getView()) && projectReportRecord.getView().equals("view")) {
+            return "modules/ruralprojectrecords/cost/projectReportRecord/projectReportRecordView";
+        } else if (StringUtils.isNotBlank(projectReportRecord.getView()) && projectReportRecord.getView().equals("modiftApply")) {
+            ProcessInstance processInstance = actTaskService.getProcIns(projectReportRecord.getProcessInstanceId());
+            if (processInstance != null) {
+                Task taskInfok = actTaskService.getCurrentTaskInfo(processInstance);
+                Act act = new Act();
+                act.setTaskId(taskInfok.getId());
+                act.setTaskName(taskInfok.getName());
+                act.setProcDefId(taskInfok.getProcessDefinitionId());
+                act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
+                act.setProcInsId(taskInfok.getProcessInstanceId());
+                act.setTask(taskInfok);
+                projectReportRecord.setAct(act);
+            }
+            return "modules/projectcontentinfo/projectReportRecordModiftApply";
+        }
+        return "modules/projectcontentinfo/projectReportRecordCaseBaseForm";
+    }
+
+    /**
+     * 保存报告归档
+     */
+    @RequestMapping(value = "storeCaseBaseRecord")
+    public String storeCaseBaseRecord(ProjectCaseBaseAudit projectCaseBaseAudit, Model model, RedirectAttributes redirectAttributes) throws Exception {
+        //根据项目id查询案例文件流程信息
+        projectCaseBaseAudit = service.getByProjectId(projectCaseBaseAudit.getProjectId());
+        addMessage(redirectAttributes, "案例项目文件暂存成功");
+
+        if (null != projectCaseBaseAudit) {//编辑表单保存
+            projectCaseBaseAudit.setIsNewRecord(false);
+            projectCaseBaseAudit.setStatus(1);
+            service.store(projectCaseBaseAudit);//保存
+        } else {//新增表单保存
+            projectCaseBaseAudit = new ProjectCaseBaseAudit();
+            projectCaseBaseAudit.setStatus(1);
+            projectCaseBaseAudit.setCompany(UserUtils.getUser().getCompany());
+            projectCaseBaseAudit.setOffice(UserUtils.getUser().getOffice());
+            projectCaseBaseAudit.setProjectId(projectCaseBaseAudit.getProjectId());
+            projectCaseBaseAudit.setIsNewRecord(true);
+            service.store(projectCaseBaseAudit);//保存
+        }
+        addMessage(redirectAttributes, "案例项目文件暂存成功");
+        return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
+    }
+
+
+    /**
+     * 保存项目案例文件,并进行处理
+     */
+    @RequestMapping(value = "saveCaseBaseRecord")
+    public String saveCaseBaseRecord(ProjectCaseBaseAudit projectCaseBaseAudit, Model model, RedirectAttributes redirectAttributes) throws Exception {
+        //获取项目信息
+        RuralProjectRecords ruralProjectRecords = projectRecordsService.get(projectCaseBaseAudit.getProjectId());
+        addMessage(redirectAttributes, "案例数据保存成功");
+
+        //根据项目id查询案例文件流程信息
+        ProjectCaseBaseAudit t = service.getByProjectId(projectCaseBaseAudit.getProjectId());
+        if (null != t) {
+            MyBeanUtils.copyBeanNotNull2Bean(projectCaseBaseAudit, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+            t.setIsNewRecord(false);
+            service.save(t);//保存
+        } else {//新增表单保存
+            projectCaseBaseAudit.setCompany(UserUtils.getUser().getCompany());
+            projectCaseBaseAudit.setOffice(UserUtils.getUser().getOffice());
+            projectCaseBaseAudit.setIsNewRecord(true);
+            service.save(projectCaseBaseAudit);//保存
+        }
+
+
+        //对上传的文件进行同步到dify
+        //查询案例相关的文件
+        //获取案例类型参数
+        List<ProjectTemplateInfo> caseBaseProjectTemplateList = projectTemplateDao.getCaseBaseAccessoryListByParentId("14");
+        List<Workattachment> attachmentAllList = com.google.common.collect.Lists.newArrayList();
+        for (ProjectTemplateInfo projectTemplateInfo : caseBaseProjectTemplateList) {
+            //根据项目id和案例类型信息查询项目案例的所有项目
+            Workattachment workAttachment = new Workattachment();
+            workAttachment.setAttachmentId(projectTemplateInfo.getId());
+            workAttachment.setProjectId(ruralProjectRecords.getId());
+            workAttachment.setAttachmentFlag("100");
+            List<Workattachment> attachmentList = workattachmentService.getAttList(workAttachment);
+            for (Workattachment workattachment : attachmentList) {
+                workattachment.setProjectId("");
+                workattachment.setId("");
+                workattachment.setAttachmentName(ruralProjectRecords.getProjectReportNumber() + "-" + workattachment.getAttachmentName());
+            }
+            attachmentAllList.addAll(attachmentList);
+        }
+        if(attachmentAllList.size()>0){
+            //先根据id查询案例资料的知识库中是否存在数据,如果存在,则将其进行删除。
+            List<KnowledgeSharingInfo> byProjectId = knowledgeSharingDetailsService.getByProjectId(ruralProjectRecords.getId());
+            for (KnowledgeSharingInfo knowledgeSharingInfo : byProjectId) {
+                knowledgeSharingDetailsService.delete(knowledgeSharingInfo);
+            }
+
+            KnowledgeSharingInfo knowledgeSharingInfo = new KnowledgeSharingInfo();
+            knowledgeSharingInfo.setColumnId("10");
+            knowledgeSharingInfo.setSubject(ruralProjectRecords.getProjectName() + "案例资料文件");
+            knowledgeSharingInfo.setWorkAttachments(attachmentAllList);
+            knowledgeSharingInfo.setCreateBy(UserUtils.getUser());
+            knowledgeSharingInfo.setCreateDate(new Date());
+            knowledgeSharingInfo.setUpdateBy(UserUtils.getUser());
+            knowledgeSharingInfo.setUpdateDate(new Date());
+            knowledgeSharingInfo.setProjectId(ruralProjectRecords.getId());
+            knowledgeSharingDetailsService.save(knowledgeSharingInfo);
+            knowledgeSharingDetailsService.saveToDify(knowledgeSharingInfo, "1");
+        }
+
+        if (StringUtils.isNotBlank(projectCaseBaseAudit.getHome()) && "home".equals(projectCaseBaseAudit.getHome())) {
+            //修改代办状态
+            workProjectNotifyService.updateCaseBaseNotifyStatus(ruralProjectRecords.getId(), "113");
+            return "redirect:" + Global.getAdminPath() + "/home/?repage";
+        } else if (StringUtils.isNotBlank(projectCaseBaseAudit.getHome()) && "notifyList".equals(projectCaseBaseAudit.getHome())) {
+            //修改代办状态
+            workProjectNotifyService.updateCaseBaseNotifyStatus(ruralProjectRecords.getId(), "113");
+            return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
+        }
+        //跳转到个人案例项目页面
+        return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
+    }
+
+    /**
+     * 案例文件审核
+     * @param projectCaseBaseAudit
+     * @param model
+     * @param redirectAttributes
+     * @return
+     */
+    @RequestMapping("saveAudit")
+    public String saveAudit(ProjectCaseBaseAudit projectCaseBaseAudit, Model model,
+                            RedirectAttributes redirectAttributes) {
+        String home = projectCaseBaseAudit.getHome();
+        try {
+            String taskDefKey = projectCaseBaseAudit.getAct().getTaskDefKey();
+            //当状态为未通过时,重新修改数据
+            if ("modifyApply".equals(taskDefKey)) {
+                projectCaseBaseAudit.getAct().setComment("重新申请");
+            }
+            List<User> users = UserUtils.getByProssType(projectCaseBaseAudit.getProcessInstanceId(),1);
+            if ("alxmwjshr".equals(taskDefKey)){
+                users = UserUtils.getByProssType(projectCaseBaseAudit.getProcessInstanceId(),1);
+                if (users==null )
+                    users = UserUtils.getByRoleActivityEnname("alxmwjshr",3,projectCaseBaseAudit.getOffice().getId(),"4",projectCaseBaseAudit.getCreateBy());
+            }else if ("modifyApply".equals(taskDefKey)){
+                users = UserUtils.getByProssType(projectCaseBaseAudit.getProcessInstanceId(),1);
+            }
+            String flag = projectCaseBaseAudit.getAct().getFlag();
+            if ("yes".equals(flag) && (users==null || users.size()==0)){
+                addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
+            }else {
+                ProjectCaseBaseAudit t = service.get(projectCaseBaseAudit.getId());//从数据库取出记录的值
+                if(t.getStatus() == 5){
+                    addMessage(redirectAttributes, "案例文件审核已完成,无法再次送审");
+                    if (StringUtils.isNotBlank(home) && "home".equals(home)) {
+                        return "redirect:" + Global.getAdminPath() + "/home/?repage";
+                    }else if (StringUtils.isNotBlank(home) && "notifyList".equals(home)){
+                        return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
+                    } else {
+                        return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
+                    }
+                }
+                String str = service.auditSave(projectCaseBaseAudit,users);
+                addMessage(redirectAttributes, str);
+            }
+        }catch (Exception e){
+            addMessage(redirectAttributes, "案例文件审核流程审批失败");
+            logger.error("Exception e:"+e);
+        }
+
+        if (StringUtils.isNotBlank(home) && "home".equals(home)) {
+            return "redirect:" + Global.getAdminPath() + "/home/?repage";
+        }else if (StringUtils.isNotBlank(home) && "notifyList".equals(home)){
+            return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
+        } else {
+            return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
+        }
+    }
+
+    /**
+     * 撤回
+     *
+     * @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 processInstanceId = requestMap.get("processInstanceId");
+        String id = requestMap.get("id");
+        try {
+            ProjectCaseBaseAudit projectCaseBaseAudit = service.get(id);
+            if (3 == projectCaseBaseAudit.getStatus() || 4 == projectCaseBaseAudit.getStatus()) {
+                addMessage(redirectAttributes, "案例项目文件审核已撤回、驳回,请勿重复操作");
+                return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
+            } else if (5 == projectCaseBaseAudit.getStatus()) {
+                addMessage(redirectAttributes, "案例项目文件审核已审批通过,无法撤回");
+                return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
+            }
+            service.cancelInvalidate(projectCaseBaseAudit);
+            addMessage(redirectAttributes, "撤回该案例项目文件审核成功");
+        } catch (Exception e) {
+            logger.info(e.getMessage());
+            addMessage(redirectAttributes, "撤回该案例项目文件审核失败");
+        }
+        return "redirect:" + Global.getAdminPath() + "/ruralProject/RuralProjectRecordsOwnCaseBase/?repage";
+    }
+
+
+
+    /**
+     * 根据信息获取归档信息并调转页面
+     */
+    @RequestMapping(value = "modify")
+    public String modify(ProjectReportRecord projectReportRecord, Model model) throws Exception {
+        //查询“配农网”工程类型id
+        String engineeringId = engineeringService.getEngineeringId("202");
+        //获取项目信息
+        ProjectRecords projectRecords = new ProjectRecords();
+        RuralProjectRecords ruralProjectRecords = projectRecordsService.get(projectReportRecord.getReportId());
+        MyBeanUtils.copyBeanNotNull2Bean(ruralProjectRecords, projectRecords);
+
+
+
+
+
+
+        //查询案例流程信息
+        ProjectCaseBaseAudit projectCaseBaseAudit = service.getByProjectId(ruralProjectRecords.getId());
+        //查询项目是否时案例项目
+        ruralProjectRecords = projectRecordsService.getCaseBaseByProjectId(ruralProjectRecords);
+        ProjectReportData projectReportData = projectReportDataService.getByNumber(ruralProjectRecords.getProjectReportNumber());
+        projectReportRecord = projectReportRecordService.getProjectReportRecordByProjectId(projectCaseBaseAudit.getProjectId());
+        Projectcontentinfo projectcontentinfo = projectcontentinfoService.getByInfoId(projectReportData.getId());
+        projectcontentinfo.setProjectReportData(projectReportData);
+        //获取子项目列表信息
+        List<SubProjectInfo> subProjectInfos = this.queryReportDetails(ruralProjectRecords.getId());
+        //获取合同信息
+        WorkContractInfo workContractInfo = this.queryWorkContract(ruralProjectRecords.getId());
+        if (null != workContractInfo) {
+            WorkClientInfo clientInfo = workClientInfoService.get(workContractInfo.getClient().getId());
+            model.addAttribute("workClientInfo", clientInfo);
+            if (StringUtils.isNotBlank(workContractInfo.getChargeCriterion())) {
+                //收费标准
+                String[] biao = workContractInfo.getChargeCriterion().split(",");
+                List<String> chargeCriterionList = new ArrayList<>();
+                for (int i = 0; i < biao.length; i++) {
+                    chargeCriterionList.add(biao[i]);
+                }
+                projectReportRecord.setChargeCriterionList(chargeCriterionList);
+            }
+        }
+
+
+        WorkContractInfo projectContractInfo = ruralProjectMessageService.getProjectContractInfo(ruralProjectRecords.getWorkContractInfo().getId());
+        ruralProjectRecords.setWorkContractInfo(projectContractInfo);
+        MyBeanUtils.copyBeanNotNull2Bean(ruralProjectRecords, projectReportRecord.getReport().getProject());//将编辑表单中的非NULL值覆盖数据库记录中的值
+        if (null != projectContractInfo) {
+            if (projectContractInfo.getWorkClientInfoList().size() > 0) {
+                model.addAttribute("workClientInfoName", projectContractInfo.getWorkClientInfoList().get(0).getName());
+            }
+        }
+        ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
+        //添加项目类型
+        relateInfo.setAttachmentProjectType(ruralProjectRecords.getProjectType());
+        relateInfo.setAttachmentProjectSort(ruralProjectRecords.getAttachmentProjectSort());
+        String money = ruralProjectRecords.getSubmitMoney();
+        Integer approvalMoney = null;
+        if (StringUtils.isBlank(money)) {
+            approvalMoney = 1;
+        } else {
+            approvalMoney = Integer.parseInt(money);
+        }
+        switch (approvalMoney) {
+            case 0:
+                //金额为0
+                relateInfo.setAttachmentProjectApprovalMoney(null);
+                break;
+            case 1:
+                //500w以下金额状态
+                relateInfo.setAttachmentProjectApprovalMoney("1");
+                break;
+            case 2:
+                //500w以上金额状态
+                relateInfo.setAttachmentProjectApprovalMoney("2");
+                break;
+        }
+
+        //添加报告类型
+        //relateInfo.setRequiredStage(2);
+        List<Integer> requiredStageList = com.google.common.collect.Lists.newArrayList();
+        requiredStageList.add(1);
+        requiredStageList.add(2);
+        relateInfo.setRequiredStageList(requiredStageList);
+        relateInfo.setId(ruralProjectRecords.getId());
+        //查询报告文件、依据性文件、其他文件必填列表以及数据
+        List<MainDictDetail> mainDictDetails = projectTemplateService.attachmentTemplateList();
+        projectTemplateService.disposeProjectTemplateFile(mainDictDetails, relateInfo, engineeringId, ruralProjectRecords, projectcontentinfo, "1000");
+
+        projectReportRecord.setUploadMode(uploadMode);
+        //获取项目基础信息
+        projectRecordsService.queryProjectDetail(ruralProjectRecords);
+        //工程咨询
+        List<MainDictDetail> mainDictList = com.google.common.collect.Lists.newArrayList();
+        if ("1".equals(ruralProjectRecords.getProjectType())) {
+            mainDictList = DictUtils.getMainDictList("attachment_project_sort");
+            //造价审核
+        } else if ("2".equals(ruralProjectRecords.getProjectType())) {
+            mainDictList = DictUtils.getMainDictList("attachment_project_sort_cost");
+        }
+        if (StringUtils.isNotBlank(ruralProjectRecords.getAttachmentProjectSort())) {
+            //处理项目类别
+            for (MainDictDetail info : mainDictList) {
+                if (ruralProjectRecords.getAttachmentProjectSort().equals(info.getValue())) {
+                    ruralProjectRecords.setAttachmentProjectSort(info.getLabel());
+                    break;
+                }
+            }
+        }
+        model.addAttribute("projectcontentinfo", projectcontentinfo);
+        model.addAttribute("projectRecords", ruralProjectRecords);
+        model.addAttribute("projectReportData", projectReportData);
+        model.addAttribute("workContractInfo", workContractInfo);
+        model.addAttribute("projectReportRecord", projectReportRecord);
+        model.addAttribute("project", projectReportRecord.getReport().getProject());
+        //tap页
+        //查询所有的工程类型
+        List<ProjectEngineeringInfo> projectEngineeringInfo = engineeringService.findList(new ProjectEngineeringInfo());
+        model.addAttribute("projectEngineeringInfo", projectEngineeringInfo);
+        //项目计划
+        RuralProjectRecords projectRecordPlans = this.planView(ruralProjectRecords.getId());
+        model.addAttribute("projectRecordPlans", projectRecordPlans);
+        //获取质量复核项目组成员
+        List<RuralReportConsultant> consultantinfo = this.qualityView(ruralProjectRecords, projectReportData);
+        model.addAttribute("consultantinfo", consultantinfo);
+        //获取总审人员
+        User user = UserUtils.get(projectReportData.getBzshbUserId());
+        model.addAttribute("bzshbUserName", user.getName());
+        //质量复核标准展示
+        String review = "";
+        if ("2".equals(ruralProjectRecords.getSubmitMoney())) {
+            review = "1";
+        }
+        ;
+        List<WorkReviewAudit> workReviewAuditList = projectContentDataService.findListReview(review, "质量复核");
+        WorkReviewAudit revAudit = new WorkReviewAudit();
+        String type = "4";
+        revAudit.setCompanyId(UserUtils.getSelectCompany().getId());
+        revAudit.setType(type);
+        revAudit.setReportId(projectReportData.getId());
+        List<WorkReviewAudit> reaudits = workReviewStandardService.findAuditList(revAudit);
+        for (WorkReviewAudit reAudit : workReviewAuditList) {
+            for (WorkReviewAudit audit : reaudits) {
+                if (reAudit.getId().equals(audit.getStandardId())) {
+                    reAudit.setDeductOption(audit.getDeductOption());
+                    break;
+                }
+            }
+        }
+        model.addAttribute("datalist", workReviewAuditList);
+        //拆线呢报告签发评分展示项
+        List<WorkReviewAudit> reviewAuditList = projectContentDataService.findListIssue(review, "报告签发");
+        //查询报告签发评分评论数据
+        WorkReviewAudit workReviewAuditTwo = new WorkReviewAudit();
+        type = "4";
+        workReviewAuditTwo.setCompanyId(UserUtils.getSelectCompany().getId());
+        workReviewAuditTwo.setType(type);
+        workReviewAuditTwo.setReportId(projectReportData.getId());
+        List<WorkReviewAudit> rreviewAuditList = workReviewStandardService.findAuditList(workReviewAuditTwo);
+        for (WorkReviewAudit reAudit : reviewAuditList) {
+            for (WorkReviewAudit audit : rreviewAuditList) {
+                if (reAudit.getId().equals(audit.getStandardId())) {
+                    reAudit.setDeductOption(audit.getDeductOption());
+                    break;
+                }
+            }
+        }
+        model.addAttribute("datalistTwo", reviewAuditList);
+        model.addAttribute("projectCaseBaseAudit", projectCaseBaseAudit);
+
+        projectReportRecord.setFileAttachmentList(projectRecordsService.disposeDataAttachment(projectcontentinfo.getFileAttachmentList()));
+        projectReportRecord.setFileGistdataList(projectRecordsService.disposeDataAttachment(projectcontentinfo.getFileGistdataList()));
+        projectReportRecord.setFileOtherList(projectRecordsService.disposeDataAttachment(projectcontentinfo.getFileOtherList()));
+        projectReportRecord.setFileCaseBaseList(projectcontentinfo.getFileCaseBaseList());
+
+
+        //ProjectReportData reportData = ruralProjectMessageService.getProjectReportDateByProjectId(projectReportRecord.getReportId());
+        if (StringUtils.isBlank(projectReportRecord.getView()) || !projectReportRecord.getView().equals("view")) {
+            if (StringUtils.isNotBlank(projectReportRecord.getReportId())) {
+                projectReportRecord = projectReportRecordService.getprojectReportRecord(projectReportData.getId());
+            }
+        }
+
+        //获取合同信息
+        projectReportData.setProject(projectRecords);
+        projectReportRecord.setReport(projectReportData);
+        projectReportRecord.setUploadMode(uploadMode);
+        model.addAttribute("projectReportRecord", projectReportRecord);
+        model.addAttribute("project", projectReportRecord.getReport().getProject());
+
+
+        model.addAttribute("projectCaseBaseAudit", projectCaseBaseAudit);
+
+        Act act = getByAct(projectCaseBaseAudit.getProcessInstanceId());
+        projectCaseBaseAudit.setAct(act);
+
+        return "modules/projectcontentinfo/projectCaseBaseSupplementModify";
+    }
+
+    public Act getByAct(String processInstanceId){
+        Act act = new Act();
+        HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
+        ProcessInstance processInstance = actTaskService.getProcIns(processInstanceId);
+        if (processInstance!=null) {
+            List<Task> taskList = actTaskService.getCurrentTaskList(processInstance);
+            if(taskList!=null && taskList.size()>1){
+                for (Task taskInfok:taskList) {
+                    if (taskInfok.getAssignee().equals(UserUtils.getUser().getId())) {
+                        act.setTaskId(taskInfok.getId());
+                        act.setTaskName(taskInfok.getName());
+                        act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
+                        act.setProcDefId(taskInfok.getProcessDefinitionId());
+                        act.setProcInsId(taskInfok.getProcessInstanceId());
+                        act.setTask(taskInfok);
+                    }
+                }
+            }else {
+                Task task = actTaskService.getCurrentTaskInfo(processInstance);
+                act.setTaskId(task.getId());
+                act.setTaskName(task.getName());
+                act.setTaskDefKey(task.getTaskDefinitionKey());
+                act.setProcDefId(task.getProcessDefinitionId());
+                act.setProcInsId(task.getProcessInstanceId());
+                act.setTask(task);
+            }
+        }
+        return  act;
+    }
+
+    /**
+     * 查询报告审核子项目详细信息
+     */
+    public List<SubProjectInfo> queryReportDetails(String projectId) {
+        RuralProjectRecords projectRecords = new RuralProjectRecords();
+        if (null != projectId) {
+            projectRecords = projectRecordsService.get(projectId);
+        }
+        //获取子项目信息
+        SubProjectInfo subProjectInfo = new SubProjectInfo();
+        subProjectInfo.setParentProId(projectId);
+        subProjectInfo.setProjectType(projectRecords.getProjectType());
+        List<SubProjectInfo> recordsList = subProjectInfoService.findList(subProjectInfo);
+        for (SubProjectInfo info : recordsList) {
+            info.setProjectType(subProjectInfo.getProjectType());
+        }
+        return recordsList;
+    }
+
+    /**
+     * 查询报告审核客户合同详细信息
+     */
+    public WorkContractInfo queryWorkContract(String projectId) {
+        RuralProjectRecords projectRecords = new RuralProjectRecords();
+        if (null != projectId) {
+            projectRecords = projectRecordsService.get(projectId);
+        }
+        //获取合同信息
+        WorkContractInfo workContractInfo = workContractInfoService.getInfoById(projectRecords.getWorkContractInfo().getId());
+        return workContractInfo;
+    }
+
+
+    //获取项目计划
+    public RuralProjectRecords planView(String projectId) {
+        //获取项目信息
+        //如果没有id则为新增 添加创建人信息和当前创建时间信息
+        RuralProjectRecords projectRecords = new RuralProjectRecords();
+        if (StringUtils.isNotBlank(projectId)) {
+            //projectRecords = ruralProjectRecordsService.get(projectRecords.getId());
+            projectRecords = projectRecordsService.getMasters(projectId);
+        } else {
+            projectRecords.setCreateBy(UserUtils.getUser());
+            projectRecords.setCreateDate(new Date());
+        }
+        ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
+        //将项目id放入项目计划表中
+        projectPlanInfo.setProjectId(projectRecords.getId());
+        //获取项目计划信息
+        List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
+        if (projectPlanList.size() == 0) {
+            //获取项目计划信息
+            List<MainDictDetail> mainDictList = DictUtils.getMainDictList("projectPlan");
+            if (mainDictList.size() > 0) {
+                for (MainDictDetail mainDict : mainDictList) {
+                    ProjectPlanInfo projectPlan = new ProjectPlanInfo();
+                    projectPlan.setProjectStage(mainDict.getLabel());
+                    //将项目负责人添加到展示栏
+                    if (null != projectRecords.getProjectLeaders()) {
+                        projectPlan.setRemindName(projectRecords.getProjectLeaders().get(0).getName());
+                        projectPlan.setRemindId(projectRecords.getProjectLeaders().get(0).getId());
+                    }
+                    //将项目等级人信息添加到完成人控件中
+                    User user = UserUtils.get(projectRecords.getCreateBy().getId());
+                    projectPlan.setFinishId(user.getId());
+                    projectPlan.setFinishName(user.getName());
+                    projectPlanList.add(projectPlan);
+                }
+            }
+        }
+        //获取 项目计划附件信息
+        List<WorkClientAttachment> workAttachmentList = projectPlanService.getWorkAttachment(projectRecords.getId());
+        projectRecords.setProjectPlanList(projectPlanList);
+        projectRecords.setWorkAttachments(workAttachmentList);
+        projectRecords.setUploadMode(uploadMode);
+        return projectRecords;
+    }
+    public List<RuralReportConsultant> qualityView(RuralProjectRecords ruralProjectRecords, ProjectReportData projectReportData) {
+        //质量复核查看
+        List<RuralReportConsultant> consultantinfo = com.google.common.collect.Lists.newArrayList();
+        //将自己添加到咨询员数据中
+        //根据用户查询技能信息
+        RuralReportConsultant currentConsultant = new RuralReportConsultant();
+        List<WorkStaffCertificate> userCertificateList = com.google.common.collect.Lists.newArrayList();
+        if (StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())) {
+            userCertificateList = ruralProjectMessageService.getCertificateByUser(ruralProjectRecords.getProjectMasterId());
+        }
+        //获取专业类型
+        List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("certificate_major");
+        for (WorkStaffCertificate certificateInfo : userCertificateList) {
+            currentConsultant.setZhucezigezhID(certificateInfo.getNum());
+            currentConsultant.setZhucezigezhKey(certificateInfo.getName());
+            for (MainDictDetail type : certificateMajor) {
+                if (certificateInfo.getMajor().equals(type.getValue())) {
+                    currentConsultant.setMajor(type.getLabel());
+                }
+            }
+            User currentUser = userService.get(ruralProjectRecords.getProjectMasterId());
+            currentConsultant.setZixunyuanName(currentUser.getName());
+            currentConsultant.setZixunyuan(currentUser.getId());
+            currentConsultant.setRole("负责人");
+            consultantinfo.add(currentConsultant);
+        }
+        //查询总审人员信息
+        RuralReportConsultant bzshbConsultant = new RuralReportConsultant();
+        //根据项目id查找报告咨询员信息
+        List<RuralReportConsultant> consultantList = ruralProjectMessageService.getConsultantsList(ruralProjectRecords.getId());
+        //使用迭代器去除重复信息
+        //排除 重新申请|撤销
+        Iterator<RuralReportConsultant> it = consultantList.iterator();
+        while (it.hasNext()) {
+            RuralReportConsultant consultant = it.next();
+            if (consultant.getZixunyuan().equals(currentConsultant.getZixunyuan())) {
+                try {
+                    MyBeanUtils.copyBeanNotNull2Bean(consultant, currentConsultant);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                it.remove();
+            } else {
+                //根据用户查询技能信息
+                List<WorkStaffCertificate> certificateList = ruralProjectMessageService.getCertificateByUser(consultant.getZixunyuan());
+                for (WorkStaffCertificate certificateInfo : certificateList) {
+                    if (certificateInfo.getName().equals(consultant.getZhucezigezhKey())) {
+                        consultant.setZhucezigezhID(certificateInfo.getNum());
+                    }
+                    for (MainDictDetail type : certificateMajor) {
+                        if (certificateInfo.getMajor().equals(type.getValue())) {
+                            consultant.setMajor(type.getLabel());
+                        }
+                    }
+                }
+                User user = userService.get(consultant.getZixunyuan());
+                if (null != user) {
+                    consultant.setZixunyuanName(user.getName());
+                    consultant.setRole("咨询员");
+                }
+                if (consultant.getZixunyuan().equals(projectReportData.getBzshbUserId())) {
+                    User chenHongXing = UserUtils.getByLoginName("陈红星");
+                    List<WorkStaffCertificate> chenHongXingCertificateList = ruralProjectMessageService.getCertificateByUser(chenHongXing.getId());
+                    //获取陈红星的造价师信息
+                    WorkStaffCertificate chenHongXingStaffCertificate = chenHongXingCertificateList.get(0);
+
+                    //根据用户查询技能信息
+                    List<WorkStaffCertificate> certificateBList = ruralProjectMessageService.getCertificateByUser(consultant.getZixunyuan());
+                    for (WorkStaffCertificate certificateInfo : certificateBList) {
+                        for (MainDictDetail type : certificateMajor) {
+                            if (certificateInfo.getMajor().equals(type.getValue())) {
+                                bzshbConsultant.setMajor(type.getLabel());
+                            }
+                        }
+                    }
+
+                    bzshbConsultant = consultant;
+                    bzshbConsultant.setZhucezigezhID(chenHongXingStaffCertificate.getNum());
+                    bzshbConsultant.setZixunyuanName("陈红星(" + consultant.getZixunyuanName() + "代)");
+                    bzshbConsultant.setRole("技术负责人");
+                    it.remove();
+                }
+            }
+        }
+        consultantinfo.addAll(consultantList);
+
+        if (StringUtils.isNotBlank(bzshbConsultant.getZixunyuan())) {
+            consultantinfo.add(bzshbConsultant);
+        } else {
+            //查询总审人员信息
+            bzshbConsultant = new RuralReportConsultant();
+            List<WorkStaffCertificate> bzshbCertificateList = com.google.common.collect.Lists.newArrayList();
+            if (StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())) {
+                bzshbCertificateList = ruralProjectMessageService.getCertificateByUser(projectReportData.getBzshbUserId());
+            }
+            for (WorkStaffCertificate certificateInfo : bzshbCertificateList) {
+                bzshbConsultant.setZhucezigezhID(certificateInfo.getNum());
+                bzshbConsultant.setZhucezigezhKey(certificateInfo.getName());
+                for (MainDictDetail dictType : certificateMajor) {
+                    if (certificateInfo.getMajor().equals(dictType.getValue())) {
+                        bzshbConsultant.setMajor(dictType.getLabel());
+                    }
+                }
+                User bzshbUser = userService.get(projectReportData.getBzshbUserId());
+                bzshbConsultant.setZixunyuanName(bzshbUser.getName());
+                bzshbConsultant.setZixunyuan(bzshbUser.getId());
+                consultantinfo.add(bzshbConsultant);
+            }
+            Iterator<RuralReportConsultant> itView = consultantinfo.iterator();
+            while (itView.hasNext()) {
+                RuralReportConsultant consultant = itView.next();
+                if (bzshbCertificateList.size() > 0) {
+                    if (consultant.getZixunyuan().equals(bzshbConsultant.getZixunyuan())) {
+                        try {
+                            MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
+                            bzshbConsultant.setZixunyuanName("陈红星(" + bzshbConsultant.getZixunyuanName() + "代)");
+                            bzshbConsultant.setRole("技术负责人");
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        itView.remove();
+                    }
+                } else {
+                    if (consultant.getZixunyuan().equals(projectReportData.getBzshbUserId())) {
+                        try {
+                            MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
+                            bzshbConsultant.setZixunyuanName("陈红星(" + bzshbConsultant.getZixunyuanName() + "代)");
+                            bzshbConsultant.setRole("技术负责人");
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        itView.remove();
+                    }
+                }
+            }
+            if (StringUtils.isNotBlank(bzshbConsultant.getZixunyuan())) {
+                consultantinfo.add(bzshbConsultant);
+            } else {
+                User user = userService.get(projectReportData.getBzshbUserId());
+                bzshbConsultant.setZixunyuanName("陈红星(" + user.getName() + "代)");
+                bzshbConsultant.setZixunyuan(user.getId());
+                bzshbConsultant.setRole("技术负责人");
+                consultantinfo.add(bzshbConsultant);
+            }
+        }
+        return consultantinfo;
+    }
 
 }

+ 4 - 0
src/main/java/com/jeeplus/modules/sys/dao/WorkattachmentDao.java

@@ -112,6 +112,10 @@ public interface WorkattachmentDao extends CrudDao<Workattachment> {
     //删除外部单位人员文件关联表中的数据
     void deleteUserFileByFileId(@Param("fileId") String fileId);
 
+    List<Workattachment> getByIdList(@Param("idList") List<String> idList);
+
+    void updateSyncDifySync( Workattachment workattachment);
+
     /**
      * 根据id获取对象
      */

+ 9 - 0
src/main/java/com/jeeplus/modules/sys/service/WorkattachmentService.java

@@ -1243,6 +1243,15 @@ public class WorkattachmentService extends CrudService<WorkattachmentDao, Workat
 		workattachmentDao.deleteUserFileByFileId(id);
 	}
 
+
+	public List<Workattachment> getByIdList( List<String> idList){
+		return workattachmentDao.getByIdList(idList);
+	}
+
+	public void updateSyncDifySync( Workattachment workattachment){
+		workattachmentDao.updateSyncDifySync(workattachment);
+	}
+
 	/**
 	 * 根据id获取对象
 	 */

+ 9 - 0
src/main/java/com/jeeplus/modules/workclientinfo/entity/WorkClientAttachment.java

@@ -37,6 +37,7 @@ public class WorkClientAttachment extends DataEntity<WorkClientAttachment> {
 	private String sort;	//排序
 	private String description;	//说明
 	private String divIdType;//判定条件
+	private String syncDifySync;		// 是否被标记
 
 	private Date beginDate;
 	private Date endDate;
@@ -213,4 +214,12 @@ public class WorkClientAttachment extends DataEntity<WorkClientAttachment> {
 	public void setFileSizeFlag(String fileSizeFlag) {
 		this.fileSizeFlag = fileSizeFlag;
 	}
+
+	public String getSyncDifySync() {
+		return syncDifySync;
+	}
+
+	public void setSyncDifySync(String syncDifySync) {
+		this.syncDifySync = syncDifySync;
+	}
 }

+ 27 - 25
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -612,6 +612,9 @@ public class WorkProjectNotifyController extends BaseController {
 	@Autowired
 	private ReimbursementVATTaxStatusDao reimbursementVATTaxStatusDao;
 
+	@Autowired
+	private RuralProjectRecordsOwnCaseBaseService ruralProjectRecordsOwnCaseBaseService;
+
 
 	@ModelAttribute
 	public WorkProjectNotify get(@RequestParam(required = false) String id) {
@@ -11044,12 +11047,14 @@ public class WorkProjectNotifyController extends BaseController {
 	private String getProjectCaseBase(WorkProjectNotify workProjectNotify,Model model) throws Exception {
 		//查询“配农网”工程类型id
 		String engineeringId = engineeringService.getEngineeringId("202");
+		//查询案例流程信息
+		ProjectCaseBaseAudit projectCaseBaseAudit = ruralProjectRecordsOwnCaseBaseService.get(workProjectNotify.getNotifyId());
 		//获取项目信息
-		RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.getQueryProjectUsers(workProjectNotify.getNotifyId());
+		RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.getQueryProjectUsers(projectCaseBaseAudit.getProjectId());
 		//查询项目是否时案例项目
 		ruralProjectRecords = ruralProjectRecordsService.getCaseBaseByProjectId(ruralProjectRecords);
 		ProjectReportData projectReportData = projectReportDataService.getByNumber(ruralProjectRecords.getProjectReportNumber());
-		ProjectReportRecord projectReportRecord = projectReportRecordService.getProjectReportRecordByProjectId(workProjectNotify.getNotifyId());
+		ProjectReportRecord projectReportRecord = projectReportRecordService.getProjectReportRecordByProjectId(projectCaseBaseAudit.getProjectId());
 		Projectcontentinfo projectcontentinfo = projectcontentinfoService.getByInfoId(projectReportData.getId());
 		projectcontentinfo.setProjectReportData(projectReportData);
 		//获取子项目列表信息
@@ -11069,14 +11074,13 @@ public class WorkProjectNotifyController extends BaseController {
 				projectReportRecord.setChargeCriterionList(chargeCriterionList);
 			}
 		}
-
-		Act act = getByAct(projectReportRecord.getProcessInstanceId());
-		projectReportRecord.setAct(act);
+		Act act = getByAct(projectCaseBaseAudit.getProcessInstanceId());
+		projectCaseBaseAudit.setAct(act);
 
 		if (StringUtils.isNotBlank(workProjectNotify.getHome())) {
-			projectReportRecord.setHome(workProjectNotify.getHome());
+			projectCaseBaseAudit.setHome(workProjectNotify.getHome());
 		} else {
-			projectReportRecord.setHome("home");
+			projectCaseBaseAudit.setHome("home");
 		}
 
 
@@ -11204,28 +11208,26 @@ public class WorkProjectNotifyController extends BaseController {
 			}
 		}
 		model.addAttribute("datalistTwo", reviewAuditList);
-		if (workProjectNotify.getRemarks().contains("待处理") && !"1".equals(workProjectNotify.getStatus())) {
-			projectReportRecord.setFileAttachmentList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileAttachmentList()));
-			projectReportRecord.setFileGistdataList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileGistdataList()));
-			projectReportRecord.setFileOtherList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileOtherList()));
-			projectReportRecord.setFileCaseBaseList(projectcontentinfo.getFileCaseBaseList());
-			if ("2".equals(ruralProjectRecords.getProjectType())) {
-				model.addAttribute("identification", "projectcontentinfoFile");
-				model.addAttribute("identifications", "referenceRemarks");
-			}
-			if ("1".equals(ruralProjectRecords.getProjectType())) {
-				model.addAttribute("identifications", "consultReferenceRemarks");
-				model.addAttribute("identification", "consultProjectcontentinfoFile");
-			}
-//						model.addAttribute("identification","projectcontentinfoFile");
-			model.addAttribute("identificationName", "归档审核意见");
-			return "modules/projectcontentinfo/projectCaseBaseSupplementForm";
-		}
+		model.addAttribute("projectCaseBaseAudit", projectCaseBaseAudit);
+
 		projectReportRecord.setFileAttachmentList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileAttachmentList()));
 		projectReportRecord.setFileGistdataList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileGistdataList()));
 		projectReportRecord.setFileOtherList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileOtherList()));
 		projectReportRecord.setFileCaseBaseList(projectcontentinfo.getFileCaseBaseList());
-		return "modules/projectcontentinfo/projectCaseBaseSupplementForm";
+
+		if (workProjectNotify.getRemarks().contains("待通知") || "view".equals(workProjectNotify.getView())) {
+			model.addAttribute("identificationName", "归档审核意见");
+			return "modules/projectcontentinfo/projectCaseBaseSupplementForm";
+		} else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
+			model.addAttribute("identificationName", "归档审核意见");
+			return "modules/projectcontentinfo/projectCaseBaseSupplementAudit";
+		} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
+			model.addAttribute("identificationName", "归档审核意见");
+			return "modules/projectcontentinfo/projectCaseBaseSupplementModify";
+		} else {
+			model.addAttribute("identificationName", "归档审核意见");
+			return "modules/projectcontentinfo/projectCaseBaseSupplementForm";
+		}
     }
 
 }

+ 5 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsCaseBaseDao.xml

@@ -74,6 +74,7 @@
 		SELECT count(DISTINCT a.id)
 		FROM case_base cb
 		left join rural_project_records a on a.id = cb.project_id
+		left join project_case_base_audit pcda on pcda.project_id = cb.project_id
 
 		<if test="leaderNameStr !=null and leaderNameStr !=''">
 			LEFT JOIN work_project_user w on a.id = w.project_id
@@ -301,10 +302,14 @@
 		,cb.case_type as "caseType"
 		,cb.case_create_by as "caseCreateBy"
 		,if(case_status > 0 ,case_status,"0") as "caseStatus"
+		,pcda.process_instance_id as "caseAuditProcessId"
+		,pcda.id as "caseAuditId"
+		,ifnull(pcda.status,0) as "caseAuditStatus"
 		FROM rural_project_records a
 		LEFT JOIN sys_area area ON area.id = a.area_id
 		left join rural_project_records_reported rprr on rprr.id = a.id
 		left join case_base cb on a.id = cb.project_id
+		left join project_case_base_audit pcda on pcda.project_id = cb.project_id
 		/*LEFT JOIN project_flingbatch_relation pfp on pfp.project_id=a.id*/
 		left join
 		(select id,status,project_id,filing_batch from

+ 86 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsOwnCaseBaseDao.xml

@@ -0,0 +1,86 @@
+<?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.ruralprojectrecords.dao.RuralProjectRecordsOwnCaseBaseDao">
+	<sql id="projectRecordsJoins">
+		LEFT JOIN sys_area area ON area.id = a.area_id
+	</sql>
+	<sql id="projectRecordsColumns">
+		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.del_flag AS "delFlag",
+		a.project_id as "projectId",
+		a.remarks as "remarks",
+		a.status as "status",
+		a.process_instance_id as "processInstanceId",
+		a.company_id AS "company.id",
+		a.office_id AS "office.id"
+	</sql>
+
+	<select id="get" resultType="ProjectCaseBaseAudit" >
+		SELECT
+		<include refid="projectRecordsColumns"/>
+		from
+		project_case_base_audit a
+		<where>
+			a.del_flag = 0 and a.id = #{id}
+		</where>
+	</select>
+
+
+	<select id="getByProjectId" resultType="ProjectCaseBaseAudit" >
+		SELECT
+		<include refid="projectRecordsColumns"/>
+		from
+		project_case_base_audit a
+		<where>
+			a.del_flag = 0 and a.project_id = #{projectId}
+		</where>
+	</select>
+
+	<insert id="insert">
+		INSERT INTO project_case_base_audit(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			project_id,
+			status,
+			process_instance_id,
+			company_id,
+			office_id
+		) VALUES (
+		    #{id},
+		    #{createBy.id},
+		 	#{createDate},
+		  	#{updateBy.id},
+		 	#{updateDate},
+		 	#{remarks},
+		 	#{delFlag},
+		 	#{projectId},
+		 	#{status},
+		 	#{processInstanceId},
+		 	#{company.id},
+		 	#{office.id}
+	 	)
+	</insert>
+
+	<update id="update">
+		UPDATE project_case_base_audit SET
+		  update_by = #{updateBy.id},
+		  update_date = #{updateDate},
+		  remarks = #{remarks},
+		  project_id = #{projectId},
+		  status = #{status},
+		  process_instance_id = #{processInstanceId},
+		  company_id = #{company.id},
+		  office_id = #{office.id}
+		WHERE id = #{id}
+	</update>
+
+</mapper>

+ 25 - 0
src/main/resources/mappings/modules/sys/WorkattachmentDao.xml

@@ -478,6 +478,31 @@
 	</update>
 
 
+
+	<select id="getByIdList" resultType="Workattachment" >
+		SELECT
+		<include refid="workattachmentColumns"/>
+		FROM work_attachment a
+		<include refid="workattachmentJoins"/>
+		<where>
+			a.del_flag ='0' and
+			(<if test="idList!=null and idList.size!=0">
+			a.id in
+			<foreach collection="idList" item="id" separator="," open="(" close=")">
+				#{id}
+			</foreach>
+		</if>
+			)
+		</where>
+	</select>
+
+	<update id="updateSyncDifySync">
+		update work_attachment set
+		sync_dify_sync = #{syncDifySync}
+		where id = #{id}
+	</update>
+
+
 <!--		<select id="getWorkattachmentById" resultMap="Workattachment">-->
 <!--			SELECT-->
 <!--			<include refid="workattachmentColumns"/>-->

+ 1 - 0
src/main/resources/mappings/modules/workclientinfo/WorkClientAttachmentDao.xml

@@ -23,6 +23,7 @@
         ,createBy.name AS "createName"
         ,a.description AS "description"
         ,a.div_id_type AS "divIdType"
+        ,a.sync_dify_sync AS "syncDifySync"
     </sql>
 
     <sql id="workClientAttachmentJoins">

Файловите разлики са ограничени, защото са твърде много
+ 2567 - 0
src/main/webapp/webpage/modules/projectcontentinfo/projectCaseBaseSupplementAudit.jsp


+ 192 - 189
src/main/webapp/webpage/modules/projectcontentinfo/projectCaseBaseSupplementForm.jsp

@@ -58,7 +58,7 @@
 							}
 						}
 					}
-					$("#inputForm").attr("action","${ctx}/ruralProject/ruralCostProjectMessageNewTwo/saveCaseBaseRecord");
+					$("#inputForm").attr("action","${ctx}/ruralProject/RuralProjectRecordsOwnCaseBase/saveCaseBaseRecord");
 				}
 				$("#inputForm").submit();
 				return true;
@@ -1273,6 +1273,197 @@
 					</c:if>
 				</div>
 				<div class="form-group layui-row first" id="AccessoryView">
+
+
+
+					<div class="form-group layui-row">
+						<div class="form-group-label"><h2>案例文件</h2></div>
+						<div id="addFile_caseBase" style="display: none" class="upload-progress">
+							<span id="fileName_caseBase" ></span>
+							<span id="_caseBase" ></span>
+							<b><span id="baifenbi_caseBase" ></span></b>
+							<div class="progress">
+								<div id="jindutiao_caseBase" class="progress-bar" style="width: 0%" aria-valuenow="0">
+								</div>
+							</div>
+						</div>
+						<input id="caseBase_file" type="file" name="caseBase_file" multiple="multiple" style="display: none;" onChange="if(this.value)caseBaseInsertTitle(this.value);"/>
+						<span id="caseBase_title"></span>
+						<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+							<table id="upTable_caseBase" class="table table-bordered table-condensed tree_table">
+								<thead>
+								<tr>
+										<%-- <th>序号</th>--%>
+									<th width="20%">文件要求</th>
+									<th width="35%">文件描述/文件</th>
+									<th width="20%">文件类型</th>
+									<th width="160px">上传时间</th>
+									<th width="120px">文件大小(M)</th>
+									<th width="100px">操作</th>
+								</tr>
+								</thead>
+								<tbody id="file_caseBase">
+								<c:forEach items="${projectReportRecord.fileCaseBaseList}" var = "filecaseBase" varStatus="status">
+									<tr id="file_caseBase_${filecaseBase.id}_tr" onclick="listTr(this)">
+											<%-- <td>${status.index + 1}</td>--%>
+										<td style="display:none">${filecaseBase.id}</td>
+										<td style="display:none">${filecaseBase.mustFlag}</td>
+										<c:choose>
+											<c:when test="${filecaseBase.mustFlag == 1}">
+												<td class="tabMove" style="text-align: left;"><span class='default_open ' style="padding-right: 15px; "></span><span style="color: red">* </span>${filecaseBase.attachName}<input type="hidden" value="${filecaseBase.attachName}"/></td>
+											</c:when>
+											<c:otherwise>
+												<td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span>${filecaseBase.attachName}<input type="hidden" value="${filecaseBase.attachName}"/></td>
+											</c:otherwise>
+										</c:choose>
+										<td>
+												<%--									<div><span class="file_nei">内容:</span><div class="file_neirong">${filecaseBase.attachName}</div></div>--%>
+											<div style="white-space:normal; word-break:break-all;overflow:hidden;"><span style="font-weight: bold">文件格式及大小:</span>${filecaseBase.attachLength}M;</div><div style="white-space:normal; word-break:break-all;overflow:hidden;">  ${filecaseBase.attachTypes}</div>
+										</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/workAttachmentForm?attachmentId=${filecaseBase.id}&projectId=${project.id}&uploadMode=${projectReportRecord.uploadMode}','70%','80%',false,'inputForm','upTable_caseBase')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+											</div>
+										</td>
+										<td style="display:none">${filecaseBase.fileFlag}</td>
+
+									</tr>
+									<c:forEach items="${filecaseBase.workAttachments}" var = "workClientAttachment" varStatus="status">
+										<tr class="addFile_caseBase_${filecaseBase.id}_tr">
+											<td></td>
+											<c:choose>
+												<c:when test="${projectReportRecord.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(filecaseBase.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(filecaseBase.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.description}')">${workClientAttachment.description}</td>
+
+
+											<td class="op-td" style="text-align:center;">
+												<fmt:formatDate value="${workClientAttachment.createDate}" type="date"/>
+											</td>
+											<td class="op-td" style="text-align:center;">
+													${workClientAttachment.fileSize}
+											</td>
+											<td class="op-td">
+												<div class="op-btn-box" >
+														<%--附件下载删除--%>
+													<c:choose>
+														<c:when test="${projectReportRecord.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>
+												</div>
+											</td>
+										</tr>
+									</c:forEach>
+								</c:forEach>
+								</tbody>
+							</table>
+						</div>
+					</div>
+					<script type="text/template" id="caseBaseTpl">//<!--
+                <tr id="budgetList{{idx}}">
+                    <td class="hide">
+                        <input id="caseBaseTpl{{idx}}_id" type="hidden" value="{{row.id}}" class="clientId"/>
+                    </td>
+                    <td class="hide">
+                        0
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.attachName}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.attachLength}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.attachTypes}}
+                    </td>
+                    <td style="text-align:center;">
+
+                    </td>
+					<td class="op-td">
+						<div class="op-btn-box" >
+							<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${project.id}','70%','80%',false,'inputForm','upTable_caseBase')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+						</div>
+					</td>
+                </tr>//-->
+					</script>
+
+
+
 					<div class="form-group layui-row">
 						<div class="form-group-label"><h2>成果文件</h2></div>
 						<div class="layui-item nav-btns">
@@ -1811,194 +2002,6 @@
 						</div>
 					</div>
 
-
-
-
-					<div class="form-group layui-row">
-						<div class="form-group-label"><h2>案例文件</h2></div>
-						<div id="addFile_caseBase" style="display: none" class="upload-progress">
-							<span id="fileName_caseBase" ></span>
-							<span id="_caseBase" ></span>
-							<b><span id="baifenbi_caseBase" ></span></b>
-							<div class="progress">
-								<div id="jindutiao_caseBase" class="progress-bar" style="width: 0%" aria-valuenow="0">
-								</div>
-							</div>
-						</div>
-						<input id="caseBase_file" type="file" name="caseBase_file" multiple="multiple" style="display: none;" onChange="if(this.value)caseBaseInsertTitle(this.value);"/>
-						<span id="caseBase_title"></span>
-						<div class="layui-item layui-col-xs12" style="padding:0 16px;">
-							<table id="upTable_caseBase" class="table table-bordered table-condensed tree_table">
-								<thead>
-								<tr>
-										<%-- <th>序号</th>--%>
-									<th width="20%">文件要求</th>
-									<th width="35%">文件描述/文件</th>
-									<th width="20%">文件类型</th>
-									<th width="160px">上传时间</th>
-									<th width="120px">文件大小(M)</th>
-									<th width="100px">操作</th>
-								</tr>
-								</thead>
-								<tbody id="file_caseBase">
-								<c:forEach items="${projectReportRecord.fileCaseBaseList}" var = "filecaseBase" varStatus="status">
-									<tr id="file_caseBase_${filecaseBase.id}_tr" onclick="listTr(this)">
-											<%-- <td>${status.index + 1}</td>--%>
-										<td style="display:none">${filecaseBase.id}</td>
-										<td style="display:none">${filecaseBase.mustFlag}</td>
-										<c:choose>
-											<c:when test="${filecaseBase.mustFlag == 1}">
-												<td class="tabMove" style="text-align: left;"><span class='default_open ' style="padding-right: 15px; "></span><span style="color: red">* </span>${filecaseBase.attachName}<input type="hidden" value="${filecaseBase.attachName}"/></td>
-											</c:when>
-											<c:otherwise>
-												<td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span>${filecaseBase.attachName}<input type="hidden" value="${filecaseBase.attachName}"/></td>
-											</c:otherwise>
-										</c:choose>
-										<td>
-												<%--									<div><span class="file_nei">内容:</span><div class="file_neirong">${filecaseBase.attachName}</div></div>--%>
-											<div style="white-space:normal; word-break:break-all;overflow:hidden;"><span style="font-weight: bold">文件格式及大小:</span>${filecaseBase.attachLength}M;</div><div style="white-space:normal; word-break:break-all;overflow:hidden;">  ${filecaseBase.attachTypes}</div>
-										</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/workAttachmentForm?attachmentId=${filecaseBase.id}&projectId=${project.id}&uploadMode=${projectReportRecord.uploadMode}','70%','80%',false,'inputForm','upTable_caseBase')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
-											</div>
-										</td>
-										<td style="display:none">${filecaseBase.fileFlag}</td>
-
-									</tr>
-									<c:forEach items="${filecaseBase.workAttachments}" var = "workClientAttachment" varStatus="status">
-										<tr class="addFile_caseBase_${filecaseBase.id}_tr">
-											<td></td>
-											<c:choose>
-												<c:when test="${projectReportRecord.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(filecaseBase.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(filecaseBase.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.description}')">${workClientAttachment.description}</td>
-
-
-											<td class="op-td" style="text-align:center;">
-												<fmt:formatDate value="${workClientAttachment.createDate}" type="date"/>
-											</td>
-											<td class="op-td" style="text-align:center;">
-													${workClientAttachment.fileSize}
-											</td>
-											<td class="op-td">
-												<div class="op-btn-box" >
-														<%--附件下载删除--%>
-													<c:choose>
-														<c:when test="${projectReportRecord.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>
-												</div>
-											</td>
-										</tr>
-									</c:forEach>
-								</c:forEach>
-								</tbody>
-							</table>
-						</div>
-					</div>
-					<script type="text/template" id="caseBaseTpl">//<!--
-                <tr id="budgetList{{idx}}">
-                    <td class="hide">
-                        <input id="caseBaseTpl{{idx}}_id" type="hidden" value="{{row.id}}" class="clientId"/>
-                    </td>
-                    <td class="hide">
-                        0
-                    </td>
-                    <td style="text-align:center;">
-                        {{row.attachName}}
-                    </td>
-                    <td style="text-align:center;">
-                        {{row.attachLength}}
-                    </td>
-                    <td style="text-align:center;">
-                        {{row.attachTypes}}
-                    </td>
-                    <td style="text-align:center;">
-
-                    </td>
-					<td class="op-td">
-						<div class="op-btn-box" >
-							<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${project.id}','70%','80%',false,'inputForm','upTable_caseBase')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
-						</div>
-					</td>
-                </tr>//-->
-					</script>
 				</div>
 			</div>
 

Файловите разлики са ограничени, защото са твърде много
+ 2480 - 0
src/main/webapp/webpage/modules/projectcontentinfo/projectCaseBaseSupplementModify.jsp


Файловите разлики са ограничени, защото са твърде много
+ 2423 - 0
src/main/webapp/webpage/modules/projectcontentinfo/projectCaseBaseSupplementView.jsp


+ 161 - 157
src/main/webapp/webpage/modules/projectcontentinfo/projectReportRecordCaseBaseForm.jsp

@@ -53,6 +53,7 @@
 				var projectId = '${project.id}';
 				var boolFlag = true;
 					if(obj == 2){
+						$("#inputForm").attr("action","${ctx}/ruralProject/RuralProjectRecordsOwnCaseBase/storeCaseBaseRecord");
 					}else{
 						if(boolFlag){
 							var caseBase = $("#file_caseBase tr").length;
@@ -73,7 +74,7 @@
 								}
 							}
 						}
-						$("#inputForm").attr("action","${ctx}/ruralProject/ruralCostProjectMessageNewTwo/saveCaseBaseRecord");
+						$("#inputForm").attr("action","${ctx}/ruralProject/RuralProjectRecordsOwnCaseBase/saveCaseBaseRecord");
 					}
 					$("#inputForm").submit();
 					return true;
@@ -175,12 +176,9 @@
 <body>
 <div class="single-form">
 	<div class="container">
-		<form:form id="inputForm" modelAttribute="projectReportRecord" method="post" class="form-horizontal layui-form">
+		<form:form id="inputForm" modelAttribute="projectCaseBaseAudit" method="post" class="form-horizontal layui-form">
 			<form:hidden path="id"/>
-			<form:hidden path="numberCount"/>
-			<form:hidden id="reportId" path="report.id"/>
-			<form:hidden path="report.name"/>
-			<form:hidden path="report.project.id"/>
+			<form:hidden path="projectId"/>
 			<input type="hidden" id="onsubmit" value="true">
 			<div class="form-group layui-row first lw12">
 				<div class="form-group-label"><h2>基本信息</h2></div>
@@ -189,7 +187,7 @@
 				<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label"><span class="require-item">*</span>报告号:</label>
 					<div class="layui-input-block">
-						<form:input id="reportNumber" path="report.number" htmlEscape="false"   readonly="true" class="form-control layui-input required"/>
+						<input id="reportNumber" name="report.number"  htmlEscape="false" readonly="true" class="form-control  layui-input required" value="${projectReportRecord.report.number}"/>
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6">
@@ -231,7 +229,8 @@
 				<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label"><span class="require-item">*</span>归档申请人:</label>
 					<div class="layui-input-block">
-						<form:input id="cBName" path="createBy.name" htmlEscape="false" readonly="true" class="form-control  layui-input required"/>
+						<input id="cBName" name="createBy.name"  htmlEscape="false" readonly="true" class="form-control  layui-input required" value="${projectReportRecord.createBy.name}"/>
+
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6">
@@ -249,23 +248,38 @@
 				</div>
 			</div>
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 			<div class="form-group layui-row">
-				<div class="form-group-label"><h2>成果文件</h2></div>
-				<div id="addFile_attachment" style="display: none" class="upload-progress">
-					<span id="fileName_attachment" ></span>
-					<span id="_attachment" ></span>
-					<b><span id="baifenbi_attachment" ></span></b>
+				<div class="form-group-label"><h2>案例文件</h2></div>
+				<div id="addFile_caseBase" style="display: none" class="upload-progress">
+					<span id="fileName_caseBase" ></span>
+					<span id="_caseBase" ></span>
+					<b><span id="baifenbi_caseBase" ></span></b>
 					<div class="progress">
-						<div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+						<div id="jindutiao_caseBase" class="progress-bar" style="width: 0%" aria-valuenow="0">
 						</div>
 					</div>
 				</div>
-				<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
-				<span id="attachment_title"></span>
+				<input id="caseBase_file" type="file" name="caseBase_file" multiple="multiple" style="display: none;" onChange="if(this.value)caseBaseInsertTitle(this.value);"/>
+				<span id="caseBase_title"></span>
 				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
-					<table id="upTable" class="table table-bordered table-condensed tree_table">
+					<table id="upTable_caseBase" class="table table-bordered table-condensed tree_table">
 						<thead>
 						<tr>
+								<%-- <th>序号</th>--%>
 							<th width="20%">文件要求</th>
 							<th width="35%">文件描述/文件</th>
 							<th width="20%">文件类型</th>
@@ -274,37 +288,37 @@
 							<th width="100px">操作</th>
 						</tr>
 						</thead>
-						<tbody id="file_attachment">
-						<c:forEach items="${projectReportRecord.fileAttachmentList}" var = "fileAttachment" varStatus="status">
-							<tr id="file_attachment_${fileAttachment.id}_tr" onclick="listTr(this)">
-								<td style="display:none">${fileAttachment.id}</td>
-								<td style="display:none">${fileAttachment.mustFlag}</td>
+						<tbody id="file_caseBase">
+						<c:forEach items="${projectReportRecord.fileCaseBaseList}" var = "filecaseBase" varStatus="status">
+							<tr id="file_caseBase_${filecaseBase.id}_tr" onclick="listTr(this)">
+									<%-- <td>${status.index + 1}</td>--%>
+								<td style="display:none">${filecaseBase.id}</td>
+								<td style="display:none">${filecaseBase.mustFlag}</td>
 								<c:choose>
-									<c:when test="${fileAttachment.mustFlag == 1}">
-										<td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span><span style="color: red">* </span>${fileAttachment.attachName}<input type="hidden" value="${fileAttachment.attachName}"/></td>
+									<c:when test="${filecaseBase.mustFlag == 1}">
+										<td class="tabMove" style="text-align: left;"><span class='default_open ' style="padding-right: 15px; "></span><span style="color: red">* </span>${filecaseBase.attachName}<input type="hidden" value="${filecaseBase.attachName}"/></td>
 									</c:when>
 									<c:otherwise>
-										<td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span>${fileAttachment.attachName}<input type="hidden" value="${fileAttachment.attachName}"/></td>
+										<td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span>${filecaseBase.attachName}<input type="hidden" value="${filecaseBase.attachName}"/></td>
 									</c:otherwise>
 								</c:choose>
 								<td>
-<%--									<div><span class="file_nei">内容:</span><div class="file_neirong">${fileAttachment.attachName}</div></div>--%>
-	<div style="white-space:normal; word-break:break-all;overflow:hidden;"><span style="font-weight: bold">文件格式及大小:</span>${fileAttachment.attachLength}M;</div><div style="white-space:normal; word-break:break-all;overflow:hidden;">  ${fileAttachment.attachTypes}</div>
+										<%--									<div><span class="file_nei">内容:</span><div class="file_neirong">${filecaseBase.attachName}</div></div>--%>
+									<div style="white-space:normal; word-break:break-all;overflow:hidden;"><span style="font-weight: bold">文件格式及大小:</span>${filecaseBase.attachLength}M;</div><div style="white-space:normal; word-break:break-all;overflow:hidden;">  ${filecaseBase.attachTypes}</div>
 								</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/workAttachmentForm?attachmentId=${fileAttachment.id}&projectId=${project.id}&uploadMode=${projectReportRecord.uploadMode}','70%','80%',false,'inputForm','upTable')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
---%>
+										<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${filecaseBase.id}&projectId=${project.id}&uploadMode=${projectReportRecord.uploadMode}','70%','80%',false,'inputForm','upTable_caseBase')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
 									</div>
 								</td>
-								<td style="display:none">${fileAttachment.fileFlag}</td>
+								<td style="display:none">${filecaseBase.fileFlag}</td>
+
 							</tr>
-							<c:forEach items="${fileAttachment.workAttachments}" var = "workClientAttachment" varStatus="status">
-								<tr class="file_attachment_${fileAttachment.id}_tr">
+							<c:forEach items="${filecaseBase.workAttachments}" var = "workClientAttachment" varStatus="status">
+								<tr class="addFile_caseBase_${filecaseBase.id}_tr">
 									<td></td>
 									<c:choose>
 										<c:when test="${projectReportRecord.uploadMode == 2}">
@@ -314,8 +328,7 @@
                                                            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}">
+													<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>
@@ -324,7 +337,7 @@
 														</c:when>
 														<c:otherwise>
 															<c:choose>
-																<c:when test="${fn:containsIgnoreCase(fileOther.attachName,'rar')
+																<c:when test="${fn:containsIgnoreCase(filecaseBase.attachName,'rar')
 																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
 																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
 																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
@@ -355,7 +368,7 @@
 														</c:when>
 														<c:otherwise>
 															<c:choose>
-																<c:when test="${fn:containsIgnoreCase(fileOther.attachName,'rar')
+																<c:when test="${fn:containsIgnoreCase(filecaseBase.attachName,'rar')
 																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
 																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
 																					   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
@@ -407,10 +420,10 @@
 					</table>
 				</div>
 			</div>
-			<script type="text/template" id="fileAttachmentTpl">//<!--
+			<script type="text/template" id="caseBaseTpl">//<!--
                 <tr id="budgetList{{idx}}">
                     <td class="hide">
-                        <input id="fileAttachment{{idx}}_id" type="hidden" value="{{row.id}}" class="clientId"/>
+                        <input id="caseBaseTpl{{idx}}_id" type="hidden" value="{{row.id}}" class="clientId"/>
                     </td>
                     <td class="hide">
                         0
@@ -429,57 +442,58 @@
                     </td>
 					<td class="op-td">
 						<div class="op-btn-box" >
-<%--
-							<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${project.id}','70%','80%',false,'inputForm','upTable')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
---%>
+							<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${project.id}','70%','80%',false,'inputForm','upTable_caseBase')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
 						</div>
 					</td>
                 </tr>//-->
 			</script>
 
+
+
+
+
+
 			<div class="form-group layui-row">
-				<div class="form-group-label"><h2>依据性文件</h2></div>
-				<div id="addFile_gistdata" style="display: none" class="upload-progress">
-					<span id="fileName_gistdata" ></span>
-					<span id="_gistdata" ></span>
-					<b><span id="baifenbi_gistdata" ></span></b>
+				<div class="form-group-label"><h2>成果文件</h2></div>
+				<div id="addFile_attachment" style="display: none" class="upload-progress">
+					<span id="fileName_attachment" ></span>
+					<span id="_attachment" ></span>
+					<b><span id="baifenbi_attachment" ></span></b>
 					<div class="progress">
-						<div id="jindutiao_gistdata" class="progress-bar" style="width: 0%" aria-valuenow="0">
+						<div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
 						</div>
 					</div>
 				</div>
-				<input id="gistdata_file" type="file" name="gistdata_file" multiple="multiple" style="display: none;" onChange="if(this.value)gistdataInsertTitle(this.value);"/>
-				<span id="gistdata_title"></span>
+				<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+				<span id="attachment_title"></span>
 				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
-					<table id="gistdata_upTable" class="table table-bordered table-condensed tree_table">
+					<table id="upTable" class="table table-bordered table-condensed tree_table">
 						<thead>
 						<tr>
-								<%-- <th>序号</th>--%>
-									<th width="20%">文件要求</th>
-									<th width="35%">文件描述/文件</th>
-									<th width="20%">文件类型</th>
-									<th width="160px">上传时间</th>
-									<th width="120px">文件大小(M)</th>
-									<th width="100px">操作</th>
+							<th width="20%">文件要求</th>
+							<th width="35%">文件描述/文件</th>
+							<th width="20%">文件类型</th>
+							<th width="160px">上传时间</th>
+							<th width="120px">文件大小(M)</th>
+							<th width="100px">操作</th>
 						</tr>
 						</thead>
-						<tbody id="file_gistdata">
-						<c:forEach items="${projectReportRecord.fileGistdataList}" var = "fileGistdata" varStatus="status">
-							<tr id="file_gistdata_${fileGistdata.id}_tr" onclick="listTr(this)">
-									<%-- <td>${status.index + 1}</td>--%>
-								<td style="display:none">${fileGistdata.id}</td>
-								<td style="display:none">${fileGistdata.mustFlag}</td>
+						<tbody id="file_attachment">
+						<c:forEach items="${projectReportRecord.fileAttachmentList}" var = "fileAttachment" varStatus="status">
+							<tr id="file_attachment_${fileAttachment.id}_tr" onclick="listTr(this)">
+								<td style="display:none">${fileAttachment.id}</td>
+								<td style="display:none">${fileAttachment.mustFlag}</td>
 								<c:choose>
-									<c:when test="${fileGistdata.mustFlag == 1}">
-										<td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span><span style="color: red">* </span>${fileGistdata.attachName}<input type="hidden" value="${fileGistdata.attachName}"/></td>
+									<c:when test="${fileAttachment.mustFlag == 1}">
+										<td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span><span style="color: red">* </span>${fileAttachment.attachName}<input type="hidden" value="${fileAttachment.attachName}"/></td>
 									</c:when>
 									<c:otherwise>
-										<td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span>${fileGistdata.attachName}<input type="hidden" value="${fileGistdata.attachName}"/></td>
+										<td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span>${fileAttachment.attachName}<input type="hidden" value="${fileAttachment.attachName}"/></td>
 									</c:otherwise>
 								</c:choose>
 								<td>
-<%--									<div><span class="file_nei">内容:</span><div class="file_neirong">${fileGistdata.attachName}</div></div>--%>
-	<div style="white-space:normal; word-break:break-all;overflow:hidden;"><span style="font-weight: bold">文件格式及大小:</span>${fileGistdata.attachLength}M;</div><div style="white-space:normal; word-break:break-all;overflow:hidden;">  ${fileGistdata.attachTypes}</div>
+<%--									<div><span class="file_nei">内容:</span><div class="file_neirong">${fileAttachment.attachName}</div></div>--%>
+	<div style="white-space:normal; word-break:break-all;overflow:hidden;"><span style="font-weight: bold">文件格式及大小:</span>${fileAttachment.attachLength}M;</div><div style="white-space:normal; word-break:break-all;overflow:hidden;">  ${fileAttachment.attachTypes}</div>
 								</td>
 								<td></td>
 								<td></td>
@@ -487,15 +501,14 @@
 								<td class="op-td">
 									<div class="op-btn-box" >
 <%--
-										<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${fileGistdata.id}&projectId=${project.id}&uploadMode=${projectReportRecord.uploadMode}','70%','80%',false,'inputForm','gistdata_upTable')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+										<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${fileAttachment.id}&projectId=${project.id}&uploadMode=${projectReportRecord.uploadMode}','70%','80%',false,'inputForm','upTable')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
 --%>
 									</div>
 								</td>
-								<td style="display:none">${fileGistdata.fileFlag}</td>
-
+								<td style="display:none">${fileAttachment.fileFlag}</td>
 							</tr>
-							<c:forEach items="${fileGistdata.workAttachments}" var = "workClientAttachment" varStatus="status">
-								<tr class="file_gistdata_${fileGistdata.id}_tr">
+							<c:forEach items="${fileAttachment.workAttachments}" var = "workClientAttachment" varStatus="status">
+								<tr class="file_attachment_${fileAttachment.id}_tr">
 									<td></td>
 									<c:choose>
 										<c:when test="${projectReportRecord.uploadMode == 2}">
@@ -505,7 +518,8 @@
                                                            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}">
+													<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>
@@ -597,10 +611,10 @@
 					</table>
 				</div>
 			</div>
-			<script type="text/template" id="gistdataTpl">//<!--
+			<script type="text/template" id="fileAttachmentTpl">//<!--
                 <tr id="budgetList{{idx}}">
                     <td class="hide">
-                        <input id="gistdataTpl{{idx}}_id" type="hidden" value="{{row.id}}" class="clientId"/>
+                        <input id="fileAttachment{{idx}}_id" type="hidden" value="{{row.id}}" class="clientId"/>
                     </td>
                     <td class="hide">
                         0
@@ -620,7 +634,7 @@
 					<td class="op-td">
 						<div class="op-btn-box" >
 <%--
-							<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${project.id}','70%','80%',false,'inputForm','gistdata_upTable')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+							<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${project.id}','70%','80%',false,'inputForm','upTable')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
 --%>
 						</div>
 					</td>
@@ -628,20 +642,20 @@
 			</script>
 
 			<div class="form-group layui-row">
-				<div class="form-group-label"><h2>其他文件</h2></div>
-				<div id="addFile_other" style="display: none" class="upload-progress">
-					<span id="fileName_other" ></span>
-					<span id="_other" ></span>
-					<b><span id="baifenbi_other" ></span></b>
+				<div class="form-group-label"><h2>依据性文件</h2></div>
+				<div id="addFile_gistdata" style="display: none" class="upload-progress">
+					<span id="fileName_gistdata" ></span>
+					<span id="_gistdata" ></span>
+					<b><span id="baifenbi_gistdata" ></span></b>
 					<div class="progress">
-						<div id="jindutiao_other" class="progress-bar" style="width: 0%" aria-valuenow="0">
+						<div id="jindutiao_gistdata" class="progress-bar" style="width: 0%" aria-valuenow="0">
 						</div>
 					</div>
 				</div>
-				<input id="other_file" type="file" name="other_file" multiple="multiple" style="display: none;" onChange="if(this.value)otherInsertTitle(this.value);"/>
-				<span id="other_title"></span>
+				<input id="gistdata_file" type="file" name="gistdata_file" multiple="multiple" style="display: none;" onChange="if(this.value)gistdataInsertTitle(this.value);"/>
+				<span id="gistdata_title"></span>
 				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
-					<table id="upTable_other" class="table table-bordered table-condensed tree_table">
+					<table id="gistdata_upTable" class="table table-bordered table-condensed tree_table">
 						<thead>
 						<tr>
 								<%-- <th>序号</th>--%>
@@ -653,23 +667,23 @@
 									<th width="100px">操作</th>
 						</tr>
 						</thead>
-						<tbody id="file_other">
-						<c:forEach items="${projectReportRecord.fileOtherList}" var = "fileOther" varStatus="status">
-							<tr id="file_other_${fileOther.id}_tr" onclick="listTr(this)">
+						<tbody id="file_gistdata">
+						<c:forEach items="${projectReportRecord.fileGistdataList}" var = "fileGistdata" varStatus="status">
+							<tr id="file_gistdata_${fileGistdata.id}_tr" onclick="listTr(this)">
 									<%-- <td>${status.index + 1}</td>--%>
-								<td style="display:none">${fileOther.id}</td>
-								<td style="display:none">${fileOther.mustFlag}</td>
+								<td style="display:none">${fileGistdata.id}</td>
+								<td style="display:none">${fileGistdata.mustFlag}</td>
 								<c:choose>
-									<c:when test="${fileOther.mustFlag == 1}">
-										<td class="tabMove" style="text-align: left;"><span class='default_open ' style="padding-right: 15px; "></span><span style="color: red">* </span>${fileOther.attachName}<input type="hidden" value="${fileOther.attachName}"/></td>
+									<c:when test="${fileGistdata.mustFlag == 1}">
+										<td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span><span style="color: red">* </span>${fileGistdata.attachName}<input type="hidden" value="${fileGistdata.attachName}"/></td>
 									</c:when>
 									<c:otherwise>
-										<td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span>${fileOther.attachName}<input type="hidden" value="${fileOther.attachName}"/></td>
+										<td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span>${fileGistdata.attachName}<input type="hidden" value="${fileGistdata.attachName}"/></td>
 									</c:otherwise>
 								</c:choose>
 								<td>
-<%--									<div><span class="file_nei">内容:</span><div class="file_neirong">${fileOther.attachName}</div></div>--%>
-	<div style="white-space:normal; word-break:break-all;overflow:hidden;"><span style="font-weight: bold">文件格式及大小:</span>${fileOther.attachLength}M;</div><div style="white-space:normal; word-break:break-all;overflow:hidden;">  ${fileOther.attachTypes}</div>
+<%--									<div><span class="file_nei">内容:</span><div class="file_neirong">${fileGistdata.attachName}</div></div>--%>
+	<div style="white-space:normal; word-break:break-all;overflow:hidden;"><span style="font-weight: bold">文件格式及大小:</span>${fileGistdata.attachLength}M;</div><div style="white-space:normal; word-break:break-all;overflow:hidden;">  ${fileGistdata.attachTypes}</div>
 								</td>
 								<td></td>
 								<td></td>
@@ -677,15 +691,15 @@
 								<td class="op-td">
 									<div class="op-btn-box" >
 <%--
-										<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${fileOther.id}&projectId=${project.id}&uploadMode=${projectReportRecord.uploadMode}','70%','80%',false,'inputForm','upTable_other')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+										<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${fileGistdata.id}&projectId=${project.id}&uploadMode=${projectReportRecord.uploadMode}','70%','80%',false,'inputForm','gistdata_upTable')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
 --%>
 									</div>
 								</td>
-								<td style="display:none">${fileOther.fileFlag}</td>
+								<td style="display:none">${fileGistdata.fileFlag}</td>
 
 							</tr>
-							<c:forEach items="${fileOther.workAttachments}" var = "workClientAttachment" varStatus="status">
-								<tr class="addFile_other_${fileOther.id}_tr">
+							<c:forEach items="${fileGistdata.workAttachments}" var = "workClientAttachment" varStatus="status">
+								<tr class="file_gistdata_${fileGistdata.id}_tr">
 									<td></td>
 									<c:choose>
 										<c:when test="${projectReportRecord.uploadMode == 2}">
@@ -787,10 +801,10 @@
 					</table>
 				</div>
 			</div>
-			<script type="text/template" id="otherTpl">//<!--
+			<script type="text/template" id="gistdataTpl">//<!--
                 <tr id="budgetList{{idx}}">
                     <td class="hide">
-                        <input id="otherTpl{{idx}}_id" type="hidden" value="{{row.id}}" class="clientId"/>
+                        <input id="gistdataTpl{{idx}}_id" type="hidden" value="{{row.id}}" class="clientId"/>
                     </td>
                     <td class="hide">
                         0
@@ -810,89 +824,72 @@
 					<td class="op-td">
 						<div class="op-btn-box" >
 <%--
-							<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${project.id}','70%','80%',false,'inputForm','upTable_other')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+							<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${project.id}','70%','80%',false,'inputForm','gistdata_upTable')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
 --%>
 						</div>
 					</td>
                 </tr>//-->
 			</script>
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 			<div class="form-group layui-row">
-				<div class="form-group-label"><h2>案例文件</h2></div>
-				<div id="addFile_caseBase" style="display: none" class="upload-progress">
-					<span id="fileName_caseBase" ></span>
-					<span id="_caseBase" ></span>
-					<b><span id="baifenbi_caseBase" ></span></b>
+				<div class="form-group-label"><h2>其他文件</h2></div>
+				<div id="addFile_other" style="display: none" class="upload-progress">
+					<span id="fileName_other" ></span>
+					<span id="_other" ></span>
+					<b><span id="baifenbi_other" ></span></b>
 					<div class="progress">
-						<div id="jindutiao_caseBase" class="progress-bar" style="width: 0%" aria-valuenow="0">
+						<div id="jindutiao_other" class="progress-bar" style="width: 0%" aria-valuenow="0">
 						</div>
 					</div>
 				</div>
-				<input id="caseBase_file" type="file" name="caseBase_file" multiple="multiple" style="display: none;" onChange="if(this.value)caseBaseInsertTitle(this.value);"/>
-				<span id="caseBase_title"></span>
+				<input id="other_file" type="file" name="other_file" multiple="multiple" style="display: none;" onChange="if(this.value)otherInsertTitle(this.value);"/>
+				<span id="other_title"></span>
 				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
-					<table id="upTable_caseBase" class="table table-bordered table-condensed tree_table">
+					<table id="upTable_other" class="table table-bordered table-condensed tree_table">
 						<thead>
 						<tr>
 								<%-- <th>序号</th>--%>
-							<th width="20%">文件要求</th>
-							<th width="35%">文件描述/文件</th>
-							<th width="20%">文件类型</th>
-							<th width="160px">上传时间</th>
-							<th width="120px">文件大小(M)</th>
-							<th width="100px">操作</th>
+									<th width="20%">文件要求</th>
+									<th width="35%">文件描述/文件</th>
+									<th width="20%">文件类型</th>
+									<th width="160px">上传时间</th>
+									<th width="120px">文件大小(M)</th>
+									<th width="100px">操作</th>
 						</tr>
 						</thead>
-						<tbody id="file_caseBase">
-						<c:forEach items="${projectReportRecord.fileCaseBaseList}" var = "filecaseBase" varStatus="status">
-							<tr id="file_caseBase_${filecaseBase.id}_tr" onclick="listTr(this)">
+						<tbody id="file_other">
+						<c:forEach items="${projectReportRecord.fileOtherList}" var = "fileOther" varStatus="status">
+							<tr id="file_other_${fileOther.id}_tr" onclick="listTr(this)">
 									<%-- <td>${status.index + 1}</td>--%>
-								<td style="display:none">${filecaseBase.id}</td>
-								<td style="display:none">${filecaseBase.mustFlag}</td>
+								<td style="display:none">${fileOther.id}</td>
+								<td style="display:none">${fileOther.mustFlag}</td>
 								<c:choose>
-									<c:when test="${filecaseBase.mustFlag == 1}">
-										<td class="tabMove" style="text-align: left;"><span class='default_open ' style="padding-right: 15px; "></span><span style="color: red">* </span>${filecaseBase.attachName}<input type="hidden" value="${filecaseBase.attachName}"/></td>
+									<c:when test="${fileOther.mustFlag == 1}">
+										<td class="tabMove" style="text-align: left;"><span class='default_open ' style="padding-right: 15px; "></span><span style="color: red">* </span>${fileOther.attachName}<input type="hidden" value="${fileOther.attachName}"/></td>
 									</c:when>
 									<c:otherwise>
-										<td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span>${filecaseBase.attachName}<input type="hidden" value="${filecaseBase.attachName}"/></td>
+										<td class="tabMove" style="text-align: left;"><span class='default_open' style="padding-right: 15px; "></span>${fileOther.attachName}<input type="hidden" value="${fileOther.attachName}"/></td>
 									</c:otherwise>
 								</c:choose>
 								<td>
-										<%--									<div><span class="file_nei">内容:</span><div class="file_neirong">${filecaseBase.attachName}</div></div>--%>
-									<div style="white-space:normal; word-break:break-all;overflow:hidden;"><span style="font-weight: bold">文件格式及大小:</span>${filecaseBase.attachLength}M;</div><div style="white-space:normal; word-break:break-all;overflow:hidden;">  ${filecaseBase.attachTypes}</div>
+<%--									<div><span class="file_nei">内容:</span><div class="file_neirong">${fileOther.attachName}</div></div>--%>
+	<div style="white-space:normal; word-break:break-all;overflow:hidden;"><span style="font-weight: bold">文件格式及大小:</span>${fileOther.attachLength}M;</div><div style="white-space:normal; word-break:break-all;overflow:hidden;">  ${fileOther.attachTypes}</div>
 								</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/workAttachmentForm?attachmentId=${filecaseBase.id}&projectId=${project.id}&uploadMode=${projectReportRecord.uploadMode}','70%','80%',false,'inputForm','upTable_caseBase')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+<%--
+										<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${fileOther.id}&projectId=${project.id}&uploadMode=${projectReportRecord.uploadMode}','70%','80%',false,'inputForm','upTable_other')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+--%>
 									</div>
 								</td>
-								<td style="display:none">${filecaseBase.fileFlag}</td>
+								<td style="display:none">${fileOther.fileFlag}</td>
 
 							</tr>
-							<c:forEach items="${filecaseBase.workAttachments}" var = "workClientAttachment" varStatus="status">
-								<tr class="addFile_caseBase_${filecaseBase.id}_tr">
+							<c:forEach items="${fileOther.workAttachments}" var = "workClientAttachment" varStatus="status">
+								<tr class="addFile_other_${fileOther.id}_tr">
 									<td></td>
 									<c:choose>
 										<c:when test="${projectReportRecord.uploadMode == 2}">
@@ -911,7 +908,7 @@
 														</c:when>
 														<c:otherwise>
 															<c:choose>
-																<c:when test="${fn:containsIgnoreCase(filecaseBase.attachName,'rar')
+																<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')}">
@@ -942,7 +939,7 @@
 														</c:when>
 														<c:otherwise>
 															<c:choose>
-																<c:when test="${fn:containsIgnoreCase(filecaseBase.attachName,'rar')
+																<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')}">
@@ -994,10 +991,10 @@
 					</table>
 				</div>
 			</div>
-			<script type="text/template" id="caseBaseTpl">//<!--
+			<script type="text/template" id="otherTpl">//<!--
                 <tr id="budgetList{{idx}}">
                     <td class="hide">
-                        <input id="caseBaseTpl{{idx}}_id" type="hidden" value="{{row.id}}" class="clientId"/>
+                        <input id="otherTpl{{idx}}_id" type="hidden" value="{{row.id}}" class="clientId"/>
                     </td>
                     <td class="hide">
                         0
@@ -1016,7 +1013,9 @@
                     </td>
 					<td class="op-td">
 						<div class="op-btn-box" >
-							<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${project.id}','70%','80%',false,'inputForm','upTable_caseBase')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+<%--
+							<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${project.id}','70%','80%',false,'inputForm','upTable_other')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+--%>
 						</div>
 					</td>
                 </tr>//-->
@@ -1024,6 +1023,11 @@
 
 
 
+
+
+
+
+
 			<div class="form-group layui-row page-end"></div>
 		</form:form>
 	</div>

+ 27 - 2
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralProjectRecordsOwnCaseBaseList.jsp

@@ -373,7 +373,7 @@
 
 		//打开对话框(查看)
 		function openDialogReportView(title,url,id,width,height){
-
+			console.log(1321321)
 
 			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
 				width='auto';
@@ -444,6 +444,7 @@
 
 
 		function openDialogreReport(title,url,id,width,height,target,buttons) {
+			console.log(312313)
 
 			if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
 				width = 'auto';
@@ -847,9 +848,30 @@
 						}
 						return xml;
 					}}
+				,{align:'center', title: '案例文件审核',  width:150,templet:function(d){
+						var st = getAuditState(d.caseAuditStatus);
+						if(st.action)
+							var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/ruralProject/ruralCostProjectMessage/getReportedProcess?processInstanceId=" + d.caseAuditProcessId + "','95%','95%')\" class=\"new-status-label status-label-" + st.label + "\" >" + st.status+ "</span>";
+						else
+							var xml = "<span style=\"cursor:default;\" class=\"new-status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+						return xml;
+					}}
                 ,{align:'center',title:"操作",width:150,templet:function(d){
+						var xml = "";
 						if(d.caseStatus == 5) {
-							var xml = "<a href=\"#\" onclick=\"openDialogre('案例文件上传', '${ctx}/ruralProject/ruralCostProjectMessageNewTwo/formCaseBase?reportId=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 案例文件</a>";
+							if(d.caseAuditStatus == 0 || d.caseAuditStatus == 5){
+								xml += "<a href=\"#\" onclick=\"openDialogre('案例文件上传', '${ctx}/ruralProject/RuralProjectRecordsOwnCaseBase/formCaseBase?reportId=" + d.id +"&id=" + d.caseAuditId + "','95%', '95%','','送审,暂存,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 案例文件</a>";
+							}else if(d.caseAuditStatus == 1){
+								xml += "<a href=\"#\" onclick=\"openDialogre('案例文件上传', '${ctx}/ruralProject/RuralProjectRecordsOwnCaseBase/formCaseBase?reportId=" + d.id +"&id=" + d.caseAuditId + "','95%', '95%','','送审,暂存,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 案例文件</a>";
+							}else if(d.caseAuditStatus == 2){
+								xml += "<a href=\"${ctx}/ruralProject/RuralProjectRecordsOwnCaseBase/revoke?id=" + d.caseAuditId + "&processInstanceId=" + d.caseAuditProcessId + "\" onclick=\"return confirmx('确认要撤回该案例文件审核吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 撤回案例文件审核</a>";
+							}else if(d.caseAuditStatus == 3){
+								//撤回操作
+								xml += "<a href=\"#\" onclick=\"openDialogre('案例文件重新上传', '${ctx}/ruralProject/RuralProjectRecordsOwnCaseBase/formCaseBase?reportId=" + d.id +"&id=" + d.caseAuditId + "','95%', '95%','','送审,暂存,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 案例文件</a>";
+							}else if(d.caseAuditStatus == 4){
+								//驳回操作
+								xml += "<a href=\"#\" onclick=\"openDialogreReportSwitch('案例文件上传调整', '${ctx}/ruralProject/RuralProjectRecordsOwnCaseBase/modify?reportId=" + d.id +"&id=" + d.caseAuditId + "','95%', '95%','','送审,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\"  style='height: 32px;margin-top: 5px;margin-bottom: 5px;'> 驳回调整</a>";
+							}
 						}
 						return xml;
 					}}
@@ -908,6 +930,9 @@
 					,"caseType":"${projectRecords.caseType}"
 					,"caseCreateBy":"${projectRecords.caseCreateBy}"
 					,"caseStatus":"${projectRecords.caseStatus}"
+					,"caseAuditId":"${projectRecords.caseAuditId}"
+					,"caseAuditStatus":"${projectRecords.caseAuditStatus}"
+					,"caseAuditProcessId":"${projectRecords.caseAuditProcessId}"
 					,"falg":
 					<c:choose>
 						<c:when test="${fns:getUser().id == projectRecords.leaderIds || fns:getUser().id eq projectRecords.createBy.id}">

+ 1 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/ruralProjectMessageList.jsp

@@ -1010,7 +1010,7 @@
 				}
 
 				/*if(d.caseStatus == 5) {
-					xml+="<a href=\"#\" onclick=\"openDialogre('案例文件上传', '${ctx}/ruralProject/ruralCostProjectMessageNewTwo/formCaseBase?reportId=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 案例文件</a>";
+					xml+="<a href=\"#\" onclick=\"openDialogre('案例文件上传', '${ctx}/ruralProject/RuralProjectRecordsOwnCaseBase/formCaseBase?reportId=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 案例文件</a>";
 				}*/
 			}
 			<shiro:hasPermission name="ruralProject:ruralCostProjectMessage:adminEdit">