Commit b408dd72 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 94c96c2c
......@@ -43,6 +43,11 @@ public class BusinessConstant {
*/
public static final String DEFAULT_VALUE = "--";
/**
* 默认取单个
*/
public static final String LAST_LIMIT = "LIMIT 1";
/**
* 开井
*/
......
......@@ -7,6 +7,7 @@ import pps.cloud.system.service.data.sys_area.GetSysAreaInput;
import pps.cloud.system.service.data.sys_area.GetSysAreaOutput;
import pps.cloud.system.service.data.sys_area.QuerySysAreaInput;
import pps.cloud.system.service.data.sys_area.QuerySysAreaOutput;
import pps.core.common.constant.BusinessConstant;
import pps.core.system.entity.SysAreaEnt;
import pps.core.system.entity.SysAreaView;
import pps.core.system.mapper.SysAreaMapper;
......@@ -50,7 +51,7 @@ public class SystemAreaServiceImpl implements SystemAreaService {
.eq(Objects.nonNull(id), SysAreaEnt::getId, id)
.eq(Objects.nonNull(parentId), SysAreaEnt::getParentId, parentId)
.eq(StringUtils.isNotEmpty(name), SysAreaEnt::getName, name)
.last("LIMIT 1")
.last(BusinessConstant.LAST_LIMIT)
);
return XSingleResult.success(XCopyUtils.copyNewObject(sysAreaEnt, GetSysAreaOutput.class));
}
......
......@@ -15,6 +15,7 @@ import pps.core.base.mapper.BaseModelValMapper;
import pps.core.base.service.data.base_data.*;
import pps.core.base.service.data.base_line.ImportFileInput;
import pps.core.base.utils.HttpUtils;
import pps.core.common.constant.BusinessConstant;
import pps.core.common.utils.ExcelUtils;
import pps.core.common.utils.ExportExcelUtils;
import xstartup.annotation.XService;
......@@ -139,7 +140,7 @@ public class BaseDataService {
QueryWrapper<BaseDataImportLogEnt> logEntQueryWrapper = new QueryWrapper<>();
logEntQueryWrapper.lambda().eq(BaseDataImportLogEnt::getLineId, input.getLineId())
.orderByDesc(BaseDataImportLogEnt::getCreateTime)
.last(" limit 1");
.last(BusinessConstant.LAST_LIMIT);
BaseDataImportLogEnt ent = logMapper.selectOne(logEntQueryWrapper);
List<QueryBaseDataOutput> outputs = new ArrayList<>();
if (null != ent) {
......@@ -160,7 +161,7 @@ public class BaseDataService {
QueryWrapper<BaseDataImportLogEnt> logEntQueryWrapper = new QueryWrapper<>();
logEntQueryWrapper.lambda().eq(BaseDataImportLogEnt::getLineId, input.getLineId())
.orderByDesc(BaseDataImportLogEnt::getCreateTime)
.last(" limit 1");
.last(BusinessConstant.LAST_LIMIT);
BaseDataImportLogEnt ent = logMapper.selectOne(logEntQueryWrapper);
List<GetBaseDataOutput> outputs = new ArrayList<>();
if (ent != null) {
......@@ -179,7 +180,7 @@ public class BaseDataService {
// detailOutput.setPredictedPower(new BigDecimal(map.get(key).toString()));
// outputs.add(detailOutput);
// }
list.stream().forEach(item -> {
list.forEach(item -> {
String dataDate = XDateUtils.getString(item.getDataDate());
if (map.get(dataDate) != null &&
XStringUtils.isNotEmpty(map.get(dataDate).toString())) {
......@@ -332,7 +333,7 @@ public class BaseDataService {
QueryWrapper<BaseDataImportLogEnt> logEntQueryWrapper = new QueryWrapper<>();
logEntQueryWrapper.lambda().eq(BaseDataImportLogEnt::getLineId, input.getLineId())
.orderByDesc(BaseDataImportLogEnt::getCreateTime)
.last(" limit 1");
.last(BusinessConstant.LAST_LIMIT);
BaseDataImportLogEnt ent = logMapper.selectOne(logEntQueryWrapper);
if (ent == null)
return XServiceResult.OK;
......@@ -359,7 +360,7 @@ public class BaseDataService {
QueryWrapper<BaseModelValEnt> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(BaseModelValEnt::getLineId, input.getLineId())
.eq(BaseModelValEnt::getKeyname, input.getKeyNames())
.orderByDesc(BaseModelValEnt::getCreatetime).last(" limit 1");
.orderByDesc(BaseModelValEnt::getCreatetime).last(BusinessConstant.LAST_LIMIT);
BaseModelValEnt baseModelValEnt = baseModelValMapper.selectOne(queryWrapper);
TrainBaseModelValOutput output = XCopyUtils.copyNewObject(baseModelValEnt, TrainBaseModelValOutput.class);
if (baseModelValEnt != null && XStringUtils.isNotEmpty(output.getYtrue()) && XStringUtils.isNotEmpty(output.getYpred())) {
......
......@@ -73,7 +73,7 @@ public class BaseWellheadCloudServiceImpl implements IBaseWellheadCloudService {
.eq(BaseModel::getIsDeleted, BusinessConstant.ONE)
.in(BaseModel::getId, input.getWellheadIds())
.orderByDesc(BaseWellheadEnt::getServiceRating)
.last("LIMIT 1")
.last(BusinessConstant.LAST_LIMIT)
);
return XSingleResult.success(XCopyUtils.copyNewObject(one, DynamicQueryBaseWellheadOutput.class));
}
......
......@@ -32,7 +32,7 @@ public class ConfigOilFieldService {
ConfigOilFieldMapper mapper = context.getBean(ConfigOilFieldMapper.class);
ConfigOilFieldEnt ent = mapper.selectOne(new LambdaQueryWrapper<ConfigOilFieldEnt>()
.eq(ConfigOilFieldEnt::getIsEnable, BusinessConstant.ZERO)
.last("LIMIT 1")
.last(BusinessConstant.LAST_LIMIT)
);
GetConfigOilFieldOutput output;
if (ObjectUtil.isNull(ent)) {
......
......@@ -11,6 +11,7 @@ import pps.core.base.entity.ThirdWeatherDataEnt;
import pps.core.base.mapper.ThirdWeatherDataMapper;
import pps.core.base.service.data.third_weather_data.GetThirdWeatherDataInput;
import pps.core.base.service.data.third_weather_data.GetThirdWeatherDataOutput;
import pps.core.common.constant.BusinessConstant;
import xstartup.annotation.XService;
import xstartup.annotation.XText;
import xstartup.base.XContext;
......@@ -51,7 +52,7 @@ public class ThirdWeatherDataService {
.lambda()
.ge(ThirdWeatherDataEnt::getForecastTime, DateUtil.date())
.orderByAsc(ThirdWeatherDataEnt::getForecastTime)
.last("LIMIT 1")
.last(BusinessConstant.LAST_LIMIT)
);
output = XCopyUtils.copyNewObject(ent, GetThirdWeatherDataOutput.class);
} else {
......
......@@ -94,7 +94,7 @@ public class SpaceCalibrationCloudServiceImpl implements ISpaceCalibrationCloudS
.eq(BaseModel::getIsDeleted, BusinessConstant.ONE)
.eq(SpaceCalibrationHistoryEnt::getInstitutionId, institutionId)
.orderByDesc(SpaceCalibrationHistoryEnt::getCalibrationDate)
.last("LIMIT 1")
.last(BusinessConstant.LAST_LIMIT)
);
if (Objects.isNull(lastHistory)) {
//创建周期
......
......@@ -242,7 +242,7 @@ public class SpaceCalibrationService {
.eq(SpaceOptimizeShortPeriodEnt::getInstitutionId, historyEnt.getInstitutionId())
.eq(SpaceOptimizeShortPeriodEnt::getOptimizeDate, inputDate)
.orderByDesc(BaseModel::getCreateTime)
.last("LIMIT 1")
.last(BusinessConstant.LAST_LIMIT)
);
//通过井口ID查区间
if (Objects.nonNull(shortPeriodEnt)) {
......@@ -262,7 +262,7 @@ public class SpaceCalibrationService {
.ge(SpaceOptimizeMidPeriodEnt::getOptimizeDeadline, inputDate)
.apply("DATE_FORMAT( create_time, '%Y-%m-%d' ) <= {0}", inputDate)
.orderByDesc(BaseModel::getCreateTime)
.last("LIMIT 1")
.last(BusinessConstant.LAST_LIMIT)
);
if (Objects.nonNull(midPeriodEnt)) {
SpaceOptimizeMidDurationMapper midDurationMapper = context.getBean(SpaceOptimizeMidDurationMapper.class);
......@@ -282,7 +282,7 @@ public class SpaceCalibrationService {
.ge(SpaceOptimizeLongPeriodEnt::getOptimizeDeadline, inputDate)
.apply("DATE_FORMAT( create_time, '%Y-%m-%d' ) <= {0}", inputDate)
.orderByDesc(BaseModel::getCreateTime)
.last("LIMIT 1")
.last(BusinessConstant.LAST_LIMIT)
);
if (Objects.nonNull(longPeriodEnt)) {
SpaceOptimizeLongDurationMapper longDurationMapper = context.getBean(SpaceOptimizeLongDurationMapper.class);
......@@ -329,7 +329,7 @@ public class SpaceCalibrationService {
.eq(SpaceCalibrationPeriodEnt::getLineId, lineId)
.eq(SpaceCalibrationPeriodEnt::getOuId, ouId)
.orderByDesc(BaseModel::getModifyTime)
.last("LIMIT 1")
.last(BusinessConstant.LAST_LIMIT)
);
}
......
......@@ -625,7 +625,7 @@ public class SpaceInstitutionDetailService extends SpaceOptimizeBaseService {
.eq(BaseModel::getIsDeleted, BusinessConstant.ONE)
.eq(SpaceCalibrationHistoryEnt::getInstitutionId, detail.getId())
.orderByDesc(SpaceCalibrationHistoryEnt::getCalibrationDate)
.last("LIMIT 1")
.last(BusinessConstant.LAST_LIMIT)
);
DateTime now = DateUtil.beginOfDay(DateUtil.date());
boolean isCreate = false;
......@@ -647,7 +647,7 @@ public class SpaceInstitutionDetailService extends SpaceOptimizeBaseService {
.eq(SpaceCalibrationPeriodEnt::getLineId, detail.getLineId())
.eq(SpaceCalibrationPeriodEnt::getOuId, detail.getOuId())
.orderByDesc(BaseModel::getModifyTime)
.last("LIMIT 1")
.last(BusinessConstant.LAST_LIMIT)
);
if (Objects.nonNull(periodEnt)) {
mapper.insert(this.createCalibrationHistory(session, detail, now, Integer.valueOf(periodEnt.getDayNumber())));
......
......@@ -117,7 +117,7 @@ public class SpaceOptimizeShortPeriodService extends SpaceOptimizeBaseService {
SpaceOptimizeShortPeriodEnt periodEnt = mapper.selectOne(new LambdaQueryWrapper<SpaceOptimizeShortPeriodEnt>()
.eq(SpaceOptimizeShortPeriodEnt::getOptimizeDate, now)
.eq(SpaceOptimizeShortPeriodEnt::getLineId, lineId)
.last("limit 1")
.last(BusinessConstant.LAST_LIMIT)
);
if (ObjectUtil.isEmpty(periodEnt)) {
return XListResult.success(Collections.emptyList());
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import pps.cloud.prediction.service.PlantTrainPowerTaskCloudService;
import pps.cloud.prediction.service.data.plant_train_power_task.GetPlantTrainPowerTaskCloudInput;
import pps.cloud.prediction.service.data.plant_train_power_task.GetPlantTrainPowerTaskCloudOutput;
import pps.core.common.constant.BusinessConstant;
import pps.core.prediction.entity.PlantTrainPowerTaskEnt;
import pps.core.prediction.mapper.PlantTrainPowerTaskMapper;
import xstartup.annotation.XService;
......@@ -22,7 +23,7 @@ public class PlantTrainPowerTaskService implements PlantTrainPowerTaskCloudServi
.eq(PlantTrainPowerTaskEnt::getRunState, 1)
.eq(PlantTrainPowerTaskEnt::getRunStep, "model_train")
.orderByDesc(PlantTrainPowerTaskEnt::getCreateTime)
.last("limit 1");
.last(BusinessConstant.LAST_LIMIT);
PlantTrainPowerTaskEnt ent = mapper.selectOne(queryWrapper);
if (ent == null) {
queryWrapper.clear();
......@@ -31,7 +32,7 @@ public class PlantTrainPowerTaskService implements PlantTrainPowerTaskCloudServi
.eq(PlantTrainPowerTaskEnt::getRunState, 1)
.eq(PlantTrainPowerTaskEnt::getRunStep, "model_train")
.orderByDesc(PlantTrainPowerTaskEnt::getCreateTime)
.last("limit 1");
.last(BusinessConstant.LAST_LIMIT);
ent = mapper.selectOne(queryWrapper);
}
GetPlantTrainPowerTaskCloudOutput output = XCopyUtils.copyNewObject(ent, GetPlantTrainPowerTaskCloudOutput.class);
......
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