Compare commits
79 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3727b5777e | |||
| c3cb9a5f85 | |||
| 05ef7028c4 | |||
| 736b0a6e60 | |||
| cc63cead04 | |||
| 30bc3c7448 | |||
| 51a16c5701 | |||
| 4497699178 | |||
| 0ac51648f4 | |||
| fb515cca9b | |||
| 14d77725aa | |||
| ee87ffb0d4 | |||
| 5ff8c946aa | |||
| cccc73f211 | |||
| 4882151ccd | |||
| b774b7ce91 | |||
| 6b0feb1320 | |||
| e92326c55d | |||
| 7abbfd500b | |||
| 77360ef468 | |||
| b38d3bad1b | |||
| 27aebf2ca4 | |||
| 9981b04ed6 | |||
| f8c9828369 | |||
| 0d652b9f4d | |||
| 3ea67da152 | |||
| c7dce89d36 | |||
| e7dbee2df5 | |||
| 29168bbd9f | |||
| 56d88939c4 | |||
| bc6f3dca80 | |||
| 2957188466 | |||
| 2894a4780b | |||
| 240ec304b0 | |||
| ae09cc1996 | |||
| efdb1781da | |||
|
|
46aef0d97f | ||
|
|
5539c8fed5 | ||
|
|
10d93c260c | ||
| 4ee100a72b | |||
|
|
958f1858fc | ||
|
|
791aac26c0 | ||
| 3526926034 | |||
| 3753544e5f | |||
| e6df543f1d | |||
|
|
f86a3c4167 | ||
| 29681d200d | |||
|
|
9ff0f40349 | ||
|
|
24187ca6d9 | ||
| f33986e934 | |||
|
|
cea2b9694a | ||
| 8e4c4383c0 | |||
| cdd1b5075c | |||
| ea54b2b907 | |||
|
|
61c8656fd9 | ||
| 02e5100426 | |||
| 85ae7e7ddb | |||
| 9ae17b14f5 | |||
|
|
f7477ea8ff | ||
| 9c6a74a2d6 | |||
| d346e80a88 | |||
|
|
0227d0731c | ||
|
|
e34721c035 | ||
| 2451df7d8d | |||
| 6e5aab4791 | |||
| adb811e9df | |||
|
|
340ba18f99 | ||
|
|
e320685af1 | ||
|
|
400b9fd9c1 | ||
|
|
ce0b9892c2 | ||
| 2fb11ecaaf | |||
| b7574b2916 | |||
| 43bdcbf623 | |||
| 629ba0746a | |||
| b86c81d70a | |||
| d10240758b | |||
| 995bd8b310 | |||
| 9531e18e93 | |||
| 753a22eb4c |
@@ -4,18 +4,14 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.njcn.cloud.enums.app.UserCodeEnum;
|
||||
import com.njcn.cloud.pojo.vo.AdminStatistic.Integrity;
|
||||
import com.njcn.cloud.pojo.vo.AdminStatistic.StaticInfo;
|
||||
import com.njcn.cloud.service.AdminStatistic.DataIntegrityService;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.api.LineIntegrityClient;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.LineDeviceStateVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.po.User;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@@ -10,12 +10,14 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.po.User;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -54,7 +56,7 @@ public class StaticServiceImpl implements StaticService {
|
||||
//获取终端信息
|
||||
List<DevDetail> devDetails = generalDeviceInfoClient.getDevInfoByIds(new ArrayList<>()).getData();
|
||||
//获取终端在线率
|
||||
List<RStatOnlinerateVO> onlineRates = generalDeviceInfoClient.getOnlineRateByDevIds(param).getData();
|
||||
List<RStatOnlineRateVO> onlineRates = generalDeviceInfoClient.getOnlineRateByDevIds(param).getData();
|
||||
//异常终端数据
|
||||
long count = devDetails.stream().filter(x -> 0==x.getComFlag()).count();
|
||||
StaticInfo info=new StaticInfo();
|
||||
@@ -63,14 +65,14 @@ public class StaticServiceImpl implements StaticService {
|
||||
info.setOnlineRatez(data);
|
||||
info.setComError(count);
|
||||
List<StaticInfo.DevStatic> list=new ArrayList<>();
|
||||
Map<String, Float> onlineRateMap = onlineRates.stream().collect(Collectors.toMap(RStatOnlinerateVO::getDevIndex, RStatOnlinerateVO::getOnlineRate));
|
||||
Map<String, BigDecimal> onlineRateMap = onlineRates.stream().collect(Collectors.toMap(RStatOnlineRateVO::getDevIndex, RStatOnlineRateVO::getOnlineRate));
|
||||
StaticInfo.DevStatic devStatic;
|
||||
for (DevDetail devDetail : devDetails) {
|
||||
devStatic=new StaticInfo.DevStatic();
|
||||
devStatic.setDevIndex(devDetail.getDevIndex());
|
||||
devStatic.setDevName(devDetail.getDevName());
|
||||
devStatic.setIp(devDetail.getIp());
|
||||
devStatic.setOnlineRate(onlineRateMap.get(devDetail.getDevIndex()));
|
||||
devStatic.setOnlineRate(onlineRateMap.get(devDetail.getDevIndex()).setScale(3, RoundingMode.HALF_UP).floatValue());
|
||||
devStatic.setGdName(devDetail.getGdName());
|
||||
devStatic.setSubName(devDetail.getBdzName());
|
||||
devStatic.setTimeId(devDetail.getTimeID());
|
||||
@@ -80,4 +82,4 @@ public class StaticServiceImpl implements StaticService {
|
||||
return info;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,12 +35,6 @@
|
||||
<artifactId>common-microservice</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>cs-warn-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>user-api</artifactId>
|
||||
@@ -59,6 +53,12 @@
|
||||
<artifactId>common-device-biz</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.afterturn</groupId>
|
||||
<artifactId>easypoi-base</artifactId>
|
||||
<version>4.4.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
@@ -22,4 +22,13 @@ public interface CsCommTerminalFeignClient {
|
||||
|
||||
@GetMapping("lineUnitDetail")
|
||||
HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId);
|
||||
|
||||
@GetMapping("getDevIdsByUser")
|
||||
HttpResult<List<String>> getDevIdsByUser(@RequestParam("userId") String userId);
|
||||
|
||||
@GetMapping("getLineIdsByUser")
|
||||
HttpResult<List<String>> getLineIdsByUser(@RequestParam("userId") String userId);
|
||||
|
||||
@GetMapping("getPqUserIdsByUser")
|
||||
HttpResult<List<String>> getPqUserIdsByUser(@RequestParam("userId") String userId);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.csdevice.api;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.fallback.CsDeviceUserClientFallbackFactory;
|
||||
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -22,4 +23,10 @@ public interface CsDeviceUserFeignClient {
|
||||
|
||||
@PostMapping("/findUserById")
|
||||
HttpResult<List<String>> findUserById(@RequestParam("id") String id);
|
||||
|
||||
@PostMapping("/findDevByUserId")
|
||||
HttpResult<List<String>> findDevByUserId(@RequestParam("id") String id);
|
||||
|
||||
@PostMapping("/channelDevByUserId")
|
||||
HttpResult<List<String>> channelDevByUserId(@RequestBody UserDevParam param);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
package com.njcn.csdevice.api;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
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.csdevice.api.fallback.CsLedgerFeignClientFallbackFactory;
|
||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
||||
import com.njcn.csdevice.pojo.param.CsLedgerParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -47,5 +42,15 @@ public interface CsLedgerFeignClient {
|
||||
@PostMapping("/getAllLedger")
|
||||
HttpResult<List<CsLedgerVO>> getAllLedger();
|
||||
|
||||
@PostMapping("/getInfoByIds")
|
||||
HttpResult<List<DevDetailDTO>> getInfoByIds(@RequestBody @Validated List<String> list);
|
||||
|
||||
@PostMapping("/getDevInfoByEngineerIds")
|
||||
@ApiOperation("根据工程获取设备信息")
|
||||
HttpResult<List<DevDetailDTO>> getDevInfoByEngineerIds(@RequestBody @Validated List<String> list);
|
||||
|
||||
@PostMapping("/getEngineeringHaveDevs")
|
||||
@ApiOperation("根据工程信息获取有设备的工程")
|
||||
HttpResult<List<DevDetailDTO>> getEngineeringHaveDevs(@RequestBody @Validated List<String> list);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,26 @@
|
||||
package com.njcn.csdevice.api;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
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.csdevice.api.fallback.CsLineClientFallbackFactory;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
@@ -31,6 +40,10 @@ public interface CsLineFeignClient {
|
||||
@PostMapping("/findByNdid")
|
||||
HttpResult<List<CsLinePO>> findByNdid(@RequestParam("id") String id);
|
||||
|
||||
|
||||
@GetMapping("/getCustomDetailByLineId")
|
||||
HttpResult<Map<String,String>> getCustomDetailByLineId(@RequestParam("id") String id);
|
||||
|
||||
@PostMapping("/getPositionById")
|
||||
HttpResult<String> getPositionById(@RequestParam("id") String id);
|
||||
|
||||
@@ -48,4 +61,27 @@ public interface CsLineFeignClient {
|
||||
|
||||
@PostMapping("/updateLineDataByList")
|
||||
HttpResult<String> updateDataByList(@RequestParam("list") List<String> list, @RequestParam("id") String id, @RequestParam("setId") String setId);
|
||||
|
||||
@PostMapping("/getLineByName")
|
||||
HttpResult<List<CsLinePO>> getLineByName(@RequestParam("lineName") String lineName);
|
||||
|
||||
@PostMapping("/getAllLine")
|
||||
HttpResult<List<String>> getAllLine();
|
||||
|
||||
@PostMapping("/getOverLimitDataByIds")
|
||||
HttpResult<List<Overlimit>> getOverLimitData(@RequestBody List<String> ids);
|
||||
|
||||
@PostMapping("/getLineBySensitiveUser")
|
||||
@ApiOperation("根据敏感用户查询监测点")
|
||||
HttpResult<List<CsLinePO>> getLineBySensitiveUser(@RequestBody List<String> list);
|
||||
|
||||
@PostMapping("/list")
|
||||
HttpResult<List<CsLinePO>> list(@RequestBody CsLinePO param);
|
||||
|
||||
@PostMapping("/getLineDetailData")
|
||||
HttpResult<LineDetailDataVO> getLineDetailData(@RequestParam("id") String id);
|
||||
|
||||
@GetMapping("/getSimpleLine")
|
||||
HttpResult<List<CsLinePO>> getSimpleLine();
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.njcn.csdevice.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.fallback.CsOverLimitFallbackFactory;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监测点数据完整性
|
||||
* @author cdf
|
||||
* @date 2023/6/7
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT,
|
||||
path = "/overLimit",
|
||||
fallbackFactory = CsOverLimitFallbackFactory.class,contextId = "overLimit")
|
||||
public interface CsOverLimitClient {
|
||||
|
||||
/**
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/6/7
|
||||
*/
|
||||
@PostMapping("/getOverLimitByLineIds")
|
||||
HttpResult<List<Overlimit>> getOverLimitByLineIds(@RequestBody List<String> lineIds);
|
||||
|
||||
/**
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/6/7
|
||||
*/
|
||||
@PostMapping("/getLimitMapsByLineIds")
|
||||
HttpResult<List<Map<String, Object>>> getLimitMapsByLineIds(@RequestBody List<String> lineIds);
|
||||
}
|
||||
@@ -3,9 +3,12 @@ package com.njcn.csdevice.api;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.fallback.CsTerminalReplyClientFallbackFactory;
|
||||
import com.njcn.csdevice.param.IcdBzReplyParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
@@ -15,6 +18,13 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
public interface CsTerminalReplyFeignClient {
|
||||
|
||||
@PostMapping("/updateData")
|
||||
HttpResult<String> updateData(@RequestParam("id") String id,@RequestParam("state") Integer state,@RequestParam("deviceId") String deviceId);
|
||||
@ApiOperation("更新推送结果")
|
||||
HttpResult<String> updateData(@RequestBody @Validated IcdBzReplyParam param);
|
||||
|
||||
|
||||
@PostMapping("/updateBzData")
|
||||
@ApiOperation("更新补召推送结果")
|
||||
HttpResult<String> updateBzData(@RequestBody @Validated IcdBzReplyParam param);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.csdevice.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.fallback.CsTerminalLogsClientFallbackFactory;
|
||||
import com.njcn.csdevice.api.fallback.IcdFallbackFactory;
|
||||
import com.njcn.csdevice.param.IcdBzParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/icd", fallbackFactory = IcdFallbackFactory.class,contextId = "icd")
|
||||
|
||||
public interface IcdFeignClient {
|
||||
|
||||
@PostMapping("/bzEvent")
|
||||
@ApiOperation("补召事件")
|
||||
HttpResult<String> bzEvent(@RequestBody @Validated IcdBzParam param);
|
||||
|
||||
@PostMapping("/bzFile")
|
||||
@ApiOperation("补召波形")
|
||||
HttpResult<String> bzFile(@RequestBody @Validated IcdBzParam param);
|
||||
|
||||
}
|
||||
@@ -9,6 +9,8 @@ import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@@ -31,6 +33,24 @@ public class CsCommTerminalFeignClientFallbackFactory implements FallbackFactory
|
||||
log.error("{}异常,降级处理,异常为:{}","查询分组",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<String>> getDevIdsByUser(String userId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据登录用户id获取用户所有设备id集合",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<String>> getLineIdsByUser(String userId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据登录用户id获取用户所有监测点id集合",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<String>> getPqUserIdsByUser(String userId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据登录用户id获取电能质量用户id集合",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.CsDeviceUserFeignClient;
|
||||
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -38,6 +39,18 @@ public class CsDeviceUserClientFallbackFactory implements FallbackFactory<CsDevi
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<String>> findDevByUserId(String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据用户Id查询设备集合",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<String>> channelDevByUserId(UserDevParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据用户Id解绑设备集合异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,24 @@ public class CsLedgerFeignClientFallbackFactory implements FallbackFactory<CsLed
|
||||
log.error("{}异常,降级处理,异常为:{}","获取台账树所有数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<DevDetailDTO>> getInfoByIds(List<String> list) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据设备集合查询工程,设备信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<DevDetailDTO>> getDevInfoByEngineerIds(List<String> list) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据工程获取设备信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<DevDetailDTO>> getEngineeringHaveDevs(List<String> list) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据工程获取设备信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,15 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
@@ -51,6 +55,12 @@ public class CsLineClientFallbackFactory implements FallbackFactory<CsLineFeignC
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Map<String,String>> getCustomDetailByLineId(@RequestParam("id") String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据id查询监测点",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> getPositionById(String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}","通过id查询监测点位置",cause.toString());
|
||||
@@ -86,6 +96,47 @@ public class CsLineClientFallbackFactory implements FallbackFactory<CsLineFeignC
|
||||
log.error("{}异常,降级处理,异常为:{}","根据装置集合修改监测点信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<String>> getAllLine() {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取所有监测点id",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<Overlimit>> getOverLimitData(List<String> ids) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据监测点id集合获取国标限值异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<CsLinePO>> getLineBySensitiveUser(List<String> list) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据敏感用户查询监测点异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<CsLinePO>> getLineByName(String lineName) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据名称查询监测点异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
@Override
|
||||
public HttpResult<List<CsLinePO>> list(CsLinePO param) {
|
||||
log.error("{}异常,降级处理,异常为:{}","查询监测点列表异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<LineDetailDataVO> getLineDetailData(@RequestParam("id") String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}","查询监测点详情异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<CsLinePO>> getSimpleLine() {
|
||||
log.error("{}异常,降级处理,异常为:{}","查询登录用户拥有的监测点台账",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.njcn.csdevice.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.CsOverLimitClient;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 告警管理熔断降级
|
||||
* @author yzh
|
||||
* @date 2022/9/19
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CsOverLimitFallbackFactory implements FallbackFactory<CsOverLimitClient> {
|
||||
@Override
|
||||
public CsOverLimitClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = DeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new CsOverLimitClient() {
|
||||
@Override
|
||||
public HttpResult<List<Overlimit>> getOverLimitByLineIds(List<String> lineIds) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "监测点限值", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<Map<String, Object>>> getLimitMapsByLineIds(List<String> lineIds) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取监测点限值map", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.CsTerminalReplyFeignClient;
|
||||
import com.njcn.csdevice.param.IcdBzReplyParam;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -23,9 +24,16 @@ public class CsTerminalReplyClientFallbackFactory implements FallbackFactory<CsT
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new CsTerminalReplyFeignClient() {
|
||||
|
||||
@Override
|
||||
public HttpResult<String> updateData(String id, Integer state, String deviceId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","更新推送结果",cause.toString());
|
||||
public HttpResult<String> updateData(IcdBzReplyParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}","更新推送结果异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> updateBzData(IcdBzReplyParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}","更新补召推送结果异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.njcn.csdevice.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.IcdFeignClient;
|
||||
import com.njcn.csdevice.param.IcdBzParam;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class IcdFallbackFactory implements FallbackFactory<IcdFeignClient> {
|
||||
@Override
|
||||
public IcdFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (cause.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new IcdFeignClient() {
|
||||
@Override
|
||||
public HttpResult<String> bzEvent(IcdBzParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}","定时补召事件异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> bzFile(IcdBzParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}","定时补召波形异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public interface DataParam {
|
||||
|
||||
String GOVERNANCE_SYSTEM = "治理系统";
|
||||
|
||||
String cldDev = "云前置设备";
|
||||
String cldDev = "监测设备";
|
||||
|
||||
String EvtParamPhase = "Evt_Param_Phase";
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.csdevice.param;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Data
|
||||
public class IcdBzParam implements Serializable {
|
||||
|
||||
@ApiModelProperty("监测点集合")
|
||||
private List<String> lineList;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty("结束时间")
|
||||
private String endTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.csdevice.param;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Data
|
||||
public class IcdBzReplyParam implements Serializable {
|
||||
|
||||
@ApiModelProperty("guid")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private Integer state;
|
||||
|
||||
@ApiModelProperty("设备id")
|
||||
private String deviceId;
|
||||
|
||||
@ApiModelProperty("监测点id")
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty("响应码")
|
||||
private Integer code;
|
||||
|
||||
@ApiModelProperty("响应消息")
|
||||
private String msg;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.csdevice.param;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Data
|
||||
public class IcdNodeParam implements Serializable {
|
||||
|
||||
@ApiModelProperty("设备id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("前置服务器id")
|
||||
private String nodeId;
|
||||
|
||||
@ApiModelProperty("进程号")
|
||||
private Integer processNo;
|
||||
}
|
||||
@@ -55,4 +55,7 @@ public class AppProjectAddParm {
|
||||
@ApiModelProperty(value="拓扑图模版id集合")
|
||||
private List<String> topoIds;
|
||||
|
||||
@ApiModelProperty(value="排序")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
|
||||
@@ -44,4 +44,7 @@ public class AppProjectAuditParm {
|
||||
private List<String> topoIds;
|
||||
|
||||
private List<String> newTopoIds;
|
||||
|
||||
@ApiModelProperty(value="排序")
|
||||
private Integer sort;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,10 @@ public class CsEngineeringAddParm {
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String description;
|
||||
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@@ -54,6 +54,7 @@ public class CsEngineeringAuditParm {
|
||||
@ApiModelProperty(value="0:删除 1:正常")
|
||||
private String status;
|
||||
|
||||
|
||||
@ApiModelProperty(value="排序")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
@@ -53,21 +55,25 @@ public class CsLineParam extends BaseEntity {
|
||||
/**
|
||||
* PT一次变比
|
||||
*/
|
||||
@Min(value = 1, message = "PT一次变比必须大于等于1")
|
||||
private Double ptRatio;
|
||||
|
||||
/**
|
||||
* PT二次变比
|
||||
*/
|
||||
@Min(value = 1, message = "PT二次变比必须大于等于1")
|
||||
private Double pt2Ratio;
|
||||
|
||||
/**
|
||||
* CT一次变比
|
||||
*/
|
||||
@Min(value = 1, message = "CT一次变比必须大于等于1")
|
||||
private Double ctRatio;
|
||||
|
||||
/**
|
||||
* CT二次变比
|
||||
*/
|
||||
@Min(value = 1, message = "CT二次变比必须大于等于1")
|
||||
private Double ct2Ratio;
|
||||
|
||||
/**
|
||||
@@ -99,4 +105,46 @@ public class CsLineParam extends BaseEntity {
|
||||
* 运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)
|
||||
*/
|
||||
private Integer runStatus;
|
||||
|
||||
/**
|
||||
* 短路容量
|
||||
*/
|
||||
private Double shortCircuitCapacity;
|
||||
|
||||
/**
|
||||
* 设备容量
|
||||
*/
|
||||
private Double devCapacity;
|
||||
|
||||
/**
|
||||
* 基准容量
|
||||
*/
|
||||
private Double basicCapacity;
|
||||
|
||||
/**
|
||||
* 协议容量
|
||||
*/
|
||||
private Double protocolCapacity;
|
||||
|
||||
/**
|
||||
* 监测对象类型
|
||||
*/
|
||||
private String monitorObj;
|
||||
/**
|
||||
* 是否治理(0:未治理 1:已治理)
|
||||
*/
|
||||
private Integer govern;
|
||||
|
||||
/**
|
||||
* 敏感用户ID
|
||||
*/
|
||||
private String monitorUser;
|
||||
|
||||
/**
|
||||
* 监测位置
|
||||
*/
|
||||
private String position;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -23,31 +23,31 @@ public class DeviceExcelTemplete implements Serializable {
|
||||
/**
|
||||
* 装置名称
|
||||
*/
|
||||
@Excel(name = "装置名称", width = 15)
|
||||
@Excel(name = "设备名称", width = 15)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 网关识别码
|
||||
*/
|
||||
@Excel(name = "网关识别码", width = 15)
|
||||
@Excel(name = "网络设备ID", width = 15)
|
||||
private String ndid;
|
||||
|
||||
/**
|
||||
* 装置类型(直连设备、网关设备、装置)
|
||||
*/
|
||||
@Excel(name = "装置类型(直连设备,网关设备)", width = 30)
|
||||
@Excel(name = "设备类型(直连设备,网关设备、便携式设备)", width = 30)
|
||||
private String devType;
|
||||
|
||||
/**
|
||||
* 装置型号(pqs588、pqs680...)
|
||||
*/
|
||||
@Excel(name = "装置型号", width = 15)
|
||||
@Excel(name = "设备型号", width = 15)
|
||||
private String devModel;
|
||||
|
||||
/**
|
||||
* 装置接入方式(mqtt、cloud)
|
||||
*/
|
||||
@Excel(name = "装置接入方式(mqtt、cloud)", width = 25)
|
||||
@Excel(name = "通讯协议(MQTT、CLD)", width = 25)
|
||||
private String devAccessMethod;
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.csdevice.pojo.param;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class UserDevParam implements Serializable {
|
||||
|
||||
@ApiModelProperty(value="用户id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value="设备集合id")
|
||||
private List<String> list;
|
||||
|
||||
}
|
||||
@@ -57,5 +57,8 @@ public class AppProjectPO extends BaseEntity {
|
||||
@TableField(value = "description")
|
||||
private String description;
|
||||
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
|
||||
}
|
||||
@@ -64,5 +64,10 @@ public class CsEngineeringPO extends BaseEntity {
|
||||
@TableField(value = "status")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@@ -122,4 +122,47 @@ public class CsLinePO extends BaseEntity {
|
||||
*/
|
||||
@TableField(value = "line_no")
|
||||
private Integer lineNo;
|
||||
}
|
||||
/**
|
||||
* 监测对象类型
|
||||
*/
|
||||
@TableField(value = "monitor_obj")
|
||||
private String monitorObj;
|
||||
/**
|
||||
* 是否治理(0:未治理 1:已治理)
|
||||
*/
|
||||
@TableField(value = "is_govern")
|
||||
private Integer govern;
|
||||
|
||||
@TableField(value = "monitor_user")
|
||||
private String monitorUser;
|
||||
|
||||
/**
|
||||
* 短路容量
|
||||
*/
|
||||
@TableField(value = "short_circuit_capacity")
|
||||
private Double shortCircuitCapacity;
|
||||
|
||||
/**
|
||||
* 设备容量
|
||||
*/
|
||||
@TableField(value = "dev_capacity")
|
||||
private Double devCapacity;
|
||||
|
||||
/**
|
||||
* 基准容量
|
||||
*/
|
||||
@TableField(value = "basic_capacity")
|
||||
private Double basicCapacity;
|
||||
|
||||
/**
|
||||
* 协议容量
|
||||
*/
|
||||
@TableField(value = "protocol_capacity")
|
||||
private Double protocolCapacity;
|
||||
|
||||
/**
|
||||
* 治理报告文件路径
|
||||
*/
|
||||
@TableField(value = "report_file_path")
|
||||
private String reportFilePath;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -34,6 +32,16 @@ public class CsTerminalLogs extends BaseEntity implements Serializable {
|
||||
*/
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 监测点id
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 前置服务器id
|
||||
*/
|
||||
|
||||
@@ -48,14 +48,34 @@ public class CsTerminalReply extends BaseEntity implements Serializable {
|
||||
private Integer processNo;
|
||||
|
||||
/**
|
||||
* 设备id集合
|
||||
* 设备id
|
||||
*/
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 监测点id
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 是否收到(0:未收到 1:收到)
|
||||
*/
|
||||
private Integer isReceived;
|
||||
|
||||
/**
|
||||
* 接收消息状态码
|
||||
*/
|
||||
private Integer receivedCode;
|
||||
|
||||
/**
|
||||
* 接收消息描述
|
||||
*/
|
||||
private String receivedMsg;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,953 @@
|
||||
//package com.njcn.csdevice.pojo.po;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.annotation.TableField;
|
||||
//import com.baomidou.mybatisplus.annotation.TableName;
|
||||
//import com.njcn.device.biz.utils.COverlimit;
|
||||
//import lombok.Data;
|
||||
//
|
||||
//import java.io.Serializable;
|
||||
//
|
||||
///**
|
||||
// * <p>
|
||||
// *
|
||||
// * </p>
|
||||
// *
|
||||
// * @author cdf
|
||||
// * @since 2022-01-04
|
||||
// */
|
||||
//@Data
|
||||
//@TableName("pq_overlimit")
|
||||
//public class Overlimit implements Serializable {
|
||||
//
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// /**
|
||||
// * 监测点序号
|
||||
// */
|
||||
// private String id;
|
||||
//
|
||||
// /**
|
||||
// * 频率限值
|
||||
// */
|
||||
// private Float freqDev;
|
||||
//
|
||||
// /**
|
||||
// * 电压波动
|
||||
// */
|
||||
// private Float voltageFluctuation;
|
||||
//
|
||||
// /**
|
||||
// * 电压上偏差限值
|
||||
// */
|
||||
// private Float voltageDev;
|
||||
//
|
||||
// /**
|
||||
// * 电压下偏差限值
|
||||
// */
|
||||
// private Float uvoltageDev;
|
||||
//
|
||||
// /**
|
||||
// * 三相电压不平衡度限值
|
||||
// */
|
||||
// private Float ubalance;
|
||||
//
|
||||
// /**
|
||||
// * 短时电压不平衡度限值
|
||||
// */
|
||||
// private Float shortUbalance;
|
||||
//
|
||||
// /**
|
||||
// * 闪变限值
|
||||
// */
|
||||
// private Float flicker;
|
||||
//
|
||||
// /**
|
||||
// * 电压总谐波畸变率限值
|
||||
// */
|
||||
// private Float uaberrance;
|
||||
//
|
||||
// /**
|
||||
// * 负序电流限值
|
||||
// */
|
||||
// private Float iNeg;
|
||||
//
|
||||
// /**
|
||||
// * 2次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_2")
|
||||
// private Float uharm2;
|
||||
//
|
||||
// /**
|
||||
// * 3次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_3")
|
||||
// private Float uharm3;
|
||||
//
|
||||
// /**
|
||||
// * 4次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_4")
|
||||
// private Float uharm4;
|
||||
//
|
||||
// /**
|
||||
// * 5次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_5")
|
||||
// private Float uharm5;
|
||||
//
|
||||
// /**
|
||||
// * 6次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_6")
|
||||
// private Float uharm6;
|
||||
//
|
||||
// /**
|
||||
// * 7次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_7")
|
||||
// private Float uharm7;
|
||||
//
|
||||
// /**
|
||||
// * 8次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_8")
|
||||
// private Float uharm8;
|
||||
//
|
||||
// /**
|
||||
// * 9次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_9")
|
||||
// private Float uharm9;
|
||||
//
|
||||
// /**
|
||||
// * 10次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_10")
|
||||
// private Float uharm10;
|
||||
//
|
||||
// /**
|
||||
// * 11次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_11")
|
||||
// private Float uharm11;
|
||||
//
|
||||
// /**
|
||||
// * 12次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_12")
|
||||
// private Float uharm12;
|
||||
//
|
||||
// /**
|
||||
// * 13次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_13")
|
||||
// private Float uharm13;
|
||||
//
|
||||
// /**
|
||||
// * 14次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_14")
|
||||
// private Float uharm14;
|
||||
//
|
||||
// /**
|
||||
// * 15次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_15")
|
||||
// private Float uharm15;
|
||||
//
|
||||
// /**
|
||||
// * 16次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_16")
|
||||
// private Float uharm16;
|
||||
//
|
||||
// /**
|
||||
// * 17次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_17")
|
||||
// private Float uharm17;
|
||||
//
|
||||
// /**
|
||||
// * 18次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_18")
|
||||
// private Float uharm18;
|
||||
//
|
||||
// /**
|
||||
// * 19次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_19")
|
||||
// private Float uharm19;
|
||||
//
|
||||
// /**
|
||||
// * 20次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_20")
|
||||
// private Float uharm20;
|
||||
//
|
||||
// /**
|
||||
// * 21次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_21")
|
||||
// private Float uharm21;
|
||||
//
|
||||
// /**
|
||||
// * 22次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_22")
|
||||
// private Float uharm22;
|
||||
//
|
||||
// /**
|
||||
// * 23次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_23")
|
||||
// private Float uharm23;
|
||||
//
|
||||
// /**
|
||||
// * 24次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_24")
|
||||
// private Float uharm24;
|
||||
//
|
||||
// /**
|
||||
// * 25次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_25")
|
||||
// private Float uharm25;
|
||||
//
|
||||
// /**
|
||||
// * 2次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_26")
|
||||
// private Float uharm26;
|
||||
//
|
||||
// /**
|
||||
// * 3次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_27")
|
||||
// private Float uharm27;
|
||||
//
|
||||
// /**
|
||||
// * 4次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_28")
|
||||
// private Float uharm28;
|
||||
//
|
||||
// /**
|
||||
// * 5次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_29")
|
||||
// private Float uharm29;
|
||||
//
|
||||
// /**
|
||||
// * 6次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_30")
|
||||
// private Float uharm30;
|
||||
//
|
||||
// /**
|
||||
// * 7次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_31")
|
||||
// private Float uharm31;
|
||||
//
|
||||
// /**
|
||||
// * 8次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_32")
|
||||
// private Float uharm32;
|
||||
//
|
||||
// /**
|
||||
// * 9次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_33")
|
||||
// private Float uharm33;
|
||||
//
|
||||
// /**
|
||||
// * 10次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_34")
|
||||
// private Float uharm34;
|
||||
//
|
||||
// /**
|
||||
// * 11次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_35")
|
||||
// private Float uharm35;
|
||||
//
|
||||
// /**
|
||||
// * 12次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_36")
|
||||
// private Float uharm36;
|
||||
//
|
||||
// /**
|
||||
// * 13次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_37")
|
||||
// private Float uharm37;
|
||||
//
|
||||
// /**
|
||||
// * 14次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_38")
|
||||
// private Float uharm38;
|
||||
//
|
||||
// /**
|
||||
// * 15次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_39")
|
||||
// private Float uharm39;
|
||||
//
|
||||
// /**
|
||||
// * 16次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_40")
|
||||
// private Float uharm40;
|
||||
//
|
||||
// /**
|
||||
// * 17次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_41")
|
||||
// private Float uharm41;
|
||||
//
|
||||
// /**
|
||||
// * 18次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_42")
|
||||
// private Float uharm42;
|
||||
//
|
||||
// /**
|
||||
// * 19次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_43")
|
||||
// private Float uharm43;
|
||||
//
|
||||
// /**
|
||||
// * 20次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_44")
|
||||
// private Float uharm44;
|
||||
//
|
||||
// /**
|
||||
// * 21次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_45")
|
||||
// private Float uharm45;
|
||||
//
|
||||
// /**
|
||||
// * 22次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_46")
|
||||
// private Float uharm46;
|
||||
//
|
||||
// /**
|
||||
// * 23次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_47")
|
||||
// private Float uharm47;
|
||||
//
|
||||
// /**
|
||||
// * 24次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_48")
|
||||
// private Float uharm48;
|
||||
//
|
||||
// /**
|
||||
// * 25次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_49")
|
||||
// private Float uharm49;
|
||||
//
|
||||
// /**
|
||||
// * 50次谐波电压限值
|
||||
// */
|
||||
// @TableField("uharm_50")
|
||||
// private Float uharm50;
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 2次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_2")
|
||||
// private Float iharm2;
|
||||
//
|
||||
// /**
|
||||
// * 3次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_3")
|
||||
// private Float iharm3;
|
||||
//
|
||||
// /**
|
||||
// * 4次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_4")
|
||||
// private Float iharm4;
|
||||
//
|
||||
// /**
|
||||
// * 5次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_5")
|
||||
// private Float iharm5;
|
||||
//
|
||||
// /**
|
||||
// * 6次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_6")
|
||||
// private Float iharm6;
|
||||
//
|
||||
// /**
|
||||
// * 7次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_7")
|
||||
// private Float iharm7;
|
||||
//
|
||||
// /**
|
||||
// * 8次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_8")
|
||||
// private Float iharm8;
|
||||
//
|
||||
// /**
|
||||
// * 9次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_9")
|
||||
// private Float iharm9;
|
||||
//
|
||||
// /**
|
||||
// * 10次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_10")
|
||||
// private Float iharm10;
|
||||
//
|
||||
// /**
|
||||
// * 11次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_11")
|
||||
// private Float iharm11;
|
||||
//
|
||||
// /**
|
||||
// * 12次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_12")
|
||||
// private Float iharm12;
|
||||
//
|
||||
// /**
|
||||
// * 13次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_13")
|
||||
// private Float iharm13;
|
||||
//
|
||||
// /**
|
||||
// * 14次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_14")
|
||||
// private Float iharm14;
|
||||
//
|
||||
// /**
|
||||
// * 15次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_15")
|
||||
// private Float iharm15;
|
||||
//
|
||||
// /**
|
||||
// * 16次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_16")
|
||||
// private Float iharm16;
|
||||
//
|
||||
// /**
|
||||
// * 17次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_17")
|
||||
// private Float iharm17;
|
||||
//
|
||||
// /**
|
||||
// * 18次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_18")
|
||||
// private Float iharm18;
|
||||
//
|
||||
// /**
|
||||
// * 19次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_19")
|
||||
// private Float iharm19;
|
||||
//
|
||||
// /**
|
||||
// * 20次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_20")
|
||||
// private Float iharm20;
|
||||
//
|
||||
// /**
|
||||
// * 21次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_21")
|
||||
// private Float iharm21;
|
||||
//
|
||||
// /**
|
||||
// * 22次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_22")
|
||||
// private Float iharm22;
|
||||
//
|
||||
// /**
|
||||
// * 23次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_23")
|
||||
// private Float iharm23;
|
||||
//
|
||||
// /**
|
||||
// * 24次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_24")
|
||||
// private Float iharm24;
|
||||
//
|
||||
// /**
|
||||
// * 25次谐波电流限值
|
||||
// */
|
||||
// @TableField("iharm_25")
|
||||
// private Float iharm25;
|
||||
//
|
||||
// /**
|
||||
// * 2次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_26")
|
||||
// private Float iharm26;
|
||||
//
|
||||
// /**
|
||||
// * 3次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_27")
|
||||
// private Float iharm27;
|
||||
//
|
||||
// /**
|
||||
// * 4次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_28")
|
||||
// private Float iharm28;
|
||||
//
|
||||
// /**
|
||||
// * 5次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_29")
|
||||
// private Float iharm29;
|
||||
//
|
||||
// /**
|
||||
// * 6次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_30")
|
||||
// private Float iharm30;
|
||||
//
|
||||
// /**
|
||||
// * 7次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_31")
|
||||
// private Float iharm31;
|
||||
//
|
||||
// /**
|
||||
// * 8次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_32")
|
||||
// private Float iharm32;
|
||||
//
|
||||
// /**
|
||||
// * 9次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_33")
|
||||
// private Float iharm33;
|
||||
//
|
||||
// /**
|
||||
// * 10次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_34")
|
||||
// private Float iharm34;
|
||||
//
|
||||
// /**
|
||||
// * 11次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_35")
|
||||
// private Float iharm35;
|
||||
//
|
||||
// /**
|
||||
// * 12次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_36")
|
||||
// private Float iharm36;
|
||||
//
|
||||
// /**
|
||||
// * 13次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_37")
|
||||
// private Float iharm37;
|
||||
//
|
||||
// /**
|
||||
// * 14次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_38")
|
||||
// private Float iharm38;
|
||||
//
|
||||
// /**
|
||||
// * 15次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_39")
|
||||
// private Float iharm39;
|
||||
//
|
||||
// /**
|
||||
// * 16次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_40")
|
||||
// private Float iharm40;
|
||||
//
|
||||
// /**
|
||||
// * 17次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_41")
|
||||
// private Float iharm41;
|
||||
//
|
||||
// /**
|
||||
// * 18次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_42")
|
||||
// private Float iharm42;
|
||||
//
|
||||
// /**
|
||||
// * 19次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_43")
|
||||
// private Float iharm43;
|
||||
//
|
||||
// /**
|
||||
// * 20次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_44")
|
||||
// private Float iharm44;
|
||||
//
|
||||
// /**
|
||||
// * 21次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_45")
|
||||
// private Float iharm45;
|
||||
//
|
||||
// /**
|
||||
// * 22次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_46")
|
||||
// private Float iharm46;
|
||||
//
|
||||
// /**
|
||||
// * 23次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_47")
|
||||
// private Float iharm47;
|
||||
//
|
||||
// /**
|
||||
// * 24次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_48")
|
||||
// private Float iharm48;
|
||||
//
|
||||
// /**
|
||||
// * 25次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_49")
|
||||
// private Float iharm49;
|
||||
//
|
||||
// /**
|
||||
// * 50次谐波电压限值
|
||||
// */
|
||||
// @TableField("iharm_50")
|
||||
// private Float iharm50;
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 0.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_1")
|
||||
// private Float inuharm1;
|
||||
//
|
||||
// /**
|
||||
// * 1.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_2")
|
||||
// private Float inuharm2;
|
||||
//
|
||||
// /**
|
||||
// * 2.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_3")
|
||||
// private Float inuharm3;
|
||||
//
|
||||
// /**
|
||||
// * 3.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_4")
|
||||
// private Float inuharm4;
|
||||
//
|
||||
// /**
|
||||
// * 4.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_5")
|
||||
// private Float inuharm5;
|
||||
//
|
||||
// /**
|
||||
// * 5.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_6")
|
||||
// private Float inuharm6;
|
||||
//
|
||||
// /**
|
||||
// * 6.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_7")
|
||||
// private Float inuharm7;
|
||||
//
|
||||
// /**
|
||||
// * 7.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_8")
|
||||
// private Float inuharm8;
|
||||
//
|
||||
// /**
|
||||
// * 8.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_9")
|
||||
// private Float inuharm9;
|
||||
//
|
||||
// /**
|
||||
// * 9.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_10")
|
||||
// private Float inuharm10;
|
||||
//
|
||||
// /**
|
||||
// * 10.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_11")
|
||||
// private Float inuharm11;
|
||||
//
|
||||
// /**
|
||||
// * 11.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_12")
|
||||
// private Float inuharm12;
|
||||
//
|
||||
// /**
|
||||
// * 12.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_13")
|
||||
// private Float inuharm13;
|
||||
//
|
||||
// /**
|
||||
// * 13.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_14")
|
||||
// private Float inuharm14;
|
||||
//
|
||||
// /**
|
||||
// * 14.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_15")
|
||||
// private Float inuharm15;
|
||||
//
|
||||
// /**
|
||||
// * 15.5次间谐波电压限值
|
||||
// */
|
||||
// @TableField("inuharm_16")
|
||||
// private Float inuharm16;
|
||||
//
|
||||
// public Overlimit(){}
|
||||
//
|
||||
//
|
||||
// public Overlimit(String lineId, String scaTmp, float fDLRL, float fJZRL, float fXYRL, float fSBRL){
|
||||
// float[] fLimit = COverlimit.GetOverLimit(scaTmp, fDLRL, fJZRL, fXYRL, fSBRL);
|
||||
// this.id=lineId;
|
||||
// this.freqDev=fLimit[0];
|
||||
// this.voltageDev=fLimit[1];
|
||||
// this.ubalance=fLimit[2];
|
||||
// this.flicker=fLimit[3];
|
||||
// this.uaberrance=fLimit[4];
|
||||
// this.uharm2=fLimit[5];
|
||||
// this.uharm3=fLimit[6];
|
||||
// this.uharm4=fLimit[7];
|
||||
// this.uharm5=fLimit[8];
|
||||
// this.uharm6=fLimit[9];
|
||||
// this.uharm7=fLimit[10];
|
||||
// this.uharm8=fLimit[11];
|
||||
// this.uharm9=fLimit[12];
|
||||
// this.uharm10=fLimit[13];
|
||||
// this.uharm11=fLimit[14];
|
||||
// this.uharm12=fLimit[15];
|
||||
// this.uharm13=fLimit[16];
|
||||
// this.uharm14=fLimit[17];
|
||||
// this.uharm15=fLimit[18];
|
||||
// this.uharm16=fLimit[19];
|
||||
// this.uharm17=fLimit[20];
|
||||
// this.uharm18=fLimit[21];
|
||||
// this.uharm19=fLimit[22];
|
||||
// this.uharm20=fLimit[23];
|
||||
// this.uharm21=fLimit[24];
|
||||
// this.uharm22=fLimit[25];
|
||||
// this.uharm23=fLimit[26];
|
||||
// this.uharm24=fLimit[27];
|
||||
// this.uharm25=fLimit[28];
|
||||
// this.iharm2=fLimit[29];
|
||||
// this.iharm3=fLimit[30];
|
||||
// this.iharm4=fLimit[31];
|
||||
// this.iharm5=fLimit[32];
|
||||
// this.iharm6=fLimit[33];
|
||||
// this.iharm7=fLimit[34];
|
||||
// this.iharm8=fLimit[35];
|
||||
// this.iharm9=fLimit[36];
|
||||
// this.iharm10=fLimit[37];
|
||||
// this.iharm11=fLimit[38];
|
||||
// this.iharm12=fLimit[39];
|
||||
// this.iharm13=fLimit[40];
|
||||
// this.iharm14=fLimit[41];
|
||||
// this.iharm15=fLimit[42];
|
||||
// this.iharm16=fLimit[43];
|
||||
// this.iharm17=fLimit[44];
|
||||
// this.iharm18=fLimit[45];
|
||||
// this.iharm19=fLimit[46];
|
||||
// this.iharm20=fLimit[47];
|
||||
// this.iharm21=fLimit[48];
|
||||
// this.iharm22=fLimit[49];
|
||||
// this.iharm23=fLimit[50];
|
||||
// this.iharm24=fLimit[51];
|
||||
// this.iharm25=fLimit[52];
|
||||
// this.uvoltageDev=fLimit[53];
|
||||
// this.iNeg=fLimit[54];
|
||||
// this.inuharm1=fLimit[55];
|
||||
// this.inuharm2=fLimit[56];
|
||||
// this.inuharm3=fLimit[57];
|
||||
// this.inuharm4=fLimit[58];
|
||||
// this.inuharm5=fLimit[59];
|
||||
// this.inuharm6=fLimit[60];
|
||||
// this.inuharm7=fLimit[61];
|
||||
// this.inuharm8=fLimit[62];
|
||||
// this.inuharm9=fLimit[63];
|
||||
// this.inuharm10=fLimit[64];
|
||||
// this.inuharm11=fLimit[65];
|
||||
// this.inuharm12=fLimit[66];
|
||||
// this.inuharm13=fLimit[67];
|
||||
// this.inuharm14=fLimit[68];
|
||||
// this.inuharm15=fLimit[69];
|
||||
// this.inuharm16=fLimit[70];
|
||||
// }
|
||||
//
|
||||
// public void buildIHarm(Float[] iHarmTem){
|
||||
// this.iharm2= iHarmTem[0];
|
||||
// this.iharm4= iHarmTem[2];
|
||||
// this.iharm6= iHarmTem[4];
|
||||
// this.iharm8= iHarmTem[6];
|
||||
// this.iharm10= iHarmTem[8];
|
||||
// this.iharm12= iHarmTem[10];
|
||||
// this.iharm14= iHarmTem[12];
|
||||
// this.iharm16= iHarmTem[14];
|
||||
// this.iharm18= iHarmTem[16];
|
||||
// this.iharm20= iHarmTem[18];
|
||||
// this.iharm22= iHarmTem[20];
|
||||
// this.iharm24= iHarmTem[22];
|
||||
// this.iharm26= iHarmTem[24];
|
||||
// this.iharm28= iHarmTem[26];
|
||||
// this.iharm30= iHarmTem[28];
|
||||
// this.iharm32= iHarmTem[30];
|
||||
// this.iharm34= iHarmTem[32];
|
||||
// this.iharm36= iHarmTem[34];
|
||||
// this.iharm38= iHarmTem[36];
|
||||
// this.iharm40= iHarmTem[38];
|
||||
// this.iharm42= iHarmTem[40];
|
||||
// this.iharm44= iHarmTem[42];
|
||||
// this.iharm46= iHarmTem[44];
|
||||
// this.iharm48= iHarmTem[46];
|
||||
// this.iharm50= iHarmTem[48];
|
||||
//
|
||||
//
|
||||
//
|
||||
// this.iharm3= iHarmTem[1];
|
||||
// this.iharm5= iHarmTem[3];
|
||||
// this.iharm7= iHarmTem[5];
|
||||
// this.iharm9= iHarmTem[7];
|
||||
// this.iharm11= iHarmTem[9];
|
||||
// this.iharm13= iHarmTem[11];
|
||||
// this.iharm15= iHarmTem[13];
|
||||
// this.iharm17= iHarmTem[15];
|
||||
// this.iharm19= iHarmTem[17];
|
||||
// this.iharm21= iHarmTem[19];
|
||||
// this.iharm23= iHarmTem[21];
|
||||
// this.iharm25= iHarmTem[23];
|
||||
// this.iharm27= iHarmTem[25];
|
||||
// this.iharm29= iHarmTem[27];
|
||||
// this.iharm31= iHarmTem[29];
|
||||
// this.iharm33= iHarmTem[31];
|
||||
// this.iharm35= iHarmTem[33];
|
||||
// this.iharm37= iHarmTem[35];
|
||||
// this.iharm39= iHarmTem[37];
|
||||
// this.iharm41= iHarmTem[39];
|
||||
// this.iharm43= iHarmTem[41];
|
||||
// this.iharm45= iHarmTem[43];
|
||||
// this.iharm47= iHarmTem[45];
|
||||
// this.iharm49= iHarmTem[47];
|
||||
// }
|
||||
//
|
||||
// public void buildUharm(Float resultEven,Float resultOdd){
|
||||
// this.uharm2=resultEven;
|
||||
// this.uharm4=resultEven;
|
||||
// this.uharm6=resultEven;
|
||||
// this.uharm8=resultEven;
|
||||
// this.uharm10=resultEven;
|
||||
// this.uharm12=resultEven;
|
||||
// this.uharm14=resultEven;
|
||||
// this.uharm16=resultEven;
|
||||
// this.uharm18=resultEven;
|
||||
// this.uharm20=resultEven;
|
||||
// this.uharm22=resultEven;
|
||||
// this.uharm24=resultEven;
|
||||
// this.uharm26=resultEven;
|
||||
// this.uharm28=resultEven;
|
||||
// this.uharm30=resultEven;
|
||||
// this.uharm32=resultEven;
|
||||
// this.uharm34=resultEven;
|
||||
// this.uharm36=resultEven;
|
||||
// this.uharm38=resultEven;
|
||||
// this.uharm40=resultEven;
|
||||
// this.uharm42=resultEven;
|
||||
// this.uharm44=resultEven;
|
||||
// this.uharm46=resultEven;
|
||||
// this.uharm48=resultEven;
|
||||
// this.uharm50=resultEven;
|
||||
//
|
||||
//
|
||||
// this.uharm3=resultOdd;
|
||||
// this.uharm5=resultOdd;
|
||||
// this.uharm7=resultOdd;
|
||||
// this.uharm9=resultOdd;
|
||||
// this.uharm11=resultOdd;
|
||||
// this.uharm13=resultOdd;
|
||||
// this.uharm15=resultOdd;
|
||||
// this.uharm17=resultOdd;
|
||||
// this.uharm19=resultOdd;
|
||||
// this.uharm21=resultOdd;
|
||||
// this.uharm23=resultOdd;
|
||||
// this.uharm25=resultOdd;
|
||||
// this.uharm27=resultOdd;
|
||||
// this.uharm29=resultOdd;
|
||||
// this.uharm31=resultOdd;
|
||||
// this.uharm33=resultOdd;
|
||||
// this.uharm35=resultOdd;
|
||||
// this.uharm37=resultOdd;
|
||||
// this.uharm39=resultOdd;
|
||||
// this.uharm41=resultOdd;
|
||||
// this.uharm43=resultOdd;
|
||||
// this.uharm45=resultOdd;
|
||||
// this.uharm47=resultOdd;
|
||||
// this.uharm49=resultOdd;
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
* 日志信息
|
||||
*/
|
||||
@Data
|
||||
public class CldLogsVo implements Serializable {
|
||||
|
||||
@ApiModelProperty("工程名称")
|
||||
private String engineeringName;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("设备名称")
|
||||
private String deviceName;
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty("补召类型")
|
||||
private String log;
|
||||
|
||||
@ApiModelProperty("补召时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime logTime;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("结果")
|
||||
private String result;
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -60,6 +61,12 @@ public class DataGroupEventVO {
|
||||
@ApiModelProperty("暂降幅值")
|
||||
private Float featureAmplitude;
|
||||
|
||||
@ApiModelProperty("映射数据库暂降幅值")
|
||||
private Double amplitude;
|
||||
|
||||
@ApiModelProperty("严重度")
|
||||
private String severity;
|
||||
|
||||
@ApiModelProperty("波形路径")
|
||||
private String wavePath;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
* 日志信息
|
||||
*/
|
||||
@Data
|
||||
public class EngineeringProjectRelationVo implements Serializable {
|
||||
|
||||
//工程信息
|
||||
@ApiModelProperty("工程id")
|
||||
private String engineeringId;
|
||||
|
||||
@ApiModelProperty("工程名称")
|
||||
private String engineeringName;
|
||||
|
||||
@ApiModelProperty("区域")
|
||||
private String engineeringArea;
|
||||
|
||||
@ApiModelProperty("工程备注")
|
||||
private String engineeringRemark;
|
||||
|
||||
@ApiModelProperty("工程排序")
|
||||
private Integer engineeringSort;
|
||||
|
||||
@ApiModelProperty("项目信息")
|
||||
private List<ProjectInfo> projectInfoList;
|
||||
|
||||
//项目信息
|
||||
@Data
|
||||
public static class ProjectInfo implements Serializable {
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("项目地址")
|
||||
private String projectArea;
|
||||
|
||||
@ApiModelProperty("项目备注")
|
||||
private String projectRemark;
|
||||
|
||||
@ApiModelProperty("项目排序")
|
||||
private Integer projectSort;
|
||||
|
||||
@ApiModelProperty("拓扑图信息")
|
||||
private String topologyInfo;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/2/23
|
||||
* 监测点信息
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class LineDetailDataVO {
|
||||
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty(name = "id",value = "监测点序号")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(name = "lineName",value = "监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty(name = "areaName",value = "工程名称")
|
||||
private String areaName;
|
||||
|
||||
@ApiModelProperty(name = "gdName",value = "单位")
|
||||
private String gdName;
|
||||
|
||||
@ApiModelProperty(name = "bdName",value = "部门")
|
||||
private String bdName;
|
||||
|
||||
@ApiModelProperty(name = "scale",value = "电压等级")
|
||||
private String scale;
|
||||
|
||||
@ApiModelProperty(name = "manufacturer",value = "厂家")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty(name = "devId",value = "终端Id")
|
||||
private String devId;
|
||||
|
||||
@ApiModelProperty(name = "devName",value = "终端名称")
|
||||
private String devName;
|
||||
|
||||
@ApiModelProperty(name = "ip",value = "网络参数")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty(name = "runFlag",value = "终端运行状态")
|
||||
private String runFlag;
|
||||
|
||||
@ApiModelProperty(name = "comFlag",value = "通讯状态")
|
||||
private String comFlag;
|
||||
|
||||
@ApiModelProperty(name = "loadType",value = "干扰源类型")
|
||||
private String loadType;
|
||||
|
||||
@ApiModelProperty(name = "businessType",value = "行业类型")
|
||||
private String businessType;
|
||||
|
||||
@ApiModelProperty(name = "objName",value = "监测点对象名称")
|
||||
private String objName;
|
||||
|
||||
@ApiModelProperty(name = "ptType",value = "接线方式")
|
||||
private String ptType;
|
||||
|
||||
@ApiModelProperty(name = "pt",value = "PT变比")
|
||||
private String pt;
|
||||
|
||||
@ApiModelProperty(name = "ct",value = "CT变比")
|
||||
private String ct;
|
||||
|
||||
@ApiModelProperty(name = "standardCapacity",value = "基准容量(MVA)")
|
||||
private Float standardCapacity;
|
||||
|
||||
@ApiModelProperty(name = "shortCapacity",value = "最小短路容量(MVA)")
|
||||
private Float shortCapacity;
|
||||
|
||||
@ApiModelProperty(name = "devCapacity",value = "供电设备容量(MVA)")
|
||||
private Float devCapacity;
|
||||
|
||||
@ApiModelProperty(name = "dealCapacity",value = "用户协议容量(MVA)")
|
||||
private Float dealCapacity;
|
||||
|
||||
@ApiModelProperty(name = "powerFlag",value = "电网标志(0-电网侧;1-非电网侧)")
|
||||
private Integer powerFlag;
|
||||
|
||||
/**
|
||||
* 测量间隔(1-10分钟)
|
||||
*/
|
||||
@ApiModelProperty(name = "timeInterval",value = "测量间隔(1-10分钟)")
|
||||
private Integer timeInterval;
|
||||
|
||||
/**
|
||||
* 监测点拥有者
|
||||
*/
|
||||
@ApiModelProperty(name = "owner",value = "监测点拥有者")
|
||||
private String owner;
|
||||
|
||||
/**
|
||||
* 拥有者职务
|
||||
*/
|
||||
@ApiModelProperty(name = "ownerDuty",value = "拥有者职务")
|
||||
private String ownerDuty;
|
||||
|
||||
/**
|
||||
* 拥有者联系方式
|
||||
*/
|
||||
@ApiModelProperty(name = "ownerTel",value = "拥有者联系方式")
|
||||
private String ownerTel;
|
||||
|
||||
/**
|
||||
* 接线图
|
||||
*/
|
||||
@ApiModelProperty(name = "wiringDiagram",value = "接线图")
|
||||
private String wiringDiagram;
|
||||
@ApiModelProperty(name = "ptPhaseType",value = "监测点接线相别(0,单相,1,三相,默认三相)")
|
||||
private Integer ptPhaseType;
|
||||
|
||||
@ApiModelProperty(name = "投运日期")
|
||||
private LocalDate loginTime;
|
||||
|
||||
@ApiModelProperty(name = "最新数据时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty(name = "监测对象信息ID")
|
||||
private String objId;
|
||||
|
||||
@ApiModelProperty(name = "对象类型大类")
|
||||
private String bigObjType;
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/2/23
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class LineOverLimitVO {
|
||||
|
||||
@ApiModelProperty(name = "freqDev",value = "频率限值")
|
||||
private Float freqDev;
|
||||
|
||||
@ApiModelProperty(name = "voltageDev",value = "电压上偏差限值")
|
||||
private Float voltageDev;
|
||||
|
||||
@ApiModelProperty(name = "uvoltageDev",value = "电压下偏差限值")
|
||||
private Float uvoltageDev;
|
||||
|
||||
@ApiModelProperty(name = "ubalance",value = "三相电压不平衡度限值")
|
||||
private Float ubalance;
|
||||
|
||||
@ApiModelProperty(name = "iNeg",value = "负序电流")
|
||||
private Float iNeg;
|
||||
|
||||
@ApiModelProperty(name = "flicker",value = "长时闪变限值")
|
||||
private Float flicker;
|
||||
|
||||
@ApiModelProperty(name = "uaberrance",value = "电压总谐波畸变率限值")
|
||||
private Float uaberrance;
|
||||
|
||||
@ApiModelProperty(name = "oddHarm",value = "奇次谐波含有率限值")
|
||||
private Float oddHarm;
|
||||
|
||||
@ApiModelProperty(name = "evenHarm",value = "偶次谐波含有率限值")
|
||||
private Float evenHarm;
|
||||
|
||||
@ApiModelProperty(name = "iharm2",value = "2次谐波电流幅值限值")
|
||||
private Float iharm2;
|
||||
|
||||
@ApiModelProperty(name = "iharm3",value = "3次谐波电流幅值限值")
|
||||
private Float iharm3;
|
||||
|
||||
@ApiModelProperty(name = "iharm4",value = "4次谐波电流幅值限值")
|
||||
private Float iharm4;
|
||||
|
||||
@ApiModelProperty(name = "iharm5",value = "5次谐波电流幅值限值")
|
||||
private Float iharm5;
|
||||
|
||||
@ApiModelProperty(name = "iharm6",value = "6次谐波电流幅值限值")
|
||||
private Float iharm6;
|
||||
|
||||
@ApiModelProperty(name = "iharm7",value = "7次谐波电流幅值限值")
|
||||
private Float iharm7;
|
||||
|
||||
@ApiModelProperty(name = "iharm8",value = "8次谐波电流幅值限值")
|
||||
private Float iharm8;
|
||||
|
||||
@ApiModelProperty(name = "iharm9",value = "9次谐波电流幅值限值")
|
||||
private Float iharm9;
|
||||
|
||||
@ApiModelProperty(name = "iharm10",value = "10次谐波电流幅值限值")
|
||||
private Float iharm10;
|
||||
|
||||
@ApiModelProperty(name = "iharm11",value = "11次谐波电流幅值限值")
|
||||
private Float iharm11;
|
||||
|
||||
@ApiModelProperty(name = "iharm12",value = "12次谐波电流幅值限值")
|
||||
private Float iharm12;
|
||||
|
||||
@ApiModelProperty(name = "iharm13",value = "13次谐波电流幅值限值")
|
||||
private Float iharm13;
|
||||
|
||||
@ApiModelProperty(name = "iharm14",value = "14次谐波电流幅值限值")
|
||||
private Float iharm14;
|
||||
|
||||
@ApiModelProperty(name = "iharm15",value = "15次谐波电流幅值限值")
|
||||
private Float iharm15;
|
||||
|
||||
@ApiModelProperty(name = "iharm16",value = "16次谐波电流幅值限值")
|
||||
private Float iharm16;
|
||||
|
||||
@ApiModelProperty(name = "iharm17",value = "17次谐波电流幅值限值")
|
||||
private Float iharm17;
|
||||
|
||||
@ApiModelProperty(name = "iharm18",value = "18次谐波电流幅值限值")
|
||||
private Float iharm18;
|
||||
|
||||
@ApiModelProperty(name = "iharm19",value = "19次谐波电流幅值限值")
|
||||
private Float iharm19;
|
||||
|
||||
@ApiModelProperty(name = "iharm20",value = "20次谐波电流幅值限值")
|
||||
private Float iharm20;
|
||||
|
||||
@ApiModelProperty(name = "iharm21",value = "21次谐波电流幅值限值")
|
||||
private Float iharm21;
|
||||
|
||||
@ApiModelProperty(name = "iharm22",value = "22次谐波电流幅值限值")
|
||||
private Float iharm22;
|
||||
|
||||
@ApiModelProperty(name = "iharm23",value = "23次谐波电流幅值限值")
|
||||
private Float iharm23;
|
||||
|
||||
@ApiModelProperty(name = "iharm24",value = "24次谐波电流幅值限值")
|
||||
private Float iharm24;
|
||||
|
||||
@ApiModelProperty(name = "iharm25",value = "25次谐波电流幅值限值")
|
||||
private Float iharm25;
|
||||
|
||||
@ApiModelProperty(name = "inUharm",value = "0.5-1.5次间谐波电压幅值限值")
|
||||
private Float inUharm;
|
||||
|
||||
@ApiModelProperty(name = "inUharm16",value = "2.5-15.5次间谐波电压幅值限值")
|
||||
private Float inUharm16;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class PqSensitiveUserLineVO {
|
||||
@ApiModelProperty("治理对象")
|
||||
private String sensitiveUser;
|
||||
@ApiModelProperty("监测点ID")
|
||||
private String lineId;
|
||||
@ApiModelProperty("测点名称")
|
||||
private String lineName;
|
||||
@ApiModelProperty("是否治理")
|
||||
private String govern;
|
||||
@ApiModelProperty("电压等级")
|
||||
private double volGrade;
|
||||
@ApiModelProperty("监测类型")
|
||||
private String position;
|
||||
@ApiModelProperty("运行状态")
|
||||
private String runStatus;
|
||||
@ApiModelProperty("报告文件")
|
||||
private String reportFilePath;
|
||||
@ApiModelProperty("最新数据时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime latestTime;
|
||||
}
|
||||
@@ -0,0 +1,383 @@
|
||||
//package com.njcn.csdevice.utils;
|
||||
//
|
||||
//import com.njcn.csdevice.pojo.po.Overlimit;
|
||||
//import com.njcn.device.biz.enums.RunFlagEnum;
|
||||
//import com.njcn.system.enums.DicDataEnum;
|
||||
//
|
||||
//import java.math.BigDecimal;
|
||||
//import java.math.RoundingMode;
|
||||
//import java.util.Objects;
|
||||
//
|
||||
//
|
||||
///**
|
||||
// * pqs
|
||||
// * 限值计算工具类
|
||||
// *
|
||||
// * @author cdf
|
||||
// * @date 2023/5/15
|
||||
// */
|
||||
//public class COverlimitUtil {
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 谐波电流系数
|
||||
// */
|
||||
// private static final double[][] ARR = {
|
||||
// {78, 62, 39, 62, 26, 44, 19, 21, 16, 28, 13, 24, 11, 12, 9.7, 18, 8.6, 16, 7.8, 8.9, 7.1, 14, 6.5, 12, 6.0, 6.9, 5.6, 11, 5.2, 10, 4.9, 5.6, 4.6, 8.9, 4.3, 8.4, 4.1, 4.8, 3.9, 7.6, 3.7, 7.2, 3.5, 4.1, 3.4, 6.6, 3.3, 6.3, 3.1},
|
||||
// {43, 34, 21, 34, 14, 24, 11, 11, 8.5, 16, 7.1, 13, 6.1, 6.8, 5.3, 10, 4.7, 9, 4.3, 4.9, 3.9, 7.4, 3.6, 6.8, 3.3, 3.8, 3.1, 5.9, 2.9, 5.5, 2.7, 3.1, 2.5, 4.9, 2.4, 4.6, 2.3, 2.6, 2.2, 4.1, 2.0, 4.0, 2.0, 2.3, 1.9, 3.6, 1.8, 3.5, 1.7},
|
||||
// {26, 20, 13, 20, 8.5, 15, 6.4, 6.8, 5.1, 9.3, 4.3, 7.9, 3.7, 4.1, 3.2, 6, 2.8, 5.4, 2.6, 2.9, 2.3, 4.5, 2.1, 4.1, 2.0, 2.2, 1.9, 3.4, 1.7, 3.2, 1.6, 1.8, 1.5, 2.9, 1.4, 2.7, 1.4, 1.5, 1.3, 2.4, 1.2, 2.3, 1.2, 1.3, 1.1, 2.1, 1.1, 2.0, 1.0},
|
||||
// {15, 12, 7.7, 12, 5.1, 8.8, 3.8, 4.1, 3.1, 5.6, 2.6, 4.7, 2.2, 2.5, 1.9, 3.6, 1.7, 3.2, 1.5, 1.8, 1.4, 2.7, 1.3, 2.5, 1.2, 1.3, 1.1, 2.1, 1.0, 1.9, 0.9, 1.1, 0.9, 1.7, 0.8, 1.6, 0.8, 0.9, 0.8, 1.5, 0.7, 1.4, 0.7, 0.8, 0.7, 1.3, 0.6, 1.2, 0.6},
|
||||
// {16, 13, 8.1, 13, 5.4, 9.3, 4.1, 4.3, 3.3, 5.9, 2.7, 5, 2.3, 2.6, 2, 3.8, 1.8, 3.4, 1.6, 1.9, 1.5, 2.8, 1.4, 2.6, 1.2, 1.4, 1.1, 2.2, 1.1, 2.1, 1.0, 1.2, 0.9, 1.9, 0.9, 1.8, 0.8, 1.0, 0.8, 1.6, 0.8, 1.5, 0.7, 0.9, 0.7, 1.4, 0.7, 1.3, 0.6},
|
||||
// {12, 9.6, 6, 9.6, 4, 6.8, 3, 3.2, 2.4, 4.3, 2, 3.7, 1.7, 1.9, 1.5, 2.8, 1.3, 2.5, 1.2, 1.4, 1.1, 2.1, 1, 1.9, 0.9, 1.1, 0.9, 1.7, 0.8, 1.5, 0.8, 0.9, 0.7, 1.4, 0.7, 1.3, 0.6, 0.7, 0.6, 1.2, 0.6, 1.1, 0.5, 0.6, 0.5, 1.0, 0.5, 1.0, 0.5}
|
||||
// };
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 计算监测点限值
|
||||
// * @param voltageLevel 电压等级(10kV = 10 220kV = 220 )
|
||||
// * @param protocolCapacity 协议容量
|
||||
// * @param devCapacity 设备容量
|
||||
// * @param shortCapacity 短路容量
|
||||
// * @param powerFlag 0.用户侧 1.电网侧
|
||||
// * @param lineType 0.主网 1.配网 需要注意配网目前没有四种容量,谐波电流幅值限值,负序电流限值无法计算默认-3.14159
|
||||
// */
|
||||
// public static Overlimit globalAssemble(Float voltageLevel, Float protocolCapacity, Float devCapacity,
|
||||
// Float shortCapacity, Integer powerFlag, Integer lineType) {
|
||||
// Overlimit overlimit = new Overlimit();
|
||||
// voltageDeviation(overlimit,voltageLevel);
|
||||
// frequency(overlimit);
|
||||
// voltageFluctuation(overlimit,voltageLevel);
|
||||
// voltageFlicker(overlimit,voltageLevel);
|
||||
// totalHarmonicDistortion(overlimit,voltageLevel);
|
||||
// uHarm(overlimit,voltageLevel);
|
||||
// threeVoltageUnbalance(overlimit);
|
||||
// interharmonicCurrent(overlimit,voltageLevel);
|
||||
//
|
||||
// if(Objects.equals(lineType, RunFlagEnum.PW_FLAG.getStatus())) {
|
||||
// //配网
|
||||
// Float[] iHarmTem = new Float[49];
|
||||
// for (int i = 0; i <= 48; i++) {
|
||||
//
|
||||
// iHarmTem[i] = -3.14159f;
|
||||
// }
|
||||
// overlimit.buildIHarm(iHarmTem);
|
||||
// overlimit.setINeg(-3.14159f);
|
||||
// }else {
|
||||
// //主网
|
||||
// iHarm(overlimit, voltageLevel, protocolCapacity, devCapacity, shortCapacity);
|
||||
// negativeSequenceCurrent(overlimit, voltageLevel, shortCapacity);
|
||||
// }
|
||||
// return overlimit;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 电压偏差限值
|
||||
// *
|
||||
// */
|
||||
// public static void voltageDeviation(Overlimit overlimit,Float voltageLevel) {
|
||||
// float voltageDev = 3.14159f,uvoltageDev = 3.14159f;
|
||||
// if(voltageLevel <= Float.parseFloat(DicDataEnum.V220.getCode())){
|
||||
// voltageDev = 7.0f;
|
||||
// uvoltageDev=-10.0f;
|
||||
// }else if(voltageLevel>Float.parseFloat(DicDataEnum.V220.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV20.getCode())){
|
||||
// voltageDev = 7.0f;
|
||||
// uvoltageDev=-7.0f;
|
||||
// }else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV20.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV35.getCode())){
|
||||
// voltageDev = 7.0f;
|
||||
// uvoltageDev=-7.0f;
|
||||
// }else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV35.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV66.getCode())){
|
||||
// voltageDev = 10.0f;
|
||||
// uvoltageDev=-10.0f;
|
||||
// }else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV66.getCode())&&voltageLevel<=Float.parseFloat(DicDataEnum.KV110.getCode())){
|
||||
// voltageDev = 7.0f;
|
||||
// uvoltageDev=-3.0f;
|
||||
// }else if(voltageLevel>Float.parseFloat(DicDataEnum.KV110.getCode())){
|
||||
// voltageDev = 10.0f;
|
||||
// uvoltageDev=-10.0f;
|
||||
// }
|
||||
// overlimit.setVoltageDev(voltageDev);
|
||||
// overlimit.setUvoltageDev(uvoltageDev);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 频率偏差
|
||||
// * 默认限值:±0.2Hz(即:-0.2 Hz≤限值≤0.2 Hz)
|
||||
// */
|
||||
// public static void frequency(Overlimit overlimit) {
|
||||
// overlimit.setFreqDev(0.2f);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 电压波动
|
||||
// * 对LV、MV:0≤限值≤3%;对HV:0≤限值≤2.5%。
|
||||
// * LV、MV、HV的定义:
|
||||
// * 低压(LV) UN≤1kV
|
||||
// * 中压(MV) 1kV<UN≤35kV
|
||||
// * 高压(HV) 35kV<UN≤220kV
|
||||
// * 超高压(EHV),220kV<UN,参照HV执行
|
||||
// */
|
||||
// public static void voltageFluctuation(Overlimit overlimit, Float voltageLevel) {
|
||||
// if (voltageLevel < Float.parseFloat(DicDataEnum.KV35.getCode())) {
|
||||
// overlimit.setVoltageFluctuation(3.0f);
|
||||
// } else {
|
||||
// overlimit.setVoltageFluctuation(2.5f);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 电压闪变
|
||||
// * ≤110kV 1
|
||||
// * >110kV 0.8
|
||||
// */
|
||||
// public static void voltageFlicker(Overlimit overlimit, Float voltageLevel) {
|
||||
// if (voltageLevel <= Float.parseFloat(DicDataEnum.KV110.getCode())) {
|
||||
// overlimit.setFlicker(1.0f);
|
||||
// } else {
|
||||
// overlimit.setFlicker(0.8f);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 总谐波电压畸变率
|
||||
// *
|
||||
// *
|
||||
// */
|
||||
// public static void totalHarmonicDistortion(Overlimit overlimit, Float voltageLevel) {
|
||||
// float result = 3.14159f;
|
||||
// if (voltageLevel < Float.parseFloat(DicDataEnum.KV6.getCode())) {
|
||||
// result = 5.0f;
|
||||
// } else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV6.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV20.getCode())){
|
||||
// result = 4.0f;
|
||||
// } else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV35.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV66.getCode())){
|
||||
// result = 3.0f;
|
||||
// } else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV110.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV1000.getCode())){
|
||||
// result = 2.0f;
|
||||
// }
|
||||
// overlimit.setUaberrance(result);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 谐波电压含有率
|
||||
// */
|
||||
// public static void uHarm(Overlimit overlimit, Float voltageLevel) {
|
||||
// float resultOdd = 3.14159f,resultEven = 3.14159f;
|
||||
// if (voltageLevel < Float.parseFloat(DicDataEnum.KV6.getCode())) {
|
||||
// resultOdd = 4.0f;
|
||||
// resultEven = 2.0f;
|
||||
// } else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV6.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV20.getCode())){
|
||||
// resultOdd = 3.2f;
|
||||
// resultEven = 1.6f;
|
||||
// } else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV35.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV66.getCode())){
|
||||
// resultOdd = 2.4f;
|
||||
// resultEven = 1.2f;
|
||||
// } else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV110.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV1000.getCode())){
|
||||
// resultOdd = 1.6f;
|
||||
// resultEven = 0.8f;
|
||||
// }
|
||||
// overlimit.buildUharm(resultEven,resultOdd);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 负序电压不平衡(三相电压不平衡度)
|
||||
// *
|
||||
// */
|
||||
// public static void threeVoltageUnbalance(Overlimit overlimit) {
|
||||
// overlimit.setUbalance(2.0f);
|
||||
// overlimit.setShortUbalance(4.0f);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /*---------------------------------谐波电流限值start-----------------------------------*/
|
||||
//
|
||||
// /**
|
||||
// * 谐波电流限值
|
||||
// */
|
||||
// public static void iHarm(Overlimit overlimit, Float voltageLevel,Float protocolCapacity,Float devCapacity,Float shortCapacity) {
|
||||
// float calCap = shortCapacity/getDlCapByVoltageLevel(voltageLevel);
|
||||
// //24谐波电流幅值
|
||||
// Float[] iHarmTem = new Float[49];
|
||||
// for (int i = 0; i <= 48; i++) {
|
||||
// float inHarm = iHarmCalculate(i+2,voltageLevel,protocolCapacity,devCapacity,calCap);
|
||||
// iHarmTem[i] = inHarm;
|
||||
// }
|
||||
// overlimit.buildIHarm(iHarmTem);
|
||||
// }
|
||||
// /**
|
||||
// * @Description: iHarmCalculate
|
||||
// * @Param: protocolCapacity 协议容量 devCapacity设备容量 calCap 短路容量
|
||||
// * @return: float
|
||||
// * @Author: clam
|
||||
// * @Date: 2024/2/4
|
||||
// */
|
||||
// private static float iHarmCalculate(int nHarm, Float voltageLevel,float protocolCapacity, float devCapacity,float calCap) {
|
||||
// double tag = calCap*getHarmTag(nHarm,voltageLevel);
|
||||
// Double limit = getHarmonicLimit(nHarm,tag,new BigDecimal(String.valueOf(devCapacity)).doubleValue(),new BigDecimal(String.valueOf(protocolCapacity)).doubleValue());
|
||||
// BigDecimal bigDecimal = BigDecimal.valueOf(limit).setScale(4,RoundingMode.HALF_UP);
|
||||
// return bigDecimal.floatValue();
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 电流谐波限值
|
||||
// */
|
||||
// private static Double getHarmTag(Integer iCount, Float voltageLevel) {
|
||||
// int x, y;
|
||||
// if (voltageLevel < DicDataEnum.KV6.getValue()) {
|
||||
// x = 0;
|
||||
// } else if (voltageLevel<DicDataEnum.KV10.getValue()) {
|
||||
// x = 1;
|
||||
// } else if (voltageLevel<DicDataEnum.KV35.getValue()) {
|
||||
// x = 2;
|
||||
// } else if (voltageLevel<DicDataEnum.KV66.getValue()) {
|
||||
// x = 3;
|
||||
// } else if (voltageLevel<DicDataEnum.KV110.getValue()) {
|
||||
// x = 4;
|
||||
// } else {
|
||||
// x = 5;
|
||||
// }
|
||||
// y = iCount - 2;
|
||||
// return ARR[x][y];
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 相位叠加系数的取值
|
||||
// */
|
||||
// public static Double getHarmonicLimit(Integer times, double iTag, double supply, double user) {
|
||||
// if (supply == 0) {
|
||||
// return 0.0;
|
||||
// }
|
||||
// double coefficient = 2.0;
|
||||
// if (times == 3) {
|
||||
// coefficient = 1.1;
|
||||
// } else if (times == 5) {
|
||||
// coefficient = 1.2;
|
||||
// } else if (times == 7) {
|
||||
// coefficient = 1.4;
|
||||
// } else if (times == 11) {
|
||||
// coefficient = 1.8;
|
||||
// } else if (times == 13) {
|
||||
// coefficient = 1.9;
|
||||
// }
|
||||
// BigDecimal bd = new BigDecimal(iTag * Math.pow((user / supply), (1 / coefficient)));
|
||||
// bd = bd.setScale(6, RoundingMode.HALF_UP);
|
||||
// return Double.parseDouble(bd.toString());
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据电压等级获取基准短路容量
|
||||
// */
|
||||
// public static float getDlCapByVoltageLevel(Float voltageLevel){
|
||||
// float capValue;
|
||||
// if(voltageLevel< DicDataEnum.KV06.getValue()){
|
||||
// capValue = 10;
|
||||
// }else if(voltageLevel<DicDataEnum.KV20.getValue()){
|
||||
// capValue = 100;
|
||||
// }else if(voltageLevel<DicDataEnum.KV35.getValue()){
|
||||
// capValue = 200;
|
||||
// }else if(voltageLevel<DicDataEnum.KV66.getValue()){
|
||||
// capValue = 250;
|
||||
// }else if(voltageLevel<DicDataEnum.KV110.getValue()){
|
||||
// capValue = 500;
|
||||
// }else if(voltageLevel<DicDataEnum.KV220.getValue()){
|
||||
// capValue = 750;
|
||||
// }else if(voltageLevel<DicDataEnum.KV330.getValue()){
|
||||
// capValue = 2000;
|
||||
// }else if(voltageLevel<DicDataEnum.KV500.getValue()){
|
||||
// capValue = 3000;
|
||||
// }else if(voltageLevel<DicDataEnum.KV750.getValue()){
|
||||
// capValue = 4500;
|
||||
// }else if(voltageLevel<DicDataEnum.KV1000.getValue()){
|
||||
// capValue = 7000;
|
||||
// }else {
|
||||
// capValue = 9000;
|
||||
// }
|
||||
// return capValue;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /*---------------------------------谐波电流限值end-----------------------------------*/
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 间谐波电压含有率
|
||||
// */
|
||||
//
|
||||
// public static void interharmonicCurrent(Overlimit overlimit,Float voltageLevel){
|
||||
// float aValue,bValue;
|
||||
// if(voltageLevel <= DicDataEnum.KV1.getValue()){
|
||||
// aValue = 0.2f;bValue = 0.5f;
|
||||
// }else {
|
||||
// aValue = 0.16f;bValue = 0.4f;
|
||||
// }
|
||||
// overlimit.setInuharm1(aValue);
|
||||
// overlimit.setInuharm2(aValue);
|
||||
//
|
||||
// overlimit.setInuharm3(bValue);
|
||||
// overlimit.setInuharm4(bValue);
|
||||
// overlimit.setInuharm5(bValue);
|
||||
// overlimit.setInuharm6(bValue);
|
||||
// overlimit.setInuharm7(bValue);
|
||||
// overlimit.setInuharm8(bValue);
|
||||
// overlimit.setInuharm9(bValue);
|
||||
// overlimit.setInuharm10(bValue);
|
||||
// overlimit.setInuharm11(bValue);
|
||||
// overlimit.setInuharm12(bValue);
|
||||
// overlimit.setInuharm13(bValue);
|
||||
// overlimit.setInuharm14(bValue);
|
||||
// overlimit.setInuharm15(bValue);
|
||||
// overlimit.setInuharm16(bValue);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 负序电流限值
|
||||
// */
|
||||
// public static void negativeSequenceCurrent(Overlimit overlimit,Float voltageLevel,Float shortCapacity){
|
||||
// double v = (0.013*shortCapacity*1000)/(getUl(voltageLevel)*Math.sqrt(3));
|
||||
// overlimit.setINeg((float) v);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取额定线电压
|
||||
// */
|
||||
// private static float getUl(Float voltageLevel){
|
||||
// float value;
|
||||
// if(voltageLevel<DicDataEnum.KV6.getValue()){
|
||||
// value = 0.4f;
|
||||
// }else if(voltageLevel<DicDataEnum.KV10.getValue()){
|
||||
// value = 6.3f;
|
||||
// }else if(voltageLevel<DicDataEnum.KV20.getValue()){
|
||||
// value = 10.5f;
|
||||
// }else if(voltageLevel<DicDataEnum.KV35.getValue()){
|
||||
// value = 21.0f;
|
||||
// }else if(voltageLevel<DicDataEnum.KV66.getValue()){
|
||||
// value = 36.5f;
|
||||
// }else if(voltageLevel<DicDataEnum.KV110.getValue()){
|
||||
// value = 69.0f;
|
||||
// }else if(voltageLevel<DicDataEnum.KV220.getValue()){
|
||||
// value = 115.5f;
|
||||
// }else if(voltageLevel<DicDataEnum.KV330.getValue()){
|
||||
// value = 230.0f;
|
||||
// }else {
|
||||
// value = 345.0f;
|
||||
// }
|
||||
// return value;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public static void main(String[] args) {
|
||||
// System.out.println("sss");
|
||||
// float aa = iHarmCalculate(9,500f,10,10,0.002222222222f);
|
||||
//
|
||||
// System.out.println(aa);
|
||||
// }
|
||||
//}
|
||||
@@ -88,11 +88,6 @@
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>cs-warn-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- zxing生成二维码 -->
|
||||
<dependency>
|
||||
@@ -153,12 +148,21 @@
|
||||
<artifactId>access-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-mq</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-mq</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.rocketmq</groupId>
|
||||
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||
<version>2.2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn.platform</groupId>
|
||||
<artifactId>message-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.njcn.csdevice.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
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.csdevice.pojo.vo.LineOverLimitVO;
|
||||
import com.njcn.csdevice.service.IOverLimitService;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "监测点限值信息查询")
|
||||
public class PQOverlimitController extends BaseController {
|
||||
|
||||
private final IOverLimitService overLimitService;
|
||||
|
||||
// -------- 3个重复的代码!!!! ----------
|
||||
/**
|
||||
* 来源于CommTerminalController的getOverLimitData
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/commTerminal/getOverLimitData")
|
||||
@ApiOperation("根据监测点id获取越限数值")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<Overlimit> getOverLimitDataTerminal(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getOverLimitData");
|
||||
Overlimit result = overLimitService.getOverLimitDataById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/line/getOverLimitData")
|
||||
@ApiOperation("根据监测点id获取越限数值")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<Overlimit> getOverLimitData(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getOverLimitData");
|
||||
Overlimit result = overLimitService.getOverLimitDataById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/line/getLineOverLimitData")
|
||||
@ApiOperation("根据监测点id获取越限详情")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<LineOverLimitVO> getLineOverLimitData(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineOverLimitData");
|
||||
LineOverLimitVO result = overLimitService.getLineOverLimitDataById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/overLimit/getOverLimitByLineIds")
|
||||
@ApiOperation("监测点集合获取限值")
|
||||
@ApiImplicitParam(name = "lineIds", value = "监测点ids", required = true)
|
||||
@ApiIgnore
|
||||
public HttpResult<List<Overlimit>> getOverLimitByLineIds(@RequestBody List<String> lineIds){
|
||||
String methodDescribe = getMethodDescribe("getOverLimitByLineIds");
|
||||
List<Overlimit> overLimitList= overLimitService.list(new LambdaQueryWrapper<Overlimit>().in(Overlimit::getId,lineIds));
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, overLimitList, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/commTerminal/getOverLimitDataByIds")
|
||||
@ApiOperation("根据监测点id集合获取越限数值")
|
||||
@ApiImplicitParam(name = "ids", value = "监测点id集合", required = true)
|
||||
public HttpResult<List<Overlimit>> getOverLimitDataByIds(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("getOverLimitDataByIds");
|
||||
List<Overlimit> result = overLimitService.listByIds(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/overLimit/getLimitMapsByLineIds")
|
||||
@ApiOperation("监测点集合获取限值")
|
||||
@ApiImplicitParam(name = "lineIds", value = "监测点ids", required = true)
|
||||
@ApiIgnore
|
||||
public HttpResult<List<Map<String, Object>>> getLimitMapsByLineIds(@RequestBody List<String> lineIds){
|
||||
String methodDescribe = getMethodDescribe("getLimitMapsByLineIds");
|
||||
List<Map<String, Object>> overLimitList= overLimitService.listMaps(new LambdaQueryWrapper<Overlimit>().in(Overlimit::getId,lineIds));
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, overLimitList, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,11 @@ import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
||||
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
||||
import com.njcn.csdevice.service.ICsGroupService;
|
||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||
import com.njcn.csharmonic.param.FittingDataQueryParam;
|
||||
import com.njcn.csharmonic.param.SensitiveUserTrendDataQueryParam;
|
||||
import com.njcn.csharmonic.param.TrendDataQueryParam;
|
||||
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -21,9 +25,11 @@ import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -143,5 +149,39 @@ public class CsGroupController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/trendData")
|
||||
@ApiOperation("查询指标趋势图数据")
|
||||
@ApiImplicitParam(name = "param",required = true)
|
||||
public HttpResult<List<ThdDataVO>> trendData(@RequestBody @Validated TrendDataQueryParam param){
|
||||
String methodDescribe = getMethodDescribe("trendData");
|
||||
List<ThdDataVO> list = csGroupService.trendData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/fittingData")
|
||||
@ApiOperation("查询指标拟合图数据")
|
||||
@ApiImplicitParam(name = "param",required = true)
|
||||
public HttpResult<List<ThdDataVO>> fittingData(@RequestBody @Validated FittingDataQueryParam param){
|
||||
String methodDescribe = getMethodDescribe("fittingData");
|
||||
List<ThdDataVO> list = csGroupService.fittingData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/sensitiveUserTrendData")
|
||||
@ApiOperation("查询监测对象电网侧和负载侧监测点指标趋势对比数据")
|
||||
@ApiImplicitParam(name = "param",required = true)
|
||||
public HttpResult<Map<String,List<ThdDataVO>>> sensitiveUserTrendData(@RequestBody @Validated SensitiveUserTrendDataQueryParam param){
|
||||
String methodDescribe = getMethodDescribe("sensitiveUserTrendData");
|
||||
Map<String,List<ThdDataVO>> result = csGroupService.sensitiveUserTrendData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.enums.DeviceOperate;
|
||||
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
||||
import com.njcn.csdevice.pojo.vo.DevUserVO;
|
||||
@@ -140,4 +141,24 @@ public class DeviceUserController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/findDevByUserId")
|
||||
@ApiOperation("根据用户Id查询设备集合")
|
||||
@ApiImplicitParam(name = "id", value = "用户id", required = true)
|
||||
public HttpResult<List<String>> findDevByUserId(@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("findDevByUserId");
|
||||
List<String> list = csDeviceUserPOService.findDevByUserId(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/channelDevByUserId")
|
||||
@ApiOperation("根据用户Id解绑设备集合")
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
public HttpResult<List<String>> channelDevByUserId(@RequestBody UserDevParam param){
|
||||
String methodDescribe = getMethodDescribe("channelDevByUserId");
|
||||
csDeviceUserPOService.channelDevByUserId(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.csdevice.controller.equipment;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
@@ -152,6 +153,9 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
@ApiImplicitParam(name = "ids", value = "设备id集合", required = true)
|
||||
public HttpResult<List<CsEquipmentDeliveryDTO>> queryEquipmentById(@RequestParam List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("queryEquipmentById");
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryService.listByIds(ids);
|
||||
List<CsEquipmentDeliveryDTO> collect = csEquipmentDeliveryPOS.stream().map(temp -> {
|
||||
CsEquipmentDeliveryDTO csEquipmentDeliveryDTO = new CsEquipmentDeliveryDTO();
|
||||
@@ -401,4 +405,14 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getRunPortableDev")
|
||||
@ApiOperation("获取用户未绑定的在运的便携式设备")
|
||||
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
||||
public HttpResult<List<CsEquipmentDeliveryPO>> getRunPortableDev(@RequestParam("userId") String userId){
|
||||
String methodDescribe = getMethodDescribe("getRunPortableDev");
|
||||
List<CsEquipmentDeliveryPO> result = csEquipmentDeliveryService.getRunPortableDev(userId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +1,26 @@
|
||||
package com.njcn.csdevice.controller.icd;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
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.csdevice.param.IcdBzParam;
|
||||
import com.njcn.csdevice.param.IcdBzReplyParam;
|
||||
import com.njcn.csdevice.pojo.vo.CldLogsVo;
|
||||
import com.njcn.csdevice.service.ICsTerminalReplyService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -51,14 +54,30 @@ public class CsTerminalReplyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateData")
|
||||
@ApiOperation("更新推送结果")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "参数", required = true),
|
||||
@ApiImplicitParam(name = "state", value = "状态", required = true),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true)
|
||||
})
|
||||
public HttpResult<String> updateData(@RequestParam String id,@RequestParam Integer state,@RequestParam String deviceId){
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
public HttpResult<String> updateData(@RequestBody @Validated IcdBzReplyParam param){
|
||||
String methodDescribe = getMethodDescribe("updateData");
|
||||
csTerminalReplyService.updateReplyData(id,state,deviceId);
|
||||
csTerminalReplyService.updateReplyData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/bzLogs")
|
||||
@ApiOperation("补召日志")
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
public HttpResult<Page<CldLogsVo>> bzLogs(@RequestBody @Validated BaseParam param){
|
||||
String methodDescribe = getMethodDescribe("bzLogs");
|
||||
Page<CldLogsVo> list = csTerminalReplyService.getBzLogs(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateBzData")
|
||||
@ApiOperation("更新补召推送结果")
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
public HttpResult<String> updateBzData(@RequestBody @Validated IcdBzReplyParam param){
|
||||
String methodDescribe = getMethodDescribe("updateBzData");
|
||||
csTerminalReplyService.updateBzData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ 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.csdevice.param.IcdBzParam;
|
||||
import com.njcn.csdevice.param.IcdLedgerParam;
|
||||
import com.njcn.csdevice.param.IcdParam;
|
||||
import com.njcn.csdevice.pojo.vo.CldLedgerVo;
|
||||
import com.njcn.csdevice.pojo.vo.DeviceInfo;
|
||||
import com.njcn.csdevice.service.IcdService;
|
||||
import com.njcn.mq.message.CldControlMessage;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -66,12 +66,32 @@ public class IcdController extends BaseController {
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/restartProcess")
|
||||
@ApiOperation("重启前置机进程")
|
||||
@ApiImplicitParam(name = "message", value = "message", required = true)
|
||||
public HttpResult<String> restartProcess(@RequestBody CldControlMessage message){
|
||||
String methodDescribe = getMethodDescribe("restartProcess");
|
||||
icdService.restartProcess(message);
|
||||
@PostMapping("/bzFileByEventId")
|
||||
@ApiOperation("指定事件补召波形指令下发")
|
||||
@ApiImplicitParam(name = "eventId", value = "事件id", required = true)
|
||||
public HttpResult<String> bzFileByEventId(@RequestParam String eventId){
|
||||
String methodDescribe = getMethodDescribe("bzFileByEventId");
|
||||
icdService.bzFileByEventId(eventId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/bzEvent")
|
||||
@ApiOperation("补召事件指令下发")
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
public HttpResult<String> bzEvent(@RequestBody @Validated IcdBzParam param){
|
||||
String methodDescribe = getMethodDescribe("bzEvent");
|
||||
icdService.bzEvent(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/bzFile")
|
||||
@ApiOperation("补召波形指令下发")
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
public HttpResult<String> bzFile(@RequestBody @Validated IcdBzParam param){
|
||||
String methodDescribe = getMethodDescribe("bzFile");
|
||||
icdService.bzFile(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ 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.csdevice.param.IcdNodeParam;
|
||||
import com.njcn.csdevice.pojo.param.NodeParam;
|
||||
import com.njcn.csdevice.pojo.po.Node;
|
||||
import com.njcn.csdevice.pojo.vo.NodeProcessDeviceVo;
|
||||
@@ -174,5 +175,41 @@ public class NodeController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/restartProcess")
|
||||
@ApiOperation("重启前置机进程")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "nodeId", value = "前置服务器id", required = true),
|
||||
@ApiImplicitParam(name = "processNo", value = "进程号", required = true)
|
||||
})
|
||||
public HttpResult<String> restartProcess(@RequestParam String nodeId,@RequestParam Integer processNo){
|
||||
String methodDescribe = getMethodDescribe("restartProcess");
|
||||
iNodeService.restartProcess(nodeId,processNo);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateDevProcessNo")
|
||||
@ApiOperation("更新设备进程号")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "设备id", required = true),
|
||||
@ApiImplicitParam(name = "processNo", value = "进程号", required = true)
|
||||
})
|
||||
public HttpResult<String> updateDevProcessNo(@RequestParam String id,@RequestParam Integer processNo){
|
||||
String methodDescribe = getMethodDescribe("updateDevProcessNo");
|
||||
String result = iNodeService.updateDevProcessNo(id,processNo);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateDevNode")
|
||||
@ApiOperation("更新设备前置信息")
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
public HttpResult<String> updateDevNode(@RequestBody IcdNodeParam param){
|
||||
String methodDescribe = getMethodDescribe("updateDevNode");
|
||||
String result = iNodeService.updateDevNode(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,25 @@
|
||||
package com.njcn.csdevice.controller.ledger;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
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.csdevice.mapper.PqsDeviceUnitMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.service.CsCommTerminalService;
|
||||
import com.njcn.csdevice.service.CsDeviceUserPOService;
|
||||
import com.njcn.csdevice.service.CsEquipmentDeliveryService;
|
||||
import com.njcn.csdevice.service.CsLinePOService;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.constant.UserType;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -17,7 +29,11 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
@@ -32,7 +48,48 @@ import java.util.Objects;
|
||||
@Api(tags = "通用台账查询")
|
||||
public class CsCommTerminalController extends BaseController {
|
||||
|
||||
private final PqsDeviceUnitMapper pqsDeviceUnitMapper;
|
||||
|
||||
private final CsCommTerminalService commTerminalService;
|
||||
|
||||
/**
|
||||
* 根据用户获取设备信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getDevIdsByUser")
|
||||
@ApiOperation("根据登录用户id获取用户所有设备id集合")
|
||||
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
||||
public HttpResult<List<String>> getDevIdsByUser(@RequestParam("userId") String userId) {
|
||||
String methodDescribe = getMethodDescribe("getDevIdsByUser");
|
||||
List<String> devIds = commTerminalService.commGetDevIds(userId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, devIds, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户获取设备信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getLineIdsByUser")
|
||||
@ApiOperation("根据登录用户id获取用户所有监测点id集合")
|
||||
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
||||
public HttpResult<List<String>> getLineIdsByUser(@RequestParam("userId") String userId) {
|
||||
String methodDescribe = getMethodDescribe("getLineIdsByUser");
|
||||
List<String> lineIds = commTerminalService.getLineIdsByUser(userId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineIds, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户获取设备信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getPqUserIdsByUser")
|
||||
@ApiOperation("根据登录用户id获取电能质量用户id集合")
|
||||
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
||||
public HttpResult<List<String>> getPqUserIdsByUser(@RequestParam("userId") String userId) {
|
||||
String methodDescribe = getMethodDescribe("getLineIdsByUser");
|
||||
List<String> lineIds = commTerminalService.getPqUserIdsByUser(userId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineIds, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -47,11 +104,7 @@ public class CsCommTerminalController extends BaseController {
|
||||
@ApiImplicitParam(name = "lineId", value = "实体", required = true)
|
||||
public HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId) {
|
||||
String methodDescribe = getMethodDescribe("lineUnitDetail");
|
||||
|
||||
PqsDeviceUnit pqsDeviceUnit = pqsDeviceUnitMapper.selectById(lineId);
|
||||
if(Objects.isNull(pqsDeviceUnit)){
|
||||
pqsDeviceUnit = new PqsDeviceUnit();
|
||||
}
|
||||
PqsDeviceUnit pqsDeviceUnit = commTerminalService.lineUnitDetail(lineId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnit, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,16 @@ public class CsLedgerController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/objTree")
|
||||
@ApiOperation("三层对象用户树")
|
||||
public HttpResult<List<CsLedgerVO>> objTree(){
|
||||
String methodDescribe = getMethodDescribe("getProjectTree");
|
||||
List<CsLedgerVO> list = csLedgerService.objTree();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增台账信息")
|
||||
@@ -165,5 +175,35 @@ public class CsLedgerController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getInfoByIds")
|
||||
@ApiOperation("根据设备集合查询工程,设备信息")
|
||||
@ApiImplicitParam(name = "list", value = "查询条件", required = true)
|
||||
public HttpResult<List<DevDetailDTO>> getInfoByIds(@RequestBody @Validated List<String> list){
|
||||
String methodDescribe = getMethodDescribe("getInfoByIds");
|
||||
List<DevDetailDTO> details = csLedgerService.getInfoByIds(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, details, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getDevInfoByEngineerIds")
|
||||
@ApiOperation("根据工程获取设备信息")
|
||||
@ApiImplicitParam(name = "list", value = "查询条件", required = true)
|
||||
public HttpResult<List<DevDetailDTO>> getDevInfoByEngineerIds(@RequestBody @Validated List<String> list){
|
||||
String methodDescribe = getMethodDescribe("getDevInfoByEngineerIds");
|
||||
List<DevDetailDTO> details = csLedgerService.getDevInfoByEngineerIds(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, details, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getEngineeringHaveDevs")
|
||||
@ApiOperation("根据工程信息获取有设备的工程")
|
||||
@ApiImplicitParam(name = "list", value = "查询条件", required = true)
|
||||
public HttpResult<List<DevDetailDTO>> getEngineeringHaveDevs(@RequestBody @Validated List<String> list){
|
||||
String methodDescribe = getMethodDescribe("getEngineeringHaveDevs");
|
||||
List<DevDetailDTO> details = csLedgerService.getEngineeringHaveDevs(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, details, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +1,33 @@
|
||||
package com.njcn.csdevice.controller.line;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
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.csdevice.mapper.OverlimitMapper;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.csdevice.pojo.vo.PqSensitiveUserLineVO;
|
||||
import com.njcn.csdevice.service.CsLinePOService;
|
||||
import com.njcn.device.biz.mapper.OverLimitWlMapper;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.utils.COverlimitUtil;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
@@ -41,7 +44,7 @@ import java.util.List;
|
||||
public class CslineController extends BaseController {
|
||||
|
||||
private final CsLinePOService csLinePOService;
|
||||
private final OverlimitMapper overlimitMapper;
|
||||
private final OverLimitWlMapper overLimitWlMapper;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryLineById")
|
||||
@@ -84,8 +87,8 @@ public class CslineController extends BaseController {
|
||||
for(CsLinePO csLinePO: list){
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(csLinePO.getVolGrade().floatValue(),10f,10f,10f,0,1);
|
||||
overlimit.setId(csLinePO.getLineId());
|
||||
overlimitMapper.deleteById(csLinePO.getLineId());
|
||||
overlimitMapper.insert(overlimit);
|
||||
overLimitWlMapper.deleteById(csLinePO.getLineId());
|
||||
overLimitWlMapper.insert(overlimit);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
@@ -101,6 +104,17 @@ public class CslineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineList, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getCustomDetailByLineId")
|
||||
@ApiOperation("根据id查询监测点")
|
||||
public HttpResult<Map<String,String>> getCustomDetailByLineId(@RequestParam String id){
|
||||
String methodDescribe = getMethodDescribe("getCustomDetailByLineId");
|
||||
Map<String,String> map = csLinePOService.getCustomDetailByLineId(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, map, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateLine")
|
||||
@ApiOperation("修改监测点信息")
|
||||
@@ -135,13 +149,23 @@ public class CslineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOverLimitDataByIds")
|
||||
@ApiOperation("根据监测点id集合获取国标限值")
|
||||
@ApiImplicitParam(name = "ids", value = "监测点id集合", required = true)
|
||||
public HttpResult<List<Overlimit>> getOverLimitData(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("getOverLimitDataByIds");
|
||||
List<Overlimit> result = overLimitWlMapper.selectBatchIds(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOverLimitData")
|
||||
@ApiOperation("根据监测点id获取国标限值")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<Overlimit> getOverLimitData(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getOverLimitData");
|
||||
Overlimit result = overlimitMapper.selectById(id);
|
||||
Overlimit result = overLimitWlMapper.selectById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -173,10 +197,10 @@ public class CslineController extends BaseController {
|
||||
String methodDescribe = getMethodDescribe("addCldLine");
|
||||
csLinePOService.addCldLine(param);
|
||||
//新增监测点限值
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(param.getVolGrade().floatValue(),10f,10f,10f,0,1);
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(param.getVolGrade().floatValue(),param.getProtocolCapacity().floatValue(),param.getDevCapacity().floatValue(),param.getShortCircuitCapacity().floatValue(),0,0);
|
||||
overlimit.setId(param.getLineId());
|
||||
overlimitMapper.deleteById(param.getLineId());
|
||||
overlimitMapper.insert(overlimit);
|
||||
overLimitWlMapper.deleteById(param.getLineId());
|
||||
overLimitWlMapper.insert(overlimit);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -188,10 +212,10 @@ public class CslineController extends BaseController {
|
||||
String methodDescribe = getMethodDescribe("updateCldLine");
|
||||
csLinePOService.updateCldLine(param);
|
||||
//修改监测点限值
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(param.getVolGrade().floatValue(),10f,10f,10f,0,1);
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(param.getVolGrade().floatValue(),param.getProtocolCapacity().floatValue(),param.getDevCapacity().floatValue(),param.getShortCircuitCapacity().floatValue(),0,0);
|
||||
overlimit.setId(param.getLineId());
|
||||
overlimitMapper.deleteById(param.getLineId());
|
||||
overlimitMapper.insert(overlimit);
|
||||
overLimitWlMapper.deleteById(param.getLineId());
|
||||
overLimitWlMapper.insert(overlimit);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -202,6 +226,7 @@ public class CslineController extends BaseController {
|
||||
public HttpResult<List<CsLinePO>> delCldLine(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("delCldLine");
|
||||
csLinePOService.deleteCldLine(id);
|
||||
overLimitWlMapper.deleteById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -220,4 +245,91 @@ public class CslineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getAllLine")
|
||||
@ApiOperation("获取系统中所有监测点id")
|
||||
public HttpResult<List<String>> getAllLine(){
|
||||
String methodDescribe = getMethodDescribe("getAllLine");
|
||||
List<String> list = csLinePOService.getAllLine();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getSimpleLine")
|
||||
@ApiOperation("查询登录用户拥有的监测点台账")
|
||||
public HttpResult<List<CsLinePO>> getSimpleLine(){
|
||||
String methodDescribe = getMethodDescribe("getSimpleLine");
|
||||
List<CsLinePO> list = csLinePOService.getSimpleLine();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineByName")
|
||||
@ApiOperation("根据名称获取监测点")
|
||||
@ApiImplicitParam(name = "lineName", value = "监测点名称", required = true)
|
||||
public HttpResult<List<CsLinePO>> getLineByName(@RequestParam("lineName") String lineName) {
|
||||
String methodDescribe = getMethodDescribe("getLineByName");
|
||||
List<CsLinePO> list = csLinePOService.getLineByName(lineName);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/list")
|
||||
@ApiOperation("查询监测点列表")
|
||||
@ApiImplicitParam(name = "param", value = "param", required = true)
|
||||
public HttpResult<List<CsLinePO>> list(@RequestBody CsLinePO param) {
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
List<CsLinePO> list = csLinePOService.getLineList(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineBySensitiveUser")
|
||||
@ApiOperation("根据敏感用户查询监测点")
|
||||
public HttpResult<List<CsLinePO>> getLineBySensitiveUser(@RequestBody List<String> list) {
|
||||
String methodDescribe = getMethodDescribe("getLineBySensitiveUser");
|
||||
List<CsLinePO> result = csLinePOService.getLineBySensitiveUser(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getSensitiveUserLineList")
|
||||
@ApiOperation("获取敏感负荷用户监测点列表")
|
||||
@ApiImplicitParam(name = "param", value = "查询参数", required = true)
|
||||
public HttpResult<Page<PqSensitiveUserLineVO>> getSensitiveUserLineList(@RequestBody BaseParam param) {
|
||||
String methodDescribe = getMethodDescribe("getSensitiveUserLineList");
|
||||
Page<PqSensitiveUserLineVO> page = csLinePOService.getSensitiveUserLineList(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/uploadReport")
|
||||
@ApiOperation("上传治理报告")
|
||||
public HttpResult<Boolean> uploadReport(@ApiParam(value = "文件",name="报告文件", required = true) @RequestPart("file") MultipartFile file,@ApiParam(value = "lineId", name="监测点ID", required = true) @RequestParam String lineId) {
|
||||
String methodDescribe = getMethodDescribe("uploadReport");
|
||||
boolean success = csLinePOService.uploadReport(file, lineId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, success, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getReportUrl")
|
||||
@ApiOperation("获取治理报告链接")
|
||||
public HttpResult<String> getReportUrl(@ApiParam(value = "lineId", name="监测点ID", required = true) @RequestParam String lineId) {
|
||||
String methodDescribe = getMethodDescribe("getReportUrl");
|
||||
String url = csLinePOService.getReportUrl(lineId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, url, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineDetailData")
|
||||
@ApiOperation("根据监测点id获取监测点详情")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<LineDetailDataVO> getLineDetailData(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineDetailData");
|
||||
LineDetailDataVO result = csLinePOService.getLineDetailData(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
||||
import com.njcn.csdevice.pojo.po.CsEngineeringPO;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
||||
import com.njcn.csdevice.service.CsEngineeringService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -94,4 +93,14 @@ public class EngineeringController extends BaseController {
|
||||
CsEngineeringPO po = csEngineeringService.queryEngineeringById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getUnlinkedEngineering")
|
||||
@ApiOperation("获取用户未绑定的工程信息")
|
||||
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
||||
public HttpResult<List<CsEngineeringPO>> getUnlinkedEngineering(@RequestParam("userId") String userId){
|
||||
String methodDescribe = getMethodDescribe("getUnlinkedEngineering");
|
||||
List<CsEngineeringPO> result = csEngineeringService.getUnlinkedEngineering(userId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.njcn.csdevice.controller.project;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
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.csdevice.pojo.param.AppProjectAddParm;
|
||||
import com.njcn.csdevice.pojo.param.AppProjectAuditParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEngineeringAddParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
||||
import com.njcn.csdevice.pojo.vo.EngineeringProjectRelationVo;
|
||||
import com.njcn.csdevice.service.IEngineeringProjectService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
* @date 2026/1/29
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/engineeringProjectRelation")
|
||||
@Api(tags = " 工程信息管理(不分权限)")
|
||||
@AllArgsConstructor
|
||||
public class EngineeringProjectController extends BaseController {
|
||||
|
||||
private final IEngineeringProjectService csEngineeringService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/addEngineering")
|
||||
@ApiOperation("新增工程信息")
|
||||
public HttpResult<Boolean> addEngineering(@Validated @RequestBody CsEngineeringAddParm csEngineeringAddParm){
|
||||
String methodDescribe = getMethodDescribe("addEngineering");
|
||||
boolean result = csEngineeringService.addEngineering(csEngineeringAddParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateEngineering")
|
||||
@ApiOperation("修改工程信息")
|
||||
public HttpResult<Boolean> updateEngineering(@Validated @RequestBody CsEngineeringAuditParm csEngineeringAuditParm){
|
||||
String methodDescribe = getMethodDescribe("updateEngineering");
|
||||
boolean result = csEngineeringService.updateEngineering(csEngineeringAuditParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/deleteEngineering")
|
||||
@ApiOperation("删除工程信息")
|
||||
public HttpResult<Boolean> deleteEngineering(@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("deleteEngineering");
|
||||
boolean result = csEngineeringService.deleteEngineering(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/addProject")
|
||||
@ApiOperation("新增项目信息")
|
||||
public HttpResult<Boolean> addProject(@Validated @RequestBody AppProjectAddParm param){
|
||||
String methodDescribe = getMethodDescribe("addProject");
|
||||
boolean result = csEngineeringService.addProject(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateProject")
|
||||
@ApiOperation("修改项目信息")
|
||||
public HttpResult<Boolean> updateProject(@Validated @RequestBody AppProjectAuditParm param){
|
||||
String methodDescribe = getMethodDescribe("updateProject");
|
||||
boolean result = csEngineeringService.updateProject(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/deleteProject")
|
||||
@ApiOperation("删除项目信息")
|
||||
public HttpResult<Boolean> deleteProject(@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("deleteProject");
|
||||
boolean result = csEngineeringService.deleteProject(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/list")
|
||||
@ApiOperation("查询工程信息列表")
|
||||
public HttpResult<List<EngineeringProjectRelationVo>> getList(){
|
||||
String methodDescribe = getMethodDescribe("getList");
|
||||
List<EngineeringProjectRelationVo> result = csEngineeringService.getList();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -17,4 +18,7 @@ import java.util.List;
|
||||
public interface CsLinePOMapper extends BaseMapper<CsLinePO> {
|
||||
|
||||
List<CsLinePO> findByNdid(@Param("id") String id);
|
||||
|
||||
|
||||
Map<String,String> getCustomDetailByLineId(@Param("lineId")String lineId);
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.csdevice.pojo.po.CsTerminalReply;
|
||||
import com.njcn.user.pojo.vo.RoleVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +17,6 @@ import com.njcn.csdevice.pojo.po.CsTerminalReply;
|
||||
*/
|
||||
public interface CsTerminalReplyMapper extends BaseMapper<CsTerminalReply> {
|
||||
|
||||
Page<CsTerminalReply> page(@Param("page")Page<RoleVO> page, @Param("ew") QueryWrapper<CsTerminalReply> queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
@DS("sjzx")
|
||||
@Mapper
|
||||
public interface OverlimitMapper extends BaseMapper<Overlimit> {
|
||||
|
||||
}
|
||||
@@ -93,7 +93,7 @@
|
||||
from
|
||||
cs_equipment_delivery
|
||||
<where>
|
||||
1=1
|
||||
dev_access_method = 'MQTT'
|
||||
<if test="queryParam.process != null and queryParam.process !=''">
|
||||
and process = #{queryParam.process}
|
||||
</if>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
line_id, dev_id, `name`, `position`, vol_grade, pt_ratio, ct_ratio, `status`, create_by,
|
||||
line_id, dev_id, `name`, `position`, vol_grade, pt_ratio, ct_ratio, `status`, create_by,
|
||||
create_time, update_by, update_time
|
||||
</sql>
|
||||
|
||||
@@ -33,4 +33,24 @@
|
||||
where
|
||||
t0.ndid = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
||||
<select id="getCustomDetailByLineId" resultType="map">
|
||||
SELECT
|
||||
line.line_id as lineId,
|
||||
line.name as lineName,
|
||||
concat(round(line.pt_ratio,0), ':', round(IFNULL(line.pt2_ratio, 1), 0)) as pt,
|
||||
concat(round(line.ct_ratio,0), ':', round(IFNULL(line.ct2_ratio, 1), 0)) as ct,
|
||||
line.dev_capacity as Dev_Capacity,
|
||||
line.short_circuit_capacity as Short_Capacity,
|
||||
line.basic_capacity as Standard_Capacity,
|
||||
line.protocol_capacity as Deal_Capacity,
|
||||
line.vol_grade AS voltageLevel,
|
||||
dataSet.data_level AS level
|
||||
FROM
|
||||
cs_line line
|
||||
left JOIN cs_data_set dataSet on line.data_set_id = dataSet.id
|
||||
WHERE
|
||||
line.line_id = #{lineId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.csdevice.mapper.CsTerminalReplyMapper">
|
||||
|
||||
<!--获取角色分页列表-->
|
||||
<select id="page" resultType="CsTerminalReply">
|
||||
select
|
||||
cs_terminal_reply.*
|
||||
from
|
||||
cs_terminal_reply
|
||||
WHERE ${ew.sqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.overlimit.mapper.OverlimitMapper">
|
||||
|
||||
<select id="getAllLineOverLimit" resultType="com.njcn.device.biz.pojo.po.Overlimit">
|
||||
select f.* from pq_line a
|
||||
inner join pq_line_detail b on a.id = b.id
|
||||
inner join pq_line c on a.pid = c.id
|
||||
inner join pq_line d on c.pid = d.id
|
||||
inner join pq_device e on d.id = e.id
|
||||
inner join pq_overlimit f on a.id=f.id
|
||||
where e.dev_data_type in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
and e.run_flag = 0
|
||||
and e.dev_model = 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -55,4 +55,11 @@ public interface AppProjectService extends IService<AppProjectPO> {
|
||||
* @return
|
||||
*/
|
||||
List<AppProjectPO> getProjectByEngineering(List<String> list);
|
||||
|
||||
|
||||
AppProjectPO add(AppProjectAddParm param);
|
||||
|
||||
AppProjectPO updateData(AppProjectAuditParm param);
|
||||
|
||||
boolean delete(String id);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
|
||||
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CsCommTerminalService {
|
||||
|
||||
|
||||
List<String> getLineIdsByUser(String userId);
|
||||
|
||||
|
||||
|
||||
List<String> getPqUserIdsByUser(String userId);
|
||||
|
||||
|
||||
PqsDeviceUnit lineUnitDetail(String lineId);
|
||||
|
||||
|
||||
List<String> commGetDevIds(String userId);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
||||
import com.njcn.csdevice.pojo.vo.DevUserVO;
|
||||
@@ -48,4 +49,8 @@ public interface CsDeviceUserPOService extends IService<CsDeviceUserPO>{
|
||||
* @return
|
||||
*/
|
||||
List<String> findUserById(String devId);
|
||||
|
||||
List<String> findDevByUserId(String userId);
|
||||
|
||||
void channelDevByUserId(UserDevParam param);
|
||||
}
|
||||
|
||||
@@ -57,4 +57,13 @@ public interface CsEngineeringService extends IService<CsEngineeringPO>{
|
||||
List<CsEngineeringPO> getEngineerings(List<String> list);
|
||||
|
||||
CsEngineeringPO queryEngineeringById(String id);
|
||||
|
||||
List<CsEngineeringPO> getUnlinkedEngineering(String userId);
|
||||
|
||||
CsEngineeringPO add(CsEngineeringAddParm csEngineeringAddParm);
|
||||
|
||||
CsEngineeringPO updateData(CsEngineeringAuditParm csEngineeringAuditParm);
|
||||
|
||||
boolean deleteData(String id);
|
||||
|
||||
}
|
||||
|
||||
@@ -130,6 +130,12 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
||||
*/
|
||||
List<CsEquipmentDeliveryPO> getAll();
|
||||
|
||||
/**
|
||||
* 获取所有装置信息(投运且在线)
|
||||
* @return
|
||||
*/
|
||||
List<CsEquipmentDeliveryPO> getAllOnline();
|
||||
|
||||
/**
|
||||
* 判断设备型号
|
||||
*/
|
||||
@@ -185,4 +191,8 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
||||
|
||||
List<CsEquipmentDeliveryPO> getDataByNodeIdAndProcessNo(String nodeId, Integer processNo);
|
||||
|
||||
List<CsEquipmentDeliveryPO> getListByIds(List<String> devList);
|
||||
|
||||
List<CsEquipmentDeliveryPO> getRunPortableDev(String userId);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.csdevice.pojo.vo.PqSensitiveUserLineVO;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/5/18 14:01【需求编号】
|
||||
*
|
||||
@@ -35,6 +40,9 @@ public interface CsLinePOService extends IService<CsLinePO>{
|
||||
*/
|
||||
List<CsLinePO> findByNdid(String id);
|
||||
|
||||
|
||||
Map<String,String> getCustomDetailByLineId(String lineId);
|
||||
|
||||
/**
|
||||
* 更新监测点信息
|
||||
* @param csLineParam
|
||||
@@ -63,4 +71,30 @@ public interface CsLinePOService extends IService<CsLinePO>{
|
||||
void updateCldLineStatus(List<CsLinePO> lineList, Integer status);
|
||||
|
||||
void updateLineDataByList(List<String> list, String id, String setId);
|
||||
|
||||
/**
|
||||
* 根据名称获取监测点
|
||||
* @param lineName
|
||||
* @return
|
||||
*/
|
||||
List<CsLinePO> getLineByName(String lineName);
|
||||
|
||||
List<String> getAllLine();
|
||||
|
||||
List<CsLinePO> getSimpleLine();
|
||||
|
||||
List<CsLinePO> getLineBySensitiveUser(List<String> list);
|
||||
|
||||
Page<PqSensitiveUserLineVO> getSensitiveUserLineList(BaseParam param);
|
||||
boolean uploadReport(MultipartFile file, String lineId);
|
||||
String getReportUrl(String lineId);
|
||||
|
||||
/**
|
||||
* 获取监测点详情
|
||||
* @param id 监测点id
|
||||
* @return 结果
|
||||
*/
|
||||
LineDetailDataVO getLineDetailData(String id);
|
||||
|
||||
List<CsLinePO> getLineList(CsLinePO param);
|
||||
}
|
||||
|
||||
@@ -7,12 +7,15 @@ import com.njcn.csdevice.pojo.po.CsGroup;
|
||||
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
||||
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||
import com.njcn.csharmonic.param.FittingDataQueryParam;
|
||||
import com.njcn.csharmonic.param.SensitiveUserTrendDataQueryParam;
|
||||
import com.njcn.csharmonic.param.TrendDataQueryParam;
|
||||
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -78,4 +81,25 @@ public interface ICsGroupService extends IService<CsGroup> {
|
||||
*/
|
||||
void deleteGroup(String groupId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询趋势数据
|
||||
* @param trendDataQueryParam
|
||||
* @return
|
||||
*/
|
||||
List<ThdDataVO> trendData(TrendDataQueryParam trendDataQueryParam);
|
||||
/**
|
||||
* 查询指标拟合图数据
|
||||
* @param fittingDataQueryParam
|
||||
* @return
|
||||
*/
|
||||
List<ThdDataVO> fittingData(FittingDataQueryParam fittingDataQueryParam);
|
||||
|
||||
/**
|
||||
* 查询敏感用户趋势数据
|
||||
* @param sensitiveUserTrendDataQueryParam
|
||||
* @return
|
||||
*/
|
||||
Map<String,List<ThdDataVO>> sensitiveUserTrendData(SensitiveUserTrendDataQueryParam sensitiveUserTrendDataQueryParam);
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public interface ICsLedgerService extends IService<CsLedger> {
|
||||
List<CsLedgerVO> getLineTree();
|
||||
|
||||
/**
|
||||
* 终端三层树
|
||||
* 终端三层树
|
||||
* @return
|
||||
*/
|
||||
List<CsLedgerVO> getDeviceTree();
|
||||
@@ -77,6 +77,9 @@ public interface ICsLedgerService extends IService<CsLedger> {
|
||||
|
||||
List<CsLedgerVO> getztProjectTree();
|
||||
|
||||
|
||||
List<CsLedgerVO> objTree();
|
||||
|
||||
/**
|
||||
* 根据设备集合获取项目和工程
|
||||
* @param id
|
||||
@@ -85,4 +88,11 @@ public interface ICsLedgerService extends IService<CsLedger> {
|
||||
List<CsLedgerVO> getProAndEngineer(List<String> id);
|
||||
|
||||
CsLedgerVO cldTree();
|
||||
|
||||
List<DevDetailDTO> getInfoByIds(List<String> list);
|
||||
|
||||
List<DevDetailDTO> getDevInfoByEngineerIds(List<String> list);
|
||||
|
||||
List<DevDetailDTO> getEngineeringHaveDevs(List<String> list);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.param.IcdBzParam;
|
||||
import com.njcn.csdevice.param.IcdBzReplyParam;
|
||||
import com.njcn.csdevice.pojo.po.CsTerminalReply;
|
||||
import com.njcn.csdevice.pojo.vo.CldLogsVo;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -17,6 +23,12 @@ public interface ICsTerminalReplyService extends IService<CsTerminalReply> {
|
||||
|
||||
List<String> queryReplyData();
|
||||
|
||||
void updateReplyData(String id,Integer state,String deviceId);
|
||||
void updateReplyData(IcdBzReplyParam param);
|
||||
|
||||
List<CsTerminalReply> getBzReplyData(String lineId);
|
||||
|
||||
Page<CldLogsVo> getBzLogs(BaseParam param);
|
||||
|
||||
void updateBzData(IcdBzReplyParam param);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.njcn.csdevice.pojo.param.AppProjectAddParm;
|
||||
import com.njcn.csdevice.pojo.param.AppProjectAuditParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEngineeringAddParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
||||
import com.njcn.csdevice.pojo.vo.EngineeringProjectRelationVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 组和指标关系表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-06-19
|
||||
*/
|
||||
public interface IEngineeringProjectService {
|
||||
|
||||
boolean addEngineering(CsEngineeringAddParm csEngineeringAddParm);
|
||||
|
||||
boolean updateEngineering(CsEngineeringAuditParm csEngineeringAuditParm);
|
||||
|
||||
boolean deleteEngineering(String id);
|
||||
|
||||
boolean addProject(AppProjectAddParm param);
|
||||
|
||||
boolean updateProject(AppProjectAuditParm param);
|
||||
|
||||
boolean deleteProject(String id);
|
||||
|
||||
List<EngineeringProjectRelationVo> getList();
|
||||
|
||||
}
|
||||
@@ -3,9 +3,11 @@ package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.param.IcdNodeParam;
|
||||
import com.njcn.csdevice.pojo.param.NodeParam;
|
||||
import com.njcn.csdevice.pojo.po.Node;
|
||||
import com.njcn.csdevice.pojo.vo.NodeProcessDeviceVo;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -79,4 +81,10 @@ public interface INodeService extends IService<Node> {
|
||||
Node getNodeByIp(String ip);
|
||||
|
||||
NodeProcessDeviceVo getProcessNoAndDeviceById(String id);
|
||||
|
||||
void restartProcess(String nodeId, Integer processNo);
|
||||
|
||||
String updateDevProcessNo(String id, Integer processNo);
|
||||
|
||||
String updateDevNode(IcdNodeParam param);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.vo.LineOverLimitVO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 越限表实体
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2023-03-28
|
||||
*/
|
||||
public interface IOverLimitService extends IService<Overlimit> {
|
||||
|
||||
|
||||
Overlimit getOverLimitDataById(String id);
|
||||
|
||||
/**
|
||||
* 获取监测点越限详情
|
||||
* @param id 监测点id
|
||||
* @return 结果
|
||||
*/
|
||||
LineOverLimitVO getLineOverLimitDataById(String id);
|
||||
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.njcn.csdevice.param.IcdBzParam;
|
||||
import com.njcn.csdevice.param.IcdLedgerParam;
|
||||
import com.njcn.csdevice.param.IcdParam;
|
||||
import com.njcn.csdevice.pojo.vo.CldLedgerVo;
|
||||
import com.njcn.csdevice.pojo.vo.DeviceInfo;
|
||||
import com.njcn.mq.message.CldControlMessage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -16,6 +16,10 @@ public interface IcdService {
|
||||
|
||||
CldLedgerVo getLedgerById(String id);
|
||||
|
||||
void restartProcess(CldControlMessage message);
|
||||
void bzFileByEventId(String eventId);
|
||||
|
||||
void bzEvent(IcdBzParam param);
|
||||
|
||||
void bzFile(IcdBzParam param);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.mapper.OverlimitMapper;
|
||||
import com.njcn.csdevice.service.impl.OverlimitService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/10/22 14:14【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@DS("sjzx")
|
||||
public class OverlimitServiceImpl extends ServiceImpl<OverlimitMapper, Overlimit> implements OverlimitService{
|
||||
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.stream.CollectorUtil;
|
||||
import com.alibaba.cloud.commons.lang.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -17,7 +17,6 @@ import com.njcn.csdevice.pojo.param.*;
|
||||
import com.njcn.csdevice.pojo.po.*;
|
||||
import com.njcn.csdevice.pojo.vo.AppProjectVO;
|
||||
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
||||
import com.njcn.csdevice.pojo.vo.CsLineTopologyTemplateVO;
|
||||
import com.njcn.csdevice.service.AppProjectService;
|
||||
import com.njcn.csdevice.service.AppTopologyDiagramService;
|
||||
import com.njcn.csdevice.service.CsLineTopologyTemplateService;
|
||||
@@ -367,4 +366,42 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppProjectPO add(AppProjectAddParm param) {
|
||||
AppProjectPO po = new AppProjectPO ( );
|
||||
List<AppProjectPO> list = this.lambdaQuery().eq(AppProjectPO::getName, param.getName()).eq(AppProjectPO::getStatus, "1").list();
|
||||
if(!list.isEmpty()){
|
||||
throw new BusinessException("新增失败,项目名重复");
|
||||
}
|
||||
BeanUtils.copyProperties (param, po);
|
||||
po.setStatus ("1");
|
||||
this.save(po);
|
||||
return po;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppProjectPO updateData(AppProjectAuditParm param) {
|
||||
List<AppProjectPO> list = this.lambdaQuery()
|
||||
.eq(AppProjectPO::getName, param.getName())
|
||||
.eq(AppProjectPO::getStatus, "1")
|
||||
.ne(AppProjectPO::getId, param.getId())
|
||||
.list();
|
||||
if(!list.isEmpty()){
|
||||
throw new BusinessException("修改失败,项目名重复");
|
||||
}
|
||||
AppProjectPO po = new AppProjectPO ();
|
||||
BeanUtils.copyProperties (param, po);
|
||||
this.updateById(po);
|
||||
return po;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delete(String id) {
|
||||
LambdaUpdateWrapper<AppProjectPO> queryWrapper = new LambdaUpdateWrapper<>();
|
||||
queryWrapper.eq(AppProjectPO::getId,id).set(AppProjectPO::getStatus,"0");
|
||||
return this.update(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
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.csdevice.mapper.CsLinePOMapper;
|
||||
import com.njcn.csdevice.mapper.PqsDeviceUnitMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.service.CsCommTerminalService;
|
||||
import com.njcn.csdevice.service.CsDeviceUserPOService;
|
||||
import com.njcn.csdevice.service.CsEquipmentDeliveryService;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.constant.UserType;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2025-12-23
|
||||
* @Description:
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CsCommTerminalServiceImpl implements CsCommTerminalService {
|
||||
|
||||
private final PqsDeviceUnitMapper pqsDeviceUnitMapper;
|
||||
private final CsDeviceUserPOService csDeviceUserPOService;
|
||||
private final CsLinePOMapper csLinePOMapper;
|
||||
private final UserFeignClient userFeignClient;
|
||||
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
||||
|
||||
|
||||
@Override
|
||||
public List<String> getLineIdsByUser(String userId) {
|
||||
List<String> result = new ArrayList<>();
|
||||
List<String> devIds = commGetDevIds(userId);
|
||||
if (CollUtil.isEmpty(devIds)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
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)) {
|
||||
result = poList.stream().map(CsLinePO::getLineId).distinct().collect(Collectors.toList());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getPqUserIdsByUser(String userId) {
|
||||
List<String> result = new ArrayList<>();
|
||||
List<String> devIds = commGetDevIds(userId);
|
||||
if (CollUtil.isEmpty(devIds)) {
|
||||
return result;
|
||||
}
|
||||
LambdaQueryWrapper<CsLinePO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
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)) {
|
||||
result = poList.stream().map(CsLinePO::getMonitorUser).distinct().collect(Collectors.toList());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PqsDeviceUnit lineUnitDetail(String lineId) {
|
||||
PqsDeviceUnit pqsDeviceUnit = pqsDeviceUnitMapper.selectById(lineId);
|
||||
if(Objects.isNull(pqsDeviceUnit)){
|
||||
pqsDeviceUnit = new PqsDeviceUnit();
|
||||
}
|
||||
return pqsDeviceUnit;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<String> commGetDevIds(String userId) {
|
||||
UserVO userVO = userFeignClient.getUserById(userId).getData();
|
||||
List<String> devIds;
|
||||
if (userVO.getType().equals(UserType.SUPER_ADMINISTRATOR) || userVO.getType().equals(UserType.ADMINISTRATOR)) {
|
||||
devIds = csEquipmentDeliveryService.getAll().stream().map(CsEquipmentDeliveryPO::getId).collect(Collectors.toList());
|
||||
} else {
|
||||
List<CsDeviceUserPO> devList = csDeviceUserPOService.lambdaQuery().select(CsDeviceUserPO::getDeviceId)
|
||||
.and(w -> w.eq(CsDeviceUserPO::getPrimaryUserId, userId).or().eq(CsDeviceUserPO::getSubUserId, userId))
|
||||
.eq(CsDeviceUserPO::getStatus, DataStateEnum.ENABLE.getCode()).list();
|
||||
devIds = devList.stream().map(CsDeviceUserPO::getDeviceId).distinct().collect(Collectors.toList());
|
||||
}
|
||||
return devIds;
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/9/27 10:29【需求编号】
|
||||
*
|
||||
@@ -50,12 +50,12 @@ public class CsDevCapacityPOServiceImpl extends ServiceImpl<CsDevCapacityPOMappe
|
||||
public Double getDevCapacity(String 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));
|
||||
List<CsLinePO> collect1 = csLinePOS.stream().filter(temp -> Objects.equals(areaId, temp.getPosition())).collect(Collectors.toList());
|
||||
//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());
|
||||
/*治理侧监测点*/
|
||||
CsLinePO csLinePO = collect1.get(0);
|
||||
CsLinePO csLinePO = csLinePOS.get(0);
|
||||
CsDevCapacityPO one = this.lambdaQuery().eq(CsDevCapacityPO::getLineId, csLinePO.getLineId()).eq(CsDevCapacityPO::getCldid, 0).one();
|
||||
// Optional.ofNullable(one).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.DATA_MISSING));
|
||||
if(Objects.isNull(one)){
|
||||
|
||||
@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
@@ -12,6 +11,7 @@ import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.mapper.CsDeviceUserPOMapper;
|
||||
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
||||
import com.njcn.csdevice.mapper.CsMarketDataMapper;
|
||||
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||
import com.njcn.csdevice.pojo.po.*;
|
||||
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
||||
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
||||
@@ -51,22 +51,17 @@ import static java.util.Objects.isNull;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper, CsDeviceUserPO> implements CsDeviceUserPOService{
|
||||
private final CsDevModelRelationService csDevModelRelationService;
|
||||
|
||||
private final CsDevModelRelationService csDevModelRelationService;
|
||||
private final ICsLedgerService iCsLedgerService;
|
||||
// private final CsEquipmentAlarmFeignClient csEquipmentAlarmFeignClient;
|
||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||
private final RoleEngineerDevService roleEngineerDevService;
|
||||
|
||||
private final AppLineTopologyDiagramService appLineTopologyDiagramService;
|
||||
|
||||
private final CsTouristDataPOService csTouristDataPOService;
|
||||
|
||||
private final CsLinePOService csLinePOService;
|
||||
private final CsMarketDataMapper csMarketDataMapper;
|
||||
private final EventUserFeignClient eventUserFeignClient;
|
||||
private final UserFeignClient userFeignClient;
|
||||
|
||||
private final FeedBackFeignClient feedBackFeignClient;
|
||||
private final IMqttUserService mqttUserService;
|
||||
|
||||
@@ -407,4 +402,22 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findDevByUserId(String userId) {
|
||||
List<String> result = new ArrayList<>();
|
||||
List<CsDeviceUserPO> list = this.lambdaQuery().eq(CsDeviceUserPO::getPrimaryUserId,userId).list();
|
||||
if (CollectionUtil.isNotEmpty(list)){
|
||||
result = list.stream().map(CsDeviceUserPO::getDeviceId).collect(Collectors.toList());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelDevByUserId(UserDevParam param) {
|
||||
LambdaQueryWrapper<CsDeviceUserPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CsDeviceUserPO::getPrimaryUserId,param.getUserId())
|
||||
.in(CsDeviceUserPO::getDeviceId,param.getList());
|
||||
this.remove(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,17 +2,21 @@ package com.njcn.csdevice.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.Query;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.api.CsDeviceUserFeignClient;
|
||||
import com.njcn.csdevice.api.CsLedgerFeignClient;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.mapper.CsEngineeringMapper;
|
||||
import com.njcn.csdevice.mapper.CsEngineeringUserMapper;
|
||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||
import com.njcn.csdevice.mapper.CsMarketDataMapper;
|
||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||
import com.njcn.csdevice.pojo.param.CsEngineeringAddParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
||||
@@ -20,7 +24,6 @@ import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
||||
import com.njcn.csdevice.pojo.po.*;
|
||||
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
||||
import com.njcn.csdevice.service.CsEngineeringService;
|
||||
import com.njcn.csdevice.service.CsMarketDataService;
|
||||
import com.njcn.csdevice.service.CsTouristDataPOService;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.api.AreaFeignClient;
|
||||
@@ -34,10 +37,8 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -58,12 +59,10 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
||||
private final CsLedgerMapper csLedgerMapper;
|
||||
private final CsEngineeringUserMapper csEngineeringUserMapper;
|
||||
private final RoleEngineerDevServiceImpl roleEngineerDevService;
|
||||
|
||||
private final CsMarketDataMapper csMarketDataMapper;
|
||||
private final CsTouristDataPOService csTouristDataPOService;
|
||||
|
||||
|
||||
|
||||
private final CsLedgerFeignClient csLedgerFeignClient;
|
||||
private final CsDeviceUserFeignClient csDeviceUserFeignClient;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@@ -222,6 +221,82 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
||||
return this.lambdaQuery().eq(CsEngineeringPO::getId,id).eq(CsEngineeringPO::getStatus,"1").one();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsEngineeringPO> getUnlinkedEngineering(String userId) {
|
||||
List<CsEngineeringPO> result = new ArrayList<>();
|
||||
List<String> list1 = new ArrayList<>();
|
||||
//根据用户信息获取设备信息
|
||||
List<String> devList = csDeviceUserFeignClient.findDevByUserId(userId).getData();
|
||||
//根据设备查询工程信息
|
||||
if (CollectionUtil.isNotEmpty(devList)) {
|
||||
List<DevDetailDTO> ledger = csLedgerFeignClient.getInfoByIds(devList).getData();
|
||||
ledger.forEach(item->{
|
||||
if (!Objects.equals(item.getEngineeringid(),"/")) {
|
||||
list1.add(item.getEngineeringid());
|
||||
}
|
||||
});
|
||||
}
|
||||
//获取有设备的工程信息
|
||||
LambdaQueryWrapper<CsEngineeringPO> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||
queryWrapper2.eq(CsEngineeringPO::getStatus,"1");
|
||||
if (CollectionUtil.isNotEmpty(list1)) {
|
||||
queryWrapper2.notIn(CsEngineeringPO::getId,list1);
|
||||
}
|
||||
List<CsEngineeringPO> list = this.baseMapper.selectList(queryWrapper2);
|
||||
//剔除没有设备的工程
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
Map<String, CsEngineeringPO> map = list.stream().collect(Collectors.toMap(CsEngineeringPO::getId, Function.identity()));
|
||||
List<String> list2 = list.stream().map(CsEngineeringPO::getId).collect(Collectors.toList());
|
||||
List<DevDetailDTO> ledger = csLedgerFeignClient.getEngineeringHaveDevs(list2).getData();
|
||||
if (CollectionUtil.isNotEmpty(ledger)) {
|
||||
ledger.forEach(item->{
|
||||
CsEngineeringPO po = new CsEngineeringPO();
|
||||
po.setId(item.getEngineeringid());
|
||||
po.setName(map.get(item.getEngineeringid()).getName());
|
||||
result.add(po);
|
||||
});
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CsEngineeringPO add(CsEngineeringAddParm csEngineeringAddParm) {
|
||||
List<CsEngineeringPO> list = this.lambdaQuery().eq(CsEngineeringPO::getName, csEngineeringAddParm.getName()).eq(CsEngineeringPO::getStatus, "1").list();
|
||||
if(!list.isEmpty()){
|
||||
throw new BusinessException("新增失败,工程名重复");
|
||||
}
|
||||
//新增工程
|
||||
CsEngineeringPO po = new CsEngineeringPO ();
|
||||
BeanUtils.copyProperties (csEngineeringAddParm, po);
|
||||
po.setStatus ("1");
|
||||
this.save(po);
|
||||
return po;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CsEngineeringPO updateData(CsEngineeringAuditParm csEngineeringAuditParm) {
|
||||
List<CsEngineeringPO> list = this.lambdaQuery()
|
||||
.eq(CsEngineeringPO::getName, csEngineeringAuditParm.getName())
|
||||
.eq(CsEngineeringPO::getStatus, "1")
|
||||
.ne(CsEngineeringPO::getId, csEngineeringAuditParm.getId())
|
||||
.list();
|
||||
if(!list.isEmpty()){
|
||||
throw new BusinessException("修改失败,工程名重复");
|
||||
}
|
||||
CsEngineeringPO po = new CsEngineeringPO();
|
||||
BeanUtils.copyProperties(csEngineeringAuditParm, po);
|
||||
this.updateById(po);
|
||||
return po;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteData(String id) {
|
||||
LambdaUpdateWrapper<CsEngineeringPO> queryWrapper = new LambdaUpdateWrapper<>();
|
||||
queryWrapper.eq(CsEngineeringPO::getId,id).set(CsEngineeringPO::getStatus,"0");
|
||||
return this.update(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
public String getAreaById(String id){
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.enums.DicTreeEnum;
|
||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||
import com.njcn.user.enums.AppRoleEnum;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -116,8 +117,12 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public CsEquipmentDeliveryPO save(CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm) {
|
||||
boolean result;
|
||||
CsEquipmentDeliveryPO one = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getName, csEquipmentDeliveryAddParm.getName()).ne(CsEquipmentDeliveryPO::getRunStatus, 0).one();
|
||||
if(Objects.nonNull (one)){
|
||||
List<CsEquipmentDeliveryPO> one = this.lambdaQuery()
|
||||
.eq(CsEquipmentDeliveryPO::getName, csEquipmentDeliveryAddParm.getName())
|
||||
.ne(CsEquipmentDeliveryPO::getRunStatus, 0)
|
||||
.eq(CsEquipmentDeliveryPO::getDevAccessMethod, "MQTT")
|
||||
.list();
|
||||
if(CollUtil.isNotEmpty(one)){
|
||||
throw new BusinessException ("设备名称不能重复");
|
||||
}
|
||||
StringUtil.containsSpecialCharacters(csEquipmentDeliveryAddParm.getNdid());
|
||||
@@ -258,12 +263,14 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPo = new CsEquipmentDeliveryPO();
|
||||
BeanUtils.copyProperties (csEquipmentDeliveryAuditParm, csEquipmentDeliveryPo);
|
||||
result = this.updateById(csEquipmentDeliveryPo);
|
||||
//修改台账树中的设备名称
|
||||
//如果是已经接入的设备需要修改台账树中的设备名称
|
||||
CsLedger csLedger = csLedgerService.findDataById(csEquipmentDeliveryAuditParm.getId());
|
||||
CsLedgerParam.Update csLedgerParam = new CsLedgerParam.Update();
|
||||
BeanUtils.copyProperties (csLedger, csLedgerParam);
|
||||
csLedgerParam.setName(csEquipmentDeliveryAuditParm.getName());
|
||||
csLedgerService.updateLedgerTree(csLedgerParam);
|
||||
if (ObjectUtil.isNotNull(csLedger)) {
|
||||
CsLedgerParam.Update csLedgerParam = new CsLedgerParam.Update();
|
||||
BeanUtils.copyProperties (csLedger, csLedgerParam);
|
||||
csLedgerParam.setName(csEquipmentDeliveryAuditParm.getName());
|
||||
csLedgerService.updateLedgerTree(csLedgerParam);
|
||||
}
|
||||
if (result) {
|
||||
refreshDeviceDataCache();
|
||||
if (!Objects.equals(po.getUsageStatus(),csEquipmentDeliveryAuditParm.getUsageStatus())) {
|
||||
@@ -428,13 +435,15 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
if (isCLdDevice) {
|
||||
// 云前置数据集
|
||||
addDataSet(dataSetList, item, "实时数据", "realtimedata");
|
||||
addDataSet(dataSetList, item, "暂态事件", "event");
|
||||
}
|
||||
deviceManagerVo.setDataLevel(item.getDataLevel());
|
||||
}
|
||||
deviceManagerVo.setDataSetList(dataSetList);
|
||||
List<CsLinePO> csLinePOS = csLinePOService.findByNdid(csEquipmentDeliveryPo.getNdid());
|
||||
if(!csLinePOS.isEmpty() && csLinePOS.get(0)!=null){
|
||||
deviceManagerVo.setTime(csLinePOService.findByNdid(csEquipmentDeliveryPo.getNdid()).get(0).getCreateTime());
|
||||
if(!csLinePOS.isEmpty()){
|
||||
Optional<CsLinePO> earliest = csLinePOS.stream().min(Comparator.comparing(CsLinePO::getCreateTime));
|
||||
deviceManagerVo.setTime(earliest.map(CsLinePO::getCreateTime).orElse(null));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -706,6 +715,15 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
return this.lambdaQuery().ne(CsEquipmentDeliveryPO::getRunStatus,0).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsEquipmentDeliveryPO> getAllOnline() {
|
||||
return this.lambdaQuery()
|
||||
.ne(CsEquipmentDeliveryPO::getRunStatus,0)
|
||||
.eq(CsEquipmentDeliveryPO::getUsageStatus,1)
|
||||
.isNotNull(CsEquipmentDeliveryPO::getNodeId)
|
||||
.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean judgeDevModel(String nDid) {
|
||||
boolean result = false;
|
||||
@@ -816,23 +834,24 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
csTerminalLogs.setIsPush(0);
|
||||
csTerminalLogs.setNodeId(one.getNodeId());
|
||||
csTerminalLogs.setNodeProcess(one.getNodeProcess());
|
||||
csTerminalLogs.setDeviceName(one.getName());
|
||||
csTerminalLogsMapper.insert(csTerminalLogs);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateCldDev(CsEquipmentDeliveryAuditParm param) {
|
||||
//云前置设备判断,修改云前置判断设备是否达到上限
|
||||
if(ObjectUtil.isNotNull(param.getNodeId())){
|
||||
Node node = nodeService.getNodeById(param.getNodeId());
|
||||
List<CsEquipmentDeliveryPO> devList = getListByNodeId(param.getNodeId());
|
||||
if (ObjectUtil.isNotEmpty(devList) && devList.size() >= node.getNodeDevNum()) {
|
||||
throw new BusinessException (AlgorithmResponseEnum.OVER_MAX_DEV_COUNT);
|
||||
}
|
||||
//自动分配进程号
|
||||
int process = findLeastFrequentProcess(devList,node.getMaxProcessNum());
|
||||
param.setNodeProcess(process);
|
||||
}
|
||||
// //云前置设备判断,修改云前置判断设备是否达到上限
|
||||
// if(ObjectUtil.isNotNull(param.getNodeId())){
|
||||
// Node node = nodeService.getNodeById(param.getNodeId());
|
||||
// List<CsEquipmentDeliveryPO> devList = getListByNodeId(param.getNodeId());
|
||||
// if (ObjectUtil.isNotEmpty(devList) && devList.size() >= node.getNodeDevNum()) {
|
||||
// throw new BusinessException (AlgorithmResponseEnum.OVER_MAX_DEV_COUNT);
|
||||
// }
|
||||
// //自动分配进程号
|
||||
// int process = findLeastFrequentProcess(devList,node.getMaxProcessNum());
|
||||
// param.setNodeProcess(process);
|
||||
// }
|
||||
StringUtil.containsSpecialCharacters(param.getNdid());
|
||||
boolean result;
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -923,9 +942,9 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
devList.forEach(item->{item.setRunStatus(1);});
|
||||
this.updateBatchById(devList);
|
||||
//修改监测点运行状态
|
||||
List<String> devIdList = devList.stream().map(CsEquipmentDeliveryPO::getId).collect(Collectors.toList());
|
||||
List<CsLinePO> lineList = csLinePOService.getLinesByDevList(devIdList);
|
||||
csLinePOService.updateCldLineStatus(lineList,2);
|
||||
//List<String> devIdList = devList.stream().map(CsEquipmentDeliveryPO::getId).collect(Collectors.toList());
|
||||
//List<CsLinePO> lineList = csLinePOService.getLinesByDevList(devIdList);
|
||||
//csLinePOService.updateCldLineStatus(lineList,2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -939,9 +958,10 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
if (ObjectUtil.isNotNull(po)) {
|
||||
po.setRunStatus(status);
|
||||
this.updateById(po);
|
||||
//这边是监测点的运行状态 不是通讯状态,所以不要修改,通讯状态跟着设备的通讯状态来
|
||||
//修改监测点运行状态
|
||||
List<CsLinePO> lineList = csLinePOService.getLinesByDevList(Collections.singletonList(po.getId()));
|
||||
csLinePOService.updateCldLineStatus(lineList,status==1?2:0);
|
||||
//List<CsLinePO> lineList = csLinePOService.getLinesByDevList(Collections.singletonList(po.getId()));
|
||||
//csLinePOService.updateCldLineStatus(lineList,status==1?2:0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -969,6 +989,46 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsEquipmentDeliveryPO> getListByIds(List<String> devList) {
|
||||
return this.lambdaQuery().in(CsEquipmentDeliveryPO::getId,devList).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsEquipmentDeliveryPO> getRunPortableDev(String userId) {
|
||||
List<CsEquipmentDeliveryPO> result = new ArrayList<>();
|
||||
DictTreeVO vo = dictTreeFeignClient.queryByCode(DicDataEnum.PORTABLE.getCode()).getData();
|
||||
if (ObjectUtil.isNull(vo)) {
|
||||
throw new BusinessException("便携式设备类型字典缺失");
|
||||
}
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getDevType,vo.getId())
|
||||
.ne(CsEquipmentDeliveryPO::getRunStatus,0)
|
||||
.eq(CsEquipmentDeliveryPO::getUsageStatus,1);
|
||||
//获取用户已经绑定的便携式设备
|
||||
List<String> devList = csDeviceUserPOService.findDevByUserId(userId);
|
||||
if (CollectionUtil.isNotEmpty(devList)) {
|
||||
lambdaQueryWrapper.notIn(CsEquipmentDeliveryPO::getId,devList);
|
||||
}
|
||||
result = this.list(lambdaQueryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(result)) {
|
||||
//获取已经接入过系统的设备,未接入的不给分配
|
||||
LambdaQueryWrapper<CsLedger> queryWrapper = new LambdaQueryWrapper<>();
|
||||
List<String> ids = result.stream().map(CsEquipmentDeliveryPO::getId).collect(Collectors.toList());
|
||||
queryWrapper.in(CsLedger::getId,ids);
|
||||
List<CsLedger> list = csLedgerService.list(queryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
Set<String> idSet = list.stream()
|
||||
.map(CsLedger::getId)
|
||||
.collect(Collectors.toSet());
|
||||
return result.stream()
|
||||
.filter(data -> idSet.contains(data.getId()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//根据前置机id获取装置数量
|
||||
public List<CsEquipmentDeliveryPO> getListByNodeId(String nodeId) {
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package com.njcn.csdevice.service.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.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONConfig;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -16,7 +20,10 @@ import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||
import com.njcn.csdevice.constant.DataParam;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||
import com.njcn.csdevice.mapper.*;
|
||||
import com.njcn.csdevice.mapper.CsDataArrayMapper;
|
||||
import com.njcn.csdevice.mapper.CsDataSetMapper;
|
||||
import com.njcn.csdevice.mapper.CsGroArrMapper;
|
||||
import com.njcn.csdevice.mapper.CsGroupMapper;
|
||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||
import com.njcn.csdevice.pojo.param.EnergyBaseParam;
|
||||
import com.njcn.csdevice.pojo.po.*;
|
||||
@@ -31,20 +38,18 @@ import com.njcn.csdevice.util.InfluxDbParamUtil;
|
||||
import com.njcn.csdevice.utils.DataChangeUtil;
|
||||
import com.njcn.csharmonic.api.EventFeignClient;
|
||||
import com.njcn.csharmonic.constant.HarmonicConstant;
|
||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
||||
import com.njcn.csharmonic.param.*;
|
||||
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||
import com.njcn.device.biz.mapper.OverLimitWlMapper;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.influx.pojo.bo.CommonQueryParam;
|
||||
import com.njcn.influx.pojo.dto.EventDataSetDTO;
|
||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||
import com.njcn.influx.service.CommonService;
|
||||
import com.njcn.influx.service.EvtDataService;
|
||||
import com.njcn.system.api.CsStatisticalSetFeignClient;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.api.EleEvtFeignClient;
|
||||
import com.njcn.system.api.EpdFeignClient;
|
||||
import com.njcn.system.api.*;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import com.njcn.system.pojo.po.EleEvtParm;
|
||||
import com.njcn.system.pojo.vo.CsStatisticalSetVO;
|
||||
@@ -59,6 +64,7 @@ import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.time.Instant;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Function;
|
||||
@@ -85,16 +91,20 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
||||
private final EpdFeignClient epdFeignClient;
|
||||
private final CsLineFeignClient csLineFeignClient;
|
||||
private final ICsLedgerService iCsLedgerService;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final EquipmentFeignClient equipmentFeignClient;
|
||||
private final CsStatisticalSetFeignClient csStatisticalSetFeignClient;
|
||||
private final EvtDataService evtDataService;
|
||||
private final DecimalFormat df = new DecimalFormat("#0.00");
|
||||
private final EleEvtFeignClient eleEvtFeignClient;
|
||||
private final OverlimitMapper overlimitMapper;
|
||||
private final OverLimitWlMapper overLimitWlMapper;
|
||||
private final CsDataSetMapper csDataSetMapper;
|
||||
private final EventFeignClient eventFeignClient;
|
||||
private final InfluxDbParamUtil influxDbParamUtil;
|
||||
private final DictTreeFeignClient dictTreeFeignClient;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final String GRID_SIDE_DICT_CODE = "Grid_Side";
|
||||
private final String LOAD_SIDE_DICT_CODE = "Load_Side";
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -575,7 +585,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
||||
@Override
|
||||
public List<ThdDataTdVO> getDeviceTrendData(String devId, String lineId,String groupId) {
|
||||
List<ThdDataTdVO> data = new ArrayList();
|
||||
List<Overlimit> overlimits = overlimitMapper.selectBatchIds(Arrays.asList(lineId));
|
||||
List<Overlimit> overlimits = overLimitWlMapper.selectBatchIds(Arrays.asList(lineId));
|
||||
List<CsLinePO> finalCsLinePOList = csLineFeignClient.queryLineById(Arrays.asList(lineId)).getData();
|
||||
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(devId).collect(Collectors.toList())).getData();
|
||||
//便携式设备-稳态指标-实时数据-指标
|
||||
@@ -784,6 +794,395 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ThdDataVO> trendData(TrendDataQueryParam trendDataQueryParam) {
|
||||
List<ThdDataVO> result = new ArrayList<>();
|
||||
CsLinePO finalCsLinePO = csLineFeignClient.getById(trendDataQueryParam.getLineId()).getData();
|
||||
CsDataSet csDataSet = csDataSetMapper.selectOne(new LambdaQueryWrapper<CsDataSet>().eq(CsDataSet::getId,finalCsLinePO.getDataSetId()));
|
||||
if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())) {
|
||||
throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)");
|
||||
}
|
||||
Double ct = finalCsLinePO.getCtRatio();
|
||||
Double pt = finalCsLinePO.getPtRatio();
|
||||
if(CollectionUtil.isNotEmpty(trendDataQueryParam.getList())) {
|
||||
for (TrendDataQueryParam param : trendDataQueryParam.getList()) {
|
||||
List<EleEpdPqd> eleEpdPqds = csStatisticalSetFeignClient.queryStatisticalSelect(param.getStatisticalId()).getData();
|
||||
for (EleEpdPqd epdPqd : eleEpdPqds) {
|
||||
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
||||
commonQueryParam.setLineId(finalCsLinePO.getLineId());
|
||||
commonQueryParam.setTableName(influxDbParamUtil.getTableNameByClassId(epdPqd.getClassId()));
|
||||
commonQueryParam.setColumnName(epdPqd.getName() + (StringUtils.isEmpty(param.getFrequency()) ? "" : "_" + param.getFrequency()));
|
||||
commonQueryParam.setPhasic(epdPqd.getPhase());
|
||||
|
||||
commonQueryParam.setStartTime(DateUtil.format(DateUtil.parse(trendDataQueryParam.getSearchBeginTime(), DatePattern.NORM_DATE_PATTERN), DatePattern.NORM_DATETIME_PATTERN));
|
||||
commonQueryParam.setEndTime(DateUtil.format(DateUtil.endOfDay(DateUtil.parse(trendDataQueryParam.getSearchEndTime(), DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATETIME_PATTERN));
|
||||
|
||||
commonQueryParam.setDataType(trendDataQueryParam.getValueType());
|
||||
|
||||
commonQueryParam.setClDid(influxDbParamUtil.getClDidByLineId(finalCsLinePO.getLineId()));
|
||||
|
||||
List<StatisticalDataDTO> deviceRtData = commonService.getNewDeviceRtDataByTime(Collections.singletonList(commonQueryParam));
|
||||
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||
String unit;
|
||||
ThdDataVO vo = new ThdDataVO();
|
||||
vo.setLineId(temp.getLineId());
|
||||
vo.setPhase(Objects.equals("M", temp.getPhaseType()) ? null : temp.getPhaseType());
|
||||
String position = finalCsLinePO.getPosition();
|
||||
vo.setPosition(position);
|
||||
vo.setTime(temp.getTime());
|
||||
vo.setStatMethod(temp.getValueType());
|
||||
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||
if (temp.getValue() != null) {
|
||||
double re = 0;
|
||||
if (Objects.equals("Primary", trendDataQueryParam.getDataLevel())) {
|
||||
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||
if (HarmonicConstant.POWER_LIST.contains(epdPqd.getShowName())) {
|
||||
re = Objects.isNull(temp.getValue()) ? 3.14159 : Double.parseDouble(df.format(temp.getValue() / 1000));
|
||||
vo.setStatisticalData(re);
|
||||
unit = "k" + epdPqd.getUnit();
|
||||
} else {
|
||||
vo.setStatisticalData(Objects.isNull(temp.getValue()) ? 3.14159 : Double.parseDouble(df.format(temp.getValue())));
|
||||
unit = epdPqd.getUnit();
|
||||
}
|
||||
} else {
|
||||
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||
switch (epdPqd.getPrimaryFormula()) {
|
||||
case "*PT":
|
||||
re = temp.getValue() * pt / 1000;
|
||||
unit = "k" + epdPqd.getUnit();
|
||||
break;
|
||||
case "*CT":
|
||||
re = temp.getValue() * ct;
|
||||
unit = epdPqd.getUnit();
|
||||
break;
|
||||
case "*PT*CT":
|
||||
re = temp.getValue() * pt * ct / 1000;
|
||||
unit = "k" + epdPqd.getUnit();
|
||||
break;
|
||||
default:
|
||||
re = temp.getValue();
|
||||
unit = epdPqd.getUnit();
|
||||
break;
|
||||
}
|
||||
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||
} else {
|
||||
re = temp.getValue();
|
||||
unit = epdPqd.getUnit();
|
||||
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||
switch (epdPqd.getPrimaryFormula()) {
|
||||
case "*PT":
|
||||
re = temp.getValue() / pt;
|
||||
break;
|
||||
case "*CT":
|
||||
re = temp.getValue() / ct;
|
||||
break;
|
||||
case "*PT*CT":
|
||||
re = temp.getValue() / pt / ct;
|
||||
break;
|
||||
default:
|
||||
re = temp.getValue();
|
||||
break;
|
||||
}
|
||||
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||
} else {
|
||||
re = temp.getValue();
|
||||
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||
}
|
||||
} else {
|
||||
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||
}
|
||||
unit = epdPqd.getUnit();
|
||||
}
|
||||
} else {
|
||||
vo.setStatisticalData(null);
|
||||
if (Objects.equals("Primary", trendDataQueryParam.getDataLevel())) {
|
||||
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||
unit = epdPqd.getUnit();
|
||||
} else {
|
||||
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||
switch (epdPqd.getPrimaryFormula()) {
|
||||
case "*PT":
|
||||
unit = "k" + epdPqd.getUnit();
|
||||
break;
|
||||
case "*CT":
|
||||
unit = epdPqd.getUnit();
|
||||
break;
|
||||
case "*PT*CT":
|
||||
unit = "k" + epdPqd.getUnit();
|
||||
break;
|
||||
default:
|
||||
unit = epdPqd.getUnit();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
unit = epdPqd.getUnit();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
unit = epdPqd.getUnit();
|
||||
}
|
||||
}
|
||||
vo.setUnit(unit);
|
||||
vo.setStatisticalIndex(epdPqd.getId());
|
||||
vo.setStatisticalName(epdPqd.getName());
|
||||
vo.setAnotherName(epdPqd.getShowName());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
result.addAll(collect1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ThdDataVO> fittingData(FittingDataQueryParam fittingDataQueryParam) {
|
||||
List<ThdDataVO> result = new ArrayList<>();
|
||||
CsLinePO finalCsLinePO = csLineFeignClient.getById(fittingDataQueryParam.getLineId()).getData();
|
||||
CsDataSet csDataSet = csDataSetMapper.selectOne(new LambdaQueryWrapper<CsDataSet>().eq(CsDataSet::getId,finalCsLinePO.getDataSetId()));
|
||||
if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())){
|
||||
throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)");
|
||||
}
|
||||
Double ct = finalCsLinePO.getCtRatio();
|
||||
Double pt = finalCsLinePO.getPtRatio();
|
||||
// String position = finalCsLinePO.getPosition();
|
||||
Overlimit overlimit = overLimitWlMapper.selectById(finalCsLinePO.getLineId());
|
||||
if (Objects.isNull(overlimit)) {
|
||||
throw new BusinessException("当前测点限值信息缺失,请联系管理员排查");
|
||||
}
|
||||
JSONObject entries = JSONUtil.parseObj(overlimit, new JSONConfig().setIgnoreNullValue(false));
|
||||
if(CollectionUtil.isNotEmpty(fittingDataQueryParam.getList())) {
|
||||
for (FittingDataQueryParam param : fittingDataQueryParam.getList()) {
|
||||
String dictCode = dictTreeFeignClient.queryById(param.getStatisticalId()).getData().getCode();
|
||||
List<EleEpdPqd> eleEpdPqds = csStatisticalSetFeignClient.queryStatisticalSelect(param.getStatisticalId()).getData();
|
||||
List<ThdDataVO> dataList = new ArrayList<>();
|
||||
for (EleEpdPqd epdPqd : eleEpdPqds) {
|
||||
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
||||
commonQueryParam.setLineId(finalCsLinePO.getLineId());
|
||||
commonQueryParam.setTableName(influxDbParamUtil.getTableNameByClassId(epdPqd.getClassId()));
|
||||
commonQueryParam.setColumnName(epdPqd.getName() + (StringUtils.isEmpty(param.getFrequency()) ? "" : "_" + param.getFrequency()));
|
||||
commonQueryParam.setPhasic(epdPqd.getPhase());
|
||||
|
||||
commonQueryParam.setStartTime(DateUtil.format(DateUtil.parse(fittingDataQueryParam.getSearchBeginTime(), DatePattern.NORM_DATE_PATTERN), DatePattern.NORM_DATETIME_PATTERN));
|
||||
commonQueryParam.setEndTime(DateUtil.format(DateUtil.endOfDay(DateUtil.parse(fittingDataQueryParam.getSearchEndTime(), DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATETIME_PATTERN));
|
||||
// 兼容用户功率需要该参数过滤
|
||||
String dataType = param.getValueType();
|
||||
if (StrUtil.isEmpty(dataType)) {
|
||||
// 电能质量指标,取限值计算类型,判断是否越限
|
||||
dataType = epdPqd.getFormula();
|
||||
}
|
||||
commonQueryParam.setDataType(dataType);
|
||||
|
||||
commonQueryParam.setClDid(influxDbParamUtil.getClDidByLineId(finalCsLinePO.getLineId()));
|
||||
|
||||
List<StatisticalDataDTO> deviceRtData = commonService.getNewDeviceRtDataByTime(Collections.singletonList(commonQueryParam));
|
||||
dataList = deviceRtData.stream().map(temp -> {
|
||||
String unit;
|
||||
ThdDataVO vo = new ThdDataVO();
|
||||
vo.setLineId(temp.getLineId());
|
||||
// vo.setLineName(finalCsLinePO.getName());
|
||||
vo.setPhase(Objects.equals("M", temp.getPhaseType()) ? null : temp.getPhaseType());
|
||||
// vo.setPosition(position);
|
||||
vo.setTime(temp.getTime());
|
||||
vo.setStatMethod(commonQueryParam.getDataType());
|
||||
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||
if (temp.getValue() != null) {
|
||||
double re;
|
||||
if (Objects.equals("Primary", fittingDataQueryParam.getDataLevel())) {
|
||||
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||
if (HarmonicConstant.POWER_LIST.contains(epdPqd.getShowName())) {
|
||||
re = Objects.isNull(temp.getValue()) ? 3.14159 : Double.parseDouble(df.format(temp.getValue() / 1000));
|
||||
vo.setStatisticalData(re);
|
||||
unit = "k" + epdPqd.getUnit();
|
||||
} else {
|
||||
vo.setStatisticalData(Objects.isNull(temp.getValue()) ? 3.14159 : Double.parseDouble(df.format(temp.getValue())));
|
||||
unit = epdPqd.getUnit();
|
||||
}
|
||||
} else {
|
||||
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||
switch (epdPqd.getPrimaryFormula()) {
|
||||
case "*PT":
|
||||
re = temp.getValue() * pt / 1000;
|
||||
unit = "k" + epdPqd.getUnit();
|
||||
break;
|
||||
case "*CT":
|
||||
re = temp.getValue() * ct;
|
||||
unit = epdPqd.getUnit();
|
||||
break;
|
||||
case "*PT*CT":
|
||||
re = temp.getValue() * pt * ct / 1000;
|
||||
unit = "k" + epdPqd.getUnit();
|
||||
break;
|
||||
default:
|
||||
re = temp.getValue();
|
||||
unit = epdPqd.getUnit();
|
||||
break;
|
||||
}
|
||||
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||
} else {
|
||||
re = temp.getValue();
|
||||
unit = epdPqd.getUnit();
|
||||
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||
switch (epdPqd.getPrimaryFormula()) {
|
||||
case "*PT":
|
||||
re = temp.getValue() / pt;
|
||||
break;
|
||||
case "*CT":
|
||||
re = temp.getValue() / ct;
|
||||
break;
|
||||
case "*PT*CT":
|
||||
re = temp.getValue() / pt / ct;
|
||||
break;
|
||||
default:
|
||||
re = temp.getValue();
|
||||
break;
|
||||
}
|
||||
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||
} else {
|
||||
re = temp.getValue();
|
||||
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||
}
|
||||
} else {
|
||||
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||
}
|
||||
unit = epdPqd.getUnit();
|
||||
}
|
||||
} else {
|
||||
vo.setStatisticalData(null);
|
||||
if (Objects.equals("Primary", fittingDataQueryParam.getDataLevel())) {
|
||||
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||
unit = epdPqd.getUnit();
|
||||
} else {
|
||||
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||
switch (epdPqd.getPrimaryFormula()) {
|
||||
case "*PT":
|
||||
unit = "k" + epdPqd.getUnit();
|
||||
break;
|
||||
case "*CT":
|
||||
unit = epdPqd.getUnit();
|
||||
break;
|
||||
case "*PT*CT":
|
||||
unit = "k" + epdPqd.getUnit();
|
||||
break;
|
||||
default:
|
||||
unit = epdPqd.getUnit();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
unit = epdPqd.getUnit();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
unit = epdPqd.getUnit();
|
||||
}
|
||||
}
|
||||
vo.setUnit(unit);
|
||||
// vo.setStatisticalIndex(epdPqd.getId());
|
||||
// vo.setStatisticalName(epdPqd.getName());
|
||||
vo.setStatisticalIndex(param.getStatisticalId());
|
||||
vo.setAnotherName(epdPqd.getShowName());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
// 电能质量指标(越限为1,不越限为0)
|
||||
List<String> hasKeys = entries.keySet().stream().filter(key -> key.startsWith(dictCode)).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(hasKeys)) {
|
||||
List<ThdDataVO> limitDataList = new ArrayList<>();
|
||||
Map<Instant, List<ThdDataVO>> timeMap = dataList.stream().collect(Collectors.groupingBy(ThdDataVO::getTime));
|
||||
// 限值
|
||||
ThdDataVO data;
|
||||
for (Map.Entry<Instant, List<ThdDataVO>> entry: timeMap.entrySet()) {
|
||||
data = new ThdDataVO();
|
||||
List<ThdDataVO> list = entry.getValue();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
ThdDataVO thdDataVO = list.get(0);
|
||||
// data.setPosition(thdDataVO.getPosition());
|
||||
data.setLineId(thdDataVO.getLineId());
|
||||
// data.setLineName(thdDataVO.getLineName());
|
||||
data.setFrequency(param.getFrequency());
|
||||
data.setStatMethod(thdDataVO.getStatMethod());
|
||||
data.setUnit(thdDataVO.getUnit());
|
||||
data.setAnotherName(thdDataVO.getAnotherName());
|
||||
data.setStatisticalIndex(param.getStatisticalId());
|
||||
}
|
||||
Instant time = entry.getKey();
|
||||
data.setTime(time);
|
||||
|
||||
double limitValue = entries.getDouble(dictCode + (StringUtils.isEmpty(param.getFrequency()) ? "" : param.getFrequency()));
|
||||
double maxValue = list.stream().filter(v -> ObjectUtil.isNotEmpty(v.getStatisticalData())).mapToDouble(ThdDataVO::getStatisticalData).max().orElse(0.0);
|
||||
// 越限为1,不越限为0
|
||||
data.setStatisticalData(maxValue > limitValue ? 1.0 : 0.0);
|
||||
limitDataList.add(data);
|
||||
}
|
||||
limitDataList.sort(Comparator.comparing(ThdDataVO::getTime));
|
||||
result.addAll(limitDataList);
|
||||
} else {
|
||||
result.addAll(dataList);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<ThdDataVO>> sensitiveUserTrendData(SensitiveUserTrendDataQueryParam param) {
|
||||
Map<String, List<ThdDataVO>> result = new HashMap<>();
|
||||
if (Objects.isNull(param.getSensitiveUserId())) {
|
||||
return result;
|
||||
}
|
||||
result.put("before", new ArrayList<>());
|
||||
result.put("after", new ArrayList<>());
|
||||
String sensitiveUserId = param.getSensitiveUserId();
|
||||
List<CsLinePO> linePOList = csLineFeignClient.getLineBySensitiveUser(Collections.singletonList(sensitiveUserId)).getData();
|
||||
if (CollUtil.isEmpty(linePOList)) {
|
||||
return result;
|
||||
}
|
||||
DictData loadSideDictData = dicDataFeignClient.getDicDataByCode(LOAD_SIDE_DICT_CODE).getData();
|
||||
DictData gridSideDictData = dicDataFeignClient.getDicDataByCode(GRID_SIDE_DICT_CODE).getData();
|
||||
CsLinePO gridSideLine = linePOList.stream().filter(linePO -> linePO.getPosition().equals(gridSideDictData.getId())).findFirst().orElse(null);
|
||||
CsLinePO loadSideLine = linePOList.stream().filter(linePO -> linePO.getPosition().equals(loadSideDictData.getId())).findFirst().orElse(null);
|
||||
TrendDataQueryParam trendDataQueryParam = new TrendDataQueryParam();
|
||||
trendDataQueryParam.setSearchBeginTime(param.getSearchBeginTime());
|
||||
trendDataQueryParam.setSearchEndTime(param.getSearchEndTime());
|
||||
trendDataQueryParam.setValueType(param.getValueType());
|
||||
trendDataQueryParam.setDataLevel(param.getDataLevel());
|
||||
List<SensitiveUserTrendDataQueryParam> paramList = param.getList();
|
||||
List<TrendDataQueryParam> indexList = paramList.stream().map(item -> {
|
||||
TrendDataQueryParam queryParam = new TrendDataQueryParam();
|
||||
if (ObjectUtil.isNotNull(param.getHarmonicCount())) {
|
||||
queryParam.setFrequency(String.valueOf(param.getHarmonicCount()));
|
||||
}
|
||||
queryParam.setStatisticalId(item.getStatisticalId());
|
||||
return queryParam;
|
||||
}).collect(Collectors.toList());
|
||||
trendDataQueryParam.setList(indexList);
|
||||
if (loadSideLine != null) {
|
||||
trendDataQueryParam.setLineId(loadSideLine.getLineId());
|
||||
List<ThdDataVO> thdDataList = this.trendData(trendDataQueryParam);
|
||||
result.put("before", thdDataList);
|
||||
}
|
||||
if (gridSideLine != null) {
|
||||
trendDataQueryParam.setLineId(gridSideLine.getLineId());
|
||||
List<ThdDataVO> thdDataList = this.trendData(trendDataQueryParam);
|
||||
result.put("after", thdDataList);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<EnergyTemplateVO> getChildren(String tabId, List<EnergyTemplateVO> all) {
|
||||
return all.stream().filter(item -> item.getPid().equals(tabId)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -4,26 +4,34 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.csdevice.constant.DataParam;
|
||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||
import com.njcn.csdevice.mapper.*;
|
||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
||||
import com.njcn.csdevice.pojo.param.CsLedgerParam;
|
||||
import com.njcn.csdevice.pojo.po.*;
|
||||
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
||||
import com.njcn.csdevice.service.*;
|
||||
import com.njcn.csharmonic.api.PqSensitiveUserFeignClient;
|
||||
import com.njcn.csharmonic.pojo.po.PqSensitiveUser;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.api.AreaFeignClient;
|
||||
import com.njcn.system.api.DictTreeFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.pojo.po.Area;
|
||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.enums.AppRoleEnum;
|
||||
import com.njcn.user.pojo.constant.UserType;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -54,8 +62,11 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
private final CsDevModelRelationService csDevModelRelationService;
|
||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||
private final ICsDataSetService csDataSetService;
|
||||
private final EquipmentFeignClient equipmentFeignClient;
|
||||
private final DictTreeFeignClient dictTreeFeignClient;
|
||||
private final CsDeviceUserPOMapper csDeviceUserPOMapper;
|
||||
private final PqSensitiveUserFeignClient pqSensitiveUserFeignClient;
|
||||
private final UserFeignClient userFeignClient;
|
||||
|
||||
|
||||
@Override
|
||||
public List<CsLedgerVO> getLedgerTree() {
|
||||
@@ -82,14 +93,14 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
//区分治理装置和云前置装置
|
||||
List<String> zhiLianDevice = new ArrayList<>();
|
||||
List<String> cldDevice = new ArrayList<>();
|
||||
List<CsEquipmentDeliveryDTO> csEquipmentDeliveryPOS = equipmentFeignClient.queryDeviceById(device).getData();
|
||||
if (CollectionUtil.isNotEmpty(csEquipmentDeliveryPOS)) {
|
||||
if (CollectionUtil.isNotEmpty(device)) {
|
||||
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryMapper.selectBatchIds(device);
|
||||
DictTreeVO vo1 = dictTreeFeignClient.queryByCode(DicDataEnum.DEV_CLD.getCode()).getData();
|
||||
Optional.ofNullable(vo1)
|
||||
.map(DictTreeVO::getId)
|
||||
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
||||
.filter(item -> Objects.equals(item.getDevType(), id))
|
||||
.map(CsEquipmentDeliveryDTO::getId)
|
||||
.map(CsEquipmentDeliveryPO::getId)
|
||||
.forEach(cldDevice::add)
|
||||
);
|
||||
DictTreeVO vo2 = dictTreeFeignClient.queryByCode(DicDataEnum.CONNECT_DEV.getCode()).getData();
|
||||
@@ -97,12 +108,11 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
.map(DictTreeVO::getId)
|
||||
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
||||
.filter(item -> Objects.equals(item.getDevType(), id))
|
||||
.map(CsEquipmentDeliveryDTO::getId)
|
||||
.map(CsEquipmentDeliveryPO::getId)
|
||||
.forEach(zhiLianDevice::add)
|
||||
);
|
||||
}
|
||||
|
||||
engineeringList = allList.stream().filter(item->roleengineer.contains(item.getId())).collect(Collectors.toList());
|
||||
engineeringList = allList.stream().filter(item -> roleengineer.contains(item.getId())).collect(Collectors.toList());
|
||||
List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
|
||||
Map<String, CsEquipmentDeliveryPO> poMap = allList.stream()
|
||||
@@ -146,14 +156,14 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
.peek(
|
||||
item -> {
|
||||
item.setType("line");
|
||||
String index = item.getId().substring(item.getId().length()-1);
|
||||
if (Objects.equals(index,"0")) {
|
||||
String index = item.getId().substring(item.getId().length() - 1);
|
||||
if (Objects.equals(index, "0")) {
|
||||
item.setLineType(0);
|
||||
} else {
|
||||
item.setLineType(1);
|
||||
}
|
||||
LambdaQueryWrapper<CsLinePO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CsLinePO::getLineId,item.getId()).eq(CsLinePO::getStatus,1);
|
||||
queryWrapper.eq(CsLinePO::getLineId, item.getId()).eq(CsLinePO::getStatus, 1);
|
||||
CsLinePO po = csLinePOService.getOne(queryWrapper);
|
||||
item.setConType(po.getConType());
|
||||
}
|
||||
@@ -194,10 +204,29 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
portable.setName(DataParam.portableDev);
|
||||
portable.setPid("0");
|
||||
portable.setId(IdUtil.simpleUUID());
|
||||
//针对未启用的装置判断
|
||||
List<CsLedgerVO> ledger = allList.stream()
|
||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//根据当前用户获取便携式设备
|
||||
List<CsLedgerVO> ledger;
|
||||
String role = RequestUtil.getUserRole();
|
||||
List<String> roles = JSONArray.parseArray(role, String.class);
|
||||
if(roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.getCode()) || roles.contains(AppRoleEnum.REGULAR_USER.getCode())){
|
||||
ledger = allList.stream()
|
||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
LambdaQueryWrapper<CsDeviceUserPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CsDeviceUserPO::getPrimaryUserId, RequestUtil.getUserIndex());
|
||||
List<CsDeviceUserPO> list1 = csDeviceUserPOMapper.selectList(queryWrapper);
|
||||
List<String> result = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(list1)) {
|
||||
result = list1.stream().map(CsDeviceUserPO::getDeviceId).collect(Collectors.toList());
|
||||
}
|
||||
//针对未启用的装置判断
|
||||
List<String> finalResult = result;
|
||||
ledger = allList.stream()
|
||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0") && finalResult.contains(item.getId()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
Map<String, CsEquipmentDeliveryPO> poMap2 = ledger.stream()
|
||||
.collect(Collectors.toMap(
|
||||
CsLedgerVO::getId,
|
||||
@@ -248,6 +277,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
//剔除未接入的设备(根据status判断不太稳,所有这里直接判断该设备有没有对应的模板指标)
|
||||
private void checkDevSetData(List<CsLedgerVO> ledgerVOS) {
|
||||
Iterator<CsLedgerVO> iterator = ledgerVOS.iterator();
|
||||
@@ -287,14 +317,14 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
|
||||
List<String> zhiLianDevice = new ArrayList<>();
|
||||
List<String> cldDevice = new ArrayList<>();
|
||||
List<CsEquipmentDeliveryDTO> csEquipmentDeliveryPOS = equipmentFeignClient.queryDeviceById(device).getData();
|
||||
if (CollectionUtil.isNotEmpty(csEquipmentDeliveryPOS)) {
|
||||
if (CollectionUtil.isNotEmpty(device)) {
|
||||
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryMapper.selectBatchIds(device);
|
||||
DictTreeVO vo1 = dictTreeFeignClient.queryByCode(DicDataEnum.DEV_CLD.getCode()).getData();
|
||||
Optional.ofNullable(vo1)
|
||||
.map(DictTreeVO::getId)
|
||||
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
||||
.filter(item -> Objects.equals(item.getDevType(), id))
|
||||
.map(CsEquipmentDeliveryDTO::getId)
|
||||
.map(CsEquipmentDeliveryPO::getId)
|
||||
.forEach(cldDevice::add)
|
||||
);
|
||||
DictTreeVO vo2 = dictTreeFeignClient.queryByCode(DicDataEnum.CONNECT_DEV.getCode()).getData();
|
||||
@@ -302,11 +332,12 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
.map(DictTreeVO::getId)
|
||||
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
||||
.filter(item -> Objects.equals(item.getDevType(), id))
|
||||
.map(CsEquipmentDeliveryDTO::getId)
|
||||
.map(CsEquipmentDeliveryPO::getId)
|
||||
.forEach(zhiLianDevice::add)
|
||||
);
|
||||
}
|
||||
engineeringList = allList.stream().filter(item->roleengineer.contains(item.getId())).collect(Collectors.toList());
|
||||
|
||||
engineeringList = allList.stream().filter(item -> roleengineer.contains(item.getId())).collect(Collectors.toList());
|
||||
List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
|
||||
Map<String, CsEquipmentDeliveryPO> poMap = allList.stream()
|
||||
@@ -379,10 +410,28 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
portable.setPid("0");
|
||||
portable.setId(IdUtil.simpleUUID());
|
||||
|
||||
//针对未启用的装置判断
|
||||
List<CsLedgerVO> ledger = allList.stream()
|
||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
||||
.collect(Collectors.toList());
|
||||
List<CsLedgerVO> ledger;
|
||||
String role = RequestUtil.getUserRole();
|
||||
List<String> roles = JSONArray.parseArray(role, String.class);
|
||||
if(roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.getCode()) || roles.contains(AppRoleEnum.REGULAR_USER.getCode())){
|
||||
ledger = allList.stream()
|
||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
LambdaQueryWrapper<CsDeviceUserPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CsDeviceUserPO::getPrimaryUserId, RequestUtil.getUserIndex());
|
||||
List<CsDeviceUserPO> list1 = csDeviceUserPOMapper.selectList(queryWrapper);
|
||||
List<String> result = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(list1)) {
|
||||
result = list1.stream().map(CsDeviceUserPO::getDeviceId).collect(Collectors.toList());
|
||||
}
|
||||
//针对未启用的装置判断
|
||||
List<String> finalResult = result;
|
||||
ledger = allList.stream()
|
||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0") && finalResult.contains(item.getId()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
Map<String, CsEquipmentDeliveryPO> poMap2 = ledger.stream()
|
||||
.collect(Collectors.toMap(
|
||||
CsLedgerVO::getId,
|
||||
@@ -435,11 +484,11 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
|
||||
@Override
|
||||
public CsLedger addLedgerTree(CsLedgerParam csLedgerParam) {
|
||||
CsLedger fatherCsLedger = this.lambdaQuery().eq(CsLedger::getId,csLedgerParam.getPid()).one();
|
||||
CsLedger fatherCsLedger = this.lambdaQuery().eq(CsLedger::getId, csLedgerParam.getPid()).one();
|
||||
CsLedger csLedger = new CsLedger();
|
||||
BeanUtils.copyProperties(csLedgerParam,csLedger);
|
||||
BeanUtils.copyProperties(csLedgerParam, csLedger);
|
||||
csLedger.setState(1);
|
||||
if (Objects.equals(csLedgerParam.getPid(),"9999999")){
|
||||
if (Objects.equals(csLedgerParam.getPid(), "9999999")) {
|
||||
csLedger.setPid("0");
|
||||
csLedger.setPids("0");
|
||||
} else {
|
||||
@@ -451,7 +500,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
|
||||
@Override
|
||||
public void deleteLedgerTree(String id) {
|
||||
CsLedger csLedger = this.lambdaQuery().eq(CsLedger::getId,id).one();
|
||||
CsLedger csLedger = this.lambdaQuery().eq(CsLedger::getId, id).one();
|
||||
csLedger.setState(0);
|
||||
this.updateById(csLedger);
|
||||
}
|
||||
@@ -466,8 +515,8 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
@Override
|
||||
public String findDevByLineId(String lineId) {
|
||||
String deviceId = null;
|
||||
CsLedger csLedger = this.lambdaQuery().eq(CsLedger::getId,lineId).eq(CsLedger::getState,1).one();
|
||||
if (!Objects.isNull(csLedger)){
|
||||
CsLedger csLedger = this.lambdaQuery().eq(CsLedger::getId, lineId).eq(CsLedger::getState, 1).one();
|
||||
if (!Objects.isNull(csLedger)) {
|
||||
deviceId = csLedger.getPid();
|
||||
}
|
||||
return deviceId;
|
||||
@@ -475,7 +524,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
|
||||
@Override
|
||||
public CsLedger findDataById(String id) {
|
||||
return this.lambdaQuery().eq(CsLedger::getId,id).eq(CsLedger::getState,1).one();
|
||||
return this.lambdaQuery().eq(CsLedger::getId, id).eq(CsLedger::getState, 1).one();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -483,12 +532,12 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
List<CsLedgerVO> engineeringList = new ArrayList<>();
|
||||
List<CsLedgerVO> allList = this.baseMapper.getAll();
|
||||
List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
||||
engineeringList = allList.stream().filter(item->roleengineer.contains(item.getId())).collect(Collectors.toList());
|
||||
engineeringList = allList.stream().filter(item -> roleengineer.contains(item.getId())).collect(Collectors.toList());
|
||||
List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
QueryWrapper<AppTopologyDiagramPO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("status","1");
|
||||
queryWrapper.eq("status", "1");
|
||||
List<AppTopologyDiagramPO> appTopologyDiagramPOS = appTopologyDiagramMapper.selectList(queryWrapper);
|
||||
projectList.forEach(temp->{
|
||||
projectList.forEach(temp -> {
|
||||
AppProjectPO appProjectPO = appProjectMapper.selectById(temp.getId());
|
||||
temp.setArea(appProjectPO.getArea());
|
||||
temp.setRemark(appProjectPO.getDescription());
|
||||
@@ -504,13 +553,13 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
temp.setChildren(collect);
|
||||
});
|
||||
engineeringList.forEach(eng -> {
|
||||
CsEngineeringPO csEngineeringPO = csEngineeringMapper.selectById(eng.getId());
|
||||
eng.setArea(this.getAreaById(csEngineeringPO.getProvince())+this.getAreaById(csEngineeringPO.getCity()));
|
||||
eng.setProvinceId(csEngineeringPO.getProvince());
|
||||
eng.setCityId(csEngineeringPO.getCity());
|
||||
eng.setRemark(csEngineeringPO.getDescription());
|
||||
eng.setChildren(getChildren(eng, projectList));
|
||||
}
|
||||
CsEngineeringPO csEngineeringPO = csEngineeringMapper.selectById(eng.getId());
|
||||
eng.setArea(this.getAreaById(csEngineeringPO.getProvince()) + this.getAreaById(csEngineeringPO.getCity()));
|
||||
eng.setProvinceId(csEngineeringPO.getProvince());
|
||||
eng.setCityId(csEngineeringPO.getCity());
|
||||
eng.setRemark(csEngineeringPO.getDescription());
|
||||
eng.setChildren(getChildren(eng, projectList));
|
||||
}
|
||||
);
|
||||
|
||||
return engineeringList;
|
||||
@@ -526,14 +575,14 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
DevDetailDTO device = new DevDetailDTO();
|
||||
CsLedger dev = this.findDataById(devId);
|
||||
//如果是便携式设备,pid为0,项目,工程都设置为/
|
||||
if(Objects.equals(dev.getPid(),"0")){
|
||||
if (Objects.equals(dev.getPid(), "0")) {
|
||||
device.setEquipmentName(dev.getName());
|
||||
device.setEquipmentId(devId);
|
||||
device.setProjectId("/");
|
||||
device.setProjectName("/");
|
||||
device.setEngineeringid("/");
|
||||
device.setEngineeringName("/");
|
||||
}else {
|
||||
} else {
|
||||
device.setEquipmentName(dev.getName());
|
||||
device.setEquipmentId(devId);
|
||||
CsLedger project = this.findDataById(dev.getPid());
|
||||
@@ -547,7 +596,6 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsLedgerVO> getztProjectTree() {
|
||||
List<CsLedgerVO> engineeringList;
|
||||
@@ -555,93 +603,361 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
/*获取用户工程,设备信息过滤*/
|
||||
List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
||||
List<String> device = roleEngineerDevService.getDevice();
|
||||
engineeringList = allList.stream().filter(item->roleengineer.contains(item.getId())).collect(Collectors.toList());
|
||||
|
||||
List<String> zhiLianDevice = new ArrayList<>();
|
||||
List<String> cldDevice = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(device)) {
|
||||
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryMapper.selectBatchIds(device);
|
||||
DictTreeVO vo1 = dictTreeFeignClient.queryByCode(DicDataEnum.DEV_CLD.getCode()).getData();
|
||||
Optional.ofNullable(vo1)
|
||||
.map(DictTreeVO::getId)
|
||||
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
||||
.filter(item -> Objects.equals(item.getDevType(), id))
|
||||
.map(CsEquipmentDeliveryPO::getId)
|
||||
.forEach(cldDevice::add)
|
||||
);
|
||||
DictTreeVO vo2 = dictTreeFeignClient.queryByCode(DicDataEnum.CONNECT_DEV.getCode()).getData();
|
||||
Optional.ofNullable(vo2)
|
||||
.map(DictTreeVO::getId)
|
||||
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
||||
.filter(item -> Objects.equals(item.getDevType(), id))
|
||||
.map(CsEquipmentDeliveryPO::getId)
|
||||
.forEach(zhiLianDevice::add)
|
||||
);
|
||||
}
|
||||
|
||||
engineeringList = allList.stream().filter(item -> roleengineer.contains(item.getId())).collect(Collectors.toList());
|
||||
List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
|
||||
List<CsLedgerVO> deviceList = allList.stream().filter(item -> device.contains(item.getId()) && !Objects.equals(item.getPid(),"0")).
|
||||
peek(
|
||||
temp->{
|
||||
CsEquipmentDeliveryPO po = csEquipmentDeliveryMapper.selectById(temp.getId());
|
||||
temp.setComFlag(po.getRunStatus());
|
||||
temp.setNDId(po.getNdid());
|
||||
temp.setType("device");
|
||||
}
|
||||
).
|
||||
sorted(Comparator.comparing(CsLedgerVO::getSort))
|
||||
.collect(Collectors.toList());
|
||||
checkDevSetData(deviceList);
|
||||
projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
|
||||
engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList)));
|
||||
Map<String, CsEquipmentDeliveryPO> poMap = allList.stream()
|
||||
.filter(item -> device.contains(item.getId()) && !Objects.equals(item.getPid(), "0"))
|
||||
.map(CsLedgerVO::getId)
|
||||
.distinct()
|
||||
.collect(Collectors.toMap(
|
||||
Function.identity(),
|
||||
csEquipmentDeliveryMapper::selectById
|
||||
));
|
||||
|
||||
//获取便携式项目数
|
||||
//获取治理设备
|
||||
List<CsLedgerVO> deviceList = allList.stream()
|
||||
.filter(item -> zhiLianDevice.contains(item.getId()) && !Objects.equals(item.getPid(), "0"))
|
||||
.peek(item -> {
|
||||
CsEquipmentDeliveryPO po = poMap.get(item.getId());
|
||||
item.setComFlag(po.getRunStatus());
|
||||
item.setNDId(po.getNdid());
|
||||
item.setType("device");
|
||||
item.setProcess(po.getProcess());
|
||||
})
|
||||
.filter(item -> Objects.equals(poMap.get(item.getId()).getUsageStatus(), 1))
|
||||
.sorted(Comparator.comparing(CsLedgerVO::getSort))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<CsLedgerVO> engineeringList1 = new ArrayList<>();
|
||||
List<CsLedgerVO> projectList1 = new ArrayList<>();
|
||||
checkDevSetData(deviceList);
|
||||
List<String> dev = deviceList.stream().map(CsLedgerVO::getId).collect(Collectors.toList());
|
||||
List<CsLedgerVO> ledger1 = getProAndEngineer(dev);
|
||||
if (CollectionUtil.isNotEmpty(ledger1)) {
|
||||
engineeringList1 = ledger1.stream().filter(item -> item.getLevel().equals(LineBaseEnum.ENGINEERING_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
projectList1 = ledger1.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
projectList1.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
|
||||
List<CsLedgerVO> finalProjectList = projectList1;
|
||||
engineeringList1.forEach(eng -> eng.setChildren(getChildren(eng, finalProjectList)));
|
||||
}
|
||||
|
||||
//获取云前置设备
|
||||
List<CsLedgerVO> cldDevList = allList.stream()
|
||||
.filter(item -> cldDevice.contains(item.getId()) && !Objects.equals(item.getPid(), "0"))
|
||||
.peek(item -> {
|
||||
CsEquipmentDeliveryPO po = poMap.get(item.getId());
|
||||
item.setComFlag(po.getRunStatus());
|
||||
item.setNDId(po.getNdid());
|
||||
item.setType("device");
|
||||
item.setProcess(po.getProcess());
|
||||
})
|
||||
.filter(item -> Objects.equals(poMap.get(item.getId()).getUsageStatus(), 1))
|
||||
.sorted(Comparator.comparing(CsLedgerVO::getSort))
|
||||
.collect(Collectors.toList());
|
||||
checkDevSetData(cldDevList);
|
||||
List<CsLedgerVO> engineeringList2 = new ArrayList<>();
|
||||
List<CsLedgerVO> projectList2 = new ArrayList<>();
|
||||
|
||||
List<String> dev2 = cldDevList.stream().map(CsLedgerVO::getId).collect(Collectors.toList());
|
||||
List<CsLedgerVO> ledger2 = getProAndEngineer(dev2);
|
||||
if (CollectionUtil.isNotEmpty(ledger2)) {
|
||||
engineeringList2 = ledger2.stream().filter(item -> item.getLevel().equals(LineBaseEnum.ENGINEERING_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
projectList2 = ledger2.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
projectList2.forEach(pro -> pro.setChildren(getChildren(pro, cldDevList)));
|
||||
List<CsLedgerVO> finalProjectList = projectList2;
|
||||
engineeringList2.forEach(eng -> eng.setChildren(getChildren(eng, finalProjectList)));
|
||||
}
|
||||
|
||||
//获取便携式设备树
|
||||
CsLedgerVO portable = new CsLedgerVO();
|
||||
portable.setLevel(0);
|
||||
portable.setName(DataParam.PORTABLE_SYSTEM);
|
||||
portable.setName(DataParam.portableDev);
|
||||
portable.setPid("0");
|
||||
portable.setId(IdUtil.simpleUUID());
|
||||
|
||||
CsLedgerVO project = new CsLedgerVO();
|
||||
project.setLevel(1);
|
||||
project.setName(DataParam.WIRELESS_PROJECT);
|
||||
project.setPid("0");
|
||||
project.setId(DataParam.WIRELESS_PROJECT_ID);
|
||||
|
||||
List<CsLedgerVO> portables = allList.stream().filter(item->Objects.equals(item.getLevel(),2) && Objects.equals(item.getPid(),"0")).collect(Collectors.toList());
|
||||
checkDevSetData(portables);
|
||||
for(CsLedgerVO c : portables){
|
||||
c.setPid(project.getId());
|
||||
CsEquipmentDeliveryPO po = csEquipmentDeliveryMapper.selectById(c.getId());
|
||||
c.setComFlag(po.getRunStatus());
|
||||
c.setNDId(po.getNdid());
|
||||
c.setType("device");
|
||||
List<CsLedgerVO> ledger;
|
||||
String role = RequestUtil.getUserRole();
|
||||
List<String> roles = JSONArray.parseArray(role, String.class);
|
||||
if(roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.getCode()) || roles.contains(AppRoleEnum.REGULAR_USER.getCode())){
|
||||
ledger = allList.stream()
|
||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
LambdaQueryWrapper<CsDeviceUserPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CsDeviceUserPO::getPrimaryUserId, RequestUtil.getUserIndex());
|
||||
List<CsDeviceUserPO> list1 = csDeviceUserPOMapper.selectList(queryWrapper);
|
||||
List<String> result = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(list1)) {
|
||||
result = list1.stream().map(CsDeviceUserPO::getDeviceId).collect(Collectors.toList());
|
||||
}
|
||||
//针对未启用的装置判断
|
||||
List<String> finalResult = result;
|
||||
ledger = allList.stream()
|
||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0") && finalResult.contains(item.getId()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
project.setChildren(portables);
|
||||
|
||||
List<CsLedgerVO> wxProjectList = new ArrayList<>();
|
||||
wxProjectList.add(project);
|
||||
|
||||
portable.setChildren(wxProjectList);
|
||||
|
||||
|
||||
|
||||
Map<String, CsEquipmentDeliveryPO> poMap2 = ledger.stream()
|
||||
.collect(Collectors.toMap(
|
||||
CsLedgerVO::getId,
|
||||
csEquipmentDeliveryMapper::selectById,
|
||||
(existing, replacement) -> existing
|
||||
));
|
||||
List<CsLedgerVO> portables = ledger.stream()
|
||||
.peek(c -> {
|
||||
CsEquipmentDeliveryPO po = poMap2.get(c.getId());
|
||||
c.setPid(portable.getId());
|
||||
c.setComFlag(po.getRunStatus());
|
||||
c.setNDId(po.getNdid());
|
||||
c.setType("device");
|
||||
c.setName(po.getName());
|
||||
c.setSort(po.getSort());
|
||||
})
|
||||
.filter(c -> poMap2.get(c.getId()).getUsageStatus() == 1)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
portables = portables.stream().sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
portable.setChildren(portables);
|
||||
|
||||
CsLedgerVO government = new CsLedgerVO();
|
||||
government.setLevel(0);
|
||||
government.setName(DataParam.GOVERNANCE_SYSTEM);
|
||||
government.setName(DataParam.governmentDev);
|
||||
government.setPid("0");
|
||||
government.setId(IdUtil.simpleUUID());
|
||||
government.setChildren(engineeringList);
|
||||
List<CsLedgerVO> tree = new ArrayList<>();
|
||||
government.setChildren(engineeringList1);
|
||||
|
||||
//获取云前置设备树
|
||||
CsLedgerVO cld = new CsLedgerVO();
|
||||
cld.setLevel(0);
|
||||
cld.setName(DataParam.cldDev);
|
||||
cld.setPid("0");
|
||||
cld.setId(IdUtil.simpleUUID());
|
||||
cld.setChildren(engineeringList2);
|
||||
|
||||
List<CsLedgerVO> tree = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(portables)) {
|
||||
tree.add(portable);
|
||||
CsLedgerVO vo1 = new CsLedgerVO();
|
||||
vo1.setLevel(0);
|
||||
vo1.setName(DataParam.PORTABLE_SYSTEM);
|
||||
vo1.setPid("0");
|
||||
vo1.setId(IdUtil.simpleUUID());
|
||||
|
||||
CsLedgerVO vo2 = new CsLedgerVO();
|
||||
vo2.setLevel(1);
|
||||
vo2.setName(DataParam.WIRELESS_PROJECT);
|
||||
vo2.setPid("0");
|
||||
vo2.setId(DataParam.WIRELESS_PROJECT_ID);
|
||||
vo2.setChildren(portables);
|
||||
vo1.setChildren(Collections.singletonList(vo2));
|
||||
tree.add(vo1);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(deviceList)) {
|
||||
tree.add(government);
|
||||
}
|
||||
|
||||
}
|
||||
if (CollUtil.isNotEmpty(cldDevList)) {
|
||||
tree.add(cld);
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<CsLedgerVO> getztProjectTree() {
|
||||
// List<CsLedgerVO> engineeringList;
|
||||
// List<CsLedgerVO> allList = this.baseMapper.getAll();
|
||||
// /*获取用户工程,设备信息过滤*/
|
||||
// List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
||||
// List<String> device = roleEngineerDevService.getDevice();
|
||||
// engineeringList = allList.stream().filter(item -> roleengineer.contains(item.getId())).collect(Collectors.toList());
|
||||
// List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
//
|
||||
// List<CsLedgerVO> deviceList = allList.stream().filter(item -> device.contains(item.getId()) && !Objects.equals(item.getPid(), "0")).
|
||||
// peek(
|
||||
// temp -> {
|
||||
// CsEquipmentDeliveryPO po = csEquipmentDeliveryMapper.selectById(temp.getId());
|
||||
// temp.setComFlag(po.getRunStatus());
|
||||
// temp.setNDId(po.getNdid());
|
||||
// temp.setType("device");
|
||||
// }
|
||||
// ).
|
||||
// sorted(Comparator.comparing(CsLedgerVO::getSort))
|
||||
// .collect(Collectors.toList());
|
||||
// checkDevSetData(deviceList);
|
||||
// projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
|
||||
// engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList)));
|
||||
//
|
||||
// //获取便携式项目数
|
||||
// CsLedgerVO portable = new CsLedgerVO();
|
||||
// portable.setLevel(0);
|
||||
// portable.setName(DataParam.PORTABLE_SYSTEM);
|
||||
// portable.setPid("0");
|
||||
// portable.setId(IdUtil.simpleUUID());
|
||||
//
|
||||
// CsLedgerVO project = new CsLedgerVO();
|
||||
// project.setLevel(1);
|
||||
// project.setName(DataParam.WIRELESS_PROJECT);
|
||||
// project.setPid("0");
|
||||
// project.setId(DataParam.WIRELESS_PROJECT_ID);
|
||||
//
|
||||
// List<CsLedgerVO> portables = allList.stream().filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0")).collect(Collectors.toList());
|
||||
// checkDevSetData(portables);
|
||||
// for (CsLedgerVO c : portables) {
|
||||
// c.setPid(project.getId());
|
||||
// CsEquipmentDeliveryPO po = csEquipmentDeliveryMapper.selectById(c.getId());
|
||||
// c.setComFlag(po.getRunStatus());
|
||||
// c.setNDId(po.getNdid());
|
||||
// c.setType("device");
|
||||
// }
|
||||
// project.setChildren(portables);
|
||||
//
|
||||
// List<CsLedgerVO> wxProjectList = new ArrayList<>();
|
||||
// wxProjectList.add(project);
|
||||
//
|
||||
// portable.setChildren(wxProjectList);
|
||||
//
|
||||
//
|
||||
// CsLedgerVO government = new CsLedgerVO();
|
||||
// government.setLevel(0);
|
||||
// government.setName(DataParam.GOVERNANCE_SYSTEM);
|
||||
// government.setPid("0");
|
||||
// government.setId(IdUtil.simpleUUID());
|
||||
// government.setChildren(engineeringList);
|
||||
// List<CsLedgerVO> tree = new ArrayList<>();
|
||||
//
|
||||
// if (CollUtil.isNotEmpty(portables)) {
|
||||
// tree.add(portable);
|
||||
// }
|
||||
// if (CollUtil.isNotEmpty(deviceList)) {
|
||||
// tree.add(government);
|
||||
// }
|
||||
//
|
||||
// return tree;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<CsLedgerVO> objTree() {
|
||||
List<CsLedgerVO> result = new ArrayList<>();
|
||||
String userId = RequestUtil.getUserIndex();
|
||||
UserVO userVO = userFeignClient.getUserById(userId).getData();
|
||||
List<String> devIds;
|
||||
if (userVO.getType().equals(UserType.SUPER_ADMINISTRATOR) || userVO.getType().equals(UserType.ADMINISTRATOR)) {
|
||||
devIds = csEquipmentDeliveryMapper.selectList(null).stream().map(CsEquipmentDeliveryPO::getId).collect(Collectors.toList());
|
||||
} else {
|
||||
LambdaQueryWrapper<CsDeviceUserPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.select(CsDeviceUserPO::getDeviceId)
|
||||
.and(w -> w.eq(CsDeviceUserPO::getPrimaryUserId, userId).or().eq(CsDeviceUserPO::getSubUserId, userId))
|
||||
.eq(CsDeviceUserPO::getStatus, DataStateEnum.ENABLE.getCode());
|
||||
List<CsDeviceUserPO> devList = csDeviceUserPOMapper.selectList(lambdaQueryWrapper);
|
||||
devIds = devList.stream().map(CsDeviceUserPO::getDeviceId).distinct().collect(Collectors.toList());
|
||||
}
|
||||
if (CollUtil.isEmpty(devIds)) {
|
||||
return result;
|
||||
}
|
||||
List<CsLinePO> poList = csLinePOService.lambdaQuery().in(CsLinePO::getDeviceId, devIds)
|
||||
.eq(CsLinePO::getStatus, DataStateEnum.ENABLE.getCode()).ne(CsLinePO::getMonitorUser,"").isNotNull(CsLinePO::getMonitorUser).list();
|
||||
if (CollUtil.isEmpty(poList)) {
|
||||
return result;
|
||||
}
|
||||
List<String> objIds = poList.stream().map(CsLinePO::getMonitorUser).distinct().collect(Collectors.toList());
|
||||
List<String> lineIds = poList.stream().map(CsLinePO::getLineId).distinct().collect(Collectors.toList());
|
||||
|
||||
List<PqSensitiveUser> pqSensitiveUserList = pqSensitiveUserFeignClient.getListByIds(objIds).getData();
|
||||
if (CollUtil.isEmpty(pqSensitiveUserList)) {
|
||||
return result;
|
||||
}
|
||||
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));
|
||||
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()+1]).distinct().collect(Collectors.toList());
|
||||
List<CsLedger> projectList = this.baseMapper.selectList(new LambdaQueryWrapper<CsLedger>().in(CsLedger::getId, projectIds));
|
||||
|
||||
List<CsLedgerVO> realProjectList = new ArrayList<>();
|
||||
projectList.forEach(pro->{
|
||||
CsLedgerVO csLedgerVO = new CsLedgerVO();
|
||||
csLedgerVO.setId(pro.getId());
|
||||
csLedgerVO.setPid(pro.getPid());
|
||||
csLedgerVO.setLevel(pro.getLevel());
|
||||
csLedgerVO.setName(pro.getName());
|
||||
|
||||
List<CsLedgerVO> temObjList = new ArrayList<>();
|
||||
if(lineMap.containsKey(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());
|
||||
if(CollUtil.isNotEmpty(objTemIds)){
|
||||
objTemIds.forEach(it->{
|
||||
CsLedgerVO inner = new CsLedgerVO();
|
||||
inner.setName(objMap.getOrDefault(it,"未知异常用户"));
|
||||
inner.setId(it);
|
||||
inner.setLevel(2);
|
||||
temObjList.add(inner);
|
||||
});
|
||||
}
|
||||
}
|
||||
csLedgerVO.setChildren(temObjList);
|
||||
realProjectList.add(csLedgerVO);
|
||||
});
|
||||
|
||||
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<CsLedgerVO> realGcList = new ArrayList<>();
|
||||
gcList.forEach(gc->{
|
||||
CsLedgerVO csLedgerVO = new CsLedgerVO();
|
||||
csLedgerVO.setId(gc.getId());
|
||||
csLedgerVO.setPid(gc.getPid());
|
||||
csLedgerVO.setLevel(gc.getLevel());
|
||||
csLedgerVO.setName(gc.getName());
|
||||
|
||||
List<CsLedgerVO> proList = realProjectList.stream().filter(it->gc.getId().equals(it.getPid())).collect(Collectors.toList());
|
||||
csLedgerVO.setChildren(proList);
|
||||
realGcList.add(csLedgerVO);
|
||||
});
|
||||
return realGcList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsLedgerVO> getProAndEngineer(List<String> id) {
|
||||
List<CsLedgerVO> result = new ArrayList<>();
|
||||
List<CsLedgerVO> allList = this.baseMapper.getAll();
|
||||
Set<String> idSet = new HashSet<>(id);
|
||||
if (CollectionUtil.isNotEmpty(id)) {
|
||||
id.forEach(item->{
|
||||
allList.forEach(item2->{
|
||||
if (Objects.equals(item2.getId(),item)) {
|
||||
idSet.addAll(Arrays.asList(item2.getPids().split( ",")));
|
||||
id.forEach(item -> {
|
||||
allList.forEach(item2 -> {
|
||||
if (Objects.equals(item2.getId(), item)) {
|
||||
idSet.addAll(Arrays.asList(item2.getPids().split(",")));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(idSet)) {
|
||||
idSet.forEach(item->{
|
||||
allList.forEach(item2->{
|
||||
if (Objects.equals(item2.getId(),item)) {
|
||||
idSet.forEach(item -> {
|
||||
allList.forEach(item2 -> {
|
||||
if (Objects.equals(item2.getId(), item)) {
|
||||
result.add(item2);
|
||||
}
|
||||
});
|
||||
@@ -674,10 +990,11 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
Set<String> list1 = new HashSet<>();
|
||||
List<String> devList = tree3.stream().map(CsLedgerVO::getId).collect(Collectors.toList());
|
||||
List<CsEquipmentDeliveryPO> devs = csEquipmentDeliveryMapper.selectBatchIds(devList);
|
||||
Map<String, CsEquipmentDeliveryPO> devsMap = devs.stream().collect(Collectors.toMap(CsEquipmentDeliveryPO::getId, Function.identity()));
|
||||
DictTreeVO vo1 = dictTreeFeignClient.queryByCode(DicDataEnum.DEV_CLD.getCode()).getData();
|
||||
|
||||
//list1是 cld设备
|
||||
devs.forEach(item->{
|
||||
devs.forEach(item -> {
|
||||
if (item.getDevType().equals(vo1.getId())) {
|
||||
list1.add(item.getId());
|
||||
}
|
||||
@@ -688,33 +1005,49 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
Set<String> list3 = tree5.stream().map(CsLedgerVO::getPid).collect(Collectors.toSet());
|
||||
projectTree = tree2.stream().filter(vo -> !list3.contains(vo.getId())).collect(Collectors.toList());
|
||||
|
||||
|
||||
List<CsLedgerVO> tree6 = tree2.stream().filter(vo -> list3.contains(vo.getId())).collect(Collectors.toList());
|
||||
Set<String> proList = tree6.stream().map(CsLedgerVO::getPid).collect(Collectors.toSet());
|
||||
engineerTree = tree1.stream().filter(vo -> !proList.contains(vo.getId())).collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtil.isNotEmpty(list1)) {
|
||||
deviceTree = tree3.stream().filter(vo -> list1.contains(vo.getId())).collect(Collectors.toList());
|
||||
lineTree = tree4.stream().filter(vo -> list1.contains(vo.getPid())).collect(Collectors.toList());
|
||||
deviceTree = tree3.stream()
|
||||
.filter(vo -> list1.contains(vo.getId()))
|
||||
.peek(item -> {
|
||||
CsEquipmentDeliveryPO dev = devsMap.get(item.getId());
|
||||
if (dev != null) {
|
||||
item.setComFlag(dev.getRunStatus());
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
lineTree = tree4.stream()
|
||||
.filter(vo -> list1.contains(vo.getPid()))
|
||||
.peek(item -> {
|
||||
CsEquipmentDeliveryPO dev = devsMap.get(item.getId());
|
||||
if (dev != null) {
|
||||
item.setComFlag(dev.getRunStatus());
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(deviceTree)) {
|
||||
List<CsLedgerVO> finalLineTree = lineTree;
|
||||
deviceTree.forEach(item->{
|
||||
deviceTree.forEach(item -> {
|
||||
item.setChildren(getChildren(item, finalLineTree));
|
||||
});
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(projectTree)) {
|
||||
List<CsLedgerVO> finalDeviceTree = deviceTree;
|
||||
projectTree.forEach(item->{
|
||||
projectTree.forEach(item -> {
|
||||
item.setChildren(getChildren(item, finalDeviceTree));
|
||||
});
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(engineerTree)) {
|
||||
List<CsLedgerVO> finalProjectTree = projectTree;
|
||||
engineerTree.forEach(item->{
|
||||
engineerTree.forEach(item -> {
|
||||
item.setChildren(getChildren(item, finalProjectTree));
|
||||
});
|
||||
}
|
||||
@@ -729,6 +1062,78 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
return government;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DevDetailDTO> getInfoByIds(List<String> list) {
|
||||
List<DevDetailDTO> details = new ArrayList<>();
|
||||
List<CsLedger> ledgers = this.listByIds(list);
|
||||
Set<String> enginingeringIds = new HashSet<>();
|
||||
ledgers.forEach(item -> {
|
||||
DevDetailDTO device = new DevDetailDTO();
|
||||
if (Objects.equals(item.getPid(), "0")) {
|
||||
device.setEquipmentName(item.getName());
|
||||
device.setEquipmentId(item.getId());
|
||||
device.setProjectId("/");
|
||||
device.setProjectName("/");
|
||||
device.setEngineeringid("/");
|
||||
device.setEngineeringName("/");
|
||||
details.add(device);
|
||||
} else {
|
||||
enginingeringIds.add(item.getPids().split(",")[1]);
|
||||
}
|
||||
});
|
||||
if (CollectionUtil.isNotEmpty(enginingeringIds)) {
|
||||
List<CsLedger> engineer = this.listByIds(enginingeringIds);
|
||||
engineer.forEach(item -> {
|
||||
DevDetailDTO detail = new DevDetailDTO();
|
||||
detail.setEngineeringid(item.getId());
|
||||
detail.setEngineeringName(item.getName());
|
||||
details.add(detail);
|
||||
});
|
||||
}
|
||||
return details;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DevDetailDTO> getDevInfoByEngineerIds(List<String> list) {
|
||||
List<DevDetailDTO> details = new ArrayList<>();
|
||||
LambdaQueryWrapper<CsLedger> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(CsLedger::getPid, list);
|
||||
List<CsLedger> project = this.list(queryWrapper);
|
||||
//工程id
|
||||
List<String> projectIds = project.stream().map(CsLedger::getId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<CsLedger> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||
queryWrapper2.in(CsLedger::getPid, projectIds);
|
||||
List<CsLedger> dev = this.list(queryWrapper2);
|
||||
dev.forEach(item -> {
|
||||
DevDetailDTO detail = new DevDetailDTO();
|
||||
detail.setEquipmentName(item.getName());
|
||||
detail.setEquipmentId(item.getId());
|
||||
details.add(detail);
|
||||
});
|
||||
return details;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DevDetailDTO> getEngineeringHaveDevs(List<String> list) {
|
||||
List<DevDetailDTO> result = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
LambdaQueryWrapper<CsLedger> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CsLedger::getPid, item);
|
||||
List<CsLedger> project = this.list(queryWrapper);
|
||||
//工程id
|
||||
List<String> projectIds = project.stream().map(CsLedger::getId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<CsLedger> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||
queryWrapper2.in(CsLedger::getPid, projectIds);
|
||||
List<CsLedger> dev = this.list(queryWrapper2);
|
||||
if (CollectionUtil.isNotEmpty(dev)) {
|
||||
DevDetailDTO dto = new DevDetailDTO();
|
||||
dto.setEngineeringid(item);
|
||||
result.add(dto);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取子节点
|
||||
*/
|
||||
@@ -744,12 +1149,12 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
return children;
|
||||
}
|
||||
|
||||
public String getAreaById(String id){
|
||||
String areaName =redisUtil.getStringByKey (id);
|
||||
areaName = Optional.ofNullable (areaName).orElseGet (() ->{
|
||||
Area data = areaFeignClient.selectIdArea (id).getData ( );
|
||||
redisUtil.saveByKey (id,data.getName ());
|
||||
return data.getName ();
|
||||
public String getAreaById(String id) {
|
||||
String areaName = redisUtil.getStringByKey(id);
|
||||
areaName = Optional.ofNullable(areaName).orElseGet(() -> {
|
||||
Area data = areaFeignClient.selectIdArea(id).getData();
|
||||
redisUtil.saveByKey(id, data.getName());
|
||||
return data.getName();
|
||||
});
|
||||
return areaName;
|
||||
}
|
||||
|
||||
@@ -1,33 +1,55 @@
|
||||
package com.njcn.csdevice.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.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.access.api.CsLineLatestDataFeignClient;
|
||||
import com.njcn.access.pojo.po.CsLineLatestData;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||
import com.njcn.csdevice.mapper.CsLinePOMapper;
|
||||
import com.njcn.csdevice.mapper.CsTerminalLogsMapper;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||
import com.njcn.csdevice.mapper.*;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.*;
|
||||
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.csdevice.pojo.vo.PqSensitiveUserLineVO;
|
||||
import com.njcn.csdevice.service.CsDevModelService;
|
||||
import com.njcn.csdevice.service.CsLinePOService;
|
||||
import com.njcn.csdevice.service.ICsDataSetService;
|
||||
import com.njcn.csharmonic.api.PqSensitiveUserFeignClient;
|
||||
import com.njcn.csharmonic.pojo.po.PqSensitiveUser;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.api.DictTreeFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.constant.UserType;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/5/18 14:01【需求编号】
|
||||
*
|
||||
@@ -43,6 +65,15 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
||||
private final ICsDataSetService csDataSetService;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final CsTerminalLogsMapper csTerminalLogsMapper;
|
||||
private final CsLineLatestDataFeignClient csLineLatestDataFeignClient;
|
||||
private final PqSensitiveUserFeignClient pqSensitiveUserFeignClient;
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
private final UserFeignClient userFeignClient;
|
||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||
private final CsDeviceUserPOMapper csDeviceUserPOMapper;
|
||||
private final DictTreeFeignClient dictTreeFeignClient;
|
||||
|
||||
|
||||
@Override
|
||||
public List<CsLinePO> getLineByDev(List<String> list) {
|
||||
@@ -73,6 +104,10 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
||||
return this.baseMapper.findByNdid(id);
|
||||
}
|
||||
|
||||
public Map<String,String> getCustomDetailByLineId(String lineId){
|
||||
return this.baseMapper.getCustomDetailByLineId(lineId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLine(CsLineParam csLineParam) {
|
||||
LambdaUpdateWrapper<CsLinePO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
@@ -109,7 +144,7 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
||||
//1.新增监测点信息
|
||||
BeanUtils.copyProperties(param,po);
|
||||
po.setStatus(1);
|
||||
po.setRunStatus(2);
|
||||
po.setRunStatus(param.getRunStatus());
|
||||
po.setLineId(param.getDevMac().replace(":","") + param.getLineNo());
|
||||
//模板id
|
||||
CsDevModelPO po1 = csDevModelService.getCldModel();
|
||||
@@ -123,8 +158,8 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
||||
po.setClDid(list.get(0).getClDev());
|
||||
}
|
||||
//监测位置
|
||||
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.GRID_SIDE.getCode()).getData();
|
||||
po.setPosition(data.getId());
|
||||
//DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.GRID_SIDE.getCode()).getData();
|
||||
po.setPosition(param.getPosition());
|
||||
this.save(po);
|
||||
|
||||
//2.新增台账树信息
|
||||
@@ -164,7 +199,16 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
||||
.set(CsLinePO::getCtRatio,param.getCtRatio())
|
||||
.set(CsLinePO::getCt2Ratio,param.getCt2Ratio())
|
||||
.set(CsLinePO::getVolGrade,param.getVolGrade())
|
||||
.set(CsLinePO::getRunStatus,param.getRunStatus());
|
||||
.set(CsLinePO::getRunStatus,param.getRunStatus())
|
||||
.set(CsLinePO::getBasicCapacity,param.getBasicCapacity())
|
||||
.set(CsLinePO::getDevCapacity,param.getDevCapacity())
|
||||
.set(CsLinePO::getProtocolCapacity,param.getProtocolCapacity())
|
||||
.set(CsLinePO::getShortCircuitCapacity,param.getShortCircuitCapacity())
|
||||
.set(CsLinePO::getMonitorObj,param.getMonitorObj())
|
||||
.set(CsLinePO::getMonitorObj,param.getMonitorObj())
|
||||
.set(CsLinePO::getGovern,param.getGovern())
|
||||
.set(CsLinePO::getPosition,param.getPosition())
|
||||
.set(CsLinePO::getMonitorUser,param.getMonitorUser());
|
||||
this.update(lambdaUpdateWrapper);
|
||||
|
||||
//修改台账树中监测点的名称
|
||||
@@ -211,6 +255,244 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
||||
this.update(updateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsLinePO> getLineByName(String lineName) {
|
||||
return this.lambdaQuery().eq(CsLinePO::getStatus, 1).like(CsLinePO::getName,lineName).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getAllLine() {
|
||||
return this.lambdaQuery()
|
||||
.eq(CsLinePO::getStatus, 1)
|
||||
.list()
|
||||
.stream()
|
||||
.map(CsLinePO::getLineId)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsLinePO> getSimpleLine() {
|
||||
List<String> devIds = commGetDevIds(RequestUtil.getUserIndex());
|
||||
if(CollUtil.isNotEmpty(devIds)){
|
||||
List<CsLinePO> poList = this.lambdaQuery().select(CsLinePO::getLineId,CsLinePO::getName,CsLinePO::getMonitorUser).in(CsLinePO::getDeviceId,devIds)
|
||||
.eq(CsLinePO::getStatus, DataStateEnum.ENABLE.getCode()).list();
|
||||
return poList;
|
||||
}else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> commGetDevIds(String userId){
|
||||
UserVO userVO = userFeignClient.getUserById(userId).getData();
|
||||
List<String> devIds;
|
||||
if(userVO.getType().equals(UserType.SUPER_ADMINISTRATOR ) || userVO.getType().equals(UserType.ADMINISTRATOR )){
|
||||
devIds = csEquipmentDeliveryMapper.selectList(new LambdaQueryWrapper<CsEquipmentDeliveryPO>().ne(CsEquipmentDeliveryPO::getRunStatus,DataStateEnum.DELETED.getCode())).stream().map(CsEquipmentDeliveryPO::getId).collect(Collectors.toList());
|
||||
} else {
|
||||
LambdaQueryWrapper<CsDeviceUserPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.select(CsDeviceUserPO::getDeviceId)
|
||||
.and(w->w.eq(CsDeviceUserPO::getPrimaryUserId,userId).or().eq(CsDeviceUserPO::getSubUserId,userId))
|
||||
.eq(CsDeviceUserPO::getStatus, DataStateEnum.ENABLE.getCode());
|
||||
List<CsDeviceUserPO> devList = this.csDeviceUserPOMapper.selectList(lambdaQueryWrapper);
|
||||
devIds = devList.stream().map(CsDeviceUserPO::getDeviceId).distinct().collect(Collectors.toList());
|
||||
}
|
||||
return devIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsLinePO> getLineBySensitiveUser(List<String> list) {
|
||||
return this.lambdaQuery()
|
||||
.in(CsLinePO::getMonitorUser,list)
|
||||
.eq(CsLinePO::getStatus, 1)
|
||||
.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<PqSensitiveUserLineVO> getSensitiveUserLineList(BaseParam param) {
|
||||
Page<PqSensitiveUserLineVO> result = new Page<>();
|
||||
result.setCurrent(param.getPageNum());
|
||||
result.setSize(param.getPageSize());
|
||||
|
||||
// 查询登录用户拥有的监测点台账
|
||||
List<CsLinePO> poList = getSimpleLine();
|
||||
// 构建基础查询条件
|
||||
LambdaQueryWrapper<CsLinePO> lambdaQueryWrapper = new LambdaQueryWrapper<CsLinePO>()
|
||||
.eq(CsLinePO::getStatus, 1)
|
||||
// 关联敏感用户
|
||||
//.isNotNull(CsLinePO::getMonitorUser)
|
||||
.orderByAsc(CsLinePO::getMonitorUser);
|
||||
// 只有当lineList不为空时才添加in条件
|
||||
if (CollUtil.isNotEmpty(poList)) {
|
||||
List<String> lineList = poList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
|
||||
lambdaQueryWrapper.in(CsLinePO::getLineId, lineList);
|
||||
}
|
||||
Page<CsLinePO> linePage = this.page(new Page<>(param.getPageNum(), param.getPageSize()), lambdaQueryWrapper);
|
||||
BeanUtil.copyProperties(linePage, result);
|
||||
List<CsLinePO> records = linePage.getRecords();
|
||||
if (CollUtil.isEmpty(records)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
List<PqSensitiveUserLineVO> list = new ArrayList<>();
|
||||
List<String> sensitiveUserIds = list.stream().map(PqSensitiveUserLineVO::getSensitiveUser).distinct().collect(Collectors.toList());
|
||||
|
||||
Map<String, String> sensitiveUserNameMap = new HashMap<>();
|
||||
List<PqSensitiveUser> pqSensitiveUserList = pqSensitiveUserFeignClient.getListByIds(sensitiveUserIds).getData();
|
||||
if (CollUtil.isNotEmpty(pqSensitiveUserList)) {
|
||||
sensitiveUserNameMap = pqSensitiveUserList.stream().collect(Collectors.toMap(PqSensitiveUser::getId, PqSensitiveUser::getName));
|
||||
}
|
||||
PqSensitiveUserLineVO sensitiveUserLineVO;
|
||||
for (CsLinePO record : records) {
|
||||
sensitiveUserLineVO = new PqSensitiveUserLineVO();
|
||||
// 治理对象
|
||||
sensitiveUserLineVO.setSensitiveUser(sensitiveUserNameMap.getOrDefault(record.getMonitorUser(), null));
|
||||
// 测点名称
|
||||
sensitiveUserLineVO.setLineId(record.getLineId());
|
||||
sensitiveUserLineVO.setLineName(record.getName());
|
||||
// 是否治理
|
||||
if (ObjectUtil.isNotEmpty(record.getGovern())) {
|
||||
if (record.getGovern().equals(0)) {
|
||||
sensitiveUserLineVO.setGovern("未治理");
|
||||
}
|
||||
if (record.getGovern().equals(1)) {
|
||||
sensitiveUserLineVO.setGovern("已治理");
|
||||
}
|
||||
}
|
||||
// 监测类型
|
||||
if (ObjectUtil.isNotNull(record.getPosition())) {
|
||||
sensitiveUserLineVO.setPosition(record.getPosition());
|
||||
DictData positionDictData = dicDataFeignClient.getDicDataById(record.getPosition()).getData();
|
||||
if (positionDictData != null) {
|
||||
sensitiveUserLineVO.setPosition(positionDictData.getName());
|
||||
}
|
||||
}
|
||||
// 电压等级
|
||||
if (ObjectUtil.isNotNull(record.getVolGrade())) {
|
||||
sensitiveUserLineVO.setVolGrade(record.getVolGrade());
|
||||
}
|
||||
// 运行状态
|
||||
if (ObjectUtil.isNotNull(record.getRunStatus())) {
|
||||
//获取设备状态
|
||||
int devRunStatus = csEquipmentDeliveryMapper.selectById(record.getDeviceId()).getRunStatus();
|
||||
sensitiveUserLineVO.setRunStatus(getRunStatusDescription(devRunStatus));
|
||||
}
|
||||
// 报告文件
|
||||
sensitiveUserLineVO.setReportFilePath(record.getReportFilePath());
|
||||
// 最新数据时间
|
||||
// List<CsLineLatestData> lineLatestDataList = csLineLatestDataFeignClient.listData().getData();
|
||||
// if (CollUtil.isNotEmpty(lineLatestDataList)) {
|
||||
// sensitiveUserLineVO.setLatestTime(lineLatestDataList.stream()
|
||||
// .filter(item -> item.getLineId().equals(record.getLineId()))
|
||||
// .map(CsLineLatestData::getTimeId)
|
||||
// .max(LocalDateTime::compareTo)
|
||||
// .orElse(null));
|
||||
// }
|
||||
list.add(sensitiveUserLineVO);
|
||||
}
|
||||
result.setRecords(list);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean uploadReport(MultipartFile file, String lineId) {
|
||||
String filePath = fileStorageUtil.uploadMultipart(file, OssPath.GOVERN_HARMONIC_FILE, true);
|
||||
return this.update(new LambdaUpdateWrapper<CsLinePO>().eq(CsLinePO::getLineId, lineId).set(CsLinePO::getReportFilePath, filePath));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReportUrl(String lineId) {
|
||||
CsLinePO linePO = this.getById(lineId);
|
||||
if (linePO != null) {
|
||||
String reportFilePath = linePO.getReportFilePath();
|
||||
if (StrUtil.isNotBlank(reportFilePath)) {
|
||||
return fileStorageUtil.getFileUrl(reportFilePath);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LineDetailDataVO getLineDetailData(String id) {
|
||||
if (StringUtils.isEmpty(id)) {
|
||||
return new LineDetailDataVO();
|
||||
} else {
|
||||
CsLinePO csLinePO = this.baseMapper.selectOne(new LambdaQueryWrapper<CsLinePO>().eq(CsLinePO::getLineId,id));
|
||||
//获取设备信息
|
||||
CsEquipmentDeliveryPO csEquipmentDelivery = csEquipmentDeliveryMapper.selectById(csLinePO.getDeviceId());
|
||||
String code = dictTreeFeignClient.queryById(csEquipmentDelivery.getDevType()).getData().getCode();
|
||||
|
||||
CsLedger csLedger = csLedgerMapper.selectById(csLinePO.getLineId());
|
||||
LineDetailDataVO lineDetailDataVO = new LineDetailDataVO();
|
||||
|
||||
lineDetailDataVO.setScale(csLinePO.getVolGrade()+"kV");
|
||||
if (Objects.equals(DicDataEnum.PORTABLE.getCode(),code)) {
|
||||
lineDetailDataVO.setAreaName("便携式工程");
|
||||
lineDetailDataVO.setBdName("便携式项目");
|
||||
} else {
|
||||
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());
|
||||
}
|
||||
lineDetailDataVO.setLineName(csLinePO.getName());
|
||||
//Device device = deviceMapper.selectById(devId);
|
||||
//lineDetailDataVO.setComFlag(PubUtils.comFlag(device.getComFlag()));
|
||||
//lineDetailDataVO.setRunFlag(PubUtils.lineRunFlag(lineDetail.getRunFlag()));
|
||||
//lineDetailDataVO.setIp(device.getIp());
|
||||
//lineDetailDataVO.setLoginTime(device.getLoginTime());
|
||||
//lineDetailDataVO.setDevId(device.getId());
|
||||
//lineDetailDataVO.setBusinessType(dicDataFeignClient.getDicDataById(lineDetail.getBusinessType()).getData().getName());
|
||||
//lineDetailDataVO.setLoadType(dicDataFeignClient.getDicDataById(lineDetail.getLoadType()).getData().getName());
|
||||
lineDetailDataVO.setObjName(csLinePO.getMonitorUser());
|
||||
lineDetailDataVO.setLineId(csLinePO.getLineId());
|
||||
lineDetailDataVO.setPtType(PubUtils.ptType(csLinePO.getConType()));
|
||||
lineDetailDataVO.setPt(csLinePO.getPtRatio() + "/" + (Objects.isNull(csLinePO.getPt2Ratio())?1.0:csLinePO.getPt2Ratio()));
|
||||
lineDetailDataVO.setCt(csLinePO.getCtRatio() + "/" + (Objects.isNull(csLinePO.getCt2Ratio())?1.0:csLinePO.getCt2Ratio()));
|
||||
lineDetailDataVO.setDealCapacity(Objects.isNull(csLinePO.getProtocolCapacity())?0.0f:csLinePO.getProtocolCapacity().floatValue());
|
||||
lineDetailDataVO.setDevCapacity(Objects.isNull(csLinePO.getDevCapacity())?0.0f:csLinePO.getDevCapacity().floatValue());
|
||||
lineDetailDataVO.setShortCapacity(Objects.isNull(csLinePO.getShortCircuitCapacity())?0.0f:csLinePO.getShortCircuitCapacity().floatValue());
|
||||
lineDetailDataVO.setStandardCapacity(Objects.isNull(csLinePO.getBasicCapacity())?0.0f:csLinePO.getBasicCapacity().floatValue());
|
||||
lineDetailDataVO.setTimeInterval(csLinePO.getLineInterval());
|
||||
|
||||
return lineDetailDataVO;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsLinePO> getLineList(CsLinePO param) {
|
||||
List<String> keywordsLineIds = new ArrayList<>();
|
||||
List<CsLinePO> poList = getSimpleLine();
|
||||
if (CollUtil.isNotEmpty(poList)) {
|
||||
keywordsLineIds = poList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
|
||||
}
|
||||
List<CsLinePO> result = this.list(new LambdaQueryWrapper<CsLinePO>()
|
||||
.eq(CsLinePO::getStatus, 1)
|
||||
.eq(StrUtil.isNotBlank(param.getPosition()), CsLinePO::getPosition, param.getPosition())
|
||||
.in(CsLinePO::getLineId, keywordsLineIds)
|
||||
.orderByAsc(CsLinePO::getName));
|
||||
//根据监测点id查询设备信息
|
||||
if (CollectionUtil.isNotEmpty(result)) {
|
||||
//获取设备信息集合
|
||||
List<String> devList = result.stream().map(CsLinePO::getDeviceId).collect(Collectors.toList());
|
||||
List<CsEquipmentDeliveryPO> equipmentDeliveryList = csEquipmentDeliveryMapper.selectBatchIds(devList);
|
||||
Map<String,Integer> runStatusMap = equipmentDeliveryList.stream().collect(Collectors.toMap(CsEquipmentDeliveryPO::getId,CsEquipmentDeliveryPO::getRunStatus));
|
||||
result.forEach(item->{
|
||||
item.setRunStatus(runStatusMap.get(item.getDeviceId()));
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private String getRunStatusDescription(Integer runStatus) {
|
||||
switch (runStatus) {
|
||||
case 1:
|
||||
return "离线";
|
||||
case 2:
|
||||
return "在线";
|
||||
default:
|
||||
return "未知";
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 1.平台端默认配置拓扑图模板,包含拓扑图信息(cs_topology_diagram_template)和拓扑图上监测点的点位信息(cs_line_topology_template)
|
||||
// *
|
||||
|
||||
@@ -146,8 +146,10 @@ public class CsTerminalLogsServiceImpl extends ServiceImpl<CsTerminalLogsMapper,
|
||||
operateType = 0;
|
||||
} else if (Objects.equals(code, "ledger_modify")) {
|
||||
operateType = 1;
|
||||
} else{
|
||||
} else if (Objects.equals(code, "delete_terminal")){
|
||||
operateType = 2;
|
||||
} else {
|
||||
operateType = 3;
|
||||
}
|
||||
//找出最新的数据,将状态改为未推送,下次可以再次推送
|
||||
this.lambdaUpdate()
|
||||
@@ -175,7 +177,7 @@ public class CsTerminalLogsServiceImpl extends ServiceImpl<CsTerminalLogsMapper,
|
||||
List<CsEquipmentDeliveryPO> v1 = entry.getValue();
|
||||
String guid = IdUtil.simpleUUID();
|
||||
message.setGuid(guid);
|
||||
message.setProcessNo(String.valueOf(k1));
|
||||
message.setProcessNo(k1);
|
||||
List<CldUpdateLedgerMessage.CldDeviceDto> list1 = new ArrayList<>();
|
||||
v1.forEach(item -> {
|
||||
CldUpdateLedgerMessage.CldDeviceDto deviceDto = new CldUpdateLedgerMessage.CldDeviceDto();
|
||||
@@ -248,7 +250,7 @@ public class CsTerminalLogsServiceImpl extends ServiceImpl<CsTerminalLogsMapper,
|
||||
nodeProcessMap1.forEach((k1,v1)->{
|
||||
String guid = IdUtil.simpleUUID();
|
||||
message.setGuid(guid);
|
||||
message.setProcessNo(String.valueOf(k1));
|
||||
message.setProcessNo(k1);
|
||||
List<CldUpdateLedgerMessage.CldDeviceDto> list1 = new ArrayList<>();
|
||||
v1.forEach(item->{
|
||||
CldUpdateLedgerMessage.CldDeviceDto deviceDto = new CldUpdateLedgerMessage.CldDeviceDto();
|
||||
@@ -267,6 +269,7 @@ public class CsTerminalLogsServiceImpl extends ServiceImpl<CsTerminalLogsMapper,
|
||||
csFmTerminalReply.setNodeId(k);
|
||||
csFmTerminalReply.setProcessNo(k1);
|
||||
csFmTerminalReply.setDeviceId(item.getDeviceId());
|
||||
csFmTerminalReply.setDeviceName(item.getDeviceName());
|
||||
csFmTerminalReply.setIsReceived(0);
|
||||
csTerminalReplyMapper.insert(csFmTerminalReply);
|
||||
});
|
||||
|
||||
@@ -1,23 +1,33 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.api.CsLedgerFeignClient;
|
||||
import com.njcn.csdevice.mapper.CsTerminalReplyMapper;
|
||||
import com.njcn.csdevice.param.IcdBzReplyParam;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.po.CsTerminalReply;
|
||||
import com.njcn.csdevice.pojo.vo.CldLogsVo;
|
||||
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
||||
import com.njcn.csdevice.service.CsEquipmentDeliveryService;
|
||||
import com.njcn.csdevice.service.ICsTerminalLogsService;
|
||||
import com.njcn.csdevice.service.ICsTerminalReplyService;
|
||||
import com.njcn.csdevice.service.INodeService;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -37,6 +47,7 @@ public class CsTerminalReplyServiceImpl extends ServiceImpl<CsTerminalReplyMappe
|
||||
private final INodeService nodeService;
|
||||
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
||||
private final ICsTerminalLogsService csTerminalLogsService;
|
||||
private final CsLedgerFeignClient csLedgerFeignClient;
|
||||
|
||||
@Override
|
||||
public List<String> queryReplyData() {
|
||||
@@ -58,25 +69,32 @@ public class CsTerminalReplyServiceImpl extends ServiceImpl<CsTerminalReplyMappe
|
||||
} else {
|
||||
list.forEach(item->{
|
||||
String key;
|
||||
String code;
|
||||
String code = "";
|
||||
if (Objects.equals(item.getCode(), "add_terminal")) {
|
||||
code = "新增";
|
||||
} else if (Objects.equals(item.getCode(), "ledger_modify")) {
|
||||
code = "修改";
|
||||
} else {
|
||||
} else if (Objects.equals(item.getCode(), "delete_terminal")){
|
||||
code = "删除";
|
||||
}
|
||||
String nodeName = nodeService.getNodeById(item.getNodeId()).getName();
|
||||
List<CsEquipmentDeliveryPO> devList1 = csEquipmentDeliveryService.getAll();
|
||||
List<CsEquipmentDeliveryPO> devList2 = devList1.stream().filter(item1 -> Objects.equals(item1.getId(), item.getDeviceId())).collect(Collectors.toList());
|
||||
List<String> devNameList = devList2.stream().map(CsEquipmentDeliveryPO::getName).collect(Collectors.toList());
|
||||
String devNameListString = devNameList.toString();
|
||||
String devNameListString;
|
||||
if (CollectionUtil.isNotEmpty(devNameList)) {
|
||||
devNameListString = devNameList.toString();
|
||||
} else {
|
||||
devNameListString = "[" + item.getDeviceName() + "]";
|
||||
}
|
||||
if (item.getIsReceived() == 0) {
|
||||
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + code + "数据失败";
|
||||
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备未收到应答";
|
||||
//将cs_terminal_logs数据置为未发送
|
||||
csTerminalLogsService.updateLaterData(item.getDeviceId(),item.getCode());
|
||||
} else if (item.getIsReceived() == 1){
|
||||
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备" + code + "数据成功";
|
||||
} else {
|
||||
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + code + "数据成功";
|
||||
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备" + code + "数据失败";
|
||||
}
|
||||
result.add(key);
|
||||
});
|
||||
@@ -87,9 +105,137 @@ public class CsTerminalReplyServiceImpl extends ServiceImpl<CsTerminalReplyMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateReplyData(String id,Integer state,String deviceId) {
|
||||
this.lambdaUpdate().set(CsTerminalReply::getIsReceived,state)
|
||||
.eq(CsTerminalReply::getDeviceId,deviceId)
|
||||
.eq(CsTerminalReply::getReplyId,id);
|
||||
public void updateReplyData(IcdBzReplyParam param) {
|
||||
LambdaUpdateWrapper<CsTerminalReply> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.set(CsTerminalReply::getIsReceived,param.getState())
|
||||
.set(CsTerminalReply::getReceivedCode,param.getCode())
|
||||
.set(CsTerminalReply::getReceivedMsg,param.getMsg())
|
||||
.eq(CsTerminalReply::getReplyId,param.getId())
|
||||
.eq(CsTerminalReply::getDeviceId,param.getDeviceId());
|
||||
this.update(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsTerminalReply> getBzReplyData(String lineId) {
|
||||
LambdaQueryWrapper<CsTerminalReply> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(CsTerminalReply::getCode,Arrays.asList("allFile","allEvent","oneFile"))
|
||||
.orderByDesc(CsTerminalReply::getCreateTime);
|
||||
if (!Objects.isNull(lineId) && StringUtils.isNotBlank(lineId)) {
|
||||
wrapper.like(CsTerminalReply::getLineId,lineId);
|
||||
}
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<CldLogsVo> getBzLogs(BaseParam param) {
|
||||
Page<CldLogsVo> page = new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param));
|
||||
QueryWrapper<CsTerminalReply> queryWrapper = new QueryWrapper<>();
|
||||
if (StrUtil.isNotBlank(param.getSearchValue())) {
|
||||
queryWrapper.like("cs_terminal_reply.line_id", param.getSearchValue());
|
||||
// //获取监测点id
|
||||
// List<CsLinePO> list = csLinePOService.getLineByName(param.getSearchValue());
|
||||
// if (CollectionUtil.isEmpty(list)) {
|
||||
// return page;
|
||||
// } else {
|
||||
// queryWrapper.and(pr -> {
|
||||
// // 获取所有 lineId
|
||||
// List<String> lineIds = list.stream()
|
||||
// .map(CsLinePO::getLineId)
|
||||
// .collect(Collectors.toList());
|
||||
// // 使用 OR 条件连接多个 lineId
|
||||
// for (int i = 0; i < lineIds.size(); i++) {
|
||||
// if (i == 0) {
|
||||
// pr.like("cs_terminal_reply.line_id", lineIds.get(i));
|
||||
// } else {
|
||||
// pr.or().like("cs_terminal_reply.line_id", lineIds.get(i));
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
}
|
||||
//排序
|
||||
queryWrapper.orderBy(true, false, "cs_terminal_reply.create_time");
|
||||
queryWrapper.in("cs_terminal_reply.code", Arrays.asList("allFile", "allEvent", "oneFile"));
|
||||
Page<CsTerminalReply> csTerminalReplyPage = this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
||||
|
||||
List<CsTerminalReply> records = csTerminalReplyPage.getRecords();
|
||||
if (CollectionUtil.isNotEmpty(records)) {
|
||||
List<CsLedgerVO> data = csLedgerFeignClient.getAllLedger().getData();
|
||||
Map<String, CsLedgerVO> ledgerMap = data.stream().collect(Collectors.toMap(CsLedgerVO::getId, Function.identity()));
|
||||
List<CldLogsVo> cldLogsVos = new ArrayList<>();
|
||||
records.forEach(item->{
|
||||
String pids = ledgerMap.get(item.getDeviceId()).getPids();
|
||||
String[] split = pids.split(",");
|
||||
CldLogsVo cldLogsVo = new CldLogsVo();
|
||||
cldLogsVo.setEngineeringName(ledgerMap.get(split[1]).getName());
|
||||
cldLogsVo.setProjectName(ledgerMap.get(split[2]).getName());
|
||||
cldLogsVo.setDeviceName(ledgerMap.get(item.getDeviceId()).getName());
|
||||
// String lineId = item.getLineId();
|
||||
// String[] lineSplit = lineId.split(",");
|
||||
// String result;
|
||||
// if (lineSplit.length == 1) {
|
||||
// result = ledgerMap.get(lineSplit[0]).getName();
|
||||
// } else {
|
||||
// result = Arrays.stream(lineSplit)
|
||||
// .map(ledgerMap::get)
|
||||
// .filter(Objects::nonNull)
|
||||
// .map(CsLedgerVO::getName)
|
||||
// .collect(Collectors.joining(","));
|
||||
// }
|
||||
// cldLogsVo.setLineName(result);
|
||||
cldLogsVo.setLineName(ledgerMap.get(param.getSearchValue()).getName());
|
||||
cldLogsVo.setLog(getLogDescription(item.getCode()));
|
||||
cldLogsVo.setLogTime(item.getCreateTime());
|
||||
if (Objects.equals(item.getIsReceived(),0)) {
|
||||
cldLogsVo.setStatus("补召已下发");
|
||||
cldLogsVo.setResult("/");
|
||||
} else {
|
||||
if (item.getReceivedCode() == 200) {
|
||||
cldLogsVo.setStatus("补召成功");
|
||||
cldLogsVo.setResult(item.getReceivedMsg());
|
||||
} else {
|
||||
cldLogsVo.setStatus("补召失败");
|
||||
cldLogsVo.setResult(item.getReceivedMsg());
|
||||
}
|
||||
}
|
||||
cldLogsVos.add(cldLogsVo);
|
||||
});
|
||||
page.setRecords(cldLogsVos);
|
||||
}
|
||||
page.setTotal(csTerminalReplyPage.getTotal());
|
||||
page.setPages(csTerminalReplyPage.getPages());
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBzData(IcdBzReplyParam param) {
|
||||
LambdaUpdateWrapper<CsTerminalReply> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.set(CsTerminalReply::getIsReceived,param.getState())
|
||||
.set(CsTerminalReply::getReceivedCode,param.getCode())
|
||||
.set(CsTerminalReply::getReceivedMsg,param.getMsg())
|
||||
.eq(CsTerminalReply::getReplyId,param.getId())
|
||||
.eq(CsTerminalReply::getDeviceId,param.getDeviceId());
|
||||
if (Objects.nonNull(param.getLineId()) && StringUtils.isNotBlank(param.getLineId())) {
|
||||
wrapper.eq(CsTerminalReply::getLineId,param.getLineId());
|
||||
}
|
||||
this.update(wrapper);
|
||||
}
|
||||
|
||||
public String getLogDescription(String code) {
|
||||
String result;
|
||||
switch (code) {
|
||||
case "allFile":
|
||||
result = "补召缺失波形文件";
|
||||
break;
|
||||
case "allEvent":
|
||||
result = "补召事件";
|
||||
break;
|
||||
case "oneFile":
|
||||
result = "补召单事件波形";
|
||||
break;
|
||||
default:
|
||||
result = "未知";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||
import com.njcn.csdevice.pojo.param.*;
|
||||
import com.njcn.csdevice.pojo.po.AppProjectPO;
|
||||
import com.njcn.csdevice.pojo.po.AppTopologyDiagramPO;
|
||||
import com.njcn.csdevice.pojo.po.CsEngineeringPO;
|
||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
||||
import com.njcn.csdevice.pojo.vo.EngineeringProjectRelationVo;
|
||||
import com.njcn.csdevice.service.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据集表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2026-01-29
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class EngineeringProjectServiceImpl implements IEngineeringProjectService {
|
||||
|
||||
private final CsEngineeringService csEngineeringService;
|
||||
private final AppProjectService appProjectService;
|
||||
private final ICsLedgerService csLedgerService;
|
||||
private final CsLedgerMapper csLedgerMapper;
|
||||
private final AppTopologyDiagramService appTopologyDiagramService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean addEngineering(CsEngineeringAddParm csEngineeringAddParm) {
|
||||
boolean result = false;
|
||||
//新增工程信息
|
||||
CsEngineeringPO po1 = csEngineeringService.add(csEngineeringAddParm);
|
||||
//新增cs_ledger数据
|
||||
CsLedgerParam csLedgerParam = new CsLedgerParam();
|
||||
csLedgerParam.setId(po1.getId());
|
||||
csLedgerParam.setPid("9999999");
|
||||
csLedgerParam.setName(csEngineeringAddParm.getName());
|
||||
csLedgerParam.setLevel(0);
|
||||
csLedgerParam.setRemark(csEngineeringAddParm.getDescription());
|
||||
csLedgerParam.setSort(csEngineeringAddParm.getSort());
|
||||
CsLedger po2 = csLedgerService.addLedgerTree(csLedgerParam);
|
||||
if (ObjectUtil.isNotNull(po1) && ObjectUtil.isNotNull(po2)) {
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updateEngineering(CsEngineeringAuditParm csEngineeringAuditParm) {
|
||||
//修改工程信息
|
||||
CsEngineeringPO po1 = csEngineeringService.updateData(csEngineeringAuditParm);
|
||||
//修改cs_ledger数据
|
||||
CsLedgerParam.Update csLedgerParam = new CsLedgerParam.Update();
|
||||
csLedgerParam.setId(po1.getId());
|
||||
csLedgerParam.setName(csEngineeringAuditParm.getName());
|
||||
csLedgerParam.setSort(csEngineeringAuditParm.getSort());
|
||||
csLedgerService.updateLedgerTree(csLedgerParam);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean deleteEngineering(String id) {
|
||||
//查询csledger数据
|
||||
List<CsLedgerVO> allList = csLedgerMapper.getAll();
|
||||
allList.forEach(item->{
|
||||
if (Objects.equals(item.getPid(),id)) {
|
||||
throw new BusinessException("请先删除该工程下的所有项目");
|
||||
}
|
||||
});
|
||||
//删除工程信息
|
||||
csEngineeringService.deleteData(id);
|
||||
//删除台账信息
|
||||
csLedgerService.deleteLedgerTree(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addProject(AppProjectAddParm param) {
|
||||
boolean result = false;
|
||||
//新增项目信息
|
||||
AppProjectPO po1 = appProjectService.add(param);
|
||||
//新增cs_ledger数据
|
||||
CsLedgerParam csLedgerParam = new CsLedgerParam();
|
||||
csLedgerParam.setId(po1.getId());
|
||||
csLedgerParam.setPid(param.getEngineeringId());
|
||||
csLedgerParam.setName(param.getName());
|
||||
csLedgerParam.setLevel(1);
|
||||
csLedgerParam.setSort(param.getSort());
|
||||
CsLedger po2 = csLedgerService.addLedgerTree(csLedgerParam);
|
||||
if (ObjectUtil.isNotNull(po1) && ObjectUtil.isNotNull(po2)) {
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateProject(AppProjectAuditParm param) {
|
||||
//修改工程信息
|
||||
AppProjectPO po1 = appProjectService.updateData(param);
|
||||
//修改cs_ledger数据
|
||||
CsLedgerParam.Update csLedgerParam = new CsLedgerParam.Update();
|
||||
csLedgerParam.setId(po1.getId());
|
||||
csLedgerParam.setName(param.getName());
|
||||
csLedgerParam.setSort(param.getSort());
|
||||
csLedgerParam.setRemark(param.getDescription());
|
||||
csLedgerService.updateLedgerTree(csLedgerParam);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteProject(String id) {
|
||||
//删除项目信息
|
||||
appProjectService.delete(id);
|
||||
//删除台账信息
|
||||
csLedgerService.deleteLedgerTree(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EngineeringProjectRelationVo> getList() {
|
||||
List<EngineeringProjectRelationVo> result = new ArrayList<>();
|
||||
//查询所有工程
|
||||
LambdaQueryWrapper<CsEngineeringPO> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||
queryWrapper1.eq(CsEngineeringPO::getStatus,"1").orderByAsc(CsEngineeringPO::getSort);
|
||||
List<CsEngineeringPO> list1 = csEngineeringService.list(queryWrapper1);
|
||||
|
||||
//查询所有项目
|
||||
LambdaQueryWrapper<AppProjectPO> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||
queryWrapper2.eq(AppProjectPO::getStatus,"1").orderByAsc(AppProjectPO::getSort);
|
||||
List<AppProjectPO> list2 = appProjectService.list(queryWrapper2);
|
||||
Map<String,AppProjectPO> map = list2.stream().collect(Collectors.toMap(AppProjectPO::getId, item->item));
|
||||
|
||||
//查询所有拓扑图
|
||||
LambdaQueryWrapper<AppTopologyDiagramPO> queryWrapper3 = new LambdaQueryWrapper<>();
|
||||
queryWrapper3.eq(AppTopologyDiagramPO::getStatus,"1");
|
||||
List<AppTopologyDiagramPO> list3 = appTopologyDiagramService.list(queryWrapper3);
|
||||
Map<String,AppTopologyDiagramPO> map3 = list3.stream().collect(Collectors.toMap(AppTopologyDiagramPO::getProjectId, item->item));
|
||||
|
||||
//查询台账信息
|
||||
List<CsLedgerVO> allList = csLedgerMapper.getAll();
|
||||
|
||||
if (CollectionUtil.isNotEmpty(list1)) {
|
||||
list1.forEach(item->{
|
||||
EngineeringProjectRelationVo temp = new EngineeringProjectRelationVo();
|
||||
temp.setEngineeringId(item.getId());
|
||||
temp.setEngineeringName(item.getName());
|
||||
temp.setEngineeringArea(item.getProvince()+item.getCity());
|
||||
temp.setEngineeringRemark(item.getDescription());
|
||||
temp.setEngineeringSort(item.getSort());
|
||||
|
||||
List<CsLedgerVO> projectList = allList.stream().filter(item2->item2.getPid().equals(item.getId())).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(projectList)) {
|
||||
List<EngineeringProjectRelationVo.ProjectInfo> projectInfoList = new ArrayList<>();
|
||||
projectList.forEach(item2->{
|
||||
AppProjectPO po = map.get(item2.getId());
|
||||
EngineeringProjectRelationVo.ProjectInfo projectInfo = new EngineeringProjectRelationVo.ProjectInfo();
|
||||
projectInfo.setProjectId(po.getId());
|
||||
projectInfo.setProjectName(po.getName());
|
||||
projectInfo.setProjectArea(po.getArea());
|
||||
projectInfo.setProjectRemark(po.getDescription());
|
||||
projectInfo.setProjectSort(po.getSort());
|
||||
projectInfo.setTopologyInfo(Objects.isNull(map3.get(po.getId()))?null:map3.get(po.getId()).getFilePath());
|
||||
projectInfoList.add(projectInfo);
|
||||
});
|
||||
temp.setProjectInfoList(projectInfoList);
|
||||
}
|
||||
result.add(temp);
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,18 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.csp.sentinel.util.StringUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.access.utils.ChannelObjectUtil;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.param.IcdBzParam;
|
||||
import com.njcn.csdevice.param.IcdLedgerParam;
|
||||
import com.njcn.csdevice.param.IcdParam;
|
||||
import com.njcn.csdevice.pojo.param.AppProjectAddParm;
|
||||
@@ -16,7 +22,13 @@ import com.njcn.csdevice.pojo.po.*;
|
||||
import com.njcn.csdevice.pojo.vo.CldLedgerVo;
|
||||
import com.njcn.csdevice.pojo.vo.DeviceInfo;
|
||||
import com.njcn.csdevice.service.*;
|
||||
import com.njcn.mq.message.CldControlMessage;
|
||||
import com.njcn.csharmonic.api.EventFeignClient;
|
||||
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
||||
import com.njcn.device.biz.mapper.OverLimitWlMapper;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.utils.COverlimitUtil;
|
||||
import com.njcn.mq.message.BZEventMessage;
|
||||
import com.njcn.mq.template.BZEventMessageTemplate;
|
||||
import com.njcn.redis.pojo.enums.AppRedisKey;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
@@ -27,6 +39,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -44,7 +58,12 @@ class IcdServiceImpl implements IcdService {
|
||||
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
||||
private final CsLinePOService csLinePOService;
|
||||
private final ICsLedgerService csLedgerService;
|
||||
private final BZEventMessageTemplate bzEventMessageTemplate;
|
||||
private final EventFeignClient eventFeignClient;
|
||||
private final ICsTerminalLogsService csTerminalLogsService;
|
||||
private final ICsTerminalReplyService csTerminalReplyService;
|
||||
private final OverLimitWlMapper overLimitWlMapper;
|
||||
private final DateTimeFormatter microsecondFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSS");
|
||||
|
||||
@Override
|
||||
public List<DeviceInfo> getLedgerInfo(IcdParam param) {
|
||||
@@ -109,7 +128,7 @@ class IcdServiceImpl implements IcdService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@DSTransactional
|
||||
public void addLedgerInfo(IcdLedgerParam param) {
|
||||
// 第一种:全流程创建
|
||||
if (isAllIndicesNull(param)) {
|
||||
@@ -161,8 +180,316 @@ class IcdServiceImpl implements IcdService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restartProcess(CldControlMessage message) {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void bzFileByEventId(String eventId) {
|
||||
CsEventPO po = eventFeignClient.queryById(eventId).getData();
|
||||
if (ObjectUtil.isNull(po)) {
|
||||
throw new BusinessException("事件缺失");
|
||||
}
|
||||
//获取设备信息
|
||||
CsEquipmentDeliveryPO dev = csEquipmentDeliveryService.getDevByLineId(po.getLineId());
|
||||
BZEventMessage.Event file = new BZEventMessage.Event();
|
||||
file.setGuid(po.getId());
|
||||
file.setTerminalId(po.getDeviceId());
|
||||
file.setMonitorIdList(Collections.singletonList(po.getLineId()));
|
||||
file.setTimeInterval(Collections.singletonList(po.getStartTime().format(microsecondFormatter)));
|
||||
file.setDataType(2);
|
||||
//记录发送日志
|
||||
CsTerminalLogs csTerminalLogs = new CsTerminalLogs();
|
||||
csTerminalLogs.setId(po.getId());
|
||||
csTerminalLogs.setDeviceId(dev.getId());
|
||||
csTerminalLogs.setLineId(po.getLineId());
|
||||
csTerminalLogs.setOperateType(3);
|
||||
csTerminalLogs.setNodeId(dev.getNodeId());
|
||||
csTerminalLogs.setNodeProcess(dev.getNodeProcess());
|
||||
csTerminalLogs.setIsPush(1);
|
||||
csTerminalLogsService.saveOrUpdate(csTerminalLogs);
|
||||
//记录响应日志
|
||||
CsTerminalReply csTerminalReply = new CsTerminalReply();
|
||||
csTerminalReply.setId(IdUtil.simpleUUID());
|
||||
csTerminalReply.setReplyId(po.getId());
|
||||
csTerminalReply.setNodeId(dev.getNodeId());
|
||||
csTerminalReply.setProcessNo(dev.getNodeProcess());
|
||||
csTerminalReply.setDeviceId(dev.getId());
|
||||
csTerminalReply.setLineId(po.getLineId());
|
||||
csTerminalReply.setIsReceived(0);
|
||||
csTerminalReply.setCode("oneFile");
|
||||
csTerminalReplyService.saveOrUpdate(csTerminalReply);
|
||||
//发送消息
|
||||
bzEventMessageTemplate.sendMember(Collections.singletonList(file),dev.getNodeId());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void bzEvent(IcdBzParam param) {
|
||||
// 参数校验
|
||||
if (StrUtil.isBlank(param.getStartTime()) || StrUtil.isBlank(param.getEndTime())) {
|
||||
throw new BusinessException("开始时间和结束时间不能为空");
|
||||
}
|
||||
LocalDateTime startLocalDate;
|
||||
LocalDateTime endLocalDate;
|
||||
try {
|
||||
startLocalDate = LocalDateTimeUtil.parse(param.getStartTime(), DatePattern.NORM_DATE_PATTERN);
|
||||
endLocalDate = LocalDateTimeUtil.parse(param.getEndTime(), DatePattern.NORM_DATE_PATTERN);
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException("时间格式不正确,请使用 yyyy-MM-dd 格式");
|
||||
}
|
||||
String beginDay = LocalDateTimeUtil.format(
|
||||
LocalDateTimeUtil.beginOfDay(startLocalDate),
|
||||
DatePattern.NORM_DATETIME_PATTERN
|
||||
);
|
||||
String endDay = LocalDateTimeUtil.format(
|
||||
LocalDateTimeUtil.endOfDay(endLocalDate),
|
||||
DatePattern.NORM_DATETIME_PATTERN
|
||||
);
|
||||
if (CollectionUtil.isNotEmpty(param.getLineList())) {
|
||||
processWithLineIds(param.getLineList(), beginDay, endDay);
|
||||
} else {
|
||||
processWithoutLineIds(beginDay, endDay);
|
||||
}
|
||||
}
|
||||
|
||||
private void processWithLineIds(List<String> lineList, String beginDay, String endDay) {
|
||||
List<CsLinePO> csLineList = csLinePOService.listByIds(lineList);
|
||||
List<String> deviceIdList = csLineList.stream()
|
||||
.map(CsLinePO::getDeviceId)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<CsEquipmentDeliveryPO> equipmentList = csEquipmentDeliveryService.listByIds(deviceIdList);
|
||||
Map<String, List<CsEquipmentDeliveryPO>> devMap = equipmentList.stream()
|
||||
.collect(Collectors.groupingBy(CsEquipmentDeliveryPO::getNodeId));
|
||||
|
||||
handleEventsAndLogs(devMap, csLineList, beginDay, endDay);
|
||||
}
|
||||
|
||||
private void processWithoutLineIds(String beginDay, String endDay) {
|
||||
List<CsEquipmentDeliveryPO> devList = csEquipmentDeliveryService.getAllOnline();
|
||||
if (CollectionUtil.isEmpty(devList)) return;
|
||||
|
||||
List<String> deviceIds = devList.stream()
|
||||
.map(CsEquipmentDeliveryPO::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<CsLinePO> csLineList = csLinePOService.getLinesByDevList(deviceIds);
|
||||
Map<String, List<CsEquipmentDeliveryPO>> devMap = devList.stream()
|
||||
.collect(Collectors.groupingBy(CsEquipmentDeliveryPO::getNodeId));
|
||||
|
||||
handleEventsAndLogs(devMap, csLineList, beginDay, endDay);
|
||||
}
|
||||
|
||||
private void handleEventsAndLogs(
|
||||
Map<String, List<CsEquipmentDeliveryPO>> devMap,
|
||||
List<CsLinePO> csLineList,
|
||||
String beginDay,
|
||||
String endDay
|
||||
) {
|
||||
devMap.forEach((nodeId, devices) -> {
|
||||
List<BZEventMessage.Event> events = new ArrayList<>();
|
||||
List<CsTerminalLogs> logsToSave = new ArrayList<>();
|
||||
List<CsTerminalReply> repliesToSave = new ArrayList<>();
|
||||
|
||||
for (CsEquipmentDeliveryPO device : devices) {
|
||||
String uuid = IdUtil.simpleUUID();
|
||||
|
||||
BZEventMessage.Event event = buildEvent(uuid, device, csLineList, beginDay, endDay);
|
||||
events.add(event);
|
||||
|
||||
CsTerminalLogs log = buildTerminalLog(uuid, device, csLineList);
|
||||
logsToSave.add(log);
|
||||
|
||||
List<CsTerminalReply> reply = buildTerminalReply(uuid, device, csLineList);
|
||||
repliesToSave.addAll(reply);
|
||||
}
|
||||
csTerminalLogsService.saveBatch(logsToSave);
|
||||
csTerminalReplyService.saveBatch(repliesToSave);
|
||||
bzEventMessageTemplate.sendMember(events, nodeId);
|
||||
});
|
||||
}
|
||||
|
||||
private BZEventMessage.Event buildEvent(String guid, CsEquipmentDeliveryPO device,
|
||||
List<CsLinePO> csLineList, String beginDay, String endDay) {
|
||||
BZEventMessage.Event event = new BZEventMessage.Event();
|
||||
event.setGuid(guid);
|
||||
event.setTerminalId(device.getId());
|
||||
|
||||
List<String> monitorIds = csLineList.stream()
|
||||
.filter(line -> Objects.equals(line.getDeviceId(), device.getId()))
|
||||
.map(CsLinePO::getLineId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
event.setMonitorIdList(monitorIds);
|
||||
event.setDataType(1);
|
||||
event.setTimeInterval(Collections.singletonList(beginDay + "~" + endDay));
|
||||
return event;
|
||||
}
|
||||
|
||||
private CsTerminalLogs buildTerminalLog(String id, CsEquipmentDeliveryPO device,
|
||||
List<CsLinePO> csLineList) {
|
||||
List<String> lineIds = csLineList.stream()
|
||||
.filter(line -> Objects.equals(line.getDeviceId(), device.getId()))
|
||||
.map(CsLinePO::getLineId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
CsTerminalLogs log = new CsTerminalLogs();
|
||||
log.setId(id);
|
||||
log.setDeviceId(device.getId());
|
||||
log.setLineId(String.join(",", lineIds));
|
||||
log.setOperateType(3);
|
||||
log.setNodeId(device.getNodeId());
|
||||
log.setNodeProcess(device.getNodeProcess());
|
||||
log.setIsPush(1);
|
||||
return log;
|
||||
}
|
||||
|
||||
private List<CsTerminalReply> buildTerminalReply(String replyId, CsEquipmentDeliveryPO device,
|
||||
List<CsLinePO> csLineList) {
|
||||
List<CsTerminalReply> replies = new ArrayList<>();
|
||||
List<String> lineIds = csLineList.stream()
|
||||
.filter(line -> Objects.equals(line.getDeviceId(), device.getId()))
|
||||
.map(CsLinePO::getLineId)
|
||||
.collect(Collectors.toList());
|
||||
lineIds.forEach(lineId -> {
|
||||
CsTerminalReply reply = new CsTerminalReply();
|
||||
reply.setId(IdUtil.simpleUUID());
|
||||
reply.setReplyId(replyId);
|
||||
reply.setNodeId(device.getNodeId());
|
||||
reply.setProcessNo(device.getNodeProcess());
|
||||
reply.setDeviceId(device.getId());
|
||||
reply.setLineId(lineId);
|
||||
reply.setIsReceived(0);
|
||||
reply.setCode("allEvent");
|
||||
replies.add(reply);
|
||||
});
|
||||
return replies;
|
||||
}
|
||||
|
||||
// private CsTerminalReply buildTerminalReply(String replyId, CsEquipmentDeliveryPO device,
|
||||
// List<CsLinePO> csLineList) {
|
||||
// List<String> lineIds = csLineList.stream()
|
||||
// .filter(line -> Objects.equals(line.getDeviceId(), device.getId()))
|
||||
// .map(CsLinePO::getLineId)
|
||||
// .collect(Collectors.toList());
|
||||
//
|
||||
// CsTerminalReply reply = new CsTerminalReply();
|
||||
// reply.setId(IdUtil.simpleUUID());
|
||||
// reply.setReplyId(replyId);
|
||||
// reply.setNodeId(device.getNodeId());
|
||||
// reply.setProcessNo(device.getNodeProcess());
|
||||
// reply.setDeviceId(device.getId());
|
||||
// reply.setLineId(String.join(",", lineIds));
|
||||
// reply.setIsReceived(0);
|
||||
// reply.setCode("allEvent");
|
||||
// return reply;
|
||||
// }
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void bzFile(IcdBzParam param) {
|
||||
String beginDay = LocalDateTimeUtil.format(
|
||||
LocalDateTimeUtil.beginOfDay(LocalDateTimeUtil.parse(param.getStartTime(), DatePattern.NORM_DATE_PATTERN)),
|
||||
DatePattern.NORM_DATETIME_PATTERN
|
||||
);
|
||||
String endDay = LocalDateTimeUtil.format(
|
||||
LocalDateTimeUtil.endOfDay(LocalDateTimeUtil.parse(param.getEndTime(), DatePattern.NORM_DATE_PATTERN)),
|
||||
DatePattern.NORM_DATETIME_PATTERN
|
||||
);
|
||||
|
||||
// 获取监测点没有波形的事件信息
|
||||
List<CsEventPO> eventList = eventFeignClient.getEventByTime(param.getLineList(), beginDay, endDay).getData();
|
||||
if (CollUtil.isEmpty(eventList)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取装置信息,用于区分不同服务器
|
||||
List<String> deviceIds = eventList.stream()
|
||||
.map(CsEventPO::getDeviceId)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (CollUtil.isEmpty(deviceIds)) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<CsEquipmentDeliveryPO> equipmentList = csEquipmentDeliveryService.listByIds(deviceIds);
|
||||
if (CollUtil.isEmpty(equipmentList)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, List<CsEquipmentDeliveryPO>> nodeToDeviceMap = equipmentList.stream()
|
||||
.collect(Collectors.groupingBy(CsEquipmentDeliveryPO::getNodeId));
|
||||
|
||||
// 构建 deviceId -> CsEventPO 映射,避免重复 filter
|
||||
Map<String, List<CsEventPO>> deviceToEventMap = eventList.stream()
|
||||
.filter(event -> event.getDeviceId() != null)
|
||||
.collect(Collectors.groupingBy(CsEventPO::getDeviceId));
|
||||
|
||||
nodeToDeviceMap.forEach((nodeId, deviceList) -> {
|
||||
List<BZEventMessage.Event> msgList = new ArrayList<>();
|
||||
List<CsTerminalLogs> logList = new ArrayList<>();
|
||||
List<CsTerminalReply> replyList = new ArrayList<>();
|
||||
|
||||
for (CsEquipmentDeliveryPO device : deviceList) {
|
||||
String deviceId = device.getId();
|
||||
List<CsEventPO> eventsForDevice = deviceToEventMap.getOrDefault(deviceId, Collections.emptyList());
|
||||
|
||||
Map<String, List<CsEventPO>> lineToEventMap = eventsForDevice.stream()
|
||||
.filter(event -> event.getLineId() != null)
|
||||
.collect(Collectors.groupingBy(CsEventPO::getLineId));
|
||||
|
||||
lineToEventMap.forEach((lineId, eventGroup) -> {
|
||||
BZEventMessage.Event event = new BZEventMessage.Event();
|
||||
String guid = IdUtil.simpleUUID();
|
||||
event.setGuid(guid);
|
||||
event.setTerminalId(deviceId);
|
||||
event.setMonitorIdList(Collections.singletonList(lineId));
|
||||
event.setDataType(2);
|
||||
|
||||
List<String> timeList = eventGroup.stream()
|
||||
.map(CsEventPO::getStartTime)
|
||||
.filter(Objects::nonNull)
|
||||
.map(dt -> dt.format(microsecondFormatter))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
event.setTimeInterval(timeList);
|
||||
msgList.add(event);
|
||||
|
||||
// 记录发送日志
|
||||
CsTerminalLogs log = new CsTerminalLogs();
|
||||
log.setId(guid);
|
||||
log.setDeviceId(deviceId);
|
||||
log.setLineId(lineId);
|
||||
log.setOperateType(3);
|
||||
log.setNodeId(device.getNodeId());
|
||||
log.setNodeProcess(device.getNodeProcess());
|
||||
log.setIsPush(1);
|
||||
logList.add(log);
|
||||
|
||||
// 记录响应日志
|
||||
CsTerminalReply reply = new CsTerminalReply();
|
||||
reply.setId(IdUtil.simpleUUID());
|
||||
reply.setReplyId(guid);
|
||||
reply.setNodeId(device.getNodeId());
|
||||
reply.setProcessNo(device.getNodeProcess());
|
||||
reply.setDeviceId(deviceId);
|
||||
reply.setLineId(lineId);
|
||||
reply.setIsReceived(0);
|
||||
reply.setCode("allFile");
|
||||
replyList.add(reply);
|
||||
});
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(logList)) {
|
||||
csTerminalLogsService.saveBatch(logList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(replyList)) {
|
||||
csTerminalReplyService.saveBatch(replyList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(msgList)) {
|
||||
bzEventMessageTemplate.sendMember(msgList, nodeId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -257,7 +584,7 @@ class IcdServiceImpl implements IcdService {
|
||||
&& ObjectUtil.isNull(param.getDevIndex());
|
||||
}
|
||||
|
||||
private void handleFullProcessCreation(@NotNull IcdLedgerParam param) {
|
||||
public void handleFullProcessCreation(@NotNull IcdLedgerParam param) {
|
||||
if (ObjectUtil.isNotNull(param.getEngineering())) {
|
||||
CsEngineeringPO po1 = csEngineeringService.addEngineering(param.getEngineering());
|
||||
param.setEngineeringIndex(po1.getId());
|
||||
@@ -265,15 +592,15 @@ class IcdServiceImpl implements IcdService {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleFromEngineeringCreation(IcdLedgerParam param) {
|
||||
public void handleFromEngineeringCreation(IcdLedgerParam param) {
|
||||
createProjectAndDevices(param);
|
||||
}
|
||||
|
||||
private void handleFromProjectCreation(IcdLedgerParam param) {
|
||||
public void handleFromProjectCreation(IcdLedgerParam param) {
|
||||
saveDevicesAndLines(param);
|
||||
}
|
||||
|
||||
private void handleFromDeviceCreation(IcdLedgerParam param) {
|
||||
public void handleFromDeviceCreation(IcdLedgerParam param) {
|
||||
saveLines(param);
|
||||
}
|
||||
|
||||
@@ -306,8 +633,7 @@ class IcdServiceImpl implements IcdService {
|
||||
saveLines(param);
|
||||
}
|
||||
|
||||
private void saveLines(IcdLedgerParam param) {
|
||||
List<CsLinePO> list = new ArrayList<>();
|
||||
public void saveLines(IcdLedgerParam param) {
|
||||
List<CsLineParam> lineList = param.getLine();
|
||||
if (CollectionUtil.isNotEmpty(lineList)) {
|
||||
boolean result = checkAndAlertDuplicates(lineList);
|
||||
@@ -329,7 +655,10 @@ class IcdServiceImpl implements IcdService {
|
||||
line.setDevId(param.getDevIndex());
|
||||
}
|
||||
CsLinePO po = csLinePOService.addCldLine(line);
|
||||
list.add(po);
|
||||
//新增监测点限值
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(line.getVolGrade().floatValue(), line.getProtocolCapacity().floatValue(),line.getDevCapacity().floatValue(),line.getShortCircuitCapacity().floatValue(),0,0);
|
||||
overlimit.setId(po.getLineId());
|
||||
overLimitWlMapper.insert(overlimit);
|
||||
}
|
||||
|
||||
//新增台账日志
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
@@ -13,6 +14,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
||||
import com.njcn.csdevice.mapper.NodeMapper;
|
||||
import com.njcn.csdevice.param.IcdNodeParam;
|
||||
import com.njcn.csdevice.pojo.param.NodeParam;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.po.Node;
|
||||
@@ -20,6 +22,8 @@ import com.njcn.csdevice.pojo.vo.NodeProcessDeviceVo;
|
||||
import com.njcn.csdevice.service.INodeService;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.mq.message.CldControlMessage;
|
||||
import com.njcn.mq.template.CldControlMessageTemplate;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -28,6 +32,7 @@ import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -46,6 +51,7 @@ import java.util.stream.Collectors;
|
||||
public class NodeServiceImpl extends ServiceImpl<NodeMapper, Node> implements INodeService {
|
||||
|
||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||
private final CldControlMessageTemplate controlMessageTemplate;
|
||||
|
||||
@Override
|
||||
public boolean addNode(NodeParam nodeParam) {
|
||||
@@ -165,6 +171,84 @@ public class NodeServiceImpl extends ServiceImpl<NodeMapper, Node> implements IN
|
||||
return nodeProcessDeviceVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restartProcess(String nodeId, Integer processNo) {
|
||||
Node node = getNodeById(nodeId);
|
||||
CldControlMessage cldControlMessage = new CldControlMessage();
|
||||
cldControlMessage.setGuid(IdUtil.simpleUUID());
|
||||
cldControlMessage.setCode("set_process");
|
||||
cldControlMessage.setNodeId(nodeId);
|
||||
cldControlMessage.setProcessNo(processNo);
|
||||
cldControlMessage.setFun("delete");
|
||||
cldControlMessage.setProcessNum(node.getMaxProcessNum());
|
||||
controlMessageTemplate.sendMember(cldControlMessage,nodeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String updateDevProcessNo(String id, Integer processNo) {
|
||||
String result;
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(CsEquipmentDeliveryPO::getId,id);
|
||||
CsEquipmentDeliveryPO po = csEquipmentDeliveryMapper.selectOne(wrapper);
|
||||
if (Objects.equals(po.getNodeProcess(),processNo)) {
|
||||
return "修改进程号前后一致,暂不调整";
|
||||
}
|
||||
int oldProcessNo = po.getNodeProcess();
|
||||
po.setNodeProcess(processNo);
|
||||
int count = csEquipmentDeliveryMapper.updateById(po);
|
||||
if (count > 0) {
|
||||
result = "修改成功";
|
||||
//重启前置机进程(两个)
|
||||
//原来的
|
||||
restartProcess(po.getNodeId(), oldProcessNo);
|
||||
//修改后的
|
||||
restartProcess(po.getNodeId(), processNo);
|
||||
} else {
|
||||
result = "修改失败";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String updateDevNode(IcdNodeParam param) {
|
||||
String result;
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(CsEquipmentDeliveryPO::getId,param.getId());
|
||||
CsEquipmentDeliveryPO po = csEquipmentDeliveryMapper.selectOne(wrapper);
|
||||
if (Objects.equals(po.getNodeId(),param.getNodeId()) && Objects.equals(po.getNodeProcess(),param.getProcessNo())) {
|
||||
return "前置机修改前后一致,暂不调整";
|
||||
}
|
||||
Node node = getNodeById(param.getNodeId());
|
||||
List<CsEquipmentDeliveryPO> devList = getListByNodeId(param.getNodeId());
|
||||
if (ObjectUtil.isNotEmpty(devList) && devList.size() >= node.getNodeDevNum()) {
|
||||
throw new BusinessException (AlgorithmResponseEnum.OVER_MAX_DEV_COUNT);
|
||||
}
|
||||
|
||||
int oldProcessNo = po.getNodeProcess();
|
||||
po.setNodeId(param.getNodeId());
|
||||
po.setNodeProcess(param.getProcessNo());
|
||||
int count = csEquipmentDeliveryMapper.updateById(po);
|
||||
if (count > 0) {
|
||||
result = "修改成功";
|
||||
//重启前置机进程(两个)
|
||||
//原来的
|
||||
restartProcess(po.getNodeId(), oldProcessNo);
|
||||
//修改后的
|
||||
restartProcess(param.getNodeId(), param.getProcessNo());
|
||||
} else {
|
||||
result = "修改失败";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//根据前置机id获取装置数量
|
||||
public List<CsEquipmentDeliveryPO> getListByNodeId(String nodeId) {
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getNodeId,nodeId)
|
||||
.in(CsEquipmentDeliveryPO::getRunStatus, Arrays.asList(1,2));
|
||||
return csEquipmentDeliveryMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数,检查是否存在相同编码的字典类型
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.pojo.vo.LineOverLimitVO;
|
||||
import com.njcn.csdevice.service.IOverLimitService;
|
||||
import com.njcn.device.biz.mapper.OverLimitWlMapper;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/6/7
|
||||
*/
|
||||
@DS("sjzx")
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class OverLimitServiceImpl extends ServiceImpl<OverLimitWlMapper, Overlimit> implements IOverLimitService {
|
||||
|
||||
|
||||
@Override
|
||||
public Overlimit getOverLimitDataById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LineOverLimitVO getLineOverLimitDataById(String id) {
|
||||
//根据监测点id查询所在监测点的限值表数据
|
||||
Overlimit overlimit = this.baseMapper.selectById(id);
|
||||
LineOverLimitVO lineOverLimitVO = new LineOverLimitVO();
|
||||
BeanUtil.copyProperties(overlimit, lineOverLimitVO);
|
||||
lineOverLimitVO.setOddHarm(overlimit.getUharm3());
|
||||
lineOverLimitVO.setEvenHarm(overlimit.getUharm2());
|
||||
lineOverLimitVO.setInUharm(overlimit.getInuharm1());
|
||||
lineOverLimitVO.setInUharm16(overlimit.getInuharm16());
|
||||
return lineOverLimitVO;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/10/22 14:14【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface OverlimitService extends IService<Overlimit>{
|
||||
|
||||
|
||||
}
|
||||
@@ -6,11 +6,11 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||
import com.njcn.csdevice.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.csdevice.service.CsEquipmentDeliveryService;
|
||||
import com.njcn.csdevice.service.IRStatIntegrityDService;
|
||||
import com.njcn.csdevice.util.TimeUtil;
|
||||
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
||||
@@ -42,15 +42,21 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class RStatIntegrityDServiceImpl extends MppServiceImpl<RStatIntegrityDMapper, RStatIntegrityD> implements IRStatIntegrityDService {
|
||||
|
||||
private final EquipmentFeignClient equipmentFeignClient;
|
||||
private final CsLineFeignClient csLineFeignClient;
|
||||
private final CommonService commonService;
|
||||
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
||||
|
||||
@Override
|
||||
public void addData(StatisticsDataParam param) {
|
||||
List<RStatIntegrityD> result = new ArrayList<>();
|
||||
//获取库中正常的所有装置
|
||||
List<CsEquipmentDeliveryPO> devList = equipmentFeignClient.getAll().getData();
|
||||
List<CsEquipmentDeliveryPO> devList;
|
||||
//判断是否指定设备补招
|
||||
if (CollectionUtil.isNotEmpty(param.getIdList())) {
|
||||
devList = csEquipmentDeliveryService.getListByIds(param.getIdList());
|
||||
} else {
|
||||
//获取库中正常的所有装置
|
||||
devList = csEquipmentDeliveryService.getAll();
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(devList)) {
|
||||
Map<String, CsEquipmentDeliveryPO> devMap = devList.stream().collect(Collectors.toMap(CsEquipmentDeliveryPO::getId, Function.identity()));
|
||||
//获取所有监测点
|
||||
|
||||
@@ -6,16 +6,15 @@ import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||
import com.njcn.csdevice.mapper.RStatOnlineRateDMapper;
|
||||
import com.njcn.csdevice.param.LineCountEvaluateParam;
|
||||
import com.njcn.csdevice.pojo.dto.PqsCommunicateDto;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.po.RStatOnlineRateD;
|
||||
import com.njcn.csdevice.service.CsEquipmentDeliveryService;
|
||||
import com.njcn.csdevice.service.ICsCommunicateService;
|
||||
import com.njcn.csdevice.service.IRStatOnlineRateDService;
|
||||
import com.njcn.csdevice.util.TimeUtil;
|
||||
import com.njcn.csharmonic.param.DataParam;
|
||||
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
||||
import com.njcn.influx.deprecated.InfluxDBPublicParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -25,7 +24,6 @@ import org.springframework.stereotype.Service;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
@@ -46,14 +44,24 @@ import java.util.List;
|
||||
public class RStatOnlineRateDServiceImpl extends MppServiceImpl<RStatOnlineRateDMapper, RStatOnlineRateD> implements IRStatOnlineRateDService {
|
||||
|
||||
private final Integer online = 1;
|
||||
private final EquipmentFeignClient equipmentFeignClient;
|
||||
private final ICsCommunicateService pqsCommunicateService;
|
||||
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
||||
|
||||
@Override
|
||||
public void addData(StatisticsDataParam param) {
|
||||
List<RStatOnlineRateD> list = new ArrayList<>();
|
||||
//获取库中正常的所有装置
|
||||
List<CsEquipmentDeliveryPO> devList = equipmentFeignClient.getAll().getData();
|
||||
List<CsEquipmentDeliveryPO> devList;
|
||||
//判断是否指定设备补招
|
||||
if (CollectionUtil.isNotEmpty(param.getIdList())) {
|
||||
devList = csEquipmentDeliveryService.getListByIds(param.getIdList());
|
||||
} else {
|
||||
//获取库中正常的所有装置
|
||||
devList = csEquipmentDeliveryService.getAll();
|
||||
}
|
||||
if (CollectionUtil.isEmpty(devList)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(devList)) {
|
||||
//获取需要计算的时间
|
||||
List<String> dateRange = TimeUtil.getDateRangeAsString(param.getStartTime(), param.getEndTime());
|
||||
@@ -190,6 +198,8 @@ public class RStatOnlineRateDServiceImpl extends MppServiceImpl<RStatOnlineRateD
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else {
|
||||
minute = InfluxDBPublicParam.DAY_MINUTE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
||||
QueryWrapper<CsLedger> csLedgerQueryWrapper = new QueryWrapper<>();
|
||||
|
||||
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();
|
||||
csEngineeringUserPOQueryWrapper.clear();
|
||||
csLedgerQueryWrapper.clear();
|
||||
@@ -61,26 +61,24 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
||||
});
|
||||
List<CsDeviceUserPO> csDeviceUserPOS = csDeviceUserPOMapper.selectList(csDeviceUserPOQueryWrapper);
|
||||
List<String> collect1 = csDeviceUserPOS.stream().map(CsDeviceUserPO::getDeviceId).distinct().collect(Collectors.toList());
|
||||
if(CollectionUtils.isEmpty(collect1)){
|
||||
return collect;
|
||||
}else{
|
||||
csLedgerQueryWrapper.in("id",collect1).eq("level",2);
|
||||
if (!CollectionUtils.isEmpty(collect1)) {
|
||||
csLedgerQueryWrapper.in("id", collect1).eq("level", 2);
|
||||
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
||||
List<String> collect2 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList());
|
||||
csLedgerQueryWrapper.clear();
|
||||
if(CollectionUtils.isEmpty(collect2)){
|
||||
if (CollectionUtils.isEmpty(collect2)) {
|
||||
return collect;
|
||||
}
|
||||
csLedgerQueryWrapper.in("id",collect2).eq("level",1);
|
||||
csLedgerQueryWrapper.in("id", collect2).eq("level", 1);
|
||||
csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
||||
List<String> collect3 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList());
|
||||
if(CollectionUtils.isEmpty(collect3)){
|
||||
return collect;
|
||||
if (CollectionUtils.isEmpty(collect3)) {
|
||||
return collect;
|
||||
}
|
||||
collect.addAll(collect3);
|
||||
collect = collect.stream().distinct().collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
return collect;
|
||||
|
||||
} else if ( Objects.equals(role,AppRoleEnum.MARKET_USER.getCode())||
|
||||
Objects.equals(role, AppRoleEnum.ENGINEERING_USER.getCode())) {
|
||||
@@ -94,7 +92,9 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
||||
List<CsTouristDataPO> csTouristDataPOS = csTouristDataPOMapper.selectList(null);
|
||||
collect = csTouristDataPOS.stream().map(CsTouristDataPO::getEnginerId).distinct().collect(Collectors.toList());
|
||||
|
||||
}else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode())||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()) || Objects.equals(role,AppRoleEnum.REGULAR_USER.getCode()) ){
|
||||
List<CsEngineeringPO> csEngineeringPOS = csEngineeringMapper.selectList(null);
|
||||
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<>();
|
||||
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.eq("status","1").and(wq -> {
|
||||
wq.eq("primary_user_id", userIndex)
|
||||
@@ -196,7 +196,9 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
||||
List<CsTouristDataPO> csTouristDataPOS = csTouristDataPOMapper.selectList(null);
|
||||
collect = csTouristDataPOS.stream().map(CsTouristDataPO::getDeviceId).distinct().collect(Collectors.toList());
|
||||
|
||||
}else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode())||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()) || Objects.equals(role,AppRoleEnum.REGULAR_USER.getCode())){
|
||||
csLedgerQueryWrapper.clear();
|
||||
csLedgerQueryWrapper.eq("level",2).eq("state",1);
|
||||
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
||||
|
||||
@@ -18,8 +18,6 @@ import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||
import com.njcn.csdevice.constant.DataParam;
|
||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||
import com.njcn.csdevice.mapper.CsDataSetMapper;
|
||||
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
||||
import com.njcn.csdevice.mapper.CsLinePOMapper;
|
||||
import com.njcn.csdevice.mapper.WlRecordMapper;
|
||||
import com.njcn.csdevice.param.WlRecordPageParam;
|
||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||
@@ -30,11 +28,10 @@ import com.njcn.csdevice.pojo.po.WlRecord;
|
||||
import com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo;
|
||||
import com.njcn.csdevice.pojo.vo.RecordTreeVo;
|
||||
import com.njcn.csdevice.pojo.vo.RecordVo;
|
||||
import com.njcn.csdevice.service.IOverLimitService;
|
||||
import com.njcn.csdevice.service.IWlRecordService;
|
||||
import com.njcn.csdevice.util.InfluxDbParamUtil;
|
||||
import com.njcn.csdevice.utils.DataChangeUtil;
|
||||
import com.njcn.csdevice.utils.StringUtil;
|
||||
import com.njcn.csharmonic.constant.HarmonicConstant;
|
||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
@@ -62,7 +59,6 @@ import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -93,10 +89,7 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
||||
|
||||
private final InfluxDbParamUtil influxDbParamUtil;
|
||||
|
||||
private final CsLinePOMapper csLinePOMapper;
|
||||
|
||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||
private final OverlimitService overlimitService;
|
||||
private final IOverLimitService overlimitService;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final DecimalFormat df = new DecimalFormat(DataParam.DecimalFormatStr);
|
||||
|
||||
@@ -53,7 +53,7 @@ public class InfluxDbParamUtil {
|
||||
//如果是云前置设备,直接返回clDid
|
||||
boolean isCLdDevice = DicDataEnum.DEV_CLD.getCode().equals(dictTreeFeignClient.queryById(csEquipmentDeliveryDTOList.get(0).getDevType()).getData().getCode());
|
||||
if(isCLdDevice){
|
||||
// return String.valueOf(finalCsLinePOList.get(0).getLineNo());
|
||||
return String.valueOf(finalCsLinePOList.get(0).getLineNo());
|
||||
}
|
||||
//之后的逻辑还是按照原来的不变
|
||||
String position = csLineFeignClient.getPositionById(lineId).getData();
|
||||
|
||||
@@ -51,6 +51,17 @@
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-oss</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-poi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.njcn.csharmonic.annotaion;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface HarCurrent {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.njcn.csharmonic.annotaion;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface HarVoltage {
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user