修改方法名

This commit is contained in:
joylink_zhangsai 2020-12-15 10:15:37 +08:00
parent 64c6261939
commit d266d3a6bc
9 changed files with 46 additions and 47 deletions

View File

@ -72,7 +72,7 @@ public class CompanyService implements ICompanyService {
@Override @Override
public void addManager(Integer companyId, List<Long> userIds, UserVO user) { public void addManager(Integer companyId, List<Long> userIds, UserVO user) {
iSysUserService.ensureAdmin(user); iSysUserService.confirmAdmin(user);
List<UserCompanyRel> ucrList = getUserCompanyRelEntity(userIds); List<UserCompanyRel> ucrList = getUserCompanyRelEntity(userIds);
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(ucrList.stream().allMatch(ucr -> ucr.getCompanyId().equals(companyId)), BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(ucrList.stream().allMatch(ucr -> ucr.getCompanyId().equals(companyId)),
"有的用户不属于该公司"); "有的用户不属于该公司");
@ -100,8 +100,8 @@ public class CompanyService implements ICompanyService {
@Override @Override
public void superAdminUpdateUserCompanyRel(Long userId, Integer companyId, UserVO superAdmin) { public void superAdminUpdateUserCompanyRel(Long userId, Integer companyId, UserVO superAdmin) {
iSysUserService.ensureSuperAdmin(superAdmin.getId()); iSysUserService.confirmSuperAdmin(superAdmin.getId());
iSysUserService.ensureExist(userId); iSysUserService.confirmExist(userId);
createOrUpdateUserCompanyRel(userId, companyId); createOrUpdateUserCompanyRel(userId, companyId);
} }

View File

@ -1,16 +1,14 @@
package club.joylink.rtss.services; package club.joylink.rtss.services;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import club.joylink.rtss.simulation.cbtc.build.SimulationBuilder;
import club.joylink.rtss.simulation.cbtc.data.CalculateService;
import club.joylink.rtss.simulation.cbtc.data.map.Section;
import club.joylink.rtss.constants.BusinessConsts; import club.joylink.rtss.constants.BusinessConsts;
import club.joylink.rtss.dao.*; import club.joylink.rtss.dao.*;
import club.joylink.rtss.entity.*; import club.joylink.rtss.entity.*;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.draftData.DraftMapFlankProtectionService; import club.joylink.rtss.services.draftData.DraftMapFlankProtectionService;
import club.joylink.rtss.services.draftData.DraftMapRunLevelService; import club.joylink.rtss.services.draftData.DraftMapRunLevelService;
import club.joylink.rtss.simulation.cbtc.build.SimulationBuilder;
import club.joylink.rtss.simulation.cbtc.data.CalculateService;
import club.joylink.rtss.simulation.cbtc.data.map.Section;
import club.joylink.rtss.util.JsonUtils; import club.joylink.rtss.util.JsonUtils;
import club.joylink.rtss.vo.UserVO; import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageQueryVO; import club.joylink.rtss.vo.client.PageQueryVO;
@ -18,13 +16,14 @@ import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.TreeNode; import club.joylink.rtss.vo.client.TreeNode;
import club.joylink.rtss.vo.client.map.*; import club.joylink.rtss.vo.client.map.*;
import club.joylink.rtss.vo.client.map.newmap.*; import club.joylink.rtss.vo.client.map.newmap.*;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
@ -154,7 +153,7 @@ public class DraftMapService implements IDraftMapService {
DraftMapWithBLOBs draftMap = draftMapVo.convert2Draft(); DraftMapWithBLOBs draftMap = draftMapVo.convert2Draft();
draftMap.setAuthorId(userVO.getId()); draftMap.setAuthorId(userVO.getId());
// 名称唯一性校验 // 名称唯一性校验
ensureDraftMapNameNotExist(draftMap); confirmDraftMapNameNotExist(draftMap);
draftMap.setUpdateTime(LocalDateTime.now()); draftMap.setUpdateTime(LocalDateTime.now());
if (draftMap.getDrawWay()) { if (draftMap.getDrawWay()) {
MapGraphDataNewVO graphDataVO = new MapGraphDataNewVO(); MapGraphDataNewVO graphDataVO = new MapGraphDataNewVO();
@ -178,7 +177,7 @@ public class DraftMapService implements IDraftMapService {
upMap.setAuthorId(userVO.getId()); upMap.setAuthorId(userVO.getId());
upMap.setUpdateTime(LocalDateTime.now()); upMap.setUpdateTime(LocalDateTime.now());
// 名称唯一性校验 // 名称唯一性校验
ensureDraftMapNameNotExist(upMap); confirmDraftMapNameNotExist(upMap);
//更改线路的话重置皮肤数据 //更改线路的话重置皮肤数据
String changedLineCode = draftMapVO.getLineCode();//传递的线路code String changedLineCode = draftMapVO.getLineCode();//传递的线路code
if (StringUtils.hasText(changedLineCode) && !Objects.equals(draftMap.getLineCode(), changedLineCode)) { if (StringUtils.hasText(changedLineCode) && !Objects.equals(draftMap.getLineCode(), changedLineCode)) {
@ -204,7 +203,7 @@ public class DraftMapService implements IDraftMapService {
draftMap.setName(name); draftMap.setName(name);
draftMap.setUpdateTime(LocalDateTime.now()); draftMap.setUpdateTime(LocalDateTime.now());
// 名称唯一性校验 // 名称唯一性校验
ensureDraftMapNameNotExist(draftMap); confirmDraftMapNameNotExist(draftMap);
// 插入新副本 // 插入新副本
draftMapDAO.insert(draftMap); draftMapDAO.insert(draftMap);
if (draftMap.getDrawWay()) { if (draftMap.getDrawWay()) {
@ -365,7 +364,7 @@ public class DraftMapService implements IDraftMapService {
draftMap.setName(name); draftMap.setName(name);
draftMap.setAuthorId(userVO.getId()); draftMap.setAuthorId(userVO.getId());
// 名称唯一性校验 // 名称唯一性校验
ensureDraftMapNameNotExist(draftMap); confirmDraftMapNameNotExist(draftMap);
draftMap.setLineCode(mapVO.getLineCode()); draftMap.setLineCode(mapVO.getLineCode());
draftMap.setDrawWay(mapVO.isDrawWay()); draftMap.setDrawWay(mapVO.isDrawWay());
draftMap.setUpdateTime(LocalDateTime.now()); draftMap.setUpdateTime(LocalDateTime.now());
@ -804,7 +803,7 @@ public class DraftMapService implements IDraftMapService {
draftMapDAO.deleteByPrimaryKey(id); draftMapDAO.deleteByPrimaryKey(id);
} }
private void ensureDraftMapNameNotExist(DraftMap map) { private void confirmDraftMapNameNotExist(DraftMap map) {
BusinessExceptionAssertEnum.DATA_UNIQUE_PROPERTY_REPEAT.assertNotTrue(checkDraftMapNameExist(map)); BusinessExceptionAssertEnum.DATA_UNIQUE_PROPERTY_REPEAT.assertNotTrue(checkDraftMapNameExist(map));
} }
@ -1183,14 +1182,14 @@ public class DraftMapService implements IDraftMapService {
@Override @Override
public void createAutoSignal(MapAutoSignalVO autoSignalVO) { public void createAutoSignal(MapAutoSignalVO autoSignalVO) {
ensureAutoSignalNotExist(autoSignalVO, null); confirmAutoSignalNotExist(autoSignalVO, null);
DraftMapAutoSignal autoSignal = autoSignalVO.convert2Draft(); DraftMapAutoSignal autoSignal = autoSignalVO.convert2Draft();
draftMapAutoSignalDAO.insert(autoSignal); draftMapAutoSignalDAO.insert(autoSignal);
} }
@Override @Override
public void createAutoSignal(MapAutoSignalNewVO autoSignalVO) { public void createAutoSignal(MapAutoSignalNewVO autoSignalVO) {
ensureAutoSignalNotExist(autoSignalVO, null); confirmAutoSignalNotExist(autoSignalVO, null);
DraftMapAutoSignal autoSignal = autoSignalVO.convert2Draft(); DraftMapAutoSignal autoSignal = autoSignalVO.convert2Draft();
draftMapAutoSignalDAO.insert(autoSignal); draftMapAutoSignalDAO.insert(autoSignal);
} }
@ -1252,7 +1251,7 @@ public class DraftMapService implements IDraftMapService {
@Override @Override
public void updateAutoSignal(Long autoSignalId, MapAutoSignalVO autoSignalVO) { public void updateAutoSignal(Long autoSignalId, MapAutoSignalVO autoSignalVO) {
getDraftMapAutoSignalEntity(autoSignalId); getDraftMapAutoSignalEntity(autoSignalId);
ensureAutoSignalNotExist(autoSignalVO, autoSignalId); confirmAutoSignalNotExist(autoSignalVO, autoSignalId);
DraftMapAutoSignal newAutoSignal = autoSignalVO.convert2Draft(); DraftMapAutoSignal newAutoSignal = autoSignalVO.convert2Draft();
newAutoSignal.setId(autoSignalId); newAutoSignal.setId(autoSignalId);
draftMapAutoSignalDAO.updateByPrimaryKeyWithBLOBs(newAutoSignal); draftMapAutoSignalDAO.updateByPrimaryKeyWithBLOBs(newAutoSignal);
@ -1261,7 +1260,7 @@ public class DraftMapService implements IDraftMapService {
@Override @Override
public void updateAutoSignal(Long autoSignalId, MapAutoSignalNewVO autoSignalVO) { public void updateAutoSignal(Long autoSignalId, MapAutoSignalNewVO autoSignalVO) {
getDraftMapAutoSignalEntity(autoSignalId); getDraftMapAutoSignalEntity(autoSignalId);
ensureAutoSignalNotExist(autoSignalVO, autoSignalId); confirmAutoSignalNotExist(autoSignalVO, autoSignalId);
DraftMapAutoSignal newAutoSignal = autoSignalVO.convert2Draft(); DraftMapAutoSignal newAutoSignal = autoSignalVO.convert2Draft();
newAutoSignal.setId(autoSignalId); newAutoSignal.setId(autoSignalId);
draftMapAutoSignalDAO.updateByPrimaryKeyWithBLOBs(newAutoSignal); draftMapAutoSignalDAO.updateByPrimaryKeyWithBLOBs(newAutoSignal);
@ -1292,7 +1291,7 @@ public class DraftMapService implements IDraftMapService {
return !CollectionUtils.isEmpty(draftMapAutoSignals); return !CollectionUtils.isEmpty(draftMapAutoSignals);
} }
private void ensureAutoSignalNotExist(MapAutoSignalVO mapAutoSignalVO, Long autoSignalId) { private void confirmAutoSignalNotExist(MapAutoSignalVO mapAutoSignalVO, Long autoSignalId) {
BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertNotTrue(ifAutoSignalExist(mapAutoSignalVO, autoSignalId)); BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertNotTrue(ifAutoSignalExist(mapAutoSignalVO, autoSignalId));
} }
@ -1308,7 +1307,7 @@ public class DraftMapService implements IDraftMapService {
return !CollectionUtils.isEmpty(draftMapAutoSignals); return !CollectionUtils.isEmpty(draftMapAutoSignals);
} }
private void ensureAutoSignalNotExist(MapAutoSignalNewVO mapAutoSignalVO, Long autoSignalId) { private void confirmAutoSignalNotExist(MapAutoSignalNewVO mapAutoSignalVO, Long autoSignalId) {
BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertNotTrue(ifAutoSignalExist(mapAutoSignalVO, autoSignalId)); BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertNotTrue(ifAutoSignalExist(mapAutoSignalVO, autoSignalId));
} }
/*------------ AutoSignal END ---------------------*/ /*------------ AutoSignal END ---------------------*/
@ -1318,7 +1317,7 @@ public class DraftMapService implements IDraftMapService {
@Override @Override
public void createRoute(MapRouteVO routeVO) { public void createRoute(MapRouteVO routeVO) {
// 编号唯一校验 // 编号唯一校验
ensureRouteNotExist(routeVO.getMapId(), routeVO.getCode()); confirmRouteNotExist(routeVO.getMapId(), routeVO.getCode());
// 保存进路信息 // 保存进路信息
DraftMapRoute route = routeVO.convert2Draft(); DraftMapRoute route = routeVO.convert2Draft();
draftMapRouteDAO.insert(route); draftMapRouteDAO.insert(route);
@ -1327,7 +1326,7 @@ public class DraftMapService implements IDraftMapService {
@Override @Override
public void createRoute(MapRouteNewVO routeVO) { public void createRoute(MapRouteNewVO routeVO) {
// 编号唯一校验 // 编号唯一校验
ensureRouteNotExist(routeVO.getMapId(), routeVO.getCode()); confirmRouteNotExist(routeVO.getMapId(), routeVO.getCode());
// 保存进路信息 // 保存进路信息
DraftMapRoute route = routeVO.convert2Draft(); DraftMapRoute route = routeVO.convert2Draft();
draftMapRouteDAO.insert(route); draftMapRouteDAO.insert(route);
@ -1429,7 +1428,7 @@ public class DraftMapService implements IDraftMapService {
@Override @Override
public void createOverlap(MapOverlapVO mapOverlapVO) { public void createOverlap(MapOverlapVO mapOverlapVO) {
if (StringUtils.hasText(mapOverlapVO.getName())) { if (StringUtils.hasText(mapOverlapVO.getName())) {
ensureOverlapNameNotRepeat(mapOverlapVO); confirmOverlapNameNotRepeat(mapOverlapVO);
} }
DraftMapOverlap draftMapOverlap = mapOverlapVO.convert2Draft(); DraftMapOverlap draftMapOverlap = mapOverlapVO.convert2Draft();
this.draftMapOverlapDAO.insert(draftMapOverlap); this.draftMapOverlapDAO.insert(draftMapOverlap);
@ -1476,7 +1475,7 @@ public class DraftMapService implements IDraftMapService {
/*------------autoReentry start ---------------------*/ /*------------autoReentry start ---------------------*/
@Override @Override
public void createAutoReentry(MapAutoReentryVO mapAutoReentryVO) { public void createAutoReentry(MapAutoReentryVO mapAutoReentryVO) {
ensureAutoReentryNotExist(mapAutoReentryVO); confirmAutoReentryNotExist(mapAutoReentryVO);
DraftMapAutoReentry draftMapAutoReentry = mapAutoReentryVO.convert2Draft(); DraftMapAutoReentry draftMapAutoReentry = mapAutoReentryVO.convert2Draft();
this.draftMapAutoReentryDAO.insert(draftMapAutoReentry); this.draftMapAutoReentryDAO.insert(draftMapAutoReentry);
} }
@ -1988,7 +1987,7 @@ public class DraftMapService implements IDraftMapService {
return autoSignal; return autoSignal;
} }
private void ensureRouteNotExist(Long mapId, String code) { private void confirmRouteNotExist(Long mapId, String code) {
DraftMapRouteExample example = new DraftMapRouteExample(); DraftMapRouteExample example = new DraftMapRouteExample();
example.createCriteria().andMapIdEqualTo(mapId).andCodeEqualTo(code); example.createCriteria().andMapIdEqualTo(mapId).andCodeEqualTo(code);
BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertTrue(draftMapRouteDAO.countByExample(example) == 0); BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertTrue(draftMapRouteDAO.countByExample(example) == 0);
@ -2004,7 +2003,7 @@ public class DraftMapService implements IDraftMapService {
return route; return route;
} }
private void ensureOverlapNameNotRepeat(MapOverlapVO mapOverlapVO) { private void confirmOverlapNameNotRepeat(MapOverlapVO mapOverlapVO) {
DraftMapOverlapExample example = new DraftMapOverlapExample(); DraftMapOverlapExample example = new DraftMapOverlapExample();
example.createCriteria() example.createCriteria()
.andMapIdEqualTo(mapOverlapVO.getMapId()) .andMapIdEqualTo(mapOverlapVO.getMapId())
@ -2023,7 +2022,7 @@ public class DraftMapService implements IDraftMapService {
return draftMapOverlap; return draftMapOverlap;
} }
private void ensureAutoReentryNotExist(MapAutoReentryVO mapAutoReentryVO) { private void confirmAutoReentryNotExist(MapAutoReentryVO mapAutoReentryVO) {
DraftMapAutoReentryExample example = new DraftMapAutoReentryExample(); DraftMapAutoReentryExample example = new DraftMapAutoReentryExample();
example.createCriteria() example.createCriteria()
.andMapIdEqualTo(mapAutoReentryVO.getMapId()) .andMapIdEqualTo(mapAutoReentryVO.getMapId())

View File

@ -221,7 +221,7 @@ public class GoodsService implements IGoodsService {
* 如果要更新的商品不存在报DBException数据不存在 * 如果要更新的商品不存在报DBException数据不存在
*/ */
public void updateGoods(Long id, GoodsUpdateVO updateVO, UserVO user) { public void updateGoods(Long id, GoodsUpdateVO updateVO, UserVO user) {
ensureExist(id); confirmExist(id);
SaleGoods goods = updateVO.convert2DB(); SaleGoods goods = updateVO.convert2DB();
goods.setId(id); goods.setId(id);
goods.setUpdateUserId(user.getId()); goods.setUpdateUserId(user.getId());
@ -230,7 +230,7 @@ public class GoodsService implements IGoodsService {
saleGoodsDAO.updateByPrimaryKeySelective(goods); saleGoodsDAO.updateByPrimaryKeySelective(goods);
} }
private void ensureExist(Long id) { private void confirmExist(Long id) {
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotTrue(isExist(id), BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotTrue(isExist(id),
String.format("id为[%s]的商品不存在", id)); String.format("id为[%s]的商品不存在", id));
} }

View File

@ -83,7 +83,7 @@ public interface ISysUserService {
/** /**
* 确认用户是管理员否则报错 * 确认用户是管理员否则报错
*/ */
void ensureAdmin(UserVO user); void confirmAdmin(UserVO user);
/** /**
* 根据地图id查询订阅人员 * 根据地图id查询订阅人员
@ -253,9 +253,9 @@ public interface ISysUserService {
boolean isSuperAdmin(Long id); boolean isSuperAdmin(Long id);
/** /**
* 是超管 * 认用户是超管
*/ */
void ensureSuperAdmin(Long userId); void confirmSuperAdmin(Long userId);
boolean isExist(Long id); boolean isExist(Long id);
@ -286,9 +286,9 @@ public interface ISysUserService {
List<SysUser> findEntity(List<Long> ids); List<SysUser> findEntity(List<Long> ids);
/** /**
* 该用户存在 * 该用户存在
*/ */
void ensureExist(Long id); void confirmExist(Long id);
void superAdminUpdateUserInfo(UserVO updateUser, UserVO superAdmin); void superAdminUpdateUserInfo(UserVO updateUser, UserVO superAdmin);

View File

@ -248,7 +248,7 @@ public class LearnService implements ILearnService {
@Override @Override
public void adminDeleteComment(Long commentId, UserVO user) { public void adminDeleteComment(Long commentId, UserVO user) {
iSysUserService.ensureAdmin(user); iSysUserService.confirmAdmin(user);
learnCommentDAO.deleteByPrimaryKey(commentId); learnCommentDAO.deleteByPrimaryKey(commentId);
} }
@ -288,7 +288,7 @@ public class LearnService implements ILearnService {
@Override @Override
public void adminDeleteMessage(Long messageId, UserVO user) { public void adminDeleteMessage(Long messageId, UserVO user) {
iSysUserService.ensureAdmin(user); iSysUserService.confirmAdmin(user);
deleteMessage(messageId); deleteMessage(messageId);
} }
@ -359,7 +359,7 @@ public class LearnService implements ILearnService {
} }
private LearnPost topCheck(Long postId, UserVO userVO) { private LearnPost topCheck(Long postId, UserVO userVO) {
iSysUserService.ensureAdmin(userVO); iSysUserService.confirmAdmin(userVO);
LearnPost post = getPostEntity(postId); LearnPost post = getPostEntity(postId);
return post; return post;
} }

View File

@ -314,7 +314,7 @@ public class MapService implements IMapService {
public void onLine(Long id, UserVO userVO) { public void onLine(Long id, UserVO userVO) {
// 判断地图数据是否存在 // 判断地图数据是否存在
MapInfo map = getMapInfoEntity(id); MapInfo map = getMapInfoEntity(id);
iSysUserService.ensureAdmin(userVO); iSysUserService.confirmAdmin(userVO);
map.setStatus(MapStatus.Online.getCode()); map.setStatus(MapStatus.Online.getCode());
mapInfoDAO.updateByPrimaryKey(map); mapInfoDAO.updateByPrimaryKey(map);
} }
@ -334,7 +334,7 @@ public class MapService implements IMapService {
public void offLine(Long id, UserVO userVO) { public void offLine(Long id, UserVO userVO) {
// 判断地图数据是否存在 // 判断地图数据是否存在
MapInfo map = getMapInfoEntity(id); MapInfo map = getMapInfoEntity(id);
iSysUserService.ensureAdmin(userVO); iSysUserService.confirmAdmin(userVO);
map.setStatus(MapStatus.Offline.getCode()); map.setStatus(MapStatus.Offline.getCode());
mapInfoDAO.updateByPrimaryKey(map); mapInfoDAO.updateByPrimaryKey(map);
} }
@ -516,7 +516,7 @@ public class MapService implements IMapService {
@Override @Override
public void updateName(Long id, String name, UserVO userVO) { public void updateName(Long id, String name, UserVO userVO) {
iSysUserService.ensureAdmin(userVO); iSysUserService.confirmAdmin(userVO);
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotTrue(isNameExistExcept(name, id)); BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotTrue(isNameExistExcept(name, id));
MapInfo map = getMapInfoEntity(id); MapInfo map = getMapInfoEntity(id);
map.setName(name); map.setName(name);
@ -525,7 +525,7 @@ public class MapService implements IMapService {
@Override @Override
public void updateBelongCity(Long id, String cityCode, UserVO user) { public void updateBelongCity(Long id, String cityCode, UserVO user) {
iSysUserService.ensureAdmin(user); iSysUserService.confirmAdmin(user);
MapInfo mapInfo = findMapInfoEntity(id); MapInfo mapInfo = findMapInfoEntity(id);
if (Objects.nonNull(mapInfo)) { if (Objects.nonNull(mapInfo)) {
mapInfo.setCityCode(cityCode); mapInfo.setCityCode(cityCode);

View File

@ -258,7 +258,7 @@ public class MapSystemService implements IMapSystemService {
@Override @Override
public void delete(Long id, UserVO userVO) { public void delete(Long id, UserVO userVO) {
iSysUserService.ensureAdmin(userVO); iSysUserService.confirmAdmin(userVO);
mapSystemDAO.deleteByPrimaryKey(id); mapSystemDAO.deleteByPrimaryKey(id);
} }

View File

@ -663,7 +663,7 @@ public class PermissionDistributeService implements IPermissionDistributeService
@Override @Override
public String createAllMapDistribute(Project project, Integer num, UserVO user) { public String createAllMapDistribute(Project project, Integer num, UserVO user) {
iSysUserService.ensureAdmin(user); iSysUserService.confirmAdmin(user);
List<MapVO> maps = iMapService.queryOnlineMapInfoListOfProject(project); List<MapVO> maps = iMapService.queryOnlineMapInfoListOfProject(project);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(maps, BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(maps,
String.format("项目[%s]下没有地图", project)); String.format("项目[%s]下没有地图", project));

View File

@ -263,7 +263,7 @@ public class SysUserService implements ISysUserService {
} }
@Override @Override
public void ensureAdmin(UserVO user) { public void confirmAdmin(UserVO user) {
BusinessExceptionAssertEnum.INSUFFICIENT_PERMISSIONS.assertTrue(isAdmin(user)); BusinessExceptionAssertEnum.INSUFFICIENT_PERMISSIONS.assertTrue(isAdmin(user));
} }
@ -275,7 +275,7 @@ public class SysUserService implements ISysUserService {
} }
@Override @Override
public void ensureSuperAdmin(Long userId) { public void confirmSuperAdmin(Long userId) {
BusinessExceptionAssertEnum.INSUFFICIENT_PERMISSIONS.assertTrue(isSuperAdmin(userId)); BusinessExceptionAssertEnum.INSUFFICIENT_PERMISSIONS.assertTrue(isSuperAdmin(userId));
} }
@ -721,7 +721,7 @@ public class SysUserService implements ISysUserService {
} }
@Override @Override
public void ensureExist(Long id) { public void confirmExist(Long id) {
getEntity(id); getEntity(id);
} }