Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java
#	src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java
#	src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
#	src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml
[user3] 4 gadi atpakaļ
vecāks
revīzija
635b02a22b
40 mainītis faili ar 5291 papildinājumiem un 171 dzēšanām
  1. 7 3
      src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectAccessoryRelationController.java
  2. 9 0
      src/main/java/com/jeeplus/modules/projectcontentinfo/entity/ProjectReportData.java
  3. 9 0
      src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectRecords.java
  4. 16 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralPeojectRecordChooseCheckDao.java
  5. 7 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java
  6. 45 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java
  7. 716 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralPeojectRecordChooseCheckService.java
  8. 7 3
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java
  9. 317 3
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java
  10. 54 20
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageController.java
  11. 37 5
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java
  12. 56 23
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageController.java
  13. 352 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectRecordChooseCheckController.java
  14. 51 1
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectRecordsController.java
  15. 102 0
      src/main/java/com/jeeplus/modules/utils/SftpClientUtil.java
  16. 198 0
      src/main/java/com/jeeplus/modules/utils/ZipCompressUtil.java
  17. 53 5
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  18. 16 9
      src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementService.java
  19. 6 5
      src/main/java/com/jeeplus/modules/workreimbursement/web/WorkReimbursementController.java
  20. 2 2
      src/main/resources/jeeplus.properties
  21. 8 3
      src/main/resources/mappings/modules/projectAccessory/ProjectAccessoryRelationDao.xml
  22. 8 3
      src/main/resources/mappings/modules/projectAccessory/ProjectTemplateDao.xml
  23. 9 5
      src/main/resources/mappings/modules/projectcontentinfo/ProjectReportDataDao.xml
  24. 369 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralPeojectRecordChooseCheckDao.xml
  25. 7 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml
  26. 21 0
      src/main/webapp/static/common/jeeplus.js
  27. 45 55
      src/main/webapp/webpage/modules/projectAccessory/projectAccessoryRelation/projectAccessoryRelationList.jsp
  28. 485 0
      src/main/webapp/webpage/modules/ruralprojectrecords/check/ruralProjectRecordsAudit.jsp
  29. 363 0
      src/main/webapp/webpage/modules/ruralprojectrecords/check/ruralProjectRecordsForm.jsp
  30. 363 0
      src/main/webapp/webpage/modules/ruralprojectrecords/check/ruralProjectRecordsList.jsp
  31. 434 0
      src/main/webapp/webpage/modules/ruralprojectrecords/check/ruralProjectRecordsModify.jsp
  32. 28 0
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectcontentinfo/reportForm.jsp
  33. 43 2
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsList.jsp
  34. 952 0
      src/main/webapp/webpage/modules/ruralprojectrecords/projectAccessoryForm.jsp
  35. 43 5
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralProjectRecordsList.jsp
  36. 32 4
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/reportForm.jsp
  37. 2 4
      src/main/webapp/webpage/modules/workclientinfo/workClientInfoForm.jsp
  38. 10 2
      src/main/webapp/webpage/modules/workcontractinfo/workContractInfoFormAdd.jsp
  39. 2 2
      src/main/webapp/webpage/modules/workcontractinfo/workContractInfoFormEdit.jsp
  40. 7 7
      src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoList.jsp

+ 7 - 3
src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectAccessoryRelationController.java

@@ -59,6 +59,8 @@ public class ProjectAccessoryRelationController extends BaseController {
 	@RequestMapping(value = {"list", ""})
 	public String list(ProjectAccessoryRelationInfo projectAccessoryRelationInfo,Model model) {
 		model.addAttribute("projectAccessoryRelationInfo",projectAccessoryRelationInfo);
+		model.addAttribute("attachmentProjectType",projectAccessoryRelationInfo.getAttachmentProjectType());
+		model.addAttribute("attachmentProjectSortStr",projectAccessoryRelationInfo.getAttachmentProjectSort());
 		return "modules/projectAccessory/projectAccessoryRelation/projectAccessoryRelationList";
 	}
 
@@ -71,11 +73,13 @@ public class ProjectAccessoryRelationController extends BaseController {
 			map.put("data",new ArrayList<ProjectAccessoryRelationInfo>());
 			return map;
 		}
+		//判断项目类别是否未空值
 		if(StringUtils.isNotBlank(projectAccessoryRelationInfo.getAttachmentProjectSort())){
-			Integer decide = projectAccessoryRelationService.decideAttachmentProjectSort(projectAccessoryRelationInfo.getAttachmentProjectSort());
-			if(1 == decide || StringUtils.isNotBlank(projectAccessoryRelationInfo.getAttachmentProjectApprovalMoney())){
+			//判断项目类别是否为打包项目判定
+			//Integer decide = projectAccessoryRelationService.decideAttachmentProjectSort(projectAccessoryRelationInfo.getAttachmentProjectSort());
+			//if(1 == decide || StringUtils.isNotBlank(projectAccessoryRelationInfo.getAttachmentProjectApprovalMoney())){
 				return projectAccessoryRelationService.findListTree(projectAccessoryRelationInfo);
-			}
+			//}
 		}
 		map.put("data",new ArrayList<ProjectAccessoryRelationInfo>());
 		return map;

+ 9 - 0
src/main/java/com/jeeplus/modules/projectcontentinfo/entity/ProjectReportData.java

@@ -61,6 +61,7 @@ public class ProjectReportData extends ActEntity<ProjectReportData> {
 	private String reportId;
 	private String numberPath;
 	private String tempType;    //模板类型
+	private String bzshbUserId; //总审用户id
 
 	public String getNumberPath() {
 		return numberPath;
@@ -634,4 +635,12 @@ public class ProjectReportData extends ActEntity<ProjectReportData> {
 	public void setDownFileStatus(String downFileStatus) {
 		this.downFileStatus = downFileStatus;
 	}
+
+	public String getBzshbUserId() {
+		return bzshbUserId;
+	}
+
+	public void setBzshbUserId(String bzshbUserId) {
+		this.bzshbUserId = bzshbUserId;
+	}
 }

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

@@ -124,6 +124,7 @@ public class ProjectRecords extends ActEntity<ProjectRecords> {
 	private String constructionUnit; //施工单位
 	private String constructionLinkman; //施工方联系人
 	private String attachmentProjectSort;   //项目类别
+	private List<User> bzshbUserList;  //总审用户信息
 	private List<WorkClientAttachment> workAttachments = Lists.newArrayList();
 
 	private List<ProjectReportData> projectReportData = Lists.newArrayList();
@@ -755,4 +756,12 @@ public class ProjectRecords extends ActEntity<ProjectRecords> {
 	public void setAttachmentProjectSort(String attachmentProjectSort) {
 		this.attachmentProjectSort = attachmentProjectSort;
 	}
+
+	public List<User> getBzshbUserList() {
+		return bzshbUserList;
+	}
+
+	public void setBzshbUserList(List<User> bzshbUserList) {
+		this.bzshbUserList = bzshbUserList;
+	}
 }

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

@@ -0,0 +1,16 @@
+package com.jeeplus.modules.ruralprojectrecords.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+
+/**
+ * @author: 大猫
+ * @create: 2021-03-09 09:57
+ **/
+@MyBatisDao
+public interface RuralPeojectRecordChooseCheckDao extends CrudDao<RuralProjectRecords> {
+    void updateProcessIdAndStatus(RuralProjectRecords projectRecords);
+
+    void updateSelectiveById(RuralProjectRecords projectRecords);
+}

+ 7 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java

@@ -127,4 +127,11 @@ public interface RuralProjectRecordsDao extends CrudDao<RuralProjectRecords> {
      * @return
      */
     List<RuralProjectRecords> projectFindList(RuralProjectRecords projectRecords);
+
+    /**
+     * 根据报告id查询归档状态
+     * @param reportId
+     * @return
+     */
+    String getReportRecordStatus(String reportId);
 }

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

@@ -139,6 +139,11 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	private String ZiXunShouRu;   //咨询收入
 	private String zaoJiaShiZhengHao;   //造价师注册证号
 	private String attachmentProjectSort;   //项目类别
+	private String checkProcessInstanceId;   //检查流程id
+	private Integer checkStatus;   //检查状态
+	private String bzshbUserId; //总审用户id
+	private String checkUserId; //检查发起人用户id
+	private List<User> bzshbUserList;  //总审用户信息
 
 	private List<String> civilProjectList = Lists.newArrayList();
 	private List<WorkClientAttachment> workAttachments = Lists.newArrayList();
@@ -938,4 +943,44 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	public void setAttachmentProjectSort(String attachmentProjectSort) {
 		this.attachmentProjectSort = attachmentProjectSort;
 	}
+
+	public String getCheckProcessInstanceId() {
+		return checkProcessInstanceId;
+	}
+
+	public void setCheckProcessInstanceId(String checkProcessInstanceId) {
+		this.checkProcessInstanceId = checkProcessInstanceId;
+	}
+
+	public Integer getCheckStatus() {
+		return checkStatus;
+	}
+
+	public void setCheckStatus(Integer checkStatus) {
+		this.checkStatus = checkStatus;
+	}
+
+	public String getBzshbUserId() {
+		return bzshbUserId;
+	}
+
+	public void setBzshbUserId(String bzshbUserId) {
+		this.bzshbUserId = bzshbUserId;
+	}
+
+	public List<User> getBzshbUserList() {
+		return bzshbUserList;
+	}
+
+	public void setBzshbUserList(List<User> bzshbUserList) {
+		this.bzshbUserList = bzshbUserList;
+	}
+
+	public String getCheckUserId() {
+		return checkUserId;
+	}
+
+	public void setCheckUserId(String checkUserId) {
+		this.checkUserId = checkUserId;
+	}
 }

+ 716 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralPeojectRecordChooseCheckService.java

@@ -0,0 +1,716 @@
+package com.jeeplus.modules.ruralprojectrecords.service;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.Collections3;
+import com.jeeplus.common.utils.MenuStatusEnum;
+import com.jeeplus.modules.act.entity.Act;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.ruralprojectrecords.dao.RuralPeojectRecordChooseCheckDao;
+import com.jeeplus.modules.ruralprojectrecords.dao.RuralWorkProjectUserDao;
+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.DictUtils;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workactivity.dao.WorkActivityProcessDao;
+import com.jeeplus.modules.workactivity.entity.Activity;
+import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
+import com.jeeplus.modules.workactivity.service.ActivityService;
+import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
+import com.jeeplus.modules.workactivitymenu.entity.WorkActivityMenu;
+import com.jeeplus.modules.workactivitymenu.service.WorkActivityMenuService;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientLinkmanDao;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
+import com.jeeplus.modules.workclientinfo.service.WorkClientInfoService;
+import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
+import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
+import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
+import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
+import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
+import org.activiti.engine.HistoryService;
+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.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author: 徐滕
+ * @create: 2021-03-09 09:54
+ **/
+@Service
+@Transactional(readOnly = true)
+public class RuralPeojectRecordChooseCheckService extends CrudService<RuralPeojectRecordChooseCheckDao, RuralProjectRecords> {
+
+
+
+    @Autowired
+    private RuralWorkProjectUserDao workProjectUserDao;
+    @Autowired
+    private WorkClientLinkmanDao workClientLinkmanDao;
+    @Autowired
+    private IdentityService identityService;
+    @Autowired
+    private OfficeService officeService;
+    @Autowired
+    private WorkActivityMenuService workActivityMenuService;
+    @Autowired
+    private RuntimeService runtimeService;
+    @Autowired
+    private WorkActivityProcessService workActivityProcessService;
+    @Autowired
+    private WorkProjectNotifyService workProjectNotifyService;
+    @Autowired
+    protected HistoryService historyService;
+    @Autowired
+    private WorkContractInfoService contractInfoService;
+    @Autowired
+    private WorkClientInfoService workClientInfoService;
+    @Autowired
+    private ActTaskService actTaskService;
+    @Autowired
+    private ActivityService activityService;
+    @Autowired
+    private WorkActivityProcessDao workActivityProcessDao;
+
+    private static byte[] SYN_BYTE = new byte[0];
+
+    public RuralProjectRecords get(String id) {
+        return super.get(id);
+    }
+
+    public Page<RuralProjectRecords> findPage(Page<RuralProjectRecords> page, RuralProjectRecords projectRecords) {
+        //设置数据权限
+        if(!UserUtils.getUser().isAdmin()) {
+            String dataScopeSql = dataScopeFilterOR(projectRecords.getCurrentUser(), "o", "u", "s", MenuStatusEnum.OVERALL_WORK_RECORDS.getValue());
+            //判断查询为工程咨询信息
+            if(StringUtils.isBlank(dataScopeSql)){
+                dataScopeSql = dataScopeFilterOR(projectRecords.getCurrentUser(), "o", "u", "s", MenuStatusEnum.OVERALL_COST_WORK_RECORDS.getValue());
+            }
+            projectRecords.getSqlMap().put("dsf", dataScopeSql);
+            projectRecords.getSqlMap().put("delFlag", "AND a.del_flag = 0");
+        }
+        int count = dao.queryCount(projectRecords);
+        page.setCount(count);
+        page.setCountFlag(false);
+        projectRecords.setPage(page);
+        List<RuralProjectRecords> recordsList = findList(projectRecords);
+        //查询负责人信息
+        for (RuralProjectRecords records : recordsList) {
+            this.queryContractInfos(records);
+            List<User> users = workProjectUserDao.queryProjectUsers(records.getId(), "1");
+            records.setProjectLeaders(users);
+            records.setLeaderNameStr(Collections3.extractToString(users, "name", ","));
+            records.setLeaderIds(Collections3.extractToString(users, "id", ","));
+        }
+        page.setList(recordsList);
+        return page;
+    }
+
+    /**
+     * 查询合同信息
+     * @param projectRecords
+     */
+    public void queryContractInfos(RuralProjectRecords projectRecords) {
+        WorkContractInfo workContractInfo = contractInfoService.get(projectRecords.getWorkContractInfo().getId());
+        if(workContractInfo!=null){
+            workContractInfo.setConstructionProjectTypeStr(DictUtils.getMainDictLabel(String.valueOf(workContractInfo.getContractType()), "contract_type", ""));
+            if(workContractInfo.getWorkClientInfoList()!=null&&!workContractInfo.getWorkClientInfoList().isEmpty()){
+                StringBuilder workClinetInfoIds = new StringBuilder();
+                for (WorkClientInfo workClientInfo : workContractInfo.getWorkClientInfoList()) {
+                    workClinetInfoIds.append(workClientInfo.getId()).append(",");
+                }
+                workClinetInfoIds.deleteCharAt(workClinetInfoIds.length()-1);
+                workContractInfo.setWorkClinetInfoIds(workClinetInfoIds.toString());
+            }
+        }
+        projectRecords.setWorkContractInfo(workContractInfo);
+    }
+
+
+    /**
+     * 设置联系人信息
+     *
+     * @param projectRecords
+     */
+    public void queryLinkmanInfos(RuralProjectRecords projectRecords) {
+        List<WorkClientLinkman> clientLinkmanList = workClientLinkmanDao.queryProjectLinkmans(projectRecords.getId(), 1);
+        for(WorkClientLinkman linkman :clientLinkmanList){
+            WorkClientInfo clientInfo = workClientInfoService.get(linkman.getClientId().getId());
+            linkman.setClientId(clientInfo);
+        }
+        projectRecords.setWorkClientLinkmanList(clientLinkmanList);
+        List<WorkClientLinkman> constructionLinkmanList = workClientLinkmanDao.queryProjectLinkmans(projectRecords.getId(), 3);
+        projectRecords.setWorkConstructionLinkmanList(constructionLinkmanList);
+    }
+
+    @Transactional(readOnly = false)
+    public String saveCheck(RuralProjectRecords projectRecords, ProjectStatusEnum projectStatus) throws Exception {
+        List<User> masters = workProjectUserDao.queryProjectUsers(projectRecords.getId(), "1");
+        Map<String, Object> variables = new HashMap<String, Object>();
+        Integer oldStatus = projectRecords.getCheckStatus();
+        projectRecords.setCheckStatus(projectStatus.getValue());
+
+        //启动审批流程
+        if (projectRecords.getCheckStatus()== ProjectStatusEnum.IN_APRL.getValue() && (oldStatus==null|| ProjectStatusEnum.REJECTED.getValue()!=oldStatus)) {
+            User user = UserUtils.getUser();
+            Office office =UserUtils.getSelectOffice();
+            Office company = UserUtils.getSelectCompany();
+            projectRecords.setOffice(office);
+            projectRecords.setCompany(company);
+            String contentStr = "项目【"+ projectRecords.getProjectName()+"】选查归档待审批,项目编号:"+projectRecords.getProjectId();
+            String titleStr = "项目【"+ projectRecords.getProjectName()+"】选查归档待审批";
+            String businessKey = projectRecords.getId();
+            // 用来设置启动流程的人员ID,引擎会自动把用户ID保存到activiti:initiator中
+            identityService.setAuthenticatedUserId(user.getId());
+            // 启动流程
+            WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("9764872f45b84acd893010e66a3db2c8", office);
+            // 启动流程
+            String processType = workActivityMenu.getProcessType();
+            StringBuffer buffer = new StringBuffer();
+            Activity activity = new Activity();
+            WorkProjectNotify workProjectNotify = UtilNotify
+                    .saveNotify(projectRecords.getId(),
+                            null,
+                            projectRecords.getCompany().getId(),
+                            titleStr,
+                            contentStr,
+                            "140",
+                            "0",
+                            "待审批",
+                            ""
+                    );
+            List<User> users = new ArrayList<>();
+                super.save(projectRecords);
+            //总工
+            //List<User> bzshbs = UserUtils.getByRoleActivityEnname("bzshb",3,office.getId(),"12",projectRecords.getCreateBy());
+            //线下归档员
+            List<User> bggdglys = UserUtils.getByRoleActivityEnname("xxgdydyhu",3,office.getId(),"10",projectRecords.getCreateBy());
+            //总工(给个空值)
+            List<User> bzshbList = Lists.newArrayList();
+            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(),"8",projectRecords.getCreateBy());
+                        if (enusers.size()==0){
+                            throw new Exception("流程审批人不能为空,角色"+a.getRole().getName()+"下无用户,请联系管理员!");
+                        }
+                        variables.put(encount, enusers.size());
+                        variables.put(enlist, enusers);
+                    }
+                    if (a.getDelFlag().equals("0") && a.getCount() == 1) {
+                        activity = a;
+                    }
+                }
+                buffer.append(activity.getRole().getEnname());
+                if (activity != null && com.jeeplus.common.utils.StringUtils.isNotBlank(activity.getId())) {
+                    //角色审批
+                    if (StringUtils.isNotBlank(activity.getRole().getEnname())) {
+                        users = UserUtils.getByRoleActivityEnnames(activity.getRole().getEnname(),office.getId(),"4",projectRecords.getCreateBy());
+                    }
+                    //人员审批
+                    if (StringUtils.isNotBlank(activity.getUser().getId())) {
+                        users.add(activity.getUser());
+                    }
+                }
+                workProjectNotify.setId("");
+            } else {
+                if (masters.size()==0){
+                    return "流程审批人不能为空,项目负责人下无用户,请联系管理员!";
+                }
+                processType = "checkAudit";
+                users.addAll(masters);
+                variables.put("masterList", masters);
+                variables.put("mastercount", masters.size());
+            }
+            for (User u : users){
+                workProjectNotify.setUser(u);
+                workProjectNotify.setNotifyRole("项目负责人审批");
+                workProjectNotify.setId("");
+                workProjectNotifyService
+                        .save(workProjectNotify);
+                Map<String,Object> extras = new HashMap<>();
+                extras.put("type","7001");
+                extras.put("id",workProjectNotify.getId());
+                extras.put("procDefKey","140");
+                UserUtils.pushInfoToApp(titleStr,contentStr,extras,u.getId());
+            }
+            variables.put("type", processType);
+            variables.put("busId", businessKey);
+            variables.put("title", "审批单:" + projectRecords.getProjectName());//设置标题;
+
+            ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
+            if (StringUtils.isNotBlank(projectRecords.getCheckProcessInstanceId())) {
+                workActivityProcessService.updateProcessInstanceId(processInstance.getId(),projectRecords.getCheckProcessInstanceId());
+                workActivityProcessService.deleteProcessInstanceId(projectRecords.getCheckProcessInstanceId());
+                workActivityProcessService.deleteProcessIdAuditUsers(projectRecords.getCheckProcessInstanceId());
+            }
+            // 更新流程实例ID
+            projectRecords.setCheckProcessInstanceId(processInstance.getId());
+            projectRecords.setCheckUserId(UserUtils.getUser().getId());
+            dao.updateProcessIdAndStatus(projectRecords);
+            List<Activity> list = workActivityMenu.getActivities();
+            if (list != null && list.size() != 0) {
+                workActivityProcessService.saveList(list, processInstance.getId());
+            } else {
+                WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+                workActivityProcess.setProcessKey(processType);
+                workActivityProcess.setCount(1);
+                workActivityProcess.setProcessInstanceId(processInstance.getId());
+                workActivityProcess.setIsApproval("0");
+                workActivityProcessService.insert(workActivityProcess);
+                workActivityProcess.setCount(2);
+                workActivityProcessService.insert(workActivityProcess);
+                workActivityProcess.setCount(3);
+                workActivityProcessService.insert(workActivityProcess);
+                workActivityProcessService.insertAuditsByType(masters,processInstance.getId(),1,1);
+                workActivityProcessService.insertAuditsByType(bzshbList,processInstance.getId(),2,0);
+                workActivityProcessService.insertAuditsByType(bggdglys,processInstance.getId(),3,0);
+            }
+            return "true";
+        }
+        return "";
+    }
+
+    /**
+     * 项目检查审批
+     * @param projectRecords
+     * @param auditUsers
+     * @return
+     * @throws Exception
+     */
+    @Transactional(readOnly = false)
+    public String auditSave(RuralProjectRecords projectRecords, List<User> auditUsers) throws Exception {
+        RuralProjectRecords records = this.get(projectRecords.getId());
+        //设置当前审核中总审人员流程信息
+        if (StringUtils.isBlank(records.getBzshbUserId())) {
+            //获取总审用户信息
+            User bzshbUser = UserUtils.get(projectRecords.getBzshbUserId());
+            List<User> bzshbList = Lists.newArrayList();
+            bzshbList.add(bzshbUser);
+            workActivityProcessService.insertAuditsByType(bzshbList,projectRecords.getCheckProcessInstanceId(),2,0);
+
+        }
+        int checkStatus = projectRecords.getCheckStatus();
+        String taskDefKey = projectRecords.getAct().getTaskDefKey();
+        if (!"modifyApply".equals(taskDefKey) && !taskDefKey.contains("audit") ) {
+            actTaskService.claim(projectRecords.getAct().getTaskId(), UserUtils.getUser().getId());
+        }else {
+            projectRecords.getAct().setFlag("yes");
+            saveCheck(projectRecords, ProjectStatusEnum.IN_APRL);
+        }
+
+        String comment = "";
+        if ( checkStatus == ProjectStatusEnum.REJECTED.getValue()) {
+            comment = ("yes".equals(projectRecords.getAct().getFlag())?"[重新申请] ":"[已撤销] ");
+        }else {
+            comment = ("yes".equals(projectRecords.getAct().getFlag())?"[同意] ":"[驳回] ")+projectRecords.getAct().getComment();
+        }
+
+        if (!"yes".equals(projectRecords.getAct().getFlag())) {
+            projectRecords.setCheckStatus(ProjectStatusEnum.REJECTED.getValue());
+        }
+
+        User createUser = UserUtils.get(projectRecords.getCreateBy().getId());
+
+        Map<String, Object> vars = Maps.newHashMap();
+        String notifyRole = "";
+        //业务逻辑对应的条件表达式
+        User user = null;
+        List<Activity> activitieList = activityService.getByProcessInstanceId(projectRecords.getCheckProcessInstanceId());
+        WorkActivityMenu workActivityMenu = new WorkActivityMenu();
+        if (activitieList != null && activitieList.size() != 0) {
+            workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
+            workActivityMenu.setActivities(activitieList);
+        }
+
+        WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+        WorkActivityProcess selectProcess = new WorkActivityProcess();
+        selectProcess.setProcessInstanceId(projectRecords.getCheckProcessInstanceId());
+        List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
+        List<Activity> activities = workActivityMenu.getActivities();
+        String  taskCount = "1";
+        String enname = "";
+        Office office = projectRecords.getOffice();
+        office = officeService.get(office.getId());
+        projectRecords.setOffice(office);
+        String notifyStr = "项目编号:"+projectRecords.getProjectId()+",项目名称:"+ projectRecords.getProjectName();
+        String str = notifyStr+",创建人:"+projectRecords.getCreateBy().getName()+",所属部门:"+projectRecords.getOffice().getName();
+        String titleStr = "项目名称:"+ projectRecords.getProjectName();
+        int key = 0;
+        if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("checkAudit")) {
+            key = 1;
+            for (int i = 0; i < workActivityProcesses.size(); i++) {
+                WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+                if (taskDefKey.equals("modifyApply")) {
+                    taskCount = "0";
+                    workActivityProcess.setId("");
+                    workActivityProcess.setCount(0);
+                    if (!"yes".equals(projectRecords.getAct().getFlag())) {
+                        projectRecords.setCheckStatus(ProjectStatusEnum.RECALL.getValue());
+                        workActivityProcess.setIsApproval("2");
+                        vars.put("pass", false);
+                    } else {
+                        vars.put("pass", true);
+                        workActivityProcess.setIsApproval("1");
+                    }
+                    break;
+                } else {
+                    taskCount = activityProcess.getCount()+"";
+                    workActivityProcess = activityProcess;
+                    if (!workActivityProcess.getIsApproval().equals("0")) {
+                        workActivityProcess.setId("");
+                    }
+                    for (Activity activity : activities) {
+                        if (activity.getCount() == activityProcess.getCount()) {
+                            notifyRole = activity.getName();
+                            break;
+                        }
+                    }
+                    if (!"yes".equals(projectRecords.getAct().getFlag())) {
+                        notifyRole = "调整项目";
+                        projectRecords.setCheckStatus(ProjectStatusEnum.REJECTED.getValue());
+                        workActivityProcess.setIsApproval("2");
+                        String returnBack = "-1";
+                        for (Activity activity : activities) {
+                            if (activity.getCount() == activityProcess.getCount()) {
+                                returnBack = activity.getReturnBack();
+                                break;
+                            }
+                        }
+                        if (returnBack.equals("0")) {
+                            workActivityProcess.setId("");
+                        }
+                        vars.put("pass", false);
+                    } else {
+                        workActivityProcess.setIsApproval("1");
+                        vars.put("pass", true);
+                    }
+                    break;
+                }
+            }
+        }else {
+            workActivityMenu.setProcessType("checkAudit");
+            for (int i = 0; i < workActivityProcesses.size(); i++) {
+                WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+                String count = String.valueOf(activityProcess.getCount());
+                workActivityProcess = activityProcess;
+                if (!workActivityProcess.getIsApproval().equals("0")) {
+                    workActivityProcess.setId("");
+                }
+                // 审核环节
+                if ("master".equals(taskDefKey) && "1".equals(count)) {
+                    taskCount = count;
+                    if ("yes".equals(projectRecords.getAct().getFlag())) {
+                        notifyRole = "总工审批";
+                        workActivityProcess.setIsApproval("1");
+                        enname = "bzshb";
+                        vars.put("bzshbList", auditUsers);
+                        vars.put("bzshbcount",auditUsers.size());
+                        vars.put("pass", true);
+                        vars.put("passs", true);
+                    } else {
+                        workActivityProcess.setIsApproval("2");
+                        vars.put("pass", false);
+                        vars.put("passs", false);
+                        user = createUser;
+                        notifyRole = "调整项目";
+                    }
+                    break;
+                }
+                if ("bzshb".equals(taskDefKey) && "2".equals(count)) {
+                    taskCount = count;
+                    if ("yes".equals(projectRecords.getAct().getFlag())) {
+                        notifyRole = "项目归档员审批";
+                        workActivityProcess.setIsApproval("1");
+                        enname = "bggdgly";
+                        vars.put("bggdglyList", auditUsers);
+                        vars.put("bggdglycount",auditUsers.size());
+                        vars.put("pass", true);
+                        vars.put("passs", true);
+                    } else {
+                        workActivityProcess.setIsApproval("2");
+                        vars.put("pass", false);
+                        vars.put("passs", false);
+                        user = createUser;
+                        notifyRole = "调整项目";
+                    }
+                    break;
+                }else if ("bggdgly".equals(taskDefKey) && count.contains("3")) {
+                    taskCount = count;
+                    if ("yes".equals(projectRecords.getAct().getFlag())) {
+                        notifyRole = "审批通过";
+                        workActivityProcess.setIsApproval("1");
+                        vars.put("pass", true);
+                        vars.put("passs", true);
+                    } else {
+                        notifyRole = "调整报告";
+                        workActivityProcess.setIsApproval("2");
+                        vars.put("pass", false);
+                        vars.put("passs", false);
+                    }
+                    break;
+                } else if ("modifyApply".equals(taskDefKey) && "0".equals(count)) {
+                    notifyRole = "负责人审批";
+                    taskCount = "0";
+                    enname = "master";
+                    workActivityProcess.setCount(0);
+                    if("yes".equals(projectRecords.getAct().getFlag())){
+                        workActivityProcess.setIsApproval("1");
+                        vars.put("pass",true);
+                        vars.put("passs",true);
+                    }else{
+                        workActivityProcess.setIsApproval("2");
+                        projectRecords.setCheckStatus(ProjectStatusEnum.RECALL.getValue());
+                        vars.put("pass",false);
+                        vars.put("passs",false);
+                    }
+                    break;
+                }
+            }
+        }
+        workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,projectRecords.getCheckProcessInstanceId(),taskDefKey,"modifyApply",projectRecords.getAct().getFlag(),comment, activities);
+        // 设置意见
+        projectRecords.getAct().setComment(comment);
+        projectRecords.preUpdate();
+        //判断是否是审核通过
+        if("yes".equals(projectRecords.getAct().getFlag())){
+            actTaskService.complete(projectRecords.getAct().getTaskId(), projectRecords.getAct().getProcInsId(), projectRecords.getAct().getComment(), vars);
+        }else{
+            //不通过需要查询审核组角色id
+            List<Act> list2 = actTaskService.toMyStartedList(projectRecords.getCheckProcessInstanceId());
+            // 提交流程任务
+            //如果是驳回,并且审核角色为多个,需要对每个角色的审核流都进行处理
+            for (Act actInfo: list2) {
+                actTaskService.complete(actInfo.getTask().getId(), actInfo.getProcInsId(), projectRecords.getAct().getComment(), vars);
+            }
+        }
+        boolean state = actTaskService.isProcessEnd(projectRecords.getAct().getProcInsId());
+        List<User> users = new ArrayList<>();
+        List<User> userList = new ArrayList<>();
+        if(!state) {
+            users.add(projectRecords.getCreateBy());
+            //审核完成提示框
+            String title = "项目【"+projectRecords.getProjectName()+"】项目选查归档完成";
+            String content = "项目【"+projectRecords.getProjectName()+"】项目选查归档完成,项目编号:"+projectRecords.getProjectId();
+            if ("yes".equals(projectRecords.getAct().getFlag())) {
+                projectRecords.setCheckStatus(ProjectStatusEnum.SIGNED.getValue());
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectRecords.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                users.add(projectRecords.getCreateBy());
+                workProjectNotifyService
+                        .save(UtilNotify
+                                .saveNotify(projectRecords.getId(),
+                                        projectRecords.getCreateBy(),
+                                        projectRecords.getCompany().getId(),
+                                        title,
+                                        content,
+                                        "140",
+                                        "0",
+                                        "待通知",
+                                        notifyRole));
+            } else {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectRecords.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                users.add(projectRecords.getCreateBy());
+                if (projectRecords.getCheckStatus()!= ProjectStatusEnum.RECALL.getValue()){
+                    projectRecords.setCheckStatus(ProjectStatusEnum.REJECTED.getValue());
+                    workProjectNotifyService
+                            .save(UtilNotify
+                                    .saveNotify(projectRecords.getId(),
+                                            projectRecords.getCreateBy(),
+                                            projectRecords.getCompany().getId(),
+                                            titleStr,
+                                            notifyStr,
+                                            "140",
+                                            "0",
+                                            "待通知",
+                                            notifyRole));
+                }
+            }
+            workActivityProcessService.deleteProcessIdAuditUsers(projectRecords.getCheckProcessInstanceId());
+
+        }else{
+            if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("checkAudit")) {
+                WorkProjectNotify notify = new WorkProjectNotify();
+                notify.setNotifyId(projectRecords.getId());
+                userList = workProjectNotifyService.readByNotifyId(notify);
+                WorkProjectNotify workProjectNotify = UtilNotify
+                        .saveNotify(projectRecords.getId(),
+                                new User(),
+                                projectRecords.getCompany().getId(),
+                                titleStr,
+                                str,
+                                "140",
+                                "0",
+                                "待审批",
+                                notifyRole);
+                String count = taskDefKey.replace("audit","").replace("task","");
+                List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
+                        activities,
+                        workProjectNotify,
+                        taskDefKey,
+                        projectRecords.getAct().getFlag(),
+                        count,
+                        projectRecords.getCreateBy(),
+                        projectRecords.getOffice().getId(),
+                        "4");
+                for (WorkProjectNotify workProjectNotify1:workProjectNotifys){
+                    users.add(workProjectNotify1.getUser());
+                    workProjectNotify1.setId("");
+                    workProjectNotify1.setIsNewRecord(false);
+                    workProjectNotifyService.save(workProjectNotify1);
+                }
+            }else {
+                if (!"yes".equals(projectRecords.getAct().getFlag())) {//驳回待办提醒
+                    str = "项目【"+ projectRecords.getProjectName()+"】项目选查归档被驳回,请选择重新申请或删除";
+                    titleStr = "项目【"+ projectRecords.getProjectName()+"】项目选查归档被驳回";
+                    WorkProjectNotify notify = new WorkProjectNotify();
+                    notify.setNotifyId(projectRecords.getId());
+                    userList = workProjectNotifyService.readByNotifyId(notify);
+                    users.add(user);
+                    User informUser = UserUtils.get(records.getCheckUserId());
+                    WorkProjectNotify workProjectNotify = UtilNotify
+                            .saveNotify(projectRecords.getId(),
+                                    informUser,
+                                    projectRecords.getCompany().getId(),
+                                    titleStr,
+                                    str,
+                                    "140",
+                                    "0",
+                                    "重新申请",
+                                    notifyRole);
+                    workProjectNotifyService.save(workProjectNotify);
+                } else {
+                    if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办信息
+                        str = "项目【"+ projectRecords.getProjectName()+"】重新选查归档,待审批,项目编号:"+projectRecords.getProjectId();
+                        titleStr = "项目【"+ projectRecords.getProjectName()+"】重新选查归档,待审批";
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(projectRecords.getId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        WorkProjectNotify workProjectNotify = UtilNotify
+                                .saveNotify(projectRecords.getId(),
+                                        new User(),
+                                        projectRecords.getCompany().getId(),
+                                        titleStr,
+                                        str,
+                                        "140",
+                                        "0",
+                                        "待审批",
+                                        notifyRole);
+                        for (User user1:auditUsers){
+                            users.add(user1);
+                            workProjectNotify.setUser(user1);
+                            workProjectNotify.setId("");
+                            workProjectNotify.setIsNewRecord(false);
+                            workProjectNotifyService.save(workProjectNotify);
+                            Map<String,Object> extras = new HashMap<>();
+                            extras.put("type","7003");
+                            extras.put("procDefKey","140");
+                            extras.put("id",workProjectNotify.getId());
+                            UserUtils.pushInfoToApp(titleStr,str,extras,user1.getId());
+                        }
+                    }else {
+                        WorkProjectNotify notify = new WorkProjectNotify();
+                        notify.setNotifyId(projectRecords.getId());
+                        userList = workProjectNotifyService.readByNotifyId(notify);
+                        users.add(projectRecords.getCreateBy());
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(projectRecords.getId(),
+                                                projectRecords.getCreateBy(),
+                                                projectRecords.getCompany().getId(),
+                                                titleStr,
+                                                str,
+                                                "140",
+                                                "0",
+                                                "重新申请",
+                                                notifyRole));
+                    }
+                }
+            }
+        }
+        dao.updateSelectiveById(projectRecords);
+        return "保存审核意见成功!";
+    }
+
+
+    @Transactional(readOnly = false)
+    public void cancelProcess(RuralProjectRecords projectRecords) throws Exception {
+        WorkActivityProcess process = new WorkActivityProcess();
+        process.setProcessInstanceId(projectRecords.getCheckProcessInstanceId());
+        process.setIsApproval("0");
+        WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+        workActivityProcess.setProcessInstanceId(projectRecords.getCheckProcessInstanceId());
+        List<WorkActivityProcess> processList = workActivityProcessService.findList(workActivityProcess);
+        WorkProjectNotify notify = new WorkProjectNotify();
+        notify.setNotifyId(projectRecords.getId());
+        List<User> userList = workProjectNotifyService.readByNotifyId(notify);
+        if (userList!=null && userList.size()!=0) {
+            for (User u : userList) {
+                User user = UserUtils.get(u.getId());
+                UserUtils.pushIm(u.getId(),"申请人 "+user.getName() +",项目登记审批:"+projectRecords.getProjectName() +" 强制撤销!");
+            }
+        }
+        if(processList!=null && processList.size()>0) {
+            for (int i = 0; i < processList.size(); i++) {
+                WorkActivityProcess p = processList.get(i);
+                if (StringUtils.isNotBlank(p.getIsApproval()) && "0".equals(p.getIsApproval())) {
+                    p.setIsApproval("-1");
+                    p.setDelFlag("1");
+                    workActivityProcessDao.updateDelFlagAndIsApproval(p);
+                }
+            }
+            WorkActivityProcess pro = new WorkActivityProcess();
+            pro.setId("");
+            pro.setDelFlag("0");
+            pro.preInsert();
+            pro.setRemarks("[强制撤销]");
+            pro.setProcessKey(processList.get(0).getProcessKey());
+            pro.setIsApproval("1");
+            pro.setProcessInstanceId(processList.get(0).getProcessInstanceId());
+            pro.setCount(0);
+            workActivityProcessDao.insert(pro);
+
+            //结束该流程,设为"撤销"状态月
+            RuralProjectRecords newRecords = new RuralProjectRecords();
+            newRecords.setId(projectRecords.getId());
+            newRecords.setCheckStatus(ProjectStatusEnum.RECALL.getValue());
+            newRecords.preUpdate();
+            dao.updateSelectiveById(newRecords);
+            actTaskService.endProcessInstance(projectRecords.getCheckProcessInstanceId(), "项目登记-撤回");
+        }
+    }
+
+    /**
+     * 删除项目选查流程信息
+     * @param projectRecords
+     */
+    @Transactional(readOnly = false)
+    public void delete(RuralProjectRecords projectRecords){
+        if(null != projectRecords && StringUtils.isNotBlank(projectRecords.getId())){
+            dao.delete(projectRecords);
+        }
+    }
+
+}

+ 7 - 3
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -439,7 +439,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
 
 
     @Transactional(readOnly = false)
-    public String saveData(Projectcontentinfo projectcontentinfo,int type) throws Exception {
+    public String saveData(Projectcontentinfo projectcontentinfo,int type) {
         String count = "0";
         String infoId = "";
         Projectcontentinfo s = new Projectcontentinfo();
@@ -1429,7 +1429,11 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         //总工
         List<User> bzshbsList = UserUtils.getByRoleActivityEnname("bzshb",3,recordsOffice.getId(),"12",projectReportData.getCreateBy());
         List<User> bzshbs = new ArrayList<>();
-        //判断总工数据是否为空
+        User bzshbsUser = UserUtils.get(projectReportData.getBzshbUserId());
+        if(null != bzshbsUser){
+            bzshbs.add(bzshbsUser);
+        }
+        /*//判断总工数据是否为空
         if(bzshbsList.size()>0){
             for (User zgUser: bzshbsList) {
                 //判断当前登陆人对应的总审人员的id和遍历的人员id相对比  相同的则留用
@@ -1442,7 +1446,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
             }
         }else{
             return "流程总审审批人不能为空,请联系管理员变更!";
-        }
+        }*/
 
         if (insert) {
             projectReportDataService.insert(projectReportData);

+ 317 - 3
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -5,6 +5,7 @@ package com.jeeplus.modules.ruralprojectrecords.service;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import com.jeeplus.common.config.Global;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.Collections3;
@@ -14,16 +15,21 @@ import com.jeeplus.common.utils.MenuStatusEnum;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.act.utils.ProcessDefCache;
+import com.jeeplus.modules.projectAccessory.dao.ProjectTemplateDao;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
+import com.jeeplus.modules.projectAccessory.service.ProjectAccessoryRelationService;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectcontentinfoDao;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectClientLinkmanDao;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectRecordsDao;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralWorkProjectUserDao;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
-import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecordsReported;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
 import com.jeeplus.modules.serialnum.service.SerialNumTplService;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
@@ -33,6 +39,8 @@ import com.jeeplus.modules.sys.service.OfficeService;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.utils.SftpClientUtil;
+import com.jeeplus.modules.utils.ZipCompressUtil;
 import com.jeeplus.modules.workactivity.dao.WorkActivityProcessDao;
 import com.jeeplus.modules.workactivity.entity.Activity;
 import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
@@ -58,14 +66,15 @@ import org.activiti.engine.RuntimeService;
 import org.activiti.engine.history.HistoricTaskInstance;
 import org.activiti.engine.history.HistoricTaskInstanceQuery;
 import org.activiti.engine.runtime.ProcessInstance;
-import org.activiti.engine.task.Task;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.text.SimpleDateFormat;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URLEncoder;
 import java.util.*;
 
 /**
@@ -119,6 +128,21 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
     private WorkActivityProcessDao workActivityProcessDao;
     @Autowired
 	private ProjectReportDataDao projectReportDataDao;
+    @Autowired
+	private ProjectReportDataService projectReportDataService;
+	@Autowired
+	private ProjectAccessoryRelationService projectAccessoryRelationService;
+	@Autowired
+	private ProjectTemplateDao projectTemplateDao;
+
+
+	/**
+	 * 获取项目附件模板类型
+	 * @return
+	 */
+	public static List<MainDictDetail> attachmentTemplateList(){
+		return  DictUtils.getMainDictList("attachment_template_type");
+	}
 
 	private static byte[] SYN_BYTE = new byte[0];
 
@@ -1442,6 +1466,296 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 			dao.updateProjectReportedState(idList);
 		}
 	}
+
+	/**
+	 * 项目相应文件批量下载并压缩
+	 * @param idList
+	 */
+	public String exportAll(List<String> idList) throws Exception {
+		//设置下载的压缩包名(固定字符+时间戳)
+		long timeMillis = System.currentTimeMillis();
+		String fileLocality = "项目附件_"+ timeMillis;
+		//判定当前系统
+		String path = null;
+		if(System.getProperty("os.name").toLowerCase().contains("win")){
+			path = Global.getConfig("remoteServer.winDirectory");
+		}else{
+			path = Global.getConfig("remoteServer.directory");
+		}
+		path = path + "/" + fileLocality;
+		//检查该路径对应的目录是否存在. 如果不存在则创建目录
+		File dir=new File(path);
+		if (!dir.exists()) {
+			dir.mkdirs();
+		}
+		//遍历项目id并查询对应数据信息
+		for (String projectId: idList) {
+			//获取项目信息
+			RuralProjectRecords records = this.getQueryProjectUsers(projectId);
+			//根据项目id查询项目报告信息
+			ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(records.getId());
+			projectReportData = projectReportDataService.get(projectReportData.getId());
+			ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
+
+			//添加项目类型
+			relateInfo.setAttachmentProjectType(records.getProjectType());
+			relateInfo.setAttachmentProjectSort(records.getAttachmentProjectSort());
+
+			//查看送审金额是否为500w以上金额
+			Integer approvalMoney = projectAccessoryRelationService.decideAttachmentProjectApprovalMoney(projectReportData.getReviewFee());
+			if(0 == approvalMoney){
+				//金额为0
+				relateInfo.setAttachmentProjectApprovalMoney(null);
+			}else if(1 == approvalMoney){
+				//500w以下金额状态
+				relateInfo.setAttachmentProjectApprovalMoney("1");
+			}else{
+				//500w以上金额状态
+				relateInfo.setAttachmentProjectApprovalMoney("2");
+			}
+			//添加报告类型
+			relateInfo.setRequiredStage(1);
+			relateInfo.setId(records.getId());
+			//查询报告文件、依据性文件、其他文件必填列表以及数据
+			List<MainDictDetail> mainDictDetails = this.attachmentTemplateList();
+			List<ProjectTemplateInfo> projectTemplateList = null;
+			String downloadPath = path + "/" + records.getProjectName();
+			for (MainDictDetail mainDict : mainDictDetails) {
+				relateInfo.setAttachType(mainDict.getValue());
+				File dirFile = null;
+				switch (mainDict.getValue()) {
+					case "11":
+						dirFile=new File(downloadPath+"/成果文件");
+						projectTemplateList = Lists.newArrayList();
+						projectTemplateList = this.getProjectTemplateList(relateInfo);
+						this.disposeFileList(projectTemplateList,dirFile.getPath());
+						break;
+					case "12":
+						dirFile=new File(downloadPath+"/依据性资料");
+						projectTemplateList = Lists.newArrayList();
+						projectTemplateList = this.getProjectTemplateList(relateInfo);
+						this.disposeFileList(projectTemplateList,dirFile.getPath());
+						break;
+					case "13":
+						dirFile=new File(downloadPath+"/其他文件");
+						projectTemplateList = Lists.newArrayList();
+						projectTemplateList = this.getProjectTemplateList(relateInfo);
+						this.disposeFileList(projectTemplateList,dirFile.getPath());
+						break;
+				}
+
+			}
+
+		}
+		//处理完之后进行打包压缩并删除之前的文件
+		ZipCompressUtil zipUtil = new ZipCompressUtil();
+		File resultFile = new File(path);
+		File file = zipUtil.zipCompress(resultFile, true);
+		return file.getPath();
+	}
+
+	/**
+	 * 下载压缩文件
+	 * @param filePath
+	 * @param response
+	 */
+	public void downloadZipFile(String filePath,HttpServletResponse response){
+		File file = new File(filePath);
+		// 取得文件名。
+		String fileName = file.getName();
+		InputStream in = null;
+		try {
+			fileName = URLEncoder.encode(fileName,"UTF8");
+			in = new FileInputStream(file);
+			response.reset();//重置 响应头
+			response.setCharacterEncoding("UTF-8");
+			response.setContentType("application/x-download");
+			response.setHeader("Content-disposition", "attachment; filename=" + fileName);
+
+			byte[] b = new byte[1024];
+			int len;
+			while ((len = in.read(b)) > 0){
+				response.getOutputStream().write(b, 0, len);
+			}
+			in.close();
+			response.getOutputStream().close();
+		}catch (IOException e) {
+			throw new RuntimeException(e);
+		}
+		finally {
+			//路径是个文件且不为空时删除文件
+			if(file.isFile()&&file.exists()){
+				file.delete();
+			}
+		}
+	}
+
+	/**
+	 * 处理文件信息
+	 * @param projectTemplateList
+	 * @param downloadPath
+	 */
+	public void disposeFileList(List<ProjectTemplateInfo> projectTemplateList,String downloadPath) throws IOException {
+		SftpClientUtil sftpClientUtil = new SftpClientUtil();
+		for (ProjectTemplateInfo info: projectTemplateList) {
+			List<WorkClientAttachment> workAttachments = info.getWorkAttachments();
+			for (WorkClientAttachment attachment:workAttachments) {
+				sftpClientUtil.downloadRuralProject(attachment.getUrl().substring(0,attachment.getUrl().lastIndexOf("/")),attachment.getUrl().substring(attachment.getUrl().lastIndexOf("/") + 1, attachment.getUrl().length()),downloadPath,attachment.getAttachmentName());
+			}
+		}
+	}
+
+
+	public List<ProjectTemplateInfo> getProjectTemplateList(ProjectAccessoryRelationInfo projectTemplateInfo){
+		//查询所有被选择为必填项展示列,并查询附件信息
+		List<ProjectTemplateInfo> projectTemplateList = projectTemplateDao.getProjectTemplateList(projectTemplateInfo);
+		for (ProjectTemplateInfo info: projectTemplateList) {
+			WorkClientAttachment attchment = new WorkClientAttachment();
+			attchment.setProjectId(projectTemplateInfo.getId());
+			attchment.setAttachmentId(info.getId());
+			List<WorkClientAttachment> attachments = workClientAttachmentDao.getList(attchment);
+			info.setWorkAttachments(attachments);
+			//判断是否为必填项,若为必填项则添加必填判定字段
+			if(info.getRequiredStage() == projectTemplateInfo.getRequiredStage()){
+				info.setMustFlag(1);
+			} else {
+				info.setMustFlag(0);
+			}
+		}
+		//查询没有被选择必填项的数据并查询是否已经上传附件,若有则添加到展示列中
+		List<ProjectTemplateInfo> otherProjectTemplateList = projectTemplateDao.projectAccessoryListByParentId(projectTemplateInfo);
+		for (ProjectTemplateInfo otherInfo: otherProjectTemplateList) {
+			WorkClientAttachment attchment = new WorkClientAttachment();
+			attchment.setProjectId(projectTemplateInfo.getId());
+			attchment.setAttachmentId(otherInfo.getId());
+			List<WorkClientAttachment> attachments = workClientAttachmentDao.getList(attchment);
+			if(attachments.size()>0){
+				otherInfo.setWorkAttachments(attachments);
+
+				otherInfo.setMustFlag(0);
+				projectTemplateList.add(otherInfo);
+			}
+		}
+
+		return projectTemplateList;
+	}
+
+	/**
+	 * 项目列表新增文件信息获取
+	 * @param projectRecords  项目信息
+	 * @return
+	 */
+	public RuralProjectcontentinfo formAccessory(RuralProjectRecords projectRecords){
+		RuralProjectcontentinfo projectcontentinfo = new RuralProjectcontentinfo();
+		//获取报告信息
+		ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(projectRecords.getId());
+
+		projectcontentinfo.setProject(projectRecords);
+		projectcontentinfo.setProjectReportData(projectReportData);
+		//声明项目与附件关系表联系
+		ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
+		//添加项目类型
+		relateInfo.setAttachmentProjectType(projectRecords.getProjectType());
+		relateInfo.setAttachmentProjectSort(projectRecords.getAttachmentProjectSort());
+		//查看送审金额是否为500w以上金额
+		Integer approvalMoney = projectAccessoryRelationService.decideAttachmentProjectApprovalMoney(projectReportData.getReviewFee());
+		if(0 == approvalMoney){
+			//金额为0
+			relateInfo.setAttachmentProjectApprovalMoney(null);
+		}else if(1 == approvalMoney){
+			//500w以下金额状态
+			relateInfo.setAttachmentProjectApprovalMoney("1");
+		}else{
+			//500w以上金额状态
+			relateInfo.setAttachmentProjectApprovalMoney("2");
+		}
+		//创建阶段集合(若为归档阶段则将新增报告和归档阶段信息都添加在内)
+		List<Integer> requiredStageList = Lists.newArrayList();
+		requiredStageList.add(1);
+		//添加报告类型
+		relateInfo.setRequiredStage(1);
+		relateInfo.setId(projectRecords.getId());
+
+		//声明归档状态
+		String reportRecordStatus = null;
+		//判断报告信息是否已存在
+		if(null != projectReportData){
+			//判断是否已经审批完成
+			if ("5".equals(projectReportData.getStatus())){
+				//查询归档状态信息
+				reportRecordStatus = dao.getReportRecordStatus(projectReportData.getId());
+				//如果归档状态不为空,则查询归档展示列
+				if(StringUtils.isNotBlank(reportRecordStatus)){
+					relateInfo.setRequiredStage(2);
+					requiredStageList.add(2);
+				}
+			}
+		}else{
+			//没有提交报告信息
+
+		}
+
+		//查询报告文件、依据性文件、其他文件必填列表以及数据
+		List<MainDictDetail> mainDictDetails = this.attachmentTemplateList();
+		for (MainDictDetail mainDict : mainDictDetails) {
+			relateInfo.setAttachType(mainDict.getValue());
+			switch (mainDict.getValue()) {
+				case "11":
+					projectcontentinfo.setFileAttachmentList(this.getProjectTemplate(relateInfo,requiredStageList));
+					break;
+				case "12":
+					projectcontentinfo.setFileGistdataList(this.getProjectTemplate(relateInfo,requiredStageList));
+					break;
+				case "13":
+					projectcontentinfo.setFileOtherList(this.getProjectTemplate(relateInfo,requiredStageList));
+					break;
+			}
+
+		}
+
+		return projectcontentinfo;
+	}
+
+
+	/**
+	 *
+	 * @param projectTemplateInfo
+	 * @param requiredStageList
+	 * @return
+	 */
+	public List<ProjectTemplateInfo> getProjectTemplate(ProjectAccessoryRelationInfo projectTemplateInfo,List<Integer> requiredStageList){
+		//查询所有被选择为必填项展示列,并查询附件信息
+		List<ProjectTemplateInfo> projectTemplateList = projectTemplateDao.getProjectTemplateList(projectTemplateInfo);
+		for (ProjectTemplateInfo info: projectTemplateList) {
+			WorkClientAttachment attchment = new WorkClientAttachment();
+			attchment.setProjectId(projectTemplateInfo.getId());
+			attchment.setAttachmentId(info.getId());
+			List<WorkClientAttachment> attachments = workClientAttachmentDao.getList(attchment);
+			info.setWorkAttachments(attachments);
+			//判断是否为必填项,若为必填项则添加必填判定字段
+			if(requiredStageList.contains(info.getRequiredStage())){
+				info.setMustFlag(1);
+			}else{
+				info.setMustFlag(0);
+			}
+		}
+		//查询没有被选择必填项的数据并查询是否已经上传附件,若有则添加到展示列中
+		List<ProjectTemplateInfo> otherProjectTemplateList = projectTemplateDao.projectAccessoryListByParentId(projectTemplateInfo);
+		for (ProjectTemplateInfo otherInfo: otherProjectTemplateList) {
+			WorkClientAttachment attchment = new WorkClientAttachment();
+			attchment.setProjectId(projectTemplateInfo.getId());
+			attchment.setAttachmentId(otherInfo.getId());
+			List<WorkClientAttachment> attachments = workClientAttachmentDao.getList(attchment);
+			if(attachments.size()>0){
+				otherInfo.setWorkAttachments(attachments);
+
+				otherInfo.setMustFlag(0);
+				projectTemplateList.add(otherInfo);
+			}
+		}
+
+		return projectTemplateList;
+	}
 	/**
 	 * 查找项目
 	 * @param projectRecords

+ 54 - 20
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageController.java

@@ -33,6 +33,7 @@ import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageServic
 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.WorkClientLinkman;
@@ -93,6 +94,8 @@ public class RuralCostProjectMessageController extends BaseController {
     private HistoricalService historicalService;
     @Autowired
     private ProjectAccessoryRelationService projectAccessoryRelationService;
+    @Autowired
+    private UserService userService;
 
     private static byte[] SYN_BYTE = new byte[0];
 
@@ -147,7 +150,7 @@ public class RuralCostProjectMessageController extends BaseController {
         model.addAttribute("parentIds", projectcontentinfo1.getParentIds());
         String dictType = projectcontentinfo.getDictType();
         RuralProjectRecords records = projectRecordsService.getQueryProjectUsers(projectcontentinfo1.getProject().getId());
-        model.addAttribute("projectRecords", records);
+
         projectcontentinfo.setProject(records);
         ProjectReportData projectReportData = new ProjectReportData();
         projectReportData.setType(dictType);
@@ -171,32 +174,35 @@ public class RuralCostProjectMessageController extends BaseController {
 
         //根据条件查询附件必填项
         //判断项目类别是否为打包项目(1:打包项目,0:非打包项目)
-        Integer projectSort = projectAccessoryRelationService.decideAttachmentProjectSort(records.getAttachmentProjectSort());
+        /*Integer projectSort = projectAccessoryRelationService.decideAttachmentProjectSort(records.getAttachmentProjectSort());
 
         Boolean flag = false;
         //如果是打包项目或者报告送审价不为null则可进行查询附件类型
         if(1 == projectSort || null != projectcontentinfo.getProjectReportData().getReviewFee()){
             flag = true;
         }
-        if(flag) {
+        if(flag) {*/
             ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
             //添加项目类型
             relateInfo.setAttachmentProjectType(records.getProjectType());
             relateInfo.setAttachmentProjectSort(records.getAttachmentProjectSort());
             //判断是否为打包项目,打包项目无需查看项目送审金额是否为500w以上判定
-            if(0 == projectSort){
+            /*if(0 == projectSort){*/
                 //查看送审金额是否为500w以上金额
                 Integer approvalMoney = projectAccessoryRelationService.decideAttachmentProjectApprovalMoney(projectcontentinfo.getProjectReportData().getReviewFee());
-                if(1 == approvalMoney){
+                if(0 == approvalMoney){
+                    //金额为0
+                    relateInfo.setAttachmentProjectApprovalMoney(null);
+                }else if(1 == approvalMoney){
                     //500w以下金额状态
                     relateInfo.setAttachmentProjectApprovalMoney("1");
                 }else{
                     //500w以上金额状态
                     relateInfo.setAttachmentProjectApprovalMoney("2");
                 }
-            }else{
+            /*}else{
                 relateInfo.setAttachmentProjectApprovalMoney(null);
-            }
+            }*/
 
             //添加报告类型
             relateInfo.setRequiredStage(1);
@@ -218,10 +224,15 @@ public class RuralCostProjectMessageController extends BaseController {
                 }
 
             }
-        }
+        /*}*/
 
+        //查询总审人员信息
+        List<User> auditUserList = userService.getAuditUserList();
+        records.setBzshbUserList(auditUserList);
+        model.addAttribute("projectRecords", records);
+        model.addAttribute("projectcontentinfo", projectcontentinfo);
         model.addAttribute("projectcontentinfo", projectcontentinfo);
-        model.addAttribute("projectSort", projectSort);
+        /*model.addAttribute("projectSort", projectSort);*/
         if (projectReportData != null && projectReportData.getCreateBy() != null && StringUtils.isNotBlank(projectReportData.getCreateBy().getId()) && projectReportData.getCreateBy().getId().equals(UserUtils.getUser().getId())) {
             return "modules/ruralprojectrecords/cost/projectcontentinfo/reportForm";
         } else if (projectReportData == null || StringUtils.isBlank(projectReportData.getId())) {
@@ -426,32 +437,35 @@ public class RuralCostProjectMessageController extends BaseController {
         projectcontent.setProjectReportData(projectReportData);
         //根据条件查询附件必填项
         //判断项目类别是否为打包项目(1:打包项目,0:非打包项目)
-        Integer projectSort = projectAccessoryRelationService.decideAttachmentProjectSort(ruralProjectRecords.getAttachmentProjectSort());
+        /*Integer projectSort = projectAccessoryRelationService.decideAttachmentProjectSort(ruralProjectRecords.getAttachmentProjectSort());
 
         Boolean flag = false;
         //如果是打包项目或者报告送审价不为null则可进行查询附件类型
         if(1 == projectSort || null != projectReportData.getReviewFee()){
             flag = true;
         }
-        if(flag) {
+        if(flag) {*/
             ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
             //添加项目类型
             relateInfo.setAttachmentProjectType(ruralProjectRecords.getProjectType());
             relateInfo.setAttachmentProjectSort(ruralProjectRecords.getAttachmentProjectSort());
             //判断是否为打包项目,打包项目无需查看项目送审金额是否为500w以上判定
-            if(0 == projectSort){
+            /*if(0 == projectSort){*/
                 //查看送审金额是否为500w以上金额
                 Integer approvalMoney = projectAccessoryRelationService.decideAttachmentProjectApprovalMoney(projectReportData.getReviewFee());
-                if(1 == approvalMoney){
+                if(0 == approvalMoney){
+                    //金额为0
+                    relateInfo.setAttachmentProjectApprovalMoney(null);
+                }else if(1 == approvalMoney){
                     //500w以下金额状态
                     relateInfo.setAttachmentProjectApprovalMoney("1");
                 }else{
                     //500w以上金额状态
                     relateInfo.setAttachmentProjectApprovalMoney("2");
                 }
-            }else{
+            /*}else{
                 relateInfo.setAttachmentProjectApprovalMoney(null);
-            }
+            }*/
 
             //添加报告类型
             relateInfo.setRequiredStage(1);
@@ -473,7 +487,10 @@ public class RuralCostProjectMessageController extends BaseController {
                 }
 
             }
-        }
+        /*}*/
+        //查询总审人员信息
+        List<User> auditUserList = userService.getAuditUserList();
+        projectcontentinfo1.getProject().setBzshbUserList(auditUserList);
         model.addAttribute("processInstanceId",projectReportData.getProcessInstanceId());
         model.addAttribute("projectId", projectcontentinfo1.getProject().getId());
         model.addAttribute("reportedId", projectcontentinfo.getReportedId());
@@ -520,6 +537,11 @@ public class RuralCostProjectMessageController extends BaseController {
         try{
             Projectcontentinfo projectcontentinfo1 = projectcontentinfoService.getByProjectId(projectcontentinfo.getProject().getId());
             ProjectReportData reportData = projectReportDataService.get(projectcontentinfo1.getInfoId());
+            //将审核人员id放入报告信息中
+            if(StringUtils.isBlank(projectcontentinfo.getProjectReportData().getBzshbUserId()) && StringUtils.isBlank(reportData.getBzshbUserId())){
+                addMessage(redirectAttributes, "审核人员未选择,请重新发起请求");
+                return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectMessage/?repage";
+            }
             if(null != reportData){
                 if(reportData.getStatus().equals("2")){
                     addMessage(redirectAttributes, "报告已送审,请勿重复提交");
@@ -707,20 +729,32 @@ public class RuralCostProjectMessageController extends BaseController {
         }
         String taskDefKey =  t.getAct().getTaskDefKey();
         List<User> users = null;
+        User auditUser = null;
         ProjectRecords projectRecord = projectRecordsServices.getRuralMasters(projectcontentinfo.getProject().getId());
         projectReportData.setProject(projectRecord);
         if ("bmzr".equals(taskDefKey)){
             users = UserUtils.getByProssType(t.getProcessInstanceId(),2);
-            if (users==null )
-                users = UserUtils.getByRoleActivityEnname("bzshb",3,t.getOfficeId(),"12",t.getCreateBy());
+            if (users==null ) {
+                users = Lists.newArrayList();
+                //添加总审人员
+                auditUser = UserUtils.get(t.getBzshbUserId());
+                users.add(auditUser);
+            }
+                //users = UserUtils.getByRoleActivityEnname("bzshb",3,t.getOfficeId(),"12",t.getCreateBy());
         }else if ("bzshb".equals(taskDefKey)){
             users = UserUtils.getByProssType(t.getProcessInstanceId(),5);
-            if (users==null )
+            if (users==null ) {
+                users = Lists.newArrayList();
+                //添加总审人员
+                auditUser = UserUtils.get(t.getBzshbUserId());
+                users.add(auditUser);
+            }
+            /*if (users==null )
                 users = UserUtils.getByRoleActivityEnname("gzr",3,t.getOfficeId(),"12",t.getCreateBy());
         }else if ("gzr".equals(taskDefKey)){
             users = UserUtils.getByProssType(t.getProcessInstanceId(),5);
             if (users==null )
-                users = UserUtils.getByRoleActivityEnname("gzr",3,t.getOfficeId(),"12",t.getCreateBy());
+                users = UserUtils.getByRoleActivityEnname("gzr",3,t.getOfficeId(),"12",t.getCreateBy());*/
         }else if ("modifyApply".equals(taskDefKey)){
             users = UserUtils.getByProssType(t.getProcessInstanceId(),1);
         }

+ 37 - 5
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java

@@ -21,6 +21,7 @@ import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
 import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
 import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
@@ -197,11 +198,21 @@ public class RuralCostProjectRecordsController extends BaseController {
 			projectRecords.setWorkAttachments(projectPlanAttachment);
 
 			//处理项目类别
-			List<MainDictDetail> mainDictList = DictUtils.getMainDictList("attachment_project_sort");
-			for (MainDictDetail info: mainDictList) {
-				if(projectRecords.getAttachmentProjectSort().equals(info.getValue())){
-					projectRecords.setAttachmentProjectSort(info.getLabel());
-					break;
+			List<MainDictDetail> mainDictList = Lists.newArrayList();
+			//工程咨询
+			if("1".equals(projectRecords.getProjectType())){
+				mainDictList = DictUtils.getMainDictList("attachment_project_sort");
+				//造价审核
+			} else if("2".equals(projectRecords.getProjectType())){
+				mainDictList = DictUtils.getMainDictList("attachment_project_sort_cost");
+			}
+			if(StringUtils.isNotBlank(projectRecords.getAttachmentProjectSort())){
+				//处理项目类别
+				for (MainDictDetail info: mainDictList) {
+					if(projectRecords.getAttachmentProjectSort().equals(info.getValue())){
+						projectRecords.setAttachmentProjectSort(info.getLabel());
+						break;
+					}
 				}
 			}
 
@@ -795,4 +806,25 @@ public class RuralCostProjectRecordsController extends BaseController {
 		}
 		return null;
 	}
+
+
+	/**
+	 * 文件上传
+	 * @param projectRecords
+	 * @param model
+	 * @return
+	 */
+	@RequiresPermissions(value={"ruralProject:ruralCostProjectRecords:accessory","ruralProject:ruralCostProjectRecords:adminAccessory"},logical=Logical.OR)
+	@RequestMapping(value = "formAccessory")
+	public String formAccessory(RuralProjectRecords projectRecords, Model model) {
+		if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
+			projectRecords = projectRecordsService.getQueryProjectUsers(projectRecords.getId());
+			RuralProjectcontentinfo ruralProjectcontentinfo = projectRecordsService.formAccessory(projectRecords);
+			model.addAttribute("projectcontentinfo", ruralProjectcontentinfo);
+			model.addAttribute("projectRecords", projectRecords);
+		}else {
+			return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
+		}
+		return "modules/ruralprojectrecords/projectAccessoryForm";
+	}
 }

+ 56 - 23
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageController.java

@@ -39,6 +39,7 @@ import com.jeeplus.modules.ruralprojectrecords.service.SubProjectInfoService;
 import com.jeeplus.modules.sys.entity.Area;
 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.WorkClientLinkman;
@@ -96,6 +97,8 @@ public class RuralProjectMessageController extends BaseController {
     private HistoricalService historicalService;
     @Autowired
     private ProjectAccessoryRelationService projectAccessoryRelationService;
+    @Autowired
+    private UserService userService;
 
     private static byte[] SYN_BYTE = new byte[0];
 
@@ -160,7 +163,7 @@ public class RuralProjectMessageController extends BaseController {
         model.addAttribute("parentIds", projectcontentinfo1.getParentIds());
         String dictType = projectcontentinfo.getDictType();
         RuralProjectRecords records = projectRecordsService.getQueryProjectUsers(projectcontentinfo1.getProject().getId());
-        model.addAttribute("projectRecords", records);
+
         projectcontentinfo.setProject(records);
         ProjectReportData projectReportData = new ProjectReportData();
         projectReportData.setType(dictType);
@@ -184,32 +187,35 @@ public class RuralProjectMessageController extends BaseController {
 
         //根据条件查询附件必填项
         //判断项目类别是否为打包项目(1:打包项目,0:非打包项目)
-        Integer projectSort = projectAccessoryRelationService.decideAttachmentProjectSort(records.getAttachmentProjectSort());
+        //Integer projectSort = projectAccessoryRelationService.decideAttachmentProjectSort(records.getAttachmentProjectSort());
 
-        Boolean flag = false;
+        /*Boolean flag = false;
         //如果是打包项目或者报告送审价不为null则可进行查询附件类型
         if(1 == projectSort || null != projectcontentinfo.getProjectReportData().getReviewFee()){
             flag = true;
         }
-        if(flag) {
+        if(flag) {*/
             ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
             //添加项目类型
             relateInfo.setAttachmentProjectType(records.getProjectType());
             relateInfo.setAttachmentProjectSort(records.getAttachmentProjectSort());
             //判断是否为打包项目,打包项目无需查看项目送审金额是否为500w以上判定
-            if(0 == projectSort){
+            /*if(0 == projectSort){*/
                 //查看送审金额是否为500w以上金额
                 Integer approvalMoney = projectAccessoryRelationService.decideAttachmentProjectApprovalMoney(projectcontentinfo.getProjectReportData().getReviewFee());
-                if(1 == approvalMoney){
+                if(0 == approvalMoney){
+                    //金额为0
+                    relateInfo.setAttachmentProjectApprovalMoney(null);
+                }else if(1 == approvalMoney){
                     //500w以下金额状态
                     relateInfo.setAttachmentProjectApprovalMoney("1");
                 }else{
                     //500w以上金额状态
                     relateInfo.setAttachmentProjectApprovalMoney("2");
                 }
-            }else{
+            /*}else{
                 relateInfo.setAttachmentProjectApprovalMoney(null);
-            }
+            }*/
 
             //添加报告类型
             relateInfo.setRequiredStage(1);
@@ -231,10 +237,13 @@ public class RuralProjectMessageController extends BaseController {
                 }
 
             }
-        }
-
+        /*}*/
+        //查询总审人员信息
+        List<User> auditUserList = userService.getAuditUserList();
+        records.setBzshbUserList(auditUserList);
+        model.addAttribute("projectRecords", records);
         model.addAttribute("projectcontentinfo", projectcontentinfo);
-        model.addAttribute("projectSort", projectSort);
+        /*model.addAttribute("projectSort", projectSort);*/
         if (projectReportData != null && projectReportData.getCreateBy() != null && StringUtils.isNotBlank(projectReportData.getCreateBy().getId()) && projectReportData.getCreateBy().getId().equals(UserUtils.getUser().getId())) {
             return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/reportForm";
         } else if (projectReportData == null || StringUtils.isBlank(projectReportData.getId())) {
@@ -437,32 +446,35 @@ public class RuralProjectMessageController extends BaseController {
         projectcontent.setProjectReportData(projectReportData);
         //根据条件查询附件必填项
         //判断项目类别是否为打包项目(1:打包项目,0:非打包项目)
-        Integer projectSort = projectAccessoryRelationService.decideAttachmentProjectSort(ruralProjectRecords.getAttachmentProjectSort());
+        /*Integer projectSort = projectAccessoryRelationService.decideAttachmentProjectSort(ruralProjectRecords.getAttachmentProjectSort());
 
         Boolean flag = false;
         //如果是打包项目或者报告送审价不为null则可进行查询附件类型
         if(1 == projectSort || null != projectReportData.getReviewFee()){
             flag = true;
         }
-        if(flag) {
+        if(flag) {*/
             ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
             //添加项目类型
             relateInfo.setAttachmentProjectType(ruralProjectRecords.getProjectType());
             relateInfo.setAttachmentProjectSort(ruralProjectRecords.getAttachmentProjectSort());
             //判断是否为打包项目,打包项目无需查看项目送审金额是否为500w以上判定
-            if(0 == projectSort){
+            /*if(0 == projectSort){*/
                 //查看送审金额是否为500w以上金额
                 Integer approvalMoney = projectAccessoryRelationService.decideAttachmentProjectApprovalMoney(projectReportData.getReviewFee());
-                if(1 == approvalMoney){
+                if(0 == approvalMoney){
+                    //金额为0
+                    relateInfo.setAttachmentProjectApprovalMoney(null);
+                }else if(1 == approvalMoney){
                     //500w以下金额状态
                     relateInfo.setAttachmentProjectApprovalMoney("1");
                 }else{
                     //500w以上金额状态
                     relateInfo.setAttachmentProjectApprovalMoney("2");
                 }
-            }else{
+            /*}else{
                 relateInfo.setAttachmentProjectApprovalMoney(null);
-            }
+            }*/
 
             //添加报告类型
             relateInfo.setRequiredStage(1);
@@ -484,7 +496,11 @@ public class RuralProjectMessageController extends BaseController {
                 }
 
             }
-        }
+        /*}*/
+
+        //查询总审人员信息
+        List<User> auditUserList = userService.getAuditUserList();
+        projectcontentinfo1.getProject().setBzshbUserList(auditUserList);
         model.addAttribute("processInstanceId",projectReportData.getProcessInstanceId());
         model.addAttribute("projectId", projectcontentinfo1.getProject().getId());
         model.addAttribute("project", projectcontentinfo1.getProject());
@@ -532,6 +548,11 @@ public class RuralProjectMessageController extends BaseController {
         try{
             Projectcontentinfo projectcontentinfo1 = projectcontentinfoService.getByProjectId(projectcontentinfo.getProject().getId());
             ProjectReportData reportData = projectReportDataService.get(projectcontentinfo1.getInfoId());
+            //将审核人员id放入报告信息中
+            if(StringUtils.isBlank(projectcontentinfo.getProjectReportData().getBzshbUserId()) && StringUtils.isBlank(reportData.getBzshbUserId())){
+                addMessage(redirectAttributes, "审核人员未选择,请重新发起请求");
+                return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectMessage/?repage";
+            }
             if(null != reportData){
                 if(reportData.getStatus().equals("2")){
                     addMessage(redirectAttributes, "报告已送审,请勿重复提交");
@@ -719,20 +740,32 @@ public class RuralProjectMessageController extends BaseController {
         }
         String taskDefKey =  t.getAct().getTaskDefKey();
         List<User> users = null;
+        User auditUser = null;
         ProjectRecords projectRecord = projectRecordsServices.getRuralMasters(projectcontentinfo.getProject().getId());
         projectReportData.setProject(projectRecord);
         if ("bmzr".equals(taskDefKey)){
             users = UserUtils.getByProssType(t.getProcessInstanceId(),2);
-            if (users==null )
-                users = UserUtils.getByRoleActivityEnname("bzshb",3,t.getOfficeId(),"12",t.getCreateBy());
+            if (users==null ) {
+                users = Lists.newArrayList();
+                //添加总审人员
+                auditUser = UserUtils.get(t.getBzshbUserId());
+                users.add(auditUser);
+            }
+                //users = UserUtils.getByRoleActivityEnname("bzshb",3,t.getOfficeId(),"12",t.getCreateBy());
         }else if ("bzshb".equals(taskDefKey)){
             users = UserUtils.getByProssType(t.getProcessInstanceId(),5);
-            if (users==null )
-                users = UserUtils.getByRoleActivityEnname("gzr",3,t.getOfficeId(),"12",t.getCreateBy());
+            if (users==null ) {
+                users = Lists.newArrayList();
+                //添加总审人员
+                auditUser = UserUtils.get(t.getBzshbUserId());
+                users.add(auditUser);
+            }
+            /*if (users==null )
+                users = UserUtils.getByRoleActivityEnname("gzr",3,t.getOfficeId(),"12",t.getCreateBy());/*users = UserUtils.getByRoleActivityEnname("gzr",3,t.getOfficeId(),"12",t.getCreateBy());
         }else if ("gzr".equals(taskDefKey)){
             users = UserUtils.getByProssType(t.getProcessInstanceId(),5);
             if (users==null )
-                users = UserUtils.getByRoleActivityEnname("gzr",3,t.getOfficeId(),"12",t.getCreateBy());
+                users = UserUtils.getByRoleActivityEnname("gzr",3,t.getOfficeId(),"12",t.getCreateBy());*/
         }else if ("modifyApply".equals(taskDefKey)){
             users = UserUtils.getByProssType(t.getProcessInstanceId(),1);
         }

+ 352 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectRecordChooseCheckController.java

@@ -0,0 +1,352 @@
+package com.jeeplus.modules.ruralprojectrecords.web;
+
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.MyBeanUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.act.entity.Act;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
+import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
+import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralPeojectRecordChooseCheckService;
+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 com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
+import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
+import jersey.repackaged.com.google.common.collect.Lists;
+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.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * @author: 徐滕
+ * @create: 2021-03-09 09:27
+ **/
+@Controller
+@RequestMapping(value = "${adminPath}/project/recordChooseCheck")
+public class RuralProjectRecordChooseCheckController extends BaseController {
+
+    @Autowired
+    private RuralPeojectRecordChooseCheckService service;
+    @Autowired
+    private RuralProjectRecordsService ruralProjectRecordsService;
+    @Autowired
+    private ProjectPlanService projectPlanService;
+    @Autowired
+    private ProjectReportDataService projectReportDataService;
+    @Autowired
+    private RuralProjectMessageService ruralProjectMessageService;
+    @Autowired
+    private ActTaskService actTaskService;
+    @Autowired
+    private UserService userService;
+
+
+    @ModelAttribute
+    public RuralProjectRecords get(@RequestParam(required=false) String id) {
+        RuralProjectRecords entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = service.get(id);
+        }
+        if (entity == null){
+            entity = new RuralProjectRecords();
+        }
+        return entity;
+    }
+
+    /**
+     * 项目列表页面
+     */
+    @RequiresPermissions("project:recordChooseCheck:list")
+    @RequestMapping(value = {"list", ""})
+    public String list(RuralProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if(UserUtils.isManager()){
+            model.addAttribute("flag","1");
+        }
+        List<String> typeList = Lists.newArrayList();
+        typeList.add("1");
+        typeList.add("2");
+        //添加查询类型list
+        projectRecords.setTypeList(typeList);
+        //获取项目信息
+        Page<RuralProjectRecords> page = service.findPage(new Page<RuralProjectRecords>(request, response), projectRecords);
+        //无合同状态下,获取委托方的名称
+        List<RuralProjectRecords> list = page.getList();
+        for (int i = 0; i < list.size(); i++) {
+            RuralProjectRecords records1 = list.get(i);
+            if (records1.getWorkContractInfo() == null) {
+                service.queryLinkmanInfos(records1);
+                if (records1.getWorkClientLinkmanList() != null && records1.getWorkClientLinkmanList().size() > 0) {
+                    WorkClientLinkman linkman = records1.getWorkClientLinkmanList().get(0);
+                    WorkContractInfo contractInfo = new WorkContractInfo();
+                    contractInfo.setClient(linkman.getClientId());
+                    records1.setWorkContractInfo(contractInfo);
+                }
+            }
+            //判断是否为admin
+            if (UserUtils.isManager()){
+                records1.setFlagAdmin("1");
+            }else{
+                records1.setFlagAdmin("0");
+            }
+        }
+        model.addAttribute("page", page);
+        return "modules/ruralprojectrecords/check/ruralProjectRecordsList";
+    }
+
+    /**
+     * 查看,增加,编辑项目表单页面
+     */
+    @RequiresPermissions(value={"ruralProject:ruralProjectRecords:add","ruralProject:ruralProjectRecords:edit"},logical=Logical.OR)
+    @RequestMapping(value = "form")
+    public String form(RuralProjectRecords projectRecords, Model model) {
+        if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
+            projectRecords = service.get(projectRecords.getId());
+            ruralProjectRecordsService.queryProjectDetail(projectRecords);
+            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);
+            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", "");
+                }
+            }
+        }
+        model.addAttribute("projectRecords", projectRecords);
+        return "modules/ruralprojectrecords/check/ruralProjectRecordsForm";
+    }
+
+    /**
+     * 保存项目
+     */
+    @RequiresPermissions(value={"project:recordChooseCheck:add","project:recordChooseCheck:edit"},logical= Logical.OR)
+    @RequestMapping(value = "save")
+    public String save(RuralProjectRecords projectRecords, RedirectAttributes redirectAttributes) throws Exception {
+        try {
+            RuralProjectRecords t = service.get(projectRecords.getId());//从数据库取出记录的值
+            if(t.getCheckStatus() == 3 || t.getCheckStatus() == 1) {
+                MyBeanUtils.copyBeanNotNull2Bean(projectRecords, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+                service.saveCheck(t, ProjectStatusEnum.IN_APRL);//保存
+            }else if(t.getCheckStatus() == 2){
+                addMessage(redirectAttributes, "选查项目已送审,无法重复送审");
+                return "redirect:"+ Global.getAdminPath()+"/project/recordChooseCheck/?repage";
+            }else if(t.getCheckStatus() == 5){
+                addMessage(redirectAttributes, "选查项目已登记完成,无法再次送审");
+                return "redirect:"+Global.getAdminPath()+"/project/recordChooseCheck/?repage";
+            } else {//新增表单保存
+                service.saveCheck(projectRecords, ProjectStatusEnum.IN_APRL);//保存
+            }
+            addMessage(redirectAttributes, "选查项目流程创建成功");
+        }catch (Exception e){
+            logger.error("项目检查流程创建异常:",e);
+            addMessage(redirectAttributes, "选查项目流程创建异常:"+e.getMessage());
+        }
+        return "redirect:"+Global.getAdminPath()+"/project/recordChooseCheck/?repage";
+    }
+
+    /**
+     * 检查流程审批
+     * @param projectRecords
+     * @param redirectAttributes
+     * @return
+     */
+    @RequestMapping("saveAudit")
+    public String saveAudit(RuralProjectRecords projectRecords,RedirectAttributes redirectAttributes) {
+        String home = projectRecords.getHome();
+        try {
+            String taskDefKey = projectRecords.getAct().getTaskDefKey();
+            //当状态为未通过时,重新修改数据
+            if ("modifyApply".equals(taskDefKey)) {
+                projectRecords.getAct().setComment("重新申请");
+            }
+            List<User> users = UserUtils.getByProssType(projectRecords.getCheckProcessInstanceId(),1);
+            if ("master".equals(taskDefKey)){
+                users = UserUtils.getByProssType(projectRecords.getCheckProcessInstanceId(),2);
+                if (users==null )
+                    users = UserUtils.getByRoleActivityEnname("bzshb",3,projectRecords.getOffice().getId(),"12",projectRecords.getCreateBy());
+            }else if ("bzshb".equals(taskDefKey)){
+                users = UserUtils.getByProssType(projectRecords.getCheckProcessInstanceId(),5);
+                if (users==null )
+                    users = UserUtils.getByRoleActivityEnname("xxgdydyhu",3,projectRecords.getOffice().getId(),"12",projectRecords.getCreateBy());
+            }else if ("bggdgly".equals(taskDefKey)){
+                users = UserUtils.getByProssType(projectRecords.getCheckProcessInstanceId(),5);
+                if (users==null )
+                    users = UserUtils.getByRoleActivityEnname("xxgdydyhu",3,projectRecords.getOffice().getId(),"12",projectRecords.getCreateBy());
+            }else if ("modifyApply".equals(taskDefKey)){
+                users = UserUtils.getByProssType(projectRecords.getCheckProcessInstanceId(),1);
+            }
+            String flag = projectRecords.getAct().getFlag();
+            if ("yes".equals(flag) && (users==null || users.size()==0)){
+                addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
+            }else {
+                RuralProjectRecords t = service.get(projectRecords.getId());//从数据库取出记录的值
+                /*if( t.getCheckStatus() != 4 && t.getCheckStatus() != 5){
+                    addMessage(redirectAttributes, "项目已送审,请勿重复送审");
+                    return "redirect:"+Global.getAdminPath()+"/project/recordChooseCheck/?repage";
+                }*/
+                if(t.getCheckStatus() == 5){
+                    addMessage(redirectAttributes, "选查项目已登记完成,无法再次送审");
+                    return "redirect:"+Global.getAdminPath()+"/project/recordChooseCheck/?repage";
+                }
+
+                String str = service.auditSave(projectRecords,users);
+                addMessage(redirectAttributes, str);
+            }
+        }catch (Exception e){
+            addMessage(redirectAttributes, "选查项目流程审批失败");
+        }
+
+        if (StringUtils.isNotBlank(home) && "home".equals(home)){
+            return "redirect:" + Global.getAdminPath() + "/home/?repage";
+        }else {
+            return "redirect:" + Global.getAdminPath() + "/project/recordChooseCheck/?repage";
+        }
+    }
+
+    /**
+     * 查询流程信息
+     * @param projectRecords
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "getProcess")
+    public String getProcess(RuralProjectRecords projectRecords, Model model){
+        projectRecords = service.get(projectRecords.getId());
+        model.addAttribute("processInstanceId", projectRecords.getCheckProcessInstanceId());
+        return "modules/ruralprojectrecords/ruralProjectRecordsTask";
+    }
+
+
+
+    /**
+     * 编辑项目表单页面
+     */
+    @RequiresPermissions(value={"project:recordChooseCheck:edit"},logical=Logical.OR)
+    @RequestMapping(value = "modify")
+    public String modify(RuralProjectRecords projectRecords, Model model, RedirectAttributes redirectAttributes) {
+        projectRecords=service.get(projectRecords.getId());
+        ProcessInstance processInstance = actTaskService.getProcIns(projectRecords.getCheckProcessInstanceId());
+        if (processInstance!=null) {
+            Task taskInfok = actTaskService.getCurrentTaskInfo(processInstance);
+            Act act = new Act();
+            act.setTaskId(taskInfok.getId());
+            act.setTaskName(taskInfok.getName());
+            act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
+            act.setProcDefId(taskInfok.getProcessDefinitionId());
+            act.setProcInsId(taskInfok.getProcessInstanceId());
+            act.setTask(taskInfok);
+            projectRecords.setAct(act);
+        }
+
+        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;
+                }
+            }
+        }
+        //查询总审人员信息
+        List<User> auditUserList = userService.getAuditUserList();
+        projectRecords.setBzshbUserList(auditUserList);
+        ruralProjectRecordsService.queryProjectDetail(projectRecords);
+        model.addAttribute("projectRecords", projectRecords);
+        return "modules/ruralprojectrecords/check/ruralProjectRecordsModify";
+    }
+
+
+    /**
+     * 撤回审批
+     * @param request
+     * @param redirectAttributes
+     * @return
+     */
+    @RequestMapping(value = "revoke")
+    public String revoke(HttpServletRequest request, RedirectAttributes redirectAttributes) {
+        HashMap<String, String> requestMap = findRequestMap(request);
+        String processInstanceId = requestMap.get("processInstanceId");
+        String id = requestMap.get("id");
+        //获取项目状态
+        Integer projectStatus = Integer.parseInt(requestMap.get("checkStatus"));
+        try {
+            RuralProjectRecords projectRecords = service.get(id);
+            if(projectRecords.getCheckStatus() != projectStatus){
+                addMessage(redirectAttributes, "选查项目不是送审状态,无法撤回");
+                return "redirect:"+Global.getAdminPath()+"/project/recordChooseCheck/?repage";
+            }
+            service.cancelProcess(projectRecords);
+            addMessage(redirectAttributes, "撤回该选查项目成功");
+        }catch (Exception e){
+            logger.info(e.getMessage());
+            addMessage(redirectAttributes, "撤回该选查项目失败");
+        }
+        return "redirect:" + Global.getAdminPath() + "/project/recordChooseCheck/?repage";
+    }
+
+
+    /**
+     * 删除项目
+     */
+    @RequiresPermissions("project:recordChooseCheck:del")
+    @RequestMapping(value = "delete")
+    public String delete(RuralProjectRecords projectRecords, RedirectAttributes redirectAttributes) {
+        int status = projectRecords.getCheckStatus();
+        if(status== ProjectStatusEnum.TSTORE.getValue()||status== ProjectStatusEnum.REJECTED.getValue()||status== ProjectStatusEnum.RECALL.getValue()){
+            service.delete(projectRecords);
+            addMessage(redirectAttributes, "删除项目选查流程成功");
+            return "redirect:"+Global.getAdminPath()+"/project/recordChooseCheck/?repage";
+        }else {
+            addMessage(redirectAttributes, "删除项目选查流程失败,只有“暂存”、“驳回”、“撤回”状态的流程才能删除");
+        }
+        return "redirect:"+Global.getAdminPath()+"/project/recordChooseCheck/?repage";
+    }
+}

+ 51 - 1
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectRecordsController.java

@@ -3,6 +3,8 @@
  */
 package com.jeeplus.modules.ruralprojectrecords.web;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.Lists;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.oss.OSSClientUtil;
@@ -21,6 +23,7 @@ import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
 import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
 import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
@@ -51,6 +54,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.io.File;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import java.util.*;
@@ -171,9 +175,16 @@ public class RuralProjectRecordsController extends BaseController {
 			List<WorkClientAttachment> projectPlanAttachment = projectPlanService.getWorkAttachment(projectRecords.getId());
 			projectRecords.setProjectPlanList(projectPlanList);
 			projectRecords.setWorkAttachments(projectPlanAttachment);
+			List<MainDictDetail> mainDictList = Lists.newArrayList();
+			//工程咨询
+			if("1".equals(projectRecords.getProjectType())){
+				mainDictList = DictUtils.getMainDictList("attachment_project_sort");
+				//造价审核
+			} else if("2".equals(projectRecords.getProjectType())){
+				mainDictList = DictUtils.getMainDictList("attachment_project_sort_cost");
+			}
 			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());
@@ -377,6 +388,24 @@ public class RuralProjectRecordsController extends BaseController {
 		addMessage(redirectAttributes, "删除项目成功");
 		return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
 	}
+
+	/**
+	 * 项目相应文件批量下载并压缩
+	 */
+	@RequiresPermissions("ruralProject:ruralProjectRecords:del")
+	@RequestMapping(value = "exportAll")
+	public String exportAll(HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+		String listIds = request.getParameter("listId");
+		List<String> idList = Arrays.asList(listIds.split(","));
+		try {
+			String filePath = projectRecordsService.exportAll(idList);
+			projectRecordsService.downloadZipFile(filePath,response);
+			return null;
+		} catch (Exception e) {
+			addMessage(redirectAttributes, "批量下载项目文件失败!");
+		}
+		return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
+	}
 	
 	/**
 	 * 导出excel文件
@@ -862,4 +891,25 @@ public class RuralProjectRecordsController extends BaseController {
 		model.addAttribute("page", page);
 		return "modules/ruralprojectrecords/ruralProjectRecordsShowFinishList";
 	}
+
+
+	/**
+	 * 文件上传
+	 * @param projectRecords
+	 * @param model
+	 * @return
+	 */
+	@RequiresPermissions(value={"ruralProject:ruralProjectRecords:accessory","ruralProject:ruralProjectRecords:adminAccessory"},logical=Logical.OR)
+	@RequestMapping(value = "formAccessory")
+	public String formAccessory(RuralProjectRecords projectRecords, Model model) {
+		if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
+			projectRecords = projectRecordsService.getQueryProjectUsers(projectRecords.getId());
+			RuralProjectcontentinfo ruralProjectcontentinfo = projectRecordsService.formAccessory(projectRecords);
+			model.addAttribute("projectcontentinfo", ruralProjectcontentinfo);
+			model.addAttribute("projectRecords", projectRecords);
+		}else {
+			return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
+		}
+		return "modules/ruralprojectrecords/projectAccessoryForm";
+	}
 }

+ 102 - 0
src/main/java/com/jeeplus/modules/utils/SftpClientUtil.java

@@ -1,12 +1,15 @@
 package com.jeeplus.modules.utils;
 
 import java.io.*;
+import java.net.URLDecoder;
 import java.net.URLEncoder;
 import java.util.*;
 
 import com.jcraft.jsch.*;
+import com.jeeplus.common.bos.BOSClientUtil;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.utils.StringUtils;
+import org.apache.commons.fileupload.util.Streams;
 import org.apache.log4j.Logger;
 import org.springframework.mock.web.MockMultipartFile;
 import org.springframework.web.multipart.MultipartFile;
@@ -31,6 +34,8 @@ public class SftpClientUtil {
     private final static String password = Global.getConfig("remoteServer.password");
     /** 目录 */
     private final static String directory = Global.getConfig("remoteServer.directory");
+    /** 文件存储方式(0:本地服务器存储。1:云端存储) */
+    private final static String uploadMode = Global.getConfig("remoteServer.uploadMode");
 
 
     /**
@@ -298,6 +303,103 @@ public class SftpClientUtil {
         return null;
     }
 
+    /**
+     * 下载文件
+     *
+     * @param directory     SFTP服务器的文件路径
+     * @param downloadFile  SFTP服务器上的文件名
+     * @return              字节数组
+     */
+    public byte[] downloadRuralProject(String directory, String downloadFile,String downLoadFilePath,String finalFileName) throws IOException {
+        File dirFile = new File(downLoadFilePath);
+        if (!dirFile.exists()) {
+            dirFile.mkdirs();
+        }
+        if("1".equals(uploadMode)){
+            OutputStream out = null;
+            InputStream in = null;
+            FileOutputStream fileOut = null;
+            String fileNamePath = directory +"/" + downloadFile;
+            try {
+                fileNamePath = URLDecoder.decode(fileNamePath,"UTF-8");
+                String path = fileNamePath.substring(fileNamePath.indexOf(".com") + 4, fileNamePath.length());
+                String fileName = URLEncoder.encode(fileNamePath.substring(fileNamePath.lastIndexOf("/") + 1, fileNamePath.length()),"UTF-8");
+                BOSClientUtil bosClientUtil = new BOSClientUtil();
+                in = bosClientUtil.getObject(path);
+
+                BufferedInputStream bis = new BufferedInputStream(in);
+                //判断文件的保存路径后面是否以/结尾
+                if (!downLoadFilePath.endsWith("/")) {
+                    downLoadFilePath += "/";
+                }
+                //写入到文件(注意文件保存路径的后面一定要加上文件的名称)
+                fileOut = new FileOutputStream(downLoadFilePath + downloadFile);
+                BufferedOutputStream bos = new BufferedOutputStream(fileOut);
+                byte[] buf = new byte[4096];
+                int length = bis.read(buf);
+                //保存文件
+                while(length != -1)
+                {
+                    bos.write(buf, 0, length);
+                    length = bis.read(buf);
+                }
+                bos.close();
+                fileOut.close();
+            }catch (IOException e){
+                e.printStackTrace();
+            }finally {
+                if (out != null) {
+                    out.close();
+                }
+                if (in != null) {
+                    in.close();
+                }
+            }
+        }else{
+            try{
+                String path = directory.substring(directory.indexOf("=")+1, directory.length());
+                if(StringUtils.isNotBlank(host) && ("127.0.0.1".equals(host) || "localhost".equals(host))){
+                    String wPath = path+"/"+downloadFile;
+                    File fileurl = new File(wPath);
+                    //将文件读入文件流
+                    InputStream inStream = new FileInputStream(fileurl);
+
+                    File file = new File(downLoadFilePath,finalFileName);
+                    //将下载保存到文件。
+                    FileOutputStream out = new FileOutputStream(file);
+                    Streams.copy(inStream, out, true);
+                }else{
+                    ChannelSftp sftp = connect();
+                    if(path != null && !"".equals(path)){
+                        sftp.cd(path);
+                    }
+                    InputStream inputStream = sftp.get(downloadFile);
+
+                    BufferedInputStream bis = new BufferedInputStream(inputStream);
+                    //写入到文件(注意文件保存路径的后面一定要加上文件的名称)
+                    FileOutputStream  fileOut = new FileOutputStream(downLoadFilePath + "/" + finalFileName);
+                    BufferedOutputStream bos = new BufferedOutputStream(fileOut);
+
+                    byte[] buf = new byte[4096];
+                    int length = bis.read(buf);
+                    //保存文件
+                    while(length != -1)
+                    {
+                        bos.write(buf, 0, length);
+                        length = bis.read(buf);
+                    }
+                    bos.close();
+                    bis.close();
+                }
+            }catch (SftpException | IOException e){
+                logger.error("文件下载异常!", e);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
+
 
     /**
      * File转MultipartFile

+ 198 - 0
src/main/java/com/jeeplus/modules/utils/ZipCompressUtil.java

@@ -0,0 +1,198 @@
+package com.jeeplus.modules.utils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.apache.tools.zip.ZipEntry;
+import org.apache.tools.zip.ZipOutputStream;
+/**
+ *
+ * 文件压缩成zip
+ *
+ */
+public class ZipCompressUtil {
+
+    /**
+     *
+     * 将文件夹及文件夹包含的内容压缩成zip文件
+     * (为了解决中文乱码的问题,ZipOutputStream用org.apache.tools.zip.*)
+     *
+     * @param inputFile 源文件
+     * @param delFlag 删除源文件标记
+     * @return File 压缩后的文件
+     */
+    public File zipCompress(File inputFile, boolean delFlag) throws Exception{
+        File zipFile = null;
+        //创建zip输出流
+        //为了解决中文乱码的问题,ZipOutputStream用org.apache.tools.zip.*
+        //不要用 java.util.zip.*
+        ZipOutputStream zos = null;
+        if(inputFile != null && inputFile.exists()) {
+            try {
+                String path = inputFile.getCanonicalPath();
+                String zipFileName = path + ".zip";
+                zipFile = new File(zipFileName);
+                if(zipFile.exists()) {
+                    zipFile.delete();
+                }
+                zipFile.createNewFile();//创建文件
+                zos = new ZipOutputStream(new FileOutputStream(zipFile));
+                //解决中文乱码问题,指定编码GBK
+                zos.setEncoding("GBK");
+                //压缩文件或文件夹
+                this.compressFile(zos, inputFile, inputFile.getName());
+            }catch(Exception e) {
+                System.out.println("文件压缩异常:" + e);
+                throw e;
+            }finally {
+                try {
+                    if(zos != null) {
+                        //先调用outputStream的flush()再关闭流;
+                        //流如果未正常关闭,则会在解压的时候出现压缩文件损坏的现象
+                        zos.flush();
+                        zos.close();
+                    }
+
+                    if(delFlag) {
+                        //递归删除源文件及源文件夹
+                        this.deleteFile(inputFile);
+                    }
+                }catch(Exception ex) {
+                    System.out.println("输出流关闭异常:" + ex);
+                }
+            }
+        }
+
+        return zipFile;
+    }
+
+    /**
+     * 压缩文件或文件夹
+     * (ZipEntry 使用org.apache.tools.zip.*,不要用 java.util.zip.*)
+     *
+     * @param zos zip输出流
+     * @param sourceFile 源文件
+     * @param baseName 父路径
+     * @throws Exception 异常
+     */
+    private void compressFile(ZipOutputStream zos, File sourceFile, String baseName) throws Exception{
+        if(!sourceFile.exists()) {
+            return;
+        }
+
+        //若路径为目录(文件夹)
+        if(sourceFile.isDirectory()) {
+            //取出文件夹中的文件(或子文件夹)
+            File[] fileList = sourceFile.listFiles();
+            //若文件夹为空,则创建一个目录进入点
+            if(fileList.length == 0) {
+                //文件名称后跟File.separator表示这是一个文件夹
+                zos.putNextEntry(new ZipEntry(baseName + File.separator));
+                //若文件夹非空,则递归调用compressFile,对文件夹中的每个文件或每个文件夹进行压缩
+            }else {
+                for(int i = 0; i < fileList.length; i++) {
+                    this.compressFile(zos, fileList[i],
+                            baseName + File.separator + fileList[i].getName());
+                }
+            }
+
+            //若为文件,则先创建目录进入点,再将文件写入zip文件中
+        }else {
+            ZipEntry ze = new ZipEntry(baseName);
+            //设置ZipEntry的最后修改时间为源文件的最后修改时间
+            ze.setTime(sourceFile.lastModified());
+            zos.putNextEntry(ze);
+
+            FileInputStream fis = new FileInputStream(sourceFile);
+            this.copyStream(fis, zos);
+            try {
+                if(fis != null) {
+                    fis.close();
+                }
+            }catch(Exception e) {
+                System.out.println("输入流关闭异常:" + e);
+            }
+        }
+    }
+
+    /**
+     * 流拷贝
+     *
+     * @param in 输入流
+     * @param out 输出流
+     * @throws IOException
+     */
+    private void copyStream(InputStream in, OutputStream out) throws IOException{
+        int bufferLength = 1024 * 100;
+        synchronized(in) {
+            synchronized(out) {
+                int count = 0;
+                byte[] buffer = new byte[bufferLength];
+                while((count = in.read(buffer, 0, bufferLength)) != -1) {
+                    out.write(buffer, 0, count);
+                }
+                out.flush();
+            }
+        }
+    }
+
+    /**
+     * 递归删除文件夹中的目录及文件
+     *
+     * @param sourceFile
+     * @throws Exception
+     */
+    private void deleteFile(File sourceFile) throws Exception{
+        //如果路径为目录
+        if(sourceFile.isDirectory()) {
+            //取出文件夹中的文件或子文件夹
+            File[] fList = sourceFile.listFiles();
+            if(fList.length == 0) {
+                sourceFile.delete();
+            }else {
+                for(int i = 0; i < fList.length; i++) {
+                    this.deleteFile(fList[i]);
+                }
+                sourceFile.delete();
+            }
+            //如果为文件则直接删除
+        }else {
+            sourceFile.delete();
+        }
+    }
+
+    /**
+     *     当前路径下若已有同名文件又不愿意覆盖,
+     *     则依次追加后缀
+     *
+     * @param path
+     * @param docName
+     * @return
+     * @throws Exception
+     */
+    private File createFile(String path, final String docName) throws Exception{
+        //创建目标文件
+        File destFile = new File(path, docName);
+        //如果路径下存在同名文件又不愿意覆盖,
+        //那么则依次给文件加后缀(2)、(3)……
+        if(destFile.exists()) {
+            int i = 1;
+            do {
+                ++i;
+                //按“.”分割
+                String[] doc = docName.split("\\.");
+                destFile = new File(path, doc[0] + "(" + i + ")" + "." + doc[1]);
+
+                //直到文件创建成功则跳出循环
+            }while(!destFile.createNewFile());
+        }else {
+            destFile.createNewFile();
+        }
+        return destFile;
+    }
+}
+

+ 53 - 5
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -359,12 +359,12 @@ public class WorkProjectNotifyController extends BaseController {
 	protected HistoryService historyService;
 	@Autowired
 	protected WorkInvoiceDetailService workInvoiceDetailService;
+    @Autowired
+    private ProjectRecordsService projectRecordsService;
+    @Autowired
+    private RuralProjectRecordsService ruralProjectRecordsService;
 	@Autowired
-	private ProjectRecordsService projectRecordsService;
-	@Autowired
-	private ProjectFilingBatchService projectFilingBatchService;
-	@Autowired
-	private RuralProjectRecordsService ruralProjectRecordsService;
+	private RuralPeojectRecordChooseCheckService ruralPeojectRecordChooseCheckService;
 	@Autowired
 	private ProjectRecordsAlterService projectRecordsAlterService;
 	@Autowired
@@ -453,6 +453,12 @@ public class WorkProjectNotifyController extends BaseController {
 	private HistoicFlowUtil histoicFlowUtil;
 	@Autowired
 	private ProjectAccessoryRelationService projectAccessoryRelationService;
+	@Autowired
+	private UserService userService;
+	@Autowired
+	private RoleDao roleDao;
+	@Autowired
+	private RoleService roleService;
 
 	@ModelAttribute
 	public WorkProjectNotify get(@RequestParam(required=false) String id) {
@@ -1346,6 +1352,48 @@ public class WorkProjectNotifyController extends BaseController {
 						}
 					}
 
+				} else if (workProjectNotify.getType().equals("140")) {    //项目检查
+					boolean flag = false;
+					//通过通知信息id获取项目登记对象
+					RuralProjectRecords ruralProjectRecords = ruralPeojectRecordChooseCheckService.get(workProjectNotify.getNotifyId());
+
+					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.setAct(getByAct(ruralProjectRecords.getCheckProcessInstanceId()));
+					ruralProjectRecords.setHome("home");
+					model.addAttribute("processInstanceId", ruralProjectRecords.getCheckProcessInstanceId());
+					model.addAttribute("projectRecords", ruralProjectRecords);
+					//处理项目类别
+					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/ruralprojectrecords/ruralProjectRecordsView";
+					}else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
+						return "modules/ruralprojectrecords/check/ruralProjectRecordsAudit";
+					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
+						return "modules/ruralprojectrecords/check/ruralProjectRecordsModify";
+					} else {
+						return "modules/ruralprojectrecords/ruralProjectRecordsView";
+					}
+
+
 				} else if (workProjectNotify.getType().equals("139")) {    //项目登记
 					ProjectFollowReport followReport = projectImplementEarlyService.getFollowById(workProjectNotify.getNotifyId());
 					ProjectRecords records = projectRecordsService.getQueryProjectUsers(followReport.getProjectId());

+ 16 - 9
src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementService.java

@@ -336,7 +336,7 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
         //财务主任
         List<User> cws = UserUtils.getByRoleActivityEnname("cwzg",3,office.getId(),"8",workReimbursement.getCreateBy());
         //总经理
-        List<User> zjls = UserUtils.getByRoleActivityEnname("zjl",3,office.getId(),"8",workReimbursement.getCreateBy());
+        //List<User> zjls = UserUtils.getByRoleActivityEnname("zjl",3,office.getId(),"8",workReimbursement.getCreateBy());
         //财务分管领导
         //List<User> cwzjs = UserUtils.getByRoleActivityEnname("cwfgld",3,office.getId(),"8",workReimbursement.getCreateBy());
         //出纳
@@ -476,9 +476,9 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
             workActivityProcessService.save(workActivityProcess);
             workActivityProcess.setCount(2);
             workActivityProcess.setId("");
-            workActivityProcessService.save(workActivityProcess);
+            /*workActivityProcessService.save(workActivityProcess);
             workActivityProcess.setCount(3);
-            workActivityProcess.setId("");
+            workActivityProcess.setId("");*/
             /*workActivityProcessService.save(workActivityProcess);
             workActivityProcess.setCount(4);
             workActivityProcess.setId("");
@@ -492,7 +492,7 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
             workActivityProcessService.insertAuditsByType(bmzrs,processInstance.getId(),1,1);
             //workActivityProcessService.insertAuditsByType(fglds,processInstance.getId(),2,0);
             workActivityProcessService.insertAuditsByType(cws,processInstance.getId(),2,0);
-            workActivityProcessService.insertAuditsByType(zjls,processInstance.getId(),3,0);
+            //workActivityProcessService.insertAuditsByType(zjls,processInstance.getId(),3,0);
             //workActivityProcessService.insertAuditsByType(cwzjs,processInstance.getId(),5,0);
             //workActivityProcessService.insertAuditsByType(cns,processInstance.getId(),6,0);
         }
@@ -823,6 +823,13 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                     taskCount = "2";
                     exp = "pass";
                     if ("yes".equals(workReimbursement.getAct().getFlag())) {
+                        notifyRole = "审批通过";
+                        workActivityProcess.setIsApproval("1");
+                    } else {
+                        notifyRole = "调整报销";
+                        workActivityProcess.setIsApproval("2");
+                    }
+                   /* if ("yes".equals(workReimbursement.getAct().getFlag())) {
                         workActivityProcessService.insertAuditsByType(auditUsers,workReimbursement.getProcessInstanceId(),4,1);
                         notifyRole = "总经理审核";
                         workActivityProcess.setIsApproval("1");
@@ -832,12 +839,12 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                     } else {
                         notifyRole = "调整报销";
                         workActivityProcess.setIsApproval("2");
-                    }
+                    }*/
                     break;
-                } else if ("zjl".equals(taskDefKey) && count.contains("3")) {
+                } /*else if ("zjl".equals(taskDefKey) && count.contains("3")) {
                     taskCount = "3";
                     exp = "pass";
-                    /*if ("yes".equals(workReimbursement.getAct().getFlag())) {
+                    *//*if ("yes".equals(workReimbursement.getAct().getFlag())) {
                         notifyRole = "财务分管领导审核";
                         workActivityProcessService.insertAuditsByType(auditUsers,workReimbursement.getProcessInstanceId(),5,1);
 
@@ -848,7 +855,7 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                     } else {
                         workActivityProcess.setIsApproval("2");
                         notifyRole = "调整报销";
-                    }*/
+                    }*//*
                     if ("yes".equals(workReimbursement.getAct().getFlag())) {
                         notifyRole = "审批通过";
                         workActivityProcess.setIsApproval("1");
@@ -857,7 +864,7 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
                         workActivityProcess.setIsApproval("2");
                     }
                     break;
-                } /*else if ("cwzj".equals(taskDefKey) && count.contains("5")) {
+                }*/ /*else if ("cwzj".equals(taskDefKey) && count.contains("5")) {
                     taskCount = "5";
                     exp = "pass";
                     if ("yes".equals(workReimbursement.getAct().getFlag())) {

+ 6 - 5
src/main/java/com/jeeplus/modules/workreimbursement/web/WorkReimbursementController.java

@@ -346,13 +346,14 @@ public class WorkReimbursementController extends BaseController {
 			}*/else  if ("cw".equals(taskDefKey)){
 				users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),3);
 				if (users==null )
-				users = UserUtils.getByRoleActivityEnname("zjl",3,workReimbursement.getOfficeId(),"8",workReimbursement.getCreateBy());
-			}else  if ("zjl".equals(taskDefKey)){
-				/*users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),5);
+					users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),1);
+				//users = UserUtils.getByRoleActivityEnname("zjl",3,workReimbursement.getOfficeId(),"8",workReimbursement.getCreateBy());
+			}/*else  if ("zjl".equals(taskDefKey)){
+				*//*users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),5);
 				if (users==null )
-					users = UserUtils.getByRoleActivityEnname("cwfgld",3,workReimbursement.getOfficeId(),"8",workReimbursement.getCreateBy());*/
+					users = UserUtils.getByRoleActivityEnname("cwfgld",3,workReimbursement.getOfficeId(),"8",workReimbursement.getCreateBy());*//*
 				users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),1);
-			}/*else if ("cwzj".equals(taskDefKey)){
+			}*//*else if ("cwzj".equals(taskDefKey)){
 				users = UserUtils.getByProssType(workReimbursement.getProcessInstanceId(),6);
 				if (users==null )
 					users = UserUtils.getByRoleActivityEnname("cn",3,workReimbursement.getOfficeId(),"8",workReimbursement.getCreateBy());

+ 2 - 2
src/main/resources/jeeplus.properties

@@ -261,7 +261,7 @@ linuxPath = /simple/
 
 #\u6587\u4EF6\u4E0A\u4F20\u670D\u52A1\u5668\u4FE1\u606F
 #\u4E3B\u673A
-remoteServer.host = 192.168.2.4
+remoteServer.host = 127.0.0.1
 #\u7AEF\u53E3
 remoteServer.port = 22
 #\u7528\u6237\u540D
@@ -275,7 +275,7 @@ remoteServer.winDirectory =d:/attachment-file
 
 
 #\u6587\u4EF6\u5B58\u50A8\u65B9\u5F0F\uFF080\uFF1A\u672C\u5730\u670D\u52A1\u5668\u5B58\u50A8\u30021\uFF1A\u4E91\u7AEF\u5B58\u50A8\uFF09
-remoteServer.uploadMode =0
+remoteServer.uploadMode =1
 
 #\u6587\u4EF6\u670D\u52A1\u5668IP\u5730\u5740
 remoteServer.visit =

+ 8 - 3
src/main/resources/mappings/modules/projectAccessory/ProjectAccessoryRelationDao.xml

@@ -44,9 +44,14 @@
 			<if test="attachmentProjectSort!=null and attachmentProjectSort != ''">
 				and a.attachment_project_sort = #{attachmentProjectSort}
 			</if>
-			<if test="attachmentProjectApprovalMoney!=null and attachmentProjectApprovalMoney != ''">
-				and a.attachment_project_approval_money = #{attachmentProjectApprovalMoney}
-			</if>
+			<choose>
+				<when test="attachmentProjectApprovalMoney!=null and attachmentProjectApprovalMoney!=''">
+					and a.attachment_project_approval_money = #{attachmentProjectApprovalMoney}
+				</when>
+				<otherwise>
+					and a.attachment_project_approval_money is null
+				</otherwise>
+			</choose>
 		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">

+ 8 - 3
src/main/resources/mappings/modules/projectAccessory/ProjectTemplateDao.xml

@@ -282,9 +282,14 @@
 			<if test="attachmentProjectSort != null and attachmentProjectSort!=''">
 				and b.attachment_project_sort = #{attachmentProjectSort}
 			</if>
-			<if test="attachmentProjectApprovalMoney != null and attachmentProjectApprovalMoney!=''">
-				and b.attachment_project_approval_money = #{attachmentProjectApprovalMoney}
-			</if>
+			<choose>
+				<when test="attachmentProjectApprovalMoney!=null and attachmentProjectApprovalMoney!=''">
+					and b.attachment_project_approval_money = #{attachmentProjectApprovalMoney}
+				</when>
+				<otherwise>
+					and b.attachment_project_approval_money is null
+				</otherwise>
+			</choose>
 		</where>
 
 		<choose>

+ 9 - 5
src/main/resources/mappings/modules/projectcontentinfo/ProjectReportDataDao.xml

@@ -52,6 +52,7 @@
 	<select id="get" resultType="ProjectReportData" >
 		SELECT
 			<include refid="projectReportDataColumns"/>
+			,a.bzshb_user_id as "bzshbUserId"
 		FROM project_report_data a
 		<include refid="projectReportDataJoins"/>
 		WHERE a.id = #{id}
@@ -532,7 +533,8 @@
 		    building_fee,
 		    install_fee,
 		    building_rate,
-		    install_rate
+		    install_rate,
+		    bzshb_user_id
 		) VALUES (
 			#{id},
 			#{createBy.id},
@@ -568,7 +570,8 @@
 			#{buildingFee},
 			#{installFee},
 			#{buildingRate},
-			#{installRate}
+			#{installRate},
+			#{bzshbUserId}
 		)
 	</insert>
 	
@@ -829,10 +832,11 @@
 	</select>
 
 	<select id="getProjectReportData" resultType="com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData">
-		select a.id,a.name,a.number,a.type as pid,a.report_type as reportType,
-		a.review_standard as reviewStandard,a.achievement_type as achievementType,
-		a.create_date as createDate,a.status as fileStatus,a.create_by as createBy
+		select
+		<include refid="projectReportDataColumns"/>
+		,a.bzshb_user_id as "bzshbUserId"
 		from project_report_data a
+		LEFT JOIN sys_user m ON m.id = a.master
 		where a.del_flag = 0 AND a.project_id = #{projectId}
 		limit 1
 	</select>

+ 369 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralPeojectRecordChooseCheckDao.xml

@@ -0,0 +1,369 @@
+<?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.RuralPeojectRecordChooseCheckDao">
+
+    <sql id="projectRecordsColumns">
+		distinct a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.del_flag AS "delFlag",
+		a.contract_id AS "workContractInfo.id",
+		a.project_id AS "projectId",
+		a.project_name AS "projectName",
+		a.scale_type AS "scaleType",
+		a.scale_unit AS "scaleUnit",
+		a.scale_quantity AS "scaleQuantity",
+		a.area_id AS "area.id",
+		a.project_site AS "projectSite",
+		a.project_desc AS "projectDesc",
+		a.remarks AS "remarks",
+		a.status AS "projectStatus",
+		a.process_instance_id AS "processInstanceId",
+		a.company_id AS "company.id",
+		a.office_id AS "office.id",
+		a.alter_process_id AS "alterProcessId",
+		area.name AS "area.name",
+		a.province,
+		a.city,
+		a.area_name AS "county",
+		a.project_structure AS "projectStructure",
+		a.on_ground_num AS "onGroundNum",
+		a.under_ground_num AS "underGroundNum",
+		a.building_scale AS "buildingScale",
+		a.measuring_unit AS "measuringUnit",
+		a.project_use AS "projectUse",
+		a.install_fees AS "installFees",
+		a.building_fees AS "buildingFees",
+		a.building_percent AS "buildingPercent",
+		a.install_percent AS "installPercent",
+		a.unit_fees AS "unitFees",
+		a.building_unit_fees AS "buildingUnitFees",
+		a.install_unit_fees AS "installUnitFees",
+		a.total_fees AS "totalFees",
+		a.start_date AS "startDate",
+		a.ending_date AS "endingDate",
+		a.estimate_total_fees AS "estimateTotalFees",
+		a.construction_unit as "constructionUnit",
+		a.construction_linkman as "constructionLinkman",
+		a.project_type as "projectType",
+		a.over_due_status as "overDueStatus",
+		a.attachment_project_sort as "attachmentProjectSort",
+		a.bzshb_user_id as "bzshbUserId"
+	</sql>
+
+    <sql id="projectRecordsJoins">
+		LEFT JOIN sys_area area ON area.id = a.area_id
+	</sql>
+
+    <select id="get" resultType="RuralProjectRecords" >
+        SELECT
+        <include refid="projectRecordsColumns"/>
+        ,a.check_user_id as "checkUserId"
+        ,ifnull(a.check_status ,0) as "checkStatus"
+        ,a.check_process_instance_id AS "checkProcessInstanceId"
+        ,su.name AS "createBy.name"
+        ,o.top_company AS "office.name"
+        FROM rural_project_records a
+        <include refid="projectRecordsJoins"/>
+        LEFT JOIN sys_user su ON su.id = a.create_by
+        LEFT JOIN sys_office o ON o.id = a.office_id
+        WHERE a.id = #{id}
+    </select>
+
+    <select id="findList" resultType="RuralProjectRecords" >
+        SELECT
+        <include refid="projectRecordsColumns"/>
+        ,a.check_user_id as "checkUserId"
+        ,ifnull(a.check_status ,0) as "checkStatus"
+        ,a.check_process_instance_id AS "checkProcessInstanceId"
+        ,wci.name AS "workContractInfo.name",
+        wct.id AS "workContractInfo.client.id",
+        wct.name AS "workContractInfo.client.name",
+        o.top_company AS "office.name"
+        FROM rural_project_records a
+        <include refid="projectRecordsJoins"/>
+
+        <if test="leaderNameStr !=null and leaderNameStr !=''">
+            LEFT JOIN work_project_user w on a.id = w.project_id
+            LEFT JOIN sys_user su on w.user_id = su.id
+        </if>
+        LEFT JOIN work_project_user w1 on a.id = w1.project_id
+        LEFT JOIN work_contract_info wci on a.contract_id = wci.id
+        LEFT JOIN work_client_info wct on wci.client_id = wct.id
+        LEFT JOIN sys_office o ON o.id = a.office_id
+        <where>
+            a.del_flag = 0
+            and a.status = 5
+            <if test="projectId != null and projectId != ''">
+                AND a.project_id like concat('%',#{projectId},'%')
+            </if>
+            <if test="projectName != null and projectName != ''">
+                AND a.project_name like concat(concat('%',#{projectName}),'%')
+            </if>
+            <if test="scaleType != null and scaleType != ''">
+                AND a.scale_type = #{scaleType}
+            </if>
+            <if test="scaleUnit != null and scaleUnit != ''">
+                AND a.scale_unit = #{scaleUnit}
+            </if>
+            <if test="scaleQuantity != null and scaleQuantity != ''">
+                AND a.scale_quantity = #{scaleQuantity}
+            </if>
+            <if test="projectSite != null and projectSite != ''">
+                AND a.project_site LIKE concat('%',#{projectSite},'%')
+            </if>
+            <if test="remarks != null and remarks != ''">
+                AND a.remarks LIKE concat('%',#{remarks},'%')
+            </if>
+            <if test="projectDesc != null and projectDesc != ''">
+                AND a.project_desc LIKE concat('%',#{projectDesc},'%')
+            </if>
+            <if test="area != null and area.id != null and area.id != ''">
+                AND a.area_id = #{area.id}
+            </if>
+            <if test="workContractInfo !=null and workContractInfo.name !=null and workContractInfo.name !=''">
+                AND wci.name like concat(concat('%',#{workContractInfo.name}),'%')
+            </if>
+            <if test="workContractInfo !=null and workContractInfo.contractNum !=null and workContractInfo.contractNum !=''">
+                AND wci.contract_num like concat(concat('%',#{workContractInfo.contractNum}),'%')
+            </if>
+            <if test="workContractInfo !=null and workContractInfo.contractPrice !=null and workContractInfo.contractPrice !=''">
+                AND wci.contract_price = #{workContractInfo.contractPrice}
+            </if>
+            <if test="workContractInfo !=null and workContractInfo.contractType !=null and workContractInfo.contractType !=''">
+                AND wci.contract_type = #{workContractInfo.contractType}
+            </if>
+            <if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
+                AND wct.name like concat(concat('%',#{workContractInfo.client.name}),'%')
+            </if>
+            <if test="leaderNameStr !=null and leaderNameStr !=''">
+                AND su.name like concat(concat('%',#{leaderNameStr}),'%') AND w.is_master = '1' AND w.del_flag='0'
+            </if>
+            <if test="checkStatus !=null">
+                <choose>
+                    <when test="checkStatus == 0">
+                        AND a.check_status is null
+                    </when>
+                    <otherwise>
+                        AND a.check_status = #{checkStatus}
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="beginDate !=null">
+                AND a.create_date >= #{beginDate}
+            </if>
+            <if test="endDate !=null">
+                AND a.create_date &lt; #{endDate}
+            </if>
+            <if test="typeList !=null and typeList !=''">
+                and project_type in
+                <foreach collection="typeList" item="id" index="index" open="(" close=")" separator=",">
+                    #{id}
+                </foreach>
+            </if>
+
+            <if test="sqlMap.delFlag !=null and sqlMap.delFlag!=''">
+                ${sqlMap.delFlag}
+            </if>
+            <if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
+                AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND a.company_id = #{currentUser.company.id} )${sqlMap.dsf} )
+            </if>
+        </where>
+        GROUP BY a.id
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+                ORDER BY a.update_date DESC
+            </otherwise>
+        </choose>
+    </select>
+
+    <select id="queryCount" resultType="int" >
+        SELECT count(DISTINCT a.id)
+        FROM rural_project_records a
+        <if test="leaderNameStr !=null and leaderNameStr !=''">
+            LEFT JOIN work_project_user w on a.id = w.project_id
+            LEFT JOIN sys_user su on w.user_id = su.id
+        </if>
+        LEFT JOIN work_project_user w1 on a.id = w1.project_id
+        <if test="workContractInfo !=null">
+            LEFT JOIN work_contract_info wci on a.contract_id = wci.id
+        </if>
+        <if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
+            LEFT JOIN work_client_info wct on wci.client_id = wct.id
+        </if>
+        <where>
+            a.del_flag = 0
+            and a.status = 5
+            <if test="checkStatus !=null">
+                <choose>
+                    <when test="checkStatus == 0">
+                        AND a.check_status is null
+                    </when>
+                    <otherwise>
+                        AND a.check_status = #{checkStatus}
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="projectId != null and projectId != ''">
+                AND a.project_id like concat('%',#{projectId},'%')
+            </if>
+            <if test="projectName != null and projectName != ''">
+                AND a.project_name like concat(concat('%',#{projectName}),'%')
+            </if>
+            <if test="scaleType != null and scaleType != ''">
+                AND a.scale_type = #{scaleType}
+            </if>
+            <if test="scaleUnit != null and scaleUnit != ''">
+                AND a.scale_unit = #{scaleUnit}
+            </if>
+            <if test="scaleQuantity != null and scaleQuantity != ''">
+                AND a.scale_quantity = #{scaleQuantity}
+            </if>
+            <if test="projectSite != null and projectSite != ''">
+                AND a.project_site LIKE concat('%',#{projectSite},'%')
+            </if>
+            <if test="remarks != null and remarks != ''">
+                AND a.remarks LIKE concat('%',#{remarks},'%')
+            </if>
+            <if test="projectDesc != null and projectDesc != ''">
+                AND a.project_desc LIKE concat('%',#{projectDesc},'%')
+            </if>
+            <if test="area != null and area.id != null and area.id != ''">
+                AND a.area_id = #{area.id}
+            </if>
+            <if test="workContractInfo !=null and workContractInfo.name !=null and workContractInfo.name !=''">
+                AND wci.name like concat(concat('%',#{workContractInfo.name}),'%')
+            </if>
+            <if test="workContractInfo !=null and workContractInfo.contractNum !=null and workContractInfo.contractNum !=''">
+                AND wci.contract_num like concat(concat('%',#{workContractInfo.contractNum}),'%')
+            </if>
+            <if test="workContractInfo !=null and workContractInfo.contractPrice !=null and workContractInfo.contractPrice !=''">
+                AND wci.contract_price = #{workContractInfo.contractPrice}
+            </if>
+            <if test="workContractInfo !=null and workContractInfo.contractType !=null and workContractInfo.contractType !=''">
+                AND wci.contract_type = #{workContractInfo.contractType}
+            </if>
+            <if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
+                AND wct.name like concat(concat('%',#{workContractInfo.client.name}),'%')
+            </if>
+            <if test="leaderNameStr !=null and leaderNameStr !=''">
+                AND su.name like concat(concat('%',#{leaderNameStr}),'%') AND w.is_master = '1' AND w.del_flag='0'
+            </if>
+            <if test="projectStatus !=null">
+                AND a.status = #{projectStatus}
+            </if>
+            <if test="beginDate !=null">
+                AND a.create_date >= #{beginDate}
+            </if>
+            <if test="endDate !=null">
+                AND a.create_date &lt; #{endDate}
+            </if>
+            <if test="typeList !=null and typeList !=''">
+                and project_type in
+                <foreach collection="typeList" item="id" index="index" open="(" close=")" separator=",">
+                    #{id}
+                </foreach>
+            </if>
+            <if test="sqlMap.delFlag !=null and sqlMap.delFlag!=''">
+                ${sqlMap.delFlag}
+            </if>
+            <if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
+                AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND a.company_id = #{currentUser.company.id})${sqlMap.dsf} )
+            </if>
+        </where>
+    </select>
+
+    <update id="updateProcessIdAndStatus" >
+        UPDATE  rural_project_records SET
+          check_process_instance_id = #{checkProcessInstanceId},
+          check_status = #{checkStatus},
+          check_user_id = #{checkUserId}
+        WHERE id = #{id}
+    </update>
+
+
+    <update id="update">
+		UPDATE rural_project_records SET
+			check_status = #{checkStatus},
+			check_process_instance_id = #{checkProcessInstanceId}
+		WHERE id = #{id}
+	</update>
+
+
+    <update id="updateSelectiveById">
+        UPDATE  rural_project_records
+        <set>
+            <if test="workContractInfo!=null and workContractInfo.id!=null and workContractInfo.id!=''">
+                contract_id = #{workContractInfo.id},
+            </if>
+            <if test="projectId!=null and projectId!=''">
+                project_id = #{projectId},
+            </if>
+            <if test="projectName!=null and projectName!=''">
+                project_name = #{projectName},
+            </if>
+            <if test="scaleType!=null and scaleType!=''">
+                scale_type = #{scaleType},
+            </if>
+            <if test="scaleUnit!=null and scaleUnit!=''">
+                scale_unit = #{scaleUnit},
+            </if>
+            <if test="scaleQuantity !=null and scaleQuantity != ''">
+                scale_quantity = #{scaleQuantity},
+            </if>
+            <if test="area!=null and area.id!=null and area.id!=''">
+                area_id = #{area.id},
+            </if>
+            <if test="projectSite!=null and projectSite!=''">
+                project_site = #{projectSite},
+            </if>
+            <if test="projectDesc!=null and projectDesc!=''">
+                project_desc = #{projectDesc},
+            </if>
+            <if test="remarks!=null and remarks!=''">
+                remarks = #{remarks},
+            </if>
+            <if test="projectStatus !=null and projectStatus != 0">
+                status = #{projectStatus},
+            </if>
+            <if test="company!=null and company.id!=null and company.id!=''">
+                company_id = #{company.id},
+            </if>
+            <if test="office!=null and office.id!=null and office.id!=''">
+                office_id = #{office.id},
+            </if>
+            <if test="alterProcessId!=null and alterProcessId!=''">
+                alter_process_id = #{alterProcessId},
+            </if>
+            <if test="checkStatus!=null and checkStatus!=''">
+                check_status = #{checkStatus},
+            </if>
+            <if test="bzshbUserId!=null and bzshbUserId!=''">
+                bzshb_user_id = #{bzshbUserId},
+            </if>
+            <if test="updateBy!=null and updateBy.id!=null and updateBy.id!=''">
+                update_by = #{updateBy.id},
+            </if>
+            <if test="updateDate!=null">
+                update_date = #{updateDate}
+            </if>
+        </set>
+        WHERE id = #{id}
+    </update>
+
+    <update id="delete">
+        update rural_project_records
+        set
+        check_process_instance_id = null,
+        check_status = null,
+        bzshb_user_id = null
+        where
+            id = #{id}
+    </update>
+
+</mapper>

+ 7 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -92,6 +92,7 @@
 		wct.id AS "workContractInfo.client.id",
 		wct.name AS "workContractInfo.client.name",
 		o.top_company AS "office.name"
+		,ifnull(prr.status ,0) as "projectReportRecordStatus"
 		FROM rural_project_records a
 		<include refid="projectRecordsJoins"/>
 
@@ -102,6 +103,8 @@
         LEFT JOIN work_project_user w1 on a.id = w1.project_id
 		LEFT JOIN work_contract_info wci on a.contract_id = wci.id
 		LEFT JOIN work_client_info wct on wci.client_id = wct.id
+		LEFT JOIN project_report_data prd on prd.project_id = a.id
+		LEFT JOIN rural_project_report_record prr on prd.id = prr.report_id
         LEFT JOIN sys_office o ON o.id = a.office_id
 		<where>
 			<if test="projectId != null and projectId != ''">
@@ -1410,4 +1413,8 @@
 			</choose>
 		</where>
 	</select>
+
+	<select id="getReportRecordStatus" resultType="java.lang.String">
+		select status from rural_project_report_record where report_id = #{reportId}
+	</select>
 </mapper>

+ 21 - 0
src/main/webapp/static/common/jeeplus.js

@@ -434,6 +434,27 @@ function getruralProjectState(id)
     return result;
 }
 
+
+function getCheckProjectState(id)
+{
+    var result ={};
+    result.action = true;
+    switch(id)
+    {
+        case "0":result.label = "unknown";result.status="未审查";result.action = false;break;
+        case "1":result.label = "tempstore";result.status="暂存";result.action = false;break;
+        case "2":result.label = "auditing";result.status="审查中";break;
+        case "3":result.label = "cancel";result.status="撤回";break;
+        case "4":result.label = "reject";result.status="驳回";break;
+        case "5":result.label = "signed";result.status="审查完成";break;
+        case "7":result.label = "discarded";result.status="作废";result.action = false;break;
+        case "8":result.label = "discarded";result.status="已删除";result.action = false;break;
+        default:
+            result.label = "unknown";result.status="未知";break;
+    }
+    return result;
+}
+
 function getRuralProjectArchiveState(id)
 {
     var result ={};

+ 45 - 55
src/main/webapp/webpage/modules/projectAccessory/projectAccessoryRelation/projectAccessoryRelationList.jsp

@@ -19,17 +19,6 @@
 	<script type="text/javascript">
 		$(document).ready(function() {
 
-			//搜索框收放
-			$('#moresee').click(function(){
-				if($('#moresees').is(':visible'))
-				{
-					$('#moresees').slideUp(0,resizeListWindow2);
-					$('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
-				}else{
-					$('#moresees').slideDown(0,resizeListWindow2);
-					$('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
-				}
-			});
 			laydate.render({
 				elem: '#beginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
 				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
@@ -43,8 +32,32 @@
 , trigger: 'click'
 			});
 
+			var attachmentProjectType = $("#attachmentProjectType").val();
+			var attachmentProjectSort = $("#attachmentProjectSortStr").val();
+			if(undefined != attachmentProjectType && null != attachmentProjectType && "" != attachmentProjectType){
 
-			var attachmentProjectSort = $("#attachmentProjectSort").val()
+				$.ajax({
+					type:"post",
+					url:'${ctx}/projectAccessoryRelation/projectAccessoryRelation/getMessage',
+					data:{"type":attachmentProjectType},
+					dataType:"json",
+					async: false,
+					success:function(data){
+						if(data.success) {
+							for (var info in data.data){
+								if(data.data[info].value == attachmentProjectSort){
+									$('#attachmentProjectSort').append(new Option(data.data[info].label,data.data[info].value,true,true));
+								}else{
+									$('#attachmentProjectSort').append(new Option(data.data[info].label,data.data[info].value));
+								}
+							}
+						}
+					}
+				})
+				layui.form.render("select");
+			}
+
+			/*var attachmentProjectSort = $("#attachmentProjectSort").val()
 			if(undefined != attachmentProjectSort && null != attachmentProjectSort && "" != attachmentProjectSort){
 				$.ajax({
 					type:"post",
@@ -68,7 +81,7 @@
 			}else{
 				document.getElementById("attachmentProjectApprovalMoney").disabled=false;
 				document.getElementById("attachmentProjectApprovalMoney").style="background-color:#FFFFFF"
-			}
+			}*/
 		});
 
 		function reset() {
@@ -175,7 +188,7 @@
 		/**
 		 * 项目类别变更进行处理
 		 */
-		function projectSortChange() {
+		/*function projectSortChange() {
 			var attachmentProjectType = $("#attachmentProjectType").val()
 			var attachmentProjectSort = $("#attachmentProjectSort").val()
 			var attachmentProjectApprovalMoney = $("#attachmentProjectApprovalMoney").val()
@@ -211,7 +224,7 @@
 				document.getElementById("attachmentProjectApprovalMoney").disabled=false;
 				document.getElementById("attachmentProjectApprovalMoney").style="background-color:#FFFFFF"
 			}
-		}
+		}*/
 	</script>
 	<style>
 		body{
@@ -229,67 +242,39 @@
 	<div class="layui-row">
 		<div class="full-width fl">
 			<div class="layui-row contentShadow shadowLR" id="queryDiv">
-				<form:form id="searchForm" modelAttribute="projectAccessoryRelationInfo" action="${ctx}/projectAccessoryRelation/projectAccessoryRelation/list" method="post" class="form-inline">
-				<%--<form:form id="searchForm" modelAttribute="projectAccessoryRelationInfo" action="${ctx}/projectAccessoryRelation/projectAccessoryRelation/list" method="post" class="form-horizontal layui-form">--%>
+				<form:form id="searchForm" modelAttribute="projectAccessoryRelationInfo" action="${ctx}/projectAccessoryRelation/projectAccessoryRelation/list" method="post" class="form-horizontal layui-form">
 					<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
 					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+					<input id="attachmentProjectSortStr" name="attachmentProjectSortStr" type="hidden" value="${attachmentProjectSortStr}"/>
 					<div class="commonQuery lw6">
 						<div class="layui-item query athird ">
 							<label class="layui-form-label">项目类型:</label>
 							<div class="layui-input-block">
-								<form:select path="attachmentProjectType" class=" form-control  simple-select" onchange="projectSortChange()">
+								<form:select path="attachmentProjectType" class=" form-control  simple-select" lay-filter="typeFilter">
 									<form:option value="" label=""/>
 									<form:options items="${fns:getMainDictList('attachment_project_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
 								</form:select>
 							</div>
 						</div>
-						<%--<div class="layui-item query athird ">
-							<label class="layui-form-label">项目类型:</label>
-							<div class="layui-input-block">
-								<select name="attachmentProjectType" id="attachmentProjectType" lay-filter="typeFilter">
-									<option value=""></option>
-									<option value="1" >工程咨询</option>
-									<option value="2" >造价审核</option>
-								</select>
-							</div>
-						</div>
 						<div class="layui-item query athird">
 							<label class="layui-form-label">项目类别:</label>
 							<div class="layui-input-block">
 								<select id="attachmentProjectSort" name="attachmentProjectSort" value="" lay-filter="sortFilter"></select>
 							</div>
-						</div>--%>
-
-						<div class="layui-item query athird ">
-							<label class="layui-form-label">项目类别:</label>
-							<div class="layui-input-block">
-								<form:select path="attachmentProjectSort" class=" form-control  simple-select" onchange="projectSortChange()">
-									<form:option value="" label=""/>
-									<form:options id="sort" cssStyle="display: none" items="${fns:getMainDictList('attachment_project_sort')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
-									<form:options id="sortCost" cssStyle="display: none" items="${fns:getMainDictList('attachment_project_sort_cost')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
-								</form:select>
-							</div>
 						</div>
-						<%--<div class="layui-item query athird ">
-							<label class="layui-form-label">送审金额:</label>
-							<div class="layui-input-block">
-								<select id="attachmentProjectApprovalMoney" name="attachmentProjectApprovalMoney" value="" lay-filter="moneyFilter"></select>
-							</div>
-						</div>--%>
-						<%--<div class="layui-item athird">
+						<div class="layui-item athird">
 							<div class="input-group">
-								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
 								<button id="searchReset" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
 								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
 							</div>
-						</div>--%>
+						</div>
 						<div style="    clear:both;"></div>
 					</div>
-					<div id="moresees" style="clear:both;/*display:none;*/" class="lw6">
+					<div id="moresees" class="commonQuery lw6">
 						<div class="layui-item query athird ">
 							<label class="layui-form-label">送审金额:</label>
 							<div class="layui-input-block">
-								<form:select path="attachmentProjectApprovalMoney" class=" form-control  simple-select" onchange="projectSortChange()">
+								<form:select path="attachmentProjectApprovalMoney" class=" form-control  simple-select">
 									<form:option value="" label=""/>
 									<form:options items="${fns:getMainDictList('attachment_project_approval_money')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
 								</form:select>
@@ -457,15 +442,15 @@
 				}
 			}
 		});
-/*
+
 		layui.form.on('select(typeFilter)',function(data) {
 			if (data.value == "") {
 				$('#attachmentProjectSort').html('<option value=""></option>');
-				$('#attachmentProjectApprovalMoney').html('<option value=""></option>')
+				/*$('#attachmentProjectApprovalMoney').html('<option value=""></option>')*/
 				layui.form.render("select");
 			} else {
 				$('#attachmentProjectSort').html('<option value=""></option>')
-				$('#attachmentProjectApprovalMoney').html('<option value=""></option>')
+				/*$('#attachmentProjectApprovalMoney').html('<option value=""></option>')*/
 				$.ajax({
 					type:"post",
 					url:'${ctx}/projectAccessoryRelation/projectAccessoryRelation/getMessage',
@@ -475,7 +460,12 @@
 					success:function(data){
 						if(data.success) {
 							for (var info in data.data){
-								$('#attachmentProjectSort').append(new Option(data.data[info].label,data.data[info].value));
+								if(info == 0){
+									$('#attachmentProjectSort').append(new Option(data.data[info].label,data.data[info].value,true,true));
+								}else{
+									$('#attachmentProjectSort').append(new Option(data.data[info].label,data.data[info].value));
+								}
+
 							}
 						}
 					}
@@ -484,7 +474,7 @@
 			}
 		});
 
-		layui.form.on('select(sortFilter)',function(data) {
+		/*layui.form.on('select(sortFilter)',function(data) {
 			if (data.value == "") {
 				$('#attachmentProjectApprovalMoney').html('<option value=""></option>');
 				layui.form.render("select");

+ 485 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/check/ruralProjectRecordsAudit.jsp

@@ -0,0 +1,485 @@
+<%@ 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">
+		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);
+			}
+		});
+
+        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="projectRecords" enctype="multipart/form-data" action="${ctx}/project/recordChooseCheck/saveAudit" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<form:hidden path="home"/>
+		<form:hidden path="workContractInfo.client.id" id="contractClientId" value="${projectRecords.workContractInfo.client.id}"/>
+		<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"/>
+		<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>
+					<div class="layui-item layui-col-sm6 lw6">
+						<label class="layui-form-label double-line">合同金额(元):</label>
+						<div class="layui-input-block">
+							<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="<fmt:formatNumber value="${projectRecords.workContractInfo.contractPrice}" pattern="#,##0.00#"/>"/>
+						</div>
+					</div>
+					<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.constructionProjectTypeStr}"/>
+						</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" 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">
+                            <form:input path="projectId" htmlEscape="false"  readonly="true" class="form-control layui-input"/>
+                            <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"  readonly="true" class="form-control layui-input" value="${projectRecords.area.name}"/>
+					</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" 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" 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" 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"  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"  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" readonly="true" id="leaderName" class="form-control layui-input" value="${projectRecords.leaderNameStr}"/>
+					</div>
+				</div>
+				<c:choose>
+					<c:when test="${not empty projectRecords.bzshbUserId}">
+						<div class="layui-item layui-col-sm6 lw7">
+							<label class="layui-form-label double-line"><span class="require-item">*</span>项目审核人员:</label>
+							<div class="layui-input-block">
+								<select class="form-control required editable-select layui-input" id="bzshbUserId" disabled="disabled" name="bzshbUserId">
+									<option value=""/>
+									<c:forEach items="${projectRecords.bzshbUserList}" var="user" varStatus="status">
+										<option value="${user.id}" <c:if test="${projectRecords.bzshbUserId eq user.id }">selected</c:if>>${user.name}</option>
+									</c:forEach>
+								</select>
+							</div>
+						</div>
+					</c:when>
+					<c:otherwise>
+						<div class="layui-item layui-col-sm6 lw7">
+							<label class="layui-form-label double-line"><span class="require-item">*</span>项目审核人员:</label>
+							<div class="layui-input-block">
+								<select class="form-control required editable-select layui-input" id="bzshbUserId"  name="bzshbUserId">
+									<option value=""/>
+									<c:forEach items="${projectRecords.bzshbUserList}" var="user" varStatus="status">
+										<option value="${user.id}">${user.name}</option>
+									</c:forEach>
+								</select>
+							</div>
+						</div>
+					</c:otherwise>
+				</c:choose>
+
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">所属部门:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" 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 double-line">工作开始日期:</label>
+					<div class="layui-input-block">
+						<input class=" form-control layui-input " 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 " 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"  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" class="form-control layui-input" value="${projectRecords.attachmentProjectSort}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label double-line">施工单位:</label>
+					<div class="layui-input-block">
+						<form:input path="constructionUnit" htmlEscape="false" id="installPercent" class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label double-line">施工方联系方式:</label>
+					<div class="layui-input-block">
+						<form:input path="constructionLinkman" htmlEscape="false" id="installPercent" class="form-control layui-input" readonly="true"/>
+					</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" 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" 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">
+						</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">
+						</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="${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>
+								<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=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>
+
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>审批意见</h2></div>
+				<div class="layui-item layui-col-sm12 lw6 with-textarea">
+					<label class="layui-form-label">审批意见:</label>
+					<div class="layui-input-block">
+						<form:textarea path="act.comment" class="form-control" rows="4" maxlength="127" />
+						<input type="file" name="upload_files" style="display: none;">
+					</div>
+				</div>
+			</div>
+
+			<script>
+                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>
+
+			<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="usersListTable" 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="55px;">状态</th>
+						</tr>
+						</thead>
+						<tbody id="usersList">
+						<c:if test="${not empty projectRecords.projectMembers}">
+							<c:forEach items="${projectRecords.projectMembers}" var="user">
+								<tr id="${user.id}">
+									<td>
+											${user.name}
+									</td>
+									<td>
+											${user.office.name}
+									</td>
+									<td>
+											${user.basicInfo.jobGrade.name}
+									</td>
+									<td>
+										<c:choose>
+											<c:when test="${user.delFlag == 0}">
+												正常
+											</c:when>
+											<c:otherwise>
+												移除
+											</c:otherwise>
+										</c:choose>
+									</td>
+								</tr>
+							</c:forEach>
+						</c:if>
+						</tbody>
+					</table>
+				</div>
+			</div>
+
+	</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>

+ 363 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/check/ruralProjectRecordsForm.jsp

@@ -0,0 +1,363 @@
+<%@ 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">
+		var validateForm;
+		function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+			if(validateForm.form()){
+				$("#inputForm").attr("action","${ctx}/project/recordChooseCheck/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();
+			}
+		});
+		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="projectRecords" action="${ctx}/project/recordChooseCheck/save" method="post" class="form-horizontal">
+			<input type="hidden" id="id" name="id" value="${projectRecords.id}">
+			<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" 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>
+				   <div class="layui-item layui-col-sm6 lw6">
+					   <label class="layui-form-label double-line">合同金额(元):</label>
+					   <div class="layui-input-block">
+						   <input htmlEscape="false"  readonly="true" class="form-control layui-input" value="<fmt:formatNumber value="${projectRecords.workContractInfo.contractPrice}" pattern="#,##0.00#"/>"/>
+					   </div>
+				   </div>
+				   <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="divv3">
+					<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.constructionProjectTypeStr}"/>
+						</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" 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">
+                            <form:input path="projectId" htmlEscape="false"  readonly="true" class="form-control layui-input"/>
+                            <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"  readonly="true" class="form-control layui-input" value="${projectRecords.area.name}"/>
+					</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" 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" 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" 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"  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"  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"  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" 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 double-line">工作开始日期:</label>
+					<div class="layui-input-block">
+						<input class="laydate-icondate form-control layui-input layer-date " readonly="true" id="startDate" name="startDate" value="<fmt:formatDate value="${ruralProjectRecords.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 " readonly="true" id="endingDate" name="endingDate" value="<fmt:formatDate value="${ruralProjectRecords.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"  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" class="form-control layui-input" value="${projectRecords.attachmentProjectSort}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label double-line">施工单位:</label>
+					<div class="layui-input-block">
+						<form:input path="constructionUnit" htmlEscape="false" id="installPercent" class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label double-line">施工方联系方式:</label>
+					<div class="layui-input-block">
+						<form:input path="constructionLinkman" htmlEscape="false" id="installPercent" class="form-control layui-input" readonly="true"/>
+					</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" 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" 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">
+						</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">
+						</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/ruralProjectMessage/modify?projectId=${projectRecords.id}&view=view','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="${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>
+								<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=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>
+			<div class="form-group layui-row page-end"></div>
+		</form:form>
+	</div>
+</div>
+</body>
+</html>

+ 363 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/check/ruralProjectRecordsList.jsp

@@ -0,0 +1,363 @@
+<%@ 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">
+        $(document).ready(function() {
+
+            //搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+            laydate.render({
+                elem: '#beginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+            laydate.render({
+                elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+        });
+
+        function reset() {
+            $("#searchForm").resetForm();
+        }
+
+        function openDialog(title,url,width,height,target) {
+
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url,
+                skin: 'three-btns',
+                btn: ['送审', '暂存', '关闭'],
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2:function(index,layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(2) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }else {
+                        return false;
+                    }
+                },
+                btn3: function (index) {
+                }
+            });
+        }
+
+        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){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2:function(index,layero){
+                    if(split.length==2){return}
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(2) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }else {
+                        return false;
+                    }
+                },
+                btn3: function (index) {
+                }
+            });
+        }
+	</script>
+	<style>
+		body{
+			background-color:transparent;
+			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+			color:#ffffff;
+			background-color:rgba(255,255,255,0);
+			height:100%;
+		}
+	</style>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<sys:message content="${message}"/>
+	<div class="layui-row">
+		<div class="full-width fl">
+			<div class="layui-row contentShadow shadowLR" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="ruralProjectRecords" action="${ctx}/project/recordChooseCheck/" method="post" class="form-inline">
+					<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+					<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
+					<div class="commonQuery lw6">
+						<div class="layui-item query athird">
+							<label class="layui-form-label">项目编号:</label>
+							<div class="layui-input-block with-icon">
+								<form:input path="projectId" htmlEscape="false" maxlength="64"  class=" form-control  layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">项目名称:</label>
+							<div class="layui-input-block">
+								<form:input path="projectName" htmlEscape="false" maxlength="64"  class=" form-control  layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item athird">
+							<div class="input-group">
+								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
+								<button id="searchReset" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
+								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
+							</div>
+						</div>
+						<div style="    clear:both;"></div>
+					</div>
+					<div id="moresees" style="clear:both;display:none;" class="lw6">
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">项目负责人:</label>
+							<div class="layui-input-block">
+								<form:input path="leaderNameStr" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">合同名称:</label>
+							<div class="layui-input-block">
+								<form:input path="workContractInfo.name" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">委托方:</label>
+							<div class="layui-input-block">
+								<form:input path="workContractInfo.client.name" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">创建时间:</label>
+							<div class="layui-input-block">
+								<input id="beginDate" name="beginDate" placeholder="开始时间" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+									   value="<fmt:formatDate value="${projectRecords.beginDate}" pattern="yyyy-MM-dd"/>"/>
+								</input>
+                                <span class="group-sep">-</span>
+                                <input id="endDate" name="endDate" placeholder="结束时间" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+                                       value="<fmt:formatDate value="${projectRecords.endDate}" pattern="yyyy-MM-dd"/>"/>
+                                </input>
+							</div>
+						</div>
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">状态:</label>
+							<div class="layui-input-block">
+								<form:select path="checkStatus" class=" form-control  simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getRuralDictList('check_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+						<div style="clear:both;"></div>
+					</div>
+				</form:form>
+			</div>
+		</div>
+		<div class="full-width fl">
+			<div class="layui-form contentDetails contentShadow shadowLBR">
+				<div class="nav-btns">
+					<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i>&nbsp;刷新</button>
+					<div style="clear: both;"></div>
+				</div>
+				<table class="oa-table layui-table" id="contentTable1"></table>
+
+				<!-- 分页代码 -->
+				<table:page page="${page}"></table:page>
+				<div style="clear: both;"></div>
+			</div>
+		</div>
+	</div>
+	<div id="changewidth"></div>
+</div>
+
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+
+    layui.use('table', function(){
+        layui.table.render({
+            limit:${ page.pageSize }
+            ,elem: '#contentTable1'
+            ,page: false
+            ,cols: [[
+                {field:'index',align:'center', title: '序号',width:40}
+                ,{field:'projName',align:'center', title: '项目名称',minWidth:200,templet:function(d){
+                        return "<a class=\"attention-info\" title=\"" + d.projName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/ruralProject/ruralProjectRecords/view?id=" + d.id +"','95%', '95%')\">" + d.projName + "</a>";
+                    }}
+				,{field:'projId',align:'center', title: '项目编号',  width:150}
+                ,{field:'contract', align:'center',title: '合同名称',minWidth:200,templet:function(d){
+                    	return "<span title='"+ d.contract +"'>" + d.contract + "</span>";
+					}}
+                ,{field:'projMaster', align:'center',title: '负责人', width:65,templet:function(d){
+                        return "<span title=\"" + d.projMaster + "\">" + d.projMaster + "</span>";
+                    }}
+                ,{field:'client',align:'center', title: '委托方',  width:150,templet:function(d){
+                        return "<span title=\"" + d.client + "\">" + d.client + "</span>";
+                    }}
+                ,{field:'createDate',align:'center', title: '创建日期',  width:80}
+                ,{align:'center', title: '状态',  width:70,templet:function(d){
+                        var st = getCheckProjectState(d.checkStatus);
+                        if(st.action)
+                            var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/project/recordChooseCheck/getProcess?id=" + d.id + "','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+                        else
+                            var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+                        return xml;
+                    }}
+                ,{field:'op',align:'center',title:"操作",width:130,templet:function(d){
+                        ////对操作进行初始化
+                        var xml="";
+                        if(d.canAdd != undefined && d.canAdd =="1")
+                        {
+							xml+="<a href=\"#\" onclick=\"openDialogre('修改项目', '${ctx}/project/recordChooseCheck/form?id=" + d.id +"','95%', '95%','','送审,关闭')\" class=\"op-btn layui-bg-green\" ><i class=\"fa fa-plus\"></i> 检查</a>";
+                        }
+                        if(d.canedit1 != undefined && d.canedit1 =="1")
+                        {
+                            xml+="<a href=\"#\" onclick=\"openDialogre('修改项目', '${ctx}/project/recordChooseCheck/form?id=" + d.id +"','95%', '95%','','送审,关闭')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 修改</a>";
+                        }
+                        if(d.canedit2 != undefined && d.canedit2 =="1")
+                        {
+                            xml+="<a href=\"#\" onclick=\"openDialogre('调整项目', '${ctx}/project/recordChooseCheck/modify?id=" + d.id + "','95%', '95%','','送审,关闭')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 修改</a>";
+                        }
+                        if(d.canrecall != undefined && d.canrecall =="1")
+                        {
+                            xml+="<a href=\"#\" onclick=\"openDialogre('调整项目', '${ctx}/project/recordChooseCheck/form?id=" + d.id + "','95%', '95%','','送审,关闭')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 修改</a>";
+                        }
+                        if(d.candel != undefined && d.candel =="1")
+                        {
+                            xml+="<a href=\"${ctx}/project/recordChooseCheck/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该选查项目流程吗?', this.href)\" class=\"op-btn op-btn-invalid\"><i class=\"fa fa-trash-o\"></i> 删除</a>";
+                        }
+                        if(d.cancancel != undefined && d.cancancel =="1")
+                        {
+                            xml+="<a href=\"${ctx}/project/recordChooseCheck/revoke?id=" + d.id + "&processInstanceId=" + d.procId + "&checkStatus="+d.checkStatus+"\" onclick=\"return confirmx('确认要撤回该项目审批吗?', this.href)\" class=\"op-btn op-btn-cancel\" ><i class=\"glyphicon glyphicon-share-alt\"></i> 撤回</a>";
+                        }
+                        return xml;
+
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="projectRecords" varStatus="index">
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+                    ,"id":"${projectRecords.id}"
+                    ,"projId":"${projectRecords.projectId}"
+                    ,"projName":"<c:out value="${projectRecords.projectName}" escapeXml="true"/>"
+                    ,"projMaster":"<c:forEach items="${projectRecords.projectLeaders}" var="leader" varStatus="status"><c:choose><c:when test="${status.last}">${leader.name}</c:when><c:otherwise>${leader.name},</c:otherwise></c:choose></c:forEach>"
+                    ,"contract":"${projectRecords.workContractInfo.name}"
+                    ,"client":"${projectRecords.workContractInfo.client.name}"
+                    ,"createDate":"<fmt:formatDate value="${projectRecords.createDate}" pattern="yyyy-MM-dd"/>"
+                    ,"projectStatus":"${projectRecords.projectStatus}"
+                    ,"checkStatus":"${projectRecords.checkStatus}"
+                    ,"procId":"${projectRecords.checkProcessInstanceId}"
+					,"flagAdmin":"${projectRecords.flagAdmin}"
+					,"checkStatus":"${projectRecords.checkStatus}"
+
+					<shiro:hasPermission name="project:recordChooseCheck:del">,"candel":	<c:choose><c:when test="${(projectRecords.checkStatus == 1 or projectRecords.checkStatus == 3 or projectRecords.checkStatus == 4)}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose></shiro:hasPermission>
+					<shiro:hasPermission name="project:recordChooseCheck:edit">
+					,"canAdd":	<c:choose><c:when test="${projectRecords.checkStatus == 0}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+					,"canedit1":<c:choose><c:when test="${projectRecords.checkStatus == 1}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+					,"canedit2":<c:choose><c:when test="${projectRecords.checkStatus == 4}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+					,"canrecall":<c:choose><c:when test="${projectRecords.checkStatus == 3}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+					</shiro:hasPermission>
+					,"cancancel":<c:choose><c:when test="${projectRecords.checkStatus == 2}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+                }
+                </c:forEach>
+                </c:if>
+            ]
+        });
+    })
+
+    resizeListTable();
+    $("a").on("click",addLinkVisied);
+</script>
+<script>
+    resizeListWindow2();
+    $(window).resize(function(){
+        resizeListWindow2();
+    });
+</script>
+</body>
+</html>

+ 434 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/check/ruralProjectRecordsModify.jsp

@@ -0,0 +1,434 @@
+<%@ 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}/helloweba_editable-select/jquery.editable-select.min.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
+    <style>
+        #projectDesc-error{
+            left:0;
+            top:82px;
+        }
+        .layui-layer-dialog{
+            background: red;
+        }
+        td input{
+            margin-left:-10px !important;
+            height: 42px !important;
+        }
+        .disables {
+            pointer-events: none;
+        }
+        .notDisables {
+            pointer-events: all;
+        }
+        .forbidden{
+            background-color:#c2c2c2;
+        }
+
+        .notForbidden{
+            background-color:#3ca2e0;
+        }
+    </style>
+    <script type="text/javascript">
+		var validateForm;
+        var clientCount = 0;
+		function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+		      if(i==2){
+		          $("#inputForm").attr("action","${ctx}/ruralProject/ruralProjectRecords/tstore");
+			  }
+			  $("#inputForm").submit();
+			  return true;
+		  }else{
+              parent.layer.msg("信息未填写完整!", {icon: 5});
+          }
+
+		  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();
+            }
+		});
+	</script>
+</head>
+<body >
+<div class="single-form">
+    <div class="container">
+		<form:form id="inputForm" modelAttribute="projectRecords" enctype="multipart/form-data" action="${ctx}/project/recordChooseCheck/saveAudit" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+            <form:hidden path="home"/>
+            <form:hidden path="act.taskId"/>
+            <form:hidden path="act.taskName"/>
+            <form:hidden path="act.taskDefKey"/>
+            <form:hidden path="act.procInsId"/>
+            <form:hidden path="act.procDefId"/>
+            <form:hidden id="flag" path="act.flag"/>
+		    <form:hidden path="workContractInfo.client.id" id="contractClientId" value="${workContractInfo.client.id}"/>
+            <input type="hidden" id="flagFile" value="">
+            <input type="hidden" id="saveAuditFlag" name="saveAuditFlag" value="1">
+
+            <input type="hidden" id="workClientLinkmanInfo" value="${projectRecords.workClientLinkmanList}">
+            <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" 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>
+                    <div class="layui-item layui-col-sm6 lw6">
+                        <label class="layui-form-label double-line">合同金额(元):</label>
+                        <div class="layui-input-block">
+                            <input htmlEscape="false"  readonly="true" class="form-control layui-input" value="<fmt:formatNumber value="${projectRecords.workContractInfo.contractPrice}" pattern="#,##0.00#"/>"/>
+                        </div>
+                    </div>
+                    <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="divv3">
+                    <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.constructionProjectTypeStr}"/>
+                        </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" 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">
+                            <form:input path="projectId" htmlEscape="false"  readonly="true" class="form-control layui-input"/>
+                            <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"  readonly="true" class="form-control layui-input" value="${projectRecords.area.name}"/>
+                    </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" 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" 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" 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"  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"  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"  readonly="true" class="form-control layui-input" value="${projectRecords.leaderNameStr}"/>
+                    </div>
+                </div>
+
+                <c:choose>
+                    <c:when test="${not empty projectRecords.bzshbUserId}">
+                        <div class="layui-item layui-col-sm6 lw7">
+                            <label class="layui-form-label double-line"><span class="require-item">*</span>项目审核人员:</label>
+                            <div class="layui-input-block">
+                                <select class="form-control required editable-select layui-input" id="bzshbUserId" disabled="disabled" name="bzshbUserId">
+                                    <option value=""/>
+                                    <c:forEach items="${projectRecords.bzshbUserList}" var="user" varStatus="status">
+                                        <option value="${user.id}" <c:if test="${projectRecords.bzshbUserId eq user.id }">selected</c:if>>${user.name}</option>
+                                    </c:forEach>
+                                </select>
+                            </div>
+                        </div>
+                    </c:when>
+                    <c:otherwise>
+                        <div class="layui-item layui-col-sm6 lw7">
+                            <label class="layui-form-label double-line"><span class="require-item">*</span>项目审核人员:</label>
+                            <div class="layui-input-block">
+                                <select class="form-control required editable-select layui-input" id="bzshbUserId"  name="bzshbUserId">
+                                    <option value=""/>
+                                    <c:forEach items="${projectRecords.bzshbUserList}" var="user" varStatus="status">
+                                        <option value="${user.id}">${user.name}</option>
+                                    </c:forEach>
+                                </select>
+                            </div>
+                        </div>
+                    </c:otherwise>
+                </c:choose>
+                <div class="layui-item layui-col-sm6 lw6">
+                    <label class="layui-form-label">所属部门:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false" 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 double-line">工作开始日期:</label>
+                    <div class="layui-input-block">
+                        <input class="laydate-icondate form-control layui-input layer-date " readonly="true" id="startDate" name="startDate" value="<fmt:formatDate value="${ruralProjectRecords.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 " readonly="true" id="endingDate" name="endingDate" value="<fmt:formatDate value="${ruralProjectRecords.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"  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" class="form-control layui-input" value="${projectRecords.attachmentProjectSort}"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw6">
+                    <label class="layui-form-label double-line">施工单位:</label>
+                    <div class="layui-input-block">
+                        <form:input path="constructionUnit" htmlEscape="false" id="installPercent" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw6">
+                    <label class="layui-form-label double-line">施工方联系方式:</label>
+                    <div class="layui-input-block">
+                        <form:input path="constructionLinkman" htmlEscape="false" id="installPercent" class="form-control layui-input" readonly="true"/>
+                    </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" 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" 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">
+                        </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">
+                        </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/ruralProjectMessage/modify?projectId=${projectRecords.id}&view=view','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="${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>
+                                <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=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>
+            <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="${projectRecords.checkProcessInstanceId}"/>
+                    <act:histoicFlow procInsId="${projectRecords.checkProcessInstanceId}"/>
+                </div>
+            </div>
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+
+</body>
+</html>

+ 28 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectcontentinfo/reportForm.jsp

@@ -492,6 +492,34 @@
 					</form:select>
 				</div>
 			</div>
+			<c:choose>
+				<c:when test="${not empty projectcontentinfo.projectReportData.bzshbUserId}">
+					<div class="layui-item layui-col-sm6 lw7">
+						<label class="layui-form-label"><span class="require-item">*</span>审核人员:</label>
+						<div class="layui-input-block">
+							<select class="form-control required editable-select layui-input" id="bzshbUserId" disabled="disabled" name="projectReportData.bzshbUserId">
+								<option value=""/>
+								<c:forEach items="${projectRecords.bzshbUserList}" var="user" varStatus="status">
+									<option value="${user.id}" <c:if test="${projectcontentinfo.projectReportData.bzshbUserId eq user.id }">selected</c:if>>${user.name}</option>
+								</c:forEach>
+							</select>
+						</div>
+					</div>
+				</c:when>
+				<c:otherwise>
+					<div class="layui-item layui-col-sm6 lw7">
+						<label class="layui-form-label"><span class="require-item">*</span>审核人员:</label>
+						<div class="layui-input-block">
+							<select class="form-control required editable-select layui-input" id="bzshbUserId"  name="projectReportData.bzshbUserId">
+								<option value=""/>
+								<c:forEach items="${projectRecords.bzshbUserList}" var="user" varStatus="status">
+									<option value="${user.id}">${user.name}</option>
+								</c:forEach>
+							</select>
+						</div>
+					</div>
+				</c:otherwise>
+			</c:choose>
 			<%--<div class="layui-item layui-col-sm6">
 				<label class="layui-form-label"><span class="require-item">*</span>签章类型:</label>
 				<div class="layui-input-block">

+ 43 - 2
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsList.jsp

@@ -258,6 +258,9 @@
 					<shiro:hasPermission name="ruralProject:ruralCostProjectRecords:export">
 						<table:exportExcel url="${ctx}/ruralProject/ruralCostProjectRecords/export"></table:exportExcel><!-- 导出按钮 -->
 					</shiro:hasPermission>
+					<shiro:hasPermission name="ruralProject:ruralCostProjectRecords:exportAll">
+						<button type="button" data-toggle="tooltip" data-placement="top" class="nav-btn nav-btn-delete" id="delUser"><i class="fa fa-file-excel-o"> 批量下载</i></button>
+					</shiro:hasPermission>
 					<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i>&nbsp;刷新</button>
 					<div style="clear: both;"></div>
 				</div>
@@ -278,10 +281,11 @@
     layui.use('table', function(){
         layui.table.render({
             limit:${ page.pageSize }
+			,id:"checkboxTable"
             ,elem: '#contentTable1'
             ,page: false
             ,cols: [[
-                // {checkbox: true, fixed: true},
+				{checkbox: true, fixed: true},
                 {field:'index',align:'center', title: '序号',width:40}
                 ,{field:'projName',align:'center', title: '项目名称',minWidth:200,templet:function(d){
                         return "<a class=\"attention-info\" title=\"" + d.projName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/ruralProject/ruralCostProjectRecords/view?id=" + d.id +"','95%', '95%')\">" + d.projName + "</a>";
@@ -308,7 +312,7 @@
                             var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
                         return xml;
                     }}
-                ,{field:'op',align:'center',title:"操作",width:130,templet:function(d){
+                ,{field:'op',align:'center',title:"操作",width:150,templet:function(d){
                         ////对操作进行初始化
                         var xml="";
                         if(d.canedit1 != undefined && d.canedit1 =="1")
@@ -331,6 +335,16 @@
                         {
                             xml+="<a href=\"${ctx}/ruralProject/ruralCostProjectRecords/revoke?id=" + d.id + "&processInstanceId=" + d.procId + "&projectStatus="+d.projectStatus+"\" onclick=\"return confirmx('确认要撤回该项目审批吗?', this.href)\" class=\"op-btn op-btn-cancel\" ><i class=\"glyphicon glyphicon-share-alt\"></i> 撤回</a>";
                         }
+						//项目在没有归档完成之前可对文档进行操作
+						if(d.recordStatus != undefined && d.recordStatus =="1")
+						{
+							xml+="<a href=\"#\" onclick=\"openDialogView('文件上传', '${ctx}/ruralProject/ruralCostProjectRecords/formAccessory?id=" + d.id + "','95%', '95%')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 上传文件</a>";
+						}
+						//项目在没有归档完成之前可对文档进行操作
+						if(d.adminAccessory != undefined && d.adminAccessory =="1")
+						{
+							xml+="<a href=\"#\" onclick=\"openDialogView('归档管理员文件上传', '${ctx}/ruralProject/ruralCostProjectRecords/formAccessory?id=" + d.id + "','95%', '95%')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 上传文件</a>";
+						}
                         if(d.canedit3 != undefined && d.canedit3 =="1")
                         {
                             //xml+="<a href=\"javascript:void(0)\" onclick=\"openDialogre('项目变更管理', '${ctx}/ruralProject/ruralCostProjectRecordsAlter/form?alterBeforeRecords.id='+encodeURIComponent('" + d.id + "'),'95%','95%','','送审,暂存,关闭')\" style=\"color: white;background: darkseagreen\" class=\"op-btn op-btn-op-btn-revert\" ><i class=\"fa fa-edit\"></i> 变更</a>";
@@ -358,6 +372,7 @@
                     ,"client":"${projectRecords.workContractInfo.client.name}"
                     ,"createDate":"<fmt:formatDate value="${projectRecords.createDate}" pattern="yyyy-MM-dd"/>"
                     ,"projectStatus":"${projectRecords.projectStatus}"
+					,"projectReportRecordStatus":"${projectRecords.projectReportRecordStatus}"
                     ,"procId":"${projectRecords.processInstanceId}"
 					,"flagAdmin":"${projectRecords.flagAdmin}"
                     <c:choose><c:when test="${flag == '1' or fns:getUser().id == projectRecords.createBy.id}">
@@ -368,6 +383,7 @@
                     </shiro:hasPermission>
                     ,"cancancel":<c:choose><c:when test="${projectRecords.projectStatus == 2 && fns:getUser().id == projectRecords.createBy.id}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
 					,"deleteAdmin":<c:choose><c:when test="${'1' == projectRecords.flagAdmin && projectRecords.projectStatus == 5}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+					,"recordStatus":<c:choose><c:when test="${'5' != projectRecords.projectReportRecordStatus && projectRecords.projectStatus == 5}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
 					</c:when>
                     <c:otherwise>
                     ,"candel":"0"
@@ -376,9 +392,17 @@
                     ,"canrecall":"0"
                     ,"cancancel":"0"
 					,"deleteAdmin":"0"
+					,"recordStatus":"0"
                     </c:otherwise>
                     </c:choose>
                     <shiro:hasPermission name="ruralProject:ruralCostProjectRecords:edit">,"canedit3":<c:choose><c:when test="${projectRecords.projectStatus == 5 && fn:contains(projectRecords.leaderIds,fns:getUser().id)}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose></shiro:hasPermission>
+					<shiro:hasPermission name="ruralProject:ruralCostProjectRecords:adminAccessory">
+						,"adminAccessory":
+							<c:choose>
+								<c:when test="${projectRecords.projectStatus == 5 && '5' != projectRecords.projectReportRecordStatus}">"1"</c:when>
+								<c:otherwise>"0"</c:otherwise>
+							</c:choose>
+					</shiro:hasPermission>
                 }
                 </c:forEach>
                 </c:if>
@@ -386,6 +410,23 @@
             // ,even: true
             // ,height: 315
         });
+		$("#delUser").bind("click",function () {
+			//获得表格CheckBox已经选中的行的信息
+			var checkList = layui.table.checkStatus('checkboxTable').data;
+			//定义数组存放批量删除的行的id
+			var listId = [];
+			//进行遍历所有选中行数据,拿出每一行的id存储到数组中
+			$.each(checkList, function (i, data) {
+				listId.push(data.id);
+			});
+			if (listId.length <= 0) {
+				layer.msg("请选择需要下载的项目信息", {icon: 2})
+			} else {
+				$("#searchForm").attr("action","${ctx}/ruralProject/ruralProjectRecords/exportAll?listId="+ listId);
+				$("#searchForm").submit();
+				return true;
+			}
+		});
     })
 
     resizeListTable();

+ 952 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/projectAccessoryForm.jsp

@@ -0,0 +1,952 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>报告详情管理</title>
+	<meta name="decorator" content="default"/>
+	<style>
+		label.error{
+			top:40px;
+			left:0;
+		}
+	</style>
+	<script type="text/javascript">
+        var validateForm;
+        var dataList;
+        function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+				if(obj == 1){
+					$("#inputForm").attr("action","${ctx}/ruralProject/ruralProjectMessage/saveReport");
+				}else{
+					$("#inputForm").attr("action","${ctx}/ruralProject/ruralProjectMessage/holdSaveReport");
+				}
+				$("#inputForm").submit();
+				return true;
+            }else {
+				parent.layer.msg("信息未填写完整!", {icon: 5});
+			}
+
+            return false;
+        }
+        $(document).ready(function() {
+            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);
+                    }
+                }
+            });
+            laydate.render({
+                elem: '#reportDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+            $("#attachment_btn").click(function () {
+                $("#attachment_file").click();
+            });;
+            $("#gistdata_btn").click(function () {
+                $("#gistdata_file").click();
+            });;
+            $("#other_btn").click(function () {
+                $("#other_file").click();
+            });
+        });
+        function hasInArr(id,idArr) {
+            for(var i=0;i<idArr.length;i++){
+                if(id==$(idArr[i]).val()){
+                    return true;
+                }
+            }
+            return false;
+        }
+        function insertTitle(tValue){
+            var files = $("#attachment_file")[0].files;
+            for(var i=0;i<files.length;i++) {
+                var file = files[i];
+                var attachmentId = "";
+                var attachmentFlag = "86";
+                console.log(file);
+                var timestamp = new Date().getTime();
+
+				var storeAs = "projectRecords";
+                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 gistdataInsertTitle(tValue){
+            var files = $("#gistdata_file")[0].files;
+            for(var i=0;i<files.length;i++) {
+                var file = files[i];
+                var gistdataId = "";
+                var gistdataFlag = "152";
+                console.log(file);
+                var timestamp = new Date().getTime();
+
+				var storeAs = "projectRecords";
+                var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+                /*将这段字符串存到数据库即可*/
+                var divId = "_gistdata";
+                $("#addFile" + divId).show();
+                multipartUploadWithSts(storeAs, file, gistdataId, gistdataFlag, uploadPath, divId, "0");
+            }
+        }
+
+        function otherInsertTitle(tValue){
+            var files = $("#other_file")[0].files;
+            for(var i=0;i<files.length;i++) {
+                var file = files[i];
+                var attachmentId = "";
+                var attachmentFlag = "153";
+                console.log(file);
+                var timestamp = new Date().getTime();
+
+				var storeAs = "projectRecords";
+                var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+                /*将这段字符串存到数据库即可*/
+                var divId = "_other";
+                $("#addFile" + divId).show();
+                multipartUploadWithSts(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, "0");
+            }
+        }
+        
+        function selectNum() {
+			top.layer.open({
+				type: 2,
+				area: ['50%','95%'],
+				title:'选择报告号',
+				content: '${ctx}/projectreportnum/projectReportNum/select',
+				btn: ['确定','关闭'],
+				btn1: function(index, layero){
+					var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+					var item = iframeWin.getSelectedItem();
+					if(item === 'false'){
+						iframeWin.layer.msg('请选择一条数据', {icon: 5});
+					}else {
+						$("#number").val(item)
+						top.layer.close(index);//关闭对话框。
+					}
+				},
+				btn2: function(index){
+				}
+
+			})
+		}
+        function openDialogre(title,url,width,height,formId){
+
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                skin: 'three-btns',
+                maxmin: true, //开启最大化最小化按钮
+                content: url ,
+                btn: ['提交','关闭'],
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    inputForm.attr("action","${ctx}/projectcontentinfo/projectcontentinfo/ajaxsaveBaseData");//表单提交成功后,从服务器返回的url在当前tab中展示
+                    var $document = iframeWin.contentWindow.document;
+                    formSubmitAjax($document,formId,index);
+                },
+                btn2: function(index){
+                }
+            });
+        }
+        function formSubmitAjax($document,inputForm,index){
+            var validateForm = $($document.getElementById(inputForm)).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                $($document.getElementById(inputForm)).ajaxSubmit({
+                    success:function(data) {
+                        if(!data.success){
+                            top.layer.msg("保存依据资料信息异常!",{icon:2});
+                            return false;
+                        }
+                        var idx = $("#workBaseDataList tr").length;
+                        addRowBaseData("#workBaseDataList",idx,workBaseDataTpl,data.body.workBasedData);
+                        parent.layer.msg(data.msg,{icon:1});
+                        top.layer.close(index)
+                    }
+                });
+            }
+        }
+
+        function delRowBaseData(obj, prefix,userId){
+            var id = $(prefix+"_id").val();
+            /* var createBy = $(prefix+"_userId").val();*/
+            var currentUser = '${fns:getUser().id}';
+            var contentId = '${projectcontentinfo.projectContentData.id}';
+            console.log(contentId);
+
+            $.ajax({
+                type:"post",
+                url:'${ctx}/projectcontentinfo/projectContentData/ajaxdelete',
+                data:{"contentId":contentId,"basedId":id},
+                dataType:"json",
+                success:function(data){
+                    if(data.success) {
+                        $(obj).parent().parent().remove();
+                        /*parent.parent.refreshTrees();*/
+                        if(data.body.inuse){
+                            return;
+                        }
+                        if (currentUser == userId) {
+                            confirmDelete('是否同步删除资料库的文件?','${ctx}/projectcontentinfo/projectcontentinfo/delete?infoId='+id+'&id=${projectcontentinfo.id}&type=1');
+                        }
+                    }else {
+                        top.layer.msg("删除依据资料失败!", {icon: 0});
+                    }
+                }
+            })
+            return;
+        }
+
+		function reviewAudits(mess, href,obj,remarks){
+				console.log(remarks);
+				var remark = $(remarks);
+				remark.val("确认");
+			    $("#audit"+obj).val("1");
+				$("#check1"+obj).attr("style","display:none");
+				$("#check2"+obj).attr("style","display");
+				top.layer.msg("已确认!", {icon: 1});
+			return false;
+		}
+
+		function getFee() {
+			var rf = $("#reviewFee").val();
+			var af = $("#approvalFee").val();
+			if(rf != ''&& af !=''){
+				var hf = parseInt(rf)-parseInt(af);
+				var rate = Math.round(parseInt(hf) / parseInt(rf) * 100) / 100 * 100
+				$("#verifyFee").val(hf);
+				$("#verifyRate").val(rate);
+			}
+			if(af !=''){
+				$("#consultFee").val(af)
+			}
+		}
+
+		function getAttachment() {
+        	/*var projectSort = $("#projectSort").val();
+        	//0为非打包项目
+        	if(projectSort == 0){*/
+				var reviewFee = $("#reviewFee").val();
+				$("#upTable").load(location.href+"&reviewFee="+reviewFee + " #upTable");
+				$("#gistdata_upTable").load(location.href+"&reviewFee="+reviewFee + " #gistdata_upTable");
+				$("#upTable_other").load(location.href+"&reviewFee="+reviewFee + " #upTable_other");
+			/*}*/
+		}
+
+		function getApprovalFee() {
+			var rf = $("#reviewFee").val();
+			var af = $("#approvalFee").val();
+			//土建
+			var bf = $("#buildingFee").val();
+			//安装
+			var inf = $("#installFee").val();
+			if(rf != ''&& af !=''){
+				var hf = parseInt(rf)-parseInt(af);
+				var rate = Math.round(parseInt(hf) / parseInt(rf) * 100) / 100 * 100
+				$("#verifyFee").val(hf);
+				$("#verifyRate").val(rate);
+			}
+			if(af !=''){
+				$("#consultFee").val(af)
+			}
+			$("#buildingFee").val("");
+			$("#installFee").val("");
+			$("#buildingRate").val("");
+			$("#installRate").val("");
+		}
+
+		function getInstallFee() {
+			var af = $("#approvalFee").val();
+			//安装
+			var inf = $("#installFee").val();
+			if(inf != ''&& af !=''){
+				var hf = parseInt(af)-parseInt(inf);
+				var rate = Math.round(parseInt(inf) / parseInt(af) * 100) / 100 * 100
+				$("#installRate").val(rate);
+				$("#buildingFee").val(hf);
+				bf = hf;
+				var bRate = Math.round(parseInt(hf) / parseInt(af) * 100) / 100 * 100
+				$("#buildingRate").val(bRate);
+			}
+			if(inf == ''|| af ==''){
+				$("#installRate").val("");
+			}
+		}
+
+		function getBuildingFee() {
+			var af = $("#approvalFee").val();
+			//土建
+			var bf = $("#buildingFee").val();
+			if(bf != ''&& af !=''){
+				var hf = parseInt(af)-parseInt(bf);
+				var rate = Math.round(parseInt(bf) / parseInt(af) * 100) / 100 * 100
+				$("#buildingRate").val(rate);
+				$("#installFee").val(hf);
+				inf = hf;
+				var inRate = Math.round(parseInt(hf) / parseInt(af) * 100) / 100 * 100
+				$("#installRate").val(inRate);
+			}
+			if(bf == ''|| af ==''){
+				$("#buildingRate").val("");
+			}
+		}
+
+        function addReview(obj) {
+            var infoId = $("#id").val();
+            var name = $("#name").val();
+            $.ajax({
+                type:"post",
+                url:'${ctx}/projectcontentinfo/projectContentData/addReview',
+                data:{"reviewId":obj,"name":name,"infoId":infoId},
+                dataType:"json",
+                success:function(data){
+                    if(data.success) {
+                        $("#projectContentDataList2").html("");
+						var list = eval(data.body.list);
+						dataList=list
+                        for(var i in list){
+                            var tr = "<tr>" +
+                                "<td>" +
+                                "<input id=\"projectReviewList"+i+"_id\" name=\"projectReportData.projectReviewList["+i+"].id\" type=\"hidden\" value=\""+list[i].id+"\"/>" +
+                                "<input id=\"projectReviewList"+i+"_delFalg\" name=\"projectReportData.projectReviewList["+i+"].delFalg\" type=\"hidden\" value=\"1\"/>" +
+                                "<input id=\"projectReviewList"+i+"_remarks\" name=\"projectReportData.projectReviewList["+i+"].remarks\" type=\"hidden\" value=\"\"/>" +
+                                ""+(parseInt(i)+1)+"" +
+                                "</td>" +
+                                "<td>" +
+                                ""+list[i].standardDetail+"" +
+                                "</td>" +
+                                "<td>" +
+                               	"<div id = \"check1"+list[i].id+"\">\n" +
+                                "<input type=\"hidden\" id=\"audit"+list[i].id+"\" value=\"0\"/>\n" +
+                                "<a href=\"projectReviewList"+list[i]+"\" onclick=\"return reviewAudits('确认要审核该质量复核内容吗?', this.href,'"+list[i].id+"','#projectReviewList"+i+"_remarks')\" style=\"color:#fff;\" class=\"op-btn op-btn-edit\">确认</a>" +
+                                "</div>\n" +
+                                "<div id = \"check2"+list[i].id+"\" class=\"check-ok\" style=\"display: none\">" +
+                                "<i class=\"fa fa-check\"></i>" +
+                                "</div>"
+                                "</td>" +
+                                "</tr>";
+                            $("#projectContentDataList2").append(tr);
+                        }
+                    }else {
+                        top.layer.msg("获取数据失败!", {icon: 0});
+                    }
+                }
+            })
+        }
+
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container${container}">
+		<form:form id="inputForm" modelAttribute="projectcontentinfo" action="${ctx}/ruralProject/ruralProjectMessage/saveReport" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<form:hidden path="name"/>
+		<form:hidden path="parentIds"/>
+		<form:hidden path="edit"/>
+		<form:hidden path="projectReportData.id"/>
+		<form:hidden path="projectReportData.createBy.id"/>
+		<form:hidden path="project.id"/>
+			<input type="hidden" id="reviewFee" value="${projectcontentinfo.projectReportData.reviewFee}">
+		<sys:message content="${message}"/>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>成果文件</h2></div>
+				<div class="layui-item nav-btns">
+					<a href="javascript:void(0)"  onclick="formAttachment('添加类型', '${ctx}/projectAccessoryRelation/projectAccessoryRelation/formAttachment?parentId=11&projectType=1&projectId=${projectRecords.id}&reviewFee='+$('#reviewFee').val(),'500px','350px',false,'inputForm','file_attachment')" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 添加类型</a>
+				</div>
+				<div id="addFile_attachment" style="display: none" class="upload-progress">
+					<span id="fileName_attachment" ></span>
+					<span id="_attachment" ></span>
+					<b><span id="baifenbi_attachment" ></span></b>
+					<div class="progress">
+						<div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+						</div>
+					</div>
+				</div>
+				<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+				<span id="attachment_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>电子件名称</th>
+							<th width="100px">最大容量(M)</th>
+							<th width="18%">类型限制</th>
+							<th>文件名</th>
+							<th width="150px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${projectcontentinfo.fileAttachmentList}" var = "fileAttachment" varStatus="status">
+							<tr>
+								<td style="display:none">${fileAttachment.id}</td>
+								<td style="display:none">${fileAttachment.mustFlag}</td>
+								<c:choose>
+									<c:when test="${fileAttachment.mustFlag == 1}">
+										<td><span style="color: red">* </span>${fileAttachment.attachName}</td>
+									</c:when>
+									<c:otherwise>
+										<td>${fileAttachment.attachName}</td>
+									</c:otherwise>
+								</c:choose>
+
+								<td>${fileAttachment.attachLength}</td>
+								<td>${fileAttachment.attachTypes}</td>
+								<td>
+									<c:forEach items="${fileAttachment.workAttachments}" var = "workAttachment" varStatus="status">
+										<a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workAttachment.url}','90%','90%')">${workAttachment.attachmentName} ; </a>
+									</c:forEach>
+								</td>
+								<td class="op-td">
+									<div class="op-btn-box" >
+										<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${fileAttachment.id}&projectId=${projectRecords.id}','70%','80%',false,'inputForm','upTable')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+									</div>
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+			<script type="text/template" id="fileAttachmentTpl">//<!--
+                <tr id="budgetList{{idx}}">
+                    <td class="hide">
+                        <input id="fileAttachment{{idx}}_id" type="hidden" value="{{row.id}}" class="clientId"/>
+                    </td>
+                    <td class="hide">
+                        0
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.attachName}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.attachLength}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.attachTypes}}
+                    </td>
+                    <td style="text-align:center;">
+
+                    </td>
+					<td class="op-td">
+						<div class="op-btn-box" >
+							<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${projectRecords.id}','70%','80%',false,'inputForm','upTable')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+						</div>
+					</td>
+                </tr>//-->
+			</script>
+
+
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>依据性资料</h2></div>
+				<div class="layui-item nav-btns">
+					<%--<a id="gistdata_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>--%>
+					<a href="javascript:void(0)"  onclick="formAttachment('添加类型', '${ctx}/projectAccessoryRelation/projectAccessoryRelation/formAttachment?parentId=12&projectType=1&projectId=${projectRecords.id}&reviewFee='+$('#reviewFee').val(),'500px','350px',false,'inputForm','file_gistdata')" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 添加类型</a>
+				</div>
+				<div id="addFile_gistdata" style="display: none" class="upload-progress">
+					<span id="fileName_gistdata" ></span>
+					<span id="_gistdata" ></span>
+					<b><span id="baifenbi_gistdata" ></span></b>
+					<div class="progress">
+						<div id="jindutiao_gistdata" class="progress-bar" style="width: 0%" aria-valuenow="0">
+						</div>
+					</div>
+				</div>
+				<input id="gistdata_file" type="file" name="gistdata_file" multiple="multiple" style="display: none;" onChange="if(this.value)gistdataInsertTitle(this.value);"/>
+				<span id="gistdata_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="gistdata_upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>电子件名称</th>
+							<th width="100px">最大容量(M)</th>
+							<th width="18%">类型限制</th>
+							<th>文件名</th>
+							<th width="150px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_gistdata">
+						<c:forEach items="${projectcontentinfo.fileGistdataList}" var = "fileGistdata" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<td style="display:none">${fileGistdata.id}</td>
+								<td style="display:none">${fileGistdata.mustFlag}</td>
+								<c:choose>
+									<c:when test="${fileGistdata.mustFlag == 1}">
+										<td><span style="color: red">* </span>${fileGistdata.attachName}</td>
+									</c:when>
+									<c:otherwise>
+										<td>${fileGistdata.attachName}</td>
+									</c:otherwise>
+								</c:choose>
+								<td>${fileGistdata.attachLength}</td>
+								<td>${fileGistdata.attachTypes}</td>
+								<td>
+									<c:forEach items="${fileGistdata.workAttachments}" var = "workAttachment" varStatus="status">
+										<a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workAttachment.url}','90%','90%')">${workAttachment.attachmentName} ; </a>
+									</c:forEach>
+								</td>
+								<td class="op-td">
+									<div class="op-btn-box" >
+										<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${fileGistdata.id}&projectId=${projectRecords.id}','70%','80%',false,'inputForm','gistdata_upTable')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+									</div>
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+			<script type="text/template" id="gistdataTpl">//<!--
+                <tr id="budgetList{{idx}}">
+                    <td class="hide">
+                        <input id="gistdataTpl{{idx}}_id" type="hidden" value="{{row.id}}" class="clientId"/>
+                    </td>
+                    <td class="hide">
+                        0
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.attachName}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.attachLength}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.attachTypes}}
+                    </td>
+                    <td style="text-align:center;">
+
+                    </td>
+					<td class="op-td">
+						<div class="op-btn-box" >
+							<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${projectRecords.id}','70%','80%',false,'inputForm','gistdata_upTable')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+						</div>
+					</td>
+                </tr>//-->
+			</script>
+
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>其他文件</h2></div>
+				<div class="layui-item nav-btns">
+					<%--<a id="other_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>--%>
+					<a href="javascript:void(0)"  onclick="formAttachment('添加类型', '${ctx}/projectAccessoryRelation/projectAccessoryRelation/formAttachment?parentId=13&projectType=1&projectId=${projectRecords.id}&reviewFee='+$('#reviewFee').val(),'500px','350px',false,'inputForm','file_other')" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 添加类型</a>
+				</div>
+				<div id="addFile_other" style="display: none" class="upload-progress">
+					<span id="fileName_other" ></span>
+					<span id="_other" ></span>
+					<b><span id="baifenbi_other" ></span></b>
+					<div class="progress">
+						<div id="jindutiao_other" class="progress-bar" style="width: 0%" aria-valuenow="0">
+						</div>
+					</div>
+				</div>
+				<input id="other_file" type="file" name="other_file" multiple="multiple" style="display: none;" onChange="if(this.value)otherInsertTitle(this.value);"/>
+				<span id="other_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="upTable_other" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>电子件名称</th>
+							<th width="100px">最大容量(M)</th>
+							<th width="18%">类型限制</th>
+							<th>文件名</th>
+							<th width="150px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_other">
+						<c:forEach items="${projectcontentinfo.fileOtherList}" var = "fileOther" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<td style="display:none">${fileOther.id}</td>
+								<td style="display:none">${fileOther.mustFlag}</td>
+								<c:choose>
+									<c:when test="${fileOther.mustFlag == 1}">
+										<td><span style="color: red">* </span>${fileOther.attachName}</td>
+									</c:when>
+									<c:otherwise>
+										<td>${fileOther.attachName}</td>
+									</c:otherwise>
+								</c:choose>
+								<td>${fileOther.attachLength}</td>
+								<td>${fileOther.attachTypes}</td>
+								<td>
+									<c:forEach items="${fileOther.workAttachments}" var = "workAttachment" varStatus="status">
+										<a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workAttachment.url}','90%','90%')">${workAttachment.attachmentName} ; </a>
+									</c:forEach>
+								</td>
+								<td class="op-td">
+									<div class="op-btn-box" >
+										<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${fileOther.id}&projectId=${projectRecords.id}','70%','80%',false,'inputForm','upTable_other')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+									</div>
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+			<script type="text/template" id="otherTpl">//<!--
+                <tr id="budgetList{{idx}}">
+                    <td class="hide">
+                        <input id="otherTpl{{idx}}_id" type="hidden" value="{{row.id}}" class="clientId"/>
+                    </td>
+                    <td class="hide">
+                        0
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.attachName}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.attachLength}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.attachTypes}}
+                    </td>
+                    <td style="text-align:center;">
+
+                    </td>
+					<td class="op-td">
+						<div class="op-btn-box" >
+							<a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${projectRecords.id}','70%','80%',false,'inputForm','upTable_other')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+						</div>
+					</td>
+                </tr>//-->
+			</script>
+		<div class="form-group layui-row page-end"></div>
+		</form:form>
+	</div>
+</div>
+<script>
+	function openBill2(title,url,width,height,target,formId,tableId){
+		var rows = $(this).parent().prevAll().length + 1;
+		var frameIndex = parent.layer.getFrameIndex(window.name);
+		var urls = url+"&index="+frameIndex;
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin:"two-btns",
+			maxmin: false, //开启最大化最小化按钮
+			content: urls ,
+			btn: ['确定','关闭'],
+			yes: function(index, layero){
+				var body = top.layer.getChildFrame('body', index);
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var inputForm = body.find('#inputForm');
+				var top_iframe;
+				if(target){
+					top_iframe = target;//如果指定了iframe,则在改frame中跳转
+				}else{
+					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+				}
+				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+				inputForm.attr("action","${ctx}/projectAccessory/projectAccessory/saveWorkAttachment");//表单提交成功后,从服务器返回的url在当前tab中展示
+				var $document = iframeWin.contentWindow.document;
+
+				formSubmit2($document,formId,index,tableId);
+
+			},
+			cancel: function(index){
+			},
+			end:function () {
+				var reviewFee = $("#reviewFee").val();
+				$("#"+tableId).load(location.href+"&reviewFee="+reviewFee + " #"+tableId);
+			}
+		});
+	}
+	function formSubmit2($document,inputForm,index,tableId){
+
+		var validateForm = $($document.getElementById(inputForm)).validate({
+			submitHandler: function(form){
+				loading('正在提交,请稍等...');
+				form.submit();
+			},
+			errorContainer: "#messageBox",
+			errorPlacement: function(error, element) {
+				$($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+					error.appendTo(element.parent().parent());
+				} else {
+					error.insertAfter(element);
+				}
+			}
+		});
+		if(validateForm.form()){
+			$($document.getElementById(inputForm)).ajaxSubmit({
+				success:function(data) {
+					var d = data;
+					//输出提示信息
+					if(d.str.length>0){
+						parent.layer.msg(d.str,{icon:1});
+					}
+					var reviewFee = $("#reviewFee").val();
+					$("#"+tableId).load(location.href+"&reviewFee="+reviewFee + " #"+tableId);
+					//关闭当前页
+					top.layer.close(index)
+				}
+			});
+		}
+	}
+
+
+	//新增行方法
+	var fileAttachmentTpl = $("#fileAttachmentTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+	var gistdataTpl = $("#gistdataTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+	var otherTpl = $("#otherTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+
+	function formAttachment(title,url,width,height,target,formId,divId){
+		var rows = $(this).parent().prevAll().length + 1;
+		var frameIndex = parent.layer.getFrameIndex(window.name);
+		var urls = url;
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin:"two-btns",
+			maxmin: false, //开启最大化最小化按钮
+			content: urls ,
+			btn: ['确定','关闭'],
+			yes: function(index, layero){
+				var body = top.layer.getChildFrame('body', index);
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var inputForm = body.find('#inputForm');
+				var top_iframe;
+				inputForm.attr("action","${ctx}/projectTemplate/projectTemplate/getProjectTemplateInfo");//表单提交成功后,从服务器返回的url在当前tab中展示
+				var $document = iframeWin.contentWindow.document;
+				formSubmitAjax($document,formId,index,divId);
+
+			},
+			cancel: function(index){
+			}
+		});
+	}
+	function formSubmitAjax($document,inputForm,index,divId){
+		var validateForm = $($document.getElementById(inputForm)).validate({
+			submitHandler: function(form){
+				loading('正在提交,请稍等...');
+				form.submit();
+			},
+			errorContainer: "#messageBox",
+			errorPlacement: function(error, element) {
+				$($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+					error.appendTo(element.parent().parent());
+				} else {
+					error.insertAfter(element);
+				}
+			}
+		});
+		if(validateForm.form()){
+			$($document.getElementById(inputForm)).ajaxSubmit({
+				success:function(data) {
+					if(!data.success){
+						top.layer.msg("保存依据资料信息异常!",{icon:2});
+						return false;
+					}
+					var idx = ''
+					if(divId == 'file_attachment'){
+						idx = $("#file_attachment tr").length;
+						addRowBaseData("#file_attachment",idx,fileAttachmentTpl,data.body.projectAccessoryInfo);
+					}else if(divId == 'file_gistdata'){
+						idx = $("#file_gistdata tr").length;
+						addRowBaseData("#file_gistdata",idx,gistdataTpl,data.body.projectAccessoryInfo);
+					}else if(divId == 'file_other'){
+						idx = $("#file_other tr").length;
+						addRowBaseData("#file_other",idx,otherTpl,data.body.projectAccessoryInfo);
+					}
+					parent.layer.msg(data.msg,{icon:1});
+					top.layer.close(index)
+				}
+			});
+		}
+	}
+
+
+	function hasInArr(id,idArr) {
+		for(var i=0;i<idArr.length;i++){
+			if(id==$(idArr[i]).val()){
+				return true;
+			}
+		}
+		return false;
+	}
+	function existBaseData(id,length) {
+		for (var i=0;i<length;i++) {
+			var val = $('#file_attachment'+i+'_id').val();
+			if(id==val){
+				return true;
+			}
+		}
+		return false;
+	}
+
+	function addRowBaseData(list, idx, tpl, row){
+		bornTemplete(list, idx, tpl, row, idx);
+	}
+
+	function bornTemplete(list, idx, tpl, row, idx1){
+		var idx1 = '';
+		if(list == 'file_attachment'){
+			idx1 = $("#file_attachment tr").length +1;
+		}else if(list == 'file_gistdata'){
+			idx1 = $("#file_gistdata tr").length +1;
+		}else if(list == 'file_other'){
+			idx1 = $("#file_other tr").length +1;
+		}
+
+		$(list).append(Mustache.render(tpl, {
+			idx: idx, delBtn: true, row: row,
+			order:idx1 + 1, idx1:idx1
+		}));
+		$(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");
+				}
+			}
+		});
+	}
+	function delRowBaseData(obj, prefix,userId){
+		var id = $(prefix+"_id").val();
+		var currentUser = '${fns:getUser().id}';
+		var contentId = '${projectcontentinfo.projectContentData.id}';
+		console.log(contentId);
+		var condition = "${flag}";
+		$.ajax({
+			type:"post",
+			url:'${ctx}/projectcontentinfo/projectContentData/ajaxdelete',
+			data:{"contentId":contentId,"basedId":id,"condition":condition},
+			dataType:"json",
+			success:function(data){
+				if(data.success) {
+					if("according" == condition || "completion" == condition || "early" == condition || "claim" == condition || "design" == condition || "visa" == condition || "interim" == condition || "distribution" == condition || "material" == condition || "armor" == condition ){
+						$(obj).parent().parent().remove();
+					}else{
+						$(obj).parent().parent().remove();
+					}
+					if(data.body.inuse){
+						return;
+					}
+					if (currentUser == userId) {
+						confirmDelete('是否同步删除资料库的文件?','${ctx}/projectcontentinfo/projectcontentinfo/delete?infoId='+id+'&id=${projectcontentinfo.id}&type=1');
+					}
+				}else {
+					top.layer.msg("删除依据资料失败!", {icon: 0});
+				}
+			}
+		})
+		return;
+	}
+
+	function delBaseData(obj, prefix,userId){
+		var id = $(prefix+"_id").val();
+		var currentUser = '${fns:getUser().id}';
+		var contentId = '${projectcontentinfo.projectContentData.id}';
+		console.log(contentId);
+		var condition = "${flag}";
+		$.ajax({
+			type:"post",
+			url:'${ctx}/projectcontentinfo/projectContentData/ajaxdelete',
+			data:{"contentId":contentId,"basedId":id,"condition":condition},
+			dataType:"json",
+			success:function(data){
+				if(data.success) {
+					if("according" == condition || "completion" == condition || "early" == condition || "claim" == condition || "design" == condition || "visa" == condition || "interim" == condition || "distribution" == condition || "material" == condition || "armor" == condition ){
+						$(obj).parent().parent().parent().remove();
+					}else{
+						$(obj).parent().parent().remove();
+					}
+					if(data.body.inuse){
+						return;
+					}
+					if (currentUser == userId) {
+						confirmDelete('是否同步删除资料库的文件?','${ctx}/projectcontentinfo/projectcontentinfo/delete?infoId='+id+'&id=${projectcontentinfo.id}&type=1');
+					}
+				}else {
+					top.layer.msg("删除依据资料失败!", {icon: 0});
+				}
+			}
+		})
+		return;
+	}
+
+	function confirmDelete(mess, href){
+		top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
+			//do something
+			if (typeof href == 'function') {
+				href();
+			}else{
+				$.ajax({
+					url:href,
+					type:"post",
+					success:function(data){
+						if(data.success){
+							top.layer.msg("删除依据资料成功!", {icon: 0});
+						}
+					}
+				});
+			}
+			top.layer.close(index);
+		});
+		return false;
+	}
+</script>
+</body>
+</html>

+ 43 - 5
src/main/webapp/webpage/modules/ruralprojectrecords/ruralProjectRecordsList.jsp

@@ -280,12 +280,12 @@
 					<shiro:hasPermission name="ruralProject:ruralProjectRecords:add">
 						<table:addRow url="${ctx}/ruralProject/ruralProjectRecords/form" title="项目"></table:addRow><!-- 增加按钮 -->
 					</shiro:hasPermission>
-					<shiro:hasPermission name="ruralProject:ruralProjectRecords:del">
-						<%--<table:delRow url="${ctx}/project/projectRecords/deleteAll" id="contentTable"></table:delRow><!-- 删除按钮 -->--%>
-					</shiro:hasPermission>
 					<shiro:hasPermission name="ruralProject:ruralProjectRecords:export">
 						<table:exportExcel url="${ctx}/ruralProject/ruralProjectRecords/export"></table:exportExcel><!-- 导出按钮 -->
 					</shiro:hasPermission>
+					<shiro:hasPermission name="ruralProject:ruralProjectRecords:exportAll">
+						<button type="button" data-toggle="tooltip" data-placement="top" class="nav-btn nav-btn-delete" id="delUser"><i class="fa fa-file-excel-o"> 批量下载</i></button>
+					</shiro:hasPermission>
 					<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i>&nbsp;刷新</button>
 					<div style="clear: both;"></div>
 				</div>
@@ -306,10 +306,11 @@
     layui.use('table', function(){
         layui.table.render({
             limit:${ page.pageSize }
+			,id:"checkboxTable"
             ,elem: '#contentTable1'
             ,page: false
             ,cols: [[
-                // {checkbox: true, fixed: true},
+				{checkbox: true, fixed: true},
                 {field:'index',align:'center', title: '序号',width:40}
                 ,{field:'projName',align:'center', title: '项目名称',minWidth:200,templet:function(d){
                         return "<a class=\"attention-info\" title=\"" + d.projName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/ruralProject/ruralProjectRecords/view?id=" + d.id +"','95%', '95%')\">" + d.projName + "</a>";
@@ -339,7 +340,7 @@
                             var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
                         return xml;
                     }}
-                ,{field:'op',align:'center',title:"操作",width:130,templet:function(d){
+                ,{field:'op',align:'center',title:"操作",width:150,templet:function(d){
                         ////对操作进行初始化
                         var xml="";
                         if(d.canedit1 != undefined && d.canedit1 =="1")
@@ -362,6 +363,16 @@
                         {
                             xml+="<a href=\"${ctx}/ruralProject/ruralProjectRecords/revoke?id=" + d.id + "&processInstanceId=" + d.procId + "&projectStatus="+d.projectStatus+"\" onclick=\"return confirmx('确认要撤回该项目审批吗?', this.href)\" class=\"op-btn op-btn-cancel\" ><i class=\"glyphicon glyphicon-share-alt\"></i> 撤回</a>";
                         }
+                        //项目在没有归档完成之前可对文档进行操作
+                        if(d.recordStatus != undefined && d.recordStatus =="1")
+                        {
+							xml+="<a href=\"#\" onclick=\"openDialogView('文件上传', '${ctx}/ruralProject/ruralProjectRecords/formAccessory?id=" + d.id + "','95%', '95%')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 上传文件</a>";
+                        }
+						//项目在没有归档完成之前可对文档进行操作
+						if(d.adminAccessory != undefined && d.adminAccessory =="1")
+						{
+							xml+="<a href=\"#\" onclick=\"openDialogView('归档管理员文件上传', '${ctx}/ruralProject/ruralProjectRecords/formAccessory?id=" + d.id + "','95%', '95%')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 上传文件</a>";
+						}
                         if(d.canedit3 != undefined && d.canedit3 =="1")
                         {
                             //xml+="<a href=\"javascript:void(0)\" onclick=\"openDialogre('项目变更管理', '${ctx}/ruralProject/ruralProjectRecordsAlter/form?alterBeforeRecords.id='+encodeURIComponent('" + d.id + "'),'95%','95%','','送审,暂存,关闭')\" style=\"color: white;background: darkseagreen\" class=\"op-btn op-btn-op-btn-revert\" ><i class=\"fa fa-edit\"></i> 变更</a>";
@@ -390,6 +401,7 @@
                     ,"createDate":"<fmt:formatDate value="${projectRecords.createDate}" pattern="yyyy-MM-dd"/>"
                     ,"projectStatus":"${projectRecords.projectStatus}"
                     ,"procId":"${projectRecords.processInstanceId}"
+					,"projectReportRecordStatus":"${projectRecords.projectReportRecordStatus}"
 					,"flagAdmin":"${projectRecords.flagAdmin}"
                     <c:choose><c:when test="${flag == '1' or fns:getUser().id == projectRecords.createBy.id}">
                     <shiro:hasPermission name="ruralProject:ruralProjectRecords:del">,"candel":	<c:choose><c:when test="${(projectRecords.projectStatus == 1 or projectRecords.projectStatus == 3 or projectRecords.projectStatus == 4) && fns:getUser().id == projectRecords.createBy.id}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose></shiro:hasPermission>
@@ -398,6 +410,7 @@
                     ,"canrecall":<c:choose><c:when test="${projectRecords.projectStatus == 3 && fns:getUser().id == projectRecords.createBy.id}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
                     </shiro:hasPermission>
                     ,"cancancel":<c:choose><c:when test="${projectRecords.projectStatus == 2 && fns:getUser().id == projectRecords.createBy.id}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+                    ,"recordStatus":<c:choose><c:when test="${'5' != projectRecords.projectReportRecordStatus && projectRecords.projectStatus == 5}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
                     ,"deleteAdmin":<c:choose><c:when test="${'1' == projectRecords.flagAdmin && projectRecords.projectStatus == 5}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
                     </c:when>
                     <c:otherwise>
@@ -407,9 +420,17 @@
                     ,"canrecall":"0"
                     ,"cancancel":"0"
                     ,"deleteAdmin":"0"
+                    ,"recordStatus":"0"
                     </c:otherwise>
                     </c:choose>
                     <shiro:hasPermission name="ruralProject:ruralProjectRecords:edit">,"canedit3":<c:choose><c:when test="${projectRecords.projectStatus == 5 && fn:contains(projectRecords.leaderIds,fns:getUser().id)}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose></shiro:hasPermission>
+					<shiro:hasPermission name="ruralProject:ruralProjectRecords:adminAccessory">
+					,"adminAccessory":
+							<c:choose>
+							<c:when test="${projectRecords.projectStatus == 5 && '5' != projectRecords.projectReportRecordStatus}">"1"</c:when>
+					<c:otherwise>"0"</c:otherwise>
+					</c:choose>
+					</shiro:hasPermission>
                 }
                 </c:forEach>
                 </c:if>
@@ -417,6 +438,23 @@
             // ,even: true
             // ,height: 315
         });
+		$("#delUser").bind("click",function () {
+			//获得表格CheckBox已经选中的行的信息
+			var checkList = layui.table.checkStatus('checkboxTable').data;
+			//定义数组存放批量删除的行的id
+			var listId = [];
+			//进行遍历所有选中行数据,拿出每一行的id存储到数组中
+			$.each(checkList, function (i, data) {
+				listId.push(data.id);
+			});
+			if (listId.length <= 0) {
+				layer.msg("请选择需要下载的项目信息", {icon: 2})
+			} else {
+				$("#searchForm").attr("action","${ctx}/ruralProject/ruralProjectRecords/exportAll?listId="+ listId);
+				$("#searchForm").submit();
+				return true;
+			}
+		});
     })
 
     resizeListTable();

+ 32 - 4
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/reportForm.jsp

@@ -343,14 +343,14 @@
 		}
 
 		function getAttachment() {
-        	var projectSort = $("#projectSort").val();
+        	/*var projectSort = $("#projectSort").val();
         	//0为非打包项目
-        	if(projectSort == 0){
+        	if(projectSort == 0){*/
 				var reviewFee = $("#reviewFee").val();
 				$("#upTable").load(location.href+"&reviewFee="+reviewFee + " #upTable");
 				$("#gistdata_upTable").load(location.href+"&reviewFee="+reviewFee + " #gistdata_upTable");
 				$("#upTable_other").load(location.href+"&reviewFee="+reviewFee + " #upTable_other");
-			}
+			/*}*/
 		}
 
 		function getApprovalFee() {
@@ -467,7 +467,7 @@
 		<form:hidden path="projectReportData.id"/>
 		<form:hidden path="projectReportData.createBy.id"/>
 		<form:hidden path="project.id"/>
-		<input type="hidden" id="projectSort" value="${projectSort}">
+		<%--<input type="hidden" id="projectSort" value="${projectSort}">--%>
 		<sys:message content="${message}"/>
 		<div class="form-group layui-row first lw12">
 			<div class="form-group-label"><h2>基本信息</h2></div>
@@ -495,6 +495,34 @@
 					</form:select>
 				</div>
 			</div>
+			<c:choose>
+				<c:when test="${not empty projectcontentinfo.projectReportData.bzshbUserId}">
+					<div class="layui-item layui-col-sm6 lw7">
+						<label class="layui-form-label"><span class="require-item">*</span>审核人员:</label>
+						<div class="layui-input-block">
+							<select class="form-control required editable-select layui-input" id="bzshbUserId" disabled="disabled" name="projectReportData.bzshbUserId">
+								<option value=""/>
+								<c:forEach items="${projectRecords.bzshbUserList}" var="user" varStatus="status">
+									<option value="${user.id}" <c:if test="${projectcontentinfo.projectReportData.bzshbUserId eq user.id }">selected</c:if>>${user.name}</option>
+								</c:forEach>
+							</select>
+						</div>
+					</div>
+				</c:when>
+				<c:otherwise>
+					<div class="layui-item layui-col-sm6 lw7">
+						<label class="layui-form-label"><span class="require-item">*</span>审核人员:</label>
+						<div class="layui-input-block">
+							<select class="form-control required editable-select layui-input" id="bzshbUserId"  name="projectReportData.bzshbUserId">
+								<option value=""/>
+								<c:forEach items="${projectRecords.bzshbUserList}" var="user" varStatus="status">
+									<option value="${user.id}">${user.name}</option>
+								</c:forEach>
+							</select>
+						</div>
+					</div>
+				</c:otherwise>
+			</c:choose>
 			<%--<div class="layui-item layui-col-sm6">
 				<label class="layui-form-label"><span class="require-item">*</span>签章类型:</label>
 				<div class="layui-input-block">

+ 2 - 4
src/main/webapp/webpage/modules/workclientinfo/workClientInfoForm.jsp

@@ -240,8 +240,6 @@
                 }
             )
 
-           dismissDiv();
-
         });
 
 		function testOurBank(value){
@@ -537,10 +535,10 @@
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
-                    <label class="layui-form-label">公司电话:</label>
+                    <label class="layui-form-label"><span class="require-item">*</span>公司电话:</label>
                     <div class="layui-input-block">
                         <form:input path="telephone" id="telephone" htmlEscape="false" maxlength="11"
-                                    class="form-control isTel layui-input"/>
+                                    class="form-control isTel layui-input required"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">

+ 10 - 2
src/main/webapp/webpage/modules/workcontractinfo/workContractInfoFormAdd.jsp

@@ -608,12 +608,12 @@
 							</div>--%>
 							<div class="layui-item layui-col-sm6">
 								<label class="layui-form-label"><span class="require-item">*</span>客户名称:</label>
-								<div class="layui-input-block with-icon" style="margin-right:95px;">
+								<div class="layui-input-block with-icon" <%--style="margin-right:95px;"--%>>
 									<sys:gridselectclien1 url="${ctx}/workcontractinfo/workContractInfo/selectclientAhref" id="client" name="client.id"  value="${workContractInfo.client.id}"  title="选择客户" labelName="client.name"
 														  labelValue="${workContractInfo.client.name}" cssClass="form-control layui-input required" fieldLabels="客户名称" fieldKeys="name" searchLabel="客户名称" searchKey="name" searchLabel1="联系人" searchKey1="workLinkName"></sys:gridselectclien1>
 
 								</div>
-								<a href="javascript:void(0)" onclick="openBill('新增客户管理', '${ctx}/workclientinfo/workClientInfo/form?param=2','90%','90%',false,'inputForm')" class="nav-btn nav-btn-add" style="margin-right: 0px;top:0px;right:16px;position: absolute;height:40px;line-height: 40px;"><i class="fa fa-plus"></i> 新增</a>
+								<%--<a href="javascript:void(0)" onclick="openBill('新增客户管理', '${ctx}/workclientinfo/workClientInfo/form?param=2','90%','90%',false,'inputForm')" class="nav-btn nav-btn-add" style="margin-right: 0px;top:0px;right:16px;position: absolute;height:40px;line-height: 40px;"><i class="fa fa-plus"></i> 新增</a>--%>
 							</div>
 							<div class="layui-item layui-col-sm6">
 								<label class="layui-form-label"><span class="require-item">*</span>合同名称:</label>
@@ -865,6 +865,14 @@
 			});
 		});
 	</script>
+	<script type="text/javascript">
+		var workClientInfoListRowIdx = 0,
+				workClientInfoListTpl = $("#workClientInfoListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
+		if ($("#id").val() || $("#aId").val()) {
+			workClientInfoListRowIdx = ${fn:length(workContractInfo.workClientInfoList)};
+		}
+
+	</script>
 </div>
 </body>
 </html>

+ 2 - 2
src/main/webapp/webpage/modules/workcontractinfo/workContractInfoFormEdit.jsp

@@ -557,12 +557,12 @@
 						<div class="form-group-label"><h2>合同基础信息</h2></div>
 						<div class="layui-item layui-col-sm6">
 							<label class="layui-form-label"><span class="require-item">*</span>客户名称:</label>
-							<div class="layui-input-block with-icon" style="margin-right:95px;">
+							<div class="layui-input-block with-icon" <%--style="margin-right:95px;"--%>>
 								<sys:gridselectclien1 url="${ctx}/workcontractinfo/workContractInfo/selectclientAhref" id="client" name="client.id"  value="${workContractInfo.client.id}"  title="选择客户" labelName="client.name"
 													  labelValue="${workContractInfo.client.name}" cssClass="form-control layui-input required" fieldLabels="客户名称" fieldKeys="name" searchLabel="客户名称" searchKey="name" searchLabel1="联系人" searchKey1="workLinkName"></sys:gridselectclien1>
 
 							</div>
-							<a href="javascript:void(0)" onclick="openBill('新增客户管理', '${ctx}/workclientinfo/workClientInfo/form?param=2','90%','90%',false,'inputForm')" class="nav-btn nav-btn-add" style="margin-right: 0px;top:0px;right:16px;position: absolute;height:40px;line-height: 40px;"><i class="fa fa-plus"></i> 新增</a>
+							<%--<a href="javascript:void(0)" onclick="openBill('新增客户管理', '${ctx}/workclientinfo/workClientInfo/form?param=2','90%','90%',false,'inputForm')" class="nav-btn nav-btn-add" style="margin-right: 0px;top:0px;right:16px;position: absolute;height:40px;line-height: 40px;"><i class="fa fa-plus"></i> 新增</a>--%>
 						</div>
 						<div class="layui-item layui-col-sm6">
 							<label class="layui-form-label"><span class="require-item">*</span>合同名称:</label>

+ 7 - 7
src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoList.jsp

@@ -230,7 +230,7 @@
                 ,{field:'office',align:'center', title: '部门', minWidth:100}
                 // ,{field:'role',align:'center', title: '岗位', minWidth:100}
                 ,{field:'jobGrade',align:'center', title: '职级', minWidth:100}
-                ,{field:'auditUserName',align:'center', title: '校审人员', minWidth:100
+                /*,{field:'auditUserName',align:'center', title: '校审人员', minWidth:100
                     ,event:'auditUserId',config:{type:'select',data:params,verify:true}
                     ,templet:function (d) {
                         if(d.auditUserName){
@@ -240,7 +240,7 @@
                             return  d.auditUserName;
                         }
                         return ''
-                    }}
+                    }}*/
                 ,{field:'status',align:'center', title: '员工状态', minWidth:80}
                 ,{field:'entryDate', align:'center',sort:true,title: '入职日期',width:100}
                 ,{field:'op',align:'center',title:"操作",width:130,templet:function(d){
@@ -281,13 +281,13 @@
             ]
         }).config.cols;
 
-        /**
+       /* /!**
          * 参数cols是table.render({})中的cols属性值
          * aop代理是基于event点击事件进行操作的,
          * 因此cols中务必开启event点击事件!
-         **/
+         **!/
         var aopTable = tableEdit.aopObj(cols); //获取一个aop对象
-        /**
+        /!**
          * 注意:
          * 1、 aopTable.on('tool(xxx)',function (obj) {})
          * 2、 table.on('tool(yyy)',function (obj) {})
@@ -295,7 +295,7 @@
          * 不能同时用,用了会造成后调用者覆盖前调用者。
          * 应该直接用1来代替2,因为1中包含了2中的事件。
          * 如果不相同,则可以同时使用。
-         **/
+         **!/
         aopTable.on('tool(tableEvent)',function (obj) {
             var field = obj.field; //单元格字段
             console.log(field);
@@ -320,7 +320,7 @@
                     parent.layer.msg(data.msg,{icon:1});
                 }
             });
-        });
+        });*/
 
     })