Commit 432833b3 authored by ZWT's avatar ZWT

feat(能源管理系统): 测试问题修复

1.修改运维管理-组织机构管理模块,查询组织和线路列表接口sql查询逻辑,解决出现重复组织问题;
2.修改运维管理-组织机构管理模块,查询组织机构分页列表接口sql查询逻辑,解决出现重复组织问题;
3.修改运维管理-基础信息配置-井口配置模块,查询井口分页列表接口查询逻辑,解决添加线路页选择关联井口时查到其它机构的井口问题;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent f22c54f8
......@@ -114,15 +114,14 @@ public class BaseDieselGeneratorService {
@XApiAnonymous
@XApiGet
public XPageResult<QueryBaseDieselGeneratorOutput> queryBaseDieselGenerator(XContext context, QueryBaseDieselGeneratorInput input) {
String ouId = input.getOuId();
String ouName = input.getOuName();
String deviceName = input.getDeviceName();
String excludeIdFlag = input.getExcludeIdFlag();
BaseDieselGeneratorMapper mapper = context.getBean(BaseDieselGeneratorMapper.class);
List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, ouId);
List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
QueryWrapper<BaseDieselGeneratorEnt> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda()
.notExists("1".equals(excludeIdFlag), "SELECT 1 FROM base_power_line_diesel w WHERE w.ou_id = {0} AND base_diesel_generator.id = w.diesel_id AND w.is_deleted = 1", input.getOuId())
.notExists("1".equals(excludeIdFlag), "SELECT 1 FROM base_power_line_diesel w WHERE base_diesel_generator.id = w.diesel_id AND w.is_deleted = 1")
.eq(BaseDieselGeneratorEnt::getIsDeleted, BusinessConstant.ONE)
.in(CollUtil.isNotEmpty(allListByOuId), BaseDieselGeneratorEnt::getOuId, allListByOuId)
.like(StrUtil.isNotEmpty(ouName), BaseDieselGeneratorEnt::getOuName, ouName)
......
......@@ -114,15 +114,14 @@ public class BaseEnergyStorageDeviceService {
@XApiAnonymous
@XApiGet
public XPageResult<QueryBaseEnergyStorageDeviceOutput> queryBaseEnergyStorageDevice(XContext context, QueryBaseEnergyStorageDeviceInput input) {
String ouId = input.getOuId();
String ouName = input.getOuName();
String deviceName = input.getDeviceName();
String excludeIdFlag = input.getExcludeIdFlag();
BaseEnergyStorageDeviceMapper mapper = context.getBean(BaseEnergyStorageDeviceMapper.class);
List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, ouId);
List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
QueryWrapper<BaseEnergyStorageDeviceEnt> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda()
.notExists("1".equals(excludeIdFlag), "SELECT 1 FROM base_power_line_storage w WHERE w.ou_id = {0} AND base_energy_storage_device.id = w.storage_id AND w.is_deleted = 1", input.getOuId())
.notExists("1".equals(excludeIdFlag), "SELECT 1 FROM base_power_line_storage w WHERE base_energy_storage_device.id = w.storage_id AND w.is_deleted = 1")
.eq(BaseEnergyStorageDeviceEnt::getIsDeleted, BusinessConstant.ONE)
.in(CollUtil.isNotEmpty(allListByOuId), BaseEnergyStorageDeviceEnt::getOuId, allListByOuId)
.like(StrUtil.isNotEmpty(ouName), BaseEnergyStorageDeviceEnt::getOuName, ouName)
......
......@@ -132,12 +132,11 @@ public class BasePhotovoltaicPlantService {
public XPageResult<QueryBasePhotovoltaicPlantOutput> queryBasePhotovoltaicPlant(XContext context, QueryBasePhotovoltaicPlantInput input) {
BasePhotovoltaicPlantMapper mapper = context.getBean(BasePhotovoltaicPlantMapper.class);
String stationName = input.getStationName();
String ouId = input.getOuId();
String excludeIdFlag = input.getExcludeIdFlag();
List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, ouId);
List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
QueryWrapper<BasePhotovoltaicPlantEnt> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda()
.notExists("1".equals(excludeIdFlag), "SELECT 1 FROM base_power_line_plant w WHERE w.ou_id = {0} AND base_photovoltaic_plant.id = w.plant_id AND w.is_deleted = 1", input.getOuId())
.notExists("1".equals(excludeIdFlag), "SELECT 1 FROM base_power_line_plant w WHERE base_photovoltaic_plant.id = w.plant_id AND w.is_deleted = 1")
.eq(BasePhotovoltaicPlantEnt::getIsDeleted, BusinessConstant.ONE)
.in(CollUtil.isNotEmpty(allListByOuId), BasePhotovoltaicPlantEnt::getOuId, allListByOuId)
.like(StrUtil.isNotEmpty(stationName), BasePhotovoltaicPlantEnt::getStationName, stationName)
......
......@@ -116,18 +116,34 @@ public class BaseWellheadService {
return XSingleResult.success(output);
}
/**
* 分页查询
* GET /base/base-wellhead/query-base-wellhead
* 接口ID:105431641
* 接口地址:https://app.apifox.com/project/3196988/apis/api-105431641
*
* @param context 上下文
* @param input 输入
* @return {@link XPageResult}<{@link QueryBaseWellheadOutput}>
*/
@XText("分页查询")
@XApiAnonymous
@XApiGet
public XPageResult<QueryBaseWellheadOutput> queryBaseWellhead(XContext context, QueryBaseWellheadInput input) {
String excludeIdFlag = input.getExcludeIdFlag();
BaseWellheadMapper mapper = context.getBean(BaseWellheadMapper.class);
QueryWrapper<BaseWellheadEnt> queryWrapper = new QueryWrapper<>();
List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
boolean excludeIdFlag = StringUtils.equals("1", input.getExcludeIdFlag());
if (excludeIdFlag) {
queryWrapper.lambda()
.notExists("SELECT 1 FROM base_power_line_wellhead w WHERE base_wellhead.id = w.wellhead_id AND w.is_deleted = 1")
.eq(BaseWellheadEnt::getOuId, input.getOuId());
} else {
List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
queryWrapper.lambda()
.in(CollUtil.isNotEmpty(allListByOuId), BaseWellheadEnt::getOuId, allListByOuId);
}
queryWrapper.lambda()
.notExists(StringUtils.equals("1", excludeIdFlag), "SELECT 1 FROM base_power_line_wellhead w WHERE w.ou_id = {0} AND base_wellhead.id = w.wellhead_id AND w.is_deleted = 1", input.getOuId())
.eq(BaseWellheadEnt::getIsDeleted, BusinessConstant.ONE)
.in(CollUtil.isNotEmpty(allListByOuId), BaseWellheadEnt::getOuId, allListByOuId)
.orderByDesc(BaseWellheadEnt::getModifyTime);
return XMapperHelper.query(mapper, input, queryWrapper, QueryBaseWellheadOutput.class);
}
......
package pps.core.base.service.data.base_wellhead;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import xstartup.annotation.XText;
import xstartup.base.data.XPageInput;
import java.math.BigDecimal;
/**
* 井口
*
* @author ZWT
* @date 2023/09/25
*/
@Data
public class QueryBaseWellheadInput extends XPageInput {
@XText("组织机构ID")
@NotBlank(message = "缺少组织机构ID")
private String ouId;
@XText("组织机构ID")
private String ouName;
......@@ -19,6 +28,7 @@ public class QueryBaseWellheadInput extends XPageInput {
@XText("运行类型key(字典获取)")
private String runTypeKey;
@XText("运行类型name(字典获取)")
private String runTypeName;
......@@ -27,5 +37,4 @@ public class QueryBaseWellheadInput extends XPageInput {
@XText("排除已绑定线路标识")
private String excludeIdFlag;
}
}
\ No newline at end of file
package pps.core.base.service.data.base_wellhead;
import lombok.Data;
import xstartup.annotation.XText;
import xstartup.base.data.XPageInput;
import java.math.BigDecimal;
import java.util.Date;
public class QueryBaseWellheadOutput extends XPageInput {
@XText("ID")
private String id;
@XText("是否删除(1_是;0_否)")
private Integer isDeleted;
@XText("创建人ID")
private String createById;
@XText("创建人名称")
private String createByName;
@XText("创建时间")
private Date createTime;
/**
* 井口设置
*
* @author ZWT
* @date 2023/09/25
*/
@Data
public class QueryBaseWellheadOutput {
@XText("修改人ID")
private String modifyById;
@XText("修改人名称")
private String modifyByName;
@XText("修改时间")
private Date modifyTime;
@XText("ID")
private String id;
@XText("组织机构ID")
private String ouId;
@XText("组织机构名称")
private String ouName;
......@@ -40,121 +28,10 @@ public class QueryBaseWellheadOutput extends XPageInput {
@XText("运行类型key(字典获取)")
private String runTypeKey;
@XText("运行类型Name(字典获取)")
private String runTypeName;
@XText("运行功率(KW)")
private BigDecimal serviceRating;
public String getId() {
return this.id;
}
public void setId(String value) {
this.id = value;
}
public Integer getIsDeleted() {
return this.isDeleted;
}
public void setIsDeleted(Integer value) {
this.isDeleted = value;
}
public String getCreateById() {
return this.createById;
}
public void setCreateById(String value) {
this.createById = value;
}
public String getCreateByName() {
return this.createByName;
}
public void setCreateByName(String value) {
this.createByName = value;
}
public Date getCreateTime() {
return this.createTime;
}
public void setCreateTime(Date value) {
this.createTime = value;
}
public String getModifyById() {
return this.modifyById;
}
public void setModifyById(String value) {
this.modifyById = value;
}
public String getModifyByName() {
return this.modifyByName;
}
public void setModifyByName(String value) {
this.modifyByName = value;
}
public Date getModifyTime() {
return this.modifyTime;
}
public void setModifyTime(Date value) {
this.modifyTime = value;
}
public String getOuId() {
return this.ouId;
}
public void setOuId(String value) {
this.ouId = value;
}
public String getWellNumber() {
return this.wellNumber;
}
public void setWellNumber(String value) {
this.wellNumber = value;
}
public String getRunTypeKey() {
return this.runTypeKey;
}
public void setRunTypeKey(String value) {
this.runTypeKey = value;
}
public BigDecimal getServiceRating() {
return this.serviceRating;
}
public void setServiceRating(BigDecimal value) {
this.serviceRating = value;
}
public String getOuName() {
return ouName;
}
public void setOuName(String ouName) {
this.ouName = ouName;
}
public String getRunTypeName() {
return runTypeName;
}
public void setRunTypeName(String runTypeName) {
this.runTypeName = runTypeName;
}
}
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