通知中心接口完善
This commit is contained in:
@@ -62,6 +62,15 @@ public class SyncNotice implements Serializable {
|
|||||||
* 店铺id
|
* 店铺id
|
||||||
*/
|
*/
|
||||||
private Long shopId;
|
private Long shopId;
|
||||||
|
/**
|
||||||
|
* 操作类型 0 新增 1 修改
|
||||||
|
*/
|
||||||
|
private Integer operationType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息内容
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
|
|||||||
@@ -21,8 +21,9 @@ public interface SyncNoticeService extends IService<SyncNotice> {
|
|||||||
* @param name 商品/耗材名称
|
* @param name 商品/耗材名称
|
||||||
* @param id 商品/耗材id
|
* @param id 商品/耗材id
|
||||||
* @param type 0-商品 1-耗材
|
* @param type 0-商品 1-耗材
|
||||||
|
* @param operationType 0-新增 1-修改
|
||||||
*/
|
*/
|
||||||
void addNotice(Long shopId, Long sysUserId, String name, Long id, Integer type);
|
void addNotice(Long shopId, Long sysUserId, String name, Long id, Integer type, Integer operationType);
|
||||||
|
|
||||||
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, Integer type, Integer isRead);
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
|
|||||||
import com.czg.account.entity.SyncNotice;
|
import com.czg.account.entity.SyncNotice;
|
||||||
import com.czg.account.service.SyncNoticeService;
|
import com.czg.account.service.SyncNoticeService;
|
||||||
import com.czg.service.account.mapper.SyncNoticeMapper;
|
import com.czg.service.account.mapper.SyncNoticeMapper;
|
||||||
|
import org.apache.dubbo.config.annotation.DubboService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -20,17 +21,35 @@ import java.util.List;
|
|||||||
* @author zs
|
* @author zs
|
||||||
* @since 2025-04-07
|
* @since 2025-04-07
|
||||||
*/
|
*/
|
||||||
@Service
|
@DubboService
|
||||||
public class SyncNoticeServiceImpl extends ServiceImpl<SyncNoticeMapper, SyncNotice> implements SyncNoticeService {
|
public class SyncNoticeServiceImpl extends ServiceImpl<SyncNoticeMapper, SyncNotice> implements SyncNoticeService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addNotice(Long shopId, Long sysUserId, String name, Long id, Integer type) {
|
public void addNotice(Long shopId, Long sysUserId, String name, Long id, Integer type, Integer operationType) {
|
||||||
SyncNotice syncNotice = new SyncNotice();
|
SyncNotice syncNotice = new SyncNotice();
|
||||||
syncNotice.setShopId(shopId);
|
syncNotice.setShopId(shopId);
|
||||||
syncNotice.setSysUserId(sysUserId);
|
syncNotice.setSysUserId(sysUserId);
|
||||||
syncNotice.setName(name);
|
syncNotice.setName(name);
|
||||||
syncNotice.setSourceId(id);
|
syncNotice.setSourceId(id);
|
||||||
syncNotice.setType(type);
|
syncNotice.setType(type);
|
||||||
|
syncNotice.setOperationType(operationType);
|
||||||
|
String content = switch (operationType) {
|
||||||
|
case 0 -> "新增";
|
||||||
|
case 1 -> "修改";
|
||||||
|
default -> "";
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case 0:
|
||||||
|
content += "商品";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
content += "耗材";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
content = StrUtil.format("{}: {}({}), 请及时确认;", content, name, id);
|
||||||
|
syncNotice.setContent(content);
|
||||||
save(syncNotice);
|
save(syncNotice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.czg.service.product.service.impl;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.util.ObjUtil;
|
import cn.hutool.core.util.ObjUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.czg.account.service.SyncNoticeService;
|
||||||
import com.czg.enums.CrudEnum;
|
import com.czg.enums.CrudEnum;
|
||||||
import com.czg.enums.StatusEnum;
|
import com.czg.enums.StatusEnum;
|
||||||
import com.czg.enums.YesNoEnum;
|
import com.czg.enums.YesNoEnum;
|
||||||
@@ -26,6 +27,7 @@ import com.mybatisflex.core.query.QueryWrapper;
|
|||||||
import com.mybatisflex.core.update.UpdateChain;
|
import com.mybatisflex.core.update.UpdateChain;
|
||||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -48,6 +50,9 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
|
|||||||
private final ConsGroupMapper consGroupMapper;
|
private final ConsGroupMapper consGroupMapper;
|
||||||
private final ConsStockFlowMapper consStockFlowMapper;
|
private final ConsStockFlowMapper consStockFlowMapper;
|
||||||
|
|
||||||
|
@DubboReference
|
||||||
|
private SyncNoticeService syncNoticeService;
|
||||||
|
|
||||||
private QueryWrapper buildQueryWrapper(ConsInfoDTO param) {
|
private QueryWrapper buildQueryWrapper(ConsInfoDTO param) {
|
||||||
QueryWrapper queryWrapper = PageUtil.buildSortQueryWrapper();
|
QueryWrapper queryWrapper = PageUtil.buildSortQueryWrapper();
|
||||||
if (ObjUtil.isNotNull(param.getConsGroupId())) {
|
if (ObjUtil.isNotNull(param.getConsGroupId())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user