Procházet zdrojové kódy

文件库代码修改

user5 před 4 roky
rodič
revize
6b7638f67b
17 změnil soubory, kde provedl 2380 přidání a 84 odebrání
  1. 35 0
      src/main/java/com/jeeplus/modules/projectAccessory/dao/CollectAccessoryDao.java
  2. 23 1
      src/main/java/com/jeeplus/modules/projectAccessory/dao/ProjectAccessoryDao.java
  3. 104 3
      src/main/java/com/jeeplus/modules/projectAccessory/entity/CollectAccessoryInfo.java
  4. 213 0
      src/main/java/com/jeeplus/modules/projectAccessory/service/CollectAccessoryService.java
  5. 82 1
      src/main/java/com/jeeplus/modules/projectAccessory/service/ProjectAccessoryService.java
  6. 172 0
      src/main/java/com/jeeplus/modules/projectAccessory/web/CollectAccessoryController.java
  7. 88 2
      src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectAccessoryController.java
  8. 1 1
      src/main/java/com/jeeplus/modules/workactivity/service/WorkActivityProcessService.java
  9. 130 0
      src/main/resources/mappings/modules/collectAccessory/CollectAccessoryDao.xml
  10. 112 17
      src/main/resources/mappings/modules/projectAccessory/ProjectAccessoryDao.xml
  11. 64 0
      src/main/webapp/WEB-INF/tags/sys/collectSelect.tag
  12. 386 0
      src/main/webapp/webpage/modules/collectAccessory/collectAccessoryCompanyList.jsp
  13. 386 0
      src/main/webapp/webpage/modules/collectAccessory/collectAccessoryList.jsp
  14. 386 0
      src/main/webapp/webpage/modules/collectAccessory/collectAccessoryOfficeList.jsp
  15. 1 0
      src/main/webapp/webpage/modules/projectAccessory/selectCollectingAccessory.jsp
  16. 20 59
      src/main/webapp/webpage/modules/projectAccessory/workAttachmentForm.jsp
  17. 177 0
      src/main/webapp/webpage/modules/sys/collectSelect.jsp

+ 35 - 0
src/main/java/com/jeeplus/modules/projectAccessory/dao/CollectAccessoryDao.java

@@ -0,0 +1,35 @@
+package com.jeeplus.modules.projectAccessory.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.projectAccessory.entity.CollectAccessoryInfo;
+
+import java.util.List;
+
+/**
+ * @author: 徐滕
+ * @create: 2021-06-02 09:43
+ **/
+@MyBatisDao
+public interface CollectAccessoryDao extends CrudDao<CollectAccessoryInfo> {
+    /**
+     * 保存收藏的附件信息
+     * @param collectAccessoryInfo
+     * @return
+     */
+    int saveCollectAccessory (CollectAccessoryInfo collectAccessoryInfo);
+
+    /**
+     * 查询共享到部门的文件信息
+     * @param collectAccessoryInfo
+     * @return
+     */
+    List<CollectAccessoryInfo> getTypeList(CollectAccessoryInfo collectAccessoryInfo);
+
+    /**
+     * 查询共享到公司的文件信息
+     * @param collectAccessoryInfo
+     * @return
+     */
+    List<CollectAccessoryInfo> companyList(CollectAccessoryInfo collectAccessoryInfo);
+}

+ 23 - 1
src/main/java/com/jeeplus/modules/projectAccessory/dao/ProjectAccessoryDao.java

@@ -6,6 +6,7 @@ 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.CollectAccessoryInfo;
 import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo;
 import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryTree;
 import org.apache.ibatis.annotations.Param;
@@ -41,4 +42,25 @@ public interface ProjectAccessoryDao extends CrudDao<ProjectAccessoryInfo>,TreeD
      * @return
      */
     List<ProjectAccessoryTree> projectAccessoryListByParentId(String parentId);
-}
+
+    /**
+     * 保存收藏的附件信息
+     * @param collectAccessoryInfo
+     * @return
+     */
+    int saveCollectAccessory (CollectAccessoryInfo collectAccessoryInfo);
+
+    /**
+     * 根据保存的url查询保存的附件信息
+     * @param collectAccessoryInfo
+     * @return
+     */
+    CollectAccessoryInfo getCollectAccessoryInfo(CollectAccessoryInfo collectAccessoryInfo);
+
+    /**
+     * 根据类型查询附件信息
+     * @param collectAccessoryInfo
+     * @return
+     */
+    List<CollectAccessoryInfo> getCollectList(CollectAccessoryInfo collectAccessoryInfo);
+}

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

@@ -1,6 +1,7 @@
 package com.jeeplus.modules.projectAccessory.entity;
 
 import com.jeeplus.common.persistence.DataEntity;
+import com.jeeplus.modules.sys.entity.User;
 
 /**
  * @author: 大猫
@@ -8,9 +9,21 @@ import com.jeeplus.common.persistence.DataEntity;
  **/
 public class CollectAccessoryInfo extends DataEntity<CollectAccessoryInfo> {
 
-    private String url;
-    private String userId;
-    private String type;
+    private String url;     //附件路径
+    private String fileName;     //附件名称
+    private String userId;  //收藏人
+    private String type;    //收藏类型
+    private String officeId;    //部门id
+    private String companyId;    //公司id
+    private String temporaryUrl;    //临时查看url
+    private String uploadUserName;    //附件上传人
+    private String createDateStr;    //收藏时间
+    private Integer collectType;    //是否收藏收藏
+    private User collectUser;    //收藏人
+    private Integer officeFlag;     //部门判定
+    private Integer companyFlag;    //公司判定
+    private Integer individualFlag;    //个人判定
+
 
     public String getUrl() {
         return url;
@@ -20,6 +33,14 @@ public class CollectAccessoryInfo extends DataEntity<CollectAccessoryInfo> {
         this.url = url;
     }
 
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
     public String getUserId() {
         return userId;
     }
@@ -35,4 +56,84 @@ public class CollectAccessoryInfo extends DataEntity<CollectAccessoryInfo> {
     public void setType(String type) {
         this.type = type;
     }
+
+    public String getOfficeId() {
+        return officeId;
+    }
+
+    public void setOfficeId(String officeId) {
+        this.officeId = officeId;
+    }
+
+    public String getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(String companyId) {
+        this.companyId = companyId;
+    }
+
+    public String getTemporaryUrl() {
+        return temporaryUrl;
+    }
+
+    public void setTemporaryUrl(String temporaryUrl) {
+        this.temporaryUrl = temporaryUrl;
+    }
+
+    public String getUploadUserName() {
+        return uploadUserName;
+    }
+
+    public void setUploadUserName(String uploadUserName) {
+        this.uploadUserName = uploadUserName;
+    }
+
+    public String getCreateDateStr() {
+        return createDateStr;
+    }
+
+    public void setCreateDateStr(String createDateStr) {
+        this.createDateStr = createDateStr;
+    }
+
+    public Integer getCollectType() {
+        return collectType;
+    }
+
+    public void setCollectType(Integer collectType) {
+        this.collectType = collectType;
+    }
+
+    public User getCollectUser() {
+        return collectUser;
+    }
+
+    public void setCollectUser(User collectUser) {
+        this.collectUser = collectUser;
+    }
+
+    public Integer getOfficeFlag() {
+        return officeFlag;
+    }
+
+    public void setOfficeFlag(Integer officeFlag) {
+        this.officeFlag = officeFlag;
+    }
+
+    public Integer getCompanyFlag() {
+        return companyFlag;
+    }
+
+    public void setCompanyFlag(Integer companyFlag) {
+        this.companyFlag = companyFlag;
+    }
+
+    public Integer getIndividualFlag() {
+        return individualFlag;
+    }
+
+    public void setIndividualFlag(Integer individualFlag) {
+        this.individualFlag = individualFlag;
+    }
 }

+ 213 - 0
src/main/java/com/jeeplus/modules/projectAccessory/service/CollectAccessoryService.java

@@ -0,0 +1,213 @@
+package com.jeeplus.modules.projectAccessory.service;
+
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.modules.projectAccessory.dao.CollectAccessoryDao;
+import com.jeeplus.modules.projectAccessory.entity.CollectAccessoryInfo;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
+import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+
+/**
+ * @author: 徐滕
+ * @create: 2021-06-02 09:42
+ **/
+@Service
+@Transactional(readOnly = true)
+public class CollectAccessoryService extends CrudService<CollectAccessoryDao, CollectAccessoryInfo> {
+
+    @Autowired
+    private WorkattachmentService workattachmentService;
+    @Autowired
+    private WorkProjectNotifyService workProjectNotifyService;
+
+    public CollectAccessoryInfo get(String id) {
+        return super.get(id);
+    }
+
+    /**
+     * 查询所有数据
+     * @param collectAccessoryInfo
+     * @return
+     */
+    public Page<CollectAccessoryInfo> findPage(Page<CollectAccessoryInfo> page, CollectAccessoryInfo collectAccessoryInfo) {
+        String type = collectAccessoryInfo.getType();
+        //只能查询登陆人的信息
+        collectAccessoryInfo.setCreateBy(UserUtils.getUser());
+        int count = dao.queryCount(collectAccessoryInfo);
+        page.setCount(count);
+        page.setCountFlag(false);
+        collectAccessoryInfo.setPage(page);
+        List<CollectAccessoryInfo> list = super.findList(collectAccessoryInfo);
+        collectAccessoryInfo.setType("1");
+        List<CollectAccessoryInfo> individualList = dao.getTypeList(collectAccessoryInfo);
+        collectAccessoryInfo.setType("2");
+        List<CollectAccessoryInfo> officeList = dao.getTypeList(collectAccessoryInfo);
+        collectAccessoryInfo.setType("3");
+        List<CollectAccessoryInfo> companyList = dao.getTypeList(collectAccessoryInfo);
+        if("2".equals(type) || "3".equals(type)){
+            for (CollectAccessoryInfo individualInfo: individualList) {
+                for (CollectAccessoryInfo info: list) {
+                    if(individualInfo.getUrl().equals(info.getUrl())){
+                        info.setIndividualFlag(1);
+                        break;
+                    }
+                }
+            }
+        }else{
+            for (CollectAccessoryInfo officeInfo: officeList) {
+                for (CollectAccessoryInfo info: list) {
+                    if(officeInfo.getUrl().equals(info.getUrl())){
+                        info.setOfficeFlag(1);
+                        break;
+                    }
+                }
+            }
+            for (CollectAccessoryInfo companyInfo: companyList) {
+                for (CollectAccessoryInfo info: list) {
+                    if(companyInfo.getUrl().equals(info.getUrl())){
+                        info.setCompanyFlag(1);
+                        break;
+                    }
+                }
+            }
+        }
+
+        workattachmentService.attachmentManageByUrlOnCollect(list);
+        page.setList(list);
+        return page;
+    }
+
+
+
+    /**
+     * 新增收藏信息接口
+     * @param collectAccessoryInfo
+     */
+    @Transactional(readOnly = false)
+    public Integer saveCollectAccessory(CollectAccessoryInfo collectAccessoryInfo){
+        //添加收藏人id
+        collectAccessoryInfo.setUserId(UserUtils.getUser().getId());
+        //保存信息
+        collectAccessoryInfo.preInsert();
+        //添加创建人部门和公司id
+        collectAccessoryInfo.setOfficeId(UserUtils.getUser().getOffice().getId());
+        collectAccessoryInfo.setCompanyId(UserUtils.getUser().getCompany().getId());
+        //添加上传人信息
+        collectAccessoryInfo.setCollectUser(UserUtils.getUser());
+        int saveResult = dao.saveCollectAccessory(collectAccessoryInfo);
+        //判断收藏类型(1:个人收藏;2:部门收藏;3:公司收藏)
+        //部门收藏和公司收藏要给对应类型的所有人发送通知
+        if(1==saveResult){
+            switch (collectAccessoryInfo.getType()){
+                case "1":
+                    //个人收藏
+                    break;
+                case "2":
+                    //部门共享
+                    //根据部门id查询部门内所有人
+                    List<User> officeUserList = UserUtils.getOfficeUserList();
+                    for (User user : officeUserList) {
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(collectAccessoryInfo.getId(),
+                                                user,
+                                                user.getCompany().getId(),
+                                                "文件收藏成功",
+                                                "文件"+collectAccessoryInfo.getFileName()+"部门收藏成功",
+                                                "92",
+                                                "0",
+                                                "待通知",
+                                                "文件收藏成功"));
+                    }
+                    break;
+                case "3":
+                    //公司共享
+                    //根据公司id查询公司内所有人
+                    List<User> companyUserList = UserUtils.getCompanyUserList();
+                    for (User user : companyUserList) {
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(collectAccessoryInfo.getId(),
+                                                user,
+                                                user.getCompany().getId(),
+                                                "文件收藏成功",
+                                                "文件"+collectAccessoryInfo.getFileName()+"公司收藏成功",
+                                                "92",
+                                                "0",
+                                                "待通知",
+                                                "文件收藏成功"));
+                    }
+                    break;
+            }
+        }
+        return saveResult;
+    }
+
+
+
+    /**
+     * 新增收藏信息接口
+     * @param collectAccessoryInfo
+     */
+    @Transactional(readOnly = false)
+    public Integer shareSave(CollectAccessoryInfo collectAccessoryInfo){
+        //保存信息
+        collectAccessoryInfo.preInsert();
+        int saveResult = dao.saveCollectAccessory(collectAccessoryInfo);
+        //判断收藏类型(1:个人收藏;2:部门收藏;3:公司收藏)
+        //部门收藏和公司收藏要给对应类型的所有人发送通知
+        if(1==saveResult){
+            switch (collectAccessoryInfo.getType()){
+                case "1":
+                    //个人收藏
+                    break;
+                case "2":
+                    //部门共享
+                    //根据部门id查询部门内所有人
+                    List<User> officeUserList = UserUtils.getOfficeUserList();
+                    for (User user : officeUserList) {
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(collectAccessoryInfo.getId(),
+                                                user,
+                                                user.getCompany().getId(),
+                                                "文件收藏成功",
+                                                "文件"+collectAccessoryInfo.getFileName()+"部门收藏成功",
+                                                "92",
+                                                "0",
+                                                "待通知",
+                                                "文件收藏成功"));
+                    }
+                    break;
+                case "3":
+                    //公司共享
+                    //根据公司id查询公司内所有人
+                    List<User> companyUserList = UserUtils.getCompanyUserList();
+                    for (User user : companyUserList) {
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(collectAccessoryInfo.getId(),
+                                                user,
+                                                user.getCompany().getId(),
+                                                "文件收藏成功",
+                                                "文件"+collectAccessoryInfo.getFileName()+"公司收藏成功",
+                                                "92",
+                                                "0",
+                                                "待通知",
+                                                "文件收藏成功"));
+                    }
+                    break;
+            }
+        }
+        return saveResult;
+    }
+}

+ 82 - 1
src/main/java/com/jeeplus/modules/projectAccessory/service/ProjectAccessoryService.java

@@ -12,10 +12,14 @@ import com.jeeplus.modules.projectAccessory.entity.CollectAccessoryInfo;
 import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo;
 import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryTree;
 import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
+import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
+import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -35,6 +39,8 @@ public class ProjectAccessoryService extends TreeService<ProjectAccessoryDao, Pr
     private WorkClientAttachmentDao workClientAttachmentDao;
     @Autowired
     private WorkattachmentService workattachmentService;
+    @Autowired
+    private WorkProjectNotifyService workProjectNotifyService;
 
 	public ProjectAccessoryInfo get(String id) {
 		return super.get(id);
@@ -297,9 +303,84 @@ public class ProjectAccessoryService extends TreeService<ProjectAccessoryDao, Pr
     public Integer saveCollectAccessory(CollectAccessoryInfo collectAccessoryInfo){
         //添加收藏人id
         collectAccessoryInfo.setUserId(UserUtils.getUser().getId());
+        //保存信息
+        collectAccessoryInfo.preInsert();
+        //添加创建人部门和公司id
+        collectAccessoryInfo.setOfficeId(UserUtils.getUser().getOffice().getId());
+        collectAccessoryInfo.setCompanyId(UserUtils.getUser().getCompany().getId());
+        int saveResult = dao.saveCollectAccessory(collectAccessoryInfo);
         //判断收藏类型(1:个人收藏;2:部门收藏;3:公司收藏)
         //部门收藏和公司收藏要给对应类型的所有人发送通知
+        if(1==saveResult){
+            switch (collectAccessoryInfo.getType()){
+                case "1":
+                    //个人收藏
+                    break;
+                case "2":
+                    //部门共享
+                    //根据部门id查询部门内所有人
+                    List<User> officeUserList = UserUtils.getOfficeUserList();
+                    for (User user : officeUserList) {
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(collectAccessoryInfo.getId(),
+                                                user,
+                                                user.getCompany().getId(),
+                                                "文件收藏成功",
+                                                "文件"+collectAccessoryInfo.getFileName()+"部门收藏成功",
+                                                "92",
+                                                "0",
+                                                "待通知",
+                                                "文件收藏成功"));
+                    }
+                    break;
+                case "3":
+                    //公司共享
+                    //根据公司id查询公司内所有人
+                    List<User> companyUserList = UserUtils.getCompanyUserList();
+                    for (User user : companyUserList) {
+                        workProjectNotifyService
+                                .save(UtilNotify
+                                        .saveNotify(collectAccessoryInfo.getId(),
+                                                user,
+                                                user.getCompany().getId(),
+                                                "文件收藏成功",
+                                                "文件"+collectAccessoryInfo.getFileName()+"公司收藏成功",
+                                                "92",
+                                                "0",
+                                                "待通知",
+                                                "文件收藏成功"));
+                    }
+                    break;
+            }
+        }
+        return saveResult;
+    }
+
 
-        return null;
+
+    /**
+     * 无合同状态,获取公司所有的客户相关联的联系人信息
+     * @param page
+     * @return
+     */
+    public Page<CollectAccessoryInfo> getCollectList(Page<CollectAccessoryInfo> page, CollectAccessoryInfo collectAccessoryInfo){
+        collectAccessoryInfo.setPage(page);
+        if(StringUtils.isBlank(collectAccessoryInfo.getType())){
+            collectAccessoryInfo.setType("1");
+            collectAccessoryInfo.setCreateBy(UserUtils.getUser());
+        }
+        switch (collectAccessoryInfo.getType()){
+            case "2":
+                collectAccessoryInfo.setOfficeId(UserUtils.getUser().getOffice().getId());
+                break;
+            case "3":
+                collectAccessoryInfo.setCompanyId(UserUtils.getUser().getCompany().getId());
+                break;
+        }
+        List<CollectAccessoryInfo> collectList=dao.getCollectList(collectAccessoryInfo);
+        workattachmentService.attachmentManageByUrlOnCollect(collectList);
+        page.setList(collectList);
+        return page;
     }
 }

+ 172 - 0
src/main/java/com/jeeplus/modules/projectAccessory/web/CollectAccessoryController.java

@@ -0,0 +1,172 @@
+package com.jeeplus.modules.projectAccessory.web;
+
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.projectAccessory.entity.CollectAccessoryInfo;
+import com.jeeplus.modules.projectAccessory.service.CollectAccessoryService;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author: 徐滕
+ * @create: 2021-06-02 09:41
+ **/
+@Controller
+@RequestMapping(value = "${adminPath}/collectAccessory/collectAccessory")
+public class CollectAccessoryController extends BaseController {
+
+    @Autowired
+    private CollectAccessoryService collectAccessoryService;
+    @Autowired
+    private WorkattachmentService workattachmentService;
+
+    @ModelAttribute
+    public CollectAccessoryInfo get(@RequestParam(required=false) String id) {
+        CollectAccessoryInfo entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = collectAccessoryService.get(id);
+        }
+        if (entity == null){
+            entity = new CollectAccessoryInfo();
+        }
+        return entity;
+    }
+
+    /**
+     * 项目列表页面
+     */
+    @RequiresPermissions("collectAccessory:collectAccessory:list")
+    @RequestMapping(value = {"list", ""})
+    public String list(CollectAccessoryInfo collectAccessoryInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if(UserUtils.isManager()){
+            model.addAttribute("flag","1");
+        }
+        if(StringUtils.isBlank(collectAccessoryInfo.getType())){
+            collectAccessoryInfo.setType("1");
+        }
+        //获取项目信息
+        Page<CollectAccessoryInfo> page = collectAccessoryService.findPage(new Page<CollectAccessoryInfo>(request, response), collectAccessoryInfo);
+
+        model.addAttribute("page", page);
+        return "modules/collectAccessory/collectAccessoryList";
+    }
+
+    /**
+     * 项目列表页面
+     */
+    @RequestMapping(value = {"officeList"})
+    public String officeList(CollectAccessoryInfo collectAccessoryInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if(UserUtils.isManager()){
+            model.addAttribute("flag","1");
+        }
+        if(StringUtils.isBlank(collectAccessoryInfo.getType())){
+            collectAccessoryInfo.setType("2");
+        }
+        //获取项目信息
+        Page<CollectAccessoryInfo> page = collectAccessoryService.findPage(new Page<CollectAccessoryInfo>(request, response), collectAccessoryInfo);
+
+        model.addAttribute("page", page);
+        return "modules/collectAccessory/collectAccessoryOfficeList";
+    }
+
+    /**
+     * 项目列表页面
+     */
+    @RequestMapping(value = {"companyList"})
+    public String companyList(CollectAccessoryInfo collectAccessoryInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if(UserUtils.isManager()){
+            model.addAttribute("flag","1");
+        }
+        if(StringUtils.isBlank(collectAccessoryInfo.getType())){
+            collectAccessoryInfo.setType("3");
+        }
+        //获取项目信息
+        Page<CollectAccessoryInfo> page = collectAccessoryService.findPage(new Page<CollectAccessoryInfo>(request, response), collectAccessoryInfo);
+
+        model.addAttribute("page", page);
+        return "modules/collectAccessory/collectAccessoryCompanyList";
+    }
+
+
+
+    /**
+     * 收藏附件信息
+     */
+    @RequestMapping(value = "saveCollectAccessory")
+    @ResponseBody
+    public Object saveCollectAccessory(CollectAccessoryInfo collectAccessoryInfo, Model model) {
+        Map<String,Object> map = new HashMap<>();
+        //url截取
+        String aliyunUrl = Global.getAliDownloadUrl();
+        if(collectAccessoryInfo.getUrl().indexOf(aliyunUrl)!=-1){
+            collectAccessoryInfo.setUrl(collectAccessoryInfo.getUrl().replace(aliyunUrl,""));
+        }
+        //根据文件id查询文件信息
+        Workattachment workattachment = workattachmentService.getByUrl(collectAccessoryInfo.getUrl());
+        if(null != workattachment){
+            collectAccessoryInfo.setFileName(workattachment.getAttachmentName());
+        }
+        //收藏附件信息
+        Integer result = collectAccessoryService.saveCollectAccessory(collectAccessoryInfo);
+        if(result == 1){
+            map.put("str","收藏附件信息成功!");
+            map.put("success",true);
+        }else{
+            map.put("str","收藏附件信息失败");
+            map.put("success",false);
+        }
+        return map;
+    }
+
+
+    /**
+     * 文件共享
+     * @param collectAccessoryInfo
+     * @return
+     */
+    @RequestMapping(value = {"shareAccessory"})
+    public String shareAccessory(CollectAccessoryInfo collectAccessoryInfo) {
+        CollectAccessoryInfo shareInfo = collectAccessoryService.get(collectAccessoryInfo.getId());
+        shareInfo.setType(collectAccessoryInfo.getType());
+        collectAccessoryService.shareSave(shareInfo);
+        return "redirect:"+Global.getAdminPath()+"/collectAccessory/collectAccessory/?repage";
+    }
+
+
+    /**
+     * 公司级、部门级附件信息收藏
+     */
+    @RequestMapping(value = "saveCollect")
+    @ResponseBody
+    public Object saveCollect(CollectAccessoryInfo collectAccessoryInfo, Model model) {
+        Map<String,Object> map = new HashMap<>();
+        CollectAccessoryInfo info = collectAccessoryService.get(collectAccessoryInfo.getId());
+        info.setType("1");
+        //收藏附件信息
+        Integer result = collectAccessoryService.shareSave(info);
+        if(result == 1){
+            map.put("str","收藏附件信息成功!");
+            map.put("success",true);
+        }else{
+            map.put("str","收藏附件信息失败");
+            map.put("success",false);
+        }
+        return map;
+    }
+}

+ 88 - 2
src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectAccessoryController.java

@@ -23,8 +23,12 @@ import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -61,6 +65,8 @@ public class ProjectAccessoryController extends BaseController {
 	private RuralProjectRecordsService projectRecordsService;
 	@Autowired
 	private ProjectEngineeringService engineeringService;
+	@Autowired
+	private WorkattachmentService workattachmentService;
 
 	@ModelAttribute
 	public ProjectAccessoryInfo get(@RequestParam(required=false) String id) {
@@ -421,13 +427,47 @@ public class ProjectAccessoryController extends BaseController {
 	}
 
 	/**
-	 * 选择报销项目
+	 * 查询收藏文件信息并跳转
+	 * @param url
+	 * @param model
+	 * @return
 	 */
 	@RequestMapping(value = "collectAccessory")
 	public String collectAccessory(String url, Model model) {
+		//url截取
+		String aliyunUrl = Global.getAliDownloadUrl();
+		if(url.indexOf(aliyunUrl)!=-1){
+			url = url.replace(aliyunUrl,"");
+		}
+		//根据文件id查询文件信息
+		Workattachment workattachment = workattachmentService.getByUrl(url);
+		CollectAccessoryInfo info = new CollectAccessoryInfo();
+		model.addAttribute("collectAccessoryInfo",info);
+		if(null != workattachment){
+			model.addAttribute("url",workattachment.getUrl());
+			model.addAttribute("fileName",workattachment.getAttachmentName());
+		}
+		return "modules/projectAccessory/selectCollectingAccessory";
+	}
+
+	/**
+	 * 查询收藏文件信息并跳转
+	 * @param url
+	 * @param model
+	 * @return
+	 */
+	@RequestMapping(value = "ossCollectAccessory")
+	public String ossCollectAccessory(String url,String fileName, Model model) {
+		//url截取
+		String aliyunUrl = Global.getAliDownloadUrl();
+		if(url.indexOf(aliyunUrl)!=-1){
+			url = url.replace(aliyunUrl,"");
+		}
+		//根据文件id查询文件信息
 		CollectAccessoryInfo info = new CollectAccessoryInfo();
 		model.addAttribute("collectAccessoryInfo",info);
 		model.addAttribute("url",url);
+		model.addAttribute("fileName",fileName);
 		return "modules/projectAccessory/selectCollectingAccessory";
 	}
 
@@ -438,13 +478,59 @@ public class ProjectAccessoryController extends BaseController {
 	@ResponseBody
 	public Object saveCollectAccessory(CollectAccessoryInfo collectAccessoryInfo, Model model) {
 		Map<String,Object> map = new HashMap<>();
+		//url截取
+		String aliyunUrl = Global.getAliDownloadUrl();
+		if(collectAccessoryInfo.getUrl().indexOf(aliyunUrl)!=-1){
+			collectAccessoryInfo.setUrl(collectAccessoryInfo.getUrl().replace(aliyunUrl,""));
+		}
+		//根据文件id查询文件信息
+		Workattachment workattachment = workattachmentService.getByUrl(collectAccessoryInfo.getUrl());
+		if(null != workattachment){
+			collectAccessoryInfo.setFileName(workattachment.getAttachmentName());
+		}
 		//收藏附件信息
 		Integer result = projectAccessoryService.saveCollectAccessory(collectAccessoryInfo);
 		if(result == 1){
 			map.put("str","收藏附件信息成功!");
+			map.put("success",true);
 		}else{
-			map.put("str","");
+			map.put("str","收藏附件信息失败");
+			map.put("success",false);
 		}
 		return map;
 	}
+
+
+
+	/**
+	 * 无合同,查询公司所有客户及其关联的联系人
+	 * @return
+	 */
+	@RequestMapping("getCollectList")
+	public String getCollectList(CollectAccessoryInfo collectAccessoryInfo, String url, String fieldLabels, String fieldKeys, String searchLabel, String searchKey, String searchLabel1, String searchKey1, HttpServletRequest request, HttpServletResponse response, Model model){
+		WorkClientInfo clientInfo = new WorkClientInfo();
+		clientInfo.setCompanyId(UserUtils.getUser().getCompany().getId());
+
+
+		Page<CollectAccessoryInfo> page = projectAccessoryService.getCollectList(new Page<CollectAccessoryInfo>(request, response), collectAccessoryInfo);
+		try {
+			fieldLabels = URLDecoder.decode(fieldLabels, "UTF-8");
+			fieldKeys = URLDecoder.decode(fieldKeys, "UTF-8");
+			searchLabel = URLDecoder.decode(searchLabel, "UTF-8");
+			searchKey = URLDecoder.decode(searchKey, "UTF-8");
+		} catch (UnsupportedEncodingException e) {
+			logger.error("Exception e:"+e);
+			e.printStackTrace();
+		}
+		model.addAttribute("labelNames", fieldLabels.split("\\|"));
+		model.addAttribute("labelValues", fieldKeys.split("\\|"));
+		model.addAttribute("fieldLabels", fieldLabels);
+		model.addAttribute("fieldKeys", fieldKeys);
+		model.addAttribute("url", url);
+		model.addAttribute("searchLabel", searchLabel);
+		model.addAttribute("searchKey", searchKey);
+		model.addAttribute("obj", collectAccessoryInfo);
+		model.addAttribute("page", page);
+		return  "modules/sys/collectSelect";
+	}
 }

+ 1 - 1
src/main/java/com/jeeplus/modules/workactivity/service/WorkActivityProcessService.java

@@ -412,4 +412,4 @@ public class WorkActivityProcessService extends CrudService<WorkActivityProcessD
 	public void updateType(String processInstanceId ,String type) {
 		dao.updateType(processInstanceId,type);
 	}
-}
+}

+ 130 - 0
src/main/resources/mappings/modules/collectAccessory/CollectAccessoryDao.xml

@@ -0,0 +1,130 @@
+<?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.CollectAccessoryDao">
+
+	<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.url AS "url",
+		a.file_name AS "fileName",
+		a.type AS "type",
+		a.office_id AS "officeId",
+		a.company_id AS "companyId",
+		a.collect_type  AS "collectType",
+		a.collect_user_id AS "collectUser.id",
+		su.name as "createBy.name",
+		suc.name as "collectUser.name"
+	</sql>
+
+	<sql id="joinColumns">
+		left join sys_user su on su.id = a.collect_user_id
+		left join sys_user suc on suc.id = a.create_by
+	</sql>
+
+
+	<select id="get" resultType="com.jeeplus.modules.projectAccessory.entity.CollectAccessoryInfo" >
+		SELECT
+			<include refid="workReviewStandardColumns"/>
+		FROM work_collect_accessory a
+		<include refid="joinColumns"/>
+		WHERE a.id = #{id}
+	</select>
+
+	<select id="findList" resultType="com.jeeplus.modules.projectAccessory.entity.CollectAccessoryInfo" >
+		SELECT
+			<include refid="workReviewStandardColumns"/>
+		FROM work_collect_accessory a
+			<include refid="joinColumns"/>
+		<where>
+			a.type = #{type} and a.del_flag = 0
+            <if test="fileName!=null and fileName != ''">
+                and a.file_name like concat('%',#{fileName},'%')
+            </if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.create_date asc,a.file_name asc
+			</otherwise>
+		</choose>
+	</select>
+
+	<select id="queryCount" resultType="int" >
+		SELECT
+		count(1)
+		FROM work_collect_accessory a
+		<where>
+			a.type = #{type} and a.del_flag = 0
+			<if test="fileName!=null and fileName != ''">
+				and a.file_name like concat('%',#{fileName},'%')
+			</if>
+		</where>
+	</select>
+
+	<insert id="saveCollectAccessory">
+		insert into work_collect_accessory (
+		  id,
+		  create_by,
+		  create_date,
+		  update_by,
+		  update_date,
+		  remarks,
+		  del_flag,
+		  url,
+		  file_name,
+		  type,
+		  office_id,
+		  company_id,
+		  collect_type,
+		  collect_user_id
+		)
+		values
+		  (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{url},
+			#{fileName},
+			#{type},
+			#{officeId},
+			#{companyId},
+			#{collectType},
+			#{collectUser.id}
+		  )
+	</insert>
+
+
+
+	<select id="getTypeList" resultType="com.jeeplus.modules.projectAccessory.entity.CollectAccessoryInfo" >
+		SELECT
+		<include refid="workReviewStandardColumns"/>
+		FROM work_collect_accessory a
+		<include refid="joinColumns"/>
+		<where>
+			a.type = #{type} and a.del_flag = 0
+		</where>
+		ORDER BY a.create_date asc,a.file_name asc
+	</select>
+
+	<select id="companyList" resultType="com.jeeplus.modules.projectAccessory.entity.CollectAccessoryInfo" >
+		SELECT
+		<include refid="workReviewStandardColumns"/>
+		FROM work_collect_accessory a
+		<include refid="joinColumns"/>
+		<where>
+			a.type = #{type} and a.del_flag = 0
+		</where>
+		ORDER BY a.create_date asc,a.file_name asc
+	</select>
+</mapper>

+ 112 - 17
src/main/resources/mappings/modules/projectAccessory/ProjectAccessoryDao.xml

@@ -1,7 +1,7 @@
 <?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.ProjectAccessoryDao">
-    
+
 	<sql id="workReviewStandardColumns">
 		a.id AS "id",
 		a.create_by AS "createBy.id",
@@ -16,17 +16,17 @@
 		a.company_id AS "companyId",
 		a.order_num AS "orderNum"
 	</sql>
-	
-    
+
+
 	<select id="get" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo" >
-		SELECT 
+		SELECT
 			<include refid="workReviewStandardColumns"/>
 		FROM project_accessory_structure_info a
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo" >
-		SELECT 
+		SELECT
 			<include refid="workReviewStandardColumns"/>
 		FROM project_accessory_structure_info a
 		<where>
@@ -71,14 +71,14 @@
 		FROM project_accessory_structure_info a
 		where a.parent_id =#{parentId}
 	</select>
-	
+
 	<select id="findAllList" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo" >
-		SELECT 
+		SELECT
 			<include refid="workReviewStandardColumns"/>
 		FROM project_accessory_structure_info a
 		<where>
 			a.del_flag = #{DEL_FLAG_NORMAL}
-		</where>		
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -88,7 +88,7 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<insert id="insert">
 		INSERT INTO project_accessory_structure_info(
 			id,
@@ -118,7 +118,7 @@
 			#{orderNum}
 		)
 	</insert>
-	
+
 	<update id="update">
 		UPDATE project_accessory_structure_info SET
 			update_by = #{updateBy.id},
@@ -131,22 +131,22 @@
 			order_num = #{orderNum}
 		WHERE id = #{id}
 	</update>
-	
-	
+
+
 	<!--物理删除-->
 	<update id="delete">
 		DELETE FROM project_accessory_structure_info
 		WHERE id = #{id} OR find_in_set(#{id},parent_ids)
 	</update>
-	
+
 	<!--逻辑删除-->
 	<update id="deleteByLogic">
 		UPDATE project_accessory_structure_info SET
 			del_flag = #{DEL_FLAG_DELETE}
 		WHERE id = #{id} OR find_in_set(#{id},parent_ids)
 	</update>
-	
-	
+
+
 	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
 	<select id="findUniqueByProperty" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo" statementType="STATEMENT">
 		select * FROM project_accessory_structure_info  where ${propertyName} = '${value}'
@@ -208,4 +208,99 @@
     <select id="getByDetail" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo">
         SELECT * FROM project_accessory_structure_info WHERE standard_detail = '标准部校核'
     </select>
-</mapper>
+
+	<insert id="saveCollectAccessory">
+		insert into work_collect_accessory (
+		  id,
+		  create_by,
+		  create_date,
+		  update_by,
+		  update_date,
+		  remarks,
+		  del_flag,
+		  url,
+		  file_name,
+		  type,
+		  office_id,
+		  company_id,
+		  collect_type,
+		  collect_user_id
+		)
+		values
+		  (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{url},
+			#{fileName},
+			#{type},
+			#{officeId},
+			#{companyId},
+			#{collectType},
+			#{collectUser.id}
+		  )
+	</insert>
+
+	<select id="getCollectAccessoryInfo" resultType="com.jeeplus.modules.projectAccessory.entity.CollectAccessoryInfo">
+		select
+		  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.url as "url",
+		  a.file_name as "fileName",
+		  a.type as "type",
+		  a.office_id as "officeId",
+		  a.company_id as "companyId",
+		  a.collect_type as "collectType"
+		from
+		  work_collect_accessory a
+		where a.url = #{url} and a.del_flag = 0
+			and (
+				(a.create_by = #{createBy.id} and a.type='1')
+				or(a.office_id = #{officeId} and a.type='2')
+				or(a.company_id = #{companyId} and a.type='3')
+			)
+	</select>
+
+	<select id="getCollectList" resultType="com.jeeplus.modules.projectAccessory.entity.CollectAccessoryInfo">
+		select
+		  a.id AS "id",
+		  a.create_by AS "createBy.id",
+		  DATE_FORMAT(a.create_date,'%Y-%m-%d') AS "createDateStr",
+		  a.update_by AS "updateBy.id",
+		  a.update_date AS "updateDate",
+		  a.remarks AS "remarks",
+		  a.del_flag AS "delFlag",
+		  a.url as "url",
+		  a.file_name as "fileName",
+		  a.type as "type",
+		  a.office_id as "officeId",
+		  a.company_id as "companyId",
+		  asu.name as "createBy.name",
+		a.collect_type as "collectType"
+		from
+		  work_collect_accessory a
+		  left join sys_user asu on asu.id = a.create_by
+		where  a.del_flag = 0
+			<if test="fileName !=null and fileName != ''">
+				and a.file_name = #{fileName}
+			</if>
+			<if test="type == 1">
+				and a.create_by = #{createBy.id} and a.type='1'
+			</if>
+			<if test="type == 2">
+				and a.office_id = #{officeId} and a.type='2'
+			</if>
+			<if test="type == 3">
+				and a.company_id = #{companyId} and a.type='3'
+			</if>
+	</select>
+</mapper>

+ 64 - 0
src/main/webapp/WEB-INF/tags/sys/collectSelect.tag

@@ -0,0 +1,64 @@
+<%@ tag language="java" pageEncoding="UTF-8"%>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<%@ attribute name="id" type="java.lang.String" required="true" description="编号"%>
+<%@ attribute name="name" type="java.lang.String" required="false" description="隐藏域名称(ID)"%>
+<%@ attribute name="value" type="java.lang.String" required="false" description="隐藏域值(ID)"%>
+<%@ attribute name="labelName" type="java.lang.String" required="false" description="输入框名称(Name)"%>
+<%@ attribute name="labelValue" type="java.lang.String" required="false" description="输入框值(Name)"%>
+<%@ attribute name="fieldLabels" type="java.lang.String" required="true" description="表格Th里显示的名字"%>
+<%@ attribute name="fieldKeys" type="java.lang.String" required="true" description="表格Td里显示的值"%>
+<%@ attribute name="searchLabel" type="java.lang.String" required="true" description="表格Td里显示的值"%>
+<%@ attribute name="searchKey" type="java.lang.String" required="true" description="表格Td里显示的值"%>
+<%@ attribute name="floorLabel" type="java.lang.String" required="false" description="表格Td里显示的值"%>
+<%@ attribute name="floorKey" type="java.lang.String" required="false" description="表格Td里显示的值"%>
+<%@ attribute name="housenumberLabel" type="java.lang.String" required="false" description="表格Td里显示的值"%>
+<%@ attribute name="housenumberKey" type="java.lang.String" required="false" description="表格Td里显示的值"%>
+<%@ attribute name="title" type="java.lang.String" required="true" description="选择框标题"%>
+<%@ attribute name="url" type="java.lang.String" required="true" description="数据地址"%>
+<%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="cssStyle" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
+<script type="text/javascript">
+function searchGrid${id}(clientId){
+	var uri;
+	var length = $("#workClientLinkmanList tr").length;
+	uri = "${ctx}/projectAccessory/projectAccessory/getCollectList";
+	top.layer.open({
+	    type: 2,
+	    area: ['90%','90%'],
+	    title:"${title}",
+		skin:"two-btns",
+	    name:'friend',
+	    content: encodeURI(uri+"?fieldLabels=${fieldLabels}&fieldKeys=${fieldKeys}&url="+uri+"&searchLabel=${searchLabel}&searchKey=${searchKey}&floorLabel=${floorLabel}&floorKey=${floorKey}&housenumberLabel=${housenumberLabel}&housenumberKey=${housenumberKey}") ,
+	    btn: ['确定', '关闭'],
+	    yes: function(index, layero){
+	    	 var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+	    	 var item = iframeWin.getSelectedItem();
+
+	    	 if(item == "-1"){
+		    	 return;
+	    	 }
+			 /*if (item.length>1){
+			 	console.log(item)
+				 top.layer.msg("不能进行多选,请重新选择。", {icon: 0});
+				 return false;
+			 }*/
+			 top.layer.close(index);//关闭对话框。
+           	 setValuee(item);
+		  },
+		  cancel: function(index){
+	       }
+	});
+
+}
+</script>
+
+	<input id="${id}Id"  type="hidden" value="${value}"/>
+	<div class="input-group" style="width: 100%">
+       		 <span class="input-group-btn">
+	       		 <a href=javascript:void(0); style="font-size:14px;" onclick="searchGridlinkman($('#linkmanId').val())" id="linkmanButton" class="nav-btn nav-btn-add"><i class="fa fa-search-plus"></i>
+	              收藏调用</a>
+       		 </span>
+
+    </div>
+	 <label id="${id}Name-error" class="error" for="${id}Name" style="display:none"></label>

+ 386 - 0
src/main/webapp/webpage/modules/collectAccessory/collectAccessoryCompanyList.jsp

@@ -0,0 +1,386 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>项目登记</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript" src="${ctxStatic}/layui/layuidown.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/layuidown.css"/>
+	<%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
+	<script type="text/javascript">
+        $(document).ready(function() {
+			layui.use(['dropdown', 'util', 'layer'], function () {
+				var form = layui.form;
+			})
+            //搜索框收放
+            $('#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 openDialogReportView(title,url,id,width,height){
+
+
+			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+				width='auto';
+				height='auto';
+			}else{//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			$.ajax({
+				async: false,
+				url: "${ctx}/ruralProject/ruralProjectMessage/getReportExist?id="+id,
+				dataType: "json",
+				success: function (data) {
+					if(data.success){
+						top.layer.open({
+							type: 2,
+							skin: 'one-btn',
+							area: [width, height],
+							title: title,
+							maxmin: true, //开启最大化最小化按钮
+							content: url ,
+							btn: ['关闭'],
+							cancel: function(index){
+							}
+						});
+					}else{
+						top.layer.msg("该项目报告信息已删除!", {icon: 0});
+						window.location.reload();
+					}
+				}
+			});
+
+		}
+        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) {
+                }
+            });
+        }
+
+        function saveClick() {
+			$("#attachment_file").click();
+		}
+
+		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 = "100";
+				console.log(file);
+				var timestamp=new Date().getTime();
+
+				var storeAs = "collectAccessory";
+				var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+				var divId = "_attachment";
+				$("#addFile"+divId).show();
+				fileCollectAccessory(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
+		}
+
+		function collectingAccessory(obj,url,id){
+			$.ajax({
+				type:"post",
+				url:url,
+				data: {"id":id,"type":"1","collectType":1},
+				success:function(data){
+					if(data.success){
+						parent.layer.msg(data.str,{icon:1});
+						location.reload();
+					}else {
+						parent.layer.msg(data.str,{icon:2});
+					}
+				}
+			});
+		}
+	</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="list-form-tab contentShadow shadowLTR" id="tabDiv">
+				<ul class="list-tabs" >
+					<li><a href="${ctx}/collectAccessory/collectAccessory/list">个人附件表</a></li>
+					<li><a href="${ctx}/collectAccessory/collectAccessory/officeList">部门附件表</a></li>
+					<li class="active"><a href="${ctx}/collectAccessory/collectAccessory/companyList">公司附件表</a></li>
+				</ul>
+			</div>
+		</div>
+		<div class="full-width fl">
+			<div class="layui-row contentShadow shadowLR" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="collectAccessoryInfo" action="${ctx}/collectAccessory/collectAccessory/companyList" method="post" class="form-inline">
+					<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+					<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">
+								<form:input path="fileName" 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>
+								<div class="layui-btn-group search-spacing">
+									<button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="search()">查询</button>
+									<button id="searchReset" class="layui-btn layui-btn-sm" onclick="resetSearch()">重置</button>
+								</div>
+							</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 with-icon">
+								<sys:treeselect id="officeId" name="office.id" value="${ruralProjectRecords.office.id}" labelName="office.name" labelValue="${ruralProjectRecords.office.name}"
+												title="部门" url="/sys/office/treeDataAll?type=2" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="false"/>
+							</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">
+					<div class="layui-btn-group">
+						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+					</div>
+					<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>
+
+    layui.use('table', function(){
+        layui.table.render({
+            limit:${ page.pageSize }
+			,id:"checkboxTable"
+            ,elem: '#contentTable1'
+            ,page: false
+            ,cols: [[
+				/*{checkbox: true, fixed: true},*/
+                {field:'index',align:'center', title: '序号',width:55}
+                ,{field:'fileName',align:'center', title: '附件名称',minWidth:200,templet:function(d){
+                		if(2 == d.uploadMode){
+                			if(d.fileName.indexOf('jpg') != -1 || d.fileName.indexOf('png') != -1 || d.fileName.indexOf('gif') != -1 || d.fileName.indexOf('bmp') != -1 || d.fileName.indexOf('jpeg') != -1){
+								return "<img src="+d.temporaryUrl+" width='50' height='50' onclick=\"openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=" + d.temporaryUrl +"','90%','90%')\" alt='"+d.fileName+"'>";
+							}else if(d.fileName.indexOf('pdf') != -1){
+								return "<a class=\"attention-info\" title=\"" + d.fileName + "\" href=\"javascript:void(0);\" onclick=\"preview('预览', '" + d.temporaryUrl +"','95%', '95%','1')\">" + d.fileName + "</a>";
+							}else{
+								return "<a class=\"attention-info\" title=\"" + d.fileName + "\" href=\"javascript:void(0);\" onclick=\"preview('预览', '" + d.temporaryUrl +"','95%', '95%')\">" + d.fileName + "</a>";
+							}
+						}else{
+							if(d.fileName.indexOf('jpg') != -1 || d.fileName.indexOf('png') != -1 || d.fileName.indexOf('gif') != -1 || d.fileName.indexOf('bmp') != -1 || d.fileName.indexOf('jpeg') != -1){
+								return "<img src="+d.url+" width='50' height='50' onclick=\"openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=" + d.url +"','90%','90%')\" alt='"+d.fileName+"'>";
+							}else if(d.fileName.indexOf('pdf') != -1){
+								return "<a class=\"attention-info\" title=\"" + d.fileName + "\" href=\"javascript:void(0);\" onclick=\"preview('预览', '" + d.url +"','95%', '95%','1')\">" + d.fileName + "</a>";
+							}else{
+								return "<a class=\"attention-info\" title=\"" + d.fileName + "\" href=\"javascript:void(0);\" onclick=\"preview('预览', '" + d.url +"','95%', '95%')\">" + d.fileName + "</a>";
+							}
+						}
+                    }}
+				,{field:'createName',align:'center', title: '上传人',  width:150}
+				,{field:'collectUserName',align:'center', title: '收藏人',  width:150}
+				,{field:'createDate',align:'center', title: '上传/收藏时间',  width:150}
+                ,{field:'op',align:'center',title:"操作",width:200,templet:function(d){
+                        ////对操作进行初始化
+                        var xml="<div class=\"layui-btn-group\">";
+                        if(d.individualFlag != 1){
+							xml+="<a href=\"javascript:void(0)\" onclick=\"collectingAccessory('"+this+"','${ctx}/collectAccessory/collectAccessory/saveCollect','"+d.id+"')\" class=\"layui-btn layui-btn-xs layui-bg-green\"> 收藏</a>";
+						}
+                	xml+="</div>"
+                        return xml;
+
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="collectAccessoryInfo" varStatus="index">
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+                    ,"id":"${collectAccessoryInfo.id}"
+                    ,"fileName":"${collectAccessoryInfo.fileName}"
+                    ,"temporaryUrl":"${collectAccessoryInfo.temporaryUrl}"
+                    ,"url":"${collectAccessoryInfo.url}"
+                    ,"uploadMode":"${collectAccessoryInfo.uploadMode}"
+                    ,"createName":"${collectAccessoryInfo.createBy.name}"
+                    ,"collectUserName":"${collectAccessoryInfo.collectUser.name}"
+					,"individualFlag":"${collectAccessoryInfo.individualFlag}"
+					,"createDate":"<fmt:formatDate value="${collectAccessoryInfo.createDate}" pattern="yyyy-MM-dd"/>"
+
+                }
+                </c:forEach>
+                </c:if>
+            ]
+        });
+    })
+
+    resizeListTable();
+    $("a").on("click",addLinkVisied);
+
+</script>
+<script>
+    resizeListWindow2();
+    $(window).resize(function(){
+        resizeListWindow2();
+    });
+</script>
+</body>
+</html>

+ 386 - 0
src/main/webapp/webpage/modules/collectAccessory/collectAccessoryList.jsp

@@ -0,0 +1,386 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>项目登记</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript" src="${ctxStatic}/layui/layuidown.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/layuidown.css"/>
+	<%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
+	<script type="text/javascript">
+        $(document).ready(function() {
+			layui.use(['dropdown', 'util', 'layer'], function () {
+				var form = layui.form;
+			})
+            //搜索框收放
+            $('#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 openDialogReportView(title,url,id,width,height){
+
+
+			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+				width='auto';
+				height='auto';
+			}else{//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			$.ajax({
+				async: false,
+				url: "${ctx}/ruralProject/ruralProjectMessage/getReportExist?id="+id,
+				dataType: "json",
+				success: function (data) {
+					if(data.success){
+						top.layer.open({
+							type: 2,
+							skin: 'one-btn',
+							area: [width, height],
+							title: title,
+							maxmin: true, //开启最大化最小化按钮
+							content: url ,
+							btn: ['关闭'],
+							cancel: function(index){
+							}
+						});
+					}else{
+						top.layer.msg("该项目报告信息已删除!", {icon: 0});
+						window.location.reload();
+					}
+				}
+			});
+
+		}
+        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) {
+                }
+            });
+        }
+
+        function saveClick() {
+			$("#attachment_file").click();
+		}
+
+		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 = "100";
+				console.log(file);
+				var timestamp=new Date().getTime();
+
+				var storeAs = "collectAccessory";
+				var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+				var divId = "_attachment";
+				$("#addFile"+divId).show();
+				fileCollectAccessory(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
+		}
+	</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="list-form-tab contentShadow shadowLTR" id="tabDiv">
+				<ul class="list-tabs" >
+					<li class="active"><a href="${ctx}/collectAccessory/collectAccessory/list">个人附件表</a></li>
+					<li><a href="${ctx}/collectAccessory/collectAccessory/officeList">部门附件表</a></li>
+					<li><a href="${ctx}/collectAccessory/collectAccessory/companyList">公司附件表</a></li>
+				</ul>
+			</div>
+		</div>
+		<div class="full-width fl">
+			<div class="layui-row contentShadow shadowLR" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="collectAccessoryInfo" action="${ctx}/collectAccessory/collectAccessory/list" method="post" class="form-inline">
+					<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+					<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">
+								<form:input path="fileName" 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>
+								<div class="layui-btn-group search-spacing">
+									<button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="search()">查询</button>
+									<button id="searchReset" class="layui-btn layui-btn-sm" onclick="resetSearch()">重置</button>
+								</div>
+							</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 with-icon">
+								<sys:treeselect id="officeId" name="office.id" value="${ruralProjectRecords.office.id}" labelName="office.name" labelValue="${ruralProjectRecords.office.name}"
+												title="部门" url="/sys/office/treeDataAll?type=2" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="false"/>
+							</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">
+					<div class="layui-btn-group">
+						<shiro:hasPermission name="collectAccessory:collectAccessory:save">
+							<button class="layui-btn layui-btn-sm layui-bg-blue" data-toggle="tooltip" data-placement="left" onclick="saveClick()" title="刷新"> 上传附件</button>
+						</shiro:hasPermission>
+						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+					</div>
+					<div style="clear: both;"></div>
+				</div>
+				<div id="addFile_attachment" style="display: none" class="upload-progress">
+					<span id="fileName_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>
+				<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>
+
+    layui.use('table', function(){
+        layui.table.render({
+            limit:${ page.pageSize }
+			,id:"checkboxTable"
+            ,elem: '#contentTable1'
+            ,page: false
+            ,cols: [[
+				/*{checkbox: true, fixed: true},*/
+                {field:'index',align:'center', title: '序号',width:55}
+                ,{field:'fileName',align:'center', title: '附件名称',minWidth:200,templet:function(d){
+                		if(2 == d.uploadMode){
+                			if(d.fileName.indexOf('jpg') != -1 || d.fileName.indexOf('png') != -1 || d.fileName.indexOf('gif') != -1 || d.fileName.indexOf('bmp') != -1 || d.fileName.indexOf('jpeg') != -1){
+								return "<img src="+d.temporaryUrl+" width='50' height='50' onclick=\"openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=" + d.temporaryUrl +"','90%','90%')\" alt='"+d.fileName+"'>";
+							}else if(d.fileName.indexOf('pdf') != -1){
+								return "<a class=\"attention-info\" title=\"" + d.fileName + "\" href=\"javascript:void(0);\" onclick=\"preview('预览', '" + d.temporaryUrl +"','95%', '95%','1')\">" + d.fileName + "</a>";
+							}else{
+								return "<a class=\"attention-info\" title=\"" + d.fileName + "\" href=\"javascript:void(0);\" onclick=\"preview('预览', '" + d.temporaryUrl +"','95%', '95%')\">" + d.fileName + "</a>";
+							}
+						}else{
+							if(d.fileName.indexOf('jpg') != -1 || d.fileName.indexOf('png') != -1 || d.fileName.indexOf('gif') != -1 || d.fileName.indexOf('bmp') != -1 || d.fileName.indexOf('jpeg') != -1){
+								return "<img src="+d.url+" width='50' height='50' onclick=\"openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=" + d.url +"','90%','90%')\" alt='"+d.fileName+"'>";
+							}else if(d.fileName.indexOf('pdf') != -1){
+								return "<a class=\"attention-info\" title=\"" + d.fileName + "\" href=\"javascript:void(0);\" onclick=\"preview('预览', '" + d.url +"','95%', '95%','1')\">" + d.fileName + "</a>";
+							}else{
+								return "<a class=\"attention-info\" title=\"" + d.fileName + "\" href=\"javascript:void(0);\" onclick=\"preview('预览', '" + d.url +"','95%', '95%')\">" + d.fileName + "</a>";
+							}
+						}
+                    }}
+				,{field:'createName',align:'center', title: '上传人',  width:150}
+				,{field:'collectUserName',align:'center', title: '收藏人',  width:150}
+				,{field:'createDate',align:'center', title: '上传/收藏时间',  width:150}
+                ,{field:'op',align:'center',title:"操作",width:200,templet:function(d){
+                        ////对操作进行初始化
+                        var xml="<div class=\"layui-btn-group\">";
+                        if(d.officeFlag != 1){
+							xml+="<a href=\"${ctx}/collectAccessory/collectAccessory/shareAccessory?id=" + d.id + "&type=2\" onclick=\"return confirmx('确认将该文件共享到部门吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-green\"> 部门共享</a>";
+						}
+						if(d.companyFlag != 1){
+							xml+="<a href=\"${ctx}/collectAccessory/collectAccessory/shareAccessory?id=" + d.id + "&type=3\" onclick=\"return confirmx('确认将该文件共享到公司吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-blue\"> 公司共享</a>";
+						}
+						xml+="<a href=\"${ctx}/collectAccessory/collectAccessory/delete?id=" + d.id + "\" onclick=\"return confirmx('确认从文件库中删除该文件吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
+
+                	xml+="</div>"
+                        return xml;
+
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="collectAccessoryInfo" varStatus="index">
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+                    ,"id":"${collectAccessoryInfo.id}"
+                    ,"fileName":"${collectAccessoryInfo.fileName}"
+                    ,"temporaryUrl":"${collectAccessoryInfo.temporaryUrl}"
+                    ,"url":"${collectAccessoryInfo.url}"
+                    ,"uploadMode":"${collectAccessoryInfo.uploadMode}"
+                    ,"createName":"${collectAccessoryInfo.createBy.name}"
+                    ,"collectUserName":"${collectAccessoryInfo.collectUser.name}"
+					,"officeFlag":"${collectAccessoryInfo.officeFlag}"
+					,"companyFlag":"${collectAccessoryInfo.companyFlag}"
+					,"createDate":"<fmt:formatDate value="${collectAccessoryInfo.createDate}" pattern="yyyy-MM-dd"/>"
+
+                }
+                </c:forEach>
+                </c:if>
+            ]
+        });
+    })
+
+    resizeListTable();
+    $("a").on("click",addLinkVisied);
+</script>
+<script>
+    resizeListWindow2();
+    $(window).resize(function(){
+        resizeListWindow2();
+    });
+</script>
+</body>
+</html>

+ 386 - 0
src/main/webapp/webpage/modules/collectAccessory/collectAccessoryOfficeList.jsp

@@ -0,0 +1,386 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>项目登记</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript" src="${ctxStatic}/layui/layuidown.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/layuidown.css"/>
+	<%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
+	<script type="text/javascript">
+        $(document).ready(function() {
+			layui.use(['dropdown', 'util', 'layer'], function () {
+				var form = layui.form;
+			})
+            //搜索框收放
+            $('#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 openDialogReportView(title,url,id,width,height){
+
+
+			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+				width='auto';
+				height='auto';
+			}else{//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			$.ajax({
+				async: false,
+				url: "${ctx}/ruralProject/ruralProjectMessage/getReportExist?id="+id,
+				dataType: "json",
+				success: function (data) {
+					if(data.success){
+						top.layer.open({
+							type: 2,
+							skin: 'one-btn',
+							area: [width, height],
+							title: title,
+							maxmin: true, //开启最大化最小化按钮
+							content: url ,
+							btn: ['关闭'],
+							cancel: function(index){
+							}
+						});
+					}else{
+						top.layer.msg("该项目报告信息已删除!", {icon: 0});
+						window.location.reload();
+					}
+				}
+			});
+
+		}
+        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) {
+                }
+            });
+        }
+
+        function saveClick() {
+			$("#attachment_file").click();
+		}
+
+		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 = "100";
+				console.log(file);
+				var timestamp=new Date().getTime();
+
+				var storeAs = "collectAccessory";
+				var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+				var divId = "_attachment";
+				$("#addFile"+divId).show();
+				fileCollectAccessory(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
+		}
+
+
+		function collectingAccessory(obj,url,id){
+			$.ajax({
+				type:"post",
+				url:url,
+				data: {"id":id,"type":"1","collectType":1},
+				success:function(data){
+					if(data.success){
+						parent.layer.msg(data.str,{icon:1});
+						location.reload();
+					}else {
+						parent.layer.msg(data.str,{icon:2});
+					}
+				}
+			});
+		}
+	</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="list-form-tab contentShadow shadowLTR" id="tabDiv">
+				<ul class="list-tabs" >
+					<li><a href="${ctx}/collectAccessory/collectAccessory/list">个人附件表</a></li>
+					<li class="active"><a href="${ctx}/collectAccessory/collectAccessory/officeList">部门附件表</a></li>
+					<li><a href="${ctx}/collectAccessory/collectAccessory/companyList">公司附件表</a></li>
+				</ul>
+			</div>
+		</div>
+		<div class="full-width fl">
+			<div class="layui-row contentShadow shadowLR" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="collectAccessoryInfo" action="${ctx}/collectAccessory/collectAccessory/officeList" method="post" class="form-inline">
+					<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+					<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">
+								<form:input path="fileName" 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>
+								<div class="layui-btn-group search-spacing">
+									<button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="search()">查询</button>
+									<button id="searchReset" class="layui-btn layui-btn-sm" onclick="resetSearch()">重置</button>
+								</div>
+							</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 with-icon">
+								<sys:treeselect id="officeId" name="office.id" value="${ruralProjectRecords.office.id}" labelName="office.name" labelValue="${ruralProjectRecords.office.name}"
+												title="部门" url="/sys/office/treeDataAll?type=2" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="false"/>
+							</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">
+					<div class="layui-btn-group">
+						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+					</div>
+					<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>
+
+    layui.use('table', function(){
+        layui.table.render({
+            limit:${ page.pageSize }
+			,id:"checkboxTable"
+            ,elem: '#contentTable1'
+            ,page: false
+            ,cols: [[
+				/*{checkbox: true, fixed: true},*/
+                {field:'index',align:'center', title: '序号',width:55}
+                ,{field:'fileName',align:'center', title: '附件名称',minWidth:200,templet:function(d){
+                		if(2 == d.uploadMode){
+                			if(d.fileName.indexOf('jpg') != -1 || d.fileName.indexOf('png') != -1 || d.fileName.indexOf('gif') != -1 || d.fileName.indexOf('bmp') != -1 || d.fileName.indexOf('jpeg') != -1){
+								return "<img src="+d.temporaryUrl+" width='50' height='50' onclick=\"openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=" + d.temporaryUrl +"','90%','90%')\" alt='"+d.fileName+"'>";
+							}else if(d.fileName.indexOf('pdf') != -1){
+								return "<a class=\"attention-info\" title=\"" + d.fileName + "\" href=\"javascript:void(0);\" onclick=\"preview('预览', '" + d.temporaryUrl +"','95%', '95%','1')\">" + d.fileName + "</a>";
+							}else{
+								return "<a class=\"attention-info\" title=\"" + d.fileName + "\" href=\"javascript:void(0);\" onclick=\"preview('预览', '" + d.temporaryUrl +"','95%', '95%')\">" + d.fileName + "</a>";
+							}
+						}else{
+							if(d.fileName.indexOf('jpg') != -1 || d.fileName.indexOf('png') != -1 || d.fileName.indexOf('gif') != -1 || d.fileName.indexOf('bmp') != -1 || d.fileName.indexOf('jpeg') != -1){
+								return "<img src="+d.url+" width='50' height='50' onclick=\"openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=" + d.url +"','90%','90%')\" alt='"+d.fileName+"'>";
+							}else if(d.fileName.indexOf('pdf') != -1){
+								return "<a class=\"attention-info\" title=\"" + d.fileName + "\" href=\"javascript:void(0);\" onclick=\"preview('预览', '" + d.url +"','95%', '95%','1')\">" + d.fileName + "</a>";
+							}else{
+								return "<a class=\"attention-info\" title=\"" + d.fileName + "\" href=\"javascript:void(0);\" onclick=\"preview('预览', '" + d.url +"','95%', '95%')\">" + d.fileName + "</a>";
+							}
+						}
+                    }}
+				,{field:'createName',align:'center', title: '上传人',  width:150}
+				,{field:'collectUserName',align:'center', title: '收藏人',  width:150}
+				,{field:'createDate',align:'center', title: '上传/收藏时间',  width:150}
+                ,{field:'op',align:'center',title:"操作",width:200,templet:function(d){
+                        ////对操作进行初始化
+                        var xml="<div class=\"layui-btn-group\">";
+                        if(d.individualFlag != 1){
+							xml+="<a href=\"javascript:void(0)\" onclick=\"collectingAccessory('"+this+"','${ctx}/collectAccessory/collectAccessory/saveCollect','"+d.id+"')\" class=\"layui-btn layui-btn-xs layui-bg-green\"> 收藏</a>";
+						}
+                	xml+="</div>"
+                        return xml;
+
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="collectAccessoryInfo" varStatus="index">
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+                    ,"id":"${collectAccessoryInfo.id}"
+                    ,"fileName":"${collectAccessoryInfo.fileName}"
+                    ,"temporaryUrl":"${collectAccessoryInfo.temporaryUrl}"
+                    ,"url":"${collectAccessoryInfo.url}"
+                    ,"uploadMode":"${collectAccessoryInfo.uploadMode}"
+                    ,"createName":"${collectAccessoryInfo.createBy.name}"
+                    ,"collectUserName":"${collectAccessoryInfo.collectUser.name}"
+					,"individualFlag":"${collectAccessoryInfo.individualFlag}"
+					,"createDate":"<fmt:formatDate value="${collectAccessoryInfo.createDate}" pattern="yyyy-MM-dd"/>"
+
+                }
+                </c:forEach>
+                </c:if>
+            ]
+        });
+    })
+
+    resizeListTable();
+    $("a").on("click",addLinkVisied);
+</script>
+<script>
+    resizeListWindow2();
+    $(window).resize(function(){
+        resizeListWindow2();
+    });
+</script>
+</body>
+</html>

+ 1 - 0
src/main/webapp/webpage/modules/projectAccessory/selectCollectingAccessory.jsp

@@ -39,6 +39,7 @@
 			<div class="layui-row" id="queryDiv">
 				<form:form id="inputForm" modelAttribute="collectAccessoryInfo" action="${ctx}/projectAccessory/projectAccessory/saveCollectAccessory" method="post" class="form-horizontal layui-form">
 					<input type="hidden" id="url" name="url" value="${url}">
+					<input type="hidden" id="fileName" name="fileName" value="${fileName}">
 					<div class="layui-item layui-col-sm8">
 						<label class="layui-form-label"><span class="require-item">*</span>收藏类型:</label>
 						<div class="layui-input-block">

+ 20 - 59
src/main/webapp/webpage/modules/projectAccessory/workAttachmentForm.jsp

@@ -116,6 +116,10 @@
 				<div class="form-group-label"><h2>附件信息</h2></div>
 				<div class="layui-item nav-btns">
 					<a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
+					<sys:collectSelect  id="linkman" url="${ctx}/workclientinfo/workClientInfo/linkmanList"
+									  name="linkman.id"  title="选择客户"
+									  cssClass="form-control judgment" fieldLabels="联系人" fieldKeys="name"
+									  searchLabel="联系人" searchKey="fileName"></sys:collectSelect>
 				</div>
 				<div id="addFile_attachment" style="display: none" class="upload-progress">
 					<span id="fileName_attachment" ></span>
@@ -196,7 +200,9 @@
 										<c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">
 											<a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?id=${workClientAttachment.id}&type=2&url=${workClientAttachment.url}','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
 										</c:if>
-										<%--<a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/collectAccessory?url=${workClientAttachment.url}')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;收藏</a>--%>
+										<c:if test="${workClientAttachment.collectFlag != 1}">
+											<a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;收藏</a>
+										</c:if>
 									</div>
 								</td>
 							</tr>
@@ -209,69 +215,24 @@
 	</div>
 </div>
 <script>
-	function collectingAccessory(obj,url,addFile,divId){
-		top.layer.open({
-			type: 2,
-			area: ['500px','350px'],
-			title:"文件收藏",
-			name:'friend',
-			skin:"two-btns",
-			content: encodeURI(url),
-			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;
-				var target = false;
-				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/saveCollectAccessory");//表单提交成功后,从服务器返回的url在当前tab中展示
-				var $document = iframeWin.contentWindow.document;
-
-				formSubmit2($document,"inputForm",index);
-			},
-			cancel: function(index){
-			}
-		});
-	}
 
-	function formSubmit2($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) {
-					var d = data;
-					//输出提示信息
-					if(d.str.length>0){
-						parent.layer.msg(d.str,{icon:1});
-					}
-					location.reload();
+	function collectingAccessory(obj,url,fileUrl){
+		$.ajax({
+			type:"post",
+			url:url,
+			data: {"url":fileUrl,"type":"1","collectType":1},
+			success:function(data){
+				if(data.success){
+					$(obj).hide()
 					//关闭当前页
 					top.layer.close(index)
+					parent.layer.msg(data.str,{icon:1});
+				}else {
+					parent.layer.msg(data.str,{icon:2});
 				}
-			});
-		}
+			}
+		});
 	}
-
 </script>
 </body>
 </html>

+ 177 - 0
src/main/webapp/webpage/modules/sys/collectSelect.jsp

@@ -0,0 +1,177 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			    $('#contentTable thead tr th input.i-checks').on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
+			    	  $('#contentTable tbody tr td input.i-checks').iCheck('check');
+			    	});
+
+			    $('#contentTable thead tr th input.i-checks').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
+			    	  $('#contentTable tbody tr td input.i-checks').iCheck('uncheck');
+			    	});
+		});
+
+		function getSelectedItem(){
+
+			var size = $("#contentTable tbody tr td input.i-checks:checked").size();
+			  /*if(size == 0 ){
+					top.layer.alert('请选择一条数据!', {icon: 0, title:'警告'});
+					return "-1";
+				  }
+			  if(size > 1 ){
+					top.layer.alert('只能选择一条数据!', {icon: 0, title:'警告'});
+					return "-1";
+				  }*/
+            var arr=new Array();
+            $("#contentTable tbody tr td input.i-checks:checkbox:checked").each(function () {
+                var id =  $(this).attr("id");
+                var label1 = $(this).parent().parent().parent().find(".codelabel1").html();
+                var label2 = $(this).parent().parent().parent().find(".codelabel2").html();
+                var label3 = $(this).parent().parent().parent().find(".codelabel3").html();
+                var label5 = $(this).parent().parent().parent().find(".codelabel5").html();
+                var data= {'id':id,'fileName':label5,'createName':label2,'url':label3,};
+                arr.push(data);
+			})
+            return arr;
+		}
+
+		function page(n,s){
+			if(n) $("#pageNo").val(n);
+			if(s) $("#pageSize").val(s);
+			$("#searchForm").attr("action","${url}");
+			$("#searchForm").submit();
+	    	return false;
+	    }
+	</script>
+</head>
+<body class="gray-bg">
+<div class="wrapper wrapper-content">
+	<div class="layui-row">
+		<div class="full-width fl">
+			<div class="layui-row" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="obj" action="${url}" method="post" class="form-inline">
+					<input type="hidden" name="url" value="${url}"/>
+					<input type="hidden" name="fieldLabels" value="${fieldLabels}"/>
+					<input type="hidden" name="fieldKeys" value="${fieldKeys}"/>
+					<input type="hidden" name="searchLabel" value="${searchLabel}"/>
+					<input type="hidden" name="searchKey" value="${searchKey}"/>
+					<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">
+						<div class="layui-item query athird" style="width: 300px;">
+							<span class="layui-form-label">文件名称:</span>
+							<div class="layui-input-block">
+								<form:input path="${searchKey}" htmlEscape="false" maxlength="50" class="form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird" style="width: 300px;">
+							<span class="layui-form-label">收藏人:</span>
+							<div class="layui-input-block">
+								<form:input path="createBy.name" htmlEscape="false" maxlength="50" class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item athird fr">
+							<div class="input-group">
+								<button id="searchReset" class="fixed-btn searchReset fr" style="margin-right: 0px;" 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-item layui-col-xs12 form-table-container">
+				<table id="contentTable" class="table details table-bordered table-condensed">
+					<thead>
+						<tr>
+							<th width="50"></th>
+								<th style="display:none">编号</th>
+								<th width="60%">附件名称</th>
+								<th width="20%">收藏人</th>
+								<th width="20%">收藏时间</th>
+						</tr>
+					</thead>
+					<tbody>
+					<c:choose>
+					<c:when test="${not empty page.list}">
+					<c:forEach items="${page.list}" var="obj">
+						<tr>
+							<td> <input type="checkbox" name="radioName" id="${fns:getValue(obj, 'id')}" class="i-checks"></td>
+
+							<c:choose>
+								<c:when test="${obj.uploadMode == 2}">
+									<c:choose>
+										<c:when test="${fn:containsIgnoreCase(obj.fileName,'jpg')
+                                                           or fn:containsIgnoreCase(obj.fileName,'png')
+                                                           or fn:containsIgnoreCase(obj.fileName,'gif')
+                                                           or fn:containsIgnoreCase(obj.fileName,'bmp')
+                                                           or fn:containsIgnoreCase(obj.fileName,'jpeg')}">
+											<td title="${obj.fileName}" class="codelabel1"><img src="${obj.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${obj.fileName}','90%','90%')" alt="${obj.fileName}">
+										</c:when>
+										<c:otherwise>
+											<c:choose>
+												<c:when test="${fn:containsIgnoreCase(obj.fileName,'pdf')}">
+													<td title="${obj.fileName}" class="codelabel1"><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${obj.temporaryUrl}','90%','90%','1')">${obj.fileName}</a></td>
+												</c:when>
+												<c:otherwise>
+													<td title="${obj.fileName}" class="codelabel1"><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${obj.temporaryUrl}','90%','90%')">${obj.fileName}</a></td>
+												</c:otherwise>
+											</c:choose>
+										</c:otherwise>
+									</c:choose>
+								</c:when>
+								<c:otherwise>
+									<c:choose>
+										<c:when test="${fn:containsIgnoreCase(obj.fileName,'jpg')
+                                                           or fn:containsIgnoreCase(obj.fileName,'png')
+                                                           or fn:containsIgnoreCase(obj.fileName,'gif')
+                                                           or fn:containsIgnoreCase(obj.fileName,'bmp')
+                                                           or fn:containsIgnoreCase(obj.fileName,'jpeg')}">
+											<td title="${obj.fileName}" class="codelabel1"><img src="${obj.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${obj.url}','90%','90%')" alt="${obj.fileName}"></td>
+										</c:when>
+										<c:otherwise>
+											<c:choose>
+												<c:when test="${fn:containsIgnoreCase(obj.fileName,'pdf')}">
+													<td title="${obj.fileName}" class="codelabel1"><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${obj.url}','90%','90%','1')">${obj.fileName}</a></td>
+												</c:when>
+												<c:otherwise>
+													<td title="${obj.fileName}" class="codelabel1"><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${obj.url}','90%','90%')">${obj.fileName}</a></td>
+												</c:otherwise>
+											</c:choose>
+										</c:otherwise>
+									</c:choose>
+								</c:otherwise>
+							</c:choose>
+							<td title="${obj.createBy.name}" class="codelabel2">${obj.createBy.name}</td>
+							<td title="${obj.createDateStr}" class="codelabel4">${obj.createDateStr}</td>
+							<td style="display:none" class="codelabel3">${obj.url}</td>
+							<td style="display:none" class="codelabel5">${obj.fileName}</td>
+						</tr>
+					</c:forEach>
+					</c:when>
+						<c:otherwise>
+							<tr>
+								<td colspan="3" align="center">
+									暂无数据
+								</td>
+							</tr>
+						</c:otherwise>
+					</c:choose>
+
+					</tbody>
+				</table>
+				<table:page page="${page}"></table:page>
+			</div>
+		</div>
+	<div class="form-group layui-row page-end"></div>
+	</div>
+</div>
+</body>
+</html>