辽宁版本台账管理调整
This commit is contained in:
@@ -0,0 +1,96 @@
|
|||||||
|
package com.njcn.device.pq.pojo.param;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2026-07-29
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class PqSubstationExpendParam extends BaseParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@NotBlank(message = "名称不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@NotBlank(message = "地市不可为空")
|
||||||
|
private String pid;
|
||||||
|
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
private BigDecimal lng;
|
||||||
|
|
||||||
|
private BigDecimal lat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负荷容量
|
||||||
|
*/
|
||||||
|
private BigDecimal loadCap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最高电压等级
|
||||||
|
*/
|
||||||
|
private Integer maxVoltageType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 投运日期
|
||||||
|
*/
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
private LocalDate operateDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运行状态
|
||||||
|
*/
|
||||||
|
private Integer operateState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属业主
|
||||||
|
*/
|
||||||
|
private String owner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
private String phoneNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 场站类型
|
||||||
|
*/
|
||||||
|
private String plantType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报告附件地址
|
||||||
|
*/
|
||||||
|
private String reportUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,32 +1,32 @@
|
|||||||
package com.njcn.device.pq.pojo.po;
|
//package com.njcn.device.pq.pojo.po;
|
||||||
|
//
|
||||||
import lombok.Data;
|
//import lombok.Data;
|
||||||
import org.influxdb.annotation.Column;
|
//import org.influxdb.annotation.Column;
|
||||||
import org.influxdb.annotation.Measurement;
|
//import org.influxdb.annotation.Measurement;
|
||||||
|
//
|
||||||
import java.time.Instant;
|
//import java.time.Instant;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* data_flicker influxDB别名映射表
|
// * data_flicker influxDB别名映射表
|
||||||
*
|
// *
|
||||||
* @author qijian
|
// * @author qijian
|
||||||
* @version 1.0.0
|
// * @version 1.0.0
|
||||||
* @createTime 2022/11/29 15:27
|
// * @createTime 2022/11/29 15:27
|
||||||
*/
|
// */
|
||||||
@Data
|
//@Data
|
||||||
@Measurement(name = "data_flicker")
|
//@Measurement(name = "data_flicker")
|
||||||
public class DataFlicker {
|
//public class DataFlicker {
|
||||||
|
//
|
||||||
@Column(name = "time")
|
// @Column(name = "time")
|
||||||
private Instant time;
|
// private Instant time;
|
||||||
|
//
|
||||||
@Column(name = "line_id")
|
// @Column(name = "line_id")
|
||||||
private String lineId;
|
// private String lineId;
|
||||||
|
//
|
||||||
@Column(name = "pst_count")
|
// @Column(name = "pst_count")
|
||||||
private Integer pstCount;
|
// private Integer pstCount;
|
||||||
|
//
|
||||||
@Column(name = "plt_count")
|
// @Column(name = "plt_count")
|
||||||
private Integer pltCount;
|
// private Integer pltCount;
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -1,72 +1,72 @@
|
|||||||
package com.njcn.device.pq.pojo.po;
|
//package com.njcn.device.pq.pojo.po;
|
||||||
|
//
|
||||||
import lombok.Data;
|
//import lombok.Data;
|
||||||
import org.influxdb.annotation.Column;
|
//import org.influxdb.annotation.Column;
|
||||||
import org.influxdb.annotation.Measurement;
|
//import org.influxdb.annotation.Measurement;
|
||||||
|
//
|
||||||
import java.time.Instant;
|
//import java.time.Instant;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* data_v influxDB别名映射表
|
// * data_v influxDB别名映射表
|
||||||
*
|
// *
|
||||||
* @author qijian
|
// * @author qijian
|
||||||
* @version 1.0.0
|
// * @version 1.0.0
|
||||||
* @createTime 2022/10/27 15:27
|
// * @createTime 2022/10/27 15:27
|
||||||
*/
|
// */
|
||||||
@Data
|
//@Data
|
||||||
@Measurement(name = "data_v")
|
//@Measurement(name = "data_v")
|
||||||
public class DataV {
|
//public class DataV {
|
||||||
|
//
|
||||||
@Column(name = "time")
|
// @Column(name = "time")
|
||||||
private Instant time;
|
// private Instant time;
|
||||||
|
//
|
||||||
@Column(name = "line_id")
|
// @Column(name = "line_id")
|
||||||
private String lineId;
|
// private String lineId;
|
||||||
|
//
|
||||||
@Column(name = "freq_max")
|
// @Column(name = "freq_max")
|
||||||
private Double freqMAX;
|
// private Double freqMAX;
|
||||||
|
//
|
||||||
@Column(name = "freq_min")
|
// @Column(name = "freq_min")
|
||||||
private Double freqMIN;
|
// private Double freqMIN;
|
||||||
|
//
|
||||||
@Column(name = "rms_max")
|
// @Column(name = "rms_max")
|
||||||
private Double rmsMAX;
|
// private Double rmsMAX;
|
||||||
|
//
|
||||||
@Column(name = "rms_min")
|
// @Column(name = "rms_min")
|
||||||
private Double rmsMIN;
|
// private Double rmsMIN;
|
||||||
|
//
|
||||||
@Column(name = "rms_lvr_max")
|
// @Column(name = "rms_lvr_max")
|
||||||
private Double rmsLvrMAX;
|
// private Double rmsLvrMAX;
|
||||||
|
//
|
||||||
@Column(name = "rms_lvr_min")
|
// @Column(name = "rms_lvr_min")
|
||||||
private Double rmsLvrMIN;
|
// private Double rmsLvrMIN;
|
||||||
|
//
|
||||||
@Column(name = "v_thd_max")
|
// @Column(name = "v_thd_max")
|
||||||
private Double vThdMAX;
|
// private Double vThdMAX;
|
||||||
|
//
|
||||||
@Column(name = "v_thd_min")
|
// @Column(name = "v_thd_min")
|
||||||
private Double vThdMIN;
|
// private Double vThdMIN;
|
||||||
|
//
|
||||||
@Column(name = "v_unbalance_max")
|
// @Column(name = "v_unbalance_max")
|
||||||
private Double vUnbalanceMAX;
|
// private Double vUnbalanceMAX;
|
||||||
|
//
|
||||||
@Column(name = "v_unbalance_min")
|
// @Column(name = "v_unbalance_min")
|
||||||
private Double vUnbalanceMIN;
|
// private Double vUnbalanceMIN;
|
||||||
|
//
|
||||||
@Column(name = "freq_count")
|
// @Column(name = "freq_count")
|
||||||
private Integer freqCount;
|
// private Integer freqCount;
|
||||||
|
//
|
||||||
@Column(name = "rms_count")
|
// @Column(name = "rms_count")
|
||||||
private Integer rmsCount;
|
// private Integer rmsCount;
|
||||||
|
//
|
||||||
@Column(name = "rms_lvr_count")
|
// @Column(name = "rms_lvr_count")
|
||||||
private Integer rmsLvrCount;
|
// private Integer rmsLvrCount;
|
||||||
|
//
|
||||||
@Column(name = "v_thd_count")
|
// @Column(name = "v_thd_count")
|
||||||
private Integer vThdCount;
|
// private Integer vThdCount;
|
||||||
|
//
|
||||||
@Column(name = "v_unbalance_count")
|
// @Column(name = "v_unbalance_count")
|
||||||
private Integer vUnbalanceCount;
|
// private Integer vUnbalanceCount;
|
||||||
|
//
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package com.njcn.device.pq.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2026-07-29
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@TableName(value = "PQ_SUBSTATION_EXPEND")
|
||||||
|
public class PqSubstationExpend extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负荷容量
|
||||||
|
*/
|
||||||
|
@TableField("LOAD_CAP")
|
||||||
|
private BigDecimal loadCap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址
|
||||||
|
*/
|
||||||
|
@TableField("ADDRESS")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 投运日期
|
||||||
|
*/
|
||||||
|
@TableField("OPERATE_DATE")
|
||||||
|
private LocalDate operateDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运行状态
|
||||||
|
*/
|
||||||
|
@TableField("OPERATE_STATE")
|
||||||
|
private Integer operateState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属业主
|
||||||
|
*/
|
||||||
|
@TableField("OWNER")
|
||||||
|
private String owner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
@TableField("PHONE_NO")
|
||||||
|
private String phoneNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 场站类型
|
||||||
|
*/
|
||||||
|
@TableField("PLANT_TYPE")
|
||||||
|
private String plantType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报告附件地址
|
||||||
|
*/
|
||||||
|
@TableField("REPORT_URL")
|
||||||
|
private String reportUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
@TableField("SORT")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
package com.njcn.device.pq.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.device.line.service.LineService;
|
||||||
|
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||||
|
import com.njcn.device.pq.pojo.param.PqSubstationExpendParam;
|
||||||
|
import com.njcn.device.pq.pojo.po.Line;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqSubstationExpend;
|
||||||
|
import com.njcn.device.pq.pojo.po.Substation;
|
||||||
|
import com.njcn.device.pq.pojo.vo.PqSubstationExpendVO;
|
||||||
|
import com.njcn.device.pq.service.ISubstationService;
|
||||||
|
import com.njcn.device.pq.service.PqSubstationExpendService;
|
||||||
|
import com.njcn.device.pq.service.impl.SubstationServiceImpl;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站扩展信息 CRUD
|
||||||
|
*
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2026-07-29
|
||||||
|
* @Description: 变电站扩展信息增删改查
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "变电站扩展信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/substationExpend")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PqSubstationExpendController extends BaseController {
|
||||||
|
|
||||||
|
private final PqSubstationExpendService pqSubstationExpendService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/getById")
|
||||||
|
@ApiOperation("根据ID查询变电站扩展信息")
|
||||||
|
@ApiImplicitParam(name = "id", value = "变电站ID", required = true)
|
||||||
|
public HttpResult<PqSubstationExpendVO> getById(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("getById");
|
||||||
|
PqSubstationExpendVO vo = pqSubstationExpendService.getByIdVO(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("查询变电站扩展信息列表")
|
||||||
|
public HttpResult<List<PqSubstationExpendVO>> list() {
|
||||||
|
String methodDescribe = getMethodDescribe("list");
|
||||||
|
List<PqSubstationExpendVO> list = pqSubstationExpendService.listVO();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/page")
|
||||||
|
@ApiOperation("分页查询变电站扩展信息(支持多条件过滤,含地市和名称)")
|
||||||
|
@ApiImplicitParam(name = "param", value = "分页查询参数", required = true)
|
||||||
|
public HttpResult<IPage<PqSubstationExpendVO>> page(@RequestBody PqSubstationExpendParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("page");
|
||||||
|
Page<PqSubstationExpendVO> page = pqSubstationExpendService.pageJoin(new Page<>(param.getPageNum(), param.getPageSize()), param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperation("新增或修改变电站扩展信息")
|
||||||
|
@ApiImplicitParam(name = "expend", value = "变电站扩展信息实体", required = true)
|
||||||
|
public HttpResult<Boolean> save(@RequestBody @Validated PqSubstationExpendParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("save");
|
||||||
|
boolean result = pqSubstationExpendService.save(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/delete")
|
||||||
|
@ApiOperation("根据ID删除变电站扩展信息")
|
||||||
|
@ApiImplicitParam(name = "id", value = "变电站ID", required = true)
|
||||||
|
public HttpResult<Boolean> delete(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
|
boolean result = pqSubstationExpendService.removeById(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.njcn.device.pq.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.device.pq.pojo.param.PqSubstationExpendParam;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqSubstationExpend;
|
||||||
|
import com.njcn.device.pq.pojo.vo.PqSubstationExpendVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PqSubstationExpendMapper extends BaseMapper<PqSubstationExpend> {
|
||||||
|
|
||||||
|
Page<PqSubstationExpendVO> pageJoin(IPage<PqSubstationExpendVO> page, @Param("param") PqSubstationExpendParam param);
|
||||||
|
|
||||||
|
PqSubstationExpendVO getByIdVO(@Param("id") String id);
|
||||||
|
|
||||||
|
List<PqSubstationExpendVO> listVO();
|
||||||
|
|
||||||
|
List<PqSubstationExpend> selectSyncData();
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.device.pq.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pq.pojo.param.PqSubstationExpendParam;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqSubstationExpend;
|
||||||
|
import com.njcn.device.pq.pojo.vo.PqSubstationExpendVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface PqSubstationExpendService extends IService<PqSubstationExpend> {
|
||||||
|
|
||||||
|
Page<PqSubstationExpendVO> pageJoin(IPage<PqSubstationExpendVO> page, PqSubstationExpendParam param);
|
||||||
|
|
||||||
|
PqSubstationExpendVO getByIdVO(String id);
|
||||||
|
|
||||||
|
List<PqSubstationExpendVO> listVO();
|
||||||
|
|
||||||
|
Boolean save(PqSubstationExpendParam param);
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.njcn.device.pq.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.device.line.service.LineService;
|
||||||
|
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||||
|
import com.njcn.device.pq.mapper.PqSubstationExpendMapper;
|
||||||
|
import com.njcn.device.pq.pojo.param.PqSubstationExpendParam;
|
||||||
|
import com.njcn.device.pq.pojo.po.Line;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqSubstationExpend;
|
||||||
|
import com.njcn.device.pq.pojo.po.Substation;
|
||||||
|
import com.njcn.device.pq.pojo.vo.PqSubstationExpendVO;
|
||||||
|
import com.njcn.device.pq.service.ISubstationService;
|
||||||
|
import com.njcn.device.pq.service.PqSubstationExpendService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2026-07-29
|
||||||
|
* @Description: 变电站扩展信息
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PqSubstationExpendServiceImpl extends ServiceImpl<PqSubstationExpendMapper, PqSubstationExpend>
|
||||||
|
implements PqSubstationExpendService {
|
||||||
|
|
||||||
|
private final LineService lineService;
|
||||||
|
|
||||||
|
private final ISubstationService iSubstationService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PqSubstationExpendVO> pageJoin(IPage<PqSubstationExpendVO> page, PqSubstationExpendParam param) {
|
||||||
|
return baseMapper.pageJoin(page, param);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PqSubstationExpendVO getByIdVO(String id) {
|
||||||
|
return baseMapper.getByIdVO(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PqSubstationExpendVO> listVO() {
|
||||||
|
return baseMapper.listVO();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean save(PqSubstationExpendParam param) {
|
||||||
|
Line line = new Line();
|
||||||
|
line.setId(param.getId());
|
||||||
|
line.setName(param.getName());
|
||||||
|
line.setPid(param.getPid());
|
||||||
|
line.setLevel(LineBaseEnum.SUB_LEVEL.getCode());
|
||||||
|
|
||||||
|
Line gd = lineService.lambdaQuery().eq(Line::getId, param.getPid()).eq(Line::getState, DataStateEnum.ENABLE.getCode()).one();
|
||||||
|
line.setPids(gd.getPids()+","+param.getId());
|
||||||
|
line.setSort(0);
|
||||||
|
line.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
lineService.saveOrUpdate(line);
|
||||||
|
|
||||||
|
Substation substation = new Substation();
|
||||||
|
substation.setId(param.getId());
|
||||||
|
substation.setLng(param.getLng());
|
||||||
|
substation.setLat(param.getLat());
|
||||||
|
substation.setScale(param.getScale());
|
||||||
|
iSubstationService.saveOrUpdate(substation);
|
||||||
|
|
||||||
|
|
||||||
|
PqSubstationExpend expend = new PqSubstationExpend();
|
||||||
|
expend.setId(param.getId());
|
||||||
|
expend.setLoadCap(param.getLoadCap());
|
||||||
|
expend.setAddress(param.getAddress());
|
||||||
|
expend.setOperateDate(param.getOperateDate());
|
||||||
|
expend.setPlantType(param.getPlantType());
|
||||||
|
expend.setOperateState(param.getOperateState());
|
||||||
|
expend.setReportUrl(param.getReportUrl());
|
||||||
|
this.saveOrUpdate(expend);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.njcn.device.line.controller;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
@@ -571,5 +572,12 @@ public class LineController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("获取指定层级的下拉数据")
|
||||||
|
@GetMapping("/getSelectList")
|
||||||
|
public HttpResult<List<Line>> getSelectList(@RequestParam Integer level){
|
||||||
|
String methodDescribe = getMethodDescribe("getSelectList");
|
||||||
|
List<Line> list = lineService.lambdaQuery().select(Line::getId,Line::getName).orderByAsc(Line::getSort).eq(Line::getLevel,level).eq(Line::getState, DataStateEnum.ENABLE.getCode()).list();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user