Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -48,9 +48,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
|
|||||||
@Override
|
@Override
|
||||||
public Page<SysRole> getList(Long shopId, PageDTO pageDTO, String key, String startTime, String endTime) {
|
public Page<SysRole> getList(Long shopId, PageDTO pageDTO, String key, String startTime, String endTime) {
|
||||||
QueryWrapper queryWrapper = new QueryWrapper();
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
if (!StpKit.USER.isAdmin()) {
|
// if (!StpKit.USER.isAdmin()) {
|
||||||
queryWrapper.eq(SysRole::getCreateUserId, StpKit.USER.getLoginIdAsLong());
|
queryWrapper.eq(SysRole::getCreateUserId, StpKit.USER.getLoginIdAsLong());
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(key)) {
|
if (StrUtil.isNotBlank(key)) {
|
||||||
queryWrapper.and(column(SysRole::getName).like(key).or(column(SysRole::getDescription).like(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.le(SysRole::getCreateTime, DateUtil.parse(endTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
queryWrapper.orderBy(SysRole::getLevel, true);
|
||||||
|
|
||||||
return page(new Page<>(pageDTO.page(), pageDTO.size()), queryWrapper);
|
return page(new Page<>(pageDTO.page(), pageDTO.size()), queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -423,12 +423,16 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
|||||||
|
|
||||||
public Map<Long, Long> syncProduct(Long sourceShopId, Long pointShopId, Map<Long, Long> unitMap,
|
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) {
|
Map<Long, Long> specMap, Map<Long, Long> cateGoryMap, List<Map<String, Object>> mainMapList) {
|
||||||
List<Long> pointProducts = productService.queryChain()
|
Map<Long, Long> proMap = new HashMap<>();
|
||||||
.select(Product::getSyncId)
|
List<Long> pointProducts = new ArrayList<>();
|
||||||
|
List<Product> pointList = productService.queryChain()
|
||||||
.eq(Product::getShopId, pointShopId)
|
.eq(Product::getShopId, pointShopId)
|
||||||
.isNotNull(Product::getSyncId)
|
.isNotNull(Product::getSyncId)
|
||||||
.listAs(Long.class);
|
.list();
|
||||||
Map<Long, Long> proMap = new HashMap<>();
|
for (Product product : pointList) {
|
||||||
|
pointProducts.add(product.getSyncId());
|
||||||
|
proMap.put(product.getSyncId(), product.getId());
|
||||||
|
}
|
||||||
List<Product> products = productService.queryChain().eq(Product::getShopId, sourceShopId).list();
|
List<Product> products = productService.queryChain().eq(Product::getShopId, sourceShopId).list();
|
||||||
if (CollectionUtil.isNotEmpty(products)) {
|
if (CollectionUtil.isNotEmpty(products)) {
|
||||||
unitService.queryChain().eq(ShopProdUnit::getIsSystem, 1).list().forEach(tbShopUnit -> {
|
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());
|
log.info("商品同步,源{}个,已有{}个,同步{}个", products.size(), pointProducts.size(), proMap.size() - pointProducts.size());
|
||||||
buildNotice(mainMapList, "商品同步", proMap.size(), null, null);
|
buildNotice(mainMapList, "商品同步", proMap.size() - pointProducts.size(), null, null);
|
||||||
return proMap;
|
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) {
|
public Map<Long, Long> syncConsInfo(Long sourceShopId, Long pointShopId, Map<Long, Long> consGroupMap, List<Map<String, Object>> mainMapList) {
|
||||||
Map<Long, Long> consMap = new HashMap<>();
|
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)
|
.eq(ConsInfo::getShopId, pointShopId)
|
||||||
.isNotNull(ConsInfo::getSyncId)
|
.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();
|
List<ConsInfo> list = consInfoService.queryChain().eq(ConsInfo::getShopId, sourceShopId).list();
|
||||||
for (ConsInfo cons : list) {
|
for (ConsInfo cons : list) {
|
||||||
if (CollUtil.isEmpty(pointConsInfo) || !pointConsInfo.contains(cons.getId())) {
|
if (CollUtil.isEmpty(pointConsInfo) || !pointConsInfo.contains(cons.getId())) {
|
||||||
@@ -850,8 +859,8 @@ public class ShopSyncServiceImpl implements ShopSyncService {
|
|||||||
consMap.put(cons.getId(), conInfo.getId());
|
consMap.put(cons.getId(), conInfo.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.info("耗材同步,源{}个,已有{}个,同步{}个", list.size(), pointConsInfo.size(), consMap.size());
|
log.info("耗材同步,源{}个,已有{}个,同步{}个", list.size(), pointConsInfo.size(), consMap.size() - pointConsInfo.size());
|
||||||
buildNotice(mainMapList, "耗材信息同步", consMap.size(), null, null);
|
buildNotice(mainMapList, "耗材信息同步", consMap.size() - pointConsInfo.size(), null, null);
|
||||||
return consMap;
|
return consMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user