数据处理
This commit is contained in:
@@ -325,7 +325,7 @@ public class ShopInfoDAO {
|
||||
Example example = new Example(ShopInfoDO.class);
|
||||
example.createCriteria().
|
||||
andNotIn("id", isCreateShopIds).andNotEqualTo("shopStatus", 2).andEqualTo("deleted", false)
|
||||
.andNotEqualTo("region_id",459);
|
||||
.andNotEqualTo("regionId",459);
|
||||
return shopInfoMapper.selectByExample(example);
|
||||
}
|
||||
public Integer updateManagerRegionId(List<ShopInfoDO> shopList){
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
<select id="queryAllBigRegion" resultType="com.cool.store.dto.region.BigRegionDTO">
|
||||
select DISTINCT
|
||||
region_id as regionId,
|
||||
region_name as regionName
|
||||
region_name as regionName,
|
||||
group_name as groupName
|
||||
FROM `xfsg_big_region`
|
||||
<where>
|
||||
<if test="keyword!=null and keyword !=''">
|
||||
|
||||
@@ -545,10 +545,10 @@
|
||||
</select>
|
||||
<select id="selectIsCreateStore" resultType="com.cool.store.dto.IsCreateStoreDTO">
|
||||
|
||||
SELECT a.id as shopId, c.parent_id as `pid`
|
||||
SELECT a.shop_name as shopName,a.id as shopId, c.id as `pid`,c.name as pidName
|
||||
FROM xfsg_shop_info a
|
||||
LEFT JOIN store_214ac5a3a517472a87268e02a2e6410a b ON a.shop_code = b.store_num
|
||||
LEFT JOIN `region_214ac5a3a517472a87268e02a2e6410a` c on b.region_id = c.`id`
|
||||
LEFT JOIN store_${enterpriseId} b ON a.shop_code = b.store_num
|
||||
LEFT JOIN region_${enterpriseId} c on b.region_id = c.`id`
|
||||
WHERE b.store_num is not null
|
||||
and a.shop_code is not null
|
||||
and a.deleted =0
|
||||
|
||||
@@ -16,10 +16,14 @@ public class ImportOaOldShopDataErrorDTO {
|
||||
@ExcelProperty(value = "门店编码", order = 1)
|
||||
@ColumnWidth(30)
|
||||
private String shopCode;
|
||||
@ExcelProperty(value = "错误原因", order = 2)
|
||||
@ExcelProperty(value = "门店", order = 2)
|
||||
@ColumnWidth(30)
|
||||
private String shopName;
|
||||
@ExcelProperty(value = "错误原因", order =3)
|
||||
@ColumnWidth(40)
|
||||
private String errorReason;
|
||||
|
||||
|
||||
public ImportOaOldShopDataErrorDTO() {
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import lombok.Data;
|
||||
@Data
|
||||
public class IsCreateStoreDTO {
|
||||
|
||||
private String shopName;
|
||||
|
||||
private Long shopId;
|
||||
|
||||
private Long pid;
|
||||
|
||||
@@ -1155,9 +1155,10 @@ public class DataHandlerServerImpl implements DataHandlerServer {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void dataHandlerCreateStore() {
|
||||
//已经创建了的门店
|
||||
List<IsCreateStoreDTO> isCreateStore = shopInfoDAO.selectIsCreateStore();
|
||||
List<IsCreateStoreDTO> isCreateStore = shopInfoDAO.selectIsCreateStore( );
|
||||
List<ShopInfoDO> updateList = new ArrayList<>();
|
||||
for (IsCreateStoreDTO isCreateStoreDTO:isCreateStore){
|
||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
||||
@@ -1191,11 +1192,19 @@ public class DataHandlerServerImpl implements DataHandlerServer {
|
||||
if (StringUtils.isBlank(name)){
|
||||
log.info("门店招商经理未找到 shopId:{}",shopInfoDO.getId());
|
||||
ImportOaOldShopDataErrorDTO errorDTO = new ImportOaOldShopDataErrorDTO(shopInfoDO.getShopCode(), "门店招商经理未找到");
|
||||
errorDTO.setShopName(shopInfoDO.getShopName());
|
||||
errorList.add(errorDTO);
|
||||
continue;
|
||||
}
|
||||
BigRegionDTO bigRegionDTO = bigRegionDTOMap.get(shopInfoDO.getId());
|
||||
BigRegionDTO bigRegionDTO = bigRegionDTOMap.get(shopInfoDO.getRegionId());
|
||||
RegionDO regionDO;
|
||||
if (bigRegionDTO==null){
|
||||
log.info("门店所属大区未找到 shopId:{}",shopInfoDO.getId());
|
||||
ImportOaOldShopDataErrorDTO errorDTO = new ImportOaOldShopDataErrorDTO(shopInfoDO.getShopCode(), "门店所属大区未找到");
|
||||
errorDTO.setShopName(shopInfoDO.getShopName());
|
||||
errorList.add(errorDTO);
|
||||
continue;
|
||||
}
|
||||
if (bigRegionDTO.getStoreManageRegionId()==null){
|
||||
regionDO = manageRegionMap.get(name);
|
||||
}else{
|
||||
@@ -1204,6 +1213,7 @@ public class DataHandlerServerImpl implements DataHandlerServer {
|
||||
if (Objects.isNull(regionDO)){
|
||||
log.info("门店所属管理区域未找到 shopId:{}",shopInfoDO.getId());
|
||||
ImportOaOldShopDataErrorDTO errorDTO = new ImportOaOldShopDataErrorDTO(shopInfoDO.getShopCode(), "门店所属管理区域未找到");
|
||||
errorDTO.setShopName(shopInfoDO.getShopName());
|
||||
errorList.add(errorDTO);
|
||||
continue;
|
||||
}
|
||||
@@ -1224,8 +1234,8 @@ public class DataHandlerServerImpl implements DataHandlerServer {
|
||||
importTaskDO.setFileName("同步门店数据错误列表");
|
||||
importTaskDO.setFileType(FileTypeEnum.IMPORT_FITMENT_SHOP_STAGE.getFileType());
|
||||
importTaskDO.setIsImport(true);
|
||||
importTaskDO.setFileType(url);
|
||||
importTaskDO.setStatus(ImportTaskStatusEnum.PROGRESS.getCode());
|
||||
importTaskDO.setFileUrl(url);
|
||||
importTaskDO.setStatus(ImportTaskStatusEnum.ERROR.getCode());
|
||||
importTaskDO.setCreateUserId(CurrentUserHolder.getUserId());
|
||||
importTaskDO.setCreateName(CurrentUserHolder.getUser().getName());
|
||||
importTaskDO.setCreateTime(System.currentTimeMillis());
|
||||
|
||||
Reference in New Issue
Block a user