|
@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fs.app.vo.FsAppRoleVO;
|
|
import com.fs.app.vo.FsAppRoleVO;
|
|
|
|
|
+import com.fs.common.exception.CustomException;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
import com.fs.common.utils.DateUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
@@ -19,6 +20,7 @@ import org.springframework.stereotype.Service;
|
|
|
import com.fs.app.mapper.FsAppRoleMapper;
|
|
import com.fs.app.mapper.FsAppRoleMapper;
|
|
|
import com.fs.app.domain.FsAppRole;
|
|
import com.fs.app.domain.FsAppRole;
|
|
|
import com.fs.app.service.IFsAppRoleService;
|
|
import com.fs.app.service.IFsAppRoleService;
|
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -102,9 +104,16 @@ public class FsAppRoleServiceImpl extends ServiceImpl<FsAppRoleMapper, FsAppRole
|
|
|
* @param param APP角色
|
|
* @param param APP角色
|
|
|
* @return 结果
|
|
* @return 结果
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @Transactional
|
|
|
@Override
|
|
@Override
|
|
|
public int insertFsAppRole(FsAppRoleVO param)
|
|
public int insertFsAppRole(FsAppRoleVO param)
|
|
|
{
|
|
{
|
|
|
|
|
+ FsAppRole query = new FsAppRole();
|
|
|
|
|
+ query.setRoleLevel(param.getRoleLevel());
|
|
|
|
|
+ List<FsAppRole> fsAppRoles = fsAppRoleMapper.selectFsAppRoleList(query);
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(fsAppRoles)) {
|
|
|
|
|
+ throw new CustomException("角色的等级:"+param.getRoleLevel()+"已存在");
|
|
|
|
|
+ }
|
|
|
FsAppRole fsAppRole = new FsAppRole();
|
|
FsAppRole fsAppRole = new FsAppRole();
|
|
|
BeanUtils.copyProperties(param, fsAppRole);
|
|
BeanUtils.copyProperties(param, fsAppRole);
|
|
|
fsAppRole.setCreateTime(DateUtils.getNowDate());
|
|
fsAppRole.setCreateTime(DateUtils.getNowDate());
|