Commit 28633788 authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.天气数据接收定时任务,解决代码扫描问题,修改文件读取相关代码,解决资源未关流问题;
2.修改登录验证码生成工具类,解决代码扫描问题,修复随机数不安全问题;
3.删除除主程序启动类外其他启动类模块,解决代码扫描问题;
4.删除自定义httputlis类,解决代码扫描问题,替换部分代码远程调用方法;
5.重构光伏预测模块下载电站实际发电数据导入模板接口,解决代码扫描问题;
6.重构光伏预测模块导入电站实际发电数据接口,解决代码扫描问题;
7.删除公用excel导入导出工具类及poi相关pom依赖,解决代码扫描问题;
8.光伏功率预测模块,增加查询线路列表接口,解决页面接口报错问题;
9.增加测试用历史数据导入接口;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 596fafea
......@@ -78,22 +78,13 @@ public class SysUserService {
return XTransactionHelper.begin(context, () -> {
SysUserMapper mapper = context.getBean(SysUserMapper.class);
//查询是否存在相同的登录名,如果存在,提示错误信息
List<SysUserEnt> isExit = mapper.selectList(new LambdaQueryWrapper<SysUserEnt>()
Long count = mapper.selectCount(new LambdaQueryWrapper<SysUserEnt>()
.eq(SysUserEnt::getLoginName, input.getLoginName()));
if (CollUtil.isNotEmpty(isExit)) {
if (count > 0) {
return XServiceResult.error(context, LoginError.Account_Already_Exists);
}
//查询是否存在有相同的Iam登录名,如果存在,提示错误信息
if (CharSequenceUtil.isNotBlank(input.getIamLoginName())) {
List<SysUserEnt> isIamExit = mapper.selectList(new LambdaQueryWrapper<SysUserEnt>()
.eq(SysUserEnt::getIamLoginName, input.getIamLoginName()));
if (CollUtil.isNotEmpty(isIamExit)) {
return XServiceResult.error(context, LoginError.Already_Exists_IAM);
}
}
SysUserEnt entity = new SysUserEnt();
XCopyUtils.copyObject(input, entity);
entity.setPassword(input.getPassword());
String uuid = BaseUtils.randomUUIDString();
entity.setId(uuid);
PpsUserSession session = context.getSession(PpsUserSession.class);
......@@ -141,37 +132,25 @@ public class SysUserService {
public XServiceResult updateSysUser(XContext context, UpdateSysUserInput input) throws XServiceException {
return XTransactionHelper.begin(context, () -> {
SysUserMapper mapper = context.getBean(SysUserMapper.class);
QueryWrapper<SysUserEnt> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SysUserEnt::getId, input.getId());
SysUserEnt entity = mapper.selectOne(queryWrapper);
SysUserEnt entity = mapper.selectById(input.getId());
if (ObjectUtil.isNull(entity)) {
return XServiceResult.error(context, XError.NotFound);
}
//查询是否存在相同的登录名,如果存在,提示错误信息
queryWrapper.clear();
queryWrapper.lambda().eq(SysUserEnt::getLoginName, input.getLoginName());
List<SysUserEnt> isExit = mapper.selectList(queryWrapper);
if (CollUtil.isNotEmpty(isExit) && (isExit.size() > 1 || !CharSequenceUtil.equals(isExit.get(0).getId(), input.getId()))) {
Long count = mapper.selectCount(new LambdaQueryWrapper<SysUserEnt>()
.eq(SysUserEnt::getLoginName, input.getLoginName())
.ne(SysUserEnt::getId, input.getId())
);
if (count > 0) {
return XServiceResult.error(context, LoginError.Account_Already_Exists);
}
//查询是否存在有相同的Iam登录名,如果存在,提示错误信息
if (CharSequenceUtil.isNotBlank(input.getIamLoginName())) {
queryWrapper.clear();
queryWrapper.lambda().eq(SysUserEnt::getIamLoginName, input.getIamLoginName());
List<SysUserEnt> isIamExit = mapper.selectList(queryWrapper);
if (CollUtil.isNotEmpty(isIamExit) && (isIamExit.size() > 1 || !CharSequenceUtil.equals(isIamExit.get(0).getId(), input.getId()))) {
return XServiceResult.error(context, LoginError.Already_Exists_IAM);
}
}
XCopyUtils.copyObject(input, entity);
if (CharSequenceUtil.isNotBlank(entity.getPassword())) {
entity.setUserCode(input.getUserCode());
entity.setUserName(input.getUserName());
entity.setAddress(input.getAddress());
if (CharSequenceUtil.isNotBlank(input.getPassword())) {
entity.setPassword(input.getPassword());
}
entity.setModifyTime(new Date());
PpsUserSession session = context.getSession(PpsUserSession.class);
if (ObjectUtil.isNotNull(session)) {
entity.setModifyById(session.getId());
entity.setModifyByName(session.getUserName());
} else {
entity.setPassword(null);
}
//加密敏感信息
if (CharSequenceUtil.isNotBlank(input.getPhone()) && !CharSequenceUtil.contains(input.getPhone(), '*')) {
......@@ -189,6 +168,10 @@ public class SysUserService {
} else {
entity.setEmail(null);
}
entity.setModifyTime(new Date());
PpsUserSession session = context.getSession(PpsUserSession.class);
entity.setModifyById(session.getId());
entity.setModifyByName(session.getUserName());
mapper.updateById(entity);
//修改用户和组织机构关系为失效
updateSysUserOrganizationRel(context, input.getId(), input.getOuId(), session, "update");
......
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