Selaa lähdekoodia

公告添加评论功能

user5 4 vuotta sitten
vanhempi
commit
a0e5ac4802

+ 10 - 2
src/main/java/com/jeeplus/modules/oa/dao/OaNotifyDao.java

@@ -6,6 +6,7 @@ package com.jeeplus.modules.oa.dao;
 import com.jeeplus.common.persistence.CrudDao;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
 import com.jeeplus.modules.oa.entity.OaNotify;
+import com.jeeplus.modules.oa.entity.OaNotifyComment;
 import com.jeeplus.modules.oa.entity.OaNotifyView;
 import org.apache.ibatis.annotations.Param;
 
@@ -18,7 +19,7 @@ import java.util.List;
  */
 @MyBatisDao
 public interface OaNotifyDao extends CrudDao<OaNotify> {
-	
+
 	/**
 	 * 获取通知数目
 	 * @param oaNotify
@@ -53,6 +54,13 @@ public interface OaNotifyDao extends CrudDao<OaNotify> {
     List<OaNotifyView> getOaNotifyViewList(String oaNotifyId);
 
     /**
+     * 根据公告id查询查看公告记录信息
+     * @param oaNotifyId
+     * @return
+     */
+    List<OaNotifyComment> getOaNotifyCommentList(String oaNotifyId);
+
+    /**
      * 根据公告id和用户id查询查看公告信息数据
      * @param oaNotifyId
      * @param userId
@@ -71,4 +79,4 @@ public interface OaNotifyDao extends CrudDao<OaNotify> {
      * @param oaNotifyView
      */
     void updateOaNotifyView(OaNotifyView oaNotifyView);
-}
+}

+ 17 - 2
src/main/java/com/jeeplus/modules/oa/dao/OaNotifyRecordDao.java

@@ -7,6 +7,7 @@ import java.util.List;
 
 import com.jeeplus.common.persistence.CrudDao;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.oa.entity.OaNotifyComment;
 import com.jeeplus.modules.oa.entity.OaNotifyRecord;
 
 /**
@@ -46,9 +47,23 @@ public interface OaNotifyRecordDao extends CrudDao<OaNotifyRecord> {
 
 
 	 public List<OaNotifyRecord> findUserList(OaNotifyRecord oaNotifyRecord);
-	
+
+
+	/**
+	 * 根据评论id 删除评论
+	 * @param id 评论ID
+	 * @return
+	 */
+	int deleteComment(String id);
+	/**
+	 * 根据公告id 新增评论
+	 * @param oaNotifyComment
+	 * @return
+	 */
+	int saveComment(OaNotifyComment oaNotifyComment);
+
 }
 
-   
+
 
 

+ 20 - 11
src/main/java/com/jeeplus/modules/oa/entity/OaNotify.java

@@ -23,7 +23,7 @@ import java.util.List;
  * @version 2014-05-16
  */
 public class OaNotify extends ActEntity<OaNotify> {
-	
+
 	private static final long serialVersionUID = 1L;
 	private String type;		// 类型
 	private String title;		// 标题
@@ -42,7 +42,7 @@ public class OaNotify extends ActEntity<OaNotify> {
 
 	private String readNum;		// 已读
 	private String unReadNum;	// 未读
-	
+
 	private boolean isSelf;		// 是否只查询自己的通知
 
     private String readFlag;	// 本人阅读状态
@@ -55,6 +55,7 @@ public class OaNotify extends ActEntity<OaNotify> {
 	private Date nowDate;
 
 	private String home;
+	private String commentContent;
 
 	private String processInstanceId;
 	private Integer closeStatus;  //关闭状态
@@ -107,7 +108,7 @@ public class OaNotify extends ActEntity<OaNotify> {
 	public void setTitle(String title) {
 		this.title = title;
 	}
-	
+
 	public String getType() {
 		return type;
 	}
@@ -115,7 +116,7 @@ public class OaNotify extends ActEntity<OaNotify> {
 	public void setType(String type) {
 		this.type = type;
 	}
-	
+
 	@Length(min=0, max=1, message="状态长度必须介于 0 和 1 之间")
 	public String getStatus() {
 		return status;
@@ -124,7 +125,7 @@ public class OaNotify extends ActEntity<OaNotify> {
 	public void setStatus(String status) {
 		this.status = status;
 	}
-	
+
 	@Length(min=0, max=2000, message="附件长度必须介于 0 和 2000 之间")
 	public String getFiles() {
 		return files;
@@ -157,7 +158,7 @@ public class OaNotify extends ActEntity<OaNotify> {
 	public void setUnReadNum(String unReadNum) {
 		this.unReadNum = unReadNum;
 	}
-	
+
 	public List<OaNotifyRecord> getOaNotifyRecordList() {
 		return oaNotifyRecordList;
 	}
@@ -165,7 +166,7 @@ public class OaNotify extends ActEntity<OaNotify> {
 	public void setOaNotifyRecordList(List<OaNotifyRecord> oaNotifyRecordList) {
 		this.oaNotifyRecordList = oaNotifyRecordList;
 	}
-	
+
 	/**
 	 * 获取通知发送记录用户ID
 	 * @return
@@ -173,7 +174,7 @@ public class OaNotify extends ActEntity<OaNotify> {
 	public String getOaNotifyRecordIds() {
 		return Collections3.extractToString(oaNotifyRecordList, "user.id", ",") ;
 	}
-	
+
 	/**
 	 * 设置通知发送记录用户ID
 	 * @return
@@ -211,7 +212,7 @@ public class OaNotify extends ActEntity<OaNotify> {
 	public String getOaNotifyRecordNames() {
 		return Collections3.extractToString(oaNotifyRecordList, "user.name", ",") ;
 	}
-	
+
 	/**
 	 * 设置通知发送记录用户Name
 	 * @return
@@ -412,11 +413,19 @@ public class OaNotify extends ActEntity<OaNotify> {
 	public void setExt(Integer ext) {
 		this.ext = ext;
 	}
+
+	public String getCommentContent() {
+		return commentContent;
+	}
+
+	public void setCommentContent(String commentContent) {
+		this.commentContent = commentContent;
+	}
 	/*	@Override
 	public String toString() {
 		return "OaNotify [type=" + type + ", title=" + title + ", content=" + content + ", files=" + files + ", status="
 				+ status + ", company=" + company + ", readNum=" + readNum + ", unReadNum=" + unReadNum + ", isSelf="
 				+ isSelf + ", readFlag=" + readFlag + ", oaNotifyRecordList=" + oaNotifyRecordList + "]";
 	}*/
-	
-}
+
+}

+ 76 - 0
src/main/java/com/jeeplus/modules/oa/entity/OaNotifyComment.java

@@ -0,0 +1,76 @@
+package com.jeeplus.modules.oa.entity;
+
+
+import com.jeeplus.common.persistence.DataEntity;
+import com.jeeplus.modules.sys.entity.User;
+
+/**
+ * 公告评论表
+ * @author: 徐滕
+ * @create: 2021-05-07 11:13
+ **/
+public class OaNotifyComment extends DataEntity<OaNotifyComment> {
+    private Integer count;      //评论总量
+    private String oaNotifyId;  //公告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 getOaNotifyId() {
+        return oaNotifyId;
+    }
+
+    public void setOaNotifyId(String oaNotifyId) {
+        this.oaNotifyId = oaNotifyId;
+    }
+
+    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 String getCommentDateStr() {
+        return commentDateStr;
+    }
+
+    public void setCommentDateStr(String commentDateStr) {
+        this.commentDateStr = commentDateStr;
+    }
+
+    public Long getMinuteTime() {
+        return minuteTime;
+    }
+
+    public void setMinuteTime(Long minuteTime) {
+        this.minuteTime = minuteTime;
+    }
+
+    public Integer getFlag() {
+        return flag;
+    }
+
+    public void setFlag(Integer flag) {
+        this.flag = flag;
+    }
+}

+ 32 - 5
src/main/java/com/jeeplus/modules/oa/service/OaNotifyService.java

@@ -18,6 +18,7 @@ import com.jeeplus.modules.oa.dao.OaNotifyDao;
 import com.jeeplus.modules.oa.dao.OaNotifyDetailDao;
 import com.jeeplus.modules.oa.dao.OaNotifyRecordDao;
 import com.jeeplus.modules.oa.entity.OaNotify;
+import com.jeeplus.modules.oa.entity.OaNotifyComment;
 import com.jeeplus.modules.oa.entity.OaNotifyRecord;
 import com.jeeplus.modules.oa.entity.OaNotifyView;
 import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
@@ -105,11 +106,11 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
         if(null != oaNotify){
             List<Workattachment> attachmentList = workattachmentService.getListByAttachmentIdAndFlag(id, "79");
             oaNotify.setWorkAttachments(attachmentList);
+            //添加当前文件服务器类型
+            oaNotify.setUploadMode(uploadMode);
+            //数据处理(如果为阿里云文件服务器,则对查看的路径进行处理)
+            workattachmentService.attachmentManageOnUrl(oaNotify.getWorkAttachments());
         }
-        //添加当前文件服务器类型
-        oaNotify.setUploadMode(uploadMode);
-        //数据处理(如果为阿里云文件服务器,则对查看的路径进行处理)
-        workattachmentService.attachmentManageOnUrl(oaNotify.getWorkAttachments());
         return oaNotify;
     }
 
@@ -1586,6 +1587,15 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
     }
 
     /**
+     * 根据公告id查询公告评论信息
+     * @param oaNotifyId
+     * @return
+     */
+    public List<OaNotifyComment> getOaNotifyCommentList(String oaNotifyId){
+        return dao.getOaNotifyCommentList(oaNotifyId);
+    }
+
+    /**
      *
      * @param oaNotifyView
      */
@@ -1649,4 +1659,21 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
         saveDetailList(oaNotify,1);
 
     }
-}
+
+
+    /**
+     * 根据评论id 删除评论
+     */
+    @Transactional(readOnly = false)
+    public void deleteComment(String id) {
+        oaNotifyRecordDao.deleteComment(id);
+    }
+    /**
+     * 根据公告id 新增评论
+     */
+    @Transactional(readOnly = false)
+    public void saveComment(OaNotifyComment oaNotifyComment) {
+        oaNotifyComment.preInsert();
+        oaNotifyRecordDao.saveComment(oaNotifyComment);
+    }
+}

+ 147 - 6
src/main/java/com/jeeplus/modules/oa/web/OaNotifyController.java

@@ -13,6 +13,7 @@ import com.jeeplus.common.websocket.onchat.ChatServerPool;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.oa.entity.OaNotify;
+import com.jeeplus.modules.oa.entity.OaNotifyComment;
 import com.jeeplus.modules.oa.entity.OaNotifyRecord;
 import com.jeeplus.modules.oa.entity.OaNotifyView;
 import com.jeeplus.modules.oa.service.OaNotifyService;
@@ -61,7 +62,7 @@ public class OaNotifyController extends BaseController {
 	private PushinfoService pushinfoService;
 	@Autowired
 	protected WorkProjectNotifyService workProjectNotifyService;
-	
+
 	@ModelAttribute
 	public OaNotify get(@RequestParam(required=false) String id) {
 		OaNotify entity = null;
@@ -379,7 +380,7 @@ public class OaNotifyController extends BaseController {
 		addMessage(redirectAttributes, "删除通知成功");
 		return "redirect:" + adminPath + "/oa/oaNotify/list?repage";
 	}
-	
+
 	/**
 	 * 我的通知列表
 	 */
@@ -409,7 +410,7 @@ public class OaNotifyController extends BaseController {
 		Page<OaNotify> page = oaNotifyService.find(new Page<OaNotify>(request, response), oaNotify);
 		return page;
 	}
-	
+
 	/**
 	 * 查看我的通知,重定向在当前页面打开
 	 * (在查看时打开view方法就是改变阅读状态而不显示;在查看时打开form方法就是可以看到所有已阅未阅情况)
@@ -435,6 +436,39 @@ public class OaNotifyController extends BaseController {
 			//根据公告id查询查看公告记录信息(先修改查看记录 再进行查询)
 			List<OaNotifyView> oaNotifyViewList = oaNotifyService.getOaNotifyViewList(oaNotify.getId());
 
+			//查询公告评论信息
+			List<OaNotifyComment> oaNotifyCommentList = oaNotifyService.getOaNotifyCommentList(oaNotify.getId());
+			for (OaNotifyComment info: oaNotifyCommentList) {
+				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("oaNotifyCommentList",oaNotifyCommentList);
+			model.addAttribute("oaNotifyCommentCount",oaNotifyCommentList.size());
 			model.addAttribute("toReadMyNotify",true);
 			model.addAttribute("disabled",(readAttr==null||"".equals(readAttr))?"false":"true");
 			model.addAttribute("oaNotify", oaNotify);
@@ -457,7 +491,7 @@ public class OaNotifyController extends BaseController {
 		}
 		return null;
 	}
-	
+
 	/**
 	 * 查看我的通知-发送记录
 	 */
@@ -470,7 +504,7 @@ public class OaNotifyController extends BaseController {
 		}
 		return null;
 	}
-	
+
 	/**
 	 * 获取我的通知数目
 	 */
@@ -595,4 +629,111 @@ public class OaNotifyController extends BaseController {
         }
         return "redirect:" + Global.getAdminPath() + "/oa/oaNotify/list?repage";
     }
-}
+
+
+	/**
+	 * 根据评论id 删除评论
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "deleteComment")
+	@ResponseBody
+	public Map deleteComment(String id) {
+    	Map map = new HashMap();
+		try {
+			oaNotifyService.deleteComment(id);
+			map.put("success",true);
+		} catch (Exception e) {
+			e.printStackTrace();
+			map.put("success",false);
+		}
+		return map;
+	}
+	/**
+	 * 根据公告id 新增评论
+	 * @param oaNotifyComment
+	 * @return
+	 */
+	@RequestMapping(value = "saveComment")
+	@ResponseBody
+	public Map saveComment(OaNotifyComment oaNotifyComment) {
+    	Map map = new HashMap();
+		try {
+			oaNotifyService.saveComment(oaNotifyComment);
+			map.put("success",true);
+		} catch (Exception e) {
+			e.printStackTrace();
+			map.put("success",false);
+		}
+		return map;
+	}
+
+
+
+	/**
+	 * 查看我的通知,重定向在当前页面打开
+	 * (在查看时打开view方法就是改变阅读状态而不显示;在查看时打开form方法就是可以看到所有已阅未阅情况)
+	 */
+	@RequestMapping(value = "homeView")
+	public String homeView(@RequestParam(value = "readAttr",required = false)String readAttr, OaNotify oaNotify, Model model) {
+		if (StringUtils.isNotBlank(oaNotify.getId())){
+			oaNotifyService.updateReadFlag(oaNotify);
+			UserUtils.pushMeIm("");
+			/*List<WebSocket> toUserConns = ChatServerPool.getWebSocketByUser(UserUtils.getUser().getId());
+			for (WebSocket toUserConn : toUserConns) {
+				String message = "{\"useType\":\"sys_me\"}";
+				ChatServerPool.sendMessageToUser(toUserConn, message);//同时向本人发送消息
+			}*/
+			oaNotify = oaNotifyService.getRecordList(oaNotify);
+			oaNotifyService.getUsers(oaNotify);
+			oaNotifyService.getOffices(oaNotify);
+			//查看登陆者访问该公告信息
+			OaNotifyView oaNotifyView = oaNotifyService.getOaNotifyView(oaNotify.getId(), UserUtils.getUser().getId());
+			//更新查看公告已看数据
+			oaNotifyService.saveOaNotifyView(oaNotifyView,oaNotify.getId());
+
+			//根据公告id查询查看公告记录信息(先修改查看记录 再进行查询)
+			List<OaNotifyView> oaNotifyViewList = oaNotifyService.getOaNotifyViewList(oaNotify.getId());
+			//查询公告评论信息
+			List<OaNotifyComment> oaNotifyCommentList = oaNotifyService.getOaNotifyCommentList(oaNotify.getId());
+			for (OaNotifyComment info: oaNotifyCommentList) {
+				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("oaNotifyCommentList",oaNotifyCommentList);
+			model.addAttribute("oaNotifyCommentCount",oaNotifyCommentList.size());
+			model.addAttribute("toReadMyNotify",true);
+			model.addAttribute("disabled",(readAttr==null||"".equals(readAttr))?"false":"true");
+			model.addAttribute("oaNotify", oaNotify);
+			model.addAttribute("oaNotifyViewList", oaNotifyViewList);
+			return "modules/oa/oaNotifyHomeView";
+		}
+		return "redirect:" + adminPath + "/oa/oaNotify/self?repage";
+
+	}
+}

+ 38 - 16
src/main/resources/mappings/modules/oa/OaNotifyDao.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jeeplus.modules.oa.dao.OaNotifyDao">
-    
+
 	<sql id="oaNotifyColumns">
 		a.ID AS "id",
 		a.TYPE AS "type",
@@ -29,7 +29,7 @@
 	    o.top_company AS "office.name",
 	    a.ext as "ext"
 	</sql>
-	
+
 	<sql id="oaNotifyJoins">
 		<!-- 查询已读和未读条数 -->
 		LEFT JOIN (
@@ -41,16 +41,16 @@
 		LEFT JOIN sys_user u ON u.id = a.create_by
 		LEFT JOIN sys_office o ON o.id = a.office_id
 	</sql>
-    
+
 	<select id="get" resultType="OaNotify">
-		SELECT 
+		SELECT
 			<include refid="oaNotifyColumns"/>
 			,a.flag_office as "flagOffice"
 		FROM oa_notify a
 		<include refid="oaNotifyJoins"/>
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="OaNotify">
 		SELECT
 			<include refid="oaNotifyColumns"/>
@@ -346,18 +346,18 @@
 		${sqlMap.dsf}
 		ORDER BY a.update_date DESC
 	</select>
-	
+
 	<select id="findAllList" resultType="OaNotify">
-		SELECT 
+		SELECT
 			<include refid="oaNotifyColumns"/>
 		FROM oa_notify a
 		<include refid="oaNotifyJoins"/>
-		WHERE a.del_flag = #{DEL_FLAG_NORMAL} 
+		WHERE a.del_flag = #{DEL_FLAG_NORMAL}
 		ORDER BY a.update_date DESC
 	</select>
-	
+
 	<select id="findCount" resultType="Long">
-		SELECT 
+		SELECT
 			count(1)
 		FROM oa_notify a
 		<if test="isSelf">
@@ -371,7 +371,7 @@
 			AND a.STATUS = '1'
 		</if>
 	</select>
-	
+
 	<insert id="insert">
 		INSERT INTO oa_notify(
 			ID,
@@ -423,9 +423,9 @@
 			#{ext}
 		)
 	</insert>
-	
+
 	<update id="update">
-		UPDATE oa_notify SET 	
+		UPDATE oa_notify SET
 			TYPE = #{type},
 			TITLE = #{title},
 			COMPANY_ID = #{company.id},
@@ -465,9 +465,9 @@
 		DELETE FROM oa_notify
 		WHERE id = #{id}
 	</update>
-	
+
 	<update id="deleteByLogic">
-		UPDATE oa_notify SET 
+		UPDATE oa_notify SET
 			del_flag = #{DEL_FLAG_DELETE}
 		WHERE id = #{id}
 	</update>
@@ -510,6 +510,28 @@
 		  a.affiche_id = #{oaNotifyId}
 	</select>
 
+	<select id="getOaNotifyCommentList" resultType="com.jeeplus.modules.oa.entity.OaNotifyComment">
+		select
+		  a.id,
+		  a.create_by,
+		  a.create_date,
+		  a.update_by,
+		  a.update_date,
+		  a.oa_notify_id,
+		  a.content,
+		  a.remarks,
+		  a.del_flag,
+		  su.name as "user.name",
+		  a.user_id as "user.id",
+		  timestampdiff(MINUTE,a.update_date,now()) as minuteTime
+		from
+		  oa_notify_comment a
+	  left join sys_user su on a.user_id = su.id
+	  where
+		  a.oa_notify_id = #{oaNotifyId}
+	  order by a.update_date desc
+	</select>
+
 	<select id="getOaNotifyView" resultType="com.jeeplus.modules.oa.entity.OaNotifyView">
 		select
 		  a.id AS "id",
@@ -573,4 +595,4 @@
 			visit_count = visit_count + 1
 		where id = #{id}
 	</update>
-</mapper>
+</mapper>

+ 51 - 20
src/main/resources/mappings/modules/oa/OaNotifyRecordDao.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jeeplus.modules.oa.dao.OaNotifyRecordDao">
-    
+
 	<sql id="oaNotifyRecordColumns">
 		a.ID AS "id",
 		a.OA_NOTIFY_ID AS "oaNotify.id",
@@ -19,27 +19,27 @@
 		a.USER_ID AS "user.id",
 		a.READ_FLAG AS "readFlag",
 		a.READ_DATE AS "readDate"
-		
+
 	</sql>
-	
-	
-	
+
+
+
 	<sql id="oaNotifyRecordJoins">
 		LEFT JOIN sys_user u ON u.id = a.user_id
 		LEFT JOIN sys_office o ON o.id = u.office_id
 		LEFT JOIN sys_office so ON so.id = a.office_id
 	</sql>
-    
+
 	<select id="get" resultType="OaNotifyRecord">
-		SELECT 
+		SELECT
 			<include refid="oaNotifyRecordColumns"/>
 		FROM oa_notify_record a
 		<include refid="oaNotifyRecordJoins"/>
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="OaNotifyRecord">
-		SELECT 
+		SELECT
 			<include refid="oaNotifyRecordColumns"/>
 		FROM oa_notify_record a
 		<include refid="oaNotifyRecordJoins"/>
@@ -90,22 +90,22 @@
 	</select>
 
 		<select id="findUserList" resultType="OaNotifyRecord">
-		SELECT 
+		SELECT
 			<include refid="oaNotifyRecordColumn"/>
 		FROM oa_notify_record a
 		WHERE a.read_flag=#{readFlag}
 			AND a.oa_notify_id = #{oaNotify.id}
 	</select>
-	
+
 	<select id="findAllList" resultType="OaNotifyRecord">
-		SELECT 
+		SELECT
 			<include refid="oaNotifyRecordColumns"/>
 		FROM oa_notify_record a
 		<include refid="oaNotifyRecordJoins"/>
 		WHERE 1=1
 		ORDER BY a.read_flag ASC
 	</select>
-	
+
 	<insert id="insert">
 		INSERT INTO oa_notify_record(
 			ID,
@@ -121,7 +121,7 @@
 			#{readDate}
 		)
 	</insert>
-	
+
 	<insert id="insertAll" parameterType="List">
 		INSERT INTO oa_notify_record(
 			ID,
@@ -156,22 +156,53 @@
 	</insert>
 
 	<update id="update">
-		UPDATE oa_notify_record SET 	
+		UPDATE oa_notify_record SET
 			READ_FLAG = #{readFlag},
 			READ_DATE = #{readDate}
 		WHERE OA_NOTIFY_ID = #{oaNotify.id}
 			AND USER_ID = #{user.id}
 			AND READ_FLAG != '1'
 	</update>
-	
+
 	<delete id="delete">
-		DELETE FROM oa_notify_record  
+		DELETE FROM oa_notify_record
 		WHERE id = #{id}
 	</delete>
-	
+
 	<update id="deleteByOaNotifyId">
 		UPDATE oa_notify_record SET READ_FLAG = ''
 		WHERE oa_notify_id = #{oaNotifyId}
 	</update>
-	
-</mapper>
+
+	<delete id="deleteComment">
+		delete from oa_notify_comment
+		where id = #{id}
+	</delete>
+
+	<insert id="saveComment">
+		INSERT INTO oa_notify_comment (
+		  id,
+		  create_by,
+		  create_date,
+		  update_by,
+		  update_date,
+		  remarks,
+		  del_flag,
+		  oa_notify_id,
+		  content,
+		  user_id
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{oaNotifyId},
+			#{content},
+			#{createBy.id}
+		)
+	</insert>
+
+</mapper>

+ 524 - 0
src/main/webapp/webpage/modules/oa/oaNotifyHomeView.jsp

@@ -0,0 +1,524 @@
+<%@ 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}/oa/oaNotify/deleteComment',
+                data:{"id":id},
+                dataType:"json",
+                success:function(data){
+                    if(data.success) {
+                        top.layer.msg("删除成功!", {icon: 1});
+                        location.reload();
+                    }else {
+                        top.layer.msg("删除失败!", {icon: 0});
+                    }
+                }
+            })
+        }
+        function submitComment() {
+            var oaNotifyId = $("#id").val();
+            var content = $("#commentContent").val();
+            if(undefined != content && null != content && '' != content){
+                $.ajax({
+                    type:"post",
+                    url:'${ctx}/oa/oaNotify/saveComment',
+                    data:{"oaNotifyId":oaNotifyId,"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="oaNotify" class="form-horizontal layui-form">
+        <form:hidden path="id"/>
+        <sys:message content="${message}"/>
+
+        <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" style="background-color: #f1f1f1" readonly="true" maxlength="30" class="form-control required layui-input"
+                           value="${oaNotify.title}"/>
+                </div>
+            </div>
+            <div class="layui-item layui-col-sm6">
+                <label class="layui-form-label">文号:</label>
+                <div class="layui-input-block">
+                    <input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" maxlength="30" class="form-control required layui-input"
+                           value="${oaNotify.referenceNumber}"/>
+                </div>
+            </div>
+            <div class="layui-item layui-col-sm6">
+                <label class="layui-form-label">公告类型:</label>
+                <div class="layui-input-block">
+                    <input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" maxlength="30" class="form-control required layui-input"
+                           value="${fns:getMainDictLabel(oaNotify.type, 'oa_notify_type', '')}"/>
+                </div>
+            </div>
+            <div class="layui-item layui-col-sm6">
+                <label class="layui-form-label">创建日期:</label>
+                <div class="layui-input-block">
+                    <input id="createDate" name="createDate" htmlEscape="false" style="background-color: #f1f1f1" readonly="true"
+                           class="laydate-icondate form-control layer-date layui-input laydate-icon"
+                           value="<fmt:formatDate value="${oaNotify.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                </div>
+            </div>
+            <div class="layui-item layui-col-sm6">
+                <label class="layui-form-label">开始日期:</label>
+                <div class="layui-input-block">
+                    <input id="startDate" name="startDate" htmlEscape="false" readonly="true" style="background-color: #f1f1f1"
+                           class="laydate-icondate form-control layer-date layui-input laydate-icon required"
+                           value="<fmt:formatDate value="${oaNotify.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                </div>
+            </div>
+            <div class="layui-item layui-col-sm6">
+                <label class="layui-form-label">结束日期:</label>
+                <div class="layui-input-block">
+                    <input id="endDate" name="endDate" htmlEscape="false" readonly="true" style="background-color: #f1f1f1"
+                           class="laydate-icondate form-control layer-date layui-input laydate-icon required"
+                           value="<fmt:formatDate value="${oaNotify.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                </div>
+            </div>
+            <div class="layui-item layui-col-sm6">
+                <label class="layui-form-label">创建人:</label>
+                <div class="layui-input-block">
+                    <form:input id="cBName" path="createBy.name" htmlEscape="false" readonly="true" style="background-color: #f1f1f1"
+                                class="form-control  layui-input"/>
+                </div>
+            </div>
+            <div class="layui-item layui-col-sm6">
+                <label class="layui-form-label">所属部门:</label>
+                <div class="layui-input-block">
+                    <form:input id="office" path="office.name" htmlEscape="false" readonly="true" style="background-color: #f1f1f1"
+                                class="form-control  layui-input"/>
+                </div>
+            </div>
+            <div class="layui-item layui-col-sm12" style="padding-bottom: 20px;">
+                <label class="layui-form-label"><span class="require-item">*</span>内容:</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 "/>
+                            <form:hidden id="content" path="content" htmlEscape="false" maxlength="64"
+                                         class="form-control required"/>
+                            <sys:ckeditorView replace="contents" uploadPath="/oa/oa"/>
+                        </div>
+                    </div>
+                </div>
+            </div>
+
+            <c:if test="${oaNotify.createBy.id eq fns:getUser().id}">
+                <div class="form-group layui-row">
+                    <div class="form-group-label"><h2>公告范围-部门</h2></div>
+                    <table id="officeTable" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                            <th>部门</th>
+                        </tr>
+                        </thead>
+                        <tbody id="officeTableList">
+                        </tbody>
+                    </table>
+                    <script type="text/template" id="officeTpl">//<!--
+                    <tr id="officeList{{idx}}">
+                        <td>
+                            {{row.name}}
+                        </td>
+                    </tr>//-->
+                    </script>
+                </div>
+                <div class="form-group layui-row">
+                    <div class="form-group-label"><h2>公告范围-成员</h2></div>
+                    <table id="userTable" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                            <th>姓名</th>
+                            <th>部门</th>
+                        </tr>
+                        </thead>
+                        <tbody id="userTableList">
+                        </tbody>
+                    </table>
+                    <script type="text/template" id="userTpl">//<!--
+                    <tr id="userList{{idx}}">
+                        <td>
+                        {{row.name}}
+                        </td>
+                        <td>
+                        {{row.officeName}}
+                        </td>
+                    </tr>//-->
+                    </script>
+                    <script type="text/javascript">
+                        var userIdx = 0, userTpl = $("#userTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
+                        var officeIdx = 0, officeTpl = $("#officeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
+
+                        $(document).ready(function () {
+                            var data = ${fns:toJson(oaNotify.officeList)};
+                            if (data != null) {
+                                for (var i = 0; i < data.length; i++) {
+                                    addRow('#officeTableList', officeIdx, officeTpl, data[i]);
+                                    officeIdx = officeIdx + 1;
+                                }
+                            }
+                            var dataBank = ${fns:toJson(oaNotify.userList)};
+                            if (dataBank != null) {
+                                for (var i = 0; i < dataBank.length; i++) {
+                                    addRow('#userTableList', userIdx, userTpl, dataBank[i]);
+                                    userIdx = userIdx + 1;
+                                }
+                            }
+                        });
+
+                        function addRow(list, idx, tpl, row) {
+                            var idx1 = 0;
+                            if ('#userTableList' == list) {
+                                idx1 = $("#userTableList tr").length
+                            } else if ('#officeTableList' == list) {
+                                idx1 = $("#officeTableList tr").length
+                            }
+                            bornTemplete(list, idx, tpl, row, idx1);
+                        }
+
+                        function bornTemplete(list, idx, tpl, row, idx1) {
+                            $(list).append(Mustache.render(tpl, {
+                                idx: idx, delBtn: true, row: row,
+                                order: idx1 + 1, idx1: idx1
+                            }));
+                            $(list + idx).find("select").each(function () {
+                                $(this).val($(this).attr("data-value"));
+                            });
+                            $(list + idx).find("input[type='checkbox'], input[type='radio']").each(function () {
+                                var ss = $(this).attr("data-value").split(',');
+                                for (var i = 0; i < ss.length; i++) {
+                                    if ($(this).val() == ss[i]) {
+                                        $(this).attr("checked", "checked");
+                                    }
+                                }
+                            });
+                        }
+
+                        function delRow(obj, prefix, idx) {
+                            $(obj).parent().parent().remove();
+                        }
+                    </script>
+                </div>
+            </c:if>
+
+            <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="100px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="file_attachment">
+
+                        <c:forEach items="${oaNotify.workAttachments}" var="workClientAttachment" varStatus="status">
+                            <tr>
+                                    <%-- <td>${status.index + 1}</td>--%>
+                                        <c:choose>
+                                            <c:when test="${oaNotify.uploadMode == 2}">
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                        <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        <c:choose>
+                                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.temporaryUrl}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.temporaryUrl}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                                        <td><img src="${workClientAttachment.url}" width="50" height="50"
+                                                                 onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')"
+                                                                 alt="${workClientAttachment.attachmentName}"></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="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a>
+                                                                </td>
+                                                            </c:when>
+                                                            <c:otherwise>
+                                                                <td><a class="attention-info" href="javascript:void(0)"
+                                                                       onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a>
+                                                                </td>
+                                                            </c:otherwise>
+                                                        </c:choose>
+                                                    </c:otherwise>
+                                                </c:choose>
+                                            </c:otherwise>
+                                        </c:choose>
+
+
+                                <td>${workClientAttachment.createBy.name}</td>
+                                <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+                                <td class="op-td">
+                                    <div class="op-btn-box">
+                                        <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>
+                                    </div>
+                                </td>
+                            </tr>
+                        </c:forEach>
+
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+            <!--在“我的公告”中只能查看到个人接收的,只改变未读状态为已读,不显示所有的查看状态;
+            在“公告管理”中只有管理员权限才能查看,显示该条公告的所有查看状态;
+            -->
+                <%-- <c:choose>
+                     <c:when test="${toReadMyNotify}">
+                     </c:when>
+                     <c:otherwise>
+                         <!-- 发布状态 -->
+                         <c:if test="${oaNotify.status eq '1'}">
+                         <div class="form-group layui-row">
+                             <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 required layui-input" value="${oaNotify.readNum}"/>
+                                 </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 required layui-input" value="${oaNotify.unReadNum}"/>
+                                 </div>
+                             </div>
+                             <div class="layui-item layui-col-sm12">
+                                 <label class="layui-form-label">总共:</label>
+                                 <div class="layui-input-block">
+                                     <input htmlEscape="false" readonly="true" class="form-control required layui-input" value="${oaNotify.readNum + oaNotify.unReadNum}"/>
+                                 </div>
+                             </div>
+                             <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                                 <table id="contentTable" class="table table-bordered table-condensed details">
+                                     <thead>
+                                     <tr>
+                                         <th>接受人</th>
+                                         <th>接受部门</th>
+                                         <th>阅读状态</th>
+                                         <th>阅读时间</th>
+                                     </tr>
+                                     </thead>
+                                     <tbody>
+                                     <c:forEach items="${oaNotify.oaNotifyRecordList}" var="oaNotifyRecord">
+                                         <tr>
+                                             <td>
+                                                     ${oaNotifyRecord.user.name}
+                                             </td>
+                                             <td>
+                                                     ${oaNotifyRecord.user.office.name}
+                                             </td>
+                                             <td>
+                                                     ${fns:getDictLabel(oaNotifyRecord.readFlag, 'oa_notify_read', '')}
+                                             </td>
+                                             <td>
+                                                 <fmt:formatDate value="${oaNotifyRecord.readDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
+                                             </td>
+                                         </tr>
+                                     </c:forEach>
+                                     </tbody>
+                                 </table>
+                             </div>
+                         </div>
+                         </c:if>
+                     </c:otherwise>
+                 </c:choose>--%>
+
+
+            <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="${oaNotifyViewList}" var="oaNotifyView" varStatus="status">
+                            <tr>
+                                <td>${status.index + 1}</td>
+                                <td>${oaNotifyView.userId}</td>
+                                <td>
+                                    <fmt:formatDate value="${oaNotifyView.firstVisitTime}" type="both"/>
+                                </td>
+                                <td>
+                                    <fmt:formatDate value="${oaNotifyView.lastVisitTime}" type="both"/>
+                                </td>
+                                <td>${oaNotifyView.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 >全部评论(${oaNotifyCommentCount}条)</h2>
+                <hr>
+                <c:forEach items="${oaNotifyCommentList}" var="oaNotifyComment" varStatus="status">
+                    <div class="layui-item layui-col-xs12" id="comment${oaNotifyComment.id}">
+                        <div class="conmment_details">
+                            <span class="comment_name">${oaNotifyComment.user.name}</span>     
+                            <div class="comment_content" style="margin-left: 25px;">${oaNotifyComment.content}</div>
+                            <div class="del">
+                                <br/>
+                                <span>${oaNotifyComment.commentDateStr}前</span>
+                                <c:if test="${oaNotifyComment.flag == 1}">
+                                    <a href="javascript:void(0)" onclick="deleteComment('${oaNotifyComment.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>

+ 2 - 2
src/main/webapp/webpage/modules/oa/oaNotifyListMyself.jsp

@@ -196,7 +196,7 @@
                 // {checkbox: true, fixed: true},
                 {field:'index',align:'center',  width:40,title: '序号'}
                 ,{field:'number',align:'center', title: '公告编号', minWidth:150,templet:function(d){
-                    var xml = "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openView('查看公告', '${ctx}/oa/oaNotify/view?id=" + d.id + "&view=view','95%','95%')\">" +
+                    var xml = "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openView('查看公告', '${ctx}/oa/oaNotify/homeView?id=" + d.id + "&view=view','95%','95%')\">" +
                         "<span title=" + d.number + ">" + d.number + "</span></a>";
                     return xml;
                 }}
@@ -254,4 +254,4 @@
     });
 </script>
 </body>
-</html>
+</html>

+ 140 - 48
src/main/webapp/webpage/modules/oa/oaNotifyView.jsp

@@ -6,24 +6,90 @@
     <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}/oa/oaNotify/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});
+                    }
+                }
+            })
+        }
+    </script>
 </head>
 <body>
-<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;
-    }
-</style>
 <div class="single-form">
     <div class="container view-form">
         <form:form id="inputForm" modelAttribute="oaNotify" class="form-horizontal layui-form">
@@ -222,56 +288,56 @@
                         <c:forEach items="${oaNotify.workAttachments}" var="workClientAttachment" varStatus="status">
                             <tr>
                                     <%-- <td>${status.index + 1}</td>--%>
+                                <c:choose>
+                                    <c:when test="${oaNotify.uploadMode == 2}">
                                         <c:choose>
-                                            <c:when test="${oaNotify.uploadMode == 2}">
-                                                <c:choose>
-                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                            <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}">
+                                                <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                            </c:when>
+                                            <c:otherwise>
+                                                <c:choose>
+                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.temporaryUrl}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
                                                     </c:when>
                                                     <c:otherwise>
-                                                        <c:choose>
-                                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.temporaryUrl}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
-                                                            </c:when>
-                                                            <c:otherwise>
-                                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.temporaryUrl}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
-                                                            </c:otherwise>
-                                                        </c:choose>
+                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.temporaryUrl}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
                                                     </c:otherwise>
                                                 </c:choose>
-                                            </c:when>
-                                            <c:otherwise>
-                                                <c:choose>
-                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                            </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>
+                                                <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="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a>
+                                                        </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="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a>
-                                                                </td>
-                                                            </c:when>
-                                                            <c:otherwise>
-                                                                <td><a class="attention-info" href="javascript:void(0)"
-                                                                       onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a>
-                                                                </td>
-                                                            </c:otherwise>
-                                                        </c:choose>
+                                                        <td><a class="attention-info" href="javascript:void(0)"
+                                                               onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a>
+                                                        </td>
                                                     </c:otherwise>
                                                 </c:choose>
                                             </c:otherwise>
                                         </c:choose>
+                                    </c:otherwise>
+                                </c:choose>
 
 
                                 <td>${workClientAttachment.createBy.name}</td>
@@ -387,10 +453,36 @@
                     </table>
                 </div>
             </div>
+            <c:if test="${oaNotify.status == 5}">
+                <div class="form-group layui-row">
+                    <h2 >全部评论(${oaNotifyCommentCount}条)</h2>
+                    <hr>
+                    <c:forEach items="${oaNotifyCommentList}" var="oaNotifyComment" varStatus="status">
+                        <div class="layui-item layui-col-xs12" id="comment${oaNotifyComment.id}">
+                            <div class="conmment_details">
+                                <span class="comment_name">${oaNotifyComment.user.name}</span>     
+                                <div class="comment_content" style="margin-left: 25px;">${oaNotifyComment.content}</div>
+                                <div class="del">
+                                    <br/>
+                                    <span>${oaNotifyComment.commentDateStr}前</span>
+                                    <c:if test="${oaNotifyComment.flag == 1}">
+                                        <a href="javascript:void(0)" onclick="deleteComment('${oaNotifyComment.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>
+            </c:if>
+                <%--<div class="comment_add_or_last" >
+                    没有更多评论了
+                </div>--%>
 
             <div class="form-group layui-row page-end"></div>
             </form:form>
         </div>
     </div>
+</div>
 </body>
-</html>
+</html>

+ 2 - 2
src/main/webapp/webpage/modules/sys/sysHome.jsp

@@ -1108,7 +1108,7 @@
         var xml = "";
         <c:forEach items="${page}" var="oaNotify" varStatus="index">
         <c:if test="${index.index < 8}">
-            xml ="<a href=\"javascript:void(0)\" onclick=\"homeOpenDialogView('查看公告', '${ctx}/oa/oaNotify/view?id=${oaNotify.id}&readAttr=disabled','95%','95%')\"  >";
+            xml ="<a href=\"javascript:void(0)\" onclick=\"homeOpenDialogView('查看公告', '${ctx}/oa/oaNotify/homeView?id=${oaNotify.id}&readAttr=disabled','95%','95%')\"  >";
 
             elem.append('<li>' + xml + "<span class=\"bord-record-type\" title=\"${fns:getMainDictLabel(oaNotify.type, 'oa_notify_type', '')}\">${fns:getMainDictLabel(oaNotify.type, 'oa_notify_type', '')}</span>"+
                 "<span class=\"bord-record\" title=\"${oaNotify.title}\">${oaNotify.title}</span>"+
@@ -1295,4 +1295,4 @@
 
 </script>
 </body>
-</html>
+</html>