add 平台发消息功能上线
This commit is contained in:
@@ -18,3 +18,5 @@ create table pay_meeting_guests_file
|
||||
alter table pay_meeting_guests_file
|
||||
add primary key (id);
|
||||
|
||||
ALTER TABLE sys_announcement_send ADD deadline datetime COMMENT '截止时间';
|
||||
|
||||
|
||||
+4
-1
@@ -31,6 +31,7 @@ import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -80,7 +81,8 @@ public class SystemSendMessageController {
|
||||
@GetMapping(value = "/sendAllUserMessage")
|
||||
@RequiresPermissions("template:add:systemNotifications")
|
||||
@Transactional
|
||||
public Result<?> sendAllUserMessage(@RequestParam("content") String content) {
|
||||
public Result<?> sendAllUserMessage(@RequestParam("content") String content,
|
||||
@RequestParam("deadline") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date deadline) {
|
||||
List<PayContactsManagement> listPayContactsManagement = payContactsManagementService.list();
|
||||
if(!CollectionUtils.isEmpty(listPayContactsManagement)){
|
||||
SysAnnouncement announcement = new SysAnnouncement();
|
||||
@@ -118,6 +120,7 @@ public class SystemSendMessageController {
|
||||
announcementSend.setAnntId(anntId);
|
||||
announcementSend.setUserId(user.getId());
|
||||
announcementSend.setReadFlag(CommonConstant.NO_READ_FLAG);
|
||||
announcementSend.setDeadline(deadline); // 截止时间
|
||||
sysAnnouncementSendService.save(announcementSend);
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_USER);
|
||||
|
||||
+35
@@ -2,10 +2,12 @@ package com.jero.modules.system.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
@@ -265,6 +267,39 @@ public class SysAnnouncementSendController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @功能:企业端获取我的消息(截止时间未读消息)
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getDeadlineUnreadSend")
|
||||
@ApiOperation(value="企业端获取我的消息(截止时间未读消息)", notes="企业端获取我的消息(截止时间未读消息)")
|
||||
public Result<List<AnnouncementSendModel>> getDeadlineUnreadSend(AnnouncementSendModel announcementSendModel) {
|
||||
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
|
||||
String userId = sysUser.getId();
|
||||
announcementSendModel.setUserId(userId);
|
||||
announcementSendModel.setDeadline(new Date());
|
||||
announcementSendModel.setReadFlag(CommonConstant.NO_READ_FLAG);
|
||||
List<AnnouncementSendModel> pageList = sysAnnouncementSendService.getDeadlineUnreadSend(announcementSendModel);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Remarks: 一键已读(截止时间未读消息)
|
||||
**/
|
||||
@GetMapping(value = "/allReadDeadlineUnreadSend")
|
||||
@ApiOperation(value="一键已读(截止时间未读消息)", notes="一键已读(截止时间未读消息)")
|
||||
public Result<String> allReadDeadlineUnreadSend(@RequestParam("anntIds") String anntIds) {
|
||||
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
|
||||
String userId = sysUser.getId();
|
||||
LambdaUpdateWrapper<SysAnnouncementSend> updateWrapper = new UpdateWrapper().lambda();
|
||||
updateWrapper.set(SysAnnouncementSend::getReadFlag, CommonConstant.HAS_READ_FLAG);
|
||||
updateWrapper.set(SysAnnouncementSend::getReadTime, new Date());
|
||||
updateWrapper.in(SysAnnouncementSend::getAnntId, Arrays.asList(anntIds.split(",")));
|
||||
updateWrapper.eq(SysAnnouncementSend::getUserId, userId);
|
||||
sysAnnouncementSendService.update(updateWrapper);
|
||||
return Result.OK("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* @功能:一键已读
|
||||
* @return
|
||||
|
||||
+5
@@ -45,4 +45,9 @@ public class SysAnnouncementSend implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**截止时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date deadline;
|
||||
}
|
||||
|
||||
+5
@@ -28,4 +28,9 @@ public interface SysAnnouncementSendMapper extends BaseMapper<SysAnnouncementSen
|
||||
*/
|
||||
public List<AnnouncementSendModel> getMyAnnouncementSendList(Page<AnnouncementSendModel> page,@Param("announcementSendModel") AnnouncementSendModel announcementSendModel);
|
||||
|
||||
/**
|
||||
* @Remarks: 获取截止时间后未读的消息
|
||||
**/
|
||||
List<AnnouncementSendModel> getMyAnnouncementSendList(@Param("announcementSendModel") AnnouncementSendModel announcementSendModel);
|
||||
|
||||
}
|
||||
|
||||
+42
-39
@@ -24,53 +24,56 @@
|
||||
</select>
|
||||
|
||||
<select id="getMyAnnouncementSendList" 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.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.template_code,
|
||||
sa.jump_parameter
|
||||
from sys_announcement_send sas
|
||||
left join sys_announcement sa ON sas.annt_id = sa.id
|
||||
where sa.send_status = '1'
|
||||
and sa.del_flag = '0'
|
||||
and sas.user_id = #{announcementSendModel.userId}
|
||||
<if test="announcementSendModel.titile !=null and announcementSendModel.titile != ''">
|
||||
and sa.titile = #{announcementSendModel.titile}
|
||||
</if>
|
||||
<if test="announcementSendModel.sender !=null and announcementSendModel.sender != ''">
|
||||
and sa.sender LIKE concat(concat('%',#{announcementSendModel.sender}),'%')
|
||||
</if>
|
||||
<if test="announcementSendModel.readFlag !=null and announcementSendModel.readFlag != ''">
|
||||
and sas.read_flag = #{announcementSendModel.readFlag}
|
||||
</if>
|
||||
<if test="announcementSendModel.busType !=null and announcementSendModel.busType != ''">
|
||||
and sa.bus_type = #{announcementSendModel.busType}
|
||||
</if>
|
||||
select
|
||||
sas.id,
|
||||
sas.annt_id,
|
||||
sas.user_id,
|
||||
sas.read_flag,
|
||||
sa.titile as titile,
|
||||
sa.msg_content as msg_content,
|
||||
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.template_code,
|
||||
sa.jump_parameter
|
||||
from sys_announcement_send sas
|
||||
left join sys_announcement sa ON sas.annt_id = sa.id
|
||||
where sa.send_status = '1'
|
||||
and sa.del_flag = '0'
|
||||
and sas.user_id = #{announcementSendModel.userId}
|
||||
<if test="announcementSendModel.deadline != null">
|
||||
and sas.deadline <= #{announcementSendModel.deadline}
|
||||
</if>
|
||||
<if test="announcementSendModel.titile !=null and announcementSendModel.titile != ''">
|
||||
and sa.titile = #{announcementSendModel.titile}
|
||||
</if>
|
||||
<if test="announcementSendModel.sender !=null and announcementSendModel.sender != ''">
|
||||
and sa.sender LIKE concat(concat('%',#{announcementSendModel.sender}),'%')
|
||||
</if>
|
||||
<if test="announcementSendModel.readFlag !=null and announcementSendModel.readFlag != ''">
|
||||
and sas.read_flag = #{announcementSendModel.readFlag}
|
||||
</if>
|
||||
<if test="announcementSendModel.busType !=null and announcementSendModel.busType != ''">
|
||||
and sa.bus_type = #{announcementSendModel.busType}
|
||||
</if>
|
||||
<if test="announcementSendModel.bizSource !=null and announcementSendModel.bizSource =='isNoBpm'">
|
||||
and (sa.bus_type != 'bpm' or sa.bus_type is null)
|
||||
</if>
|
||||
<if test="announcementSendModel.msgCategory !=null and announcementSendModel.msgCategory != ''">
|
||||
and sa.msg_category = #{announcementSendModel.msgCategory}
|
||||
</if>
|
||||
<if test="announcementSendModel.startTime != null and announcementSendModel.startTime != ''">
|
||||
<if test="announcementSendModel.msgCategory !=null and announcementSendModel.msgCategory != ''">
|
||||
and sa.msg_category = #{announcementSendModel.msgCategory}
|
||||
</if>
|
||||
<if test="announcementSendModel.startTime != null and announcementSendModel.startTime != ''">
|
||||
and DATE_FORMAT(sa.create_time,'%Y-%m-%d') >= #{announcementSendModel.startTime}
|
||||
</if>
|
||||
<if test="announcementSendModel.endTime != null and announcementSendModel.endTime != ''">
|
||||
and DATE_FORMAT(sa.create_time,'%Y-%m-%d') <= #{announcementSendModel.endTime}
|
||||
</if>
|
||||
order by sas.read_flag,sa.send_time desc
|
||||
order by sas.read_flag,sa.send_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
+6
@@ -8,6 +8,7 @@ import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 用户通告阅读标记表
|
||||
@@ -92,4 +93,9 @@ public class AnnouncementSendModel implements Serializable {
|
||||
* 跳转参数
|
||||
*/
|
||||
private String jumpParameter;
|
||||
|
||||
/**
|
||||
* @Remarks: 截止时间
|
||||
**/
|
||||
private Date deadline;
|
||||
}
|
||||
|
||||
+4
@@ -25,4 +25,8 @@ public interface ISysAnnouncementSendService extends IService<SysAnnouncementSen
|
||||
*/
|
||||
public Page<AnnouncementSendModel> getMyAnnouncementSendPage(Page<AnnouncementSendModel> page,AnnouncementSendModel announcementSendModel);
|
||||
|
||||
/**
|
||||
* @Remarks: 企业端获取我的消息(截止时间未读消息)
|
||||
**/
|
||||
List<AnnouncementSendModel> getDeadlineUnreadSend(AnnouncementSendModel announcementSendModel);
|
||||
}
|
||||
|
||||
+8
@@ -36,4 +36,12 @@ public class SysAnnouncementSendServiceImpl extends ServiceImpl<SysAnnouncementS
|
||||
return page.setRecords(sysAnnouncementSendMapper.getMyAnnouncementSendList(page, announcementSendModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Remarks: 企业端获取我的消息(截止时间未读消息)
|
||||
**/
|
||||
@Override
|
||||
public List<AnnouncementSendModel> getDeadlineUnreadSend(AnnouncementSendModel announcementSendModel) {
|
||||
return sysAnnouncementSendMapper.getMyAnnouncementSendList(announcementSendModel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user