Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -78,6 +78,8 @@ public enum AdvanceResponseEnum {
|
||||
MACHINE_HAS_UNIT("A0102","当前设备存在元器件"),
|
||||
|
||||
EVENT_TIME_ERROR("A0102","暂降事件时间格式有误,请检查"),
|
||||
|
||||
INVALID_FILE_TYPE("A0102","请选择CSV文件"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
@@ -106,6 +106,13 @@ public class SgEventController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||
public HttpResult<String> importEventData(@RequestParam("file") MultipartFile file, @RequestParam("incomingLineId") String incomingLineId, @RequestParam("productLineId") String productLineId, HttpServletResponse response) {
|
||||
String methodDescribe = getMethodDescribe("importEventData");
|
||||
|
||||
// 检查文件MIME类型是否为csv
|
||||
String contentType = file.getContentType();
|
||||
if (!"text/csv".equals(contentType)) {
|
||||
throw new BusinessException(AdvanceResponseEnum.INVALID_FILE_TYPE);
|
||||
}
|
||||
|
||||
ImportParams params = new ImportParams();
|
||||
params.setHeadRows(1);
|
||||
params.setNeedVerify(true);
|
||||
|
||||
@@ -277,7 +277,6 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
LambdaQueryWrapper<RmpEventDetailAssPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StrUtil.isNotBlank(baseParam.getSearchValue())) {
|
||||
lambdaQueryWrapper.like(RmpEventDetailAssPO::getContentDes, baseParam.getSearchValue());
|
||||
|
||||
}
|
||||
lambdaQueryWrapper.between(RmpEventDetailAssPO::getTimeId, timeV.get(0), timeV.get(1))
|
||||
.orderByAsc(RmpEventDetailAssPO::getTimeId);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.bpm.controller;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||
import com.njcn.bpm.pojo.dto.PageResult;
|
||||
import com.njcn.bpm.pojo.param.task.*;
|
||||
import com.njcn.bpm.pojo.po.BpmCategory;
|
||||
@@ -217,6 +218,24 @@ public class BpmTaskController extends BaseController {
|
||||
page.setTotal(bpmTaskRespVOPageResult.getTotal());
|
||||
page.setSize(PageFactory.getPageSize(bpmTaskQueryParam));
|
||||
page.setCurrent(PageFactory.getPageNum(bpmTaskQueryParam));
|
||||
|
||||
List<BpmTaskVO> records = page.getRecords();
|
||||
for (BpmTaskVO record : records) {
|
||||
if(record.getStatus().equals(BpmTaskStatusEnum.CANCEL.getStatus()) && record.getReason().equals("系统自动取消")){
|
||||
record.setStatus(BpmTaskStatusEnum.APPROVE.getStatus());
|
||||
record.setReason(BpmTaskStatusEnum.APPROVE.getName());
|
||||
// 找到由谁完成的
|
||||
HttpResult<List<BpmTaskVO>> taskListByProcessInstanceId = this.getTaskListByProcessInstanceId(record.getProcessInstanceId());
|
||||
if(CollectionUtil.isNotEmpty(taskListByProcessInstanceId.getData())){
|
||||
for (BpmTaskVO datum : taskListByProcessInstanceId.getData()) {
|
||||
if(datum.getStatus().equals(BpmTaskStatusEnum.APPROVE.getStatus()) && datum.getTaskDefinitionKey().equals(record.getTaskDefinitionKey())){
|
||||
record.setReason("由".concat(datum.getAssigneeUser().getName()).concat("完成审批"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ public class BpmTaskServiceImpl implements IBpmTaskService {
|
||||
// 审批时间倒序
|
||||
.orderByHistoricTaskInstanceEndTime().desc();
|
||||
if (StrUtil.isNotBlank(bpmTaskQueryParam.getSearchValue())) {
|
||||
taskQuery.taskNameLike("%" + bpmTaskQueryParam.getSearchValue() + "%");
|
||||
taskQuery.processDefinitionNameLike("%" + bpmTaskQueryParam.getSearchValue() + "%");
|
||||
}
|
||||
String beginTimeStr = bpmTaskQueryParam.getSearchBeginTime();
|
||||
String endTimeStr = bpmTaskQueryParam.getSearchEndTime();
|
||||
|
||||
@@ -70,4 +70,9 @@ public class TerminalTree implements Serializable {
|
||||
* 电网侧变电站
|
||||
*/
|
||||
private String powerSubstationName;
|
||||
|
||||
/**
|
||||
* 电网侧变电站
|
||||
*/
|
||||
private String objName;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.pojo.po.YwZtSubstation;
|
||||
import com.njcn.device.pq.service.IYwZtSubstationService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -51,5 +53,12 @@ public class YwZtSubstationController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, ywZtSubstation, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/tagOrIdGetYWZtSub")
|
||||
@ApiOperation("获取变电站信息")
|
||||
public HttpResult<List<SubGetBase>> tagOrIdGetSub(@RequestBody SubstationParam substationParam) {
|
||||
String methodDescribe = getMethodDescribe("tagOrIdGetSub");
|
||||
List<SubGetBase> subGetBases = ywZtSubstationService.getSubstation(substationParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, subGetBases, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.pojo.po.YwZtSubstation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
@@ -13,4 +18,5 @@ import com.njcn.device.pq.pojo.po.YwZtSubstation;
|
||||
*/
|
||||
public interface YwZtSubstationMapper extends BaseMapper<YwZtSubstation> {
|
||||
|
||||
List<SubGetBase> selectSubstationList(@Param("param") SubstationParam substationParam);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,32 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.YwZtSubstationMapper">
|
||||
|
||||
<select id="selectSubstationList" resultType="com.njcn.device.biz.pojo.dto.SubGetBase">
|
||||
SELECT
|
||||
sub.id id,
|
||||
sub.NAME NAME,
|
||||
sub.org_Id orgId,
|
||||
sub.Scale voltageLevel,
|
||||
sub.lng lng,
|
||||
sub.lat lat
|
||||
FROM
|
||||
pq_ywzt_substation sub
|
||||
<where>
|
||||
<if test="param.orgIds!=null and param.orgIds.size!=0">
|
||||
and sub.org_Id in
|
||||
<foreach collection="param.orgIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.powerName !=null and param.powerName!='' ">
|
||||
and sub.name like CONCAT(CONCAT('%', #{param.powerName}), '%')
|
||||
</if>
|
||||
<if test="param.powerVoltageLevel!=null and param.powerVoltageLevel.size!=0">
|
||||
and sub.Scale in
|
||||
<foreach collection="param.powerVoltageLevel" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.pojo.po.YwZtSubstation;
|
||||
|
||||
import java.util.List;
|
||||
@@ -19,4 +21,11 @@ public interface IYwZtSubstationService extends IService<YwZtSubstation> {
|
||||
Boolean syncYwZtSubstation();
|
||||
|
||||
List<YwZtSubstation> getYwZtSubstation(String orgId);
|
||||
|
||||
/**
|
||||
* 线上管控获取所有中台变电站信息
|
||||
* @param substationParam
|
||||
* @return
|
||||
*/
|
||||
List<SubGetBase> getSubstation(SubstationParam substationParam);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.pq.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||
@@ -319,6 +320,7 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
if(powerFlagMap.containsKey(x.getId())){
|
||||
x.setPowerFlag(powerFlagMap.get(x.getId()).getPowerFlag());
|
||||
x.setPowerSubstationName(powerFlagMap.get(x.getId()).getPowerSubstationName());
|
||||
x.setObjName(powerFlagMap.get(x.getId()).getObjName());
|
||||
}else{
|
||||
x.setPowerFlag(LineBaseEnum.POWER_FLAG.getCode());
|
||||
}
|
||||
@@ -333,8 +335,7 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
lineObjNameMap.forEach((key, value)->{
|
||||
List<TerminalTree> terminalTrees = Collections.unmodifiableList(collect1);
|
||||
//获取变电信息
|
||||
List<TerminalTree> collect = subList.stream().filter(x -> x.getName().equals(key)).collect(Collectors.toList());
|
||||
|
||||
List<TerminalTree> collect = subList.stream().filter(x -> x.getName().equals(key.replace("±",""))).collect(Collectors.toList());
|
||||
//电网侧监测点
|
||||
List<TerminalTree> powerFlag = value.stream().filter(x -> x.getPowerFlag().equals(LineBaseEnum.POWER_FLAG.getCode())).collect(Collectors.toList());
|
||||
if(CollUtil.isEmpty(powerFlag)){
|
||||
@@ -342,13 +343,24 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
powerFlag.addAll(collect);
|
||||
}
|
||||
List<TerminalTree> subChildren = new ArrayList<>();
|
||||
getRecursionChildren(powerFlag,subChildren, terminalTrees);
|
||||
|
||||
TerminalTree recursion = getRecursionChildren(powerFlag, terminalTrees);
|
||||
if(ObjectUtil.isNotNull(recursion)){
|
||||
subChildren.add(recursion);
|
||||
}
|
||||
//非电网侧监测点
|
||||
List<TerminalTree> powerFlagNot = value.stream().filter(x -> x.getPowerFlag().equals(LineBaseEnum.POWER_FLAG_NOT.getCode())).collect(Collectors.toList());
|
||||
List<TerminalTree> notSubChildren = new ArrayList<>();
|
||||
getRecursionChildren(powerFlagNot,notSubChildren,terminalTrees);
|
||||
if(CollUtil.isNotEmpty(powerFlagNot)){
|
||||
Map<String, List<TerminalTree>> objNameMap = powerFlagNot.stream().collect(Collectors.groupingBy(TerminalTree::getObjName));
|
||||
objNameMap.forEach((objNameKey,objNameValue)->{
|
||||
TerminalTree recursionChildren = getRecursionChildren(objNameValue, terminalTrees);
|
||||
if(ObjectUtil.isNotNull(recursionChildren)){
|
||||
recursionChildren.setName(objNameKey);
|
||||
notSubChildren.add(recursionChildren);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
if(CollUtil.isNotEmpty(collect)){
|
||||
List<TerminalTree> valueList = new ArrayList<>();
|
||||
TerminalTree sub=new TerminalTree();
|
||||
@@ -506,7 +518,7 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
* @param all 检测对象
|
||||
* @return
|
||||
*/
|
||||
public void getRecursionChildren(List<TerminalTree> line, List<TerminalTree> info,List<TerminalTree> all) {
|
||||
public TerminalTree getRecursionChildren(List<TerminalTree> line, List<TerminalTree> all) {
|
||||
List<TerminalTree> aa=new ArrayList<>();
|
||||
for (TerminalTree lineTree : line) {
|
||||
findParentsRecursive(lineTree, all,aa);
|
||||
@@ -520,11 +532,10 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
List<TerminalTree> lines = aa.stream().distinct().sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
List<TerminalTree> collect = distinctList.stream().filter(x -> x.getLevel() == LineBaseEnum.SUB_LEVEL.getCode()).collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(collect)){
|
||||
for (TerminalTree tree : collect) {
|
||||
TerminalTree terminalTree = BeanUtil.copyProperties(tree, TerminalTree.class);
|
||||
info.add(findParents(lines,terminalTree));
|
||||
}
|
||||
TerminalTree terminalTree = BeanUtil.copyProperties(collect.get(0), TerminalTree.class);
|
||||
return findParents(lines,terminalTree);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void findParentsRecursive(TerminalTree tree, List<TerminalTree> all,List<TerminalTree> newParents) {
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.njcn.device.pq.service.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pq.mapper.SubstationMapper;
|
||||
import com.njcn.device.pq.mapper.YwZtSubstationMapper;
|
||||
import com.njcn.device.pq.pojo.po.Substation;
|
||||
@@ -12,11 +14,13 @@ import com.njcn.device.pq.service.IYwZtSubstationService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
@@ -98,6 +102,28 @@ public class YwZtSubstationServiceImpl extends ServiceImpl<YwZtSubstationMapper,
|
||||
return this.list(new LambdaQueryWrapper<YwZtSubstation>().in(CollUtil.isNotEmpty(orgIds),YwZtSubstation::getOrgId,orgIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SubGetBase> getSubstation(SubstationParam substationParam) {
|
||||
List<String> orgIds = substationParam.getOrgIds();
|
||||
List<Dept> deptList = deptFeignClient.getDeptInfoListByIds(orgIds).getData();
|
||||
List<String> deptCode = deptList.stream().map(Dept::getCode).collect(Collectors.toList());
|
||||
substationParam.setOrgIds(deptCode);
|
||||
List<SubGetBase> subGetBases = this.baseMapper.selectSubstationList(substationParam);
|
||||
if(CollUtil.isNotEmpty(subGetBases)){
|
||||
Map<String, Dept> deptMap = deptList.stream().collect(Collectors.toMap(Dept::getCode, Function.identity()));
|
||||
subGetBases.stream().forEach(x->{
|
||||
if(deptMap.containsKey(x.getOrgId())){
|
||||
Dept deptDTO = deptMap.get(x.getOrgId());
|
||||
x.setOrgName(deptDTO.getName());
|
||||
x.setOrgId(deptDTO.getId());
|
||||
}
|
||||
});
|
||||
return subGetBases;
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
public String getDzmc(String dzmc) {
|
||||
if(StrUtil.isNotBlank(dzmc)) {
|
||||
dzmc = dzmc.replace("变电站", "")
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.njcn.harmonic.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
@@ -44,6 +46,7 @@ import sun.misc.BASE64Encoder;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -177,7 +180,12 @@ public class ExportModelController extends BaseController {
|
||||
ReportQueryParam param = new ReportQueryParam();
|
||||
param.setLineId(lineIndex);
|
||||
param.setStartTime(DateUtil.format(startDate, "yyyy-MM-dd HH:mm:ss"));
|
||||
param.setEndTime(DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss"));
|
||||
LocalDateTime parse = LocalDateTimeUtil.parse(DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss"), DatePattern.NORM_DATETIME_PATTERN);
|
||||
if(LocalDateTime.now().isBefore(parse)){
|
||||
param.setEndTime(LocalDateTimeUtil.format(LocalDateTime.now(),DatePattern.NORM_DATETIME_PATTERN));
|
||||
}else {
|
||||
param.setEndTime(DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
param.setB(day == 0);
|
||||
|
||||
//限值
|
||||
|
||||
@@ -969,7 +969,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
String localTime = InfluxDbSqlConstant.END_TIME;
|
||||
LocalDate localDate = LocalDateTimeUtil.parseDate(reportSearchParam.getEndTime(), DatePattern.NORM_DATE_PATTERN);
|
||||
if(LocalDate.now().isEqual(localDate)){
|
||||
localTime = LocalTime.now().format(DatePattern.NORM_TIME_FORMATTER);
|
||||
localTime =" "+ LocalTime.now().format(DatePattern.NORM_TIME_FORMATTER);
|
||||
}
|
||||
son.set("v", reportSearchParam.getStartTime() + InfluxDbSqlConstant.START_TIME + "_" + reportSearchParam.getEndTime() + localTime);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user