Commit 580ed807 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 2cde354e
...@@ -183,11 +183,11 @@ public class LoginService { ...@@ -183,11 +183,11 @@ public class LoginService {
} }
private void checkCode(XContext context, String code, String codeIden) { private void checkCode(XContext context, String code, String codeIden) {
if (code == null) { if (CharSequenceUtil.isBlank(code)) {
throw new XServiceException(context, LoginError.NotExistCode); throw new XServiceException(context, LoginError.NotExistCode);
} }
LoginVerCodeCache isUse = LoginVerCodeCache.exist(context, codeIden); LoginVerCodeCache isUse = LoginVerCodeCache.exist(context, codeIden);
if (isUse == null) { if (ObjectUtil.isNull(isUse)) {
throw new XServiceException(context, LoginError.NotUsedCode); throw new XServiceException(context, LoginError.NotUsedCode);
} }
if (!CharSequenceUtil.equalsAnyIgnoreCase(isUse.getCode(), code)) { if (!CharSequenceUtil.equalsAnyIgnoreCase(isUse.getCode(), code)) {
...@@ -224,7 +224,7 @@ public class LoginService { ...@@ -224,7 +224,7 @@ public class LoginService {
queryWrapper.lambda().eq(SysUserLoginLogEnt::getLoginName, loginName); queryWrapper.lambda().eq(SysUserLoginLogEnt::getLoginName, loginName);
queryWrapper.lambda().ge(SysUserLoginLogEnt::getCreateTime, XDateUtils.getDayBeginTime(new Date())); queryWrapper.lambda().ge(SysUserLoginLogEnt::getCreateTime, XDateUtils.getDayBeginTime(new Date()));
Long count = userLoginLogMapper.selectCount(queryWrapper); Long count = userLoginLogMapper.selectCount(queryWrapper);
if (count >= 5 && sysUserEnt != null) { if (count >= 5 && ObjectUtil.isNotNull(sysUserEnt)) {
SysUserMapper mapper = context.getBean(SysUserMapper.class); SysUserMapper mapper = context.getBean(SysUserMapper.class);
sysUserEnt.setStatus(2); sysUserEnt.setStatus(2);
sysUserEnt.setModifyTime(new Date()); sysUserEnt.setModifyTime(new Date());
......
package pps.core.system.service; package pps.core.system.service;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.util.CollectionUtils;
import pps.core.common.constant.BusinessConstant; import pps.core.common.constant.BusinessConstant;
import pps.core.system.cache.SysAreaCache; import pps.core.system.cache.SysAreaCache;
import pps.core.system.entity.SysAreaEnt; import pps.core.system.entity.SysAreaEnt;
...@@ -41,20 +42,20 @@ public class SysAreaService { ...@@ -41,20 +42,20 @@ public class SysAreaService {
if (ObjectUtils.isNotEmpty(input.getLev()) && input.getLev() == 1) { if (ObjectUtils.isNotEmpty(input.getLev()) && input.getLev() == 1) {
List<SysAreaCache> items = new ArrayList<>(); List<SysAreaCache> items = new ArrayList<>();
for (SysAreaCache ent : sysAreaCaches) { for (SysAreaCache ent : sysAreaCaches) {
if (!CollectionUtils.isEmpty(ent.getChildren())) { if (CollUtil.isNotEmpty(ent.getChildren())) {
items.addAll(ent.getChildren()); items.addAll(ent.getChildren());
} }
} }
sysAreaCaches = items; sysAreaCaches = items;
} }
//缓存不存在从数据库获取 //缓存不存在从数据库获取
if (CollectionUtils.isEmpty(sysAreaCaches)) { if (CollUtil.isEmpty(sysAreaCaches)) {
List<SysAreaCache> caches = selectSysAreaTree(context, input); List<SysAreaCache> caches = selectSysAreaTree(context, input);
List<GetSysAreaViewOutputTree> resultTree = XCopyUtils.copyNewList(caches, GetSysAreaViewOutputTree.class); List<GetSysAreaViewOutputTree> resultTree = XCopyUtils.copyNewList(caches, GetSysAreaViewOutputTree.class);
if (ObjectUtils.isNotEmpty(input.getLev()) && input.getLev() == 1) { if (ObjectUtils.isNotEmpty(input.getLev()) && input.getLev() == 1) {
List<GetSysAreaViewOutputTree> items = new ArrayList<>(); List<GetSysAreaViewOutputTree> items = new ArrayList<>();
for (GetSysAreaViewOutputTree ent : resultTree) { for (GetSysAreaViewOutputTree ent : resultTree) {
if (!CollectionUtils.isEmpty(ent.getChildren())) { if (CollUtil.isNotEmpty(ent.getChildren())) {
items.addAll(ent.getChildren()); items.addAll(ent.getChildren());
} }
} }
...@@ -105,10 +106,10 @@ public class SysAreaService { ...@@ -105,10 +106,10 @@ public class SysAreaService {
@XApiPost @XApiPost
public XServiceResult updateSysArea(XContext context, UpdateSysAreaInput input) { public XServiceResult updateSysArea(XContext context, UpdateSysAreaInput input) {
SysAreaMapper mapper = context.getBean(SysAreaMapper.class); SysAreaMapper mapper = context.getBean(SysAreaMapper.class);
QueryWrapper<SysAreaEnt> queryWrapper = new QueryWrapper<>(); SysAreaEnt entity = mapper.selectOne(new QueryWrapper<SysAreaEnt>()
queryWrapper.lambda().eq(SysAreaEnt::getId, input.getId()); .lambda()
SysAreaEnt entity = mapper.selectOne(queryWrapper); .eq(SysAreaEnt::getId, input.getId()));
if (entity == null) { if (ObjectUtil.isNull(entity)) {
return XServiceResult.error(context, XError.NotFound); return XServiceResult.error(context, XError.NotFound);
} }
XCopyUtils.copyObject(input, entity); XCopyUtils.copyObject(input, entity);
...@@ -119,10 +120,10 @@ public class SysAreaService { ...@@ -119,10 +120,10 @@ public class SysAreaService {
@XApiPost @XApiPost
public XServiceResult deleteSysArea(XContext context, DeleteSysAreaInput input) { public XServiceResult deleteSysArea(XContext context, DeleteSysAreaInput input) {
SysAreaMapper mapper = context.getBean(SysAreaMapper.class); SysAreaMapper mapper = context.getBean(SysAreaMapper.class);
QueryWrapper<SysAreaEnt> queryWrapper = new QueryWrapper<>(); SysAreaEnt entity = mapper.selectOne(new QueryWrapper<SysAreaEnt>()
queryWrapper.lambda().eq(SysAreaEnt::getId, input.getId()); .lambda()
SysAreaEnt entity = mapper.selectOne(queryWrapper); .eq(SysAreaEnt::getId, input.getId()));
if (entity == null) { if (ObjectUtil.isNull(entity)) {
return XServiceResult.error(context, XError.NotFound); return XServiceResult.error(context, XError.NotFound);
} }
mapper.deleteById(entity); mapper.deleteById(entity);
...@@ -132,10 +133,10 @@ public class SysAreaService { ...@@ -132,10 +133,10 @@ public class SysAreaService {
@XApiGet @XApiGet
public XSingleResult<GetSysAreaOutput> getSysArea(XContext context, GetSysAreaInput input) { public XSingleResult<GetSysAreaOutput> getSysArea(XContext context, GetSysAreaInput input) {
SysAreaMapper mapper = context.getBean(SysAreaMapper.class); SysAreaMapper mapper = context.getBean(SysAreaMapper.class);
QueryWrapper<SysAreaEnt> queryWrapper = new QueryWrapper<>(); SysAreaEnt entity = mapper.selectOne(new QueryWrapper<SysAreaEnt>()
queryWrapper.lambda().eq(SysAreaEnt::getId, input.getId()); .lambda()
SysAreaEnt entity = mapper.selectOne(queryWrapper); .eq(SysAreaEnt::getId, input.getId()));
if (entity == null) { if (ObjectUtil.isNull(entity)) {
return XSingleResult.error(context, XError.NotFound); return XSingleResult.error(context, XError.NotFound);
} }
GetSysAreaOutput output = new GetSysAreaOutput(); GetSysAreaOutput output = new GetSysAreaOutput();
......
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