ONLY_WAR_REGION_CONFIG
This commit is contained in:
@@ -135,6 +135,7 @@ public enum ErrorCodeEnum {
|
|||||||
OPEN_AREA_IS_NOT_EXISTS(107006, "意向区域城市不存在", null),
|
OPEN_AREA_IS_NOT_EXISTS(107006, "意向区域城市不存在", null),
|
||||||
|
|
||||||
REGION_NOT_EXIST(108001, "区域不存在",null),
|
REGION_NOT_EXIST(108001, "区域不存在",null),
|
||||||
|
ONLY_WAR_REGION_CONFIG(108002, "意向省市只能配置到战区",null),
|
||||||
|
|
||||||
NOT_APPROVE_NODE(109001, "不是审批节点",null),
|
NOT_APPROVE_NODE(109001, "不是审批节点",null),
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -117,7 +117,8 @@
|
|||||||
region_type as regionType,
|
region_type as regionType,
|
||||||
region_path as regionPath,
|
region_path as regionPath,
|
||||||
deleted,
|
deleted,
|
||||||
store_num as storeNum
|
store_num as storeNum,
|
||||||
|
third_region_type as thirdRegionType
|
||||||
from region_${enterpriseId}
|
from region_${enterpriseId}
|
||||||
where id = #{regionId}
|
where id = #{regionId}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.cool.store.dao.RegionDao;
|
|||||||
import com.cool.store.entity.RegionAreaConfigDO;
|
import com.cool.store.entity.RegionAreaConfigDO;
|
||||||
import com.cool.store.entity.RegionDO;
|
import com.cool.store.entity.RegionDO;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.enums.ThirdRegionTypeEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.request.RegionAreaConfigAddRequest;
|
import com.cool.store.request.RegionAreaConfigAddRequest;
|
||||||
import com.cool.store.service.RegionAreaConfigService;
|
import com.cool.store.service.RegionAreaConfigService;
|
||||||
@@ -40,6 +41,9 @@ public class RegionAreaConfigServiceImpl implements RegionAreaConfigService {
|
|||||||
if(regionDO == null){
|
if(regionDO == null){
|
||||||
throw new ServiceException(ErrorCodeEnum.REGION_NOT_EXIST);
|
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();
|
List<Long> areaIdList = regionAreaConfigAddRequest.getAreaIdList();
|
||||||
if(CollectionUtils.isEmpty(areaIdList)){
|
if(CollectionUtils.isEmpty(areaIdList)){
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
|
|||||||
Reference in New Issue
Block a user