Merge remote-tracking branch 'origin/master'
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
|||||||
|
package com.jero.common.constant.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description
|
||||||
|
* @date 2022/1/21 15:22
|
||||||
|
* @auth zhn
|
||||||
|
*/
|
||||||
|
public enum MessageTypeEnum {
|
||||||
|
READ("订阅通知","1"),
|
||||||
|
WARN("预警信息","2"),
|
||||||
|
PUSH("转发推送","3");
|
||||||
|
|
||||||
|
String name;
|
||||||
|
String value;
|
||||||
|
|
||||||
|
private MessageTypeEnum(String name, String value) {
|
||||||
|
this.name = name;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
+47
-14
@@ -1,11 +1,11 @@
|
|||||||
package com.jero.modules.system.controller;
|
package com.jero.modules.system.controller;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import java.util.Date;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.constant.CommonConstant;
|
import com.jero.common.constant.CommonConstant;
|
||||||
import com.jero.common.system.vo.LoginUser;
|
import com.jero.common.system.vo.LoginUser;
|
||||||
@@ -13,6 +13,9 @@ import com.jero.common.util.oConvertUtils;
|
|||||||
import com.jero.modules.system.entity.SysAnnouncementSend;
|
import com.jero.modules.system.entity.SysAnnouncementSend;
|
||||||
import com.jero.modules.system.model.AnnouncementSendModel;
|
import com.jero.modules.system.model.AnnouncementSendModel;
|
||||||
import com.jero.modules.system.service.ISysAnnouncementSendService;
|
import com.jero.modules.system.service.ISysAnnouncementSendService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -23,14 +26,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import java.util.ArrayList;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import java.util.Arrays;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import java.util.Date;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import java.util.List;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Title: Controller
|
* @Title: Controller
|
||||||
@@ -39,6 +39,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
* @Date: 2019-02-21
|
* @Date: 2019-02-21
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Api(tags="消息")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/sys/sysAnnouncementSend")
|
@RequestMapping("/sys/sysAnnouncementSend")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -239,4 +241,35 @@ public class SysAnnouncementSendController {
|
|||||||
result.setMessage("全部已读");
|
result.setMessage("全部已读");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @功能:标记已读
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/read")
|
||||||
|
public Result<SysAnnouncementSend> read(String ids) {
|
||||||
|
Result<SysAnnouncementSend> result = new Result<SysAnnouncementSend>();
|
||||||
|
List<SysAnnouncementSend> list = new ArrayList<>();
|
||||||
|
for (String id : ids.split(",")) {
|
||||||
|
SysAnnouncementSend sysAnnouncementSend = new SysAnnouncementSend();
|
||||||
|
sysAnnouncementSend.setId(id);
|
||||||
|
sysAnnouncementSend.setReadFlag("1");
|
||||||
|
list.add(sysAnnouncementSend);
|
||||||
|
}
|
||||||
|
sysAnnouncementSendService.updateBatchById(list);
|
||||||
|
result.setSuccess(true);
|
||||||
|
result.setMessage("标记已读");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @功能:查询所有的未读消息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/getMessageUnreadList")
|
||||||
|
public Result<?> getMessageUnreadList() {
|
||||||
|
Result<SysAnnouncementSend> result = new Result<SysAnnouncementSend>();
|
||||||
|
List<AnnouncementSendModel> messageUnreadList = sysAnnouncementSendService.getMessageUnreadList();
|
||||||
|
result.OK(messageUnreadList);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+9
@@ -38,6 +38,11 @@ public class SysAnnouncement implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@Excel(name = "内容", width = 30)
|
@Excel(name = "内容", width = 30)
|
||||||
private java.lang.String msgContent;
|
private java.lang.String msgContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细内容
|
||||||
|
*/
|
||||||
|
private java.lang.String msgContentInfo;
|
||||||
/**
|
/**
|
||||||
* 开始时间
|
* 开始时间
|
||||||
*/
|
*/
|
||||||
@@ -144,4 +149,8 @@ public class SysAnnouncement implements Serializable {
|
|||||||
* 摘要
|
* 摘要
|
||||||
*/
|
*/
|
||||||
private java.lang.String msgAbstract;
|
private java.lang.String msgAbstract;
|
||||||
|
/**
|
||||||
|
* 文档id
|
||||||
|
*/
|
||||||
|
private java.lang.String documentId;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -28,4 +28,6 @@ public interface SysAnnouncementSendMapper extends BaseMapper<SysAnnouncementSen
|
|||||||
*/
|
*/
|
||||||
public List<AnnouncementSendModel> getMyAnnouncementSendList(Page<AnnouncementSendModel> page,@Param("announcementSendModel") AnnouncementSendModel announcementSendModel);
|
public List<AnnouncementSendModel> getMyAnnouncementSendList(Page<AnnouncementSendModel> page,@Param("announcementSendModel") AnnouncementSendModel announcementSendModel);
|
||||||
|
|
||||||
|
public List<AnnouncementSendModel> getMessageUnreadList(@Param("userId") String userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -27,6 +27,12 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public SysUser getUserByName(@Param("username") String username);
|
public SysUser getUserByName(@Param("username") String username);
|
||||||
|
/**
|
||||||
|
* 通过用户账号查询用户信息(批量)
|
||||||
|
* @param usernames
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<SysUser> getUserListByNames(@Param("usernames") String usernames);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据部门Id查询用户信息
|
* 根据部门Id查询用户信息
|
||||||
|
|||||||
+2
@@ -6,6 +6,7 @@
|
|||||||
<result column="id" property="id" jdbcType="VARCHAR"/>
|
<result column="id" property="id" jdbcType="VARCHAR"/>
|
||||||
<result column="titile" property="titile" jdbcType="VARCHAR"/>
|
<result column="titile" property="titile" jdbcType="VARCHAR"/>
|
||||||
<result column="msg_content" property="msgContent" jdbcType="VARCHAR"/>
|
<result column="msg_content" property="msgContent" jdbcType="VARCHAR"/>
|
||||||
|
<result column="msg_content_info" property="msgContentInfo" jdbcType="VARCHAR"/>
|
||||||
<result column="start_time" property="startTime" jdbcType="TIMESTAMP"/>
|
<result column="start_time" property="startTime" jdbcType="TIMESTAMP"/>
|
||||||
<result column="end_time" property="endTime" jdbcType="TIMESTAMP"/>
|
<result column="end_time" property="endTime" jdbcType="TIMESTAMP"/>
|
||||||
<result column="sender" property="sender" jdbcType="VARCHAR"/>
|
<result column="sender" property="sender" jdbcType="VARCHAR"/>
|
||||||
@@ -25,6 +26,7 @@
|
|||||||
<result column="bus_id" property="busId" jdbcType="VARCHAR"/>
|
<result column="bus_id" property="busId" jdbcType="VARCHAR"/>
|
||||||
<result column="open_type" property="openType" jdbcType="VARCHAR"/>
|
<result column="open_type" property="openType" jdbcType="VARCHAR"/>
|
||||||
<result column="open_page" property="openPage" jdbcType="VARCHAR"/>
|
<result column="open_page" property="openPage" jdbcType="VARCHAR"/>
|
||||||
|
<result column="document_id" property="documentId" jdbcType="VARCHAR"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+31
-3
@@ -8,6 +8,7 @@
|
|||||||
<result column="user_id" property="userId" jdbcType="VARCHAR"/>
|
<result column="user_id" property="userId" jdbcType="VARCHAR"/>
|
||||||
<result column="titile" property="titile" jdbcType="VARCHAR"/>
|
<result column="titile" property="titile" jdbcType="VARCHAR"/>
|
||||||
<result column="msg_content" property="msgContent" jdbcType="VARCHAR"/>
|
<result column="msg_content" property="msgContent" jdbcType="VARCHAR"/>
|
||||||
|
<result column="msg_content_info" property="msgContentInfo" jdbcType="VARCHAR"/>
|
||||||
<result column="sender" property="sender" jdbcType="VARCHAR"/>
|
<result column="sender" property="sender" jdbcType="VARCHAR"/>
|
||||||
<result column="priority" property="priority" jdbcType="VARCHAR"/>
|
<result column="priority" property="priority" jdbcType="VARCHAR"/>
|
||||||
<result column="msg_category" property="msgCategory" jdbcType="VARCHAR"/>
|
<result column="msg_category" property="msgCategory" jdbcType="VARCHAR"/>
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
<result column="bus_id" property="busId" jdbcType="VARCHAR"/>
|
<result column="bus_id" property="busId" jdbcType="VARCHAR"/>
|
||||||
<result column="open_type" property="openType" jdbcType="VARCHAR"/>
|
<result column="open_type" property="openType" jdbcType="VARCHAR"/>
|
||||||
<result column="open_page" property="openPage" jdbcType="VARCHAR"/>
|
<result column="open_page" property="openPage" jdbcType="VARCHAR"/>
|
||||||
|
<result column="document_id" property="documentId" jdbcType="VARCHAR"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="queryByUserId" parameterType="String" resultType="String">
|
<select id="queryByUserId" parameterType="String" resultType="String">
|
||||||
@@ -30,6 +32,7 @@
|
|||||||
sas.read_flag,
|
sas.read_flag,
|
||||||
sa.titile as titile,
|
sa.titile as titile,
|
||||||
sa.msg_content as msg_content,
|
sa.msg_content as msg_content,
|
||||||
|
sa.msg_content_info as msg_content_info,
|
||||||
sa.sender as sender,
|
sa.sender as sender,
|
||||||
sa.priority as priority,
|
sa.priority as priority,
|
||||||
sa.msg_category,
|
sa.msg_category,
|
||||||
@@ -37,11 +40,11 @@
|
|||||||
sa.bus_id as bus_id,
|
sa.bus_id as bus_id,
|
||||||
sa.open_type as open_type,
|
sa.open_type as open_type,
|
||||||
sa.open_page as open_page,
|
sa.open_page as open_page,
|
||||||
sa.msg_abstract
|
sa.msg_abstract,
|
||||||
|
sa.document_id as document_id
|
||||||
from sys_announcement_send sas
|
from sys_announcement_send sas
|
||||||
left join sys_announcement sa ON sas.annt_id = sa.id
|
left join sys_announcement sa ON sas.annt_id = sa.id
|
||||||
where sa.send_status = '1'
|
where sa.del_flag = '0'
|
||||||
and sa.del_flag = '0'
|
|
||||||
and sas.user_id = #{announcementSendModel.userId}
|
and sas.user_id = #{announcementSendModel.userId}
|
||||||
<if test="announcementSendModel.titile !=null and announcementSendModel.titile != ''">
|
<if test="announcementSendModel.titile !=null and announcementSendModel.titile != ''">
|
||||||
and sa.titile LIKE concat(concat('%',#{announcementSendModel.titile}),'%')
|
and sa.titile LIKE concat(concat('%',#{announcementSendModel.titile}),'%')
|
||||||
@@ -63,5 +66,30 @@
|
|||||||
</if>
|
</if>
|
||||||
order by sas.read_flag,sa.send_time desc
|
order by sas.read_flag,sa.send_time desc
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getMessageUnreadList" parameterType="Object" resultMap="AnnouncementSendModel">
|
||||||
|
select
|
||||||
|
sas.id,
|
||||||
|
sas.annt_id,
|
||||||
|
sas.user_id,
|
||||||
|
sas.read_flag,
|
||||||
|
sa.titile as titile,
|
||||||
|
sa.msg_content as msg_content,
|
||||||
|
sa.msg_content_info as msg_content_info,
|
||||||
|
sa.sender as sender,
|
||||||
|
sa.priority as priority,
|
||||||
|
sa.msg_category,
|
||||||
|
sa.send_time as send_time,
|
||||||
|
sa.bus_id as bus_id,
|
||||||
|
sa.open_type as open_type,
|
||||||
|
sa.open_page as open_page,
|
||||||
|
sa.msg_abstract,
|
||||||
|
sa.document_id as document_id
|
||||||
|
from sys_announcement_send sas
|
||||||
|
left join sys_announcement sa ON sas.annt_id = sa.id
|
||||||
|
where sa.del_flag = '0'
|
||||||
|
and sas.read_flag = '0'
|
||||||
|
and sas.user_id = #{userId}
|
||||||
|
order by sas.read_flag,sa.send_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
+9
@@ -6,6 +6,15 @@
|
|||||||
<select id="getUserByName" resultType="com.jero.modules.system.entity.SysUser">
|
<select id="getUserByName" resultType="com.jero.modules.system.entity.SysUser">
|
||||||
select * from sys_user where username = #{username} and del_flag = 0
|
select * from sys_user where username = #{username} and del_flag = 0
|
||||||
</select>
|
</select>
|
||||||
|
<!-- 根据用户名查询(批量) -->
|
||||||
|
<select id="getUserListByNames" resultType="com.jero.modules.system.entity.SysUser">
|
||||||
|
select * from sys_user
|
||||||
|
where username in
|
||||||
|
<foreach collection="usernames.split(',')" index="index" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
and del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- 根据部门Id查询 -->
|
<!-- 根据部门Id查询 -->
|
||||||
<select id="getUserByDepId" resultType="com.jero.modules.system.entity.SysUser">
|
<select id="getUserByDepId" resultType="com.jero.modules.system.entity.SysUser">
|
||||||
|
|||||||
+6
@@ -32,6 +32,8 @@ public class AnnouncementSendModel implements Serializable {
|
|||||||
private java.lang.String titile;
|
private java.lang.String titile;
|
||||||
/**内容*/
|
/**内容*/
|
||||||
private java.lang.String msgContent;
|
private java.lang.String msgContent;
|
||||||
|
/**详细内容*/
|
||||||
|
private java.lang.String msgContentInfo;
|
||||||
/**发布人*/
|
/**发布人*/
|
||||||
private java.lang.String sender;
|
private java.lang.String sender;
|
||||||
/**优先级(L低,M中,H高)*/
|
/**优先级(L低,M中,H高)*/
|
||||||
@@ -76,5 +78,9 @@ public class AnnouncementSendModel implements Serializable {
|
|||||||
* 摘要
|
* 摘要
|
||||||
*/
|
*/
|
||||||
private java.lang.String msgAbstract;
|
private java.lang.String msgAbstract;
|
||||||
|
/**
|
||||||
|
* 文档id
|
||||||
|
*/
|
||||||
|
private java.lang.String documentId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -25,4 +25,6 @@ public interface ISysAnnouncementSendService extends IService<SysAnnouncementSen
|
|||||||
*/
|
*/
|
||||||
public Page<AnnouncementSendModel> getMyAnnouncementSendPage(Page<AnnouncementSendModel> page,AnnouncementSendModel announcementSendModel);
|
public Page<AnnouncementSendModel> getMyAnnouncementSendPage(Page<AnnouncementSendModel> page,AnnouncementSendModel announcementSendModel);
|
||||||
|
|
||||||
|
List<AnnouncementSendModel> getMessageUnreadList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+8
@@ -4,10 +4,12 @@ import java.util.List;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.modules.system.entity.SysAnnouncementSend;
|
import com.jero.modules.system.entity.SysAnnouncementSend;
|
||||||
import com.jero.modules.system.mapper.SysAnnouncementSendMapper;
|
import com.jero.modules.system.mapper.SysAnnouncementSendMapper;
|
||||||
import com.jero.modules.system.model.AnnouncementSendModel;
|
import com.jero.modules.system.model.AnnouncementSendModel;
|
||||||
import com.jero.modules.system.service.ISysAnnouncementSendService;
|
import com.jero.modules.system.service.ISysAnnouncementSendService;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -36,4 +38,10 @@ public class SysAnnouncementSendServiceImpl extends ServiceImpl<SysAnnouncementS
|
|||||||
return page.setRecords(sysAnnouncementSendMapper.getMyAnnouncementSendList(page, announcementSendModel));
|
return page.setRecords(sysAnnouncementSendMapper.getMyAnnouncementSendList(page, announcementSendModel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AnnouncementSendModel> getMessageUnreadList() {
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
return sysAnnouncementSendMapper.getMessageUnreadList(sysUser.getId());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ public class SysAnnouncementServiceImpl extends ServiceImpl<SysAnnouncementMappe
|
|||||||
sysAnnouncementMapper.insert(sysAnnouncement);
|
sysAnnouncementMapper.insert(sysAnnouncement);
|
||||||
// 2.插入用户通告阅读标记表记录
|
// 2.插入用户通告阅读标记表记录
|
||||||
String userId = sysAnnouncement.getUserIds();
|
String userId = sysAnnouncement.getUserIds();
|
||||||
String[] userIds = userId.substring(0, (userId.length()-1)).split(",");
|
String[] userIds = userId.split(",");
|
||||||
String anntId = sysAnnouncement.getId();
|
String anntId = sysAnnouncement.getId();
|
||||||
Date refDate = new Date();
|
Date refDate = new Date();
|
||||||
for(int i=0;i<userIds.length;i++) {
|
for(int i=0;i<userIds.length;i++) {
|
||||||
|
|||||||
+69
-11
@@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.jero.common.constant.CommonConstant;
|
||||||
import com.jero.common.constant.enums.CutEnum;
|
import com.jero.common.constant.enums.CutEnum;
|
||||||
|
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||||
import com.jero.common.constant.enums.ModuleEnum;
|
import com.jero.common.constant.enums.ModuleEnum;
|
||||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
@@ -25,7 +27,14 @@ import com.jero.modules.oss.entity.OSSFile;
|
|||||||
import com.jero.modules.oss.service.IOSSFileService;
|
import com.jero.modules.oss.service.IOSSFileService;
|
||||||
import com.jero.modules.subscribe.entity.OnlCgformSubscribe;
|
import com.jero.modules.subscribe.entity.OnlCgformSubscribe;
|
||||||
import com.jero.modules.subscribe.service.IOnlCgformSubscribeService;
|
import com.jero.modules.subscribe.service.IOnlCgformSubscribeService;
|
||||||
|
import com.jero.modules.system.entity.SysAnnouncement;
|
||||||
|
import com.jero.modules.system.entity.SysAnnouncementSend;
|
||||||
import com.jero.modules.system.entity.SysDictItem;
|
import com.jero.modules.system.entity.SysDictItem;
|
||||||
|
import com.jero.modules.system.entity.SysUser;
|
||||||
|
import com.jero.modules.system.mapper.SysUserMapper;
|
||||||
|
import com.jero.modules.system.service.ISysAnnouncementSendService;
|
||||||
|
import com.jero.modules.system.service.ISysAnnouncementService;
|
||||||
|
import com.jero.modules.system.service.impl.SysBaseApiImpl;
|
||||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||||
import com.jero.modules.tag.entity.OnlCgformArea;
|
import com.jero.modules.tag.entity.OnlCgformArea;
|
||||||
import com.jero.modules.tag.service.impl.OnlCgformAreaServiceImpl;
|
import com.jero.modules.tag.service.impl.OnlCgformAreaServiceImpl;
|
||||||
@@ -96,6 +105,10 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
private IOnlCgformSubscribeService iOnlCgformSubscribeService;
|
private IOnlCgformSubscribeService iOnlCgformSubscribeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBussLogEOService iBussLogEOService;
|
private IBussLogEOService iBussLogEOService;
|
||||||
|
@Autowired
|
||||||
|
private ISysAnnouncementService sysAnnouncementService;
|
||||||
|
@Autowired
|
||||||
|
private SysUserMapper sysUserMapper;
|
||||||
|
|
||||||
@Value(value = "${jero.path.upload}")
|
@Value(value = "${jero.path.upload}")
|
||||||
private String uploadpath;
|
private String uploadpath;
|
||||||
@@ -648,7 +661,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
|
|
||||||
|
|
||||||
//处理修改代替标准,发送通知
|
//处理修改代替标准,发送通知
|
||||||
sendMessage(map, dataList);
|
sendMessage(map, dataList, fieldList, fieldDateList, fieldFileList, fieldPullList,cut);
|
||||||
|
|
||||||
|
|
||||||
//字段
|
//字段
|
||||||
@@ -745,6 +758,20 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
List<OnlCgformField> fieldFileList,
|
List<OnlCgformField> fieldFileList,
|
||||||
List<OnlCgformField> fieldPullList,
|
List<OnlCgformField> fieldPullList,
|
||||||
String cut) {
|
String cut) {
|
||||||
|
StringBuilder sb = getUpdateInfo(map, dataList, fieldList, fieldDateList, fieldFileList, fieldPullList, cut);
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
if (StringUtils.isNotBlank(sb)) {
|
||||||
|
String content = sb.substring(0, sb.length() - 1);
|
||||||
|
BussLogEO bussLogEO = new BussLogEO();
|
||||||
|
bussLogEO.setDocumentId((String) map.get("id"));
|
||||||
|
bussLogEO.setContent(content);
|
||||||
|
bussLogEO.setCreateBy(sysUser.getRealname());
|
||||||
|
iBussLogEOService.add(bussLogEO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private StringBuilder getUpdateInfo(Map<String, Object> map, List<Map<String, Object>> dataList, List<OnlCgformField> fieldList, List<OnlCgformField> fieldDateList, List<OnlCgformField> fieldFileList, List<OnlCgformField> fieldPullList, String cut) {
|
||||||
Map<String, Object> mapTemp = new HashMap<>();
|
Map<String, Object> mapTemp = new HashMap<>();
|
||||||
mapCopy(map, mapTemp);
|
mapCopy(map, mapTemp);
|
||||||
//时间类型的字段
|
//时间类型的字段
|
||||||
@@ -860,15 +887,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
return sb;
|
||||||
if (StringUtils.isNotBlank(sb)) {
|
|
||||||
String content = sb.substring(0, sb.length() - 1);
|
|
||||||
BussLogEO bussLogEO = new BussLogEO();
|
|
||||||
bussLogEO.setDocumentId((String) map.get("id"));
|
|
||||||
bussLogEO.setContent(content);
|
|
||||||
bussLogEO.setCreateBy(sysUser.getRealname());
|
|
||||||
iBussLogEOService.add(bussLogEO);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -876,7 +895,43 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
*
|
*
|
||||||
* @param map
|
* @param map
|
||||||
*/
|
*/
|
||||||
private void sendMessage(Map<String, Object> map, List<Map<String, Object>> dataList) {
|
private void sendMessage(Map<String, Object> map,
|
||||||
|
List<Map<String, Object>> dataList,
|
||||||
|
List<OnlCgformField> fieldList,
|
||||||
|
List<OnlCgformField> fieldDateList,
|
||||||
|
List<OnlCgformField> fieldFileList,
|
||||||
|
List<OnlCgformField> fieldPullList,
|
||||||
|
String cut) {
|
||||||
|
//修改的内容
|
||||||
|
StringBuilder sb = getUpdateInfo(map, dataList, fieldList, fieldDateList, fieldFileList, fieldPullList, cut);
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
String serialNumber = (String) dataList.get(0).get("serial_number");
|
||||||
|
//只要修改了标准,就需要向订阅用户发送消息(内容为-->XXX对“GB 7258 进行了修改请及时查看”)
|
||||||
|
//1.先判断是否订阅
|
||||||
|
LambdaQueryWrapper<OnlCgformSubscribe> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.in(OnlCgformSubscribe::getDocumentId, (String)map.get("id"));
|
||||||
|
List<OnlCgformSubscribe> onlCgformSubscribeList = iOnlCgformSubscribeService.list(lambdaQueryWrapper);
|
||||||
|
List<String> userNameList = new ArrayList<>();
|
||||||
|
if(onlCgformSubscribeList.size() != 0){
|
||||||
|
for (OnlCgformSubscribe onlCgformSubscribe : onlCgformSubscribeList) {
|
||||||
|
userNameList.add(onlCgformSubscribe.getCreateBy());
|
||||||
|
}
|
||||||
|
List<SysUser> userList = sysUserMapper.getUserListByNames(StringUtils.join(userNameList, ","));
|
||||||
|
List<String> userIdList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
SysAnnouncement sysAnnouncement = new SysAnnouncement();
|
||||||
|
sysAnnouncement.setDelFlag("0");
|
||||||
|
sysAnnouncement.setSendStatus("0");
|
||||||
|
sysAnnouncement.setSendTime(new Date());
|
||||||
|
sysAnnouncement.setDocumentId((String) dataList.get(0).get("id"));
|
||||||
|
sysAnnouncement.setMsgCategory(MessageTypeEnum.READ.getValue());//消息类型
|
||||||
|
sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
|
||||||
|
sysAnnouncement.setMsgContent(sysUser.getRealname()+"对"+serialNumber+"进行了修改请及时查看");
|
||||||
|
sysAnnouncement.setMsgContentInfo(sysUser.getRealname()+"修改标准"+serialNumber+"中"+sb.toString());
|
||||||
|
sysAnnouncement.setUserIds(StringUtils.join(userIdList,","));
|
||||||
|
//111111111111111111111111111111111
|
||||||
|
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||||
|
}
|
||||||
//处理修改代替标准,发送通知
|
//处理修改代替标准,发送通知
|
||||||
//修改时前端传参
|
//修改时前端传参
|
||||||
String replaceStandard = (String) map.get("replace_standard");
|
String replaceStandard = (String) map.get("replace_standard");
|
||||||
@@ -1186,13 +1241,16 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
if (idList.size() == 0) {
|
if (idList.size() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
LambdaQueryWrapper<OnlCgformCollection> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<OnlCgformCollection> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.in(OnlCgformCollection::getDocumentId, idList);
|
wrapper.in(OnlCgformCollection::getDocumentId, idList);
|
||||||
|
wrapper.eq(OnlCgformCollection::getCreateBy,sysUser.getUsername());
|
||||||
List<OnlCgformCollection> collectList = iOnlCgformCollectionService.list(wrapper);
|
List<OnlCgformCollection> collectList = iOnlCgformCollectionService.list(wrapper);
|
||||||
List<String> collectIdList = collectList.stream().map(OnlCgformCollection::getDocumentId).collect(Collectors.toList());
|
List<String> collectIdList = collectList.stream().map(OnlCgformCollection::getDocumentId).collect(Collectors.toList());
|
||||||
//订阅
|
//订阅
|
||||||
LambdaQueryWrapper<OnlCgformSubscribe> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<OnlCgformSubscribe> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.in(OnlCgformSubscribe::getDocumentId, idList);
|
lambdaQueryWrapper.in(OnlCgformSubscribe::getDocumentId, idList);
|
||||||
|
lambdaQueryWrapper.eq(OnlCgformSubscribe::getCreateBy,sysUser.getUsername());
|
||||||
List<OnlCgformSubscribe> subscribeList = iOnlCgformSubscribeService.list(lambdaQueryWrapper);
|
List<OnlCgformSubscribe> subscribeList = iOnlCgformSubscribeService.list(lambdaQueryWrapper);
|
||||||
List<String> subscribeIdList = subscribeList.stream().map(OnlCgformSubscribe::getDocumentId).collect(Collectors.toList());
|
List<String> subscribeIdList = subscribeList.stream().map(OnlCgformSubscribe::getDocumentId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user