Commit 3b5c64de authored by ZWT's avatar ZWT

feat(零碳): 长庆

1.修改极短期间开预测定时任务逻辑,解决优化后部分优化结果时间段过短问题;
2.修改心知天气气象数据获取及接收定时任务,解决天气数据通过邮件下载后,部分数据精度丢失问题;
3.修改首页各个接口逻辑,对小数类型字段进行处理,修改首页接口,增加小时保留两位四舍五入逻辑,同时解决线路详情接口部分查询逻辑报错问题;
4.能耗分析模块,能耗概览接口修改,修改查询逻辑,修改数据获取逻辑及绿电占比计算逻辑;
5.能耗分析模块,消纳曲线用电趋势接口修改,修改查询逻辑,修改数据获取逻辑及绿电占比计算逻辑;
6.能耗分析模块,用电详情接口修改,修改查询逻辑,修改数据获取逻辑及绿电占比计算逻辑;
7.修改首页先导实验井间开制度模块接口查询逻辑,解决极短期间开优化修改后没有第一次开井时间标识导致数据查询不出来问题;
8.基础间开制度新增修改接口逻辑修改,删除防冻堵对井口处理逻辑;
9.极短期间开优化算法修改,增加防冻堵井开井时间优化逻辑;
10.提供长庆通过日期获取当日间开优化结果接口开发,完成接口冒烟测试并添加线上接口文档;
11.提供长庆1天光伏出力预测结果接口开发,完成接口冒烟测试并添加线上接口文档;
12.提供长庆15天光伏出力预测结果接口开发,完成接口冒烟测试并添加线上接口文档;
13.修改极短期间开优化算法,优化防冻堵策略;
14.开发第三方历史天气导入功能;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 9cfd20c4
...@@ -84,4 +84,4 @@ public class ConfigServiceImpl implements ConfigService { ...@@ -84,4 +84,4 @@ public class ConfigServiceImpl implements ConfigService {
} }
return baseSysConfigEnt; return baseSysConfigEnt;
} }
} }
\ No newline at end of file
...@@ -114,7 +114,7 @@ public class LoginService { ...@@ -114,7 +114,7 @@ public class LoginService {
@XText("账号密码登录") @XText("账号密码登录")
@XApiPost(anonymous = true) @XApiPost(anonymous = true)
public XSingleResult<LoginByAccountOutput> loginByAccount(XContext context, LoginByAccountInput input) { public XSingleResult<LoginByAccountOutput> loginByAccount(XContext context, LoginByAccountInput input) {
long startTime = new Date().getTime(); long startTime = System.currentTimeMillis();
Long count = getErrorTimes(context, input.getLoginName(), null); Long count = getErrorTimes(context, input.getLoginName(), null);
if (count >= 5) { if (count >= 5) {
return XSingleResult.error(context, LoginError.ISLOCKED); return XSingleResult.error(context, LoginError.ISLOCKED);
......
package pps.core.system.service;
import xstartup.annotation.XService;
@XService
public class MessageProcParamService {
// @XApiAnonymous
// @XApiPost
// public XServiceResult createMessageProcParam(XContext context, CreateMessageProcParamInput input){
// MessageProcParamMapper mapper = context.getBean(MessageProcParamMapper.class);
// MessageProcParamEnt entity = new MessageProcParamEnt();
// XCopyUtils.copyObject(input, entity);
// mapper.insert(entity);
// return XServiceResult.OK;
// }
//
// @XApiAnonymous
// @XApiPost
// public XServiceResult updateMessageProcParam(XContext context, UpdateMessageProcParamInput input){
// MessageProcParamMapper mapper = context.getBean(MessageProcParamMapper.class);
// QueryWrapper<MessageProcParamEnt> queryWrapper = new QueryWrapper<>();
// queryWrapper.lambda().eq(MessageProcParamEnt::getId, input.getId());
// MessageProcParamEnt entity = mapper.selectOne(queryWrapper);
// if(entity == null) {
// return XServiceResult.error(context, XError.NotFound);
// }
// XCopyUtils.copyObject(input, entity);
// mapper.updateById(entity);
// return XServiceResult.OK;
// }
//
// @XApiAnonymous
// @XApiPost
// public XServiceResult deleteMessageProcParam(XContext context, DeleteMessageProcParamInput input){
// MessageProcParamMapper mapper = context.getBean(MessageProcParamMapper.class);
// QueryWrapper<MessageProcParamEnt> queryWrapper = new QueryWrapper<>();
// queryWrapper.lambda().eq(MessageProcParamEnt::getId, input.getId());
// MessageProcParamEnt entity = mapper.selectOne(queryWrapper);
// if(entity == null) {
// return XServiceResult.error(context, XError.NotFound);
// }
// mapper.deleteById(entity);
// return XServiceResult.OK;
// }
//
// @XApiAnonymous
// @XApiGet
// public XSingleResult<GetMessageProcParamOutput> getMessageProcParam(XContext context, GetMessageProcParamInput input){
// MessageProcParamMapper mapper = context.getBean(MessageProcParamMapper.class);
// QueryWrapper<MessageProcParamEnt> queryWrapper = new QueryWrapper<>();
// queryWrapper.lambda().eq(MessageProcParamEnt::getId, input.getId());
// MessageProcParamEnt entity = mapper.selectOne(queryWrapper);
// if(entity == null) {
// return XSingleResult.error(context, XError.NotFound);
// }
// GetMessageProcParamOutput output = new GetMessageProcParamOutput();
// XCopyUtils.copyObject(entity, output);
// return XSingleResult.success(output);
// }
//
// @XApiAnonymous
// @XApiGet
// public XPageResult<QueryMessageProcParamOutput> queryMessageProcParam(XContext context, QueryMessageProcParamInput input){
// MessageProcParamMapper mapper = context.getBean(MessageProcParamMapper.class);
// QueryWrapper<MessageProcParamEnt> queryWrapper = new QueryWrapper<>();
// queryWrapper.lambda().like(MessageProcParamEnt::getId, input.getId())
// .like(MessageProcParamEnt::getProcId, input.getProcId())
// .like(MessageProcParamEnt::getParamName, input.getParamName())
// .like(MessageProcParamEnt::getParamDes, input.getParamDes())
// .like(MessageProcParamEnt::getParamType, input.getParamType())
// .like(MessageProcParamEnt::getInOut, input.getInOut())
// .like(MessageProcParamEnt::getCreateByName, input.getCreateByName())
// .eq(MessageProcParamEnt::getSort, input.getSort());
// return MapperHelper.query(mapper, input, queryWrapper, QueryMessageProcParamOutput.class);
// }
//
// @XApiAnonymous
// @XApiGet
// public XPageResult<QueryMessageProcParamOutput> dynamicQueryMessageProcParam(XContext context, CustomQueryInput input){
// MessageProcParamMapper mapper = context.getBean(MessageProcParamMapper.class);
// return MapperHelper.query(mapper, input, MessageProcParamEnt.class, QueryMessageProcParamOutput.class);
// }
//
// @XApiAnonymous
// @XApiGet
// public XSingleResult<GetMessageProcParamViewOutput> getMessageProcParamView(XContext context, GetMessageProcParamViewInput input){
// MessageProcParamViewMapper mapper = context.getBean(MessageProcParamViewMapper.class);
// MessageProcParamView record = new MessageProcParamView();
// XCopyUtils.copyObject(input, record);
// MessageProcParamView view = mapper.selectOne(record);
// if(view == null) {
// return XSingleResult.error(context, XError.NotFound);
// }
// GetMessageProcParamViewOutput output = new GetMessageProcParamViewOutput();
// XCopyUtils.copyObject(view, output);
// return XSingleResult.success(output);
// }
//
// @XApiAnonymous
// @XApiGet
// public XPageResult<QueryMessageProcParamViewOutput> queryMessageProcParamView(XContext context, QueryMessageProcParamViewInput input){
// MessageProcParamViewMapper mapper = context.getBean(MessageProcParamViewMapper.class);
// MessageProcParamView record = new MessageProcParamView();
// XCopyUtils.copyObject(input, record);
// PageHelper.startPage(input.getPage(), input.getLimit());
// List<MessageProcParamView> list = mapper.selectList(record);
// PageInfo<MessageProcParamView> pageInfo = new PageInfo<>(list);
// List<QueryMessageProcParamViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QueryMessageProcParamViewOutput.class);
// return XPageResult.success(outputs, input, pageInfo.getTotal());
// }
}
...@@ -154,5 +154,4 @@ public class OperationMaintenanceUserInformationService { ...@@ -154,5 +154,4 @@ public class OperationMaintenanceUserInformationService {
List<QueryOperationMaintenanceUserInformationViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QueryOperationMaintenanceUserInformationViewOutput.class); List<QueryOperationMaintenanceUserInformationViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QueryOperationMaintenanceUserInformationViewOutput.class);
return XPageResult.success(outputs, input, pageInfo.getTotal()); return XPageResult.success(outputs, input, pageInfo.getTotal());
} }
}
} \ No newline at end of file
...@@ -46,7 +46,6 @@ public class SysAreaService { ...@@ -46,7 +46,6 @@ public class SysAreaService {
if (!CollectionUtils.isEmpty(ent.getChildren())) { if (!CollectionUtils.isEmpty(ent.getChildren())) {
items.addAll(ent.getChildren()); items.addAll(ent.getChildren());
} }
} }
sysAreaCaches = items; sysAreaCaches = items;
} }
...@@ -76,7 +75,6 @@ public class SysAreaService { ...@@ -76,7 +75,6 @@ public class SysAreaService {
List<SysAreaView> areaViews = mapper.selectListAll(record); List<SysAreaView> areaViews = mapper.selectListAll(record);
List<GetSysAreaViewOutputTree> list = XCopyUtils.copyNewList(areaViews, GetSysAreaViewOutputTree.class); List<GetSysAreaViewOutputTree> list = XCopyUtils.copyNewList(areaViews, GetSysAreaViewOutputTree.class);
List<GetSysAreaViewOutputTree> trees = new ArrayList<>(); List<GetSysAreaViewOutputTree> trees = new ArrayList<>();
for (GetSysAreaViewOutputTree tree : list) { for (GetSysAreaViewOutputTree tree : list) {
if (tree.getLev().equals(0)) { if (tree.getLev().equals(0)) {
trees.add(tree); trees.add(tree);
...@@ -197,5 +195,4 @@ public class SysAreaService { ...@@ -197,5 +195,4 @@ public class SysAreaService {
List<QuerySysAreaViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QuerySysAreaViewOutput.class); List<QuerySysAreaViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QuerySysAreaViewOutput.class);
return XPageResult.success(outputs, input, pageInfo.getTotal()); return XPageResult.success(outputs, input, pageInfo.getTotal());
} }
}
} \ No newline at end of file
...@@ -40,7 +40,6 @@ public class SysAuthOuScopeService { ...@@ -40,7 +40,6 @@ public class SysAuthOuScopeService {
@XText("创建用户和菜单、组织机构关系表") @XText("创建用户和菜单、组织机构关系表")
@XApiPost @XApiPost
public XServiceResult createSysAuthOuScope(XContext context, CreateSysAuthOuScopeInput input) throws XServiceException { public XServiceResult createSysAuthOuScope(XContext context, CreateSysAuthOuScopeInput input) throws XServiceException {
return XTransactionHelper.begin(context, () -> { return XTransactionHelper.begin(context, () -> {
SysAuthOuScopeMapper sysAuthOuScopeMapper = context.getBean(SysAuthOuScopeMapper.class); SysAuthOuScopeMapper sysAuthOuScopeMapper = context.getBean(SysAuthOuScopeMapper.class);
SysAuthOuScopeViewMapper sysAuthOuScopeViewMapper = context.getBean(SysAuthOuScopeViewMapper.class); SysAuthOuScopeViewMapper sysAuthOuScopeViewMapper = context.getBean(SysAuthOuScopeViewMapper.class);
...@@ -69,7 +68,6 @@ public class SysAuthOuScopeService { ...@@ -69,7 +68,6 @@ public class SysAuthOuScopeService {
List<String> collect = deleteList.stream().map(SysAuthOuScopeEnt::getId).collect(Collectors.toList()); List<String> collect = deleteList.stream().map(SysAuthOuScopeEnt::getId).collect(Collectors.toList());
sysAuthOuScopeMapper.deleteBatchIds(collect); sysAuthOuScopeMapper.deleteBatchIds(collect);
} }
//创建新关系 //创建新关系
List<SysAuthOuScopeView> viewList = new ArrayList<>(); List<SysAuthOuScopeView> viewList = new ArrayList<>();
List<String> ouIds = input.getOuIds(); List<String> ouIds = input.getOuIds();
...@@ -94,21 +92,7 @@ public class SysAuthOuScopeService { ...@@ -94,21 +92,7 @@ public class SysAuthOuScopeService {
//返回执行成功的结果,事务提交 //返回执行成功的结果,事务提交
return XServiceResult.OK; return XServiceResult.OK;
}); });
} }
/* @XApiAnonymous
@XApiPost
public XServiceResult createSysAuthOuScope(XContext context, CreateSysAuthOuScopeInput input){
SysAuthOuScopeMapper mapper = context.getBean(SysAuthOuScopeMapper.class);
SysAuthOuScopeEnt entity = new SysAuthOuScopeEnt();
XCopyUtils.copyObject(input, entity);
// entity.setCreateById(context.getUser().getId());
entity.setCreateByName(context.getUser().getName());
entity.setCreateTime(new Date());
mapper.insert(entity);
return XServiceResult.OK;
}*/
@XText("批量删除") @XText("批量删除")
@XApiPost @XApiPost
...@@ -126,7 +110,6 @@ public class SysAuthOuScopeService { ...@@ -126,7 +110,6 @@ public class SysAuthOuScopeService {
return XServiceResult.OK; return XServiceResult.OK;
} }
@XText("查询管理授权") @XText("查询管理授权")
@XApiPost @XApiPost
public XPageResult<QuerySysAuthOuScopeViewOutput> querySysAuthOuScopeView(XContext context, QuerySysAuthOuScopeViewInput input) { public XPageResult<QuerySysAuthOuScopeViewOutput> querySysAuthOuScopeView(XContext context, QuerySysAuthOuScopeViewInput input) {
...@@ -140,7 +123,6 @@ public class SysAuthOuScopeService { ...@@ -140,7 +123,6 @@ public class SysAuthOuScopeService {
return XPageResult.success(outputs, input, pageInfo.getTotal()); return XPageResult.success(outputs, input, pageInfo.getTotal());
} }
@XText("根据用户组id查询") @XText("根据用户组id查询")
@XApiAnonymous @XApiAnonymous
@XApiPost @XApiPost
...@@ -154,5 +136,4 @@ public class SysAuthOuScopeService { ...@@ -154,5 +136,4 @@ public class SysAuthOuScopeService {
List<QuerySysAuthOuScopeViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QuerySysAuthOuScopeViewOutput.class); List<QuerySysAuthOuScopeViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QuerySysAuthOuScopeViewOutput.class);
return XPageResult.success(outputs, input, pageInfo.getTotal()); return XPageResult.success(outputs, input, pageInfo.getTotal());
} }
}
} \ No newline at end of file
...@@ -39,4 +39,4 @@ public class SysBaseInfoSyncServiceImpl implements SysBaseInfoSyncService { ...@@ -39,4 +39,4 @@ public class SysBaseInfoSyncServiceImpl implements SysBaseInfoSyncService {
mapper.updateById(ent); mapper.updateById(ent);
return XServiceResult.OK; return XServiceResult.OK;
} }
} }
\ No newline at end of file
...@@ -16,6 +16,7 @@ import xstartup.feature.mybatis.helper.XMapperHelper; ...@@ -16,6 +16,7 @@ import xstartup.feature.mybatis.helper.XMapperHelper;
@XService @XService
public class SysBaseInfoSysncConfigService { public class SysBaseInfoSysncConfigService {
@XApiPost @XApiPost
public XServiceResult createSysBaseInfoSysncConfig(XContext context, CreateSysBaseInfoSysncConfigInput input) { public XServiceResult createSysBaseInfoSysncConfig(XContext context, CreateSysBaseInfoSysncConfigInput input) {
SysBaseInfoSysncConfigMapper mapper = context.getBean(SysBaseInfoSysncConfigMapper.class); SysBaseInfoSysncConfigMapper mapper = context.getBean(SysBaseInfoSysncConfigMapper.class);
...@@ -41,7 +42,6 @@ public class SysBaseInfoSysncConfigService { ...@@ -41,7 +42,6 @@ public class SysBaseInfoSysncConfigService {
if (entity == null) { if (entity == null) {
return XServiceResult.error(context, XError.NotFound); return XServiceResult.error(context, XError.NotFound);
} }
QueryWrapper<SysBaseInfoSysncConfigEnt> wrapper = new QueryWrapper(); QueryWrapper<SysBaseInfoSysncConfigEnt> wrapper = new QueryWrapper();
wrapper.lambda().eq(SysBaseInfoSysncConfigEnt::getTableName, input.getTableName()) wrapper.lambda().eq(SysBaseInfoSysncConfigEnt::getTableName, input.getTableName())
.eq(SysBaseInfoSysncConfigEnt::getTargetDb, input.getTargetDb()); .eq(SysBaseInfoSysncConfigEnt::getTargetDb, input.getTargetDb());
...@@ -49,7 +49,6 @@ public class SysBaseInfoSysncConfigService { ...@@ -49,7 +49,6 @@ public class SysBaseInfoSysncConfigService {
if (sysBaseInfoSysncConfigEnt != null && !sysBaseInfoSysncConfigEnt.getId().equals(input.getId())) { if (sysBaseInfoSysncConfigEnt != null && !sysBaseInfoSysncConfigEnt.getId().equals(input.getId())) {
return XServiceResult.error(1000, "配置已存在"); return XServiceResult.error(1000, "配置已存在");
} }
XCopyUtils.copyObject(input, entity); XCopyUtils.copyObject(input, entity);
mapper.updateById(entity); mapper.updateById(entity);
return XServiceResult.OK; return XServiceResult.OK;
...@@ -91,5 +90,4 @@ public class SysBaseInfoSysncConfigService { ...@@ -91,5 +90,4 @@ public class SysBaseInfoSysncConfigService {
.eq(SysBaseInfoSysncConfigEnt::getIsEnable, input.getIsEnable()); .eq(SysBaseInfoSysncConfigEnt::getIsEnable, input.getIsEnable());
return XMapperHelper.query(mapper, input, queryWrapper, QuerySysBaseInfoSysncConfigOutput.class); return XMapperHelper.query(mapper, input, queryWrapper, QuerySysBaseInfoSysncConfigOutput.class);
} }
}
} \ No newline at end of file
...@@ -128,7 +128,7 @@ public class SysDictionaryService { ...@@ -128,7 +128,7 @@ public class SysDictionaryService {
mapper.insert(entity); mapper.insert(entity);
//更新字典缓存 //更新字典缓存
if (entity.getEndTime() != null) { if (entity.getEndTime() != null) {
long l = entity.getEndTime().getTime() - new Date().getTime(); long l = entity.getEndTime().getTime() - System.currentTimeMillis();
if (l > 0) { if (l > 0) {
/*List<SysDictionaryCache> list = SysDictionaryCache.list(context, alias); /*List<SysDictionaryCache> list = SysDictionaryCache.list(context, alias);
SysDictionaryCache sysDictionaryCache = new SysDictionaryCache(); SysDictionaryCache sysDictionaryCache = new SysDictionaryCache();
...@@ -182,7 +182,7 @@ public class SysDictionaryService { ...@@ -182,7 +182,7 @@ public class SysDictionaryService {
public XServiceResult updateSysDictionary(XContext context, UpdateSysDictionaryInput input) { public XServiceResult updateSysDictionary(XContext context, UpdateSysDictionaryInput input) {
SysDictionaryMapper mapper = context.getBean(SysDictionaryMapper.class); SysDictionaryMapper mapper = context.getBean(SysDictionaryMapper.class);
//如果输入的alias为空,查询新增项的上级alias //如果输入的alias为空,查询新增项的上级alias
String alias = ""; String alias;
if (StringUtils.isNotBlank(input.getAlias())) { if (StringUtils.isNotBlank(input.getAlias())) {
alias = input.getAlias(); alias = input.getAlias();
List<SysDictionaryCache> list1 = SysDictionaryCache.list(context, alias); List<SysDictionaryCache> list1 = SysDictionaryCache.list(context, alias);
...@@ -215,7 +215,6 @@ public class SysDictionaryService { ...@@ -215,7 +215,6 @@ public class SysDictionaryService {
} }
} }
} }
//查询需要修改的 //查询需要修改的
QueryWrapper<SysDictionaryEnt> queryEntity = new QueryWrapper<>(); QueryWrapper<SysDictionaryEnt> queryEntity = new QueryWrapper<>();
queryEntity.lambda().eq(SysDictionaryEnt::getId, input.getId()); queryEntity.lambda().eq(SysDictionaryEnt::getId, input.getId());
...@@ -227,7 +226,6 @@ public class SysDictionaryService { ...@@ -227,7 +226,6 @@ public class SysDictionaryService {
entity.setModifyName(context.getUser().getName()); entity.setModifyName(context.getUser().getName());
entity.setModifyTime(new Date()); entity.setModifyTime(new Date());
mapper.updateById(entity); mapper.updateById(entity);
//更新字典缓存 //更新字典缓存
List<SysDictionaryCache> list = SysDictionaryCache.list(context, alias); List<SysDictionaryCache> list = SysDictionaryCache.list(context, alias);
List<SysDictionaryCache> items = new ArrayList<>(); List<SysDictionaryCache> items = new ArrayList<>();
...@@ -476,9 +474,9 @@ public class SysDictionaryService { ...@@ -476,9 +474,9 @@ public class SysDictionaryService {
XPageResult<QuerySysDictionaryOutput> query = XMapperHelper.query(mapper, input, queryWrapper, QuerySysDictionaryOutput.class); XPageResult<QuerySysDictionaryOutput> query = XMapperHelper.query(mapper, input, queryWrapper, QuerySysDictionaryOutput.class);
List<QuerySysDictionaryOutput> items = query.getResult().getItems(); List<QuerySysDictionaryOutput> items = query.getResult().getItems();
if (items != null && items.size() > 0) { if (items != null && items.size() > 0) {
List<String> ids = items.stream().map(p -> { List<String> ids = items.stream().map(p ->
return p.getId(); p.getId()
}).distinct().collect(Collectors.toList()); ).distinct().collect(Collectors.toList());
SysDictionaryView sysDictionaryView = new SysDictionaryView(); SysDictionaryView sysDictionaryView = new SysDictionaryView();
StringBuffer idsStr = new StringBuffer(); StringBuffer idsStr = new StringBuffer();
for (int i = 0; i < ids.size(); i++) { for (int i = 0; i < ids.size(); i++) {
...@@ -663,14 +661,11 @@ public class SysDictionaryService { ...@@ -663,14 +661,11 @@ public class SysDictionaryService {
list.add(cache); list.add(cache);
} }
} }
Collections.sort(sysDictionaryList, new Comparator<SysDictionaryEnt>() { Collections.sort(sysDictionaryList, (o1, o2) -> {
@Override if (ObjectUtils.isNotEmpty(o1.getSort()) && ObjectUtils.isNotEmpty(o2.getSort())) {
public int compare(SysDictionaryEnt o1, SysDictionaryEnt o2) { return o1.getSort() - o2.getSort();
if (ObjectUtils.isNotEmpty(o1.getSort()) && ObjectUtils.isNotEmpty(o2.getSort())) { } else {
return o1.getSort() - o2.getSort(); return 0;
} else {
return 0;
}
} }
}); });
List<QuerySysDictionaryViewOutput> outputs = XCopyUtils.copyNewList(sysDictionaryList, QuerySysDictionaryViewOutput.class); List<QuerySysDictionaryViewOutput> outputs = XCopyUtils.copyNewList(sysDictionaryList, QuerySysDictionaryViewOutput.class);
...@@ -703,23 +698,18 @@ public class SysDictionaryService { ...@@ -703,23 +698,18 @@ public class SysDictionaryService {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
list = list.stream().filter(i -> dicIds.contains(i.getId())).collect(Collectors.toList()); list = list.stream().filter(i -> dicIds.contains(i.getId())).collect(Collectors.toList());
} }
} }
Collections.sort(list, new Comparator<SysDictionaryCache>() { Collections.sort(list, (o1, o2) -> {
@Override if (ObjectUtils.isNotEmpty(o1.getSort()) && ObjectUtils.isNotEmpty(o2.getSort())) {
public int compare(SysDictionaryCache o1, SysDictionaryCache o2) { return o1.getSort() - o2.getSort();
if (ObjectUtils.isNotEmpty(o1.getSort()) && ObjectUtils.isNotEmpty(o2.getSort())) { } else {
return o1.getSort() - o2.getSort(); return 0;
} else {
return 0;
}
} }
}); });
List<QuerySysDictionaryViewOutput> outputs = XCopyUtils.copyNewList(list, QuerySysDictionaryViewOutput.class); List<QuerySysDictionaryViewOutput> outputs = XCopyUtils.copyNewList(list, QuerySysDictionaryViewOutput.class);
return XListResult.success(outputs); return XListResult.success(outputs);
} }
@XText("获取字典地区树") @XText("获取字典地区树")
@XApiPost @XApiPost
public XListResult<QuerySysDictionaryViewOutput> querySysDictionaryTree(XContext context, GetSysDictionaryViewInput input) { public XListResult<QuerySysDictionaryViewOutput> querySysDictionaryTree(XContext context, GetSysDictionaryViewInput input) {
...@@ -729,7 +719,6 @@ public class SysDictionaryService { ...@@ -729,7 +719,6 @@ public class SysDictionaryService {
List<SysDictionaryView> list = mapper.selectSysDictionaryTree(record); List<SysDictionaryView> list = mapper.selectSysDictionaryTree(record);
List<QuerySysDictionaryViewOutput> outputs = XCopyUtils.copyNewList(list, QuerySysDictionaryViewOutput.class); List<QuerySysDictionaryViewOutput> outputs = XCopyUtils.copyNewList(list, QuerySysDictionaryViewOutput.class);
List<QuerySysDictionaryViewOutput> trees = new ArrayList<>(); List<QuerySysDictionaryViewOutput> trees = new ArrayList<>();
for (QuerySysDictionaryViewOutput tree : outputs) { for (QuerySysDictionaryViewOutput tree : outputs) {
if (tree.getParentSysDictionaryId().equals("30")) { if (tree.getParentSysDictionaryId().equals("30")) {
trees.add(tree); trees.add(tree);
...@@ -743,10 +732,8 @@ public class SysDictionaryService { ...@@ -743,10 +732,8 @@ public class SysDictionaryService {
tree.getChildren().add(it); tree.getChildren().add(it);
} }
} }
} }
trees.stream().sorted(Comparator.comparing(QuerySysDictionaryViewOutput::getSort)).collect(Collectors.toList()); trees.stream().sorted(Comparator.comparing(QuerySysDictionaryViewOutput::getSort)).collect(Collectors.toList());
return XListResult.success(trees); return XListResult.success(trees);
} }
...@@ -768,9 +755,9 @@ public class SysDictionaryService { ...@@ -768,9 +755,9 @@ public class SysDictionaryService {
public XServiceResult updateBasePipelineParentPath(XContext context, List<SysDictionaryEnt> dics) { public XServiceResult updateBasePipelineParentPath(XContext context, List<SysDictionaryEnt> dics) {
SysDictionaryMapper mapper = context.getBean(SysDictionaryMapper.class); SysDictionaryMapper mapper = context.getBean(SysDictionaryMapper.class);
List<String> list = dics.stream().map(p -> { List<String> list = dics.stream().map(p ->
return p.getId(); p.getId()
}).distinct().collect(Collectors.toList()); ).distinct().collect(Collectors.toList());
while (ObjectUtils.isNotEmpty(list)) { while (ObjectUtils.isNotEmpty(list)) {
//更新二级字典parentPath //更新二级字典parentPath
QueryWrapper<SysDictionaryEnt> wrapper = new QueryWrapper<>(); QueryWrapper<SysDictionaryEnt> wrapper = new QueryWrapper<>();
...@@ -786,9 +773,9 @@ public class SysDictionaryService { ...@@ -786,9 +773,9 @@ public class SysDictionaryService {
entity.setDicPath(parentPath); entity.setDicPath(parentPath);
mapper.updateById(entity); mapper.updateById(entity);
} }
list = sysDictionaryEnts.stream().map(p -> { list = sysDictionaryEnts.stream().map(p ->
return p.getId(); p.getId()
}).distinct().collect(Collectors.toList()); ).distinct().collect(Collectors.toList());
} else { } else {
list = null; list = null;
} }
...@@ -799,7 +786,6 @@ public class SysDictionaryService { ...@@ -799,7 +786,6 @@ public class SysDictionaryService {
@XText("修改字典排序") @XText("修改字典排序")
@XApiPost @XApiPost
public XServiceResult updateDictionarySortById(XContext context, QuerySysDictionaryOutput input) { public XServiceResult updateDictionarySortById(XContext context, QuerySysDictionaryOutput input) {
SysDictionaryViewMapper viewMapper = context.getBean(SysDictionaryViewMapper.class);
SysDictionaryMapper mapper = context.getBean(SysDictionaryMapper.class); SysDictionaryMapper mapper = context.getBean(SysDictionaryMapper.class);
QueryWrapper<SysDictionaryEnt> query = new QueryWrapper(); QueryWrapper<SysDictionaryEnt> query = new QueryWrapper();
//查询当前字典项 //查询当前字典项
...@@ -816,7 +802,7 @@ public class SysDictionaryService { ...@@ -816,7 +802,7 @@ public class SysDictionaryService {
.orderByAsc(SysDictionaryEnt::getSort); .orderByAsc(SysDictionaryEnt::getSort);
} }
List<SysDictionaryEnt> sysDictionaryEnts = mapper.selectList(query); List<SysDictionaryEnt> sysDictionaryEnts = mapper.selectList(query);
Integer sort = 0; Integer sort;
if (ObjectUtils.isNotEmpty(sysDictionaryEnts)) { if (ObjectUtils.isNotEmpty(sysDictionaryEnts)) {
SysDictionaryEnt sysDictionaryEnt1 = sysDictionaryEnts.get(0); SysDictionaryEnt sysDictionaryEnt1 = sysDictionaryEnts.get(0);
//交换排序值 //交换排序值
...@@ -862,9 +848,9 @@ public class SysDictionaryService { ...@@ -862,9 +848,9 @@ public class SysDictionaryService {
queryOrgDic.lambda().eq(SysOrganizationDictionaryEnt::getOuId, RULE_NUMBER_ALIAS) queryOrgDic.lambda().eq(SysOrganizationDictionaryEnt::getOuId, RULE_NUMBER_ALIAS)
.eq(SysOrganizationDictionaryEnt::getParentDicCode, sysDictionary.getId()).gt(SysOrganizationDictionaryEnt::getEndTime, new Date()); .eq(SysOrganizationDictionaryEnt::getParentDicCode, sysDictionary.getId()).gt(SysOrganizationDictionaryEnt::getEndTime, new Date());
List<SysOrganizationDictionaryEnt> sysOrganizationDictionaryEnts = orgDicmapper.selectList(queryOrgDic); List<SysOrganizationDictionaryEnt> sysOrganizationDictionaryEnts = orgDicmapper.selectList(queryOrgDic);
List<String> dicIds = sysOrganizationDictionaryEnts.stream().map(p -> { List<String> dicIds = sysOrganizationDictionaryEnts.stream().map(p ->
return p.getDicCode(); p.getDicCode()
}).collect(Collectors.toList()); ).collect(Collectors.toList());
queryItems.lambda().in(SysDictionaryEnt::getId, dicIds); queryItems.lambda().in(SysDictionaryEnt::getId, dicIds);
} }
queryItems.lambda().eq(SysDictionaryEnt::getPid, sysDictionaryCache.getId()).gt(SysDictionaryEnt::getEndTime, new Date()); queryItems.lambda().eq(SysDictionaryEnt::getPid, sysDictionaryCache.getId()).gt(SysDictionaryEnt::getEndTime, new Date());
...@@ -877,14 +863,11 @@ public class SysDictionaryService { ...@@ -877,14 +863,11 @@ public class SysDictionaryService {
list.add(cache); list.add(cache);
} }
} }
Collections.sort(list, new Comparator<SysDictionaryCache>() { Collections.sort(list, (o1, o2) -> {
@Override if (ObjectUtils.isNotEmpty(o1.getSort()) && ObjectUtils.isNotEmpty(o2.getSort())) {
public int compare(SysDictionaryCache o1, SysDictionaryCache o2) { return o1.getSort() - o2.getSort();
if (ObjectUtils.isNotEmpty(o1.getSort()) && ObjectUtils.isNotEmpty(o2.getSort())) { } else {
return o1.getSort() - o2.getSort(); return o1.getId().compareTo(o2.getId());
} else {
return o1.getId().compareTo(o2.getId());
}
} }
}); });
List<QueryRuleNumberOutput> outputs = XCopyUtils.copyNewList(sysDictionaryList, QueryRuleNumberOutput.class); List<QueryRuleNumberOutput> outputs = XCopyUtils.copyNewList(sysDictionaryList, QueryRuleNumberOutput.class);
...@@ -898,19 +881,16 @@ public class SysDictionaryService { ...@@ -898,19 +881,16 @@ public class SysDictionaryService {
queryOrgDic.lambda().eq(SysOrganizationDictionaryEnt::getOuId, sysDictionaryEnt.getId()) queryOrgDic.lambda().eq(SysOrganizationDictionaryEnt::getOuId, sysDictionaryEnt.getId())
.eq(SysOrganizationDictionaryEnt::getParentDicCode, sysDictionaryEnt.getId()).gt(SysOrganizationDictionaryEnt::getEndTime, new Date()); .eq(SysOrganizationDictionaryEnt::getParentDicCode, sysDictionaryEnt.getId()).gt(SysOrganizationDictionaryEnt::getEndTime, new Date());
List<SysOrganizationDictionaryEnt> sysOrganizationDictionaryEnts = orgDicmapper.selectList(queryOrgDic); List<SysOrganizationDictionaryEnt> sysOrganizationDictionaryEnts = orgDicmapper.selectList(queryOrgDic);
List<String> dicIds = sysOrganizationDictionaryEnts.stream().map(p -> { List<String> dicIds = sysOrganizationDictionaryEnts.stream().map(p ->
return p.getDicCode(); p.getDicCode()
}).collect(Collectors.toList()); ).collect(Collectors.toList());
list = list.stream().filter(i -> dicIds.contains(i.getId())).collect(Collectors.toList()); list = list.stream().filter(i -> dicIds.contains(i.getId())).collect(Collectors.toList());
} }
Collections.sort(list, new Comparator<SysDictionaryCache>() { Collections.sort(list, (o1, o2) -> {
@Override if (ObjectUtils.isNotEmpty(o1.getSort()) && ObjectUtils.isNotEmpty(o2.getSort())) {
public int compare(SysDictionaryCache o1, SysDictionaryCache o2) { return o1.getSort() - o2.getSort();
if (ObjectUtils.isNotEmpty(o1.getSort()) && ObjectUtils.isNotEmpty(o2.getSort())) { } else {
return o1.getSort() - o2.getSort(); return 0;
} else {
return 0;
}
} }
}); });
List<QueryRuleNumberOutput> outputs = new ArrayList<>(); List<QueryRuleNumberOutput> outputs = new ArrayList<>();
...@@ -919,7 +899,6 @@ public class SysDictionaryService { ...@@ -919,7 +899,6 @@ public class SysDictionaryService {
QueryRuleNumberOutput querySysDictionaryViewOutput = XCopyUtils.copyNewObject(sysDictionaryCache, QueryRuleNumberOutput.class); QueryRuleNumberOutput querySysDictionaryViewOutput = XCopyUtils.copyNewObject(sysDictionaryCache, QueryRuleNumberOutput.class);
outputs.add(querySysDictionaryViewOutput); outputs.add(querySysDictionaryViewOutput);
} }
PageInfo<QueryRuleNumberOutput> pageInfo = new PageInfo<>(outputs); PageInfo<QueryRuleNumberOutput> pageInfo = new PageInfo<>(outputs);
return XPageResult.success(outputs, input, pageInfo.getTotal()); return XPageResult.success(outputs, input, pageInfo.getTotal());
} }
...@@ -940,9 +919,7 @@ public class SysDictionaryService { ...@@ -940,9 +919,7 @@ public class SysDictionaryService {
newEnt.setDicKey(PinyinUtil.getPinyin(input.getDicName(), "_")); newEnt.setDicKey(PinyinUtil.getPinyin(input.getDicName(), "_"));
newEnt.updateCreateInfo(context); newEnt.updateCreateInfo(context);
mapper.insert(newEnt); mapper.insert(newEnt);
SysDictionaryCache.deleteCache(context, "rule_number"); SysDictionaryCache.deleteCache(context, "rule_number");
return XServiceResult.OK; return XServiceResult.OK;
} }
...@@ -953,4 +930,4 @@ public class SysDictionaryService { ...@@ -953,4 +930,4 @@ public class SysDictionaryService {
input.setAlias("CODE_GENERATOR_PARAM"); input.setAlias("CODE_GENERATOR_PARAM");
return querySysDictionarysByAlias(context, input); return querySysDictionarysByAlias(context, input);
} }
} }
\ No newline at end of file
...@@ -164,7 +164,6 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService { ...@@ -164,7 +164,6 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
list = list.stream().filter(i -> dicIds.contains(i.getId())).collect(Collectors.toList()); list = list.stream().filter(i -> dicIds.contains(i.getId())).collect(Collectors.toList());
} }
} }
Collections.sort(list, new Comparator<SysDictionaryCache>() { Collections.sort(list, new Comparator<SysDictionaryCache>() {
@Override @Override
...@@ -269,12 +268,10 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService { ...@@ -269,12 +268,10 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService {
if (list.isEmpty()) { if (list.isEmpty()) {
return XListResult.success(resultList); return XListResult.success(resultList);
} }
SysDictionaryEnt parentDictionaryEnt = list.get(0); SysDictionaryEnt parentDictionaryEnt = list.get(0);
list = sysDictionaryMapper.selectList(Builder.create(QueryWrapper.class).build(queryWrapper -> { list = sysDictionaryMapper.selectList(Builder.create(QueryWrapper.class).build(queryWrapper -> {
queryWrapper.eq("pid", parentDictionaryEnt.getId()); queryWrapper.eq("pid", parentDictionaryEnt.getId());
})); }));
resultList = XCopyUtils.copyNewList(list, QuerySysDictionaryViewOutput.class); resultList = XCopyUtils.copyNewList(list, QuerySysDictionaryViewOutput.class);
return XListResult.success(resultList); return XListResult.success(resultList);
} }
...@@ -285,7 +282,7 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService { ...@@ -285,7 +282,7 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService {
return XTransactionHelper.begin(context, () -> { return XTransactionHelper.begin(context, () -> {
SysDictionaryMapper mapper = context.getBean(SysDictionaryMapper.class); SysDictionaryMapper mapper = context.getBean(SysDictionaryMapper.class);
//如果输入的alias为空,查询新增项的上级alias //如果输入的alias为空,查询新增项的上级alias
String alias = ""; String alias;
if (StringUtils.isNotBlank(input.getAlias())) { if (StringUtils.isNotBlank(input.getAlias())) {
alias = input.getAlias(); alias = input.getAlias();
List<SysDictionaryCache> list1 = SysDictionaryCache.list(context, alias); List<SysDictionaryCache> list1 = SysDictionaryCache.list(context, alias);
...@@ -380,7 +377,7 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService { ...@@ -380,7 +377,7 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService {
return XTransactionHelper.begin(context, () -> { return XTransactionHelper.begin(context, () -> {
SysDictionaryMapper mapper = context.getBean(SysDictionaryMapper.class); SysDictionaryMapper mapper = context.getBean(SysDictionaryMapper.class);
//如果输入的alias为空,查询新增项的上级alias //如果输入的alias为空,查询新增项的上级alias
String alias = ""; String alias;
if (StringUtils.isNotBlank(input.getAlias())) { if (StringUtils.isNotBlank(input.getAlias())) {
alias = input.getAlias(); alias = input.getAlias();
List<SysDictionaryCache> list1 = SysDictionaryCache.list(context, alias); List<SysDictionaryCache> list1 = SysDictionaryCache.list(context, alias);
...@@ -495,7 +492,6 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService { ...@@ -495,7 +492,6 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService {
@XText("修改字典排序") @XText("修改字典排序")
@Override @Override
public XServiceResult updateDictionarySortById(XContext context, QuerySysDictionaryOutput input) { public XServiceResult updateDictionarySortById(XContext context, QuerySysDictionaryOutput input) {
SysDictionaryViewMapper viewMapper = context.getBean(SysDictionaryViewMapper.class);
SysDictionaryMapper mapper = context.getBean(SysDictionaryMapper.class); SysDictionaryMapper mapper = context.getBean(SysDictionaryMapper.class);
QueryWrapper<SysDictionaryEnt> query = new QueryWrapper(); QueryWrapper<SysDictionaryEnt> query = new QueryWrapper();
//查询当前字典项 //查询当前字典项
...@@ -512,7 +508,7 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService { ...@@ -512,7 +508,7 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService {
.orderByAsc(SysDictionaryEnt::getSort); .orderByAsc(SysDictionaryEnt::getSort);
} }
List<SysDictionaryEnt> sysDictionaryEnts = mapper.selectList(query); List<SysDictionaryEnt> sysDictionaryEnts = mapper.selectList(query);
Integer sort = 0; Integer sort;
if (ObjectUtils.isNotEmpty(sysDictionaryEnts)) { if (ObjectUtils.isNotEmpty(sysDictionaryEnts)) {
SysDictionaryEnt sysDictionaryEnt1 = sysDictionaryEnts.get(0); SysDictionaryEnt sysDictionaryEnt1 = sysDictionaryEnts.get(0);
//交换排序值 //交换排序值
...@@ -611,4 +607,4 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService { ...@@ -611,4 +607,4 @@ public class SysDictionaryServiceImpl implements SystemDictionaryService {
SysDictionaryCache.deleteCache(context, input.getAlias()); SysDictionaryCache.deleteCache(context, input.getAlias());
return XServiceResult.OK; return XServiceResult.OK;
} }
} }
\ No newline at end of file
...@@ -362,7 +362,6 @@ public class SysInformService { ...@@ -362,7 +362,6 @@ public class SysInformService {
outputs.add(output); outputs.add(output);
} }
} }
return XListResult.success(outputs); return XListResult.success(outputs);
} }
...@@ -419,4 +418,4 @@ public class SysInformService { ...@@ -419,4 +418,4 @@ public class SysInformService {
GetSysOrganizationViewOutput organizationViewOutput = XCopyUtils.copyNewObject(sysOrganizationView, GetSysOrganizationViewOutput.class); GetSysOrganizationViewOutput organizationViewOutput = XCopyUtils.copyNewObject(sysOrganizationView, GetSysOrganizationViewOutput.class);
return organizationViewOutput; return organizationViewOutput;
} }
} }
\ No newline at end of file
...@@ -77,7 +77,6 @@ public class SysInformTemplateReceiveTypeDetailService { ...@@ -77,7 +77,6 @@ public class SysInformTemplateReceiveTypeDetailService {
return XSingleResult.success(output); return XSingleResult.success(output);
} }
@XApiAnonymous @XApiAnonymous
@XApiGet @XApiGet
public XSingleResult<GetSysInformTemplateReceiveTypeDetailViewOutput> getSysInformTemplateReceiveTypeDetailView(XContext context, GetSysInformTemplateReceiveTypeDetailViewInput input) { public XSingleResult<GetSysInformTemplateReceiveTypeDetailViewOutput> getSysInformTemplateReceiveTypeDetailView(XContext context, GetSysInformTemplateReceiveTypeDetailViewInput input) {
...@@ -105,5 +104,4 @@ public class SysInformTemplateReceiveTypeDetailService { ...@@ -105,5 +104,4 @@ public class SysInformTemplateReceiveTypeDetailService {
List<QuerySysInformTemplateReceiveTypeDetailViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QuerySysInformTemplateReceiveTypeDetailViewOutput.class); List<QuerySysInformTemplateReceiveTypeDetailViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QuerySysInformTemplateReceiveTypeDetailViewOutput.class);
return XPageResult.success(outputs, input, pageInfo.getTotal()); return XPageResult.success(outputs, input, pageInfo.getTotal());
} }
}
} \ No newline at end of file
...@@ -104,5 +104,4 @@ public class SysInformTemplateReceiveTypeService { ...@@ -104,5 +104,4 @@ public class SysInformTemplateReceiveTypeService {
List<QuerySysInformTemplateReceiveTypeViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QuerySysInformTemplateReceiveTypeViewOutput.class); List<QuerySysInformTemplateReceiveTypeViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QuerySysInformTemplateReceiveTypeViewOutput.class);
return XPageResult.success(outputs, input, pageInfo.getTotal()); return XPageResult.success(outputs, input, pageInfo.getTotal());
} }
}
} \ No newline at end of file
...@@ -40,7 +40,6 @@ import java.util.stream.Collectors; ...@@ -40,7 +40,6 @@ import java.util.stream.Collectors;
@XService @XService
public class SysMenuService { public class SysMenuService {
@XText("角色列表使用的菜单树") @XText("角色列表使用的菜单树")
@XApiPost @XApiPost
public XListResult<QuerySysMenuOutputTree> getSysMenuTreeRole(XContext context, GetSysMenuInput input) { public XListResult<QuerySysMenuOutputTree> getSysMenuTreeRole(XContext context, GetSysMenuInput input) {
...@@ -63,11 +62,9 @@ public class SysMenuService { ...@@ -63,11 +62,9 @@ public class SysMenuService {
CreateSysDictionaryInput mediaTypesInput = new CreateSysDictionaryInput(); CreateSysDictionaryInput mediaTypesInput = new CreateSysDictionaryInput();
mediaTypesInput.setAlias("MEDIUM_TYPE"); mediaTypesInput.setAlias("MEDIUM_TYPE");
XListResult<QuerySysDictionaryViewOutput> mediaTypes = dictService.querySysDictionarysByAlias(context, mediaTypesInput); XListResult<QuerySysDictionaryViewOutput> mediaTypes = dictService.querySysDictionarysByAlias(context, mediaTypesInput);
CreateSysDictionaryInput businessTypeInput = new CreateSysDictionaryInput(); CreateSysDictionaryInput businessTypeInput = new CreateSysDictionaryInput();
businessTypeInput.setAlias("business_type"); businessTypeInput.setAlias("business_type");
XListResult<QuerySysDictionaryViewOutput> businessTypes = dictService.querySysDictionarysByAlias(context, businessTypeInput); XListResult<QuerySysDictionaryViewOutput> businessTypes = dictService.querySysDictionarysByAlias(context, businessTypeInput);
for (QuerySysMenuOutputTree tree : list) { for (QuerySysMenuOutputTree tree : list) {
//业务类型 //业务类型
if (XStringUtils.isNotEmpty(tree.getMenuType())) { if (XStringUtils.isNotEmpty(tree.getMenuType())) {
...@@ -81,7 +78,6 @@ public class SysMenuService { ...@@ -81,7 +78,6 @@ public class SysMenuService {
tree.setBusinessTypeName(tree.getMenuType()); tree.setBusinessTypeName(tree.getMenuType());
} }
} }
//介质类型 //介质类型
if (XStringUtils.isNotEmpty(tree.getMediaType())) { if (XStringUtils.isNotEmpty(tree.getMediaType())) {
if (mediaTypes.getResult() != null) { if (mediaTypes.getResult() != null) {
...@@ -100,16 +96,13 @@ public class SysMenuService { ...@@ -100,16 +96,13 @@ public class SysMenuService {
String mediaTypeName = buffer.substring(1); String mediaTypeName = buffer.substring(1);
tree.setMediaTypeName(mediaTypeName); tree.setMediaTypeName(mediaTypeName);
} }
} }
if (tree.getMediaTypeName() == null) { if (tree.getMediaTypeName() == null) {
tree.setMediaTypeName(tree.getMediaType()); tree.setMediaTypeName(tree.getMediaType());
} }
} }
} }
List<QuerySysMenuOutputTree> trees = new ArrayList<>(); List<QuerySysMenuOutputTree> trees = new ArrayList<>();
for (QuerySysMenuOutputTree tree : list) { for (QuerySysMenuOutputTree tree : list) {
if (tree.getParentMenuId() == null || "".equals(tree.getParentMenuId())) { if (tree.getParentMenuId() == null || "".equals(tree.getParentMenuId())) {
trees.add(tree); trees.add(tree);
...@@ -129,13 +122,10 @@ public class SysMenuService { ...@@ -129,13 +122,10 @@ public class SysMenuService {
tree.setChildren(children); tree.setChildren(children);
} }
} }
trees = trees.stream().sorted(Comparator.comparing(QuerySysMenuOutputTree::getSort)).collect(Collectors.toList()); trees = trees.stream().sorted(Comparator.comparing(QuerySysMenuOutputTree::getSort)).collect(Collectors.toList());
return XListResult.success(trees); return XListResult.success(trees);
} }
@XText("根据当前用户查询菜单列表树") @XText("根据当前用户查询菜单列表树")
@XApiPost @XApiPost
public XListResult<QuerySysMenuOutputTree> getSysMenuTreeByUserId(XContext context, GetSysMenuInput input) { public XListResult<QuerySysMenuOutputTree> getSysMenuTreeByUserId(XContext context, GetSysMenuInput input) {
...@@ -154,11 +144,9 @@ public class SysMenuService { ...@@ -154,11 +144,9 @@ public class SysMenuService {
CreateSysDictionaryInput mediaTypesInput = new CreateSysDictionaryInput(); CreateSysDictionaryInput mediaTypesInput = new CreateSysDictionaryInput();
mediaTypesInput.setAlias("MEDIUM_TYPE"); mediaTypesInput.setAlias("MEDIUM_TYPE");
XListResult<QuerySysDictionaryViewOutput> mediaTypes = dictService.querySysDictionarysByAlias(context, mediaTypesInput); XListResult<QuerySysDictionaryViewOutput> mediaTypes = dictService.querySysDictionarysByAlias(context, mediaTypesInput);
CreateSysDictionaryInput businessTypeInput = new CreateSysDictionaryInput(); CreateSysDictionaryInput businessTypeInput = new CreateSysDictionaryInput();
businessTypeInput.setAlias("business_type"); businessTypeInput.setAlias("business_type");
XListResult<QuerySysDictionaryViewOutput> businessTypes = dictService.querySysDictionarysByAlias(context, businessTypeInput); XListResult<QuerySysDictionaryViewOutput> businessTypes = dictService.querySysDictionarysByAlias(context, businessTypeInput);
for (QuerySysMenuOutputTree tree : list) { for (QuerySysMenuOutputTree tree : list) {
//业务类型 //业务类型
if (XStringUtils.isNotEmpty(tree.getMenuType())) { if (XStringUtils.isNotEmpty(tree.getMenuType())) {
...@@ -172,7 +160,6 @@ public class SysMenuService { ...@@ -172,7 +160,6 @@ public class SysMenuService {
tree.setBusinessTypeName(tree.getMenuType()); tree.setBusinessTypeName(tree.getMenuType());
} }
} }
//介质类型 //介质类型
if (XStringUtils.isNotEmpty(tree.getMediaType())) { if (XStringUtils.isNotEmpty(tree.getMediaType())) {
if (mediaTypes.getResult() != null) { if (mediaTypes.getResult() != null) {
...@@ -191,16 +178,13 @@ public class SysMenuService { ...@@ -191,16 +178,13 @@ public class SysMenuService {
String mediaTypeName = buffer.substring(1); String mediaTypeName = buffer.substring(1);
tree.setMediaTypeName(mediaTypeName); tree.setMediaTypeName(mediaTypeName);
} }
} }
if (tree.getMediaTypeName() == null) { if (tree.getMediaTypeName() == null) {
tree.setMediaTypeName(tree.getMediaType()); tree.setMediaTypeName(tree.getMediaType());
} }
} }
} }
List<QuerySysMenuOutputTree> trees = new ArrayList<>(); List<QuerySysMenuOutputTree> trees = new ArrayList<>();
for (QuerySysMenuOutputTree tree : list) { for (QuerySysMenuOutputTree tree : list) {
if (tree.getParentMenuId() == null || "".equals(tree.getParentMenuId())) { if (tree.getParentMenuId() == null || "".equals(tree.getParentMenuId())) {
trees.add(tree); trees.add(tree);
...@@ -220,9 +204,7 @@ public class SysMenuService { ...@@ -220,9 +204,7 @@ public class SysMenuService {
tree.setChildren(children); tree.setChildren(children);
} }
} }
trees = trees.stream().sorted(Comparator.comparing(QuerySysMenuOutputTree::getSort)).collect(Collectors.toList()); trees = trees.stream().sorted(Comparator.comparing(QuerySysMenuOutputTree::getSort)).collect(Collectors.toList());
return XListResult.success(trees); return XListResult.success(trees);
} }
...@@ -244,11 +226,9 @@ public class SysMenuService { ...@@ -244,11 +226,9 @@ public class SysMenuService {
CreateSysDictionaryInput mediaTypesInput = new CreateSysDictionaryInput(); CreateSysDictionaryInput mediaTypesInput = new CreateSysDictionaryInput();
mediaTypesInput.setAlias("MEDIUM_TYPE"); mediaTypesInput.setAlias("MEDIUM_TYPE");
XListResult<QuerySysDictionaryViewOutput> mediaTypes = dictService.querySysDictionarysByAlias(context, mediaTypesInput); XListResult<QuerySysDictionaryViewOutput> mediaTypes = dictService.querySysDictionarysByAlias(context, mediaTypesInput);
CreateSysDictionaryInput businessTypeInput = new CreateSysDictionaryInput(); CreateSysDictionaryInput businessTypeInput = new CreateSysDictionaryInput();
businessTypeInput.setAlias("business_type"); businessTypeInput.setAlias("business_type");
XListResult<QuerySysDictionaryViewOutput> businessTypes = dictService.querySysDictionarysByAlias(context, businessTypeInput); XListResult<QuerySysDictionaryViewOutput> businessTypes = dictService.querySysDictionarysByAlias(context, businessTypeInput);
for (QuerySysMenuOutputTree tree : list) { for (QuerySysMenuOutputTree tree : list) {
//业务类型 //业务类型
if (XStringUtils.isNotEmpty(tree.getMenuType())) { if (XStringUtils.isNotEmpty(tree.getMenuType())) {
...@@ -262,7 +242,6 @@ public class SysMenuService { ...@@ -262,7 +242,6 @@ public class SysMenuService {
tree.setBusinessTypeName(tree.getMenuType()); tree.setBusinessTypeName(tree.getMenuType());
} }
} }
//介质类型 //介质类型
if (XStringUtils.isNotEmpty(tree.getMediaType())) { if (XStringUtils.isNotEmpty(tree.getMediaType())) {
if (mediaTypes.getResult() != null) { if (mediaTypes.getResult() != null) {
...@@ -281,16 +260,13 @@ public class SysMenuService { ...@@ -281,16 +260,13 @@ public class SysMenuService {
String mediaTypeName = buffer.substring(1); String mediaTypeName = buffer.substring(1);
tree.setMediaTypeName(mediaTypeName); tree.setMediaTypeName(mediaTypeName);
} }
} }
if (tree.getMediaTypeName() == null) { if (tree.getMediaTypeName() == null) {
tree.setMediaTypeName(tree.getMediaType()); tree.setMediaTypeName(tree.getMediaType());
} }
} }
} }
List<QuerySysMenuOutputTree> trees = new ArrayList<>(); List<QuerySysMenuOutputTree> trees = new ArrayList<>();
for (QuerySysMenuOutputTree tree : list) { for (QuerySysMenuOutputTree tree : list) {
if (tree.getParentMenuId() == null || "".equals(tree.getParentMenuId())) { if (tree.getParentMenuId() == null || "".equals(tree.getParentMenuId())) {
trees.add(tree); trees.add(tree);
...@@ -310,9 +286,7 @@ public class SysMenuService { ...@@ -310,9 +286,7 @@ public class SysMenuService {
tree.setChildren(children); tree.setChildren(children);
} }
} }
trees = trees.stream().sorted(Comparator.comparing(QuerySysMenuOutputTree::getSort)).collect(Collectors.toList()); trees = trees.stream().sorted(Comparator.comparing(QuerySysMenuOutputTree::getSort)).collect(Collectors.toList());
return XListResult.success(trees); return XListResult.success(trees);
} }
...@@ -340,11 +314,9 @@ public class SysMenuService { ...@@ -340,11 +314,9 @@ public class SysMenuService {
CreateSysDictionaryInput mediaTypesInput = new CreateSysDictionaryInput(); CreateSysDictionaryInput mediaTypesInput = new CreateSysDictionaryInput();
mediaTypesInput.setAlias("MEDIUM_TYPE"); mediaTypesInput.setAlias("MEDIUM_TYPE");
XListResult<QuerySysDictionaryViewOutput> mediaTypes = dictService.querySysDictionarysByAlias(context, mediaTypesInput); XListResult<QuerySysDictionaryViewOutput> mediaTypes = dictService.querySysDictionarysByAlias(context, mediaTypesInput);
CreateSysDictionaryInput businessTypeInput = new CreateSysDictionaryInput(); CreateSysDictionaryInput businessTypeInput = new CreateSysDictionaryInput();
businessTypeInput.setAlias("business_type"); businessTypeInput.setAlias("business_type");
XListResult<QuerySysDictionaryViewOutput> businessTypes = dictService.querySysDictionarysByAlias(context, businessTypeInput); XListResult<QuerySysDictionaryViewOutput> businessTypes = dictService.querySysDictionarysByAlias(context, businessTypeInput);
for (QuerySysMenuOutputTree tree : list) { for (QuerySysMenuOutputTree tree : list) {
//业务类型 //业务类型
if (XStringUtils.isNotEmpty(tree.getMenuType())) { if (XStringUtils.isNotEmpty(tree.getMenuType())) {
...@@ -358,7 +330,6 @@ public class SysMenuService { ...@@ -358,7 +330,6 @@ public class SysMenuService {
tree.setBusinessTypeName(tree.getMenuType()); tree.setBusinessTypeName(tree.getMenuType());
} }
} }
//介质类型 //介质类型
if (XStringUtils.isNotEmpty(tree.getMediaType())) { if (XStringUtils.isNotEmpty(tree.getMediaType())) {
if (mediaTypes.getResult() != null) { if (mediaTypes.getResult() != null) {
...@@ -377,13 +348,11 @@ public class SysMenuService { ...@@ -377,13 +348,11 @@ public class SysMenuService {
String mediaTypeName = buffer.substring(1); String mediaTypeName = buffer.substring(1);
tree.setMediaTypeName(mediaTypeName); tree.setMediaTypeName(mediaTypeName);
} }
} }
if (tree.getMediaTypeName() == null) { if (tree.getMediaTypeName() == null) {
tree.setMediaTypeName(tree.getMediaType()); tree.setMediaTypeName(tree.getMediaType());
} }
} }
} }
//判断是否有子集 //判断是否有子集
List<String> parentIds = list.stream().map(QuerySysMenuOutputTree::getId).collect(Collectors.toList()); List<String> parentIds = list.stream().map(QuerySysMenuOutputTree::getId).collect(Collectors.toList());
...@@ -397,7 +366,6 @@ public class SysMenuService { ...@@ -397,7 +366,6 @@ public class SysMenuService {
} }
}); });
list = list.stream().sorted(Comparator.comparing(QuerySysMenuOutputTree::getSort)).collect(Collectors.toList()); list = list.stream().sorted(Comparator.comparing(QuerySysMenuOutputTree::getSort)).collect(Collectors.toList());
return XListResult.success(list); return XListResult.success(list);
} }
...@@ -412,11 +380,9 @@ public class SysMenuService { ...@@ -412,11 +380,9 @@ public class SysMenuService {
CreateSysDictionaryInput mediaTypesInput = new CreateSysDictionaryInput(); CreateSysDictionaryInput mediaTypesInput = new CreateSysDictionaryInput();
mediaTypesInput.setAlias("MEDIUM_TYPE"); mediaTypesInput.setAlias("MEDIUM_TYPE");
XListResult<QuerySysDictionaryViewOutput> mediaTypes = dictService.querySysDictionarysByAlias(context, mediaTypesInput); XListResult<QuerySysDictionaryViewOutput> mediaTypes = dictService.querySysDictionarysByAlias(context, mediaTypesInput);
CreateSysDictionaryInput businessTypeInput = new CreateSysDictionaryInput(); CreateSysDictionaryInput businessTypeInput = new CreateSysDictionaryInput();
businessTypeInput.setAlias("business_type"); businessTypeInput.setAlias("business_type");
XListResult<QuerySysDictionaryViewOutput> businessTypes = dictService.querySysDictionarysByAlias(context, businessTypeInput); XListResult<QuerySysDictionaryViewOutput> businessTypes = dictService.querySysDictionarysByAlias(context, businessTypeInput);
for (QuerySysMenuOutputTree tree : list) { for (QuerySysMenuOutputTree tree : list) {
//业务类型 //业务类型
if (XStringUtils.isNotEmpty(tree.getMenuType())) { if (XStringUtils.isNotEmpty(tree.getMenuType())) {
...@@ -430,7 +396,6 @@ public class SysMenuService { ...@@ -430,7 +396,6 @@ public class SysMenuService {
tree.setBusinessTypeName(tree.getMenuType()); tree.setBusinessTypeName(tree.getMenuType());
} }
} }
//介质类型 //介质类型
if (XStringUtils.isNotEmpty(tree.getMediaType())) { if (XStringUtils.isNotEmpty(tree.getMediaType())) {
if (mediaTypes.getResult() != null) { if (mediaTypes.getResult() != null) {
...@@ -449,16 +414,13 @@ public class SysMenuService { ...@@ -449,16 +414,13 @@ public class SysMenuService {
String mediaTypeName = buffer.substring(1); String mediaTypeName = buffer.substring(1);
tree.setMediaTypeName(mediaTypeName); tree.setMediaTypeName(mediaTypeName);
} }
} }
if (tree.getMediaTypeName() == null) { if (tree.getMediaTypeName() == null) {
tree.setMediaTypeName(tree.getMediaType()); tree.setMediaTypeName(tree.getMediaType());
} }
} }
} }
List<QuerySysMenuOutputTree> trees = new ArrayList<>(); List<QuerySysMenuOutputTree> trees = new ArrayList<>();
for (QuerySysMenuOutputTree tree : list) { for (QuerySysMenuOutputTree tree : list) {
if (tree.getParentMenuId() == null || "".equals(tree.getParentMenuId())) { if (tree.getParentMenuId() == null || "".equals(tree.getParentMenuId())) {
trees.add(tree); trees.add(tree);
...@@ -478,16 +440,13 @@ public class SysMenuService { ...@@ -478,16 +440,13 @@ public class SysMenuService {
tree.setChildren(children); tree.setChildren(children);
} }
} }
trees = trees.stream().sorted(Comparator.comparing(QuerySysMenuOutputTree::getSort)).collect(Collectors.toList()); trees = trees.stream().sorted(Comparator.comparing(QuerySysMenuOutputTree::getSort)).collect(Collectors.toList());
return XListResult.success(trees); return XListResult.success(trees);
} }
@XText("菜单排序") @XText("菜单排序")
@XApiPost @XApiPost
public XServiceResult updateSysMenuSort(XContext context, UpdateSysMenuInput input) throws XServiceException { public XServiceResult updateSysMenuSort(XContext context, UpdateSysMenuInput input) throws XServiceException {
return XTransactionHelper.begin(context, () -> { return XTransactionHelper.begin(context, () -> {
SysMenuMapper mapper = context.getBean(SysMenuMapper.class); SysMenuMapper mapper = context.getBean(SysMenuMapper.class);
QueryWrapper<SysMenuEnt> queryWrapper = new QueryWrapper<>(); QueryWrapper<SysMenuEnt> queryWrapper = new QueryWrapper<>();
...@@ -496,7 +455,6 @@ public class SysMenuService { ...@@ -496,7 +455,6 @@ public class SysMenuService {
if (entity == null) { if (entity == null) {
return XServiceResult.error(context, XError.NotFound); return XServiceResult.error(context, XError.NotFound);
} }
Integer entitySort = entity.getSort(); Integer entitySort = entity.getSort();
QueryWrapper<SysMenuEnt> neighborQueryWrapper = new QueryWrapper<>(); QueryWrapper<SysMenuEnt> neighborQueryWrapper = new QueryWrapper<>();
neighborQueryWrapper.lambda().eq(SysMenuEnt::getParentMenuId, entity.getParentMenuId()); neighborQueryWrapper.lambda().eq(SysMenuEnt::getParentMenuId, entity.getParentMenuId());
...@@ -510,7 +468,6 @@ public class SysMenuService { ...@@ -510,7 +468,6 @@ public class SysMenuService {
neighborQueryWrapper.lambda().ge(SysMenuEnt::getSort, entitySort); neighborQueryWrapper.lambda().ge(SysMenuEnt::getSort, entitySort);
neighborQueryWrapper.lambda().orderByAsc(SysMenuEnt::getSort); neighborQueryWrapper.lambda().orderByAsc(SysMenuEnt::getSort);
} }
List<SysMenuEnt> sysMenuEnts = mapper.selectList(neighborQueryWrapper); List<SysMenuEnt> sysMenuEnts = mapper.selectList(neighborQueryWrapper);
PpsUserSession session = context.getSession(PpsUserSession.class); PpsUserSession session = context.getSession(PpsUserSession.class);
if (!CollectionUtils.isEmpty(sysMenuEnts) && sysMenuEnts.size() > 1) { if (!CollectionUtils.isEmpty(sysMenuEnts) && sysMenuEnts.size() > 1) {
...@@ -525,14 +482,12 @@ public class SysMenuService { ...@@ -525,14 +482,12 @@ public class SysMenuService {
neighborEntSort += 1; neighborEntSort += 1;
} }
} }
//上方或下方有数据进行交换序号 //上方或下方有数据进行交换序号
neighborEnt.setSort(entitySort); neighborEnt.setSort(entitySort);
neighborEnt.setModifyTime(new Date()); neighborEnt.setModifyTime(new Date());
neighborEnt.setModifyById(session.getId()); neighborEnt.setModifyById(session.getId());
neighborEnt.setModifyByName(session.getUserName()); neighborEnt.setModifyByName(session.getUserName());
mapper.updateById(neighborEnt); mapper.updateById(neighborEnt);
entity.setSort(neighborEntSort); entity.setSort(neighborEntSort);
} }
entity.setModifyTime(new Date()); entity.setModifyTime(new Date());
...@@ -553,17 +508,14 @@ public class SysMenuService { ...@@ -553,17 +508,14 @@ public class SysMenuService {
}); });
} }
@XText("新增菜单") @XText("新增菜单")
@XApiPost @XApiPost
public XServiceResult createSysMenu(XContext context, CreateSysMenuInput input) throws XServiceException { public XServiceResult createSysMenu(XContext context, CreateSysMenuInput input) throws XServiceException {
return XTransactionHelper.begin(context, () -> { return XTransactionHelper.begin(context, () -> {
SysMenuMapper mapper = context.getBean(SysMenuMapper.class); SysMenuMapper mapper = context.getBean(SysMenuMapper.class);
SysMenuViewMapper viewMapper = context.getBean(SysMenuViewMapper.class); SysMenuViewMapper viewMapper = context.getBean(SysMenuViewMapper.class);
SysMenuEnt entity = new SysMenuEnt(); SysMenuEnt entity = new SysMenuEnt();
XCopyUtils.copyObject(input, entity); XCopyUtils.copyObject(input, entity);
if (entity.getSort() == null) { if (entity.getSort() == null) {
SysMenuView relView = viewMapper.selectMaxSort(entity.getParentMenuId()); SysMenuView relView = viewMapper.selectMaxSort(entity.getParentMenuId());
if (relView != null) { if (relView != null) {
...@@ -585,7 +537,6 @@ public class SysMenuService { ...@@ -585,7 +537,6 @@ public class SysMenuService {
}); });
} }
} }
if (entity.getParentMenuId() == null || "".equals(entity.getParentMenuId())) { if (entity.getParentMenuId() == null || "".equals(entity.getParentMenuId())) {
entity.setLevel("1"); entity.setLevel("1");
} }
...@@ -594,12 +545,10 @@ public class SysMenuService { ...@@ -594,12 +545,10 @@ public class SysMenuService {
if (session != null) { if (session != null) {
entity.setCreateById(session.getId()); entity.setCreateById(session.getId());
entity.setCreateByName(session.getUserName()); entity.setCreateByName(session.getUserName());
} }
entity.setMediaType("ALL"); entity.setMediaType("ALL");
entity.setShowChildren(false); entity.setShowChildren(false);
mapper.insert(entity); mapper.insert(entity);
//返回执行成功的结果,事务提交 //返回执行成功的结果,事务提交
return XServiceResult.OK; return XServiceResult.OK;
}); });
...@@ -623,7 +572,6 @@ public class SysMenuService { ...@@ -623,7 +572,6 @@ public class SysMenuService {
@XText("修改菜单信息") @XText("修改菜单信息")
@XApiPost @XApiPost
public XServiceResult updateSysMenu(XContext context, UpdateSysMenuInput input) throws XServiceException { public XServiceResult updateSysMenu(XContext context, UpdateSysMenuInput input) throws XServiceException {
return XTransactionHelper.begin(context, () -> { return XTransactionHelper.begin(context, () -> {
SysMenuMapper mapper = context.getBean(SysMenuMapper.class); SysMenuMapper mapper = context.getBean(SysMenuMapper.class);
SysMenuViewMapper viewMapper = context.getBean(SysMenuViewMapper.class); SysMenuViewMapper viewMapper = context.getBean(SysMenuViewMapper.class);
...@@ -652,13 +600,11 @@ public class SysMenuService { ...@@ -652,13 +600,11 @@ public class SysMenuService {
//返回执行成功的结果,事务提交 //返回执行成功的结果,事务提交
return XServiceResult.OK; return XServiceResult.OK;
}); });
} }
@XText("删除菜单") @XText("删除菜单")
@XApiPost @XApiPost
public XServiceResult deleteSysMenu(XContext context, DeleteSysMenuInput input) throws XServiceException { public XServiceResult deleteSysMenu(XContext context, DeleteSysMenuInput input) throws XServiceException {
return XTransactionHelper.begin(context, () -> { return XTransactionHelper.begin(context, () -> {
SysMenuMapper mapper = context.getBean(SysMenuMapper.class); SysMenuMapper mapper = context.getBean(SysMenuMapper.class);
QueryWrapper<SysMenuEnt> queryWrapper = new QueryWrapper<>(); QueryWrapper<SysMenuEnt> queryWrapper = new QueryWrapper<>();
...@@ -675,7 +621,6 @@ public class SysMenuService { ...@@ -675,7 +621,6 @@ public class SysMenuService {
} else { } else {
return XServiceResult.error(context, MenuError.NotDelete); return XServiceResult.error(context, MenuError.NotDelete);
} }
//返回执行成功的结果,事务提交 //返回执行成功的结果,事务提交
return XServiceResult.OK; return XServiceResult.OK;
}); });
...@@ -769,4 +714,4 @@ public class SysMenuService { ...@@ -769,4 +714,4 @@ public class SysMenuService {
List<QuerySysUserMenuViewOutput> outputs = XCopyUtils.copyNewList(list.stream().filter(item -> !item.getUrl().contains("#")).collect(Collectors.toList()), QuerySysUserMenuViewOutput.class); List<QuerySysUserMenuViewOutput> outputs = XCopyUtils.copyNewList(list.stream().filter(item -> !item.getUrl().contains("#")).collect(Collectors.toList()), QuerySysUserMenuViewOutput.class);
return XListResult.success(outputs); return XListResult.success(outputs);
} }
} }
\ No newline at end of file
...@@ -20,7 +20,6 @@ public class SysMenuUserCloudServiceImpl implements SysMenuUserCloudService { ...@@ -20,7 +20,6 @@ public class SysMenuUserCloudServiceImpl implements SysMenuUserCloudService {
@Override @Override
public XListResult<GetSysMenuUserViewOutput> selectMenuListByUserId(XContext context, GetSysMenuUserViewInput input) { public XListResult<GetSysMenuUserViewOutput> selectMenuListByUserId(XContext context, GetSysMenuUserViewInput input) {
SysMenuViewMapper menuViewMapper = context.getBean(SysMenuViewMapper.class); SysMenuViewMapper menuViewMapper = context.getBean(SysMenuViewMapper.class);
PpsUserSession session = context.getSession(PpsUserSession.class); PpsUserSession session = context.getSession(PpsUserSession.class);
SysMenuView menuView = new SysMenuView(); SysMenuView menuView = new SysMenuView();
......
...@@ -35,7 +35,6 @@ import static pps.core.system.error.OrganizationError.PARAM_EMPTY; ...@@ -35,7 +35,6 @@ import static pps.core.system.error.OrganizationError.PARAM_EMPTY;
@XService @XService
public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudService { public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudService {
@Override @Override
public XSingleResult<GetSysOrganizationViewOutput> getSysOrganizationById(XContext context, GetSysOrganizationViewInput input) { public XSingleResult<GetSysOrganizationViewOutput> getSysOrganizationById(XContext context, GetSysOrganizationViewInput input) {
SysOrganizationMapper mapper = context.getBean(SysOrganizationMapper.class); SysOrganizationMapper mapper = context.getBean(SysOrganizationMapper.class);
...@@ -52,7 +51,6 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ ...@@ -52,7 +51,6 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ
SysOrganizationMapper mapper = context.getBean(SysOrganizationMapper.class); SysOrganizationMapper mapper = context.getBean(SysOrganizationMapper.class);
List<SysOrganizationEnt> list = mapper.selectBatchIds(input.getIds()); List<SysOrganizationEnt> list = mapper.selectBatchIds(input.getIds());
List<GetSysOrganizationViewOutput> outputs = XCopyUtils.copyNewList(list, GetSysOrganizationViewOutput.class); List<GetSysOrganizationViewOutput> outputs = XCopyUtils.copyNewList(list, GetSysOrganizationViewOutput.class);
return XListResult.success(outputs); return XListResult.success(outputs);
} }
...@@ -71,7 +69,6 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ ...@@ -71,7 +69,6 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ
@Override @Override
public XSingleResult<GetSysOrganizationViewOutput> getSysOrganizationByOuLevelAndOuId(XContext context, GetSysOrganizationViewInput input) { public XSingleResult<GetSysOrganizationViewOutput> getSysOrganizationByOuLevelAndOuId(XContext context, GetSysOrganizationViewInput input) {
SysOrganizationViewMapper viewMapper = context.getBean(SysOrganizationViewMapper.class); SysOrganizationViewMapper viewMapper = context.getBean(SysOrganizationViewMapper.class);
SysOrganizationView view = new SysOrganizationView(); SysOrganizationView view = new SysOrganizationView();
XCopyUtils.copyObject(input, view); XCopyUtils.copyObject(input, view);
...@@ -88,7 +85,6 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ ...@@ -88,7 +85,6 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ
@Override @Override
public XSingleResult<GetSysOrganizationViewOutput> getSysOrganizationByOuLevelAndUserId(XContext context, GetSysOrganizationViewInput input) { public XSingleResult<GetSysOrganizationViewOutput> getSysOrganizationByOuLevelAndUserId(XContext context, GetSysOrganizationViewInput input) {
SysOrganizationViewMapper viewMapper = context.getBean(SysOrganizationViewMapper.class); SysOrganizationViewMapper viewMapper = context.getBean(SysOrganizationViewMapper.class);
SysOrganizationView view = new SysOrganizationView(); SysOrganizationView view = new SysOrganizationView();
XCopyUtils.copyObject(input, view); XCopyUtils.copyObject(input, view);
...@@ -99,10 +95,8 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ ...@@ -99,10 +95,8 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ
return XSingleResult.success(output); return XSingleResult.success(output);
} }
@Override @Override
public XListResult<GetSysOrganizationViewOutput> getSysOrganizationListByOuLevelAndUserId(XContext context, GetSysOrganizationViewInput input) { public XListResult<GetSysOrganizationViewOutput> getSysOrganizationListByOuLevelAndUserId(XContext context, GetSysOrganizationViewInput input) {
SysOrganizationViewMapper viewMapper = context.getBean(SysOrganizationViewMapper.class); SysOrganizationViewMapper viewMapper = context.getBean(SysOrganizationViewMapper.class);
SysOrganizationView view = new SysOrganizationView(); SysOrganizationView view = new SysOrganizationView();
XCopyUtils.copyObject(input, view); XCopyUtils.copyObject(input, view);
...@@ -133,8 +127,6 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ ...@@ -133,8 +127,6 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ
SysUserOrganizationRelMapper mapper = context.getBean(SysUserOrganizationRelMapper.class); SysUserOrganizationRelMapper mapper = context.getBean(SysUserOrganizationRelMapper.class);
SysOrganizationMapper sysOrganizationMapper = context.getBean(SysOrganizationMapper.class); SysOrganizationMapper sysOrganizationMapper = context.getBean(SysOrganizationMapper.class);
SysOrganizationRelMapper sysOrganizationRelMapper = context.getBean(SysOrganizationRelMapper.class); SysOrganizationRelMapper sysOrganizationRelMapper = context.getBean(SysOrganizationRelMapper.class);
QueryWrapper<SysUserOrganizationRelEnt> wrapper = new QueryWrapper<>(); QueryWrapper<SysUserOrganizationRelEnt> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(SysUserOrganizationRelEnt::getUserId, input.getUserId()) wrapper.lambda().eq(SysUserOrganizationRelEnt::getUserId, input.getUserId())
.le(SysUserOrganizationRelEnt::getEffectTime, new Date()) .le(SysUserOrganizationRelEnt::getEffectTime, new Date())
...@@ -149,7 +141,6 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ ...@@ -149,7 +141,6 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ
SysOrganizationEnt sysOrganizationEnt = sysOrganizationMapper.selectOne(queryWrapper); SysOrganizationEnt sysOrganizationEnt = sysOrganizationMapper.selectOne(queryWrapper);
XCopyUtils.copyObject(sysOrganizationEnt, output); XCopyUtils.copyObject(sysOrganizationEnt, output);
output.setOuId(relEnts.get(0).getOuId()); output.setOuId(relEnts.get(0).getOuId());
QueryWrapper<SysOrganizationRelEnt> qw = new QueryWrapper<>(); QueryWrapper<SysOrganizationRelEnt> qw = new QueryWrapper<>();
qw.lambda().eq(SysOrganizationRelEnt::getOuId, relEnts.get(0).getOuId()) qw.lambda().eq(SysOrganizationRelEnt::getOuId, relEnts.get(0).getOuId())
.le(SysOrganizationRelEnt::getEffectTime, new Date()) .le(SysOrganizationRelEnt::getEffectTime, new Date())
...@@ -197,10 +188,8 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ ...@@ -197,10 +188,8 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ
queryWrapper.lambda().lt(SysOrganizationRelEnt::getEffectTime, new Date()); queryWrapper.lambda().lt(SysOrganizationRelEnt::getEffectTime, new Date());
queryWrapper.lambda().gt(SysOrganizationRelEnt::getEndTime, new Date()); queryWrapper.lambda().gt(SysOrganizationRelEnt::getEndTime, new Date());
SysOrganizationRelEnt relEnt = mapper.selectOne(queryWrapper); SysOrganizationRelEnt relEnt = mapper.selectOne(queryWrapper);
SysOrganizationMapper orgMapper = context.getBean(SysOrganizationMapper.class); SysOrganizationMapper orgMapper = context.getBean(SysOrganizationMapper.class);
SysOrganizationEnt sysOrganizationEnt = orgMapper.selectById(relEnt.getParentOuId()); SysOrganizationEnt sysOrganizationEnt = orgMapper.selectById(relEnt.getParentOuId());
GetSysOrganizationViewOutput output = new GetSysOrganizationViewOutput(); GetSysOrganizationViewOutput output = new GetSysOrganizationViewOutput();
XCopyUtils.copyObject(sysOrganizationEnt, output); XCopyUtils.copyObject(sysOrganizationEnt, output);
return XSingleResult.success(output); return XSingleResult.success(output);
...@@ -240,7 +229,6 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ ...@@ -240,7 +229,6 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ
return XListResult.success(list); return XListResult.success(list);
} }
@XText("根据用户id获取用户组织机构") @XText("根据用户id获取用户组织机构")
public XListResult<OuIdAndOutNameOutput> getOrgListByUserId(XContext context, QueryUserIdInput input) { public XListResult<OuIdAndOutNameOutput> getOrgListByUserId(XContext context, QueryUserIdInput input) {
SysUserOrganizationRelViewMapper mapper = context.getBean(SysUserOrganizationRelViewMapper.class); SysUserOrganizationRelViewMapper mapper = context.getBean(SysUserOrganizationRelViewMapper.class);
...@@ -364,7 +352,6 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ ...@@ -364,7 +352,6 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ
@Override @Override
public XListResult<GetSysOrganizationViewOutput> queryOuInfoOrStationByParentOuId(XContext context) { public XListResult<GetSysOrganizationViewOutput> queryOuInfoOrStationByParentOuId(XContext context) {
PpsUserSession session = context.getSession(PpsUserSession.class); PpsUserSession session = context.getSession(PpsUserSession.class);
SysOrganizationService organizationService = context.getBean(SysOrganizationService.class); SysOrganizationService organizationService = context.getBean(SysOrganizationService.class);
GetSysOrganizationRelInput organizationRelInput = new GetSysOrganizationRelInput(); GetSysOrganizationRelInput organizationRelInput = new GetSysOrganizationRelInput();
organizationRelInput.setParentOuId(session.getOuId()); organizationRelInput.setParentOuId(session.getOuId());
...@@ -407,4 +394,4 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ ...@@ -407,4 +394,4 @@ public class SysOrganizationCloudServiceImpl implements SysOrganizationCloudServ
); );
return XListResult.success(XCopyUtils.copyNewList(plant, GetSysOrganizationViewOutput.class)); return XListResult.success(XCopyUtils.copyNewList(plant, GetSysOrganizationViewOutput.class));
} }
} }
\ No newline at end of file
...@@ -113,7 +113,6 @@ public class SysOrganizationDictionaryService { ...@@ -113,7 +113,6 @@ public class SysOrganizationDictionaryService {
} }
} }
} }
return XServiceResult.OK; return XServiceResult.OK;
}); });
} }
...@@ -143,9 +142,9 @@ public class SysOrganizationDictionaryService { ...@@ -143,9 +142,9 @@ 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(p ->
return p.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);
if (StringUtils.isNotBlank(input.getOuId())) { if (StringUtils.isNotBlank(input.getOuId())) {
...@@ -242,9 +241,8 @@ public class SysOrganizationDictionaryService { ...@@ -242,9 +241,8 @@ public class SysOrganizationDictionaryService {
SysDictionaryMapper dictionaryMapper = context.getBean(SysDictionaryMapper.class); SysDictionaryMapper dictionaryMapper = context.getBean(SysDictionaryMapper.class);
SysOrganizationCloudService orgService = context.getBean(SysOrganizationCloudService.class); SysOrganizationCloudService orgService = context.getBean(SysOrganizationCloudService.class);
SysDictionaryViewMapper dictionaryViewMapper = context.getBean(SysDictionaryViewMapper.class); SysDictionaryViewMapper dictionaryViewMapper = context.getBean(SysDictionaryViewMapper.class);
SysOrganizationDictionaryMapper orgDictionaryMapper = context.getBean(SysOrganizationDictionaryMapper.class);
List<QuerySysDictionaryViewOutput> outputs = new ArrayList<>(); List<QuerySysDictionaryViewOutput> outputs = new ArrayList<>();
List<SysDictionaryView> dictionaryViews = new ArrayList<>(); List<SysDictionaryView> dictionaryViews;
Integer dictionaryItems = 0; Integer dictionaryItems = 0;
PageInfo<SysDictionaryView> pageInfo = new PageInfo<>(); PageInfo<SysDictionaryView> pageInfo = new PageInfo<>();
pageInfo.setPageNum(input.getPage()); pageInfo.setPageNum(input.getPage());
...@@ -307,9 +305,9 @@ public class SysOrganizationDictionaryService { ...@@ -307,9 +305,9 @@ 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(p ->
return p.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);
...@@ -358,4 +356,4 @@ public class SysOrganizationDictionaryService { ...@@ -358,4 +356,4 @@ public class SysOrganizationDictionaryService {
List<SysOrganizationDictionaryEnt> sysOrganizationDictionaryEnts = mapper.selectList(queryWrapper); List<SysOrganizationDictionaryEnt> sysOrganizationDictionaryEnts = mapper.selectList(queryWrapper);
return XListResult.success(sysOrganizationDictionaryEnts); return XListResult.success(sysOrganizationDictionaryEnts);
} }
} }
\ No newline at end of file
...@@ -54,7 +54,6 @@ public class SysOrganizationPropertyService { ...@@ -54,7 +54,6 @@ public class SysOrganizationPropertyService {
.le(true, SysOrganizationPropertyEnt::getEffectTime, date) .le(true, SysOrganizationPropertyEnt::getEffectTime, date)
.ge(true, SysOrganizationPropertyEnt::getEndTime, date); .ge(true, SysOrganizationPropertyEnt::getEndTime, date);
} else { } else {
List<GetSysOrganizationPropertyOutput> list = new ArrayList<>(); List<GetSysOrganizationPropertyOutput> list = new ArrayList<>();
for (QuerySysDictionaryViewOutput viewOutput : mediaTypesResult) { for (QuerySysDictionaryViewOutput viewOutput : mediaTypesResult) {
GetSysOrganizationPropertyOutput output = new GetSysOrganizationPropertyOutput(); GetSysOrganizationPropertyOutput output = new GetSysOrganizationPropertyOutput();
...@@ -81,7 +80,6 @@ public class SysOrganizationPropertyService { ...@@ -81,7 +80,6 @@ public class SysOrganizationPropertyService {
return XListResult.success(outputs); return XListResult.success(outputs);
} }
@XApiPost @XApiPost
public XListResult<QuerySysOrganizationPropertyOutput> query(XContext context, QuerySysOrganizationPropertyInput input) { public XListResult<QuerySysOrganizationPropertyOutput> query(XContext context, QuerySysOrganizationPropertyInput input) {
//普通角色只查询所属企业的介质类型 //普通角色只查询所属企业的介质类型
...@@ -133,7 +131,6 @@ public class SysOrganizationPropertyService { ...@@ -133,7 +131,6 @@ public class SysOrganizationPropertyService {
return XServiceResult.OK; return XServiceResult.OK;
} }
@XApiGet @XApiGet
public XPageResult<QuerySysOrganizationPropertyOutput> querySysOrganizationProperty(XContext context, QuerySysOrganizationPropertyInput input) { public XPageResult<QuerySysOrganizationPropertyOutput> querySysOrganizationProperty(XContext context, QuerySysOrganizationPropertyInput input) {
SysOrganizationPropertyMapper mapper = context.getBean(SysOrganizationPropertyMapper.class); SysOrganizationPropertyMapper mapper = context.getBean(SysOrganizationPropertyMapper.class);
...@@ -159,7 +156,6 @@ public class SysOrganizationPropertyService { ...@@ -159,7 +156,6 @@ public class SysOrganizationPropertyService {
return XMapperHelper.query(mapper, input, SysOrganizationPropertyEnt.class, QuerySysOrganizationPropertyOutput.class); return XMapperHelper.query(mapper, input, SysOrganizationPropertyEnt.class, QuerySysOrganizationPropertyOutput.class);
} }
@XApiGet @XApiGet
public XPageResult<QuerySysOrganizationPropertyViewOutput> querySysOrganizationPropertyView(XContext context, QuerySysOrganizationPropertyViewInput input) { public XPageResult<QuerySysOrganizationPropertyViewOutput> querySysOrganizationPropertyView(XContext context, QuerySysOrganizationPropertyViewInput input) {
SysOrganizationPropertyViewMapper mapper = context.getBean(SysOrganizationPropertyViewMapper.class); SysOrganizationPropertyViewMapper mapper = context.getBean(SysOrganizationPropertyViewMapper.class);
...@@ -171,5 +167,4 @@ public class SysOrganizationPropertyService { ...@@ -171,5 +167,4 @@ public class SysOrganizationPropertyService {
List<QuerySysOrganizationPropertyViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QuerySysOrganizationPropertyViewOutput.class); List<QuerySysOrganizationPropertyViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QuerySysOrganizationPropertyViewOutput.class);
return XPageResult.success(outputs, input, pageInfo.getTotal()); return XPageResult.success(outputs, input, pageInfo.getTotal());
} }
}
} \ No newline at end of file
...@@ -25,6 +25,7 @@ import java.util.List; ...@@ -25,6 +25,7 @@ import java.util.List;
@XService @XService
public class SysOrganizationRelService { public class SysOrganizationRelService {
@XApiAnonymous @XApiAnonymous
@XApiPost @XApiPost
public XServiceResult createSysOrganizationRel(XContext context, CreateSysOrganizationRelInput input) { public XServiceResult createSysOrganizationRel(XContext context, CreateSysOrganizationRelInput input) {
...@@ -35,7 +36,6 @@ public class SysOrganizationRelService { ...@@ -35,7 +36,6 @@ public class SysOrganizationRelService {
return XServiceResult.OK; return XServiceResult.OK;
} }
@XApiAnonymous @XApiAnonymous
@XApiPost @XApiPost
public XServiceResult deleteSysOrganizationRel(XContext context, DeleteSysOrganizationRelInput input) { public XServiceResult deleteSysOrganizationRel(XContext context, DeleteSysOrganizationRelInput input) {
...@@ -122,5 +122,4 @@ public class SysOrganizationRelService { ...@@ -122,5 +122,4 @@ public class SysOrganizationRelService {
List<QuerySysOrganizationRelViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QuerySysOrganizationRelViewOutput.class); List<QuerySysOrganizationRelViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QuerySysOrganizationRelViewOutput.class);
return XPageResult.success(outputs, input, pageInfo.getTotal()); return XPageResult.success(outputs, input, pageInfo.getTotal());
} }
}
} \ No newline at end of file
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