消息通知
This commit is contained in:
@@ -119,7 +119,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void sync(Long sourceShopId, Long targetShopId) {
|
||||
public void sync(Long sourceShopId, Long targetShopId, Long sysUserId) {
|
||||
Map<Long, Long> unitMap;
|
||||
Map<Long, Long> specMap;
|
||||
Map<Long, Long> categoryMap;
|
||||
@@ -160,7 +160,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
Map<Long, Long> consInfoMap = syncConsInfo(sourceShopId, targetShopId, conGroupMap);
|
||||
buildNotice(mainMapList, "耗材信息同步", consInfoMap.size(), null);
|
||||
syncConsPro(sourceShopId, targetShopId, consInfoMap, proMap);
|
||||
syncNoticeService.addNotice(targetShopId, StpKit.USER.getLoginIdAsLong(), "数据同步", JSON.toJSONString(mainMapList), null);
|
||||
syncNoticeService.addNotice(targetShopId, sysUserId, "数据同步", JSON.toJSONString(mainMapList), null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -211,7 +211,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncUnitBySourceShop(Long sourceShopId, Long unitId) {
|
||||
public void syncUnitBySourceShop(Long sourceShopId, Long unitId, Long sysUserId) {
|
||||
AssertUtil.isNull(unitId, "{}不能为空", "单位ID");
|
||||
Set<Long> shopIds = checkSourceShopInfo(sourceShopId, 1);
|
||||
if (CollUtil.isEmpty(shopIds)) {
|
||||
@@ -242,7 +242,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
}
|
||||
unitDataMap.put(newUnit.getId(), newUnit.getName());
|
||||
buildNotice(mainMapList, "单位变动", 1, unitDataMap);
|
||||
syncNoticeService.addNotice(shopId, StpKit.USER.getLoginIdAsLong(), "数据变动", JSON.toJSONString(mainMapList), JSON.toJSONString(newUnit));
|
||||
syncNoticeService.addNotice(shopId, sysUserId, "数据变动", JSON.toJSONString(mainMapList), JSON.toJSONString(newUnit));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncSpecBySourceShop(Long sourceShopId, Long specId) {
|
||||
public void syncSpecBySourceShop(Long sourceShopId, Long specId, Long sysUserId) {
|
||||
AssertUtil.isNull(specId, "{}不能为空", "规格ID");
|
||||
Set<Long> shopIds = checkSourceShopInfo(sourceShopId, 1);
|
||||
if (CollUtil.isEmpty(shopIds)) {
|
||||
@@ -301,7 +301,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
}
|
||||
dataMap.put(newEntity.getId(), newEntity.getName());
|
||||
buildNotice(mainMapList, "规格变动", 1, dataMap);
|
||||
syncNoticeService.addNotice(shopId, StpKit.USER.getLoginIdAsLong(), "数据变动", JSON.toJSONString(mainMapList), JSON.toJSONString(newEntity));
|
||||
syncNoticeService.addNotice(shopId, sysUserId, "数据变动", JSON.toJSONString(mainMapList), JSON.toJSONString(newEntity));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncCategoryBySourceShop(Long sourceShopId, Long categoryId) {
|
||||
public void syncCategoryBySourceShop(Long sourceShopId, Long categoryId, Long sysUserId) {
|
||||
AssertUtil.isNull(categoryId, "{}不能为空", "分类ID");
|
||||
Set<Long> shopIds = checkSourceShopInfo(sourceShopId, 1);
|
||||
if (CollUtil.isEmpty(shopIds)) {
|
||||
@@ -393,7 +393,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
}
|
||||
dataMap.put(newEntity.getId(), newEntity.getName());
|
||||
buildNotice(mainMapList, "分类变动", 1, dataMap);
|
||||
syncNoticeService.addNotice(shopId, StpKit.USER.getLoginIdAsLong(), "数据变动", JSON.toJSONString(mainMapList), JSON.toJSONString(newEntity));
|
||||
syncNoticeService.addNotice(shopId, sysUserId, "数据变动", JSON.toJSONString(mainMapList), JSON.toJSONString(newEntity));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,7 +430,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncProductBySourceShop(Long sourceShopId, Long productId) {
|
||||
public void syncProductBySourceShop(Long sourceShopId, Long productId, Long sysUserId) {
|
||||
AssertUtil.isNull(productId, "{}不能为空", "商品ID");
|
||||
Set<Long> shopIds = checkSourceShopInfo(sourceShopId, 1);
|
||||
if (CollUtil.isEmpty(shopIds)) {
|
||||
@@ -484,7 +484,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
}
|
||||
dataMap.put(newEntity.getId(), newEntity.getName());
|
||||
buildNotice(mainMapList, "商品变动", 1, dataMap);
|
||||
syncNoticeService.addNotice(shopId, StpKit.USER.getLoginIdAsLong(), "数据变动", JSON.toJSONString(mainMapList), JSON.toJSONString(newEntity));
|
||||
syncNoticeService.addNotice(shopId, sysUserId, "数据变动", JSON.toJSONString(mainMapList), JSON.toJSONString(newEntity));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncGroupBySourceShop(Long sourceShopId, Long groupId) {
|
||||
public void syncGroupBySourceShop(Long sourceShopId, Long groupId, Long sysUserId) {
|
||||
AssertUtil.isNull(groupId, "{}不能为空", "分组ID");
|
||||
Set<Long> shopIds = checkSourceShopInfo(sourceShopId, 1);
|
||||
if (CollUtil.isEmpty(shopIds)) {
|
||||
@@ -555,7 +555,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
}
|
||||
dataMap.put(newEntity.getId(), newEntity.getName());
|
||||
buildNotice(mainMapList, "分组变动", 1, dataMap);
|
||||
syncNoticeService.addNotice(shopId, StpKit.USER.getLoginIdAsLong(), "数据变动", JSON.toJSONString(mainMapList), JSON.toJSONString(newEntity));
|
||||
syncNoticeService.addNotice(shopId, sysUserId, "数据变动", JSON.toJSONString(mainMapList), JSON.toJSONString(newEntity));
|
||||
if (CollUtil.isEmpty(groupRelationMap)) {
|
||||
List<ProdGroupRelation> oldProdGroup = prodGroupRelationService.queryChain().eq(ProdGroupRelation::getProdGroupId, newEntity.getId()).list();
|
||||
if (CollUtil.isEmpty(oldProdGroup)) {
|
||||
@@ -727,7 +727,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncConsGroupBySourceShop(Long sourceShopId, Long consGroupId) {
|
||||
public void syncConsGroupBySourceShop(Long sourceShopId, Long consGroupId, Long sysUserId) {
|
||||
AssertUtil.isNull(consGroupId, "{}不能为空", "耗材分组ID");
|
||||
Set<Long> shopIds = checkSourceShopInfo(sourceShopId, 2);
|
||||
if (CollUtil.isEmpty(shopIds)) {
|
||||
@@ -757,7 +757,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
}
|
||||
dataMap.put(newEntity.getId(), newEntity.getName());
|
||||
buildNotice(mainMapList, "耗材分组变动", 1, dataMap);
|
||||
syncNoticeService.addNotice(shopId, StpKit.USER.getLoginIdAsLong(), "数据变动", JSON.toJSONString(mainMapList), JSON.toJSONString(newEntity));
|
||||
syncNoticeService.addNotice(shopId, sysUserId, "数据变动", JSON.toJSONString(mainMapList), JSON.toJSONString(newEntity));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -787,7 +787,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncConsInfoBySourceShop(Long sourceShopId, Long consInfoId) {
|
||||
public void syncConsInfoBySourceShop(Long sourceShopId, Long consInfoId, Long sysUserId) {
|
||||
AssertUtil.isNull(consInfoId, "{}不能为空", "耗材ID");
|
||||
Set<Long> shopIds = checkSourceShopInfo(sourceShopId, 2);
|
||||
if (CollUtil.isEmpty(shopIds)) {
|
||||
@@ -823,7 +823,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
}
|
||||
dataMap.put(newEntity.getId(), newEntity.getConName());
|
||||
buildNotice(mainMapList, "耗材信息变动", 1, dataMap);
|
||||
syncNoticeService.addNotice(shopId, StpKit.USER.getLoginIdAsLong(), "数据变动", JSON.toJSONString(mainMapList), JSON.toJSONString(newEntity));
|
||||
syncNoticeService.addNotice(shopId, sysUserId, "数据变动", JSON.toJSONString(mainMapList), JSON.toJSONString(newEntity));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -841,7 +841,7 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncConsProBySourceShop(Long sourceShopId, Long sourceProdId) {
|
||||
public void syncConsProBySourceShop(Long sourceShopId, Long sourceProdId, Long sysUserId) {
|
||||
AssertUtil.isNull(sourceProdId, "{}不能为空", "商品ID");
|
||||
Set<Long> shopIds = checkSourceShopInfo(sourceShopId, 2);
|
||||
if (CollUtil.isEmpty(shopIds)) {
|
||||
|
||||
Reference in New Issue
Block a user