Browse Source

项目类型附件设置管理页

user5 4 years ago
parent
commit
3c9d5eb691
15 changed files with 1422 additions and 12 deletions
  1. 31 0
      src/main/java/com/jeeplus/modules/projectAccessory/dao/ProjectAccessoryRelationDao.java
  2. 10 1
      src/main/java/com/jeeplus/modules/projectAccessory/dao/ProjectTemplateDao.java
  3. 132 0
      src/main/java/com/jeeplus/modules/projectAccessory/entity/ProjectAccessoryRelationInfo.java
  4. 94 0
      src/main/java/com/jeeplus/modules/projectAccessory/entity/ProjectAccessoryRelationTree.java
  5. 3 3
      src/main/java/com/jeeplus/modules/projectAccessory/entity/ProjectTemplateInfo.java
  6. 157 0
      src/main/java/com/jeeplus/modules/projectAccessory/service/ProjectAccessoryRelationService.java
  7. 20 0
      src/main/java/com/jeeplus/modules/projectAccessory/service/ProjectTemplateService.java
  8. 203 0
      src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectAccessoryRelationController.java
  9. 0 5
      src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectTemplateController.java
  10. 132 0
      src/main/resources/mappings/modules/projectAccessory/ProjectAccessoryRelationDao.xml
  11. 10 1
      src/main/resources/mappings/modules/projectAccessory/ProjectTemplateDao.xml
  12. 85 0
      src/main/webapp/webpage/modules/projectAccessory/projectAccessoryRelation/projectAccessoryRelationForm.jsp
  13. 465 0
      src/main/webapp/webpage/modules/projectAccessory/projectAccessoryRelation/projectAccessoryRelationList.jsp
  14. 76 0
      src/main/webapp/webpage/modules/projectAccessory/projectAccessoryRelation/projectAccessoryRelationView.jsp
  15. 4 2
      src/main/webapp/webpage/modules/projectAccessory/projectTemplate/projectTemplateList.jsp

+ 31 - 0
src/main/java/com/jeeplus/modules/projectAccessory/dao/ProjectAccessoryRelationDao.java

@@ -0,0 +1,31 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.projectAccessory.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.TreeDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
+import com.jeeplus.modules.projectAccessory.entity.TemplateTypeInfo;
+import com.jeeplus.modules.sys.entity.MainDictDetail;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * 复核标准(字典版)DAO接口
+ * @author ssrh
+ * @version 2018-06-01
+ */
+@MyBatisDao
+public interface ProjectAccessoryRelationDao extends CrudDao<ProjectAccessoryRelationInfo>,TreeDao<ProjectAccessoryRelationInfo> {
+    /**
+     * 获取所有父节点信息
+     * @return
+     */
+    List<ProjectAccessoryRelationInfo> projectAccessoryParentList();
+
+}

+ 10 - 1
src/main/java/com/jeeplus/modules/projectAccessory/dao/ProjectTemplateDao.java

@@ -44,7 +44,14 @@ public interface ProjectTemplateDao extends CrudDao<ProjectTemplateInfo>,TreeDao
      * @param parentId
      * @return
      */
-    List<ProjectTemplateInfo> projectAccessoryListByParentId(String parentId);
+    List<ProjectTemplateInfo> projectAccessoryListByParentId(@Param("parentId") String parentId,@Param("projectType") String projectType);
+
+    /**
+     * 根据父id获取子信息并保留当前id项
+     * @param parentId
+     * @return
+     */
+    List<ProjectTemplateInfo> getProjectTemplateListById(@Param("parentId") String parentId,@Param("projectType") String projectType,@Param("id") String id);
 
 
     /**
@@ -59,4 +66,6 @@ public interface ProjectTemplateDao extends CrudDao<ProjectTemplateInfo>,TreeDao
      * @return
      */
     List<MainDictDetail> getPostfixTypeById(String id);
+
+
 }

+ 132 - 0
src/main/java/com/jeeplus/modules/projectAccessory/entity/ProjectAccessoryRelationInfo.java

@@ -0,0 +1,132 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.projectAccessory.entity;
+
+
+import com.jeeplus.common.persistence.TreeEntity;
+
+import java.util.List;
+
+/**
+ * 项目与附件关系表Entity
+ * @author 徐滕
+ * @version 2020-11-19
+ */
+public class ProjectAccessoryRelationInfo extends TreeEntity<ProjectAccessoryRelationInfo>{
+
+	private static final long serialVersionUID = 1L;
+	private String attachName;		// 名称
+	private String projectType;		// 项目类型字典key
+	private String attachType;		// 附件类型字典key
+	private String attachId;		// 附件类型id
+	private Integer requiredStage;		// 必填阶段(1.上传报告,2.归档)
+	private String parentIds;		// 所有父ID
+	private String parentId;		// 父ID
+	private String requiredStageStr;		// 必填阶段(1.上传报告,2.归档)
+	private List<ProjectTemplateInfo> projectTemplateList;
+
+	public String getAttachName() {
+		return attachName;
+	}
+
+	public void setAttachName(String attachName) {
+		this.attachName = attachName;
+	}
+
+	public ProjectAccessoryRelationInfo() {
+		super();
+	}
+
+	public ProjectAccessoryRelationInfo(String id){
+		super(id);
+	}
+
+	public String getParentIds() {
+		return parentIds;
+	}
+
+	public void setParentIds(String parentIds) {
+		this.parentIds = parentIds;
+	}
+
+
+    public ProjectAccessoryRelationInfo getParent() {
+        return parent;
+    }
+
+    public void setParent(ProjectAccessoryRelationInfo parent) {
+        this.parent = parent;
+    }
+
+    public int getGrade(){
+        String[] split = this.getParentIds().split(",");
+        return split.length-1;
+    }
+	@Override
+	public String getName() {
+		return name;
+	}
+
+	@Override
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	@Override
+	public String getParentId() {
+		return parentId;
+	}
+
+	public void setParentId(String parentId) {
+		this.parentId = parentId;
+	}
+
+	public String getProjectType() {
+		return projectType;
+	}
+
+	public void setProjectType(String projectType) {
+		this.projectType = projectType;
+	}
+
+	public String getAttachType() {
+		return attachType;
+	}
+
+	public void setAttachType(String attachType) {
+		this.attachType = attachType;
+	}
+
+	public String getAttachId() {
+		return attachId;
+	}
+
+	public void setAttachId(String attachId) {
+		this.attachId = attachId;
+	}
+
+	public Integer getRequiredStage() {
+		return requiredStage;
+	}
+
+	public void setRequiredStage(Integer requiredStage) {
+		this.requiredStage = requiredStage;
+	}
+
+	public List<ProjectTemplateInfo> getProjectTemplateList() {
+		return projectTemplateList;
+	}
+
+	public void setProjectTemplateList(List<ProjectTemplateInfo> projectTemplateList) {
+		this.projectTemplateList = projectTemplateList;
+	}
+
+	public String getRequiredStageStr() {
+		return requiredStageStr;
+	}
+
+	public void setRequiredStageStr(String requiredStageStr) {
+		this.requiredStageStr = requiredStageStr;
+	}
+}

+ 94 - 0
src/main/java/com/jeeplus/modules/projectAccessory/entity/ProjectAccessoryRelationTree.java

@@ -0,0 +1,94 @@
+package com.jeeplus.modules.projectAccessory.entity;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+
+import java.util.List;
+
+/**
+ * @author: 大猫
+ * @create: 2020-10-26 14:58
+ **/
+public class ProjectAccessoryRelationTree {
+    private String id;        //id
+    private String attachName;    //名称
+    private String projectType;		// 项目类型字典key
+    private String attachType;		// 附件类型字典key
+    private String attachId;		// 附件类型id
+    private Integer requiredStage;		// 必填阶段(1.上传报告,2.归档)
+    private String requiredStageStr;		// 必填阶段(1.上传报告,2.归档)
+    private String pid;       //父级id
+    private Integer condition;   //标识 (1:代表第1级,剩下的以此类推)
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getAttachName() {
+        return attachName;
+    }
+
+    public void setAttachName(String attachName) {
+        this.attachName = attachName;
+    }
+
+    public String getProjectType() {
+        return projectType;
+    }
+
+    public void setProjectType(String projectType) {
+        this.projectType = projectType;
+    }
+
+    public String getAttachType() {
+        return attachType;
+    }
+
+    public void setAttachType(String attachType) {
+        this.attachType = attachType;
+    }
+
+    public String getAttachId() {
+        return attachId;
+    }
+
+    public void setAttachId(String attachId) {
+        this.attachId = attachId;
+    }
+
+    public Integer getRequiredStage() {
+        return requiredStage;
+    }
+
+    public void setRequiredStage(Integer requiredStage) {
+        this.requiredStage = requiredStage;
+    }
+
+    public String getPid() {
+        return pid;
+    }
+
+    public void setPid(String pid) {
+        this.pid = pid;
+    }
+
+    public Integer getCondition() {
+        return condition;
+    }
+
+    public void setCondition(Integer condition) {
+        this.condition = condition;
+    }
+
+    public String getRequiredStageStr() {
+        return requiredStageStr;
+    }
+
+    public void setRequiredStageStr(String requiredStageStr) {
+        this.requiredStageStr = requiredStageStr;
+    }
+}

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

@@ -20,7 +20,7 @@ public class ProjectTemplateInfo extends TreeEntity<ProjectTemplateInfo>{
 	private String attachName;		// 名称
 	private String indexNum;		// 排序
 	private String attachTypes;		// 附件类型
-	private Byte attachLength;		// 附件大小(单位:M)
+	private Integer attachLength;	// 附件大小(单位:M)
 	private String parentIds;		// 所有父ID
 	private String parentId;		// 父ID
 	private String companyId;   //公司id
@@ -107,11 +107,11 @@ public class ProjectTemplateInfo extends TreeEntity<ProjectTemplateInfo>{
 		this.attachTypes = attachTypes;
 	}
 
-	public Byte getAttachLength() {
+	public Integer getAttachLength() {
 		return attachLength;
 	}
 
-	public void setAttachLength(Byte attachLength) {
+	public void setAttachLength(Integer attachLength) {
 		this.attachLength = attachLength;
 	}
 

+ 157 - 0
src/main/java/com/jeeplus/modules/projectAccessory/service/ProjectAccessoryRelationService.java

@@ -0,0 +1,157 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.projectAccessory.service;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.TreeService;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.projectAccessory.dao.ProjectAccessoryRelationDao;
+import com.jeeplus.modules.projectAccessory.dao.ProjectTemplateDao;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationTree;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
+import com.jeeplus.modules.sys.entity.MainDictDetail;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.utils.DictUtils;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+
+/**
+ * 复核标准(字典版)Service
+ * @author ssrh
+ * @version 2018-06-01
+ */
+@Service
+@Transactional(readOnly = true)
+public class ProjectAccessoryRelationService extends TreeService<ProjectAccessoryRelationDao, ProjectAccessoryRelationInfo> {
+
+
+	public ProjectAccessoryRelationInfo get(String id) {
+		return super.get(id);
+	}
+
+    /**
+     * 获取项目附件模板类型
+     * @return
+     */
+	public static List<MainDictDetail> attachmentTemplateList(){
+	    return  DictUtils.getMainDictList("attachment_template_type");
+    }
+
+    /**
+     * 获取项目类型
+     * @return
+     */
+	public static List<MainDictDetail> attachmentProjectList(){
+	    return  DictUtils.getMainDictList("attachment_project_type");
+    }
+
+    /**
+     * 获取项目必填阶段
+     * @return
+     */
+	public static List<MainDictDetail> attachmentRequiredStageList(){
+	    return  DictUtils.getMainDictList("attachment_required_stage_type");
+    }
+
+    /**
+     * 查询所有数据
+     * @param projectTemplateInfo
+     * @return
+     */
+	public Map<String,List> findListTree(ProjectAccessoryRelationInfo projectTemplateInfo) {
+        Map<String,List> map = new HashMap<>();
+        //获取项目类型
+        List<MainDictDetail> attachmentProjectList = attachmentProjectList();
+        //新建树形列表集合
+        List<ProjectAccessoryRelationTree> treeList=new ArrayList<>();
+        if(attachmentProjectList.size()>0){
+            for (MainDictDetail projectDict:attachmentProjectList) {
+                //将项目类型放入树形列表集合中
+                ProjectAccessoryRelationTree recordTreeData = new ProjectAccessoryRelationTree();
+                //将界面需要展示数据放入类中
+                recordTreeData.setId(projectDict.getValue());
+                recordTreeData.setAttachName(projectDict.getLabel());
+                recordTreeData.setPid("0");
+                //将项目类型设置为第一级数据
+                recordTreeData.setCondition(1);
+                //将项目类型信息放入
+                treeList.add(recordTreeData);
+
+                //获取项目附件模板类型
+                List<MainDictDetail> attachmentTemplateList = attachmentTemplateList();
+                if(attachmentTemplateList.size()>0){
+                    //遍历项目中的项目附件模板类型信息
+                    for (MainDictDetail mainDict:attachmentTemplateList) {
+                        ProjectAccessoryRelationTree mainDictData = new ProjectAccessoryRelationTree();
+                        //将第一级id添加到二级id中,解决三级数据重复展示问题
+                        mainDictData.setId(recordTreeData.getId()+","+mainDict.getValue());
+                        mainDictData.setAttachName(mainDict.getLabel());
+                        mainDictData.setPid(recordTreeData.getId());
+
+                        //将项目附件模板类型设置为第二级数据
+                        mainDictData.setCondition(2);
+                        //将项目附件模板类型信息放入
+                        treeList.add(mainDictData);
+
+                        //根据条件查询第三级数据集合
+                        projectTemplateInfo.setProjectType(projectDict.getValue());
+                        projectTemplateInfo.setAttachType(mainDict.getValue());
+                        List<ProjectAccessoryRelationInfo> relationlist = super.findList(projectTemplateInfo);
+                        for (int j=0;j<relationlist.size();j++){
+                            ProjectAccessoryRelationTree contentData=new ProjectAccessoryRelationTree();
+                            ProjectAccessoryRelationInfo data=relationlist.get(j);
+
+                            for (MainDictDetail mainDictInfo: attachmentRequiredStageList()) {
+                                if(data.getRequiredStage() == Integer.parseInt(mainDictInfo.getValue())){
+                                    contentData.setRequiredStageStr(mainDictInfo.getLabel());
+                                    contentData.setRequiredStage(Integer.parseInt(mainDictInfo.getValue()));
+                                }
+                            }
+
+                            contentData.setPid(mainDictData.getId());
+                            contentData.setId(data.getId());
+                            contentData.setAttachName(data.getAttachName());
+
+                            //将具体类型设置为第三级数据
+                            contentData.setCondition(3);
+                            treeList.add(contentData);
+                        }
+
+                    }
+                }
+            }
+
+        }
+        map.put("data",treeList);
+        return map;
+    }
+
+    /**
+     * 新增
+     * @param projectTemplateInfo
+     */
+	@Transactional(readOnly = false)
+	public void save(ProjectAccessoryRelationInfo projectTemplateInfo) {
+        //根据条件进行新增或修改处理
+        if (StringUtils.isNotBlank(projectTemplateInfo.getId())){
+            projectTemplateInfo.preUpdate();
+            dao.update(projectTemplateInfo);
+        }else{
+            projectTemplateInfo.preInsert();
+            dao.insert(projectTemplateInfo);
+        }
+	}
+
+	@Transactional(readOnly = false)
+	public void delete(ProjectAccessoryRelationInfo projectTemplateInfo) {
+        dao.delete(projectTemplateInfo);
+	}
+
+}

+ 20 - 0
src/main/java/com/jeeplus/modules/projectAccessory/service/ProjectTemplateService.java

@@ -175,4 +175,24 @@ public class ProjectTemplateService extends TreeService<ProjectTemplateDao, Proj
         dao.deleteByLogic(projectTemplateInfo);
 	}
 
+    /**
+     * 根据parentId获取数据集
+     * @param parentId
+     * @param projectType
+     * @return
+     */
+	public List<ProjectTemplateInfo> getProjectTemplateList(String parentId,String projectType){
+	    return dao.projectAccessoryListByParentId(parentId,projectType);
+    }
+
+    /**
+     * 根据parentId获取数据集
+     * @param parentId
+     * @param projectType
+     * @return
+     */
+	public List<ProjectTemplateInfo> getProjectTemplateListById(String parentId,String projectType,String id){
+	    return dao.getProjectTemplateListById(parentId,projectType, id);
+    }
+
 }

+ 203 - 0
src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectAccessoryRelationController.java

@@ -0,0 +1,203 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.projectAccessory.web;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.utils.MyBeanUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationTree;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
+import com.jeeplus.modules.projectAccessory.service.ProjectAccessoryRelationService;
+import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
+import com.jeeplus.modules.projectConstruction.entity.ConstructionContract;
+import com.jeeplus.modules.projectVisa.entity.VisaTreeData;
+import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
+import com.jeeplus.modules.projectrecord.entity.ProjectImplementEarly;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.sys.entity.MainDictDetail;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.DictUtils;
+import com.jeeplus.modules.sys.utils.UserUtils;
+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.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.ConstraintViolationException;
+import java.util.*;
+
+/**
+ * 项目类型附件设置Controller
+ * @author 徐滕
+ * @version 2020-11-18
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/projectAccessoryRelation/projectAccessoryRelation")
+public class ProjectAccessoryRelationController extends BaseController {
+
+	@Autowired
+	private ProjectAccessoryRelationService projectAccessoryRelationService;
+
+	@Autowired
+	private ProjectTemplateService projectTemplateService;
+	
+	@ModelAttribute
+	public ProjectAccessoryRelationInfo get(@RequestParam(required=false) String id) {
+		ProjectAccessoryRelationInfo entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = projectAccessoryRelationService.get(id);
+		}
+		if (entity == null){
+			entity = new ProjectAccessoryRelationInfo();
+		}
+		return entity;
+	}
+
+	/**
+	 * 附件结构列表页面
+	 * @return
+	 */
+	@RequiresPermissions("projectAccessoryRelation:projectAccessoryRelation:list")
+	@RequestMapping(value = {"list", ""})
+	public String list(ProjectAccessoryRelationInfo projectAccessoryRelationInfo,Model model) {
+		model.addAttribute("projectAccessoryRelationInfo",projectAccessoryRelationInfo);
+		return "modules/projectAccessory/projectAccessoryRelation/projectAccessoryRelationList";
+	}
+
+	//获取树状图
+	@RequestMapping(value = "getAccessoryRelationList")
+	@ResponseBody
+	public Map<String,List> getAccessoryRelationList(ProjectAccessoryRelationInfo projectAccessoryRelationInfo){
+		return projectAccessoryRelationService.findListTree(projectAccessoryRelationInfo);
+	}
+
+
+
+	/**
+	 * 查看,增加,编辑附件结构表单页面
+	 * @param projectAccessoryRelationInfo
+	 * @param model
+	 * @return
+	 */
+	@RequiresPermissions(value={"projectAccessoryRelation:projectAccessoryRelation:add","projectAccessoryRelation:projectAccessoryRelation:edit"},logical=Logical.OR)
+	@RequestMapping(value = "form")
+	public String form(ProjectAccessoryRelationInfo projectAccessoryRelationInfo, Model model) {
+		//修改
+		if(StringUtils.isNotBlank(projectAccessoryRelationInfo.getId())){
+			projectAccessoryRelationInfo.setProjectTemplateList(projectTemplateService.getProjectTemplateListById(projectAccessoryRelationInfo.getAttachType(), projectAccessoryRelationInfo.getProjectType(),projectAccessoryRelationInfo.getId()));
+
+		} else if(StringUtils.isNotBlank(projectAccessoryRelationInfo.getParentIds())) {
+			//新增
+			//解析获取的父级id集合
+			if (StringUtils.isNotBlank(projectAccessoryRelationInfo.getParentIds())) {
+				String[] parentIds = projectAccessoryRelationInfo.getParentIds().split(",");
+				List<String> parentIdList = Arrays.asList(parentIds);
+				projectAccessoryRelationInfo.setProjectType(parentIdList.get(0));
+				projectAccessoryRelationInfo.setAttachType(parentIdList.get(1));
+			}
+			projectAccessoryRelationInfo.setProjectTemplateList(projectTemplateService.getProjectTemplateList(projectAccessoryRelationInfo.getAttachType(), projectAccessoryRelationInfo.getProjectType()));
+			//获取项目阶段 并进行处理展示数据信息
+			List<MainDictDetail> mainDictDetails = projectAccessoryRelationService.attachmentProjectList();
+			if (mainDictDetails.size() > 0) {
+				for (MainDictDetail info : mainDictDetails) {
+					if (info.getValue().equals(projectAccessoryRelationInfo.getProjectType())) {
+						projectAccessoryRelationInfo.setRequiredStageStr(info.getLabel());
+						projectAccessoryRelationInfo.setRequiredStage(Integer.parseInt(info.getValue()));
+						break;
+					}
+				}
+			}
+		}
+		model.addAttribute("projectAccessoryRelationInfo", projectAccessoryRelationInfo);
+		return "modules/projectAccessory/projectAccessoryRelation/projectAccessoryRelationForm";
+	}
+
+	/**
+	 * 查看
+	 * @param projectAccessoryInfo
+	 * @param model
+	 * @return
+	 */
+    @RequiresPermissions(value={"projectAccessoryRelation:projectAccessoryRelation:view"},logical=Logical.OR)
+    @RequestMapping(value = "view")
+    public String view(ProjectAccessoryRelationInfo projectAccessoryInfo, Model model) {
+        if(projectAccessoryInfo!=null&&projectAccessoryInfo.getParent()!=null&&StringUtils.isNotBlank(projectAccessoryInfo.getParent().getId())){
+			ProjectAccessoryRelationInfo parent = projectAccessoryRelationService.get(projectAccessoryInfo.getParent().getId());
+			projectAccessoryInfo.setParent(parent);
+            List<ProjectAccessoryRelationInfo> list = new ArrayList<>();
+            list.add(projectAccessoryInfo);
+        }
+        model.addAttribute("projectAccessoryInfo", projectAccessoryInfo);
+        return "modules/projectAccessory/projectAccessoryRelation/projectAccessoryRelationView";
+    }
+
+	/**
+	 * 保存附件结构
+	 * @param projectAccessoryInfo
+	 * @param model
+	 * @param redirectAttributes
+	 * @return
+	 * @throws Exception
+	 */
+	@RequiresPermissions(value={"projectAccessoryRelation:projectAccessoryRelation:add","projectAccessoryRelation:projectAccessoryRelation:edit"},logical=Logical.OR)
+	@RequestMapping(value = "save")
+	public String save(ProjectAccessoryRelationInfo projectAccessoryInfo, Model model, RedirectAttributes redirectAttributes) throws Exception{
+		if(!projectAccessoryInfo.getIsNewRecord()){//编辑表单保存
+			ProjectAccessoryRelationInfo t = projectAccessoryRelationService.get(projectAccessoryInfo.getId());//从数据库取出记录的值
+			MyBeanUtils.copyBeanNotNull2Bean(projectAccessoryInfo, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+			projectAccessoryRelationService.save(t);//保存
+		}else{//新增表单保存
+			projectAccessoryRelationService.save(projectAccessoryInfo);//保存
+		}
+		addMessage(redirectAttributes, "保存项目类型附件设置成功");
+		return "redirect:"+Global.getAdminPath()+"/projectAccessoryRelation/projectAccessoryRelation/?repage";
+	}
+
+	/**
+	 * 删除附件结构
+	 * @param projectAccessoryInfo
+	 * @param redirectAttributes
+	 * @return
+	 */
+	@RequiresPermissions("projectAccessoryRelation:projectAccessoryRelation:del")
+	@RequestMapping(value = "delete")
+	public String delete(ProjectAccessoryRelationInfo projectAccessoryInfo, RedirectAttributes redirectAttributes) {
+		projectAccessoryRelationService.delete(projectAccessoryInfo);
+		addMessage(redirectAttributes, "删除项目类型附件设置成功");
+		return "redirect:"+Global.getAdminPath()+"/projectAccessoryRelation/projectAccessoryRelation/?repage";
+	}
+
+	/**
+	 * 批量删除附件结构
+	 * @param ids
+	 * @param redirectAttributes
+	 * @return
+	 */
+	@RequiresPermissions("projectAccessoryRelation:projectAccessoryRelation:del")
+	@RequestMapping(value = "deleteAll")
+	public String deleteAll(String ids, RedirectAttributes redirectAttributes) {
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			projectAccessoryRelationService.delete(projectAccessoryRelationService.get(id));
+		}
+		addMessage(redirectAttributes, "删除项目类型附件设置成功");
+		return "redirect:"+Global.getAdminPath()+"/projectAccessoryRelation/projectAccessoryRelation/?repage";
+	}
+
+}

+ 0 - 5
src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectTemplateController.java

@@ -4,7 +4,6 @@
 package com.jeeplus.modules.projectAccessory.web;
 
 import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.json.AjaxJson;
 import com.jeeplus.common.persistence.Page;
@@ -14,14 +13,10 @@ import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.utils.excel.ExportExcel;
 import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.common.web.BaseController;
-import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo;
-import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryTree;
 import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
-import com.jeeplus.modules.projectAccessory.service.ProjectAccessoryService;
 import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.utils.DictUtils;
-import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;

+ 132 - 0
src/main/resources/mappings/modules/projectAccessory/ProjectAccessoryRelationDao.xml

@@ -0,0 +1,132 @@
+<?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.projectAccessory.dao.ProjectAccessoryRelationDao">
+    
+	<sql id="workReviewStandardColumns">
+		a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.project_type AS "projectType",
+		a.attach_type AS "attachType",
+		a.attach_id AS "attachId",
+		a.required_stage AS "requiredStage"
+	</sql>
+	
+    
+	<select id="get" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo" >
+		SELECT 
+			<include refid="workReviewStandardColumns"/>
+		FROM project_accessory_relation_info a
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo" >
+		SELECT 
+			<include refid="workReviewStandardColumns"/>
+			,ptsi.attach_name as "attachName"
+		FROM project_accessory_relation_info a
+		left join project_template_structure_info ptsi on ptsi.id = a.attach_id
+		<where>
+		a.del_flag = 0
+			<if test="projectType!=null and projectType != ''">
+				and a.project_type = #{projectType}
+			</if>
+			<if test="attachType!=null and attachType != ''">
+				and a.attach_type = #{attachType}
+			</if>
+			<if test="attachName!=null and attachName != ''">
+				and ptsi.attach_name like concat('%',#{attachName},'%')
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date
+			</otherwise>
+		</choose>
+	</select>
+
+	<select id="projectAccessoryParentList" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo" >
+		SELECT
+			a.id as "id", a.attach_name as "type",a.parent_id as "pid"
+		FROM project_accessory_relation_info a
+		where a.parent_id ="0"
+	</select>
+	
+	<select id="findAllList" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo" >
+		SELECT 
+			<include refid="workReviewStandardColumns"/>
+		FROM project_accessory_relation_info a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+		</where>		
+		<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>
+	
+	<insert id="insert">
+		INSERT INTO project_accessory_relation_info(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			project_type,
+			attach_type,
+			attach_id,
+			required_stage
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{projectType},
+			#{attachType},
+			#{attachId},
+			#{requiredStage}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE project_accessory_relation_info SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			project_type = #{projectType},
+			attach_type = #{attachType},
+			attach_id = #{attachId},
+			required_stage = #{requiredStage}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM project_accessory_relation_info
+		WHERE id = #{id}
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE project_accessory_relation_info SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+</mapper>

+ 10 - 1
src/main/resources/mappings/modules/projectAccessory/ProjectTemplateDao.xml

@@ -69,9 +69,18 @@
 
 	<select id="projectAccessoryListByParentId" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo" >
 		SELECT
-			a.id as "id", a.attach_name as "type",a.parent_id as "pid"
+			a.id as "id", a.attach_name as "attachName",a.parent_id as "parentId"
+		FROM project_template_structure_info a
+		where a.parent_id =#{parentId}
+		and a.id not in(select attach_id from project_accessory_relation_info where project_type = #{projectType} and attach_type = #{parentId} )
+	</select>
+
+	<select id="getProjectTemplateListById" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo" >
+		SELECT
+			a.id as "id", a.attach_name as "attachName",a.parent_id as "parentId"
 		FROM project_template_structure_info a
 		where a.parent_id =#{parentId}
+		and a.id not in(select attach_id from project_accessory_relation_info where project_type = #{projectType} and attach_type = #{parentId} and id != #{id})
 	</select>
 	
 	<select id="findAllList" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo" >

+ 85 - 0
src/main/webapp/webpage/modules/projectAccessory/projectAccessoryRelation/projectAccessoryRelationForm.jsp

@@ -0,0 +1,85 @@
+<%@ 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;
+		}
+		#standardDetail-error{
+			top:82px;
+			left:0;
+		}
+	</style>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+		  	$("#inputForm").submit();
+		  	return true;
+		  }
+	
+		  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);
+					}
+				}
+			});
+            var edit = "${workReviewStandard.id}";
+            if(edit!=null && edit!=''){
+                $("#reviewParentButton").attr("disabled","disabled");
+            }
+		});
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="projectAccessoryRelationInfo" action="${ctx}/projectAccessoryRelation/projectAccessoryRelation/save" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<input type="hidden" id="attachType" name="attachType" value="${projectAccessoryRelationInfo.attachType}">
+		<input type="hidden" id="projectType" name="projectType" value="${projectAccessoryRelationInfo.projectType}">
+			<div class="form-group layui-row first">
+				<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">
+						<form:select path="attachId" cssClass="form-control required simple-select">
+							<form:option value="" label=""/>
+							<c:forEach items="${projectAccessoryRelationInfo.projectTemplateList}" var = "template" varStatus="status">
+								<option value="${template.id}" <c:if test="${projectAccessoryRelationInfo.attachId==template.id}">selected</c:if>>${template.attachName}</option>
+							</c:forEach>
+						</form:select>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 ">
+					<label class="layui-form-label"><span class="require-item">*</span>必填阶段:</label>
+					<div class="layui-input-block">
+						<form:select path="requiredStage" cssClass="form-control required simple-select">
+							<form:option value="" label=""/>
+							<form:options items="${fns:getMainDictList('attachment_required_stage_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+						</form:select>
+					</div>
+				</div>
+			</div>
+		</form:form>
+	</div>
+</div>
+</body>
+</html>

+ 465 - 0
src/main/webapp/webpage/modules/projectAccessory/projectAccessoryRelation/projectAccessoryRelationList.jsp

@@ -0,0 +1,465 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>签证管理</title>
+	<meta name="decorator" content="default"/>
+	<link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
+	<style>
+		.layui-table th{
+			font-size: 14px;
+			/*表头内容居中显示*/
+			text-align: center;
+		}
+		.pid{
+			font-size:14px;
+			font-weight:400;
+		}
+	</style>
+	<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'
+			});
+			laydate.render({
+				elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+			});
+		});
+
+		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) {
+				}
+			});
+		}
+
+
+		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="projectAccessoryRelationInfo" action="${ctx}/projectAccessoryRelation/projectAccessoryRelation/list" 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}"/>
+					<div class="commonQuery lw14">
+						<div class="layui-item query athird">
+							<label class="layui-form-label">附件名称:</label>
+							<div class="layui-input-block">
+								<form:input path="attachName" htmlEscape="false" maxlength="255"  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>
+				</form:form>
+			</div>
+		</div>
+		<div class="full-width fl">
+			<div class="layui-form contentDetails contentShadow shadowLBR">
+				<div class="nav-btns">
+					<button class="nav-btn layui-btn" id="btn-expand">全部展开</button>
+					<button class="nav-btn layui-btn-warm" id="btn-fold">全部折叠</button>
+					<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 id="permissionTable" class="layui-table" lay-filter="permissionTable"></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>
+
+	resizeListTable();
+	$("a").on("click",addLinkVisied);
+</script>
+<script>
+	resizeListWindow2();
+	$(window).resize(function(){
+		resizeListWindow2();
+	});
+</script>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script src="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.js" charset="utf-8"></script>
+<script>
+	/*使用模块加载的方式 加载文件*/
+	layui.config({
+		base: '${ctx}/resoueces/css/layui/module/'
+	}).extend({
+		treetable: 'treetable-lay/treetable'
+	}).use(['layer', 'table', 'treetable'], function () {
+		var $ = layui.jquery;
+		var table = layui.table;
+		var layer = layui.layer;
+		var treetable = layui.treetable;
+
+		// 渲染表格
+		var renderTable = function () {
+			var attachName = $("#attachName").val();
+			if(undefined == attachName){
+				attachName = "";
+			}
+			layer.load(2);
+			treetable.render({
+				treeColIndex: 1,//树形图标显示在第几列
+				treeSpid: 0,//最上级的父级id
+				treeIdName: 'permissionId',//id字段的名称
+				treePidName: 'pid',//pid字段的名称
+				treeDefaultClose: false,//是否默认折叠
+				treeLinkage: true,//父级展开时是否自动展开所有子级
+				elem: '#permissionTable',
+				url: '${ctx}/projectAccessoryRelation/projectAccessoryRelation/getAccessoryRelationList?attachName='+attachName,
+				page: false,
+				cols: [[
+					{type: 'numbers', align:'center', title: '序号' ,width:80},
+					{field: 'attachName', title: '附件结构名称',templet:function(d){
+							if(d.condition ==1){
+								return "<font>"+d.attachName+"</font>";
+							}else if(d.condition ==2){
+								return "<font>"+d.attachName+"</font>";
+							}else{
+								return "<font>"+d.attachName+"</font>";
+							}
+						}},
+					{field: 'requiredStageStr', title: '必填阶段',templet:function(d){
+							if(d.condition ==1 || d.condition ==2){
+
+								return "";
+							}else{
+								if(d.requiredStageStr == null || d.requiredStageStr == ""){
+									return "";
+								}else{
+									return "<font>"+d.requiredStageStr+"</font>";
+								}
+							}
+						}},
+					{templet: complain, align:'center', title: '操作',width:160}
+				]],
+				done: function () {
+					layer.closeAll('loading');
+				}
+			});
+		};
+
+		renderTable();
+
+		//触发三个button按钮
+		$('#btn-expand').click(function () {
+			treetable.expandAll('#permissionTable');
+		});
+
+		$('#btn-fold').click(function () {
+			treetable.foldAll('#permissionTable');
+		});
+
+		$('#btn-refresh').click(function () {
+			renderTable();
+		});
+
+
+		function complain(d){//操作中显示的内容
+			if(d.condition ==1) {
+				return [
+					'',
+				].join('');
+			} else if(d.condition ==2) {
+				return [
+					'<a href="javascript:void(0)" onclick="openDialogreAudit(\'新增必填阶段\', \'${ctx}/projectAccessoryRelation/projectAccessoryRelation/form?parentIds='+d.id+' \',\'80%\',\'60%\')" style=\"color: white;background: darkseagreen\" class="op-btn op-btn-add" ><i class="fa fa-plus"></i> 新增附件关系</a>',
+				].join('');
+			} else if (d.condition ==3){
+				return [
+					'<a href="javascript:void(0)" onclick="openDialogreAudit(\'修改必填阶段\', \'${ctx}/projectAccessoryRelation/projectAccessoryRelation/form?id='+d.id+'\',\'80%\',\'60%\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>',
+					'<a href="${ctx}/projectAccessoryRelation/projectAccessoryRelation/delete?id='+d.id+'" onclick="return confirmx(\'确认要删除该必填阶段吗?\', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>'
+				].join('');
+			}else{
+				return [
+					'',
+				].join('');
+			}
+
+		}
+		//监听工具条
+		table.on('tool(permissionTable)', function (obj) {
+			var data = obj.data;
+			var layEvent = obj.event;
+			if(data.permissionName!=null){
+				if (layEvent === 'del') {
+					layer.msg('删除' + data.id);
+				} else if (layEvent === 'edit') {
+					layer.msg('修改' + data.id);
+				}
+			}
+		});
+	});
+
+</script>
+<script>
+	function openDialogres(title,url,width,height,target){
+
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin: 'three-btns',
+			maxmin: true, //开启最大化最小化按钮
+			content: url ,
+			btn: ['提交','暂存','关闭'],
+			btn1: function(index, layero){
+				var body = top.layer.getChildFrame('body', index);
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var inputForm = body.find('#inputForm');
+				var top_iframe;
+				if(target){
+					top_iframe = target;//如果指定了iframe,则在改frame中跳转
+				}else{
+					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+				}
+				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+				if(iframeWin.contentWindow.doSubmit(1) ){
+					//top.layer.close(index);//关闭对话框。
+					setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+				}
+			},
+			btn2:function(index,layero){
+				var body = top.layer.getChildFrame('body', index);
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var inputForm = body.find('#inputForm');
+				var top_iframe;
+				if(target){
+					top_iframe = target;//如果指定了iframe,则在改frame中跳转
+				}else{
+					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+				}
+				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+				if(iframeWin.contentWindow.doSubmit(2) ){
+					// top.layer.close(index);//关闭对话框。
+					setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+				}
+				return false;
+			},
+			btn3: function(index){
+			}
+		});
+	}
+	function openDialogreAudit(title,url,width,height,target){
+
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin: 'three-btns',
+			maxmin: true, //开启最大化最小化按钮
+			content: url ,
+			btn: ['提交','关闭'],
+			btn1: function(index, layero){
+				var body = top.layer.getChildFrame('body', index);
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var inputForm = body.find('#inputForm');
+				var top_iframe;
+				if(target){
+					top_iframe = target;//如果指定了iframe,则在改frame中跳转
+				}else{
+					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+				}
+				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+				if(iframeWin.contentWindow.doSubmit(1) ){
+					top.layer.close(index);//关闭对话框。
+					setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+				}
+
+			},
+			btn2: function(index){
+			}
+		});
+	}
+	// 确认对话框
+	function confirmxRefresh(mess, href){
+		top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
+			//do something
+			if (typeof href == 'function') {
+				href();
+			}else{
+				resetTip(); //loading();
+				$.ajax({
+					url:href,
+					data:$('#loginForm').serialize(),
+					type:"post",
+					success:function(data){
+						if(data.status){
+							parent.layer.msg(data.msg,{icon:1});
+						}else {
+							parent.layer.msg(data.msg,{icon:2});
+						}
+						//parent.refreshTrees();
+						location = '${ctx}/project/projectVisa/list';
+					}
+				});
+			}
+			top.layer.close(index);
+		});
+		return false;
+	}
+	// 确认对话框
+	function confirmxHintContent(mess, href){
+		$.ajax({
+			url:href,
+			data:$('#loginForm').serialize(),
+			type:"post",
+			success:function(data){
+				parent.layer.open({
+					title: '提示内容'
+					,shade: 0
+					,maxmin: true
+					,content: data.msg
+				});
+			}
+		});
+	}
+</script>
+</body>
+</html>

+ 76 - 0
src/main/webapp/webpage/modules/projectAccessory/projectAccessoryRelation/projectAccessoryRelationView.jsp

@@ -0,0 +1,76 @@
+<%@ 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(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+			  $("#inputForm").submit();
+			  return true;
+		  }
+	
+		  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);
+					}
+				}
+			});
+		});
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container view-form">
+		<form:form id="inputForm" modelAttribute="workReviewStandard" action="#" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+
+			<div class="form-group layui-row first">
+				<div class="form-group-label"><h2>标准信息</h2></div>
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label"><span class="require-item">*</span>上级节点:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workReviewStandard.parent.standardDetail}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12 with-textarea">
+					<label class="layui-form-label"><span class="require-item">*</span>标准内容:</label>
+					<div class="layui-input-block">
+						<textarea htmlEscape="false" readonly="true" rows="4" style="resize:none;" class="form-control required">${workReviewStandard.standardDetail}</textarea>
+					</div>
+				</div>
+				<c:if test="${workReviewStandard.proofread == 1}">
+					<div class="layui-item layui-col-sm12">
+						<label class="layui-form-label"><span class="require-item">*</span>最多扣分:</label>
+						<div class="layui-input-block">
+							<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workReviewStandard.maxDeduct}"/>
+						</div>
+					</div>
+				</c:if>
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label">序号:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true" class="form-control layui-input" value=" ${workReviewStandard.orderNum}"/>
+					</div>
+				</div>
+
+			</div>
+		</form:form>
+	</div>
+</div>
+</body>
+</html>

+ 4 - 2
src/main/webapp/webpage/modules/projectAccessory/projectTemplate/projectTemplateList.jsp

@@ -78,9 +78,11 @@
 						<tbody>
 						<c:forEach items="${list}" var="projectAccessory">
 							<tr id="${projectAccessory.id}" pid="${projectAccessory.parent.id}">
-								<td><a  href="#" onclick="openDialogView('查看附件结构', '${ctx}/projectTemplate/projectTemplate/view?id=${projectAccessory.id}','80%', '60%')">
+								<td><%--<a  href="#" onclick="openDialogView('查看附件结构', '${ctx}/projectTemplate/projectTemplate/view?id=${projectAccessory.id}','80%', '60%')">
 										${projectAccessory.attachName}
-								</a></td>
+								</a>--%>
+										${projectAccessory.attachName}
+								</td>
 								<td style="text-align: center">
 										${projectAccessory.attachTypes}
 								</td>