ONLY_WAR_REGION_CONFIG

This commit is contained in:
wangxiaopeng
2024-04-09 15:32:47 +08:00
parent bbc1b10011
commit 5ceb6371b9
3 changed files with 7 additions and 1 deletions

View File

@@ -135,6 +135,7 @@ public enum ErrorCodeEnum {
OPEN_AREA_IS_NOT_EXISTS(107006, "意向区域城市不存在", null),
REGION_NOT_EXIST(108001, "区域不存在",null),
ONLY_WAR_REGION_CONFIG(108002, "意向省市只能配置到战区",null),
NOT_APPROVE_NODE(109001, "不是审批节点",null),
;

View File

@@ -117,7 +117,8 @@
region_type as regionType,
region_path as regionPath,
deleted,
store_num as storeNum
store_num as storeNum,
third_region_type as thirdRegionType
from region_${enterpriseId}
where id = #{regionId}
</select>

View File

@@ -6,6 +6,7 @@ import com.cool.store.dao.RegionDao;
import com.cool.store.entity.RegionAreaConfigDO;
import com.cool.store.entity.RegionDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.ThirdRegionTypeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.RegionAreaConfigAddRequest;
import com.cool.store.service.RegionAreaConfigService;
@@ -40,6 +41,9 @@ public class RegionAreaConfigServiceImpl implements RegionAreaConfigService {
if(regionDO == null){
throw new ServiceException(ErrorCodeEnum.REGION_NOT_EXIST);
}
if(!ThirdRegionTypeEnum.WAR_REGION.getCode().equals(regionDO.getThirdRegionType())){
throw new ServiceException(ErrorCodeEnum.ONLY_WAR_REGION_CONFIG);
}
List<Long> areaIdList = regionAreaConfigAddRequest.getAreaIdList();
if(CollectionUtils.isEmpty(areaIdList)){
return Boolean.TRUE;