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