Compare commits
12 Commits
e7dbee2df5
...
2025-12
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b0feb1320 | |||
| e92326c55d | |||
| 7abbfd500b | |||
| 77360ef468 | |||
| b38d3bad1b | |||
| 27aebf2ca4 | |||
| 9981b04ed6 | |||
| f8c9828369 | |||
| 0d652b9f4d | |||
| 3ea67da152 | |||
| c7dce89d36 | |||
| 56d88939c4 |
@@ -1,9 +1,9 @@
|
|||||||
package com.njcn.csdevice.service.impl;
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.csdevice.mapper.CsLinePOMapper;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
|
||||||
import com.njcn.csdevice.mapper.PqsDeviceUnitMapper;
|
import com.njcn.csdevice.mapper.PqsDeviceUnitMapper;
|
||||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
@@ -11,7 +11,6 @@ import com.njcn.csdevice.pojo.po.CsLinePO;
|
|||||||
import com.njcn.csdevice.service.CsCommTerminalService;
|
import com.njcn.csdevice.service.CsCommTerminalService;
|
||||||
import com.njcn.csdevice.service.CsDeviceUserPOService;
|
import com.njcn.csdevice.service.CsDeviceUserPOService;
|
||||||
import com.njcn.csdevice.service.CsEquipmentDeliveryService;
|
import com.njcn.csdevice.service.CsEquipmentDeliveryService;
|
||||||
import com.njcn.csdevice.service.CsLinePOService;
|
|
||||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||||
import com.njcn.user.api.UserFeignClient;
|
import com.njcn.user.api.UserFeignClient;
|
||||||
import com.njcn.user.pojo.constant.UserType;
|
import com.njcn.user.pojo.constant.UserType;
|
||||||
@@ -36,7 +35,7 @@ public class CsCommTerminalServiceImpl implements CsCommTerminalService {
|
|||||||
|
|
||||||
private final PqsDeviceUnitMapper pqsDeviceUnitMapper;
|
private final PqsDeviceUnitMapper pqsDeviceUnitMapper;
|
||||||
private final CsDeviceUserPOService csDeviceUserPOService;
|
private final CsDeviceUserPOService csDeviceUserPOService;
|
||||||
private final CsLinePOService csLinePOService;
|
private final CsLinePOMapper csLinePOMapper;
|
||||||
private final UserFeignClient userFeignClient;
|
private final UserFeignClient userFeignClient;
|
||||||
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
||||||
|
|
||||||
@@ -48,8 +47,11 @@ public class CsCommTerminalServiceImpl implements CsCommTerminalService {
|
|||||||
if (CollUtil.isEmpty(devIds)) {
|
if (CollUtil.isEmpty(devIds)) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
List<CsLinePO> poList = csLinePOService.lambdaQuery().select(CsLinePO::getLineId).in(CsLinePO::getDeviceId, devIds)
|
|
||||||
.eq(CsLinePO::getStatus, DataStateEnum.ENABLE.getCode()).list();
|
LambdaQueryWrapper<CsLinePO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.select(CsLinePO::getLineId).in(CsLinePO::getDeviceId, devIds)
|
||||||
|
.eq(CsLinePO::getStatus, DataStateEnum.ENABLE.getCode());
|
||||||
|
List<CsLinePO> poList = csLinePOMapper.selectList(lambdaQueryWrapper);
|
||||||
if (CollUtil.isNotEmpty(poList)) {
|
if (CollUtil.isNotEmpty(poList)) {
|
||||||
result = poList.stream().map(CsLinePO::getLineId).distinct().collect(Collectors.toList());
|
result = poList.stream().map(CsLinePO::getLineId).distinct().collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
@@ -63,8 +65,10 @@ public class CsCommTerminalServiceImpl implements CsCommTerminalService {
|
|||||||
if (CollUtil.isEmpty(devIds)) {
|
if (CollUtil.isEmpty(devIds)) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
List<CsLinePO> poList = csLinePOService.lambdaQuery().select(CsLinePO::getLineId, CsLinePO::getMonitorUser).in(CsLinePO::getDeviceId, devIds)
|
LambdaQueryWrapper<CsLinePO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
.eq(CsLinePO::getStatus, DataStateEnum.ENABLE.getCode()).list();
|
lambdaQueryWrapper.select(CsLinePO::getLineId, CsLinePO::getMonitorUser).in(CsLinePO::getDeviceId, devIds)
|
||||||
|
.eq(CsLinePO::getStatus, DataStateEnum.ENABLE.getCode());
|
||||||
|
List<CsLinePO> poList =csLinePOMapper.selectList(lambdaQueryWrapper);
|
||||||
if (CollUtil.isNotEmpty(poList)) {
|
if (CollUtil.isNotEmpty(poList)) {
|
||||||
result = poList.stream().map(CsLinePO::getMonitorUser).distinct().collect(Collectors.toList());
|
result = poList.stream().map(CsLinePO::getMonitorUser).distinct().collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import java.util.Optional;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Date: 2023/9/27 10:29【需求编号】
|
* Date: 2023/9/27 10:29【需求编号】
|
||||||
*
|
*
|
||||||
@@ -50,12 +50,12 @@ public class CsDevCapacityPOServiceImpl extends ServiceImpl<CsDevCapacityPOMappe
|
|||||||
public Double getDevCapacity(String id) {
|
public Double getDevCapacity(String id) {
|
||||||
List<CsLinePO> csLinePOS = csLinePOService.queryByDevId(id);
|
List<CsLinePO> csLinePOS = csLinePOService.queryByDevId(id);
|
||||||
|
|
||||||
String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId();
|
//String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId();
|
||||||
|
|
||||||
Optional.ofNullable(csLinePOS).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
|
//Optional.ofNullable(csLinePOS).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
|
||||||
List<CsLinePO> collect1 = csLinePOS.stream().filter(temp -> Objects.equals(areaId, temp.getPosition())).collect(Collectors.toList());
|
//List<CsLinePO> collect1 = csLinePOS.stream().filter(temp -> Objects.equals(areaId, temp.getPosition())).collect(Collectors.toList());
|
||||||
/*治理侧监测点*/
|
/*治理侧监测点*/
|
||||||
CsLinePO csLinePO = collect1.get(0);
|
CsLinePO csLinePO = csLinePOS.get(0);
|
||||||
CsDevCapacityPO one = this.lambdaQuery().eq(CsDevCapacityPO::getLineId, csLinePO.getLineId()).eq(CsDevCapacityPO::getCldid, 0).one();
|
CsDevCapacityPO one = this.lambdaQuery().eq(CsDevCapacityPO::getLineId, csLinePO.getLineId()).eq(CsDevCapacityPO::getCldid, 0).one();
|
||||||
// Optional.ofNullable(one).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.DATA_MISSING));
|
// Optional.ofNullable(one).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.DATA_MISSING));
|
||||||
if(Objects.isNull(one)){
|
if(Objects.isNull(one)){
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.csdevice.constant.DataParam;
|
import com.njcn.csdevice.constant.DataParam;
|
||||||
import com.njcn.csdevice.controller.project.EngineeringController;
|
|
||||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||||
import com.njcn.csdevice.mapper.*;
|
import com.njcn.csdevice.mapper.*;
|
||||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||||
@@ -210,7 +209,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
List<CsLedgerVO> ledger;
|
List<CsLedgerVO> ledger;
|
||||||
String role = RequestUtil.getUserRole();
|
String role = RequestUtil.getUserRole();
|
||||||
List<String> roles = JSONArray.parseArray(role, String.class);
|
List<String> roles = JSONArray.parseArray(role, String.class);
|
||||||
if (roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.getCode())) {
|
if(roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.getCode()) || roles.contains(AppRoleEnum.REGULAR_USER.getCode())){
|
||||||
ledger = allList.stream()
|
ledger = allList.stream()
|
||||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
@@ -414,7 +413,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
List<CsLedgerVO> ledger;
|
List<CsLedgerVO> ledger;
|
||||||
String role = RequestUtil.getUserRole();
|
String role = RequestUtil.getUserRole();
|
||||||
List<String> roles = JSONArray.parseArray(role, String.class);
|
List<String> roles = JSONArray.parseArray(role, String.class);
|
||||||
if (roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.getCode())) {
|
if(roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.getCode()) || roles.contains(AppRoleEnum.REGULAR_USER.getCode())){
|
||||||
ledger = allList.stream()
|
ledger = allList.stream()
|
||||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
@@ -674,7 +673,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
@Override
|
@Override
|
||||||
public List<CsLedgerVO> objTree() {
|
public List<CsLedgerVO> objTree() {
|
||||||
List<CsLedgerVO> result = new ArrayList<>();
|
List<CsLedgerVO> result = new ArrayList<>();
|
||||||
String userId = RequestUtil.getUserIndex();
|
String userId = "fa37b93cc90d4c1784ca8f6debddee1a";
|
||||||
UserVO userVO = userFeignClient.getUserById(userId).getData();
|
UserVO userVO = userFeignClient.getUserById(userId).getData();
|
||||||
List<String> devIds;
|
List<String> devIds;
|
||||||
if (userVO.getType().equals(UserType.SUPER_ADMINISTRATOR) || userVO.getType().equals(UserType.ADMINISTRATOR)) {
|
if (userVO.getType().equals(UserType.SUPER_ADMINISTRATOR) || userVO.getType().equals(UserType.ADMINISTRATOR)) {
|
||||||
@@ -690,8 +689,8 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
if (CollUtil.isEmpty(devIds)) {
|
if (CollUtil.isEmpty(devIds)) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
List<CsLinePO> poList = csLinePOService.lambdaQuery().select(CsLinePO::getLineId).in(CsLinePO::getDeviceId, devIds)
|
List<CsLinePO> poList = csLinePOService.lambdaQuery().in(CsLinePO::getDeviceId, devIds)
|
||||||
.eq(CsLinePO::getStatus, DataStateEnum.ENABLE.getCode()).list();
|
.eq(CsLinePO::getStatus, DataStateEnum.ENABLE.getCode()).ne(CsLinePO::getMonitorUser,"").isNotNull(CsLinePO::getMonitorUser).list();
|
||||||
if (CollUtil.isEmpty(poList)) {
|
if (CollUtil.isEmpty(poList)) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -702,9 +701,9 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
Map<String,String> objMap = pqSensitiveUserList.stream().collect(Collectors.toMap(PqSensitiveUser::getId, PqSensitiveUser::getName));
|
Map<String,String> objMap = pqSensitiveUserList.stream().collect(Collectors.toMap(PqSensitiveUser::getId, PqSensitiveUser::getName));
|
||||||
|
|
||||||
List<CsLedger> csLineList = this.baseMapper.selectList(new LambdaQueryWrapper<CsLedger>().in(CsLedger::getId, lineIds));
|
List<CsLedger> csLineList = this.baseMapper.selectList(new LambdaQueryWrapper<CsLedger>().in(CsLedger::getId, lineIds));
|
||||||
Map<String,List<String>> lineMap = csLineList.stream().collect(Collectors.groupingBy(it->it.getPids().split(StrUtil.COMMA)[LineBaseEnum.PROJECT_LEVEL.getCode()],Collectors.mapping(CsLedger::getId,Collectors.toList())));
|
Map<String,List<String>> lineMap = csLineList.stream().collect(Collectors.groupingBy(it->it.getPids().split(StrUtil.COMMA)[LineBaseEnum.PROJECT_LEVEL.getCode()+1],Collectors.mapping(CsLedger::getId,Collectors.toList())));
|
||||||
|
|
||||||
List<String> projectIds = csLineList.stream().map(it -> it.getPids().split(StrUtil.COMMA)[LineBaseEnum.PROJECT_LEVEL.getCode()]).collect(Collectors.toList());
|
List<String> projectIds = csLineList.stream().map(it -> it.getPids().split(StrUtil.COMMA)[LineBaseEnum.PROJECT_LEVEL.getCode()+1]).distinct().collect(Collectors.toList());
|
||||||
List<CsLedger> projectList = this.baseMapper.selectList(new LambdaQueryWrapper<CsLedger>().in(CsLedger::getId, projectIds));
|
List<CsLedger> projectList = this.baseMapper.selectList(new LambdaQueryWrapper<CsLedger>().in(CsLedger::getId, projectIds));
|
||||||
|
|
||||||
List<CsLedgerVO> realProjectList = new ArrayList<>();
|
List<CsLedgerVO> realProjectList = new ArrayList<>();
|
||||||
@@ -713,24 +712,27 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
csLedgerVO.setId(pro.getId());
|
csLedgerVO.setId(pro.getId());
|
||||||
csLedgerVO.setPid(pro.getPid());
|
csLedgerVO.setPid(pro.getPid());
|
||||||
csLedgerVO.setLevel(pro.getLevel());
|
csLedgerVO.setLevel(pro.getLevel());
|
||||||
|
csLedgerVO.setName(pro.getName());
|
||||||
|
|
||||||
List<CsLedgerVO> temObjList = new ArrayList<>();
|
List<CsLedgerVO> temObjList = new ArrayList<>();
|
||||||
if(lineMap.containsKey(pro.getId())){
|
if(lineMap.containsKey(pro.getId())){
|
||||||
List<String> ids = lineMap.get(pro.getId());
|
List<String> ids = lineMap.get(pro.getId());
|
||||||
List<String> objTemIds = poList.stream().filter(it->ids.contains(it.getLineId())).map(CsLinePO::getMonitorUser).distinct().collect(Collectors.toList());
|
List<String> objTemIds = poList.stream().filter(it->ids.contains(it.getLineId())).map(CsLinePO::getMonitorUser).distinct().collect(Collectors.toList());
|
||||||
objTemIds.forEach(it->{
|
if(CollUtil.isNotEmpty(objTemIds)){
|
||||||
CsLedgerVO inner = new CsLedgerVO();
|
objTemIds.forEach(it->{
|
||||||
inner.setName(objMap.getOrDefault(it,"未知异常用户"));
|
CsLedgerVO inner = new CsLedgerVO();
|
||||||
inner.setId(it);
|
inner.setName(objMap.getOrDefault(it,"未知异常用户"));
|
||||||
inner.setLevel(2);
|
inner.setId(it);
|
||||||
temObjList.add(inner);
|
inner.setLevel(2);
|
||||||
});
|
temObjList.add(inner);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
csLedgerVO.setChildren(temObjList);
|
csLedgerVO.setChildren(temObjList);
|
||||||
realProjectList.add(csLedgerVO);
|
realProjectList.add(csLedgerVO);
|
||||||
});
|
});
|
||||||
|
|
||||||
List<String> gcIds = projectList.stream().map(it -> it.getPids().split(StrUtil.COMMA)[LineBaseEnum.ENGINEERING_LEVEL.getCode()]).collect(Collectors.toList());
|
List<String> gcIds = projectList.stream().map(CsLedger::getPid).collect(Collectors.toList());
|
||||||
List<CsLedger> gcList = this.baseMapper.selectList(new LambdaQueryWrapper<CsLedger>().in(CsLedger::getId, gcIds));
|
List<CsLedger> gcList = this.baseMapper.selectList(new LambdaQueryWrapper<CsLedger>().in(CsLedger::getId, gcIds));
|
||||||
|
|
||||||
List<CsLedgerVO> realGcList = new ArrayList<>();
|
List<CsLedgerVO> realGcList = new ArrayList<>();
|
||||||
@@ -739,6 +741,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
csLedgerVO.setId(gc.getId());
|
csLedgerVO.setId(gc.getId());
|
||||||
csLedgerVO.setPid(gc.getPid());
|
csLedgerVO.setPid(gc.getPid());
|
||||||
csLedgerVO.setLevel(gc.getLevel());
|
csLedgerVO.setLevel(gc.getLevel());
|
||||||
|
csLedgerVO.setName(gc.getName());
|
||||||
|
|
||||||
List<CsLedgerVO> proList = realProjectList.stream().filter(it->gc.getId().equals(it.getPid())).collect(Collectors.toList());
|
List<CsLedgerVO> proList = realProjectList.stream().filter(it->gc.getId().equals(it.getPid())).collect(Collectors.toList());
|
||||||
csLedgerVO.setChildren(proList);
|
csLedgerVO.setChildren(proList);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.njcn.access.pojo.po.CsLineLatestData;
|
|||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.utils.PubUtils;
|
import com.njcn.common.utils.PubUtils;
|
||||||
|
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||||
import com.njcn.csdevice.mapper.*;
|
import com.njcn.csdevice.mapper.*;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.*;
|
import com.njcn.csdevice.pojo.po.*;
|
||||||
@@ -399,9 +400,15 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
|||||||
return new LineDetailDataVO();
|
return new LineDetailDataVO();
|
||||||
} else {
|
} else {
|
||||||
CsLinePO csLinePO = this.baseMapper.selectOne(new LambdaQueryWrapper<CsLinePO>().eq(CsLinePO::getLineId,id));
|
CsLinePO csLinePO = this.baseMapper.selectOne(new LambdaQueryWrapper<CsLinePO>().eq(CsLinePO::getLineId,id));
|
||||||
|
|
||||||
|
CsLedger csLedger = csLedgerMapper.selectById(csLinePO.getLineId());
|
||||||
|
|
||||||
LineDetailDataVO lineDetailDataVO = new LineDetailDataVO();
|
LineDetailDataVO lineDetailDataVO = new LineDetailDataVO();
|
||||||
|
|
||||||
//lineDetailDataVO.setScale(dicDataFeignClient.getDicDataById(voltageMapper.selectById(voId).getScale()).getData().getName());
|
lineDetailDataVO.setScale(csLinePO.getVolGrade()+"kV");
|
||||||
|
lineDetailDataVO.setAreaName(csLedgerMapper.selectById(csLedger.getPids().split(StrUtil.COMMA)[LineBaseEnum.ENGINEERING_LEVEL.getCode()+1]).getName());
|
||||||
|
lineDetailDataVO.setBdName(csLedgerMapper.selectById(csLedger.getPids().split(StrUtil.COMMA)[LineBaseEnum.PROJECT_LEVEL.getCode()+1]).getName());
|
||||||
|
|
||||||
//Device device = deviceMapper.selectById(devId);
|
//Device device = deviceMapper.selectById(devId);
|
||||||
//lineDetailDataVO.setComFlag(PubUtils.comFlag(device.getComFlag()));
|
//lineDetailDataVO.setComFlag(PubUtils.comFlag(device.getComFlag()));
|
||||||
//lineDetailDataVO.setRunFlag(PubUtils.lineRunFlag(lineDetail.getRunFlag()));
|
//lineDetailDataVO.setRunFlag(PubUtils.lineRunFlag(lineDetail.getRunFlag()));
|
||||||
@@ -413,8 +420,8 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
|||||||
lineDetailDataVO.setObjName(csLinePO.getMonitorUser());
|
lineDetailDataVO.setObjName(csLinePO.getMonitorUser());
|
||||||
lineDetailDataVO.setLineId(csLinePO.getLineId());
|
lineDetailDataVO.setLineId(csLinePO.getLineId());
|
||||||
lineDetailDataVO.setPtType(PubUtils.ptType(csLinePO.getConType()));
|
lineDetailDataVO.setPtType(PubUtils.ptType(csLinePO.getConType()));
|
||||||
//lineDetailDataVO.setPt(lineDetail.getPt1() + "/" + lineDetail.getPt2());
|
lineDetailDataVO.setPt(csLinePO.getPtRatio() + "/" + csLinePO.getPt2Ratio());
|
||||||
//lineDetailDataVO.setCt(lineDetail.getCt1() + "/" + lineDetail.getCt2());
|
lineDetailDataVO.setCt(csLinePO.getCtRatio() + "/" + csLinePO.getCt2Ratio());
|
||||||
lineDetailDataVO.setDealCapacity(csLinePO.getProtocolCapacity().floatValue());
|
lineDetailDataVO.setDealCapacity(csLinePO.getProtocolCapacity().floatValue());
|
||||||
lineDetailDataVO.setDevCapacity(csLinePO.getDevCapacity().floatValue());
|
lineDetailDataVO.setDevCapacity(csLinePO.getDevCapacity().floatValue());
|
||||||
lineDetailDataVO.setShortCapacity(csLinePO.getShortCircuitCapacity().floatValue());
|
lineDetailDataVO.setShortCapacity(csLinePO.getShortCircuitCapacity().floatValue());
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
QueryWrapper<CsLedger> csLedgerQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<CsLedger> csLedgerQueryWrapper = new QueryWrapper<>();
|
||||||
|
|
||||||
List<String> collect = new ArrayList<>();
|
List<String> collect = new ArrayList<>();
|
||||||
if(Objects.equals(role,AppRoleEnum.APP_VIP_USER.getCode())){
|
if(Objects.equals(role,AppRoleEnum.APP_VIP_USER.getCode()) || Objects.equals(role,AppRoleEnum.REGULAR_USER_8000.getCode())){
|
||||||
csDeviceUserPOQueryWrapper.clear();
|
csDeviceUserPOQueryWrapper.clear();
|
||||||
csEngineeringUserPOQueryWrapper.clear();
|
csEngineeringUserPOQueryWrapper.clear();
|
||||||
csLedgerQueryWrapper.clear();
|
csLedgerQueryWrapper.clear();
|
||||||
@@ -94,7 +94,7 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
// ||Objects.equals(role,"bxs_user")
|
// ||Objects.equals(role,"bxs_user")
|
||||||
else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode())){
|
else if(Objects.equals(role,AppRoleEnum.ROOT.getCode()) || Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode()) || Objects.equals(role,AppRoleEnum.REGULAR_USER.getCode()) ){
|
||||||
List<CsEngineeringPO> csEngineeringPOS = csEngineeringMapper.selectList(null);
|
List<CsEngineeringPO> csEngineeringPOS = csEngineeringMapper.selectList(null);
|
||||||
collect =csEngineeringPOS.stream().filter(temp->Objects.equals(temp.getStatus(),"1")).map(CsEngineeringPO::getId).collect(Collectors.toList());
|
collect =csEngineeringPOS.stream().filter(temp->Objects.equals(temp.getStatus(),"1")).map(CsEngineeringPO::getId).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
|
|
||||||
List<String> collect = new ArrayList<>();
|
List<String> collect = new ArrayList<>();
|
||||||
if(
|
if(
|
||||||
Objects.equals(role,AppRoleEnum.APP_VIP_USER.getCode())){
|
Objects.equals(role,AppRoleEnum.APP_VIP_USER.getCode()) || Objects.equals(role,AppRoleEnum.REGULAR_USER_8000.getCode())){
|
||||||
csDeviceUserPOQueryWrapper.clear();
|
csDeviceUserPOQueryWrapper.clear();
|
||||||
csDeviceUserPOQueryWrapper.eq("status","1").and(wq -> {
|
csDeviceUserPOQueryWrapper.eq("status","1").and(wq -> {
|
||||||
wq.eq("primary_user_id", userIndex)
|
wq.eq("primary_user_id", userIndex)
|
||||||
@@ -198,7 +198,7 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
// ||Objects.equals(role,"bxs_user")
|
// ||Objects.equals(role,"bxs_user")
|
||||||
else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode())){
|
else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode()) || Objects.equals(role,AppRoleEnum.REGULAR_USER.getCode())){
|
||||||
csLedgerQueryWrapper.clear();
|
csLedgerQueryWrapper.clear();
|
||||||
csLedgerQueryWrapper.eq("level",2).eq("state",1);
|
csLedgerQueryWrapper.eq("level",2).eq("state",1);
|
||||||
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ public class CsConfigurationParm {
|
|||||||
private String id;
|
private String id;
|
||||||
@ApiModelProperty(value = "当前用户ID")
|
@ApiModelProperty(value = "当前用户ID")
|
||||||
private String currentUserId;
|
private String currentUserId;
|
||||||
|
@ApiModelProperty(value = "当前用户角色")
|
||||||
|
private String roleCode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ public class CsConfigurationVO extends BaseEntity {
|
|||||||
|
|
||||||
private Integer orderBy;
|
private Integer orderBy;
|
||||||
|
|
||||||
|
private Integer scope;
|
||||||
|
|
||||||
|
|
||||||
private List<String> projectIds;
|
private List<String> projectIds;
|
||||||
|
|
||||||
|
|||||||
@@ -146,6 +146,16 @@
|
|||||||
<build>
|
<build>
|
||||||
<finalName>csHarmonicBoot</finalName>
|
<finalName>csHarmonicBoot</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
<nonFilteredFileExtensions>
|
||||||
|
<nonFilteredFileExtension>docx</nonFilteredFileExtension>
|
||||||
|
</nonFilteredFileExtensions>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
|||||||
@@ -7,14 +7,15 @@
|
|||||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||||
<result column="status" jdbcType="INTEGER" property="status" />
|
<result column="status" jdbcType="INTEGER" property="status" />
|
||||||
|
<result column="scope" jdbcType="INTEGER" property="scope" />
|
||||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
id, `name`, `status`, create_by, create_time, update_by, update_time
|
id, `name`, `status`, `scope`,create_by, create_time, update_by, update_time
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="queryPage" resultMap="BaseResultMap">
|
<select id="queryPage" resultMap="BaseResultMap">
|
||||||
@@ -24,7 +25,14 @@
|
|||||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
AND (a.scope = 1 OR (a.scope = 0 AND a.create_by = #{userId}))
|
<choose>
|
||||||
|
<when test="userId != null and userId != ''">
|
||||||
|
AND (a.scope = 1 OR (a.scope = 0 AND a.create_by = #{userId}))
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
AND (a.scope = 1 OR a.scope = 0)
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
<if test="temp!=null and temp.searchValue != null and temp.searchValue !=''">
|
<if test="temp!=null and temp.searchValue != null and temp.searchValue !=''">
|
||||||
AND a.name like concat(concat("%",#{temp.searchValue}),"%")
|
AND a.name like concat(concat("%",#{temp.searchValue}),"%")
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import java.util.*;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Date: 2023/5/31 10:53【需求编号】
|
* Date: 2023/5/31 10:53【需求编号】
|
||||||
*
|
*
|
||||||
@@ -42,7 +42,7 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMapper, CsConfigurationPO> implements CsConfigurationService{
|
public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMapper, CsConfigurationPO> implements CsConfigurationService {
|
||||||
private final FileStorageUtil fileStorageUtil;
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
|
||||||
private final UserFeignClient userFeignClient;
|
private final UserFeignClient userFeignClient;
|
||||||
@@ -53,17 +53,16 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
public boolean add(CsConfigurationParm csConfigurationParm) {
|
public boolean add(CsConfigurationParm csConfigurationParm) {
|
||||||
CsConfigurationPO csConfigurationPO = new CsConfigurationPO();
|
CsConfigurationPO csConfigurationPO = new CsConfigurationPO();
|
||||||
|
|
||||||
BeanUtils.copyProperties(csConfigurationParm,csConfigurationPO);
|
BeanUtils.copyProperties(csConfigurationParm, csConfigurationPO);
|
||||||
|
|
||||||
List<String> projectIds = csConfigurationParm.getProjectIds();
|
List<String> projectIds = csConfigurationParm.getProjectIds();
|
||||||
if(CollectionUtils.isEmpty(projectIds)){
|
String projects = "";
|
||||||
throw new BusinessException("请选择项目");
|
if (!CollectionUtils.isEmpty(projectIds)) {
|
||||||
|
projects = String.join(",", projectIds);
|
||||||
}
|
}
|
||||||
String projects = String.join(",", projectIds);
|
|
||||||
|
|
||||||
csConfigurationPO.setProjectIds(projects);
|
csConfigurationPO.setProjectIds(projects);
|
||||||
//排序不填给个100往后排
|
//排序不填给个100往后排
|
||||||
csConfigurationPO.setOrderBy(Objects.isNull(csConfigurationParm.getOrderBy())?100:csConfigurationParm.getOrderBy());
|
csConfigurationPO.setOrderBy(Objects.isNull(csConfigurationParm.getOrderBy()) ? 100 : csConfigurationParm.getOrderBy());
|
||||||
csConfigurationPO.setImagePath(csConfigurationParm.getFileContent());
|
csConfigurationPO.setImagePath(csConfigurationParm.getFileContent());
|
||||||
|
|
||||||
csConfigurationPO.setStatus("1");
|
csConfigurationPO.setStatus("1");
|
||||||
@@ -71,7 +70,7 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
|
|
||||||
String name = csConfigurationPO.getName();
|
String name = csConfigurationPO.getName();
|
||||||
Integer count = this.lambdaQuery().eq(CsConfigurationPO::getName, name).eq(CsConfigurationPO::getStatus, "1").count();
|
Integer count = this.lambdaQuery().eq(CsConfigurationPO::getName, name).eq(CsConfigurationPO::getStatus, "1").count();
|
||||||
if(count>1){
|
if (count > 1) {
|
||||||
throw new BusinessException("存在相同的组态项目名称在其他工程项目中,无法新建");
|
throw new BusinessException("存在相同的组态项目名称在其他工程项目中,无法新建");
|
||||||
}
|
}
|
||||||
return save;
|
return save;
|
||||||
@@ -80,30 +79,30 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
@Override
|
@Override
|
||||||
public boolean audit(CsConfigurationParm.CsConfigurationAuditParam auditParm) {
|
public boolean audit(CsConfigurationParm.CsConfigurationAuditParam auditParm) {
|
||||||
CsConfigurationPO csConfigurationPO = new CsConfigurationPO();
|
CsConfigurationPO csConfigurationPO = new CsConfigurationPO();
|
||||||
if(Objects.equals(auditParm.getStatus(),"0")){
|
if (Objects.equals(auditParm.getStatus(), "0")) {
|
||||||
csConfigurationPO.setId(auditParm.getId());
|
csConfigurationPO.setId(auditParm.getId());
|
||||||
csConfigurationPO.setStatus("0");
|
csConfigurationPO.setStatus("0");
|
||||||
boolean b = this.updateById(csConfigurationPO);
|
boolean b = this.updateById(csConfigurationPO);
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
Integer count = this.lambdaQuery().eq(CsConfigurationPO::getName, auditParm.getName()).ne(CsConfigurationPO::getId,auditParm.getId()).eq(CsConfigurationPO::getStatus, "1").count();
|
Integer count = this.lambdaQuery().eq(CsConfigurationPO::getName, auditParm.getName()).ne(CsConfigurationPO::getId, auditParm.getId()).eq(CsConfigurationPO::getStatus, "1").count();
|
||||||
if(count>0){
|
if (count > 0) {
|
||||||
throw new BusinessException("修改名称失败,存在相同的组态项目");
|
throw new BusinessException("修改名称失败,存在相同的组态项目");
|
||||||
}
|
}
|
||||||
BeanUtils.copyProperties(auditParm,csConfigurationPO);
|
BeanUtils.copyProperties(auditParm, csConfigurationPO);
|
||||||
|
|
||||||
List<String> projectIds = auditParm.getProjectIds();
|
List<String> projectIds = auditParm.getProjectIds();
|
||||||
if(!CollectionUtils.isEmpty(projectIds)){
|
if (!CollectionUtils.isEmpty(projectIds)) {
|
||||||
String projects = String.join(",", projectIds);
|
String projects = String.join(",", projectIds);
|
||||||
csConfigurationPO.setProjectIds(projects);
|
csConfigurationPO.setProjectIds(projects);
|
||||||
|
|
||||||
}
|
}
|
||||||
if(!Objects.isNull(auditParm.getOrderBy())){
|
if (!Objects.isNull(auditParm.getOrderBy())) {
|
||||||
csConfigurationPO.setOrderBy(auditParm.getOrderBy()==0?100:auditParm.getOrderBy());
|
csConfigurationPO.setOrderBy(auditParm.getOrderBy() == 0 ? 100 : auditParm.getOrderBy());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Objects.isNull(auditParm.getFileContent())){
|
if (!Objects.isNull(auditParm.getFileContent())) {
|
||||||
String s = fileStorageUtil.uploadStream(writeJsonStringToInputStream(auditParm.getFileContent()), HarmonicConstant.CONFIGURATIONPATH, HarmonicConstant.CONFIGURATIONNAME);
|
String s = fileStorageUtil.uploadStream(writeJsonStringToInputStream(auditParm.getFileContent()), HarmonicConstant.CONFIGURATIONPATH, HarmonicConstant.CONFIGURATIONNAME);
|
||||||
csConfigurationPO.setImagePath(s);
|
csConfigurationPO.setImagePath(s);
|
||||||
}
|
}
|
||||||
@@ -115,19 +114,21 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<CsConfigurationVO> queryPage(CsConfigurationParm.CsConfigurationQueryParam csConfigurationQueryParam) {
|
public IPage<CsConfigurationVO> queryPage(CsConfigurationParm.CsConfigurationQueryParam csConfigurationQueryParam) {
|
||||||
Page<CsConfigurationVO> returnpage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
|
Page<CsConfigurationVO> returnpage = new Page<>(csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize());
|
||||||
Page<CsConfigurationPO> temppage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
|
Page<CsConfigurationPO> temppage = new Page<>(csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize());
|
||||||
|
|
||||||
List<String> data1 = roleEngineerDevFeignClient.getRoleProject().getData();
|
List<String> data1 = roleEngineerDevFeignClient.getRoleProject().getData();
|
||||||
if(CollectionUtils.isEmpty(data1)){
|
// if (CollectionUtils.isEmpty(data1)) {
|
||||||
return returnpage;
|
// return returnpage;
|
||||||
}
|
// }
|
||||||
//+无线项目id
|
//+无线项目id
|
||||||
data1.add(DataParam.WIRELESS_PROJECT_ID);
|
data1.add(DataParam.WIRELESS_PROJECT_ID);
|
||||||
|
String userId = csConfigurationQueryParam.getCurrentUserId();
|
||||||
|
String roleCode = csConfigurationQueryParam.getRoleCode();
|
||||||
|
if (roleCode.contains("operation_manager")) {
|
||||||
Page<CsConfigurationPO> csConfigurationPOPage = this.getBaseMapper().queryPage(temppage,csConfigurationQueryParam,data1,csConfigurationQueryParam.getCurrentUserId());
|
userId = null;
|
||||||
|
}
|
||||||
|
Page<CsConfigurationPO> csConfigurationPOPage = this.getBaseMapper().queryPage(temppage, csConfigurationQueryParam, data1, userId);
|
||||||
// QueryWrapper<CsConfigurationPO> query = new QueryWrapper<>();
|
// QueryWrapper<CsConfigurationPO> query = new QueryWrapper<>();
|
||||||
// query.like(StringUtils.isNotBlank(csConfigurationQueryParam.getSearchValue()),CsConfigurationPO.COL_NAME,csConfigurationQueryParam.getSearchValue()).
|
// query.like(StringUtils.isNotBlank(csConfigurationQueryParam.getSearchValue()),CsConfigurationPO.COL_NAME,csConfigurationQueryParam.getSearchValue()).
|
||||||
// le (StringUtils.isNotBlank (csConfigurationQueryParam.getSearchEndTime()), CsConfigurationPO.COL_CREATE_TIME, csConfigurationQueryParam.getSearchEndTime ( )).
|
// le (StringUtils.isNotBlank (csConfigurationQueryParam.getSearchEndTime()), CsConfigurationPO.COL_CREATE_TIME, csConfigurationQueryParam.getSearchEndTime ( )).
|
||||||
@@ -136,7 +137,7 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
// Page<CsConfigurationPO> csConfigurationPOPage = this.getBaseMapper().selectPage(temppage, query);
|
// Page<CsConfigurationPO> csConfigurationPOPage = this.getBaseMapper().selectPage(temppage, query);
|
||||||
List<String> collect1 = csConfigurationPOPage.getRecords().stream().map(CsConfigurationPO::getCreateBy).collect(Collectors.toList());
|
List<String> collect1 = csConfigurationPOPage.getRecords().stream().map(CsConfigurationPO::getCreateBy).collect(Collectors.toList());
|
||||||
Map<String, String> collect2;
|
Map<String, String> collect2;
|
||||||
if(!CollectionUtils.isEmpty(collect1)){
|
if (!CollectionUtils.isEmpty(collect1)) {
|
||||||
List<User> data = userFeignClient.appuserByIdList(collect1).getData();
|
List<User> data = userFeignClient.appuserByIdList(collect1).getData();
|
||||||
collect2 = data.stream().collect(Collectors.toMap(User::getId, User::getName, (e1, e2) -> e1 + "," + e2));
|
collect2 = data.stream().collect(Collectors.toMap(User::getId, User::getName, (e1, e2) -> e1 + "," + e2));
|
||||||
|
|
||||||
@@ -148,16 +149,16 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
CsConfigurationVO csDevModelPageVO = new CsConfigurationVO();
|
CsConfigurationVO csDevModelPageVO = new CsConfigurationVO();
|
||||||
BeanUtils.copyProperties(page, csDevModelPageVO);
|
BeanUtils.copyProperties(page, csDevModelPageVO);
|
||||||
|
|
||||||
if(StringUtils.isEmpty(page.getProjectIds())){
|
if (StringUtils.isEmpty(page.getProjectIds())) {
|
||||||
csDevModelPageVO.setProjectIds(new ArrayList<>());
|
csDevModelPageVO.setProjectIds(new ArrayList<>());
|
||||||
}else {
|
} else {
|
||||||
csDevModelPageVO.setProjectIds( Arrays.asList(page.getProjectIds().split(",")));
|
csDevModelPageVO.setProjectIds(Arrays.asList(page.getProjectIds().split(",")));
|
||||||
|
|
||||||
}
|
}
|
||||||
if(Objects.isNull(page.getImagePath())){
|
if (Objects.isNull(page.getImagePath())) {
|
||||||
csDevModelPageVO.setFileContent(null);
|
csDevModelPageVO.setFileContent(null);
|
||||||
|
|
||||||
}else {
|
} else {
|
||||||
InputStream fileStream = fileStorageUtil.getFileStream(page.getImagePath());
|
InputStream fileStream = fileStorageUtil.getFileStream(page.getImagePath());
|
||||||
String text = new BufferedReader(
|
String text = new BufferedReader(
|
||||||
new InputStreamReader(fileStream, StandardCharsets.UTF_8))
|
new InputStreamReader(fileStream, StandardCharsets.UTF_8))
|
||||||
@@ -174,13 +175,12 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
returnpage.setTotal(csConfigurationPOPage.getTotal());
|
returnpage.setTotal(csConfigurationPOPage.getTotal());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return returnpage;
|
return returnpage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String uploadImage(MultipartFile issuesFile) {
|
public String uploadImage(MultipartFile issuesFile) {
|
||||||
return fileStorageUtil.getFileUrl( fileStorageUtil.uploadMultipart(issuesFile, HarmonicConstant.CONFIGURATIONPATH));
|
return fileStorageUtil.getFileUrl(fileStorageUtil.uploadMultipart(issuesFile, HarmonicConstant.CONFIGURATIONPATH));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*将strin写入Json文件,返回一个InputStream*/
|
/*将strin写入Json文件,返回一个InputStream*/
|
||||||
|
|||||||
@@ -1126,6 +1126,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
|||||||
Map<String, List<ReportTemplateDTO>> classMap = reportTemplateDTOList.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getResourceId));
|
Map<String, List<ReportTemplateDTO>> classMap = reportTemplateDTOList.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getResourceId));
|
||||||
//定义存放越限指标的map
|
//定义存放越限指标的map
|
||||||
Map<String, ReportTemplateDTO> assNoPassMap = new HashMap<>();
|
Map<String, ReportTemplateDTO> assNoPassMap = new HashMap<>();
|
||||||
|
|
||||||
classMap.forEach((classKey, templateValue) -> {
|
classMap.forEach((classKey, templateValue) -> {
|
||||||
Map<String, List<ReportTemplateDTO>> valueTypeMap = templateValue.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getStatMethod));
|
Map<String, List<ReportTemplateDTO>> valueTypeMap = templateValue.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getStatMethod));
|
||||||
//每张表开启一个独立线程查询
|
//每张表开启一个独立线程查询
|
||||||
@@ -1133,23 +1134,27 @@ public class CustomReportServiceImpl implements CustomReportService {
|
|||||||
// 子线程中手动指定数据源(关键)
|
// 子线程中手动指定数据源(关键)
|
||||||
DynamicDataSourceContextHolder.push("sjzx");
|
DynamicDataSourceContextHolder.push("sjzx");
|
||||||
//avg.max,min,cp95
|
//avg.max,min,cp95
|
||||||
valueTypeMap.forEach((valueTypeKey, valueTypeVal) -> {
|
try {
|
||||||
//相别分组
|
valueTypeMap.forEach((valueTypeKey, valueTypeVal) -> {
|
||||||
Map<String, List<ReportTemplateDTO>> phaseMap = valueTypeVal.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getPhase));
|
//相别分组
|
||||||
phaseMap.forEach((phaseKey, phaseVal) -> {
|
Map<String, List<ReportTemplateDTO>> phaseMap = valueTypeVal.stream().collect(Collectors.groupingBy(ReportTemplateDTO::getPhase));
|
||||||
StringBuilder sql = new StringBuilder(InfluxDbSqlConstant.SELECT);
|
phaseMap.forEach((phaseKey, phaseVal) -> {
|
||||||
if (InfluxDbSqlConstant.MAX.equalsIgnoreCase(valueTypeKey)) {
|
StringBuilder sql = new StringBuilder(InfluxDbSqlConstant.SELECT);
|
||||||
assSqlByMysql(phaseVal, sql, endList, InfluxDbSqlConstant.MAX, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap);
|
if (InfluxDbSqlConstant.MAX.equalsIgnoreCase(valueTypeKey)) {
|
||||||
} else if (InfluxDbSqlConstant.MIN.equalsIgnoreCase(valueTypeKey)) {
|
assSqlByMysql(phaseVal, sql, endList, InfluxDbSqlConstant.MAX, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap);
|
||||||
assSqlByMysql(phaseVal, sql, endList, InfluxDbSqlConstant.MIN, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap);
|
} else if (InfluxDbSqlConstant.MIN.equalsIgnoreCase(valueTypeKey)) {
|
||||||
} else if (InfluxDbSqlConstant.AVG_WEB.equalsIgnoreCase(valueTypeKey)) {
|
assSqlByMysql(phaseVal, sql, endList, InfluxDbSqlConstant.MIN, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap);
|
||||||
assSqlByMysql(phaseVal, sql, endList, InfluxDbSqlConstant.AVG_WEB, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap);
|
} else if (InfluxDbSqlConstant.AVG_WEB.equalsIgnoreCase(valueTypeKey)) {
|
||||||
} else if (InfluxDbSqlConstant.CP95.equalsIgnoreCase(valueTypeKey)) {
|
assSqlByMysql(phaseVal, sql, endList, InfluxDbSqlConstant.AVG_WEB, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap);
|
||||||
assSqlByMysql(phaseVal, sql, endList, InfluxDbSqlConstant.CP95, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap);
|
} else if (InfluxDbSqlConstant.CP95.equalsIgnoreCase(valueTypeKey)) {
|
||||||
}
|
assSqlByMysql(phaseVal, sql, endList, InfluxDbSqlConstant.CP95, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}finally {
|
||||||
|
DynamicDataSourceContextHolder.poll();
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -165,7 +165,6 @@ public class LineTargetServiceImpl implements ILineTargetService {
|
|||||||
}
|
}
|
||||||
String clDid = influxDbParamUtil.getClDidByLineId(item.getLineId());
|
String clDid = influxDbParamUtil.getClDidByLineId(item.getLineId());
|
||||||
//基础信息
|
//基础信息
|
||||||
System.out.println(item.getLineId());
|
|
||||||
CsRtDataVO vo = getLineRtData(item.getId(),item.getLineId(),tempTable[3],tempTable[0],Objects.equals(tempTable[1],"T")?"M":tempTable[1],tempTable[2],targetName,clDid);
|
CsRtDataVO vo = getLineRtData(item.getId(),item.getLineId(),tempTable[3],tempTable[0],Objects.equals(tempTable[1],"T")?"M":tempTable[1],tempTable[2],targetName,clDid);
|
||||||
//设备状态信息
|
//设备状态信息
|
||||||
CsEquipmentDeliveryPO po = equipmentFeignClient.getDevByLineId(item.getLineId()).getData();
|
CsEquipmentDeliveryPO po = equipmentFeignClient.getDevByLineId(item.getLineId()).getData();
|
||||||
@@ -215,7 +214,7 @@ public class LineTargetServiceImpl implements ILineTargetService {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
String s = tempUid.get(tempUid.size() - 1);
|
String s = tempUid.get(tempUid.size() - 1);
|
||||||
String[] tempTable = s.replace("$", "").split("#");
|
String[] tempTable = s.replace("$", "").split("#");
|
||||||
result.add(getLineRtDataNew(item.getId(),item.getLineId(),tempTable[3],tempTable[0],Objects.equals(tempTable[1],"T")?"M":tempTable[1],tempTable[2].toUpperCase(),temp,item.getUnit().get(i)));
|
result.add(getLineRtDataNew(item.getId(),item.getLineId(),tempTable[3],tempTable[0],Objects.equals(tempTable[1],"T")?"M":tempTable[1],tempTable[2],temp,item.getUnit().get(i)));
|
||||||
// result.add(getLineRtData(item.getId(),item.getLineId(),tempUid.get(3),tempUid.get(0),tempUid.get(1),tempUid.get(2).toUpperCase(),temp,"%"));
|
// result.add(getLineRtData(item.getId(),item.getLineId(),tempUid.get(3),tempUid.get(0),tempUid.get(1),tempUid.get(2).toUpperCase(),temp,"%"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -273,13 +272,6 @@ public class LineTargetServiceImpl implements ILineTargetService {
|
|||||||
*/
|
*/
|
||||||
public CsRtDataVO getLineRtData(String id,String lineId, String tableName, String columnName, String phasic, String dataType, String target, String cldId) {
|
public CsRtDataVO getLineRtData(String id,String lineId, String tableName, String columnName, String phasic, String dataType, String target, String cldId) {
|
||||||
CsRtDataVO csRtDataVO = new CsRtDataVO();
|
CsRtDataVO csRtDataVO = new CsRtDataVO();
|
||||||
log.info("---------------------------------------------------------------------------------------------------------------");
|
|
||||||
log.info(lineId);
|
|
||||||
log.info(tableName);
|
|
||||||
log.info(columnName);
|
|
||||||
log.info(phasic);
|
|
||||||
log.info(dataType);
|
|
||||||
log.info(cldId);
|
|
||||||
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,tableName,columnName,phasic,dataType,cldId);
|
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,tableName,columnName,phasic,dataType,cldId);
|
||||||
if(Objects.isNull(statisticalDataDTO)){
|
if(Objects.isNull(statisticalDataDTO)){
|
||||||
statisticalDataDTO = new StatisticalDataDTO();
|
statisticalDataDTO = new StatisticalDataDTO();
|
||||||
@@ -311,7 +303,8 @@ public class LineTargetServiceImpl implements ILineTargetService {
|
|||||||
*/
|
*/
|
||||||
public CsRtDataVO getLineRtDataNew(String id,String lineId, String tableName, String columnName, String phasic, String dataType, String target,String uint) {
|
public CsRtDataVO getLineRtDataNew(String id,String lineId, String tableName, String columnName, String phasic, String dataType, String target,String uint) {
|
||||||
CsRtDataVO csRtDataVO = new CsRtDataVO();
|
CsRtDataVO csRtDataVO = new CsRtDataVO();
|
||||||
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,tableName,columnName,phasic,dataType,null);
|
String clDid = influxDbParamUtil.getClDidByLineId(lineId);
|
||||||
|
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,tableName,columnName,phasic,dataType,clDid);
|
||||||
if(Objects.isNull(statisticalDataDTO)){
|
if(Objects.isNull(statisticalDataDTO)){
|
||||||
statisticalDataDTO = new StatisticalDataDTO();
|
statisticalDataDTO = new StatisticalDataDTO();
|
||||||
statisticalDataDTO.setLineId(lineId);
|
statisticalDataDTO.setLineId(lineId);
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ public class ReportServiceImpl implements ReportService {
|
|||||||
return value.stream().filter(x -> x.getValueType().equals(name)).map(temp -> {
|
return value.stream().filter(x -> x.getValueType().equals(name)).map(temp -> {
|
||||||
BigDecimal o = null;
|
BigDecimal o = null;
|
||||||
try {
|
try {
|
||||||
o = (BigDecimal) finalField.get(temp);
|
o = BigDecimal.valueOf((Double) finalField.get(temp));
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user