Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
@@ -35,12 +35,6 @@
|
|||||||
<artifactId>common-microservice</artifactId>
|
<artifactId>common-microservice</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<artifactId>cs-warn-api</artifactId>
|
|
||||||
<version>1.0.0</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>user-api</artifactId>
|
<artifactId>user-api</artifactId>
|
||||||
@@ -59,6 +53,12 @@
|
|||||||
<artifactId>common-device-biz</artifactId>
|
<artifactId>common-device-biz</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.afterturn</groupId>
|
||||||
|
<artifactId>easypoi-base</artifactId>
|
||||||
|
<version>4.4.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|||||||
@@ -22,4 +22,13 @@ public interface CsCommTerminalFeignClient {
|
|||||||
|
|
||||||
@GetMapping("lineUnitDetail")
|
@GetMapping("lineUnitDetail")
|
||||||
HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId);
|
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.constant.ServerInfo;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.fallback.CsDeviceUserClientFallbackFactory;
|
import com.njcn.csdevice.api.fallback.CsDeviceUserClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -22,4 +23,10 @@ public interface CsDeviceUserFeignClient {
|
|||||||
|
|
||||||
@PostMapping("/findUserById")
|
@PostMapping("/findUserById")
|
||||||
HttpResult<List<String>> findUserById(@RequestParam("id") String id);
|
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;
|
package com.njcn.csdevice.api;
|
||||||
|
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
|
||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
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.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
|
||||||
import com.njcn.csdevice.api.fallback.CsLedgerFeignClientFallbackFactory;
|
import com.njcn.csdevice.api.fallback.CsLedgerFeignClientFallbackFactory;
|
||||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||||
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
||||||
import com.njcn.csdevice.pojo.param.CsLedgerParam;
|
import com.njcn.csdevice.pojo.param.CsLedgerParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||||
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -47,5 +42,15 @@ public interface CsLedgerFeignClient {
|
|||||||
@PostMapping("/getAllLedger")
|
@PostMapping("/getAllLedger")
|
||||||
HttpResult<List<CsLedgerVO>> 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,10 +1,16 @@
|
|||||||
package com.njcn.csdevice.api;
|
package com.njcn.csdevice.api;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
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.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.csdevice.api.fallback.CsLineClientFallbackFactory;
|
import com.njcn.csdevice.api.fallback.CsLineClientFallbackFactory;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -48,4 +54,21 @@ public interface CsLineFeignClient {
|
|||||||
|
|
||||||
@PostMapping("/updateLineDataByList")
|
@PostMapping("/updateLineDataByList")
|
||||||
HttpResult<String> updateDataByList(@RequestParam("list") List<String> list, @RequestParam("id") String id, @RequestParam("setId") String setId);
|
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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,12 @@ package com.njcn.csdevice.api;
|
|||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.fallback.CsTerminalReplyClientFallbackFactory;
|
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.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author xy
|
* @author xy
|
||||||
@@ -15,6 +18,13 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
public interface CsTerminalReplyFeignClient {
|
public interface CsTerminalReplyFeignClient {
|
||||||
|
|
||||||
@PostMapping("/updateData")
|
@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 lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author xy
|
* @author xy
|
||||||
*/
|
*/
|
||||||
@@ -31,6 +33,24 @@ public class CsCommTerminalFeignClientFallbackFactory implements FallbackFactory
|
|||||||
log.error("{}异常,降级处理,异常为:{}","查询分组",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","查询分组",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
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.exception.BusinessException;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.CsDeviceUserFeignClient;
|
import com.njcn.csdevice.api.CsDeviceUserFeignClient;
|
||||||
|
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -38,6 +39,18 @@ public class CsDeviceUserClientFallbackFactory implements FallbackFactory<CsDevi
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
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());
|
log.error("{}异常,降级处理,异常为:{}","获取台账树所有数据",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
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,6 +6,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -86,6 +87,35 @@ public class CsLineClientFallbackFactory implements FallbackFactory<CsLineFeignC
|
|||||||
log.error("{}异常,降级处理,异常为:{}","根据装置集合修改监测点信息",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","根据装置集合修改监测点信息",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
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);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.CsTerminalReplyFeignClient;
|
import com.njcn.csdevice.api.CsTerminalReplyFeignClient;
|
||||||
|
import com.njcn.csdevice.param.IcdBzReplyParam;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -23,9 +24,16 @@ public class CsTerminalReplyClientFallbackFactory implements FallbackFactory<CsT
|
|||||||
}
|
}
|
||||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
return new CsTerminalReplyFeignClient() {
|
return new CsTerminalReplyFeignClient() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<String> updateData(String id, Integer state, String deviceId) {
|
public HttpResult<String> updateData(IcdBzReplyParam param) {
|
||||||
log.error("{}异常,降级处理,异常为:{}","更新推送结果",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","更新推送结果异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> updateBzData(IcdBzReplyParam param) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","更新补召推送结果异常",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
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 GOVERNANCE_SYSTEM = "治理系统";
|
||||||
|
|
||||||
String cldDev = "云前置设备";
|
String cldDev = "在线设备";
|
||||||
|
|
||||||
String EvtParamPhase = "Evt_Param_Phase";
|
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;
|
||||||
|
}
|
||||||
@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -53,21 +55,25 @@ public class CsLineParam extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* PT一次变比
|
* PT一次变比
|
||||||
*/
|
*/
|
||||||
|
@Min(value = 1, message = "PT一次变比必须大于等于1")
|
||||||
private Double ptRatio;
|
private Double ptRatio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PT二次变比
|
* PT二次变比
|
||||||
*/
|
*/
|
||||||
|
@Min(value = 1, message = "PT二次变比必须大于等于1")
|
||||||
private Double pt2Ratio;
|
private Double pt2Ratio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CT一次变比
|
* CT一次变比
|
||||||
*/
|
*/
|
||||||
|
@Min(value = 1, message = "CT一次变比必须大于等于1")
|
||||||
private Double ctRatio;
|
private Double ctRatio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CT二次变比
|
* CT二次变比
|
||||||
*/
|
*/
|
||||||
|
@Min(value = 1, message = "CT二次变比必须大于等于1")
|
||||||
private Double ct2Ratio;
|
private Double ct2Ratio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -99,4 +105,27 @@ public class CsLineParam extends BaseEntity {
|
|||||||
* 运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)
|
* 运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)
|
||||||
*/
|
*/
|
||||||
private Integer runStatus;
|
private Integer runStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短路容量
|
||||||
|
*/
|
||||||
|
private Integer shortCircuitCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备容量
|
||||||
|
*/
|
||||||
|
private Integer devCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基准容量
|
||||||
|
*/
|
||||||
|
private Integer basicCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议容量
|
||||||
|
*/
|
||||||
|
private Integer protocolCapacity;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -122,4 +122,23 @@ public class CsLinePO extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
@TableField(value = "line_no")
|
@TableField(value = "line_no")
|
||||||
private Integer lineNo;
|
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 = "report_file_path")
|
||||||
|
private String reportFilePath;
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@@ -34,6 +32,16 @@ public class CsTerminalLogs extends BaseEntity implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String deviceId;
|
private String deviceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点id
|
||||||
|
*/
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 前置服务器id
|
* 前置服务器id
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -48,14 +48,34 @@ public class CsTerminalReply extends BaseEntity implements Serializable {
|
|||||||
private Integer processNo;
|
private Integer processNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备id集合
|
* 设备id
|
||||||
*/
|
*/
|
||||||
private String deviceId;
|
private String deviceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点id
|
||||||
|
*/
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否收到(0:未收到 1:收到)
|
* 是否收到(0:未收到 1:收到)
|
||||||
*/
|
*/
|
||||||
private Integer isReceived;
|
private Integer isReceived;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收消息状态码
|
||||||
|
*/
|
||||||
|
private Integer receivedCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收消息描述
|
||||||
|
*/
|
||||||
|
private String receivedMsg;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,6 +61,12 @@ public class DataGroupEventVO {
|
|||||||
@ApiModelProperty("暂降幅值")
|
@ApiModelProperty("暂降幅值")
|
||||||
private Float featureAmplitude;
|
private Float featureAmplitude;
|
||||||
|
|
||||||
|
@ApiModelProperty("映射数据库暂降幅值")
|
||||||
|
private Double amplitude;
|
||||||
|
|
||||||
|
@ApiModelProperty("严重度")
|
||||||
|
private String severity;
|
||||||
|
|
||||||
@ApiModelProperty("波形路径")
|
@ApiModelProperty("波形路径")
|
||||||
private String wavePath;
|
private String wavePath;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.njcn.csdevice.pojo.vo;
|
package com.njcn.csdevice.pojo.vo;
|
||||||
|
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -88,11 +88,6 @@
|
|||||||
<artifactId>hutool-all</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
<version>5.8.5</version>
|
<version>5.8.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<artifactId>cs-warn-api</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- zxing生成二维码 -->
|
<!-- zxing生成二维码 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -153,12 +148,21 @@
|
|||||||
<artifactId>access-api</artifactId>
|
<artifactId>access-api</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>common-mq</artifactId>
|
<artifactId>common-mq</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<scope>compile</scope>
|
</dependency>
|
||||||
</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>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -12,7 +12,11 @@ import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
|||||||
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
||||||
import com.njcn.csdevice.service.ICsGroupService;
|
import com.njcn.csdevice.service.ICsGroupService;
|
||||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
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.ThdDataTdVO;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -21,9 +25,11 @@ import io.swagger.annotations.ApiImplicitParams;
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -143,5 +149,39 @@ public class CsGroupController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
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.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.csdevice.enums.DeviceOperate;
|
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.po.CsDeviceUserPO;
|
||||||
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
||||||
import com.njcn.csdevice.pojo.vo.DevUserVO;
|
import com.njcn.csdevice.pojo.vo.DevUserVO;
|
||||||
@@ -140,4 +141,24 @@ public class DeviceUserController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
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.ExcelExportUtil;
|
||||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
@@ -152,6 +153,9 @@ public class EquipmentDeliveryController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "ids", value = "设备id集合", required = true)
|
@ApiImplicitParam(name = "ids", value = "设备id集合", required = true)
|
||||||
public HttpResult<List<CsEquipmentDeliveryDTO>> queryEquipmentById(@RequestParam List<String> ids){
|
public HttpResult<List<CsEquipmentDeliveryDTO>> queryEquipmentById(@RequestParam List<String> ids){
|
||||||
String methodDescribe = getMethodDescribe("queryEquipmentById");
|
String methodDescribe = getMethodDescribe("queryEquipmentById");
|
||||||
|
if (CollectionUtil.isEmpty(ids)) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryService.listByIds(ids);
|
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryService.listByIds(ids);
|
||||||
List<CsEquipmentDeliveryDTO> collect = csEquipmentDeliveryPOS.stream().map(temp -> {
|
List<CsEquipmentDeliveryDTO> collect = csEquipmentDeliveryPOS.stream().map(temp -> {
|
||||||
CsEquipmentDeliveryDTO csEquipmentDeliveryDTO = new CsEquipmentDeliveryDTO();
|
CsEquipmentDeliveryDTO csEquipmentDeliveryDTO = new CsEquipmentDeliveryDTO();
|
||||||
@@ -401,4 +405,14 @@ public class EquipmentDeliveryController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
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;
|
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.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
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.csdevice.service.ICsTerminalReplyService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -51,14 +54,30 @@ public class CsTerminalReplyController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/updateData")
|
@PostMapping("/updateData")
|
||||||
@ApiOperation("更新推送结果")
|
@ApiOperation("更新推送结果")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||||
@ApiImplicitParam(name = "id", value = "参数", required = true),
|
public HttpResult<String> updateData(@RequestBody @Validated IcdBzReplyParam param){
|
||||||
@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){
|
|
||||||
String methodDescribe = getMethodDescribe("updateData");
|
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);
|
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.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.param.IcdBzParam;
|
||||||
import com.njcn.csdevice.param.IcdLedgerParam;
|
import com.njcn.csdevice.param.IcdLedgerParam;
|
||||||
import com.njcn.csdevice.param.IcdParam;
|
import com.njcn.csdevice.param.IcdParam;
|
||||||
import com.njcn.csdevice.pojo.vo.CldLedgerVo;
|
import com.njcn.csdevice.pojo.vo.CldLedgerVo;
|
||||||
import com.njcn.csdevice.pojo.vo.DeviceInfo;
|
import com.njcn.csdevice.pojo.vo.DeviceInfo;
|
||||||
import com.njcn.csdevice.service.IcdService;
|
import com.njcn.csdevice.service.IcdService;
|
||||||
import com.njcn.mq.message.CldControlMessage;
|
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -66,12 +66,32 @@ public class IcdController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/restartProcess")
|
@PostMapping("/bzFileByEventId")
|
||||||
@ApiOperation("重启前置机进程")
|
@ApiOperation("指定事件补召波形")
|
||||||
@ApiImplicitParam(name = "message", value = "message", required = true)
|
@ApiImplicitParam(name = "eventId", value = "事件id", required = true)
|
||||||
public HttpResult<String> restartProcess(@RequestBody CldControlMessage message){
|
public HttpResult<String> bzFileByEventId(@RequestParam String eventId){
|
||||||
String methodDescribe = getMethodDescribe("restartProcess");
|
String methodDescribe = getMethodDescribe("bzFileByEventId");
|
||||||
icdService.restartProcess(message);
|
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);
|
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.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.param.IcdNodeParam;
|
||||||
import com.njcn.csdevice.pojo.param.NodeParam;
|
import com.njcn.csdevice.pojo.param.NodeParam;
|
||||||
import com.njcn.csdevice.pojo.po.Node;
|
import com.njcn.csdevice.pojo.po.Node;
|
||||||
import com.njcn.csdevice.pojo.vo.NodeProcessDeviceVo;
|
import com.njcn.csdevice.pojo.vo.NodeProcessDeviceVo;
|
||||||
@@ -174,5 +175,41 @@ public class NodeController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
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,24 @@
|
|||||||
package com.njcn.csdevice.controller.ledger;
|
package com.njcn.csdevice.controller.ledger;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
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.common.LogEnum;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.csdevice.mapper.PqsDeviceUnitMapper;
|
import com.njcn.csdevice.mapper.PqsDeviceUnitMapper;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
|
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.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 com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -17,7 +28,11 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
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.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,7 +49,89 @@ public class CsCommTerminalController extends BaseController {
|
|||||||
|
|
||||||
private final PqsDeviceUnitMapper pqsDeviceUnitMapper;
|
private final PqsDeviceUnitMapper pqsDeviceUnitMapper;
|
||||||
|
|
||||||
|
private final CsDeviceUserPOService csDeviceUserPOService;
|
||||||
|
|
||||||
|
private final CsLinePOService csLinePOService;
|
||||||
|
private final UserFeignClient userFeignClient;
|
||||||
|
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户获取设备信息
|
||||||
|
*/
|
||||||
|
@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 = 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> devIds = commGetDevIds(userId);
|
||||||
|
if(CollUtil.isNotEmpty(devIds)){
|
||||||
|
List<CsLinePO> poList = csLinePOService.lambdaQuery().select(CsLinePO::getLineId).in(CsLinePO::getDeviceId,devIds)
|
||||||
|
.eq(CsLinePO::getStatus,DataStateEnum.ENABLE.getCode()).list();
|
||||||
|
if(CollUtil.isEmpty(poList)){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Collections.emptyList(), methodDescribe);
|
||||||
|
}else {
|
||||||
|
List<String> result = poList.stream().map(CsLinePO::getLineId).distinct().collect(Collectors.toList());
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Collections.emptyList(), 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("getPqUserIdsByUser");
|
||||||
|
|
||||||
|
List<String> devIds = commGetDevIds(userId);
|
||||||
|
if(CollUtil.isNotEmpty(devIds)){
|
||||||
|
List<CsLinePO> poList = csLinePOService.lambdaQuery().select(CsLinePO::getLineId,CsLinePO::getMonitorUser).in(CsLinePO::getDeviceId,devIds)
|
||||||
|
.eq(CsLinePO::getStatus,DataStateEnum.ENABLE.getCode()).list();
|
||||||
|
if(CollUtil.isEmpty(poList)){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Collections.emptyList(), methodDescribe);
|
||||||
|
}else {
|
||||||
|
List<String> result = poList.stream().map(CsLinePO::getMonitorUser).distinct().collect(Collectors.toList());
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Collections.emptyList(), methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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 = 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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过监测点获取监测点数据单位
|
* 通过监测点获取监测点数据单位
|
||||||
|
|||||||
@@ -165,5 +165,35 @@ public class CsLedgerController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
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,6 +1,8 @@
|
|||||||
package com.njcn.csdevice.controller.line;
|
package com.njcn.csdevice.controller.line;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
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.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
@@ -9,19 +11,19 @@ import com.njcn.common.utils.HttpResultUtil;
|
|||||||
import com.njcn.csdevice.mapper.OverlimitMapper;
|
import com.njcn.csdevice.mapper.OverlimitMapper;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.PqSensitiveUserLineVO;
|
||||||
import com.njcn.csdevice.service.CsLinePOService;
|
import com.njcn.csdevice.service.CsLinePOService;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import com.njcn.device.biz.utils.COverlimitUtil;
|
import com.njcn.device.biz.utils.COverlimitUtil;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.*;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -136,12 +138,12 @@ public class CslineController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getOverLimitData")
|
@PostMapping("/getOverLimitDataByIds")
|
||||||
@ApiOperation("根据监测点id获取国标限值")
|
@ApiOperation("根据监测点id集合获取国标限值")
|
||||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
@ApiImplicitParam(name = "ids", value = "监测点id集合", required = true)
|
||||||
public HttpResult<Overlimit> getOverLimitData(@RequestParam("id") String id) {
|
public HttpResult<List<Overlimit>> getOverLimitData(@RequestBody List<String> ids) {
|
||||||
String methodDescribe = getMethodDescribe("getOverLimitData");
|
String methodDescribe = getMethodDescribe("getOverLimitDataByIds");
|
||||||
Overlimit result = overlimitMapper.selectById(id);
|
List<Overlimit> result = overlimitMapper.selectBatchIds(ids);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,4 +222,84 @@ public class CslineController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
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.list(new LambdaQueryWrapper<CsLinePO>()
|
||||||
|
.eq(CsLinePO::getStatus, 1)
|
||||||
|
.eq(StrUtil.isNotBlank(param.getPosition()), CsLinePO::getPosition, param.getPosition())
|
||||||
|
.orderByAsc(CsLinePO::getName));
|
||||||
|
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("getList");
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
|||||||
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
||||||
import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
||||||
import com.njcn.csdevice.pojo.po.CsEngineeringPO;
|
import com.njcn.csdevice.pojo.po.CsEngineeringPO;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
||||||
import com.njcn.csdevice.service.CsEngineeringService;
|
import com.njcn.csdevice.service.CsEngineeringService;
|
||||||
@@ -94,4 +95,14 @@ public class EngineeringController extends BaseController {
|
|||||||
CsEngineeringPO po = csEngineeringService.queryEngineeringById(id);
|
CsEngineeringPO po = csEngineeringService.queryEngineeringById(id);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package com.njcn.csdevice.mapper;
|
package com.njcn.csdevice.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
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.csdevice.pojo.po.CsTerminalReply;
|
||||||
|
import com.njcn.user.pojo.vo.RoleVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -13,4 +17,6 @@ import com.njcn.csdevice.pojo.po.CsTerminalReply;
|
|||||||
*/
|
*/
|
||||||
public interface CsTerminalReplyMapper extends BaseMapper<CsTerminalReply> {
|
public interface CsTerminalReplyMapper extends BaseMapper<CsTerminalReply> {
|
||||||
|
|
||||||
|
Page<CsTerminalReply> page(@Param("page")Page<RoleVO> page, @Param("ew") QueryWrapper<CsTerminalReply> queryWrapper);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
from
|
from
|
||||||
cs_equipment_delivery
|
cs_equipment_delivery
|
||||||
<where>
|
<where>
|
||||||
1=1
|
dev_access_method = 'MQTT'
|
||||||
<if test="queryParam.process != null and queryParam.process !=''">
|
<if test="queryParam.process != null and queryParam.process !=''">
|
||||||
and process = #{queryParam.process}
|
and process = #{queryParam.process}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.csdevice.service;
|
package com.njcn.csdevice.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
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.po.CsDeviceUserPO;
|
||||||
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
||||||
import com.njcn.csdevice.pojo.vo.DevUserVO;
|
import com.njcn.csdevice.pojo.vo.DevUserVO;
|
||||||
@@ -48,4 +49,8 @@ public interface CsDeviceUserPOService extends IService<CsDeviceUserPO>{
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<String> findUserById(String devId);
|
List<String> findUserById(String devId);
|
||||||
|
|
||||||
|
List<String> findDevByUserId(String userId);
|
||||||
|
|
||||||
|
void channelDevByUserId(UserDevParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,4 +57,6 @@ public interface CsEngineeringService extends IService<CsEngineeringPO>{
|
|||||||
List<CsEngineeringPO> getEngineerings(List<String> list);
|
List<CsEngineeringPO> getEngineerings(List<String> list);
|
||||||
|
|
||||||
CsEngineeringPO queryEngineeringById(String id);
|
CsEngineeringPO queryEngineeringById(String id);
|
||||||
|
|
||||||
|
List<CsEngineeringPO> getUnlinkedEngineering(String userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,6 +130,12 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
|||||||
*/
|
*/
|
||||||
List<CsEquipmentDeliveryPO> getAll();
|
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> getDataByNodeIdAndProcessNo(String nodeId, Integer processNo);
|
||||||
|
|
||||||
|
List<CsEquipmentDeliveryPO> getListByIds(List<String> devList);
|
||||||
|
|
||||||
|
List<CsEquipmentDeliveryPO> getRunPortableDev(String userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
package com.njcn.csdevice.service;
|
package com.njcn.csdevice.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
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.List;
|
||||||
|
|
||||||
@@ -63,4 +66,21 @@ public interface CsLinePOService extends IService<CsLinePO>{
|
|||||||
void updateCldLineStatus(List<CsLinePO> lineList, Integer status);
|
void updateCldLineStatus(List<CsLinePO> lineList, Integer status);
|
||||||
|
|
||||||
void updateLineDataByList(List<String> list, String id, String setId);
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,15 @@ import com.njcn.csdevice.pojo.po.CsGroup;
|
|||||||
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
||||||
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
||||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
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.ThdDataTdVO;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -78,4 +81,25 @@ public interface ICsGroupService extends IService<CsGroup> {
|
|||||||
*/
|
*/
|
||||||
void deleteGroup(String groupId);
|
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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,4 +85,11 @@ public interface ICsLedgerService extends IService<CsLedger> {
|
|||||||
List<CsLedgerVO> getProAndEngineer(List<String> id);
|
List<CsLedgerVO> getProAndEngineer(List<String> id);
|
||||||
|
|
||||||
CsLedgerVO cldTree();
|
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;
|
package com.njcn.csdevice.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
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.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;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -17,6 +23,12 @@ public interface ICsTerminalReplyService extends IService<CsTerminalReply> {
|
|||||||
|
|
||||||
List<String> queryReplyData();
|
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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ package com.njcn.csdevice.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
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.param.NodeParam;
|
||||||
import com.njcn.csdevice.pojo.po.Node;
|
import com.njcn.csdevice.pojo.po.Node;
|
||||||
import com.njcn.csdevice.pojo.vo.NodeProcessDeviceVo;
|
import com.njcn.csdevice.pojo.vo.NodeProcessDeviceVo;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -79,4 +81,10 @@ public interface INodeService extends IService<Node> {
|
|||||||
Node getNodeByIp(String ip);
|
Node getNodeByIp(String ip);
|
||||||
|
|
||||||
NodeProcessDeviceVo getProcessNoAndDeviceById(String id);
|
NodeProcessDeviceVo getProcessNoAndDeviceById(String id);
|
||||||
|
|
||||||
|
void restartProcess(String nodeId, Integer processNo);
|
||||||
|
|
||||||
|
String updateDevProcessNo(String id, Integer processNo);
|
||||||
|
|
||||||
|
String updateDevNode(IcdNodeParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package com.njcn.csdevice.service;
|
package com.njcn.csdevice.service;
|
||||||
|
|
||||||
|
import com.njcn.csdevice.param.IcdBzParam;
|
||||||
import com.njcn.csdevice.param.IcdLedgerParam;
|
import com.njcn.csdevice.param.IcdLedgerParam;
|
||||||
import com.njcn.csdevice.param.IcdParam;
|
import com.njcn.csdevice.param.IcdParam;
|
||||||
import com.njcn.csdevice.pojo.vo.CldLedgerVo;
|
import com.njcn.csdevice.pojo.vo.CldLedgerVo;
|
||||||
import com.njcn.csdevice.pojo.vo.DeviceInfo;
|
import com.njcn.csdevice.pojo.vo.DeviceInfo;
|
||||||
import com.njcn.mq.message.CldControlMessage;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -16,6 +16,10 @@ public interface IcdService {
|
|||||||
|
|
||||||
CldLedgerVo getLedgerById(String id);
|
CldLedgerVo getLedgerById(String id);
|
||||||
|
|
||||||
void restartProcess(CldControlMessage message);
|
void bzFileByEventId(String eventId);
|
||||||
|
|
||||||
|
void bzEvent(IcdBzParam param);
|
||||||
|
|
||||||
|
void bzFile(IcdBzParam param);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
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.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
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.CsDeviceUserPOMapper;
|
||||||
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
||||||
import com.njcn.csdevice.mapper.CsMarketDataMapper;
|
import com.njcn.csdevice.mapper.CsMarketDataMapper;
|
||||||
|
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||||
import com.njcn.csdevice.pojo.po.*;
|
import com.njcn.csdevice.pojo.po.*;
|
||||||
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
||||||
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
||||||
@@ -51,22 +51,17 @@ import static java.util.Objects.isNull;
|
|||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper, CsDeviceUserPO> implements CsDeviceUserPOService{
|
public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper, CsDeviceUserPO> implements CsDeviceUserPOService{
|
||||||
private final CsDevModelRelationService csDevModelRelationService;
|
|
||||||
|
|
||||||
|
private final CsDevModelRelationService csDevModelRelationService;
|
||||||
private final ICsLedgerService iCsLedgerService;
|
private final ICsLedgerService iCsLedgerService;
|
||||||
// private final CsEquipmentAlarmFeignClient csEquipmentAlarmFeignClient;
|
|
||||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||||
private final RoleEngineerDevService roleEngineerDevService;
|
private final RoleEngineerDevService roleEngineerDevService;
|
||||||
|
|
||||||
private final AppLineTopologyDiagramService appLineTopologyDiagramService;
|
private final AppLineTopologyDiagramService appLineTopologyDiagramService;
|
||||||
|
|
||||||
private final CsTouristDataPOService csTouristDataPOService;
|
private final CsTouristDataPOService csTouristDataPOService;
|
||||||
|
|
||||||
private final CsLinePOService csLinePOService;
|
private final CsLinePOService csLinePOService;
|
||||||
private final CsMarketDataMapper csMarketDataMapper;
|
private final CsMarketDataMapper csMarketDataMapper;
|
||||||
private final EventUserFeignClient eventUserFeignClient;
|
private final EventUserFeignClient eventUserFeignClient;
|
||||||
private final UserFeignClient userFeignClient;
|
private final UserFeignClient userFeignClient;
|
||||||
|
|
||||||
private final FeedBackFeignClient feedBackFeignClient;
|
private final FeedBackFeignClient feedBackFeignClient;
|
||||||
private final IMqttUserService mqttUserService;
|
private final IMqttUserService mqttUserService;
|
||||||
|
|
||||||
@@ -407,4 +402,22 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
|||||||
}
|
}
|
||||||
return result;
|
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,20 @@ package com.njcn.csdevice.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
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.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
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.enums.AlgorithmResponseEnum;
|
||||||
import com.njcn.csdevice.mapper.CsEngineeringMapper;
|
import com.njcn.csdevice.mapper.CsEngineeringMapper;
|
||||||
import com.njcn.csdevice.mapper.CsEngineeringUserMapper;
|
import com.njcn.csdevice.mapper.CsEngineeringUserMapper;
|
||||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||||
import com.njcn.csdevice.mapper.CsMarketDataMapper;
|
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.CsEngineeringAddParm;
|
||||||
import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
||||||
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
||||||
@@ -20,7 +23,6 @@ import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
|||||||
import com.njcn.csdevice.pojo.po.*;
|
import com.njcn.csdevice.pojo.po.*;
|
||||||
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
||||||
import com.njcn.csdevice.service.CsEngineeringService;
|
import com.njcn.csdevice.service.CsEngineeringService;
|
||||||
import com.njcn.csdevice.service.CsMarketDataService;
|
|
||||||
import com.njcn.csdevice.service.CsTouristDataPOService;
|
import com.njcn.csdevice.service.CsTouristDataPOService;
|
||||||
import com.njcn.redis.utils.RedisUtil;
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
import com.njcn.system.api.AreaFeignClient;
|
import com.njcn.system.api.AreaFeignClient;
|
||||||
@@ -34,10 +36,8 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.function.Function;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,12 +58,10 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
|||||||
private final CsLedgerMapper csLedgerMapper;
|
private final CsLedgerMapper csLedgerMapper;
|
||||||
private final CsEngineeringUserMapper csEngineeringUserMapper;
|
private final CsEngineeringUserMapper csEngineeringUserMapper;
|
||||||
private final RoleEngineerDevServiceImpl roleEngineerDevService;
|
private final RoleEngineerDevServiceImpl roleEngineerDevService;
|
||||||
|
|
||||||
private final CsMarketDataMapper csMarketDataMapper;
|
private final CsMarketDataMapper csMarketDataMapper;
|
||||||
private final CsTouristDataPOService csTouristDataPOService;
|
private final CsTouristDataPOService csTouristDataPOService;
|
||||||
|
private final CsLedgerFeignClient csLedgerFeignClient;
|
||||||
|
private final CsDeviceUserFeignClient csDeviceUserFeignClient;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
@@ -222,6 +220,45 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
|||||||
return this.lambdaQuery().eq(CsEngineeringPO::getId,id).eq(CsEngineeringPO::getStatus,"1").one();
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getAreaById(String id){
|
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.DicDataTypeEnum;
|
||||||
import com.njcn.system.enums.DicTreeEnum;
|
import com.njcn.system.enums.DicTreeEnum;
|
||||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||||
|
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||||
import com.njcn.user.enums.AppRoleEnum;
|
import com.njcn.user.enums.AppRoleEnum;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -428,6 +429,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
if (isCLdDevice) {
|
if (isCLdDevice) {
|
||||||
// 云前置数据集
|
// 云前置数据集
|
||||||
addDataSet(dataSetList, item, "实时数据", "realtimedata");
|
addDataSet(dataSetList, item, "实时数据", "realtimedata");
|
||||||
|
addDataSet(dataSetList, item, "暂态事件", "event");
|
||||||
}
|
}
|
||||||
deviceManagerVo.setDataLevel(item.getDataLevel());
|
deviceManagerVo.setDataLevel(item.getDataLevel());
|
||||||
}
|
}
|
||||||
@@ -706,6 +708,15 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
return this.lambdaQuery().ne(CsEquipmentDeliveryPO::getRunStatus,0).list();
|
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
|
@Override
|
||||||
public boolean judgeDevModel(String nDid) {
|
public boolean judgeDevModel(String nDid) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
@@ -816,23 +827,24 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
csTerminalLogs.setIsPush(0);
|
csTerminalLogs.setIsPush(0);
|
||||||
csTerminalLogs.setNodeId(one.getNodeId());
|
csTerminalLogs.setNodeId(one.getNodeId());
|
||||||
csTerminalLogs.setNodeProcess(one.getNodeProcess());
|
csTerminalLogs.setNodeProcess(one.getNodeProcess());
|
||||||
|
csTerminalLogs.setDeviceName(one.getName());
|
||||||
csTerminalLogsMapper.insert(csTerminalLogs);
|
csTerminalLogsMapper.insert(csTerminalLogs);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateCldDev(CsEquipmentDeliveryAuditParm param) {
|
public Boolean updateCldDev(CsEquipmentDeliveryAuditParm param) {
|
||||||
//云前置设备判断,修改云前置判断设备是否达到上限
|
// //云前置设备判断,修改云前置判断设备是否达到上限
|
||||||
if(ObjectUtil.isNotNull(param.getNodeId())){
|
// if(ObjectUtil.isNotNull(param.getNodeId())){
|
||||||
Node node = nodeService.getNodeById(param.getNodeId());
|
// Node node = nodeService.getNodeById(param.getNodeId());
|
||||||
List<CsEquipmentDeliveryPO> devList = getListByNodeId(param.getNodeId());
|
// List<CsEquipmentDeliveryPO> devList = getListByNodeId(param.getNodeId());
|
||||||
if (ObjectUtil.isNotEmpty(devList) && devList.size() >= node.getNodeDevNum()) {
|
// if (ObjectUtil.isNotEmpty(devList) && devList.size() >= node.getNodeDevNum()) {
|
||||||
throw new BusinessException (AlgorithmResponseEnum.OVER_MAX_DEV_COUNT);
|
// throw new BusinessException (AlgorithmResponseEnum.OVER_MAX_DEV_COUNT);
|
||||||
}
|
// }
|
||||||
//自动分配进程号
|
// //自动分配进程号
|
||||||
int process = findLeastFrequentProcess(devList,node.getMaxProcessNum());
|
// int process = findLeastFrequentProcess(devList,node.getMaxProcessNum());
|
||||||
param.setNodeProcess(process);
|
// param.setNodeProcess(process);
|
||||||
}
|
// }
|
||||||
StringUtil.containsSpecialCharacters(param.getNdid());
|
StringUtil.containsSpecialCharacters(param.getNdid());
|
||||||
boolean result;
|
boolean result;
|
||||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
@@ -969,6 +981,30 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
return this.list(lambdaQueryWrapper);
|
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.isNotNull(vo)) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//根据前置机id获取装置数量
|
//根据前置机id获取装置数量
|
||||||
public List<CsEquipmentDeliveryPO> getListByNodeId(String nodeId) {
|
public List<CsEquipmentDeliveryPO> getListByNodeId(String nodeId) {
|
||||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
package com.njcn.csdevice.service.impl;
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -31,8 +34,7 @@ import com.njcn.csdevice.util.InfluxDbParamUtil;
|
|||||||
import com.njcn.csdevice.utils.DataChangeUtil;
|
import com.njcn.csdevice.utils.DataChangeUtil;
|
||||||
import com.njcn.csharmonic.api.EventFeignClient;
|
import com.njcn.csharmonic.api.EventFeignClient;
|
||||||
import com.njcn.csharmonic.constant.HarmonicConstant;
|
import com.njcn.csharmonic.constant.HarmonicConstant;
|
||||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
import com.njcn.csharmonic.param.*;
|
||||||
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
@@ -41,10 +43,8 @@ import com.njcn.influx.pojo.dto.EventDataSetDTO;
|
|||||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||||
import com.njcn.influx.service.CommonService;
|
import com.njcn.influx.service.CommonService;
|
||||||
import com.njcn.influx.service.EvtDataService;
|
import com.njcn.influx.service.EvtDataService;
|
||||||
import com.njcn.system.api.CsStatisticalSetFeignClient;
|
import com.njcn.system.api.*;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import com.njcn.system.api.EleEvtFeignClient;
|
|
||||||
import com.njcn.system.api.EpdFeignClient;
|
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
import com.njcn.system.pojo.po.EleEvtParm;
|
import com.njcn.system.pojo.po.EleEvtParm;
|
||||||
import com.njcn.system.pojo.vo.CsStatisticalSetVO;
|
import com.njcn.system.pojo.vo.CsStatisticalSetVO;
|
||||||
@@ -59,6 +59,7 @@ import java.lang.reflect.Field;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
import java.time.Instant;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@@ -85,7 +86,6 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
private final EpdFeignClient epdFeignClient;
|
private final EpdFeignClient epdFeignClient;
|
||||||
private final CsLineFeignClient csLineFeignClient;
|
private final CsLineFeignClient csLineFeignClient;
|
||||||
private final ICsLedgerService iCsLedgerService;
|
private final ICsLedgerService iCsLedgerService;
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
|
||||||
private final EquipmentFeignClient equipmentFeignClient;
|
private final EquipmentFeignClient equipmentFeignClient;
|
||||||
private final CsStatisticalSetFeignClient csStatisticalSetFeignClient;
|
private final CsStatisticalSetFeignClient csStatisticalSetFeignClient;
|
||||||
private final EvtDataService evtDataService;
|
private final EvtDataService evtDataService;
|
||||||
@@ -95,6 +95,11 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
private final CsDataSetMapper csDataSetMapper;
|
private final CsDataSetMapper csDataSetMapper;
|
||||||
private final EventFeignClient eventFeignClient;
|
private final EventFeignClient eventFeignClient;
|
||||||
private final InfluxDbParamUtil influxDbParamUtil;
|
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
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -784,6 +789,387 @@ 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 = overlimitMapper.selectById(finalCsLinePO.getLineId());
|
||||||
|
JSONObject entries = JSONUtil.parseObj(overlimit);
|
||||||
|
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<>();
|
||||||
|
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();
|
||||||
|
queryParam.setFrequency(item.getFrequency());
|
||||||
|
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) {
|
private List<EnergyTemplateVO> getChildren(String tabId, List<EnergyTemplateVO> all) {
|
||||||
return all.stream().filter(item -> item.getPid().equals(tabId)).collect(Collectors.toList());
|
return all.stream().filter(item -> item.getPid().equals(tabId)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ import cn.hutool.core.bean.BeanUtil;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.constant.DataParam;
|
import com.njcn.csdevice.constant.DataParam;
|
||||||
|
import com.njcn.csdevice.controller.project.EngineeringController;
|
||||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||||
import com.njcn.csdevice.mapper.*;
|
import com.njcn.csdevice.mapper.*;
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
|
||||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||||
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
||||||
import com.njcn.csdevice.pojo.param.CsLedgerParam;
|
import com.njcn.csdevice.pojo.param.CsLedgerParam;
|
||||||
@@ -24,6 +24,8 @@ import com.njcn.system.api.DictTreeFeignClient;
|
|||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.system.pojo.po.Area;
|
import com.njcn.system.pojo.po.Area;
|
||||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||||
|
import com.njcn.user.enums.AppRoleEnum;
|
||||||
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -54,8 +56,9 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
private final CsDevModelRelationService csDevModelRelationService;
|
private final CsDevModelRelationService csDevModelRelationService;
|
||||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||||
private final ICsDataSetService csDataSetService;
|
private final ICsDataSetService csDataSetService;
|
||||||
private final EquipmentFeignClient equipmentFeignClient;
|
|
||||||
private final DictTreeFeignClient dictTreeFeignClient;
|
private final DictTreeFeignClient dictTreeFeignClient;
|
||||||
|
private final EngineeringController engineeringController;
|
||||||
|
private final CsDeviceUserPOMapper csDeviceUserPOMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CsLedgerVO> getLedgerTree() {
|
public List<CsLedgerVO> getLedgerTree() {
|
||||||
@@ -82,14 +85,14 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
//区分治理装置和云前置装置
|
//区分治理装置和云前置装置
|
||||||
List<String> zhiLianDevice = new ArrayList<>();
|
List<String> zhiLianDevice = new ArrayList<>();
|
||||||
List<String> cldDevice = new ArrayList<>();
|
List<String> cldDevice = new ArrayList<>();
|
||||||
List<CsEquipmentDeliveryDTO> csEquipmentDeliveryPOS = equipmentFeignClient.queryDeviceById(device).getData();
|
if (CollectionUtil.isNotEmpty(device)) {
|
||||||
if (CollectionUtil.isNotEmpty(csEquipmentDeliveryPOS)) {
|
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryMapper.selectBatchIds(device);
|
||||||
DictTreeVO vo1 = dictTreeFeignClient.queryByCode(DicDataEnum.DEV_CLD.getCode()).getData();
|
DictTreeVO vo1 = dictTreeFeignClient.queryByCode(DicDataEnum.DEV_CLD.getCode()).getData();
|
||||||
Optional.ofNullable(vo1)
|
Optional.ofNullable(vo1)
|
||||||
.map(DictTreeVO::getId)
|
.map(DictTreeVO::getId)
|
||||||
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
||||||
.filter(item -> Objects.equals(item.getDevType(), id))
|
.filter(item -> Objects.equals(item.getDevType(), id))
|
||||||
.map(CsEquipmentDeliveryDTO::getId)
|
.map(CsEquipmentDeliveryPO::getId)
|
||||||
.forEach(cldDevice::add)
|
.forEach(cldDevice::add)
|
||||||
);
|
);
|
||||||
DictTreeVO vo2 = dictTreeFeignClient.queryByCode(DicDataEnum.CONNECT_DEV.getCode()).getData();
|
DictTreeVO vo2 = dictTreeFeignClient.queryByCode(DicDataEnum.CONNECT_DEV.getCode()).getData();
|
||||||
@@ -97,11 +100,10 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
.map(DictTreeVO::getId)
|
.map(DictTreeVO::getId)
|
||||||
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
||||||
.filter(item -> Objects.equals(item.getDevType(), id))
|
.filter(item -> Objects.equals(item.getDevType(), id))
|
||||||
.map(CsEquipmentDeliveryDTO::getId)
|
.map(CsEquipmentDeliveryPO::getId)
|
||||||
.forEach(zhiLianDevice::add)
|
.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());
|
List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||||
|
|
||||||
@@ -194,10 +196,29 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
portable.setName(DataParam.portableDev);
|
portable.setName(DataParam.portableDev);
|
||||||
portable.setPid("0");
|
portable.setPid("0");
|
||||||
portable.setId(IdUtil.simpleUUID());
|
portable.setId(IdUtil.simpleUUID());
|
||||||
//针对未启用的装置判断
|
|
||||||
List<CsLedgerVO> ledger = allList.stream()
|
//根据当前用户获取便携式设备
|
||||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
List<CsLedgerVO> ledger;
|
||||||
.collect(Collectors.toList());
|
String role = RequestUtil.getUserRole();
|
||||||
|
List<String> roles = JSONArray.parseArray(role, String.class);
|
||||||
|
if(roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.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()
|
Map<String, CsEquipmentDeliveryPO> poMap2 = ledger.stream()
|
||||||
.collect(Collectors.toMap(
|
.collect(Collectors.toMap(
|
||||||
CsLedgerVO::getId,
|
CsLedgerVO::getId,
|
||||||
@@ -287,14 +308,14 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
|
|
||||||
List<String> zhiLianDevice = new ArrayList<>();
|
List<String> zhiLianDevice = new ArrayList<>();
|
||||||
List<String> cldDevice = new ArrayList<>();
|
List<String> cldDevice = new ArrayList<>();
|
||||||
List<CsEquipmentDeliveryDTO> csEquipmentDeliveryPOS = equipmentFeignClient.queryDeviceById(device).getData();
|
if (CollectionUtil.isNotEmpty(device)) {
|
||||||
if (CollectionUtil.isNotEmpty(csEquipmentDeliveryPOS)) {
|
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryMapper.selectBatchIds(device);
|
||||||
DictTreeVO vo1 = dictTreeFeignClient.queryByCode(DicDataEnum.DEV_CLD.getCode()).getData();
|
DictTreeVO vo1 = dictTreeFeignClient.queryByCode(DicDataEnum.DEV_CLD.getCode()).getData();
|
||||||
Optional.ofNullable(vo1)
|
Optional.ofNullable(vo1)
|
||||||
.map(DictTreeVO::getId)
|
.map(DictTreeVO::getId)
|
||||||
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
||||||
.filter(item -> Objects.equals(item.getDevType(), id))
|
.filter(item -> Objects.equals(item.getDevType(), id))
|
||||||
.map(CsEquipmentDeliveryDTO::getId)
|
.map(CsEquipmentDeliveryPO::getId)
|
||||||
.forEach(cldDevice::add)
|
.forEach(cldDevice::add)
|
||||||
);
|
);
|
||||||
DictTreeVO vo2 = dictTreeFeignClient.queryByCode(DicDataEnum.CONNECT_DEV.getCode()).getData();
|
DictTreeVO vo2 = dictTreeFeignClient.queryByCode(DicDataEnum.CONNECT_DEV.getCode()).getData();
|
||||||
@@ -302,10 +323,11 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
.map(DictTreeVO::getId)
|
.map(DictTreeVO::getId)
|
||||||
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
||||||
.filter(item -> Objects.equals(item.getDevType(), id))
|
.filter(item -> Objects.equals(item.getDevType(), id))
|
||||||
.map(CsEquipmentDeliveryDTO::getId)
|
.map(CsEquipmentDeliveryPO::getId)
|
||||||
.forEach(zhiLianDevice::add)
|
.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());
|
List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||||
|
|
||||||
@@ -379,10 +401,28 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
portable.setPid("0");
|
portable.setPid("0");
|
||||||
portable.setId(IdUtil.simpleUUID());
|
portable.setId(IdUtil.simpleUUID());
|
||||||
|
|
||||||
//针对未启用的装置判断
|
List<CsLedgerVO> ledger;
|
||||||
List<CsLedgerVO> ledger = allList.stream()
|
String role = RequestUtil.getUserRole();
|
||||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
List<String> roles = JSONArray.parseArray(role, String.class);
|
||||||
.collect(Collectors.toList());
|
if(roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.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()
|
Map<String, CsEquipmentDeliveryPO> poMap2 = ledger.stream()
|
||||||
.collect(Collectors.toMap(
|
.collect(Collectors.toMap(
|
||||||
CsLedgerVO::getId,
|
CsLedgerVO::getId,
|
||||||
@@ -674,6 +714,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
Set<String> list1 = new HashSet<>();
|
Set<String> list1 = new HashSet<>();
|
||||||
List<String> devList = tree3.stream().map(CsLedgerVO::getId).collect(Collectors.toList());
|
List<String> devList = tree3.stream().map(CsLedgerVO::getId).collect(Collectors.toList());
|
||||||
List<CsEquipmentDeliveryPO> devs = csEquipmentDeliveryMapper.selectBatchIds(devList);
|
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();
|
DictTreeVO vo1 = dictTreeFeignClient.queryByCode(DicDataEnum.DEV_CLD.getCode()).getData();
|
||||||
|
|
||||||
//list1是 cld设备
|
//list1是 cld设备
|
||||||
@@ -688,14 +729,30 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
Set<String> list3 = tree5.stream().map(CsLedgerVO::getPid).collect(Collectors.toSet());
|
Set<String> list3 = tree5.stream().map(CsLedgerVO::getPid).collect(Collectors.toSet());
|
||||||
projectTree = tree2.stream().filter(vo -> !list3.contains(vo.getId())).collect(Collectors.toList());
|
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());
|
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());
|
Set<String> proList = tree6.stream().map(CsLedgerVO::getPid).collect(Collectors.toSet());
|
||||||
engineerTree = tree1.stream().filter(vo -> !proList.contains(vo.getId())).collect(Collectors.toList());
|
engineerTree = tree1.stream().filter(vo -> !proList.contains(vo.getId())).collect(Collectors.toList());
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(list1)) {
|
if (CollectionUtil.isNotEmpty(list1)) {
|
||||||
deviceTree = tree3.stream().filter(vo -> list1.contains(vo.getId())).collect(Collectors.toList());
|
deviceTree = tree3.stream()
|
||||||
lineTree = tree4.stream().filter(vo -> list1.contains(vo.getPid())).collect(Collectors.toList());
|
.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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -729,6 +786,78 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
return government;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取子节点
|
* 获取子节点
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,29 +1,50 @@
|
|||||||
package com.njcn.csdevice.service.impl;
|
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.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.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
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.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.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.csdevice.mapper.CsLinePOMapper;
|
import com.njcn.csdevice.mapper.*;
|
||||||
import com.njcn.csdevice.mapper.CsTerminalLogsMapper;
|
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.*;
|
import com.njcn.csdevice.pojo.po.*;
|
||||||
import com.njcn.csdevice.service.CsDevModelService;
|
import com.njcn.csdevice.pojo.vo.PqSensitiveUserLineVO;
|
||||||
import com.njcn.csdevice.service.CsLinePOService;
|
import com.njcn.csdevice.service.*;
|
||||||
import com.njcn.csdevice.service.ICsDataSetService;
|
import com.njcn.csharmonic.api.PqSensitiveUserFeignClient;
|
||||||
|
import com.njcn.csharmonic.pojo.po.PqSensitiveUser;
|
||||||
|
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||||
|
import com.njcn.oss.constant.OssPath;
|
||||||
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
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 lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,6 +64,15 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
|||||||
private final ICsDataSetService csDataSetService;
|
private final ICsDataSetService csDataSetService;
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
private final CsTerminalLogsMapper csTerminalLogsMapper;
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CsLinePO> getLineByDev(List<String> list) {
|
public List<CsLinePO> getLineByDev(List<String> list) {
|
||||||
@@ -211,6 +241,162 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
|||||||
this.update(updateWrapper);
|
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).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>().eq(CsEquipmentDeliveryPO::getStatus,DataStateEnum.ENABLE)).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());
|
||||||
|
|
||||||
|
|
||||||
|
Page<CsLinePO> linePage = this.page(new Page<>(param.getPageNum(), param.getPageSize()),
|
||||||
|
new LambdaQueryWrapper<CsLinePO>()
|
||||||
|
.eq(CsLinePO::getStatus, 1)
|
||||||
|
// 关联敏感用户
|
||||||
|
.isNotNull(CsLinePO::getMonitorUser)
|
||||||
|
.orderByAsc(CsLinePO::getMonitorUser)
|
||||||
|
);
|
||||||
|
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 = pqSensitiveUserFeignClient.getListByIds(sensitiveUserIds).getData()
|
||||||
|
.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("已治理");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 监测类型
|
||||||
|
sensitiveUserLineVO.setPosition(record.getPosition());
|
||||||
|
DictData positionDictData = dicDataFeignClient.getDicDataById(record.getPosition()).getData();
|
||||||
|
if (positionDictData != null) {
|
||||||
|
sensitiveUserLineVO.setPosition(positionDictData.getName());
|
||||||
|
}
|
||||||
|
// 电压等级
|
||||||
|
sensitiveUserLineVO.setVolGrade(record.getVolGrade());
|
||||||
|
// 运行状态
|
||||||
|
sensitiveUserLineVO.setRunStatus(getRunStatusDescription(record.getRunStatus()));
|
||||||
|
// 报告文件
|
||||||
|
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);
|
||||||
|
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 "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String getRunStatusDescription(Integer runStatus) {
|
||||||
|
// 0:运行;1:检修;2:停运;3:调试;4:退运
|
||||||
|
switch (runStatus) {
|
||||||
|
case 0:
|
||||||
|
return "运行";
|
||||||
|
case 1:
|
||||||
|
return "检修";
|
||||||
|
case 2:
|
||||||
|
return "停运";
|
||||||
|
case 3:
|
||||||
|
return "调试";
|
||||||
|
case 4:
|
||||||
|
return "退运";
|
||||||
|
default:
|
||||||
|
return "未知";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 1.平台端默认配置拓扑图模板,包含拓扑图信息(cs_topology_diagram_template)和拓扑图上监测点的点位信息(cs_line_topology_template)
|
// * 1.平台端默认配置拓扑图模板,包含拓扑图信息(cs_topology_diagram_template)和拓扑图上监测点的点位信息(cs_line_topology_template)
|
||||||
// *
|
// *
|
||||||
|
|||||||
@@ -146,8 +146,10 @@ public class CsTerminalLogsServiceImpl extends ServiceImpl<CsTerminalLogsMapper,
|
|||||||
operateType = 0;
|
operateType = 0;
|
||||||
} else if (Objects.equals(code, "ledger_modify")) {
|
} else if (Objects.equals(code, "ledger_modify")) {
|
||||||
operateType = 1;
|
operateType = 1;
|
||||||
} else{
|
} else if (Objects.equals(code, "delete_terminal")){
|
||||||
operateType = 2;
|
operateType = 2;
|
||||||
|
} else {
|
||||||
|
operateType = 3;
|
||||||
}
|
}
|
||||||
//找出最新的数据,将状态改为未推送,下次可以再次推送
|
//找出最新的数据,将状态改为未推送,下次可以再次推送
|
||||||
this.lambdaUpdate()
|
this.lambdaUpdate()
|
||||||
@@ -175,7 +177,7 @@ public class CsTerminalLogsServiceImpl extends ServiceImpl<CsTerminalLogsMapper,
|
|||||||
List<CsEquipmentDeliveryPO> v1 = entry.getValue();
|
List<CsEquipmentDeliveryPO> v1 = entry.getValue();
|
||||||
String guid = IdUtil.simpleUUID();
|
String guid = IdUtil.simpleUUID();
|
||||||
message.setGuid(guid);
|
message.setGuid(guid);
|
||||||
message.setProcessNo(String.valueOf(k1));
|
message.setProcessNo(k1);
|
||||||
List<CldUpdateLedgerMessage.CldDeviceDto> list1 = new ArrayList<>();
|
List<CldUpdateLedgerMessage.CldDeviceDto> list1 = new ArrayList<>();
|
||||||
v1.forEach(item -> {
|
v1.forEach(item -> {
|
||||||
CldUpdateLedgerMessage.CldDeviceDto deviceDto = new CldUpdateLedgerMessage.CldDeviceDto();
|
CldUpdateLedgerMessage.CldDeviceDto deviceDto = new CldUpdateLedgerMessage.CldDeviceDto();
|
||||||
@@ -248,7 +250,7 @@ public class CsTerminalLogsServiceImpl extends ServiceImpl<CsTerminalLogsMapper,
|
|||||||
nodeProcessMap1.forEach((k1,v1)->{
|
nodeProcessMap1.forEach((k1,v1)->{
|
||||||
String guid = IdUtil.simpleUUID();
|
String guid = IdUtil.simpleUUID();
|
||||||
message.setGuid(guid);
|
message.setGuid(guid);
|
||||||
message.setProcessNo(String.valueOf(k1));
|
message.setProcessNo(k1);
|
||||||
List<CldUpdateLedgerMessage.CldDeviceDto> list1 = new ArrayList<>();
|
List<CldUpdateLedgerMessage.CldDeviceDto> list1 = new ArrayList<>();
|
||||||
v1.forEach(item->{
|
v1.forEach(item->{
|
||||||
CldUpdateLedgerMessage.CldDeviceDto deviceDto = new CldUpdateLedgerMessage.CldDeviceDto();
|
CldUpdateLedgerMessage.CldDeviceDto deviceDto = new CldUpdateLedgerMessage.CldDeviceDto();
|
||||||
@@ -267,6 +269,7 @@ public class CsTerminalLogsServiceImpl extends ServiceImpl<CsTerminalLogsMapper,
|
|||||||
csFmTerminalReply.setNodeId(k);
|
csFmTerminalReply.setNodeId(k);
|
||||||
csFmTerminalReply.setProcessNo(k1);
|
csFmTerminalReply.setProcessNo(k1);
|
||||||
csFmTerminalReply.setDeviceId(item.getDeviceId());
|
csFmTerminalReply.setDeviceId(item.getDeviceId());
|
||||||
|
csFmTerminalReply.setDeviceName(item.getDeviceName());
|
||||||
csFmTerminalReply.setIsReceived(0);
|
csFmTerminalReply.setIsReceived(0);
|
||||||
csTerminalReplyMapper.insert(csFmTerminalReply);
|
csTerminalReplyMapper.insert(csFmTerminalReply);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,23 +1,33 @@
|
|||||||
package com.njcn.csdevice.service.impl;
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.csdevice.api.CsLedgerFeignClient;
|
||||||
import com.njcn.csdevice.mapper.CsTerminalReplyMapper;
|
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.CsEquipmentDeliveryPO;
|
||||||
import com.njcn.csdevice.pojo.po.CsTerminalReply;
|
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.CsEquipmentDeliveryService;
|
||||||
import com.njcn.csdevice.service.ICsTerminalLogsService;
|
import com.njcn.csdevice.service.ICsTerminalLogsService;
|
||||||
import com.njcn.csdevice.service.ICsTerminalReplyService;
|
import com.njcn.csdevice.service.ICsTerminalReplyService;
|
||||||
import com.njcn.csdevice.service.INodeService;
|
import com.njcn.csdevice.service.INodeService;
|
||||||
import com.njcn.redis.utils.RedisUtil;
|
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 com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.function.Function;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@@ -37,6 +47,7 @@ public class CsTerminalReplyServiceImpl extends ServiceImpl<CsTerminalReplyMappe
|
|||||||
private final INodeService nodeService;
|
private final INodeService nodeService;
|
||||||
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
||||||
private final ICsTerminalLogsService csTerminalLogsService;
|
private final ICsTerminalLogsService csTerminalLogsService;
|
||||||
|
private final CsLedgerFeignClient csLedgerFeignClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> queryReplyData() {
|
public List<String> queryReplyData() {
|
||||||
@@ -58,25 +69,32 @@ public class CsTerminalReplyServiceImpl extends ServiceImpl<CsTerminalReplyMappe
|
|||||||
} else {
|
} else {
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
String key;
|
String key;
|
||||||
String code;
|
String code = "";
|
||||||
if (Objects.equals(item.getCode(), "add_terminal")) {
|
if (Objects.equals(item.getCode(), "add_terminal")) {
|
||||||
code = "新增";
|
code = "新增";
|
||||||
} else if (Objects.equals(item.getCode(), "ledger_modify")) {
|
} else if (Objects.equals(item.getCode(), "ledger_modify")) {
|
||||||
code = "修改";
|
code = "修改";
|
||||||
} else {
|
} else if (Objects.equals(item.getCode(), "delete_terminal")){
|
||||||
code = "删除";
|
code = "删除";
|
||||||
}
|
}
|
||||||
String nodeName = nodeService.getNodeById(item.getNodeId()).getName();
|
String nodeName = nodeService.getNodeById(item.getNodeId()).getName();
|
||||||
List<CsEquipmentDeliveryPO> devList1 = csEquipmentDeliveryService.getAll();
|
List<CsEquipmentDeliveryPO> devList1 = csEquipmentDeliveryService.getAll();
|
||||||
List<CsEquipmentDeliveryPO> devList2 = devList1.stream().filter(item1 -> Objects.equals(item1.getId(), item.getDeviceId())).collect(Collectors.toList());
|
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());
|
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) {
|
if (item.getIsReceived() == 0) {
|
||||||
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + code + "数据失败";
|
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备未收到应答";
|
||||||
//将cs_terminal_logs数据置为未发送
|
//将cs_terminal_logs数据置为未发送
|
||||||
csTerminalLogsService.updateLaterData(item.getDeviceId(),item.getCode());
|
csTerminalLogsService.updateLaterData(item.getDeviceId(),item.getCode());
|
||||||
|
} else if (item.getIsReceived() == 1){
|
||||||
|
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备" + code + "数据成功";
|
||||||
} else {
|
} else {
|
||||||
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + code + "数据成功";
|
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备" + code + "数据失败";
|
||||||
}
|
}
|
||||||
result.add(key);
|
result.add(key);
|
||||||
});
|
});
|
||||||
@@ -87,9 +105,137 @@ public class CsTerminalReplyServiceImpl extends ServiceImpl<CsTerminalReplyMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateReplyData(String id,Integer state,String deviceId) {
|
public void updateReplyData(IcdBzReplyParam param) {
|
||||||
this.lambdaUpdate().set(CsTerminalReply::getIsReceived,state)
|
LambdaUpdateWrapper<CsTerminalReply> wrapper = new LambdaUpdateWrapper<>();
|
||||||
.eq(CsTerminalReply::getDeviceId,deviceId)
|
wrapper.set(CsTerminalReply::getIsReceived,param.getState())
|
||||||
.eq(CsTerminalReply::getReplyId,id);
|
.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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
package com.njcn.csdevice.service.impl;
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
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.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.csp.sentinel.util.StringUtil;
|
import com.alibaba.csp.sentinel.util.StringUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.njcn.access.utils.ChannelObjectUtil;
|
import com.njcn.access.utils.ChannelObjectUtil;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.csdevice.mapper.OverlimitMapper;
|
||||||
|
import com.njcn.csdevice.param.IcdBzParam;
|
||||||
import com.njcn.csdevice.param.IcdLedgerParam;
|
import com.njcn.csdevice.param.IcdLedgerParam;
|
||||||
import com.njcn.csdevice.param.IcdParam;
|
import com.njcn.csdevice.param.IcdParam;
|
||||||
import com.njcn.csdevice.pojo.param.AppProjectAddParm;
|
import com.njcn.csdevice.pojo.param.AppProjectAddParm;
|
||||||
@@ -16,7 +22,12 @@ import com.njcn.csdevice.pojo.po.*;
|
|||||||
import com.njcn.csdevice.pojo.vo.CldLedgerVo;
|
import com.njcn.csdevice.pojo.vo.CldLedgerVo;
|
||||||
import com.njcn.csdevice.pojo.vo.DeviceInfo;
|
import com.njcn.csdevice.pojo.vo.DeviceInfo;
|
||||||
import com.njcn.csdevice.service.*;
|
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.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.pojo.enums.AppRedisKey;
|
||||||
import com.njcn.redis.utils.RedisUtil;
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
@@ -27,6 +38,8 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -44,7 +57,12 @@ class IcdServiceImpl implements IcdService {
|
|||||||
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
||||||
private final CsLinePOService csLinePOService;
|
private final CsLinePOService csLinePOService;
|
||||||
private final ICsLedgerService csLedgerService;
|
private final ICsLedgerService csLedgerService;
|
||||||
|
private final BZEventMessageTemplate bzEventMessageTemplate;
|
||||||
|
private final EventFeignClient eventFeignClient;
|
||||||
private final ICsTerminalLogsService csTerminalLogsService;
|
private final ICsTerminalLogsService csTerminalLogsService;
|
||||||
|
private final ICsTerminalReplyService csTerminalReplyService;
|
||||||
|
private final OverlimitMapper overlimitMapper;
|
||||||
|
private final DateTimeFormatter microsecondFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSS");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeviceInfo> getLedgerInfo(IcdParam param) {
|
public List<DeviceInfo> getLedgerInfo(IcdParam param) {
|
||||||
@@ -109,7 +127,6 @@ class IcdServiceImpl implements IcdService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void addLedgerInfo(IcdLedgerParam param) {
|
public void addLedgerInfo(IcdLedgerParam param) {
|
||||||
// 第一种:全流程创建
|
// 第一种:全流程创建
|
||||||
if (isAllIndicesNull(param)) {
|
if (isAllIndicesNull(param)) {
|
||||||
@@ -161,8 +178,316 @@ class IcdServiceImpl implements IcdService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 +582,8 @@ class IcdServiceImpl implements IcdService {
|
|||||||
&& ObjectUtil.isNull(param.getDevIndex());
|
&& ObjectUtil.isNull(param.getDevIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleFullProcessCreation(@NotNull IcdLedgerParam param) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void handleFullProcessCreation(@NotNull IcdLedgerParam param) {
|
||||||
if (ObjectUtil.isNotNull(param.getEngineering())) {
|
if (ObjectUtil.isNotNull(param.getEngineering())) {
|
||||||
CsEngineeringPO po1 = csEngineeringService.addEngineering(param.getEngineering());
|
CsEngineeringPO po1 = csEngineeringService.addEngineering(param.getEngineering());
|
||||||
param.setEngineeringIndex(po1.getId());
|
param.setEngineeringIndex(po1.getId());
|
||||||
@@ -265,15 +591,18 @@ class IcdServiceImpl implements IcdService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleFromEngineeringCreation(IcdLedgerParam param) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void handleFromEngineeringCreation(IcdLedgerParam param) {
|
||||||
createProjectAndDevices(param);
|
createProjectAndDevices(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleFromProjectCreation(IcdLedgerParam param) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void handleFromProjectCreation(IcdLedgerParam param) {
|
||||||
saveDevicesAndLines(param);
|
saveDevicesAndLines(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleFromDeviceCreation(IcdLedgerParam param) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void handleFromDeviceCreation(IcdLedgerParam param) {
|
||||||
saveLines(param);
|
saveLines(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,8 +635,8 @@ class IcdServiceImpl implements IcdService {
|
|||||||
saveLines(param);
|
saveLines(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveLines(IcdLedgerParam param) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
List<CsLinePO> list = new ArrayList<>();
|
public void saveLines(IcdLedgerParam param) {
|
||||||
List<CsLineParam> lineList = param.getLine();
|
List<CsLineParam> lineList = param.getLine();
|
||||||
if (CollectionUtil.isNotEmpty(lineList)) {
|
if (CollectionUtil.isNotEmpty(lineList)) {
|
||||||
boolean result = checkAndAlertDuplicates(lineList);
|
boolean result = checkAndAlertDuplicates(lineList);
|
||||||
@@ -329,7 +658,10 @@ class IcdServiceImpl implements IcdService {
|
|||||||
line.setDevId(param.getDevIndex());
|
line.setDevId(param.getDevIndex());
|
||||||
}
|
}
|
||||||
CsLinePO po = csLinePOService.addCldLine(line);
|
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());
|
||||||
|
overlimitMapper.insert(overlimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
//新增台账日志
|
//新增台账日志
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.csdevice.service.impl;
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
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.enums.AlgorithmResponseEnum;
|
||||||
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
||||||
import com.njcn.csdevice.mapper.NodeMapper;
|
import com.njcn.csdevice.mapper.NodeMapper;
|
||||||
|
import com.njcn.csdevice.param.IcdNodeParam;
|
||||||
import com.njcn.csdevice.pojo.param.NodeParam;
|
import com.njcn.csdevice.pojo.param.NodeParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
import com.njcn.csdevice.pojo.po.Node;
|
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.csdevice.service.INodeService;
|
||||||
import com.njcn.db.constant.DbConstant;
|
import com.njcn.db.constant.DbConstant;
|
||||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
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 com.njcn.web.factory.PageFactory;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@@ -28,6 +32,7 @@ import org.springframework.transaction.annotation.Propagation;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -46,6 +51,7 @@ import java.util.stream.Collectors;
|
|||||||
public class NodeServiceImpl extends ServiceImpl<NodeMapper, Node> implements INodeService {
|
public class NodeServiceImpl extends ServiceImpl<NodeMapper, Node> implements INodeService {
|
||||||
|
|
||||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||||
|
private final CldControlMessageTemplate controlMessageTemplate;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addNode(NodeParam nodeParam) {
|
public boolean addNode(NodeParam nodeParam) {
|
||||||
@@ -165,6 +171,84 @@ public class NodeServiceImpl extends ServiceImpl<NodeMapper, Node> implements IN
|
|||||||
return nodeProcessDeviceVo;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验参数,检查是否存在相同编码的字典类型
|
* 校验参数,检查是否存在相同编码的字典类型
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.mapper.RStatIntegrityDMapper;
|
import com.njcn.csdevice.mapper.RStatIntegrityDMapper;
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import com.njcn.csdevice.pojo.po.RStatIntegrityD;
|
import com.njcn.csdevice.pojo.po.RStatIntegrityD;
|
||||||
|
import com.njcn.csdevice.service.CsEquipmentDeliveryService;
|
||||||
import com.njcn.csdevice.service.IRStatIntegrityDService;
|
import com.njcn.csdevice.service.IRStatIntegrityDService;
|
||||||
import com.njcn.csdevice.util.TimeUtil;
|
import com.njcn.csdevice.util.TimeUtil;
|
||||||
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
||||||
@@ -42,15 +42,21 @@ import java.util.stream.Collectors;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class RStatIntegrityDServiceImpl extends MppServiceImpl<RStatIntegrityDMapper, RStatIntegrityD> implements IRStatIntegrityDService {
|
public class RStatIntegrityDServiceImpl extends MppServiceImpl<RStatIntegrityDMapper, RStatIntegrityD> implements IRStatIntegrityDService {
|
||||||
|
|
||||||
private final EquipmentFeignClient equipmentFeignClient;
|
|
||||||
private final CsLineFeignClient csLineFeignClient;
|
private final CsLineFeignClient csLineFeignClient;
|
||||||
private final CommonService commonService;
|
private final CommonService commonService;
|
||||||
|
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addData(StatisticsDataParam param) {
|
public void addData(StatisticsDataParam param) {
|
||||||
List<RStatIntegrityD> result = new ArrayList<>();
|
List<RStatIntegrityD> result = new ArrayList<>();
|
||||||
//获取库中正常的所有装置
|
List<CsEquipmentDeliveryPO> devList;
|
||||||
List<CsEquipmentDeliveryPO> devList = equipmentFeignClient.getAll().getData();
|
//判断是否指定设备补招
|
||||||
|
if (CollectionUtil.isNotEmpty(param.getIdList())) {
|
||||||
|
devList = csEquipmentDeliveryService.getListByIds(param.getIdList());
|
||||||
|
} else {
|
||||||
|
//获取库中正常的所有装置
|
||||||
|
devList = csEquipmentDeliveryService.getAll();
|
||||||
|
}
|
||||||
if (CollectionUtil.isNotEmpty(devList)) {
|
if (CollectionUtil.isNotEmpty(devList)) {
|
||||||
Map<String, CsEquipmentDeliveryPO> devMap = devList.stream().collect(Collectors.toMap(CsEquipmentDeliveryPO::getId, Function.identity()));
|
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 cn.hutool.core.date.DateUtil;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
|
||||||
import com.njcn.csdevice.mapper.RStatOnlineRateDMapper;
|
import com.njcn.csdevice.mapper.RStatOnlineRateDMapper;
|
||||||
import com.njcn.csdevice.param.LineCountEvaluateParam;
|
import com.njcn.csdevice.param.LineCountEvaluateParam;
|
||||||
import com.njcn.csdevice.pojo.dto.PqsCommunicateDto;
|
import com.njcn.csdevice.pojo.dto.PqsCommunicateDto;
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
import com.njcn.csdevice.pojo.po.RStatOnlineRateD;
|
import com.njcn.csdevice.pojo.po.RStatOnlineRateD;
|
||||||
|
import com.njcn.csdevice.service.CsEquipmentDeliveryService;
|
||||||
import com.njcn.csdevice.service.ICsCommunicateService;
|
import com.njcn.csdevice.service.ICsCommunicateService;
|
||||||
import com.njcn.csdevice.service.IRStatOnlineRateDService;
|
import com.njcn.csdevice.service.IRStatOnlineRateDService;
|
||||||
import com.njcn.csdevice.util.TimeUtil;
|
import com.njcn.csdevice.util.TimeUtil;
|
||||||
import com.njcn.csharmonic.param.DataParam;
|
|
||||||
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
||||||
import com.njcn.influx.deprecated.InfluxDBPublicParam;
|
import com.njcn.influx.deprecated.InfluxDBPublicParam;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -25,7 +24,6 @@ import org.springframework.stereotype.Service;
|
|||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -46,14 +44,24 @@ import java.util.List;
|
|||||||
public class RStatOnlineRateDServiceImpl extends MppServiceImpl<RStatOnlineRateDMapper, RStatOnlineRateD> implements IRStatOnlineRateDService {
|
public class RStatOnlineRateDServiceImpl extends MppServiceImpl<RStatOnlineRateDMapper, RStatOnlineRateD> implements IRStatOnlineRateDService {
|
||||||
|
|
||||||
private final Integer online = 1;
|
private final Integer online = 1;
|
||||||
private final EquipmentFeignClient equipmentFeignClient;
|
|
||||||
private final ICsCommunicateService pqsCommunicateService;
|
private final ICsCommunicateService pqsCommunicateService;
|
||||||
|
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addData(StatisticsDataParam param) {
|
public void addData(StatisticsDataParam param) {
|
||||||
List<RStatOnlineRateD> list = new ArrayList<>();
|
List<RStatOnlineRateD> list = new ArrayList<>();
|
||||||
//获取库中正常的所有装置
|
List<CsEquipmentDeliveryPO> devList;
|
||||||
List<CsEquipmentDeliveryPO> devList = equipmentFeignClient.getAll().getData();
|
//判断是否指定设备补招
|
||||||
|
if (CollectionUtil.isNotEmpty(param.getIdList())) {
|
||||||
|
devList = csEquipmentDeliveryService.getListByIds(param.getIdList());
|
||||||
|
} else {
|
||||||
|
//获取库中正常的所有装置
|
||||||
|
devList = csEquipmentDeliveryService.getAll();
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isEmpty(devList)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(devList)) {
|
if (CollectionUtil.isNotEmpty(devList)) {
|
||||||
//获取需要计算的时间
|
//获取需要计算的时间
|
||||||
List<String> dateRange = TimeUtil.getDateRangeAsString(param.getStartTime(), param.getEndTime());
|
List<String> dateRange = TimeUtil.getDateRangeAsString(param.getStartTime(), param.getEndTime());
|
||||||
@@ -190,6 +198,8 @@ public class RStatOnlineRateDServiceImpl extends MppServiceImpl<RStatOnlineRateD
|
|||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
minute = InfluxDBPublicParam.DAY_MINUTE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,26 +61,24 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
});
|
});
|
||||||
List<CsDeviceUserPO> csDeviceUserPOS = csDeviceUserPOMapper.selectList(csDeviceUserPOQueryWrapper);
|
List<CsDeviceUserPO> csDeviceUserPOS = csDeviceUserPOMapper.selectList(csDeviceUserPOQueryWrapper);
|
||||||
List<String> collect1 = csDeviceUserPOS.stream().map(CsDeviceUserPO::getDeviceId).distinct().collect(Collectors.toList());
|
List<String> collect1 = csDeviceUserPOS.stream().map(CsDeviceUserPO::getDeviceId).distinct().collect(Collectors.toList());
|
||||||
if(CollectionUtils.isEmpty(collect1)){
|
if (!CollectionUtils.isEmpty(collect1)) {
|
||||||
return collect;
|
csLedgerQueryWrapper.in("id", collect1).eq("level", 2);
|
||||||
}else{
|
|
||||||
csLedgerQueryWrapper.in("id",collect1).eq("level",2);
|
|
||||||
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
||||||
List<String> collect2 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList());
|
List<String> collect2 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList());
|
||||||
csLedgerQueryWrapper.clear();
|
csLedgerQueryWrapper.clear();
|
||||||
if(CollectionUtils.isEmpty(collect2)){
|
if (CollectionUtils.isEmpty(collect2)) {
|
||||||
return collect;
|
return collect;
|
||||||
}
|
}
|
||||||
csLedgerQueryWrapper.in("id",collect2).eq("level",1);
|
csLedgerQueryWrapper.in("id", collect2).eq("level", 1);
|
||||||
csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
||||||
List<String> collect3 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList());
|
List<String> collect3 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList());
|
||||||
if(CollectionUtils.isEmpty(collect3)){
|
if (CollectionUtils.isEmpty(collect3)) {
|
||||||
return collect;
|
return collect;
|
||||||
}
|
}
|
||||||
collect.addAll(collect3);
|
collect.addAll(collect3);
|
||||||
collect = collect.stream().distinct().collect(Collectors.toList());
|
collect = collect.stream().distinct().collect(Collectors.toList());
|
||||||
return collect;
|
|
||||||
}
|
}
|
||||||
|
return collect;
|
||||||
|
|
||||||
} else if ( Objects.equals(role,AppRoleEnum.MARKET_USER.getCode())||
|
} else if ( Objects.equals(role,AppRoleEnum.MARKET_USER.getCode())||
|
||||||
Objects.equals(role, AppRoleEnum.ENGINEERING_USER.getCode())) {
|
Objects.equals(role, AppRoleEnum.ENGINEERING_USER.getCode())) {
|
||||||
@@ -94,7 +92,9 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
List<CsTouristDataPO> csTouristDataPOS = csTouristDataPOMapper.selectList(null);
|
List<CsTouristDataPO> csTouristDataPOS = csTouristDataPOMapper.selectList(null);
|
||||||
collect = csTouristDataPOS.stream().map(CsTouristDataPO::getEnginerId).distinct().collect(Collectors.toList());
|
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())){
|
||||||
List<CsEngineeringPO> csEngineeringPOS = csEngineeringMapper.selectList(null);
|
List<CsEngineeringPO> csEngineeringPOS = csEngineeringMapper.selectList(null);
|
||||||
collect =csEngineeringPOS.stream().filter(temp->Objects.equals(temp.getStatus(),"1")).map(CsEngineeringPO::getId).collect(Collectors.toList());
|
collect =csEngineeringPOS.stream().filter(temp->Objects.equals(temp.getStatus(),"1")).map(CsEngineeringPO::getId).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
@@ -196,7 +196,9 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
List<CsTouristDataPO> csTouristDataPOS = csTouristDataPOMapper.selectList(null);
|
List<CsTouristDataPO> csTouristDataPOS = csTouristDataPOMapper.selectList(null);
|
||||||
collect = csTouristDataPOS.stream().map(CsTouristDataPO::getDeviceId).distinct().collect(Collectors.toList());
|
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())){
|
||||||
csLedgerQueryWrapper.clear();
|
csLedgerQueryWrapper.clear();
|
||||||
csLedgerQueryWrapper.eq("level",2).eq("state",1);
|
csLedgerQueryWrapper.eq("level",2).eq("state",1);
|
||||||
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class InfluxDbParamUtil {
|
|||||||
//如果是云前置设备,直接返回clDid
|
//如果是云前置设备,直接返回clDid
|
||||||
boolean isCLdDevice = DicDataEnum.DEV_CLD.getCode().equals(dictTreeFeignClient.queryById(csEquipmentDeliveryDTOList.get(0).getDevType()).getData().getCode());
|
boolean isCLdDevice = DicDataEnum.DEV_CLD.getCode().equals(dictTreeFeignClient.queryById(csEquipmentDeliveryDTOList.get(0).getDevType()).getData().getCode());
|
||||||
if(isCLdDevice){
|
if(isCLdDevice){
|
||||||
// return String.valueOf(finalCsLinePOList.get(0).getLineNo());
|
return String.valueOf(finalCsLinePOList.get(0).getLineNo());
|
||||||
}
|
}
|
||||||
//之后的逻辑还是按照原来的不变
|
//之后的逻辑还是按照原来的不变
|
||||||
String position = csLineFeignClient.getPositionById(lineId).getData();
|
String position = csLineFeignClient.getPositionById(lineId).getData();
|
||||||
|
|||||||
@@ -1,19 +1,24 @@
|
|||||||
package com.njcn.csharmonic.api;
|
package com.njcn.csharmonic.api;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
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.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.csdevice.pojo.vo.DataGroupEventVO;
|
import com.njcn.csdevice.pojo.vo.DataGroupEventVO;
|
||||||
import com.njcn.csharmonic.api.fallback.EventFeignClientFallbackFactory;
|
import com.njcn.csharmonic.api.fallback.EventFeignClientFallbackFactory;
|
||||||
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
||||||
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
||||||
import com.njcn.csharmonic.pojo.vo.CsEventVO;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,5 +35,9 @@ public interface EventFeignClient {
|
|||||||
@PostMapping("/queryByIndex")
|
@PostMapping("/queryByIndex")
|
||||||
HttpResult<CsEventPO> queryByIndex(@RequestBody CsEventPO csEventPO);
|
HttpResult<CsEventPO> queryByIndex(@RequestBody CsEventPO csEventPO);
|
||||||
|
|
||||||
|
@PostMapping("/queryById")
|
||||||
|
HttpResult<CsEventPO> queryById(@RequestParam("eventId") String eventId);
|
||||||
|
|
||||||
}
|
@PostMapping("/getEventByTime")
|
||||||
|
HttpResult<List<CsEventPO>> getEventByTime(@RequestParam(name = "lineList", required = false) List<String> lineList,@RequestParam("startTime") String startTime,@RequestParam("endTime") String endTime);
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.njcn.csharmonic.api;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.csharmonic.api.fallback.EventUserFeignClientFallbackFactory;
|
||||||
|
import com.njcn.csharmonic.pojo.po.PqSensitiveUser;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@FeignClient(value = ServerInfo.CS_HARMONIC_BOOT, path = "/pqSensitiveUser", fallbackFactory = EventUserFeignClientFallbackFactory.class,contextId = "pqSensitiveUser")
|
||||||
|
public interface PqSensitiveUserFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/getListByIds")
|
||||||
|
HttpResult<List<PqSensitiveUser>> getListByIds(@RequestParam(name = "ids", required = false) List<String> ids);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,13 +8,10 @@ import com.njcn.csdevice.pojo.vo.DataGroupEventVO;
|
|||||||
import com.njcn.csharmonic.api.EventFeignClient;
|
import com.njcn.csharmonic.api.EventFeignClient;
|
||||||
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
||||||
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
||||||
import com.njcn.csharmonic.pojo.vo.CsEventVO;
|
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,6 +46,18 @@ public class EventFeignClientFallbackFactory implements FallbackFactory<EventFei
|
|||||||
log.error("{}异常,降级处理,异常为:{}","根据根据表唯一索引查询(用于校验是否存在该事件)s",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","根据根据表唯一索引查询(用于校验是否存在该事件)s",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<CsEventPO> queryById(String eventId) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据事件id查询数据",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<CsEventPO>> getEventByTime(List<String> lineList, String startTime, String endTime) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据时间获取无波形的暂态事件",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.njcn.csharmonic.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.csharmonic.api.PqSensitiveUserFeignClient;
|
||||||
|
import com.njcn.csharmonic.pojo.po.PqSensitiveUser;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class PqSensitiveUserFeignClientFallbackFactory implements FallbackFactory<PqSensitiveUserFeignClient> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PqSensitiveUserFeignClient create(Throwable cause) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if (cause.getCause() instanceof BusinessException) {
|
||||||
|
BusinessException businessException = (BusinessException) cause.getCause();
|
||||||
|
}
|
||||||
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
|
return new PqSensitiveUserFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<PqSensitiveUser>> getListByIds(List<String> ids) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据id集合获取敏感负荷用户列表",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.csharmonic.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public enum CsEventEnum {
|
||||||
|
|
||||||
|
EVENT_TYPE(0,"暂态事件"),
|
||||||
|
HARMONIC_TYPE(1,"稳态事件"),
|
||||||
|
DEVICE_TYPE(2,"设备事件"),
|
||||||
|
ALARM_TYPE(3,"告警事件")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
private final Integer code;
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
CsEventEnum(Integer code, String name) {
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -20,7 +20,18 @@ public enum CsHarmonicResponseEnum {
|
|||||||
RECORD_MISSING("A00602","record.bin文件缺失,补召失败"),
|
RECORD_MISSING("A00602","record.bin文件缺失,补召失败"),
|
||||||
|
|
||||||
EVENT_FILE_NOT_SAME("A00603","cfg、dat文件名称不一致"),
|
EVENT_FILE_NOT_SAME("A00603","cfg、dat文件名称不一致"),
|
||||||
|
CUSTOM_REPORT_REPEAT("A00552","自定义报表模板名称已存在"),
|
||||||
|
|
||||||
|
CUSTOM_REPORT_JSON("A00553","模板非严格json数据"),
|
||||||
|
|
||||||
|
CUSTOM_REPORT_DEPT("A00554","该部门已存在绑定报表模板"),
|
||||||
|
CUSTOM_TYPE("A00555","字典中未查询到报表模板类型"),
|
||||||
|
CUSTOM_REPORT_ACTIVE("A00556","不存在激活的自定义报告模板"),
|
||||||
|
CUSTOM_REPORT_EMPTY("A00557","自定义报表模板异常,模板数据为空"),
|
||||||
|
CUSTOM_REPORT_FILE("A00558","上传文件服务器错误,请检查数据"),
|
||||||
|
|
||||||
|
REPORT_DOWNLOAD_ERROR("A00559","报表文件下载异常"),
|
||||||
|
REPORT_TEMPLATE_DOWNLOAD_ERROR("A00560","报表模板下载异常")
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.njcn.csharmonic.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public enum CsTransientEnum {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
EVT_SYS_DIPSTR("Evt_Sys_DipStr","电压暂降"),
|
||||||
|
EVT_SYS_INTRSTR("Evt_Sys_IntrStr","电压中断"),
|
||||||
|
EVT_SYS_SWLSTR("Evt_Sys_SwlStr","电压暂升"),
|
||||||
|
TRANSIENT("Transient","录波"),
|
||||||
|
UN_KNOW("Un_Know","未知")
|
||||||
|
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
CsTransientEnum(String code, String name) {
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据code获取对应的name
|
||||||
|
* @param code 枚举编码
|
||||||
|
* @return 匹配的名称,未匹配时返回"未知",code为null时返回"未知"
|
||||||
|
*/
|
||||||
|
public static String getNameByCode(String code) {
|
||||||
|
// 处理code为null的情况
|
||||||
|
if (code == null) {
|
||||||
|
return UN_KNOW.getName();
|
||||||
|
}
|
||||||
|
// 遍历所有枚举常量,匹配code
|
||||||
|
for (CsTransientEnum transientEnum : CsTransientEnum.values()) {
|
||||||
|
if (transientEnum.getCode().equals(code)) {
|
||||||
|
return transientEnum.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 未找到匹配的code时,返回未知名称
|
||||||
|
return UN_KNOW.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.njcn.csharmonic.param;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FittingDataQueryParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "监测点")
|
||||||
|
@NotBlank(message = "监测点ID不可为空")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "searchBeginTime", value = "开始时间")
|
||||||
|
@NotBlank(message = "起始时间不可为空")
|
||||||
|
@DateTimeStrValid(message = "起始时间格式出错")
|
||||||
|
private String searchBeginTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "searchEndTime", value = "结束时间")
|
||||||
|
@NotBlank(message = "结束时间不可为空")
|
||||||
|
private String searchEndTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用于选择多个指标及谐波次数")
|
||||||
|
List<FittingDataQueryParam> list;
|
||||||
|
@ApiModelProperty(value = "指标组id")
|
||||||
|
private String statisticalId;
|
||||||
|
@ApiModelProperty(value = "一次值:Primary;二次值:Secondary")
|
||||||
|
private String dataLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "取值类型:Max,Min,cp95,avg(用户功率专用)")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "频次2-50(谐波电压、谐波电流专用)")
|
||||||
|
private String frequency;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.csharmonic.param;
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SensitiveUserReportQueryParam {
|
||||||
|
@NotBlank(message = "监测对象id不可为空")
|
||||||
|
@ApiModelProperty(name = "lineId",value = "监测对象id")
|
||||||
|
private String sensitiveUserId;
|
||||||
|
@NotBlank(message = "模板ID不可为空")
|
||||||
|
@ApiModelProperty(name = "tempId",value = "模板ID")
|
||||||
|
private String tempId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "searchBeginTime", value = "开始时间")
|
||||||
|
@NotBlank(message = "起始时间不可为空")
|
||||||
|
@DateTimeStrValid(message = "起始时间格式出错")
|
||||||
|
private String searchBeginTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "searchEndTime", value = "结束时间")
|
||||||
|
@NotBlank(message = "结束时间不可为空")
|
||||||
|
private String searchEndTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.njcn.csharmonic.param;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SensitiveUserTrendDataQueryParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "检测对象ID")
|
||||||
|
@NotBlank(message = "检测对象ID不可为空")
|
||||||
|
private String sensitiveUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "searchBeginTime", value = "开始时间")
|
||||||
|
@NotBlank(message = "起始时间不可为空")
|
||||||
|
@DateTimeStrValid(message = "起始时间格式出错")
|
||||||
|
private String searchBeginTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "searchEndTime", value = "结束时间")
|
||||||
|
@NotBlank(message = "结束时间不可为空")
|
||||||
|
private String searchEndTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用于选择多个指标及谐波次数")
|
||||||
|
List<SensitiveUserTrendDataQueryParam> list;
|
||||||
|
@ApiModelProperty(value = "指标组id")
|
||||||
|
private String statisticalId;
|
||||||
|
@ApiModelProperty(value = "取值类型(Max,Min,cp95,avg)")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "一次值:Primary;二次值:Secondary")
|
||||||
|
private String dataLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "频次2-50")
|
||||||
|
private String frequency;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.njcn.csharmonic.param;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TrendDataQueryParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "监测点")
|
||||||
|
@NotBlank(message = "监测点ID不可为空")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "searchBeginTime", value = "开始时间")
|
||||||
|
@NotBlank(message = "起始时间不可为空")
|
||||||
|
@DateTimeStrValid(message = "起始时间格式出错")
|
||||||
|
private String searchBeginTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "searchEndTime", value = "结束时间")
|
||||||
|
@NotBlank(message = "结束时间不可为空")
|
||||||
|
private String searchEndTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用于选择多个指标及谐波次数")
|
||||||
|
List<TrendDataQueryParam> list;
|
||||||
|
@ApiModelProperty(value = "指标组id")
|
||||||
|
private String statisticalId;
|
||||||
|
@ApiModelProperty(value = "取值类型(Max,Min,cp95,avg)")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "一次值:Primary;二次值:Secondary")
|
||||||
|
private String dataLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "频次2-50")
|
||||||
|
private String frequency;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/8/22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ReportTemplateDTO {
|
||||||
|
/**
|
||||||
|
* $HA[_25]#B#max#classId#resourceId$
|
||||||
|
*/
|
||||||
|
private String itemName;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应influxdb数据库中字段
|
||||||
|
*/
|
||||||
|
private String templateName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应限值字段
|
||||||
|
*/
|
||||||
|
private String limitName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别
|
||||||
|
*/
|
||||||
|
private String phase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* max min avg cp95
|
||||||
|
*/
|
||||||
|
private String statMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应influxdb数据库的表名
|
||||||
|
*/
|
||||||
|
private String classId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应mysql数据库的表名
|
||||||
|
*/
|
||||||
|
private String resourceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标识指标是否越限 0.否 1.是
|
||||||
|
*/
|
||||||
|
private Integer overLimitFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填入的value值
|
||||||
|
*/
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.param;
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-11-21
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class EventStatisticParam extends BaseParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("监测点id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安装位置
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("字典表:安装位置(负载侧,电网侧, 输出侧)")
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.param;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.hibernate.validator.constraints.Range;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-12-02
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PqSensitiveUserParam {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感用户名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "用户名称不可为空")
|
||||||
|
@ApiModelProperty(name = "name",value = "用户名称不可为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感负荷类型
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "敏感负荷类型不可为空")
|
||||||
|
@ApiModelProperty(name = "loadType",value = "敏感负荷类型")
|
||||||
|
private String loadType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户协议容量
|
||||||
|
*/
|
||||||
|
@Range(min = 0,max = 10000000 )
|
||||||
|
@ApiModelProperty(name = "userAgreementCapacity",value = "用户协议容量")
|
||||||
|
private Double userAgreementCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装机容量
|
||||||
|
*/
|
||||||
|
@Range(min = 0,max = 10000000 )
|
||||||
|
@ApiModelProperty(name = "installedCapacity",value = "装机容量")
|
||||||
|
private Double installedCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属厂站名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "所属厂站名称不可为空")
|
||||||
|
@ApiModelProperty(name = "substationName",value = "所属厂站名称")
|
||||||
|
private String substationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
@NotNull(message = "排序不可为空")
|
||||||
|
@ApiModelProperty(name = "sort",value = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class UpdatePqSensitiveUserParam extends PqSensitiveUserParam{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "id不可为空")
|
||||||
|
@ApiModelProperty(name = "id",value = "id")
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.param;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板动态更新数据
|
||||||
|
*
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ReportSearchParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "lineId",value = "监测点id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "tempId",value = "模板ID")
|
||||||
|
private String tempId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "activation",value = "激活状态")
|
||||||
|
private Integer activation;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "type",value = "报表类型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "startTime",value = "开始时间")
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "endTime",value = "结束时间")
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "deptId",value = "部门ID")
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
|
//目前用于区分不同系统资源,null默认 1.无线系统,配合cs-device
|
||||||
|
private Integer resourceType;
|
||||||
|
|
||||||
|
//浙江无线报表特殊标识 null为通用报表 1.浙江无线报表
|
||||||
|
private Integer customType;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.param;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/8/16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ReportTemplateParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "name",value = "模板名称",required = true)
|
||||||
|
@NotBlank(message = "模板名称不可为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "fileContent",value = "json文件",required = true)
|
||||||
|
@NotNull(message = "模板文件不可为空")
|
||||||
|
private MultipartFile fileContent;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "content",value = "json文件内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "deptId",value = "部门id")
|
||||||
|
private List<String> deptId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "valueTitle",value = "存取库中")
|
||||||
|
private String valueTitle;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "reportType",value = "模板类型",required = true)
|
||||||
|
@NotBlank(message = "模板类型不可为空")
|
||||||
|
private String reportType;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "reportForm",value = "报表类型",required = true)
|
||||||
|
private String reportForm;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class UpdateReportTemplateParam extends ReportTemplateParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "id",required = true)
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ import lombok.NoArgsConstructor;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName(value = "cs_configuration")
|
@TableName(value = "cs_configuration")
|
||||||
public class CsConfigurationPO extends BaseEntity {
|
public class CsConfigurationPO extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public class CsPagePO extends BaseEntity {
|
|||||||
@TableField(value = "`status`")
|
@TableField(value = "`status`")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
public static final String COL_ID = "id";
|
public static final String COL_ID = "id";
|
||||||
@@ -74,4 +75,7 @@ public class CsPagePO extends BaseEntity {
|
|||||||
public static final String COL_UPDATE_BY = "update_by";
|
public static final String COL_UPDATE_BY = "update_by";
|
||||||
|
|
||||||
public static final String COL_UPDATE_TIME = "update_time";
|
public static final String COL_UPDATE_TIME = "update_time";
|
||||||
|
|
||||||
|
public static final String SORT = "sort";
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
* 自定义报表
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/8/16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName(value = "sys_excel_rpt_temp")
|
||||||
|
public class ExcelRptTemp extends BaseEntity {
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
private Integer activation;
|
||||||
|
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
private String valueTitle;
|
||||||
|
|
||||||
|
private String reportType;
|
||||||
|
|
||||||
|
private String reportForm;
|
||||||
|
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2025-11-17
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("pq_sensitive_user")
|
||||||
|
public class PqSensitiveUser extends BaseEntity implements Serializable{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感用户名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感负荷类型
|
||||||
|
*/
|
||||||
|
private String loadType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户协议容量
|
||||||
|
*/
|
||||||
|
private Double userAgreementCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装机容量
|
||||||
|
*/
|
||||||
|
private Double installedCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属厂站名称
|
||||||
|
*/
|
||||||
|
private String substationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -27,6 +27,9 @@ public class CsRtDataVO {
|
|||||||
@ApiModelProperty("监测点id")
|
@ApiModelProperty("监测点id")
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("设备状态 1:离线 2:在线")
|
||||||
|
private Integer devStatus;
|
||||||
|
|
||||||
@ApiModelProperty("相别")
|
@ApiModelProperty("相别")
|
||||||
private String phaseType;
|
private String phaseType;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EventStatisticsVo implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "监测点名称")
|
||||||
|
private String engineeringName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "电压中断次数")
|
||||||
|
private Integer times1;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "电压暂降次数")
|
||||||
|
private Integer times2;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "电压暂升次数")
|
||||||
|
private Integer times3;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2025-11-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PqSensitiveUserVo implements Serializable{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感用户名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感负荷类型
|
||||||
|
*/
|
||||||
|
private String loadType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否监测
|
||||||
|
*/
|
||||||
|
private String isMonitor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否治理
|
||||||
|
*/
|
||||||
|
private String isGovern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户协议容量
|
||||||
|
*/
|
||||||
|
private Double userAgreementCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装机容量
|
||||||
|
*/
|
||||||
|
private Double installedCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属厂站名称
|
||||||
|
*/
|
||||||
|
private String substationName;
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ReportTemplateDataVO {
|
||||||
|
/**
|
||||||
|
* $HA[_25]#B#max#classId#resourceId$
|
||||||
|
*/
|
||||||
|
private String itemName;
|
||||||
|
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应influxdb数据库中字段
|
||||||
|
*/
|
||||||
|
private String templateName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别
|
||||||
|
*/
|
||||||
|
private String phase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* max min avg cp95
|
||||||
|
*/
|
||||||
|
private String statMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应influxdb数据库的表名
|
||||||
|
*/
|
||||||
|
private String classId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应mysql数据库的表名
|
||||||
|
*/
|
||||||
|
private String resourceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填入的value值
|
||||||
|
*/
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.vo;
|
||||||
|
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
* 自定义报表
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/8/16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ReportTemplateVO extends BaseEntity {
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
|
private Integer activation;
|
||||||
|
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
private String reportType;
|
||||||
|
|
||||||
|
private String reportForm;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/8/18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ReportTreeVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "id",value = "模板索引")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "name",value = "模板字段名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "showName",value = "模板中文展示名")
|
||||||
|
private String showName;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "flag",value = "用于标识最底层对象 1.表示已经没有子级")
|
||||||
|
private Integer flag;
|
||||||
|
|
||||||
|
private List<ReportTreeVO> children;
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author qijian
|
||||||
|
* @since 2022-10-19 09:31:39
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysDeptTempVO implements Serializable {
|
||||||
|
private static final long serialVersionUID = -35391150359300949L;
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 部门主键
|
||||||
|
*/
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板主键
|
||||||
|
*/
|
||||||
|
private String tempId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 激活状态
|
||||||
|
*/
|
||||||
|
private Integer activation;
|
||||||
|
|
||||||
|
//部门名称
|
||||||
|
private String deptName;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.vo.event;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-11-24
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EventCoordsVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "xList",value = "下面的图x轴")
|
||||||
|
private List<String> xList;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "trendList",value = "下面的图y轴")
|
||||||
|
private List<TagObj> trendList;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "innerList",value = "xyz图")
|
||||||
|
private List<inner> innerList;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public static class inner {
|
||||||
|
@ApiModelProperty(name = "x",value = "x轴")
|
||||||
|
private Integer x;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "y",value = "y轴")
|
||||||
|
private Integer y;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "z",value = "z轴")
|
||||||
|
private Integer z;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public static class TagObj {
|
||||||
|
@ApiModelProperty(name = "name",value = "名称")
|
||||||
|
private String name;
|
||||||
|
@ApiModelProperty(name = "trendList",value = "y轴数据")
|
||||||
|
private List<Integer> trendList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.vo.event;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.ibatis.javassist.runtime.Inner;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-11-20
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EventStatisticVO {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "暂降")
|
||||||
|
private Integer eventDown = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "中断")
|
||||||
|
private Integer eventOff = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "暂升")
|
||||||
|
private Integer eventUp = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "总数")
|
||||||
|
private Integer allNum = 0;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.vo.event;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-11-21
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class F47Curve {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "eventId", value = "暂降id")
|
||||||
|
private String eventId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "lineName", value = "监测点名称")
|
||||||
|
private String lineName;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "time", value = "事件发生时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
|
||||||
|
private LocalDateTime time;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "tag", value = "事件类型")
|
||||||
|
private String tag;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "persistTime", value = "持续时间(ms)")
|
||||||
|
private BigDecimal persistTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "eventValue", value = "特征幅值")
|
||||||
|
private BigDecimal eventValue;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.njcn.csharmonic.utils;
|
||||||
|
|
||||||
|
public class DataChangeUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用来将二次值转成一次值
|
||||||
|
*/
|
||||||
|
public static double secondaryToPrimary(String formula, Double data,Double pt, Double ct) {
|
||||||
|
switch (formula) {
|
||||||
|
|
||||||
|
case "*PT":
|
||||||
|
data = data * pt;
|
||||||
|
break;
|
||||||
|
case "*CT":
|
||||||
|
data = data * ct;
|
||||||
|
break;
|
||||||
|
case "*PT*CT":
|
||||||
|
data = data * pt * ct;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用来将一次值转成二次值
|
||||||
|
*/
|
||||||
|
public static double primaryToSecondary(String formula, Double data,Double pt, Double ct) {
|
||||||
|
switch (formula) {
|
||||||
|
case "*PT":
|
||||||
|
data = data / pt;
|
||||||
|
break;
|
||||||
|
case "*CT":
|
||||||
|
data = data / ct;
|
||||||
|
break;
|
||||||
|
case "*PT*CT":
|
||||||
|
data = data / pt / ct;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -119,6 +119,27 @@
|
|||||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||||
<version>3.5.1</version>
|
<version>3.5.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>common-mq</artifactId>
|
||||||
|
<version>${project.version}</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>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>harmonic-common</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -11,14 +11,17 @@ import com.njcn.csharmonic.param.CldEventParam;
|
|||||||
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
||||||
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
||||||
import com.njcn.csharmonic.param.DataParam;
|
import com.njcn.csharmonic.param.DataParam;
|
||||||
|
import com.njcn.csharmonic.pojo.param.EventStatisticParam;
|
||||||
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
||||||
import com.njcn.csharmonic.pojo.vo.CsEventVO;
|
import com.njcn.csharmonic.pojo.vo.CsEventVO;
|
||||||
import com.njcn.csharmonic.pojo.vo.EventDetailVO;
|
import com.njcn.csharmonic.pojo.vo.EventDetailVO;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.EventStatisticsVo;
|
||||||
import com.njcn.csharmonic.service.CsEventPOService;
|
import com.njcn.csharmonic.service.CsEventPOService;
|
||||||
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -63,6 +66,15 @@ public class CsEventController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/pageEvent")
|
||||||
|
@ApiOperation("分页查询暂降事件")
|
||||||
|
public HttpResult<Page<DataGroupEventVO>> pageEvent(@RequestBody EventStatisticParam baseParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("pageEvent");
|
||||||
|
Page<DataGroupEventVO> page = csEventPOService.pageEvent(baseParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@GetMapping("/analyseWave")
|
@GetMapping("/analyseWave")
|
||||||
@ApiOperation("暂态事件波形分析")
|
@ApiOperation("暂态事件波形分析")
|
||||||
@@ -111,6 +123,16 @@ public class CsEventController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/queryById")
|
||||||
|
@ApiOperation("根据事件id查询数据")
|
||||||
|
public HttpResult<CsEventPO> queryById(String eventId) {
|
||||||
|
String methodDescribe = getMethodDescribe("queryById");
|
||||||
|
CsEventPO po = csEventPOService.lambdaQuery().eq(CsEventPO::getId,eventId).one();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/queryByModelId")
|
@PostMapping("/queryByModelId")
|
||||||
@ApiOperation("获取各模块事件")
|
@ApiOperation("获取各模块事件")
|
||||||
@@ -130,4 +152,29 @@ public class CsEventController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getEventByTime")
|
||||||
|
@ApiOperation("根据时间获取无波形的暂态事件")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "lineList", value = "监测点id"),
|
||||||
|
@ApiImplicitParam(name = "startTime", value = "开始时间"),
|
||||||
|
@ApiImplicitParam(name = "endTime", value = "结束时间")
|
||||||
|
})
|
||||||
|
public HttpResult<List<CsEventPO>> getEventByTime(@RequestParam(required = false) List<String> lineList,@RequestParam String startTime,@RequestParam String endTime) {
|
||||||
|
String methodDescribe = getMethodDescribe("getEventByTime");
|
||||||
|
List<CsEventPO> list = csEventPOService.getEventByTime(lineList,startTime,endTime);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/eventStatistics")
|
||||||
|
@ApiOperation("暂态事件统计")
|
||||||
|
@ApiImplicitParam(name = "param", value = "事件信息", required = true)
|
||||||
|
public HttpResult<List<EventStatisticsVo>> getEventStatistics(@RequestBody CsEventUserQueryParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("getEventByTime");
|
||||||
|
List<EventStatisticsVo> list = csEventPOService.getEventStatistics(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,282 @@
|
|||||||
|
package com.njcn.csharmonic.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
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.csharmonic.param.SensitiveUserReportQueryParam;
|
||||||
|
import com.njcn.csharmonic.pojo.param.ReportSearchParam;
|
||||||
|
import com.njcn.csharmonic.pojo.param.ReportTemplateParam;
|
||||||
|
import com.njcn.csharmonic.pojo.po.ExcelRptTemp;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.ReportTemplateVO;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.ReportTreeVO;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.SysDeptTempVO;
|
||||||
|
import com.njcn.csharmonic.service.CustomReportService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
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 javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
* 用户自定义报表
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/8/15
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/customReport")
|
||||||
|
@Api(tags = "用户自定义报表")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CustomReportController extends BaseController {
|
||||||
|
|
||||||
|
private final CustomReportService customReportService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 替换报表数据并返回
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/19
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getCustomReport")
|
||||||
|
@ApiOperation("获取报表")
|
||||||
|
@ApiImplicitParam(name = "reportSearchParam", value = "查询体", required = false)
|
||||||
|
public void getCustomReport(@RequestBody ReportSearchParam reportSearchParam, HttpServletResponse response) {
|
||||||
|
customReportService.getCustomReport(reportSearchParam,response);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增自定义报表模板
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/10/19
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType=OperateType.ADD)
|
||||||
|
@PostMapping("/addTemplate")
|
||||||
|
@ApiOperation("新增自定义报表模板")
|
||||||
|
public HttpResult<Boolean> addCustomReportTemplate(@Validated ReportTemplateParam reportTemplateParam){
|
||||||
|
String methodDescribe = getMethodDescribe("addCustomReportTemplate");
|
||||||
|
boolean res = customReportService.addCustomReportTemplate(reportTemplateParam);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有模板
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/14
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getTemplateList")
|
||||||
|
@ApiOperation("查询报表模板")
|
||||||
|
@ApiImplicitParam(name = "reportSearchParam", value = "实体参数", required = false)
|
||||||
|
public HttpResult<List<ReportTemplateVO>> getTemplateList(@RequestBody ReportSearchParam reportSearchParam){
|
||||||
|
String methodDescribe = getMethodDescribe("getTemplateList");
|
||||||
|
List<ReportTemplateVO> list = customReportService.getTemplateList(reportSearchParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据部门查询模板
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/19
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/getTemplateByDept")
|
||||||
|
@ApiOperation("根据部门查询模板")
|
||||||
|
@ApiImplicitParam(name = "id", value = "id", required = true)
|
||||||
|
public HttpResult<List<ReportTemplateVO>> getTemplateByDept(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("getTemplateList");
|
||||||
|
List<ReportTemplateVO> list = customReportService.getTemplateByDept(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除模板
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/18
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType=OperateType.DELETE)
|
||||||
|
@PostMapping("/delTemplate")
|
||||||
|
@ApiOperation("删除报表模板")
|
||||||
|
@ApiImplicitParam(name = "reportSearchParam", value = "实体参数", required = false)
|
||||||
|
public HttpResult<Boolean> delTemplate(@RequestBody ReportSearchParam reportSearchParam){
|
||||||
|
String methodDescribe = getMethodDescribe("delTemplate");
|
||||||
|
boolean res = customReportService.delTemplate(reportSearchParam);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询模板详情
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/14
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/getCustomReportTemplateById")
|
||||||
|
@ApiOperation("根据id查询模板详情")
|
||||||
|
@ApiImplicitParam(name = "id", value = "id", required = true)
|
||||||
|
public HttpResult<ExcelRptTemp> getCustomReportTemplateById(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("getCustomReportTemplateById");
|
||||||
|
ExcelRptTemp excelRptTemp = customReportService.getCustomReportTemplateById(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, excelRptTemp, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id回显模板
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/14
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/viewCustomReportTemplateById")
|
||||||
|
@ApiOperation("根据id查询模板详情")
|
||||||
|
@ApiImplicitParam(name = "id", value = "id", required = true)
|
||||||
|
public void viewCustomReportTemplateById(@RequestParam("id") String id,HttpServletResponse response){
|
||||||
|
customReportService.viewCustomReportTemplateById(id,response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改自定义报表模板
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/18
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType=OperateType.UPDATE)
|
||||||
|
@PostMapping("/updateTemplate")
|
||||||
|
@ApiOperation("修改自定义报表模板")
|
||||||
|
public HttpResult<Boolean> updateCustomReportTemplate(@Validated ReportTemplateParam.UpdateReportTemplateParam reportTemplateParam){
|
||||||
|
String methodDescribe = getMethodDescribe("updateCustomReportTemplate");
|
||||||
|
boolean res = customReportService.updateCustomReportTemplate(reportTemplateParam);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定/解绑模板数据
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/19
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType=OperateType.UPDATE)
|
||||||
|
@PostMapping("/updateBindTemplate")
|
||||||
|
@ApiOperation("绑定/解绑模板数据")
|
||||||
|
@ApiImplicitParam(name = "reportSearchParams", value = "实体参数", required = false)
|
||||||
|
public HttpResult<Boolean> updateBindTemplate(@RequestBody List<ReportSearchParam> reportSearchParams){
|
||||||
|
String methodDescribe = getMethodDescribe("updateBindTemplate");
|
||||||
|
boolean res = customReportService.updateBindTemplate(reportSearchParams);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据模板ID查询数据
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/19
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/getDataByTempId")
|
||||||
|
@ApiOperation("根据模板ID查询数据")
|
||||||
|
@ApiImplicitParam(name = "id", value = "id", required = true)
|
||||||
|
public HttpResult<List<SysDeptTempVO>> getDataByTempId(@RequestParam("id")String id){
|
||||||
|
String methodDescribe = getMethodDescribe("getDataByTempId");
|
||||||
|
List<SysDeptTempVO> list = customReportService.getDataByTempId(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改激活状态
|
||||||
|
* @author qijian
|
||||||
|
* @date 2022/10/17
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType=OperateType.UPDATE)
|
||||||
|
@PostMapping("/updateTemplateActive")
|
||||||
|
@ApiOperation("修改激活状态")
|
||||||
|
@ApiImplicitParam(name = "reportSearchParam", value = "实体参数", required = false)
|
||||||
|
public HttpResult<Page<ExcelRptTemp>> updateTemplateActive(@RequestBody ReportSearchParam reportSearchParam){
|
||||||
|
String methodDescribe = getMethodDescribe("updateTemplateActive");
|
||||||
|
boolean res = customReportService.updateStatus(reportSearchParam);
|
||||||
|
if(res){
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取报表模板树
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/8/16
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/reportChooseTree")
|
||||||
|
@ApiOperation("获取报表模板树")
|
||||||
|
public HttpResult<List<ReportTreeVO>> reportChooseTree(){
|
||||||
|
String methodDescribe = getMethodDescribe("reportChooseTree");
|
||||||
|
List<ReportTreeVO> res = customReportService.reportChooseTree();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取报表指标是否合格模板树
|
||||||
|
* @author cdf
|
||||||
|
* @date 2023/10/11
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/targetLimitChooseTree")
|
||||||
|
@ApiOperation("获取报表指标是否合格模板树")
|
||||||
|
public HttpResult<List<ReportTreeVO>> targetLimitChooseTree(){
|
||||||
|
String methodDescribe = getMethodDescribe("targetLimitChooseTree");
|
||||||
|
List<ReportTreeVO> res = customReportService.targetLimitChooseTree();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取报表台账模板树
|
||||||
|
* @author cdf
|
||||||
|
* @date 2023/10/11
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/terminalChooseTree")
|
||||||
|
@ApiOperation("获取报表台账模板树")
|
||||||
|
public HttpResult<List<ReportTreeVO>> terminalChooseTree(){
|
||||||
|
String methodDescribe = getMethodDescribe("terminalChooseTree");
|
||||||
|
List<ReportTreeVO> res = customReportService.terminalChooseTree();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getSensitiveUserReport")
|
||||||
|
@ApiOperation("获取监测对象治理报表")
|
||||||
|
@ApiImplicitParam(name = "queryParam", value = "查询体", required = true)
|
||||||
|
public void getSensitiveUserReport(@RequestBody SensitiveUserReportQueryParam queryParam, HttpServletResponse response) {
|
||||||
|
customReportService.getSensitiveUserReport(queryParam,response);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
package com.njcn.csharmonic.controller;
|
||||||
|
|
||||||
|
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.csharmonic.pojo.param.EventStatisticParam;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.event.EventCoordsVO;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.event.EventStatisticVO;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.event.F47Curve;
|
||||||
|
import com.njcn.csharmonic.service.event.EventOverviewService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import com.njcn.web.utils.RequestUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-11-20
|
||||||
|
* @Description: 暂降概览
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/csevent")
|
||||||
|
@Api(tags = "暂降概览")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EventOverviewController extends BaseController {
|
||||||
|
|
||||||
|
private final EventOverviewService eventOverviewService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("暂降类型分类统计Echart")
|
||||||
|
@PostMapping("netEventEcharts")
|
||||||
|
public HttpResult<EventStatisticVO> netEventEcharts(@RequestBody EventStatisticParam baseParam){
|
||||||
|
String methodDescribe = getMethodDescribe("netEventEcharts");
|
||||||
|
EventStatisticVO eventStatisticVO = eventOverviewService.netEventEcharts(baseParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eventStatisticVO, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("暂降类型分类统计表格")
|
||||||
|
@PostMapping("netEventTable")
|
||||||
|
public HttpResult<List<EventStatisticVO>> netEventTable(@RequestBody EventStatisticParam baseParam){
|
||||||
|
String methodDescribe = getMethodDescribe("netEventTable");
|
||||||
|
List<EventStatisticVO> list = eventOverviewService.netEventTable(baseParam);
|
||||||
|
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("F47曲线")
|
||||||
|
@PostMapping("f47Curve")
|
||||||
|
public HttpResult<List<F47Curve>> getF47Curve(@RequestBody EventStatisticParam baseParam){
|
||||||
|
String methodDescribe = getMethodDescribe("getF47Curve");
|
||||||
|
List<F47Curve> list = eventOverviewService.getF47Curve(baseParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("日历暂降事件详情")
|
||||||
|
@PostMapping("getEventDate")
|
||||||
|
public HttpResult<List<EventStatisticVO>> getEventDate(@RequestBody EventStatisticParam baseParam){
|
||||||
|
String methodDescribe = getMethodDescribe("getEventDate");
|
||||||
|
List<EventStatisticVO> list = eventOverviewService.getEventDate(baseParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getEventCoords")
|
||||||
|
@ApiOperation("获取电压暂态表及密度坐标图")
|
||||||
|
public HttpResult<EventCoordsVO> getEventCoords(@RequestBody EventStatisticParam baseParam){
|
||||||
|
String methodDescribe = getMethodDescribe("getEventCoords");
|
||||||
|
EventCoordsVO vo = eventOverviewService.getEventCoords(baseParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,vo,methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
package com.njcn.csharmonic.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
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.constant.OperateType;
|
||||||
|
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.csharmonic.pojo.param.PqSensitiveUserParam;
|
||||||
|
import com.njcn.csharmonic.pojo.po.PqSensitiveUser;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.PqSensitiveUserVo;
|
||||||
|
import com.njcn.csharmonic.service.IPqSensitiveUserService;
|
||||||
|
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.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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2025-11-17
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pqSensitiveUser")
|
||||||
|
@Api(tags = "敏感负荷用户管理")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PqSensitiveUserController extends BaseController {
|
||||||
|
|
||||||
|
private final IPqSensitiveUserService pqSensitiveUserService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getList")
|
||||||
|
@ApiOperation("获取敏感负荷用户列表")
|
||||||
|
@ApiImplicitParam(name = "param", value = "查询参数", required = true)
|
||||||
|
public HttpResult<Page<PqSensitiveUserVo>> getList(@RequestBody BaseParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("getList");
|
||||||
|
Page<PqSensitiveUserVo> page = pqSensitiveUserService.getList(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getListByIds")
|
||||||
|
@ApiOperation("根据id集合获取敏感负荷用户列表")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "id集合")
|
||||||
|
public HttpResult<List<PqSensitiveUser>> getListByIds(@RequestParam(name = "ids", required = false) List<String> ids) {
|
||||||
|
String methodDescribe = getMethodDescribe("getListByIds");
|
||||||
|
List<PqSensitiveUser> list = pqSensitiveUserService.list(
|
||||||
|
new LambdaQueryWrapper<PqSensitiveUser>()
|
||||||
|
.in(CollUtil.isNotEmpty(ids),PqSensitiveUser::getId, ids)
|
||||||
|
);
|
||||||
|
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户对象
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperation("新增用户对象")
|
||||||
|
public HttpResult<Boolean> save(@RequestBody @Validated PqSensitiveUserParam pqSensitiveUserParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("save");
|
||||||
|
pqSensitiveUserService.save(pqSensitiveUserParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户对象
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.UPDATE)
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperation("修改用户对象")
|
||||||
|
public HttpResult<Boolean> update(@RequestBody @Validated PqSensitiveUserParam.UpdatePqSensitiveUserParam pqSensitiveUserParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("update");
|
||||||
|
pqSensitiveUserService.update(pqSensitiveUserParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户对象
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
||||||
|
@PostMapping("/delete")
|
||||||
|
@ApiOperation("删除用户对象")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "id集合")
|
||||||
|
public HttpResult<Boolean> delete(@RequestBody List<String> ids) {
|
||||||
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
|
pqSensitiveUserService.removeByIds(ids);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.njcn.csharmonic.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.csharmonic.pojo.param.ReportSearchParam;
|
||||||
|
import com.njcn.csharmonic.pojo.po.ExcelRptTemp;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.ReportTemplateVO;
|
||||||
|
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/8/16
|
||||||
|
*/
|
||||||
|
public interface ExcelRptTempMapper extends BaseMapper<ExcelRptTemp> {
|
||||||
|
|
||||||
|
Page<ReportTemplateVO> getReportTemplateListPage(Page<BaseParam> page, @Param("baseParam")BaseParam baseParam);
|
||||||
|
|
||||||
|
List<ReportTemplateVO> getReportTemplateList(@Param("reportSearchParam")ReportSearchParam reportSearchParam);
|
||||||
|
|
||||||
|
List<ReportTemplateVO> getReportTemplateByDept(@Param("ids") List<String> ids);
|
||||||
|
|
||||||
|
|
||||||
|
@Select("${sqlStr}")
|
||||||
|
StatisticalDataDTO dynamicSql(@Param("sqlStr")String sql);
|
||||||
|
|
||||||
|
@Select("${sqlStr}")
|
||||||
|
Map<String, Float> dynamicSqlMap(@Param("sqlStr")String sql);
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user