通知中心调整
This commit is contained in:
@@ -25,31 +25,27 @@ import java.util.List;
|
||||
public class SyncNoticeServiceImpl extends ServiceImpl<SyncNoticeMapper, SyncNotice> implements SyncNoticeService {
|
||||
|
||||
@Override
|
||||
public void addNotice(Long shopId, Long sysUserId, String name, Long id, Integer type, Integer operationType) {
|
||||
public void addNotice(Long shopId, Long sysUserId, String name, Long id, Integer type) {
|
||||
SyncNotice syncNotice = new SyncNotice();
|
||||
syncNotice.setShopId(shopId);
|
||||
syncNotice.setSysUserId(sysUserId);
|
||||
syncNotice.setName(name);
|
||||
syncNotice.setSourceId(id);
|
||||
syncNotice.setType(type);
|
||||
syncNotice.setOperationType(operationType);
|
||||
String content = switch (operationType) {
|
||||
case 0 -> "新增";
|
||||
case 1 -> "修改";
|
||||
String content = switch (type) {
|
||||
case 0 -> "新增商品";
|
||||
case 1 -> "修改商品";
|
||||
case 2 -> "新增耗材";
|
||||
case 3 -> "修改耗材";
|
||||
default -> "";
|
||||
};
|
||||
|
||||
switch (type) {
|
||||
case 0:
|
||||
content += "商品";
|
||||
break;
|
||||
case 1:
|
||||
content += "耗材";
|
||||
break;
|
||||
}
|
||||
String json = switch (type) {
|
||||
case 0, 1, 2, 3 -> StrUtil.format("{\"id\":{},\"name\":\"{}\"}", id, name);
|
||||
default -> "";
|
||||
};
|
||||
|
||||
content = StrUtil.format("{}: {}, 请及时确认;", content, name);
|
||||
syncNotice.setContent(content);
|
||||
syncNotice.setExtraJson(json);
|
||||
save(syncNotice);
|
||||
}
|
||||
|
||||
@@ -57,7 +53,7 @@ public class SyncNoticeServiceImpl extends ServiceImpl<SyncNoticeMapper, SyncNot
|
||||
public Page<SyncNotice> pageInfo(Long shopId, String name, String startTime, String endTime, Integer type, Integer isRead) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper().eq(SyncNotice::getShopId, shopId);
|
||||
if (StrUtil.isNotBlank(name)) {
|
||||
queryWrapper.like(SyncNotice::getName, name);
|
||||
queryWrapper.like(SyncNotice::getContent, name);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(startTime)) {
|
||||
|
||||
Reference in New Issue
Block a user