初始版本提交
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
package com.njcn.gather.event.devcie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqDevice;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -12,4 +16,5 @@ import com.njcn.gather.event.devcie.pojo.po.PqDevice;
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PqDeviceMapper extends BaseMapper<PqDevice> {
|
||||
List<DeviceDTO> queryListByIds(@Param("ids") List<Integer> ids);
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -19,4 +18,5 @@ import java.util.List;
|
||||
public interface PqLineMapper extends BaseMapper<PqLine> {
|
||||
|
||||
List<LedgerBaseInfoDTO> getBaseLineInfo(@Param("ids")List<Integer> ids);
|
||||
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.njcn.gather.event.devcie.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.gather.event.devcie.pojo.dto.SubstationDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqSubstation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -12,4 +16,5 @@ import com.njcn.gather.event.devcie.pojo.po.PqSubstation;
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PqSubstationMapper extends BaseMapper<PqSubstation> {
|
||||
List<SubstationDTO> queryListByIds(@Param("ids")List<Integer> ids);
|
||||
}
|
||||
@@ -27,4 +27,28 @@
|
||||
DEV_INDEX, GD_INDEX, SUB_INDEX, "NAME", "STATUS", DEVTYPE, LOGONTIME, UPDATETIME,
|
||||
NODE_INDEX, PORTID, DEVFLAG, DEV_SERIES, DEV_KEY, IP, DEVMODEL, CALLFLAG, DATATYPE
|
||||
</sql>
|
||||
|
||||
<select id="queryListByIds" resultType="com.njcn.gather.event.devcie.pojo.dto.DeviceDTO">
|
||||
select
|
||||
pq_device.dev_index devId,
|
||||
pq_device.name devName,
|
||||
PQ_SUBVOLTAGE.SUBV_INDEX busBarId,
|
||||
PQ_SUBVOLTAGE.name busBarName,
|
||||
PQ_SUBSTATION.sub_index stationId,
|
||||
PQ_SUBSTATION.name stationName,
|
||||
PQ_GDINFORMATION.Name gdName
|
||||
from
|
||||
PQ_SUBVOLTAGE,
|
||||
pq_device,
|
||||
PQ_SUBSTATION,
|
||||
PQ_GDINFORMATION
|
||||
where
|
||||
PQ_SUBVOLTAGE.DEV_INDEX = pq_device.DEV_INDEX
|
||||
and pq_device.SUB_INDEX = PQ_SUBSTATION.SUB_INDEX
|
||||
and pq_device.GD_INDEX =PQ_GDINFORMATION.GD_INDEX
|
||||
and pq_device.DEV_INDEX in
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -13,4 +13,20 @@
|
||||
<!--@mbg.generated-->
|
||||
SUB_INDEX, GD_INDEX, "NAME", "SCALE"
|
||||
</sql>
|
||||
|
||||
<select id="queryListByIds" resultType="com.njcn.gather.event.devcie.pojo.dto.SubstationDTO">
|
||||
select
|
||||
PQ_SUBSTATION.sub_index stationId,
|
||||
PQ_SUBSTATION.name stationName,
|
||||
PQ_GDINFORMATION.Name gdName
|
||||
from
|
||||
PQ_SUBSTATION,
|
||||
PQ_GDINFORMATION
|
||||
where
|
||||
PQ_SUBSTATION.GD_INDEX =PQ_GDINFORMATION.GD_INDEX
|
||||
and PQ_SUBSTATION.SUB_INDEX in
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.gather.event.devcie.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/27 下午 3:25【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class DeviceDTO {
|
||||
private Integer devId;
|
||||
private String devName;
|
||||
private Integer busBarId;
|
||||
private String busBarName;
|
||||
private Integer stationId;
|
||||
private String stationName;
|
||||
private String gdName;
|
||||
private Integer runFlag=0;
|
||||
}
|
||||
@@ -27,4 +27,7 @@ public class LedgerBaseInfoDTO {
|
||||
private Integer stationId;
|
||||
|
||||
private String stationName;
|
||||
|
||||
private Integer runFlag=0;;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.gather.event.devcie.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/27 下午 3:37【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class SubstationDTO {
|
||||
|
||||
private Integer stationId;
|
||||
private String stationName;
|
||||
private String gdName;
|
||||
private Integer runFlag=0;;
|
||||
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
package com.njcn.gather.event.devcie.service;
|
||||
|
||||
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqDevice;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 1:47【需求编号】
|
||||
@@ -12,5 +17,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface PqDeviceService extends IService<PqDevice>{
|
||||
|
||||
|
||||
List<DeviceDTO> queryListByIds(List<Integer> lineIds);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package com.njcn.gather.event.devcie.service;
|
||||
|
||||
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 1:43【需求编号】
|
||||
@@ -12,5 +17,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface PqLineService extends IService<PqLine>{
|
||||
|
||||
|
||||
List<LedgerBaseInfoDTO> queryListByIds(List<Integer> lineIds);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package com.njcn.gather.event.devcie.service;
|
||||
|
||||
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.dto.SubstationDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqSubstation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 1:48【需求编号】
|
||||
@@ -12,5 +17,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface PqSubstationService extends IService<PqSubstation>{
|
||||
|
||||
|
||||
List<SubstationDTO> queryListByIds(List<Integer> lineIds);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.gather.event.devcie.service.impl;
|
||||
|
||||
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import java.util.List;
|
||||
@@ -18,4 +19,8 @@ import com.njcn.gather.event.devcie.service.PqDeviceService;
|
||||
@Service
|
||||
public class PqDeviceServiceImpl extends ServiceImpl<PqDeviceMapper, PqDevice> implements PqDeviceService{
|
||||
|
||||
@Override
|
||||
public List<DeviceDTO> queryListByIds(List<Integer> lineIds) {
|
||||
return this.baseMapper.queryListByIds(lineIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.njcn.gather.event.devcie.service.impl;
|
||||
|
||||
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.gather.event.devcie.mapper.PqLineMapper;
|
||||
@@ -18,4 +20,8 @@ import com.njcn.gather.event.devcie.service.PqLineService;
|
||||
@Service
|
||||
public class PqLineServiceImpl extends ServiceImpl<PqLineMapper, PqLine> implements PqLineService{
|
||||
|
||||
@Override
|
||||
public List<LedgerBaseInfoDTO> queryListByIds(List<Integer> lineIds) {
|
||||
return this.baseMapper.getBaseLineInfo(lineIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.gather.event.devcie.service.impl;
|
||||
|
||||
import com.njcn.gather.event.devcie.pojo.dto.SubstationDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import java.util.List;
|
||||
@@ -18,4 +19,8 @@ import com.njcn.gather.event.devcie.service.PqSubstationService;
|
||||
@Service
|
||||
public class PqSubstationServiceImpl extends ServiceImpl<PqSubstationMapper, PqSubstation> implements PqSubstationService{
|
||||
|
||||
@Override
|
||||
public List<SubstationDTO> queryListByIds(List<Integer> lineIds) {
|
||||
return this.baseMapper.queryListByIds(lineIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.njcn.gather.event.transientes.pojo.vo;
|
||||
|
||||
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.dto.SubstationDTO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:06【需求编号】
|
||||
@@ -19,4 +24,8 @@ public class LedgerCountVO {
|
||||
private long runSubCount;
|
||||
private long runLineCount;
|
||||
|
||||
private List<SubstationDTO> allSubList;
|
||||
private List<DeviceDTO> allDevList;
|
||||
private List<LedgerBaseInfoDTO> allLineList;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
package com.njcn.gather.event.transientes.pojo.vo;
|
||||
|
||||
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||
import com.njcn.gather.event.transientes.pojo.po.MsgEventInfo;
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/26 上午 8:50【需求编号】
|
||||
@@ -16,4 +22,8 @@ public class MapCountVO {
|
||||
private Integer lineCount;
|
||||
private Integer eventCount;
|
||||
private Integer noticeCount;
|
||||
|
||||
private List<LedgerBaseInfoDTO> lineList;
|
||||
private List<PqsEventdetail> eventList;
|
||||
private List<MsgEventInfo> noticeList;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,9 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.gather.event.devcie.mapper.PqLineMapper;
|
||||
import com.njcn.gather.event.devcie.mapper.PqLinedetailMapper;
|
||||
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.dto.SubstationDTO;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqLinedetail;
|
||||
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqDevice;
|
||||
@@ -68,6 +70,7 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
private final PqsDeptslineService pqsDeptslineService;
|
||||
private final PqsDeptsService pqsDeptsService;
|
||||
private final PqLineService pqLineService;
|
||||
private final PqSubstationService pqSubstationService;
|
||||
private final PqDeviceService pqDeviceService;
|
||||
private final PqsEventdetailService pqsEventdetailService;
|
||||
private final PqLineMapper pqLineMapper;
|
||||
@@ -105,7 +108,9 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
pqLineList.addAll(temp);
|
||||
}
|
||||
//统计总数
|
||||
long allSubCount = pqLineList.stream().map(PqLine::getSubIndex).distinct().count();
|
||||
List<Integer> allLineIds = pqLineList.stream().map(PqLine::getLineIndex).collect(Collectors.toList());
|
||||
List<Integer> allSubList = pqLineList.stream().map(PqLine::getSubIndex).distinct().collect(Collectors.toList());
|
||||
long allSubCount =allSubList.stream().count();
|
||||
List<Integer> devList = pqLineList.stream().map(PqLine::getDevIndex).distinct().collect(Collectors.toList());
|
||||
long allDevCount = devList.stream().count();
|
||||
|
||||
@@ -114,10 +119,14 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
List<PqDevice> list = pqDeviceService.lambdaQuery().in(PqDevice::getDevIndex, devList).eq(PqDevice::getDevflag, 0).list();
|
||||
List<Integer> runDevList = list.stream().map(PqDevice::getDevIndex).collect(Collectors.toList());
|
||||
long runDevCount = runDevList.stream().count();
|
||||
long runSubCount = list.stream().map(PqDevice::getSubIndex).distinct().count();
|
||||
List<PqLine> runLineList = pqLineService.lambdaQuery().in(PqLine::getDevIndex, runDevList).list();
|
||||
List<Integer> runSubList = list.stream().map(PqDevice::getSubIndex).distinct().collect(Collectors.toList());
|
||||
long runSubCount = runSubList.stream().count();
|
||||
List<Integer> runLineList = pqLineList.stream().filter(temp->runDevList.contains(temp.getDevIndex())).map(PqLine::getLineIndex).collect(Collectors.toList());
|
||||
|
||||
long runLineCount = runLineList.stream().count();
|
||||
|
||||
|
||||
|
||||
ledgerCountVO.setAllSubCount(allSubCount);
|
||||
ledgerCountVO.setAllDevCount(allDevCount);
|
||||
ledgerCountVO.setAllLineCount(allLineCount);
|
||||
@@ -125,7 +134,15 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
ledgerCountVO.setRunSubCount(runSubCount);
|
||||
ledgerCountVO.setRunLineCount(runLineCount);
|
||||
|
||||
|
||||
List<LedgerBaseInfoDTO> ledgerBaseInfoDTOS = pqLineService.queryListByIds(allLineIds);
|
||||
ledgerBaseInfoDTOS.stream().forEach(temp->temp.setRunFlag(runLineList.contains(temp.getLineId())?1:0));
|
||||
ledgerCountVO.setAllLineList(ledgerBaseInfoDTOS);
|
||||
List<DeviceDTO> deviceDTOS = pqDeviceService.queryListByIds(devList);
|
||||
deviceDTOS.forEach(temp->temp.setRunFlag(runDevList.contains(temp.getDevId())?1:0));
|
||||
ledgerCountVO.setAllDevList(deviceDTOS);
|
||||
List<SubstationDTO> substationDTOS = pqSubstationService.queryListByIds(allSubList);
|
||||
substationDTOS.forEach(temp->temp.setRunFlag(runSubList.contains(temp.getStationId())?1:0));
|
||||
ledgerCountVO.setAllSubList(substationDTOS);
|
||||
return ledgerCountVO;
|
||||
}
|
||||
|
||||
@@ -133,9 +150,23 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
public AlarmAnalysisVO alarmAnalysis(LargeScreenCountParam largeScreenCountParam) {
|
||||
AlarmAnalysisVO alarmAnalysisVO = new AlarmAnalysisVO();
|
||||
//起始时间
|
||||
String startTime = DateUtil.format(DateUtil.beginOfMonth(new Date()), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
LocalDateTime startTime;
|
||||
//结束时间
|
||||
String endTime = DateUtil.format(DateUtil.endOfMonth(new Date()), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
LocalDateTime endTime;
|
||||
if (largeScreenCountParam.getType() == 3) {
|
||||
//起始时间
|
||||
startTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.beginOfMonth(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
//结束时间
|
||||
endTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.endOfMonth(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
} else if (largeScreenCountParam.getType() == 4) {
|
||||
//起始时间
|
||||
startTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.beginOfWeek(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
//结束时间
|
||||
endTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.endOfWeek(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
} else {
|
||||
throw new BusinessException("统计类型有误类型");
|
||||
}
|
||||
|
||||
//根据用户获取当前部门及子部门id
|
||||
List<String> deptAndChildren = pqsDeptsService.findDeptAndChildren(largeScreenCountParam.getDeptId());
|
||||
//获取对应监测点id
|
||||
@@ -150,13 +181,13 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
List<List<Integer>> listIds = CollUtil.split(deptslineIds,1000);
|
||||
for(List<Integer> itemIds : listIds){
|
||||
List<PqsEventdetail> temp = pqsEventdetailService.lambdaQuery()
|
||||
.between(PqsEventdetail::getTimeid, LocalDateTimeUtil.parse(startTime,DatePattern.NORM_DATETIME_FORMATTER), LocalDateTimeUtil.parse(endTime,DatePattern.NORM_DATETIME_FORMATTER))
|
||||
.between(PqsEventdetail::getTimeid,startTime, endTime)
|
||||
.in(PqsEventdetail::getLineid,listIds).list();
|
||||
eventdetails.addAll(temp);
|
||||
}
|
||||
}else {
|
||||
List<PqsEventdetail> temp = pqsEventdetailService.lambdaQuery()
|
||||
.between(PqsEventdetail::getTimeid, LocalDateTimeUtil.parse(startTime,DatePattern.NORM_DATETIME_FORMATTER), LocalDateTimeUtil.parse(endTime,DatePattern.NORM_DATETIME_FORMATTER))
|
||||
.between(PqsEventdetail::getTimeid, startTime, endTime)
|
||||
.in(PqsEventdetail::getLineid,deptslineIds).list();
|
||||
eventdetails.addAll(temp);
|
||||
}
|
||||
@@ -308,9 +339,22 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
Page<PqsEventdetail> pqsEventdetailPage = new Page<>(largeScreenCountParam.getPageNum(), largeScreenCountParam.getPageSize());
|
||||
|
||||
//起始时间
|
||||
LocalDateTime startTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.beginOfMonth(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
LocalDateTime startTime;
|
||||
//结束时间
|
||||
LocalDateTime endTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.endOfMonth(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
LocalDateTime endTime;
|
||||
if (largeScreenCountParam.getType() == 3) {
|
||||
//起始时间
|
||||
startTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.beginOfMonth(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
//结束时间
|
||||
endTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.endOfMonth(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
} else if (largeScreenCountParam.getType() == 4) {
|
||||
//起始时间
|
||||
startTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.beginOfWeek(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
//结束时间
|
||||
endTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.endOfWeek(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
} else {
|
||||
throw new BusinessException("统计类型有误类型");
|
||||
}
|
||||
//根据用户获取当前部门及子部门id
|
||||
List<String> deptAndChildren = pqsDeptsService.findDeptAndChildren(largeScreenCountParam.getDeptId());
|
||||
//获取对应监测点id
|
||||
@@ -450,9 +494,22 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
public List<MapCountVO> mapCount(LargeScreenCountParam largeScreenCountParam) {
|
||||
List<MapCountVO> result = new ArrayList<>();
|
||||
//起始时间
|
||||
LocalDateTime startTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.beginOfMonth(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
LocalDateTime startTime;
|
||||
//结束时间
|
||||
LocalDateTime endTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.endOfMonth(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
LocalDateTime endTime;
|
||||
if (largeScreenCountParam.getType() == 3) {
|
||||
//起始时间
|
||||
startTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.beginOfMonth(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
//结束时间
|
||||
endTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.endOfMonth(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
} else if (largeScreenCountParam.getType() == 4) {
|
||||
//起始时间
|
||||
startTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.beginOfWeek(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
//结束时间
|
||||
endTime = LocalDateTimeUtil.parse(DateUtil.format(DateUtil.endOfWeek(new Date()), DatePattern.NORM_DATETIME_FORMATTER), DatePattern.NORM_DATETIME_FORMATTER);
|
||||
} else {
|
||||
throw new BusinessException("统计类型有误类型");
|
||||
}
|
||||
//根据用户获取当前部门及子部门id
|
||||
List<String> deptAndChildren = pqsDeptsService.findDeptAndChildren(largeScreenCountParam.getDeptId());
|
||||
deptAndChildren.remove(largeScreenCountParam.getDeptId());
|
||||
@@ -470,17 +527,23 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
mapCountVO.setDeptsIndex(k);
|
||||
mapCountVO.setDeptsName(stringPqsDeptsMap.get(k).getDeptsname());
|
||||
mapCountVO.setLineCount(v.size());
|
||||
|
||||
List<LedgerBaseInfoDTO> ledgerBaseInfoDTOS = pqLineService.queryListByIds(v.stream().map(PqsDeptsline::getLineIndex).collect(Collectors.toList()));
|
||||
mapCountVO.setLineList(ledgerBaseInfoDTOS);
|
||||
List<Integer> deptslineIds = v.stream().map(PqsDeptsline::getLineIndex).collect(Collectors.toList());
|
||||
|
||||
List<PqsEventdetail> eventdetails = pqsEventdetailService.lambdaQuery()
|
||||
.between(PqsEventdetail::getTimeid, startTime, endTime)
|
||||
.in(PqsEventdetail::getLineid, deptslineIds).list();
|
||||
mapCountVO.setEventCount(eventdetails.size());
|
||||
List<PqsEventdetail> noticeEvent = eventdetails.stream().filter(temp -> Objects.equals(temp.getNoticeFlag(), 1)).collect(Collectors.toList());
|
||||
|
||||
|
||||
mapCountVO.setNoticeCount(noticeEvent.size());
|
||||
mapCountVO.setEventList(eventdetails);
|
||||
List<String> eveIdndex = eventdetails.stream().map(PqsEventdetail::getEventdetailIndex).collect(Collectors.toList());
|
||||
List<MsgEventInfo> temp = new ArrayList<>();
|
||||
if(!CollectionUtils.isEmpty(eveIdndex)){
|
||||
temp = msgEventInfoService.lambdaQuery().in(MsgEventInfo::getEventIndex,eveIdndex).list();
|
||||
}
|
||||
|
||||
mapCountVO.setNoticeCount(temp.size());
|
||||
mapCountVO.setNoticeList(temp);
|
||||
result.add(mapCountVO);
|
||||
});
|
||||
return result;
|
||||
@@ -573,4 +636,6 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user