1.终端模块代码调整

This commit is contained in:
cdf
2025-03-06 14:55:36 +08:00
parent 0b930f1adf
commit d14e83c935
7 changed files with 38 additions and 88 deletions

View File

@@ -28,10 +28,10 @@ public class MonitorStatisticsController extends BaseController {
@PostMapping("/objType") @PostMapping("/objType")
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("国网上送接口") @ApiOperation("查询主网用户分类")
public HttpResult< List<List<String>>> objType(String deptId){ public HttpResult< List<List<String>>> objType(String deptId,Integer up){
String methodDescribe = getMethodDescribe("objType"); String methodDescribe = getMethodDescribe("objType");
List<List<String>> gwMonitorStatistics = monitorStatisticsService.getGwMonitorStatistics(deptId); List<List<String>> gwMonitorStatistics = monitorStatisticsService.getGwMonitorStatistics(deptId,up);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gwMonitorStatistics, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gwMonitorStatistics, methodDescribe);
} }

View File

@@ -14,6 +14,7 @@ import com.njcn.common.utils.LogUtil;
import com.njcn.device.pms.annotation.TerminalOperationLogDesc; import com.njcn.device.pms.annotation.TerminalOperationLogDesc;
import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel; import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel;
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam; import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
import com.njcn.device.pms.pojo.param.TaiZhangParam;
import com.njcn.device.pms.pojo.po.PowerDistributionarea; import com.njcn.device.pms.pojo.po.PowerDistributionarea;
import com.njcn.device.pms.pojo.vo.PVCapacity; import com.njcn.device.pms.pojo.vo.PVCapacity;
import com.njcn.device.pms.service.majornetwork.IPowerDistributionareaService; import com.njcn.device.pms.service.majornetwork.IPowerDistributionareaService;
@@ -58,7 +59,7 @@ public class PmsPowerDistributionareaController extends BaseController {
@PostMapping("getPowerDistributionAreaList") @PostMapping("getPowerDistributionAreaList")
@ApiOperation("分页查询台区所有信息") @ApiOperation("分页查询台区所有信息")
@ApiImplicitParam(name = "baseParam",value = "查询台区信息",required = true) @ApiImplicitParam(name = "baseParam",value = "查询台区信息",required = true)
public HttpResult<Page<PowerDistributionarea>> getList(@RequestBody @Validated BaseParam baseParam){ public HttpResult<Page<PowerDistributionarea>> getList(@RequestBody TaiZhangParam baseParam){
String methodDescribe = getMethodDescribe("getList"); String methodDescribe = getMethodDescribe("getList");
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, baseParam); LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, baseParam);
Page<PowerDistributionarea> res = iPowerDistributionareaService.getList(baseParam); Page<PowerDistributionarea> res = iPowerDistributionareaService.getList(baseParam);

View File

@@ -7,10 +7,10 @@
SELECT DISTINCT SELECT DISTINCT
monitor.Org_Id AS orgId, monitor.Org_Id AS orgId,
monitor.Org_Name AS orgName, monitor.Org_Name AS orgName,
monitor.Powerr_Id AS powerId, monitor.`Powerr_Id` AS powerId,
monitor.Powerr_Name AS powerName, monitor.`Powerr_Name` AS powerName,
monitor.id AS monitorId, monitor.id AS monitorId,
monitor.Name AS monitorName, monitor.`Name` AS monitorName,
monitor.Line_Id, monitor.Line_Id,
monitor.Line_Name, monitor.Line_Name,
pdm.Monitor_Sort AS monitorSort, pdm.Monitor_Sort AS monitorSort,
@@ -26,11 +26,11 @@
pdm.Update_By AS updateBy, pdm.Update_By AS updateBy,
pdm.Update_Time AS updateTime pdm.Update_Time AS updateTime
FROM FROM
(( (
SELECT SELECT
pm.id, pm.id,
pm.Name, pm.`Name`,
pm.Status, pm.`Status`,
pm.Org_Id, pm.Org_Id,
pm.Org_Name, pm.Org_Name,
pm.Powerr_Id, pm.Powerr_Id,
@@ -48,57 +48,11 @@
</if> </if>
</where> </where>
) UNION ALL ) AS monitor
/* (
SELECT
ppd.id,
ppd.Name,
ppd.Status,
ppd.Org_Id,
ppd.Org_Name,
ppd.Power_Station_Id,
ppd.Powerr_Name,
ppd.Line_Id,
ppd.Line_Name
FROM
pms_power_distributionarea AS ppd
) UNION ALL*/
(
SELECT
ppc.id,
ppc.Name,
ppc.Status,
ppc.Org_Id,
ppc.Org_Name,
ppc.Power_Station_Id,
ps.Power_Name,
ppc.Line_Id,
0
FROM
pms_power_client AS ppc
INNER JOIN pms_statation_stat ps ON ps.Power_Id = ppc.Power_Station_Id
AND ppc.Org_Id = ps.Org_Id
) UNION ALL
(
SELECT
ppgu.id,
ppgu.Name,
ppgu.Status,
ppgu.Org_Id,
ppgu.Org_Name,
ppgu.Power_Station_Id,
pss.Power_Name,
ppgu.Line_Id,
0
FROM
pms_power_generation_user AS ppgu
INNER JOIN pms_statation_stat AS pss ON pss.Power_Id = ppgu.Power_Station_Id
AND ppgu.Org_Id = pss.Org_Id
)) AS monitor
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
WHERE WHERE
monitor.Status = 1 monitor.`Status` = 1
AND pdm.Status = 1 AND pdm.`Status` = 1
AND monitor.Org_Id IN AND monitor.Org_Id IN
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=","> <foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
#{orgId} #{orgId}
@@ -131,9 +85,10 @@
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser} AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
</if> </if>
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''"> <if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%') AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
</if> </if>
</select> </select>
<select id="getPwPhotovoltaicMonitorList" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO"> <select id="getPwPhotovoltaicMonitorList" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
SELECT DISTINCT SELECT DISTINCT
monitor.Org_Id AS orgId, monitor.Org_Id AS orgId,
@@ -176,27 +131,12 @@
</foreach> </foreach>
</if> </if>
</where> </where>
) /*UNION ALL
(
SELECT
ppd.id,
ppd.Name,
ppd.Status,
ppd.Org_Id,
ppd.Org_Name,
ppd.Power_Station_Id,
ppd.Powerr_Name,
ppd.Line_Id,
ppd.Line_Name
FROM
pms_power_distributionarea AS ppd
) )
) AS monitor*/ INNER JOIN pms_distribution_monitor AS pdm ON pm.id = pdm.Monitor_Id
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
WHERE WHERE
monitor.Status = 1 pm.Status = 1
AND pdm.Status = 1 AND pdm.Status = 1
AND monitor.Org_Id IN AND pm.Org_Id IN
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=","> <foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
#{orgId} #{orgId}
</foreach> </foreach>
@@ -228,7 +168,7 @@
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser} AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
</if> </if>
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''"> <if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%') AND pm.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
</if> </if>
</select> </select>

View File

@@ -19,7 +19,7 @@ public interface MonitorStatisticsService {
* @Author: wr * @Author: wr
* @Date: 2024/3/22 9:49 * @Date: 2024/3/22 9:49
*/ */
List<List<String>> getGwMonitorStatistics(String deptId); List<List<String>> getGwMonitorStatistics(String deptId,Integer up);
/** /**
* @Description: 国网上送新能源场站统计 * @Description: 国网上送新能源场站统计

View File

@@ -67,7 +67,7 @@ public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
private final ITerminalService terminalService; private final ITerminalService terminalService;
@Override @Override
public List<List<String>> getGwMonitorStatistics(String deptId) { public List<List<String>> getGwMonitorStatistics(String deptId,Integer up) {
List<List<String>> info = new ArrayList<>(); List<List<String>> info = new ArrayList<>();
//查询所有一级树字典 //查询所有一级树字典
List<SysDicTreePO> sysDicTreePOList = dictTreeFeignClient.queryAll().getData(); List<SysDicTreePO> sysDicTreePOList = dictTreeFeignClient.queryAll().getData();
@@ -105,6 +105,7 @@ public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
DeptGetLineParam deptGetLineParam = new DeptGetLineParam(); DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
deptGetLineParam.setDeptId(deptId); deptGetLineParam.setDeptId(deptId);
deptGetLineParam.setMonitorStateRunning(false); deptGetLineParam.setMonitorStateRunning(false);
deptGetLineParam.setSystemType(0);
List<DeptGetChildrenMoreDTO> deptGetChildrenMoreDTOS = commTerminalService.deptGetLine(deptGetLineParam); List<DeptGetChildrenMoreDTO> deptGetChildrenMoreDTOS = commTerminalService.deptGetLine(deptGetLineParam);
//部门信息循环 //部门信息循环
List<String> line; List<String> line;
@@ -115,8 +116,12 @@ public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
if (CollUtil.isEmpty(lineBaseList)) { if (CollUtil.isEmpty(lineBaseList)) {
continue; continue;
} }
List<LineDevGetDTO> upToGridList = lineBaseList.stream().filter(item -> Objects.equals(item.getIsUpToGrid(), DataStateEnum.ENABLE.getCode())) List<LineDevGetDTO> upToGridList;
.collect(Collectors.toList()); if(Objects.isNull(up) || up == 1){
upToGridList = lineBaseList.stream().filter(item -> Objects.equals(item.getIsUpToGrid(), DataStateEnum.ENABLE.getCode())).collect(Collectors.toList());
}else {
upToGridList = lineBaseList;
}
addmetWorkList(metWorkMap, upToGridList, line); addmetWorkList(metWorkMap, upToGridList, line);
addSourceLoadList(sourceLoadMap, upToGridList, line); addSourceLoadList(sourceLoadMap, upToGridList, line);
info.add(line); info.add(line);

View File

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.common.pojo.param.StatisticsBizBaseParam; import com.njcn.common.pojo.param.StatisticsBizBaseParam;
import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel; import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel;
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam; import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
import com.njcn.device.pms.pojo.param.TaiZhangParam;
import com.njcn.device.pms.pojo.po.PowerDistributionarea; import com.njcn.device.pms.pojo.po.PowerDistributionarea;
import com.njcn.device.pms.pojo.vo.PVCapacity; import com.njcn.device.pms.pojo.vo.PVCapacity;
import com.njcn.web.pojo.param.BaseParam; import com.njcn.web.pojo.param.BaseParam;
@@ -28,7 +29,7 @@ public interface IPowerDistributionareaService extends IService<PowerDistributio
* 分页查询所有 * 分页查询所有
* @return * @return
*/ */
Page<PowerDistributionarea> getList(BaseParam baseParam); Page<PowerDistributionarea> getList(TaiZhangParam baseParam);
/** /**
* 查询所有 * 查询所有

View File

@@ -21,6 +21,7 @@ import com.njcn.device.pms.mapper.majornetwork.PowerDistributionareaMapper;
import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel; import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel;
import com.njcn.device.pms.pojo.excel.PowerGenerationUserExcel; import com.njcn.device.pms.pojo.excel.PowerGenerationUserExcel;
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam; import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
import com.njcn.device.pms.pojo.param.TaiZhangParam;
import com.njcn.device.pms.pojo.po.GeneratrixWire; import com.njcn.device.pms.pojo.po.GeneratrixWire;
import com.njcn.device.pms.pojo.po.PowerDistributionarea; import com.njcn.device.pms.pojo.po.PowerDistributionarea;
import com.njcn.device.pms.pojo.po.PowerGenerationUser; import com.njcn.device.pms.pojo.po.PowerGenerationUser;
@@ -82,16 +83,18 @@ public class PowerDistributionareaServiceImpl extends ServiceImpl<PowerDistribut
@Override @Override
public Page<PowerDistributionarea> getList(BaseParam baseParam) { public Page<PowerDistributionarea> getList(TaiZhangParam baseParam) {
List<Dept> deptInfo = deptFeignClient.getAllDept().getData(); List<String> deptInfo = deptFeignClient.getDepSonSelfCodetByDeptId(baseParam.getOrgId()).getData();
List<String> deptIds = deptInfo.stream().map(Dept::getCode).collect(Collectors.toList());
LambdaQueryWrapper<PowerDistributionarea> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PowerDistributionarea> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(PowerDistributionarea::getStatus,DataStateEnum.ENABLE.getCode()) lambdaQueryWrapper.eq(PowerDistributionarea::getStatus,DataStateEnum.ENABLE.getCode())
.in(CollUtil.isNotEmpty(deptIds),PowerDistributionarea::getOrgId,deptIds) .in(CollUtil.isNotEmpty(deptInfo),PowerDistributionarea::getOrgId,deptInfo)
.and(StrUtil.isNotBlank(baseParam.getSearchValue()), .and(StrUtil.isNotBlank(baseParam.getSearchValue()),
i->i.like(PowerDistributionarea::getName,baseParam.getSearchValue()) i->i.like(PowerDistributionarea::getName,baseParam.getSearchValue())
.or() .or()
.like(PowerDistributionarea::getPowerrName,baseParam.getSearchValue()) .like(PowerDistributionarea::getPowerrName,baseParam.getSearchValue())
.or()
.like(PowerDistributionarea::getLineName,baseParam.getSearchValue())
.or() .or()
.like(PowerDistributionarea::getOrgName,baseParam.getSearchValue())).orderByDesc(PowerDistributionarea::getCreateTime); .like(PowerDistributionarea::getOrgName,baseParam.getSearchValue())).orderByDesc(PowerDistributionarea::getCreateTime);