切换mysql为达梦数据库-代码审查
1.supervision-boot模块
This commit is contained in:
@@ -3,6 +3,7 @@ package com.njcn.supervision.service.databank.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||
@@ -90,13 +91,11 @@ public class LibAlgorithmServiceImpl extends ServiceImpl<LibAlgorithmMapper, Lib
|
||||
|
||||
@Override
|
||||
public List<LibAlgorithm> queryAll() {
|
||||
|
||||
List<LibAlgorithm> libAlgorithmList = this.lambdaQuery().eq(LibAlgorithm::getStatus,1).list();
|
||||
List<LibAlgorithm> tree = libAlgorithmList.stream().filter(item -> item.getPid().equals("0")).peek(item -> {
|
||||
return libAlgorithmList.stream().filter(item -> BizParamConstant.PARENT_ID.equals(item.getPid())).peek(item -> {
|
||||
item.setLevel(1);
|
||||
item.setChildren(getChildren(item, libAlgorithmList));
|
||||
}).collect(Collectors.toList());
|
||||
return tree;
|
||||
}
|
||||
private List<LibAlgorithm> getChildren(LibAlgorithm libAlgorithm, List<LibAlgorithm> all) {
|
||||
return all.stream().filter(item -> item.getPid().equals(libAlgorithm.getId())).peek(item -> {
|
||||
|
||||
@@ -76,14 +76,12 @@ public class LibCaseServiceImpl extends ServiceImpl<LibCaseMapper, LibCase> impl
|
||||
@Override
|
||||
public Page<LibCase> pageQuery(LibCaseParam.LibCaseParamQuery param) {
|
||||
QueryWrapper<LibCase> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.eq("lib_case.status",1);
|
||||
//添加上时间范围
|
||||
queryWrapper.between("lib_case.Create_Time",
|
||||
DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())));
|
||||
queryWrapper.orderByDesc("lib_case.Update_Time");
|
||||
Page<LibCase> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
||||
return page;
|
||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.supervision.service.databank.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||
@@ -87,10 +88,9 @@ public class LibStandardServiceImpl extends ServiceImpl<LibStandardMapper, LibSt
|
||||
@Override
|
||||
public List<LibStandard> queryAll() {
|
||||
List<LibStandard> libStandardList = this.lambdaQuery().eq(LibStandard::getStatus,1).list();
|
||||
List<LibStandard> tree = libStandardList.stream().filter(item -> item.getPid().equals("0")).peek(item -> {
|
||||
return libStandardList.stream().filter(item -> BizParamConstant.PARENT_ID.equals(item.getPid())).peek(item -> {
|
||||
item.setChildren(getChildren(item, libStandardList));
|
||||
}).collect(Collectors.toList());
|
||||
return tree;
|
||||
}
|
||||
|
||||
private List<LibStandard> getChildren(LibStandard libStandard, List<LibStandard> all) {
|
||||
|
||||
@@ -81,7 +81,6 @@ public class LibTemplateServiceImpl extends ServiceImpl<LibTemplateMapper, LibTe
|
||||
DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())));
|
||||
queryWrapper.orderByDesc("lib_template.Update_Time");
|
||||
Page<LibTemplate> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
||||
return page;
|
||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.njcn.bpm.pojo.dto.BpmInstanceInfo;
|
||||
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||
import com.njcn.bpm.pojo.vo.TodoVO;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
@@ -44,7 +43,6 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
@@ -155,11 +153,11 @@ public class CheckDeviceServiceImpl extends MppServiceImpl<CheckDeviceMapper, Ch
|
||||
checkDevice.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
checkDevice.setNowCheckTime(LocalDate.parse(param.getNowCheckTime(), DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.TIMING_CHECK_DEVICE.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(checkDevice.getId());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>(16));
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(RequestUtil.getUserIndex(), bpmProcessInstanceCreateReqDTO).getData();
|
||||
// 将工作流的编号,更新到流程单中
|
||||
@@ -182,11 +180,11 @@ public class CheckDeviceServiceImpl extends MppServiceImpl<CheckDeviceMapper, Ch
|
||||
checkDevice.setDescription(param.getDescription());
|
||||
checkDevice.setNowCheckTime(LocalDate.parse(param.getNowCheckTime(), DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.TIMING_CHECK_DEVICE.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(checkDevice.getId());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>(16));
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(checkDevice.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||
// 将工作流的编号,更新到流程单中
|
||||
|
||||
@@ -66,6 +66,8 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.util.regex.Pattern.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 监测点每日稳态指标超标天数统计表 服务实现类
|
||||
@@ -118,9 +120,9 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
for (RStatLimitTargetDPO item : limitTarget) {
|
||||
List<LineWarning> lineWarnings = lineWarningMap.get(item.getLineId());
|
||||
DeptLine deptLine = deptLineFeignClient.getLineByLineIds(item.getLineId()).getData();
|
||||
String deptId = Objects.isNull(deptLine)?null:deptLine.getId();
|
||||
String deptId = Objects.isNull(deptLine) ? null : deptLine.getId();
|
||||
if (CollUtil.isEmpty(lineWarnings)) {
|
||||
addList.addAll(getTargetInfo(item.getLineId(),targetMap,limitMap,deptId));
|
||||
addList.addAll(getTargetInfo(item.getLineId(), targetMap, limitMap, deptId));
|
||||
} else {
|
||||
//1.查询各指标越限时间不超过10天,超标则每天递增,不超标则清零
|
||||
//2.越限时间超过10天未超过15天,超标则每天递增,不超标保存当前记录,新增一条记录
|
||||
@@ -128,21 +130,21 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
//4.发过告警单,则重新生成一条数据
|
||||
RStatLimitTargetDPO dpo = limitMap.get(item.getLineId());
|
||||
//频率偏差
|
||||
targetInfo(lineWarnings,targetMap,DicDataEnum.PLPC_ENUM.getCode(),dpo,item.getLineId(),addList,updateList,deptId);
|
||||
targetInfo(lineWarnings, targetMap, DicDataEnum.PLPC_ENUM.getCode(), dpo, item.getLineId(), addList, updateList, deptId);
|
||||
//电压偏差
|
||||
targetInfo(lineWarnings,targetMap,DicDataEnum.DYPC_ENUM.getCode(),dpo,item.getLineId(),addList,updateList,deptId);
|
||||
targetInfo(lineWarnings, targetMap, DicDataEnum.DYPC_ENUM.getCode(), dpo, item.getLineId(), addList, updateList, deptId);
|
||||
//长时闪变
|
||||
targetInfo(lineWarnings,targetMap,DicDataEnum.CSSB_ENUM.getCode(),dpo,item.getLineId(),addList,updateList,deptId);
|
||||
targetInfo(lineWarnings, targetMap, DicDataEnum.CSSB_ENUM.getCode(), dpo, item.getLineId(), addList, updateList, deptId);
|
||||
//谐波电压
|
||||
targetInfo(lineWarnings,targetMap,DicDataEnum.XBDY_ENUM.getCode(),dpo,item.getLineId(),addList,updateList,deptId);
|
||||
targetInfo(lineWarnings, targetMap, DicDataEnum.XBDY_ENUM.getCode(), dpo, item.getLineId(), addList, updateList, deptId);
|
||||
//谐波电流
|
||||
targetInfo(lineWarnings,targetMap,DicDataEnum.XBDL_ENUM.getCode(),dpo,item.getLineId(),addList,updateList,deptId);
|
||||
targetInfo(lineWarnings, targetMap, DicDataEnum.XBDL_ENUM.getCode(), dpo, item.getLineId(), addList, updateList, deptId);
|
||||
//间谐波电压
|
||||
targetInfo(lineWarnings,targetMap,DicDataEnum.JXBDY_ENUM.getCode(),dpo,item.getLineId(),addList,updateList,deptId);
|
||||
targetInfo(lineWarnings, targetMap, DicDataEnum.JXBDY_ENUM.getCode(), dpo, item.getLineId(), addList, updateList, deptId);
|
||||
//负序电压不平衡度
|
||||
targetInfo(lineWarnings,targetMap,DicDataEnum.SXDYBPHD_ENUM.getCode(),dpo,item.getLineId(),addList,updateList,deptId);
|
||||
targetInfo(lineWarnings, targetMap, DicDataEnum.SXDYBPHD_ENUM.getCode(), dpo, item.getLineId(), addList, updateList, deptId);
|
||||
//负序电流
|
||||
targetInfo(lineWarnings,targetMap,DicDataEnum.FXDL_ENUM.getCode(),dpo,item.getLineId(),addList,updateList,deptId);
|
||||
targetInfo(lineWarnings, targetMap, DicDataEnum.FXDL_ENUM.getCode(), dpo, item.getLineId(), addList, updateList, deptId);
|
||||
}
|
||||
}
|
||||
this.saveBatch(addList);
|
||||
@@ -160,46 +162,46 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
List<DeptLine> deptLines = deptLineFeignClient.getAllData().getData();
|
||||
Map<String, List<DeptLine>> deptLineMap = deptLines.stream().collect(Collectors.groupingBy(DeptLine::getLineId));
|
||||
//获取监测点按时间统计越限天数
|
||||
LocalDate firstDayOfMonth = Objects.isNull(startTime)?LocalDate.now().minusDays(1).with(TemporalAdjusters.firstDayOfMonth()):LocalDate.parse(startTime);
|
||||
String date = Objects.isNull(startTime)?DateUtil.format(firstDayOfMonth.atStartOfDay(), DatePattern.NORM_DATE_PATTERN):startTime;
|
||||
String endDate = Objects.isNull(endTime)?DateUtil.format(LocalDateTime.now().minusDays(1), DatePattern.NORM_DATE_PATTERN):endTime;
|
||||
RStatLimitQueryParam rStatLimitQueryParam = new RStatLimitQueryParam(null,date,endDate);
|
||||
LocalDate firstDayOfMonth = Objects.isNull(startTime) ? LocalDate.now().minusDays(1).with(TemporalAdjusters.firstDayOfMonth()) : LocalDate.parse(startTime);
|
||||
String date = Objects.isNull(startTime) ? DateUtil.format(firstDayOfMonth.atStartOfDay(), DatePattern.NORM_DATE_PATTERN) : startTime;
|
||||
String endDate = Objects.isNull(endTime) ? DateUtil.format(LocalDateTime.now().minusDays(1), DatePattern.NORM_DATE_PATTERN) : endTime;
|
||||
RStatLimitQueryParam rStatLimitQueryParam = new RStatLimitQueryParam(null, date, endDate);
|
||||
List<RStatLimitTargetVO> limitTarget = limitRateDClient.monitorOverLimitDays(rStatLimitQueryParam).getData();
|
||||
//按各指标统计越限天数
|
||||
if (CollUtil.isNotEmpty(limitTarget)) {
|
||||
limitTarget.forEach(item->{
|
||||
String deptId = Objects.isNull(deptLineMap.get(item.getLineId()))?null:deptLineMap.get(item.getLineId()).get(0).getId();
|
||||
limitTarget.forEach(item -> {
|
||||
String deptId = Objects.isNull(deptLineMap.get(item.getLineId())) ? null : deptLineMap.get(item.getLineId()).get(0).getId();
|
||||
//频率偏差
|
||||
LineWarning l1 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.FREQUENCY_DEV.getCode()).getId(),item.getFreqDevOvertime());
|
||||
LineWarning l1 = overData(firstDayOfMonth, item.getLineId(), deptId, targetMap.get(DicDataEnum.FREQUENCY_DEV.getCode()).getId(), item.getFreqDevOvertime());
|
||||
//电压偏差
|
||||
LineWarning l2 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.VOLTAGE_DEV.getCode()).getId(),item.getVoltageDevOvertime());
|
||||
LineWarning l2 = overData(firstDayOfMonth, item.getLineId(), deptId, targetMap.get(DicDataEnum.VOLTAGE_DEV.getCode()).getId(), item.getVoltageDevOvertime());
|
||||
//长时闪变
|
||||
LineWarning l3 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.FLICKER.getCode()).getId(),item.getFlickerOvertime());
|
||||
LineWarning l3 = overData(firstDayOfMonth, item.getLineId(), deptId, targetMap.get(DicDataEnum.FLICKER.getCode()).getId(), item.getFlickerOvertime());
|
||||
//谐波电压
|
||||
LineWarning l4 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.HARMONIC_VOLTAGE.getCode()).getId(),item.getUharmOvertime());
|
||||
LineWarning l4 = overData(firstDayOfMonth, item.getLineId(), deptId, targetMap.get(DicDataEnum.HARMONIC_VOLTAGE.getCode()).getId(), item.getUharmOvertime());
|
||||
//谐波电流
|
||||
LineWarning l5 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.HARMONIC_CURRENT.getCode()).getId(),item.getIharmOvertime());
|
||||
LineWarning l5 = overData(firstDayOfMonth, item.getLineId(), deptId, targetMap.get(DicDataEnum.HARMONIC_CURRENT.getCode()).getId(), item.getIharmOvertime());
|
||||
//间谐波电压
|
||||
LineWarning l6 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.INTERHARMONIC_VOLTAGE.getCode()).getId(),item.getInuharmOvertime());
|
||||
LineWarning l6 = overData(firstDayOfMonth, item.getLineId(), deptId, targetMap.get(DicDataEnum.INTERHARMONIC_VOLTAGE.getCode()).getId(), item.getInuharmOvertime());
|
||||
//负序电压不平衡度
|
||||
LineWarning l7 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.PHASE_VOLTAGE.getCode()).getId(),item.getUbalanceOvertime());
|
||||
LineWarning l7 = overData(firstDayOfMonth, item.getLineId(), deptId, targetMap.get(DicDataEnum.PHASE_VOLTAGE.getCode()).getId(), item.getUbalanceOvertime());
|
||||
//负序电流
|
||||
LineWarning l8 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.NEG_CURRENT.getCode()).getId(),item.getINegOvertime());
|
||||
LineWarning l8 = overData(firstDayOfMonth, item.getLineId(), deptId, targetMap.get(DicDataEnum.NEG_CURRENT.getCode()).getId(), item.getINegOvertime());
|
||||
//电压总谐波畸变率
|
||||
LineWarning l9 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.THD_V.getCode()).getId(),item.getUaberranceOvertime());
|
||||
LineWarning l9 = overData(firstDayOfMonth, item.getLineId(), deptId, targetMap.get(DicDataEnum.THD_V.getCode()).getId(), item.getUaberranceOvertime());
|
||||
//总稳态指标
|
||||
LineWarning l10 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.TOTAL_INDICATOR.getCode()).getId(),item.getAllOvertime());
|
||||
result.addAll(Arrays.asList(l1,l2,l3,l4,l5,l6,l7,l8,l9,l10));
|
||||
LineWarning l10 = overData(firstDayOfMonth, item.getLineId(), deptId, targetMap.get(DicDataEnum.TOTAL_INDICATOR.getCode()).getId(), item.getAllOvertime());
|
||||
result.addAll(Arrays.asList(l1, l2, l3, l4, l5, l6, l7, l8, l9, l10));
|
||||
});
|
||||
}
|
||||
//将装置无数据的统计入库 按运维要求,判断装置的最新数据不是当天,则认为装置无数据
|
||||
List<LineDetailVO.noDataLineInfo> noDataLineInfo = lineFeignClient.getNoDataLine().getData();
|
||||
if (CollUtil.isNotEmpty(noDataLineInfo)) {
|
||||
LambdaQueryWrapper<LineWarning> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(LineWarning::getTargetType,"0").eq(LineWarning::getAlarmTime,date);
|
||||
lambdaQueryWrapper.eq(LineWarning::getTargetType, "0").eq(LineWarning::getAlarmTime, date);
|
||||
this.baseMapper.delete(lambdaQueryWrapper);
|
||||
noDataLineInfo.forEach(item->{
|
||||
String deptId = Objects.isNull(deptLineMap.get(item.getLineId()))?null:deptLineMap.get(item.getLineId()).get(0).getId();
|
||||
noDataLineInfo.forEach(item -> {
|
||||
String deptId = Objects.isNull(deptLineMap.get(item.getLineId())) ? null : deptLineMap.get(item.getLineId()).get(0).getId();
|
||||
LineWarning lineWarning = new LineWarning();
|
||||
lineWarning.setAlarmTime(firstDayOfMonth);
|
||||
lineWarning.setDeptId(deptId);
|
||||
@@ -222,17 +224,17 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
QueryWrapper<LineWarning> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.between("A.alarm_time", param.getSearchBeginTime(),param.getSearchEndTime());
|
||||
queryWrapper.between("A.alarm_time", param.getSearchBeginTime(), param.getSearchEndTime());
|
||||
//监测点id
|
||||
if (CollUtil.isNotEmpty(lineList)) {
|
||||
queryWrapper.in("A.line_id",lineList);
|
||||
queryWrapper.in("A.line_id", lineList);
|
||||
}
|
||||
//监测点类型
|
||||
if (StringUtils.isNotBlank(param.getLineType())) {
|
||||
queryWrapper.eq("B.Power_Flag",Integer.parseInt(param.getLineType()));
|
||||
queryWrapper.eq("B.Power_Flag", Integer.parseInt(param.getLineType()));
|
||||
}
|
||||
//查询无数据的监测点
|
||||
if (Objects.equals(param.getDataType(),0)){
|
||||
if (Objects.equals(param.getDataType(), 0)) {
|
||||
queryWrapper.eq("A.target_type", "0");
|
||||
}
|
||||
//查询指标超标的监测点
|
||||
@@ -242,7 +244,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
queryWrapper.in("A.target_type", param.getTargetList());
|
||||
}
|
||||
}
|
||||
queryWrapper.orderBy(true, true, "D.Name","p4.Name","p3.Name");
|
||||
queryWrapper.orderBy(true, true, "D.Name", "p4.Name", "p3.Name");
|
||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
||||
}
|
||||
|
||||
@@ -261,78 +263,78 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
param.setDeptName(deptName);
|
||||
String inputUrl = "file/warningReport.docx";
|
||||
String alarmType = param.getType() == 1 ? "预" : "告";
|
||||
String fileName = "电能["+alarmType+"]"+param.getYear()+"年"+param.getNumber()+"号-"+param.getDeptName()+"地市 电能质量技术监督"+alarmType+"警单.docx";
|
||||
String fileName = "电能[" + alarmType + "]" + param.getYear() + "年" + param.getNumber() + "号-" + param.getDeptName() + "地市 电能质量技术监督" + alarmType + "警单.docx";
|
||||
//获取无数据监测点集合
|
||||
List<ReportLineInfoVo> list1 = getReportLineInfo(true,param.getIdList(),null,param.getSearchBeginTime(),param.getSearchEndTime(),param.getDeptId(),allLineWarnings);
|
||||
List<ReportLineInfoVo> list1 = getReportLineInfo(true, param.getIdList(), null, param.getSearchBeginTime(), param.getSearchEndTime(), param.getDeptId(), allLineWarnings);
|
||||
//获取谐波电压超标监测点集合
|
||||
String vCode = dicDataFeignClient.getDicDataByCode(DicDataEnum.HARMONIC_VOLTAGE.getCode()).getData().getId();
|
||||
List<ReportLineInfoVo> list2 = getReportLineInfo(false,param.getIdList(),vCode,param.getSearchBeginTime(),param.getSearchEndTime(),null,allLineWarnings);
|
||||
List<ReportLineInfoVo> list2 = getReportLineInfo(false, param.getIdList(), vCode, param.getSearchBeginTime(), param.getSearchEndTime(), null, allLineWarnings);
|
||||
//获取谐波电流超标监测点集合
|
||||
String iCode = dicDataFeignClient.getDicDataByCode(DicDataEnum.HARMONIC_CURRENT.getCode()).getData().getId();
|
||||
List<ReportLineInfoVo> list3 = getReportLineInfo(false,param.getIdList(),iCode,param.getSearchBeginTime(),param.getSearchEndTime(),null,allLineWarnings);
|
||||
List<ReportLineInfoVo> list3 = getReportLineInfo(false, param.getIdList(), iCode, param.getSearchBeginTime(), param.getSearchEndTime(), null, allLineWarnings);
|
||||
try {
|
||||
Map<String, Object> dataMap = new HashMap<String, Object>();
|
||||
Map<String, Object> dataMap = new HashMap<>(16);
|
||||
dataMap.put("${year}", param.getYear());
|
||||
dataMap.put("${number}", param.getNumber());
|
||||
dataMap.put("${deptName}", param.getDeptName());
|
||||
dataMap.put("${startTime}", new SimpleDateFormat(DatePattern.CHINESE_DATE_PATTERN).format(new SimpleDateFormat(DatePattern.NORM_DATE_PATTERN).parse(param.getSearchBeginTime())));
|
||||
dataMap.put("${endTime}", new SimpleDateFormat(DatePattern.CHINESE_DATE_PATTERN).format(new SimpleDateFormat(DatePattern.NORM_DATE_PATTERN).parse(param.getSearchEndTime())));
|
||||
dataMap.put("${harmonicV}", CollUtil.isEmpty(list2)?"0":String.valueOf(list2.size()));
|
||||
dataMap.put("${harmonicI}", CollUtil.isEmpty(list3)?"0":String.valueOf(list3.size()));
|
||||
dataMap.put("${harmonicV}", CollUtil.isEmpty(list2) ? "0" : String.valueOf(list2.size()));
|
||||
dataMap.put("${harmonicI}", CollUtil.isEmpty(list3) ? "0" : String.valueOf(list3.size()));
|
||||
dataMap.put("${alarmDay}", String.valueOf(param.getAlarmThreshold()));
|
||||
dataMap.put("${title}", alarmType + "警");
|
||||
dataMap.put("${alarmType}", alarmType);
|
||||
dataMap.put("${gdName}", getGdName(param.getDeptName()));
|
||||
dataMap.put("${time}", LocalDate.now().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
|
||||
|
||||
List<String[]> dataList1 = new ArrayList<String[]>(),dataList2 = new ArrayList<String[]>(),dataList3 = new ArrayList<String[]>();
|
||||
List<String[]> dataList1 = new ArrayList<>(), dataList2 = new ArrayList<>(), dataList3 = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(list1)) {
|
||||
list1.forEach(item->{
|
||||
if (Objects.isNull(param.getLineType()) || Objects.equals("",param.getLineType())) {
|
||||
dataList1.add(new String[]{deptName,item.getLineVoltage(),item.getLineName(),item.getSubName(),item.getObjName(),item.getSubVName(),item.getUpdateTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)),item.getIp()});
|
||||
list1.forEach(item -> {
|
||||
if (Objects.isNull(param.getLineType()) || Objects.equals("", param.getLineType())) {
|
||||
dataList1.add(new String[]{deptName, item.getLineVoltage(), item.getLineName(), item.getSubName(), item.getObjName(), item.getSubVName(), item.getUpdateTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)), item.getIp()});
|
||||
} else if (Integer.parseInt(param.getLineType()) == item.getPowerFlag()) {
|
||||
dataList1.add(new String[]{deptName,item.getLineVoltage(),item.getLineName(),item.getSubName(),item.getObjName(),item.getSubVName(),item.getUpdateTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)),item.getIp()});
|
||||
dataList1.add(new String[]{deptName, item.getLineVoltage(), item.getLineName(), item.getSubName(), item.getObjName(), item.getSubVName(), item.getUpdateTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)), item.getIp()});
|
||||
}
|
||||
});
|
||||
dataMap.put("${noData}", CollUtil.isEmpty(dataList1)?"0":String.valueOf(dataList1.size()));
|
||||
dataMap.put("${noData}", CollUtil.isEmpty(dataList1) ? "0" : String.valueOf(dataList1.size()));
|
||||
}
|
||||
if (CollUtil.isNotEmpty(list2)) {
|
||||
list2.forEach(item->{
|
||||
dataList2.add(new String[]{deptName,item.getLineName(),item.getSubName(),item.getObjName(),String.valueOf(item.getOverDays())});
|
||||
list2.forEach(item -> {
|
||||
dataList2.add(new String[]{deptName, item.getLineName(), item.getSubName(), item.getObjName(), String.valueOf(item.getOverDays())});
|
||||
});
|
||||
}
|
||||
if (CollUtil.isNotEmpty(list3)) {
|
||||
list3.forEach(item->{
|
||||
dataList3.add(new String[]{deptName,item.getLineName(),item.getSubName(),item.getObjName(),String.valueOf(item.getOverDays()),String.valueOf(item.getShortCapacity()),String.valueOf(item.getDevCapacity()),String.valueOf(item.getDealCapacity())});
|
||||
list3.forEach(item -> {
|
||||
dataList3.add(new String[]{deptName, item.getLineName(), item.getSubName(), item.getObjName(), String.valueOf(item.getOverDays()), String.valueOf(item.getShortCapacity()), String.valueOf(item.getDevCapacity()), String.valueOf(item.getDealCapacity())});
|
||||
});
|
||||
}
|
||||
|
||||
List<List<String[]>> tableList = Arrays.asList(dataList1,dataList2,dataList3);
|
||||
InputStream inputStream = wordUtil2.getReportFile(inputUrl,dataMap,tableList);
|
||||
List<List<String[]>> tableList = Arrays.asList(dataList1, dataList2, dataList3);
|
||||
InputStream inputStream = wordUtil2.getReportFile(inputUrl, dataMap, tableList);
|
||||
//上传文件服务器
|
||||
String path = fileStorageUtil.uploadStreamSpecifyName(inputStream, OssPath.ONLINE_REPORT, fileName);
|
||||
//1.生成预告警单数据
|
||||
String leafletId = warningLeafletService.createLeaflet(
|
||||
ProblemTypeEnum.ONLINE.getName()
|
||||
,param.getDeptId()
|
||||
,IdWorker.get32UUID()
|
||||
,null
|
||||
,ProblemTypeEnum.ONLINE.getCode()
|
||||
,param.getType()
|
||||
,param.getIssueDetail()
|
||||
,param.getReformAdvice()
|
||||
,path);
|
||||
, param.getDeptId()
|
||||
, IdWorker.get32UUID()
|
||||
, null
|
||||
, ProblemTypeEnum.ONLINE.getCode()
|
||||
, param.getType()
|
||||
, param.getIssueDetail()
|
||||
, param.getReformAdvice()
|
||||
, path);
|
||||
//2.将选择的数据状态改成预警或者告警 && 将选择的数据添加预告警单id
|
||||
if (CollUtil.isNotEmpty(allLineWarnings)) {
|
||||
LambdaQueryWrapper<LineWarning> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(LineWarning::getId,param.getIdList())
|
||||
.notIn(LineWarning::getTargetType,Arrays.asList(vCode,iCode))
|
||||
.between(LineWarning::getAlarmTime,param.getSearchBeginTime(),param.getSearchEndTime());
|
||||
lambdaQueryWrapper.in(LineWarning::getId, param.getIdList())
|
||||
.notIn(LineWarning::getTargetType, Arrays.asList(vCode, iCode))
|
||||
.between(LineWarning::getAlarmTime, param.getSearchBeginTime(), param.getSearchEndTime());
|
||||
allLineWarnings.addAll(this.baseMapper.selectList(lambdaQueryWrapper));
|
||||
allLineWarnings.forEach(item->{
|
||||
allLineWarnings.forEach(item -> {
|
||||
item.setStep(param.getType());
|
||||
item.setInitiateWarningFlag(1);
|
||||
if (!Objects.equals(item.getTargetType(),"0")) {
|
||||
if (!Objects.equals(item.getTargetType(), "0")) {
|
||||
item.setAlertThreshold(param.getAlertThreshold());
|
||||
item.setAlarmThreshold(param.getAlarmThreshold());
|
||||
}
|
||||
@@ -348,13 +350,13 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
@Override
|
||||
public List<LineLimitDetailVo> getOverLimitDetail(OnlineParam.DetailParam param) {
|
||||
List<LineLimitDetailVo> result = new ArrayList<>();
|
||||
String targetCode = dicDataFeignClient.getDicDataById(param.getTargetId()).getData().getCode();
|
||||
String targetCode = dicDataFeignClient.getDicDataById(param.getTargetId()).getData().getCode();
|
||||
//获取监测点统计间隔
|
||||
Integer timeInterval = commTerminalGeneralClient.getMonitorDetail(param.getLineId()).getData().getInterval();
|
||||
//获取限值
|
||||
Overlimit overlimit = commTerminalGeneralClient.getOverLimitData(param.getLineId()).getData();
|
||||
//处理数据
|
||||
List<LineLimitDetailVo> data = chanelTarget(param,overlimit,timeInterval,targetCode);
|
||||
List<LineLimitDetailVo> data = chanelTarget(param, overlimit, timeInterval, targetCode);
|
||||
if (CollUtil.isNotEmpty(data)) {
|
||||
result = data.stream().sorted(Comparator.comparing(LineLimitDetailVo::getTime)).collect(Collectors.toList());
|
||||
}
|
||||
@@ -363,26 +365,26 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
|
||||
//指标数据处理
|
||||
public List<LineLimitDetailVo> chanelTarget(OnlineParam.DetailParam param, Overlimit overlimit, Integer timeInterval, String targetCode) {
|
||||
List<LineLimitDetailVo> result = new ArrayList<>(),finalList = new ArrayList<>();
|
||||
List<LineLimitDetailVo> result = new ArrayList<>(), finalList = new ArrayList<>();
|
||||
//频率偏差
|
||||
if (Objects.equals(targetCode,DicDataEnum.FREQUENCY_DEV.getCode()) || Objects.equals(targetCode,DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(),param.getSearchBeginTime(),param.getSearchEndTime(),1).getData();
|
||||
if (Objects.equals(targetCode, DicDataEnum.FREQUENCY_DEV.getCode()) || Objects.equals(targetCode, DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(), param.getSearchBeginTime(), param.getSearchEndTime(), 1).getData();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
list.forEach(item->{
|
||||
list.forEach(item -> {
|
||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||
double maxData = getFreqDev(param.getLineId()
|
||||
, time + " 00:00:00"
|
||||
, time + " 23:59:59"
|
||||
).get(0).getFreqDev();
|
||||
channelEachData(item,maxData>0?overlimit.getFreqDev():-overlimit.getFreqDev(),"getFreqDev",result,DicDataEnum.FREQUENCY_DEV.getName(),timeInterval,maxData);
|
||||
channelEachData(item, maxData > 0 ? overlimit.getFreqDev() : -overlimit.getFreqDev(), "getFreqDev", result, DicDataEnum.FREQUENCY_DEV.getName(), timeInterval, maxData);
|
||||
});
|
||||
}
|
||||
}
|
||||
//电压偏差
|
||||
if (Objects.equals(targetCode,DicDataEnum.VOLTAGE_DEV.getCode()) || Objects.equals(targetCode,DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(),param.getSearchBeginTime(),param.getSearchEndTime(),2).getData();
|
||||
if (Objects.equals(targetCode, DicDataEnum.VOLTAGE_DEV.getCode()) || Objects.equals(targetCode, DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(), param.getSearchBeginTime(), param.getSearchEndTime(), 2).getData();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
list.forEach(item->{
|
||||
list.forEach(item -> {
|
||||
Float overLimit;
|
||||
Double maxData;
|
||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||
@@ -391,132 +393,132 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
, time + " 23:59:59"
|
||||
);
|
||||
List<Double> voltage = voltageList.stream().map(DataV::getVuDev).collect(Collectors.toList());
|
||||
if (Math.abs(voltage.get(0)) >= Math.abs(voltage.get(1))){
|
||||
if (Math.abs(voltage.get(0)) >= Math.abs(voltage.get(1))) {
|
||||
overLimit = overlimit.getUvoltageDev();
|
||||
maxData = voltage.get(0);
|
||||
} else {
|
||||
overLimit = overlimit.getVoltageDev();
|
||||
maxData = voltage.get(1);
|
||||
}
|
||||
channelEachData(item,overLimit,"getVoltageDev",result,DicDataEnum.VOLTAGE_DEV.getName(),timeInterval,maxData);
|
||||
channelEachData(item, overLimit, "getVoltageDev", result, DicDataEnum.VOLTAGE_DEV.getName(), timeInterval, maxData);
|
||||
});
|
||||
}
|
||||
}
|
||||
//长时闪变
|
||||
if (Objects.equals(targetCode,DicDataEnum.FLICKER.getCode()) || Objects.equals(targetCode,DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(),param.getSearchBeginTime(),param.getSearchEndTime(),3).getData();
|
||||
if (Objects.equals(targetCode, DicDataEnum.FLICKER.getCode()) || Objects.equals(targetCode, DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(), param.getSearchBeginTime(), param.getSearchEndTime(), 3).getData();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
list.forEach(item->{
|
||||
list.forEach(item -> {
|
||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||
double maxData = getFlicker(param.getLineId()
|
||||
, time + " 00:00:00"
|
||||
, time + " 23:59:59"
|
||||
).get(0).getPlt();
|
||||
channelEachData(item,overlimit.getFlicker(),"getFlicker",result,DicDataEnum.FLICKER.getName(),timeInterval,maxData);
|
||||
channelEachData(item, overlimit.getFlicker(), "getFlicker", result, DicDataEnum.FLICKER.getName(), timeInterval, maxData);
|
||||
});
|
||||
}
|
||||
}
|
||||
//电压总谐波畸变率
|
||||
if (Objects.equals(targetCode,DicDataEnum.THD_V.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(),param.getSearchBeginTime(),param.getSearchEndTime(),4).getData();
|
||||
if (Objects.equals(targetCode, DicDataEnum.THD_V.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(), param.getSearchBeginTime(), param.getSearchEndTime(), 4).getData();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
list.forEach(item->{
|
||||
list.forEach(item -> {
|
||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||
double maxData = getVThd(param.getLineId()
|
||||
, time + " 00:00:00"
|
||||
, time + " 23:59:59"
|
||||
).get(0).getVThd();
|
||||
channelEachData(item,overlimit.getUaberrance(),"getUaberrance",result,DicDataEnum.THD_V.getName(),timeInterval,maxData);
|
||||
channelEachData(item, overlimit.getUaberrance(), "getUaberrance", result, DicDataEnum.THD_V.getName(), timeInterval, maxData);
|
||||
});
|
||||
}
|
||||
}
|
||||
//谐波电压
|
||||
if (Objects.equals(targetCode,DicDataEnum.HARMONIC_VOLTAGE.getCode()) || Objects.equals(targetCode,DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
if (Objects.equals(targetCode, DicDataEnum.HARMONIC_VOLTAGE.getCode()) || Objects.equals(targetCode, DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
//电压总谐波畸变率
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(),param.getSearchBeginTime(),param.getSearchEndTime(),4).getData();
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(), param.getSearchBeginTime(), param.getSearchEndTime(), 4).getData();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
list.forEach(item->{
|
||||
list.forEach(item -> {
|
||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||
double maxData = getVThd(param.getLineId()
|
||||
, time + " 00:00:00"
|
||||
, time + " 23:59:59"
|
||||
).get(0).getVThd();
|
||||
channelEachData(item,overlimit.getUaberrance(),"getUaberrance",result,DicDataEnum.THD_V.getName(),timeInterval,maxData);
|
||||
channelEachData(item, overlimit.getUaberrance(), "getUaberrance", result, DicDataEnum.THD_V.getName(), timeInterval, maxData);
|
||||
});
|
||||
}
|
||||
//谐波电压含有率2~25次
|
||||
List<RStatLimitRateDPO> list2 = limitRateDClient.getOverData(param.getLineId(),param.getSearchBeginTime(),param.getSearchEndTime(),7).getData();
|
||||
List<RStatLimitRateDPO> list2 = limitRateDClient.getOverData(param.getLineId(), param.getSearchBeginTime(), param.getSearchEndTime(), 7).getData();
|
||||
if (CollUtil.isNotEmpty(list2)) {
|
||||
list2.forEach(item->{
|
||||
list2.forEach(item -> {
|
||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||
DataHarmRateV dataHarmRateV = getDataHarmRateV(param.getLineId()
|
||||
, time + " 00:00:00"
|
||||
, time + " 23:59:59").get(0);
|
||||
channelHarmonicData(dataHarmRateV,null,null,item,overlimit,result,"getUharm",DicDataEnum.HARMONIC_VOLTAGE.getName(),timeInterval,2,25);
|
||||
channelHarmonicData(dataHarmRateV, null, null, item, overlimit, result, "getUharm", DicDataEnum.HARMONIC_VOLTAGE.getName(), timeInterval, 2, 25);
|
||||
});
|
||||
}
|
||||
}
|
||||
//谐波电流
|
||||
if (Objects.equals(targetCode,DicDataEnum.HARMONIC_CURRENT.getCode()) || Objects.equals(targetCode,DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(),param.getSearchBeginTime(),param.getSearchEndTime(),8).getData();
|
||||
if (Objects.equals(targetCode, DicDataEnum.HARMONIC_CURRENT.getCode()) || Objects.equals(targetCode, DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(), param.getSearchBeginTime(), param.getSearchEndTime(), 8).getData();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
list.forEach(item->{
|
||||
list.forEach(item -> {
|
||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||
DataI dataI = getDataI(param.getLineId()
|
||||
, time + " 00:00:00"
|
||||
, time + " 23:59:59").get(0);
|
||||
channelHarmonicData(null,dataI,null,item,overlimit,result,"getIharm",DicDataEnum.HARMONIC_CURRENT.getName(),timeInterval,2,25);
|
||||
channelHarmonicData(null, dataI, null, item, overlimit, result, "getIharm", DicDataEnum.HARMONIC_CURRENT.getName(), timeInterval, 2, 25);
|
||||
});
|
||||
}
|
||||
}
|
||||
//间谐波电压
|
||||
if (Objects.equals(targetCode,DicDataEnum.INTERHARMONIC_VOLTAGE.getCode()) || Objects.equals(targetCode,DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(),param.getSearchBeginTime(),param.getSearchEndTime(),9).getData();
|
||||
if (Objects.equals(targetCode, DicDataEnum.INTERHARMONIC_VOLTAGE.getCode()) || Objects.equals(targetCode, DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(), param.getSearchBeginTime(), param.getSearchEndTime(), 9).getData();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
list.forEach(item->{
|
||||
list.forEach(item -> {
|
||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||
DataInHarmV dataInHarmV = getDataInHarmV(param.getLineId()
|
||||
, time + " 00:00:00"
|
||||
, time + " 23:59:59").get(0);
|
||||
channelHarmonicData(null,null,dataInHarmV,item,overlimit,result,"getInuharm",DicDataEnum.INTERHARMONIC_VOLTAGE.getName(),timeInterval,1,16);
|
||||
channelHarmonicData(null, null, dataInHarmV, item, overlimit, result, "getInuharm", DicDataEnum.INTERHARMONIC_VOLTAGE.getName(), timeInterval, 1, 16);
|
||||
});
|
||||
}
|
||||
}
|
||||
//负序电压不平衡度
|
||||
if (Objects.equals(targetCode,DicDataEnum.PHASE_VOLTAGE.getCode()) || Objects.equals(targetCode,DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(),param.getSearchBeginTime(),param.getSearchEndTime(),5).getData();
|
||||
if (Objects.equals(targetCode, DicDataEnum.PHASE_VOLTAGE.getCode()) || Objects.equals(targetCode, DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(), param.getSearchBeginTime(), param.getSearchEndTime(), 5).getData();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
list.forEach(item->{
|
||||
list.forEach(item -> {
|
||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||
double maxData = getUnbalance(param.getLineId()
|
||||
, time + " 00:00:00"
|
||||
, time + " 23:59:59"
|
||||
).get(0).getVUnbalance();
|
||||
channelEachData(item,overlimit.getUbalance(),"getUbalance",result,DicDataEnum.PHASE_VOLTAGE.getName(),timeInterval,maxData);
|
||||
channelEachData(item, overlimit.getUbalance(), "getUbalance", result, DicDataEnum.PHASE_VOLTAGE.getName(), timeInterval, maxData);
|
||||
});
|
||||
}
|
||||
}
|
||||
//负序电流
|
||||
if (Objects.equals(targetCode,DicDataEnum.NEG_CURRENT.getCode()) || Objects.equals(targetCode,DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(),param.getSearchBeginTime(),param.getSearchEndTime(),6).getData();
|
||||
if (Objects.equals(targetCode, DicDataEnum.NEG_CURRENT.getCode()) || Objects.equals(targetCode, DicDataEnum.TOTAL_INDICATOR.getCode())) {
|
||||
List<RStatLimitRateDPO> list = limitRateDClient.getOverData(param.getLineId(), param.getSearchBeginTime(), param.getSearchEndTime(), 6).getData();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
list.forEach(item->{
|
||||
list.forEach(item -> {
|
||||
String time = item.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||
double maxData = getINeg(param.getLineId()
|
||||
, time + " 00:00:00"
|
||||
, time + " 23:59:59"
|
||||
).get(0).getINeg();
|
||||
channelEachData(item,overlimit.getINeg(),"getINeg",result,DicDataEnum.NEG_CURRENT.getName(),timeInterval,maxData);
|
||||
channelEachData(item, overlimit.getINeg(), "getINeg", result, DicDataEnum.NEG_CURRENT.getName(), timeInterval, maxData);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(result)) {
|
||||
Map<LocalDate,List<LineLimitDetailVo>> map = result.stream().collect(Collectors.groupingBy(LineLimitDetailVo::getTime,LinkedHashMap::new,Collectors.toList()));
|
||||
map.forEach((k,v)->{
|
||||
Map<LocalDate, List<LineLimitDetailVo>> map = result.stream().collect(Collectors.groupingBy(LineLimitDetailVo::getTime, LinkedHashMap::new, Collectors.toList()));
|
||||
map.forEach((k, v) -> {
|
||||
StringBuilder describe = new StringBuilder();
|
||||
LineLimitDetailVo lineLimitDetailVo = new LineLimitDetailVo();
|
||||
lineLimitDetailVo.setTime(k);
|
||||
v.forEach(item->{
|
||||
v.forEach(item -> {
|
||||
describe.append(item.getOverLimitInfo());
|
||||
});
|
||||
lineLimitDetailVo.setOverLimitInfo(describe.toString());
|
||||
@@ -536,7 +538,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
int value = (int) method.invoke(dpo);
|
||||
LineLimitDetailVo vo = new LineLimitDetailVo();
|
||||
vo.setTime(dpo.getTime());
|
||||
vo.setOverLimitInfo(targetName + "最大幅值:" + PubUtils.doubleRound(2,maxData) + ",限值:" + limit + ",超标时间:" + value * timeInterval + "分钟;");
|
||||
vo.setOverLimitInfo(targetName + "最大幅值:" + PubUtils.doubleRound(2, maxData) + ",限值:" + limit + ",超标时间:" + value * timeInterval + "分钟;");
|
||||
result.add(vo);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
@@ -545,7 +547,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
|
||||
//处理谐波数据 谐波电压、谐波电流、间谐波电压
|
||||
public void channelHarmonicData(DataHarmRateV dataHarmRateV, DataI dataI, DataInHarmV dataInHarmV, RStatLimitRateDPO dpo, Overlimit overlimit, List<LineLimitDetailVo> result, String getColum, String targetName, Integer timeInterval, Integer startTimes, Integer endTimes) {
|
||||
LinkedHashMap<Integer,Integer> overMap = new LinkedHashMap<>();
|
||||
LinkedHashMap<Integer, Integer> overMap = new LinkedHashMap<>();
|
||||
StringBuilder describe = new StringBuilder();
|
||||
LineLimitDetailVo vo = new LineLimitDetailVo();
|
||||
vo.setTime(dpo.getTime());
|
||||
@@ -557,7 +559,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
Method method = clazz.getMethod(methodName);
|
||||
int value = (int) method.invoke(dpo);
|
||||
if (value > 0) {
|
||||
overMap.put(i,value);
|
||||
overMap.put(i, value);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
@@ -565,7 +567,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
}
|
||||
Class<?> clazz2 = null;
|
||||
String targetName2 = null;
|
||||
double value2 = 0.0;
|
||||
double value2;
|
||||
if (Objects.nonNull(dataHarmRateV)) {
|
||||
clazz2 = dataHarmRateV.getClass();
|
||||
targetName2 = "getV";
|
||||
@@ -576,7 +578,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
clazz2 = dataInHarmV.getClass();
|
||||
targetName2 = "getV";
|
||||
}
|
||||
for(Integer key:overMap.keySet()){
|
||||
for (Integer key : overMap.keySet()) {
|
||||
int value = overMap.get(key);
|
||||
String methodName = targetName2 + key;
|
||||
Method method;
|
||||
@@ -584,13 +586,13 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
method = clazz2.getMethod(methodName);
|
||||
if (Objects.nonNull(dataHarmRateV)) {
|
||||
value2 = (double) method.invoke(dataHarmRateV);
|
||||
describe.append(key).append("次").append(targetName).append("CP95值最大幅值:").append(PubUtils.doubleRound(2,value2)).append("%,限值:").append(getOverLimitData(overlimit, getColum, key)).append("%,超标时间:").append(value * timeInterval).append("分钟;");
|
||||
describe.append(key).append("次").append(targetName).append("CP95值最大幅值:").append(PubUtils.doubleRound(2, value2)).append("%,限值:").append(getOverLimitData(overlimit, getColum, key)).append("%,超标时间:").append(value * timeInterval).append("分钟;");
|
||||
} else if (Objects.nonNull(dataI)) {
|
||||
value2 = (double) method.invoke(dataI);
|
||||
describe.append(key).append("次").append(targetName).append("CP95值最大幅值:").append(PubUtils.doubleRound(2,value2)).append("%,限值:").append(getOverLimitData(overlimit, getColum, key)).append("%,超标时间:").append(value * timeInterval).append("分钟;");
|
||||
describe.append(key).append("次").append(targetName).append("CP95值最大幅值:").append(PubUtils.doubleRound(2, value2)).append("%,限值:").append(getOverLimitData(overlimit, getColum, key)).append("%,超标时间:").append(value * timeInterval).append("分钟;");
|
||||
} else if (Objects.nonNull(dataInHarmV)) {
|
||||
value2 = (double) method.invoke(dataInHarmV);
|
||||
describe.append((key - 0.5)).append("次").append(targetName).append("CP95值最大幅值:").append(PubUtils.doubleRound(2,value2)).append("%,限值:").append(getOverLimitData(overlimit, getColum, key)).append("%,超标时间:").append(value * timeInterval).append("分钟;");
|
||||
describe.append((key - 0.5)).append("次").append(targetName).append("CP95值最大幅值:").append(PubUtils.doubleRound(2, value2)).append("%,限值:").append(getOverLimitData(overlimit, getColum, key)).append("%,超标时间:").append(value * timeInterval).append("分钟;");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
@@ -605,7 +607,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
*/
|
||||
public String getGdName(String deptName) {
|
||||
String gdName;
|
||||
if (Objects.equals(deptName,"风光储") || Objects.equals(deptName,"超高压") ) {
|
||||
if (Objects.equals(deptName, "风光储") || Objects.equals(deptName, "超高压")) {
|
||||
gdName = deptName + "公司";
|
||||
} else {
|
||||
gdName = deptName + "供电公司";
|
||||
@@ -613,24 +615,24 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
return gdName;
|
||||
}
|
||||
|
||||
public List<ReportLineInfoVo> getReportLineInfo(boolean type, List<String> idList, String codeId, String startTime, String endTime, String deptId,List<LineWarning> allLineWarnings) {
|
||||
public List<ReportLineInfoVo> getReportLineInfo(boolean type, List<String> idList, String codeId, String startTime, String endTime, String deptId, List<LineWarning> allLineWarnings) {
|
||||
List<ReportLineInfoVo> list = new ArrayList<>();
|
||||
LambdaQueryWrapper<LineWarning> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if (type) {
|
||||
lambdaQueryWrapper.eq(LineWarning::getTargetType,"0")
|
||||
.eq(LineWarning::getDeptId,deptId)
|
||||
.between(LineWarning::getAlarmTime,startTime,endTime);
|
||||
lambdaQueryWrapper.eq(LineWarning::getTargetType, "0")
|
||||
.eq(LineWarning::getDeptId, deptId)
|
||||
.between(LineWarning::getAlarmTime, startTime, endTime);
|
||||
} else {
|
||||
lambdaQueryWrapper.eq(LineWarning::getTargetType,codeId)
|
||||
.in(LineWarning::getId,idList)
|
||||
.between(LineWarning::getAlarmTime,startTime,endTime);
|
||||
lambdaQueryWrapper.eq(LineWarning::getTargetType, codeId)
|
||||
.in(LineWarning::getId, idList)
|
||||
.between(LineWarning::getAlarmTime, startTime, endTime);
|
||||
}
|
||||
List<LineWarning> warnings = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
if (CollUtil.isNotEmpty(warnings)) {
|
||||
allLineWarnings.addAll(warnings);
|
||||
List<String> lineList = warnings.stream().map(LineWarning::getLineId).collect(Collectors.toList());
|
||||
list = lineFeignClient.getReportLineInfo(lineList).getData();
|
||||
if (!type){
|
||||
if (!type) {
|
||||
Map<String, Integer> lineIdOverLimitDayMap = warnings.stream().collect(Collectors.toMap(LineWarning::getLineId, LineWarning::getOverLimitDay));
|
||||
list.forEach(item1 -> {
|
||||
String lineId = item1.getLineId();
|
||||
@@ -647,15 +649,15 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
/**
|
||||
* 获取监测点各指标的超标天数
|
||||
*/
|
||||
public List<LineWarning> getTargetInfo(String lineId, Map<String, DictData> map, Map<String, RStatLimitTargetDPO> limitMap,String deptId) {
|
||||
public List<LineWarning> getTargetInfo(String lineId, Map<String, DictData> map, Map<String, RStatLimitTargetDPO> limitMap, String deptId) {
|
||||
List<LineWarning> result = new ArrayList<>();
|
||||
map.forEach((k,v)->{
|
||||
map.forEach((k, v) -> {
|
||||
LineWarning lineWarning = new LineWarning();
|
||||
lineWarning.setAlarmTime(LocalDate.now().minusDays(1));
|
||||
lineWarning.setDeptId(deptId);
|
||||
lineWarning.setLineId(lineId);
|
||||
lineWarning.setTargetType(v.getId());
|
||||
lineWarning.setOverLimitDay(overDay(k,limitMap.get(lineId)));
|
||||
lineWarning.setOverLimitDay(overDay(k, limitMap.get(lineId)));
|
||||
lineWarning.setInitiateWarningFlag(0);
|
||||
lineWarning.setStep(0);
|
||||
result.add(lineWarning);
|
||||
@@ -677,19 +679,19 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
int result = 0;
|
||||
try {
|
||||
//频率偏差
|
||||
if (Objects.equals(code,DicDataEnum.PLPC_ENUM.getCode())) {
|
||||
if (Objects.equals(code, DicDataEnum.PLPC_ENUM.getCode())) {
|
||||
result = limitTarget.getFreqDevOvertime();
|
||||
}
|
||||
//电压偏差
|
||||
else if (Objects.equals(code,DicDataEnum.DYPC_ENUM.getCode())) {
|
||||
else if (Objects.equals(code, DicDataEnum.DYPC_ENUM.getCode())) {
|
||||
result = limitTarget.getVoltageDevOvertime();
|
||||
}
|
||||
//长时闪变
|
||||
else if (Objects.equals(code,DicDataEnum.CSSB_ENUM.getCode())) {
|
||||
else if (Objects.equals(code, DicDataEnum.CSSB_ENUM.getCode())) {
|
||||
result = limitTarget.getFlickerOvertime();
|
||||
}
|
||||
//谐波电压
|
||||
else if (Objects.equals(code,DicDataEnum.XBDY_ENUM.getCode())) {
|
||||
else if (Objects.equals(code, DicDataEnum.XBDY_ENUM.getCode())) {
|
||||
int sum = 0;
|
||||
Class<?> clazz = limitTarget.getClass();
|
||||
for (int i = 2; i <= 25; i++) {
|
||||
@@ -701,7 +703,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
result = limitTarget.getUaberranceOvertime() + sum;
|
||||
}
|
||||
//谐波电流
|
||||
else if (Objects.equals(code,DicDataEnum.XBDL_ENUM.getCode())) {
|
||||
else if (Objects.equals(code, DicDataEnum.XBDL_ENUM.getCode())) {
|
||||
int sum = 0;
|
||||
Class<?> clazz = limitTarget.getClass();
|
||||
for (int i = 2; i <= 25; i++) {
|
||||
@@ -713,7 +715,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
result = sum;
|
||||
}
|
||||
//间谐波电压
|
||||
else if (Objects.equals(code,DicDataEnum.JXBDY_ENUM.getCode())) {
|
||||
else if (Objects.equals(code, DicDataEnum.JXBDY_ENUM.getCode())) {
|
||||
int sum = 0;
|
||||
Class<?> clazz = limitTarget.getClass();
|
||||
for (int i = 1; i <= 16; i++) {
|
||||
@@ -725,30 +727,33 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
result = sum;
|
||||
}
|
||||
//负序电压不平衡度
|
||||
else if (Objects.equals(code,DicDataEnum.SXDYBPHD_ENUM.getCode())) {
|
||||
else if (Objects.equals(code, DicDataEnum.SXDYBPHD_ENUM.getCode())) {
|
||||
result = limitTarget.getUbalanceOvertime();
|
||||
}
|
||||
//负序电流
|
||||
else if (Objects.equals(code,DicDataEnum.FXDL_ENUM.getCode())) {
|
||||
else if (Objects.equals(code, DicDataEnum.FXDL_ENUM.getCode())) {
|
||||
result = limitTarget.getINegOvertime();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result > 0 ? 1:0;
|
||||
return result > 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 各指标计算 系统默认阈值:预警单10天 告警单15天
|
||||
*/
|
||||
public void targetInfo(List<LineWarning> lineWarnings, Map<String, DictData> targetMap, String target, RStatLimitTargetDPO dpo, String item, List<LineWarning> addList, List<LineWarning> updateList, String deptId) {
|
||||
List<LineWarning> l1 = lineWarnings.stream().filter(o->Objects.equals(o.getTargetType(),targetMap.get(target).getId())).collect(Collectors.toList());
|
||||
List<LineWarning> l1 = lineWarnings.stream().filter(o -> Objects.equals(o.getTargetType(), targetMap.get(target).getId())).collect(Collectors.toList());
|
||||
//获取最新的一条记录
|
||||
LineWarning line = l1.stream().max(Comparator.comparing(LineWarning::getAlarmTime)).orElse(null);
|
||||
//当前监测点连续越限天数
|
||||
int day = line.getOverLimitDay();
|
||||
int day = 0;
|
||||
if (line != null) {
|
||||
day = line.getOverLimitDay();
|
||||
}
|
||||
//当天是否越限 0:未越限 1:越限
|
||||
int result = overDay(target,dpo);
|
||||
int result = overDay(target, dpo);
|
||||
if (result == 0) {
|
||||
if (day < 10) {
|
||||
line.setOverLimitDay(0);
|
||||
@@ -824,7 +829,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
return "1";
|
||||
}
|
||||
// 编译正则表达式,用于匹配文件中的编号
|
||||
Pattern pattern = Pattern.compile("年(\\d+)号");
|
||||
Pattern pattern = compile("年(\\d+)号");
|
||||
int maxNumber = 0;
|
||||
for (WarningLeaflet leaflet : list) {
|
||||
String filePath = leaflet.getFilePath();
|
||||
@@ -844,7 +849,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
InfluxQueryWrapper influxQueryWrapper2 = new InfluxQueryWrapper(DataV.class);
|
||||
influxQueryWrapper2.eq(DataV::getLineId, lineIndex)
|
||||
.eq(DataV::getValueType, InfluxDbSqlConstant.MAX)
|
||||
.eq(DataV::getPhaseType,"T")
|
||||
.eq(DataV::getPhaseType, "T")
|
||||
.max(DataV::getFreqDev)
|
||||
.between(DataV::getTime, startTime, endTime);
|
||||
return dataVMapper.getStatisticsByWraper(influxQueryWrapper2);
|
||||
@@ -857,14 +862,14 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||
influxQueryWrapper.eq(DataV::getLineId, lineIndex)
|
||||
.eq(DataV::getValueType, InfluxDbSqlConstant.MIN)
|
||||
.regular(DataV::getPhaseType,Arrays.asList("A","B","C"))
|
||||
.regular(DataV::getPhaseType, Arrays.asList("A", "B", "C"))
|
||||
.min(DataV::getVuDev)
|
||||
.between(DataV::getTime, startTime, endTime);
|
||||
List<DataV> result = new ArrayList<>(dataVMapper.getStatisticsByWraper(influxQueryWrapper));
|
||||
InfluxQueryWrapper influxQueryWrapper2 = new InfluxQueryWrapper(DataV.class);
|
||||
influxQueryWrapper2.eq(DataV::getLineId, lineIndex)
|
||||
.eq(DataV::getValueType, InfluxDbSqlConstant.MAX)
|
||||
.regular(DataV::getPhaseType,Arrays.asList("A","B","C"))
|
||||
.regular(DataV::getPhaseType, Arrays.asList("A", "B", "C"))
|
||||
.max(DataV::getVuDev)
|
||||
.between(DataV::getTime, startTime, endTime);
|
||||
result.addAll(dataVMapper.getStatisticsByWraper(influxQueryWrapper2));
|
||||
@@ -877,7 +882,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
public List<DataPlt> getFlicker(String lineIndex, String startTime, String endTime) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataPlt.class);
|
||||
influxQueryWrapper.eq(DataPlt::getLineId, lineIndex)
|
||||
.regular(DataPlt::getPhaseType,Arrays.asList("A","B","C"))
|
||||
.regular(DataPlt::getPhaseType, Arrays.asList("A", "B", "C"))
|
||||
.max(DataPlt::getPlt)
|
||||
.between(DataPlt::getTime, startTime, endTime);
|
||||
return dataPltMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
@@ -890,7 +895,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||
influxQueryWrapper.eq(DataV::getLineId, lineIndex)
|
||||
.eq(DataV::getValueType, InfluxDbSqlConstant.CP95)
|
||||
.regular(DataV::getPhaseType,Arrays.asList("A","B","C"))
|
||||
.regular(DataV::getPhaseType, Arrays.asList("A", "B", "C"))
|
||||
.max(DataV::getVThd)
|
||||
.between(DataV::getTime, startTime, endTime);
|
||||
return dataVMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
@@ -903,7 +908,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||
influxQueryWrapper.eq(DataV::getLineId, lineIndex)
|
||||
.eq(DataV::getValueType, InfluxDbSqlConstant.MAX)
|
||||
.eq(DataV::getPhaseType,"T")
|
||||
.eq(DataV::getPhaseType, "T")
|
||||
.max(DataV::getVUnbalance)
|
||||
.between(DataV::getTime, startTime, endTime);
|
||||
return dataVMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
@@ -916,7 +921,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
||||
influxQueryWrapper.eq(DataI::getLineId, lineIndex)
|
||||
.eq(DataI::getValueType, InfluxDbSqlConstant.MAX)
|
||||
.eq(DataI::getPhaseType,"T")
|
||||
.eq(DataI::getPhaseType, "T")
|
||||
.max(DataI::getINeg)
|
||||
.between(DataI::getTime, startTime, endTime);
|
||||
return dataIMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
@@ -927,10 +932,10 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
*/
|
||||
public List<DataHarmRateV> getDataHarmRateV(String lineIndex, String startTime, String endTime) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmRateV.class);
|
||||
influxQueryWrapper.maxSamePrefixAndSuffix(InfluxDbSqlConstant.V,"", HarmonicTimesUtil.harmonicTimesList(2,25,1));
|
||||
influxQueryWrapper.maxSamePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(2, 25, 1));
|
||||
influxQueryWrapper.eq(DataHarmRateV::getLineId, lineIndex)
|
||||
.eq(DataHarmRateV::getValueType, InfluxDbSqlConstant.CP95)
|
||||
.regular(DataHarmRateV::getPhaseType,Arrays.asList("A","B","C"))
|
||||
.regular(DataHarmRateV::getPhaseType, Arrays.asList("A", "B", "C"))
|
||||
.between(DataHarmRateV::getTime, startTime, endTime);
|
||||
return dataHarmRateVMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
}
|
||||
@@ -940,10 +945,10 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
*/
|
||||
public List<DataI> getDataI(String lineIndex, String startTime, String endTime) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
||||
influxQueryWrapper.maxSamePrefixAndSuffix(InfluxDbSqlConstant.I,"", HarmonicTimesUtil.harmonicTimesList(2,25,1));
|
||||
influxQueryWrapper.maxSamePrefixAndSuffix(InfluxDbSqlConstant.I, "", HarmonicTimesUtil.harmonicTimesList(2, 25, 1));
|
||||
influxQueryWrapper.eq(DataI::getLineId, lineIndex)
|
||||
.eq(DataI::getValueType, InfluxDbSqlConstant.CP95)
|
||||
.regular(DataI::getPhaseType,Arrays.asList("A","B","C"))
|
||||
.regular(DataI::getPhaseType, Arrays.asList("A", "B", "C"))
|
||||
.between(DataI::getTime, startTime, endTime);
|
||||
return dataIMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
}
|
||||
@@ -953,10 +958,10 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
*/
|
||||
public List<DataInHarmV> getDataInHarmV(String lineIndex, String startTime, String endTime) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInHarmV.class);
|
||||
influxQueryWrapper.maxSamePrefixAndSuffix(InfluxDbSqlConstant.V,"", HarmonicTimesUtil.harmonicTimesList(1,16,1));
|
||||
influxQueryWrapper.maxSamePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 16, 1));
|
||||
influxQueryWrapper.eq(DataInHarmV::getLineId, lineIndex)
|
||||
.eq(DataInHarmV::getValueType, InfluxDbSqlConstant.CP95)
|
||||
.regular(DataInHarmV::getPhaseType,Arrays.asList("A","B","C"))
|
||||
.regular(DataInHarmV::getPhaseType, Arrays.asList("A", "B", "C"))
|
||||
.between(DataInHarmV::getTime, startTime, endTime);
|
||||
return dataInHarmVMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@@ -31,7 +30,6 @@ import com.njcn.supervision.enums.SupervisionUserStatusEnum;
|
||||
import com.njcn.supervision.mapper.device.QuitRunningDeviceMapper;
|
||||
import com.njcn.supervision.pojo.param.device.QuitRunningDeviceParam;
|
||||
import com.njcn.supervision.pojo.po.device.QuitRunningDevice;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||
import com.njcn.supervision.pojo.vo.device.QuitRunningDeviceVO;
|
||||
import com.njcn.supervision.service.device.IQuitRunningDeviceService;
|
||||
import com.njcn.supervision.service.user.UserReportPOService;
|
||||
@@ -90,7 +88,6 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
||||
|
||||
}
|
||||
|
||||
// quitRunningDevice.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
this.saveOrUpdate(quitRunningDevice);
|
||||
quitRunningDevice = this.baseMapper.selectById(quitRunningDevice.getId());
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pms.utils.PubUtil;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.api.NodeClient;
|
||||
import com.njcn.device.pq.pojo.po.Node;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
@@ -40,10 +39,8 @@ import com.njcn.supervision.mapper.device.SupervisionDevMainReportPOMapper;
|
||||
import com.njcn.supervision.pojo.dto.SupervisionDevMainReportExcel;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionDevMainReportParam;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionTempDeviceReportParam;
|
||||
import com.njcn.supervision.pojo.po.device.QuitRunningDevice;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
||||
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
||||
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
|
||||
import com.njcn.supervision.service.device.SupervisionDevMainReportPOService;
|
||||
import com.njcn.supervision.service.device.SupervisionTempDeviceReportService;
|
||||
@@ -87,7 +84,6 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
private final SupervisionTempDeviceReportService supervisionTempDeviceReportService;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final UserFeignClient userFeignClient;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final NodeClient nodeClient;
|
||||
private final CommTerminalGeneralClient commterminalGeneralClient;
|
||||
@@ -99,14 +95,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
SupervisionDevMainReportPO supervisionDevMainReportPO = new SupervisionDevMainReportPO();
|
||||
BeanUtils.copyProperties(supervisionDevMainReportParam, supervisionDevMainReportPO);
|
||||
if (Objects.equals(supervisionDevMainReportParam.getSaveOrCheckflag(), "2")) {
|
||||
if (StringUtils.isEmpty(supervisionDevMainReportParam.getId())) {
|
||||
//设备校验ip
|
||||
checkIp(supervisionDevMainReportParam, false);
|
||||
} else {
|
||||
//设备校验ip
|
||||
checkIp(supervisionDevMainReportParam, true);
|
||||
|
||||
}
|
||||
checkIp(supervisionDevMainReportParam, !StringUtils.isEmpty(supervisionDevMainReportParam.getId()));
|
||||
}
|
||||
|
||||
//设置状态
|
||||
@@ -147,7 +136,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
// 发起 BPM 流程
|
||||
// 如何未提交审则不需要发起 BPM 流程
|
||||
if (Objects.equals(supervisionDevMainReportParam.getSaveOrCheckflag(), "2")) {
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.DEVICE_INFO_ADD.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(id);
|
||||
@@ -174,7 +163,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
//处理历史流程id列表
|
||||
String historyInstanceIds = InstanceUtil.dealHistoryId(supervisionDevMainReportPO.getProcessInstanceId(), supervisionDevMainReportPO.getHistoryInstanceId());
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.DEVICE_INFO_ADD.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(supervisionDevMainReportPO.getId());
|
||||
@@ -237,7 +226,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
DateUtil.endOfDay(DateUtil.parse(supervisionDevMainReportQuery.getSearchEndTime())));
|
||||
queryWrapper.orderByDesc("supervision_dev_main_report.Update_Time");
|
||||
Page<SupervisionDevMainReportVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(supervisionDevMainReportQuery), PageFactory.getPageSize(supervisionDevMainReportQuery)), queryWrapper);
|
||||
page.getRecords().stream().forEach(temp -> {
|
||||
page.getRecords().forEach(temp -> {
|
||||
// temp.setOrgName((deptFeignClient.getDeptById(temp.getOrgId()).getData().getName()));
|
||||
//处理特殊字段,用户名、部门名
|
||||
UserVO userVO = userFeignClient.getUserById(temp.getReporter()).getData();
|
||||
@@ -306,10 +295,8 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
.list();
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
List<String> collect = list.stream().map(SupervisionDevMainReportPO::getId).collect(Collectors.toList());
|
||||
List<SupervisionTempDeviceReport> list1 = supervisionTempDeviceReportService.lambdaQuery().in(SupervisionTempDeviceReport::getId, collect).list();
|
||||
return list1;
|
||||
return supervisionTempDeviceReportService.lambdaQuery().in(SupervisionTempDeviceReport::getId, collect).list();
|
||||
}
|
||||
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@@ -506,8 +493,10 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
@Override
|
||||
public void importDevData(MultipartFile file, HttpServletResponse response) {
|
||||
ImportParams params = new ImportParams();
|
||||
params.setHeadRows(1);//表头
|
||||
params.setTitleRows(1);//标题
|
||||
//表头
|
||||
params.setHeadRows(1);
|
||||
//标题
|
||||
params.setTitleRows(1);
|
||||
params.setNeedVerify(true);
|
||||
params.setStartSheetIndex(0);
|
||||
params.setSheetNum(1);
|
||||
@@ -725,8 +714,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
|
||||
/**
|
||||
* @Description: 判断设备ip是否重复,如果重复提示
|
||||
* @Param: supervisionDevMainReportParam终端详情 isExcludeSelf是否排除自己,一般新增不排除,更新时需要排除自己
|
||||
* @return: void
|
||||
* @param supervisionDevMainReportParam 终端详情 isExcludeSelf是否排除自己,一般新增不排除,更新时需要排除自己
|
||||
* @Author: clam
|
||||
* @Date: 2024/5/11
|
||||
*/
|
||||
|
||||
@@ -32,7 +32,6 @@ import com.njcn.supervision.enums.UserNatureEnum;
|
||||
import com.njcn.supervision.mapper.device.SupervisionTempLineDebugPOMapper;
|
||||
import com.njcn.supervision.mapper.user.UserReportNormalMapper;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionTempLineDebugParam;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||
@@ -67,7 +66,6 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/5/17 15:26【需求编号】
|
||||
*
|
||||
@@ -76,7 +74,7 @@ import java.util.stream.Stream;
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<SupervisionTempLineDebugPOMapper, SupervisionTempLineDebugPO> implements SupervisionTempLineDebugPOService{
|
||||
public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<SupervisionTempLineDebugPOMapper, SupervisionTempLineDebugPO> implements SupervisionTempLineDebugPOService {
|
||||
|
||||
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
@@ -133,20 +131,20 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
);
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
Optional<UserReportNormalPO> netInReport = list.stream().filter(x -> 0 == x.getType()).findFirst();
|
||||
if(netInReport.isPresent()){
|
||||
if(netInReport.get().getStatus()!=2){
|
||||
if (netInReport.isPresent()) {
|
||||
if (netInReport.get().getStatus() != 2) {
|
||||
throw new BusinessException("最新入网验收方案流程,暂未审核通过!");
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
throw new BusinessException("请填写入网验收方案流程,审核通过后方可操作!");
|
||||
}
|
||||
if (needGovernance == 1) {
|
||||
Optional<UserReportNormalPO> governReport = list.stream().filter(x -> 1 == x.getType()).findFirst();
|
||||
if(governReport.isPresent()){
|
||||
if(governReport.get().getStatus()!=2){
|
||||
if (governReport.isPresent()) {
|
||||
if (governReport.get().getStatus() != 2) {
|
||||
throw new BusinessException("最新治理工程验收方案流程,暂未审核通过!");
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
throw new BusinessException("请填写治理工程验收方案流程,审核通过后方可操作!");
|
||||
}
|
||||
}
|
||||
@@ -155,12 +153,12 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
}
|
||||
|
||||
SupervisionTempLineDebugPO supervisionTempLineDebugPO = new SupervisionTempLineDebugPO();
|
||||
BeanUtils.copyProperties(supervisionTempLineReportParam,supervisionTempLineDebugPO);
|
||||
BeanUtils.copyProperties(supervisionTempLineReportParam, supervisionTempLineDebugPO);
|
||||
//设置状态
|
||||
if(Objects.equals(supervisionTempLineReportParam.getSaveOrCheckflag(),"1")){
|
||||
if (Objects.equals(supervisionTempLineReportParam.getSaveOrCheckflag(), "1")) {
|
||||
supervisionTempLineDebugPO.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||
|
||||
}else {
|
||||
} else {
|
||||
supervisionTempLineDebugPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
|
||||
}
|
||||
@@ -168,16 +166,16 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
this.saveOrUpdate(supervisionTempLineDebugPO);
|
||||
String id = supervisionTempLineDebugPO.getId();
|
||||
supervisionTempLineDebugPO = this.baseMapper.selectById(id);
|
||||
if(Objects.equals(supervisionTempLineReportParam.getSaveOrCheckflag(),"2")) {
|
||||
if (Objects.equals(supervisionTempLineReportParam.getSaveOrCheckflag(), "2")) {
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.TEMP_LINE_DEBUG.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(id);
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(supervisionTempLineReportParam.getStartUserSelectAssignees());
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
//fixme 这边supervisionTempLineDebugPO.getUpdateBy()为null,先改成当前用户
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(RequestUtil.getUserIndex(),bpmProcessInstanceCreateReqDTO).getData();
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(RequestUtil.getUserIndex(), bpmProcessInstanceCreateReqDTO).getData();
|
||||
// 将工作流的编号,更新到流程单中
|
||||
supervisionTempLineDebugPO.setProcessInstanceId(processInstanceId);
|
||||
this.updateById(supervisionTempLineDebugPO);
|
||||
@@ -189,16 +187,16 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
public String updateTempLineDebug(SupervisionTempLineDebugParam.SupervisionTempLineDebugUpdateParam supervisionTempLineReportParam) {
|
||||
SupervisionTempLineDebugPO supervisionTempLineDebugPO = this.baseMapper.selectById(supervisionTempLineReportParam.getId());
|
||||
//判断是否有权限操作
|
||||
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(),supervisionTempLineDebugPO.getCreateBy());
|
||||
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(), supervisionTempLineDebugPO.getCreateBy());
|
||||
supervisionTempLineReportParam.setProcessInstanceId(supervisionTempLineDebugPO.getProcessInstanceId());
|
||||
supervisionTempLineReportParam.setHistoryInstanceId(supervisionTempLineDebugPO.getHistoryInstanceId());
|
||||
BeanUtils.copyProperties(supervisionTempLineReportParam,supervisionTempLineDebugPO);
|
||||
BeanUtils.copyProperties(supervisionTempLineReportParam, supervisionTempLineDebugPO);
|
||||
supervisionTempLineDebugPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
supervisionTempLineDebugPO.setState(DataStateEnum.ENABLE.getCode());
|
||||
//处理历史流程id列表
|
||||
String historyInstanceIds = InstanceUtil.dealHistoryId(supervisionTempLineDebugPO.getProcessInstanceId(), supervisionTempLineDebugPO.getHistoryInstanceId());
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.TEMP_LINE_DEBUG.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(supervisionTempLineDebugPO.getId());
|
||||
@@ -218,14 +216,14 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
QueryWrapper<SupervisionDevMainReportVO> queryWrapper = new QueryWrapper<>();
|
||||
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||
queryWrapper.in("supervision_temp_line_debug.create_by", colleaguesIds)
|
||||
.eq("supervision_temp_line_debug.state", DataStateEnum.ENABLE.getCode());
|
||||
.eq("supervision_temp_line_debug.state", DataStateEnum.ENABLE.getCode());
|
||||
if (StrUtil.isNotBlank(supervisionTempLineDebugQuery.getOrgNo())) {
|
||||
/*获取直接下属子单位*/
|
||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineDebugQuery.getOrgNo()).getData();
|
||||
queryWrapper.in("supervision_temp_line_report.org_id", data);
|
||||
}
|
||||
queryWrapper
|
||||
.and(CollUtil.isNotEmpty(InstanceUtil.filterTaskStatus()),w -> w.in("supervision_temp_line_debug.status", InstanceUtil.filterTaskStatus())
|
||||
.and(CollUtil.isNotEmpty(InstanceUtil.filterTaskStatus()), w -> w.in("supervision_temp_line_debug.status", InstanceUtil.filterTaskStatus())
|
||||
.or()
|
||||
.eq("supervision_temp_line_debug.create_by", RequestUtil.getUserIndex())
|
||||
);
|
||||
@@ -234,7 +232,7 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
queryWrapper.eq("supervision_temp_line_debug.status", supervisionTempLineDebugQuery.getStatus());
|
||||
}
|
||||
if (StrUtil.isNotBlank(supervisionTempLineDebugQuery.getSearchValue())) {
|
||||
queryWrapper.and(x->x
|
||||
queryWrapper.and(x -> x
|
||||
.like("supervision_temp_line_report.Power_Substation_Name", supervisionTempLineDebugQuery.getSearchValue())
|
||||
.or()
|
||||
.like("supervision_temp_line_report.connected_bus", supervisionTempLineDebugQuery.getSearchValue())
|
||||
@@ -249,8 +247,7 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
DateUtil.beginOfDay(DateUtil.parse(supervisionTempLineDebugQuery.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(supervisionTempLineDebugQuery.getSearchEndTime())));
|
||||
queryWrapper.orderByDesc("supervision_temp_line_debug.Update_Time");
|
||||
Page<SupervisionTempLineDebugVO> page =this.baseMapper.page(new Page<>(PageFactory.getPageNum(supervisionTempLineDebugQuery), PageFactory.getPageSize(supervisionTempLineDebugQuery)), queryWrapper);
|
||||
return page;
|
||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(supervisionTempLineDebugQuery), PageFactory.getPageSize(supervisionTempLineDebugQuery)), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -265,7 +262,7 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
queryWrapper.in("supervision_temp_line_report.org_id", data);
|
||||
}
|
||||
queryWrapper
|
||||
.and(CollUtil.isNotEmpty(InstanceUtil.filterTaskStatus()),w -> w.in("supervision_temp_line_debug.status", InstanceUtil.filterTaskStatus())
|
||||
.and(CollUtil.isNotEmpty(InstanceUtil.filterTaskStatus()), w -> w.in("supervision_temp_line_debug.status", InstanceUtil.filterTaskStatus())
|
||||
.or()
|
||||
.eq("supervision_temp_line_debug.create_by", RequestUtil.getUserIndex())
|
||||
);
|
||||
@@ -277,16 +274,15 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
DateUtil.beginOfDay(DateUtil.parse(supervisionTempLineDebugQuery.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(supervisionTempLineDebugQuery.getSearchEndTime())));
|
||||
queryWrapper.orderByDesc("supervision_temp_line_debug.Update_Time");
|
||||
Page<SupervisionTempLineDebugVO> page =this.baseMapper.pageHasDebug(new Page<>(PageFactory.getPageNum(supervisionTempLineDebugQuery), PageFactory.getPageSize(supervisionTempLineDebugQuery)), queryWrapper);
|
||||
return page;
|
||||
return this.baseMapper.pageHasDebug(new Page<>(PageFactory.getPageNum(supervisionTempLineDebugQuery), PageFactory.getPageSize(supervisionTempLineDebugQuery)), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupervisionTempLineDebugVO getDetailTempLineDebug(String id) {
|
||||
SupervisionTempLineDebugVO supervisionTempLineDebugVO =null;
|
||||
SupervisionTempLineDebugVO supervisionTempLineDebugVO = null;
|
||||
SupervisionTempLineReport supervisionTempLineReport = supervisionTempLineReportService.getById(id);
|
||||
SupervisionTempLineDebugPO supervisionTempLineDebugPO = this.getById(id);
|
||||
if(ObjectUtil.isNotNull(supervisionTempLineDebugPO)){
|
||||
if (ObjectUtil.isNotNull(supervisionTempLineDebugPO)) {
|
||||
supervisionTempLineDebugVO = new SupervisionTempLineDebugVO();
|
||||
supervisionTempLineDebugVO.setId(id);
|
||||
supervisionTempLineDebugVO.setUserName(supervisionTempLineReport.getUserName());
|
||||
@@ -306,7 +302,7 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
|
||||
@Override
|
||||
public void updateProcessStatus(String businessKey, Integer status) {
|
||||
this.lambdaUpdate().set(SupervisionTempLineDebugPO::getStatus,status).eq(SupervisionTempLineDebugPO::getId,businessKey).update();
|
||||
this.lambdaUpdate().set(SupervisionTempLineDebugPO::getStatus, status).eq(SupervisionTempLineDebugPO::getId, businessKey).update();
|
||||
|
||||
}
|
||||
|
||||
@@ -314,14 +310,14 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
public BpmInstanceInfo getInstanceInfo(String businessId) {
|
||||
BpmInstanceInfo bpmInstanceInfo = new BpmInstanceInfo();
|
||||
SupervisionTempLineDebugVO supervisionTempLineDebugVO = this.getDetailTempLineDebug(businessId);
|
||||
if(ObjectUtil.isNotNull(supervisionTempLineDebugVO)){
|
||||
if (ObjectUtil.isNotNull(supervisionTempLineDebugVO)) {
|
||||
bpmInstanceInfo.setHistoryInstanceId(supervisionTempLineDebugVO.getHistoryInstanceId());
|
||||
String sign = "";
|
||||
if(StrUtil.isNotBlank(supervisionTempLineDebugVO.getPowerSubstationName())){
|
||||
sign=supervisionTempLineDebugVO.getPowerSubstationName()
|
||||
if (StrUtil.isNotBlank(supervisionTempLineDebugVO.getPowerSubstationName())) {
|
||||
sign = supervisionTempLineDebugVO.getPowerSubstationName()
|
||||
.concat(StrPool.SLASH);
|
||||
}
|
||||
sign = sign
|
||||
sign = sign
|
||||
.concat(supervisionTempLineDebugVO.getMonitoringTerminalName())
|
||||
.concat(StrPool.SLASH)
|
||||
.concat(supervisionTempLineDebugVO.getLineName());
|
||||
@@ -347,16 +343,14 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 临时表台账数据同步到实际表中
|
||||
* @Param:
|
||||
* @return: java.lang.String
|
||||
* @Author: clam
|
||||
* @Date: 2024/5/29
|
||||
*/
|
||||
* @Description: 临时表台账数据同步到实际表中
|
||||
* @Author: clam
|
||||
* @Date: 2024/5/29
|
||||
*/
|
||||
@Override
|
||||
public String ledgerSync(String id) {
|
||||
SupervisionTempLineDebugPO byId = this.getById(id);
|
||||
if(byId.getStatus()!=2){
|
||||
if (byId.getStatus() != 2) {
|
||||
throw new BusinessException("未审核通过无法同步台账");
|
||||
}
|
||||
//获取临时监测点详情
|
||||
@@ -366,7 +360,7 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
SyncTerminalParam syncTerminalParam = new SyncTerminalParam();
|
||||
//用于绑定监测点部门
|
||||
syncTerminalParam.setDeptId(tempDevice.getPowerCompany());
|
||||
if(tempDevice.getCustomSubstationFlag()==0){
|
||||
if (tempDevice.getCustomSubstationFlag() == 0) {
|
||||
List<Line> data = lineFeignClient.getBaseLineList(Stream.of(tempDevice.getSubstation()).collect(Collectors.toList())).getData();
|
||||
String pids = data.get(0).getPids();
|
||||
String[] idsArray = pids.split(",");
|
||||
@@ -376,7 +370,7 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
syncTerminalParam.setGdIndex(idsArray[2]);
|
||||
syncTerminalParam.setSubIndex(tempDevice.getSubstation());
|
||||
|
||||
}else {
|
||||
} else {
|
||||
//电站可能后期要录 todo
|
||||
List<String> data1 = deptLineFeignClient.getLineNodeByDeptId(tempDevice.getPowerCompany()).getData();
|
||||
List<Line> data = lineFeignClient.getBaseLineList(data1).getData();
|
||||
@@ -403,14 +397,14 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
SubVoltageParam subVoltageParam = new SubVoltageParam();
|
||||
LineParam lineParam = new LineParam();
|
||||
|
||||
assembleSyncTerminalParam(deviceParam,tempDevice,subVoltageParam,lineParam,tempLine);
|
||||
assembleSyncTerminalParam(deviceParam, tempDevice, subVoltageParam, lineParam, tempLine);
|
||||
|
||||
syncTerminalParam.setDeviceParam(deviceParam);
|
||||
syncTerminalParam.setSubVoltageParam(subVoltageParam);
|
||||
syncTerminalParam.setLineParam(lineParam);
|
||||
|
||||
String substation = terminalBaseClient.terminalSync(syncTerminalParam).getData();
|
||||
this.updateProcessStatus(id,5);
|
||||
this.updateProcessStatus(id, 5);
|
||||
tempDevice.setSubstation(substation);
|
||||
supervisionTempDeviceReportService.updateById(tempDevice);
|
||||
return null;
|
||||
@@ -421,7 +415,7 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
//准备取消该流程,需要远程调用接口
|
||||
SupervisionTempLineDebugPO supervisionTempLineDebugPO = this.baseMapper.selectById(cancelReqVO.getId());
|
||||
//判断是否有权限操作
|
||||
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(),supervisionTempLineDebugPO.getCreateBy());
|
||||
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(), supervisionTempLineDebugPO.getCreateBy());
|
||||
//取消流程
|
||||
bpmProcessFeignClient.cancelProcessInstanceByStartUser(cancelReqVO);
|
||||
//更新状态
|
||||
@@ -433,7 +427,7 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
@Override
|
||||
public Boolean deleteTempLineDebugReport(List<String> supervisionId) {
|
||||
List<SupervisionTempLineDebugPO> supervisionTempLineDebugPOS = this.listByIds(supervisionId);
|
||||
if(CollUtil.isEmpty(supervisionTempLineDebugPOS)){
|
||||
if (CollUtil.isEmpty(supervisionTempLineDebugPOS)) {
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
//判断是否有权限操作
|
||||
@@ -441,12 +435,12 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
long count = supervisionTempLineDebugPOS.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
|
||||
InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
|
||||
return this.update(new LambdaUpdateWrapper<SupervisionTempLineDebugPO>().set(SupervisionTempLineDebugPO::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(SupervisionTempLineDebugPO::getId, supervisionId));
|
||||
.in(SupervisionTempLineDebugPO::getId, supervisionId));
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void assembleSyncTerminalParam(DeviceParam deviceParam, SupervisionTempDeviceReport tempDevice,SubVoltageParam subVoltageParam,LineParam lineParam ,SupervisionTempLineReport tempLine) {
|
||||
private void assembleSyncTerminalParam(DeviceParam deviceParam, SupervisionTempDeviceReport tempDevice, SubVoltageParam subVoltageParam, LineParam lineParam, SupervisionTempLineReport tempLine) {
|
||||
//包装device
|
||||
deviceParam.setDevIndex(tempDevice.getId());
|
||||
deviceParam.setName(tempDevice.getMonitoringTerminalName());
|
||||
@@ -509,7 +503,7 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
lineParam.setPowerSubstationName(tempLine.getPowerSubstationName());
|
||||
// lineParam.setCalssificationGrade();
|
||||
// lineParam.setSuperiorsSubstation();
|
||||
lineParam.setStatFlag(Integer.valueOf(tempLine.getIsStatistical()));
|
||||
lineParam.setStatFlag(tempLine.getIsStatistical());
|
||||
// lineParam.setHangLine();
|
||||
// lineParam.setOwner();
|
||||
// lineParam.setOwnerDuty();
|
||||
@@ -517,7 +511,6 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
lineParam.setWiringDiagram(tempLine.getMainWiringDiagram());
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private String reflectionBusinessType(String businessType) {
|
||||
|
||||
@@ -26,7 +26,6 @@ import com.njcn.supervision.enums.SupervisionUserStatusEnum;
|
||||
import com.njcn.supervision.mapper.device.SupervisionTempLineDebugPOMapper;
|
||||
import com.njcn.supervision.mapper.device.SupervisionTempLineReportMapper;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionTempLineReportParam;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineReportVO;
|
||||
@@ -48,10 +47,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static javafx.beans.binding.Bindings.concat;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/5/11 14:07【需求编号】
|
||||
*
|
||||
@@ -60,7 +57,7 @@ import static javafx.beans.binding.Bindings.concat;
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SupervisionTempLineReportServiceImpl extends ServiceImpl<SupervisionTempLineReportMapper, SupervisionTempLineReport> implements SupervisionTempLineReportService{
|
||||
public class SupervisionTempLineReportServiceImpl extends ServiceImpl<SupervisionTempLineReportMapper, SupervisionTempLineReport> implements SupervisionTempLineReportService {
|
||||
|
||||
|
||||
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||
@@ -75,23 +72,15 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String addTempLineReport(SupervisionTempLineReportParam supervisionTempLineReportParam) {
|
||||
SupervisionTempLineReport supervisionTempLineReport = new SupervisionTempLineReport();
|
||||
BeanUtils.copyProperties(supervisionTempLineReportParam,supervisionTempLineReport);
|
||||
if(Objects.equals(supervisionTempLineReportParam.getSaveOrCheckflag(),"2")){
|
||||
if(StringUtils.isEmpty(supervisionTempLineReportParam.getId())){
|
||||
//判断监测点是否重复
|
||||
checkLineId(supervisionTempLineReportParam, false);
|
||||
|
||||
}else {
|
||||
//判断监测点是否重复
|
||||
checkLineId(supervisionTempLineReportParam, true);
|
||||
|
||||
}
|
||||
BeanUtils.copyProperties(supervisionTempLineReportParam, supervisionTempLineReport);
|
||||
if (Objects.equals(supervisionTempLineReportParam.getSaveOrCheckflag(), "2")) {
|
||||
checkLineId(supervisionTempLineReportParam, !StringUtils.isEmpty(supervisionTempLineReportParam.getId()));
|
||||
}
|
||||
//设置状态
|
||||
if(Objects.equals(supervisionTempLineReportParam.getSaveOrCheckflag(),"1")){
|
||||
if (Objects.equals(supervisionTempLineReportParam.getSaveOrCheckflag(), "1")) {
|
||||
supervisionTempLineReport.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||
|
||||
}else {
|
||||
} else {
|
||||
supervisionTempLineReport.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
|
||||
}
|
||||
@@ -103,9 +92,9 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
String id = supervisionTempLineReport.getId();
|
||||
supervisionTempLineReport = this.baseMapper.selectById(id);
|
||||
|
||||
if(Objects.equals(supervisionTempLineReportParam.getSaveOrCheckflag(),"2")) {
|
||||
if (Objects.equals(supervisionTempLineReportParam.getSaveOrCheckflag(), "2")) {
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.LINE_INFO_ADD.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(id);
|
||||
@@ -123,16 +112,16 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
public String updateLineReport(SupervisionTempLineReportParam.SupervisionTempLineReportUpdate supervisionTempLineReportParam) {
|
||||
SupervisionTempLineReport supervisionTempLineReport = this.baseMapper.selectById(supervisionTempLineReportParam.getId());
|
||||
//判断是否有权限操作
|
||||
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(),supervisionTempLineReport.getCreateBy());
|
||||
InstanceUtil.judgeUserPower(RequestUtil.getUserIndex(), supervisionTempLineReport.getCreateBy());
|
||||
supervisionTempLineReportParam.setProcessInstanceId(supervisionTempLineReport.getProcessInstanceId());
|
||||
supervisionTempLineReportParam.setHistoryInstanceId(supervisionTempLineReport.getHistoryInstanceId());
|
||||
BeanUtils.copyProperties(supervisionTempLineReportParam,supervisionTempLineReport);
|
||||
BeanUtils.copyProperties(supervisionTempLineReportParam, supervisionTempLineReport);
|
||||
supervisionTempLineReport.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
supervisionTempLineReport.setState(DataStateEnum.ENABLE.getCode());
|
||||
//处理历史流程id列表
|
||||
String historyInstanceIds = InstanceUtil.dealHistoryId(supervisionTempLineReport.getProcessInstanceId(), supervisionTempLineReport.getHistoryInstanceId());
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.LINE_INFO_ADD.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(supervisionTempLineReport.getId());
|
||||
@@ -154,14 +143,14 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||
queryWrapper.in("supervision_temp_line_report.create_by", colleaguesIds)
|
||||
.eq("supervision_temp_line_report.state", DataStateEnum.ENABLE.getCode())
|
||||
.in(CollectionUtil.isNotEmpty(supervisionTempLineReportQuery.getStatueList()),"supervision_temp_line_report.status",supervisionTempLineReportQuery.getStatueList());
|
||||
.in(CollectionUtil.isNotEmpty(supervisionTempLineReportQuery.getStatueList()), "supervision_temp_line_report.status", supervisionTempLineReportQuery.getStatueList());
|
||||
if (StrUtil.isNotBlank(supervisionTempLineReportQuery.getOrgNo())) {
|
||||
/*获取直接下属子单位*/
|
||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineReportQuery.getOrgNo()).getData();
|
||||
queryWrapper.in("supervision_temp_line_report.org_id", data);
|
||||
}
|
||||
queryWrapper
|
||||
.and(CollUtil.isNotEmpty(InstanceUtil.filterTaskStatus()),w -> w.in("supervision_temp_line_report.status", InstanceUtil.filterTaskStatus())
|
||||
.and(CollUtil.isNotEmpty(InstanceUtil.filterTaskStatus()), w -> w.in("supervision_temp_line_report.status", InstanceUtil.filterTaskStatus())
|
||||
.or()
|
||||
.eq("supervision_temp_line_report.create_by", RequestUtil.getUserIndex())
|
||||
);
|
||||
@@ -170,7 +159,7 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
queryWrapper.eq("supervision_temp_line_report.status", supervisionTempLineReportQuery.getStatus());
|
||||
}
|
||||
if (StrUtil.isNotBlank(supervisionTempLineReportQuery.getSearchValue())) {
|
||||
queryWrapper.and(x->x
|
||||
queryWrapper.and(x -> x
|
||||
.like("supervision_temp_line_report.Power_Substation_Name", supervisionTempLineReportQuery.getSearchValue())
|
||||
.or()
|
||||
.like("supervision_temp_line_report.connected_bus", supervisionTempLineReportQuery.getSearchValue())
|
||||
@@ -185,15 +174,14 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
DateUtil.beginOfDay(DateUtil.parse(supervisionTempLineReportQuery.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(supervisionTempLineReportQuery.getSearchEndTime())));
|
||||
queryWrapper.orderByDesc("supervision_temp_line_report.Update_Time");
|
||||
Page<SupervisionTempLineReportVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(supervisionTempLineReportQuery), PageFactory.getPageSize(supervisionTempLineReportQuery)), queryWrapper);
|
||||
return page;
|
||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(supervisionTempLineReportQuery), PageFactory.getPageSize(supervisionTempLineReportQuery)), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateProcessStatus(String businessKey, Integer status) {
|
||||
this.lambdaUpdate().set(SupervisionTempLineReport::getStatus,status).eq(SupervisionTempLineReport::getId,businessKey).update();
|
||||
if(status.equals(BpmProcessInstanceStatusEnum.APPROVE.getStatus())){
|
||||
this.lambdaUpdate().set(SupervisionTempLineReport::getStatus, status).eq(SupervisionTempLineReport::getId, businessKey).update();
|
||||
if (status.equals(BpmProcessInstanceStatusEnum.APPROVE.getStatus())) {
|
||||
SupervisionTempLineReport byId = this.getById(businessKey);
|
||||
|
||||
userReportPOService.updateUserStatus(businessKey, SupervisionUserStatusEnum.BUILD.getCode());
|
||||
@@ -212,13 +200,13 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
public BpmInstanceInfo getInstanceInfo(String businessId) {
|
||||
BpmInstanceInfo bpmInstanceInfo = new BpmInstanceInfo();
|
||||
SupervisionTempLineReportVO supervisionTempLineReportVO = this.getDetailTempLine(businessId);
|
||||
if(ObjectUtil.isNotNull(supervisionTempLineReportVO)){
|
||||
if (ObjectUtil.isNotNull(supervisionTempLineReportVO)) {
|
||||
bpmInstanceInfo.setHistoryInstanceId(supervisionTempLineReportVO.getHistoryInstanceId());
|
||||
String powerSubstationName = supervisionTempLineReportVO.getPowerSubstationName();
|
||||
if(StrUtil.isNotBlank(powerSubstationName)){
|
||||
powerSubstationName.concat(StrPool.SLASH);
|
||||
}else{
|
||||
powerSubstationName="";
|
||||
if (StrUtil.isNotBlank(powerSubstationName)) {
|
||||
powerSubstationName = powerSubstationName.concat(StrPool.SLASH);
|
||||
} else {
|
||||
powerSubstationName = "";
|
||||
}
|
||||
String sign = powerSubstationName
|
||||
.concat(supervisionTempLineReportVO.getMonitoringTerminalName())
|
||||
@@ -262,21 +250,21 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
|
||||
@Override
|
||||
public SupervisionTempLineReportVO getDetailTempLine(String id) {
|
||||
SupervisionTempLineReportVO vo=null;
|
||||
SupervisionTempLineReportVO vo = null;
|
||||
SupervisionTempLineReport byId = this.getById(id);
|
||||
if(ObjectUtil.isNotNull(byId)){
|
||||
vo =new SupervisionTempLineReportVO();
|
||||
BeanUtils.copyProperties(byId,vo);
|
||||
if (ObjectUtil.isNotNull(byId)) {
|
||||
vo = new SupervisionTempLineReportVO();
|
||||
BeanUtils.copyProperties(byId, vo);
|
||||
//处理特殊字段,用户名、部门名
|
||||
UserVO userVO = userFeignClient.getUserById(vo.getCreateBy()).getData();
|
||||
vo.setReporter(userVO.getName());
|
||||
if(StringUtils.isNotEmpty(vo.getOrgId())){
|
||||
if (StringUtils.isNotEmpty(vo.getOrgId())) {
|
||||
vo.setOrgName(deptFeignClient.getDeptById(vo.getOrgId()).getData().getName());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(vo.getLoadType())){
|
||||
if (StringUtils.isNotEmpty(vo.getLoadType())) {
|
||||
vo.setLoadType(dictTreeFeignClient.queryById(vo.getLoadType()).getData().getName());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(vo.getBusinessType())){
|
||||
if (StringUtils.isNotEmpty(vo.getBusinessType())) {
|
||||
vo.setBusinessType(dictTreeFeignClient.queryById(vo.getBusinessType()).getData().getName());
|
||||
}
|
||||
}
|
||||
@@ -286,7 +274,7 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
@Override
|
||||
public Boolean deleteTempLineReport(List<String> supervisionId) {
|
||||
List<SupervisionTempLineReport> supervisionTempLineReports = this.listByIds(supervisionId);
|
||||
if(CollUtil.isEmpty(supervisionTempLineReports)){
|
||||
if (CollUtil.isEmpty(supervisionTempLineReports)) {
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
//判断是否有权限操作
|
||||
@@ -294,12 +282,12 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
long count = supervisionTempLineReports.stream().filter(x -> !BpmTaskStatusEnum.WAIT.getStatus().equals(x.getStatus())).count();
|
||||
InstanceUtil.deleteRole(RequestUtil.getUserIndex(), collect, count);
|
||||
return this.update(new LambdaUpdateWrapper<SupervisionTempLineReport>().set(SupervisionTempLineReport::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(SupervisionTempLineReport::getId, supervisionId));
|
||||
.in(SupervisionTempLineReport::getId, supervisionId));
|
||||
}
|
||||
|
||||
private void checkLineId(SupervisionTempLineReportParam supervisionTempLineReportParam, boolean isExcludeSelf) {
|
||||
//保存时不为空则不校验
|
||||
if(Objects.nonNull(supervisionTempLineReportParam.getNum())||Objects.nonNull(supervisionTempLineReportParam.getLineName())) {
|
||||
if (Objects.nonNull(supervisionTempLineReportParam.getNum()) || Objects.nonNull(supervisionTempLineReportParam.getLineName())) {
|
||||
LambdaQueryWrapper<SupervisionTempLineReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper
|
||||
.eq(SupervisionTempLineReport::getMonitoringTerminalCode, supervisionTempLineReportParam.getMonitoringTerminalCode())
|
||||
@@ -312,7 +300,7 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
if (isExcludeSelf) {
|
||||
if (supervisionTempLineReportParam instanceof SupervisionTempLineReportParam.SupervisionTempLineReportUpdate) {
|
||||
lambdaQueryWrapper.ne(SupervisionTempLineReport::getId, ((SupervisionTempLineReportParam.SupervisionTempLineReportUpdate) supervisionTempLineReportParam).getId());
|
||||
}else {
|
||||
} else {
|
||||
lambdaQueryWrapper.ne(SupervisionTempLineReport::getId, (supervisionTempLineReportParam).getId());
|
||||
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ import com.njcn.supervision.enums.SupervisionUserStatusEnum;
|
||||
import com.njcn.supervision.mapper.device.SupervisionTempLineReportMapper;
|
||||
import com.njcn.supervision.mapper.device.SupervisionTempLineRunTestMapper;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionTempLineRunTestParam;
|
||||
import com.njcn.supervision.pojo.po.device.CheckDevice;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTestPO;
|
||||
import com.njcn.supervision.pojo.po.device.TempLineRunTestWarning;
|
||||
@@ -259,11 +258,11 @@ public class SupervisionTempLineRunTestServiceImpl extends ServiceImpl<Supervisi
|
||||
po.setHistoryInstanceId(historyInstanceIds);
|
||||
}
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.LINE_RUN_TEST.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(supervisionTempLineRunTestPO.getId());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>(16));
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(supervisionTempLineRunTestPO.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||
po.setProcessInstanceId(processInstanceId);
|
||||
|
||||
@@ -7,9 +7,7 @@ import com.njcn.supervision.service.device.TempLineRunTestWarningService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author web2023
|
||||
* @description 针对表【supervision_temp_line_run_test_warning】的数据库操作Service实现
|
||||
* @createDate 2024-07-03 13:52:39
|
||||
* @author wr
|
||||
*/
|
||||
@Service
|
||||
public class TempLineRunTestWarningServiceImpl extends ServiceImpl<TempLineRunTestWarningMapper, TempLineRunTestWarning> implements TempLineRunTestWarningService {
|
||||
|
||||
@@ -5,26 +5,23 @@ import com.njcn.supervision.pojo.vo.gridDiagram.GridDiagramVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
*/
|
||||
public interface GridDiagramService {
|
||||
|
||||
/**
|
||||
* 技术监督首页数据展示
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
GridDiagramVO.Info getSupervisionData(StatisticsBizBaseParam param);
|
||||
|
||||
/**
|
||||
* 技术监督详细页面展示
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<GridDiagramVO.Info> getSupervisionDetailsData(StatisticsBizBaseParam param);
|
||||
|
||||
/**
|
||||
* 技术监督市级详细页面展示
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
GridDiagramVO.City getSupervisionCityDetailsData(StatisticsBizBaseParam param);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2024/6/13 14:53
|
||||
*/
|
||||
@Service
|
||||
@@ -137,7 +136,7 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
List<String> handleList = warn.stream().filter(x -> x.getStatus() == 2).map(WarningLeaflet::getId).collect(Collectors.toList());
|
||||
warnVo.setWorkNum(warn.size());
|
||||
warnVo.setProcessedNum(handleList.size());
|
||||
warnVo.setDisposalNum(warn.size() == 0 ? 0.0f : NumberUtil.round(handleList.size() * 100.0 / warn.size(), 2).floatValue());
|
||||
warnVo.setDisposalNum(warn.isEmpty() ? 0.0f : NumberUtil.round(handleList.size() * 100.0 / warn.size(), 2).floatValue());
|
||||
|
||||
//用户投诉问题(添加出来就是有问题的)
|
||||
GridDiagramVO userVo=new GridDiagramVO();
|
||||
@@ -149,7 +148,7 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
List<String> userHandleList = user.stream().filter(x -> x.getStatus() == 2).map(WarningLeaflet::getId).collect(Collectors.toList());
|
||||
userVo.setWorkNum(user.size());
|
||||
userVo.setProcessedNum(userHandleList.size());
|
||||
userVo.setDisposalNum(user.size() == 0 ? 0.0f : NumberUtil.round(userHandleList.size() * 100.0 / user.size(), 2).floatValue());
|
||||
userVo.setDisposalNum(user.isEmpty() ? 0.0f : NumberUtil.round(userHandleList.size() * 100.0 / user.size(), 2).floatValue());
|
||||
|
||||
//计划问题(有问题的单子)
|
||||
GridDiagramVO surveyVo=new GridDiagramVO();
|
||||
@@ -161,7 +160,7 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
List<String> surveyHandleList = survey.stream().filter(x -> x.getStatus() == 2).map(WarningLeaflet::getId).collect(Collectors.toList());
|
||||
surveyVo.setWorkNum(survey.size());
|
||||
surveyVo.setProcessedNum(surveyHandleList.size());
|
||||
surveyVo.setDisposalNum(survey.size() == 0 ? 0.0f : NumberUtil.round(surveyHandleList.size() * 100.0 / survey.size(), 2).floatValue());
|
||||
surveyVo.setDisposalNum(survey.isEmpty() ? 0.0f : NumberUtil.round(surveyHandleList.size() * 100.0 / survey.size(), 2).floatValue());
|
||||
|
||||
//试运行监测点问题
|
||||
GridDiagramVO trialRunVo=new GridDiagramVO();
|
||||
@@ -172,7 +171,7 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
List<String> trialRunHandleList = trialRun.stream().filter(x -> x.getStatus() == 2).map(WarningLeaflet::getId).collect(Collectors.toList());
|
||||
trialRunVo.setWorkNum(trialRun.size());
|
||||
trialRunVo.setProcessedNum(trialRunHandleList.size());
|
||||
trialRunVo.setDisposalNum(trialRun.size() == 0 ? 0.0f : NumberUtil.round(trialRunHandleList.size() * 100.0 / trialRun.size(), 2).floatValue());
|
||||
trialRunVo.setDisposalNum(trialRun.isEmpty() ? 0.0f : NumberUtil.round(trialRunHandleList.size() * 100.0 / trialRun.size(), 2).floatValue());
|
||||
|
||||
City.setOnLine(warnVo);
|
||||
City.setUser(userVo);
|
||||
@@ -185,7 +184,6 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
* @param deptDTO 子集部门
|
||||
* @param ids 子集下所有部门信息
|
||||
* @param baseParam 查询条件
|
||||
* @return
|
||||
*/
|
||||
private GridDiagramVO.Info supervisionDetailsAdd(DeptDTO deptDTO, List<String> ids, StatisticsBizBaseParam baseParam) {
|
||||
GridDiagramVO.Info gridDiagramVO = new GridDiagramVO.Info();
|
||||
@@ -242,7 +240,7 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
List<String> handleList = list.stream().filter(x -> x.getStatus() == 2).map(WarningLeaflet::getId).collect(Collectors.toList());
|
||||
gridDiagramVO.setWorkNum(list.size());
|
||||
gridDiagramVO.setProcessedNum(handleList.size());
|
||||
gridDiagramVO.setDisposalNum(list.size() == 0 ? 0.0f : NumberUtil.round(handleList.size() * 100.0 / list.size(), 2).floatValue());
|
||||
gridDiagramVO.setDisposalNum(list.isEmpty() ? 0.0f : NumberUtil.round(handleList.size() * 100.0 / list.size(), 2).floatValue());
|
||||
|
||||
} else {
|
||||
gridDiagramVO.setAssociatedNum(0);
|
||||
|
||||
@@ -15,14 +15,11 @@ public interface ILineRunTestProblemService{
|
||||
|
||||
/**
|
||||
* 查询审核不通过,试运行列表。来表示电能问题
|
||||
* @param supervisionTempLineDebugQuery
|
||||
* @return
|
||||
*/
|
||||
Page<SupervisionTempLineDebugVO> pageProblem(SupervisionTempLineDebugParam.SupervisionTempLineDebugQuery supervisionTempLineDebugQuery);
|
||||
|
||||
/**
|
||||
* 发起告警单
|
||||
* @param warningAddParam
|
||||
*/
|
||||
void initiateWarningLeaflet(WarningAddParam.Extend warningAddParam);
|
||||
}
|
||||
|
||||
@@ -52,8 +52,6 @@ public interface IWarningLeafletService extends IBpmService<WarningLeaflet> {
|
||||
|
||||
/**
|
||||
* 查询告警单信息,包含预警单和告警单
|
||||
* @param warningLeafletQueryParam
|
||||
* @return
|
||||
*/
|
||||
Page<WarningLeafletVO> allPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam);
|
||||
|
||||
|
||||
@@ -60,8 +60,7 @@ public class LineRunTestProblemServiceImpl implements ILineRunTestProblemService
|
||||
DateUtil.beginOfDay(DateUtil.parse(supervisionTempLineDebugQuery.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(supervisionTempLineDebugQuery.getSearchEndTime())));
|
||||
queryWrapper.orderByDesc("supervision_temp_line_run_test_warning.create_time");
|
||||
Page<SupervisionTempLineDebugVO> page = lineDebugPOMapper.pageProblem(new Page<>(PageFactory.getPageNum(supervisionTempLineDebugQuery), PageFactory.getPageSize(supervisionTempLineDebugQuery)), queryWrapper);
|
||||
return page;
|
||||
return lineDebugPOMapper.pageProblem(new Page<>(PageFactory.getPageNum(supervisionTempLineDebugQuery), PageFactory.getPageSize(supervisionTempLineDebugQuery)), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,7 +93,7 @@ public class LineRunTestProblemServiceImpl implements ILineRunTestProblemService
|
||||
}
|
||||
|
||||
private String assembleWarningDetail(SupervisionTempLineRunTestVO byId) {
|
||||
String issueDetail = byId.getPowerSubstationName()
|
||||
return byId.getPowerSubstationName()
|
||||
.concat("_")
|
||||
.concat(byId.getMonitoringTerminalName())
|
||||
.concat("_")
|
||||
@@ -102,6 +101,5 @@ public class LineRunTestProblemServiceImpl implements ILineRunTestProblemService
|
||||
.concat("_")
|
||||
.concat(byId.getLineName())
|
||||
.concat("试运行评估问题");
|
||||
return issueDetail;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet;
|
||||
import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO;
|
||||
import com.njcn.supervision.service.device.TempLineRunTestWarningService;
|
||||
import com.njcn.supervision.service.leaflet.IWarningLeafletService;
|
||||
import com.njcn.supervision.service.survey.ISurveyTestService;
|
||||
import com.njcn.supervision.utils.InstanceUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
@@ -43,7 +42,6 @@ import com.njcn.user.pojo.vo.UserVO;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -69,9 +67,6 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
@Resource
|
||||
private BpmProcessFeignClient bpmProcessFeignClient;
|
||||
|
||||
@Resource
|
||||
private ISurveyTestService surveyTestService;
|
||||
|
||||
@Resource
|
||||
private DeptFeignClient deptFeignClient;
|
||||
|
||||
@@ -133,7 +128,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
if (CollUtil.isNotEmpty(deptIds)) {
|
||||
List<Dept> data = deptFeignClient.getDeptInfoListByIds(deptIds).getData();
|
||||
Map<String, String> deptMap = data.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
|
||||
warningLeafletVOPage.getRecords().stream().forEach(x -> {
|
||||
warningLeafletVOPage.getRecords().forEach(x -> {
|
||||
if (deptMap.containsKey(x.getDutyOrgId())) {
|
||||
x.setDutyOrgName(deptMap.get(x.getDutyOrgId()));
|
||||
}
|
||||
@@ -162,7 +157,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
}
|
||||
if (Objects.equals(warningLeafletUpdateParam.getSaveOrCheckflag(), "2")) {
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.WARN_LEAFLET.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(warningLeaflet.getId());
|
||||
@@ -191,7 +186,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
warningLeaflet.setState(DataStateEnum.ENABLE.getCode());
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.WARN_LEAFLET.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(warningLeaflet.getId());
|
||||
@@ -286,11 +281,11 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
}
|
||||
warningLeafletVOQueryWrapper
|
||||
.and(w -> w.in("supervision_warning_leaflet.status", Arrays.asList(BpmTaskStatusEnum.RUNNING.getStatus(),
|
||||
BpmTaskStatusEnum.APPROVE.getStatus(),
|
||||
BpmTaskStatusEnum.RETURN.getStatus()
|
||||
BpmTaskStatusEnum.APPROVE.getStatus(),
|
||||
BpmTaskStatusEnum.RETURN.getStatus()
|
||||
))
|
||||
.or()
|
||||
.eq("supervision_warning_leaflet.dept_id", RequestUtil.getDeptIndex())
|
||||
.or()
|
||||
.eq("supervision_warning_leaflet.dept_id", RequestUtil.getDeptIndex())
|
||||
);
|
||||
//筛选负责单位
|
||||
if (StrUtil.isNotBlank(warningLeafletQueryParam.getDeptIndex())) {
|
||||
@@ -307,7 +302,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
List<WarningLeafletVO> records = warningLeafletVOPage.getRecords();
|
||||
if (CollectionUtil.isNotEmpty(records)) {
|
||||
List<String> deptIds = records.stream().distinct().map(WarningLeafletVO::getDutyOrgId).collect(Collectors.toList());
|
||||
Map<String, String> deptMap = new HashMap<>();
|
||||
Map<String, String> deptMap = new HashMap<>(16);
|
||||
if (CollUtil.isNotEmpty(deptIds)) {
|
||||
List<Dept> data = deptFeignClient.getDeptInfoListByIds(deptIds).getData();
|
||||
deptMap.putAll(data.stream().collect(Collectors.toMap(Dept::getId, Dept::getName)));
|
||||
@@ -391,7 +386,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
List<WarningLeafletVO> records = warningLeafletVOPage.getRecords();
|
||||
if (CollectionUtil.isNotEmpty(records)) {
|
||||
List<String> deptIds = records.stream().distinct().map(WarningLeafletVO::getDutyOrgId).collect(Collectors.toList());
|
||||
Map<String, String> deptMap = new HashMap<>();
|
||||
Map<String, String> deptMap = new HashMap<>(16);
|
||||
if (CollUtil.isNotEmpty(deptIds)) {
|
||||
List<Dept> data = deptFeignClient.getDeptInfoListByIds(deptIds).getData();
|
||||
deptMap.putAll(data.stream().collect(Collectors.toMap(Dept::getId, Dept::getName)));
|
||||
@@ -418,7 +413,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
@Override
|
||||
public Boolean deleteWarningLeaflet(List<String> supervisionId) {
|
||||
List<WarningLeaflet> warningLeaflets = this.listByIds(supervisionId);
|
||||
if(CollUtil.isEmpty(warningLeaflets)){
|
||||
if (CollUtil.isEmpty(warningLeaflets)) {
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
//判断是否有权限操作
|
||||
@@ -434,12 +429,12 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
List<TodoVO> todoVOList = new ArrayList<>();
|
||||
//如果用户为管理员则不查
|
||||
UserVO userVO = userFeignClient.getUserById(RequestUtil.getUserIndex()).getData();
|
||||
if(Objects.nonNull(userVO) && userVO.getType() == 1){
|
||||
if (Objects.nonNull(userVO) && userVO.getType() == 1) {
|
||||
return todoVOList;
|
||||
}
|
||||
QueryWrapper<WarningLeafletVO> queryWrapper = new QueryWrapper<>();
|
||||
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(RequestUtil.getDeptIndex()).getData();
|
||||
if(CollectionUtil.isEmpty(deptIds)){
|
||||
if (CollectionUtil.isEmpty(deptIds)) {
|
||||
return todoVOList;
|
||||
}
|
||||
queryWrapper.in("supervision_warning_leaflet.dept_id", deptIds)
|
||||
@@ -447,12 +442,12 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
.eq("supervision_warning_leaflet.state", DataStateEnum.ENABLE.getCode())
|
||||
.orderByDesc("supervision_warning_leaflet.Update_Time");
|
||||
List<WarningLeafletVO> warningLeafletVOList = this.baseMapper.getTodoBusiness(queryWrapper);
|
||||
if(CollectionUtil.isNotEmpty(warningLeafletVOList)){
|
||||
if (CollectionUtil.isNotEmpty(warningLeafletVOList)) {
|
||||
todoVOList = warningLeafletVOList.stream().map(item -> {
|
||||
TodoVO todoVO = new TodoVO();
|
||||
String title = "预警单";
|
||||
Integer tabValue = 3;
|
||||
if(item.getLeafletType()==2){
|
||||
int tabValue = 3;
|
||||
if (item.getLeafletType() == 2) {
|
||||
title = "告警单";
|
||||
tabValue = 4;
|
||||
}
|
||||
@@ -473,7 +468,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
|
||||
|
||||
private String assembleOverLimitInfo(RMpPartHarmonicDetailDTO rMpPartHarmonicDetailDTO) {
|
||||
String info = "";
|
||||
String info;
|
||||
String leafletType = Objects.equals(rMpPartHarmonicDetailDTO.getAlarmFlag(), 1) ? "告警单" : "预警单";
|
||||
/*获取稳态统计指标*/
|
||||
List<DictData> steadyStatis = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INDICATOR_TYPE.getCode()).getData();
|
||||
|
||||
@@ -20,16 +20,14 @@ import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.supervision.enums.SupervisionKeyEnum;
|
||||
import com.njcn.supervision.mapper.plan.SupervisionPlanPOMapper;
|
||||
import com.njcn.supervision.pojo.param.plan.SupervisionPlanParam;
|
||||
import com.njcn.supervision.pojo.po.device.CheckDevice;
|
||||
import com.njcn.supervision.pojo.po.plan.SupervisionPlanPO;
|
||||
import com.njcn.supervision.pojo.po.plan.SupervisionProblemPO;
|
||||
import com.njcn.supervision.pojo.vo.plan.SupervisionPlanVO;
|
||||
import com.njcn.supervision.service.leaflet.IWarningLeafletService;
|
||||
import com.njcn.supervision.service.plan.SupervisionPlanPOService;
|
||||
import com.njcn.supervision.service.plan.SupervisionProblemPOService;
|
||||
import com.njcn.supervision.utils.InstanceUtil;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
@@ -62,8 +60,6 @@ public class SupervisionPlanPOServiceImpl extends ServiceImpl<SupervisionPlanPOM
|
||||
private final UserFeignClient userFeignClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||
private final SupervisionProblemPOService supervisionProblemPOService;
|
||||
private final IWarningLeafletService warningLeafletService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -171,11 +167,11 @@ public class SupervisionPlanPOServiceImpl extends ServiceImpl<SupervisionPlanPOM
|
||||
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SUP_PLAN_ADD.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(supervisionPlanPO.getPlanId());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>(16));
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(supervisionPlanPO.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||
// 将工作流的编号,更新到流程单中
|
||||
@@ -199,7 +195,7 @@ public class SupervisionPlanPOServiceImpl extends ServiceImpl<SupervisionPlanPOM
|
||||
}
|
||||
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getSortBy())){
|
||||
if(supvPlanParam.getOrderBy().equals("desc")){
|
||||
if(DbConstant.DESC.equals(supvPlanParam.getOrderBy())){
|
||||
lambdaQueryWrapper.orderByDesc(SupervisionPlanPO::getPlanSupvDate);
|
||||
}else {
|
||||
lambdaQueryWrapper.orderByAsc(SupervisionPlanPO::getPlanSupvDate);
|
||||
@@ -224,7 +220,7 @@ public class SupervisionPlanPOServiceImpl extends ServiceImpl<SupervisionPlanPOM
|
||||
List<SupervisionPlanVO> supvPlanVOList = BeanUtil.copyToList(page.getRecords(), SupervisionPlanVO.class);
|
||||
List<String> userIds = supvPlanVOList.stream().map(SupervisionPlanVO::getPlanUserId).distinct().collect(Collectors.toList());
|
||||
supvPlanVOList.forEach(item -> {
|
||||
PvTerminalTreeVO pvTerminalTreeVO = null;
|
||||
PvTerminalTreeVO pvTerminalTreeVO ;
|
||||
if (mapList.containsKey(item.getSupvOrgId())) {
|
||||
pvTerminalTreeVO = mapList.get(item.getSupvOrgId());
|
||||
item.setSupvOrgName(pvTerminalTreeVO.getName());
|
||||
@@ -294,11 +290,11 @@ public class SupervisionPlanPOServiceImpl extends ServiceImpl<SupervisionPlanPOM
|
||||
// throw new BusinessException("请填写完实施问题提交审核");
|
||||
// }
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SUP_PLAN_ADD.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(id);
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<String, List<String>> ());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<> (16));
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(byId.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||
// 将工作流的编号,更新到流程单中
|
||||
@@ -316,7 +312,7 @@ public class SupervisionPlanPOServiceImpl extends ServiceImpl<SupervisionPlanPOM
|
||||
BeanUtils.copyProperties(byId,supervisionPlanVO);
|
||||
|
||||
if (mapList.containsKey(supervisionPlanVO.getSupvOrgId())) {
|
||||
PvTerminalTreeVO pvTerminalTreeVO = null;
|
||||
PvTerminalTreeVO pvTerminalTreeVO ;
|
||||
|
||||
pvTerminalTreeVO = mapList.get(supervisionPlanVO.getSupvOrgId());
|
||||
supervisionPlanVO.setSupvOrgName(pvTerminalTreeVO.getName());
|
||||
@@ -446,8 +442,8 @@ public class SupervisionPlanPOServiceImpl extends ServiceImpl<SupervisionPlanPOM
|
||||
* 格式:planCreateTime发起的planName普测计划,由负责人leader测试后,于planComplateTime完成,其中subName在本次普测计划测试中存在电能质量问题,详细请查看附件
|
||||
*/
|
||||
private String assembleIssueDetail(List<SupervisionProblemPO> supervisionProblemPOList, SupervisionPlanPO supervisionPlanPO) {
|
||||
String join = String.join(",", supervisionProblemPOList.stream().map(SupervisionProblemPO::getRemark).collect(Collectors.toList()));
|
||||
String issueDetail = "于"
|
||||
String join = supervisionProblemPOList.stream().map(SupervisionProblemPO::getRemark).collect(Collectors.joining(","));
|
||||
return "于"
|
||||
.concat(LocalDateTimeUtil.format(supervisionPlanPO.getCreateTime(), DatePattern.CHINESE_DATE_PATTERN))
|
||||
.concat("发起的")
|
||||
.concat(supervisionPlanPO.getWorkPlanName())
|
||||
@@ -458,7 +454,6 @@ public class SupervisionPlanPOServiceImpl extends ServiceImpl<SupervisionPlanPOM
|
||||
.concat("完成,其中存在问题")
|
||||
.concat(join)
|
||||
.concat("在本次技术监督计划测试中存在电能质量问题,详细请查看问题附件");
|
||||
return issueDetail;
|
||||
}
|
||||
|
||||
|
||||
@@ -517,7 +512,7 @@ public class SupervisionPlanPOServiceImpl extends ServiceImpl<SupervisionPlanPOM
|
||||
DateTime effectStartTime = DateUtil.parse(supvPlanParam.getEffectStartTime(), "yyyy-MM-dd HH:mm:ss");
|
||||
//问题发现时间
|
||||
DateTime problemOcTime = DateUtil.parse(problemOcTime1, "yyyy-MM-dd HH:mm:ss");
|
||||
Boolean fly = false;
|
||||
boolean fly = false;
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getEffectEndTime())){
|
||||
//实施结束时间
|
||||
DateTime effectEndTime = DateUtil.parse(supvPlanParam.getEffectEndTime(), "yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@@ -17,8 +17,6 @@ import com.njcn.supervision.pojo.param.plan.SupervisopnProblemParam;
|
||||
import com.njcn.supervision.pojo.po.plan.SupervisionPlanPO;
|
||||
import com.njcn.supervision.pojo.po.plan.SupervisionProblemPO;
|
||||
import com.njcn.supervision.service.plan.SupervisionProblemPOService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
@@ -44,7 +42,6 @@ public class SupervisionProblemPOServiceImpl extends ServiceImpl<SupervisionProb
|
||||
|
||||
|
||||
private final SupervisionPlanPOMapper supervisionPlanPOMapper;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
@@ -63,7 +60,7 @@ public class SupervisionProblemPOServiceImpl extends ServiceImpl<SupervisionProb
|
||||
|
||||
@Override
|
||||
public Page<SupervisionProblemPO> pageProblem(SupervisopnProblemParam supvProblemParam) {
|
||||
DictData stamped_report = dicDataFeignClient.getDicDataByCode("Stamped_Report").getData();
|
||||
|
||||
|
||||
LambdaQueryWrapper<SupervisionProblemPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SupervisionProblemPO::getPlanId, supvProblemParam.getPlanId());
|
||||
@@ -77,6 +74,7 @@ public class SupervisionProblemPOServiceImpl extends ServiceImpl<SupervisionProb
|
||||
item.setDutyOrgName(mapCode.get(item.getDutyOrgId()).getName());
|
||||
}
|
||||
|
||||
// DictData stamped_report = dicDataFeignClient.getDicDataByCode("Stamped_Report").getData();
|
||||
// List<SupvFile> supvFileList = supvFileMapper.selectList(new LambdaQueryWrapper<SupvFile>().eq(SupvFile::getBusiId, item.getProblemId()).eq(SupvFile::getType, 1));
|
||||
// if (CollUtil.isNotEmpty(supvFileList)) {
|
||||
// for(SupvFile supvFile:supvFileList){
|
||||
@@ -93,7 +91,9 @@ public class SupervisionProblemPOServiceImpl extends ServiceImpl<SupervisionProb
|
||||
return page;
|
||||
}
|
||||
|
||||
//判断是否存在时间范围内
|
||||
/**
|
||||
* 判断是否存在时间范围内
|
||||
*/
|
||||
public void checkParam(String id, String time) {
|
||||
if (StrUtil.isNotBlank(time)) {
|
||||
SupervisionPlanPO supvPlan = supervisionPlanPOMapper.selectById(id);
|
||||
@@ -106,7 +106,7 @@ public class SupervisionProblemPOServiceImpl extends ServiceImpl<SupervisionProb
|
||||
DateTime effectStartTime = DateUtil.parse(DateUtil.formatLocalDateTime(supvPlan.getEffectStartTime()), "yyyy-MM-dd HH:mm:ss");
|
||||
//问题发现时间
|
||||
DateTime problemOcTime = DateUtil.parse(time, "yyyy-MM-dd HH:mm:ss");
|
||||
Boolean fly = false;
|
||||
boolean fly = false;
|
||||
if (ObjectUtil.isNotNull(supvPlan.getEffectEndTime())) {
|
||||
//实施结束时间
|
||||
DateTime effectEndTime = DateUtil.parse(DateUtil.formatLocalDateTime(supvPlan.getEffectEndTime()), "yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@@ -2,9 +2,7 @@ package com.njcn.supervision.service.problem.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
@@ -83,7 +81,7 @@ public class SupervisionUserComplaintPOServiceImpl extends ServiceImpl<Supervisi
|
||||
if (CollUtil.isNotEmpty(deptIds)) {
|
||||
List<Dept> data = deptFeignClient.getDeptInfoListByIds(deptIds).getData();
|
||||
Map<String, String> deptMap = data.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
|
||||
page.getRecords().stream().forEach(x -> {
|
||||
page.getRecords().forEach(x -> {
|
||||
if (deptMap.containsKey(x.getDutyOrgId())) {
|
||||
x.setDutyOrgName(deptMap.get(x.getDutyOrgId()));
|
||||
}
|
||||
@@ -97,8 +95,6 @@ public class SupervisionUserComplaintPOServiceImpl extends ServiceImpl<Supervisi
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void initiateWarningLeaflet(WarningAddParam warningAddParam) {
|
||||
SupervisionUserComplaintPO supervisionUserComplaintPO = this.getById(warningAddParam.getId());
|
||||
//组装告警单
|
||||
String complainteDetail = assembleComplainteDetail(supervisionUserComplaintPO);
|
||||
/*
|
||||
* 1、预告警单名称,此处暂时用用户名+投诉
|
||||
* 2、预告警编号暂时随机by yxb
|
||||
@@ -121,16 +117,4 @@ public class SupervisionUserComplaintPOServiceImpl extends ServiceImpl<Supervisi
|
||||
this.lambdaUpdate().eq(SupervisionUserComplaintPO::getId,warningAddParam.getId()).set(SupervisionUserComplaintPO::getInitiateWarningFlag,1).update();
|
||||
}
|
||||
|
||||
private String assembleComplainteDetail(SupervisionUserComplaintPO byId) {
|
||||
String issueDetail = "于"
|
||||
.concat(LocalDateTimeUtil.format(byId.getCreateTime(), DatePattern.CHINESE_DATE_PATTERN))
|
||||
.concat(",用户")
|
||||
.concat(byId.getUserName())
|
||||
.concat("发起的用户投诉")
|
||||
.concat("投诉内容")
|
||||
.concat(byId.getComplaintText())
|
||||
;
|
||||
return issueDetail;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,11 +2,10 @@ package com.njcn.supervision.service.survey;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanDetailPO;
|
||||
/**
|
||||
*
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/5/13 18:35【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
|
||||
@@ -26,9 +26,6 @@ import com.njcn.supervision.enums.SupervisionKeyEnum;
|
||||
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||
import com.njcn.supervision.mapper.survey.SurveyPlanMapper;
|
||||
import com.njcn.supervision.pojo.param.survey.SurveyPlanParam;
|
||||
import com.njcn.supervision.pojo.po.device.CheckDevice;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTestPO;
|
||||
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
||||
import com.njcn.supervision.pojo.po.survey.SurveyTest;
|
||||
import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO;
|
||||
@@ -39,7 +36,6 @@ import com.njcn.supervision.utils.InstanceUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -62,8 +58,6 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyPlan> implements ISurveyPlanService {
|
||||
|
||||
@Resource
|
||||
private UserFeignClient userFeignClient;
|
||||
|
||||
@Resource
|
||||
private BpmProcessFeignClient bpmProcessFeignClient;
|
||||
@@ -163,11 +157,11 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
||||
|
||||
// 发起 BPM 流程
|
||||
if(Objects.equals(surveyPlanParam.getSaveOrCheckflag(),"2")){
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SURVEY_PLAN.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyPlan.getId());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>(16));
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(surveyPlan.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||
// 将工作流的编号,更新到流程单中
|
||||
@@ -192,11 +186,11 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
||||
//处理历史流程id列表
|
||||
String historyInstanceIds = InstanceUtil.dealHistoryId(surveyPlan.getProcessInstanceId(), surveyPlan.getHistoryInstanceId());
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SURVEY_PLAN.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyPlan.getId());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>());
|
||||
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>(16));
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(surveyPlan.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||
// 将工作流的编号,更新到流程单中
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.njcn.supervision.service.survey.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
@@ -317,16 +316,6 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
|
||||
if(Objects.nonNull(data)){
|
||||
name = data.getName();
|
||||
}
|
||||
// String sign = name.concat("由")
|
||||
// .concat(surveyTestVO.getDeptName())
|
||||
// .concat("负责")
|
||||
// .concat(surveyTestVO.getPlanName())
|
||||
// .concat(",由")
|
||||
// .concat(surveyTestVO.getCompleteBy())
|
||||
// .concat(",在")
|
||||
// .concat(LocalDateTimeUtil.format(surveyTestVO.getCompleteTime(),DatePattern.CHINESE_DATE_PATTERN))
|
||||
// .concat("完成计划测试。")
|
||||
// ;
|
||||
String sign = name.concat("->")
|
||||
.concat(surveyTestVO.getSupvObjectName());
|
||||
bpmInstanceInfo.setInstanceSign(sign);
|
||||
|
||||
@@ -17,15 +17,11 @@ public interface IUserReportDeleteService extends IBpmService<UserReportPO> {
|
||||
|
||||
/**
|
||||
* 干扰源用户管理信息删除功能
|
||||
* @param userReportParam
|
||||
* @return
|
||||
*/
|
||||
String addEditor(UserReportParam userReportParam);
|
||||
|
||||
/**
|
||||
* 干扰源用户管理删除重新发送功能
|
||||
* @param userReportParam
|
||||
* @return
|
||||
*/
|
||||
String resend(UserReportParam userReportParam);
|
||||
}
|
||||
|
||||
@@ -18,29 +18,21 @@ public interface IUserReportRenewalService extends IBpmService<UserReportRenewal
|
||||
|
||||
/**
|
||||
* 干扰源用户管理更新后信息查看
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
UserReportRenewalPO getUserReportUpdateById(String id);
|
||||
|
||||
/**
|
||||
* 干扰源用户管理更新信息新增功能
|
||||
* @param userReportParam
|
||||
* @return
|
||||
*/
|
||||
String addEditor(UserReportParam userReportParam);
|
||||
|
||||
/**
|
||||
* 干扰源用户管理更新信息重新发送功能
|
||||
* @param userReportParam
|
||||
* @return
|
||||
*/
|
||||
String resend(UserReportParam userReportParam);
|
||||
|
||||
/**
|
||||
* 取消功能
|
||||
* @param cancelReqVO
|
||||
* @return
|
||||
*/
|
||||
String cancelUserReportRenewal(BpmProcessInstanceCancelParam cancelReqVO);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.njcn.bpm.pojo.dto.BpmInstanceInfo;
|
||||
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pq.api.TerminalBaseClient;
|
||||
import com.njcn.supervision.enums.SupervisionKeyEnum;
|
||||
import com.njcn.supervision.mapper.user.UserReportPOMapper;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
@@ -49,19 +48,18 @@ public class UserReportDeleteServiceImpl extends ServiceImpl<UserReportPOMapper,
|
||||
private final UserReportSubstationPOService userReportSubstationPOService;
|
||||
private final UserReportSensitivePOService userReportSensitivePOService;
|
||||
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||
private final TerminalBaseClient translateClient;
|
||||
private final SupervisionTempLineReportService lineReportService;
|
||||
private final SupervisionTempLineDebugPOService lineDebugService;
|
||||
private final ISupervisionTempLineRunTestService lineRunTestService;
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateProcessStatus(String businessId, Integer status) {
|
||||
if (status == BpmTaskStatusEnum.RUNNING.getStatus()) {
|
||||
/**
|
||||
if (Objects.equals(status, BpmTaskStatusEnum.RUNNING.getStatus())) {
|
||||
|
||||
/*
|
||||
* 1。删除常态化用户所有信息()
|
||||
* 2.删除绑定监测点信息(根据常态化用户信息找到监测点)
|
||||
* 3.删除试运行信息,
|
||||
*
|
||||
*/
|
||||
//电网工程类用户额外数据
|
||||
userReportProjectPOService.update(new LambdaUpdateWrapper<UserReportProjectPO>()
|
||||
@@ -133,7 +131,7 @@ public class UserReportDeleteServiceImpl extends ServiceImpl<UserReportPOMapper,
|
||||
//处理历史流程id列表
|
||||
String historyInstanceIds = InstanceUtil.dealHistoryId(po.getProcessInstanceId(), po.getHistoryInstanceId());
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.USER_REPORT_DELETE.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(userReportParam.getId());
|
||||
@@ -166,7 +164,7 @@ public class UserReportDeleteServiceImpl extends ServiceImpl<UserReportPOMapper,
|
||||
//处理历史流程id列表
|
||||
String historyInstanceIds = InstanceUtil.dealHistoryId(po.getProcessInstanceId(), po.getHistoryInstanceId());
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.USER_REPORT_DELETE.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(userReportParam.getId());
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.njcn.supervision.enums.SupervisionKeyEnum;
|
||||
import com.njcn.supervision.enums.UserNatureEnum;
|
||||
import com.njcn.supervision.mapper.user.UserReportNormalMapper;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportNormalParam;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||
import com.njcn.supervision.pojo.po.user.*;
|
||||
import com.njcn.supervision.pojo.vo.user.UserReportVO;
|
||||
import com.njcn.supervision.service.user.*;
|
||||
@@ -78,7 +77,7 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
|
||||
userReportNormalPO = this.getById(userReportNormalPO.getId());
|
||||
if (Objects.equals(userReportNormalParam.getSaveOrCheckflag(), "2")) {
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
if (0 == userReportNormalParam.getType()) {
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.USER_GO_NET.getKey());
|
||||
@@ -108,7 +107,7 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
|
||||
userReportNormalPO.setState(DataStateEnum.ENABLE.getCode());
|
||||
userReportNormalPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
if (userReportNormalPO.getType() == 0) {
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.USER_GO_NET.getKey());
|
||||
@@ -277,8 +276,8 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
|
||||
);
|
||||
Optional<String> netInReport = list.stream().filter(x -> 0 == x.getType()).map(UserReportNormalPO::getReportUrl).findFirst();
|
||||
Optional<String> governReport = list.stream().filter(x -> 1 == x.getType()).map(UserReportNormalPO::getReportUrl).findFirst();
|
||||
userReportVO.setNetInReport(Arrays.asList(netInReport.isPresent() ? netInReport.get() : null));
|
||||
userReportVO.setGovernReport(Arrays.asList(governReport.isPresent() ? governReport.get() : null));
|
||||
userReportVO.setNetInReport(Collections.singletonList(netInReport.orElse(null)));
|
||||
userReportVO.setGovernReport(Collections.singletonList(governReport.orElse(null)));
|
||||
return userReportVO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.bpm.api.BpmProcessFeignClient;
|
||||
import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum;
|
||||
import com.njcn.bpm.enums.BpmResponseEnum;
|
||||
import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||
import com.njcn.bpm.pojo.dto.BpmInstanceInfo;
|
||||
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||
@@ -40,7 +39,6 @@ import com.njcn.supervision.mapper.user.UserReportPOMapper;
|
||||
import com.njcn.supervision.pojo.dto.SensitiveReportExcel;
|
||||
import com.njcn.supervision.pojo.dto.SensitiveUserSExcel;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
import com.njcn.supervision.pojo.po.device.CheckDevice;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||
import com.njcn.supervision.pojo.po.user.*;
|
||||
import com.njcn.supervision.pojo.vo.user.UserReportVO;
|
||||
@@ -105,11 +103,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
BeanUtils.copyProperties(userReportParam, userReportPO);
|
||||
userReportPO.setState(DataStateEnum.ENABLE.getCode());
|
||||
if (Objects.equals(userReportParam.getSaveOrCheckflag(), "2")) {
|
||||
if (StringUtils.isEmpty(userReportParam.getId())) {
|
||||
checkProjectName(userReportParam, false);
|
||||
} else {
|
||||
checkProjectName(userReportParam, true);
|
||||
}
|
||||
checkProjectName(userReportParam, !StringUtils.isEmpty(userReportParam.getId()));
|
||||
}
|
||||
//判断工程名称是否有重复的
|
||||
if (Objects.equals(userReportParam.getSaveOrCheckflag(), "1")) {
|
||||
@@ -164,7 +158,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
|
||||
// 如何未提交审则不需要发起 BPM 流程
|
||||
if (Objects.equals(userReportParam.getSaveOrCheckflag(), "2")) {
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
//干扰源用户台账和敏感用户审核流程
|
||||
if (ObjectUtil.isNotNull(userReportParam.getDataType())) {
|
||||
@@ -232,7 +226,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
String key = SupervisionKeyEnum.BUILD_USER_INFO.getKey();
|
||||
if(ObjectUtil.isNotNull(userReportPO.getDataType())){
|
||||
@@ -403,8 +397,8 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
);
|
||||
Optional<String> netInReport = list.stream().filter(x -> 0 == x.getType()).map(UserReportNormalPO::getReportUrl).findFirst();
|
||||
Optional<String> governReport = list.stream().filter(x -> 1 == x.getType()).map(UserReportNormalPO::getReportUrl).findFirst();
|
||||
userReportVO.setNetInReport(Arrays.asList(netInReport.isPresent() ? netInReport.get() : null));
|
||||
userReportVO.setGovernReport(Arrays.asList(governReport.isPresent() ? governReport.get() : null));
|
||||
userReportVO.setNetInReport(Collections.singletonList(netInReport.orElse(null)));
|
||||
userReportVO.setGovernReport(Collections.singletonList(governReport.orElse(null)));
|
||||
return userReportVO;
|
||||
}
|
||||
|
||||
@@ -451,7 +445,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
.eq(UserReportPO::getDataType, 0)
|
||||
.in(CollectionUtil.isNotEmpty(data), UserReportPO::getOrgId, data)
|
||||
.list();
|
||||
List<UserReportVO> collect = list.stream().map(temp -> {
|
||||
return list.stream().map(temp -> {
|
||||
UserReportVO vo = new UserReportVO();
|
||||
BeanUtils.copyProperties(temp, vo);
|
||||
UserVO userVO = userFeignClient.getUserById(temp.getReporter()).getData();
|
||||
@@ -460,7 +454,6 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
vo.setOrgName(deptFeignClient.getDeptById(temp.getOrgId()).getData().getName());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -538,7 +531,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
}
|
||||
temp.setNeedGovernance(needGovernance);
|
||||
//添加治理评估文件,需先判断入网评估是否审核通过
|
||||
Boolean type = true;
|
||||
boolean type = true;
|
||||
if (1 == temp.getNeedGovernance()) {
|
||||
List<UserReportNormalPO> list = userReportNormalMapper.selectList(new LambdaQueryWrapper<UserReportNormalPO>()
|
||||
.eq(UserReportNormalPO::getUserReportId, temp.getId())
|
||||
@@ -672,7 +665,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(1);
|
||||
pullDown.setLastCol(1);
|
||||
pullDown.setStrings(jiBeiArea.stream().filter(x -> !x.getName().equals("风光储") && !x.getName().equals("超高压")).map(DictData::getName).collect(Collectors.toList()));
|
||||
pullDown.setStrings(jiBeiArea.stream().filter(x -> !"风光储".equals(x.getName()) && !"超高压".equals(x.getName())).map(DictData::getName).collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
pullDown = new PullDown();
|
||||
@@ -760,8 +753,10 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void importSensitiveUserData(MultipartFile file, HttpServletResponse response) {
|
||||
ImportParams params = new ImportParams();
|
||||
params.setHeadRows(1);//表头
|
||||
params.setTitleRows(1);//标题
|
||||
//表头
|
||||
params.setHeadRows(1);
|
||||
//标题
|
||||
params.setTitleRows(1);
|
||||
params.setNeedVerify(true);
|
||||
params.setStartSheetIndex(0);
|
||||
params.setSheetNum(1);
|
||||
@@ -951,7 +946,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(16);
|
||||
pullDown.setLastCol(16);
|
||||
pullDown.setStrings(treeString.keySet().stream().collect(Collectors.toList()));
|
||||
pullDown.setStrings(new ArrayList<>(treeString.keySet()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
pullDown = new PullDown();
|
||||
@@ -973,8 +968,10 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void importSensitiveReportData(MultipartFile file, HttpServletResponse response) {
|
||||
ImportParams params = new ImportParams();
|
||||
params.setHeadRows(1);//表头
|
||||
params.setTitleRows(1);//标题
|
||||
//表头
|
||||
params.setHeadRows(1);
|
||||
//标题
|
||||
params.setTitleRows(1);
|
||||
params.setNeedVerify(true);
|
||||
params.setStartSheetIndex(0);
|
||||
params.setSheetNum(1);
|
||||
@@ -1051,7 +1048,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
userReportProjectPO.setAgreementCapacity(reportExcel.getUserAgreementCapacity().doubleValue());
|
||||
}
|
||||
if (StrUtil.isNotBlank(reportExcel.getNonlinearLoadType())) {
|
||||
userReportProjectPO.setNonlinearDeviceType(treeString.containsKey(reportExcel.getNonlinearLoadType()) ? treeString.get(reportExcel.getNonlinearLoadType()) : null);
|
||||
userReportProjectPO.setNonlinearDeviceType(treeString.getOrDefault(reportExcel.getNonlinearLoadType(), null));
|
||||
}
|
||||
|
||||
userReportProjectPO.setNeedGovernance(reportExcel.getNeedGovernance());
|
||||
@@ -1135,9 +1132,6 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
|
||||
/**
|
||||
* 获取所有字段为null的属性名
|
||||
*
|
||||
* @param source
|
||||
* @return
|
||||
*/
|
||||
public String[] getNullPropertyNames(Object source) {
|
||||
final BeanWrapper src = new BeanWrapperImpl(source);
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.supervision.enums.*;
|
||||
import com.njcn.supervision.mapper.user.UserReportRenewalMapper;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
import com.njcn.supervision.pojo.po.device.CheckDevice;
|
||||
import com.njcn.supervision.pojo.po.user.*;
|
||||
import com.njcn.supervision.service.user.*;
|
||||
import com.njcn.supervision.utils.InstanceUtil;
|
||||
@@ -58,7 +57,7 @@ public class UserReportRenewalServiceImpl extends ServiceImpl<UserReportRenewalM
|
||||
public void updateProcessStatus(String businessId, Integer status) {
|
||||
UserReportRenewalPO userReportPO = this.getById(businessId);
|
||||
if (ObjUtil.isNotNull(userReportPO)) {
|
||||
if (BpmTaskStatusEnum.APPROVE.getStatus() == status) {
|
||||
if (Objects.equals(BpmTaskStatusEnum.APPROVE.getStatus(), status)) {
|
||||
UserReportParam userReportParam = new UserReportParam();
|
||||
userReportParam.setId(businessId);
|
||||
userReportPO.getUserReportMessageJson().setSaveOrCheckflag("0");
|
||||
@@ -119,11 +118,7 @@ public class UserReportRenewalServiceImpl extends ServiceImpl<UserReportRenewalM
|
||||
userReportPO.setState(DataStateEnum.ENABLE.getCode());
|
||||
if (Objects.equals(userReportParam.getSaveOrCheckflag(), "2")) {
|
||||
po.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
if (StringUtils.isEmpty(userReportParam.getId())) {
|
||||
userReportPOService.checkProjectName(userReportParam, false);
|
||||
} else {
|
||||
userReportPOService.checkProjectName(userReportParam, true);
|
||||
}
|
||||
userReportPOService.checkProjectName(userReportParam, !StringUtils.isEmpty(userReportParam.getId()));
|
||||
}else {
|
||||
po.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||
}
|
||||
@@ -140,14 +135,14 @@ public class UserReportRenewalServiceImpl extends ServiceImpl<UserReportRenewalM
|
||||
if (Objects.equals(userReportParam.getSaveOrCheckflag(), "2")) {
|
||||
UserReportRenewalPO byId = this.getById(userReportParam.getId());
|
||||
if(ObjectUtil.isNotNull(byId)){
|
||||
if(FlowStatusEnum.APPROVE.getCode()==byId.getStatus()) {
|
||||
if(Objects.equals(FlowStatusEnum.APPROVE.getCode(), byId.getStatus())) {
|
||||
//处理历史流程id列表
|
||||
String historyInstanceIds = InstanceUtil.dealHistoryId(byId.getProcessInstanceId(), byId.getHistoryInstanceId());
|
||||
//保存历史流程id列表
|
||||
po.setHistoryInstanceId(historyInstanceIds);
|
||||
}
|
||||
}
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.USER_REPORT_RENEWAL.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(userReportPO.getId());
|
||||
@@ -182,7 +177,7 @@ public class UserReportRenewalServiceImpl extends ServiceImpl<UserReportRenewalM
|
||||
addition(userReportParam, userReportParam.getUserType());
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.USER_REPORT_RENEWAL.getKey());
|
||||
bpmProcessInstanceCreateReqDTO.setBusinessKey(userReportParam.getId());
|
||||
|
||||
Reference in New Issue
Block a user