Merge branch 'cc_20250710_userRegion' into 'master'
fix See merge request hangzhou/java/custom_zxjp!132
This commit is contained in:
@@ -580,6 +580,7 @@
|
||||
update xfsg_shop_info set shop_name = #{item.shopName}, province =#{item.province}, city = #{item.city}, district=#{item.district}, detail_address = #{item.detailAddress} where id = #{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateManagerRegionId">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update xfsg_shop_info set manager_region_id = #{item.managerRegionId} where id = #{item.id}
|
||||
|
||||
@@ -1175,10 +1175,10 @@ public class DataHandlerServerImpl implements DataHandlerServer {
|
||||
|
||||
//查询门店-XX大区下面的管理督导
|
||||
List<RegionDO> manageRegionList = regionDao.getSubRegionByParentIdsAndRegionType(storeManageIds, "path");
|
||||
Map<String, RegionDO> manageRegionMap = manageRegionList.stream().collect(Collectors.toMap(regionDO -> regionDO.getName(), Function.identity()));
|
||||
Map<String, List<RegionDO>> manageRegionMap = manageRegionList.stream().collect(Collectors.groupingBy(RegionDO::getName));
|
||||
//查询加盟分部下的管理督导
|
||||
List<RegionDO> branchStoreManageList = regionDao.getSubRegionByParentIdsAndRegionType(branchStoreManageIds, "path");
|
||||
Map<String, RegionDO> branchStoreManageMap = branchStoreManageList.stream().collect(Collectors.toMap(regionDO -> regionDO.getName(), Function.identity()));
|
||||
Map<String, List<RegionDO>> branchStoreManageMap = branchStoreManageList.stream().collect(Collectors.groupingBy(RegionDO::getName));
|
||||
|
||||
List<Long> isShopIds = isCreateStore.stream().map(IsCreateStoreDTO::getShopId).collect(Collectors.toList());
|
||||
//未建店
|
||||
@@ -1198,7 +1198,7 @@ public class DataHandlerServerImpl implements DataHandlerServer {
|
||||
continue;
|
||||
}
|
||||
BigRegionDTO bigRegionDTO = bigRegionDTOMap.get(shopInfoDO.getRegionId());
|
||||
RegionDO regionDO;
|
||||
List<RegionDO> regions = new ArrayList<>();
|
||||
if (bigRegionDTO==null){
|
||||
log.info("门店所属大区未找到 shopId:{}",shopInfoDO.getId());
|
||||
ImportOaOldShopDataErrorDTO errorDTO = new ImportOaOldShopDataErrorDTO(shopInfoDO.getShopCode(), "门店所属大区未找到");
|
||||
@@ -1207,18 +1207,30 @@ public class DataHandlerServerImpl implements DataHandlerServer {
|
||||
continue;
|
||||
}
|
||||
if (bigRegionDTO.getStoreManageRegionId()!=null){
|
||||
regionDO = manageRegionMap.get(name);
|
||||
regions = manageRegionMap.get(name);
|
||||
}else{
|
||||
regionDO= branchStoreManageMap.get(name);
|
||||
regions= branchStoreManageMap.get(name);
|
||||
}
|
||||
if (Objects.isNull(regionDO)||!Long.valueOf(regionDO.getParentId()).equals(bigRegionDTO.getStoreManageRegionId())){
|
||||
if (CollectionUtils.isEmpty(regions)){
|
||||
log.info("门店所属管理区域未找到 shopId:{}",shopInfoDO.getId());
|
||||
ImportOaOldShopDataErrorDTO errorDTO = new ImportOaOldShopDataErrorDTO(shopInfoDO.getShopCode(), "门店所属管理区域未找到");
|
||||
errorDTO.setShopName(shopInfoDO.getShopName());
|
||||
errorList.add(errorDTO);
|
||||
continue;
|
||||
}
|
||||
for(RegionDO regionDO:regions){
|
||||
if (Long.valueOf(regionDO.getParentId()).equals(bigRegionDTO.getStoreManageRegionId())){
|
||||
shopInfoDO.setManagerRegionId(regionDO.getId());
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (shopInfoDO.getManagerRegionId()==null){
|
||||
log.info("门店所属管理区域未找到 shopId:{}",shopInfoDO.getId());
|
||||
ImportOaOldShopDataErrorDTO errorDTO = new ImportOaOldShopDataErrorDTO(shopInfoDO.getShopCode(), "门店所属管理区域未找到");
|
||||
errorDTO.setShopName(shopInfoDO.getShopName());
|
||||
errorList.add(errorDTO);
|
||||
continue;
|
||||
}
|
||||
updateList.add(shopInfoDO);
|
||||
}
|
||||
shopInfoDAO.updateManagerRegionId(updateList);
|
||||
|
||||
Reference in New Issue
Block a user