瀏覽代碼

知识分享和其他小修改提交

user5 3 年之前
父節點
當前提交
b5ffdf69bf
共有 19 個文件被更改,包括 4032 次插入3 次删除
  1. 14 0
      src/main/java/com/jeeplus/modules/knowledgeSharing/dao/KnowledgeSharingDao.java
  2. 64 0
      src/main/java/com/jeeplus/modules/knowledgeSharing/dao/KnowledgeSharingDetailsDao.java
  3. 74 0
      src/main/java/com/jeeplus/modules/knowledgeSharing/entity/KnowledgeSharingComment.java
  4. 150 0
      src/main/java/com/jeeplus/modules/knowledgeSharing/entity/KnowledgeSharingInfo.java
  5. 66 0
      src/main/java/com/jeeplus/modules/knowledgeSharing/entity/KnowledgeSharingView.java
  6. 192 0
      src/main/java/com/jeeplus/modules/knowledgeSharing/service/KnowledgeSharingDetailsService.java
  7. 117 0
      src/main/java/com/jeeplus/modules/knowledgeSharing/service/KnowledgeSharingService.java
  8. 107 0
      src/main/java/com/jeeplus/modules/knowledgeSharing/web/KnowledgeSharingController.java
  9. 245 0
      src/main/java/com/jeeplus/modules/knowledgeSharing/web/KnowledgeSharingDetailsController.java
  10. 3 1
      src/main/java/com/jeeplus/modules/sys/web/OfficeController.java
  11. 137 0
      src/main/resources/mappings/modules/knowledgeSharing/KnowledgeSharingDao.xml
  12. 274 0
      src/main/resources/mappings/modules/knowledgeSharing/KnowledgeSharingDetailsDao.xml
  13. 301 0
      src/main/webapp/webpage/modules/knowledgeSharing/knowledgeSharingDetailsForm.jsp
  14. 302 0
      src/main/webapp/webpage/modules/knowledgeSharing/knowledgeSharingDetailsList.jsp
  15. 300 0
      src/main/webapp/webpage/modules/knowledgeSharing/knowledgeSharingForm.jsp
  16. 210 0
      src/main/webapp/webpage/modules/knowledgeSharing/knowledgeSharingList.jsp
  17. 386 0
      src/main/webapp/webpage/modules/knowledgeSharing/knowledgeSharingView.jsp
  18. 1088 0
      src/main/webapp/webpage/modules/ruralprojectrecords/record/cost/projectRecordAdminDescriptionForm.jsp
  19. 2 2
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/all/ruralProjectMessageAllList.jsp

+ 14 - 0
src/main/java/com/jeeplus/modules/knowledgeSharing/dao/KnowledgeSharingDao.java

@@ -0,0 +1,14 @@
+package com.jeeplus.modules.knowledgeSharing.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingInfo;
+
+/**
+ * 知识分享Dao
+ * @author 徐滕
+ * @create 2022-04-11 09:19
+ */
+@MyBatisDao
+public interface KnowledgeSharingDao extends CrudDao<KnowledgeSharingInfo> {
+}

+ 64 - 0
src/main/java/com/jeeplus/modules/knowledgeSharing/dao/KnowledgeSharingDetailsDao.java

@@ -0,0 +1,64 @@
+package com.jeeplus.modules.knowledgeSharing.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingComment;
+import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingInfo;
+import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingView;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 知识分享Dao
+ * @author 徐滕
+ * @create 2022-04-11 09:19
+ */
+@MyBatisDao
+public interface KnowledgeSharingDetailsDao extends CrudDao<KnowledgeSharingInfo> {
+    /**
+     * 根据知识分享id和用户id查询查看知识分享信息数据
+     * @param knowledgeSharingId
+     * @param userId
+     * @return
+     */
+    KnowledgeSharingView getKnowledgeSharingView(@Param("knowledgeSharingId") String knowledgeSharingId, @Param("userId")String userId);
+
+    /**
+     * 新增知识分享浏览记录
+     * @param knowledgeSharingView
+     */
+    void saveKnowledgeSharingView(KnowledgeSharingView knowledgeSharingView);
+
+    /**
+     * 修改知识分享浏览记录
+     * @param knowledgeSharingView
+     */
+    void updateKnowledgeSharingView(KnowledgeSharingView knowledgeSharingView);
+
+    /**
+     * 根据知识分享id查询查看知识分享记录信息
+     * @param knowledgeSharingId
+     * @return
+     */
+    List<KnowledgeSharingView> getKnowledgeSharingViewList(String knowledgeSharingId);
+
+    /**
+     * 根据知识分享id查询查看知识分享记录信息
+     * @param knowledgeSharingId
+     * @return
+     */
+    List<KnowledgeSharingComment> getKnowledgeSharingCommentList(String knowledgeSharingId);
+    /**
+     * 根据知识分享id 新增评论
+     * @param knowledgeSharingComment
+     * @return
+     */
+    int saveComment(KnowledgeSharingComment knowledgeSharingComment);
+    /**
+     * 根据评论id 删除评论
+     * @param id 评论ID
+     * @return
+     */
+    int deleteComment(String id);
+}

+ 74 - 0
src/main/java/com/jeeplus/modules/knowledgeSharing/entity/KnowledgeSharingComment.java

@@ -0,0 +1,74 @@
+package com.jeeplus.modules.knowledgeSharing.entity;
+
+import com.jeeplus.common.persistence.DataEntity;
+import com.jeeplus.modules.sys.entity.User;
+
+/**
+ * @author 徐滕
+ * @create 2022-04-18 15:53
+ */
+public class KnowledgeSharingComment extends DataEntity<KnowledgeSharingComment> {
+    private Integer count;      //评论总量
+    private String knowledgeSharingId;  //知识分享id
+    private String content;     //评论内容
+    private User user;          //评论人
+    private Long minuteTime;          //评论时间距今相差分钟数
+    private String commentDateStr;     //评论时间
+    private Integer flag;       //判断是否有删除权限
+
+    public Integer getCount() {
+        return count;
+    }
+
+    public void setCount(Integer count) {
+        this.count = count;
+    }
+
+    public String getKnowledgeSharingId() {
+        return knowledgeSharingId;
+    }
+
+    public void setKnowledgeSharingId(String knowledgeSharingId) {
+        this.knowledgeSharingId = knowledgeSharingId;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public User getUser() {
+        return user;
+    }
+
+    public void setUser(User user) {
+        this.user = user;
+    }
+
+    public Long getMinuteTime() {
+        return minuteTime;
+    }
+
+    public void setMinuteTime(Long minuteTime) {
+        this.minuteTime = minuteTime;
+    }
+
+    public String getCommentDateStr() {
+        return commentDateStr;
+    }
+
+    public void setCommentDateStr(String commentDateStr) {
+        this.commentDateStr = commentDateStr;
+    }
+
+    public Integer getFlag() {
+        return flag;
+    }
+
+    public void setFlag(Integer flag) {
+        this.flag = flag;
+    }
+}

+ 150 - 0
src/main/java/com/jeeplus/modules/knowledgeSharing/entity/KnowledgeSharingInfo.java

@@ -0,0 +1,150 @@
+package com.jeeplus.modules.knowledgeSharing.entity;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.persistence.DataEntity;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.utils.UserUtils;
+
+import java.util.List;
+
+/**
+ * 知识分享Info
+ * @author 徐滕
+ * @create 2022-04-11 09:31
+ */
+public class KnowledgeSharingInfo extends DataEntity<KnowledgeSharingInfo> {
+    private String columnId; //栏目名称id
+    private String columnName; //栏目名称
+    private String subject;     //主题
+    private String moderator;   //版主
+    private String contents;    //帖子详情
+    private String invitationCount;    //帖子数
+    private List<Workattachment> workAttachments = Lists.newArrayList();
+    private String lastPublish; //最后发表
+
+    private String jordanswId;      // 发帖人id
+    private String jordanswName;    // 发帖人名称
+    private String readCount;       //阅读数
+    private String replyCount;      //回复数
+    private Integer isAdmin;      //登陆人是否为管理员
+    private String commentContent;
+
+    public String getColumnName() {
+        return columnName;
+    }
+
+    public void setColumnName(String columnName) {
+        this.columnName = columnName;
+    }
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    public String getModerator() {
+        return moderator;
+    }
+
+    public void setModerator(String moderator) {
+        this.moderator = moderator;
+    }
+
+    public String getContents() {
+        return contents;
+    }
+
+    public void setContents(String contents) {
+        this.contents = contents;
+    }
+
+    public List<Workattachment> getWorkAttachments() {
+        return workAttachments;
+    }
+
+    public void setWorkAttachments(List<Workattachment> workAttachments) {
+        this.workAttachments = workAttachments;
+    }
+
+    public String getColumnId() {
+        return columnId;
+    }
+
+    public void setColumnId(String columnId) {
+        this.columnId = columnId;
+    }
+
+    public String getInvitationCount() {
+        return invitationCount;
+    }
+
+    public void setInvitationCount(String invitationCount) {
+        this.invitationCount = invitationCount;
+    }
+
+    public String getLastPublish() {
+        return lastPublish;
+    }
+
+    public void setLastPublish(String lastPublish) {
+        this.lastPublish = lastPublish;
+    }
+
+    public String getJordanswId() {
+        return jordanswId;
+    }
+
+    public void setJordanswId(String jordanswId) {
+        this.jordanswId = jordanswId;
+    }
+
+    public String getJordanswName() {
+        return jordanswName;
+    }
+
+    public void setJordanswName(String jordanswName) {
+        this.jordanswName = jordanswName;
+    }
+
+    public String getReadCount() {
+        return readCount;
+    }
+
+    public void setReadCount(String readCount) {
+        this.readCount = readCount;
+    }
+
+    public String getReplyCount() {
+        return replyCount;
+    }
+
+    public void setReplyCount(String replyCount) {
+        this.replyCount = replyCount;
+    }
+
+    public Integer getIsAdmin() {
+        User user = UserUtils.getUser();
+        if(user.isAdmin()){
+            isAdmin = 1;
+        }else{
+            isAdmin = 0;
+        }
+        return isAdmin;
+    }
+
+    public void setIsAdmin(Integer isAdmin) {
+        this.isAdmin = isAdmin;
+    }
+
+    public String getCommentContent() {
+        return commentContent;
+    }
+
+    public void setCommentContent(String commentContent) {
+        this.commentContent = commentContent;
+    }
+}

+ 66 - 0
src/main/java/com/jeeplus/modules/knowledgeSharing/entity/KnowledgeSharingView.java

@@ -0,0 +1,66 @@
+package com.jeeplus.modules.knowledgeSharing.entity;
+
+import com.jeeplus.common.persistence.DataEntity;
+
+import java.util.Date;
+
+/**
+ * @author 徐滕
+ * @create 2022-04-18 14:09
+ */
+public class KnowledgeSharingView extends DataEntity<KnowledgeSharingView> {
+    private String knowledgeSharingId;  //知识分享id
+    private String userId;  //访问用户id
+    private String userName;  //访问用户名称
+    private Date firstVisitTime;  //首次访问时间
+    private Date lastVisitTime;   //最有一次访问时间
+    private Integer visitCount;  //访问次数
+
+    public String getKnowledgeSharingId() {
+        return knowledgeSharingId;
+    }
+
+    public void setKnowledgeSharingId(String knowledgeSharingId) {
+        this.knowledgeSharingId = knowledgeSharingId;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public Date getFirstVisitTime() {
+        return firstVisitTime;
+    }
+
+    public void setFirstVisitTime(Date firstVisitTime) {
+        this.firstVisitTime = firstVisitTime;
+    }
+
+    public Date getLastVisitTime() {
+        return lastVisitTime;
+    }
+
+    public void setLastVisitTime(Date lastVisitTime) {
+        this.lastVisitTime = lastVisitTime;
+    }
+
+    public Integer getVisitCount() {
+        return visitCount;
+    }
+
+    public void setVisitCount(Integer visitCount) {
+        this.visitCount = visitCount;
+    }
+}

+ 192 - 0
src/main/java/com/jeeplus/modules/knowledgeSharing/service/KnowledgeSharingDetailsService.java

@@ -0,0 +1,192 @@
+package com.jeeplus.modules.knowledgeSharing.service;
+
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.knowledgeSharing.dao.KnowledgeSharingDetailsDao;
+import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingComment;
+import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingInfo;
+import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingView;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 知识分享Service
+ * @author 徐滕
+ * @create 2022-4-11 9:17
+ */
+@Service
+@Transactional(readOnly = true)
+public class KnowledgeSharingDetailsService extends CrudService<KnowledgeSharingDetailsDao, KnowledgeSharingInfo> {
+
+    @Autowired
+    private WorkattachmentService workattachmentService;
+
+    public KnowledgeSharingInfo get(String id) {
+        return super.get(id);
+    }
+
+    public List<KnowledgeSharingInfo> findList(KnowledgeSharingInfo knowledgeSharingInfo) {
+        return super.findList(knowledgeSharingInfo);
+    }
+
+
+    /**
+     * 获取附件信息
+     * @param knowledgeSharingInfo
+     */
+    public void queryDetails(KnowledgeSharingInfo knowledgeSharingInfo) {
+        if(knowledgeSharingInfo==null)return;
+        Workattachment attchment = new Workattachment();
+        attchment.setAttachmentId(knowledgeSharingInfo.getId());
+        attchment.setAttachmentFlag("183");
+        List<Workattachment> attachments = workattachmentService.findList(attchment);
+        knowledgeSharingInfo.setWorkAttachments(attachments);
+        for (Workattachment clientAttachment:attachments){
+            if (clientAttachment.getCollectFlag().equals("1")){
+                for (Workattachment workattachment:knowledgeSharingInfo.getWorkAttachments()){
+                    if (clientAttachment.getId().equals(workattachment.getId())){
+                        workattachment.setCollectFlag("1");
+                        break;
+                    }
+                }
+            }
+        }
+    }
+
+
+    public Page<KnowledgeSharingInfo> findPage(Page<KnowledgeSharingInfo> page, KnowledgeSharingInfo knowledgeSharingInfo) {
+        //处理登记人信息
+        if (knowledgeSharingInfo!=null && StringUtils.isNotBlank(knowledgeSharingInfo.getJordanswId())){
+            knowledgeSharingInfo.setJordanswName(UserUtils.get(knowledgeSharingInfo.getJordanswId()).getName());
+        }
+        int count = dao.queryCount(knowledgeSharingInfo);
+        page.setCount(count);
+        page.setCountFlag(false);
+        knowledgeSharingInfo.setPage(page);
+        page.setList(findList(knowledgeSharingInfo));
+        return page;
+    }
+
+    @Transactional(readOnly = false)
+    public void save(KnowledgeSharingInfo knowledgeSharingInfo) {
+        knowledgeSharingInfo.setModerator("系统管理员");
+        //添加信息
+        super.save(knowledgeSharingInfo);
+        //保存附件
+        this.saveAttachments(knowledgeSharingInfo);
+
+    }
+
+    /**
+     * 添加附件信息
+     * @param knowledgeSharingInfo
+     */
+    @Transactional(readOnly = false)
+    public void saveAttachments(KnowledgeSharingInfo knowledgeSharingInfo) {
+        List<Workattachment> workattachments = knowledgeSharingInfo.getWorkAttachments();
+        if (workattachments!=null && workattachments.size()!=0) {
+            for (Workattachment workattachment : workattachments) {
+                if (workattachment.getId() == null) {
+                    continue;
+                }
+                if (workattachment.DEL_FLAG_NORMAL.equals(workattachment.getDelFlag())) {
+                    workattachment.setAttachmentId(knowledgeSharingInfo.getId());
+                    workattachment.setAttachmentFlag("183");
+                    workattachment.setAttachmentUser(UserUtils.getUser().getId());
+                    if (StringUtils.isBlank(workattachment.getId()) || "null".equals(workattachment.getId())) {
+                        workattachmentService.insertOnWorkAttachment(workattachment);
+                    } else {
+                        workattachmentService.updateOnWorkAttachment(workattachment);
+                    }
+                } else {
+                    workattachmentService.delete(workattachment);
+                }
+            }
+        }
+    }
+
+    /**
+     * 删除方法
+     * @param knowledgeSharingInfo
+     */
+    @Transactional(readOnly = false)
+    public void delete (KnowledgeSharingInfo knowledgeSharingInfo){
+        dao.deleteByLogic(knowledgeSharingInfo);
+    }
+
+    /**
+     * 根据知识分享id和用户id查询查看知识分享信息数据
+     * @param knowledgeSharingId
+     * @param userId
+     * @return
+     */
+    public KnowledgeSharingView getOaNotifyView(String knowledgeSharingId, String userId){
+        return dao.getKnowledgeSharingView(knowledgeSharingId, userId);
+
+    }
+
+    /**
+     * 保存修改知识分享阅读数据
+     * @param knowledgeSharingView
+     */
+    @Transactional(readOnly = false)
+    public void saveKnowledgeSharingView(KnowledgeSharingView knowledgeSharingView,String knowledgeSharingId){
+        //判断是否为空,若为空则该知识分享没看过 则对该知识分享进行添加基本数据
+        if(null == knowledgeSharingView){
+            KnowledgeSharingView newKnowledgeSharingView = new KnowledgeSharingView();
+            newKnowledgeSharingView.setKnowledgeSharingId(knowledgeSharingId);
+            newKnowledgeSharingView.setUserId(UserUtils.getUser().getId());
+            newKnowledgeSharingView.setVisitCount(1);
+            newKnowledgeSharingView.setFirstVisitTime(new Date());
+            newKnowledgeSharingView.setLastVisitTime(new Date());
+            newKnowledgeSharingView.preInsert();
+            dao.saveKnowledgeSharingView(newKnowledgeSharingView);
+        }else{
+            //如果已经有查看记录则修改最后一次查看记录时间并修改查看次数
+            knowledgeSharingView.setLastVisitTime(new Date());
+            knowledgeSharingView.preUpdate();
+            dao.updateKnowledgeSharingView(knowledgeSharingView);
+        }
+    }
+
+    /**
+     * 根据知识分享id查询查看知识分享记录信息
+     * @param knowledgeSharingId
+     * @return
+     */
+    public List<KnowledgeSharingView> getKnowledgeSharingViewList(String knowledgeSharingId){
+        return dao.getKnowledgeSharingViewList(knowledgeSharingId);
+    }
+
+    /**
+     * 根据知识分享id查询知识分享评论信息
+     * @param knowledgeSharingId
+     * @return
+     */
+    public List<KnowledgeSharingComment> getKnowledgeSharingCommentList(String knowledgeSharingId){
+        return dao.getKnowledgeSharingCommentList(knowledgeSharingId);
+    }
+    /**
+     * 根据知识分享id 新增评论
+     */
+    @Transactional(readOnly = false)
+    public void saveComment(KnowledgeSharingComment knowledgeSharingComment) {
+        knowledgeSharingComment.preInsert();
+        dao.saveComment(knowledgeSharingComment);
+    }
+    /**
+     * 根据评论id 删除评论
+     */
+    @Transactional(readOnly = false)
+    public void deleteComment(String id) {
+        dao.deleteComment(id);
+    }
+}

+ 117 - 0
src/main/java/com/jeeplus/modules/knowledgeSharing/service/KnowledgeSharingService.java

@@ -0,0 +1,117 @@
+package com.jeeplus.modules.knowledgeSharing.service;
+
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.businessQuestions.entity.BusinessQuestions;
+import com.jeeplus.modules.knowledgeSharing.dao.KnowledgeSharingDao;
+import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingInfo;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 知识分享Service
+ * @author 徐滕
+ * @create 2022-4-11 9:17
+ */
+@Service
+@Transactional(readOnly = true)
+public class KnowledgeSharingService extends CrudService<KnowledgeSharingDao, KnowledgeSharingInfo> {
+
+    @Autowired
+    private WorkattachmentService workattachmentService;
+
+    public KnowledgeSharingInfo get(String id) {
+        return super.get(id);
+    }
+
+    public List<KnowledgeSharingInfo> findList(KnowledgeSharingInfo knowledgeSharingInfo) {
+        return super.findList(knowledgeSharingInfo);
+    }
+
+
+    /**
+     * 获取附件信息
+     * @param knowledgeSharingInfo
+     */
+    public void queryDetails(KnowledgeSharingInfo knowledgeSharingInfo) {
+        if(knowledgeSharingInfo==null)return;
+        Workattachment attchment = new Workattachment();
+        attchment.setAttachmentId(knowledgeSharingInfo.getId());
+        attchment.setAttachmentFlag("183");
+        List<Workattachment> attachments = workattachmentService.findList(attchment);
+        knowledgeSharingInfo.setWorkAttachments(attachments);
+        for (Workattachment clientAttachment:attachments){
+            if (clientAttachment.getCollectFlag().equals("1")){
+                for (Workattachment workattachment:knowledgeSharingInfo.getWorkAttachments()){
+                    if (clientAttachment.getId().equals(workattachment.getId())){
+                        workattachment.setCollectFlag("1");
+                        break;
+                    }
+                }
+            }
+        }
+    }
+
+    public Page<KnowledgeSharingInfo> findPage(Page<KnowledgeSharingInfo> page, KnowledgeSharingInfo knowledgeSharingInfo) {
+        int count = dao.queryCount(knowledgeSharingInfo);
+        page.setCount(count);
+        page.setCountFlag(false);
+        knowledgeSharingInfo.setPage(page);
+        page.setList(findList(knowledgeSharingInfo));
+        return page;
+    }
+
+    @Transactional(readOnly = false)
+    public void save(KnowledgeSharingInfo knowledgeSharingInfo) {
+        knowledgeSharingInfo.setModerator("系统管理员");
+        //添加信息
+        super.save(knowledgeSharingInfo);
+        //保存附件
+        this.saveAttachments(knowledgeSharingInfo);
+
+    }
+
+    /**
+     * 添加附件信息
+     * @param knowledgeSharingInfo
+     */
+    @Transactional(readOnly = false)
+    public void saveAttachments(KnowledgeSharingInfo knowledgeSharingInfo) {
+        List<Workattachment> workattachments = knowledgeSharingInfo.getWorkAttachments();
+        if (workattachments!=null && workattachments.size()!=0) {
+            for (Workattachment workattachment : workattachments) {
+                if (workattachment.getId() == null) {
+                    continue;
+                }
+                if (workattachment.DEL_FLAG_NORMAL.equals(workattachment.getDelFlag())) {
+                    workattachment.setAttachmentId(knowledgeSharingInfo.getId());
+                    workattachment.setAttachmentFlag("183");
+                    workattachment.setAttachmentUser(UserUtils.getUser().getId());
+                    if (StringUtils.isBlank(workattachment.getId()) || "null".equals(workattachment.getId())) {
+                        workattachmentService.insertOnWorkAttachment(workattachment);
+                    } else {
+                        workattachmentService.updateOnWorkAttachment(workattachment);
+                    }
+                } else {
+                    workattachmentService.delete(workattachment);
+                }
+            }
+        }
+    }
+
+    /**
+     * 删除方法
+     * @param knowledgeSharingInfo
+     */
+    @Transactional(readOnly = false)
+    public void delete (KnowledgeSharingInfo knowledgeSharingInfo){
+        dao.deleteByLogic(knowledgeSharingInfo);
+    }
+}

+ 107 - 0
src/main/java/com/jeeplus/modules/knowledgeSharing/web/KnowledgeSharingController.java

@@ -0,0 +1,107 @@
+package com.jeeplus.modules.knowledgeSharing.web;
+
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.MyBeanUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.businessQuestions.entity.BusinessQuestions;
+import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingInfo;
+import com.jeeplus.modules.knowledgeSharing.service.KnowledgeSharingService;
+import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.apache.shiro.authz.annotation.Logical;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+
+/**
+ * 知识分享Controller
+ * @author 徐滕
+ * @create 2022-04-11 09:20
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/knowledgeSharing/knowledgeSharing")
+public class KnowledgeSharingController extends BaseController {
+
+    @Autowired
+    private KnowledgeSharingService service;
+
+    @ModelAttribute
+    public KnowledgeSharingInfo get(@RequestParam(required=false) String id) {
+        KnowledgeSharingInfo entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = service.get(id);
+        }
+        if (entity == null){
+            entity = new KnowledgeSharingInfo();
+        }
+        return entity;
+    }
+
+    /**
+     * 业务提问-所有问题展示页
+     */
+    @RequiresPermissions("knowledgeSharing:knowledgeSharing:list")
+    @RequestMapping(value = {"list", ""})
+    public String list(KnowledgeSharingInfo knowledgeSharingInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<KnowledgeSharingInfo> page = service.findPage(new Page<KnowledgeSharingInfo>(request, response), knowledgeSharingInfo);
+        model.addAttribute("page", page);
+        return "modules/knowledgeSharing/knowledgeSharingList";
+    }
+
+    /**
+     * 查看,增加,编辑业务提问表单页面
+     * @param knowledgeSharingInfo
+     * @param model
+     * @return
+     */
+    @RequiresPermissions(value={"knowledgeSharing:knowledgeSharing:add","knowledgeSharing:knowledgeSharing:edit"},logical= Logical.OR)
+    @RequestMapping(value = "form")
+    public String form(KnowledgeSharingInfo knowledgeSharingInfo, Model model) {
+        if (knowledgeSharingInfo!=null&&StringUtils.isNotBlank(knowledgeSharingInfo.getId())) {
+            service.queryDetails(knowledgeSharingInfo);
+        }else {
+            knowledgeSharingInfo.setCreateBy(UserUtils.getUser());
+            knowledgeSharingInfo.setCreateDate(new Date());
+        }
+
+        model.addAttribute("knowledgeSharingInfo", knowledgeSharingInfo);
+        return "modules/knowledgeSharing/knowledgeSharingForm";
+    }
+
+    /**
+     * 暂存
+     * @param knowledgeSharingInfo
+     * @param model
+     * @param redirectAttributes
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions(value={"knowledgeSharing:knowledgeSharing:add","knowledgeSharing:knowledgeSharing:edit"},logical=Logical.OR)
+    @RequestMapping(value = "save")
+    public String save(KnowledgeSharingInfo knowledgeSharingInfo, Model model, RedirectAttributes redirectAttributes) throws Exception{
+        if (!beanValidator(model, knowledgeSharingInfo)){
+            return form(knowledgeSharingInfo, model);
+        }
+
+        if(!knowledgeSharingInfo.getIsNewRecord()){//编辑表单保存
+            KnowledgeSharingInfo t = service.get(knowledgeSharingInfo.getId());//从数据库取出记录的值
+            MyBeanUtils.copyBeanNotNull2Bean(knowledgeSharingInfo, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+            service.save(t);//保存
+        }else{//新增表单保存
+            service.save(knowledgeSharingInfo);//保存
+        }
+        addMessage(redirectAttributes, "保存成功");
+        return "redirect:"+ Global.getAdminPath()+"/knowledgeSharing/knowledgeSharing/?repage";
+    }
+}

+ 245 - 0
src/main/java/com/jeeplus/modules/knowledgeSharing/web/KnowledgeSharingDetailsController.java

@@ -0,0 +1,245 @@
+package com.jeeplus.modules.knowledgeSharing.web;
+
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.MyBeanUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingInfo;
+import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingView;
+import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingComment;
+import com.jeeplus.modules.knowledgeSharing.service.KnowledgeSharingDetailsService;
+import com.jeeplus.modules.sys.entity.MainDictDetail;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.DictUtils;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.apache.shiro.authz.annotation.Logical;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 知识分享-列表Controller
+ * @author 徐滕
+ * @create 2022-04-15 14:20
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/knowledgeSharingDetails/knowledgeSharingDetails")
+public class KnowledgeSharingDetailsController extends BaseController {
+
+    @Autowired
+    private KnowledgeSharingDetailsService service;
+
+    @ModelAttribute
+    public KnowledgeSharingInfo get(@RequestParam(required=false) String id) {
+        KnowledgeSharingInfo entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = service.get(id);
+        }
+        if (entity == null){
+            entity = new KnowledgeSharingInfo();
+        }
+        return entity;
+    }
+
+    /**
+     * 业务提问-所有问题展示页
+     */
+    @RequiresPermissions("knowledgeSharing:knowledgeSharing:list")
+    @RequestMapping(value = {"list", ""})
+    public String list(KnowledgeSharingInfo knowledgeSharingInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if(StringUtils.isBlank(knowledgeSharingInfo.getColumnId())){
+            knowledgeSharingInfo.setColumnId("1");
+        }
+        Page<KnowledgeSharingInfo> page = service.findPage(new Page<KnowledgeSharingInfo>(request, response), knowledgeSharingInfo);
+        model.addAttribute("page", page);
+        model.addAttribute("columnId", knowledgeSharingInfo.getColumnId());
+        return "modules/knowledgeSharing/knowledgeSharingDetailsList";
+    }
+
+    /**
+     * 查看,增加,编辑业务提问表单页面
+     * @param knowledgeSharingInfo
+     * @param model
+     * @return
+     */
+    @RequiresPermissions(value={"knowledgeSharing:knowledgeSharing:add","knowledgeSharing:knowledgeSharing:edit"},logical= Logical.OR)
+    @RequestMapping(value = "form")
+    public String form(KnowledgeSharingInfo knowledgeSharingInfo, Model model) {
+        if (knowledgeSharingInfo!=null&&StringUtils.isNotBlank(knowledgeSharingInfo.getId())) {
+            service.queryDetails(knowledgeSharingInfo);
+        }else {
+            knowledgeSharingInfo.setCreateBy(UserUtils.getUser());
+            knowledgeSharingInfo.setCreateDate(new Date());
+        }
+
+        model.addAttribute("knowledgeSharingInfo", knowledgeSharingInfo);
+        return "modules/knowledgeSharing/knowledgeSharingDetailsForm";
+    }
+
+    /**
+     * 保存
+     * @param knowledgeSharingInfo
+     * @param model
+     * @param redirectAttributes
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions(value={"knowledgeSharing:knowledgeSharing:add","knowledgeSharing:knowledgeSharing:edit"},logical=Logical.OR)
+    @RequestMapping(value = "save")
+    public String save(KnowledgeSharingInfo knowledgeSharingInfo, Model model, RedirectAttributes redirectAttributes) throws Exception{
+        if (!beanValidator(model, knowledgeSharingInfo)){
+            return form(knowledgeSharingInfo, model);
+        }
+
+        if(!knowledgeSharingInfo.getIsNewRecord()){//编辑表单保存
+            KnowledgeSharingInfo t = service.get(knowledgeSharingInfo.getId());//从数据库取出记录的值
+            MyBeanUtils.copyBeanNotNull2Bean(knowledgeSharingInfo, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+            service.save(t);//保存
+        }else{//新增表单保存
+            service.save(knowledgeSharingInfo);//保存
+        }
+        addMessage(redirectAttributes, "保存成功");
+        return "redirect:"+ Global.getAdminPath()+"/knowledgeSharing/knowledgeSharing/?repage";
+    }
+
+    /**
+     * 查看页面
+     */
+    @RequiresPermissions(value={"knowledgeSharing:knowledgeSharing:view"},logical=Logical.OR)
+    @RequestMapping(value = "view")
+    public String view(KnowledgeSharingInfo knowledgeSharingInfo, Model model) {
+        if (knowledgeSharingInfo!=null&&StringUtils.isNotBlank(knowledgeSharingInfo.getId())) {
+            service.queryDetails(knowledgeSharingInfo);
+        }else {
+            knowledgeSharingInfo.setCreateBy(UserUtils.getUser());
+            knowledgeSharingInfo.setCreateDate(new Date());
+        }
+
+        List<MainDictDetail> billingContentList = DictUtils.getMainDictList("column_name");
+        for (MainDictDetail dictDetail: billingContentList) {
+            if(knowledgeSharingInfo.getColumnId().equals(dictDetail.getValue())){
+                knowledgeSharingInfo.setColumnName(dictDetail.getLabel());
+                break;
+            }
+        }
+
+        //查看登陆者访问该知识分享信息
+        KnowledgeSharingView knowledgeSharingView = service.getOaNotifyView(knowledgeSharingInfo.getId(), UserUtils.getUser().getId());
+        //更新查看知识分享已看数据
+        service.saveKnowledgeSharingView(knowledgeSharingView,knowledgeSharingInfo.getId());
+
+        //根据知识分享id查询查看知识分享记录信息(先修改查看记录 再进行查询)
+        List<KnowledgeSharingView> knowledgeSharingViewList = service.getKnowledgeSharingViewList(knowledgeSharingInfo.getId());
+        //查询知识分享评论信息
+        List<KnowledgeSharingComment> knowledgeSharingCommentList = service.getKnowledgeSharingCommentList(knowledgeSharingInfo.getId());
+        for (KnowledgeSharingComment info: knowledgeSharingCommentList) {
+            if(null != info.getMinuteTime()){
+                //判断评论时间是否小于60分钟
+                if(info.getMinuteTime() < 60){
+                    info.setCommentDateStr(info.getMinuteTime() + "分钟");
+                }else{
+                    //计算评论时间距今过去多少小时
+                    Long hour = info.getMinuteTime()/60;
+                    //判断小时数是否大于24
+                    if(hour > 24){
+                        Long day = hour/24;
+                        info.setCommentDateStr(day + "天");
+                    }else{
+                        info.setCommentDateStr(hour + "小时");
+                    }
+                }
+            }else{
+                info.setCommentDateStr("0分钟");
+            }
+
+            //判断是否有删除权限(只有管理员和评论人可以删除评论)
+            User loginUser = UserUtils.getUser();
+            if(loginUser.isAdmin() || info.getUser().getId().equals(loginUser.getId())){
+                info.setFlag(1);
+            }else{
+                info.setFlag(0);
+            }
+
+        }
+        model.addAttribute("knowledgeSharingCommentList",knowledgeSharingCommentList);
+        model.addAttribute("knowledgeSharingCommentCount",knowledgeSharingCommentList.size());
+        model.addAttribute("toReadMyNotify",true);
+        model.addAttribute("knowledgeSharingViewList", knowledgeSharingViewList);;
+        model.addAttribute("knowledgeSharingInfo", knowledgeSharingInfo);
+        return "modules/knowledgeSharing/knowledgeSharingView";
+    }
+
+    /**
+     * 根据知识分享id 新增评论
+     * @param knowledgeSharingComment
+     * @return
+     */
+    @RequestMapping(value = "saveComment")
+    @ResponseBody
+    public Map saveComment(KnowledgeSharingComment knowledgeSharingComment) {
+        Map map = new HashMap();
+        try {
+            service.saveComment(knowledgeSharingComment);
+            map.put("success",true);
+        } catch (Exception e) {
+            logger.error("Exception e:"+e);
+            e.printStackTrace();
+            map.put("success",false);
+        }
+        return map;
+    }
+
+
+    /**
+     * 删除
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions(value={"knowledgeSharing:knowledgeSharing:del"},logical=Logical.OR)
+    @RequestMapping(value = "delete")
+    @ResponseBody
+    public Object delete(KnowledgeSharingInfo knowledgeSharingInfo){
+        Map<String,Object> map = new HashMap<>();
+        try {
+            service.delete(knowledgeSharingInfo);//保存
+            map.put("success",true);
+        }catch (Exception e){
+            map.put("success",false);
+        }
+        return map;
+    }
+
+    /**
+     * 根据评论id 删除评论
+     * @param id
+     * @return
+     */
+    @RequestMapping(value = "deleteComment")
+    @ResponseBody
+    public Map deleteComment(String id) {
+        Map map = new HashMap();
+        try {
+            service.deleteComment(id);
+            map.put("success",true);
+        } catch (Exception e) {
+            logger.error("Exception e:"+e);
+            e.printStackTrace();
+            map.put("success",false);
+        }
+        return map;
+    }
+}

+ 3 - 1
src/main/java/com/jeeplus/modules/sys/web/OfficeController.java

@@ -479,7 +479,9 @@ public class OfficeController extends BaseController {
             Iterator<Office> it = list.iterator();
             while(it.hasNext()){
                 Office info = it.next();
-                if(info.getId().equals("876aaf31050d4829a8c916aaf2184487") || info.getId().equals("5c38f1ce85224d74bd9d110ea6fab976")){
+                if(info.getId().equals("876aaf31050d4829a8c916aaf2184487") || info.getParentIds().contains("876aaf31050d4829a8c916aaf2184487")
+                        || info.getId().equals("5c38f1ce85224d74bd9d110ea6fab976")
+                        || info.getParentIds().contains("5c38f1ce85224d74bd9d110ea6fab976")){
                     it.remove();
                 }
             }

+ 137 - 0
src/main/resources/mappings/modules/knowledgeSharing/KnowledgeSharingDao.xml

@@ -0,0 +1,137 @@
+<?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.knowledgeSharing.dao.KnowledgeSharingDao">
+
+	<sql id="businessQuestionsColumns">
+		a.id as "id",
+		a.create_by as "createBy.id",
+		(select name from sys_user user where user.id=a.create_by) as "createBy.name",
+		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.column_id as "columnId",
+		a.subject as "subject",
+		a.moderator as "moderator",
+		a.contents as "contents"
+	</sql>
+
+	<sql id="businessQuestionsJoins">
+		left join main_dict_detail mdd on mdd.id = a.column_id
+	</sql>
+
+
+	<select id="get" resultType="com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingInfo" >
+		SELECT
+			<include refid="businessQuestionsColumns"/>
+		FROM knowledge_sharing_info a
+		<include refid="businessQuestionsJoins"/>
+		WHERE a.id = #{id}
+	</select>
+
+	<select id="findList" resultType="com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingInfo" >
+		SELECT
+			<include refid="businessQuestionsColumns"/>
+			,count(column_id) as "invitationCount"
+			,concat('最后更新:',a.update_date,'。发帖人:',(select name from sys_user user where user.id=a.create_by),'(',(select name from sys_office where id = (select office_id from sys_user user where user.id = a.create_by)),')') as 'lastPublish'
+		FROM (select * from knowledge_sharing_info where del_flag = 0 order by update_date desc) a
+		<include refid="businessQuestionsJoins"/>
+		left join sys_user su on su.id = a.create_by
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+            <if test="columnId != null and columnId != ''">
+                AND a.column_id = #{columnId}
+            </if>
+		</where>
+		group by a.column_id
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+
+	<select id="queryCount" resultType="java.lang.Integer" >
+		select count(1) from (
+			SELECT count(a.column_id)
+			FROM knowledge_sharing_info a
+			<include refid="businessQuestionsJoins"/>
+			left join sys_user su on su.id = a.create_by
+			<where>
+				a.del_flag = 0
+				<if test="columnId != null and columnId != ''">
+					AND a.column_id = #{columnId}
+				</if>
+			</where>
+		group by a.column_id) z
+
+	</select>
+
+	<insert id="insert">
+		INSERT INTO knowledge_sharing_info(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+
+			column_id,
+			subject,
+			moderator,
+			contents
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+
+			#{columnId},
+			#{subject},
+			#{moderator},
+			#{contents}
+		)
+	</insert>
+
+	<update id="update">
+		UPDATE knowledge_sharing_info SET
+			update_by = #{updateBy.id}
+			,update_date = #{updateDate}
+			,remarks = #{remarks}
+			<if test="columnId != null and columnId != ''">
+				,column_id = #{columnId}
+			</if>
+			<if test="subject != null and subject != ''">
+				,subject = #{subject}
+			</if>
+			<if test="moderator != null and moderator != ''">
+				,moderator = #{moderator}
+			</if>
+			<if test="contents != null and contents != ''">
+				,contents = #{contents}
+			</if>
+		WHERE id = #{id}
+	</update>
+
+
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM knowledge_sharing_info
+		WHERE id = #{id}
+	</update>
+
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE knowledge_sharing_info SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+</mapper>

+ 274 - 0
src/main/resources/mappings/modules/knowledgeSharing/KnowledgeSharingDetailsDao.xml

@@ -0,0 +1,274 @@
+<?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.knowledgeSharing.dao.KnowledgeSharingDetailsDao">
+
+	<sql id="businessQuestionsColumns">
+		a.id as "id",
+		a.create_by as "createBy.id",
+		(select name from sys_user user where user.id=a.create_by) as "createBy.name",
+		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.column_id as "columnId",
+		a.subject as "subject",
+		a.moderator as "moderator",
+		a.contents as "contents"
+	</sql>
+
+
+	<select id="get" resultType="com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingInfo" >
+		SELECT
+			<include refid="businessQuestionsColumns"/>
+		FROM knowledge_sharing_info a
+		WHERE a.id = #{id}
+	</select>
+
+	<select id="findList" resultType="com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingInfo" >
+		SELECT
+			<include refid="businessQuestionsColumns"/>
+			,(select sum(ksv.visit_count) from knowledge_sharing_view ksv where a.id = ksv.knowledge_sharing_id) as "readCount"
+			,(select count(ksc.id) from knowledge_sharing_comment ksc where a.id = ksc.knowledge_sharing_id) as "replyCount"
+		FROM knowledge_sharing_info a
+		left join sys_user su on su.id = a.create_by
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+            <if test="columnId != null and columnId != ''">
+                AND a.column_id = #{columnId}
+            </if>
+			<if test="(jordanswId != null and jordanswId != '') or (jordanswName != null and jordanswName != '')">
+				AND (a.create_by = #{jordanswId} or su.name like concat('%',#{jordanswName},'%'))
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+
+	<select id="queryCount" resultType="java.lang.Integer" >
+		SELECT count(1)
+		FROM knowledge_sharing_info a
+		left join sys_user su on su.id = a.create_by
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			<if test="columnId != null and columnId != ''">
+				AND a.column_id = #{columnId}
+			</if>
+			<if test="(jordanswId != null and jordanswId != '') or (jordanswName != null and jordanswName != '')">
+				AND (a.create_by = #{jordanswId} or su.name like concat('%',#{jordanswName},'%'))
+			</if>
+		</where>
+	</select>
+
+	<insert id="insert">
+		INSERT INTO knowledge_sharing_info(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+
+			column_id,
+			subject,
+			moderator,
+			contents
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+
+			#{columnId},
+			#{subject},
+			#{moderator},
+			#{contents}
+		)
+	</insert>
+
+	<update id="update">
+		UPDATE knowledge_sharing_info SET
+		update_by = #{updateBy.id}
+		,update_date = #{updateDate}
+		,remarks = #{remarks}
+		<if test="columnId != null and columnId != ''">
+			,column_id = #{columnId}
+		</if>
+		<if test="subject != null and subject != ''">
+			,subject = #{subject}
+		</if>
+		<if test="moderator != null and moderator != ''">
+			,moderator = #{moderator}
+		</if>
+		<if test="contents != null and contents != ''">
+			,contents = #{contents}
+		</if>
+		WHERE id = #{id}
+	</update>
+
+
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM knowledge_sharing_info
+		WHERE id = #{id}
+	</update>
+
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE knowledge_sharing_info SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+
+
+	<select id="getKnowledgeSharingView" resultType="com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingView">
+		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.del_flag AS "delFlag",
+		  a.remarks AS "remarks",
+		  a.knowledge_sharing_id as "knowledgeSharingId",
+		  a.user_id as "userId",
+		  a.first_visit_time as "firstVisitTime",
+		  a.last_visit_time as "lastVisitTime",
+		  a.visit_count as "visitCount"
+		from
+		  knowledge_sharing_view a
+		  where
+		  a.knowledge_sharing_id = #{knowledgeSharingId}
+		  and a.user_id = #{userId}
+	</select>
+
+
+	<select id="getKnowledgeSharingViewList" resultType="com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingView">
+		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.del_flag AS "delFlag",
+		  a.remarks AS "remarks",
+		  a.knowledge_sharing_id as "knowledgeSharingId",
+		  a.user_id as "userId",
+		  (select name from sys_user user where user.id=a.user_id) as "userName",
+		  a.first_visit_time as "firstVisitTime",
+		  a.last_visit_time as "lastVisitTime",
+		  a.visit_count as "visitCount"
+		from
+		  knowledge_sharing_view a
+		  left join sys_user su on a.user_id = su.id
+		  where
+		  a.knowledge_sharing_id = #{knowledgeSharingId}
+	</select>
+
+	<insert id="saveKnowledgeSharingView">
+		insert into knowledge_sharing_view (
+		  id,
+		  create_by,
+		  create_date,
+		  update_by,
+		  update_date,
+		  remarks,
+		  del_flag,
+		  knowledge_sharing_id,
+		  user_id,
+		  first_visit_time,
+		  last_visit_time,
+		  visit_count
+		)
+		values
+		  (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{knowledgeSharingId},
+			#{userId},
+			#{firstVisitTime},
+			#{lastVisitTime},
+			#{visitCount}
+		  )
+	</insert>
+
+	<update id="updateKnowledgeSharingView">
+		update
+			knowledge_sharing_view
+		set
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			last_visit_time = #{lastVisitTime},
+			visit_count = visit_count + 1
+		where id = #{id}
+	</update>
+
+	<select id="getKnowledgeSharingCommentList" resultType="com.jeeplus.modules.knowledgeSharing.entity.KnowledgeSharingComment">
+		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.del_flag AS "delFlag",
+		  a.remarks AS "remarks",
+		  a.knowledge_sharing_id as "knowledgeSharingId",
+		  a.content as "content",
+		  su.name as "user.name",
+		  a.user_id as "user.id",
+		  timestampdiff(MINUTE,a.update_date,now()) as minuteTime
+		from
+		  knowledge_sharing_comment a
+	  left join sys_user su on a.user_id = su.id
+	  where
+		  a.knowledge_sharing_id = #{oaNotifyId}
+	  order by a.update_date desc
+	</select>
+
+	<insert id="saveComment">
+		INSERT INTO knowledge_sharing_comment (
+		  id,
+		  create_by,
+		  create_date,
+		  update_by,
+		  update_date,
+		  remarks,
+		  del_flag,
+		  knowledge_sharing_id,
+		  content,
+		  user_id
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{knowledgeSharingId},
+			#{content},
+			#{createBy.id}
+		)
+	</insert>
+
+	<delete id="deleteComment">
+		delete from knowledge_sharing_comment
+		where id = #{id}
+	</delete>
+</mapper>

+ 301 - 0
src/main/webapp/webpage/modules/knowledgeSharing/knowledgeSharingDetailsForm.jsp

@@ -0,0 +1,301 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+
+<html>
+<head>
+    <title>业务提问管理</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript" src="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/iCheck/icheck.min.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <script src="${ctxStatic}/common/html/js/script.js"></script>
+
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+
+    <script type="text/javascript">
+        var validateForm;
+        var isMasterClient = true;//是否是委托方
+        var clientCount = 0;
+        function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                $("#inputForm").submit();
+                return true;
+            }
+
+            return false;
+        }
+        $(document).ready(function() {
+            layui.use(['form', 'layer'], function () {
+                var form = layui.form;
+
+            });
+            validateForm = $("#inputForm").validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+
+            $("#attachment_btn").click(function () {
+                $("#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 = "183";
+                console.log(file);
+                var timestamp=new Date().getTime();
+
+                var storeAs = "knowledgeSharingInfo";
+                var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+                var divId = "_attachment";
+                $("#addFile"+divId).show();
+                multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
+        }
+
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <sys:message content="${message}"/>
+        <form:form id="inputForm" modelAttribute="knowledgeSharingInfo" action="${ctx}/knowledgeSharingDetails/knowledgeSharingDetails/save" method="post" class="form-horizontal layui-form">
+            <form:hidden path="id"/>
+            <form:hidden path="columnId"/>
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>知识分享</h2></div>
+
+                <div class="layui-item layui-col-sm6 lw6">
+                    <label class="layui-form-label"><span class="require-item">*</span>栏目名称:</label>
+                    <div class="layui-input-block">
+                        <form:select path="columnId" class="form-control editable-select layui-input required" disabled="true">
+                            <form:option value=""/>
+                            <form:options items="${fns:getMainDictList('column_name')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                        </form:select>
+                    </div>
+                </div>
+
+                <div class="layui-item layui-col-sm6 lw6">
+                    <label class="layui-form-label"><span class="require-item">*</span>主题:</label>
+                    <div class="layui-input-block">
+                        <form:input path="subject" placeholder="请输入主题" htmlEscape="false"  class="form-control layui-input required"/>
+                    </div>
+                </div>
+
+                <div class="layui-item layui-col-sm12" style="padding-bottom: 20px;">
+                    <label class="layui-form-label">问题内容:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="contents" htmlEscape="false"  colspan="3" rows="6"  maxlength="550" class="form-control "/>
+                        <sys:ckeditor replace="contents" uploadPath="/oa/oa"/>
+                    </div>
+                </div>
+                <div class="form-group layui-row">
+                    <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>
+                        <b><span id="baifenbi_attachment" ></span></b>
+                        <div class="progress">
+                            <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+                            </div>
+                        </div>
+                    </div>
+                    <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+                    <span id="attachment_title"></span>
+                    <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                        <table id="listAttachment" class="table table-bordered table-condensed details">
+                            <thead>
+                            <tr>
+                                    <%-- <th>序号</th>--%>
+                                <th>文件预览</th>
+                                <th>上传人</th>
+                                <th>上传时间</th>
+                                <th width="200px">操作</th>
+                            </tr>
+                            </thead>
+                            <tbody id="file_attachment">
+                            <c:forEach items="${knowledgeSharingInfo.workAttachments}" var = "workClientAttachment" varStatus="status">
+                                <tr>
+
+                                        <%-- <td>${status.index + 1}</td>--%>
+                                    <c:choose>
+                                        <c:when test="${knowledgeSharingInfo.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                    <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                    <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${knowledgeSharingInfo.uploadMode == 2}">
+                                                                    <c:choose>
+                                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                                            <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                                        </c:when>
+                                                                        <c:otherwise>
+                                                                            <c:choose>
+                                                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                                                </c:when>
+                                                                                <c:otherwise>
+                                                                                    <c:choose>
+                                                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                                        </c:when>
+                                                                                        <c:otherwise>
+                                                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                                        </c:otherwise>
+                                                                                    </c:choose>
+                                                                                </c:otherwise>
+                                                                            </c:choose>
+                                                                        </c:otherwise>
+                                                                    </c:choose>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <c:choose>
+                                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                                            <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                                        </c:when>
+                                                                        <c:otherwise>
+                                                                            <c:choose>
+                                                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                                                    <td><a href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                                                </c:when>
+                                                                                <c:otherwise>
+                                                                                    <c:choose>
+                                                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                                        </c:when>
+                                                                                        <c:otherwise>
+                                                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                                        </c:otherwise>
+                                                                                    </c:choose>
+                                                                                </c:otherwise>
+                                                                            </c:choose>
+                                                                        </c:otherwise>
+                                                                    </c:choose>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:otherwise>
+                                    </c:choose>
+
+                                    <td>${workClientAttachment.createBy.name}</td>
+                                    <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+                                    <td class="op-td">
+                                        <div class="op-btn-box" >
+                                                <%--附件下载删除--%>
+                                            <c:choose>
+                                                <c:when test="${knowledgeSharingInfo.uploadMode == 2}">
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                </c:otherwise>
+                                            </c:choose>
+                                            <c:if test="${workClientAttachment.collectFlag != 1}">
+                                                <a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
+                                            </c:if>
+                                            <c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">
+                                                <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile_attachment','_attachment')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
+                                            </c:if>
+
+                                        </div>
+                                    </td>
+                                </tr>
+                            </c:forEach>
+                            </tbody>
+                        </table>
+                    </div>
+                </div>
+            </div>
+
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+</body>
+</html>

+ 302 - 0
src/main/webapp/webpage/modules/knowledgeSharing/knowledgeSharingDetailsList.jsp

@@ -0,0 +1,302 @@
+<%@ 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}/ckeditor/ckeditor.js"></script>
+	<script type="text/javascript">
+
+		$(document).ready(function() {
+			//搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow1);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow1);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+
+            var columnId = '${columnId}';
+			$(".list-tabs li").each(function(){
+				$(this).removeAttr("class","active");
+				var id='#'+$(this).find("span").html();
+				$(id).attr("class","hide");
+				if($(this).val() == columnId){
+					$(this).attr("class","active");
+					var id='#'+$(this).find("span").html();
+					$(id).removeAttr("class","hide");
+				}
+				$("#columnId").val(columnId)
+			})
+
+			$(".list-tabs li").click(function(){
+				$(".list-tabs li").each(function(){
+					$(this).removeAttr("class","active");
+					var id='#'+$(this).find("span").html();
+					$(id).attr("class","hide");
+				})
+				$(this).attr("class","active");
+				var id='#'+$(this).find("span").html();
+				$(id).removeAttr("class","hide");
+
+				$("#columnId").val($(this).val())
+				$("#searchForm").submit();
+			})
+		});
+
+		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: 'two-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);
+							window.location.reload();
+						}, 100);//延时0.1秒,对应360 7.1版本bug
+						top.layer.close(index);
+					}
+
+				},
+				btn2: function (index) {
+				}
+			});
+		}
+
+		function deleteInfo(title,id) {
+
+			layer.open({
+				title: title,
+				maxmin: true, //开启最大化最小化按钮
+				content: '确认要删除帖子吗?',
+				skin: 'two-btns',
+				btn: ['确定', '取消'],
+				btn1: function(index, layero){
+					$.ajax({
+						type:"post",
+						url:"${ctx}/knowledgeSharingDetails/knowledgeSharingDetails/delete?id="+ id,
+						success:function(data){
+							if(data.success) {
+								parent.layer.msg('删除成功', {icon: 1});
+								window.location.reload();
+							}else {
+								parent.layer.msg('删除失败', {icon: 0});
+							}
+						}
+					})
+
+				},
+				btn2: function (index) {
+				}
+			});
+		}
+
+
+		//打开对话框(查看)
+		function openDialogListView(title,url,width,height){
+
+
+			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+				width='auto';
+				height='auto';
+			}else{//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			$.ajax({
+				async: false,
+				url: url,
+				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){
+							}
+						});
+					}
+				}
+			});
+
+		}
+	</script>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<sys:message content="${message}"/>
+	<div class="list-form-tab contentShadow shadowLTR" id="tabDiv">
+		<ul class="list-tabs" >
+			<li value="1"><a>学习园地</a></li>
+			<li value="2"><a>请教专家</a></li>
+			<li value="3"><a>一事一议</a></li>
+			<li value="4"><a>案例分析</a></li>
+			<li value="5"><a>知识分享</a></li>
+			<li value="6"><a>案例讨论</a></li>
+		</ul>
+	</div>
+	<div class="layui-row">
+		<div class="full-width fl">
+			<div class="contentShadow layui-row" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="knowledgeSharingInfo" action="${ctx}/knowledgeSharingDetails/knowledgeSharingDetails/list" method="post" class="form-inline">
+					<input id="columnId" name="columnId" type="hidden" value="${columnId}"/>
+					<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">
+							<label class="layui-form-label">主题:</label>
+							<div class="layui-input-block">
+								<form:input path="subject" htmlEscape="false" maxlength="64"  class=" form-control  layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">发帖人:</label>
+							<div class="layui-input-block with-icon">
+								<sys:inquireselectUserNotReadolnyTow id="jordansw" name="jordanswId" value="${knowledgeSharingInfo.jordanswId}" labelName="jordanswName" labelValue="${knowledgeSharingInfo.jordanswName}" cssStyle="background-color: #fff"
+																	 title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+							</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;">
+						<div style="clear:both;"></div>
+					</div>
+				</form:form>
+			</div>
+		</div>
+		<div class="full-width fl">
+			<div class="contentShadow layui-form contentDetails">
+				<div class="nav-btns">
+					<div class="layui-btn-group">
+						<shiro:hasPermission name="knowledgeSharing:knowledgeSharing:add">
+							<table:addRow label="新发帖" url="${ctx}/knowledgeSharingDetails/knowledgeSharingDetails/form?columnId=${columnId}" title="新发帖" height="95%;" width="95%;"></table:addRow><!-- 增加按钮 -->
+						</shiro:hasPermission>
+						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+					</div>
+				</div>
+				<table class="oa-table layui-table" id="contentTable"></table>
+
+				<!-- 分页代码 -->
+				<table:page page="${page}"></table:page>
+				<div style="clear: both;"></div>
+			</div>
+		</div>
+	</div>
+	<div id="changewidth"></div>
+</div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+	layui.use('table', function(){
+		layui.table.render({
+			limit:${ page.pageSize }
+			,id:"checkboxTable"
+			,elem: '#contentTable'
+			,page: false
+			,cols: [[
+				//{checkbox: true, fixed: true},
+				{field:'index',align:'center',  width:40,title: '序号'}
+				,{field:'subject',align:'center', title: '主题', minWidth:250,templet:function(d){
+						var xml = "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogView('查看', '${ctx}/knowledgeSharingDetails/knowledgeSharingDetails/view?id=" + d.id + "','95%','95%')\">" +
+								"<span title=" + d.subject + ">" + d.subject + "</span></a>";
+						return xml;
+					}}
+				,{field:'createBy',align:'center', title: '发帖人', width:100}
+				,{field:'createDate',align:'center', title: '发帖时间', width:150}
+				,{field:'readCount',align:'center', title: '阅读数', width:100}
+				,{field:'replyCount', align:'center',title: '回复数', width:100}
+				,{align:'center',title:"操作",width:150,templet:function(d){
+						////对操作进行初始化
+						var xml = "<div class=\"layui-btn-group\">";
+						if(d.canedit != undefined && d.canedit == "1")
+							xml += "<a href=\"javascript:void(0)\" onclick=\"openDialog('修改发帖信息', '${ctx}/knowledgeSharingDetails/knowledgeSharingDetails/form?id="+ d.id +"','95%', '95%')\"   class=\"layui-btn layui-btn-xs  layui-bg-green\"> 编辑</a>";
+
+						if((d.candelete != undefined && d.candelete == "1") || d.isAdmin == "1")
+							xml += "<a href=\"javascript:void(0)\" onclick=\"deleteInfo('删除',  '"+d.id+"')\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
+							/*xml += "<a href=\"${ctx}/knowledgeSharingDetails/knowledgeSharingDetails/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="knowledgeSharingInfo" varStatus="index">
+				<c:if test="${index.index != 0}">,</c:if>
+				{
+					"index":"${index.index+1}"
+					,"id":"${knowledgeSharingInfo.id}"
+					,"columnId":"${knowledgeSharingInfo.columnId}"
+					,"subject":"${knowledgeSharingInfo.subject}"
+					,"columnName":"${fns:getMainDictLabel(knowledgeSharingInfo.columnId, 'column_name', '')}"
+					,"invitationCount":"${knowledgeSharingInfo.invitationCount}"
+					,"createBy":"${knowledgeSharingInfo.createBy.name}"
+					,"createDate":"<fmt:formatDate value="${knowledgeSharingInfo.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
+					,"moderator":"${knowledgeSharingInfo.moderator}"
+					,"lastPublish":"${knowledgeSharingInfo.lastPublish}"
+					,"readCount":"${knowledgeSharingInfo.readCount}"
+					,"replyCount":"${knowledgeSharingInfo.replyCount}"
+					,"isAdmin":"${knowledgeSharingInfo.isAdmin}"
+					<shiro:hasPermission name="knowledgeSharing:knowledgeSharing:edit">,"canedit":<c:choose><c:when test="${fns:getUser().id == knowledgeSharingInfo.createBy.id}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose></shiro:hasPermission>
+					<shiro:hasPermission name="knowledgeSharing:knowledgeSharing:del">,"candelete":<c:choose><c:when test="${fns:getUser().id == knowledgeSharingInfo.createBy.id}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose></shiro:hasPermission>
+				}
+				</c:forEach>
+				</c:if>
+			]
+			// ,even: true
+			// ,height: 315
+		});
+
+	})
+
+	resizeListTable();
+</script>
+<script>
+	resizeListWindow1();
+	$(window).resize(function(){
+		resizeListWindow1();
+	});
+</script>
+</body>
+</html>

+ 300 - 0
src/main/webapp/webpage/modules/knowledgeSharing/knowledgeSharingForm.jsp

@@ -0,0 +1,300 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+
+<html>
+<head>
+    <title>业务提问管理</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript" src="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/iCheck/icheck.min.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <script src="${ctxStatic}/common/html/js/script.js"></script>
+
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+
+    <script type="text/javascript">
+        var validateForm;
+        var isMasterClient = true;//是否是委托方
+        var clientCount = 0;
+        function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                $("#inputForm").submit();
+                return true;
+            }
+
+            return false;
+        }
+        $(document).ready(function() {
+            layui.use(['form', 'layer'], function () {
+                var form = layui.form;
+
+            });
+            validateForm = $("#inputForm").validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+
+            $("#attachment_btn").click(function () {
+                $("#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 = "183";
+                console.log(file);
+                var timestamp=new Date().getTime();
+
+                var storeAs = "knowledgeSharingInfo";
+                var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+                var divId = "_attachment";
+                $("#addFile"+divId).show();
+                multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
+        }
+
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <sys:message content="${message}"/>
+        <form:form id="inputForm" modelAttribute="knowledgeSharingInfo" action="${ctx}/knowledgeSharing/knowledgeSharing/save" method="post" class="form-horizontal layui-form">
+            <form:hidden path="id"/>
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>知识分享</h2></div>
+
+                <div class="layui-item layui-col-sm6 lw6">
+                    <label class="layui-form-label"><span class="require-item">*</span>栏目名称:</label>
+                    <div class="layui-input-block">
+                        <form:select path="columnId" class="form-control editable-select layui-input required">
+                            <form:option value=""/>
+                            <form:options items="${fns:getMainDictList('column_name')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                        </form:select>
+                    </div>
+                </div>
+
+                <div class="layui-item layui-col-sm6 lw6">
+                    <label class="layui-form-label"><span class="require-item">*</span>主题:</label>
+                    <div class="layui-input-block">
+                        <form:input path="subject" placeholder="请输入主题" htmlEscape="false"  class="form-control layui-input required"/>
+                    </div>
+                </div>
+
+                <div class="layui-item layui-col-sm12" style="padding-bottom: 20px;">
+                    <label class="layui-form-label">问题内容:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="contents" htmlEscape="false"  colspan="3" rows="6"  maxlength="550" class="form-control "/>
+                        <sys:ckeditor replace="contents" uploadPath="/oa/oa"/>
+                    </div>
+                </div>
+                <div class="form-group layui-row">
+                    <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>
+                        <b><span id="baifenbi_attachment" ></span></b>
+                        <div class="progress">
+                            <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+                            </div>
+                        </div>
+                    </div>
+                    <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+                    <span id="attachment_title"></span>
+                    <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                        <table id="listAttachment" class="table table-bordered table-condensed details">
+                            <thead>
+                            <tr>
+                                    <%-- <th>序号</th>--%>
+                                <th>文件预览</th>
+                                <th>上传人</th>
+                                <th>上传时间</th>
+                                <th width="200px">操作</th>
+                            </tr>
+                            </thead>
+                            <tbody id="file_attachment">
+                            <c:forEach items="${knowledgeSharingInfo.workAttachments}" var = "workClientAttachment" varStatus="status">
+                                <tr>
+
+                                        <%-- <td>${status.index + 1}</td>--%>
+                                    <c:choose>
+                                        <c:when test="${knowledgeSharingInfo.uploadMode == 2}">
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                    <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <c:choose>
+                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                    <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <c:choose>
+                                                                <c:when test="${knowledgeSharingInfo.uploadMode == 2}">
+                                                                    <c:choose>
+                                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                                            <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                                        </c:when>
+                                                                        <c:otherwise>
+                                                                            <c:choose>
+                                                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                                                    <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                                                </c:when>
+                                                                                <c:otherwise>
+                                                                                    <c:choose>
+                                                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                                        </c:when>
+                                                                                        <c:otherwise>
+                                                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                                        </c:otherwise>
+                                                                                    </c:choose>
+                                                                                </c:otherwise>
+                                                                            </c:choose>
+                                                                        </c:otherwise>
+                                                                    </c:choose>
+                                                                </c:when>
+                                                                <c:otherwise>
+                                                                    <c:choose>
+                                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                                            <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                                        </c:when>
+                                                                        <c:otherwise>
+                                                                            <c:choose>
+                                                                                <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                                                    <td><a href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                                                </c:when>
+                                                                                <c:otherwise>
+                                                                                    <c:choose>
+                                                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                                                        </c:when>
+                                                                                        <c:otherwise>
+                                                                                            <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                                        </c:otherwise>
+                                                                                    </c:choose>
+                                                                                </c:otherwise>
+                                                                            </c:choose>
+                                                                        </c:otherwise>
+                                                                    </c:choose>
+                                                                </c:otherwise>
+                                                            </c:choose>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:otherwise>
+                                            </c:choose>
+                                        </c:otherwise>
+                                    </c:choose>
+
+                                    <td>${workClientAttachment.createBy.name}</td>
+                                    <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+                                    <td class="op-td">
+                                        <div class="op-btn-box" >
+                                                <%--附件下载删除--%>
+                                            <c:choose>
+                                                <c:when test="${knowledgeSharingInfo.uploadMode == 2}">
+                                                    <c:choose>
+                                                        <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                            <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:when>
+                                                        <c:otherwise>
+                                                            <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                        </c:otherwise>
+                                                    </c:choose>
+                                                </c:when>
+                                                <c:otherwise>
+                                                    <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                </c:otherwise>
+                                            </c:choose>
+                                            <c:if test="${workClientAttachment.collectFlag != 1}">
+                                                <a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
+                                            </c:if>
+                                            <c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">
+                                                <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile_attachment','_attachment')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
+                                            </c:if>
+
+                                        </div>
+                                    </td>
+                                </tr>
+                            </c:forEach>
+                            </tbody>
+                        </table>
+                    </div>
+                </div>
+            </div>
+
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+</body>
+</html>

+ 210 - 0
src/main/webapp/webpage/modules/knowledgeSharing/knowledgeSharingList.jsp

@@ -0,0 +1,210 @@
+<%@ 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}/ckeditor/ckeditor.js"></script>
+	<script type="text/javascript">
+
+        $(document).ready(function() {
+            /*//搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow1);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow1);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });*/
+        });
+
+        function openDialog(title,url,width,height,target) {
+
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url,
+                skin: 'three-btns',
+                btn: ['提交', '关闭'],
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2: function (index) {
+                }
+            });
+        }
+
+
+		//打开对话框(查看)
+		function openDialogListView(title,url,width,height){
+
+
+			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+				width='auto';
+				height='auto';
+			}else{//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			$.ajax({
+				async: false,
+				url: url,
+				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){
+							}
+						});
+					}
+				}
+			});
+
+		}
+	</script>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<sys:message content="${message}"/>
+	<div class="layui-row">
+		<div class="full-width fl">
+			<div class="contentShadow layui-row" id="queryDiv">
+
+			<form:form id="searchForm" modelAttribute="knowledgeSharingInfo" action="${ctx}/knowledgeSharing/knowledgeSharing/list" method="post" class="form-inline">
+			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+			<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
+				<div class="commonQuery">
+					<div class="layui-item query athird">
+						<label class="layui-form-label">栏目名称:</label>
+						<div class="layui-input-block with-icon">
+							<form:select path="columnId" class="form-control simple-select">
+								<form:option value="" label=""/>
+								<form:options items="${fns:getMainDictList('column_name')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+							</form:select>
+						</div>
+					</div>
+					<div class="layui-item query athird">
+					</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;">
+					<div style="clear:both;"></div>
+				</div>
+			</form:form>
+			</div>
+		</div>
+		<div class="full-width fl">
+			<div class="contentShadow layui-form contentDetails">
+				<div class="nav-btns">
+					<div class="layui-btn-group">
+						<shiro:hasPermission name="knowledgeSharing:knowledgeSharing:add">
+							<table:addRow label="新发帖" url="${ctx}/knowledgeSharing/knowledgeSharing/form" title="新发帖" height="95%;" width="95%;"></table:addRow><!-- 增加按钮 -->
+						</shiro:hasPermission>
+						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+					</div>
+				</div>
+				<table class="oa-table layui-table" id="contentTable"></table>
+
+				<!-- 分页代码 -->
+				<table:page page="${page}"></table:page>
+				<div style="clear: both;"></div>
+			</div>
+		</div>
+	</div>
+	<div id="changewidth"></div>
+</div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+    layui.use('table', function(){
+        layui.table.render({
+            limit:${ page.pageSize }
+			,id:"checkboxTable"
+            ,elem: '#contentTable'
+            ,page: false
+            ,cols: [[
+                //{checkbox: true, fixed: true},
+				{field:'index',align:'center',  width:40,title: '序号'}
+				,{field:'columnName',align:'center', title: '栏目名称', width:250,templet:function(d){
+						var xml = "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogView('查看', '${ctx}/knowledgeSharingDetails/knowledgeSharingDetails/list?columnId=" + d.columnId + "','95%','95%')\">" +
+								"<span title=" + d.columnName + ">" + d.columnName + "</span></a>";
+						return xml;
+					}}
+				,{field:'invitationCount',align:'center', title: '帖子数', width:100}
+                ,{field:'moderator',align:'center', title: '版主', width:150}
+                ,{field:'lastPublish', align:'center',title: '最后发表', minWidth:150}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="knowledgeSharingInfo" varStatus="index">
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+                    ,"id":"${knowledgeSharingInfo.id}"
+                    ,"columnId":"${knowledgeSharingInfo.columnId}"
+					,"columnName":"${fns:getMainDictLabel(knowledgeSharingInfo.columnId, 'column_name', '')}"
+                    ,"invitationCount":"${knowledgeSharingInfo.invitationCount}"
+
+                    ,"moderator":"${knowledgeSharingInfo.moderator}"
+                    ,"lastPublish":"${knowledgeSharingInfo.lastPublish}"
+                }
+                </c:forEach>
+                </c:if>
+            ]
+            // ,even: true
+            // ,height: 315
+        });
+
+    })
+
+    resizeListTable();
+</script>
+<script>
+    resizeListWindow1();
+    $(window).resize(function(){
+        resizeListWindow1();
+    });
+</script>
+</body>
+</html>

+ 386 - 0
src/main/webapp/webpage/modules/knowledgeSharing/knowledgeSharingView.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/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+    <style>
+        .wrapForm {
+            width: 100%;
+            height: 530px;
+            margin-top: -93px;
+        }
+        .mask{
+            width: 100%;
+            height:100%;
+        }
+        .layui-input-block{
+            border-top: 1px solid #cccccc;
+            overflow: hidden;
+            border-radius: 3px;
+        }
+
+        .comment_list {
+            padding-top:40px;
+            width:700px;
+            margin:0 auto;
+        }
+        .comment_details {
+            float:left;
+        }
+        .comment_content {
+            margin-top:10px;
+            font-size:16px;
+        }
+        .comment_add_or_last {
+
+            margin:0 auto;
+            clear: both;
+            width:600px;
+            height:40px;
+            background: #F0F0F0;
+            text-align: center;
+            line-height: 40px;   //行高(与div保持同高,垂直居中写法)
+        }
+        .imgdiv{
+            float:left;
+
+        }
+        .imgcss {
+            width:50px;
+            height:50px;
+            border-radius: 50%;
+        }
+        .comment_name {
+            margin-left:10px;
+            color:#3D9EEA;
+            font-size:15px;
+            font-weight: bolder;
+        }
+        .layui-icon {
+            font-size: 10px;
+            color: grey;
+        }
+        .del {
+            margin-left: 55px;
+        }
+    </style>
+
+
+    <script>
+        function deleteComment(id) {
+            $.ajax({
+                type:"post",
+                url:'${ctx}/knowledgeSharingDetails/knowledgeSharingDetails/deleteComment',
+                data:{"id":id},
+                dataType:"json",
+                success:function(data){
+                    if(data.success) {
+                        //$("#"+divId).remove();
+                        top.layer.msg("删除成功!", {icon: 1});
+                        location.reload();
+                    }else {
+                        top.layer.msg("删除失败!", {icon: 0});
+                    }
+                }
+            })
+        }
+
+        function submitComment() {
+            var knowledgeSharingId = $("#id").val();
+            var content = $("#commentContent").val();
+            if(undefined != content && null != content && '' != content){
+                $.ajax({
+                    type:"post",
+                    url:'${ctx}/knowledgeSharingDetails/knowledgeSharingDetails/saveComment',
+                    data:{"knowledgeSharingId":knowledgeSharingId,"content":content},
+                    dataType:"json",
+                    success:function(data){
+                        if(data.success) {
+                            top.layer.msg("发表成功!", {icon: 1});
+                            location.reload();
+                        }else {
+                            top.layer.msg("发表失败!", {icon: 0});
+                        }
+                    }
+                })
+            }
+
+        }
+        function resetComment() {
+            $("#commentContent").val("");
+        }
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container view-form">
+        <form:form id="inputForm" modelAttribute="knowledgeSharingInfo" class="form-horizontal layui-form">
+        <form:hidden path="id"/>
+        <div class="form-group layui-row first">
+            <div class="form-group-label"><h2>知识分享信息</h2></div>
+            <div class="layui-item layui-col-sm6">
+                <label class="layui-form-label">栏目名称:</label>
+                <div class="layui-input-block">
+                    <input htmlEscape="false" readonly="true" class="form-control layui-input"
+                           value="${knowledgeSharingInfo.columnName}"/>
+                </div>
+            </div>
+            <div class="layui-item layui-col-sm6">
+                <label class="layui-form-label">主题:</label>
+                <div class="layui-input-block">
+                    <input htmlEscape="false" readonly="true" class="form-control layui-input"
+                           value="${knowledgeSharingInfo.subject}"/>
+                </div>
+            </div>
+
+            <div class="layui-item layui-col-sm12" style="padding-bottom: 20px;">
+                <label class="layui-form-label">内容:</label>
+                <div class="layui-input-block">
+                    <div class="wrapForm">
+                        <div class="mask">
+                            <form:textarea path="contents" disabled="true" htmlEscape="false" colspan="3" rows="6" maxlength="550"
+                                           class="form-control "/>
+                            <sys:ckeditorView replace="contents" uploadPath="/oa/oa"/>
+                        </div>
+                    </div>
+                </div>
+            </div>
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>公告附件</h2></div>
+                <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                    <table id="upTable" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                                <%-- <th>序号</th>--%>
+                            <th>文件预览</th>
+                            <th>上传人</th>
+                            <th>上传时间</th>
+                            <th width="150px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="file_attachment">
+
+                        <c:forEach items="${knowledgeSharingInfo.workAttachments}" var="workClientAttachment" varStatus="status">
+                            <tr>
+                                    <%-- <td>${status.index + 1}</td>--%>
+                                <c:choose>
+                                    <c:when test="${knowledgeSharingInfo.uploadMode == 2}">
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                            </c:when>
+                                            <c:otherwise>
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <c:choose>
+                                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <c:choose>
+                                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'avi')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'wmv')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'mpg')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'mpeg')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'mov')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'rm')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'ram')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'swf')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'flv')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'mp4')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'rmvb')}">
+                                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openDialogView('预览','${ctx}/sys/picturepreview/videoPreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" >${workClientAttachment.attachmentName}</a></td>
+                                                                    </c:when>
+                                                                    <c:otherwise>
+                                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                    </c:otherwise>
+                                                                </c:choose>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:when>
+                                    <c:otherwise>
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                <td><img src="${workClientAttachment.url}" width="50" height="50"
+                                                         onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')"
+                                                         alt="${workClientAttachment.attachmentName}"></td>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                        <td><a class="attention-info" href="javascript:void(0)"
+                                                               onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a>
+                                                        </td>
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <c:choose>
+                                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
+                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
+                                                                <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <c:choose>
+                                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'avi')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'wmv')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'mpg')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'mpeg')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'mov')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'rm')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'ram')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'swf')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'flv')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'mp4')
+                                                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'rmvb')}">
+                                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openDialogView('预览','${ctx}/sys/picturepreview/videoPreview?url=${workClientAttachment.url}','90%','90%')" >${workClientAttachment.attachmentName}</a></td>
+                                                                    </c:when>
+                                                                    <c:otherwise>
+                                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
+                                                                    </c:otherwise>
+                                                                </c:choose>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:otherwise>
+                                </c:choose>
+
+
+                                <td>${workClientAttachment.createBy.name}</td>
+                                <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+                                <td class="op-td">
+                                    <div class="op-btn-box">
+                                            <%--附件下载删除--%>
+                                        <c:choose>
+                                            <c:when test="${knowledgeSharingInfo.uploadMode == 2}">
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                        <a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                            </c:otherwise>
+                                        </c:choose>
+                                        <c:if test="${workClientAttachment.collectFlag != 1}">
+                                            <a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
+                                        </c:if>
+                                    </div>
+                                </td>
+                            </tr>
+                        </c:forEach>
+
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>访问日志</h2></div>
+                <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                    <table id="viewTable" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                            <th width="60px">序号</th>
+                            <th>访问人</th>
+                            <th>首次访问时间</th>
+                            <th>最近访问时间</th>
+                            <th>访问次数</th>
+                        </tr>
+                        </thead>
+                        <tbody id="oa_notify_view">
+
+                        <c:forEach items="${knowledgeSharingViewList}" var="knowledgeSharingView" varStatus="status">
+                            <tr>
+                                <td>${status.index + 1}</td>
+                                <td>${knowledgeSharingView.userName}</td>
+                                <td>
+                                    <fmt:formatDate value="${knowledgeSharingView.firstVisitTime}" type="both"/>
+                                </td>
+                                <td>
+                                    <fmt:formatDate value="${knowledgeSharingView.lastVisitTime}" type="both"/>
+                                </td>
+                                <td>${knowledgeSharingView.visitCount}</td>
+                            </tr>
+                        </c:forEach>
+
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>发表评论</h2></div>
+                <div class="layui-item layui-col-xs12 with-textarea">
+                    <div class="layui-input-block" style="margin-left:0px;position: relative">
+                        <form:textarea placeholder="请输入评论信息:" path="commentContent" class="form-control required" rows="4" maxlength="255" />
+                    </div>
+                    <div style="float: right;margin-right: 10%">
+                        <br/>
+                        <a href="javascript:void(0)" id="submitComment" class="layui-btn" onclick="submitComment()">发表</a>
+                        <a href="javascript:void(0)" id="resetComment" class="layui-btn layui-btn-primary" onclick="resetComment()">清空</a>
+                    </div>
+                </div>
+            </div>
+
+            <div class="form-group layui-row">
+                <h2 >全部评论(${knowledgeSharingCommentCount}条)</h2>
+                <hr>
+                <c:forEach items="${knowledgeSharingCommentList}" var="knowledgeSharingComment" varStatus="status">
+                    <div class="layui-item layui-col-xs12" id="comment${knowledgeSharingComment.id}">
+                        <div class="conmment_details">
+                            <span class="comment_name">${knowledgeSharingComment.user.name}</span>     
+                            <div class="comment_content" style="margin-left: 25px;">${knowledgeSharingComment.content}</div>
+                            <div class="del">
+                                <br/>
+                                <span>${knowledgeSharingComment.commentDateStr}前</span>
+                                <c:if test="${knowledgeSharingComment.flag == 1}">
+                                    <a href="javascript:void(0)" onclick="deleteComment('${knowledgeSharingComment.id}')" style="float: right;margin-right: 100px" class="del_comment" data-id="1"> <i class="icon layui-icon" >删除</i></a>
+                                </c:if>
+                            </div>
+                        </div>
+                        <hr>
+                    </div>
+                </c:forEach>
+            </div>
+                <%--<div class="comment_add_or_last" >
+                    没有更多评论了
+                </div>--%>
+
+            <div class="form-group layui-row page-end"></div>
+            </form:form>
+        </div>
+    </div>
+</div>
+</body>
+</html>

File diff suppressed because it is too large
+ 1088 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/record/cost/projectRecordAdminDescriptionForm.jsp


+ 2 - 2
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/all/ruralProjectMessageAllList.jsp

@@ -1063,7 +1063,7 @@
                                     if(d.emergencyProject == 1){
                                         if(d.projectReportRecordStatus != 1 && d.projectReportRecordStatus != 2  && d.projectReportRecordStatus != 5 ){
                                             if (d.defectRecordStatus==0) {
-                                                xml+="<a href=\"#\" onclick=\"openDialogre('新增缺失说明信息', '${ctx}/projectReportDefectRecord/projectReportDefectRecord/formAdminDescription?reportId=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 资料缺失说明</a>";
+                                                xml+="<a href=\"#\" onclick=\"openDialogre('新增缺失说明信息', '${ctx}/projectReportDefectRecord/projectReportDefectRecord/formAdminDescription?reportId=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" > 资料缺失说明</a>";
                                             }
                                         }
                                     }
@@ -1072,7 +1072,7 @@
                                 if(d.projectReportStatusTwo == 5){
                                     if(d.projectReportRecordStatus != 1 && d.projectReportRecordStatus != 2  && d.projectReportRecordStatus != 5){
                                         if (d.defectRecordStatus==0) {
-                                            xml+="<a href=\"#\" onclick=\"openDialogre('新增缺失说明信息', '${ctx}/projectReportDefectRecord/projectReportDefectRecord/formAdminDescription?reportId=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 资料缺失说明</a>";
+                                            xml+="<a href=\"#\" onclick=\"openDialogre('新增缺失说明信息', '${ctx}/projectReportDefectRecord/projectReportDefectRecord/formAdminDescription?reportId=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" > 资料缺失说明</a>";
                                         }
                                     }
                                 }