Commit 9acad680 authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.修改系统首页大屏总览接口,增加区分组织机构逻辑,完成接口冒烟测试;
2.修改系统首页获取井场列表接口,增加区分组织机构逻辑,完成接口冒烟测试;
3.修改系统首页井场功能下钻后提示报错问题,修改用电功率数据获取逻辑,修复报错问题;
4.修改输电线路分页列表查询接口,增加查询条件,在查询父线路列表时只查询10千伏线路,修改线上接口文档同时完成接口冒烟测试;
5.修改系统首页井场实时监控接口,增加区分组织机构逻辑,完成接口冒烟测试;
6.修改系统首页用能分析接口,增加区分组织机构逻辑,完成接口冒烟测试;
7.修改系统首页井场用能分析(双坐标轴)接口,增加区分组织机构逻辑,完成接口冒烟测试;
8.修改系统首页累积用电接口,增加区分组织机构逻辑,完成接口冒烟测试;
9.修改系统首页光伏实时监控接口,增加区分组织机构逻辑,完成接口冒烟测试;
10.修改系统首页井场效果评价接口,增加区分组织机构逻辑,完成接口冒烟测试;
11.修改系统首页先导实验井间开制度接口,增加区分组织机构逻辑,完成接口冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent bc2fff75
...@@ -41,7 +41,7 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService { ...@@ -41,7 +41,7 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService {
list = new ArrayList<>(); list = new ArrayList<>();
SysDictionaryCache.set(context, input.getAlias(), list); SysDictionaryCache.set(context, input.getAlias(), list);
//查询alias字典 //查询alias字典
QueryWrapper<SysDictionaryEnt> query = new QueryWrapper(); QueryWrapper<SysDictionaryEnt> query = new QueryWrapper<>();
query.lambda().eq(SysDictionaryEnt::getAlias, input.getAlias()).gt(SysDictionaryEnt::getEndTime, new Date()); query.lambda().eq(SysDictionaryEnt::getAlias, input.getAlias()).gt(SysDictionaryEnt::getEndTime, new Date());
SysDictionaryEnt sysDictionary = mapper.selectOne(query); SysDictionaryEnt sysDictionary = mapper.selectOne(query);
if (ObjectUtils.isNotEmpty(sysDictionary)) { if (ObjectUtils.isNotEmpty(sysDictionary)) {
...@@ -49,7 +49,7 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService { ...@@ -49,7 +49,7 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService {
XCopyUtils.copyObject(sysDictionary, sysDictionaryCache); XCopyUtils.copyObject(sysDictionary, sysDictionaryCache);
list.add(sysDictionaryCache); list.add(sysDictionaryCache);
//查询alias字典下级字典项 //查询alias字典下级字典项
QueryWrapper<SysDictionaryEnt> queryItems = new QueryWrapper(); QueryWrapper<SysDictionaryEnt> queryItems = new QueryWrapper<>();
if (ObjectUtils.isNotEmpty(sysDictionary.getIsOrg()) && sysDictionary.getIsOrg() == 1) { if (ObjectUtils.isNotEmpty(sysDictionary.getIsOrg()) && sysDictionary.getIsOrg() == 1) {
//查询当前登录人的组织机构层级路径 //查询当前登录人的组织机构层级路径
QueryWrapper<SysOrganizationRelEnt> queryOrgRel = new QueryWrapper<>(); QueryWrapper<SysOrganizationRelEnt> queryOrgRel = new QueryWrapper<>();
...@@ -57,7 +57,7 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService { ...@@ -57,7 +57,7 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService {
.gt(SysOrganizationRelEnt::getEndTime, new Date()); .gt(SysOrganizationRelEnt::getEndTime, new Date());
SysOrganizationRelEnt sysOrganizationRelEnt = orgRelMapper.selectOne(queryOrgRel); SysOrganizationRelEnt sysOrganizationRelEnt = orgRelMapper.selectOne(queryOrgRel);
//根据字典id查询 //根据字典id查询
QueryWrapper<SysOrganizationDictionaryEnt> queryOrgDic = new QueryWrapper(); QueryWrapper<SysOrganizationDictionaryEnt> queryOrgDic = new QueryWrapper<>();
queryOrgDic.lambda().eq(SysOrganizationDictionaryEnt::getParentDicCode, sysDictionary.getId()) queryOrgDic.lambda().eq(SysOrganizationDictionaryEnt::getParentDicCode, sysDictionary.getId())
.gt(SysOrganizationDictionaryEnt::getEndTime, new Date()); .gt(SysOrganizationDictionaryEnt::getEndTime, new Date());
List<SysOrganizationDictionaryEnt> sysOrganizationDictionaryEnts = orgDicmapper.selectList(queryOrgDic); List<SysOrganizationDictionaryEnt> sysOrganizationDictionaryEnts = orgDicmapper.selectList(queryOrgDic);
...@@ -105,7 +105,7 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService { ...@@ -105,7 +105,7 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService {
.gt(SysOrganizationRelEnt::getEndTime, new Date()); .gt(SysOrganizationRelEnt::getEndTime, new Date());
SysOrganizationRelEnt sysOrganizationRelEnt = orgRelMapper.selectOne(queryOrgRel); SysOrganizationRelEnt sysOrganizationRelEnt = orgRelMapper.selectOne(queryOrgRel);
//根据字典id查询 //根据字典id查询
QueryWrapper<SysOrganizationDictionaryEnt> queryOrgDic = new QueryWrapper(); QueryWrapper<SysOrganizationDictionaryEnt> queryOrgDic = new QueryWrapper<>();
queryOrgDic.lambda().eq(SysOrganizationDictionaryEnt::getParentDicCode, sysDictionaryEnt.getId()) queryOrgDic.lambda().eq(SysOrganizationDictionaryEnt::getParentDicCode, sysDictionaryEnt.getId())
.gt(SysOrganizationDictionaryEnt::getEndTime, new Date()); .gt(SysOrganizationDictionaryEnt::getEndTime, new Date());
List<SysOrganizationDictionaryEnt> sysOrganizationDictionaryEnts = orgDicmapper.selectList(queryOrgDic); List<SysOrganizationDictionaryEnt> sysOrganizationDictionaryEnts = orgDicmapper.selectList(queryOrgDic);
......
...@@ -359,7 +359,7 @@ public class SysMenuService { ...@@ -359,7 +359,7 @@ public class SysMenuService {
SysMenuViewMapper viewMapper = context.getBean(SysMenuViewMapper.class); SysMenuViewMapper viewMapper = context.getBean(SysMenuViewMapper.class);
List<SysMenuView> childList = viewMapper.selectCountByParentMenuIds(parentIds); List<SysMenuView> childList = viewMapper.selectCountByParentMenuIds(parentIds);
Map<String, List<SysMenuView>> groupChildList = childList.stream().collect(Collectors.groupingBy(SysMenuView::getParentMenuId)); Map<String, List<SysMenuView>> groupChildList = childList.stream().collect(Collectors.groupingBy(SysMenuView::getParentMenuId));
list.stream().forEach(item -> { list.forEach(item -> {
if (groupChildList.get(item.getId()) == null) { if (groupChildList.get(item.getId()) == null) {
item.setChildren(null); item.setChildren(null);
item.setIsHasChildren(0); item.setIsHasChildren(0);
......
...@@ -58,7 +58,7 @@ public class SysOrganizationDictionaryService { ...@@ -58,7 +58,7 @@ public class SysOrganizationDictionaryService {
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }
QueryWrapper<SysOrganizationDictionaryEnt> query = new QueryWrapper(); QueryWrapper<SysOrganizationDictionaryEnt> query = new QueryWrapper<>();
query.lambda().eq(SysOrganizationDictionaryEnt::getOuId, input.getOuId()).gt(SysOrganizationDictionaryEnt::getEndTime, new Date()); query.lambda().eq(SysOrganizationDictionaryEnt::getOuId, input.getOuId()).gt(SysOrganizationDictionaryEnt::getEndTime, new Date());
List<SysOrganizationDictionaryEnt> list = mapper.selectList(query); List<SysOrganizationDictionaryEnt> list = mapper.selectList(query);
/*List<SysOrganizationDictionaryEnt> delList = new ArrayList<>(); /*List<SysOrganizationDictionaryEnt> delList = new ArrayList<>();
...@@ -90,7 +90,7 @@ public class SysOrganizationDictionaryService { ...@@ -90,7 +90,7 @@ public class SysOrganizationDictionaryService {
mapper.updateById(obj); mapper.updateById(obj);
} }
List<SysDictionaryView> dataList = input.getItems(); List<SysDictionaryView> dataList = input.getItems();
if (dataList != null && dataList.size() > 0) { if (dataList != null && !dataList.isEmpty()) {
for (SysDictionaryView view : dataList) { for (SysDictionaryView view : dataList) {
SysOrganizationDictionaryEnt entity = new SysOrganizationDictionaryEnt(); SysOrganizationDictionaryEnt entity = new SysOrganizationDictionaryEnt();
entity.setOuId(input.getOuId()); entity.setOuId(input.getOuId());
...@@ -141,8 +141,7 @@ public class SysOrganizationDictionaryService { ...@@ -141,8 +141,7 @@ public class SysOrganizationDictionaryService {
SysDictionaryView view = new SysDictionaryView(); SysDictionaryView view = new SysDictionaryView();
view.setDicPath(input.getId()); view.setDicPath(input.getId());
List<SysDictionaryView> sysDictionaryViews = dicViewMapper.selectListsByDicPathIncludeSelf(view); List<SysDictionaryView> sysDictionaryViews = dicViewMapper.selectListsByDicPathIncludeSelf(view);
List<String> dicIds = sysDictionaryViews.stream().map(p -> List<String> dicIds = sysDictionaryViews.stream().map(SysDictionaryView::getId
p.getId()
).distinct().collect(Collectors.toList()); ).distinct().collect(Collectors.toList());
QueryWrapper<SysOrganizationDictionaryEnt> queryWrapper = new QueryWrapper<>(); QueryWrapper<SysOrganizationDictionaryEnt> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().in(SysOrganizationDictionaryEnt::getDicCode, dicIds); queryWrapper.lambda().in(SysOrganizationDictionaryEnt::getDicCode, dicIds);
...@@ -262,17 +261,16 @@ public class SysOrganizationDictionaryService { ...@@ -262,17 +261,16 @@ public class SysOrganizationDictionaryService {
dictionaryViews = dictionaryViewMapper.selectChildListByCondition(recordView); dictionaryViews = dictionaryViewMapper.selectChildListByCondition(recordView);
} }
if (ObjectUtils.isNotEmpty(dictionaryViews)) { if (ObjectUtils.isNotEmpty(dictionaryViews)) {
List<String> pidList = dictionaryViews.stream().map(p -> List<String> pidList = dictionaryViews.stream().map(SysDictionaryView::getId
p.getId()
).distinct().collect(Collectors.toList()); ).distinct().collect(Collectors.toList());
QueryWrapper<SysDictionaryEnt> queryDict = new QueryWrapper(); QueryWrapper<SysDictionaryEnt> queryDict = new QueryWrapper<>();
queryDict.lambda().in(SysDictionaryEnt::getPid, pidList); queryDict.lambda().in(SysDictionaryEnt::getPid, pidList);
List<SysDictionaryEnt> sysDictionaryList = dictionaryMapper.selectList(queryDict); List<SysDictionaryEnt> sysDictionaryList = dictionaryMapper.selectList(queryDict);
pageInfo.setList(dictionaryViews); pageInfo.setList(dictionaryViews);
outputs = XCopyUtils.copyNewList(pageInfo.getList(), QuerySysDictionaryViewOutput.class); outputs = XCopyUtils.copyNewList(pageInfo.getList(), QuerySysDictionaryViewOutput.class);
int i = 0; int i = 0;
for (QuerySysDictionaryViewOutput out : outputs) { for (QuerySysDictionaryViewOutput out : outputs) {
if (sysDictionaryList != null && sysDictionaryList.size() > 0) { if (sysDictionaryList != null && !sysDictionaryList.isEmpty()) {
boolean flag = false; boolean flag = false;
for (SysDictionaryEnt obj : sysDictionaryList) { for (SysDictionaryEnt obj : sysDictionaryList) {
if (StringUtils.equals(out.getId(), obj.getPid())) { if (StringUtils.equals(out.getId(), obj.getPid())) {
......
...@@ -477,7 +477,7 @@ public class SysOrganizationService { ...@@ -477,7 +477,7 @@ public class SysOrganizationService {
SysDictionaryViewMapper dictionaryViewMapper = context.getBean(SysDictionaryViewMapper.class); SysDictionaryViewMapper dictionaryViewMapper = context.getBean(SysDictionaryViewMapper.class);
SysDictionaryView dictionaryView = new SysDictionaryView(); SysDictionaryView dictionaryView = new SysDictionaryView();
dictionaryView.setAlias("sys_inform_org"); dictionaryView.setAlias("sys_inform_org");
Boolean isSpecial = false; boolean isSpecial = false;
List<SysDictionaryView> dictionaryViews = dictionaryViewMapper.selectListsByAlias(dictionaryView); List<SysDictionaryView> dictionaryViews = dictionaryViewMapper.selectListsByAlias(dictionaryView);
if (!CollectionUtils.isEmpty(dictionaryViews)) { if (!CollectionUtils.isEmpty(dictionaryViews)) {
SysDictionaryView isExit = dictionaryViews.stream().filter(item -> XDateUtils.compare(item.getEndTime(), new Date()) >= 0 && item.getRemark().equals(session.getOuId())).findFirst().orElse(null); SysDictionaryView isExit = dictionaryViews.stream().filter(item -> XDateUtils.compare(item.getEndTime(), new Date()) >= 0 && item.getRemark().equals(session.getOuId())).findFirst().orElse(null);
...@@ -666,7 +666,7 @@ public class SysOrganizationService { ...@@ -666,7 +666,7 @@ public class SysOrganizationService {
List<String> parentIds = list.stream().map(SysOrganizationView::getId).collect(Collectors.toList()); List<String> parentIds = list.stream().map(SysOrganizationView::getId).collect(Collectors.toList());
List<SysOrganizationView> childList = mapper.selectCountByParentOuIds(parentIds, new Date()); List<SysOrganizationView> childList = mapper.selectCountByParentOuIds(parentIds, new Date());
Map<String, List<SysOrganizationView>> groupChildList = childList.stream().collect(Collectors.groupingBy(SysOrganizationView::getParentOuId)); Map<String, List<SysOrganizationView>> groupChildList = childList.stream().collect(Collectors.groupingBy(SysOrganizationView::getParentOuId));
list.stream().forEach(item -> { list.forEach(item -> {
if (groupChildList.get(item.getId()) != null) if (groupChildList.get(item.getId()) != null)
item.setIsHasChildren(1); item.setIsHasChildren(1);
else else
...@@ -766,7 +766,7 @@ public class SysOrganizationService { ...@@ -766,7 +766,7 @@ public class SysOrganizationService {
List<SysOrganizationView> list = mapper.selectSysOrganizationList(record); List<SysOrganizationView> list = mapper.selectSysOrganizationList(record);
if (CollUtil.isEmpty(list) && StringUtils.isNotBlank(record.getId())) { if (CollUtil.isEmpty(list) && StringUtils.isNotBlank(record.getId())) {
SysOrganizationView owner = mapper.selectOne(record); SysOrganizationView owner = mapper.selectOne(record);
List<SysOrganizationView> parentList = mapper.selectOrganizationBySubOuIds(Arrays.asList(record.getId())); List<SysOrganizationView> parentList = mapper.selectOrganizationBySubOuIds(Collections.singletonList(record.getId()));
if (CollUtil.isNotEmpty(parentList)) { if (CollUtil.isNotEmpty(parentList)) {
SysOrganizationView parent = parentList.get(0); SysOrganizationView parent = parentList.get(0);
owner.setParentOuId(parent.getParentOuId()); owner.setParentOuId(parent.getParentOuId());
...@@ -1228,7 +1228,7 @@ public class SysOrganizationService { ...@@ -1228,7 +1228,7 @@ public class SysOrganizationService {
relWrapper.lambda().like(SysOrganizationRelEnt::getOuIdPath, relEnt.getOuId() + "/"); relWrapper.lambda().like(SysOrganizationRelEnt::getOuIdPath, relEnt.getOuId() + "/");
List<SysOrganizationRelEnt> childList = relMapper.selectList(relWrapper); List<SysOrganizationRelEnt> childList = relMapper.selectList(relWrapper);
if (!CollectionUtils.isEmpty(childList)) { if (!CollectionUtils.isEmpty(childList)) {
childList.stream().forEach(item -> { childList.forEach(item -> {
int index = item.getOuIdPath().indexOf(relEnt.getOuId()); int index = item.getOuIdPath().indexOf(relEnt.getOuId());
item.setOuIdPath(relEnt.getOuIdPath() + item.getOuIdPath().substring(index + relEnt.getOuId().length())); item.setOuIdPath(relEnt.getOuIdPath() + item.getOuIdPath().substring(index + relEnt.getOuId().length()));
item.setModifyById(session.getId()); item.setModifyById(session.getId());
...@@ -1271,7 +1271,7 @@ public class SysOrganizationService { ...@@ -1271,7 +1271,7 @@ public class SysOrganizationService {
authOutIds.add(auth.getOuId()); authOutIds.add(auth.getOuId());
} }
} }
if (authOutIds.size() > 0) { if (!authOutIds.isEmpty()) {
List<GetOuListTreeOutput> resultAuthList = this.getOuListByOuIds(context, authOutIds); List<GetOuListTreeOutput> resultAuthList = this.getOuListByOuIds(context, authOutIds);
ouList.addAll(resultAuthList); ouList.addAll(resultAuthList);
} }
...@@ -1290,7 +1290,7 @@ public class SysOrganizationService { ...@@ -1290,7 +1290,7 @@ public class SysOrganizationService {
view.setIsDeleted(1); view.setIsDeleted(1);
view.setId(ouId); view.setId(ouId);
List<SysOrganizationView> list = mapper.selectAllListByOuId(view); List<SysOrganizationView> list = mapper.selectAllListByOuId(view);
if (list.size() > 0) { if (!list.isEmpty()) {
for (SysOrganizationView item : list) { for (SysOrganizationView item : list) {
GetOuListTreeOutput out = new GetOuListTreeOutput(); GetOuListTreeOutput out = new GetOuListTreeOutput();
out.setId(item.getId()); out.setId(item.getId());
...@@ -1312,7 +1312,7 @@ public class SysOrganizationService { ...@@ -1312,7 +1312,7 @@ public class SysOrganizationService {
if (CollectionUtils.isEmpty(ouIds)) return outputs; if (CollectionUtils.isEmpty(ouIds)) return outputs;
SysOrganizationViewMapper mapper = context.getBean(SysOrganizationViewMapper.class); SysOrganizationViewMapper mapper = context.getBean(SysOrganizationViewMapper.class);
List<SysOrganizationView> list = mapper.selectListByOuIds(ouIds); List<SysOrganizationView> list = mapper.selectListByOuIds(ouIds);
if (list.size() > 0) { if (!list.isEmpty()) {
for (SysOrganizationView item : list) { for (SysOrganizationView item : list) {
GetOuListTreeOutput out = new GetOuListTreeOutput(); GetOuListTreeOutput out = new GetOuListTreeOutput();
out.setId(item.getId()); out.setId(item.getId());
...@@ -1328,7 +1328,7 @@ public class SysOrganizationService { ...@@ -1328,7 +1328,7 @@ public class SysOrganizationService {
public List<GetOuListTreeOutput> createOuTree(List<GetOuListTreeOutput> list) { public List<GetOuListTreeOutput> createOuTree(List<GetOuListTreeOutput> list) {
List<GetOuListTreeOutput> treeList = new ArrayList<>(); List<GetOuListTreeOutput> treeList = new ArrayList<>();
if (list.size() > 0) { if (!list.isEmpty()) {
for (GetOuListTreeOutput tree : list) { for (GetOuListTreeOutput tree : list) {
boolean isHaveParent = false; boolean isHaveParent = false;
for (GetOuListTreeOutput item : list) { for (GetOuListTreeOutput item : list) {
......
...@@ -61,12 +61,10 @@ public class SysRoleService { ...@@ -61,12 +61,10 @@ public class SysRoleService {
for (SysOrganizationPropertyView propertyEnt : propertyViews) { for (SysOrganizationPropertyView propertyEnt : propertyViews) {
mediaTypeList.add(propertyEnt.getPropertyValue()); mediaTypeList.add(propertyEnt.getPropertyValue());
} }
if (!CollectionUtils.isEmpty(mediaTypeList)) {
record.setMediaTypes(mediaTypeList); record.setMediaTypes(mediaTypeList);
} }
} }
} }
}
List<SysRoleView> list = viewMapper.selectSysRoleListByOuId(record); List<SysRoleView> list = viewMapper.selectSysRoleListByOuId(record);
long total; long total;
//查询上级可继承的角色 //查询上级可继承的角色
...@@ -87,7 +85,7 @@ public class SysRoleService { ...@@ -87,7 +85,7 @@ public class SysRoleService {
ouIds = ouIds.stream().filter(id -> !id.equals(input.getOuId())).collect(Collectors.toList()); ouIds = ouIds.stream().filter(id -> !id.equals(input.getOuId())).collect(Collectors.toList());
record.setOuIds(ouIds); record.setOuIds(ouIds);
//下级单位是否可继承:0->否;1->是; //下级单位是否可继承:0->否;1->是;
if (ouIds.size() > 0) { if (!ouIds.isEmpty()) {
if (XStringUtils.isNotEmpty(input.getMediaType())) { if (XStringUtils.isNotEmpty(input.getMediaType())) {
record.setMediaType(input.getMediaType()); record.setMediaType(input.getMediaType());
} else { } else {
......
...@@ -43,7 +43,6 @@ public class SysUserGroupService { ...@@ -43,7 +43,6 @@ public class SysUserGroupService {
SysUserGroupEnt entity = new SysUserGroupEnt(); SysUserGroupEnt entity = new SysUserGroupEnt();
XCopyUtils.copyObject(input, entity); XCopyUtils.copyObject(input, entity);
entity.setId(UUID.randomUUID().toString()); entity.setId(UUID.randomUUID().toString());
//entity.setCreateById(context.getSession(PpsUserSession.class).getId());
entity.setCreateByName(context.getUser().getName()); entity.setCreateByName(context.getUser().getName());
entity.setCreateTime(new Date()); entity.setCreateTime(new Date());
mapper.insert(entity); mapper.insert(entity);
...@@ -75,7 +74,6 @@ public class SysUserGroupService { ...@@ -75,7 +74,6 @@ public class SysUserGroupService {
entity.setRoleId(role); entity.setRoleId(role);
entity.setUserGroupId(input.getUserGroupId()); entity.setUserGroupId(input.getUserGroupId());
entity.setId(UUID.randomUUID().toString()); entity.setId(UUID.randomUUID().toString());
//entity.setCreateById(context.getUser().getId());
entity.setCreateByName(context.getUser().getName()); entity.setCreateByName(context.getUser().getName());
entity.setCreateTime(now); entity.setCreateTime(now);
viewList.add(entity); viewList.add(entity);
...@@ -150,7 +148,6 @@ public class SysUserGroupService { ...@@ -150,7 +148,6 @@ public class SysUserGroupService {
entity.setUserId(obj.getUserId()); entity.setUserId(obj.getUserId());
entity.setUserGroupId(input.getUserGroupId()); entity.setUserGroupId(input.getUserGroupId());
entity.setId(UUID.randomUUID().toString()); entity.setId(UUID.randomUUID().toString());
//entity.setCreateById(context.getUser().getId());
entity.setCreateByName(context.getUser().getName()); entity.setCreateByName(context.getUser().getName());
entity.setCreateTime(now); entity.setCreateTime(now);
viewList.add(entity); viewList.add(entity);
...@@ -196,7 +193,7 @@ public class SysUserGroupService { ...@@ -196,7 +193,7 @@ public class SysUserGroupService {
QueryWrapper<SysUserGroupRoleRelEnt> roleWrapper = new QueryWrapper<>(); QueryWrapper<SysUserGroupRoleRelEnt> roleWrapper = new QueryWrapper<>();
roleWrapper.lambda().eq(SysUserGroupRoleRelEnt::getUserGroupId, entity.getId()); roleWrapper.lambda().eq(SysUserGroupRoleRelEnt::getUserGroupId, entity.getId());
List<SysUserGroupRoleRelEnt> sysUserGroupEnts = groupRoleMapper.selectList(roleWrapper); List<SysUserGroupRoleRelEnt> sysUserGroupEnts = groupRoleMapper.selectList(roleWrapper);
if (sysUserGroupEnts != null && sysUserGroupEnts.size() > 0) { if (sysUserGroupEnts != null && !sysUserGroupEnts.isEmpty()) {
for (SysUserGroupRoleRelEnt obj : sysUserGroupEnts) { for (SysUserGroupRoleRelEnt obj : sysUserGroupEnts) {
mapper.deleteById(obj); mapper.deleteById(obj);
} }
...@@ -205,7 +202,7 @@ public class SysUserGroupService { ...@@ -205,7 +202,7 @@ public class SysUserGroupService {
QueryWrapper<SysAuthOuScopeEnt> menuWrapper = new QueryWrapper<>(); QueryWrapper<SysAuthOuScopeEnt> menuWrapper = new QueryWrapper<>();
menuWrapper.lambda().eq(SysAuthOuScopeEnt::getUserGroupId, entity.getId()); menuWrapper.lambda().eq(SysAuthOuScopeEnt::getUserGroupId, entity.getId());
List<SysAuthOuScopeEnt> menuGroupEnts = groupMenuMapper.selectList(menuWrapper); List<SysAuthOuScopeEnt> menuGroupEnts = groupMenuMapper.selectList(menuWrapper);
if (menuGroupEnts != null && menuGroupEnts.size() > 0) { if (menuGroupEnts != null && !menuGroupEnts.isEmpty()) {
for (SysAuthOuScopeEnt obj : menuGroupEnts) { for (SysAuthOuScopeEnt obj : menuGroupEnts) {
groupMenuMapper.deleteById(obj); groupMenuMapper.deleteById(obj);
} }
...@@ -214,7 +211,7 @@ public class SysUserGroupService { ...@@ -214,7 +211,7 @@ public class SysUserGroupService {
QueryWrapper<SysUserWithUserGroupRelEnt> userWrapper = new QueryWrapper<>(); QueryWrapper<SysUserWithUserGroupRelEnt> userWrapper = new QueryWrapper<>();
userWrapper.lambda().eq(SysUserWithUserGroupRelEnt::getUserGroupId, entity.getId()); userWrapper.lambda().eq(SysUserWithUserGroupRelEnt::getUserGroupId, entity.getId());
List<SysUserWithUserGroupRelEnt> userGroupEnts = groupUserMapper.selectList(userWrapper); List<SysUserWithUserGroupRelEnt> userGroupEnts = groupUserMapper.selectList(userWrapper);
if (userGroupEnts != null && userGroupEnts.size() > 0) { if (userGroupEnts != null && !userGroupEnts.isEmpty()) {
for (SysUserWithUserGroupRelEnt obj : userGroupEnts) { for (SysUserWithUserGroupRelEnt obj : userGroupEnts) {
groupUserMapper.deleteById(obj); groupUserMapper.deleteById(obj);
} }
......
...@@ -94,7 +94,6 @@ public class SysUserService { ...@@ -94,7 +94,6 @@ public class SysUserService {
if (XStringUtils.isEmpty(input.getPassword())) { if (XStringUtils.isEmpty(input.getPassword())) {
return XServiceResult.error(993, "请输入密码!"); return XServiceResult.error(993, "请输入密码!");
} }
//String password = MD5Util.encryptPassword(AESUtil.decrypt(input.getPassword()));
entity.setPassword(input.getPassword()); entity.setPassword(input.getPassword());
String uuid = UUID.randomUUID().toString(); String uuid = UUID.randomUUID().toString();
entity.setId(uuid); entity.setId(uuid);
...@@ -159,8 +158,7 @@ public class SysUserService { ...@@ -159,8 +158,7 @@ public class SysUserService {
queryWrapper.clear(); queryWrapper.clear();
queryWrapper.lambda().eq(SysUserEnt::getLoginName, input.getLoginName()); queryWrapper.lambda().eq(SysUserEnt::getLoginName, input.getLoginName());
List<SysUserEnt> isExit = mapper.selectList(queryWrapper); List<SysUserEnt> isExit = mapper.selectList(queryWrapper);
if (!CollectionUtils.isEmpty(isExit) && (isExit.size() > 1 if (!CollectionUtils.isEmpty(isExit) && (isExit.size() > 1 || !isExit.get(0).getId().equals(input.getId()))) {
|| (isExit.size() == 1 && !isExit.get(0).getId().equals(input.getId())))) {
return XServiceResult.error(993, "登录账户已存在!"); return XServiceResult.error(993, "登录账户已存在!");
} }
//查询是否存在有相同的Iam登录名,如果存在,提示错误信息 //查询是否存在有相同的Iam登录名,如果存在,提示错误信息
...@@ -168,8 +166,7 @@ public class SysUserService { ...@@ -168,8 +166,7 @@ public class SysUserService {
queryWrapper.clear(); queryWrapper.clear();
queryWrapper.lambda().eq(SysUserEnt::getIamLoginName, input.getIamLoginName()); queryWrapper.lambda().eq(SysUserEnt::getIamLoginName, input.getIamLoginName());
List<SysUserEnt> isIamExit = mapper.selectList(queryWrapper); List<SysUserEnt> isIamExit = mapper.selectList(queryWrapper);
if (!CollectionUtils.isEmpty(isIamExit) && (isIamExit.size() > 1 if (!CollectionUtils.isEmpty(isIamExit) && (isIamExit.size() > 1 || !isIamExit.get(0).getId().equals(input.getId()))) {
|| (isIamExit.size() == 1 && !isIamExit.get(0).getId().equals(input.getId())))) {
return XServiceResult.error(993, "Iam登录账户已存在!"); return XServiceResult.error(993, "Iam登录账户已存在!");
} }
} }
......
...@@ -105,7 +105,7 @@ public class SysUserWithUserGroupRelService { ...@@ -105,7 +105,7 @@ public class SysUserWithUserGroupRelService {
entity.setSort(input.getSort()); entity.setSort(input.getSort());
list.add(entity); list.add(entity);
} }
list.forEach(x -> mapper.insert(x)); list.forEach(mapper::insert);
return XServiceResult.OK; return XServiceResult.OK;
} }
...@@ -130,7 +130,7 @@ public class SysUserWithUserGroupRelService { ...@@ -130,7 +130,7 @@ public class SysUserWithUserGroupRelService {
entity.setSort(input.getSort()); entity.setSort(input.getSort());
list.add(entity); list.add(entity);
} }
list.forEach(x -> mapper.insert(x)); list.forEach(mapper::insert);
return XServiceResult.OK; return XServiceResult.OK;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment