1.终端模块代码调整
This commit is contained in:
@@ -28,10 +28,10 @@ public class MonitorStatisticsController extends BaseController {
|
||||
|
||||
@PostMapping("/objType")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("国网上送接口")
|
||||
public HttpResult< List<List<String>>> objType(String deptId){
|
||||
@ApiOperation("查询主网用户分类")
|
||||
public HttpResult< List<List<String>>> objType(String deptId,Integer up){
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.pms.annotation.TerminalOperationLogDesc;
|
||||
import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel;
|
||||
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.vo.PVCapacity;
|
||||
import com.njcn.device.pms.service.majornetwork.IPowerDistributionareaService;
|
||||
@@ -58,7 +59,7 @@ public class PmsPowerDistributionareaController extends BaseController {
|
||||
@PostMapping("getPowerDistributionAreaList")
|
||||
@ApiOperation("分页查询台区所有信息")
|
||||
@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");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, baseParam);
|
||||
Page<PowerDistributionarea> res = iPowerDistributionareaService.getList(baseParam);
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
SELECT DISTINCT
|
||||
monitor.Org_Id AS orgId,
|
||||
monitor.Org_Name AS orgName,
|
||||
monitor.Powerr_Id AS powerId,
|
||||
monitor.Powerr_Name AS powerName,
|
||||
monitor.`Powerr_Id` AS powerId,
|
||||
monitor.`Powerr_Name` AS powerName,
|
||||
monitor.id AS monitorId,
|
||||
monitor.Name AS monitorName,
|
||||
monitor.`Name` AS monitorName,
|
||||
monitor.Line_Id,
|
||||
monitor.Line_Name,
|
||||
pdm.Monitor_Sort AS monitorSort,
|
||||
@@ -26,11 +26,11 @@
|
||||
pdm.Update_By AS updateBy,
|
||||
pdm.Update_Time AS updateTime
|
||||
FROM
|
||||
((
|
||||
(
|
||||
SELECT
|
||||
pm.id,
|
||||
pm.Name,
|
||||
pm.Status,
|
||||
pm.`Name`,
|
||||
pm.`Status`,
|
||||
pm.Org_Id,
|
||||
pm.Org_Name,
|
||||
pm.Powerr_Id,
|
||||
@@ -48,57 +48,11 @@
|
||||
</if>
|
||||
</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
|
||||
) 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
|
||||
) AS monitor
|
||||
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
||||
WHERE
|
||||
monitor.Status = 1
|
||||
AND pdm.Status = 1
|
||||
monitor.`Status` = 1
|
||||
AND pdm.`Status` = 1
|
||||
AND monitor.Org_Id IN
|
||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||
#{orgId}
|
||||
@@ -131,9 +85,10 @@
|
||||
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
||||
</if>
|
||||
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
||||
AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getPwPhotovoltaicMonitorList" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
|
||||
SELECT DISTINCT
|
||||
monitor.Org_Id AS orgId,
|
||||
@@ -176,27 +131,12 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</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 monitor.id = pdm.Monitor_Id
|
||||
INNER JOIN pms_distribution_monitor AS pdm ON pm.id = pdm.Monitor_Id
|
||||
WHERE
|
||||
monitor.Status = 1
|
||||
pm.Status = 1
|
||||
AND pdm.Status = 1
|
||||
AND monitor.Org_Id IN
|
||||
AND pm.Org_Id IN
|
||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||
#{orgId}
|
||||
</foreach>
|
||||
@@ -228,7 +168,7 @@
|
||||
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
||||
</if>
|
||||
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
||||
AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
AND pm.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ public interface MonitorStatisticsService {
|
||||
* @Author: wr
|
||||
* @Date: 2024/3/22 9:49
|
||||
*/
|
||||
List<List<String>> getGwMonitorStatistics(String deptId);
|
||||
List<List<String>> getGwMonitorStatistics(String deptId,Integer up);
|
||||
|
||||
/**
|
||||
* @Description: 国网上送新能源场站统计
|
||||
|
||||
@@ -67,7 +67,7 @@ public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
|
||||
private final ITerminalService terminalService;
|
||||
|
||||
@Override
|
||||
public List<List<String>> getGwMonitorStatistics(String deptId) {
|
||||
public List<List<String>> getGwMonitorStatistics(String deptId,Integer up) {
|
||||
List<List<String>> info = new ArrayList<>();
|
||||
//查询所有一级树字典
|
||||
List<SysDicTreePO> sysDicTreePOList = dictTreeFeignClient.queryAll().getData();
|
||||
@@ -105,6 +105,7 @@ public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(deptId);
|
||||
deptGetLineParam.setMonitorStateRunning(false);
|
||||
deptGetLineParam.setSystemType(0);
|
||||
List<DeptGetChildrenMoreDTO> deptGetChildrenMoreDTOS = commTerminalService.deptGetLine(deptGetLineParam);
|
||||
//部门信息循环
|
||||
List<String> line;
|
||||
@@ -115,8 +116,12 @@ public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
|
||||
if (CollUtil.isEmpty(lineBaseList)) {
|
||||
continue;
|
||||
}
|
||||
List<LineDevGetDTO> upToGridList = lineBaseList.stream().filter(item -> Objects.equals(item.getIsUpToGrid(), DataStateEnum.ENABLE.getCode()))
|
||||
.collect(Collectors.toList());
|
||||
List<LineDevGetDTO> upToGridList;
|
||||
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);
|
||||
addSourceLoadList(sourceLoadMap, upToGridList, line);
|
||||
info.add(line);
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel;
|
||||
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.vo.PVCapacity;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
@@ -28,7 +29,7 @@ public interface IPowerDistributionareaService extends IService<PowerDistributio
|
||||
* 分页查询所有
|
||||
* @return
|
||||
*/
|
||||
Page<PowerDistributionarea> getList(BaseParam baseParam);
|
||||
Page<PowerDistributionarea> getList(TaiZhangParam baseParam);
|
||||
|
||||
/**
|
||||
* 查询所有
|
||||
|
||||
@@ -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.PowerGenerationUserExcel;
|
||||
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.PowerDistributionarea;
|
||||
import com.njcn.device.pms.pojo.po.PowerGenerationUser;
|
||||
@@ -82,16 +83,18 @@ public class PowerDistributionareaServiceImpl extends ServiceImpl<PowerDistribut
|
||||
|
||||
|
||||
@Override
|
||||
public Page<PowerDistributionarea> getList(BaseParam baseParam) {
|
||||
List<Dept> deptInfo = deptFeignClient.getAllDept().getData();
|
||||
List<String> deptIds = deptInfo.stream().map(Dept::getCode).collect(Collectors.toList());
|
||||
public Page<PowerDistributionarea> getList(TaiZhangParam baseParam) {
|
||||
List<String> deptInfo = deptFeignClient.getDepSonSelfCodetByDeptId(baseParam.getOrgId()).getData();
|
||||
LambdaQueryWrapper<PowerDistributionarea> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
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()),
|
||||
i->i.like(PowerDistributionarea::getName,baseParam.getSearchValue())
|
||||
.or()
|
||||
.like(PowerDistributionarea::getPowerrName,baseParam.getSearchValue())
|
||||
.or()
|
||||
.like(PowerDistributionarea::getLineName,baseParam.getSearchValue())
|
||||
|
||||
.or()
|
||||
.like(PowerDistributionarea::getOrgName,baseParam.getSearchValue())).orderByDesc(PowerDistributionarea::getCreateTime);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user