Commit 84ae7a4e authored by ZWT's avatar ZWT

feat(能源管理系统): 基础信息配置

1.开发基础信息配置-输电线路配置模块修改功能,完成接口冒烟测试并生成接口文档;
2.开发基础信息配置-输电线路配置模块删除功能,完成接口冒烟测试并生成接口文档;
3.开发基础信息配置-输电线路配置模块详情功能,完成接口冒烟测试并生成接口文档;
4.开发基础信息配置-输电线路配置模块分页列表功能,完成接口冒烟测试并生成接口文档;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 0a4958f0
......@@ -96,4 +96,10 @@ public class BasePowerLineView implements Serializable {
*/
@XText("上级线路名称")
private String upperLineName;
/**
* 井口数
*/
@XText("井口数")
private Integer wellheadCount;
}
......@@ -11,7 +11,7 @@ import java.util.List;
* @author ZWT
* @date 2023/08/28
*/
@Repository(value="pps.core.base.mapper.BasePowerLineViewMapper")
@Repository(value = "pps.core.base.mapper.BasePowerLineViewMapper")
public interface BasePowerLineViewMapper {
/**
......@@ -21,6 +21,12 @@ public interface BasePowerLineViewMapper {
* @return {@link BasePowerLineView}
*/
BasePowerLineView selectOne(BasePowerLineView record);
List<BasePowerLineView> selectList(BasePowerLineView record);
/**
* 输电线路配置列表
*
* @param record 记录
* @return {@link List}<{@link BasePowerLineView}>
*/
List<BasePowerLineView> selectList(BasePowerLineView record);
}
......@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import pps.cloud.system.service.SysOrganizationCloudService;
import pps.cloud.system.service.data.GetSysOrganizationViewInput;
import pps.cloud.system.service.data.GetSysOrganizationViewOutput;
import pps.core.base.entity.*;
import pps.core.base.mapper.*;
import pps.core.base.service.data.base_power_line.*;
......@@ -28,6 +31,7 @@ import xstartup.helper.XTransactionHelper;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* 输电线路配置模块
......@@ -196,17 +200,42 @@ public class BasePowerLineService {
@XText("输电线路配置--分页列表")
public XPageResult<QueryBasePowerLineViewOutput> queryBasePowerLineView(XContext context, QueryBasePowerLineViewInput input) {
BasePowerLineViewMapper mapper = context.getBean(BasePowerLineViewMapper.class);
BasePowerLineView record = new BasePowerLineView();
XCopyUtils.copyObject(input, record);
BasePowerLineView record = XCopyUtils.copyNewObject(input, BasePowerLineView.class);
PageHelper.startPage(input.getPage(), input.getLimit());
List<BasePowerLineView> list = mapper.selectList(record);
PageInfo<BasePowerLineView> pageInfo = new PageInfo<>(list);
List<QueryBasePowerLineViewOutput> outputs = XCopyUtils.copyNewList(pageInfo.getList(), QueryBasePowerLineViewOutput.class);
String ouName = this.getSysOrgNameById(context, input.getOuId());
outputs.forEach(output -> output.setOuName(ouName));
return XPageResult.success(outputs, input, pageInfo.getTotal());
}
/*-----------------------------------private-----------------------------------*/
/**
* 通过组织id获取系统组织名称
*
* @param context 上下文
* @param ouId 组织id
* @return {@link String}
*/
private String getSysOrgNameById(XContext context, String ouId) {
SysOrganizationCloudService orgCloudService = context.getBean(SysOrganizationCloudService.class);
GetSysOrganizationViewInput viewInput = new GetSysOrganizationViewInput();
viewInput.setId(ouId);
XSingleResult<GetSysOrganizationViewOutput> organization = orgCloudService.getSysOrganizationById(context, viewInput);
organization.throwIfFail();
return Optional.ofNullable(organization.getResult())
.map(GetSysOrganizationViewOutput::getOuName)
.orElse(null);
}
/**
* 通过线路ID获取线路信息
*
......
package pps.core.base.service.data.base_power_line;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import xstartup.annotation.XText;
import xstartup.base.data.XPageInput;
......@@ -17,11 +18,9 @@ public class QueryBasePowerLineViewInput extends XPageInput {
private String id;
@XText("组织机构ID")
@NotBlank(message = "缺少组织机构ID")
private String ouId;
@XText("上级线路ID")
private String upperLineId;
@XText("线路名称")
private String lineName;
}
package pps.core.base.service.data.base_power_line;
import lombok.Data;
import xstartup.annotation.XText;
import java.util.Date;
import java.math.BigDecimal;
import xstartup.base.data.XPageInput;
/**
* 输电线路配置
*
* @author ZWT
* @date 2023/08/28
*/
@Data
public class QueryBasePowerLineViewOutput extends XPageInput {
@XText("ID")
private String id;
@XText("是否删除(0_是;1_否)")
private Integer isDeleted;
@XText("创建人ID")
private String createById;
@XText("创建人名称")
private String createByName;
@XText("创建时间")
private Date createTime;
@XText("修改人ID")
private String modifyById;
@XText("修改人名称")
private String modifyByName;
@XText("修改时间")
private Date modifyTime;
@XText("组织机构ID")
private String ouId;
......@@ -54,132 +39,33 @@ public class QueryBasePowerLineViewOutput extends XPageInput {
@XText("是否激活返输调度(0_激活;1_关闭)")
private Integer isReverseDispatch;
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 getUpperLineId() {
return this.upperLineId;
}
public void setUpperLineId(String value) {
this.upperLineId = value;
}
public String getLineName() {
return this.lineName;
}
public void setLineName(String value) {
this.lineName = value;
}
public String getGridTypeKey() {
return this.gridTypeKey;
}
public void setGridTypeKey(String value) {
this.gridTypeKey = value;
}
public String getLineTypeKey() {
return this.lineTypeKey;
}
public void setLineTypeKey(String value) {
this.lineTypeKey = value;
}
public String getStrategyId() {
return this.strategyId;
}
public void setStrategyId(String value) {
this.strategyId = value;
}
public Integer getIsShareDispatch() {
return this.isShareDispatch;
}
public void setIsShareDispatch(Integer value) {
this.isShareDispatch = value;
}
public Integer getIsReverseDispatch() {
return this.isReverseDispatch;
}
public void setIsReverseDispatch(Integer value) {
this.isReverseDispatch = value;
}
/**
* 上级线路名称
*/
@XText("上级线路名称")
private String upperLineName;
/**
* 组织机构名称
*/
@XText("组织机构名称")
private String ouName;
/**
* 电网类型名称
*/
@XText("电网类型名称")
private String gridTypeName;
/**
* 线路类型名称
*/
@XText("线路类型名称")
private String lineTypeName;
/**
* 井口数
*/
@XText("井口数")
private Integer wellheadCount;
}
\ No newline at end of file
......@@ -42,6 +42,7 @@
<resultMap id="ExtendsResultMap" type="pps.core.base.entity.BasePowerLineView" extends="BaseResultMap">
<result column="upper_line_name" property="upperLineName" jdbcType="VARCHAR"/>
<result column="policy_name" property="policyName" jdbcType="VARCHAR"/>
<result column="wellhead_count" property="wellheadCount" jdbcType="INTEGER"/>
</resultMap>
<select id="selectOne" parameterType="pps.core.base.entity.BasePowerLineView" resultMap="ExtendsResultMap">
......@@ -57,8 +58,13 @@
<select id="selectList" parameterType="pps.core.base.entity.BasePowerLineView" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
, ( SELECT line_name FROM base_power_line l WHERE l.id = base_power_line.upper_line_id ) AS upper_line_name
, ( SELECT COUNT( 1 ) FROM base_power_line_wellhead w WHERE base_power_line.id = w.line_id ) AS wellhead_count
from base_power_line
where
id=#{id}
ou_id =#{ouId}
<if test="lineName != null and lineName != ''">
AND line_name LIKE CONCAT( '%', #{lineName}, '%' )
</if>
</select>
</mapper>
\ No newline at end of file
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