From 072be96034783d5388d4762dca93a1ee812f66e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E6=9C=A8c?= <857448963@qq.com> Date: Mon, 25 Jul 2022 11:49:01 +0800 Subject: [PATCH] =?UTF-8?q?pv=E7=BB=88=E7=AB=AF=E5=8F=B0=E8=B4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/enums/PvDeviceResponseEnum.java | 1 + .../device/pojo/vo/pv/PvSubstationVO.java | 54 +++++++++++++++++++ .../controller/PvSubstationController.java | 5 +- .../pvdevice/mapper/PvSubstationMapper.java | 3 +- .../mapper/mapping/PvSubstationMapper.xml | 5 +- .../service/IPvSubstationService.java | 3 +- .../service/impl/PvDeviceServiceImpl.java | 2 +- .../impl/PvDistributedServiceImpl.java | 4 +- .../service/impl/PvLvUserServiceImpl.java | 6 +-- .../service/impl/PvSubAreaServiceImpl.java | 2 +- .../service/impl/PvSubstationServiceImpl.java | 5 +- .../service/impl/PvTenVoltageServiceImpl.java | 2 +- .../service/impl/PvVoltageServiceImpl.java | 2 +- 13 files changed, 77 insertions(+), 17 deletions(-) create mode 100644 pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvSubstationVO.java diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/enums/PvDeviceResponseEnum.java b/pqs-device/device-api/src/main/java/com/njcn/device/enums/PvDeviceResponseEnum.java index 64473adcf..00d313ac0 100644 --- a/pqs-device/device-api/src/main/java/com/njcn/device/enums/PvDeviceResponseEnum.java +++ b/pqs-device/device-api/src/main/java/com/njcn/device/enums/PvDeviceResponseEnum.java @@ -25,6 +25,7 @@ public enum PvDeviceResponseEnum { SUB_AREA_EMPTY("A0357","台区不能为空"), VOLTAGE_PARAM_EMPTY("A0358","所属母线不可为空"), VOLTAGE_PARAM_EMPTY_MUST("A0359","所属母线必须为空"), + LV_USER_REPEAT("A0360","低压用户名称重复"), TEN_VOLTAGE_NULL("A0360","未查询到指定10kV线路"), diff --git a/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvSubstationVO.java b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvSubstationVO.java new file mode 100644 index 000000000..f6cbd2efe --- /dev/null +++ b/pqs-device/device-api/src/main/java/com/njcn/device/pojo/vo/pv/PvSubstationVO.java @@ -0,0 +1,54 @@ +package com.njcn.device.pojo.vo.pv; + +import lombok.Data; + +/** + * pqs + * + * @author cdf + * @date 2022/7/25 + */ +@Data +public class PvSubstationVO { + + /** + * 变电站表Id + */ + private String id; + + /** + * 所属单位Id + */ + private String unitId; + + /** + * 所属单位名称 + */ + private String unitName; + + /** + * 变电站名称 + */ + private String name; + + /** + * 电压等级Id,字典表 + */ + private String scale; + + /** + * 电压等级名称 + */ + private String scaleName; + + /** + * 变电站总容量(MVA)(手动填写) + */ + private Double totalCapacity; + + /** + * 运维班组Code + */ + private String teamCode; + +} diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvSubstationController.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvSubstationController.java index 7e65709a4..4eab88f0e 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvSubstationController.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/controller/PvSubstationController.java @@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil; import com.njcn.device.pojo.param.pv.PvSubstationParam; import com.njcn.device.pojo.param.pv.SubstationQueryParam; import com.njcn.device.pojo.po.pv.PvSubstation; +import com.njcn.device.pojo.vo.pv.PvSubstationVO; import com.njcn.pvdevice.service.IPvSubstationService; import com.njcn.web.pojo.param.BaseParam; import io.swagger.annotations.Api; @@ -88,9 +89,9 @@ public class PvSubstationController extends BaseController { @OperateInfo(info = LogEnum.SYSTEM_COMMON) @ApiOperation("分页查询变电站") @ApiImplicitParam(name = "substationQueryParam",value = "变电站实体",required = true) - public HttpResult> getPvSubstationList(@RequestBody SubstationQueryParam substationQueryParam){ + public HttpResult> getPvSubstationList(@RequestBody SubstationQueryParam substationQueryParam){ String methodDescribe = getMethodDescribe("getPvSubstationList"); - Page page = iPvSubstationService.getPvSubstationList(substationQueryParam); + Page page = iPvSubstationService.getPvSubstationList(substationQueryParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe); } diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvSubstationMapper.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvSubstationMapper.java index 7e5f6cb3a..0593fad92 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvSubstationMapper.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/PvSubstationMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.device.pojo.param.pv.SubstationQueryParam; import com.njcn.device.pojo.po.pv.PvSubstation; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.device.pojo.vo.pv.PvSubstationVO; import com.njcn.user.pojo.vo.PvTerminalTreeVO; import org.apache.ibatis.annotations.Param; @@ -19,7 +20,7 @@ import java.util.List; */ public interface PvSubstationMapper extends BaseMapper { - Page getPvSubstationList(Page page,@Param("substationQueryParam") SubstationQueryParam substationQueryParam); + Page getPvSubstationList(Page page, @Param("substationQueryParam") SubstationQueryParam substationQueryParam); /** * 终端树结构的变电站 diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvSubstationMapper.xml b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvSubstationMapper.xml index 1947e39de..ccc27ee57 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvSubstationMapper.xml +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/mapper/mapping/PvSubstationMapper.xml @@ -2,10 +2,10 @@ - SELECT sub.id, - unit.NAME unitId, + dept.NAME unitId, dic.NAME scale, sub.NAME, sub.Total_Capacity, @@ -14,6 +14,7 @@ pv_substation sub LEFT JOIN pv_unit unit ON sub.unit_id = unit.id LEFT JOIN sys_dict_data dic ON sub.scale = dic.id + LEFT JOIN sys_dept dept ON sub.unit_id = dept.id and sub.name like CONCAT('%',#{substationQueryParam.searchValue},'%') diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvSubstationService.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvSubstationService.java index b31c8fc51..030147a45 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvSubstationService.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/IPvSubstationService.java @@ -6,6 +6,7 @@ import com.njcn.device.pojo.param.pv.SubstationQueryParam; import com.njcn.device.pojo.po.pv.PvSubstation; import com.baomidou.mybatisplus.extension.service.IService; import com.njcn.device.pojo.po.pv.PvSubstation; +import com.njcn.device.pojo.vo.pv.PvSubstationVO; import com.njcn.web.pojo.param.BaseParam; import java.util.List; @@ -46,7 +47,7 @@ public interface IPvSubstationService extends IService { * @date 2022/7/5 * @return Page */ - Page getPvSubstationList(SubstationQueryParam substationQueryParam); + Page getPvSubstationList(SubstationQueryParam substationQueryParam); List getAllPvSubstationList(); diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDeviceServiceImpl.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDeviceServiceImpl.java index 6394ee4c0..6c2e4cb0e 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDeviceServiceImpl.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDeviceServiceImpl.java @@ -92,7 +92,7 @@ public class PvDeviceServiceImpl extends ServiceImpl i if (isUpdate) { //更新操作 if (pvDeviceParam instanceof PvDeviceParam.UpdatePvDeviceParam) { - lambdaQueryWrapper.eq(PvDevice::getId, ((PvDeviceParam.UpdatePvDeviceParam) pvDeviceParam).getId()); + lambdaQueryWrapper.ne(PvDevice::getId, ((PvDeviceParam.UpdatePvDeviceParam) pvDeviceParam).getId()); } } int count = this.count(lambdaQueryWrapper); diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDistributedServiceImpl.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDistributedServiceImpl.java index 947edf770..1601f0733 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDistributedServiceImpl.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvDistributedServiceImpl.java @@ -97,7 +97,7 @@ public class PvDistributedServiceImpl extends ServiceImpl i if (isUpdate) { //更新操作 if (pvLvUserParam instanceof PvLvUserParam.UpdatePvLvUserParam) { - lambdaQueryWrapper.eq(PvLvUser::getId, ((PvLvUserParam.UpdatePvLvUserParam) pvLvUserParam).getId()); + lambdaQueryWrapper.ne(PvLvUser::getId, ((PvLvUserParam.UpdatePvLvUserParam) pvLvUserParam).getId()); } } int count = this.count(lambdaQueryWrapper); if (count > 0) { - throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_REPEAT); + throw new BusinessException(PvDeviceResponseEnum.LV_USER_REPEAT); } @@ -111,7 +111,7 @@ public class PvLvUserServiceImpl extends ServiceImpl i if (isUpdate) { //更新操作 if (pvLvUserParam instanceof PvLvUserParam.UpdatePvLvUserParam) { - lambdaQueryWrapper.eq(PvLvUser::getId, ((PvLvUserParam.UpdatePvLvUserParam) pvLvUserParam).getId()); + lambdaQueryWrapper.ne(PvLvUser::getId, ((PvLvUserParam.UpdatePvLvUserParam) pvLvUserParam).getId()); } } int countUserCode = this.count(lambdaQueryWrapper); diff --git a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvSubAreaServiceImpl.java b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvSubAreaServiceImpl.java index d967afde1..c9f91263e 100644 --- a/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvSubAreaServiceImpl.java +++ b/pqs-device/device-boot/src/main/java/com/njcn/pvdevice/service/impl/PvSubAreaServiceImpl.java @@ -104,7 +104,7 @@ public class PvSubAreaServiceImpl extends ServiceImpl getPvSubstationList(SubstationQueryParam substationQueryParam) { + public Page getPvSubstationList(SubstationQueryParam substationQueryParam) { Page page = new Page<>(PageFactory.getPageNum(substationQueryParam),PageFactory.getPageSize(substationQueryParam)); return this.baseMapper.getPvSubstationList(page,substationQueryParam); } @@ -102,7 +103,7 @@ public class PvSubstationServiceImpl extends ServiceImpl