From c3b89343fd60d69c7c2b8a89c21c064f1709a4f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E6=9C=A8c?= <857448963@qq.com> Date: Wed, 22 Mar 2023 18:06:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4pms=E6=AF=8D=E7=BA=BF?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../njcn/device/pms/pojo/po/Generatrix.java | 72 ++-- .../ledgerManger/PmsGeneratrixController.java | 24 +- .../majornetwork/PmsGeneratrixMapper.java | 94 ++--- .../majornetwork/IPmsGeneratrixService.java | 216 +++++------ .../majornetwork/impl/GeneratrixWireImpl.java | 2 - .../impl/PmsGeneratrixServiceImpl.java | 344 +++++++++--------- .../impl/RStatBusbarHarmonicServiceImpl.java | 3 - 7 files changed, 380 insertions(+), 375 deletions(-) diff --git a/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/Generatrix.java b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/Generatrix.java index 72b2bb5dc..507f20702 100644 --- a/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/Generatrix.java +++ b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/Generatrix.java @@ -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; +// +// +//} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsGeneratrixController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsGeneratrixController.java index e91a2b99c..985214d2e 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsGeneratrixController.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsGeneratrixController.java @@ -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> * @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> * @Author: clam * @Date: 2022/12/5 - */ + *//* + @OperateInfo(info = LogEnum.BUSINESS_COMMON) @PostMapping("/getGeneratrixByCondition") @ApiOperation("普测计划页面调用根据条件查询母线信息") @@ -184,3 +193,4 @@ public class PmsGeneratrixController extends BaseController { } } +*/ diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/PmsGeneratrixMapper.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/PmsGeneratrixMapper.java index 0c5f92cd0..ba8f7e546 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/PmsGeneratrixMapper.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/PmsGeneratrixMapper.java @@ -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 { - - /** - * 获取母线信息 - * - * @param pmsGeneratrixParam 入参 - * @return 母线信息 - */ - List getGeneratrixInfo(@Param("pmsGeneratrixParam") PmsGeneratrixParam pmsGeneratrixParam); - - /** - * 获取母线与电站关联信息 - * - * @param param 条件参数 - * @return java.util.List - * @author yzh - * @date 2022/11/3 - */ - List getGeneratrixAndPowerStationInfo(@Param("param") PmsGeneratrixParam param); - /** - * @Description: 普测计划页面调用根据条件查询母线信息 - * @Param: [data, param] - * @return: java.util.List - * @Author: clam - * @Date: 2022/12/5 - */ - List getGeneratrixByCondition(@Param("orgList")List 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 { +// +// /** +// * 获取母线信息 +// * +// * @param pmsGeneratrixParam 入参 +// * @return 母线信息 +// */ +// List getGeneratrixInfo(@Param("pmsGeneratrixParam") PmsGeneratrixParam pmsGeneratrixParam); +// +// /** +// * 获取母线与电站关联信息 +// * +// * @param param 条件参数 +// * @return java.util.List +// * @author yzh +// * @date 2022/11/3 +// */ +// List getGeneratrixAndPowerStationInfo(@Param("param") PmsGeneratrixParam param); +// /** +// * @Description: 普测计划页面调用根据条件查询母线信息 +// * @Param: [data, param] +// * @return: java.util.List +// * @Author: clam +// * @Date: 2022/12/5 +// */ +// List getGeneratrixByCondition(@Param("orgList")List data, @Param("param")ConditionParam param); +//} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPmsGeneratrixService.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPmsGeneratrixService.java index c0e73e5a8..5fd95708a 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPmsGeneratrixService.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPmsGeneratrixService.java @@ -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 { - - /** - * 获取母线信息 - * - * @param param 入参 - * @return 母线信息 - */ - List 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 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 getGeneratrixList(PmsBaseParam pmsBaseParam); - - /** - * 查询母线列表 - * - * @param baseParam 基础参数 - * @return boolean - * @author cdf - * @date 2022/10/25 - */ - Page getGeneratrixPageList(BaseParam baseParam); - - /** - * 获取母线与电站关联信息 - * - * @param param 条件参数 - * @return java.util.List - * @author yzh - * @date 2022/11/3 - */ - List getGeneratrixAndPowerStationInfo(PmsGeneratrixParam param); - /** - * @Description: 普测计划页面调用根据条件查询母线信息 - * @Param: [param] - * @return: java.util.List - * @Author: clam - * @Date: 2022/12/5 - */ - List 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 { +// +// /** +// * 获取母线信息 +// * +// * @param param 入参 +// * @return 母线信息 +// */ +// List 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 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 getGeneratrixList(PmsBaseParam pmsBaseParam); +// +// /** +// * 查询母线列表 +// * +// * @param baseParam 基础参数 +// * @return boolean +// * @author cdf +// * @date 2022/10/25 +// */ +// Page getGeneratrixPageList(BaseParam baseParam); +// +// /** +// * 获取母线与电站关联信息 +// * +// * @param param 条件参数 +// * @return java.util.List +// * @author yzh +// * @date 2022/11/3 +// */ +// List getGeneratrixAndPowerStationInfo(PmsGeneratrixParam param); +// /** +// * @Description: 普测计划页面调用根据条件查询母线信息 +// * @Param: [param] +// * @return: java.util.List +// * @Author: clam +// * @Date: 2022/12/5 +// */ +// List getGeneratrixByCondition(ConditionParam param); +//} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/GeneratrixWireImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/GeneratrixWireImpl.java index ae94e45af..b744f0ea8 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/GeneratrixWireImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/GeneratrixWireImpl.java @@ -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; diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PmsGeneratrixServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PmsGeneratrixServiceImpl.java index 95a274617..7dc98fe41 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PmsGeneratrixServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PmsGeneratrixServiceImpl.java @@ -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 implements IPmsGeneratrixService { - - private final PmsGeneratrixMapper pmsGeneratrixMapper; - - private final StatationStatMapper statationStatMapper; - - private final DeptFeignClient deptFeignClient; - - /** - * 获取母线信息 - * - * @param param 入参 - * @return 母线信息 - */ - @Override - public List 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 generatrixIds) { - return this.removeByIds(generatrixIds); - } - - @Override - public Generatrix getGeneratrixById(String generatrixId) { - return this.getById(generatrixId); - } - - @Override - public List getGeneratrixList(PmsBaseParam pmsBaseParam) { - LambdaQueryWrapper 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 getGeneratrixPageList(BaseParam baseParam) { - LambdaQueryWrapper 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 - * @author yzh - * @date 2022/11/3 - */ - @Override - public List getGeneratrixAndPowerStationInfo(PmsGeneratrixParam param) { - return pmsGeneratrixMapper.getGeneratrixAndPowerStationInfo(param); - } - - /** - * @param param - * @Description: 普测计划页面调用根据条件查询母线信息 - * @Param: [param] - * @return: java.util.List - * @Author: clam - * @Date: 2022/12/5 - */ - @Override - public List getGeneratrixByCondition(ConditionParam param) { - - List data = deptFeignClient.getDepSonSelfCodetByDeptId (param.getDeptId ( )).getData ( ); - - return pmsGeneratrixMapper.getGeneratrixByCondition(data,param); - } - - - private void checkName(GeneratrixParam generatrixParam, Boolean updateFlag){ - - LambdaQueryWrapper 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 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 implements IPmsGeneratrixService { +// +// private final PmsGeneratrixMapper pmsGeneratrixMapper; +// +// private final StatationStatMapper statationStatMapper; +// +// private final DeptFeignClient deptFeignClient; +// +// /** +// * 获取母线信息 +// * +// * @param param 入参 +// * @return 母线信息 +// */ +// @Override +// public List 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 generatrixIds) { +// return this.removeByIds(generatrixIds); +// } +// +// @Override +// public Generatrix getGeneratrixById(String generatrixId) { +// return this.getById(generatrixId); +// } +// +// @Override +// public List getGeneratrixList(PmsBaseParam pmsBaseParam) { +// LambdaQueryWrapper 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 getGeneratrixPageList(BaseParam baseParam) { +// LambdaQueryWrapper 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 +// * @author yzh +// * @date 2022/11/3 +// */ +// @Override +// public List getGeneratrixAndPowerStationInfo(PmsGeneratrixParam param) { +// return pmsGeneratrixMapper.getGeneratrixAndPowerStationInfo(param); +// } +// +// /** +// * @param param +// * @Description: 普测计划页面调用根据条件查询母线信息 +// * @Param: [param] +// * @return: java.util.List +// * @Author: clam +// * @Date: 2022/12/5 +// */ +// @Override +// public List getGeneratrixByCondition(ConditionParam param) { +// +// List data = deptFeignClient.getDepSonSelfCodetByDeptId (param.getDeptId ( )).getData ( ); +// +// return pmsGeneratrixMapper.getGeneratrixByCondition(data,param); +// } +// +// +// private void checkName(GeneratrixParam generatrixParam, Boolean updateFlag){ +// +// LambdaQueryWrapper 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 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); +// } +// } +//} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RStatBusbarHarmonicServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RStatBusbarHarmonicServiceImpl.java index e934e99fb..7c204de80 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RStatBusbarHarmonicServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RStatBusbarHarmonicServiceImpl.java @@ -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;