删除pms母线代码

This commit is contained in:
2023-03-22 18:06:00 +08:00
parent eb6c6fa85b
commit c3b89343fd
7 changed files with 380 additions and 375 deletions

View File

@@ -1,36 +1,36 @@
package com.njcn.device.pms.pojo.po;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* pms-device
* 母线
* @author cdf
* @date 2022/10/26
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("pms_generatrix")
public class Generatrix extends BaseEntity {
private static final long serialVersionUID = 1L;
@TableId
private String generatrixId;
private String generatrixName;
private String statationId;
private String statationName;
private String scale;
private Integer status;
}
//package com.njcn.device.pms.pojo.po;
//
//import com.baomidou.mybatisplus.annotation.TableId;
//import com.baomidou.mybatisplus.annotation.TableName;
//import com.njcn.db.bo.BaseEntity;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//
///**
// * pms-device
// * 母线
// * @author cdf
// * @date 2022/10/26
// */
//@Data
//@EqualsAndHashCode(callSuper = true)
//@TableName("pms_generatrix")
//public class Generatrix extends BaseEntity {
//
// private static final long serialVersionUID = 1L;
//
// @TableId
// private String generatrixId;
//
// private String generatrixName;
//
// private String statationId;
//
// private String statationName;
//
// private String scale;
//
// private Integer status;
//
//
//}

View File

@@ -1,3 +1,4 @@
/*
package com.njcn.device.pms.controller.ledgerManger;
import cn.hutool.core.collection.CollectionUtil;
@@ -29,12 +30,14 @@ import javax.validation.constraints.NotEmpty;
import java.util.List;
import java.util.Objects;
*/
/**
* 母线信息
*
* @author yzh
* @date 2022/10/18
*/
*//*
@RestController
@RequestMapping("/pmsGeneratrix")
@@ -45,12 +48,14 @@ public class PmsGeneratrixController extends BaseController {
private final IPmsGeneratrixService pmsGeneratrixService;
/**
*/
/**
* 获取指定母线信息
*
* @param param 获取指定的监测点信息条件
* @return 指定母线信息
*/
*//*
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getGeneratrixInfo")
@ApiOperation("获取指定母线信息")
@@ -65,14 +70,16 @@ public class PmsGeneratrixController extends BaseController {
}
}
/**
*/
/**
* 获取母线与电站关联信息
*
* @param param 条件参数
* @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO>>
* @author yzh
* @date 2022/11/3
*/
*//*
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getGeneratrixAndPowerStationInfo")
@ApiOperation("获取母线与电站关联信息")
@@ -87,13 +94,15 @@ public class PmsGeneratrixController extends BaseController {
}
}
/**
*/
/**
* @Description: 普测计划页面调用根据条件查询母线信息
* @Param: [param]
* @return: com.njcn.common.pojo.response.HttpResult<java.util.List<com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO>>
* @Author: clam
* @Date: 2022/12/5
*/
*//*
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getGeneratrixByCondition")
@ApiOperation("普测计划页面调用根据条件查询母线信息")
@@ -184,3 +193,4 @@ public class PmsGeneratrixController extends BaseController {
}
}
*/

View File

@@ -1,47 +1,47 @@
package com.njcn.device.pms.mapper.majornetwork;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO;
import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationSonDTO;
import com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO;
import com.njcn.device.pms.pojo.param.ConditionParam;
import com.njcn.device.pms.pojo.param.PmsGeneratrixParam;
import com.njcn.device.pms.pojo.po.Generatrix;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author yzh
* @date 2022/10/18
*/
@Mapper
public interface PmsGeneratrixMapper extends BaseMapper<Generatrix> {
/**
* 获取母线信息
*
* @param pmsGeneratrixParam 入参
* @return 母线信息
*/
List<PmsGeneratrixDTO> getGeneratrixInfo(@Param("pmsGeneratrixParam") PmsGeneratrixParam pmsGeneratrixParam);
/**
* 获取母线与电站关联信息
*
* @param param 条件参数
* @return java.util.List<com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO>
* @author yzh
* @date 2022/11/3
*/
List<GeneratrixAndPowerStationDTO> getGeneratrixAndPowerStationInfo(@Param("param") PmsGeneratrixParam param);
/**
* @Description: 普测计划页面调用根据条件查询母线信息
* @Param: [data, param]
* @return: java.util.List<com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO>
* @Author: clam
* @Date: 2022/12/5
*/
List<GeneratrixAndPowerStationSonDTO> getGeneratrixByCondition(@Param("orgList")List<String> data, @Param("param")ConditionParam param);
}
//package com.njcn.device.pms.mapper.majornetwork;
//
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
//import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO;
//import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationSonDTO;
//import com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO;
//import com.njcn.device.pms.pojo.param.ConditionParam;
//import com.njcn.device.pms.pojo.param.PmsGeneratrixParam;
//import com.njcn.device.pms.pojo.po.Generatrix;
//import org.apache.ibatis.annotations.Mapper;
//import org.apache.ibatis.annotations.Param;
//
//import java.util.List;
//
///**
// * @author yzh
// * @date 2022/10/18
// */
//@Mapper
//public interface PmsGeneratrixMapper extends BaseMapper<Generatrix> {
//
// /**
// * 获取母线信息
// *
// * @param pmsGeneratrixParam 入参
// * @return 母线信息
// */
// List<PmsGeneratrixDTO> getGeneratrixInfo(@Param("pmsGeneratrixParam") PmsGeneratrixParam pmsGeneratrixParam);
//
// /**
// * 获取母线与电站关联信息
// *
// * @param param 条件参数
// * @return java.util.List<com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO>
// * @author yzh
// * @date 2022/11/3
// */
// List<GeneratrixAndPowerStationDTO> getGeneratrixAndPowerStationInfo(@Param("param") PmsGeneratrixParam param);
// /**
// * @Description: 普测计划页面调用根据条件查询母线信息
// * @Param: [data, param]
// * @return: java.util.List<com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO>
// * @Author: clam
// * @Date: 2022/12/5
// */
// List<GeneratrixAndPowerStationSonDTO> getGeneratrixByCondition(@Param("orgList")List<String> data, @Param("param")ConditionParam param);
//}

View File

@@ -1,108 +1,108 @@
package com.njcn.device.pms.service.majornetwork;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO;
import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationSonDTO;
import com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO;
import com.njcn.device.pms.pojo.param.ConditionParam;
import com.njcn.device.pms.pojo.param.GeneratrixParam;
import com.njcn.device.pms.pojo.param.PmsBaseParam;
import com.njcn.device.pms.pojo.param.PmsGeneratrixParam;
import com.njcn.device.pms.pojo.po.Generatrix;
import com.njcn.web.pojo.param.BaseParam;
import java.util.List;
/**
* @author yzh
* @date 2022/10/18
*/
public interface IPmsGeneratrixService extends IService<Generatrix> {
/**
* 获取母线信息
*
* @param param 入参
* @return 母线信息
*/
List<PmsGeneratrixDTO> getGeneratrixInfo(PmsGeneratrixParam param);
/**
* 新增母线
*
* @param generatrixParam 母线
* @return boolean
* @author cdf
* @date 2022/10/25
*/
boolean addGeneratrix(GeneratrixParam generatrixParam);
/**
* 修改母线
*
* @param generatrixParam 母线
* @return boolean
* @author cdf
* @date 2022/10/25
*/
boolean updateGeneratrix(GeneratrixParam generatrixParam);
/**
* 删除母线
*
* @param generatrixIds 母线
* @return boolean
* @author cdf
* @date 2022/10/25
*/
boolean delGeneratrix(List<String> generatrixIds);
/**
* 查询母线
*
* @param generatrixId 母线id
* @return boolean
* @author cdf
* @date 2022/10/25
*/
Generatrix getGeneratrixById(String generatrixId);
/**
* 查询母线列表
*
* @return boolean
* @author cdf
* @date 2022/10/25
*/
List<Generatrix> getGeneratrixList(PmsBaseParam pmsBaseParam);
/**
* 查询母线列表
*
* @param baseParam 基础参数
* @return boolean
* @author cdf
* @date 2022/10/25
*/
Page<Generatrix> getGeneratrixPageList(BaseParam baseParam);
/**
* 获取母线与电站关联信息
*
* @param param 条件参数
* @return java.util.List<com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO>
* @author yzh
* @date 2022/11/3
*/
List<GeneratrixAndPowerStationDTO> getGeneratrixAndPowerStationInfo(PmsGeneratrixParam param);
/**
* @Description: 普测计划页面调用根据条件查询母线信息
* @Param: [param]
* @return: java.util.List<com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO>
* @Author: clam
* @Date: 2022/12/5
*/
List<GeneratrixAndPowerStationSonDTO> getGeneratrixByCondition(ConditionParam param);
}
//package com.njcn.device.pms.service.majornetwork;
//
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.baomidou.mybatisplus.extension.service.IService;
//import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO;
//import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationSonDTO;
//import com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO;
//import com.njcn.device.pms.pojo.param.ConditionParam;
//import com.njcn.device.pms.pojo.param.GeneratrixParam;
//import com.njcn.device.pms.pojo.param.PmsBaseParam;
//import com.njcn.device.pms.pojo.param.PmsGeneratrixParam;
//import com.njcn.device.pms.pojo.po.Generatrix;
//import com.njcn.web.pojo.param.BaseParam;
//
//import java.util.List;
//
///**
// * @author yzh
// * @date 2022/10/18
// */
//
//public interface IPmsGeneratrixService extends IService<Generatrix> {
//
// /**
// * 获取母线信息
// *
// * @param param 入参
// * @return 母线信息
// */
// List<PmsGeneratrixDTO> getGeneratrixInfo(PmsGeneratrixParam param);
//
// /**
// * 新增母线
// *
// * @param generatrixParam 母线
// * @return boolean
// * @author cdf
// * @date 2022/10/25
// */
// boolean addGeneratrix(GeneratrixParam generatrixParam);
//
// /**
// * 修改母线
// *
// * @param generatrixParam 母线
// * @return boolean
// * @author cdf
// * @date 2022/10/25
// */
// boolean updateGeneratrix(GeneratrixParam generatrixParam);
//
// /**
// * 删除母线
// *
// * @param generatrixIds 母线
// * @return boolean
// * @author cdf
// * @date 2022/10/25
// */
// boolean delGeneratrix(List<String> generatrixIds);
//
// /**
// * 查询母线
// *
// * @param generatrixId 母线id
// * @return boolean
// * @author cdf
// * @date 2022/10/25
// */
// Generatrix getGeneratrixById(String generatrixId);
//
// /**
// * 查询母线列表
// *
// * @return boolean
// * @author cdf
// * @date 2022/10/25
// */
// List<Generatrix> getGeneratrixList(PmsBaseParam pmsBaseParam);
//
// /**
// * 查询母线列表
// *
// * @param baseParam 基础参数
// * @return boolean
// * @author cdf
// * @date 2022/10/25
// */
// Page<Generatrix> getGeneratrixPageList(BaseParam baseParam);
//
// /**
// * 获取母线与电站关联信息
// *
// * @param param 条件参数
// * @return java.util.List<com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO>
// * @author yzh
// * @date 2022/11/3
// */
// List<GeneratrixAndPowerStationDTO> getGeneratrixAndPowerStationInfo(PmsGeneratrixParam param);
// /**
// * @Description: 普测计划页面调用根据条件查询母线信息
// * @Param: [param]
// * @return: java.util.List<com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO>
// * @Author: clam
// * @Date: 2022/12/5
// */
// List<GeneratrixAndPowerStationSonDTO> getGeneratrixByCondition(ConditionParam param);
//}

View File

@@ -10,7 +10,6 @@ import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.device.pms.enums.PmsDeviceResponseEnum;
import com.njcn.device.pms.mapper.majornetwork.PmsGeneratrixWireMapper;
import com.njcn.device.pms.mapper.majornetwork.PmsGeneratrixMapper;
import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO;
import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationSonDTO;
import com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO;
@@ -18,7 +17,6 @@ import com.njcn.device.pms.pojo.param.ConditionParam;
import com.njcn.device.pms.pojo.param.GeneratrixWireParam;
import com.njcn.device.pms.pojo.param.PmsBaseParam;
import com.njcn.device.pms.pojo.param.PmsGeneratrixParam;
import com.njcn.device.pms.pojo.po.Generatrix;
import com.njcn.device.pms.pojo.po.GeneratrixWire;
import com.njcn.device.pms.pojo.po.StatationStat;
import com.njcn.device.pms.service.majornetwork.IGeneratrixWireService;

View File

@@ -1,172 +1,172 @@
package com.njcn.device.pms.service.majornetwork.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.common.pojo.exception.BusinessException;
import com.njcn.device.pms.enums.PmsDeviceResponseEnum;
import com.njcn.device.pms.mapper.majornetwork.PmsGeneratrixMapper;
import com.njcn.device.pms.mapper.majornetwork.StatationStatMapper;
import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO;
import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationSonDTO;
import com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO;
import com.njcn.device.pms.pojo.param.*;
import com.njcn.device.pms.pojo.po.Generatrix;
import com.njcn.device.pms.pojo.po.StatationStat;
import com.njcn.device.pms.service.majornetwork.IPmsGeneratrixService;
import com.njcn.user.api.DeptFeignClient;
import com.njcn.web.factory.PageFactory;
import com.njcn.web.pojo.param.BaseParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* @author yzh
* @date 2022/10/18
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class PmsGeneratrixServiceImpl extends ServiceImpl<PmsGeneratrixMapper, Generatrix> implements IPmsGeneratrixService {
private final PmsGeneratrixMapper pmsGeneratrixMapper;
private final StatationStatMapper statationStatMapper;
private final DeptFeignClient deptFeignClient;
/**
* 获取母线信息
*
* @param param 入参
* @return 母线信息
*/
@Override
public List<PmsGeneratrixDTO> getGeneratrixInfo(PmsGeneratrixParam param) {
if (CollUtil.isEmpty(param.getGeneratrixIds())) {
return null;
}
return pmsGeneratrixMapper.getGeneratrixInfo(param);
}
@Override
public boolean addGeneratrix(GeneratrixParam generatrixParam) {
checkName(generatrixParam,false);
StatationStat statationStat = statationStatMapper.selectById(generatrixParam.getStatationId());
if(Objects.isNull(statationStat)){
throw new BusinessException(PmsDeviceResponseEnum.NO_STATION);
}
Generatrix generatrix = new Generatrix();
BeanUtils.copyProperties(generatrixParam, generatrix);
generatrix.setStatationName(statationStat.getPowerName());
generatrix.setStatus(DataStateEnum.ENABLE.getCode());
return this.save(generatrix);
}
@Override
public boolean updateGeneratrix(GeneratrixParam generatrixParam) {
checkName(generatrixParam,true);
StatationStat statationStat = statationStatMapper.selectById(generatrixParam.getStatationId());
if(Objects.isNull(statationStat)){
throw new BusinessException(PmsDeviceResponseEnum.NO_STATION);
}
Generatrix generatrix = new Generatrix();
BeanUtils.copyProperties(generatrixParam, generatrix);
generatrix.setStatationName(statationStat.getPowerName());
return this.updateById(generatrix);
}
@Override
public boolean delGeneratrix(List<String> generatrixIds) {
return this.removeByIds(generatrixIds);
}
@Override
public Generatrix getGeneratrixById(String generatrixId) {
return this.getById(generatrixId);
}
@Override
public List<Generatrix> getGeneratrixList(PmsBaseParam pmsBaseParam) {
LambdaQueryWrapper<Generatrix> lambdaQueryWrapper = new LambdaQueryWrapper<>();
if(StrUtil.isNotBlank(pmsBaseParam.getStationId())){
lambdaQueryWrapper.eq(Generatrix::getStatationId,pmsBaseParam.getStationId());
}
lambdaQueryWrapper.orderByAsc(Generatrix::getCreateTime);
return this.list(lambdaQueryWrapper);
}
@Override
public Page<Generatrix> getGeneratrixPageList(BaseParam baseParam) {
LambdaQueryWrapper<Generatrix> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.like(StrUtil.isNotBlank(baseParam.getSearchValue()),Generatrix::getGeneratrixName,baseParam.getSearchValue())
.or(StrUtil.isNotBlank(baseParam.getSearchValue()))
.like(StrUtil.isNotBlank(baseParam.getSearchValue()),Generatrix::getStatationName,baseParam.getSearchValue())
.orderByAsc(Generatrix::getCreateTime);
return this.page(new Page<>(PageFactory.getPageNum(baseParam),PageFactory.getPageSize(baseParam)),lambdaQueryWrapper);
}
/**
* 获取母线与电站关联信息
*
* @param param 条件参数
* @return java.util.List<com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO>
* @author yzh
* @date 2022/11/3
*/
@Override
public List<GeneratrixAndPowerStationDTO> getGeneratrixAndPowerStationInfo(PmsGeneratrixParam param) {
return pmsGeneratrixMapper.getGeneratrixAndPowerStationInfo(param);
}
/**
* @param param
* @Description: 普测计划页面调用根据条件查询母线信息
* @Param: [param]
* @return: java.util.List<com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO>
* @Author: clam
* @Date: 2022/12/5
*/
@Override
public List<GeneratrixAndPowerStationSonDTO> getGeneratrixByCondition(ConditionParam param) {
List<String> data = deptFeignClient.getDepSonSelfCodetByDeptId (param.getDeptId ( )).getData ( );
return pmsGeneratrixMapper.getGeneratrixByCondition(data,param);
}
private void checkName(GeneratrixParam generatrixParam, Boolean updateFlag){
LambdaQueryWrapper<Generatrix> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(Generatrix::getGeneratrixName,generatrixParam.getGeneratrixName())
.eq(Generatrix::getGeneratrixId,generatrixParam.getStatationId())
.eq(Generatrix::getStatus, DataStateEnum.ENABLE.getCode());
if(updateFlag){
//更新
lambdaQueryWrapper.ne(Generatrix::getGeneratrixId,generatrixParam.getGeneratrixId());
}else {
//新增校验
LambdaQueryWrapper<Generatrix> lambdaQuery = new LambdaQueryWrapper<>();
lambdaQuery.eq(Generatrix::getGeneratrixId,generatrixParam.getGeneratrixId());
int count = this.count(lambdaQuery);
if(count>0){
throw new BusinessException(PmsDeviceResponseEnum.GENWIRE_SAME);
}
}
int count = this.count(lambdaQueryWrapper);
if(count > 0){
throw new BusinessException(PmsDeviceResponseEnum.GENERATRIX_NAME_REPEAT);
}
}
}
//package com.njcn.device.pms.service.majornetwork.impl;
//
//import cn.hutool.core.collection.CollUtil;
//import cn.hutool.core.util.StrUtil;
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//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.common.pojo.exception.BusinessException;
//import com.njcn.device.pms.enums.PmsDeviceResponseEnum;
//import com.njcn.device.pms.mapper.majornetwork.PmsGeneratrixMapper;
//import com.njcn.device.pms.mapper.majornetwork.StatationStatMapper;
//import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO;
//import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationSonDTO;
//import com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO;
//import com.njcn.device.pms.pojo.param.*;
//import com.njcn.device.pms.pojo.po.Generatrix;
//import com.njcn.device.pms.pojo.po.StatationStat;
//import com.njcn.device.pms.service.majornetwork.IPmsGeneratrixService;
//
//import com.njcn.user.api.DeptFeignClient;
//import com.njcn.web.factory.PageFactory;
//import com.njcn.web.pojo.param.BaseParam;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.BeanUtils;
//import org.springframework.stereotype.Service;
//
//import java.util.List;
//import java.util.Objects;
//
///**
// * @author yzh
// * @date 2022/10/18
// */
//@Slf4j
//@Service
//@RequiredArgsConstructor
//public class PmsGeneratrixServiceImpl extends ServiceImpl<PmsGeneratrixMapper, Generatrix> implements IPmsGeneratrixService {
//
// private final PmsGeneratrixMapper pmsGeneratrixMapper;
//
// private final StatationStatMapper statationStatMapper;
//
// private final DeptFeignClient deptFeignClient;
//
// /**
// * 获取母线信息
// *
// * @param param 入参
// * @return 母线信息
// */
// @Override
// public List<PmsGeneratrixDTO> getGeneratrixInfo(PmsGeneratrixParam param) {
// if (CollUtil.isEmpty(param.getGeneratrixIds())) {
// return null;
// }
// return pmsGeneratrixMapper.getGeneratrixInfo(param);
// }
//
// @Override
// public boolean addGeneratrix(GeneratrixParam generatrixParam) {
// checkName(generatrixParam,false);
// StatationStat statationStat = statationStatMapper.selectById(generatrixParam.getStatationId());
// if(Objects.isNull(statationStat)){
// throw new BusinessException(PmsDeviceResponseEnum.NO_STATION);
// }
// Generatrix generatrix = new Generatrix();
// BeanUtils.copyProperties(generatrixParam, generatrix);
// generatrix.setStatationName(statationStat.getPowerName());
// generatrix.setStatus(DataStateEnum.ENABLE.getCode());
// return this.save(generatrix);
// }
//
// @Override
// public boolean updateGeneratrix(GeneratrixParam generatrixParam) {
// checkName(generatrixParam,true);
// StatationStat statationStat = statationStatMapper.selectById(generatrixParam.getStatationId());
// if(Objects.isNull(statationStat)){
// throw new BusinessException(PmsDeviceResponseEnum.NO_STATION);
// }
// Generatrix generatrix = new Generatrix();
// BeanUtils.copyProperties(generatrixParam, generatrix);
// generatrix.setStatationName(statationStat.getPowerName());
// return this.updateById(generatrix);
// }
//
// @Override
// public boolean delGeneratrix(List<String> generatrixIds) {
// return this.removeByIds(generatrixIds);
// }
//
// @Override
// public Generatrix getGeneratrixById(String generatrixId) {
// return this.getById(generatrixId);
// }
//
// @Override
// public List<Generatrix> getGeneratrixList(PmsBaseParam pmsBaseParam) {
// LambdaQueryWrapper<Generatrix> lambdaQueryWrapper = new LambdaQueryWrapper<>();
// if(StrUtil.isNotBlank(pmsBaseParam.getStationId())){
// lambdaQueryWrapper.eq(Generatrix::getStatationId,pmsBaseParam.getStationId());
// }
// lambdaQueryWrapper.orderByAsc(Generatrix::getCreateTime);
// return this.list(lambdaQueryWrapper);
// }
//
// @Override
// public Page<Generatrix> getGeneratrixPageList(BaseParam baseParam) {
// LambdaQueryWrapper<Generatrix> lambdaQueryWrapper = new LambdaQueryWrapper<>();
// lambdaQueryWrapper.like(StrUtil.isNotBlank(baseParam.getSearchValue()),Generatrix::getGeneratrixName,baseParam.getSearchValue())
// .or(StrUtil.isNotBlank(baseParam.getSearchValue()))
// .like(StrUtil.isNotBlank(baseParam.getSearchValue()),Generatrix::getStatationName,baseParam.getSearchValue())
// .orderByAsc(Generatrix::getCreateTime);
// return this.page(new Page<>(PageFactory.getPageNum(baseParam),PageFactory.getPageSize(baseParam)),lambdaQueryWrapper);
// }
//
// /**
// * 获取母线与电站关联信息
// *
// * @param param 条件参数
// * @return java.util.List<com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO>
// * @author yzh
// * @date 2022/11/3
// */
// @Override
// public List<GeneratrixAndPowerStationDTO> getGeneratrixAndPowerStationInfo(PmsGeneratrixParam param) {
// return pmsGeneratrixMapper.getGeneratrixAndPowerStationInfo(param);
// }
//
// /**
// * @param param
// * @Description: 普测计划页面调用根据条件查询母线信息
// * @Param: [param]
// * @return: java.util.List<com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO>
// * @Author: clam
// * @Date: 2022/12/5
// */
// @Override
// public List<GeneratrixAndPowerStationSonDTO> getGeneratrixByCondition(ConditionParam param) {
//
// List<String> data = deptFeignClient.getDepSonSelfCodetByDeptId (param.getDeptId ( )).getData ( );
//
// return pmsGeneratrixMapper.getGeneratrixByCondition(data,param);
// }
//
//
// private void checkName(GeneratrixParam generatrixParam, Boolean updateFlag){
//
// LambdaQueryWrapper<Generatrix> lambdaQueryWrapper = new LambdaQueryWrapper<>();
// lambdaQueryWrapper.eq(Generatrix::getGeneratrixName,generatrixParam.getGeneratrixName())
// .eq(Generatrix::getGeneratrixId,generatrixParam.getStatationId())
// .eq(Generatrix::getStatus, DataStateEnum.ENABLE.getCode());
//
// if(updateFlag){
// //更新
// lambdaQueryWrapper.ne(Generatrix::getGeneratrixId,generatrixParam.getGeneratrixId());
// }else {
// //新增校验
// LambdaQueryWrapper<Generatrix> lambdaQuery = new LambdaQueryWrapper<>();
// lambdaQuery.eq(Generatrix::getGeneratrixId,generatrixParam.getGeneratrixId());
// int count = this.count(lambdaQuery);
// if(count>0){
// throw new BusinessException(PmsDeviceResponseEnum.GENWIRE_SAME);
// }
// }
// int count = this.count(lambdaQueryWrapper);
// if(count > 0){
// throw new BusinessException(PmsDeviceResponseEnum.GENERATRIX_NAME_REPEAT);
// }
// }
//}

View File

@@ -3,8 +3,6 @@ package com.njcn.device.pms.service.majornetwork.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.dto.SimpleDTO;
import com.njcn.device.pms.api.PmsGeneralDeviceInfoClient;
import com.njcn.device.pms.api.PmsGeneratrixClient;
import com.njcn.device.pms.mapper.majornetwork.RStatBusbarHarmonicMapper;
import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO;
import com.njcn.device.pms.pojo.dto.PmsGeneralDeviceDTO;
@@ -15,7 +13,6 @@ import com.njcn.device.pms.pojo.po.RStatBusbarHarmonicYPO;
import com.njcn.device.pms.pojo.vo.RStatBusbarHarmonicYVO;
import com.njcn.device.pms.service.majornetwork.IGeneratrixWireService;
import com.njcn.device.pms.service.majornetwork.IPmsGeneralDeviceService;
import com.njcn.device.pms.service.majornetwork.IPmsGeneratrixService;
import com.njcn.device.pms.service.majornetwork.RStatBusbarHarmonicService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;