消息修改
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
package com.jero.message.common;
|
||||
|
||||
public class MessageCommon {
|
||||
/**
|
||||
* 阅读状态(0未读,1已读)
|
||||
*/
|
||||
public final static Integer READ_FLAG1 = 1;
|
||||
/**
|
||||
* 阅读状态(0未读,1已读)
|
||||
*/
|
||||
public final static Integer READ_FLAG0 = 0;
|
||||
}
|
||||
-179
@@ -1,179 +0,0 @@
|
||||
package com.jero.message.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.message.common.MessageCommon;
|
||||
import com.jero.message.entity.PayAnnouncementMessage;
|
||||
import com.jero.message.service.IPayAnnouncementMessageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* @Description: 消息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-09-22
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="消息")
|
||||
@RestController
|
||||
@RequestMapping("/message/payAnnouncementMessage")
|
||||
@Slf4j
|
||||
public class PayAnnouncementMessageController extends JeroController<PayAnnouncementMessage, IPayAnnouncementMessageService> {
|
||||
@Autowired
|
||||
private IPayAnnouncementMessageService payAnnouncementMessageService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param payAnnouncementMessage
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "消息-分页列表查询")
|
||||
@ApiOperation(value="消息-分页列表查询", notes="消息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> queryPageList(PayAnnouncementMessage payAnnouncementMessage,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
payAnnouncementMessage.setRecipient(sysUser.getId());
|
||||
QueryWrapper<PayAnnouncementMessage> queryWrapper = QueryGenerator.initQueryWrapper(payAnnouncementMessage, req.getParameterMap());
|
||||
Page<PayAnnouncementMessage> page = new Page<>(pageNo, pageSize);
|
||||
IPage<PayAnnouncementMessage> pageList = payAnnouncementMessageService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
/**
|
||||
* @Description 已读
|
||||
* @Author lqt
|
||||
* @Date 2021/9/22
|
||||
* @Param
|
||||
* @Return
|
||||
* @Exception
|
||||
*/
|
||||
@AutoLog(value = "消息-已读")
|
||||
@ApiOperation(value="消息-已读", notes="消息-已读")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> update(@RequestBody PayAnnouncementMessage payAnnouncementMessage) {
|
||||
LambdaUpdateWrapper<PayAnnouncementMessage> update = new LambdaUpdateWrapper<>();
|
||||
update.eq(PayAnnouncementMessage::getId,payAnnouncementMessage.getId());
|
||||
update.set(PayAnnouncementMessage::getReadFlag,MessageCommon.READ_FLAG1);
|
||||
payAnnouncementMessageService.update(update);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param payAnnouncementMessage
|
||||
* @return
|
||||
*/
|
||||
// @AutoLog(value = "pay_announcement_message-添加")
|
||||
// @ApiOperation(value="pay_announcement_message-添加", notes="pay_announcement_message-添加")
|
||||
// @PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody PayAnnouncementMessage payAnnouncementMessage) {
|
||||
payAnnouncementMessageService.save(payAnnouncementMessage);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param payAnnouncementMessage
|
||||
* @return
|
||||
*/
|
||||
// @AutoLog(value = "pay_announcement_message-编辑")
|
||||
// @ApiOperation(value="pay_announcement_message-编辑", notes="pay_announcement_message-编辑")
|
||||
// @PutMapping(value = "/edit")
|
||||
public Result<?> edit(@RequestBody PayAnnouncementMessage payAnnouncementMessage) {
|
||||
payAnnouncementMessageService.updateById(payAnnouncementMessage);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
// @AutoLog(value = "pay_announcement_message-通过id删除")
|
||||
// @ApiOperation(value="pay_announcement_message-通过id删除", notes="pay_announcement_message-通过id删除")
|
||||
// @DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
payAnnouncementMessageService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
// @AutoLog(value = "pay_announcement_message-批量删除")
|
||||
// @ApiOperation(value="pay_announcement_message-批量删除", notes="pay_announcement_message-批量删除")
|
||||
// @DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.payAnnouncementMessageService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "pay_announcement_message-通过id查询")
|
||||
@ApiOperation(value="pay_announcement_message-通过id查询", notes="pay_announcement_message-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
PayAnnouncementMessage payAnnouncementMessage = payAnnouncementMessageService.getById(id);
|
||||
if(payAnnouncementMessage==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(payAnnouncementMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param payAnnouncementMessage
|
||||
*/
|
||||
// @RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, PayAnnouncementMessage payAnnouncementMessage) {
|
||||
return super.exportXls(request, payAnnouncementMessage, PayAnnouncementMessage.class, "pay_announcement_message");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, PayAnnouncementMessage.class);
|
||||
}
|
||||
|
||||
}
|
||||
-89
@@ -1,89 +0,0 @@
|
||||
package com.jero.message.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: pay_announcement_message
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-09-22
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("pay_announcement_message")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="pay_announcement_message对象", description="pay_announcement_message")
|
||||
public class PayAnnouncementMessage implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
/**标题*/
|
||||
@Excel(name = "标题", width = 15)
|
||||
@ApiModelProperty(value = "标题")
|
||||
private String titile;
|
||||
/**内容*/
|
||||
@Excel(name = "内容", width = 15)
|
||||
@ApiModelProperty(value = "内容")
|
||||
private String msgContent;
|
||||
/**发布人*/
|
||||
@Excel(name = "发布人", width = 15)
|
||||
@ApiModelProperty(value = "发布人")
|
||||
private String sender;
|
||||
/**接收用户*/
|
||||
@Excel(name = "接收用户", width = 15)
|
||||
@ApiModelProperty(value = "接收用户")
|
||||
private String recipient;
|
||||
/**消息类型(字典表)*/
|
||||
@Excel(name = "消息类型(字典表)", width = 15)
|
||||
@ApiModelProperty(value = "消息类型(字典表)")
|
||||
private Integer msgCategory;
|
||||
/**操作*/
|
||||
@Excel(name = "操作", width = 15)
|
||||
@ApiModelProperty(value = "操作")
|
||||
private String operation;
|
||||
/**业务id*/
|
||||
@Excel(name = "业务id", width = 15)
|
||||
@ApiModelProperty(value = "业务id")
|
||||
private String busId;
|
||||
/**阅读状态(0未读,1已读)*/
|
||||
@Excel(name = "阅读状态(0未读,1已读)", width = 15)
|
||||
@ApiModelProperty(value = "阅读状态(0未读,1已读)")
|
||||
private Integer readFlag;
|
||||
/**阅读时间*/
|
||||
@Excel(name = "阅读时间", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "阅读时间")
|
||||
private Date readTime;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**创建时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
/**更新时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package com.jero.message.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.message.entity.PayAnnouncementMessage;
|
||||
|
||||
/**
|
||||
* @Description: pay_announcement_message
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-09-22
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface PayAnnouncementMessageMapper extends BaseMapper<PayAnnouncementMessage> {
|
||||
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<?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.jero.message.mapper.PayAnnouncementMessageMapper">
|
||||
|
||||
</mapper>
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package com.jero.message.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.message.entity.PayAnnouncementMessage;
|
||||
|
||||
/**
|
||||
* @Description: pay_announcement_message
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-09-22
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IPayAnnouncementMessageService extends IService<PayAnnouncementMessage> {
|
||||
|
||||
void sendMessage(PayAnnouncementMessage payAnnouncementMessage);
|
||||
|
||||
}
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
package com.jero.message.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.WebsocketConst;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.message.common.MessageCommon;
|
||||
import com.jero.message.entity.PayAnnouncementMessage;
|
||||
import com.jero.message.mapper.PayAnnouncementMessageMapper;
|
||||
import com.jero.message.service.IPayAnnouncementMessageService;
|
||||
import com.jero.modules.message.websocket.WebSocket;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Description: pay_announcement_message
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-09-22
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class PayAnnouncementMessageServiceImpl extends ServiceImpl<PayAnnouncementMessageMapper, PayAnnouncementMessage> implements IPayAnnouncementMessageService {
|
||||
@Autowired
|
||||
private IPayAnnouncementMessageService payAnnouncementMessageService;
|
||||
@Resource
|
||||
private WebSocket webSocket;
|
||||
@Override
|
||||
@Transactional
|
||||
public void sendMessage(PayAnnouncementMessage payAnnouncementMessage) {
|
||||
if(Objects.isNull(payAnnouncementMessage)){
|
||||
throw new JeroBootException("发送消息失败!");
|
||||
}
|
||||
payAnnouncementMessage.setReadFlag(MessageCommon.READ_FLAG0);
|
||||
payAnnouncementMessageService.save(payAnnouncementMessage);
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_USER);
|
||||
obj.put(WebsocketConst.MSG_USER_ID, payAnnouncementMessage.getRecipient());
|
||||
obj.put(WebsocketConst.MSG_ID, payAnnouncementMessage.getId());
|
||||
obj.put(WebsocketConst.MSG_TXT, payAnnouncementMessage.getTitile());
|
||||
webSocket.sendMessage(payAnnouncementMessage.getRecipient(), obj.toJSONString());
|
||||
}
|
||||
}
|
||||
-5
@@ -5,10 +5,8 @@ import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jero.common.api.dto.message.BusTemplateMessageDTO;
|
||||
import com.jero.common.api.dto.message.TemplateMessageDTO;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.enums.CompanyMessageEnums;
|
||||
import com.jero.common.enums.ManagementMessageEnums;
|
||||
import com.jero.common.service.ProjectDetailService;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
@@ -16,7 +14,6 @@ import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.common.util.ValidUtil;
|
||||
import com.jero.common.vo.ProjectDetailVO;
|
||||
import com.jero.message.service.IPayAnnouncementMessageService;
|
||||
import com.jero.project.common.PayProjectCommon;
|
||||
import com.jero.project.entity.*;
|
||||
import com.jero.project.service.IPayWorkingGroupService;
|
||||
@@ -56,8 +53,6 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
|
||||
private IPayWorkingGroupService payWorkingGroupService;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
private IPayAnnouncementMessageService payAnnouncementMessageService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
|
||||
@@ -42,11 +42,11 @@ spring:
|
||||
## quartz定时任务,采用数据库方式
|
||||
quartz:
|
||||
job-store-type: jdbc
|
||||
initialize-schema: embedded
|
||||
initialize-schema: embedded`
|
||||
#设置自动启动,默认为 true
|
||||
auto-startup: true
|
||||
auto-startup: false
|
||||
#启动时更新己存在的Job
|
||||
overwrite-existing-jobs: true
|
||||
overwrite-existing-jobs: false
|
||||
properties:
|
||||
org:
|
||||
quartz:
|
||||
@@ -140,15 +140,15 @@ spring:
|
||||
password: 123456
|
||||
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
||||
# 多数据源配置
|
||||
multi-datasource1:
|
||||
url: jdbc:p6spy:mysql://192.168.18.254:3306/standards_association?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: 123456
|
||||
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
||||
# multi-datasource1:
|
||||
# url: jdbc:p6spy:mysql://192.168.18.254:3306/standards_association?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&serverTimezone=Asia/Shanghai
|
||||
# username: root
|
||||
# password: 123456
|
||||
# driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
||||
redis:
|
||||
database: 14
|
||||
# host: 121.36.69.172
|
||||
host: 192.168.18.254
|
||||
host: localhost
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 8 #最大连接数据库连接数,设 0 为没有限制
|
||||
@@ -157,7 +157,7 @@ spring:
|
||||
min-idle: 0 #最小等待连接中的数量,设 0 为没有限制
|
||||
shutdown-timeout: 100ms
|
||||
# password: hzwlsoft.com
|
||||
password: 123456
|
||||
password:
|
||||
# port: 4780
|
||||
port: 6379
|
||||
|
||||
|
||||
Reference in New Issue
Block a user