Merge remote-tracking branch 'origin/master'

This commit is contained in:
Tankaikai 2025-04-11 15:21:43 +08:00
commit bb018c6053
2 changed files with 23 additions and 12 deletions

View File

@ -48,9 +48,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
@Override
public Page<SysRole> getList(Long shopId, PageDTO pageDTO, String key, String startTime, String endTime) {
QueryWrapper queryWrapper = new QueryWrapper();
if (!StpKit.USER.isAdmin()) {
// if (!StpKit.USER.isAdmin()) {
queryWrapper.eq(SysRole::getCreateUserId, StpKit.USER.getLoginIdAsLong());
}
// }
if (StrUtil.isNotBlank(key)) {
queryWrapper.and(column(SysRole::getName).like(key).or(column(SysRole::getDescription).like(key)));
@ -64,6 +64,8 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
queryWrapper.le(SysRole::getCreateTime, DateUtil.parse(endTime));
}
queryWrapper.orderBy(SysRole::getLevel, true);
return page(new Page<>(pageDTO.page(), pageDTO.size()), queryWrapper);
}

View File

@ -423,12 +423,16 @@ public class ShopSyncServiceImpl implements ShopSyncService {
public Map<Long, Long> syncProduct(Long sourceShopId, Long pointShopId, Map<Long, Long> unitMap,
Map<Long, Long> specMap, Map<Long, Long> cateGoryMap, List<Map<String, Object>> mainMapList) {
List<Long> pointProducts = productService.queryChain()
.select(Product::getSyncId)
Map<Long, Long> proMap = new HashMap<>();
List<Long> pointProducts = new ArrayList<>();
List<Product> pointList = productService.queryChain()
.eq(Product::getShopId, pointShopId)
.isNotNull(Product::getSyncId)
.listAs(Long.class);
Map<Long, Long> proMap = new HashMap<>();
.list();
for (Product product : pointList) {
pointProducts.add(product.getSyncId());
proMap.put(product.getSyncId(), product.getId());
}
List<Product> products = productService.queryChain().eq(Product::getShopId, sourceShopId).list();
if (CollectionUtil.isNotEmpty(products)) {
unitService.queryChain().eq(ShopProdUnit::getIsSystem, 1).list().forEach(tbShopUnit -> {
@ -452,8 +456,8 @@ public class ShopSyncServiceImpl implements ShopSyncService {
}
}
}
log.info("商品同步,源{}个,已有{}个,同步{}个", products.size(), pointProducts.size(), proMap.size());
buildNotice(mainMapList, "商品同步", proMap.size(), null, null);
log.info("商品同步,源{}个,已有{}个,同步{}个", products.size(), pointProducts.size(), proMap.size() - pointProducts.size());
buildNotice(mainMapList, "商品同步", proMap.size() - pointProducts.size(), null, null);
return proMap;
}
@ -833,10 +837,15 @@ public class ShopSyncServiceImpl implements ShopSyncService {
// 耗材
public Map<Long, Long> syncConsInfo(Long sourceShopId, Long pointShopId, Map<Long, Long> consGroupMap, List<Map<String, Object>> mainMapList) {
Map<Long, Long> consMap = new HashMap<>();
List<Long> pointConsInfo = consInfoService.queryChain().select(ConsInfo::getSyncId)
List<Long> pointConsInfo = new ArrayList<>();
List<ConsInfo> pointList = consInfoService.queryChain()
.eq(ConsInfo::getShopId, pointShopId)
.isNotNull(ConsInfo::getSyncId)
.listAs(Long.class);
.list();
for (ConsInfo consInfo : pointList) {
pointConsInfo.add(consInfo.getSyncId());
consMap.put(consInfo.getSyncId(), consInfo.getId());
}
List<ConsInfo> list = consInfoService.queryChain().eq(ConsInfo::getShopId, sourceShopId).list();
for (ConsInfo cons : list) {
if (CollUtil.isEmpty(pointConsInfo) || !pointConsInfo.contains(cons.getId())) {
@ -850,8 +859,8 @@ public class ShopSyncServiceImpl implements ShopSyncService {
consMap.put(cons.getId(), conInfo.getId());
}
}
log.info("耗材同步,源{}个,已有{}个,同步{}个", list.size(), pointConsInfo.size(), consMap.size());
buildNotice(mainMapList, "耗材信息同步", consMap.size(), null, null);
log.info("耗材同步,源{}个,已有{}个,同步{}个", list.size(), pointConsInfo.size(), consMap.size() - pointConsInfo.size());
buildNotice(mainMapList, "耗材信息同步", consMap.size() - pointConsInfo.size(), null, null);
return consMap;
}