Commit ae13f19c authored by wujiang's avatar wujiang

修改统计问题

parent 18a592a5
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.bean.BeanUtil; import java.util.ArrayList;
import cn.hutool.core.util.ObjectUtil; import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.module.hygf.api.dto.HYGFMaintenanceTicketsDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto; import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto; import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.*; import com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation;
import com.yeejoin.amos.boot.module.hygf.api.entity.StdUserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn;
import com.yeejoin.amos.boot.module.hygf.api.mapper.HYGFMaintenanceTicketsMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.HYGFMaintenanceTicketsMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpCollectorMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.JpCollectorMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpInverterMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.JpInverterMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.UserEmpowerMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpInverterWarnService; import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpInverterWarnService;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper; import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper;
import com.yeejoin.amos.boot.module.hygf.api.util.TimeUtil; import com.yeejoin.amos.boot.module.hygf.api.util.TimeUtil;
import jdk.nashorn.internal.ir.annotations.Ignore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.*; import cn.hutool.core.util.ObjectUtil;
import java.util.stream.Collectors;
/** /**
* 户用光伏监盘逆变器报警表服务实现类 * 户用光伏监盘逆变器报警表服务实现类
...@@ -48,6 +57,8 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -48,6 +57,8 @@ public class TdHygfJpInverterWarnServiceImpl
JpInverterMapper jpInverterMapper; JpInverterMapper jpInverterMapper;
@Autowired @Autowired
JpCollectorMapper jpCollectorMapper; JpCollectorMapper jpCollectorMapper;
@Autowired
private UserEmpowerMapper userEmpowerMapper;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -241,21 +252,27 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -241,21 +252,27 @@ public class TdHygfJpInverterWarnServiceImpl
public Map<String, Object> queryStateNumber(String regionalCompaniesCode, String amosCompanyCode, String thirdStationId, String type) { public Map<String, Object> queryStateNumber(String regionalCompaniesCode, String amosCompanyCode, String thirdStationId, String type) {
List<String> thirdStationIds=null; List<String> thirdStationIds=null;
if(regionalCompaniesCode==null&&amosCompanyCode==null) String userid=RequestContext.getExeUserId();
{ LambdaQueryWrapper<StdUserEmpower> qu=new LambdaQueryWrapper();
thirdStationIds=null; qu.eq(StdUserEmpower::getAmosUserId,userid);
} qu.eq(StdUserEmpower::getPermissionType,"HYGF");
else StdUserEmpower stdUserEmpower= userEmpowerMapper.selectOne(qu);
{
// 查询所有场站 if(regionalCompaniesCode==null&&amosCompanyCode==null&&stdUserEmpower!=null&&stdUserEmpower.getAmosOrgCode().contains("all"))
List<JpStationDto> jpStationDtos = jpStationServiceImpl.queryAllPowerStation(regionalCompaniesCode, amosCompanyCode, thirdStationId, type); {
thirdStationIds=null;
}
if (!CollectionUtils.isEmpty(jpStationDtos)) { else
thirdStationIds = jpStationDtos.stream().map(JpStation -> JpStation.getThirdStationId()).collect(Collectors.toList()); {
} // 查询所有场站
} List<JpStationDto> jpStationDtos = jpStationServiceImpl.queryAllPowerStation(regionalCompaniesCode, amosCompanyCode, thirdStationId, type);
if (!CollectionUtils.isEmpty(jpStationDtos)) {
thirdStationIds = jpStationDtos.stream().map(JpStation -> JpStation.getThirdStationId()).collect(Collectors.toList());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment