From ae04eb131e64ce7dfd186356f7b9cdaf336067f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E6=9C=A8c?= <857448963@qq.com> Date: Wed, 31 Jan 2024 16:47:28 +0800 Subject: [PATCH] =?UTF-8?q?1.pms=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/njcn/device/pms/pojo/param/PmsTerminalParam.java | 3 +++ .../njcn/device/pms/pojo/param/TerminalQueryParam.java | 2 ++ .../ledgerManger/PmsStatationStatController.java | 3 ++- .../pms/mapper/majornetwork/StatationStatMapper.java | 3 ++- .../mapper/majornetwork/mapping/StatationStatMapper.xml | 7 +++++++ .../pms/service/majornetwork/IStatationStatService.java | 3 ++- .../majornetwork/impl/StatationStatServiceImpl.java | 9 +++++++-- .../service/majornetwork/impl/TerminalServiceImpl.java | 7 +++++++ 8 files changed, 32 insertions(+), 5 deletions(-) diff --git a/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/param/PmsTerminalParam.java b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/param/PmsTerminalParam.java index aef34b68c..5bc863ec2 100644 --- a/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/param/PmsTerminalParam.java +++ b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/param/PmsTerminalParam.java @@ -95,5 +95,8 @@ public class PmsTerminalParam { @NotNull(message = "是否是上送国网监测点不能为空") private Integer isUpToGrid; + @ApiModelProperty(name = "terminalCode", value = "同源装置编号") + private String terminalCode; + } diff --git a/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/param/TerminalQueryParam.java b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/param/TerminalQueryParam.java index ff82acfd7..abe9cdcf3 100644 --- a/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/param/TerminalQueryParam.java +++ b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/param/TerminalQueryParam.java @@ -15,6 +15,8 @@ import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper = true) public class TerminalQueryParam extends BaseParam { + @ApiModelProperty(value = "单位id") + private String orgId; @ApiModelProperty(value = "监测点状态(字典)") private String monitorState; diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsStatationStatController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsStatationStatController.java index 621266b58..76d50895f 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsStatationStatController.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/PmsStatationStatController.java @@ -13,6 +13,7 @@ import com.njcn.device.pms.pojo.dto.PmsStatationStatInfoDTO; import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.param.StatationStatParam; import com.njcn.device.pms.pojo.param.PmsStatationStatInfoParam; +import com.njcn.device.pms.pojo.param.TerminalQueryParam; import com.njcn.device.pms.pojo.po.PmsMidLedger; import com.njcn.device.pms.pojo.po.StatationStat; import com.njcn.device.pms.pojo.vo.StatationStatVO; @@ -140,7 +141,7 @@ public class PmsStatationStatController extends BaseController { @PostMapping("/getStatationStatPageList") @ApiOperation("分页获取电站列表") @ApiImplicitParam(name = "baseParam", value = "基本查询体", required = true) - public HttpResult> getStatationStatPageList(@RequestBody BaseParam baseParam) { + public HttpResult> getStatationStatPageList(@RequestBody TerminalQueryParam baseParam) { String methodDescribe = getMethodDescribe("getStatationStatPageList"); Page result = statationStatService.getStatationStatPageList(baseParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/StatationStatMapper.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/StatationStatMapper.java index 44e2818af..3535e1055 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/StatationStatMapper.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/StatationStatMapper.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.device.pms.pojo.dto.PmsStatationStatInfoDTO; import com.njcn.device.pms.pojo.param.PmsStatationStatInfoParam; +import com.njcn.device.pms.pojo.param.TerminalQueryParam; import com.njcn.device.pms.pojo.po.StatationStat; import com.njcn.device.pms.pojo.vo.StatationStatVO; import com.njcn.web.pojo.param.BaseParam; @@ -37,7 +38,7 @@ public interface StatationStatMapper extends BaseMapper { * @author cdf * @date 2022/11/18 */ - Page getStatationStatPageList(Page page,@Param("baseParam") BaseParam baseParam); + Page getStatationStatPageList(Page page, @Param("baseParam") TerminalQueryParam baseParam, @Param("orgIds")List orgIds); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/mapping/StatationStatMapper.xml b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/mapping/StatationStatMapper.xml index 6075e38fa..2aafaca59 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/mapping/StatationStatMapper.xml +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/mapping/StatationStatMapper.xml @@ -49,6 +49,12 @@ left join sys_dept b on a.org_id = b.code and b.state = 1 left join pms_mid_ledger c on a.Mid_Station_Id = c.id where a.status = 1 + + and a.Org_Id in + + #{item} + + and ( @@ -57,6 +63,7 @@ or b.name like concat('%',#{baseParam.searchValue},'%') ) + order by a.org_name,a.Power_Name asc diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IStatationStatService.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IStatationStatService.java index 7f7b09056..b0227c462 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IStatationStatService.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IStatationStatService.java @@ -6,6 +6,7 @@ import com.njcn.device.pms.pojo.dto.PmsStatationStatInfoDTO; import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.param.StatationStatParam; import com.njcn.device.pms.pojo.param.PmsStatationStatInfoParam; +import com.njcn.device.pms.pojo.param.TerminalQueryParam; import com.njcn.device.pms.pojo.po.PmsMidLedger; import com.njcn.device.pms.pojo.po.StatationStat; import com.njcn.device.pms.pojo.po.StatationStat; @@ -90,7 +91,7 @@ public interface IStatationStatService extends IService { * @author cdf * @date 2022/10/25 */ - Page getStatationStatPageList(BaseParam baseParam); + Page getStatationStatPageList(TerminalQueryParam baseParam); /** * 获取变电站信息 diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/StatationStatServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/StatationStatServiceImpl.java index aa10551fc..8b0b04fb7 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/StatationStatServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/StatationStatServiceImpl.java @@ -17,6 +17,7 @@ import com.njcn.device.pms.pojo.dto.PmsStatationStatInfoDTO; import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.param.StatationStatParam; import com.njcn.device.pms.pojo.param.PmsStatationStatInfoParam; +import com.njcn.device.pms.pojo.param.TerminalQueryParam; import com.njcn.device.pms.pojo.po.*; import com.njcn.device.pms.pojo.vo.StatationStatVO; import com.njcn.device.pms.service.majornetwork.*; @@ -223,8 +224,12 @@ public class StatationStatServiceImpl extends ServiceImpl getStatationStatPageList(BaseParam baseParam) { - return this.baseMapper.getStatationStatPageList(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), baseParam); + public Page getStatationStatPageList(TerminalQueryParam baseParam) { + List orgIds = new ArrayList<>(); + if(StrUtil.isNotBlank(baseParam.getOrgId())){ + orgIds.addAll(deptFeignClient.getDepSonSelfCodetByCode(baseParam.getOrgId()).getData()); + } + return this.baseMapper.getStatationStatPageList(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), baseParam,orgIds); } /** diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/TerminalServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/TerminalServiceImpl.java index 758ff4e25..df25ad1c2 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/TerminalServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/TerminalServiceImpl.java @@ -32,6 +32,7 @@ import org.springframework.stereotype.Service; import java.time.LocalDate; import java.time.format.DateTimeFormatter; +import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -60,8 +61,14 @@ public class TerminalServiceImpl extends ServiceImpl getTerminalList(TerminalQueryParam baseParam) { + List orgIds = new ArrayList<>(); + if(StrUtil.isNotBlank(baseParam.getOrgId())){ + orgIds.addAll(deptFeignClient.getDepSonSelfCodetByCode(baseParam.getOrgId()).getData()); + } + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(PmsTerminal::getStatus,DataStateEnum.ENABLE.getCode()) + .in(PmsTerminal::getOrgId,orgIds) .eq(StrUtil.isNotBlank(baseParam.getDeviceCategory()),PmsTerminal::getDeviceCategory,baseParam.getDeviceCategory()); if(StrUtil.isNotBlank(baseParam.getSearchValue())) { lambdaQueryWrapper.and(i -> i.like(PmsTerminal::getName, baseParam.getSearchValue())