Commit 2c3c238d authored by ZWT's avatar ZWT

feat(零碳): 长庆演示系统新增功能

1.修改第三方日累计数据推送表表结构,增加日累计储能放电量字段,同时修改代码对应实体及mapper文件,修改相关接口增加储能日累计放电量接收逻辑;
2.修改首页井场收益分析模块接口,修改获取储能累计放电量逻辑;
3.设计并创建井口日用电趋势表,生成对应实体类及mapper文件;
4.统计分析模块,新增本月累计节电经济效益查询接口,添加线上接口文档并完成接口冒烟测试;
5.统计分析模块,新增本月累计减碳量查询接口,添加线上接口文档并完成接口冒烟测试;
6.统计分析模块,新增光伏发电趋势查询接口,添加线上接口文档并完成接口冒烟测试;
7.统计分析模块,新增月度总览查询接口,添加线上接口文档并完成接口冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent a343f8b3
......@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.text.CharSequenceUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.lang3.StringUtils;
import pps.core.base.entity.BaseDieselGeneratorEnt;
import pps.core.base.entity.BasePowerLineDieselEnt;
import pps.core.base.enums.BusinessError;
......@@ -165,10 +164,10 @@ public class BaseDieselGeneratorService {
String deviceName = input.getDeviceName();
BaseDieselGeneratorMapper mapper = context.getBean(BaseDieselGeneratorMapper.class);
QueryWrapper<BaseDieselGeneratorEnt> queryWrapper = new QueryWrapper<>();
if (StringUtils.isNotEmpty(input.getLineId())) {
if (CharSequenceUtil.isNotEmpty(input.getLineId())) {
queryWrapper.lambda()
.notExists(!StringUtils.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId()), "SELECT 1 FROM base_power_line_diesel w WHERE base_diesel_generator.id = w.diesel_id AND w.is_deleted = 1 AND w.line_id <> {0}", input.getLineId())
.notExists(StringUtils.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId()), "SELECT 1 FROM base_power_line_diesel w WHERE base_diesel_generator.id = w.diesel_id AND w.is_deleted = 1")
.notExists(!CharSequenceUtil.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId()), "SELECT 1 FROM base_power_line_diesel w WHERE base_diesel_generator.id = w.diesel_id AND w.is_deleted = 1 AND w.line_id <> {0}", input.getLineId())
.notExists(CharSequenceUtil.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId()), "SELECT 1 FROM base_power_line_diesel w WHERE base_diesel_generator.id = w.diesel_id AND w.is_deleted = 1")
.eq(BaseDieselGeneratorEnt::getOuId, input.getOuId());
} else {
List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
......@@ -226,7 +225,7 @@ public class BaseDieselGeneratorService {
Long count = mapper.selectCount(new LambdaQueryWrapper<BaseDieselGeneratorEnt>()
.eq(BaseModel::getIsDeleted, BusinessConstant.ONE)
.eq(BaseDieselGeneratorEnt::getMakerNumber, makerNumber)
.ne(StringUtils.isNotEmpty(id), BaseModel::getId, id)
.ne(CharSequenceUtil.isNotEmpty(id), BaseModel::getId, id)
);
return count > 0;
}
......
......@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.text.CharSequenceUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.lang3.StringUtils;
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;
......@@ -42,7 +41,6 @@ import xstartup.annotation.XText;
import xstartup.base.XContext;
import xstartup.base.util.XCopyUtils;
import xstartup.base.util.XJsonUtils;
import xstartup.base.util.XStringUtils;
import xstartup.data.XListResult;
import xstartup.data.XPageResult;
import xstartup.data.XServiceResult;
......@@ -84,7 +82,7 @@ public class BasePhotovoltaicPlantService {
@XApiPost
public XServiceResult createBasePhotovoltaicPlant(XContext context, CreateBasePhotovoltaicPlantInput input) {
BasePhotovoltaicPlantMapper mapper = context.getBean(BasePhotovoltaicPlantMapper.class);
if (StringUtils.isNotEmpty(input.getMakerNumber()) && this.checkMakerNumberExists(mapper, input.getMakerNumber(), null)) {
if (CharSequenceUtil.isNotEmpty(input.getMakerNumber()) && this.checkMakerNumberExists(mapper, input.getMakerNumber(), null)) {
return XServiceResult.error(context, BusinessError.MakerNumberExists);
}
BasePhotovoltaicPlantEnt entity = XCopyUtils.copyNewObject(input, BasePhotovoltaicPlantEnt.class);
......@@ -109,7 +107,7 @@ public class BasePhotovoltaicPlantService {
@XApiPost
public XServiceResult updateBasePhotovoltaicPlant(XContext context, UpdateBasePhotovoltaicPlantInput input) {
BasePhotovoltaicPlantMapper mapper = context.getBean(BasePhotovoltaicPlantMapper.class);
if (StringUtils.isNotEmpty(input.getMakerNumber()) && this.checkMakerNumberExists(mapper, input.getMakerNumber(), input.getId())) {
if (CharSequenceUtil.isNotEmpty(input.getMakerNumber()) && this.checkMakerNumberExists(mapper, input.getMakerNumber(), input.getId())) {
return XServiceResult.error(context, BusinessError.MakerNumberExists);
}
BasePhotovoltaicPlantEnt entity = this.selectOneByPlantId(input.getId(), mapper);
......@@ -188,7 +186,7 @@ public class BasePhotovoltaicPlantService {
.map(GetSysAreaOutput::getName)
.orElse(null));
//20240321 从电站辐照度模拟表中获取精准率
if (XStringUtils.isNotEmpty(input.getType())) {
if (CharSequenceUtil.isNotEmpty(input.getType())) {
PlantTrainPowerTaskCloudService cloudService = context.getBean(PlantTrainPowerTaskCloudService.class);
GetPlantTrainPowerTaskCloudInput cloudInput = new GetPlantTrainPowerTaskCloudInput();
cloudInput.setPlantId(input.getId());
......@@ -204,9 +202,9 @@ public class BasePhotovoltaicPlantService {
break;
}
XSingleResult<GetPlantTrainPowerTaskCloudOutput> result = cloudService.getPlantTrainPowerTaskData(context, cloudInput);
if (result.isSuccess() && result.getResult() != null && XStringUtils.isNotEmpty(result.getResult().getMetricsScore())) {
if (result.isSuccess() && result.getResult() != null && CharSequenceUtil.isNotEmpty(result.getResult().getMetricsScore())) {
Map<String, Object> map = XJsonUtils.toMap(result.getResult().getMetricsScore());
if (map.containsKey("MAPE") && XStringUtils.isNotEmpty(map.get("MAPE").toString())) {
if (map.containsKey("MAPE") && CharSequenceUtil.isNotEmpty(map.get("MAPE").toString())) {
BigDecimal relMape = new BigDecimal(map.get("MAPE").toString());
BigDecimal mape = null;
//获取调整的准确率附加值
......@@ -255,10 +253,10 @@ public class BasePhotovoltaicPlantService {
BasePhotovoltaicPlantMapper mapper = context.getBean(BasePhotovoltaicPlantMapper.class);
String stationName = input.getStationName();
QueryWrapper<BasePhotovoltaicPlantEnt> queryWrapper = new QueryWrapper<>();
if (StringUtils.isNotEmpty(input.getLineId())) {
if (CharSequenceUtil.isNotEmpty(input.getLineId())) {
queryWrapper.lambda()
.notExists(!StringUtils.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId()), "SELECT 1 FROM base_power_line_plant w WHERE base_photovoltaic_plant.id = w.plant_id AND w.is_deleted = 1 AND w.line_id <> {0}", input.getLineId())
.notExists(StringUtils.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId()), "SELECT 1 FROM base_power_line_plant w WHERE base_photovoltaic_plant.id = w.plant_id AND w.is_deleted = 1")
.notExists(!CharSequenceUtil.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId()), "SELECT 1 FROM base_power_line_plant w WHERE base_photovoltaic_plant.id = w.plant_id AND w.is_deleted = 1 AND w.line_id <> {0}", input.getLineId())
.notExists(CharSequenceUtil.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId()), "SELECT 1 FROM base_power_line_plant w WHERE base_photovoltaic_plant.id = w.plant_id AND w.is_deleted = 1")
.eq(BasePhotovoltaicPlantEnt::getOuId, input.getOuId());
} else {
List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
......@@ -290,7 +288,7 @@ public class BasePhotovoltaicPlantService {
String ouName = input.getOuName();
if (CharSequenceUtil.isBlank(ouName)) {
SysOrganizationViewMapper mapper = context.getBean(SysOrganizationViewMapper.class);
if (XStringUtils.isEmpty(input.getParentOuId())) {
if (CharSequenceUtil.isEmpty(input.getParentOuId())) {
PpsUserSession session = context.getSession(PpsUserSession.class);
Integer isSuperAdmin = session.getIsSuperAdmin();
//如果是超级管理员查所以组织机构
......@@ -384,7 +382,7 @@ public class BasePhotovoltaicPlantService {
Long count = mapper.selectCount(new LambdaQueryWrapper<BasePhotovoltaicPlantEnt>()
.eq(BaseModel::getIsDeleted, BusinessConstant.ONE)
.eq(BasePhotovoltaicPlantEnt::getMakerNumber, makerNumber)
.ne(StringUtils.isNotEmpty(id), BaseModel::getId, id)
.ne(CharSequenceUtil.isNotEmpty(id), BaseModel::getId, id)
);
return count > 0;
}
......
package pps.core.base.service;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.text.CharSequenceUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.lang3.StringUtils;
import pps.cloud.base.service.IBasePowerLineCloudService;
import pps.cloud.base.service.data.base_power_line.DynamicQueryBasePowerLineInput;
import pps.cloud.base.service.data.base_power_line.DynamicQueryBasePowerLineOutput;
......@@ -83,13 +83,13 @@ public class BasePowerLineCloudServiceImpl implements IBasePowerLineCloudService
.eq(BaseModel::getIsDeleted, BusinessConstant.ONE)
.in(CollUtil.isNotEmpty(lineIds), BaseModel::getId, lineIds)
.in(CollUtil.isNotEmpty(lineNames), BasePowerLineEnt::getLineName, lineNames)
.eq(StringUtils.isNotBlank(lineId), BaseModel::getId, lineId)
.eq(StringUtils.isNotBlank(ouId), BasePowerLineEnt::getOuId, ouId)
.eq(StringUtils.isNotBlank(upperLineId), BasePowerLineEnt::getUpperLineId, upperLineId)
.like(StringUtils.isNotBlank(lineName), BasePowerLineEnt::getLineName, lineName)
.eq(StringUtils.isNotBlank(gridTypeKey), BasePowerLineEnt::getGridTypeKey, gridTypeKey)
.eq(StringUtils.isNotBlank(lineTypeKey), BasePowerLineEnt::getLineTypeKey, lineTypeKey)
.eq(StringUtils.isNotBlank(strategyId), BasePowerLineEnt::getStrategyId, strategyId)
.eq(CharSequenceUtil.isNotBlank(lineId), BaseModel::getId, lineId)
.eq(CharSequenceUtil.isNotBlank(ouId), BasePowerLineEnt::getOuId, ouId)
.eq(CharSequenceUtil.isNotBlank(upperLineId), BasePowerLineEnt::getUpperLineId, upperLineId)
.like(CharSequenceUtil.isNotBlank(lineName), BasePowerLineEnt::getLineName, lineName)
.eq(CharSequenceUtil.isNotBlank(gridTypeKey), BasePowerLineEnt::getGridTypeKey, gridTypeKey)
.eq(CharSequenceUtil.isNotBlank(lineTypeKey), BasePowerLineEnt::getLineTypeKey, lineTypeKey)
.eq(CharSequenceUtil.isNotBlank(strategyId), BasePowerLineEnt::getStrategyId, strategyId)
.orderByDesc(BaseModel::getModifyTime)
);
return XListResult.success(XCopyUtils.copyNewList(selectList, DynamicQueryBasePowerLineOutput.class));
......@@ -179,7 +179,7 @@ public class BasePowerLineCloudServiceImpl implements IBasePowerLineCloudService
List<BasePowerLinePlantEnt> list = mapper.selectList(
new LambdaQueryWrapper<BasePowerLinePlantEnt>()
.eq(BaseModel::getIsDeleted, BusinessConstant.ONE)
.eq(StringUtils.isNotBlank(plantId), BasePowerLinePlantEnt::getPlantId, plantId)
.eq(CharSequenceUtil.isNotBlank(plantId), BasePowerLinePlantEnt::getPlantId, plantId)
.in(CollUtil.isNotEmpty(lineIds), BasePowerLinePlantEnt::getLineId, lineIds)
);
return XListResult.success(XCopyUtils.copyNewList(
......
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