消息同步修改
This commit is contained in:
@@ -27,15 +27,15 @@ public class SyncNoticeController {
|
|||||||
* @param name 名称
|
* @param name 名称
|
||||||
* @param startTime 起始时间
|
* @param startTime 起始时间
|
||||||
* @param endTime 结束时间
|
* @param endTime 结束时间
|
||||||
* @param type 0 商品新增 1 商品编辑 2 耗材新增 3 耗材编辑
|
* @param title 数据同步/数据变动/库存预警
|
||||||
* @param isRead 0-未读 1-已读
|
* @param isRead 0-未读 1-已读
|
||||||
* @return 分页数据
|
* @return 分页数据
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public CzgResult<Page<SyncNotice>> page(@RequestParam(required = false) String name, @RequestParam(required = false) String startTime,
|
public CzgResult<Page<SyncNotice>> page(@RequestParam(required = false) String name, @RequestParam(required = false) String startTime,
|
||||||
@RequestParam(required = false) String endTime, @RequestParam(required = false) Integer type,
|
@RequestParam(required = false) String endTime, @RequestParam(required = false) String title,
|
||||||
@RequestParam(required = false) Integer isRead) {
|
@RequestParam(required = false) Integer isRead) {
|
||||||
return CzgResult.success(syncNoticeService.pageInfo(StpKit.USER.getShopId(), name, startTime, endTime, type, isRead));
|
return CzgResult.success(syncNoticeService.pageInfo(StpKit.USER.getShopId(), name, startTime, endTime, title, isRead));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -38,10 +38,6 @@ public class SyncNotice implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Long sysUserId;
|
private Long sysUserId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 通知类型 0 商品新增 1 商品编辑 2耗材新增 3耗材编辑
|
|
||||||
*/
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否已读,1已读
|
* 是否已读,1已读
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public interface SyncNoticeService extends IService<SyncNotice> {
|
|||||||
*/
|
*/
|
||||||
void addNotice(Long shopId, Long sysUserId, String title, String content, String extraJson);
|
void addNotice(Long shopId, Long sysUserId, String title, String content, String extraJson);
|
||||||
|
|
||||||
Page<SyncNotice> pageInfo(Long shopId, String name, String startTime, String endTime, Integer type, Integer isRead);
|
Page<SyncNotice> pageInfo(Long shopId, String name, String startTime, String endTime, String title, Integer isRead);
|
||||||
|
|
||||||
Boolean read(Long shopId, SyncNoticeReadDTO syncNoticeReadDTO);
|
Boolean read(Long shopId, SyncNoticeReadDTO syncNoticeReadDTO);
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ public class SyncNoticeServiceImpl extends ServiceImpl<SyncNoticeMapper, SyncNot
|
|||||||
SyncNotice syncNotice = new SyncNotice();
|
SyncNotice syncNotice = new SyncNotice();
|
||||||
syncNotice.setShopId(shopId);
|
syncNotice.setShopId(shopId);
|
||||||
syncNotice.setSysUserId(sysUserId);
|
syncNotice.setSysUserId(sysUserId);
|
||||||
syncNotice.setType(type);
|
|
||||||
String content = switch (type) {
|
String content = switch (type) {
|
||||||
case 0 -> "新增商品";
|
case 0 -> "新增商品";
|
||||||
case 1 -> "修改商品";
|
case 1 -> "修改商品";
|
||||||
@@ -63,7 +62,7 @@ public class SyncNoticeServiceImpl extends ServiceImpl<SyncNoticeMapper, SyncNot
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<SyncNotice> pageInfo(Long shopId, String name, String startTime, String endTime, Integer type, Integer isRead) {
|
public Page<SyncNotice> pageInfo(Long shopId, String name, String startTime, String endTime, String title, Integer isRead) {
|
||||||
QueryWrapper queryWrapper = new QueryWrapper().eq(SyncNotice::getShopId, shopId);
|
QueryWrapper queryWrapper = new QueryWrapper().eq(SyncNotice::getShopId, shopId);
|
||||||
if (StrUtil.isNotBlank(name)) {
|
if (StrUtil.isNotBlank(name)) {
|
||||||
queryWrapper.like(SyncNotice::getContent, name);
|
queryWrapper.like(SyncNotice::getContent, name);
|
||||||
@@ -76,7 +75,7 @@ public class SyncNoticeServiceImpl extends ServiceImpl<SyncNoticeMapper, SyncNot
|
|||||||
if (StrUtil.isNotBlank(endTime)) {
|
if (StrUtil.isNotBlank(endTime)) {
|
||||||
queryWrapper.le(SyncNotice::getCreateTime, endTime);
|
queryWrapper.le(SyncNotice::getCreateTime, endTime);
|
||||||
}
|
}
|
||||||
queryWrapper.eq(SyncNotice::getType, type);
|
queryWrapper.eq(SyncNotice::getTitle, title);
|
||||||
queryWrapper.eq(SyncNotice::getIsRead, isRead);
|
queryWrapper.eq(SyncNotice::getIsRead, isRead);
|
||||||
queryWrapper.orderBy(SyncNotice::getCreateTime, false);
|
queryWrapper.orderBy(SyncNotice::getCreateTime, false);
|
||||||
return page(PageUtil.buildPage(), queryWrapper);
|
return page(PageUtil.buildPage(), queryWrapper);
|
||||||
|
|||||||
Reference in New Issue
Block a user