Sfoglia il codice sorgente

纸质归档流程

[user3] 3 anni fa
parent
commit
07539d2eb2

+ 14 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/ProjectPaperFilingDao.java

@@ -0,0 +1,14 @@
+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.ProjectPaperFiling;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+
+/**
+ * 纸质归档
+ */
+@MyBatisDao
+public interface ProjectPaperFilingDao extends CrudDao<ProjectPaperFiling> {
+    void updateProcessIdAndStatus(ProjectPaperFiling paperFiling);
+}

+ 108 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/ProjectPaperFiling.java

@@ -0,0 +1,108 @@
+package com.jeeplus.modules.ruralprojectrecords.entity;
+
+import com.jeeplus.common.persistence.ActEntity;
+import com.jeeplus.modules.sys.entity.Office;
+
+public class ProjectPaperFiling extends ActEntity<ProjectPaperFiling> {
+    private Integer status;  //状态
+    private String processInstanceId;   //流程id
+    private String projectId;   //项目id
+    private RuralProjectRecords projectRecords; //项目
+
+    private String companyId;		// 公司id
+    private String officeId;		// 部门id
+    private Office office;         //部门
+    private String home;
+    private String fileNum;     //案卷号
+    private String fileNumTow;  //确认案卷号
+    private String view;
+
+    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 String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public RuralProjectRecords getProjectRecords() {
+        return projectRecords;
+    }
+
+    public void setProjectRecords(RuralProjectRecords projectRecords) {
+        this.projectRecords = projectRecords;
+    }
+
+    public String getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(String companyId) {
+        this.companyId = companyId;
+    }
+
+    public String getOfficeId() {
+        return officeId;
+    }
+
+    public void setOfficeId(String officeId) {
+        this.officeId = officeId;
+    }
+
+    public String getHome() {
+        return home;
+    }
+
+    public void setHome(String home) {
+        this.home = home;
+    }
+
+    public String getFileNum() {
+        return fileNum;
+    }
+
+    public void setFileNum(String fileNum) {
+        this.fileNum = fileNum;
+    }
+
+    public String getFileNumTow() {
+        return fileNumTow;
+    }
+
+    public void setFileNumTow(String fileNumTow) {
+        this.fileNumTow = fileNumTow;
+    }
+
+    public Office getOffice() {
+        return office;
+    }
+
+    public void setOffice(Office office) {
+        this.office = office;
+    }
+
+    public String getView() {
+        return view;
+    }
+
+    public void setView(String view) {
+        this.view = view;
+    }
+}
+

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

@@ -81,6 +81,10 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	private String prrdProcessInstanceId; //线下归档流程号
 	private String reportedProcessInstanceId;//上报流程号
 
+	private String ppfProcessInstanceId; //纸质归档流程号
+	private String paperFilingStatus; //纸质归档状态
+	private String ppfId; //纸质归档Id
+
 	private String projectType; //类型 1.工程咨询 2.造价审核
 	private String constructionUnit; //施工单位
 	private String constructionLinkman; //施工方联系人
@@ -1590,4 +1594,28 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	public void setNewReportMaterialAuditNotifyFlag(Integer newReportMaterialAuditNotifyFlag) {
 		this.newReportMaterialAuditNotifyFlag = newReportMaterialAuditNotifyFlag;
 	}
+
+	public String getPpfProcessInstanceId() {
+		return ppfProcessInstanceId;
+	}
+
+	public void setPpfProcessInstanceId(String ppfProcessInstanceId) {
+		this.ppfProcessInstanceId = ppfProcessInstanceId;
+	}
+
+	public String getPaperFilingStatus() {
+		return paperFilingStatus;
+	}
+
+	public void setPaperFilingStatus(String paperFilingStatus) {
+		this.paperFilingStatus = paperFilingStatus;
+	}
+
+	public String getPpfId() {
+		return ppfId;
+	}
+
+	public void setPpfId(String ppfId) {
+		this.ppfId = ppfId;
+	}
 }

+ 579 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/ProjectPaperFilingService.java

@@ -0,0 +1,579 @@
+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.modules.act.entity.Act;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
+import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingbatchRelation;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
+import com.jeeplus.modules.ruralprojectrecords.dao.ProjectPaperFilingDao;
+import com.jeeplus.modules.ruralprojectrecords.dao.RuralPeojectRecordChooseCheckDao;
+import com.jeeplus.modules.ruralprojectrecords.entity.ProjectPaperFiling;
+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.service.OfficeService;
+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.workcontent.web.WorkContentTypeController;
+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.IdentityService;
+import org.activiti.engine.RuntimeService;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.apache.commons.lang3.StringUtils;
+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 ProjectPaperFilingService extends CrudService<ProjectPaperFilingDao, ProjectPaperFiling> {
+    @Autowired
+    private RuralProjectRecordsService ruralProjectRecordsService;
+    @Autowired
+    private ProjectReportDataService projectReportDataService;
+    @Autowired
+    private IdentityService identityService;
+    @Autowired
+    private WorkActivityMenuService workActivityMenuService;
+    @Autowired
+    private WorkProjectNotifyService workProjectNotifyService;
+    @Autowired
+    private RuntimeService runtimeService;
+    @Autowired
+    private OfficeService officeService;
+    @Autowired
+    private WorkActivityProcessService workActivityProcessService;
+    @Autowired
+    private ActTaskService actTaskService;
+    @Autowired
+    private ActivityService activityService;
+    @Autowired
+    private WorkActivityProcessDao workActivityProcessDao;
+    @Override
+    public ProjectPaperFiling get(String id) {
+        return super.get(id);
+    }
+    @Transactional(readOnly = false)
+    public String saveCheck(ProjectPaperFiling paperFiling, Map<String, Object> variables, String processInstanceId) throws Exception {
+        User user = UserUtils.getUser();
+        Boolean insert = false;
+        if (com.jeeplus.common.utils.StringUtils.isBlank(paperFiling.getId())){
+            paperFiling.setCompanyId(user.getComId());
+            paperFiling.setOfficeId(user.getOffice().getId());
+            insert = true;
+        }
+        //对数据进行插入数据库
+        //纸质归档表添加操作
+        super.save(paperFiling);
+//        //判断如果是暂存,则跳过流程操作
+//        if("1".equals(paperFiling.getFlag())){
+//            return "true";
+//        }
+        //获取项目信息
+        RuralProjectRecords record = ruralProjectRecordsService.get(paperFiling.getProjectId());
+        //查询项目新增报告信息
+        ProjectReportData reportData = projectReportDataService.get(record.getPrdId());
+        //启动流程操作
+        String title = "项目【"+ record.getProjectName()+"】纸质归档申请待审批";
+        String str = "项目【"+ record.getProjectName()+"】纸质归档申请待审批";
+        // 用来设置启动流程的人员ID,引擎会自动把用户ID保存到activiti:initiator中
+        identityService.setAuthenticatedUserId(user.getId());
+        // 启动流程
+        String businessKey = paperFiling.getId().toString();
+        Office office = UserUtils.getSelectOffice();
+        WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("5864872f45b84acd893010e66a3db2c8", office);
+
+        String processType = workActivityMenu.getProcessType();
+        StringBuffer buffer = new StringBuffer();
+        Activity activity = new Activity();
+        WorkProjectNotify workProjectNotify = UtilNotify
+                .saveNotify(paperFiling.getId(),
+                        null,
+                        paperFiling.getCompanyId(),
+                        title,
+                        str,
+                        "110",
+                        "0",
+                        "待审批",
+                        ""
+                );
+        List<User> users = new ArrayList<>();
+        List<User> bggdglys = UserUtils.getByRoleActivityEnname("bggdgly",3,office.getId(),"10",paperFiling.getCreateBy());
+        if (StringUtils.isNotBlank(workActivityMenu.getId())) {
+            workProjectNotify.setNotifyRole("");
+            workActivityMenu = workActivityMenuService.get(workActivityMenu.getId());
+            List<Activity> activities = workActivityMenu.getActivities();
+            for (Activity a : activities) {
+                String encount = a.getEncount();
+                String enlist = a.getEnlist();
+                if (a.getRole()!=null && com.jeeplus.common.utils.StringUtils.isNotBlank(a.getRole().getEnname())){
+                    List enusers = UserUtils.getByRoleActivityEnnames(a.getRole().getEnname(),office.getId(),"10",paperFiling.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 && com.jeeplus.common.utils.StringUtils.isNotBlank(activity.getId())) {
+                //角色审批
+                if (com.jeeplus.common.utils.StringUtils.isNotBlank(activity.getRole().getEnname())) {
+                    users = UserUtils.getByRoleActivityEnnames(activity.getRole().getEnname(),office.getId(),"10",paperFiling.getCreateBy());
+                }
+                //人员审批
+                if (com.jeeplus.common.utils.StringUtils.isNotBlank(activity.getUser().getId())) {
+                    users.add(activity.getUser());
+                }
+            }
+            workProjectNotify.setId("");
+        }else{
+            if (bggdglys==null||bggdglys.size()==0){
+                throw new Exception("流程审批人不能为空,请联系管理员!");
+            }
+            variables.put("bggdglyList", bggdglys);
+            variables.put("bggdglycount",bggdglys.size());
+            processType = "paperFiling";
+            users.addAll(bggdglys);
+        }
+        for (User u : users){
+            workProjectNotify.setUser(u);
+            workProjectNotify.setId("");
+            workProjectNotify.setNotifyRole("归档管理员审批");
+            workProjectNotifyService
+                    .save(workProjectNotify);
+            Map<String,Object> extras = new HashMap<>();
+            extras.put("type","7001");
+            extras.put("id",workProjectNotify.getId());
+            extras.put("procDefKey","110");
+            UserUtils.pushInfoToApp(title,str,extras,u.getId());
+            UserUtils.pushIm(u.getId(),str);
+        }
+        variables.put("type", processType);
+        variables.put("busId", businessKey);
+        variables.put("title", "纸质归档项目:" + record.getProjectName());//设置标题;
+        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
+        if (com.jeeplus.common.utils.StringUtils.isNotBlank(processInstanceId)) {
+            workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
+            workActivityProcessService.deleteProcessInstanceId(processInstanceId);
+            workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
+        }
+        paperFiling.setProcessInstanceId(processInstance.getId());
+        paperFiling.setStatus(ProjectStatusEnum.IN_APRL.getValue());
+        dao.updateProcessIdAndStatus(paperFiling);
+        //通知添加流程实例ID
+        workProjectNotify.setProcessInstanceId(processInstance.getId());
+        workProjectNotifyService.save(workProjectNotify);
+        List<Activity> list = workActivityMenu.getActivities();
+        if (list != null && list.size() != 0) {
+            workActivityProcessService.saveList(list, processInstance.getId());
+        } else {
+            WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+            workActivityProcess.setCount(1);
+            workActivityProcess.setProcessKey(processType);
+            workActivityProcess.setProcessInstanceId(processInstance.getId());
+            workActivityProcess.setIsApproval("0");
+            workActivityProcessService.insert(workActivityProcess);
+            workActivityProcessService.insertAuditsByType(bggdglys,processInstance.getId(),1,1);
+        }
+        return "true";
+    }
+    /**
+     * 归档:强制撤销
+     * @param paperFiling
+     */
+    @Transactional(readOnly = false)
+    public void cancelInvalidate(ProjectPaperFiling paperFiling){
+        String invalidateProcessInstanceId = paperFiling.getProcessInstanceId();
+        //将流程图中尚未走到的task的流程追踪信息逻辑删除,添加一条"撤销"流程追踪信息
+        WorkActivityProcess process = new WorkActivityProcess();
+        process.setProcessInstanceId(paperFiling.getProcessInstanceId());
+        process.setIsApproval("0");
+        WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+        workActivityProcess.setProcessInstanceId(paperFiling.getProcessInstanceId());
+        List<WorkActivityProcess> processList = workActivityProcessService.findList(workActivityProcess);
+        WorkProjectNotify notify = new WorkProjectNotify();
+        notify.setNotifyId(paperFiling.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.setIsApproval("-1");
+                    p.setDelFlag("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);
+        }
+
+        //结束该流程,设为"撤销"状态
+        try {
+            actTaskService.endProcessInstance(invalidateProcessInstanceId,"纸质归档-强制撤销");
+        } catch (Exception e) {
+            e.printStackTrace();
+            logger.error("Exception e:"+e);
+        }
+        paperFiling.setStatus(3);
+        paperFiling.preUpdate();
+        save(paperFiling);
+    }
+    /**
+     * 审核
+     * @param paperFiling
+     * @param auditUsers
+     * @return
+     * @throws Exception
+     */
+    @Transactional(readOnly = false)
+    public String auditSave(ProjectPaperFiling paperFiling, List<User> auditUsers) throws Exception {
+        RuralProjectRecords records=ruralProjectRecordsService.get(paperFiling.getProjectId());
+        ProjectReportData reportData = projectReportDataService.get(records.getPrdId());
+        String flag = paperFiling.getAct().getFlag();
+        Integer filingStatus = paperFiling.getStatus();
+        // 对不同环节的业务逻辑进行操作
+        Act act = paperFiling.getAct();
+        String taskDefKey = act.getTaskDefKey();
+        if (!"modifyApply".equals(taskDefKey) && !taskDefKey.contains("audit")  ) {
+            actTaskService.claim(act.getTaskId(), UserUtils.getUser().getId());
+        }else {
+            flag = "yes";
+        };
+//        /**
+//         * 流程驳回修改归档状态
+//         */
+//        if (!"yes".equals(paperFiling.getAct().getFlag())) {
+//            paperFiling.setStatus(ProjectStatusEnum.REJECTED.getValue());
+//            dao.updateProcessIdAndStatus(paperFiling);
+//        }
+        User user=UserUtils.get(paperFiling.getCreateBy().getId());
+        Office office=user.getOffice();
+        paperFiling.setOffice(office);
+        String notifyStr = "报告号"+reportData.getNumber()+"。纸质归档项目名称:"+records.getProjectName();
+        String str = notifyStr+",创建人:"+paperFiling.getCreateBy().getName()+",所属部门:"+paperFiling.getOffice().getName();
+        String titleStr = "报告号"+reportData.getNumber()+"。纸质归档项目名称:"+records.getProjectName();;
+        String comment = "";
+        if ( filingStatus == ProjectStatusEnum.REJECTED.getValue()) {
+            comment = ("yes".equals(flag)?"[重新申请] ":"[已撤销] ");
+        }else {
+            comment = ("yes".equals(flag)?"[同意] ":"[驳回] ");
+        }
+        paperFiling.setStatus(("yes".equals(flag) ? 2 : 4));
+        Map<String, Object> vars = Maps.newHashMap();
+        //业务逻辑对应的条件表达式
+        String exp = "";
+        String taskCount = "";
+        String notifyRole = "";
+        int key = 0;
+        String enname = "";
+        List<Activity> activitieList = activityService.getByProcessInstanceId(paperFiling.getProcessInstanceId());
+        WorkActivityMenu workActivityMenu = new WorkActivityMenu();
+        if (activitieList != null && activitieList.size() != 0) {
+            //判断上面act流程的流程图key是不是空  不是空则使用该流程图key信息
+            if(StringUtils.isNotBlank(act.getProcDefKey())){
+                workActivityMenu.setProcessType(act.getProcDefKey());
+            }else{
+                workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
+            }
+            workActivityMenu.setActivities(activitieList);
+        }
+        WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+        WorkActivityProcess selectProcess = new WorkActivityProcess();
+        selectProcess.setProcessInstanceId(paperFiling.getProcessInstanceId());
+        List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
+        List<Activity> activities = workActivityMenu.getActivities();
+        if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("paperFiling")) {
+            key = 1;
+            for (int i = 0; i < workActivityProcesses.size(); i++) {
+                WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+                if (taskDefKey.equals(activityProcess.getActivityTask()) && !taskDefKey.equals("modifyApply")) {
+                    taskCount = activityProcess.getCount()+"";
+                    workActivityProcess = activityProcess;
+                    if (!workActivityProcess.getIsApproval().equals("0")) {
+                        workActivityProcess.setId("");
+                    }
+                    exp = "pass";
+                    if (!"yes".equals(flag)) {
+                        workActivityProcess.setIsApproval("2");
+                        paperFiling.setStatus(4);
+                        String returnBack = "-1";
+                        for (Activity activity : activities) {
+                            if (activity.getCount() == activityProcess.getCount()) {
+                                returnBack = activity.getReturnBack();
+                                notifyRole = activity.getName();
+                                break;
+                            }
+                        }
+                        if (returnBack.equals("0")) {
+                            workActivityProcess.setId("");
+                        }
+
+                    } else {
+                        workActivityProcess.setIsApproval("1");
+                    }
+                }else if(taskDefKey.equals("modifyApply")){
+                    notifyRole = "调整纸质归档";
+                    taskCount = "0";
+                    exp = "pass";
+                    workActivityProcess.setId("");
+                    workActivityProcess.setCount(0);
+                    if (!"yes".equals(flag)) {
+                        paperFiling.setStatus(3);
+                        workActivityProcess.setIsApproval("2");
+                    } else {
+                        workActivityProcess.setIsApproval("1");
+                    }
+                    break;
+                }
+            }
+        } else {
+            workActivityMenu.setProcessType("paperFiling");
+            for (int i = 0; i < workActivityProcesses.size(); i++) {
+                WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+                String count = activityProcess.getCount() + "";
+                workActivityProcess = activityProcess;
+                if (!workActivityProcess.getIsApproval().equals("0")) {
+                    workActivityProcess.setId("");
+                }
+                // 审核环节
+                if ("bggdgly".equals(taskDefKey) && count.contains("1")) {
+                    taskCount = "1";
+                    exp = "pass";
+                    if ("yes".equals(flag)) {
+                        notifyRole = "审批通过";
+                        workActivityProcess.setIsApproval("1");
+                    } else {
+                        notifyRole = "调整报告";
+                        workActivityProcess.setIsApproval("2");
+                    }
+                    break;
+                } else if ("modifyApply".equals(taskDefKey)&& count.contains("0")) {
+                    notifyRole = "归档管理员审批";
+                    taskCount = "0";
+                    exp = "pass";
+                    workActivityProcess.setCount(0);
+                    enname = "master";
+                    if (!"yes".equals(flag)) {
+                        paperFiling.setStatus(3);
+                    }
+                    break;
+                }
+            }
+        }
+        // 设置意见
+        act.setComment(("yes".equals(flag) ? "[同意] " : "[驳回] ") + act.getComment());
+        paperFiling.preUpdate();
+        // 提交流程任务
+        vars.put(exp, "yes".equals(flag) ? true : false);
+        vars.put("passs", true);
+        workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,paperFiling.getProcessInstanceId(),taskDefKey,"modifyApply",flag,act.getComment(), activities);
+        // 提交流程任务
+        actTaskService.complete(act.getTaskId(), act.getProcInsId(), act.getComment(), vars);
+        boolean state = actTaskService.isProcessEnd(act.getProcInsId());
+
+        List<User> users = new ArrayList<>();
+        List<User> userList = new ArrayList<>();
+        if (!state) {
+            users.add(paperFiling.getCreateBy());
+            if ("yes".equals(flag)) {
+                //审核完成提示框
+                String title = "报告号"+reportData.getNumber()+"。项目名称【"+records.getProjectName()+"】纸质归档成功";
+                String content = "报告号"+reportData.getNumber()+"。项目名称【"+records.getProjectName()+"】纸质归档成功,项目编号:"+records.getProjectId();
+                paperFiling.setStatus(5);
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(paperFiling.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                workProjectNotifyService
+                        .save(UtilNotify
+                                .saveNotify(paperFiling.getId(),
+                                        paperFiling.getCreateBy(),
+                                        paperFiling.getCompanyId(),
+                                        title,
+                                        content,
+                                        "110",
+                                        "0",
+                                        "待通知",
+                                        notifyRole));
+
+            } else {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(paperFiling.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                if ( null != paperFiling.getStatus() && 0 != paperFiling.getStatus() && paperFiling.getStatus()!=3){
+                    paperFiling.setStatus(4);
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNotify(paperFiling.getId(),
+                                            paperFiling.getCreateBy(),
+                                            paperFiling.getCompanyId(),
+                                            titleStr,
+                                            str,
+                                            "110",
+                                            "0",
+                                            "待通知",
+                                            notifyRole));
+                }
+            }
+            workActivityProcessService.deleteProcessIdAuditUsers(paperFiling.getProcessInstanceId());
+        }else {
+            if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("paperFiling")) {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(paperFiling.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                WorkProjectNotify workProjectNotify = UtilNotify
+                        .saveNotify(paperFiling.getId(),
+                                new User(),
+                                paperFiling.getCompanyId(),
+                                titleStr,
+                                str,
+                                "110",
+                                "0",
+                                "待审批",
+                                notifyRole);
+                List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
+                        activities,
+                        workProjectNotify,
+                        taskDefKey,
+                        flag,
+                        taskCount,
+                        paperFiling.getCreateBy(),
+                        UserUtils.get(paperFiling.getCreateBy().getId()).getOffice().getId(),
+                        "8");
+                for (WorkProjectNotify workProjectNotify1:workProjectNotifys){
+                    users.add(workProjectNotify1.getUser());
+                    workProjectNotify1.setId("");
+                    workProjectNotify1.setIsNewRecord(false);
+                    workProjectNotifyService
+                            .save(workProjectNotify1);
+                    if (!"modifyApply".equals(taskDefKey)){
+                        Map<String,Object> extras = new HashMap<>();
+                        extras.put("type","7001");
+                        extras.put("id",workProjectNotify.getId());
+                        extras.put("procDefKey","110");
+                        UserUtils.pushInfoToApp(titleStr,str,extras,workProjectNotify1.getUser().getId());
+
+                    }
+                }
+            } else {
+                if (!"yes".equals(flag)) {//报告驳回待办提醒
+                    str = "报告号"+reportData.getNumber()+"。项目编号【"+ records.getProjectId()+"】纸质归档申请被驳回,请选择重新申请或作废";
+                    titleStr = "报告号"+reportData.getNumber()+"。项目编号【"+ records.getProjectId()+"】纸质归档申请被驳回";
+                    WorkProjectNotify notify = new WorkProjectNotify();
+                    notify.setNotifyId(paperFiling.getId());
+                    userList = workProjectNotifyService.readByNotifyId(notify);
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNotify(paperFiling.getId(),
+                                            paperFiling.getCreateBy(),
+                                            paperFiling.getCompanyId(),
+                                            titleStr,
+                                            str,
+                                            "110",
+                                            "0",
+                                            "重新申请",
+                                            notifyRole));
+                    users.add( paperFiling.getCreateBy());
+                } else {
+                    if (com.jeeplus.common.utils.StringUtils.isNotBlank(enname)) {//驳回重新申请待办信息
+                        str = "报告号"+reportData.getNumber()+"。项目编号【"+ records.getProjectId()+"】重新纸质归档,待审批";
+                        titleStr = "报告号"+reportData.getNumber()+"。项目编号【"+ records.getProjectId()+"】重新纸质归档,待审批";
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(paperFiling.getId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        WorkProjectNotify workProjectNotify = UtilNotify
+                                .saveNotify(paperFiling.getId(),
+                                        new User(),
+                                        paperFiling.getCompanyId(),
+                                        titleStr,
+                                        str,
+                                        "110",
+                                        "0",
+                                        "待审批",
+                                        notifyRole);
+                        users.addAll(auditUsers);
+                        for (User user1 : users) {
+                            workProjectNotify.setUser(user1);
+                            workProjectNotify.setId("");
+                            workProjectNotify.setIsNewRecord(false);
+                            workProjectNotifyService
+                                    .save(workProjectNotify);
+                            if (!"modifyApply".equals(taskDefKey)){
+                                Map<String,Object> extras = new HashMap<>();
+                                extras.put("type","7001");
+                                extras.put("id",workProjectNotify.getId());
+                                extras.put("procDefKey","110");
+                                UserUtils.pushInfoToApp(titleStr,str,extras,user1.getId());
+
+                            }
+                        }
+                    }else {
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(paperFiling.getId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        users.add(paperFiling.getCreateBy());
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(paperFiling.getId(),
+                                                paperFiling.getCreateBy(),
+                                                paperFiling.getCompanyId(),
+                                                titleStr,
+                                                str,
+                                                "110",
+                                                "0",
+                                                "重新申请",
+                                                notifyRole));
+                    }
+                }
+            }
+        }
+        if (users!=null && users.size()!=0) {
+            for (User u : users) {
+                UserUtils.pushIm(u.getId(),titleStr);
+            }
+        }
+        if (users!=null && userList.size()!=0) {
+            for (User u : userList) {
+                UserUtils.pushMeIm(u.getId());
+            }
+        }
+        int i=dao.update(paperFiling);
+        return "保存审核意见成功!";
+    }
+
+}

+ 329 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/ProjectPaperFilingController.java

@@ -0,0 +1,329 @@
+package com.jeeplus.modules.ruralprojectrecords.web;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.config.Global;
+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.projectEngineering.entity.ProjectEngineeringInfo;
+import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
+import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectMaterialDefectRecord;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportRecordService;
+import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
+import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
+import com.jeeplus.modules.ruralprojectrecords.entity.ProjectPaperFiling;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
+import com.jeeplus.modules.ruralprojectrecords.service.ProjectPaperFilingService;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralPeojectRecordChooseCheckAllService;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.sys.entity.MainDictDetail;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.service.UserService;
+import com.jeeplus.modules.sys.utils.DictUtils;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+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.Logical;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 纸质归档Controller
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/paperFiling/paperFiling")
+public class ProjectPaperFilingController extends BaseController {
+
+    @Autowired
+    private ProjectPaperFilingService service;
+    @Autowired
+    private RuralProjectRecordsService ruralProjectRecordsService;
+    @Autowired
+    private ProjectPlanService projectPlanService;
+    @Autowired
+    private ProjectReportDataService projectReportDataService;
+    @Autowired
+    private RuralProjectMessageService ruralProjectMessageService;
+    @Autowired
+    private ActTaskService actTaskService;
+    @Autowired
+    private ProjectEngineeringService engineeringService;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private HistoryService historyService;
+    @Autowired
+    private ProjectReportRecordService projectReportRecordService;
+    /**
+     * 查看,增加,编辑项目表单页面
+     */
+    @RequestMapping(value = "form")
+    public String form(ProjectPaperFiling paperFiling, Model model) {
+        RuralProjectRecords projectRecords=new RuralProjectRecords();
+        projectRecords=ruralProjectRecordsService.get(paperFiling.getProjectId());
+        if (projectRecords!=null&& StringUtils.isNotBlank(projectRecords.getId())) {
+            ruralProjectRecordsService.queryProjectDetail(projectRecords);
+            if(null != projectRecords.getWorkContractInfo()){
+                if(null != projectRecords.getWorkContractInfo().getContractTypeDoc()){
+                    projectRecords.getWorkContractInfo().setContractType(DictUtils.getMainDictLabel(String.valueOf(projectRecords.getWorkContractInfo().getContractTypeDoc()),"contract_info_type",""));
+                }
+            }
+            ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
+            projectPlanInfo.setProjectId(projectRecords.getId());
+            //获取项目计划信息
+            List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
+            //项目计划附件信息
+            List<WorkClientAttachment> projectPlanAttachment = projectPlanService.getWorkAttachment(projectRecords.getId());
+            projectRecords.setProjectPlanList(projectPlanList);
+            projectRecords.setWorkAttachments(projectPlanAttachment);
+            projectRecords.setUploadMode(uploadMode);
+            if(StringUtils.isNotBlank(projectRecords.getAttachmentProjectSort())){
+                //处理项目类别
+                List<MainDictDetail> mainDictList = DictUtils.getMainDictList("attachment_project_sort");
+                for (MainDictDetail info: mainDictList) {
+                    if(projectRecords.getAttachmentProjectSort().equals(info.getValue())){
+                        projectRecords.setAttachmentProjectSort(info.getLabel());
+                        break;
+                    }
+                }
+            }
+
+            //查询项目报告信息
+            ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(projectRecords.getId());
+            //如果项目报告不为空,则查询项目线上归档信息
+            if(null != projectReportData){
+                ProjectReportRecord projectReportRecord = ruralProjectMessageService.getProjectReportRecord(projectReportData.getId());
+                if(null != projectReportRecord){
+                    model.addAttribute("projectId", projectRecords.getId());
+                }else{
+                    model.addAttribute("projectId", "");
+                }
+            }
+        }
+        //查询所有的工程类型
+        List<ProjectEngineeringInfo> engineeringInfos=engineeringService.findList(new ProjectEngineeringInfo());
+        model.addAttribute("engineeringInfo",engineeringInfos);
+        model.addAttribute("projectRecords", projectRecords);
+        model.addAttribute("projectPaperFiling", paperFiling);
+        return "modules/projectPaperFiling/projectPaperFilingForm";
+    }
+    @RequestMapping(value = "save")
+    public String save(ProjectPaperFiling paperFiling, RedirectAttributes redirectAttributes) throws Exception {
+        try {
+            //获取创建者信息
+            User user = paperFiling.getCreateBy();
+            Integer sta = paperFiling.getStatus();
+            if(user!=null && !UserUtils.getUser().getId().equals(user.getId()) && StringUtils.isNotBlank(user.getId())){
+                addMessage(redirectAttributes, "您不是申请人,无法修改");
+                if (StringUtils.isNotBlank(paperFiling.getView()) && paperFiling.getView().equals("filing")){
+                    return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralProjectMessage/?repage";
+                }
+                return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
+            }
+            //状态设置为审核中
+            paperFiling.setStatus(2);
+            String processInstanceId ="";
+            if (user!=null && StringUtils.isNotBlank(user.getId()) && null!=sta && sta!=0 && sta!=3){
+                processInstanceId = paperFiling.getProcessInstanceId();
+            }
+            Map<String, Object> variables = new HashMap<>();
+            if(!paperFiling.getIsNewRecord()){//编辑表单保存
+                ProjectPaperFiling t =  service.get(paperFiling.getId());//从数据库取出记录的值
+                MyBeanUtils.copyBeanNotNull2Bean(paperFiling,t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+//                if (StringUtils.isNotBlank(paperFiling.getView()) && materialDefectRecord.getView().equals("modify")){
+//                    materialDefectRecord.setStatus("2");
+//                }
+                service.saveCheck(t,variables,processInstanceId);//保存
+            }else {//新增表单保存
+//                ProjectReportRecord reportRecord = projectReportRecordService.getprojectReportRecord(materialDefectRecord.getReport().getId());//从数据库取出记录的值
+//                if(null !=reportRecord){
+//                    projectReportRecord.setId(reportRecord.getId());
+//                }
+                service.saveCheck(paperFiling,variables,processInstanceId);//保存
+            }
+            addMessage(redirectAttributes, "纸质归档流程创建成功");
+        }catch (Exception e){
+            logger.error("纸质归档流程创建异常:",e);
+            addMessage(redirectAttributes, "纸质归档流程创建异常:"+e.getMessage());
+        }
+        if (StringUtils.isNotBlank(paperFiling.getView()) && paperFiling.getView().equals("filing")){
+            return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralProjectMessage/?repage";
+        }
+        return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
+    }
+
+    /**
+     * 纸质归档:强制撤回
+     */
+    @RequestMapping("cancelInvalidate")
+    public String cancelInvalidate(ProjectPaperFiling paperFiling,RedirectAttributes redirectAttributes){
+        String view=paperFiling.getView();
+        paperFiling = service.get(paperFiling.getId());
+        try {
+            if(paperFiling.getStatus()==5){
+                addMessage(redirectAttributes, "纸质归档已审批通过,无法撤回");
+            }else{
+                if(paperFiling.getStatus()==2){
+                    service.cancelInvalidate(paperFiling);
+//                    ruralProjectMessageService.cancelInvalidate(projectReportRecord);
+                    addMessage(redirectAttributes, "强制撤回纸质归档成功");
+                }else{
+                    addMessage(redirectAttributes, "纸质归档不是送审状态,无法撤回");
+                    if (StringUtils.isNotBlank(paperFiling.getView()) && paperFiling.getView().equals("filing")){
+                        return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralProjectMessage/?repage";
+                    }
+                    return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectMessage/?repage";
+                }
+            }
+        }catch (Exception e){
+            addMessage(redirectAttributes, "强制撤回纸质归档失败");
+            logger.error("强制撤回归档信息失败",e);
+        }
+        if (StringUtils.isNotBlank(view) && view.equals("filing")){
+            return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralProjectMessage/?repage";
+        }
+        return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectMessage/?repage";
+    }
+    /**
+     * 检查流程审批
+     * @param paperFiling
+     * @param redirectAttributes
+     * @return
+     */
+    @RequestMapping("saveAudit")
+    public String saveAudit(ProjectPaperFiling paperFiling,RedirectAttributes redirectAttributes) {
+        String home = paperFiling.getHome();
+        ProjectPaperFiling t = service.get(paperFiling.getId());//从数据库取出记录的值
+        try {
+            String taskDefKey = paperFiling.getAct().getTaskDefKey();
+            //当状态为未通过时,重新修改数据
+            if ("modifyApply".equals(taskDefKey)) {
+                paperFiling.getAct().setComment("重新申请");
+            }
+            List<User> users = UserUtils.getByProssType(t.getProcessInstanceId(),1);
+            String flag = paperFiling.getAct().getFlag();
+            if ("yes".equals(flag) && (users==null || users.size()==0)){
+                addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
+            }else {
+                MyBeanUtils.copyBeanNotNull2Bean(paperFiling, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+                String str = service.auditSave(t,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(paperFiling.getView()) && paperFiling.getView().equals("filing")){
+                return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralProjectMessage/?repage";
+            }
+            return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectMessage/?repage";
+        }
+    }
+    /**
+     * 驳回修改
+     */
+    @RequestMapping(value = "modify")
+    public String modify(ProjectPaperFiling paperFiling, Model model) {
+        RuralProjectRecords projectRecords=new RuralProjectRecords();
+        projectRecords=ruralProjectRecordsService.get(paperFiling.getProjectId());
+        if (projectRecords!=null&& StringUtils.isNotBlank(projectRecords.getId())) {
+            ruralProjectRecordsService.queryProjectDetail(projectRecords);
+            if(null != projectRecords.getWorkContractInfo()){
+                if(null != projectRecords.getWorkContractInfo().getContractTypeDoc()){
+                    projectRecords.getWorkContractInfo().setContractType(DictUtils.getMainDictLabel(String.valueOf(projectRecords.getWorkContractInfo().getContractTypeDoc()),"contract_info_type",""));
+                }
+            }
+            ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
+            projectPlanInfo.setProjectId(projectRecords.getId());
+            //获取项目计划信息
+            List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
+            //项目计划附件信息
+            List<WorkClientAttachment> projectPlanAttachment = projectPlanService.getWorkAttachment(projectRecords.getId());
+            projectRecords.setProjectPlanList(projectPlanList);
+            projectRecords.setWorkAttachments(projectPlanAttachment);
+            projectRecords.setUploadMode(uploadMode);
+            if(StringUtils.isNotBlank(projectRecords.getAttachmentProjectSort())){
+                //处理项目类别
+                List<MainDictDetail> mainDictList = DictUtils.getMainDictList("attachment_project_sort");
+                for (MainDictDetail info: mainDictList) {
+                    if(projectRecords.getAttachmentProjectSort().equals(info.getValue())){
+                        projectRecords.setAttachmentProjectSort(info.getLabel());
+                        break;
+                    }
+                }
+            }
+            paperFiling.setAct(getByAct(paperFiling.getProcessInstanceId()));
+
+            //查询项目报告信息
+            ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(projectRecords.getId());
+            //如果项目报告不为空,则查询项目线上归档信息
+            if(null != projectReportData){
+                ProjectReportRecord projectReportRecord = ruralProjectMessageService.getProjectReportRecord(projectReportData.getId());
+                if(null != projectReportRecord){
+                    model.addAttribute("projectId", projectRecords.getId());
+                }else{
+                    model.addAttribute("projectId", "");
+                }
+            }
+        }
+        //查询所有的工程类型
+        List<ProjectEngineeringInfo> engineeringInfos=engineeringService.findList(new ProjectEngineeringInfo());
+        model.addAttribute("engineeringInfo",engineeringInfos);
+        model.addAttribute("projectRecords", projectRecords);
+        model.addAttribute("projectPaperFiling", paperFiling);
+        return "modules/projectPaperFiling/projectPaperFilingModify";
+    }
+    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 (UserUtils.getUser().getId().equals(taskInfok.getAssignee())) {
+                        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;
+    }
+
+}

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

@@ -372,6 +372,8 @@ public class WorkProjectNotifyController extends BaseController {
 	@Autowired
 	private RuralPeojectRecordChooseCheckService ruralPeojectRecordChooseCheckService;
 	@Autowired
+	private ProjectPaperFilingService projectPaperFilingService ;
+	@Autowired
 	private ProjectRecordsAlterService projectRecordsAlterService;
 	@Autowired
 	private RuralProjectRecordsAlterService ruralProjectRecordsAlterService;
@@ -1512,6 +1514,65 @@ public class WorkProjectNotifyController extends BaseController {
 						}
 					}
 
+				} else if (workProjectNotify.getType().equals("110")) {    //项目纸质归档
+					boolean flag = false;
+					//通过通知信息id获取项目登记对象
+					ProjectPaperFiling projectPaperFiling = projectPaperFilingService.get(workProjectNotify.getNotifyId());
+					RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectPaperFiling.getProjectId());
+
+					if (ruralProjectRecords != null && StringUtils.isNotBlank(ruralProjectRecords.getId())) {
+						ruralProjectRecordsService.queryProjectDetail(ruralProjectRecords);
+						ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
+						projectPlanInfo.setProjectId(ruralProjectRecords.getId());
+
+						//获取项目计划信息
+						List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
+						//项目计划附件信息
+						List<WorkClientAttachment> projectPlanAttachment = projectPlanService.getWorkAttachment(ruralProjectRecords.getId());
+						ruralProjectRecords.setProjectPlanList(projectPlanList);
+						ruralProjectRecords.setWorkAttachments(projectPlanAttachment);
+						ruralProjectRecords.setUploadMode(uploadMode);
+					}
+					projectPaperFiling.setAct(getByAct(projectPaperFiling.getProcessInstanceId()));
+					if(StringUtils.isNotBlank(workProjectNotify.getHome())){
+						projectPaperFiling.setHome(workProjectNotify.getHome());
+					}else{
+						projectPaperFiling.setHome("home");
+					}
+					if(null != ruralProjectRecords.getWorkContractInfo()){
+						if(null != ruralProjectRecords.getWorkContractInfo().getContractTypeDoc()){
+							ruralProjectRecords.getWorkContractInfo().setContractType(DictUtils.getMainDictLabel(String.valueOf(ruralProjectRecords.getWorkContractInfo().getContractTypeDoc()),"contract_info_type",""));
+						}
+					}
+					//查询所有的工程类型
+					List<ProjectEngineeringInfo> engineeringInfos=engineeringService.findList(new ProjectEngineeringInfo());
+					model.addAttribute("engineeringInfo",engineeringInfos);
+					model.addAttribute("processInstanceId", projectPaperFiling.getProcessInstanceId());
+					model.addAttribute("projectRecords", ruralProjectRecords);
+					model.addAttribute("projectPaperFiling", projectPaperFiling);
+					//处理项目类别
+					List<MainDictDetail> mainDictList = DictUtils.getMainDictList("attachment_project_sort");
+					for (MainDictDetail info: mainDictList) {
+						if(ruralProjectRecords.getAttachmentProjectSort().equals(info.getValue())){
+							ruralProjectRecords.setAttachmentProjectSort(info.getLabel());
+							break;
+						}
+					}
+					//查询总审人员信息
+					List<User> auditUserList = userService.getAuditUserList();
+					ruralProjectRecords.setBzshbUserList(auditUserList);
+					if (workProjectNotify.getRemarks().contains("待通知") || "view".equals(workProjectNotify.getView())) {
+						return "modules/projectPaperFiling/projectPaperFilingView";
+					}else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
+						model.addAttribute("identification", "projectPaperFiling");
+						model.addAttribute("identificationName","项目纸质归档意见");
+						return "modules/projectPaperFiling/projectPaperFilingAudit";
+					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
+						return "modules/projectPaperFiling/projectPaperFilingModify";
+					} else {
+						return "modules/projectPaperFiling/projectPaperFilingView";
+					}
+
 				} else if (workProjectNotify.getType().equals("140")) {    //项目检查
 					boolean flag = false;
 					//通过通知信息id获取项目登记对象

+ 89 - 0
src/main/resources/mappings/modules/ruralprojectrecords/ProjectPaperFilingDao.xml

@@ -0,0 +1,89 @@
+<?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.ProjectPaperFilingDao">
+    
+	<sql id="projectPaperFilingColumns">
+		DISTINCT a.id AS "id",
+		a.create_by AS "createBy.id",
+		(select name from sys_user user where user.id=a.create_by) AS "createBy.name",
+		(select name from sys_user user where user.id=a.create_by) AS "principalUser",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.del_flag AS "delFlag",
+		a.status As "status",
+		a.process_instance_id As "processInstanceId" ,
+		a.project_id As "projectId",
+		a.office_id	As "officeId",
+		a.company_id As "companyId",
+		a.file_num AS "fileNum",
+		a.file_num_tow AS "fileNumTow"
+	</sql>
+
+	<sql id="projectPaperFilingJions">
+		left join rural_project_records r on a.project_id =r.id
+		left join work_contract_info wci on r.contract_id = wci.id
+		left join work_client_info client on client.id = wci.client_id
+		left join project_report_data prd on prd.project_id = r.id
+		left join rural_project_report_record prr on prr.report_id = prd.id
+		left join sys_user u on u.id = a.create_by
+		left join sys_office o on o.id = r.office_id
+		LEFT JOIN sys_area area ON area.id = r.area_id
+        LEFT JOIN work_project_user w1 on a.id = w1.project_id
+		left join sys_user su on su.id = w1.user_id
+		left join sys_office so on so.id = su.office_id
+	</sql>
+
+	<select id="get" resultType="com.jeeplus.modules.ruralprojectrecords.entity.ProjectPaperFiling" >
+		SELECT
+			<include refid="projectPaperFilingColumns"/>
+		FROM project_paper_filing a
+		<include refid="projectPaperFilingJions"/>
+		WHERE a.id = #{id}
+	</select>
+	<insert id="insert">
+		INSERT INTO project_paper_filing(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			del_flag,
+			company_id,
+			office_id,
+			status,
+			process_instance_id,
+			project_id
+		) VALUES (
+			 #{id},
+			 #{createBy.id},
+			 #{createDate},
+			 #{updateBy.id},
+			 #{updateDate},
+			 #{delFlag},
+			 #{companyId},
+			 #{officeId},
+			 #{status},
+			 #{processInstanceId},
+			 #{projectId}
+				 )
+	</insert>
+	<update id="update">
+		UPDATE project_paper_filing SET
+			   update_by = #{updateBy.id},
+			   update_date = #{updateDate},
+			   company_id = #{companyId},
+			   office_id = #{officeId},
+			   status = #{status},
+			   process_instance_id = #{processInstanceId},
+			   file_num = #{fileNum},
+			   file_num_tow = #{fileNumTow}
+		WHERE id = #{id}
+	</update>
+	<update id="updateProcessIdAndStatus">
+		UPDATE project_paper_filing SET
+			   status = #{status},
+			   process_instance_id = #{processInstanceId}
+		WHERE id = #{id}
+	</update>
+</mapper>

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

@@ -354,6 +354,9 @@
 		,ifnull(pmdr.status,0) as "defectRecordStatus"
 		,pmdr.process_instance_id as "pmdrProcessInstanceId"
 		,pmdr.id as pmdrId
+		,ifnull(ppf.status,0) as "paperFilingStatus"
+		,ppf.process_instance_id as "ppfProcessInstanceId"
+		,ppf.id as "ppfId"
 		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
@@ -372,6 +375,7 @@
 		left join rural_project_report_record prr on prr.report_id = prd.id
 		LEFT JOIN project_material_defect_record pmdr on prd.id = pmdr.report_id
 		left join rural_project_report_record_down prrd on prrd.report_id = prd.id
+		left join project_paper_filing ppf on ppf.project_id = a.id
 		<where>
 			a.status = 5
 			<if test="projectId != null and projectId != ''">
@@ -543,6 +547,7 @@
 		left join rural_project_report_record_down prrd on prrd.report_id = prd.id
 		LEFT JOIN project_flingbatch_relation pfp on pfp.project_id= a.id
 		LEFT JOIN sys_user sua on a.create_by = sua.id
+		left join project_paper_filing ppf on ppf.project_id = a.id
 
 		<where>
             a.status = 5

+ 243 - 0
src/main/webapp/webpage/modules/projectPaperFiling/projectPaperFilingAudit.jsp

@@ -0,0 +1,243 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>项目审批管理</title>
+	<meta name="decorator" content="default"/>
+	<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>
+	<script type="text/javascript" src="${ctxStatic}/layui/layuidown.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/layuidown.css"/>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+				var fileNum =  $("#fileNum").val();
+				var fileNumTow =  $("#fileNumTow").val();
+				var ss= document.getElementById("iframe").contentWindow.document.getElementById("opinion").value
+				$("#opinion").val(ss);
+                if(obj == 1) {
+                    $("#flag").val("yes");
+					if(fileNum == ''|| fileNum == undefined){
+						top.layer.msg('填写案卷号!', {icon: 0});
+						return;
+					}
+					if(fileNumTow == ''|| fileNumTow == undefined){
+						top.layer.msg('请再次填写案卷号!', {icon: 0});
+						return;
+					}
+					if(fileNum != fileNumTow){
+						top.layer.msg('两次案卷号填写不同,请重新输入!', {icon: 0});
+						return;
+					}
+                }else {
+                    if(obj == 2){
+                        $("#flag").val("no1");
+					}else {
+                        $("#flag").val("no2");
+					}
+                }
+                $("#inputForm").submit();
+                return true;
+            }
+
+		  return false;
+		}
+		$(document).ready(function() {
+
+			var tt = $("#contractNum").val();
+			if (tt == null || tt === "") {
+				$("#divv").hide();
+				$("#divv2").show();
+				$("#divv3").hide();
+				setTimeout(function () {
+					var tt = $("#workClientLinkmanList").find("tr").eq(0).find("td").eq(1).text().trim();
+					$("#clientName").val(tt);
+				},100);
+			}else{
+				$("#divv2").hide();
+			}
+
+			validateForm = $("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+
+			});
+
+			var contractNum = $("#contractNum").val();
+			if (contractNum == null || contractNum === "") {
+				$("#div1").hide();
+				$("#div3").hide();
+				setTimeout(function () {
+					var tt = $("#workClientLinkmanList").find("tr").eq(0).find("td").eq(1).text().trim();
+					$("#clientName").val(tt);
+				},100);
+			}
+			//默认打开判断是否时紧急项目
+			var submitMoney="${projectRecords.submitMoney}"
+			if(submitMoney==1){
+				$("#emergencyProject").parent().parent().parent().show();
+				var emergencyProject="${projectRecords.emergencyProject}"
+				if (emergencyProject=="1"){
+					$("#emergencyProject").prop("checked",true);
+					layui.form.render();
+				}else{
+					$("#emergencyProject").prop("checked",false);
+					layui.form.render();
+				}
+			}
+			$("#iframeTap").load(function () {
+				console.log($(this).contents().find("body").height());
+				console.log("---------------")
+				console.log($(this).contents().find("body"));
+				var mainheight = $(this).contents().find("body").height() + 30;
+				$(this).height(mainheight);
+			});
+		});
+
+        function insertTitle(tValue){
+            var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
+            var attachmentId = $("#id").val();
+            var attachmentFlag = "82";
+            console.log(file);
+            var timestamp=new Date().getTime();
+
+				var storeAs = "projectRecods";
+            var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+            var divId = "_attachment";
+            $("#addFile"+divId).show();
+            multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
+        }
+
+        function addFile() {
+            $("#attachment_file").click();
+        }
+
+        function addRow(list, idx, tpl, row){
+            // var idx1 = $("#workClientLinkmanList tr").length;
+            bornTemplete(list, idx, tpl, row, idx);
+        }
+
+        function bornTemplete(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+        }
+	</script>
+</head>
+<body >
+<div class="single-form">
+	<iframe id="iframeTap" src="${ctx}/ruralProject/ruralProjectView/view?id=${projectRecords.id}" name="" frameborder="0" align="left" width="100%" height="1700px" scrolling="value"></iframe>
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="projectPaperFiling" enctype="multipart/form-data" action="${ctx}/paperFiling/paperFiling/saveAudit" method="post" class="form-horizontal layui-form">
+		<form:hidden path="id"/>
+		<form:hidden path="home"/>
+		<form:hidden path="act.taskId"/>
+		<form:hidden path="act.taskName"/>
+		<form:hidden id="taskDefKey" path="act.taskDefKey"/>
+		<form:hidden path="act.procInsId"/>
+		<form:hidden path="act.procDefId"/>
+		<form:hidden id="flag" path="act.flag"/>
+		<input type="hidden" id="opinion" name="act.comment" value="" maxlength="250">
+		<c:set var="status" value="${projectRecords.act.status}" />
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>提交说明</h2></div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label"><span class="require-item">*</span>案卷号:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" id="fileNum" name="fileNum"  class="form-control layui-input" value="${projectRecords.fileNum}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label"><span class="require-item">*</span>确认案卷号:</label>
+					<div class="layui-input-block">
+						<input id="fileNumTow" name="fileNumTow" type="text"  class="layui-input form-control" equalTo="#fileNum" value="${projectRecords.fileNumTow}"/>
+					</div>
+				</div>
+			</div>
+
+			<script>
+				layui.use(['form', 'layer'], function () {
+					var form = layui.form;
+				});
+				function f1(row) {
+					// window.parent.document.getElementById('opinion').value = row;
+					$("#opinion").val(row)
+				}
+				function openDialogre(title,url,width,height,target,buttons) {
+					if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+						width = 'auto';
+						height = 'auto';
+					} else {//如果是PC端,根据用户设置的width和height显示。
+					}
+					var split = buttons.split(",");
+					top.layer.open({
+						type: 2,
+						area: [width, height],
+						title: title,
+						maxmin: true, //开启最大化最小化按钮
+						skin: 'three-btns',
+						content: url,
+						btn: split,
+						btn1: function(index, layero){
+							top.layer.close(index)
+							document.getElementById('iframe').contentWindow.location.reload();
+						}
+					});
+				}
+                var workClientLinkmanRowIdx = 0, workClientLinkmanTpl = $("#workClientLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                var workConstructionLinkmanRowIdx = 0, workConstructionLinkmanTpl = $("#workConstructionLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                $(document).ready(function() {
+                    var data = ${fns:toJson(projectRecords.workClientLinkmanList)};
+                    for (var i=0; i<data.length; i++){
+                        addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl, data[i]);
+                        workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
+                    }
+                    var dataBank = ${fns:toJson(projectRecords.workConstructionLinkmanList)};
+                    for (var i=0; i<dataBank.length; i++){
+                        addRow('#workConstructionLinkmanList', workConstructionLinkmanRowIdx, workConstructionLinkmanTpl, dataBank[i]);
+                        workConstructionLinkmanRowIdx = workConstructionLinkmanRowIdx + 1;
+                    }
+                });
+
+			</script>
+
+	</form:form>
+		<div class="form-group-label">
+			<div style="float: right"> <a href="javascript:void(0)" style='background-color: #FFB800' onclick="openDialogre('个人模板列表', '${ctx}/auditTemplate/auditTemplate/templateList?identification=${identification}&name=${identificationName}','80%', '70%','','关闭')" class="nav-btn layui-btn layui-btn-sm" ><i class="fa fa-file-excel-o"></i> 审核意见模板列表</a></div>
+			<h2>审批意见</h2>
+		</div>
+		<iframe id="iframe" src="${ctx}/auditTemplate/auditTemplate/iframeView?identification=${identification}" name="listresult" frameborder="0" align="left" width="100%" height="300" scrolling="value"></iframe>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>审批流程</h2></div>
+				<div class="layui-item layui-col-xs12 form-table-container" >
+					<act:flowChart procInsId="${processInstanceId}"/>
+					<act:histoicFlow procInsId="${processInstanceId}"/>
+				</div>
+			</div>
+	</div>
+</div>
+</body>
+</html>

+ 531 - 0
src/main/webapp/webpage/modules/projectPaperFiling/projectPaperFilingForm.jsp

@@ -0,0 +1,531 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>项目审批管理</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript" src="${ctxStatic}/layui/layuidown.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/layuidown.css"/>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+			if(validateForm.form()){
+				$("#inputForm").attr("action","${ctx}/paperFiling/paperFiling/save");
+				$("#inputForm").submit();
+				return true;
+			}
+
+			return false;
+		}
+		$(document).ready(function() {
+			var radioVal ;
+			validateForm = $("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+			var tt = $("#contractNum").val();
+			if (tt == null || tt === "") {
+				$("#divv").hide();
+				$("#divv2").show();
+				$("#divv3").hide();
+				setTimeout(function () {
+					var tt = $("#workClientLinkmanList").find("tr").eq(0).find("td").eq(1).text().trim();
+					$("#clientName").val(tt);
+				},100);
+			}else{
+				$("#divv2").hide();
+			}
+
+			layui.use('form', function () {
+				var form = layui.form;
+				form.render();
+			});
+			//默认打开判断是否时紧急项目
+			var submitMoney="${projectRecords.submitMoney}"
+			if(submitMoney==1){
+				$("#emergencyProject").parent().parent().parent().show();
+				var emergencyProject="${projectRecords.emergencyProject}"
+				if (emergencyProject=="1"){
+					$("#emergencyProject").prop("checked",true);
+					layui.form.render();
+				}else{
+					$("#emergencyProject").prop("checked",false);
+					layui.form.render();
+				}
+			}
+		});
+		function initRecordStatus(index,id,dataid,status)
+		{
+			var elem = document.getElementById("status_td_" + index);
+			var st = getAuditState(status);
+			if(st.action)
+				var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/projectcontentinfo/projectcontentinfo/getProcessOne?id=" + id + "&projectReportData.id="+ dataid + "&type="+status+"','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+			else
+				var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+
+			elem.innerHTML = xml;
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container view-form">
+		<form:form id="inputForm" modelAttribute="projectPaperFiling" action="${ctx}/paperFiling/paperFiling/save" method="post" class="form-horizontal  layui-form">
+			<input type="hidden" id="id" name="id" value="${projectPaperFiling.id}">
+			<input type="hidden" id="id" name="projectId" value="${projectRecords.id}">
+			<form:input path="view"/>
+			<div class="form-group layui-row first">
+				<div class="form-group-label"><h2>项目合同信息</h2></div>
+               <div id="divv">
+				   <div class="layui-item layui-col-sm12 lw6">
+					   <label class="layui-form-label">合同编号:</label>
+					   <div class="layui-input-block">
+						   <input htmlEscape="false" style="background-color: #f1f1f1" id="contractNum" readonly="true" class="form-control layui-input" value="${projectRecords.workContractInfo.contractNum}"/>
+					   </div>
+				   </div>
+				   <div class="layui-item layui-col-sm6 lw6">
+					   <label class="layui-form-label">合同名称:</label>
+					   <div class="layui-input-block">
+						   <input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" value="${projectRecords.workContractInfo.name}"/>
+					   </div>
+				   </div>
+					<c:if test="${projectRecords.workContractInfo.contractInformation =='0'}">
+						<div class="layui-item layui-col-sm6 lw6">
+							<label class="layui-form-label double-line">合同金额(元):</label>
+							<div class="layui-input-block">
+								<input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" value="<fmt:formatNumber value="${projectRecords.workContractInfo.contractPrice}" pattern="#,##0.00#"/>"/>
+							</div>
+						</div>
+					</c:if>
+				   <c:if test="${projectRecords.workContractInfo.contractInformation =='1'}">
+					   <div class="layui-item layui-col-sm6 lw6">
+						   <label class="layui-form-label">费率合同:</label>
+						   <div class="layui-input-block">
+							   <input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" title="${projectRecords.workContractInfo.otherDetails}" value="${projectRecords.workContractInfo.otherDetails}"/>
+						   </div>
+					   </div>
+				   </c:if>
+
+
+				   <div class="layui-item layui-col-sm6 lw6">
+					   <label class="layui-form-label">委托方:</label>
+					   <div class="layui-input-block">
+						   <input htmlEscape="false" style="background-color: #f1f1f1"  id="clientName" readonly="true" class="form-control layui-input" value="${projectRecords.workContractInfo.client.name}"/>
+					   </div>
+				   </div>
+			   </div>
+				<div id="divv2">
+					<div class="layui-item layui-col-sm6 lw6">
+						<label class="layui-form-label">无合同</label>
+					</div>
+				</div>
+				<div id="divv3">
+					<div class="layui-item layui-col-sm6 lw6">
+						<label class="layui-form-label">合同类型:</label>
+						<div class="layui-input-block">
+							<input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" value="${projectRecords.workContractInfo.contractType}"/>
+						</div>
+					</div>
+				</div>
+			</div>
+
+			<div class="form-group layui-row first">
+				<div class="form-group-label"><h2>项目基础信息</h2></div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目名称:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" style="background-color: #f1f1f1" value="${projectRecords.projectName}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目编号:</label>
+					<div class="layui-input-block">
+						<div class="input-group">
+							<input htmlEscape="false"  readonly="true" class="form-control layui-input" style="background-color: #f1f1f1" value="${projectRecords.projectId}"/>
+							<span class="input-group-btn">
+                                <label class="form-status"><c:choose><c:when test="${not empty projectRecords.projectStatus}">${fns:getDictLabel(projectRecords.projectStatus, 'rural_project_audit_state', '')}</c:when><c:otherwise>新添</c:otherwise></c:choose></label>
+                             </span>
+						</div>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目所在地:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${projectRecords.province}-${projectRecords.city}-${projectRecords.county}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">投资性质:</label>
+					<div class="layui-input-block">
+						<c:if test="${projectRecords.projectProperties==null}">
+							<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input"/>
+						</c:if>
+						<c:forEach  items="${fns:getMainDictList('project_properties')}" var="v">
+							<c:if test="${v.value==projectRecords.projectProperties}">
+								<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${v.label}"/>
+							</c:if>
+						</c:forEach>
+					</div>
+				</div>
+					<%--				<div class="layui-item layui-col-sm6 lw6">--%>
+					<%--					<label class="layui-form-label">所在省份:</label>--%>
+					<%--					<div class="layui-input-block">--%>
+					<%--						<form:input path="province" cssStyle="background-color: #f1f1f1" htmlEscape="false" id="province" class="form-control layui-input" readonly="true"/>--%>
+					<%--					</div>--%>
+					<%--				</div>--%>
+					<%--				<div class="layui-item layui-col-sm6 lw6">--%>
+					<%--					<label class="layui-form-label">所在地级市:</label>--%>
+					<%--					<div class="layui-input-block">--%>
+					<%--						<form:input path="city" cssStyle="background-color: #f1f1f1" htmlEscape="false" id="city" class="form-control layui-input" readonly="true"/>--%>
+					<%--					</div>--%>
+					<%--				</div>--%>
+					<%--				<div class="layui-item layui-col-sm6 lw6">--%>
+					<%--					<label class="layui-form-label">所在区县:</label>--%>
+					<%--					<div class="layui-input-block">--%>
+					<%--						<form:input path="county" cssStyle="background-color: #f1f1f1" htmlEscape="false" id="areaName1" class="form-control layui-input" readonly="true"/>--%>
+					<%--					</div>--%>
+					<%--				</div>--%>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">建设地点:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" value="${projectRecords.projectSite}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">创建人:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${projectRecords.createBy.name}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目责任人:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${projectRecords.leaderNameStr}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">所属部门:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" id="officeName" class="form-control layui-input" value="${projectRecords.officeName}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目负责人:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${projectRecords.projectMasterName}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">工程类型:</label>
+					<div class="layui-input-block">
+						<c:forEach items="${engineeringInfo}" var="e">
+							<c:if test="${e.id==projectRecords.engineeringType}">
+								<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${e.engineeringName}"/>
+							</c:if>
+						</c:forEach>
+<%--						<form:select path="" disabled="true" style="background-color: #f1f1f1"  class="form-control simple-select">--%>
+<%--							<form:options items="${engineeringInfo}" itemLabel="engineeringName" itemValue="id" htmlEscape="false"/>--%>
+<%--							&lt;%&ndash;							<c:forEach items="${engineeringInfo}" varStatus="index" var="info">&ndash;%&gt;--%>
+<%--							&lt;%&ndash;								<form:option value="${info.id}" <c:if test="${info.id == projectRecords.engineeringType}"> selected</c:if>>${info.engineeringName}</form:option>&ndash;%&gt;--%>
+<%--							&lt;%&ndash;							</c:forEach>&ndash;%&gt;--%>
+<%--						</form:select>--%>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目等级:</label>
+					<div class="layui-input-block">
+						<c:forEach items="${fns:getMainDictListOnProjectAdvent('attachment_project_grade')}" var="v">
+							<input type="radio" disabled name="submitMoney" id="submitMoney" value="${v.value}" title="${v.label}" <c:if test="${projectRecords.submitMoney==v.value}">checked</c:if>>
+						</c:forEach>
+							<%--<form:select path="submitMoney" disabled="true" style="background-color: #f1f1f1"  class="form-control simple-select">
+                                <form:option value=""/>
+                                <form:options items="${fns:getMainDictListOnProjectAdvent('attachment_project_approval_money')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                            </form:select>--%>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7" style="display: none">
+					<label class="layui-form-label double-line">是否是紧急项目:</label>
+					<div class="layui-input-block">
+						<div style="margin-right: 30px;">
+							<input type="checkbox" id="emergencyProject" disabled lay-filter="emergencyProject" lay-skin="switch" lay-text="是|否">
+						</div>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label double-line">送审规模(万元):</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${projectRecords.submitScale}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label double-line">工作开始日期:</label>
+					<div class="layui-input-block">
+						<input class="laydate-icondate form-control layui-input layer-date ash"  style="background-color: #f1f1f1" readonly="true" id="startDate" name="startDate" value="<fmt:formatDate value="${projectRecords.startDate}" pattern="yyyy-MM-dd"/>">
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label double-line">工作结束日期:</label>
+					<div class="layui-input-block">
+						<input class="laydate-icondate form-control layui-input layer-date "  style="background-color: #f1f1f1" readonly="true" id="endingDate" name="endingDate" value="<fmt:formatDate value="${projectRecords.endingDate}" pattern="yyyy-MM-dd"/>">
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">创建日期:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="<fmt:formatDate value="${projectRecords.createDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label">项目类别:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true"  style="background-color: #f1f1f1" class="form-control layui-input" value="${projectRecords.attachmentProjectSort}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6 with-textarea">
+					<label class="layui-form-label">工程概况:</label>
+					<div class="layui-input-block">
+						<textarea htmlEscape="false" rows="4" readonly="true"  style="background-color: #f1f1f1" maxlength="1000" class="form-control" >${projectRecords.projectDesc}</textarea>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6 with-textarea">
+					<label class="layui-form-label">备注:</label>
+					<div class="layui-input-block">
+						<textarea htmlEscape="false" rows="4" readonly="true" maxlength="1000"  style="background-color: #f1f1f1" class="form-control" >${projectRecords.remarks}</textarea>
+					</div>
+				</div>
+			</div>
+
+
+
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>委托方联系人信息</h2></div>
+				<div class="layui-item layui-col-xs12 form-table-container" >
+					<table id="contentTable" class="table table-bordered table-condensed no-bottom-margin details">
+						<thead>
+						<tr>
+							<th class="hide"></th>
+							<th width="25%">委托方</th>
+							<th width="25%">联系人姓名</th>
+							<th width="25%">联系方式1</th>
+							<th width="25%">联系方式2</th>
+						</tr>
+						</thead>
+						<tbody id="workClientLinkmanList">
+							<c:forEach items="${projectRecords.workClientLinkmanList}" var="info" varStatus="index">
+								<tr>
+									<td >
+											${info.clientId.name}
+									</td>
+									<td>
+											${info.name}
+									</td>
+									<td>
+											${info.linkPhone}
+									</td>
+									<td>
+											${info.linkMobile}
+									</td>
+								</tr>
+							</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>施工方信息</h2></div>
+				<div class="layui-item layui-col-xs12 form-table-container" >
+					<table id="contentTable1" class="table table-bordered table-condensed no-bottom-margin details">
+						<thead>
+						<tr>
+							<th class="hide"></th>
+							<th width="25%">施工方单位名称</th>
+							<th width="25%">联系人姓名</th>
+							<th width="25%">联系方式1</th>
+							<th width="25%">联系方式2</th>
+						</tr>
+						</thead>
+						<tbody id="workConstructionLinkmanList">
+							<c:forEach items="${projectRecords.workConstructionLinkmanList}" var="info" varStatus="index">
+								<tr>
+									<td >
+											${info.clientId.name}
+									</td>
+									<td>
+											${info.name}
+									</td>
+									<td>
+											${info.linkPhone}
+									</td>
+									<td>
+											${info.linkMobile}
+									</td>
+								</tr>
+							</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>项目报告</h2></div>
+				<div class="layui-item layui-col-xs12 form-table-container" >
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+							<th width="25%">报告编号</th>
+							<th width="25%">报告名称</th>
+							<th width="25%">创建日期</th>
+							<th width="25%">状态</th>
+						</tr>
+						</thead>
+						<tbody>
+						<c:choose>
+							<c:when test="${not empty projectRecords.projectReportData}">
+								<c:forEach items="${projectRecords.projectReportData}" var="projectReportData" varStatus="index">
+									<tr>
+										<td><a title="${projectReportData.number}" href="javascript:void(0)" onclick="openDialogView('查看报告详情', '${ctx}/ruralProject/ruralProjectView/modify?projectId=${projectRecords.id}','95%', '95%')">
+												${projectReportData.number}
+										</a></td>
+										<td>
+												${projectReportData.name}
+										</td>
+										<td>
+											<fmt:formatDate value="${projectReportData.reportDate}" pattern="yyyy-MM-dd"/>
+										</td>
+										<td class="op-td">
+											<div style="text-align: center" id="status_td_${index.index+1}">
+											</div>
+											<script>
+												initRecordStatus(${index.index+1},"${id}","${projectReportData.id}","${projectReportData.status}");
+											</script>
+										</td>
+									</tr>
+								</c:forEach>
+							</c:when>
+							<c:otherwise>
+								<tr>
+									<td colspan="7">
+										暂无数据
+									</td>
+								</tr>
+							</c:otherwise>
+						</c:choose>
+						</tbody>
+					</table>
+				</div>
+			</div>
+
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>项目计划附件信息</h2></div>
+				<div class="layui-item layui-col-xs12 form-table-container" >
+					<table id="listAttachment" class="table table-bordered table-condensed no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="25%">文件预览</th>
+							<th width="25%">上传人</th>
+							<th width="25%">上传时间</th>
+							<th width="25%">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${projectRecords.workAttachments}" var="workClientAttachment" varStatus="status">
+							<tr>
+								<c:choose>
+									<c:when test="${projectRecords.uploadMode == 2}">
+										<c:choose>
+											<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+												<td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+											</c:when>
+											<c:otherwise>
+												<c:choose>
+													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+														<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+													</c:when>
+													<c:otherwise>
+														<c:choose>
+															<c:when test="${fn:containsIgnoreCase(fileOther.attachName,'rar')
+                                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+															</c:when>
+															<c:otherwise>
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+															</c:otherwise>
+														</c:choose>
+													</c:otherwise>
+												</c:choose>
+											</c:otherwise>
+										</c:choose>
+									</c:when>
+									<c:otherwise>
+										<c:choose>
+											<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+												<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+											</c:when>
+											<c:otherwise>
+												<c:choose>
+													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+														<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+													</c:when>
+													<c:otherwise>
+														<c:choose>
+															<c:when test="${fn:containsIgnoreCase(fileOther.attachName,'rar')
+                                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+															</c:when>
+															<c:otherwise>
+																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+															</c:otherwise>
+														</c:choose>
+													</c:otherwise>
+												</c:choose>
+											</c:otherwise>
+										</c:choose>
+									</c:otherwise>
+								</c:choose>
+
+
+								<td>${workClientAttachment.createBy.name}</td>
+								<td><fmt:formatDate value="${workClientAttachment.createDate}" pattern="yyyy-MM-dd"/></td>
+								<td  class="op-td">
+									<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+									<c:if test="${workClientAttachment.collectFlag != 1}">
+										<a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete"  style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
+									</c:if>
+<!--									<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>-->
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+			<div class="form-group layui-row page-end"></div>
+		</form:form>
+	</div>
+</div>
+</body>
+</html>

+ 553 - 0
src/main/webapp/webpage/modules/projectPaperFiling/projectPaperFilingModify.jsp

@@ -0,0 +1,553 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>项目审批管理</title>
+	<meta name="decorator" content="default"/>
+	<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>
+	<script type="text/javascript" src="${ctxStatic}/layui/layuidown.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/layuidown.css"/>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+			if(validateForm.form()){
+				if(obj == 1) {
+					$("#flag").val("yes");
+				}else {
+					if(obj == 2){
+						$("#flag").val("no1");
+					}else {
+						$("#flag").val("no2");
+					}
+				}
+				$("#inputForm").submit();
+				return true;
+			}
+
+			return false;
+		}
+		$(document).ready(function() {
+
+			var tt = $("#contractNum").val();
+			if (tt == null || tt === "") {
+				$("#divv").hide();
+				$("#divv2").show();
+				$("#divv3").hide();
+				setTimeout(function () {
+					var tt = $("#workClientLinkmanList").find("tr").eq(0).find("td").eq(1).text().trim();
+					$("#clientName").val(tt);
+				},100);
+			}else{
+				$("#divv2").hide();
+			}
+
+			validateForm = $("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+
+			var contractNum = $("#contractNum").val();
+			if (contractNum == null || contractNum === "") {
+				$("#div1").hide();
+				$("#div3").hide();
+				setTimeout(function () {
+					var tt = $("#workClientLinkmanList").find("tr").eq(0).find("td").eq(1).text().trim();
+					$("#clientName").val(tt);
+				},100);
+			}
+			//默认打开判断是否时紧急项目
+			var submitMoney="${projectRecords.submitMoney}"
+			if(submitMoney==1){
+				$("#emergencyProject").parent().parent().parent().show();
+				var emergencyProject="${projectRecords.emergencyProject}"
+				if (emergencyProject=="1"){
+					$("#emergencyProject").prop("checked",true);
+					layui.form.render();
+				}else{
+					$("#emergencyProject").prop("checked",false);
+					layui.form.render();
+				}
+			}
+		});
+
+		function insertTitle(tValue){
+			var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
+				var attachmentId = $("#id").val();
+				var attachmentFlag = "82";
+				console.log(file);
+				var timestamp=new Date().getTime();
+
+				var storeAs = "projectRecods";
+				var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+				var divId = "_attachment";
+				$("#addFile"+divId).show();
+				multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
+		}
+
+		function addFile() {
+			$("#attachment_file").click();
+		}
+
+		function addRow(list, idx, tpl, row){
+			// var idx1 = $("#workClientLinkmanList tr").length;
+			bornTemplete(list, idx, tpl, row, idx);
+		}
+
+		function bornTemplete(list, idx, tpl, row, idx1){
+			$(list).append(Mustache.render(tpl, {
+				idx: idx, delBtn: true, row: row,
+				order:idx1 + 1
+			}));
+			$(list+idx).find("select").each(function(){
+				$(this).val($(this).attr("data-value"));
+			});
+			$(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+				var ss = $(this).attr("data-value").split(',');
+				for (var i=0; i<ss.length; i++){
+					if($(this).val() == ss[i]){
+						$(this).attr("checked","checked");
+					}
+				}
+			});
+		}
+	</script>
+</head>
+<body >
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="projectPaperFiling" enctype="multipart/form-data" action="${ctx}/paperFiling/paperFiling/saveAudit" method="post" class="form-horizontal layui-form">
+			<form:hidden path="id"/>
+			<form:hidden path="home"/>
+			<form:hidden path="act.taskId"/>
+			<form:hidden path="act.taskName"/>
+			<form:hidden id="taskDefKey" path="act.taskDefKey"/>
+			<form:hidden path="act.procInsId"/>
+			<form:hidden path="act.procDefId"/>
+			<form:hidden id="flag" path="act.flag"/>
+			<form:input path="view"/>
+			<input type="hidden" id="opinion" name="act.comment" value="" maxlength="250">
+			<c:set var="status" value="${projectRecords.act.status}" />
+			<div class="form-group layui-row first">
+				<div class="form-group-label"><h2>项目合同信息</h2></div>
+				<div id="div1">
+					<div class="layui-item layui-col-sm12 lw6">
+						<label class="layui-form-label">合同编号:</label>
+						<div class="layui-input-block">
+							<input htmlEscape="false" id="contractNum"  readonly="true" class="form-control layui-input" value="${projectRecords.workContractInfo.contractNum}"/>
+						</div>
+					</div>
+					<div class="layui-item layui-col-sm6 lw6">
+						<label class="layui-form-label">合同名称:</label>
+						<div class="layui-input-block">
+							<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.workContractInfo.name}"/>
+						</div>
+					</div>
+					<c:if test="${projectRecords.workContractInfo.contractInformation =='0'}">
+						<div class="layui-item layui-col-sm6 lw6">
+							<label class="layui-form-label double-line">合同金额(元):</label>
+							<div class="layui-input-block">
+								<input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" value="<fmt:formatNumber value="${projectRecords.workContractInfo.contractPrice}" pattern="#,##0.00#"/>"/>
+							</div>
+						</div>
+					</c:if>
+					<c:if test="${projectRecords.workContractInfo.contractInformation =='1'}">
+						<div class="layui-item layui-col-sm6 lw6">
+							<label class="layui-form-label">费率合同:</label>
+							<div class="layui-input-block">
+								<input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" title="${projectRecords.workContractInfo.otherDetails}" value="${projectRecords.workContractInfo.otherDetails}"/>
+							</div>
+						</div>
+					</c:if>
+					<div class="layui-item layui-col-sm6 lw6">
+						<label class="layui-form-label">委托方:</label>
+						<div class="layui-input-block">
+							<input htmlEscape="false" id="clientName" readonly="true" class="form-control layui-input" value="${projectRecords.workContractInfo.client.name}"/>
+						</div>
+					</div>
+				</div>
+				<div id="divv2">
+					<div class="layui-item layui-col-sm6 lw6">
+						<label class="layui-form-label">无合同</label>
+					</div>
+				</div>
+				<div id="div3">
+					<div class="layui-item layui-col-sm6 lw6">
+						<label class="layui-form-label">合同类型:</label>
+						<div class="layui-input-block">
+							<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.workContractInfo.contractType}"/>
+						</div>
+					</div>
+				</div>
+			</div>
+
+
+			<div class="form-group layui-row first">
+				<div class="form-group-label"><h2>项目基础信息</h2></div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目名称:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" style="background-color: #f1f1f1" value="${projectRecords.projectName}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目编号:</label>
+					<div class="layui-input-block">
+						<div class="input-group">
+							<input htmlEscape="false"  readonly="true" class="form-control layui-input" style="background-color: #f1f1f1" value="${projectRecords.projectId}"/>
+							<span class="input-group-btn">
+                                <label class="form-status"><c:choose><c:when test="${not empty projectRecords.projectStatus}">${fns:getDictLabel(projectRecords.projectStatus, 'rural_project_audit_state', '')}</c:when><c:otherwise>新添</c:otherwise></c:choose></label>
+                             </span>
+						</div>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目所在地:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${projectRecords.province}-${projectRecords.city}-${projectRecords.county}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">投资性质:</label>
+					<div class="layui-input-block">
+						<c:if test="${projectRecords.projectProperties==null}">
+							<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input"/>
+						</c:if>
+						<c:forEach  items="${fns:getMainDictList('project_properties')}" var="v">
+							<c:if test="${v.value==projectRecords.projectProperties}">
+								<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${v.label}"/>
+							</c:if>
+						</c:forEach>
+					</div>
+				</div>
+					<%--				<div class="layui-item layui-col-sm6 lw6">--%>
+					<%--					<label class="layui-form-label">所在省份:</label>--%>
+					<%--					<div class="layui-input-block">--%>
+					<%--						<form:input path="province" cssStyle="background-color: #f1f1f1" htmlEscape="false" id="province" class="form-control layui-input" readonly="true"/>--%>
+					<%--					</div>--%>
+					<%--				</div>--%>
+					<%--				<div class="layui-item layui-col-sm6 lw6">--%>
+					<%--					<label class="layui-form-label">所在地级市:</label>--%>
+					<%--					<div class="layui-input-block">--%>
+					<%--						<form:input path="city" cssStyle="background-color: #f1f1f1" htmlEscape="false" id="city" class="form-control layui-input" readonly="true"/>--%>
+					<%--					</div>--%>
+					<%--				</div>--%>
+					<%--				<div class="layui-item layui-col-sm6 lw6">--%>
+					<%--					<label class="layui-form-label">所在区县:</label>--%>
+					<%--					<div class="layui-input-block">--%>
+					<%--						<form:input path="county" cssStyle="background-color: #f1f1f1" htmlEscape="false" id="areaName1" class="form-control layui-input" readonly="true"/>--%>
+					<%--					</div>--%>
+					<%--				</div>--%>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">建设地点:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1"  readonly="true" class="form-control layui-input" value="${projectRecords.projectSite}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">创建人:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${projectRecords.createBy.name}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目责任人:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${projectRecords.leaderNameStr}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">所属部门:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" id="officeName" class="form-control layui-input" value="${projectRecords.officeName}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目负责人:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${projectRecords.projectMasterName}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">工程类型:</label>
+					<div class="layui-input-block">
+						<c:forEach items="${engineeringInfo}" var="e">
+							<c:if test="${e.id==projectRecords.engineeringType}">
+								<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${e.engineeringName}"/>
+							</c:if>
+						</c:forEach>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目等级:</label>
+					<div class="layui-input-block">
+						<c:forEach items="${fns:getMainDictListOnProjectAdvent('attachment_project_grade')}" var="v">
+							<input type="radio" disabled name="submitMoney" id="submitMoney" value="${v.value}" title="${v.label}" <c:if test="${projectRecords.submitMoney==v.value}">checked</c:if>>
+						</c:forEach>
+							<%--<form:select path="submitMoney" disabled="true" style="background-color: #f1f1f1"  class="form-control simple-select">
+                                <form:option value=""/>
+                                <form:options items="${fns:getMainDictListOnProjectAdvent('attachment_project_approval_money')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                            </form:select>--%>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7" style="display: none">
+					<label class="layui-form-label double-line">是否是紧急项目:</label>
+					<div class="layui-input-block">
+						<div style="margin-right: 30px;">
+							<input type="checkbox" id="emergencyProject" disabled lay-filter="emergencyProject" lay-skin="switch" lay-text="是|否">
+						</div>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label double-line">送审规模(万元):</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${projectRecords.submitScale}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label double-line">工作开始日期:</label>
+					<div class="layui-input-block">
+						<input class=" form-control layui-input"  style="background-color: #f1f1f1" readonly="true" id="startDate" name="startDate" value="<fmt:formatDate value="${projectRecords.startDate}" pattern="yyyy-MM-dd"/>">
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label double-line">工作结束日期:</label>
+					<div class="layui-input-block">
+						<input class="form-control layui-input"  style="background-color: #f1f1f1" readonly="true" id="endingDate" name="endingDate" value="<fmt:formatDate value="${projectRecords.endingDate}" pattern="yyyy-MM-dd"/>">
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">创建日期:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="<fmt:formatDate value="${projectRecords.createDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label">项目类别:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true"  style="background-color: #f1f1f1" class="form-control layui-input" value="${projectRecords.attachmentProjectSort}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6 with-textarea">
+					<label class="layui-form-label">工程概况:</label>
+					<div class="layui-input-block">
+						<textarea htmlEscape="false" rows="4" readonly="true"  style="background-color: #f1f1f1" maxlength="1000" class="form-control" >${projectRecords.projectDesc}</textarea>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6 with-textarea">
+					<label class="layui-form-label">备注:</label>
+					<div class="layui-input-block">
+						<textarea htmlEscape="false" rows="4" readonly="true" maxlength="1000"  style="background-color: #f1f1f1" class="form-control" >${projectRecords.remarks}</textarea>
+					</div>
+				</div>
+			</div>
+
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>委托方联系人信息</h2></div>
+				<div class="layui-item layui-col-xs12 form-table-container" >
+					<table id="contentTable" class="table table-bordered table-condensed no-bottom-margin details">
+						<thead>
+						<tr>
+							<th class="hide"></th>
+							<th width="25%">委托方</th>
+							<th width="25%">联系人姓名</th>
+							<th width="25%">联系方式1</th>
+							<th width="25%">联系方式2</th>
+						</tr>
+						</thead>
+						<tbody id="workClientLinkmanList">
+						<c:forEach items="${projectRecords.workClientLinkmanList}" var="info" varStatus="index">
+							<tr>
+								<td >
+										${info.clientId.name}
+								</td>
+								<td>
+										${info.name}
+								</td>
+								<td>
+										${info.linkPhone}
+								</td>
+								<td>
+										${info.linkMobile}
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>施工方信息</h2></div>
+				<div class="layui-item layui-col-xs12 form-table-container" >
+					<table id="contentTable1" class="table table-bordered table-condensed no-bottom-margin details">
+						<thead>
+						<tr>
+							<th class="hide"></th>
+							<th width="25%">施工方单位名称</th>
+							<th width="25%">联系人姓名</th>
+							<th width="25%">联系方式1</th>
+							<th width="25%">联系方式2</th>
+						</tr>
+						</thead>
+						<tbody id="workConstructionLinkmanList">
+						<c:forEach items="${projectRecords.workConstructionLinkmanList}" var="info" varStatus="index">
+							<tr>
+								<td >
+										${info.clientId.name}
+								</td>
+								<td>
+										${info.name}
+								</td>
+								<td>
+										${info.linkPhone}
+								</td>
+								<td>
+										${info.linkMobile}
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>项目计划附件信息</h2></div>
+				<div class="layui-item layui-col-xs12 form-table-container" >
+					<table id="listAttachment" class="table table-bordered table-condensed no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="25%">文件预览</th>
+							<th width="25%">上传人</th>
+							<th width="25%">上传时间</th>
+							<th width="25%">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${projectRecords.workAttachments}" var="workClientAttachment" varStatus="status">
+							<tr>
+									<%--<td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${projectRecords.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="preview('预览','${workClientAttachment.temporaryUrl}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+													</c:when>
+													<c:otherwise>
+														<td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.temporaryUrl}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
+													</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}">
+											</c:when>
+											<c:otherwise>
+												<c:choose>
+													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+														<td><a href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','95%','95%','1')">${workClientAttachment.attachmentName}</a></td>
+													</c:when>
+													<c:otherwise>
+														<td><a href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','95%','95%')">${workClientAttachment.attachmentName}</a></td>
+													</c:otherwise>
+												</c:choose>
+											</c:otherwise>
+										</c:choose>
+									</c:otherwise>
+								</c:choose>
+								<td>${workClientAttachment.createBy.name}</td>
+								<td><fmt:formatDate value="${workClientAttachment.createDate}" pattern="yyyy-MM-dd"/></td>
+								<td  class="op-td">
+									<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>
+										<%--									<a href="javascript:location.href=encodeURI('${ctx}/workcontractinfo/workContractInfo/downLoadAttach?file=${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>--%>
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+			<script>
+				layui.use(['form', 'layer'], function () {
+					var form = layui.form;
+				});
+				function f1(row) {
+					// window.parent.document.getElementById('opinion').value = row;
+					$("#opinion").val(row)
+				}
+				function openDialogre(title,url,width,height,target,buttons) {
+					if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+						width = 'auto';
+						height = 'auto';
+					} else {//如果是PC端,根据用户设置的width和height显示。
+					}
+					var split = buttons.split(",");
+					top.layer.open({
+						type: 2,
+						area: [width, height],
+						title: title,
+						maxmin: true, //开启最大化最小化按钮
+						skin: 'three-btns',
+						content: url,
+						btn: split,
+						btn1: function(index, layero){
+							top.layer.close(index)
+							document.getElementById('iframe').contentWindow.location.reload();
+						}
+					});
+				}
+				var workClientLinkmanRowIdx = 0, workClientLinkmanTpl = $("#workClientLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+				var workConstructionLinkmanRowIdx = 0, workConstructionLinkmanTpl = $("#workConstructionLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+				$(document).ready(function() {
+					var data = ${fns:toJson(projectRecords.workClientLinkmanList)};
+					for (var i=0; i<data.length; i++){
+						addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl, data[i]);
+						workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
+					}
+					var dataBank = ${fns:toJson(projectRecords.workConstructionLinkmanList)};
+					for (var i=0; i<dataBank.length; i++){
+						addRow('#workConstructionLinkmanList', workConstructionLinkmanRowIdx, workConstructionLinkmanTpl, dataBank[i]);
+						workConstructionLinkmanRowIdx = workConstructionLinkmanRowIdx + 1;
+					}
+				});
+
+			</script>
+
+		</form:form>
+		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>审批流程</h2></div>
+			<div class="layui-item layui-col-xs12 form-table-container" >
+				<act:flowChart procInsId="${processInstanceId}"/>
+				<act:histoicFlow procInsId="${processInstanceId}"/>
+			</div>
+		</div>
+	</div>
+</div>
+</body>
+</html>

+ 243 - 0
src/main/webapp/webpage/modules/projectPaperFiling/projectPaperFilingView.jsp

@@ -0,0 +1,243 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>项目审批管理</title>
+	<meta name="decorator" content="default"/>
+	<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>
+	<script type="text/javascript" src="${ctxStatic}/layui/layuidown.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/layuidown.css"/>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+				var fileNum =  $("#fileNum").val();
+				var fileNumTow =  $("#fileNumTow").val();
+				var ss= document.getElementById("iframe").contentWindow.document.getElementById("opinion").value
+				$("#opinion").val(ss);
+                if(obj == 1) {
+                    $("#flag").val("yes");
+					if(fileNum == ''|| fileNum == undefined){
+						top.layer.msg('填写案卷号!', {icon: 0});
+						return;
+					}
+					if(fileNumTow == ''|| fileNumTow == undefined){
+						top.layer.msg('请再次填写案卷号!', {icon: 0});
+						return;
+					}
+					if(fileNum != fileNumTow){
+						top.layer.msg('两次案卷号填写不同,请重新输入!', {icon: 0});
+						return;
+					}
+                }else {
+                    if(obj == 2){
+                        $("#flag").val("no1");
+					}else {
+                        $("#flag").val("no2");
+					}
+                }
+                $("#inputForm").submit();
+                return true;
+            }
+
+		  return false;
+		}
+		$(document).ready(function() {
+
+			var tt = $("#contractNum").val();
+			if (tt == null || tt === "") {
+				$("#divv").hide();
+				$("#divv2").show();
+				$("#divv3").hide();
+				setTimeout(function () {
+					var tt = $("#workClientLinkmanList").find("tr").eq(0).find("td").eq(1).text().trim();
+					$("#clientName").val(tt);
+				},100);
+			}else{
+				$("#divv2").hide();
+			}
+
+			validateForm = $("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+
+			});
+
+			var contractNum = $("#contractNum").val();
+			if (contractNum == null || contractNum === "") {
+				$("#div1").hide();
+				$("#div3").hide();
+				setTimeout(function () {
+					var tt = $("#workClientLinkmanList").find("tr").eq(0).find("td").eq(1).text().trim();
+					$("#clientName").val(tt);
+				},100);
+			}
+			//默认打开判断是否时紧急项目
+			var submitMoney="${projectRecords.submitMoney}"
+			if(submitMoney==1){
+				$("#emergencyProject").parent().parent().parent().show();
+				var emergencyProject="${projectRecords.emergencyProject}"
+				if (emergencyProject=="1"){
+					$("#emergencyProject").prop("checked",true);
+					layui.form.render();
+				}else{
+					$("#emergencyProject").prop("checked",false);
+					layui.form.render();
+				}
+			}
+			$("#iframeTap").load(function () {
+				console.log($(this).contents().find("body").height());
+				console.log("---------------")
+				console.log($(this).contents().find("body"));
+				var mainheight = $(this).contents().find("body").height() + 30;
+				$(this).height(mainheight);
+			});
+		});
+
+        function insertTitle(tValue){
+            var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
+            var attachmentId = $("#id").val();
+            var attachmentFlag = "82";
+            console.log(file);
+            var timestamp=new Date().getTime();
+
+				var storeAs = "projectRecods";
+            var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+            var divId = "_attachment";
+            $("#addFile"+divId).show();
+            multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
+        }
+
+        function addFile() {
+            $("#attachment_file").click();
+        }
+
+        function addRow(list, idx, tpl, row){
+            // var idx1 = $("#workClientLinkmanList tr").length;
+            bornTemplete(list, idx, tpl, row, idx);
+        }
+
+        function bornTemplete(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+        }
+	</script>
+</head>
+<body >
+<div class="single-form">
+	<iframe id="iframeTap" src="${ctx}/ruralProject/ruralProjectView/view?id=${projectRecords.id}" name="" frameborder="0" align="left" width="100%" height="1700px" scrolling="value"></iframe>
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="projectPaperFiling" enctype="multipart/form-data" action="${ctx}/paperFiling/paperFiling/saveAudit" method="post" class="form-horizontal layui-form">
+		<form:hidden path="id"/>
+		<form:hidden path="home"/>
+		<form:hidden path="act.taskId"/>
+		<form:hidden path="act.taskName"/>
+		<form:hidden id="taskDefKey" path="act.taskDefKey"/>
+		<form:hidden path="act.procInsId"/>
+		<form:hidden path="act.procDefId"/>
+		<form:hidden id="flag" path="act.flag"/>
+		<input type="hidden" id="opinion" name="act.comment" value="" maxlength="250">
+		<c:set var="status" value="${projectRecords.act.status}" />
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>提交说明</h2></div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label">案卷号:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true" id="fileNum" name="fileNum"  class="form-control layui-input" value="${projectPaperFiling.fileNum}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label">确认案卷号:</label>
+					<div class="layui-input-block">
+						<input id="fileNumTow" readonly="true" name="fileNumTow" type="text"  class="layui-input form-control" equalTo="#fileNum" value="${projectPaperFiling.fileNumTow}"/>
+					</div>
+				</div>
+			</div>
+
+			<script>
+				layui.use(['form', 'layer'], function () {
+					var form = layui.form;
+				});
+				function f1(row) {
+					// window.parent.document.getElementById('opinion').value = row;
+					$("#opinion").val(row)
+				}
+				function openDialogre(title,url,width,height,target,buttons) {
+					if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+						width = 'auto';
+						height = 'auto';
+					} else {//如果是PC端,根据用户设置的width和height显示。
+					}
+					var split = buttons.split(",");
+					top.layer.open({
+						type: 2,
+						area: [width, height],
+						title: title,
+						maxmin: true, //开启最大化最小化按钮
+						skin: 'three-btns',
+						content: url,
+						btn: split,
+						btn1: function(index, layero){
+							top.layer.close(index)
+							document.getElementById('iframe').contentWindow.location.reload();
+						}
+					});
+				}
+                var workClientLinkmanRowIdx = 0, workClientLinkmanTpl = $("#workClientLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                var workConstructionLinkmanRowIdx = 0, workConstructionLinkmanTpl = $("#workConstructionLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                $(document).ready(function() {
+                    var data = ${fns:toJson(projectRecords.workClientLinkmanList)};
+                    for (var i=0; i<data.length; i++){
+                        addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl, data[i]);
+                        workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
+                    }
+                    var dataBank = ${fns:toJson(projectRecords.workConstructionLinkmanList)};
+                    for (var i=0; i<dataBank.length; i++){
+                        addRow('#workConstructionLinkmanList', workConstructionLinkmanRowIdx, workConstructionLinkmanTpl, dataBank[i]);
+                        workConstructionLinkmanRowIdx = workConstructionLinkmanRowIdx + 1;
+                    }
+                });
+
+			</script>
+
+	</form:form>
+<%--		<div class="form-group-label">--%>
+<%--			<div style="float: right"> <a href="javascript:void(0)" style='background-color: #FFB800' onclick="openDialogre('个人模板列表', '${ctx}/auditTemplate/auditTemplate/templateList?identification=${identification}&name=${identificationName}','80%', '70%','','关闭')" class="nav-btn layui-btn layui-btn-sm" ><i class="fa fa-file-excel-o"></i> 审核意见模板列表</a></div>--%>
+<%--			<h2>审批意见</h2>--%>
+<%--		</div>--%>
+<%--		<iframe id="iframe" src="${ctx}/auditTemplate/auditTemplate/iframeView?identification=${identification}" name="listresult" frameborder="0" align="left" width="100%" height="300" scrolling="value"></iframe>--%>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>审批流程</h2></div>
+				<div class="layui-item layui-col-xs12 form-table-container" >
+					<act:flowChart procInsId="${processInstanceId}"/>
+					<act:histoicFlow procInsId="${processInstanceId}"/>
+				</div>
+			</div>
+	</div>
+</div>
+</body>
+</html>

+ 31 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectMessageList.jsp

@@ -735,6 +735,14 @@
 							var xml = "<span style=\"cursor:default;\" class=\"new-status-label status-label-" + st.label + "\" >" + st.status + "</span>";
 						return xml;
 					}}
+				,{align:'center', title: '纸质',  width:90,templet:function(d){
+						var st = getRuralProjectArchiveState(d.paperFilingStatus);
+						if(st.action)
+							var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/ruralProject/ruralCostProjectMessage/getReportRecordProcessOne?processInstanceId=" + d.ppfProcessInstanceId + "','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;
+					}}
                 ,{field:'op',align:'center',title:"操作",width:350,templet:function(d) {
 						////对操作进行初始化
 						var xml = '<div class=\"layui-btn-group\">';
@@ -956,6 +964,25 @@
 									}
 								}
 							}
+							/*纸质归档*/
+							if(d.projectReportStatusTwo == 5){
+								if(d.submitMoney == "2"){
+									/*xml+="<a href=\"#\" style='background-color: #FFB800' onclick=\"openDialogre('下载模板', '${ctx}/ruralProject/ruralCostProjectMessage/skipDownloadFtl?id=" + d.id +"','35%', '35%','','下载,关闭')\" class=\"op-btn\" > 下载模板</a>";*/
+									if(d.paperFilingStatus == 0){
+										xml+="<a href=\"#\" onclick=\"openDialogre('新增纸质归档信息', '${ctx}/paperFiling/paperFiling/form?projectId=" + d.id +"&view=filing','95%', '95%','','送审,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" > 纸质归档</a>";
+									}
+									if(d.paperFilingStatus == 2){
+										xml+="<a href=\"${ctx}/paperFiling/paperFiling/cancelInvalidate?id=" + d.ppfId + "&view=filing&processInstanceId=" + d.ppfProcessInstanceId + "\" onclick=\"return confirmx('确认要撤回该纸质归档审批吗?', this.href)\" class=\"layui-btn layui-btn-xs  layui-bg-red\" > 撤回纸质归档</a>";
+									}
+									if(d.paperFilingStatus == 3){
+										xml+="<a href=\"#\" onclick=\"openDialogre('撤回调整归档信息', '${ctx}/paperFiling/paperFiling/form?id=" + d.ppfId + "&projectId=" + d.id +"&view=filing ','95%', '95%','','送审,关闭')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" > 纸质重新归档</a>";
+									}
+									if(d.paperFilingStatus == 4){
+										//驳回操作
+										xml+="<a href=\"#\" onclick=\"openDialogre('调整归档信息', '${ctx}/paperFiling/paperFiling/modify?id=" + d.ppfId + "&projectId=" + d.id + "&processInstanceId=" + d.ppfProcessInstanceId + "&view=filing ','95%', '95%','','送审,关闭')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" > 纸质重新归档</a>";
+									}
+								}
+							}
 
 
 							if('1' == d.flagAdmin && d.projectReportStatus == 5)
@@ -1021,6 +1048,10 @@
 					,"pmdrProcessInstanceId":"${projectRecords.pmdrProcessInstanceId}"
 					,"pmdrId":"${projectRecords.pmdrId}"
 					,"prdtProcessinstanceId":"${projectRecords.prdtProcessinstanceId}"
+					,"paperFilingStatus":"${projectRecords.paperFilingStatus}"
+					,"ppfId":"${projectRecords.ppfId}"
+					,"ppfProcessInstanceId":"${projectRecords.ppfProcessInstanceId}"
+					,"submitMoney":"${projectRecords.submitMoney}"
 					,"falg":
 					<c:choose>
 						<c:when test="${fns:getUser().id == projectRecords.leaderIds || fns:getUser().id eq projectRecords.createBy.id}">

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

@@ -733,6 +733,14 @@
                             var xml = "<span style=\"cursor:default;\" class=\"new-status-label status-label-" + st.label + "\" >" + st.status + "</span>";
                         return xml;
                     }}
+				,{align:'center', title: '纸质',  width:90,templet:function(d){
+						var st = getRuralProjectArchiveState(d.paperFilingStatus);
+						if(st.action)
+							var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/ruralProject/ruralCostProjectMessage/getReportRecordProcessOne?processInstanceId=" + d.ppfProcessInstanceId + "','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;
+					}}
 				,{field:'op',align:'center',title:"操作",width:350,templet:function(d) {
 
 							////对操作进行初始化
@@ -955,6 +963,27 @@
 
 								}
 							}
+							/*纸质归档*/
+							if(d.projectReportStatusTwo == 5){
+								if(d.submitMoney == "2"){
+									/*xml+="<a href=\"#\" style='background-color: #FFB800' onclick=\"openDialogre('下载模板', '${ctx}/ruralProject/ruralCostProjectMessage/skipDownloadFtl?id=" + d.id +"','35%', '35%','','下载,关闭')\" class=\"op-btn\" > 下载模板</a>";*/
+									if(d.paperFilingStatus == 0){
+										xml+="<a href=\"#\" onclick=\"openDialogre('新增纸质归档信息', '${ctx}/paperFiling/paperFiling/form?projectId=" + d.id +"&view=filing','95%', '95%','','送审,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" > 纸质归档</a>";
+									}
+									if(d.paperFilingStatus == 2){
+										xml+="<a href=\"${ctx}/paperFiling/paperFiling/cancelInvalidate?id=" + d.ppfId + "&view=filing&processInstanceId=" + d.ppfProcessInstanceId + "\" onclick=\"return confirmx('确认要撤回该纸质归档审批吗?', this.href)\" class=\"layui-btn layui-btn-xs  layui-bg-red\" > 撤回纸质归档</a>";
+									}
+									if(d.paperFilingStatus == 3){
+										xml+="<a href=\"#\" onclick=\"openDialogre('撤回调整归档信息', '${ctx}/paperFiling/paperFiling/form?id=" + d.ppfId + "&projectId=" + d.id +"&view=filing ','95%', '95%','','送审,关闭')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" > 纸质重新归档</a>";
+									}
+									if(d.paperFilingStatus == 4){
+										//驳回操作
+										xml+="<a href=\"#\" onclick=\"openDialogre('调整归档信息', '${ctx}/paperFiling/paperFiling/modify?id=" + d.ppfId + "&projectId=" + d.id + "&processInstanceId=" + d.ppfProcessInstanceId + "&view=filing ','95%', '95%','','送审,关闭')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" > 纸质重新归档</a>";
+									}
+								}
+							}
+
+
 
 							if('1' == d.flagAdmin && d.projectReportStatus == 5)
 							{
@@ -1020,6 +1049,10 @@
 					,"projectReportStatusTwo":"${projectRecords.projectReportStatusTwo}"
 					,"defectRecordStatus":"${projectRecords.defectRecordStatus}"
 					,"prdtProcessinstanceId":"${projectRecords.prdtProcessinstanceId}"
+					,"paperFilingStatus":"${projectRecords.paperFilingStatus}"
+					,"ppfId":"${projectRecords.ppfId}"
+					,"ppfProcessInstanceId":"${projectRecords.ppfProcessInstanceId}"
+					,"submitMoney":"${projectRecords.submitMoney}"
 					,"falg":
 					<c:choose>
 						<c:when test="${fns:getUser().id == projectRecords.leaderIds || fns:getUser().id eq projectRecords.createBy.id}">