Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 867176d8a0 | |||
|
|
e6e6790ee2 | ||
| 6811d02f6b | |||
|
|
4745b86085 | ||
| d1574e43be | |||
| f13c8670cb | |||
| 162f39543e | |||
|
|
0cf9a45436 | ||
|
|
f9aa1d4f69 | ||
| 196de3a1d8 | |||
| 16551b2451 | |||
| d3f32fd396 | |||
| 35e521365d | |||
| e836d9bd07 | |||
| 509712b5b5 | |||
|
|
65afb4eddc | ||
| 86ad89d06c | |||
|
|
a6465911c4 | ||
|
|
aaa1f69ec2 | ||
| f86f18817d | |||
| 46a9922313 | |||
|
|
72807b6d13 | ||
|
|
87e67a4f23 | ||
| e0d5c3e52c | |||
|
|
73374c6b8d | ||
| 0a45b1303d | |||
| facaba6606 | |||
| d2bff5bb81 | |||
|
|
f5bc7e3c2c | ||
|
|
9821b30d94 | ||
| 5a6677ce3d | |||
| d54ec83d1c | |||
| d0aac0886a | |||
|
|
1402287fd5 | ||
| 2bc0f6f563 | |||
| e5067abdfb | |||
| 2d134809a0 | |||
| 7205d8a324 | |||
| 74a83d6f44 | |||
| 3d9acfe95b | |||
| 26e45ddbc5 | |||
| 67cbff33ef | |||
| ad0f7bc3fc |
@@ -53,6 +53,12 @@
|
|||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>common-device-biz</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
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.CsCommTerminalFeignClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.api.fallback.CsDeviceUserClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
|
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/commTerminal", fallbackFactory = CsCommTerminalFeignClientFallbackFactory.class,contextId = "deviceUser")
|
||||||
|
public interface CsCommTerminalFeignClient {
|
||||||
|
|
||||||
|
@GetMapping("lineUnitDetail")
|
||||||
|
HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
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.CsSoftInfoClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsSoftInfoPO;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/csSoftInfo", fallbackFactory = CsSoftInfoClientFallbackFactory.class,contextId = "csSoftInfo")
|
||||||
|
public interface CsSoftInfoFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/findSoftInfo")
|
||||||
|
HttpResult<CsSoftInfoPO> findSoftInfo(@RequestParam("id") String id);
|
||||||
|
|
||||||
|
@PostMapping("/saveSoftInfo")
|
||||||
|
HttpResult<String> saveSoftInfo(@RequestBody CsSoftInfoPO po);
|
||||||
|
|
||||||
|
@PostMapping("/removeSoftInfo")
|
||||||
|
HttpResult<String> removeSoftInfo(@RequestParam("id") String id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ import com.njcn.csdevice.pojo.po.CsDataSet;
|
|||||||
import com.njcn.csdevice.pojo.vo.LineTargetVO;
|
import com.njcn.csdevice.pojo.vo.LineTargetVO;
|
||||||
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.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -27,4 +28,8 @@ public interface DataSetFeignClient {
|
|||||||
@PostMapping("/getModuleDataSet")
|
@PostMapping("/getModuleDataSet")
|
||||||
HttpResult<List<CsDataSet>> getModuleDataSet(@RequestParam("modelId") String modelId);
|
HttpResult<List<CsDataSet>> getModuleDataSet(@RequestParam("modelId") String modelId);
|
||||||
|
|
||||||
|
@PostMapping("/getDataSetBySetIds")
|
||||||
|
HttpResult<List<CsDataSet>> getDataSetBySetIds(@RequestBody List<String> lineIds);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
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.DeviceFtpClientFallbackFactory;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/deviceFile", fallbackFactory = DeviceFtpClientFallbackFactory.class,contextId = "deviceFile")
|
||||||
|
|
||||||
|
public interface DeviceFtpFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/downloadFile")
|
||||||
|
HttpResult<String> downloadFile(@RequestParam("nDid") String nDid, @RequestParam("name") String name, @RequestParam("size") Integer size, @RequestParam("fileCheck") String fileCheck);
|
||||||
|
}
|
||||||
@@ -1,11 +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.EquipmentFeignClientFallbackFactory;
|
import com.njcn.csdevice.api.fallback.EquipmentFeignClientFallbackFactory;
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
||||||
|
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.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
@@ -50,4 +55,7 @@ public interface EquipmentFeignClient {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/updateModuleNumber")
|
@PostMapping("/updateModuleNumber")
|
||||||
HttpResult<String> updateModuleNumber(@RequestParam("nDid") String nDid,@RequestParam("number") Integer number);
|
HttpResult<String> updateModuleNumber(@RequestParam("nDid") String nDid,@RequestParam("number") Integer number);
|
||||||
|
|
||||||
|
@PostMapping("/getAll")
|
||||||
|
HttpResult<List<CsEquipmentDeliveryPO>> getAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
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.PortableOffLogFeignClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.api.fallback.ProcessFeignClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsEquipmentProcessPO;
|
||||||
|
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;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/portableOfflLog", fallbackFactory = PortableOffLogFeignClientFallbackFactory.class,contextId = "PortableOffLog")
|
||||||
|
|
||||||
|
public interface PortableOffLogFeignClient {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(value = "dataOnlineRecruitment")
|
||||||
|
HttpResult<String> dataOnlineRecruitment(@RequestParam("devId") String devId
|
||||||
|
, @RequestParam("lineId") String lineId, @RequestParam("path") String path);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
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.WlRecordClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.pojo.param.WlRecordParam;
|
||||||
|
import com.njcn.csdevice.pojo.po.WlRecord;
|
||||||
|
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;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/wlRecord", fallbackFactory = WlRecordClientFallbackFactory.class,contextId = "wlRecord")
|
||||||
|
|
||||||
|
public interface WlRecordFeignClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增原始数据
|
||||||
|
*/
|
||||||
|
@PostMapping("/addBaseData")
|
||||||
|
HttpResult<Boolean> addBaseData(@RequestBody @Validated WlRecord wlRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增原始数据
|
||||||
|
*/
|
||||||
|
@PostMapping("/addBaseDataList")
|
||||||
|
HttpResult<Boolean> addBaseDataList(@RequestBody @Validated List<WlRecord> wlRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按条件查询设备基础数据
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/findDevBaseData")
|
||||||
|
HttpResult<WlRecord> findDevBaseData(@RequestBody @Validated WlRecordParam.Record param);
|
||||||
|
|
||||||
|
@PostMapping("/updateTestRecord")
|
||||||
|
HttpResult<Boolean> updateTestRecord(@RequestBody @Validated WlRecordParam.UpdateRecord record);
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
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.CsCommTerminalFeignClient;
|
||||||
|
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class CsCommTerminalFeignClientFallbackFactory implements FallbackFactory<CsCommTerminalFeignClient> {
|
||||||
|
@Override
|
||||||
|
public CsCommTerminalFeignClient create(Throwable cause) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if (cause.getCause() instanceof BusinessException) {
|
||||||
|
BusinessException businessException = (BusinessException) cause.getCause();
|
||||||
|
}
|
||||||
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
|
return new CsCommTerminalFeignClient() {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<PqsDeviceUnit> lineUnitDetail(String lineId) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","查询分组",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
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.CsSoftInfoFeignClient;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsSoftInfoPO;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class CsSoftInfoClientFallbackFactory implements FallbackFactory<CsSoftInfoFeignClient> {
|
||||||
|
@Override
|
||||||
|
public CsSoftInfoFeignClient create(Throwable cause) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if (cause.getCause() instanceof BusinessException) {
|
||||||
|
BusinessException businessException = (BusinessException) cause.getCause();
|
||||||
|
}
|
||||||
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
|
return new CsSoftInfoFeignClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<CsSoftInfoPO> findSoftInfo(String id) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","获取装置软件信息",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> saveSoftInfo(CsSoftInfoPO po) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","保存软件程序",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> removeSoftInfo(String id) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","删除软件程序",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -50,6 +50,12 @@ public class DataSetFeignClientFallbackFactory implements FallbackFactory<DataSe
|
|||||||
log.error("{}异常,降级处理,异常为:{}","获取子模块数据集",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","获取子模块数据集",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<CsDataSet>> getDataSetBySetIds(List<String> lineIds) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据数据集ids获取数据集",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
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.DeviceFtpFeignClient;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class DeviceFtpClientFallbackFactory implements FallbackFactory<DeviceFtpFeignClient> {
|
||||||
|
@Override
|
||||||
|
public DeviceFtpFeignClient create(Throwable cause) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if (cause.getCause() instanceof BusinessException) {
|
||||||
|
BusinessException businessException = (BusinessException) cause.getCause();
|
||||||
|
}
|
||||||
|
Enum<?> DeviceFtpFeignClient = exceptionEnum;
|
||||||
|
return new DeviceFtpFeignClient() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> downloadFile(String nDid, String name, Integer size, String fileCheck) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","文件下载处理",cause.toString());
|
||||||
|
throw new BusinessException(DeviceFtpFeignClient);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -71,6 +71,12 @@ public class EquipmentFeignClientFallbackFactory implements FallbackFactory<Equi
|
|||||||
log.error("{}异常,降级处理,异常为:{}","更新设备模块个数",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","更新设备模块个数",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<CsEquipmentDeliveryPO>> getAll() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","获取所有装置",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
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.PortableOffLogFeignClient;
|
||||||
|
import com.njcn.csdevice.api.ProcessFeignClient;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsEquipmentProcessPO;
|
||||||
|
import com.njcn.csdevice.utils.CsDeviceEnumUtil;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 20:09
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class PortableOffLogFeignClientFallbackFactory implements FallbackFactory<PortableOffLogFeignClient> {
|
||||||
|
@Override
|
||||||
|
public PortableOffLogFeignClient create(Throwable cause) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if (cause.getCause() instanceof BusinessException) {
|
||||||
|
BusinessException businessException = (BusinessException) cause.getCause();
|
||||||
|
exceptionEnum = CsDeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||||
|
}
|
||||||
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
|
return new PortableOffLogFeignClient() {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> dataOnlineRecruitment(String devId, String lineId, String path) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","线上补招",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
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.WlRecordFeignClient;
|
||||||
|
import com.njcn.csdevice.pojo.param.WlRecordParam;
|
||||||
|
import com.njcn.csdevice.pojo.po.WlRecord;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class WlRecordClientFallbackFactory implements FallbackFactory<WlRecordFeignClient> {
|
||||||
|
@Override
|
||||||
|
public WlRecordFeignClient create(Throwable cause) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if (cause.getCause() instanceof BusinessException) {
|
||||||
|
BusinessException businessException = (BusinessException) cause.getCause();
|
||||||
|
}
|
||||||
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
|
return new WlRecordFeignClient() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<Boolean> addBaseData(WlRecord wlRecord) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","新增原始数据",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<Boolean> addBaseDataList(List<WlRecord> wlRecord) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","批量新增原始数据",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<WlRecord> findDevBaseData(WlRecordParam.Record param) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","查询装置基础数据",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<Boolean> updateTestRecord(WlRecordParam.UpdateRecord record) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","修改测试项",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -52,6 +52,9 @@ public interface DataParam {
|
|||||||
|
|
||||||
String EvtParamPhase = "Evt_Param_Phase";
|
String EvtParamPhase = "Evt_Param_Phase";
|
||||||
|
|
||||||
|
String EvtParamDepth = "Evt_Param_VVaDepth";
|
||||||
|
String EVTPARAMTM ="Evt_Param_Tm";
|
||||||
|
|
||||||
String evtData = "evt_data";
|
String evtData = "evt_data";
|
||||||
|
|
||||||
String wlRecordPath = "test/";
|
String wlRecordPath = "test/";
|
||||||
|
|||||||
@@ -38,7 +38,15 @@ public enum AlgorithmResponseEnum {
|
|||||||
|
|
||||||
DATA_ARRAY_MISSING("A00515","详细数据为空"),
|
DATA_ARRAY_MISSING("A00515","详细数据为空"),
|
||||||
UNKNOW_ROLE("A00515","角色无权限操作"),
|
UNKNOW_ROLE("A00515","角色无权限操作"),
|
||||||
DATA_MISSING("A00516","数据缺失")
|
DATA_MISSING("A00516","数据缺失"),
|
||||||
|
ASK_DEVICE_DIR_ROOT_ERROR("A00516","读取装置根目录异常"),
|
||||||
|
ASK_DEVICE_DIR_ERROR("A00516","读取装置文件异常,请重试"),
|
||||||
|
FILE_DOWNLOAD_ERROR("A00516","下载失败"),
|
||||||
|
FILE_DOWNLOADING("A00516","下载失败,系统正在响应其他下载任务,请稍后重试"),
|
||||||
|
FILE_UPLOADING("A00516","上传失败,系统正在响应其他上传任务,请稍后重试"),
|
||||||
|
FILE_BUSY("A00516","正在进行其他文件操作,请稍后重试"),
|
||||||
|
RECORD_FILE_LOST("A00516","record.bin文件缺失,请检查上传文件夹"),
|
||||||
|
LINE_NUM_MISMATCH("A00516","上传文件的监测点序号和选择的监测点不匹配,请检查"),
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.njcn.csdevice.pojo.param;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,7 +18,7 @@ import java.util.List;
|
|||||||
public class WlRecordParam {
|
public class WlRecordParam {
|
||||||
|
|
||||||
@ApiModelProperty("方案名称")
|
@ApiModelProperty("方案名称")
|
||||||
private String itemName;
|
private String proName;
|
||||||
|
|
||||||
@ApiModelProperty("描述")
|
@ApiModelProperty("描述")
|
||||||
private String describe;
|
private String describe;
|
||||||
@@ -25,6 +27,18 @@ public class WlRecordParam {
|
|||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public static class Record extends WlRecordParam {
|
public static class Record extends WlRecordParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("装置id")
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目起始时间")
|
||||||
|
private LocalDateTime proStartTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目结束时间")
|
||||||
|
private LocalDateTime proEndTime;
|
||||||
|
|
||||||
@ApiModelProperty("测试项名称")
|
@ApiModelProperty("测试项名称")
|
||||||
private String itemName;
|
private String itemName;
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,16 @@ public class CsLinePO extends BaseEntity {
|
|||||||
@TableField(value = "`position`")
|
@TableField(value = "`position`")
|
||||||
private String position;
|
private String position;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据集id
|
||||||
|
*/
|
||||||
|
private String dataSetId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板id
|
||||||
|
*/
|
||||||
|
private String dataModelId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压等级
|
* 电压等级
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.njcn.csdevice.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 系统软件表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-05-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("cs_soft_info")
|
||||||
|
public class CsSoftInfoPO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 读写操作属性:“r”
|
||||||
|
*/
|
||||||
|
private String opAttr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作系统名称,裸机系统填Null
|
||||||
|
*/
|
||||||
|
private String osName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作系统版本,裸机系统填Null
|
||||||
|
*/
|
||||||
|
private String osVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用程序版本号
|
||||||
|
*/
|
||||||
|
private String appVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用程序发布日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime appDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用程序校验码
|
||||||
|
*/
|
||||||
|
private String appCheck;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否支持远程升级程序
|
||||||
|
*/
|
||||||
|
private String softUpdate;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -145,4 +145,9 @@ public class WlRecord extends BaseEntity {
|
|||||||
@TableField(value = "`describe`")
|
@TableField(value = "`describe`")
|
||||||
private String describe;
|
private String describe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程路径
|
||||||
|
*/
|
||||||
|
private String gcDataPath;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ public class CsDevModelPageVO extends BaseEntity {
|
|||||||
* 版本日期
|
* 版本日期
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "版本日期")
|
@ApiModelProperty(value = "版本日期")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||||
private Date versionDate;
|
private Date versionDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ public class CsLedgerVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "comFlag",value = "设备状态")
|
@ApiModelProperty(name = "comFlag",value = "设备状态")
|
||||||
private Integer comFlag;
|
private Integer comFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "nDid",value = "nDid")
|
||||||
|
private String nDId;
|
||||||
|
|
||||||
@ApiModelProperty(name = "children",value = "子节点")
|
@ApiModelProperty(name = "children",value = "子节点")
|
||||||
private List<CsLedgerVO> children = new ArrayList<>();
|
private List<CsLedgerVO> children = new ArrayList<>();
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,6 @@ public class DataGroupEventVO {
|
|||||||
@ApiModelProperty("事件ID")
|
@ApiModelProperty("事件ID")
|
||||||
private String eventId;
|
private String eventId;
|
||||||
|
|
||||||
@ApiModelProperty("变电站名称")
|
|
||||||
private String subName;
|
|
||||||
|
|
||||||
@ApiModelProperty("监测点ID")
|
@ApiModelProperty("监测点ID")
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
@@ -39,7 +36,7 @@ public class DataGroupEventVO {
|
|||||||
private String itemName;
|
private String itemName;
|
||||||
|
|
||||||
@ApiModelProperty("持续时间")
|
@ApiModelProperty("持续时间")
|
||||||
private Double duration;
|
private Double persistTime;
|
||||||
|
|
||||||
@ApiModelProperty("发生时刻")
|
@ApiModelProperty("发生时刻")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss.SSS")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss.SSS")
|
||||||
|
|||||||
@@ -42,6 +42,16 @@ public class DeviceManagerVO {
|
|||||||
@ApiModelProperty(value = "装置数据标识")
|
@ApiModelProperty(value = "装置数据标识")
|
||||||
private String dataLevel;
|
private String dataLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "应用程序版本号")
|
||||||
|
private String appVersion;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "应用程序发布日期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||||
|
private LocalDateTime appDate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "应用程序校验码")
|
||||||
|
private String appCheck;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class DataSetVO {
|
public static class DataSetVO {
|
||||||
@ApiModelProperty(value = "数据集Id")
|
@ApiModelProperty(value = "数据集Id")
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
package com.njcn.csdevice.utils;
|
package com.njcn.csdevice.utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类的介绍:用来将二次值转成一次值
|
* 类的介绍:
|
||||||
* @author xuyang
|
* @author xuyang
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
*/
|
*/
|
||||||
public class DataChangeUtil {
|
public class DataChangeUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用来将二次值转成一次值
|
||||||
|
*/
|
||||||
public static double secondaryToPrimary(String formula, Double data,Double pt, Double ct) {
|
public static double secondaryToPrimary(String formula, Double data,Double pt, Double ct) {
|
||||||
switch (formula) {
|
switch (formula) {
|
||||||
case "*PT":
|
case "*PT":
|
||||||
@@ -23,4 +26,24 @@ public class DataChangeUtil {
|
|||||||
}
|
}
|
||||||
return data;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,13 +154,17 @@
|
|||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>event-api</artifactId>
|
<artifactId>access-api</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -16,10 +16,7 @@ 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.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -76,5 +73,15 @@ public class CsDataSetController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getDataSetBySetIds")
|
||||||
|
@ApiOperation("根据测点获取数据集")
|
||||||
|
@ApiImplicitParam(name = "lineIds", value = "监测点ids", required = true)
|
||||||
|
public HttpResult<List<CsDataSet>> getDataSetBySetIds(@RequestBody List<String> lineIds){
|
||||||
|
String methodDescribe = getMethodDescribe("getDataSetBySetIds");
|
||||||
|
List<CsDataSet> list = csDataSetService.getDataSetBySetIds(lineIds);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package com.njcn.csdevice.controller.equipment;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.mapper.CsSoftInfoMapper;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsSoftInfoPO;
|
||||||
|
import com.njcn.csdevice.service.ICsSoftInfoService;
|
||||||
|
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.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 系统软件表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-08-09
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/csSoftInfo")
|
||||||
|
@Api(tags = "装置程序信息")
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Validated
|
||||||
|
public class CsSoftInfoController extends BaseController {
|
||||||
|
|
||||||
|
private final CsSoftInfoMapper csSoftInfoMapper;
|
||||||
|
private final ICsSoftInfoService csSoftInfoService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/findSoftInfo")
|
||||||
|
@ApiOperation("获取程序软件信息")
|
||||||
|
@ApiImplicitParam(name = "id", value = "id", required = true)
|
||||||
|
public HttpResult<CsSoftInfoPO> findSoftInfo(@RequestParam String id){
|
||||||
|
String methodDescribe = getMethodDescribe("findSoftInfo");
|
||||||
|
CsSoftInfoPO po = csSoftInfoMapper.selectById(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/saveSoftInfo")
|
||||||
|
@ApiOperation("保存程序软件信息")
|
||||||
|
@ApiImplicitParam(name = "po", value = "po", required = true)
|
||||||
|
public HttpResult<String> saveSoftInfo(@RequestBody CsSoftInfoPO po){
|
||||||
|
String methodDescribe = getMethodDescribe("saveSoftInfo");
|
||||||
|
csSoftInfoService.save(po);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/removeSoftInfo")
|
||||||
|
@ApiOperation("删除程序软件信息")
|
||||||
|
@ApiImplicitParam(name = "id", value = "id", required = true)
|
||||||
|
public HttpResult<String> removeSoftInfo(@RequestParam String id){
|
||||||
|
String methodDescribe = getMethodDescribe("removeSoftInfo");
|
||||||
|
csSoftInfoService.removeById(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
package com.njcn.csdevice.controller.equipment;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
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.exception.BusinessException;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
|
import com.njcn.csdevice.service.DeviceFtpService;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.MakeUpVo;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "装置文件管理")
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("/deviceFile")
|
||||||
|
public class DeviceFtpController extends BaseController {
|
||||||
|
|
||||||
|
private final DeviceFtpService deviceFtpService;
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/askDeviceRootPath")
|
||||||
|
@ApiOperation("设备根目录询问")
|
||||||
|
@ApiImplicitParam(name = "nDid", value = "nDid", required = true)
|
||||||
|
public HttpResult<MakeUpVo> askDeviceRootPath(@RequestParam("nDid") String nDid){
|
||||||
|
String methodDescribe = getMethodDescribe("askDeviceRootPath");
|
||||||
|
MakeUpVo vo = deviceFtpService.askDeviceRootPath(nDid);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/askDeviceFileOrDir")
|
||||||
|
@ApiOperation("设备文件/目录信息询问")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "nDid", value = "nDid", required = true),
|
||||||
|
@ApiImplicitParam(name = "name", value = "文件路径名", required = true),
|
||||||
|
@ApiImplicitParam(name = "type", value = "文件类型", required = true)
|
||||||
|
})
|
||||||
|
public HttpResult<List<MakeUpVo>> askDeviceFileOrDir(@RequestParam("nDid") String nDid, @RequestParam("name") String name, @RequestParam("type") String type){
|
||||||
|
String methodDescribe = getMethodDescribe("askDeviceFileOrDir");
|
||||||
|
List<MakeUpVo> list = deviceFtpService.askDeviceFileOrDir(nDid,name,type);
|
||||||
|
if (CollectionUtil.isEmpty(list) && Objects.equals(type,"file")) {
|
||||||
|
throw new BusinessException(AlgorithmResponseEnum.ASK_DEVICE_DIR_ERROR);
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/downloadFile")
|
||||||
|
@ApiOperation("设备文件下载")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "nDid", value = "nDid", required = true),
|
||||||
|
@ApiImplicitParam(name = "name", value = "文件路径名", required = true),
|
||||||
|
@ApiImplicitParam(name = "size", value = "文件大小(单位byte)", required = true),
|
||||||
|
@ApiImplicitParam(name = "fileCheck", value = "文件校验码", required = true)
|
||||||
|
})
|
||||||
|
public HttpResult<String> downloadFile(@RequestParam("nDid") String nDid, @RequestParam("name") String name, @RequestParam("size") Integer size, @RequestParam("fileCheck") String fileCheck){
|
||||||
|
String methodDescribe = getMethodDescribe("downloadFile");
|
||||||
|
String result = deviceFtpService.downloadFile(nDid,name,size,fileCheck);
|
||||||
|
redisUtil.delete("downloadFilePath:"+name);
|
||||||
|
redisUtil.delete("fileCheck"+name);
|
||||||
|
redisUtil.delete("fileDowning:"+nDid);
|
||||||
|
if (Objects.isNull(result)) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/createFolder")
|
||||||
|
@ApiOperation("创建文件")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "nDid", value = "nDid", required = true),
|
||||||
|
@ApiImplicitParam(name = "path", value = "文件路径", required = true)
|
||||||
|
})
|
||||||
|
public HttpResult<String> createFolder(@RequestParam("nDid") String nDid, @RequestParam("path") String path){
|
||||||
|
String methodDescribe = getMethodDescribe("createFolder");
|
||||||
|
boolean result = deviceFtpService.createFile(nDid,path);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/deleteFolder")
|
||||||
|
@ApiOperation("删除文件")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "nDid", value = "nDid", required = true),
|
||||||
|
@ApiImplicitParam(name = "path", value = "文件路径", required = true)
|
||||||
|
})
|
||||||
|
public HttpResult<String> deleteFolder(@RequestParam("nDid") String nDid, @RequestParam("path") String path){
|
||||||
|
String methodDescribe = getMethodDescribe("deleteFolder");
|
||||||
|
boolean result = deviceFtpService.deleteFile(nDid,path);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,7 +23,6 @@ import com.njcn.csdevice.service.IMqttUserService;
|
|||||||
import com.njcn.csdevice.utils.ExcelStyleUtil;
|
import com.njcn.csdevice.utils.ExcelStyleUtil;
|
||||||
import com.njcn.poi.excel.ExcelUtil;
|
import com.njcn.poi.excel.ExcelUtil;
|
||||||
import com.njcn.poi.util.PoiUtil;
|
import com.njcn.poi.util.PoiUtil;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
|
||||||
import com.njcn.web.advice.DeviceLog;
|
import com.njcn.web.advice.DeviceLog;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
@@ -284,4 +283,27 @@ public class EquipmentDeliveryController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/rebootDevice")
|
||||||
|
@ApiOperation("重启设备")
|
||||||
|
@ApiImplicitParam(name = "nDid", value = "nDid", required = true)
|
||||||
|
public HttpResult<String> rebootDevice(@RequestParam("nDid") String nDid){
|
||||||
|
String methodDescribe = getMethodDescribe("rebootDevice");
|
||||||
|
boolean result = csEquipmentDeliveryService.rebootDevice(nDid);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getAll")
|
||||||
|
@ApiOperation("获取所有装置")
|
||||||
|
public HttpResult<List<CsEquipmentDeliveryPO>> getAll(){
|
||||||
|
String methodDescribe = getMethodDescribe("getAll");
|
||||||
|
List<CsEquipmentDeliveryPO> result = csEquipmentDeliveryService.getAll();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.njcn.csdevice.pojo.po.PortableOfflLog;
|
|||||||
import com.njcn.csdevice.service.IPortableOfflLogService;
|
import com.njcn.csdevice.service.IPortableOfflLogService;
|
||||||
import com.njcn.csdevice.utils.ExcelStyleUtil;
|
import com.njcn.csdevice.utils.ExcelStyleUtil;
|
||||||
import com.njcn.csdevice.param.UploadDataParam;
|
import com.njcn.csdevice.param.UploadDataParam;
|
||||||
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
import com.njcn.poi.excel.ExcelUtil;
|
import com.njcn.poi.excel.ExcelUtil;
|
||||||
import com.njcn.poi.util.PoiUtil;
|
import com.njcn.poi.util.PoiUtil;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
@@ -53,6 +54,8 @@ public class PortableOfflLogController extends BaseController {
|
|||||||
|
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@ApiOperation("导出设备基础数据模板")
|
@ApiOperation("导出设备基础数据模板")
|
||||||
@GetMapping(value = "getExcelTemplate")
|
@GetMapping(value = "getExcelTemplate")
|
||||||
@@ -98,5 +101,27 @@ public class PortableOfflLogController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("数据在线补招")
|
||||||
|
@PostMapping(value = "dataOnlineRecruitment")
|
||||||
|
public HttpResult<String> dataOnlineRecruitment(@RequestParam("devId") String devId
|
||||||
|
, @RequestParam("lineId") String lineId, @RequestParam("path") String path) {
|
||||||
|
String methodDescribe = getMethodDescribe("dataOnlineRecruitment");
|
||||||
|
|
||||||
|
List<MultipartFile> excelreport = null;
|
||||||
|
try {
|
||||||
|
excelreport = fileStorageUtil.getAllFile("excelreport", path);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
UploadDataParam uploadDataParam = new UploadDataParam();
|
||||||
|
uploadDataParam.setDevId(devId);
|
||||||
|
uploadDataParam.setLineId(lineId);
|
||||||
|
|
||||||
|
uploadDataParam.setFiles(excelreport);
|
||||||
|
iPortableOfflLogService.importEquipment(uploadDataParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package com.njcn.csdevice.controller.ledger;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.mapper.PqsDeviceUnitMapper;
|
||||||
|
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wr
|
||||||
|
* @description
|
||||||
|
* @date 2023/4/26 10:00
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/commTerminal")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "通用台账查询")
|
||||||
|
public class CsCommTerminalController extends BaseController {
|
||||||
|
|
||||||
|
private final PqsDeviceUnitMapper pqsDeviceUnitMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过监测点获取监测点数据单位
|
||||||
|
* @author cdf
|
||||||
|
* @date 2023/9/21
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/lineUnitDetail")
|
||||||
|
@ApiOperation("根据监测点id获取数据单位")
|
||||||
|
@ApiImplicitParam(name = "lineId", value = "实体", required = true)
|
||||||
|
public HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId) {
|
||||||
|
String methodDescribe = getMethodDescribe("lineUnitDetail");
|
||||||
|
|
||||||
|
PqsDeviceUnit pqsDeviceUnit = pqsDeviceUnitMapper.selectById(lineId);
|
||||||
|
if(Objects.isNull(pqsDeviceUnit)){
|
||||||
|
pqsDeviceUnit = new PqsDeviceUnit();
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnit, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,15 +5,19 @@ 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.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.service.CsLinePOService;
|
import com.njcn.csdevice.service.CsLinePOService;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
|
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 io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
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.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 springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
@@ -36,6 +40,8 @@ public class CslineController extends BaseController {
|
|||||||
|
|
||||||
private final CsLinePOService csLinePOService;
|
private final CsLinePOService csLinePOService;
|
||||||
|
|
||||||
|
private final OverlimitMapper overlimitMapper;
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/queryLineById")
|
@PostMapping("/queryLineById")
|
||||||
@ApiOperation("监测点查询通过id获取")
|
@ApiOperation("监测点查询通过id获取")
|
||||||
@@ -70,9 +76,16 @@ public class CslineController extends BaseController {
|
|||||||
@PostMapping("/addList")
|
@PostMapping("/addList")
|
||||||
@ApiOperation("批量新增监测点")
|
@ApiOperation("批量新增监测点")
|
||||||
@ApiImplicitParam(name = "list", value = "监测点数据集", required = true)
|
@ApiImplicitParam(name = "list", value = "监测点数据集", required = true)
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public HttpResult<String> addLineList(@RequestBody List<CsLinePO> list){
|
public HttpResult<String> addLineList(@RequestBody List<CsLinePO> list){
|
||||||
String methodDescribe = getMethodDescribe("addLineList");
|
String methodDescribe = getMethodDescribe("addLineList");
|
||||||
csLinePOService.saveBatch(list);
|
csLinePOService.saveBatch(list);
|
||||||
|
for(CsLinePO csLinePO: list){
|
||||||
|
Overlimit overlimit = COverlimitUtil.globalAssemble(csLinePO.getVolGrade().floatValue(),10f,10f,10f,0,1);
|
||||||
|
overlimit.setId(csLinePO.getLineId());
|
||||||
|
overlimitMapper.deleteById(csLinePO.getLineId());
|
||||||
|
overlimitMapper.insert(overlimit);
|
||||||
|
}
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
|||||||
import com.njcn.common.utils.LogUtil;
|
import com.njcn.common.utils.LogUtil;
|
||||||
import com.njcn.csdevice.param.WlRecordPageParam;
|
import com.njcn.csdevice.param.WlRecordPageParam;
|
||||||
import com.njcn.csdevice.pojo.param.WlRecordParam;
|
import com.njcn.csdevice.pojo.param.WlRecordParam;
|
||||||
|
import com.njcn.csdevice.pojo.po.WlRecord;
|
||||||
import com.njcn.csdevice.pojo.vo.RecordTreeVo;
|
import com.njcn.csdevice.pojo.vo.RecordTreeVo;
|
||||||
import com.njcn.csdevice.pojo.vo.RecordVo;
|
import com.njcn.csdevice.pojo.vo.RecordVo;
|
||||||
import com.njcn.csdevice.service.IWlRecordService;
|
import com.njcn.csdevice.service.IWlRecordService;
|
||||||
@@ -22,6 +23,7 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
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 java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -83,6 +85,34 @@ public class WlRecordController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增原始数据
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/addBaseData")
|
||||||
|
@ApiOperation("新增原始数据")
|
||||||
|
@ApiImplicitParam(name = "wlRecord", value = "装置原始数据", required = true)
|
||||||
|
public HttpResult<Boolean> addBaseData(@RequestBody @Validated WlRecord wlRecord) {
|
||||||
|
String methodDescribe = getMethodDescribe("addBaseData");
|
||||||
|
LogUtil.njcnDebug(log, "{},装置原始数据为:{}", methodDescribe, wlRecord);
|
||||||
|
wlRecordService.addBaseData(wlRecord);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增原始数据
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/addBaseDataList")
|
||||||
|
@ApiOperation("批量新增原始数据")
|
||||||
|
@ApiImplicitParam(name = "wlRecord", value = "装置原始数据", required = true)
|
||||||
|
public HttpResult<Boolean> addBaseDataList(@RequestBody @Validated List<WlRecord> wlRecord) {
|
||||||
|
String methodDescribe = getMethodDescribe("addBaseDataList");
|
||||||
|
LogUtil.njcnDebug(log, "{},装置原始数据为:{}", methodDescribe, wlRecord);
|
||||||
|
wlRecordService.addBaseDataList(wlRecord);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改测试项
|
* 修改测试项
|
||||||
*/
|
*/
|
||||||
@@ -151,5 +181,31 @@ public class WlRecordController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询装置基础数据
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||||
|
@PostMapping("/findDevBaseData")
|
||||||
|
@ApiOperation("查询装置基础数据")
|
||||||
|
@ApiImplicitParam(name = "param", value = "查询条件", required = true)
|
||||||
|
public HttpResult<WlRecord> findDevBaseData(@RequestBody @Validated WlRecordParam.Record param) {
|
||||||
|
String methodDescribe = getMethodDescribe("findDevBaseData");
|
||||||
|
LogUtil.njcnDebug(log, "{},查询对象为:{}", methodDescribe, param);
|
||||||
|
WlRecord record = wlRecordService.findDevBaseData(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, record, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每日处理没有结束时间的测试基础数据
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@PostMapping("/dayDealNoEndTimeEvent")
|
||||||
|
@ApiOperation("每日处理没有结束时间的测试基础数据")
|
||||||
|
public void dayDealNoEndTimeEvent() {
|
||||||
|
String methodDescribe = getMethodDescribe("dayDealNoEndTimeEvent");
|
||||||
|
wlRecordService.dayDealNoEndTimeEvent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.csdevice.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsSoftInfoPO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 系统软件表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-08-09
|
||||||
|
*/
|
||||||
|
public interface CsSoftInfoMapper extends BaseMapper<CsSoftInfoPO> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.njcn.csdevice.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-01-04
|
||||||
|
*/
|
||||||
|
public interface OverlimitMapper extends BaseMapper<Overlimit> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.njcn.csdevice.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2024/8/21
|
||||||
|
*/
|
||||||
|
public interface PqsDeviceUnitMapper extends BaseMapper<PqsDeviceUnit> {
|
||||||
|
}
|
||||||
@@ -23,7 +23,8 @@
|
|||||||
<if test="wlRecordPageParam.isTrueFlag == 0">
|
<if test="wlRecordPageParam.isTrueFlag == 0">
|
||||||
select a.dev_id as id,b.name as name from wl_record a
|
select a.dev_id as id,b.name as name from wl_record a
|
||||||
left join cs_equipment_delivery b on a.dev_id = b.id
|
left join cs_equipment_delivery b on a.dev_id = b.id
|
||||||
where a.type=1 and a.state =1 and
|
where a.type=1 and a.state =1 and a.end_time is not null
|
||||||
|
and
|
||||||
(select count(1) from wl_record wl where wl.dev_id = a.dev_id) >
|
(select count(1) from wl_record wl where wl.dev_id = a.dev_id) >
|
||||||
(select count(1) from wl_record_test_data wd where wd.test_item_id = #{wlRecordPageParam.id}
|
(select count(1) from wl_record_test_data wd where wd.test_item_id = #{wlRecordPageParam.id}
|
||||||
and data_id in (select w.id from wl_record w where w.dev_id = a.dev_id))
|
and data_id in (select w.id from wl_record w where w.dev_id = a.dev_id))
|
||||||
@@ -32,7 +33,8 @@
|
|||||||
<if test="wlRecordPageParam.isTrueFlag == 1">
|
<if test="wlRecordPageParam.isTrueFlag == 1">
|
||||||
select a.dev_id as id,b.name as name from wl_record a
|
select a.dev_id as id,b.name as name from wl_record a
|
||||||
left join cs_equipment_delivery b on a.dev_id = b.id
|
left join cs_equipment_delivery b on a.dev_id = b.id
|
||||||
where a.type=1 and a.state =1 and exists
|
where a.type=1 and a.state =1 and a.end_time is not null
|
||||||
|
and exists
|
||||||
(select 1 from wl_record wl where wl.dev_id = a.dev_id and wl.type=1 and wl.state =1
|
(select 1 from wl_record wl where wl.dev_id = a.dev_id and wl.type=1 and wl.state =1
|
||||||
and exists (select 1 from wl_record_test_data wd where wd.test_item_id = #{wlRecordPageParam.id} and wd.data_id = wl.id))
|
and exists (select 1 from wl_record_test_data wd where wd.test_item_id = #{wlRecordPageParam.id} and wd.data_id = wl.id))
|
||||||
group by a.dev_id,b.name having a.dev_id is not null and b.name is not null
|
group by a.dev_id,b.name having a.dev_id is not null and b.name is not null
|
||||||
@@ -55,7 +57,7 @@
|
|||||||
<select id="getRecordAllTime" resultType="com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo$RecordAllTimeTreeVo">
|
<select id="getRecordAllTime" resultType="com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo$RecordAllTimeTreeVo">
|
||||||
select a.id as id,concat(a.start_time,'-',a.end_time) as name, concat(#{wlRecordPageParam.lineId},'-',#{wlRecordPageParam.devId}) as pid from wl_record a
|
select a.id as id,concat(a.start_time,'-',a.end_time) as name, concat(#{wlRecordPageParam.lineId},'-',#{wlRecordPageParam.devId}) as pid from wl_record a
|
||||||
left join cs_line c on a.line_id = c.line_id
|
left join cs_line c on a.line_id = c.line_id
|
||||||
where a.type=1 and a.state =1 and a.dev_id=#{wlRecordPageParam.devId} and a.line_id=#{wlRecordPageParam.lineId}
|
where a.type=1 and a.state =1 and a.end_time is not null and a.dev_id=#{wlRecordPageParam.devId} and a.line_id=#{wlRecordPageParam.lineId}
|
||||||
and
|
and
|
||||||
<if test="wlRecordPageParam.isTrueFlag == 0">
|
<if test="wlRecordPageParam.isTrueFlag == 0">
|
||||||
not
|
not
|
||||||
@@ -65,7 +67,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getAll" resultType="com.njcn.csdevice.pojo.vo.CsLedgerVO">
|
<select id="getAll" resultType="com.njcn.csdevice.pojo.vo.CsLedgerVO">
|
||||||
select a.dev_id as id,b.name as name ,2 as level from wl_record a
|
select a.dev_id as id,b.name as name ,2 as level,b.ndid nDid from wl_record a
|
||||||
left join cs_equipment_delivery b on a.dev_id = b.id
|
left join cs_equipment_delivery b on a.dev_id = b.id
|
||||||
where a.type=1 and a.state =1
|
where a.type=1 and a.state =1
|
||||||
group by a.dev_id,b.name having a.dev_id is not null and b.name is not null
|
group by a.dev_id,b.name having a.dev_id is not null and b.name is not null
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.njcn.csdevice.pojo.vo.ProjectEquipmentVO;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -114,4 +115,12 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
|||||||
* @param number
|
* @param number
|
||||||
*/
|
*/
|
||||||
void updateModuleNumber(String nDid, Integer number);
|
void updateModuleNumber(String nDid, Integer number);
|
||||||
|
|
||||||
|
boolean rebootDevice(String nDid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有装置信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CsEquipmentDeliveryPO> getAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.njcn.csdevice.service;
|
||||||
|
|
||||||
|
import com.njcn.csharmonic.pojo.vo.MakeUpVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface DeviceFtpService {
|
||||||
|
|
||||||
|
MakeUpVo askDeviceRootPath(String nDid);
|
||||||
|
|
||||||
|
List<MakeUpVo> askDeviceFileOrDir(String nDid, String name, String type);
|
||||||
|
|
||||||
|
String downloadFile(String nDid, String name, Integer size, String fileCheck);
|
||||||
|
|
||||||
|
boolean createFile(String nDid, String path);
|
||||||
|
|
||||||
|
boolean deleteFile(String nDid, String path);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -45,4 +45,11 @@ public interface ICsDataSetService extends IService<CsDataSet> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<CsDataSet> getModuleDataSet(String modelId);
|
List<CsDataSet> getModuleDataSet(String modelId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据测点id获取数据集
|
||||||
|
* @param setIds 监测点id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CsDataSet> getDataSetBySetIds(List<String> setIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.csdevice.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsSoftInfoPO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 系统软件表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-08-09
|
||||||
|
*/
|
||||||
|
public interface ICsSoftInfoService extends IService<CsSoftInfoPO> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import com.njcn.csdevice.pojo.vo.RecordTreeVo;
|
|||||||
import com.njcn.csdevice.pojo.vo.RecordVo;
|
import com.njcn.csdevice.pojo.vo.RecordVo;
|
||||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,6 +42,20 @@ public interface IWlRecordService extends IService<WlRecord> {
|
|||||||
*/
|
*/
|
||||||
void addRecord(WlRecordParam.AddRecord records);
|
void addRecord(WlRecordParam.AddRecord records);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增原始数据
|
||||||
|
* @param wlRecord
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void addBaseData(WlRecord wlRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增原始数据
|
||||||
|
* @param wlRecord
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void addBaseDataList(List<WlRecord> wlRecord);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改测试项
|
* 修改测试项
|
||||||
* @param record
|
* @param record
|
||||||
@@ -81,4 +96,16 @@ public interface IWlRecordService extends IService<WlRecord> {
|
|||||||
*/
|
*/
|
||||||
List<ThdDataVO> queryCommonStatisticalByTest(CommonStatisticalQueryParam commonStatisticalQueryParam);
|
List<ThdDataVO> queryCommonStatisticalByTest(CommonStatisticalQueryParam commonStatisticalQueryParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取装置基础数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
WlRecord findDevBaseData(WlRecordParam.Record param);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每日处理没有结束时间的测试基础数据
|
||||||
|
*/
|
||||||
|
void dayDealNoEndTimeEvent();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.njcn.csdevice.service.ICsDataSetService;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,4 +42,9 @@ public class CsDataSetServiceImpl extends ServiceImpl<CsDataSetMapper, CsDataSet
|
|||||||
return this.lambdaQuery().eq(CsDataSet::getPid,modelId).ne(CsDataSet::getClDev,0).list();
|
return this.lambdaQuery().eq(CsDataSet::getPid,modelId).ne(CsDataSet::getClDev,0).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CsDataSet> getDataSetBySetIds(List<String> setIds) {
|
||||||
|
return this.lambdaQuery().in(CsDataSet::getId,setIds).list();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,6 @@ public class CsDevCapacityPOServiceImpl extends ServiceImpl<CsDevCapacityPOMappe
|
|||||||
if(Objects.isNull(one)){
|
if(Objects.isNull(one)){
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
return Double.valueOf(df.format(one.getCapacity()*0.1));
|
return Double.valueOf(df.format(one.getCapacity()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,18 +11,18 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
|
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
|
||||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
|
||||||
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.core.conditions.update.UpdateWrapper;
|
|
||||||
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.access.api.AskDeviceDataFeignClient;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.csdevice.constant.DataParam;
|
import com.njcn.csdevice.constant.DataParam;
|
||||||
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.CsSoftInfoMapper;
|
||||||
import com.njcn.csdevice.pojo.param.*;
|
import com.njcn.csdevice.pojo.param.*;
|
||||||
import com.njcn.csdevice.pojo.po.*;
|
import com.njcn.csdevice.pojo.po.*;
|
||||||
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
||||||
@@ -35,10 +35,10 @@ import com.njcn.db.constant.DbConstant;
|
|||||||
import com.njcn.oss.constant.OssPath;
|
import com.njcn.oss.constant.OssPath;
|
||||||
import com.njcn.oss.utils.FileStorageUtil;
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
import com.njcn.redis.pojo.enums.AppRedisKey;
|
import com.njcn.redis.pojo.enums.AppRedisKey;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.api.DictTreeFeignClient;
|
import com.njcn.system.api.DictTreeFeignClient;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.system.enums.DicTreeEnum;
|
|
||||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
@@ -75,28 +75,20 @@ import java.util.stream.Collectors;
|
|||||||
public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliveryMapper, CsEquipmentDeliveryPO> implements CsEquipmentDeliveryService{
|
public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliveryMapper, CsEquipmentDeliveryPO> implements CsEquipmentDeliveryService{
|
||||||
|
|
||||||
private final CsDevModelRelationService csDevModelRelationService;
|
private final CsDevModelRelationService csDevModelRelationService;
|
||||||
|
|
||||||
private final ICsDataSetService csDataSetService;
|
private final ICsDataSetService csDataSetService;
|
||||||
|
|
||||||
private final ICsLedgerService csLedgerService;
|
private final ICsLedgerService csLedgerService;
|
||||||
|
|
||||||
private final RoleEngineerDevService roleEngineerDevService;
|
private final RoleEngineerDevService roleEngineerDevService;
|
||||||
|
|
||||||
private final CsDeviceUserPOService csDeviceUserPOService;
|
private final CsDeviceUserPOService csDeviceUserPOService;
|
||||||
|
|
||||||
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 DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
private final FileStorageUtil fileStorageUtil;
|
private final FileStorageUtil fileStorageUtil;
|
||||||
private final DictTreeFeignClient dictTreeFeignClient;
|
private final DictTreeFeignClient dictTreeFeignClient;
|
||||||
|
|
||||||
private final CsEquipmentProcessPOService csEquipmentProcessPOService;
|
private final CsEquipmentProcessPOService csEquipmentProcessPOService;
|
||||||
private final IMqttUserService mqttUserService;
|
private final AskDeviceDataFeignClient askDeviceDataFeignClient;
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
private final CsSoftInfoMapper csSoftInfoMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
@@ -248,13 +240,13 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
queryWrapper.orderBy(true, false, "create_time");
|
queryWrapper.orderBy(true, false, "create_time");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(queryParam.getDevType()) || !Objects.isNull(queryParam.getDevType())){
|
if (StrUtil.isNotBlank(queryParam.getDevType()) && !Objects.isNull(queryParam.getDevType())){
|
||||||
queryWrapper.eq("cs_equipment_delivery.dev_type", queryParam.getDevType());
|
queryWrapper.eq("cs_equipment_delivery.dev_type", queryParam.getDevType());
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(queryParam.getDevModel()) || !Objects.isNull(queryParam.getDevModel())){
|
if (StrUtil.isNotBlank(queryParam.getDevModel()) && !Objects.isNull(queryParam.getDevModel())){
|
||||||
queryWrapper.eq("cs_equipment_delivery.dev_model", queryParam.getDevModel());
|
queryWrapper.eq("cs_equipment_delivery.dev_model", queryParam.getDevModel());
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(queryParam.getDevAccessMethod()) || !Objects.isNull(queryParam.getDevAccessMethod())){
|
if (StrUtil.isNotBlank(queryParam.getDevAccessMethod()) && !Objects.isNull(queryParam.getDevAccessMethod())){
|
||||||
queryWrapper.eq("cs_equipment_delivery.dev_access_method", queryParam.getDevAccessMethod());
|
queryWrapper.eq("cs_equipment_delivery.dev_access_method", queryParam.getDevAccessMethod());
|
||||||
}
|
}
|
||||||
if (!Objects.isNull(queryParam.getStatus())){
|
if (!Objects.isNull(queryParam.getStatus())){
|
||||||
@@ -281,6 +273,14 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
DeviceManagerVO deviceManagerVo = new DeviceManagerVO();
|
DeviceManagerVO deviceManagerVo = new DeviceManagerVO();
|
||||||
List<DeviceManagerVO.DataSetVO> dataSetList = new ArrayList<>();
|
List<DeviceManagerVO.DataSetVO> dataSetList = new ArrayList<>();
|
||||||
CsEquipmentDeliveryPO csEquipmentDeliveryPo = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getId, deviceId).one();
|
CsEquipmentDeliveryPO csEquipmentDeliveryPo = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getId, deviceId).one();
|
||||||
|
//获取装置版本信息
|
||||||
|
String softInfoId = csEquipmentDeliveryPo.getSoftinfoId();
|
||||||
|
if (StringUtils.isNotBlank(softInfoId) && ObjectUtil.isNotNull(softInfoId)) {
|
||||||
|
CsSoftInfoPO po = csSoftInfoMapper.selectById(softInfoId);
|
||||||
|
deviceManagerVo.setAppVersion(po.getAppVersion());
|
||||||
|
deviceManagerVo.setAppDate(po.getAppDate());
|
||||||
|
deviceManagerVo.setAppCheck(po.getAppCheck());
|
||||||
|
}
|
||||||
if (lineId == null || lineId.isEmpty()) {
|
if (lineId == null || lineId.isEmpty()) {
|
||||||
List<CsDataSet> dataSet = new ArrayList<>();
|
List<CsDataSet> dataSet = new ArrayList<>();
|
||||||
//如果没有传lineId(测点ID) 则根据设备ID获取对应的模板 select modelId from cs_dev_model_relation where dev_id = ?
|
//如果没有传lineId(测点ID) 则根据设备ID获取对应的模板 select modelId from cs_dev_model_relation where dev_id = ?
|
||||||
@@ -346,7 +346,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
for (CsDataSet item : dataSet) {
|
for (CsDataSet item : dataSet) {
|
||||||
DeviceManagerVO.DataSetVO dataSetVO = new DeviceManagerVO.DataSetVO();
|
DeviceManagerVO.DataSetVO dataSetVO = new DeviceManagerVO.DataSetVO();
|
||||||
dataSetVO.setId(item.getId());
|
dataSetVO.setId(item.getId());
|
||||||
dataSetVO.setName(item.getAnotherName());
|
dataSetVO.setName("history".equals(type) ? "准实时数据":item.getAnotherName());
|
||||||
dataSetVO.setType("rt");
|
dataSetVO.setType("rt");
|
||||||
dataSetList.add(dataSetVO);
|
dataSetList.add(dataSetVO);
|
||||||
deviceManagerVo.setDataLevel(item.getDataLevel());
|
deviceManagerVo.setDataLevel(item.getDataLevel());
|
||||||
@@ -354,7 +354,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
//历史数据tab
|
//历史数据tab
|
||||||
DeviceManagerVO.DataSetVO dataSetVo2 = new DeviceManagerVO.DataSetVO();
|
DeviceManagerVO.DataSetVO dataSetVo2 = new DeviceManagerVO.DataSetVO();
|
||||||
dataSetVo2.setId(item.getId());
|
dataSetVo2.setId(item.getId());
|
||||||
dataSetVo2.setName("历史" + item.getAnotherName());
|
dataSetVo2.setName("历史统计数据");
|
||||||
dataSetVo2.setType("history");
|
dataSetVo2.setType("history");
|
||||||
dataSetList.add(dataSetVo2);
|
dataSetList.add(dataSetVo2);
|
||||||
deviceManagerVo.setDataLevel(item.getDataLevel());
|
deviceManagerVo.setDataLevel(item.getDataLevel());
|
||||||
@@ -363,19 +363,19 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
//趋势数据tab
|
//趋势数据tab
|
||||||
DeviceManagerVO.DataSetVO dataSetVo3 = new DeviceManagerVO.DataSetVO();
|
DeviceManagerVO.DataSetVO dataSetVo3 = new DeviceManagerVO.DataSetVO();
|
||||||
dataSetVo3.setId(item.getId());
|
dataSetVo3.setId(item.getId());
|
||||||
dataSetVo3.setName(item.getAnotherName() + "趋势数据");
|
dataSetVo3.setName("历史趋势数据");
|
||||||
dataSetVo3.setType("trenddata");
|
dataSetVo3.setType("trenddata");
|
||||||
dataSetList.add(dataSetVo3);
|
dataSetList.add(dataSetVo3);
|
||||||
//实时数据tab
|
//实时数据tab
|
||||||
DeviceManagerVO.DataSetVO dataSetVo4 = new DeviceManagerVO.DataSetVO();
|
DeviceManagerVO.DataSetVO dataSetVo4 = new DeviceManagerVO.DataSetVO();
|
||||||
dataSetVo4.setId(item.getId());
|
dataSetVo4.setId(item.getId());
|
||||||
dataSetVo4.setName(item.getAnotherName() + "实时数据");
|
dataSetVo4.setName("实时数据");
|
||||||
dataSetVo4.setType("realtimedata");
|
dataSetVo4.setType("realtimedata");
|
||||||
dataSetList.add(dataSetVo4);
|
dataSetList.add(dataSetVo4);
|
||||||
//暂态事件tab
|
//暂态事件tab
|
||||||
DeviceManagerVO.DataSetVO dataSetVo5 = new DeviceManagerVO.DataSetVO();
|
DeviceManagerVO.DataSetVO dataSetVo5 = new DeviceManagerVO.DataSetVO();
|
||||||
dataSetVo5.setId(item.getId());
|
dataSetVo5.setId(item.getId());
|
||||||
dataSetVo5.setName(item.getAnotherName() + "暂态事件");
|
dataSetVo5.setName("暂态事件");
|
||||||
dataSetVo5.setType("event");
|
dataSetVo5.setType("event");
|
||||||
dataSetList.add(dataSetVo5);
|
dataSetList.add(dataSetVo5);
|
||||||
}
|
}
|
||||||
@@ -601,6 +601,28 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
this.update(lambdaUpdateWrapper);
|
this.update(lambdaUpdateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean rebootDevice(String nDid) {
|
||||||
|
boolean result = false;
|
||||||
|
try {
|
||||||
|
askDeviceDataFeignClient.rebootDevice(nDid);
|
||||||
|
Thread.sleep(3000);
|
||||||
|
String key = AppRedisKey.CONTROL + nDid;
|
||||||
|
String value = redisUtil.getObjectByKey(key).toString();
|
||||||
|
if (Objects.equals(value,"success")) {
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CsEquipmentDeliveryPO> getAll() {
|
||||||
|
return this.lambdaQuery().ne(CsEquipmentDeliveryPO::getRunStatus,0).list();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ndid生成二维码
|
* 根据ndid生成二维码
|
||||||
* @param ndid
|
* @param ndid
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
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.date.DatePattern;
|
||||||
|
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 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;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.utils.PubUtils;
|
import com.njcn.common.utils.PubUtils;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||||
@@ -14,32 +18,27 @@ import com.njcn.csdevice.api.EquipmentFeignClient;
|
|||||||
import com.njcn.csdevice.constant.DataParam;
|
import com.njcn.csdevice.constant.DataParam;
|
||||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||||
import com.njcn.csdevice.mapper.CsDataArrayMapper;
|
import com.njcn.csdevice.mapper.*;
|
||||||
import com.njcn.csdevice.mapper.CsGroArrMapper;
|
|
||||||
import com.njcn.csdevice.mapper.CsGroupMapper;
|
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||||
import com.njcn.csdevice.pojo.param.EnergyBaseParam;
|
import com.njcn.csdevice.pojo.param.EnergyBaseParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsDataArray;
|
import com.njcn.csdevice.pojo.po.*;
|
||||||
import com.njcn.csdevice.pojo.po.CsGroArr;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsGroup;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
||||||
import com.njcn.csdevice.pojo.vo.DataGroupEventVO;
|
import com.njcn.csdevice.pojo.vo.DataGroupEventVO;
|
||||||
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
||||||
import com.njcn.csdevice.pojo.vo.EnergyTemplateVO;
|
import com.njcn.csdevice.pojo.vo.EnergyTemplateVO;
|
||||||
|
import com.njcn.csdevice.service.CsDevModelRelationService;
|
||||||
import com.njcn.csdevice.service.ICsDataArrayService;
|
import com.njcn.csdevice.service.ICsDataArrayService;
|
||||||
import com.njcn.csdevice.service.ICsGroupService;
|
import com.njcn.csdevice.service.ICsGroupService;
|
||||||
import com.njcn.csdevice.util.InfluxDbParamUtil;
|
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.param.CommonStatisticalQueryParam;
|
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||||
|
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.CsEventVO;
|
||||||
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;
|
||||||
import com.njcn.device.pq.api.LineFeignClient;
|
|
||||||
import com.njcn.device.pq.api.OverLimitClient;
|
|
||||||
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
|
||||||
import com.njcn.event.api.EventDetailFeignClient;
|
|
||||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
|
||||||
import com.njcn.influx.pojo.bo.CommonQueryParam;
|
import com.njcn.influx.pojo.bo.CommonQueryParam;
|
||||||
import com.njcn.influx.pojo.dto.EventDataSetDTO;
|
import com.njcn.influx.pojo.dto.EventDataSetDTO;
|
||||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||||
@@ -102,18 +101,26 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
|
|
||||||
private final EvtDataService evtDataService;
|
private final EvtDataService evtDataService;
|
||||||
|
|
||||||
private final EventDetailFeignClient eventDetailFeignClient;
|
private final DecimalFormat df = new DecimalFormat("#0.00");
|
||||||
|
|
||||||
private final DecimalFormat df = new DecimalFormat("#0.0000");
|
|
||||||
|
|
||||||
private final EleEvtFeignClient eleEvtFeignClient;
|
private final EleEvtFeignClient eleEvtFeignClient;
|
||||||
|
|
||||||
private final OverLimitClient overLimitClient;
|
private final OverlimitMapper overlimitMapper;
|
||||||
|
|
||||||
private final LineFeignClient lineFeignClient;
|
private final CsDataSetMapper csDataSetMapper;
|
||||||
|
|
||||||
|
private final EventFeignClient eventFeignClient;
|
||||||
|
|
||||||
private final InfluxDbParamUtil influxDbParamUtil;
|
private final InfluxDbParamUtil influxDbParamUtil;
|
||||||
|
|
||||||
|
private final Set<String> POWER_LIST = new HashSet<>(Arrays.asList(
|
||||||
|
"电网有功功率", "电网无功功率", "电网视在功率", "负载有功功率",
|
||||||
|
"负载无功功率", "负载视在功率", "有功功率", "无功功率",
|
||||||
|
"视在功率", "基波有功功率", "基波无功功率",
|
||||||
|
"基波视在功率", "三相总有功功率", "三相总无功功率",
|
||||||
|
"三相总视在功率"
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -144,15 +151,17 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
//获取所有字典指标
|
//获取所有字典指标
|
||||||
List<EleEpdPqd> epdPqdList = epdFeignClient.selectByIds(list.stream().map(EnergyTemplateVO::getDataId).distinct().collect(Collectors.toList())).getData();
|
List<EleEpdPqd> epdPqdList = epdFeignClient.selectByIds(list.stream().map(EnergyTemplateVO::getDataId).distinct().collect(Collectors.toList())).getData();
|
||||||
Map<String, EleEpdPqd> eventTypeMap = epdPqdList.stream().collect(Collectors.toMap(EleEpdPqd::getId, Function.identity()));
|
Map<String, EleEpdPqd> eventTypeMap = epdPqdList.stream().collect(Collectors.toMap(EleEpdPqd::getId, Function.identity()));
|
||||||
getUnit(list,epdPqdList,groupList);
|
getUnit(list,epdPqdList,groupList,dataLevel);
|
||||||
//根据lineId获取监测点pt、ct变比
|
//根据lineId获取监测点pt、ct变比
|
||||||
CsLinePO csLinePO = csLineFeignClient.queryLineById(Collections.singletonList(lineId)).getData().get(0);
|
CsLinePO csLinePO = csLineFeignClient.queryLineById(Collections.singletonList(lineId)).getData().get(0);
|
||||||
|
CsDataSet csDataSet = csDataSetMapper.selectOne(new LambdaQueryWrapper<CsDataSet>().eq(CsDataSet::getId,csLinePO.getDataSetId()));
|
||||||
|
if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())){
|
||||||
|
throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)");
|
||||||
|
}
|
||||||
|
//获取测点模板
|
||||||
for (EnergyTemplateVO item : list) {
|
for (EnergyTemplateVO item : list) {
|
||||||
EnergyTemplateVO vo = new EnergyTemplateVO();
|
EnergyTemplateVO vo = new EnergyTemplateVO();
|
||||||
BeanUtils.copyProperties(item,vo);
|
BeanUtils.copyProperties(item,vo);
|
||||||
if (vo.getAnotherName().contains("A相") || vo.getAnotherName().contains("B相") || vo.getAnotherName().contains("C相")) {
|
|
||||||
vo.setAnotherName(vo.getAnotherName().substring(0,2));
|
|
||||||
}
|
|
||||||
EleEpdPqd eleEpdPqd = eventTypeMap.get(item.getDataId());
|
EleEpdPqd eleEpdPqd = eventTypeMap.get(item.getDataId());
|
||||||
vo.setClassId(eleEpdPqd.getClassId());
|
vo.setClassId(eleEpdPqd.getClassId());
|
||||||
vo.setUnit(eleEpdPqd.getUnit());
|
vo.setUnit(eleEpdPqd.getUnit());
|
||||||
@@ -160,15 +169,31 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
if (Objects.nonNull(statisticalDataDTO)) {
|
if (Objects.nonNull(statisticalDataDTO)) {
|
||||||
vo.setTime(statisticalDataDTO.getTime());
|
vo.setTime(statisticalDataDTO.getTime());
|
||||||
//判断监测点类型 针对治理设备 模块数据是一次值、电能质量设备是二次值
|
//判断监测点类型 针对治理设备 模块数据是一次值、电能质量设备是二次值
|
||||||
if (csLinePO.getClDid() != 0 && Objects.equals("Primary",dataLevel) && ObjectUtil.isNotNull(eleEpdPqd.getPrimaryFormula())) {
|
if (ObjectUtil.isNotNull(eleEpdPqd.getPrimaryFormula()) && !Objects.equals(csDataSet.getDataLevel(),dataLevel)) {
|
||||||
double secondaryData = DataChangeUtil.secondaryToPrimary(eleEpdPqd.getPrimaryFormula(), statisticalDataDTO.getValue(), csLinePO.getPtRatio(), csLinePO.getCtRatio());
|
double re;
|
||||||
vo.setDataValue(BigDecimal.valueOf(secondaryData).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
if("Primary".equals(csDataSet.getDataLevel())){
|
||||||
|
re = DataChangeUtil.primaryToSecondary(eleEpdPqd.getPrimaryFormula(), statisticalDataDTO.getValue(), csLinePO.getPtRatio(), csLinePO.getCtRatio());
|
||||||
|
}else {
|
||||||
|
re = DataChangeUtil.secondaryToPrimary(eleEpdPqd.getPrimaryFormula(), statisticalDataDTO.getValue(), csLinePO.getPtRatio(), csLinePO.getCtRatio());
|
||||||
|
}
|
||||||
|
if (changePower(vo.getAnotherName())) {
|
||||||
|
vo.setDataValue(Double.valueOf(df.format(BigDecimal.valueOf(re / 1000).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
} else {
|
||||||
|
vo.setDataValue(Double.valueOf(df.format(BigDecimal.valueOf(re).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
vo.setDataValue(BigDecimal.valueOf(statisticalDataDTO.getValue()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
if (changePower(vo.getAnotherName())) {
|
||||||
|
vo.setDataValue(Double.valueOf(df.format(BigDecimal.valueOf(statisticalDataDTO.getValue()/1000).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
} else {
|
||||||
|
vo.setDataValue(Double.valueOf(df.format(BigDecimal.valueOf(statisticalDataDTO.getValue()).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
vo.setDataValue(3.1415926);
|
vo.setDataValue(3.1415926);
|
||||||
}
|
}
|
||||||
|
if (vo.getAnotherName().contains("A相") || vo.getAnotherName().contains("B相") || vo.getAnotherName().contains("C相")) {
|
||||||
|
vo.setAnotherName(vo.getAnotherName().substring(0,2));
|
||||||
|
}
|
||||||
arrayList.add(vo);
|
arrayList.add(vo);
|
||||||
}
|
}
|
||||||
if (CollectionUtil.isNotEmpty(arrayList)){
|
if (CollectionUtil.isNotEmpty(arrayList)){
|
||||||
@@ -202,9 +227,14 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
//获取所有字典指标
|
//获取所有字典指标
|
||||||
List<EleEpdPqd> epdPqdList = epdFeignClient.selectByIds(list.stream().map(EnergyTemplateVO::getDataId).distinct().collect(Collectors.toList())).getData();
|
List<EleEpdPqd> epdPqdList = epdFeignClient.selectByIds(list.stream().map(EnergyTemplateVO::getDataId).distinct().collect(Collectors.toList())).getData();
|
||||||
Map<String, EleEpdPqd> eventTypeMap = epdPqdList.stream().collect(Collectors.toMap(EleEpdPqd::getId, Function.identity()));
|
Map<String, EleEpdPqd> eventTypeMap = epdPqdList.stream().collect(Collectors.toMap(EleEpdPqd::getId, Function.identity()));
|
||||||
getUnit(list,epdPqdList,groupList);
|
getUnit(list,epdPqdList,groupList,energyBaseParam.getDataLevel());
|
||||||
//根据lineId获取监测点pt、ct变比
|
//根据lineId获取监测点pt、ct变比
|
||||||
CsLinePO po = csLineFeignClient.queryLineById(Collections.singletonList(energyBaseParam.getLineId())).getData().get(0);
|
CsLinePO po = csLineFeignClient.queryLineById(Collections.singletonList(energyBaseParam.getLineId())).getData().get(0);
|
||||||
|
CsDataSet csDataSet = csDataSetMapper.selectOne(new LambdaQueryWrapper<CsDataSet>().eq(CsDataSet::getId,po.getDataSetId()));
|
||||||
|
if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())){
|
||||||
|
throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)");
|
||||||
|
}
|
||||||
|
|
||||||
for (EnergyTemplateVO item : list) {
|
for (EnergyTemplateVO item : list) {
|
||||||
EnergyTemplateVO vo = new EnergyTemplateVO();
|
EnergyTemplateVO vo = new EnergyTemplateVO();
|
||||||
BeanUtils.copyProperties(item,vo);
|
BeanUtils.copyProperties(item,vo);
|
||||||
@@ -218,17 +248,39 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
if (Objects.nonNull(statisticalDataDTO)) {
|
if (Objects.nonNull(statisticalDataDTO)) {
|
||||||
vo.setTime(statisticalDataDTO.getTime());
|
vo.setTime(statisticalDataDTO.getTime());
|
||||||
//判断监测点类型 针对治理设备 模块数据是一次值、电能质量设备是二次值
|
//判断监测点类型 针对治理设备 模块数据是一次值、电能质量设备是二次值
|
||||||
if (po.getClDid() != 0 && Objects.equals("Primary",energyBaseParam.getDataLevel()) && ObjectUtil.isNotNull(eleEpdPqd.getPrimaryFormula())) {
|
if (ObjectUtil.isNotNull(eleEpdPqd.getPrimaryFormula()) && !Objects.equals(csDataSet.getDataLevel(),energyBaseParam.getDataLevel()) ) {
|
||||||
double secondaryData1 = DataChangeUtil.secondaryToPrimary(eleEpdPqd.getPrimaryFormula(), statisticalDataDTO.getMaxValue(), po.getPtRatio(), po.getCtRatio());
|
double secondaryData1;
|
||||||
double secondaryData2 = DataChangeUtil.secondaryToPrimary(eleEpdPqd.getPrimaryFormula(), statisticalDataDTO.getMinValue(), po.getPtRatio(), po.getCtRatio());
|
double secondaryData2;
|
||||||
double secondaryData3 = DataChangeUtil.secondaryToPrimary(eleEpdPqd.getPrimaryFormula(), statisticalDataDTO.getAvgValue(), po.getPtRatio(), po.getCtRatio());
|
double secondaryData3;
|
||||||
vo.setMaxValue(BigDecimal.valueOf(secondaryData1).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
if("Primary".equals(csDataSet.getDataLevel())){
|
||||||
vo.setMinValue(BigDecimal.valueOf(secondaryData2).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
secondaryData1 = DataChangeUtil.primaryToSecondary(eleEpdPqd.getPrimaryFormula(), statisticalDataDTO.getMaxValue(), po.getPtRatio(), po.getCtRatio());
|
||||||
vo.setAvgValue(BigDecimal.valueOf(secondaryData3).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
secondaryData2 = DataChangeUtil.primaryToSecondary(eleEpdPqd.getPrimaryFormula(), statisticalDataDTO.getMinValue(), po.getPtRatio(), po.getCtRatio());
|
||||||
|
secondaryData3 = DataChangeUtil.primaryToSecondary(eleEpdPqd.getPrimaryFormula(), statisticalDataDTO.getAvgValue(), po.getPtRatio(), po.getCtRatio());
|
||||||
|
}else {
|
||||||
|
secondaryData1 = DataChangeUtil.secondaryToPrimary(eleEpdPqd.getPrimaryFormula(), statisticalDataDTO.getMaxValue(), po.getPtRatio(), po.getCtRatio());
|
||||||
|
secondaryData2 = DataChangeUtil.secondaryToPrimary(eleEpdPqd.getPrimaryFormula(), statisticalDataDTO.getMinValue(), po.getPtRatio(), po.getCtRatio());
|
||||||
|
secondaryData3 = DataChangeUtil.secondaryToPrimary(eleEpdPqd.getPrimaryFormula(), statisticalDataDTO.getAvgValue(), po.getPtRatio(), po.getCtRatio());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changePower(vo.getAnotherName())) {
|
||||||
|
vo.setMaxValue(Double.valueOf(df.format(BigDecimal.valueOf(secondaryData1/1000).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
vo.setMinValue(Double.valueOf(df.format(BigDecimal.valueOf(secondaryData2/1000).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
vo.setAvgValue(Double.valueOf(df.format(BigDecimal.valueOf(secondaryData3/1000).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
} else {
|
||||||
|
vo.setMaxValue(Double.valueOf(df.format(BigDecimal.valueOf(secondaryData1).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
vo.setMinValue(Double.valueOf(df.format(BigDecimal.valueOf(secondaryData2).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
vo.setAvgValue(Double.valueOf(df.format(BigDecimal.valueOf(secondaryData3).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
vo.setMaxValue(BigDecimal.valueOf(statisticalDataDTO.getMaxValue()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
if (changePower(vo.getAnotherName())) {
|
||||||
vo.setMinValue(BigDecimal.valueOf(statisticalDataDTO.getMinValue()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
vo.setMaxValue(Double.valueOf(df.format(BigDecimal.valueOf(statisticalDataDTO.getMaxValue()/1000).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
vo.setAvgValue(BigDecimal.valueOf(statisticalDataDTO.getAvgValue()).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
vo.setMinValue(Double.valueOf(df.format(BigDecimal.valueOf(statisticalDataDTO.getMinValue()/1000).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
vo.setAvgValue(Double.valueOf(df.format(BigDecimal.valueOf(statisticalDataDTO.getAvgValue()/1000).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
} else {
|
||||||
|
vo.setMaxValue(Double.valueOf(df.format(BigDecimal.valueOf(statisticalDataDTO.getMaxValue()).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
vo.setMinValue(Double.valueOf(df.format(BigDecimal.valueOf(statisticalDataDTO.getMinValue()).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
vo.setAvgValue(Double.valueOf(df.format(BigDecimal.valueOf(statisticalDataDTO.getAvgValue()).setScale(2, RoundingMode.HALF_UP).doubleValue())));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
vo.setMaxValue(3.1415956);
|
vo.setMaxValue(3.1415956);
|
||||||
@@ -258,18 +310,18 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
@Override
|
@Override
|
||||||
public Object deviceDataByType(CommonStatisticalQueryParam commonStatisticalQueryParam) {
|
public Object deviceDataByType(CommonStatisticalQueryParam commonStatisticalQueryParam) {
|
||||||
String type = commonStatisticalQueryParam.getType();
|
String type = commonStatisticalQueryParam.getType();
|
||||||
if (type == null) throw new BusinessException(LineBaseEnum.NOTYPE_FAIL.getMessage());
|
if (type == null){
|
||||||
|
throw new BusinessException(LineBaseEnum.NOTYPE_FAIL.getMessage());
|
||||||
|
}
|
||||||
//传1 则是趋势数据tab页面
|
//传1 则是趋势数据tab页面
|
||||||
if("1".equals(type)){
|
if("1".equals(type)){
|
||||||
formatQueryParamList(commonStatisticalQueryParam);
|
formatQueryParamList(commonStatisticalQueryParam);
|
||||||
List<ThdDataVO> result = new ArrayList();
|
List<ThdDataVO> result = new ArrayList();
|
||||||
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(commonStatisticalQueryParam.getDevId()).collect(Collectors.toList())).getData();
|
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(commonStatisticalQueryParam.getDevId()).collect(Collectors.toList())).getData();
|
||||||
List<CsLinePO> finalCsLinePOList = csLineFeignClient.queryLineById(Arrays.asList(commonStatisticalQueryParam.getLineId())).getData();
|
List<CsLinePO> finalCsLinePOList = csLineFeignClient.queryLineById(Arrays.asList(commonStatisticalQueryParam.getLineId())).getData();
|
||||||
if(commonStatisticalQueryParam.getList() != null && commonStatisticalQueryParam.getList().size() > 0){
|
if(CollectionUtil.isNotEmpty(commonStatisticalQueryParam.getList())){
|
||||||
for (CommonStatisticalQueryParam param : commonStatisticalQueryParam.getList()){
|
for (CommonStatisticalQueryParam param : commonStatisticalQueryParam.getList()){
|
||||||
if(param.getStatisticalId() == null){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
List<EleEpdPqd> eleEpdPqds = csStatisticalSetFeignClient.queryStatisticalSelect(param.getStatisticalId()).getData();
|
List<EleEpdPqd> eleEpdPqds = csStatisticalSetFeignClient.queryStatisticalSelect(param.getStatisticalId()).getData();
|
||||||
eleEpdPqds.forEach(epdPqd->{
|
eleEpdPqds.forEach(epdPqd->{
|
||||||
List<CommonQueryParam> commonQueryParams = finalCsLinePOList.stream().map(temp -> {
|
List<CommonQueryParam> commonQueryParams = finalCsLinePOList.stream().map(temp -> {
|
||||||
@@ -278,15 +330,17 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
commonQueryParam.setTableName(influxDbParamUtil.getTableNameByClassId(epdPqd.getClassId()));
|
commonQueryParam.setTableName(influxDbParamUtil.getTableNameByClassId(epdPqd.getClassId()));
|
||||||
commonQueryParam.setColumnName(epdPqd.getName()+ (param.getFrequency() == null ? "":"_"+param.getFrequency()));
|
commonQueryParam.setColumnName(epdPqd.getName()+ (param.getFrequency() == null ? "":"_"+param.getFrequency()));
|
||||||
commonQueryParam.setPhasic(epdPqd.getPhase());
|
commonQueryParam.setPhasic(epdPqd.getPhase());
|
||||||
//commonQueryParam.setStartTime(commonStatisticalQueryParam.getStartTime());
|
|
||||||
//commonQueryParam.setEndTime(commonStatisticalQueryParam.getEndTime());
|
commonQueryParam.setStartTime(DateUtil.format(DateUtil.parse(commonStatisticalQueryParam.getStartTime(),DatePattern.NORM_DATE_PATTERN), DatePattern.NORM_DATETIME_PATTERN));
|
||||||
|
commonQueryParam.setEndTime(DateUtil.format(DateUtil.endOfDay(DateUtil.parse(commonStatisticalQueryParam.getEndTime(),DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATETIME_PATTERN));
|
||||||
|
|
||||||
commonQueryParam.setDataType(commonStatisticalQueryParam.getValueType());
|
commonQueryParam.setDataType(commonStatisticalQueryParam.getValueType());
|
||||||
commonQueryParam.setProcess(data1.get(0).getProcess()+"");
|
commonQueryParam.setProcess(data1.get(0).getProcess()+"");
|
||||||
commonQueryParam.setClDid(influxDbParamUtil.getClDidByLineId(temp.getLineId()));
|
commonQueryParam.setClDid(influxDbParamUtil.getClDidByLineId(temp.getLineId()));
|
||||||
return commonQueryParam;
|
return commonQueryParam;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
//List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(commonQueryParams);
|
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(commonQueryParams);
|
||||||
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtData(commonQueryParams);
|
//List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtData(commonQueryParams);
|
||||||
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||||
ThdDataVO vo = new ThdDataVO();
|
ThdDataVO vo = new ThdDataVO();
|
||||||
vo.setLineId(temp.getLineId());
|
vo.setLineId(temp.getLineId());
|
||||||
@@ -356,9 +410,15 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
return result;
|
return result;
|
||||||
}else if("3".equals(type)){
|
}else if("3".equals(type)){
|
||||||
//传3 则是暂态事件tab页面
|
//传3 则是暂态事件tab页面
|
||||||
Page<DataGroupEventVO> returnpage = new Page<> (commonStatisticalQueryParam.getPageNum(),commonStatisticalQueryParam.getPageSize());
|
CsEventUserQueryPage csEventUserQueryPage = new CsEventUserQueryPage();
|
||||||
returnpage = this.getBaseMapper().getGroupEventList(returnpage,commonStatisticalQueryParam.getDevId(),commonStatisticalQueryParam.getLineId());
|
csEventUserQueryPage.setPageNum(commonStatisticalQueryParam.getPageNum());
|
||||||
returnpage.getRecords().forEach(temp->{
|
csEventUserQueryPage.setPageSize(commonStatisticalQueryParam.getPageSize());
|
||||||
|
csEventUserQueryPage.setLineId(commonStatisticalQueryParam.getLineId());
|
||||||
|
csEventUserQueryPage.setStartTime(commonStatisticalQueryParam.getStartTime());
|
||||||
|
csEventUserQueryPage.setEndTime(commonStatisticalQueryParam.getEndTime());
|
||||||
|
Page<DataGroupEventVO> csEventVOPage = eventFeignClient.pageQueryByLineId(csEventUserQueryPage).getData();
|
||||||
|
|
||||||
|
csEventVOPage.getRecords().forEach(temp->{
|
||||||
//事件描述、相别、暂降幅值,需要特殊处理赋值
|
//事件描述、相别、暂降幅值,需要特殊处理赋值
|
||||||
//事件描述
|
//事件描述
|
||||||
EleEpdPqd ele = epdFeignClient.findByName(temp.getTag()).getData();
|
EleEpdPqd ele = epdFeignClient.findByName(temp.getTag()).getData();
|
||||||
@@ -386,18 +446,26 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
}else {
|
}else {
|
||||||
temp.setPhaseType(evtParamPhase.get(0).getValue()+(Objects.isNull(evtParamPhase.get(0).getUnit())?"":evtParamPhase.get(0).getUnit()));
|
temp.setPhaseType(evtParamPhase.get(0).getValue()+(Objects.isNull(evtParamPhase.get(0).getUnit())?"":evtParamPhase.get(0).getUnit()));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//变电站名称
|
|
||||||
List<LineDetailVO.Detail> lineDetailVOS = lineFeignClient.getLineDetailByIds(Arrays.asList(temp.getLineId())).getData();
|
|
||||||
if(!lineDetailVOS.isEmpty()){
|
|
||||||
temp.setSubName(lineDetailVOS.get(0).getSubName());
|
|
||||||
}
|
|
||||||
//暂降幅值
|
|
||||||
List<RmpEventDetailPO> eventDetails = eventDetailFeignClient.getEventDetailByIdsList(Arrays.asList(temp.getEventId())).getData();
|
|
||||||
if(eventDetails !=null && !eventDetails.isEmpty()) temp.setFeatureAmplitude(PubUtils.floatRound(2, eventDetails.get(0).getFeatureAmplitude().floatValue()));
|
|
||||||
|
|
||||||
|
List<EventDataSetDTO> evtParamDepth = eventDataSetDTOS.stream().
|
||||||
|
filter(dataSetDTO -> Objects.equals(dataSetDTO.getName(), DataParam.EvtParamDepth)).
|
||||||
|
collect(Collectors.toList());
|
||||||
|
if(CollectionUtil.isEmpty(evtParamDepth)){
|
||||||
|
temp.setFeatureAmplitude(null);
|
||||||
|
}else {
|
||||||
|
temp.setFeatureAmplitude(evtParamDepth.get(0).getValue().equals("-")?null:Float.parseFloat(evtParamDepth.get(0).getValue()));
|
||||||
|
}
|
||||||
|
List<EventDataSetDTO> evtParmTm = eventDataSetDTOS.stream().
|
||||||
|
filter(dataSetDTO -> Objects.equals(dataSetDTO.getName(), DataParam.EVTPARAMTM)).
|
||||||
|
collect(Collectors.toList());
|
||||||
|
if(CollectionUtil.isEmpty(evtParamDepth)){
|
||||||
|
temp.setPersistTime(null);
|
||||||
|
}else {
|
||||||
|
temp.setPersistTime(evtParmTm.get(0).getValue().equals("-")?null:Double.parseDouble(evtParmTm.get(0).getValue()));
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return returnpage;
|
return csEventVOPage;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -426,7 +494,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
@Override
|
@Override
|
||||||
public List<ThdDataTdVO> getDeviceTrendData(String devId, String lineId,String groupId) {
|
public List<ThdDataTdVO> getDeviceTrendData(String devId, String lineId,String groupId) {
|
||||||
List<ThdDataTdVO> data = new ArrayList();
|
List<ThdDataTdVO> data = new ArrayList();
|
||||||
List<Overlimit> overlimits = overLimitClient.getOverLimitByLineIds(Arrays.asList(lineId)).getData();
|
List<Overlimit> overlimits = overlimitMapper.selectBatchIds(Arrays.asList(lineId));
|
||||||
List<CsLinePO> finalCsLinePOList = csLineFeignClient.queryLineById(Arrays.asList(lineId)).getData();
|
List<CsLinePO> finalCsLinePOList = csLineFeignClient.queryLineById(Arrays.asList(lineId)).getData();
|
||||||
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(devId).collect(Collectors.toList())).getData();
|
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(devId).collect(Collectors.toList())).getData();
|
||||||
//便携式设备-稳态指标-实时数据-指标
|
//便携式设备-稳态指标-实时数据-指标
|
||||||
@@ -695,7 +763,9 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
//单位处理
|
//单位处理
|
||||||
public void getUnit(List<EnergyTemplateVO> energyTemplates, List<EleEpdPqd> eleEpdPqds, List<DataGroupTemplateVO> dataGroupTemplates) {
|
public void getUnit(List<EnergyTemplateVO> energyTemplates, List<EleEpdPqd> eleEpdPqds, List<DataGroupTemplateVO> dataGroupTemplates, String type) {
|
||||||
|
List<String> pList = Arrays.asList("电网有功功率", "电网无功功率", "电网视在功率","负载有功功率","负载无功功率","负载视在功率"
|
||||||
|
,"有功功率","无功功率","视在功率","基波有功功率","基波无功功率","基波视在功率","三相总有功功率","三相总无功功率","三相总视在功率");
|
||||||
// 使用Map来存储EleEpdPqd的ID和Unit,以便快速查找
|
// 使用Map来存储EleEpdPqd的ID和Unit,以便快速查找
|
||||||
Map<String, String> unitMap = new HashMap<>();
|
Map<String, String> unitMap = new HashMap<>();
|
||||||
for (EleEpdPqd item : eleEpdPqds) {
|
for (EleEpdPqd item : eleEpdPqds) {
|
||||||
@@ -720,10 +790,20 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
for (DataGroupTemplateVO dataGroupTemplate : dataGroupTemplates) {
|
for (DataGroupTemplateVO dataGroupTemplate : dataGroupTemplates) {
|
||||||
EnergyTemplateVO energyTemplate = energyTemplateMap.get(dataGroupTemplate.getId());
|
EnergyTemplateVO energyTemplate = energyTemplateMap.get(dataGroupTemplate.getId());
|
||||||
if (energyTemplate != null && energyTemplate.getUnit() != null) {
|
if (energyTemplate != null && energyTemplate.getUnit() != null) {
|
||||||
dataGroupTemplate.setName(dataGroupTemplate.getName() + "(" + energyTemplate.getUnit() + ")");
|
if (changePower(dataGroupTemplate.getName())) {
|
||||||
|
dataGroupTemplate.setName(dataGroupTemplate.getName() + "(k" + energyTemplate.getUnit() + ")");
|
||||||
|
} else {
|
||||||
|
dataGroupTemplate.setName(dataGroupTemplate.getName() + "(" + energyTemplate.getUnit() + ")");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dataGroupTemplate.setName(dataGroupTemplate.getName().replace("序列",""));;
|
dataGroupTemplate.setName(dataGroupTemplate.getName().replace("序列",""));;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//判断功率是否需要转换
|
||||||
|
public boolean changePower(String name) {
|
||||||
|
return POWER_LIST.stream()
|
||||||
|
.anyMatch(name::contains);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import com.njcn.oss.utils.FileStorageUtil;
|
|||||||
import com.njcn.redis.utils.RedisUtil;
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
import com.njcn.system.api.AreaFeignClient;
|
import com.njcn.system.api.AreaFeignClient;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
|
||||||
import com.njcn.system.pojo.po.Area;
|
import com.njcn.system.pojo.po.Area;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@@ -50,14 +49,10 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
private final DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
private final FileStorageUtil fileStorageUtil;
|
private final FileStorageUtil fileStorageUtil;
|
||||||
private final RoleEngineerDevService roleEngineerDevService;
|
private final RoleEngineerDevService roleEngineerDevService;
|
||||||
private final WlRecordMapper wlRecordMapper;
|
|
||||||
private final CsDevModelRelationService csDevModelRelationService;
|
private final CsDevModelRelationService csDevModelRelationService;
|
||||||
|
|
||||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||||
private final ICsDataSetService csDataSetService;
|
private final ICsDataSetService csDataSetService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CsLedgerVO> getLedgerTree() {
|
public List<CsLedgerVO> getLedgerTree() {
|
||||||
List<CsLedgerVO> list = new ArrayList<>();
|
List<CsLedgerVO> list = new ArrayList<>();
|
||||||
@@ -75,10 +70,8 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CsLedgerVO> getLineTree() {
|
public List<CsLedgerVO> getLineTree() {
|
||||||
List<CsLedgerVO> engineeringList = new ArrayList<>();
|
List<CsLedgerVO> engineeringList;
|
||||||
List<CsLedgerVO> allList = this.baseMapper.getAll();
|
List<CsLedgerVO> allList = this.baseMapper.getAll();
|
||||||
String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId();
|
|
||||||
|
|
||||||
/*获取用户工程,设备信息过滤*/
|
/*获取用户工程,设备信息过滤*/
|
||||||
List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
||||||
List<String> device = roleEngineerDevService.getDevice();
|
List<String> device = roleEngineerDevService.getDevice();
|
||||||
@@ -98,24 +91,21 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
deviceList.forEach(dev -> dev.setChildren(getChildren(dev, finalLineList)));
|
deviceList.forEach(dev -> dev.setChildren(getChildren(dev, finalLineList)));
|
||||||
projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
|
projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
|
||||||
engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList)));
|
engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList)));
|
||||||
//整理整个树并新增便携式设备树
|
//获取便携式设备树
|
||||||
CsLedgerVO portable = new CsLedgerVO();
|
CsLedgerVO portable = new CsLedgerVO();
|
||||||
portable.setLevel(0);
|
portable.setLevel(0);
|
||||||
portable.setName(DataParam.portableDev);
|
portable.setName(DataParam.portableDev);
|
||||||
portable.setPid("0");
|
portable.setPid("0");
|
||||||
portable.setId(IdUtil.simpleUUID());
|
portable.setId(IdUtil.simpleUUID());
|
||||||
List<CsLedgerVO> portables = wlRecordMapper.getAll();
|
List<CsLedgerVO> portables = allList.stream().filter(item->Objects.equals(item.getLevel(),2) && Objects.equals(item.getPid(),"0")).collect(Collectors.toList());
|
||||||
checkDevSetData(portables);
|
|
||||||
for(CsLedgerVO c : portables){
|
for(CsLedgerVO c : portables){
|
||||||
c.setPid(portable.getId());
|
c.setPid(portable.getId());
|
||||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(c.getId());
|
CsEquipmentDeliveryPO po = csEquipmentDeliveryMapper.selectById(c.getId());
|
||||||
c.setComFlag(csEquipmentDeliveryPO.getRunStatus());
|
c.setComFlag(po.getRunStatus());
|
||||||
c.setChildren(wlRecordMapper.getAllLine(c.getId()));
|
c.setNDId(po.getNdid());
|
||||||
for(CsLedgerVO cs : c.getChildren()){
|
|
||||||
cs.setPid(c.getId());
|
|
||||||
cs.setLevel(3);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
portables.forEach(dev -> dev.setChildren(getChildren(dev, finalLineList)));
|
||||||
|
checkDevSetData(portables);
|
||||||
portable.setChildren(portables);
|
portable.setChildren(portables);
|
||||||
|
|
||||||
CsLedgerVO government = new CsLedgerVO();
|
CsLedgerVO government = new CsLedgerVO();
|
||||||
@@ -128,29 +118,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
tree.add(portable);
|
tree.add(portable);
|
||||||
tree.add(government);
|
tree.add(government);
|
||||||
return tree;
|
return tree;
|
||||||
//return engineeringList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// //剔除未接入的设备(根据status判断不太稳,所有这里直接判断该设备有没有对应的模板指标)
|
|
||||||
// private void checkDevSetData(List<CsLedgerVO> ledgerVOS){
|
|
||||||
// Iterator<CsLedgerVO> iterator = ledgerVOS.iterator();
|
|
||||||
// while (iterator.hasNext()){
|
|
||||||
// CsLedgerVO csLedgerVO = iterator.next();
|
|
||||||
// //只针对设备
|
|
||||||
// if(csLedgerVO.getLevel() == 2){
|
|
||||||
// List<CsDevModelRelationPO> modelId = csDevModelRelationService.findModelByDevId(csLedgerVO.getId());
|
|
||||||
// if (CollUtil.isEmpty(modelId)){
|
|
||||||
// iterator.remove();
|
|
||||||
// }else{
|
|
||||||
// for (CsDevModelRelationPO item : modelId) {
|
|
||||||
// if (CollUtil.isEmpty(csDataSetService.findDataSetByModelId(item.getModelId()))){
|
|
||||||
// iterator.remove();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//剔除未接入的设备(根据status判断不太稳,所有这里直接判断该设备有没有对应的模板指标)
|
//剔除未接入的设备(根据status判断不太稳,所有这里直接判断该设备有没有对应的模板指标)
|
||||||
private void checkDevSetData(List<CsLedgerVO> ledgerVOS) {
|
private void checkDevSetData(List<CsLedgerVO> ledgerVOS) {
|
||||||
Iterator<CsLedgerVO> iterator = ledgerVOS.iterator();
|
Iterator<CsLedgerVO> iterator = ledgerVOS.iterator();
|
||||||
@@ -182,44 +150,39 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CsLedgerVO> getDeviceTree() {
|
public List<CsLedgerVO> getDeviceTree() {
|
||||||
List<CsLedgerVO> engineeringList = new ArrayList<>();
|
List<CsLedgerVO> engineeringList;
|
||||||
List<CsLedgerVO> allList = this.baseMapper.getAll();
|
List<CsLedgerVO> allList = this.baseMapper.getAll();
|
||||||
/*获取用户工程,设备信息过滤*/
|
/*获取用户工程,设备信息过滤*/
|
||||||
List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
||||||
List<String> device = roleEngineerDevService.getDevice();
|
List<String> device = roleEngineerDevService.getDevice();
|
||||||
engineeringList = allList.stream().filter(item->roleengineer.contains(item.getId())).collect(Collectors.toList());
|
engineeringList = allList.stream().filter(item->roleengineer.contains(item.getId())).collect(Collectors.toList());
|
||||||
// if (Objects.equals(RequestUtil.getUsername(),"root")){
|
|
||||||
// engineeringList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.ENGINEERING_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
|
||||||
// } else {
|
|
||||||
// List<CsEngineeringPO> engineering = csEngineeringUserService.getEngineeringByUser();
|
|
||||||
// engineeringList = allList.stream().filter(item->engineering.stream().map(CsEngineeringPO::getId).collect(Collectors.toList()).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());
|
||||||
// List<CsLedgerVO> deviceList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.DEVICE_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
|
||||||
List<CsLedgerVO> deviceList = allList.stream().filter(item -> device.contains(item.getId())).
|
List<CsLedgerVO> deviceList = allList.stream().filter(item -> device.contains(item.getId())).
|
||||||
map(
|
peek(
|
||||||
temp->{
|
temp->{
|
||||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(temp.getId());
|
CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(temp.getId());
|
||||||
temp.setComFlag(csEquipmentDeliveryPO.getRunStatus());
|
temp.setComFlag(csEquipmentDeliveryPO.getRunStatus());
|
||||||
return temp;
|
temp.setNDId(csEquipmentDeliveryPO.getNdid());
|
||||||
}
|
}
|
||||||
).
|
).
|
||||||
sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||||
checkDevSetData(deviceList);
|
checkDevSetData(deviceList);
|
||||||
projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
|
projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
|
||||||
engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList)));
|
engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList)));
|
||||||
//整理整个树并新增便携式设备树
|
|
||||||
|
//获取便携式设备树
|
||||||
CsLedgerVO portable = new CsLedgerVO();
|
CsLedgerVO portable = new CsLedgerVO();
|
||||||
portable.setLevel(0);
|
portable.setLevel(0);
|
||||||
portable.setName(DataParam.portableDev);
|
portable.setName(DataParam.portableDev);
|
||||||
portable.setPid("0");
|
portable.setPid("0");
|
||||||
portable.setId(IdUtil.simpleUUID());
|
portable.setId(IdUtil.simpleUUID());
|
||||||
List<CsLedgerVO> portables = wlRecordMapper.getAll();
|
List<CsLedgerVO> portables = allList.stream().filter(item->Objects.equals(item.getLevel(),2) && Objects.equals(item.getPid(),"0")).collect(Collectors.toList());
|
||||||
checkDevSetData(portables);
|
checkDevSetData(portables);
|
||||||
for(CsLedgerVO c : portables){
|
for(CsLedgerVO c : portables){
|
||||||
c.setPid(portable.getId());
|
c.setPid(portable.getId());
|
||||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(c.getId());
|
CsEquipmentDeliveryPO po = csEquipmentDeliveryMapper.selectById(c.getId());
|
||||||
c.setComFlag(csEquipmentDeliveryPO.getRunStatus());
|
c.setComFlag(po.getRunStatus());
|
||||||
|
c.setNDId(po.getNdid());
|
||||||
}
|
}
|
||||||
portable.setChildren(portables);
|
portable.setChildren(portables);
|
||||||
|
|
||||||
@@ -233,7 +196,6 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
tree.add(portable);
|
tree.add(portable);
|
||||||
tree.add(government);
|
tree.add(government);
|
||||||
return tree;
|
return tree;
|
||||||
//return engineeringList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -285,12 +247,6 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
public List<CsLedgerVO> getProjectTree() {
|
public List<CsLedgerVO> getProjectTree() {
|
||||||
List<CsLedgerVO> engineeringList = new ArrayList<>();
|
List<CsLedgerVO> engineeringList = new ArrayList<>();
|
||||||
List<CsLedgerVO> allList = this.baseMapper.getAll();
|
List<CsLedgerVO> allList = this.baseMapper.getAll();
|
||||||
// if (Objects.equals(RequestUtil.getUsername(),"root") || Objects.equals(RequestUtil.getUsername(),"njcnser")){
|
|
||||||
// engineeringList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.ENGINEERING_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
|
||||||
// } else {
|
|
||||||
// List<CsEngineeringPO> engineering = csEngineeringUserService.getEngineeringByUser();
|
|
||||||
// engineeringList = allList.stream().filter(item->engineering.stream().map(CsEngineeringPO::getId).collect(Collectors.toList()).contains(item.getId())).collect(Collectors.toList());
|
|
||||||
// }
|
|
||||||
List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
||||||
engineeringList = allList.stream().filter(item->roleengineer.contains(item.getId())).collect(Collectors.toList());
|
engineeringList = allList.stream().filter(item->roleengineer.contains(item.getId())).collect(Collectors.toList());
|
||||||
List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||||
@@ -313,23 +269,18 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
temp.setChildren(collect);
|
temp.setChildren(collect);
|
||||||
});
|
});
|
||||||
engineeringList.forEach(eng -> {
|
engineeringList.forEach(eng -> {
|
||||||
|
|
||||||
CsEngineeringPO csEngineeringPO = csEngineeringMapper.selectById(eng.getId());
|
CsEngineeringPO csEngineeringPO = csEngineeringMapper.selectById(eng.getId());
|
||||||
eng.setArea(this.getAreaById(csEngineeringPO.getProvince())+this.getAreaById(csEngineeringPO.getCity()));
|
eng.setArea(this.getAreaById(csEngineeringPO.getProvince())+this.getAreaById(csEngineeringPO.getCity()));
|
||||||
eng.setRemark(csEngineeringPO.getDescription());
|
eng.setRemark(csEngineeringPO.getDescription());
|
||||||
eng.setChildren(getChildren(eng, projectList));
|
eng.setChildren(getChildren(eng, projectList));
|
||||||
|
}
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
return engineeringList;
|
return engineeringList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CsLedger> queryLine(LineParamDTO lineParamdto) {
|
public List<CsLedger> queryLine(LineParamDTO lineParamdto) {
|
||||||
List<CsLedger> lineIds = this.getBaseMapper().queryLine(lineParamdto);
|
return this.getBaseMapper().queryLine(lineParamdto);
|
||||||
return lineIds;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.csdevice.mapper.CsSoftInfoMapper;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsSoftInfoPO;
|
||||||
|
import com.njcn.csdevice.service.ICsSoftInfoService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 系统软件表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-08-09
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CsSoftInfoServiceImpl extends ServiceImpl<CsSoftInfoMapper, CsSoftInfoPO> implements ICsSoftInfoService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,202 @@
|
|||||||
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.njcn.access.api.AskDeviceDataFeignClient;
|
||||||
|
import com.njcn.access.enums.AccessResponseEnum;
|
||||||
|
import com.njcn.access.pojo.dto.file.FileDto;
|
||||||
|
import com.njcn.access.utils.ChannelObjectUtil;
|
||||||
|
import com.njcn.access.utils.MqttUtil;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
|
import com.njcn.csdevice.service.DeviceFtpService;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.MakeUpVo;
|
||||||
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
|
import com.njcn.redis.pojo.enums.AppRedisKey;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DeviceFtpServiceImpl implements DeviceFtpService {
|
||||||
|
|
||||||
|
private final AskDeviceDataFeignClient askDeviceDataFeignClient;
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
private final ChannelObjectUtil channelObjectUtil;
|
||||||
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
private final MqttUtil mqttUtil;
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MakeUpVo askDeviceRootPath(String nDid) {
|
||||||
|
MakeUpVo makeUpVo = new MakeUpVo();
|
||||||
|
try {
|
||||||
|
judgeClientOnline(nDid);
|
||||||
|
redisUtil.delete(AppRedisKey.DEVICE_ROOT_PATH + nDid);
|
||||||
|
askDeviceDataFeignClient.askDeviceRootPath(nDid);
|
||||||
|
Thread.sleep(3000);
|
||||||
|
Object object = redisUtil.getObjectByKey(AppRedisKey.DEVICE_ROOT_PATH + nDid);
|
||||||
|
if (Objects.nonNull(object)) {
|
||||||
|
makeUpVo.setPrjDataPath(object.toString());
|
||||||
|
makeUpVo.setType("dir");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException(AlgorithmResponseEnum.ASK_DEVICE_DIR_ROOT_ERROR);
|
||||||
|
}
|
||||||
|
return makeUpVo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MakeUpVo> askDeviceFileOrDir(String nDid, String name, String type) {
|
||||||
|
List<MakeUpVo> result = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
judgeClientOnline(nDid);
|
||||||
|
// 删除旧的缓存信息
|
||||||
|
redisUtil.delete(AppRedisKey.PROJECT_INFO + nDid);
|
||||||
|
// 请求设备文件或目录信息
|
||||||
|
askDeviceDataFeignClient.askDeviceFileOrDir(nDid, name);
|
||||||
|
Thread.sleep(10000);
|
||||||
|
// 从 Redis 获取对象
|
||||||
|
Object object = redisUtil.getObjectByKey(AppRedisKey.PROJECT_INFO + nDid);
|
||||||
|
if (object != null) {
|
||||||
|
// 根据类型处理不同的数据
|
||||||
|
processObject(result, object, type);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 捕获特定异常并抛出运行时异常
|
||||||
|
throw new BusinessException(AlgorithmResponseEnum.ASK_DEVICE_DIR_ERROR);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(result)) {
|
||||||
|
result.stream().sorted(Comparator.comparing(MakeUpVo::getType)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String downloadFile(String nDid, String name, Integer size, String fileCheck) {
|
||||||
|
String result = null;
|
||||||
|
judgeClientOnline(nDid);
|
||||||
|
Object task = redisUtil.getObjectByKey("fileDowning:"+nDid);
|
||||||
|
if (Objects.nonNull(task)) {
|
||||||
|
throw new BusinessException(AlgorithmResponseEnum.FILE_DOWNLOADING);
|
||||||
|
}
|
||||||
|
Object task2 = redisUtil.getObjectByKey("uploading");
|
||||||
|
if (Objects.nonNull(task2)) {
|
||||||
|
throw new BusinessException(AlgorithmResponseEnum.FILE_BUSY);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
redisUtil.delete("downloadFilePath:"+name);
|
||||||
|
boolean file = askDeviceDataFeignClient.downloadFile(nDid,name,size,fileCheck).getData();
|
||||||
|
if (!file) {
|
||||||
|
redisUtil.delete("fileDowning:"+nDid);
|
||||||
|
redisUtil.delete("fileCheck"+name);
|
||||||
|
throw new BusinessException(AlgorithmResponseEnum.FILE_DOWNLOAD_ERROR);
|
||||||
|
}
|
||||||
|
Object object = redisUtil.getObjectByKey("downloadFilePath:"+name);
|
||||||
|
if (Objects.nonNull(object)) {
|
||||||
|
result = (String) object;
|
||||||
|
redisUtil.delete("downloadFilePath:"+name);
|
||||||
|
redisUtil.delete("fileCheck"+name);
|
||||||
|
redisUtil.delete("fileDowning:"+nDid);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
redisUtil.delete("fileDowning:"+nDid);
|
||||||
|
redisUtil.delete("fileCheck"+name);
|
||||||
|
throw new BusinessException(AlgorithmResponseEnum.FILE_DOWNLOADING);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean createFile(String nDid, String path) {
|
||||||
|
boolean result = false;
|
||||||
|
try {
|
||||||
|
askDeviceDataFeignClient.createFolder(nDid,path);
|
||||||
|
Thread.sleep(3000);
|
||||||
|
String key = "createDir"+ nDid;
|
||||||
|
Integer value = Integer.parseInt(redisUtil.getObjectByKey(key).toString());
|
||||||
|
if (Objects.equals(value,200)) {
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean deleteFile(String nDid, String path) {
|
||||||
|
boolean result = false;
|
||||||
|
try {
|
||||||
|
askDeviceDataFeignClient.deleteFolder(nDid,path);
|
||||||
|
Thread.sleep(3000);
|
||||||
|
String key = "deleteDir"+ nDid;
|
||||||
|
Integer value = Integer.parseInt(redisUtil.getObjectByKey(key).toString());
|
||||||
|
if (Objects.equals(value,200)) {
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processObject(List<MakeUpVo> result, Object object, String type) {
|
||||||
|
if ("dir".equals(type)) {
|
||||||
|
List<FileDto.DirInfo> projectInfoList = channelObjectUtil.objectToList(object, FileDto.DirInfo.class);
|
||||||
|
projectInfoList.forEach(item -> {
|
||||||
|
MakeUpVo vo = createMakeUpVoFromDir(item);
|
||||||
|
result.add(vo);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
FileDto.FileInfo fileInfo = channelObjectUtil.objectToSingleObject(object, FileDto.FileInfo.class);
|
||||||
|
MakeUpVo vo = createMakeUpVoFromFile(fileInfo);
|
||||||
|
result.add(vo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private MakeUpVo createMakeUpVoFromDir(FileDto.DirInfo item) {
|
||||||
|
MakeUpVo vo = new MakeUpVo();
|
||||||
|
vo.setPrjDataPath(item.getName());
|
||||||
|
vo.setType(item.getType());
|
||||||
|
vo.setSize(item.getSize());
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
private MakeUpVo createMakeUpVoFromFile(FileDto.FileInfo fileInfo) {
|
||||||
|
MakeUpVo vo = new MakeUpVo();
|
||||||
|
vo.setPrjDataPath(fileInfo.getName());
|
||||||
|
if (fileInfo.getFileTime() != 0) {
|
||||||
|
LocalDateTime dateTime = Instant.ofEpochMilli((fileInfo.getFileTime() - 3600*8) * 1000).atZone(ZoneId.systemDefault()).toLocalDateTime();
|
||||||
|
String formattedDate = dateTime.format(formatter);
|
||||||
|
vo.setStartTime(formattedDate);
|
||||||
|
vo.setSize(fileInfo.getFileSize());
|
||||||
|
}
|
||||||
|
vo.setFileCheck(fileInfo.getFileCheck());
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void judgeClientOnline(String nDid) {
|
||||||
|
//判断客户端是否在线
|
||||||
|
String clientName = "NJCN-" + nDid.substring(nDid.length() - 6);
|
||||||
|
boolean mqttClient = mqttUtil.judgeClientOnline(clientName);
|
||||||
|
if (!mqttClient){
|
||||||
|
throw new BusinessException(AccessResponseEnum.MISSING_CLIENT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,7 +3,6 @@ package com.njcn.csdevice.service.impl;
|
|||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||||
import com.njcn.csdevice.constant.DataParam;
|
import com.njcn.csdevice.constant.DataParam;
|
||||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
@@ -17,12 +16,16 @@ import com.njcn.csdevice.util.InfluxDbParamUtil;
|
|||||||
import com.njcn.csharmonic.api.EventFeignClient;
|
import com.njcn.csharmonic.api.EventFeignClient;
|
||||||
import com.njcn.csharmonic.api.OfflineDataUploadFeignClient;
|
import com.njcn.csharmonic.api.OfflineDataUploadFeignClient;
|
||||||
import com.njcn.csharmonic.offline.constant.OfflineConstant;
|
import com.njcn.csharmonic.offline.constant.OfflineConstant;
|
||||||
|
import com.njcn.csharmonic.offline.log.Log;
|
||||||
import com.njcn.csharmonic.offline.log.vo.NewBodyTaglogbuffer;
|
import com.njcn.csharmonic.offline.log.vo.NewBodyTaglogbuffer;
|
||||||
import com.njcn.csharmonic.offline.log.vo.NewHeadTaglogbuffer;
|
import com.njcn.csharmonic.offline.log.vo.NewHeadTaglogbuffer;
|
||||||
import com.njcn.csharmonic.offline.log.vo.NewTaglogbuffer;
|
import com.njcn.csharmonic.offline.log.vo.NewTaglogbuffer;
|
||||||
import com.njcn.csharmonic.offline.mincfg.tagComtradeCfg;
|
import com.njcn.csharmonic.offline.log.vo.TagComtradeCfg;
|
||||||
|
import com.njcn.csharmonic.offline.mincfg.AnalyseComtradeCfg;
|
||||||
|
import com.njcn.csharmonic.offline.mincfg.vo.CmnModeCfg;
|
||||||
import com.njcn.csharmonic.offline.vo.Response;
|
import com.njcn.csharmonic.offline.vo.Response;
|
||||||
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
||||||
|
import com.njcn.influx.imapper.CommonMapper;
|
||||||
import com.njcn.influx.imapper.EvtDataMapper;
|
import com.njcn.influx.imapper.EvtDataMapper;
|
||||||
import com.njcn.influx.imapper.PqdDataMapper;
|
import com.njcn.influx.imapper.PqdDataMapper;
|
||||||
import com.njcn.influx.pojo.po.cs.EntData;
|
import com.njcn.influx.pojo.po.cs.EntData;
|
||||||
@@ -30,21 +33,18 @@ import com.njcn.influx.pojo.po.cs.PqdData;
|
|||||||
import com.njcn.oss.utils.FileStorageUtil;
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.api.EleEvtFeignClient;
|
import com.njcn.system.api.EleEvtFeignClient;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import com.njcn.system.pojo.po.EleEvtParm;
|
|
||||||
import com.njcn.web.pojo.param.BaseParam;
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.io.FilenameUtils;
|
||||||
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.util.CollectionUtils;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.*;
|
||||||
import java.io.IOException;
|
import java.text.DecimalFormat;
|
||||||
import java.io.ObjectInputStream;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.time.ZoneOffset;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@@ -62,6 +62,9 @@ import java.util.stream.Stream;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMapper, PortableOfflLog> implements IPortableOfflLogService {
|
public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMapper, PortableOfflLog> implements IPortableOfflLogService {
|
||||||
|
|
||||||
|
|
||||||
|
private final DecimalFormat df = new DecimalFormat("#0.000");
|
||||||
|
|
||||||
private final FileStorageUtil fileStorageUtil;
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
@@ -74,8 +77,6 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
|
|||||||
|
|
||||||
private final EquipmentFeignClient equipmentFeignClient;
|
private final EquipmentFeignClient equipmentFeignClient;
|
||||||
|
|
||||||
private final CsLineFeignClient csLineFeignClient;
|
|
||||||
|
|
||||||
private final InfluxDbParamUtil influxDbParamUtil;
|
private final InfluxDbParamUtil influxDbParamUtil;
|
||||||
|
|
||||||
private final PqdDataMapper pqdDataMapper;
|
private final PqdDataMapper pqdDataMapper;
|
||||||
@@ -85,15 +86,103 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
|
|||||||
@Override
|
@Override
|
||||||
public Page<PortableOfflLog> queryPage(BaseParam baseParam) {
|
public Page<PortableOfflLog> queryPage(BaseParam baseParam) {
|
||||||
Page<PortableOfflLog> returnpage = new Page<> (baseParam.getPageNum(), baseParam.getPageSize ());
|
Page<PortableOfflLog> returnpage = new Page<> (baseParam.getPageNum(), baseParam.getPageSize ());
|
||||||
if(baseParam.getSearchBeginTime()!=null) baseParam.setSearchBeginTime(baseParam.getSearchBeginTime()+DataParam.startTime);
|
if(baseParam.getSearchBeginTime()!=null) {
|
||||||
if(baseParam.getSearchEndTime()!=null) baseParam.setSearchEndTime(baseParam.getSearchEndTime()+DataParam.endTime);
|
baseParam.setSearchBeginTime(baseParam.getSearchBeginTime()+DataParam.startTime);
|
||||||
|
}
|
||||||
|
if(baseParam.getSearchEndTime()!=null) {
|
||||||
|
baseParam.setSearchEndTime(baseParam.getSearchEndTime()+DataParam.endTime);
|
||||||
|
}
|
||||||
returnpage = this.getBaseMapper().queryPage(returnpage,baseParam);
|
returnpage = this.getBaseMapper().queryPage(returnpage,baseParam);
|
||||||
return returnpage;
|
return returnpage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public byte[] uploadAnalysis(List<MultipartFile> files,String type) throws Exception{
|
||||||
|
byte[] bytes = null;
|
||||||
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
|
ObjectOutputStream oos = new ObjectOutputStream(baos);
|
||||||
|
|
||||||
|
List<Response> responses = new ArrayList<>();
|
||||||
|
//min解析较为特殊需要同时解析所有文件
|
||||||
|
if(!files.isEmpty() && OfflineConstant.MIN.equals(type)){
|
||||||
|
Response response = new Response();
|
||||||
|
response.setFilename(OfflineConstant.MIN);
|
||||||
|
List<PqdData> pqdData = null;
|
||||||
|
try {
|
||||||
|
pqdData = AnalyseComtradeCfg.processDirectory(files);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("min文件夹下的数据文件解析失败");
|
||||||
|
response.setState(2);
|
||||||
|
}
|
||||||
|
response.setObj(pqdData);
|
||||||
|
responses.add(response);
|
||||||
|
}else{
|
||||||
|
for(MultipartFile file : files){
|
||||||
|
Response response = new Response();
|
||||||
|
response.setFilename(file.getOriginalFilename());
|
||||||
|
if(OfflineConstant.COMTRADE.equals(type) && file.getOriginalFilename().indexOf(OfflineConstant.CFG) != -1) {
|
||||||
|
TagComtradeCfg tagComtradeCfg = null;
|
||||||
|
try {
|
||||||
|
tagComtradeCfg = AnalyseComtradeCfg.analyseComtradeCfg(file);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("当前文件:{},解析失败",file.getOriginalFilename());
|
||||||
|
response.setState(2);
|
||||||
|
}
|
||||||
|
response.setObj(tagComtradeCfg);
|
||||||
|
}else if(OfflineConstant.LOG.equals(type) && file.getOriginalFilename().indexOf(OfflineConstant.BIN) != -1){
|
||||||
|
List<NewTaglogbuffer> newTaglogbuffers = null;
|
||||||
|
try {
|
||||||
|
newTaglogbuffers = Log.convertLog(file);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("当前文件:{},解析失败",file.getOriginalFilename());
|
||||||
|
response.setState(2);
|
||||||
|
}
|
||||||
|
response.setObj(newTaglogbuffers);
|
||||||
|
}
|
||||||
|
responses.add(response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
oos.writeObject(responses);
|
||||||
|
bytes = baos.toByteArray();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new BusinessException(OfflineConstant.DATATOBYTE_FAIL);
|
||||||
|
} finally {
|
||||||
|
oos.close();
|
||||||
|
baos.close();
|
||||||
|
}
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public void importEquipment(UploadDataParam uploadDataParam) {
|
public void importEquipment(UploadDataParam uploadDataParam){
|
||||||
|
String lineId = uploadDataParam.getLineId();
|
||||||
|
String cdid = uploadDataParam.getLineId().substring(uploadDataParam.getLineId().length() - 1);
|
||||||
|
//第一步解析redcord.bin文件获取监测点序号做校验
|
||||||
|
List<MultipartFile> record = uploadDataParam.getFiles().stream().filter(
|
||||||
|
temp -> temp.getOriginalFilename().contains("record.bin"))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if(CollectionUtils.isEmpty(record)){
|
||||||
|
throw new BusinessException(AlgorithmResponseEnum.RECORD_FILE_LOST);
|
||||||
|
}else {
|
||||||
|
InputStream inputStream = null;
|
||||||
|
try {
|
||||||
|
inputStream = record.get(0).getInputStream();
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
CmnModeCfg cmnModeCfg = AnalyseComtradeCfg.convertRecord(inputStream);
|
||||||
|
//监测点序号
|
||||||
|
int lineIdx = cmnModeCfg.line_idx;
|
||||||
|
|
||||||
|
if(lineIdx!=Integer.valueOf(cdid)){
|
||||||
|
throw new BusinessException(AlgorithmResponseEnum.LINE_NUM_MISMATCH);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//获取离线上传对应的字典规则(字典用来控制上传的文件夹名称,其中字典的name代表名称,code代表该文件夹下对应的解析规则且code不能更改)
|
//获取离线上传对应的字典规则(字典用来控制上传的文件夹名称,其中字典的name代表名称,code代表该文件夹下对应的解析规则且code不能更改)
|
||||||
List<DictData> dictDatas = dicDataFeignClient.getDicDataByTypeCode(DataParam.wlRecordUpload).getData();
|
List<DictData> dictDatas = dicDataFeignClient.getDicDataByTypeCode(DataParam.wlRecordUpload).getData();
|
||||||
List<Response> responses = new ArrayList<>();
|
List<Response> responses = new ArrayList<>();
|
||||||
@@ -104,11 +193,18 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
|
|||||||
List<MultipartFile> fileList = new ArrayList<>();
|
List<MultipartFile> fileList = new ArrayList<>();
|
||||||
for(MultipartFile file : uploadDataParam.getFiles()){
|
for(MultipartFile file : uploadDataParam.getFiles()){
|
||||||
//获取每个文件夹下对应的文件信息
|
//获取每个文件夹下对应的文件信息
|
||||||
if(checkPrevsFolder(file.getOriginalFilename(),dictData.getName())!=null) fileList.add(file);
|
if(checkPrevsFolder(file.getOriginalFilename(),dictData.getName())!=null) {
|
||||||
|
fileList.add(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(!fileList.isEmpty()){
|
if(!fileList.isEmpty()){
|
||||||
//将当前文件夹下的文件统一解析
|
//将当前文件夹下的文件统一解析
|
||||||
byte[] resp = offlineDataUploadFeignClient.uploadAnalysis(fileList,dictData.getCode()).getData();
|
byte[] resp = new byte[0];
|
||||||
|
try {
|
||||||
|
resp = uploadAnalysis(fileList,dictData.getCode());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
//解析的返回的是复杂对象所以直接转成byte数组
|
//解析的返回的是复杂对象所以直接转成byte数组
|
||||||
ByteArrayInputStream bis = new ByteArrayInputStream(resp);
|
ByteArrayInputStream bis = new ByteArrayInputStream(resp);
|
||||||
ObjectInputStream ois = null;
|
ObjectInputStream ois = null;
|
||||||
@@ -137,11 +233,12 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(uploadDataParam.getDevId()).collect(Collectors.toList())).getData();
|
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(uploadDataParam.getDevId()).collect(Collectors.toList())).getData();
|
||||||
|
CsEquipmentDeliveryDTO csEquipmentDeliveryDTO = data1.get(0);
|
||||||
//min文件夹下的文件是否解析过
|
//min文件夹下的文件是否解析过
|
||||||
boolean minFlag = true;
|
boolean minFlag = true;
|
||||||
//开始上传文件、记录上传日志、解析的文件结果入库
|
//开始上传文件、记录上传日志、解析的文件结果入库
|
||||||
//最外层便利所有文件确保所有文件都上传及记录上传日志
|
//最外层便利所有文件确保所有文件都上传及记录上传日志
|
||||||
|
|
||||||
for(MultipartFile file : uploadDataParam.getFiles()){
|
for(MultipartFile file : uploadDataParam.getFiles()){
|
||||||
//初始上传日志基本信息
|
//初始上传日志基本信息
|
||||||
PortableOfflLog portableOfflLog = new PortableOfflLog();
|
PortableOfflLog portableOfflLog = new PortableOfflLog();
|
||||||
@@ -153,11 +250,18 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
|
|||||||
//默认总条数及入库数为0(防止解析的数据重复插入及上传的文件目录路径错误)
|
//默认总条数及入库数为0(防止解析的数据重复插入及上传的文件目录路径错误)
|
||||||
portableOfflLog.setAllCount(0);
|
portableOfflLog.setAllCount(0);
|
||||||
portableOfflLog.setRealCount(0);
|
portableOfflLog.setRealCount(0);
|
||||||
|
|
||||||
//开始匹配解析的文件结果入库
|
//开始匹配解析的文件结果入库
|
||||||
for(Response response : responses){
|
for(Response response : responses){
|
||||||
//min解析结果较为特殊所有的文件解析后只有一条结果
|
//min解析结果较为特殊所有的文件解析后只有一条结果
|
||||||
if(OfflineConstant.MIN.equals(response.getFilename()) && checkPrevsFolder(file.getOriginalFilename(),OfflineConstant.MIN)!=null){
|
if(OfflineConstant.MIN.equals(response.getFilename()) && checkPrevsFolder(file.getOriginalFilename(),OfflineConstant.MIN)!=null){
|
||||||
List<PqdData> pqdData = (List<PqdData>) response.getObj();
|
List<PqdData> pqdData = (List<PqdData>) response.getObj();
|
||||||
|
pqdData.forEach(temp->{
|
||||||
|
temp.setClDid(cdid);
|
||||||
|
temp.setIsAbnormal(0);
|
||||||
|
temp.setProcess(data1.get(0).getProcess()+"");
|
||||||
|
temp.setLineId(uploadDataParam.getLineId());
|
||||||
|
});
|
||||||
//如果明确返回了state 那么当前文件解析出错
|
//如果明确返回了state 那么当前文件解析出错
|
||||||
if(response.getState() != null){
|
if(response.getState() != null){
|
||||||
portableOfflLog.setState(response.getState());
|
portableOfflLog.setState(response.getState());
|
||||||
@@ -169,7 +273,7 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
|
|||||||
portableOfflLog.setRealCount(pqdData.size());
|
portableOfflLog.setRealCount(pqdData.size());
|
||||||
if(minFlag){
|
if(minFlag){
|
||||||
log.info("类型min,插入infulxDb的pqdData");
|
log.info("类型min,插入infulxDb的pqdData");
|
||||||
//pqdDataMapper.insertBatch(pqdData);
|
pqdDataMapper.insertBatch(pqdData);
|
||||||
//min结果集解析入库后就不需要在解析了
|
//min结果集解析入库后就不需要在解析了
|
||||||
minFlag = false;
|
minFlag = false;
|
||||||
}
|
}
|
||||||
@@ -181,7 +285,7 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
|
|||||||
if(response.getState() != null){
|
if(response.getState() != null){
|
||||||
portableOfflLog.setState(response.getState());
|
portableOfflLog.setState(response.getState());
|
||||||
}
|
}
|
||||||
tagComtradeCfg tagComtradeCfg = (tagComtradeCfg) response.getObj();
|
TagComtradeCfg tagComtradeCfg = (TagComtradeCfg) response.getObj();
|
||||||
if(tagComtradeCfg != null){
|
if(tagComtradeCfg != null){
|
||||||
//否则正常标记为成功解析
|
//否则正常标记为成功解析
|
||||||
portableOfflLog.setState(1);
|
portableOfflLog.setState(1);
|
||||||
@@ -208,6 +312,7 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
|
|||||||
NewHeadTaglogbuffer newHeadTaglogbuffer = newTaglogbuffer.getNewHeadTaglogbuffer();
|
NewHeadTaglogbuffer newHeadTaglogbuffer = newTaglogbuffer.getNewHeadTaglogbuffer();
|
||||||
String strId = "";
|
String strId = "";
|
||||||
String strName = newHeadTaglogbuffer.getLogCode()+"";
|
String strName = newHeadTaglogbuffer.getLogCode()+"";
|
||||||
|
//todo 其他事件做映射
|
||||||
//中断标志
|
//中断标志
|
||||||
if(DataParam.intrStr.contains(newHeadTaglogbuffer.getLogCode())){
|
if(DataParam.intrStr.contains(newHeadTaglogbuffer.getLogCode())){
|
||||||
strId = DataParam.intrStrId;
|
strId = DataParam.intrStrId;
|
||||||
@@ -223,28 +328,44 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
|
|||||||
strId = DataParam.swlStrId;
|
strId = DataParam.swlStrId;
|
||||||
strName = DataParam.swlStrName;
|
strName = DataParam.swlStrName;
|
||||||
}
|
}
|
||||||
List<EleEvtParm> eleEvtParms = eleEvtFeignClient.queryByPid(strId).getData();
|
|
||||||
//插入事件表
|
//插入事件表
|
||||||
CsEventPO csEventPO = new CsEventPO();
|
CsEventPO csEventPO = new CsEventPO();
|
||||||
csEventPO.setId(IdUtil.simpleUUID());
|
csEventPO.setId(IdUtil.fastSimpleUUID());
|
||||||
csEventPO.setLineId(uploadDataParam.getLineId());
|
csEventPO.setLineId(uploadDataParam.getLineId());
|
||||||
csEventPO.setDeviceId(uploadDataParam.getDevId());
|
csEventPO.setDeviceId(uploadDataParam.getDevId());
|
||||||
|
csEventPO.setProcess(csEquipmentDeliveryDTO.getProcess());
|
||||||
|
//todo 做映射目前置空
|
||||||
|
csEventPO.setCode(null);
|
||||||
csEventPO.setStartTime(newTaglogbuffer.getStart());
|
csEventPO.setStartTime(newTaglogbuffer.getStart());
|
||||||
csEventPO.setTag(strName);
|
csEventPO.setTag(strName);
|
||||||
|
//更具唯一索引做校验存在该事件则跳过;
|
||||||
|
CsEventPO data = eventFeignClient.queryByIndex(csEventPO).getData();
|
||||||
|
if(Objects.nonNull(data)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
String wavePath = null;
|
String wavePath = null;
|
||||||
//设置波形文件(去cfg结果集里面去找)
|
//设置波形文件(去cfg结果集里面去找)
|
||||||
for (Response res : cfgResponse) {
|
for (Response res : cfgResponse) {
|
||||||
String cfg = res.getFilename();
|
String cfg = res.getFilename();
|
||||||
String dat = cfg.substring(0,cfg.lastIndexOf("."))+OfflineConstant.DAT;
|
String dat = cfg.substring(0,cfg.lastIndexOf("."))+OfflineConstant.DAT;
|
||||||
String sharPath = OfflineConstant.COMTRADE+"/"+DataParam.wlRecordPath+uploadDataParam.getDevId()+"/"+uploadDataParam.getLineId()+"/"+getFolderName()+"/";
|
String sharPath = OfflineConstant.COMTRADE+"/"+csEquipmentDeliveryDTO.getMac()+"/";
|
||||||
tagComtradeCfg sing = (tagComtradeCfg) res.getObj();
|
TagComtradeCfg sing = (TagComtradeCfg) res.getObj();
|
||||||
Date date = Date.from(newTaglogbuffer.getStart().atZone( ZoneId.systemDefault()).toInstant());
|
|
||||||
//如果匹配上则需要将当前cfg文件及对应的dat文件上传到comtrade文件夹中
|
//如果匹配上则需要将当前cfg文件及对应的dat文件上传到comtrade文件夹中
|
||||||
if ((sing!= null && sing.getTimeStart()!= null && sing.getTimeEnd() !=null && sing.getTimeTrigger().compareTo(date) <= 0 && sing.getTimeEnd().compareTo(date) >= 0)) {
|
if (sing!= null && sing.getTimeStart()!= null && sing.getTimeTrigger().compareTo(csEventPO.getStartTime())<=0
|
||||||
|
&&sing.getTimeEnd().compareTo(csEventPO.getStartTime())>=0) {
|
||||||
for(MultipartFile f : uploadDataParam.getFiles()){
|
for(MultipartFile f : uploadDataParam.getFiles()){
|
||||||
if(f.getOriginalFilename().equals(cfg) || f.getOriginalFilename().equals(dat)){
|
if(f.getOriginalFilename().equals(cfg) || f.getOriginalFilename().equals(dat)){
|
||||||
fileStorageUtil.uploadMultipart(f, sharPath);
|
int lastIndex = f.getOriginalFilename().lastIndexOf('/');
|
||||||
wavePath = sharPath;
|
String fileName = f.getOriginalFilename().substring(lastIndex + 1);
|
||||||
|
String baseName = FilenameUtils.getBaseName(fileName);
|
||||||
|
String extension = FilenameUtils.getExtension(fileName);
|
||||||
|
try {
|
||||||
|
fileStorageUtil.uploadStreamSpecifyName(f.getInputStream(), sharPath, baseName + "." + extension.toUpperCase());
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
wavePath = sharPath+fileName.substring(0,fileName.lastIndexOf("."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -254,17 +375,24 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
|
|||||||
csEventPO.setType(0);
|
csEventPO.setType(0);
|
||||||
String clDid = influxDbParamUtil.getClDidByLineId(uploadDataParam.getLineId());
|
String clDid = influxDbParamUtil.getClDidByLineId(uploadDataParam.getLineId());
|
||||||
csEventPO.setClDid(clDid == null ? null : Integer.parseInt(clDid));
|
csEventPO.setClDid(clDid == null ? null : Integer.parseInt(clDid));
|
||||||
//默认告警等级2
|
|
||||||
csEventPO.setLevel(2);
|
|
||||||
//默认事件发生位置:电网侧
|
csEventPO.setProcess(csEquipmentDeliveryDTO.getProcess());
|
||||||
csEventPO.setLocation("grid");
|
|
||||||
csEventPO.setProcess(data1.get(0).getProcess());
|
|
||||||
csEventPOS.add(csEventPO);
|
csEventPOS.add(csEventPO);
|
||||||
EntData entData = new EntData();
|
EntData entData = new EntData();
|
||||||
entData.setTime(newTaglogbuffer.getStart().toInstant(ZoneOffset.UTC));
|
entData.setUuid(csEventPO.getId());
|
||||||
|
entData.setTime(new Date().toInstant());
|
||||||
|
|
||||||
|
|
||||||
|
//entData.setTime(newTaglogbuffer.getStart().toInstant(ZoneOffset.UTC));
|
||||||
for(NewBodyTaglogbuffer newBodyTaglogbuffer : newTaglogbuffer.getNewBodyTaglogbuffers()){
|
for(NewBodyTaglogbuffer newBodyTaglogbuffer : newTaglogbuffer.getNewBodyTaglogbuffers()){
|
||||||
if(newBodyTaglogbuffer.getParaCode() == 0) entData.setEvtParamVVaDepth(newBodyTaglogbuffer.getParaValue()/65536D);
|
if(newBodyTaglogbuffer.getParaCode() == 0) {
|
||||||
if(newBodyTaglogbuffer.getParaCode() == 1) entData.setEvtParamTm(newBodyTaglogbuffer.getParaValue()/65536D);
|
entData.setEvtParamVVaDepth(Double.parseDouble(df.format(newBodyTaglogbuffer.getParaValue()/65536D)));
|
||||||
|
}
|
||||||
|
if(newBodyTaglogbuffer.getParaCode() == 1) {
|
||||||
|
entData.setEvtParamTm(Double.parseDouble(df.format(newBodyTaglogbuffer.getParaValue()/65536D)));
|
||||||
|
csEventPO.setPersistTime(Double.parseDouble(df.format(newBodyTaglogbuffer.getParaValue()/65536D)));
|
||||||
|
}
|
||||||
if(newBodyTaglogbuffer.getParaCode() == 5) {
|
if(newBodyTaglogbuffer.getParaCode() == 5) {
|
||||||
int code = newBodyTaglogbuffer.getParaValue()/65536;
|
int code = newBodyTaglogbuffer.getParaValue()/65536;
|
||||||
switch (code){
|
switch (code){
|
||||||
@@ -293,10 +421,14 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.info("类型log,插入infulxDb的evtData");
|
log.info("类型log,插入infulxDb的evtData");
|
||||||
//evtDataMapper.insertOne(entData);
|
try {
|
||||||
|
evtDataMapper.insertOne(entData);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
log.info("类型log,插入mysql事件表cs_event");
|
log.info("类型log,插入mysql事件表cs_event");
|
||||||
//eventFeignClient.saveBatchEventList(csEventPOS);
|
eventFeignClient.saveBatchEventList(csEventPOS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,27 @@
|
|||||||
package com.njcn.csdevice.service.impl;
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||||
import com.njcn.csdevice.constant.DataParam;
|
import com.njcn.csdevice.constant.DataParam;
|
||||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||||
|
import com.njcn.csdevice.mapper.CsDeviceUserPOMapper;
|
||||||
|
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
||||||
|
import com.njcn.csdevice.mapper.CsLinePOMapper;
|
||||||
import com.njcn.csdevice.mapper.WlRecordMapper;
|
import com.njcn.csdevice.mapper.WlRecordMapper;
|
||||||
import com.njcn.csdevice.param.WlRecordPageParam;
|
import com.njcn.csdevice.param.WlRecordPageParam;
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||||
|
import com.njcn.csdevice.pojo.dto.CsEquipmentProcessDTO;
|
||||||
import com.njcn.csdevice.pojo.param.WlRecordParam;
|
import com.njcn.csdevice.pojo.param.WlRecordParam;
|
||||||
|
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.WlRecord;
|
import com.njcn.csdevice.pojo.po.WlRecord;
|
||||||
import com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo;
|
import com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo;
|
||||||
@@ -24,21 +31,26 @@ import com.njcn.csdevice.service.IWlRecordService;
|
|||||||
import com.njcn.csdevice.util.InfluxDbParamUtil;
|
import com.njcn.csdevice.util.InfluxDbParamUtil;
|
||||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
|
import com.njcn.influx.imapper.CommonMapper;
|
||||||
import com.njcn.influx.pojo.bo.CommonQueryParam;
|
import com.njcn.influx.pojo.bo.CommonQueryParam;
|
||||||
|
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
||||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||||
|
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||||
import com.njcn.influx.service.CommonService;
|
import com.njcn.influx.service.CommonService;
|
||||||
import com.njcn.system.api.CsStatisticalSetFeignClient;
|
import com.njcn.system.api.CsStatisticalSetFeignClient;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.sf.cglib.core.Local;
|
||||||
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 java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.time.LocalDateTime;
|
import java.time.*;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@@ -63,8 +75,14 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
|||||||
|
|
||||||
private final CommonService commonService;
|
private final CommonService commonService;
|
||||||
|
|
||||||
|
private final CommonMapper commonMapper;
|
||||||
|
|
||||||
private final InfluxDbParamUtil influxDbParamUtil;
|
private final InfluxDbParamUtil influxDbParamUtil;
|
||||||
|
|
||||||
|
private final CsLinePOMapper csLinePOMapper;
|
||||||
|
|
||||||
|
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||||
|
|
||||||
private final DecimalFormat df = new DecimalFormat(DataParam.DecimalFormatStr);
|
private final DecimalFormat df = new DecimalFormat(DataParam.DecimalFormatStr);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -99,11 +117,23 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
|||||||
this.saveBatch(insertList);
|
this.saveBatch(insertList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addBaseData(WlRecord wlRecord) {
|
||||||
|
this.save(wlRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addBaseDataList(List<WlRecord> wlRecord) {
|
||||||
|
this.saveBatch(wlRecord);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateTestRecord(WlRecordParam.UpdateRecord record) {
|
public void updateTestRecord(WlRecordParam.UpdateRecord record) {
|
||||||
WlRecord wlRecord = new WlRecord();
|
WlRecord wlRecord = new WlRecord();
|
||||||
BeanUtils.copyProperties(record, wlRecord);
|
BeanUtils.copyProperties(record, wlRecord);
|
||||||
|
wlRecord.setStartTime(record.getProStartTime());
|
||||||
|
wlRecord.setEndTime(record.getProEndTime());
|
||||||
this.updateById(wlRecord);
|
this.updateById(wlRecord);
|
||||||
saveDataRecord(record);
|
saveDataRecord(record);
|
||||||
}
|
}
|
||||||
@@ -134,13 +164,13 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
|||||||
public RecordVo.RecordItemVo getTestRecordById(String testRecordId) {
|
public RecordVo.RecordItemVo getTestRecordById(String testRecordId) {
|
||||||
RecordVo.RecordItemVo recordItemVo = new RecordVo.RecordItemVo();
|
RecordVo.RecordItemVo recordItemVo = new RecordVo.RecordItemVo();
|
||||||
List<RecordVo> recordVoList = new ArrayList<>();
|
List<RecordVo> recordVoList = new ArrayList<>();
|
||||||
LambdaQueryWrapper<WlRecord> qw = new LambdaQueryWrapper();
|
LambdaQueryWrapper<WlRecord> qw = new LambdaQueryWrapper<>();
|
||||||
qw.eq(WlRecord::getId,testRecordId).eq(WlRecord::getType,0).eq(WlRecord::getState,1);
|
qw.eq(WlRecord::getId,testRecordId).eq(WlRecord::getType,0).eq(WlRecord::getState,1);
|
||||||
List<WlRecord> list = this.baseMapper.selectList(qw);
|
List<WlRecord> list = this.baseMapper.selectList(qw);
|
||||||
WlRecord wlRecord = list.get(0);
|
WlRecord wlRecord = list.get(0);
|
||||||
//当前ID就是测试项ID直接返回
|
//当前ID就是测试项ID直接返回
|
||||||
if(wlRecord.getPId()!=null){
|
if(wlRecord.getPId()!=null){
|
||||||
qw = new LambdaQueryWrapper();
|
qw.clear();
|
||||||
qw.eq(WlRecord::getId,wlRecord.getPId()).eq(WlRecord::getType,0).eq(WlRecord::getState,1);
|
qw.eq(WlRecord::getId,wlRecord.getPId()).eq(WlRecord::getType,0).eq(WlRecord::getState,1);
|
||||||
List<WlRecord> wlRecordList = this.baseMapper.selectList(qw);
|
List<WlRecord> wlRecordList = this.baseMapper.selectList(qw);
|
||||||
recordItemVo.setDescribe(wlRecordList.get(0).getDescribe());
|
recordItemVo.setDescribe(wlRecordList.get(0).getDescribe());
|
||||||
@@ -154,9 +184,10 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
|||||||
//反之则是方案ID 则返回该方案下所有的测试项信息
|
//反之则是方案ID 则返回该方案下所有的测试项信息
|
||||||
recordItemVo.setDescribe(wlRecord.getDescribe());
|
recordItemVo.setDescribe(wlRecord.getDescribe());
|
||||||
recordItemVo.setItemName(wlRecord.getItemName());
|
recordItemVo.setItemName(wlRecord.getItemName());
|
||||||
qw = new LambdaQueryWrapper();
|
qw.clear();
|
||||||
qw.eq(WlRecord::getPId,testRecordId).eq(WlRecord::getType,0).eq(WlRecord::getState,1).orderByAsc(WlRecord::getCreateTime);;
|
qw.eq(WlRecord::getPId,testRecordId).eq(WlRecord::getType,0).eq(WlRecord::getState,1).orderByAsc(WlRecord::getCreateTime);;
|
||||||
for (WlRecord wl : this.baseMapper.selectList(qw)){
|
List<WlRecord> wlRecordList = this.baseMapper.selectList(qw);
|
||||||
|
for (WlRecord wl : wlRecordList){
|
||||||
RecordVo recordVo = new RecordVo();
|
RecordVo recordVo = new RecordVo();
|
||||||
wl.setStartTime(getFirstTimeById(wl.getId()));
|
wl.setStartTime(getFirstTimeById(wl.getId()));
|
||||||
wl.setEndTime(getLastTimeById(wl.getId()));
|
wl.setEndTime(getLastTimeById(wl.getId()));
|
||||||
@@ -171,6 +202,55 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
|||||||
@Override
|
@Override
|
||||||
public Object queryPage(WlRecordPageParam wlRecordPageParam) {
|
public Object queryPage(WlRecordPageParam wlRecordPageParam) {
|
||||||
//组装tree用于测试项绑定数据页面左侧的搜索树
|
//组装tree用于测试项绑定数据页面左侧的搜索树
|
||||||
|
/* List<RecordAllDevTreeVo> devList = new ArrayList<>();
|
||||||
|
if(wlRecordPageParam.getIsTrueFlag() == 0){
|
||||||
|
LambdaQueryWrapper<WlRecord> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(WlRecord::getType,1).eq(WlRecord::getState, DataStateEnum.ENABLE.getCode());
|
||||||
|
List<WlRecord> wlRecordList = this.list(lambdaQueryWrapper);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(CollUtil.isNotEmpty(wlRecordList)){
|
||||||
|
List<String> devIds = wlRecordList.stream().map(WlRecord::getDevId).distinct().collect(Collectors.toList());
|
||||||
|
List<String> lineIds = wlRecordList.stream().map(WlRecord::getLineId).distinct().collect(Collectors.toList());
|
||||||
|
List<CsLinePO> csLinePOList = csLinePOMapper.selectBatchIds(lineIds);
|
||||||
|
Map<String,CsLinePO> csLinePOMap = csLinePOList.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
|
||||||
|
List<CsEquipmentDeliveryPO> csDevPOList = csEquipmentDeliveryMapper.selectList(new LambdaQueryWrapper<CsEquipmentDeliveryPO>().in(CsEquipmentDeliveryPO::getId,devIds));
|
||||||
|
Map<String,CsEquipmentDeliveryPO> csDevPOMap = csDevPOList.stream().collect(Collectors.toMap(CsEquipmentDeliveryPO::getId, Function.identity()));
|
||||||
|
|
||||||
|
Map<String,List<WlRecord>> devMap = wlRecordList.stream().collect(Collectors.groupingBy(WlRecord::getDevId));
|
||||||
|
|
||||||
|
devMap.forEach((devId,list)->{
|
||||||
|
RecordAllDevTreeVo devTree = new RecordAllDevTreeVo();
|
||||||
|
devTree.setId(devId);
|
||||||
|
devTree.setName(csDevPOMap.get(list.get(0).getDevId()).getName());
|
||||||
|
devTree.setPid("0");
|
||||||
|
|
||||||
|
Map<String,List<WlRecord>> lineMap = list.stream().collect(Collectors.groupingBy(WlRecord::getLineId));
|
||||||
|
List<RecordAllDevTreeVo> csLineList = new ArrayList<>();
|
||||||
|
lineMap.forEach((lineId,lineList)->{
|
||||||
|
RecordAllDevTreeVo recordAllDevTreeVo = new RecordAllDevTreeVo();
|
||||||
|
recordAllDevTreeVo.setId(lineId);
|
||||||
|
recordAllDevTreeVo.setName(csLinePOMap.get(lineList.get(0).getLineId()).getName());
|
||||||
|
recordAllDevTreeVo.setPid(devId);
|
||||||
|
List<RecordAllDevTreeVo> iiList = new ArrayList<>();
|
||||||
|
lineList.forEach(it->{
|
||||||
|
RecordAllDevTreeVo ii = new RecordAllDevTreeVo();
|
||||||
|
ii.setId(it.getId());
|
||||||
|
ii.setName(it.getStartTime()+"-"+it.getEndTime());
|
||||||
|
ii.setPid(lineId);
|
||||||
|
iiList.add(ii);
|
||||||
|
});
|
||||||
|
recordAllDevTreeVo.setChildren(iiList);
|
||||||
|
csLineList.add(recordAllDevTreeVo);
|
||||||
|
});
|
||||||
|
devTree.setChildren(csLineList);
|
||||||
|
devList.add(devTree);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
List<RecordAllDevTreeVo> recordAllDevTreeVos = this.baseMapper.getRecordAll(wlRecordPageParam);
|
List<RecordAllDevTreeVo> recordAllDevTreeVos = this.baseMapper.getRecordAll(wlRecordPageParam);
|
||||||
for (RecordAllDevTreeVo recordAllDevTreeVo : recordAllDevTreeVos){
|
for (RecordAllDevTreeVo recordAllDevTreeVo : recordAllDevTreeVos){
|
||||||
wlRecordPageParam.setDevId(recordAllDevTreeVo.getId());
|
wlRecordPageParam.setDevId(recordAllDevTreeVo.getId());
|
||||||
@@ -334,6 +414,108 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WlRecord findDevBaseData(WlRecordParam.Record param) {
|
||||||
|
LambdaQueryWrapper<WlRecord> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(WlRecord::getGcName,param.getProName())
|
||||||
|
.eq(WlRecord::getDevId,param.getDevId())
|
||||||
|
.eq(WlRecord::getLineId,param.getLineId())
|
||||||
|
.eq(WlRecord::getStartTime,param.getProStartTime())
|
||||||
|
.eq(WlRecord::getType,1)
|
||||||
|
.eq(WlRecord::getState,1);
|
||||||
|
return this.getOne(lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dayDealNoEndTimeEvent() {
|
||||||
|
LambdaQueryWrapper<WlRecord> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(WlRecord::getType,1).eq(WlRecord::getState,DataStateEnum.ENABLE.getCode());
|
||||||
|
List<WlRecord> wlRecordList = this.list(lambdaQueryWrapper);
|
||||||
|
if(CollUtil.isNotEmpty(wlRecordList)){
|
||||||
|
|
||||||
|
//需要处理的基础数据
|
||||||
|
List<WlRecord> needDealList = wlRecordList.stream().filter(it->Objects.isNull(it.getEndTime())).collect(Collectors.toList());
|
||||||
|
List<String> needIds = needDealList.stream().map(WlRecord::getLineId).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
Map<String,List<WlRecord>> lineMap = wlRecordList.stream().collect(Collectors.groupingBy(WlRecord::getLineId));
|
||||||
|
|
||||||
|
List<WlRecord> poList = new ArrayList<>();
|
||||||
|
lineMap.forEach((lineId,list)->{
|
||||||
|
if(needIds.contains(lineId)){
|
||||||
|
//选择起始时间进行倒序
|
||||||
|
list = list.stream().sorted(Comparator.comparing(WlRecord::getStartTime)).collect(Collectors.toList());
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
LocalDateTime start = list.get(i).getStartTime();
|
||||||
|
String startSql = start.format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN));
|
||||||
|
if(i==list.size()-1){
|
||||||
|
//判断最迟时间的数据是否没有结束时间
|
||||||
|
if(Objects.isNull(list.get(i).getEndTime())){
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
String sqlNow = now.format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN));
|
||||||
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper("pqd_data",StatisticalDataDTO.class);
|
||||||
|
influxQueryWrapper.select(StatisticalDataDTO::getLineId)
|
||||||
|
.select(StatisticalDataDTO::getPhaseType)
|
||||||
|
.select(StatisticalDataDTO::getValueType)
|
||||||
|
.last("Pq_Freq")
|
||||||
|
.eq(InfluxDBTableConstant.LINE_ID,lineId)
|
||||||
|
.eq(InfluxDBTableConstant.PHASIC_TYPE,"M")
|
||||||
|
.between(InfluxDBTableConstant.TIME,startSql,sqlNow);
|
||||||
|
System.out.println(influxQueryWrapper.generateSql());
|
||||||
|
StatisticalDataDTO statisticalDataDTO = commonMapper.getLineRtData(influxQueryWrapper);
|
||||||
|
if(Objects.nonNull(statisticalDataDTO)){
|
||||||
|
LocalDateTime endTime = statisticalDataDTO.getTime().atOffset(ZoneOffset.ofHours(0)).toLocalDateTime();
|
||||||
|
Duration duration = Duration.between(now, endTime);
|
||||||
|
long hour = duration.toHours();
|
||||||
|
if(hour>6){
|
||||||
|
WlRecord wlRecord = new WlRecord();
|
||||||
|
wlRecord.setId(list.get(i).getId());
|
||||||
|
wlRecord.setEndTime(endTime);
|
||||||
|
poList.add(wlRecord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
//如果不存在结束时间,则取后面一条的起始时间作为结束判断标识
|
||||||
|
if(Objects.isNull(list.get(i).getEndTime())){
|
||||||
|
String end = list.get(i+1).getStartTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN));
|
||||||
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper("pqd_data",StatisticalDataDTO.class);
|
||||||
|
influxQueryWrapper.select(StatisticalDataDTO::getLineId)
|
||||||
|
.select(StatisticalDataDTO::getPhaseType)
|
||||||
|
.select(StatisticalDataDTO::getValueType)
|
||||||
|
.last("Pq_Freq")
|
||||||
|
.eq(InfluxDBTableConstant.LINE_ID,lineId)
|
||||||
|
.eq(InfluxDBTableConstant.PHASIC_TYPE,"M")
|
||||||
|
.between(InfluxDBTableConstant.TIME,startSql,end);
|
||||||
|
System.out.println(influxQueryWrapper.generateSql());
|
||||||
|
StatisticalDataDTO statisticalDataDTO = commonMapper.getLineRtData(influxQueryWrapper);
|
||||||
|
WlRecord wlRecord = new WlRecord();
|
||||||
|
wlRecord.setId(list.get(i).getId());
|
||||||
|
|
||||||
|
if(Objects.nonNull(statisticalDataDTO)){
|
||||||
|
LocalDateTime endTime = statisticalDataDTO.getTime().atOffset(ZoneOffset.ofHours(0)).toLocalDateTime();
|
||||||
|
wlRecord.setEndTime(endTime);
|
||||||
|
}else {
|
||||||
|
//TODO 如果查询时间段内无数据,说明装置可能时间段内掉线,出错,需要标识出来
|
||||||
|
wlRecord.setEndTime(list.get(i+1).getStartTime());
|
||||||
|
}
|
||||||
|
poList.add(wlRecord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
if(CollUtil.isNotEmpty(poList)){
|
||||||
|
System.out.println("444");
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据项内的时间进行覆盖:解决多个数据项的startTime及endTime之间存在时间冲突
|
* 数据项内的时间进行覆盖:解决多个数据项的startTime及endTime之间存在时间冲突
|
||||||
* @param data 数据项
|
* @param data 数据项
|
||||||
@@ -454,7 +636,7 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
|
|||||||
if(recordIds.isEmpty()){
|
if(recordIds.isEmpty()){
|
||||||
recordIds.add("-1");
|
recordIds.add("-1");
|
||||||
}
|
}
|
||||||
qw.eq(WlRecord::getState,"1").in(WlRecord::getId,recordIds).orderByAsc(WlRecord::getEndTime);
|
qw.eq(WlRecord::getState,"1").in(WlRecord::getId,recordIds).orderByDesc(WlRecord::getEndTime);
|
||||||
List<WlRecord> list = this.baseMapper.selectList(qw);
|
List<WlRecord> list = this.baseMapper.selectList(qw);
|
||||||
if(list.isEmpty()){
|
if(list.isEmpty()){
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -33,6 +33,10 @@ spring:
|
|||||||
refresh: true
|
refresh: true
|
||||||
main:
|
main:
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 100MB
|
||||||
|
max-request-size: 100MB
|
||||||
|
|
||||||
|
|
||||||
#项目日志的配置
|
#项目日志的配置
|
||||||
|
|||||||
@@ -1,12 +1,19 @@
|
|||||||
package com.njcn.csharmonic.api;
|
package com.njcn.csharmonic.api;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
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.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.pojo.po.CsEventPO;
|
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.CsEventVO;
|
||||||
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 java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -18,4 +25,10 @@ public interface EventFeignClient {
|
|||||||
@PostMapping("/saveBatchEventList")
|
@PostMapping("/saveBatchEventList")
|
||||||
HttpResult<String> saveBatchEventList(@RequestBody List<CsEventPO> csEventPOS);
|
HttpResult<String> saveBatchEventList(@RequestBody List<CsEventPO> csEventPOS);
|
||||||
|
|
||||||
}
|
@PostMapping("/pageQueryByLineId")
|
||||||
|
HttpResult<Page<DataGroupEventVO>> pageQueryByLineId(@RequestBody CsEventUserQueryPage csEventUserQueryPage);
|
||||||
|
@PostMapping("/queryByIndex")
|
||||||
|
HttpResult<CsEventPO> queryByIndex(@RequestBody CsEventPO csEventPO);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,13 +1,20 @@
|
|||||||
package com.njcn.csharmonic.api.fallback;
|
package com.njcn.csharmonic.api.fallback;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
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.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.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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,6 +37,18 @@ public class EventFeignClientFallbackFactory implements FallbackFactory<EventFei
|
|||||||
log.error("{}异常,降级处理,异常为:{}","获取当天事件未读消息未读消息",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","获取当天事件未读消息未读消息",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<Page<DataGroupEventVO>> pageQueryByLineId(CsEventUserQueryPage csEventUserQueryPage) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据监测点分页查询暂降事件",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<CsEventPO> queryByIndex( CsEventPO csEventPO) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据根据表唯一索引查询(用于校验是否存在该事件)s",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
package com.njcn.csharmonic.constant;
|
package com.njcn.csharmonic.constant;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 常量类
|
* 常量类
|
||||||
* @author qijian
|
* @author qijian
|
||||||
@@ -68,4 +72,13 @@ public interface HarmonicConstant {
|
|||||||
String INSET_DATA = "inset_data";
|
String INSET_DATA = "inset_data";
|
||||||
|
|
||||||
String CTRL_DATA = "ctrl_data";
|
String CTRL_DATA = "ctrl_data";
|
||||||
|
|
||||||
|
|
||||||
|
Set<String> POWER_LIST = new HashSet<>(Arrays.asList(
|
||||||
|
"电网有功功率", "电网无功功率", "电网视在功率", "负载有功功率",
|
||||||
|
"负载无功功率", "负载视在功率", "有功功率", "无功功率",
|
||||||
|
"视在功率", "基波有功功率", "基波无功功率",
|
||||||
|
"基波视在功率", "三相总有功功率", "三相总无功功率",
|
||||||
|
"三相总视在功率"
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ public enum CsHarmonicResponseEnum {
|
|||||||
*/
|
*/
|
||||||
CS_DEVICE_COMMON_ERROR("A00600","治理稳态模块异常"),
|
CS_DEVICE_COMMON_ERROR("A00600","治理稳态模块异常"),
|
||||||
BIND_TARGET_ERROR("A00601","指标参数绑定异常"),
|
BIND_TARGET_ERROR("A00601","指标参数绑定异常"),
|
||||||
|
MAKE_UP_ERROR("A00602","补招失败"),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ import java.util.List;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class Log {
|
public class Log {
|
||||||
private static String logPath = "C:\\Users\\Administrator\\Desktop\\浙江无线\\离线数据上传\\09\\log";//事件文件路径
|
private static String logPath = "C:\\Users\\Administrator\\Desktop\\浙江无线\\离线数据上传\\09\\log";//事件文件路径
|
||||||
private static LocalDateTime event_starttime = null;
|
|
||||||
private static LocalDateTime event_endtime = null;
|
|
||||||
private static List<TagComtradeCfg> tagComtradeCfgs = new ArrayList();//波形文件cfg信息队列
|
private static List<TagComtradeCfg> tagComtradeCfgs = new ArrayList();//波形文件cfg信息队列
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
boolean logbin = false;
|
boolean logbin = false;
|
||||||
@@ -55,12 +54,14 @@ public class Log {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new BusinessException("文件" + file.getName() + " 读取时发生错误");
|
throw new BusinessException("文件" + file.getName() + " 读取时发生错误");
|
||||||
}
|
}
|
||||||
|
LocalDateTime event_starttime = null;
|
||||||
|
LocalDateTime event_endtime = null;
|
||||||
NewTaglogbuffer newTaglogbuffer = getnewTaglogbuffer(bBuf);
|
NewTaglogbuffer newTaglogbuffer = getnewTaglogbuffer(bBuf);
|
||||||
newTaglogbuffers.add(newTaglogbuffer);
|
newTaglogbuffers.add(newTaglogbuffer);
|
||||||
TagMsTime devtime = newTaglogbuffer.getNewHeadTaglogbuffer().getDevtime();
|
TagMsTime devtime = newTaglogbuffer.getNewHeadTaglogbuffer().getDevtime();
|
||||||
LocalDateTime time = LocalDateTime.of(devtime.getYear(), devtime.getMonth(), devtime.getDay(), devtime.getHour(), devtime.getMin(), devtime.getSec(), devtime.getMs());
|
LocalDateTime time = LocalDateTime.of(devtime.getYear(), devtime.getMonth(), devtime.getDay(), devtime.getHour(), devtime.getMin(), devtime.getSec(), devtime.getMs()*1000*1000);
|
||||||
//存在启动时间
|
//存在启动时间
|
||||||
if (event_starttime != LocalDateTime.MIN && event_starttime != null) {
|
if (event_starttime != LocalDateTime.MIN&& event_starttime!=null) {
|
||||||
if (time.compareTo(event_starttime) <= 0) {
|
if (time.compareTo(event_starttime) <= 0) {
|
||||||
event_starttime = time;
|
event_starttime = time;
|
||||||
}
|
}
|
||||||
@@ -68,7 +69,7 @@ public class Log {
|
|||||||
//不存在启动时间 填入当前时间
|
//不存在启动时间 填入当前时间
|
||||||
event_starttime = time;
|
event_starttime = time;
|
||||||
}
|
}
|
||||||
if (event_endtime != LocalDateTime.MIN && event_endtime != null) {
|
if (event_endtime != LocalDateTime.MIN && event_endtime!=null) {
|
||||||
if (time.compareTo(event_endtime) >= 0) {
|
if (time.compareTo(event_endtime) >= 0) {
|
||||||
event_endtime = time;
|
event_endtime = time;
|
||||||
}
|
}
|
||||||
@@ -77,6 +78,7 @@ public class Log {
|
|||||||
event_endtime = time;
|
event_endtime = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
long sec = 0;
|
long sec = 0;
|
||||||
for (NewBodyTaglogbuffer sing : newTaglogbuffer.getNewBodyTaglogbuffers()) {
|
for (NewBodyTaglogbuffer sing : newTaglogbuffer.getNewBodyTaglogbuffers()) {
|
||||||
switch (sing.getParaCode()) {
|
switch (sing.getParaCode()) {
|
||||||
@@ -95,14 +97,19 @@ public class Log {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//当事件时长超过1分钟直接排除
|
||||||
|
if(sec>60){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
newTaglogbuffer.setStart(time); //事件开始时间
|
newTaglogbuffer.setStart(time); //事件开始时间
|
||||||
newTaglogbuffer.setEnd(time.plusSeconds(sec)); //事件结束时间
|
newTaglogbuffer.setEnd(time.plusSeconds(sec)); //事件结束时间
|
||||||
for (TagComtradeCfg sing : tagComtradeCfgs) {
|
//这里tagComtradeCfgs为空无效
|
||||||
if (sing.getTimeTrigger().compareTo(newTaglogbuffer.getStart()) <= 0 && sing.getTimeEnd().compareTo(newTaglogbuffer.getStart()) >= 0) {
|
// for (TagComtradeCfg sing : tagComtradeCfgs) {
|
||||||
newTaglogbuffer.setPath(sing.getPath());
|
// if (sing.getTimeTrigger().compareTo(newTaglogbuffer.getStart()) <= 0 && sing.getTimeEnd().compareTo(newTaglogbuffer.getStart()) >= 0) {
|
||||||
break;
|
// newTaglogbuffer.setPath(sing.getPath());
|
||||||
}
|
// break;
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -137,11 +144,12 @@ public class Log {
|
|||||||
throw new BusinessException("文件" + file.getOriginalFilename() + " 读取时发生错误");
|
throw new BusinessException("文件" + file.getOriginalFilename() + " 读取时发生错误");
|
||||||
}
|
}
|
||||||
NewTaglogbuffer newTaglogbuffer = getnewTaglogbuffer(bBuf);
|
NewTaglogbuffer newTaglogbuffer = getnewTaglogbuffer(bBuf);
|
||||||
newTaglogbuffers.add(newTaglogbuffer);
|
LocalDateTime event_starttime = null;
|
||||||
|
LocalDateTime event_endtime = null;
|
||||||
TagMsTime devtime = newTaglogbuffer.getNewHeadTaglogbuffer().getDevtime();
|
TagMsTime devtime = newTaglogbuffer.getNewHeadTaglogbuffer().getDevtime();
|
||||||
LocalDateTime time = LocalDateTime.of(devtime.getYear(), devtime.getMonth(), devtime.getDay(), devtime.getHour(), devtime.getMin(), devtime.getSec(), devtime.getMs());
|
LocalDateTime time = LocalDateTime.of(devtime.getYear(), devtime.getMonth(), devtime.getDay(), devtime.getHour(), devtime.getMin(), devtime.getSec(), devtime.getMs()*1000*1000);
|
||||||
//存在启动时间
|
//存在启动时间
|
||||||
if (event_starttime != LocalDateTime.MIN && event_starttime != null) {
|
if (event_starttime != LocalDateTime.MIN&& event_starttime!=null) {
|
||||||
if (time.compareTo(event_starttime) <= 0) {
|
if (time.compareTo(event_starttime) <= 0) {
|
||||||
event_starttime = time;
|
event_starttime = time;
|
||||||
}
|
}
|
||||||
@@ -149,7 +157,7 @@ public class Log {
|
|||||||
//不存在启动时间 填入当前时间
|
//不存在启动时间 填入当前时间
|
||||||
event_starttime = time;
|
event_starttime = time;
|
||||||
}
|
}
|
||||||
if (event_endtime != LocalDateTime.MIN && event_endtime != null) {
|
if (event_endtime != LocalDateTime.MIN && event_endtime!=null) {
|
||||||
if (time.compareTo(event_endtime) >= 0) {
|
if (time.compareTo(event_endtime) >= 0) {
|
||||||
event_endtime = time;
|
event_endtime = time;
|
||||||
}
|
}
|
||||||
@@ -176,14 +184,21 @@ public class Log {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//当事件时长超过1分钟直接排除
|
||||||
|
if(sec>60){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
newTaglogbuffer.setStart(time); //事件开始时间
|
newTaglogbuffer.setStart(time); //事件开始时间
|
||||||
newTaglogbuffer.setEnd(time.plusSeconds(sec)); //事件结束时间
|
newTaglogbuffer.setEnd(time.plusSeconds(sec)); //事件结束时间
|
||||||
for (TagComtradeCfg sing : tagComtradeCfgs) {
|
//这里tagComtradeCfgs为空无效
|
||||||
if (sing.getTimeTrigger().compareTo(newTaglogbuffer.getStart()) <= 0 && sing.getTimeEnd().compareTo(newTaglogbuffer.getStart()) >= 0) {
|
// for (TagComtradeCfg sing : tagComtradeCfgs) {
|
||||||
newTaglogbuffer.setPath(sing.getPath());
|
// if (sing.getTimeTrigger().compareTo(newTaglogbuffer.getStart()) <= 0 && sing.getTimeEnd().compareTo(newTaglogbuffer.getStart()) >= 0) {
|
||||||
break;
|
// newTaglogbuffer.setPath(sing.getPath());
|
||||||
}
|
// break;
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
newTaglogbuffers.add(newTaglogbuffer);
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import lombok.Data;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package com.njcn.csharmonic.offline.log.vo;
|
package com.njcn.csharmonic.offline.log.vo;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class TagComtradeCfg {
|
public class TagComtradeCfg implements Serializable {
|
||||||
private int nChannelNum; //通道总个数
|
private int nChannelNum; //通道总个数
|
||||||
private int nAnalogNum; //模拟量通道的个数 WW 2013-05-15
|
private int nAnalogNum; //模拟量通道的个数 WW 2013-05-15
|
||||||
private int nDigitalNum; //数字量通道的个数 WW 2013-05-15
|
private int nDigitalNum; //数字量通道的个数 WW 2013-05-15
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ package com.njcn.csharmonic.offline.log.vo;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class TagOneChannleCfg {
|
public class TagOneChannleCfg implements Serializable {
|
||||||
//通道序号
|
//通道序号
|
||||||
private int nIndex;
|
private int nIndex;
|
||||||
//通道名称
|
//通道名称
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ package com.njcn.csharmonic.offline.log.vo;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class TagOneChannleCfgDigital {
|
public class TagOneChannleCfgDigital implements Serializable {
|
||||||
//通道序号
|
//通道序号
|
||||||
private int nIndex;
|
private int nIndex;
|
||||||
//通道名称
|
//通道名称
|
||||||
|
|||||||
@@ -2,16 +2,22 @@ package com.njcn.csharmonic.offline.mincfg;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||||
import com.njcn.influx.pojo.po.cs.PqdData;
|
import com.njcn.csharmonic.offline.log.vo.TagComtradeCfg;
|
||||||
|
import com.njcn.csharmonic.offline.log.vo.TagOneChannleCfg;
|
||||||
|
import com.njcn.csharmonic.offline.mincfg.vo.*;
|
||||||
import com.njcn.csharmonic.offline.mincfg.vo.RTC_Timer_MS;
|
import com.njcn.csharmonic.offline.mincfg.vo.RTC_Timer_MS;
|
||||||
import com.njcn.csharmonic.offline.mincfg.vo.tagPQDataCmn;
|
import com.njcn.influx.pojo.po.cs.PqdData;
|
||||||
import com.njcn.csharmonic.offline.mincfg.vo.tagPQDataCmnHh;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -134,7 +140,7 @@ public class AnalyseComtradeCfg {
|
|||||||
//电能质量只有电压偏差,上偏差正,下偏差负,判断上偏差是否为0如果为0取下偏差负数,反正取上偏差
|
//电能质量只有电压偏差,上偏差正,下偏差负,判断上偏差是否为0如果为0取下偏差负数,反正取上偏差
|
||||||
hashMapA.put("pq_UDev",AnalyseComtradeCfg.isZero(uuDeviation[0])?(-ulDeviation[0]):uuDeviation[0]);
|
hashMapA.put("pq_UDev",AnalyseComtradeCfg.isZero(uuDeviation[0])?(-ulDeviation[0]):uuDeviation[0]);
|
||||||
hashMapB.put("pq_UDev",AnalyseComtradeCfg.isZero(uuDeviation[1])?(-ulDeviation[1]):uuDeviation[1]);
|
hashMapB.put("pq_UDev",AnalyseComtradeCfg.isZero(uuDeviation[1])?(-ulDeviation[1]):uuDeviation[1]);
|
||||||
hashMapC.put("pq_RmsU",AnalyseComtradeCfg.isZero(uuDeviation[2])?(-ulDeviation[2]):uuDeviation[2]);
|
hashMapC.put("pq_UDev",AnalyseComtradeCfg.isZero(uuDeviation[2])?(-ulDeviation[2]):uuDeviation[2]);
|
||||||
hashMapAB.put("pq_LUDev",AnalyseComtradeCfg.isZero(uuDeviation[3])?(-ulDeviation[3]):uuDeviation[3]);
|
hashMapAB.put("pq_LUDev",AnalyseComtradeCfg.isZero(uuDeviation[3])?(-ulDeviation[3]):uuDeviation[3]);
|
||||||
hashMapBC.put("pq_LUDev",AnalyseComtradeCfg.isZero(uuDeviation[4])?(-ulDeviation[4]):uuDeviation[4]);
|
hashMapBC.put("pq_LUDev",AnalyseComtradeCfg.isZero(uuDeviation[4])?(-ulDeviation[4]):uuDeviation[4]);
|
||||||
hashMapCA.put("pq_LUDev",AnalyseComtradeCfg.isZero(uuDeviation[5])?(-ulDeviation[5]):uuDeviation[5]);
|
hashMapCA.put("pq_LUDev",AnalyseComtradeCfg.isZero(uuDeviation[5])?(-ulDeviation[5]):uuDeviation[5]);
|
||||||
@@ -522,8 +528,8 @@ public class AnalyseComtradeCfg {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public static List<tagComtradeCfg> convertCfgFile(String strFilePath) { //解析cfg录波文件
|
public static List<TagComtradeCfg> convertCfgFile(String strFilePath) { //解析cfg录波文件
|
||||||
List<tagComtradeCfg> tagComtradeCfgList = new ArrayList<>();
|
List<TagComtradeCfg> tagComtradeCfgList = new ArrayList<>();
|
||||||
// File folder = new File(strFilePath);
|
// File folder = new File(strFilePath);
|
||||||
// File[] files = folder.listFiles((dir, name) -> name.endsWith(".cfg")); //获取文件夹下所有cfg文件
|
// File[] files = folder.listFiles((dir, name) -> name.endsWith(".cfg")); //获取文件夹下所有cfg文件
|
||||||
// Arrays.stream(files).forEach(file -> {
|
// Arrays.stream(files).forEach(file -> {
|
||||||
@@ -539,8 +545,8 @@ public class AnalyseComtradeCfg {
|
|||||||
* @Author: clam
|
* @Author: clam
|
||||||
* @Date: 2024/7/15
|
* @Date: 2024/7/15
|
||||||
*/
|
*/
|
||||||
public static tagComtradeCfg analyseComtradeCfg(MultipartFile file) {
|
public static TagComtradeCfg analyseComtradeCfg(MultipartFile file) {
|
||||||
tagComtradeCfg comtradeCfg = new tagComtradeCfg();
|
TagComtradeCfg comtradeCfg = new TagComtradeCfg();
|
||||||
String strFilePath = file.getOriginalFilename();
|
String strFilePath = file.getOriginalFilename();
|
||||||
int i = 0; //用于遍历 字符串转换的字段数组
|
int i = 0; //用于遍历 字符串转换的字段数组
|
||||||
String strFileLine;//临时存放 cfg每行读取的字符串
|
String strFileLine;//临时存放 cfg每行读取的字符串
|
||||||
@@ -551,7 +557,7 @@ public class AnalyseComtradeCfg {
|
|||||||
InputStream readFile = file.getInputStream();
|
InputStream readFile = file.getInputStream();
|
||||||
InputStreamReader isr = new InputStreamReader(readFile, StandardCharsets.UTF_8);
|
InputStreamReader isr = new InputStreamReader(readFile, StandardCharsets.UTF_8);
|
||||||
BufferedReader sr = new BufferedReader(isr);
|
BufferedReader sr = new BufferedReader(isr);
|
||||||
comtradeCfg = new tagComtradeCfg();//配置文件总类对象初始化
|
comtradeCfg = new TagComtradeCfg();//配置文件总类对象初始化
|
||||||
ratesCfg = new tagRates();//多段采样类对象初始化
|
ratesCfg = new tagRates();//多段采样类对象初始化
|
||||||
long nFreq = 0; //临时存放 采样频率 例:50Hz
|
long nFreq = 0; //临时存放 采样频率 例:50Hz
|
||||||
//第一行不关心仅仅是一些描述类的信息
|
//第一行不关心仅仅是一些描述类的信息
|
||||||
@@ -562,65 +568,65 @@ public class AnalyseComtradeCfg {
|
|||||||
for (i = 0; i < strTempArray.length; i++) {
|
for (i = 0; i < strTempArray.length; i++) {
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 0: //通道总个数
|
case 0: //通道总个数
|
||||||
comtradeCfg.nChannelNum = Integer.parseInt(strTempArray[i]);
|
comtradeCfg.setNChannelNum(Integer.parseInt(strTempArray[i]));
|
||||||
break;
|
break;
|
||||||
case 1: //模拟量的个数
|
case 1: //模拟量的个数
|
||||||
String str = strTempArray[i].substring(0, strTempArray[i].length() - 1);
|
String str = strTempArray[i].substring(0, strTempArray[i].length() - 1);
|
||||||
comtradeCfg.nAnalogNum = Integer.parseInt(str);
|
comtradeCfg.setNAnalogNum(Integer.parseInt(str));
|
||||||
break;
|
break;
|
||||||
case 2://开关量的个数
|
case 2://开关量的个数
|
||||||
str = strTempArray[i].substring(0, strTempArray[i].length() - 1);
|
str = strTempArray[i].substring(0, strTempArray[i].length() - 1);
|
||||||
comtradeCfg.nDigitalNum = Integer.parseInt(str);
|
comtradeCfg.setNDigitalNum(Integer.parseInt(str));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//从第三行到第ComtradeCfg.nChannelNum+3行是模拟量通道和数字量通道
|
//从第三行到第ComtradeCfg.nChannelNum+3行是模拟量通道和数字量通道
|
||||||
List<tagOneChannleCfg> OneChannleCfgList =new ArrayList<>();
|
ArrayList<TagOneChannleCfg> OneChannleCfgList =new ArrayList<>();
|
||||||
for (i = 0; i < comtradeCfg.nChannelNum; i++) {
|
for (i = 0; i < comtradeCfg.getNChannelNum(); i++) {
|
||||||
tagOneChannleCfg oneChannlecfg = new tagOneChannleCfg();
|
TagOneChannleCfg oneChannlecfg = new TagOneChannleCfg();
|
||||||
|
|
||||||
strFileLine = sr.readLine(); // ③ or ④ or ⑤
|
strFileLine = sr.readLine(); // ③ or ④ or ⑤
|
||||||
strTempArray = strFileLine.split(",");
|
strTempArray = strFileLine.split(",");
|
||||||
for (int j = 0; j < strTempArray.length; j++) {
|
for (int j = 0; j < strTempArray.length; j++) {
|
||||||
switch (j) {
|
switch (j) {
|
||||||
case 0://通道序号
|
case 0://通道序号
|
||||||
oneChannlecfg.nIndex = Integer.parseInt(strTempArray[j]);
|
oneChannlecfg.setNIndex(Integer.parseInt(strTempArray[j]));
|
||||||
break;
|
break;
|
||||||
case 1://通道名称
|
case 1://通道名称
|
||||||
oneChannlecfg.szChannleName = strTempArray[j];
|
oneChannlecfg.setSzChannleName(strTempArray[j]);
|
||||||
break;
|
break;
|
||||||
case 2://监视的通道名称
|
case 2://监视的通道名称
|
||||||
oneChannlecfg.szPhasicName = strTempArray[j];
|
oneChannlecfg.setSzPhasicName(strTempArray[j]);
|
||||||
break;
|
break;
|
||||||
case 3://监视的通道名称
|
case 3://监视的通道名称
|
||||||
oneChannlecfg.szMonitoredChannleName = strTempArray[j];
|
oneChannlecfg.setSzMonitoredChannleName(strTempArray[j]);
|
||||||
break;
|
break;
|
||||||
case 4://通道的单位
|
case 4://通道的单位
|
||||||
oneChannlecfg.szUnitName = strTempArray[j];
|
oneChannlecfg.setSzUnitName(strTempArray[j]);
|
||||||
break;
|
break;
|
||||||
case 5://通道的系数
|
case 5://通道的系数
|
||||||
oneChannlecfg.fCoefficent = Float.parseFloat(strTempArray[j]);
|
oneChannlecfg.setFCoefficent(Float.parseFloat(strTempArray[j]));
|
||||||
break;
|
break;
|
||||||
case 6://通道的偏移量
|
case 6://通道的偏移量
|
||||||
oneChannlecfg.fOffset = Float.parseFloat(strTempArray[j]);
|
oneChannlecfg.setFOffset(Float.parseFloat(strTempArray[j]));
|
||||||
break;
|
break;
|
||||||
case 7://起始采样时间的偏移量
|
case 7://起始采样时间的偏移量
|
||||||
oneChannlecfg.fTimeOffset = Float.parseFloat(strTempArray[j]);
|
oneChannlecfg.setFTimeOffset( Float.parseFloat(strTempArray[j]));
|
||||||
break;
|
break;
|
||||||
case 8://采样值的最小值
|
case 8://采样值的最小值
|
||||||
oneChannlecfg.nMin = Integer.parseInt(strTempArray[j]);
|
oneChannlecfg.setNMin( Integer.parseInt(strTempArray[j]));
|
||||||
break;
|
break;
|
||||||
case 9://采样值的最大值
|
case 9://采样值的最大值
|
||||||
oneChannlecfg.nMax = Integer.parseInt(strTempArray[j]);
|
oneChannlecfg.setNMax(Integer.parseInt(strTempArray[j]));
|
||||||
break;
|
break;
|
||||||
case 10://一次变比
|
case 10://一次变比
|
||||||
oneChannlecfg.fPrimary = Float.parseFloat(strTempArray[j]);
|
oneChannlecfg.setFPrimary( Float.parseFloat(strTempArray[j]));
|
||||||
break;
|
break;
|
||||||
case 11://二次变比
|
case 11://二次变比
|
||||||
oneChannlecfg.fSecondary = Float.parseFloat(strTempArray[j]);
|
oneChannlecfg.setFSecondary(Float.parseFloat(strTempArray[j]));
|
||||||
break;
|
break;
|
||||||
case 12://一次值还是二次值标志
|
case 12://一次值还是二次值标志
|
||||||
oneChannlecfg.szValueType = strTempArray[j];
|
oneChannlecfg.setSzValueType(strTempArray[j]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -664,21 +670,21 @@ public class AnalyseComtradeCfg {
|
|||||||
|
|
||||||
sr.close();
|
sr.close();
|
||||||
readFile.close();
|
readFile.close();
|
||||||
return comtradeCfg;
|
return new TagComtradeCfg();
|
||||||
}
|
}
|
||||||
//波形起始时间
|
//波形起始时间
|
||||||
strFileLine = sr.readLine(); // ⑨
|
strFileLine = sr.readLine(); // ⑨
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy,HH:mm:ss.SSSSSS");
|
DateTimeFormatter sdf = DateTimeFormatter.ofPattern("dd/MM/yyyy,HH:mm:ss.SSSSSS");
|
||||||
comtradeCfg.setTimeTrigger(sdf.parse(strFileLine));
|
comtradeCfg.setTimeTrigger(LocalDateTime.parse(strFileLine, sdf));
|
||||||
|
|
||||||
strFileLine = sr.readLine(); // ⑩
|
strFileLine = sr.readLine(); // ⑩
|
||||||
comtradeCfg.setTimeStart(sdf.parse(strFileLine));
|
comtradeCfg.setTimeStart(LocalDateTime.parse(strFileLine, sdf));
|
||||||
comtradeCfg.setTimeEnd(new Date(comtradeCfg.getTimeStart().getTime() + nMSTotal));;
|
comtradeCfg.setTimeEnd(comtradeCfg.getTimeStart().plusSeconds(nMSTotal/1000L));;
|
||||||
comtradeCfg.setPath(file.getOriginalFilename());
|
comtradeCfg.setPath(file.getOriginalFilename());
|
||||||
|
|
||||||
sr.close();
|
sr.close();
|
||||||
readFile.close();
|
readFile.close();
|
||||||
} catch (IOException | ParseException e) {
|
} catch (IOException e) {
|
||||||
System.out.println("Error opening file: " + strFilePath + " " + e.getMessage());
|
System.out.println("Error opening file: " + strFilePath + " " + e.getMessage());
|
||||||
return comtradeCfg;
|
return comtradeCfg;
|
||||||
}
|
}
|
||||||
@@ -686,6 +692,81 @@ public class AnalyseComtradeCfg {
|
|||||||
return comtradeCfg;
|
return comtradeCfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static CmnModeCfg convertRecord(String strFile) {
|
||||||
|
File file = new File(strFile);
|
||||||
|
if (file.length() == 0) {
|
||||||
|
System.out.println("文件 " + strFile + " 长度为0字节,程序将跳过本文件的转换");
|
||||||
|
}
|
||||||
|
|
||||||
|
long nBufSize = file.length();
|
||||||
|
int n1BufLen = PrjRecordInfo.GetSize();
|
||||||
|
int n2BufLen = CmnModeCfg.GetSize();
|
||||||
|
|
||||||
|
PrjRecordInfo prjRecordInfo = new PrjRecordInfo();
|
||||||
|
CmnModeCfg cmnModeCfg = new CmnModeCfg();
|
||||||
|
if (nBufSize == n1BufLen) {
|
||||||
|
byte[] bBuf = new byte[0];
|
||||||
|
try {
|
||||||
|
bBuf = Files.readAllBytes(Paths.get(strFile));
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
prjRecordInfo.SetStructBuf(bBuf, 0);
|
||||||
|
CmnModeCfg recordInfo = prjRecordInfo.cfg;
|
||||||
|
} else if (nBufSize == n2BufLen) {
|
||||||
|
byte[] bBuf = new byte[0];
|
||||||
|
try {
|
||||||
|
bBuf = Files.readAllBytes(Paths.get(strFile));
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
cmnModeCfg.SetStructBuf(bBuf, 0);
|
||||||
|
CmnModeCfg recordInfo = cmnModeCfg;
|
||||||
|
} else {
|
||||||
|
System.out.println("解析配置参数文件异常");
|
||||||
|
}
|
||||||
|
return cmnModeCfg;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static CmnModeCfg convertRecord(InputStream fileStream) {
|
||||||
|
|
||||||
|
PrjRecordInfo prjRecordInfo = new PrjRecordInfo();
|
||||||
|
CmnModeCfg cmnModeCfg = new CmnModeCfg();
|
||||||
|
try {
|
||||||
|
int nBufSize = fileStream.available();//计算需要解析的文件总长
|
||||||
|
int n1BufLen = PrjRecordInfo.GetSize();
|
||||||
|
int n2BufLen = CmnModeCfg.GetSize();
|
||||||
|
|
||||||
|
|
||||||
|
if (nBufSize == n1BufLen) {
|
||||||
|
byte[] bBuf = new byte[nBufSize];
|
||||||
|
|
||||||
|
fileStream.read(bBuf, 0, n1BufLen);
|
||||||
|
|
||||||
|
prjRecordInfo.SetStructBuf(bBuf, 0);
|
||||||
|
cmnModeCfg = prjRecordInfo.cfg;
|
||||||
|
} else if (nBufSize == n2BufLen) {
|
||||||
|
byte[] bBuf = new byte[nBufSize];
|
||||||
|
|
||||||
|
fileStream.read(bBuf, 0, n2BufLen);
|
||||||
|
|
||||||
|
cmnModeCfg.SetStructBuf(bBuf, 0);
|
||||||
|
} else {
|
||||||
|
System.out.println("解析配置参数文件异常");
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}finally {
|
||||||
|
try {
|
||||||
|
fileStream.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cmnModeCfg;
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
// tagComtradeCfg tagComtradeCfg = AnalyseComtradeCfg.analyseComtradeCfg("C:\\Users\\Administrator\\Desktop\\浙江无线\\离线数据上传\\09\\comtrade\\line1_20240704_143908_213.cfg");
|
// tagComtradeCfg tagComtradeCfg = AnalyseComtradeCfg.analyseComtradeCfg("C:\\Users\\Administrator\\Desktop\\浙江无线\\离线数据上传\\09\\comtrade\\line1_20240704_143908_213.cfg");
|
||||||
// System.out.println(tagComtradeCfg);
|
// System.out.println(tagComtradeCfg);
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
package com.njcn.csharmonic.offline.mincfg;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Description:
|
|
||||||
* Date: 2024/7/15 15:40【需求编号】
|
|
||||||
*
|
|
||||||
* @author clam
|
|
||||||
* @version V1.0.0
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class tagComtradeCfg implements Serializable {
|
|
||||||
|
|
||||||
public int nChannelNum; //通道总个数
|
|
||||||
public int nAnalogNum; //模拟量通道的个数 WW 2013-05-15
|
|
||||||
public int nDigitalNum; //数字量通道的个数 WW 2013-05-15
|
|
||||||
public List<tagOneChannleCfg> OneChannleCfg; //模拟量通道记录类链表
|
|
||||||
public List<tagOneChannleCfg_digital> OneChannleCfgDig; //数字量通道记录类链表
|
|
||||||
public Date TimeTrigger; //暂态触发时间
|
|
||||||
public Date TimeStart; //波形起始时间 注:相较于TimeTrigger波形触发时间起始有一段平滑过渡波形时间,约100ms
|
|
||||||
public Date TimeEnd; //波形结束时间
|
|
||||||
public String path;//对应波形cfg文件全路径名称
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@ package com.njcn.csharmonic.offline.mincfg.vo;
|
|||||||
装置普测工程配置信息
|
装置普测工程配置信息
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public class cmn_mode_cfg
|
public class CmnModeCfg
|
||||||
{
|
{
|
||||||
public byte[] prj_name = new byte[128]; //工程名称
|
public byte[] prj_name = new byte[128]; //工程名称
|
||||||
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
|
||||||
@@ -4,10 +4,10 @@ package com.njcn.csharmonic.offline.mincfg.vo;
|
|||||||
工程数据文件信息
|
工程数据文件信息
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public class prj_record_info
|
public class PrjRecordInfo
|
||||||
{
|
{
|
||||||
public pqv_dev_info_int dev_info; //装置信息
|
public pqv_dev_info_int dev_info; //装置信息
|
||||||
public cmn_mode_cfg cfg; //测试记录工程配置
|
public CmnModeCfg cfg; //测试记录工程配置
|
||||||
public prj_store_info store_mag; //存储管理缓冲
|
public prj_store_info store_mag; //存储管理缓冲
|
||||||
public int tv_sec_s; //开始记录时间
|
public int tv_sec_s; //开始记录时间
|
||||||
public int tv_sec_e; //结束记录时间
|
public int tv_sec_e; //结束记录时间
|
||||||
@@ -15,16 +15,16 @@ public class prj_record_info
|
|||||||
//ORIGINAL LINE: public uint status;
|
//ORIGINAL LINE: public uint status;
|
||||||
public int status; //测试工程数据是否有效标志
|
public int status; //测试工程数据是否有效标志
|
||||||
|
|
||||||
public prj_record_info()
|
public PrjRecordInfo()
|
||||||
{
|
{
|
||||||
dev_info = new pqv_dev_info_int();
|
dev_info = new pqv_dev_info_int();
|
||||||
cfg = new cmn_mode_cfg();
|
cfg = new CmnModeCfg();
|
||||||
store_mag = new prj_store_info();
|
store_mag = new prj_store_info();
|
||||||
}
|
}
|
||||||
public static int GetSize() //用于定义Byte数组
|
public static int GetSize() //用于定义Byte数组
|
||||||
{
|
{
|
||||||
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
|
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
|
||||||
int nSize = 2 * Integer.SIZE / Byte.SIZE + 1 * Integer.SIZE / Byte.SIZE + pqv_dev_info_int.GetSize() + cmn_mode_cfg.GetSize() + prj_store_info.GetSize(); //CComtradeDataItem数据结构数据长度
|
int nSize = 2 * Integer.SIZE / Byte.SIZE + 1 * Integer.SIZE / Byte.SIZE + pqv_dev_info_int.GetSize() + CmnModeCfg.GetSize() + prj_store_info.GetSize(); //CComtradeDataItem数据结构数据长度
|
||||||
return nSize;
|
return nSize;
|
||||||
}
|
}
|
||||||
public final boolean SetStructBuf(byte[] bArray, int nHaveRead)
|
public final boolean SetStructBuf(byte[] bArray, int nHaveRead)
|
||||||
@@ -39,7 +39,7 @@ public class prj_record_info
|
|||||||
dev_info.SetStructBuf(bArray, iStep);
|
dev_info.SetStructBuf(bArray, iStep);
|
||||||
iStep = iStep + pqv_dev_info_int.GetSize();
|
iStep = iStep + pqv_dev_info_int.GetSize();
|
||||||
cfg.SetStructBuf(bArray, iStep);
|
cfg.SetStructBuf(bArray, iStep);
|
||||||
iStep = iStep + cmn_mode_cfg.GetSize();
|
iStep = iStep + CmnModeCfg.GetSize();
|
||||||
store_mag.SetStructBuf(bArray, iStep);
|
store_mag.SetStructBuf(bArray, iStep);
|
||||||
iStep = iStep + prj_store_info.GetSize();
|
iStep = iStep + prj_store_info.GetSize();
|
||||||
tv_sec_s = Service.convertInt32_net(bArray, iStep);
|
tv_sec_s = Service.convertInt32_net(bArray, iStep);
|
||||||
@@ -66,7 +66,7 @@ public class prj_record_info
|
|||||||
dev_info.SetStructBuf(bArray, iStep);
|
dev_info.SetStructBuf(bArray, iStep);
|
||||||
iStep = iStep + pqv_dev_info_int.GetSize();
|
iStep = iStep + pqv_dev_info_int.GetSize();
|
||||||
cfg.SetStructBuf_net(bArray, iStep);
|
cfg.SetStructBuf_net(bArray, iStep);
|
||||||
iStep = iStep + cmn_mode_cfg.GetSize();
|
iStep = iStep + CmnModeCfg.GetSize();
|
||||||
store_mag.SetStructBuf_net(bArray, iStep);
|
store_mag.SetStructBuf_net(bArray, iStep);
|
||||||
iStep = iStep + prj_store_info.GetSize();
|
iStep = iStep + prj_store_info.GetSize();
|
||||||
tv_sec_s = Service.convertInt32(bArray, iStep);
|
tv_sec_s = Service.convertInt32(bArray, iStep);
|
||||||
@@ -40,6 +40,9 @@ public class CsEventUserQueryPage extends CsEventUserQueryParam{
|
|||||||
*/
|
*/
|
||||||
private String deviceId;
|
private String deviceId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "测点id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.dto;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MakeUpDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Cldid")
|
||||||
|
private Integer clDid;
|
||||||
|
|
||||||
|
@SerializedName("DataType")
|
||||||
|
private Integer dataType;
|
||||||
|
|
||||||
|
@SerializedName("DataAttr")
|
||||||
|
private Integer dataAttr;
|
||||||
|
|
||||||
|
@SerializedName("Operate")
|
||||||
|
private Integer operate;
|
||||||
|
|
||||||
|
@SerializedName("StartTime")
|
||||||
|
private Integer startTime;
|
||||||
|
|
||||||
|
@SerializedName("EndTime")
|
||||||
|
private Integer endTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class FileInfo implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty("工程存储路径")
|
||||||
|
private String proName;
|
||||||
|
|
||||||
|
@ApiModelProperty("装置nDid")
|
||||||
|
private String nDid;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("需要处理的文件")
|
||||||
|
private List<String> fileList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.param;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MakeUpParam implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty("数据类型 0:稳态 1:暂态")
|
||||||
|
private List<Integer> dataTypeList;
|
||||||
|
|
||||||
|
@ApiModelProperty("起始时间")
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("结束时间")
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("工程列表")
|
||||||
|
private List<String> proList;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("装置nDid")
|
||||||
|
private String nDid;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -51,6 +51,9 @@ public class EventDetailVO {
|
|||||||
@ApiModelProperty(value = "设备名称")
|
@ApiModelProperty(value = "设备名称")
|
||||||
private String equipmentName;
|
private String equipmentName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "监测点名称")
|
||||||
|
private String lineName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 事件时间
|
* 事件时间
|
||||||
*/
|
*/
|
||||||
@@ -97,6 +100,8 @@ public class EventDetailVO {
|
|||||||
*/
|
*/
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
private String location;
|
||||||
|
|
||||||
private List<EventDataSetDTO> dataSet;
|
private List<EventDataSetDTO> dataSet;
|
||||||
/*暂态深度*/
|
/*暂态深度*/
|
||||||
private String evtParamVVaDepth;
|
private String evtParamVVaDepth;
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package com.njcn.csharmonic.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MakeUpVo implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty("项目名称")
|
||||||
|
private String prjName;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目起始时间")
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目结束时间")
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件路径")
|
||||||
|
private String prjDataPath;
|
||||||
|
|
||||||
|
@ApiModelProperty("装置型号")
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
@ApiModelProperty("装置mac")
|
||||||
|
private String devMac;
|
||||||
|
|
||||||
|
@ApiModelProperty("设备应用程序版本信息")
|
||||||
|
private String appVersion;
|
||||||
|
|
||||||
|
@ApiModelProperty("逻辑子设备ID(0-逻辑设备本身)")
|
||||||
|
private Integer clDid;
|
||||||
|
|
||||||
|
@ApiModelProperty("分钟数据统计时间间隔(1~10分钟)")
|
||||||
|
private Integer statCycle;
|
||||||
|
|
||||||
|
@ApiModelProperty("电压等级(kV)")
|
||||||
|
private Double volGrade;
|
||||||
|
|
||||||
|
@ApiModelProperty("电压接线方式 (0-星型, 1-角型, 2-V型)")
|
||||||
|
private Integer volConType;
|
||||||
|
|
||||||
|
@ApiModelProperty("电流接线方式 (0-正常, 1-合成IB, 2-合成IC)")
|
||||||
|
private Integer curConSel;
|
||||||
|
|
||||||
|
@ApiModelProperty("PT变比")
|
||||||
|
private Integer ptRatio;
|
||||||
|
|
||||||
|
@ApiModelProperty("CT变比")
|
||||||
|
private Integer ctRatio;
|
||||||
|
|
||||||
|
@ApiModelProperty("基准短路容量(MVA)")
|
||||||
|
private Double capacitySscb;
|
||||||
|
|
||||||
|
@ApiModelProperty("最小短路容量(MVA)")
|
||||||
|
private Double capacitySscmin;
|
||||||
|
|
||||||
|
@ApiModelProperty("供电设备容量(MVA)")
|
||||||
|
private Double capacitySt;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户协议容量(MVA)")
|
||||||
|
private Double capacitySi;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件类型 dir:文件夹 file:文件")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件大小 单位KB")
|
||||||
|
private Integer size;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件校验码")
|
||||||
|
private String fileCheck;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -104,6 +104,11 @@
|
|||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>access-api</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
package com.njcn.csharmonic.controller;
|
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.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.pojo.vo.DataGroupEventVO;
|
||||||
|
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
||||||
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
||||||
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;
|
||||||
@@ -19,6 +22,7 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,7 +37,8 @@ import java.util.List;
|
|||||||
@RequestMapping("/event")
|
@RequestMapping("/event")
|
||||||
@Api(tags = "暂降事件")
|
@Api(tags = "暂降事件")
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class EventController extends BaseController {
|
public class CsEventController extends BaseController {
|
||||||
|
|
||||||
private final CsEventPOService csEventPOService;
|
private final CsEventPOService csEventPOService;
|
||||||
|
|
||||||
|
|
||||||
@@ -47,6 +52,17 @@ public class EventController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/pageQueryByLineId")
|
||||||
|
@ApiOperation("根据监测点分页查询暂降事件")
|
||||||
|
@ApiImplicitParam(name = "csEventUserQueryPage", value = "暂降事件查询参数", required = true)
|
||||||
|
public HttpResult<Page<DataGroupEventVO>> pageQueryByLineId(@RequestBody CsEventUserQueryPage csEventUserQueryPage) {
|
||||||
|
String methodDescribe = getMethodDescribe("queryEventList");
|
||||||
|
Page<DataGroupEventVO> page = csEventPOService.pageQueryByLineId(csEventUserQueryPage);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@GetMapping("/analyseWave")
|
@GetMapping("/analyseWave")
|
||||||
@ApiOperation("暂态事件波形分析")
|
@ApiOperation("暂态事件波形分析")
|
||||||
@@ -76,4 +92,13 @@ public class EventController extends BaseController {
|
|||||||
csEventPOService.saveBatchEventList(csEventPOS);
|
csEventPOService.saveBatchEventList(csEventPOS);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/queryByIndex")
|
||||||
|
@ApiOperation("根据表唯一索引查询(用于校验是否存在该事件)")
|
||||||
|
public HttpResult<CsEventPO> queryByIndex(@RequestBody CsEventPO csEventPO) {
|
||||||
|
String methodDescribe = getMethodDescribe("queryByIndex");
|
||||||
|
CsEventPO po = csEventPOService.lambdaQuery().eq(CsEventPO::getDeviceId,csEventPO.getDeviceId()).eq(CsEventPO::getTag,csEventPO.getTag()).eq(CsEventPO::getStartTime,csEventPO.getStartTime()).one();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -5,15 +5,20 @@ 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.csharmonic.pojo.param.MakeUpParam;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.MakeUpVo;
|
||||||
import com.njcn.csharmonic.service.OfflineDataUploadService;
|
import com.njcn.csharmonic.service.OfflineDataUploadService;
|
||||||
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.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.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,4 +46,40 @@ public class OfflineDataUploadController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping(value = "/makeUpData")
|
||||||
|
@ApiOperation("补招数据-界面")
|
||||||
|
@ApiImplicitParam(name = "lineId", value = "监测点id", required = true)
|
||||||
|
@Deprecated
|
||||||
|
public HttpResult<List<MakeUpVo>> makeUpData(@RequestParam("lineId") String lineId){
|
||||||
|
String methodDescribe = getMethodDescribe("makeUpData");
|
||||||
|
List<MakeUpVo> list = offlineDataUploadService.getMakeUpData(lineId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping(value = "/askDirOrFile")
|
||||||
|
@ApiOperation("询问装置目录/文件")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "nDid", value = "装置nDid", required = true, paramType = "query"),
|
||||||
|
@ApiImplicitParam(name = "prjName", value = "项目名称", required = true, paramType = "query"),
|
||||||
|
@ApiImplicitParam(name = "path", value = "文件路径/文件名", required = true, paramType = "query"),
|
||||||
|
@ApiImplicitParam(name = "fileType", value = "文件类型", required = true, paramType = "query")
|
||||||
|
})
|
||||||
|
public HttpResult<List<MakeUpVo>> askDirOrFile(@RequestParam("nDid") String nDid, @RequestParam("prjName") String prjName, @RequestParam("path") String path, @RequestParam("fileType") String fileType) {
|
||||||
|
String methodDescribe = getMethodDescribe("askDirOrFile");
|
||||||
|
List<MakeUpVo> list = offlineDataUploadService.askDirOrFile(nDid,prjName,path,fileType);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping(value = "/makeUp")
|
||||||
|
@ApiOperation("设备补招")
|
||||||
|
@ApiImplicitParam(name = "param", value = "补招参数", required = true)
|
||||||
|
public HttpResult<String> makeUp(@RequestBody MakeUpParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("makeUp");
|
||||||
|
offlineDataUploadService.startMakeUpData(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.njcn.csharmonic.controller;
|
||||||
|
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:治理实时数据
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2024/9/30
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/realData")
|
||||||
|
@Api(tags = "实时数据")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class RealDataController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -165,7 +165,7 @@ public class MqttMessageHandler {
|
|||||||
if (capacity<=0){
|
if (capacity<=0){
|
||||||
thdDataVO.setStatisticalData(3.1415926);
|
thdDataVO.setStatisticalData(3.1415926);
|
||||||
}else {
|
}else {
|
||||||
double v = temp.getStatisticalData() / capacity;
|
double v = temp.getStatisticalData()*100 / capacity;
|
||||||
thdDataVO.setStatisticalData(Double.valueOf(df.format(v)));
|
thdDataVO.setStatisticalData(Double.valueOf(df.format(v)));
|
||||||
}
|
}
|
||||||
result.add(thdDataVO);
|
result.add(thdDataVO);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
1 status,
|
1 status,
|
||||||
</if>
|
</if>
|
||||||
b.device_id deviceId,b.line_id lineId,
|
b.device_id deviceId,b.line_id lineId,
|
||||||
b.start_time startTime,b.tag tag ,b.wave_path wavePath,b.instant_pics,b.rms_pics , b.type type,b.code code,b.level level
|
b.start_time startTime,b.tag tag ,b.wave_path wavePath,b.instant_pics,b.rms_pics , b.type type,b.code code,b.level level,b.location location
|
||||||
from cs_event_user a inner join cs_event b on a.event_id=b.id inner join cs_equipment_delivery c on b.device_id=c.id where 1=1
|
from cs_event_user a inner join cs_event b on a.event_id=b.id inner join cs_equipment_delivery c on b.device_id=c.id where 1=1
|
||||||
and b.process=c.process
|
and b.process=c.process
|
||||||
<if test="csEventUserQueryParam!=null and csEventUserQueryParam.endTime != null and csEventUserQueryParam.endTime !=''">
|
<if test="csEventUserQueryParam!=null and csEventUserQueryParam.endTime != null and csEventUserQueryParam.endTime !=''">
|
||||||
@@ -83,8 +83,8 @@
|
|||||||
1 status,
|
1 status,
|
||||||
</if>
|
</if>
|
||||||
b.device_id deviceId,b.line_id lineId,b.code code,
|
b.device_id deviceId,b.line_id lineId,b.code code,
|
||||||
b.start_time startTime,b.tag tag ,b.wave_path wavePath,b.instant_pics,b.rms_pics , b.type type,b.level level
|
b.start_time startTime,b.tag tag ,b.wave_path wavePath,b.instant_pics,b.rms_pics , b.type type,b.level level,b.location location,d.name lineName
|
||||||
from cs_event_user a inner join cs_event b on a.event_id=b.id inner join cs_equipment_delivery c on b.device_id=c.id where 1=1
|
from cs_event_user a inner join cs_event b on a.event_id=b.id inner join cs_equipment_delivery c on b.device_id=c.id inner join cs_line d on d.device_id=b.device_id and d.clDid=b.cl_did where 1=1
|
||||||
and b.process=c.process
|
and b.process=c.process
|
||||||
<if test="csEventUserQueryPage!=null and csEventUserQueryPage.endTime != null and csEventUserQueryPage.endTime !=''">
|
<if test="csEventUserQueryPage!=null and csEventUserQueryPage.endTime != null and csEventUserQueryPage.endTime !=''">
|
||||||
AND DATE(b.start_time) <= DATE(#{csEventUserQueryPage.endTime})
|
AND DATE(b.start_time) <= DATE(#{csEventUserQueryPage.endTime})
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package com.njcn.csharmonic.service;
|
package com.njcn.csharmonic.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.csdevice.pojo.vo.DataGroupEventVO;
|
||||||
|
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
||||||
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
||||||
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
@@ -40,5 +43,7 @@ public interface CsEventPOService extends IService<CsEventPO>{
|
|||||||
|
|
||||||
List<EventDetailVO> queryEventList(CsEventUserQueryParam csEventUserQueryParam);
|
List<EventDetailVO> queryEventList(CsEventUserQueryParam csEventUserQueryParam);
|
||||||
|
|
||||||
|
Page<DataGroupEventVO> pageQueryByLineId(CsEventUserQueryPage csEventUserQueryPage);
|
||||||
|
|
||||||
void saveBatchEventList(List<CsEventPO> csEventPOS);
|
void saveBatchEventList(List<CsEventPO> csEventPOS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package com.njcn.csharmonic.service;
|
package com.njcn.csharmonic.service;
|
||||||
|
|
||||||
|
import com.njcn.csharmonic.pojo.param.MakeUpParam;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.MakeUpVo;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,4 +18,26 @@ public interface OfflineDataUploadService {
|
|||||||
|
|
||||||
byte[] uploadAnalysis(List<MultipartFile> files,String type) throws Exception;
|
byte[] uploadAnalysis(List<MultipartFile> files,String type) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 传递监测点id,获取装置中的项目信息
|
||||||
|
* @param lineId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MakeUpVo> getMakeUpData(String lineId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 传递监测点id,获取装置中的项目信息
|
||||||
|
* @param nDid 装置nDid
|
||||||
|
* @param path 文件夹路径/文件名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MakeUpVo> askDirOrFile(String nDid, String prjName, String path, String fileType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始装置数据补招
|
||||||
|
* 根据项目递归获取文件夹下的bin文件,区分暂态、稳态,存储离线文件的方式,调用黄正剑的离线数据补招功能
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void startMakeUpData(MakeUpParam param);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,22 @@
|
|||||||
package com.njcn.csharmonic.service.impl;
|
package com.njcn.csharmonic.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
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.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.csdevice.api.CsLedgerFeignClient;
|
import com.njcn.csdevice.api.CsLedgerFeignClient;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.DataGroupEventVO;
|
||||||
|
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
||||||
import com.njcn.csharmonic.pojo.vo.CsEventVO;
|
import com.njcn.csharmonic.pojo.vo.CsEventVO;
|
||||||
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
||||||
import com.njcn.csharmonic.pojo.vo.EventDetailVO;
|
import com.njcn.csharmonic.pojo.vo.EventDetailVO;
|
||||||
@@ -29,6 +37,7 @@ import com.njcn.system.pojo.po.EleEpdPqd;
|
|||||||
import com.njcn.system.pojo.po.EleEvtParm;
|
import com.njcn.system.pojo.po.EleEvtParm;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@@ -37,13 +46,10 @@ import com.njcn.csharmonic.pojo.po.CsEventPO;
|
|||||||
import com.njcn.csharmonic.service.CsEventPOService;
|
import com.njcn.csharmonic.service.CsEventPOService;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@@ -94,14 +100,22 @@ public class CsEventPOServiceImpl extends ServiceImpl<CsEventPOMapper, CsEventPO
|
|||||||
for (EleEvtParm eleEvtParm : data1) {
|
for (EleEvtParm eleEvtParm : data1) {
|
||||||
EventDataSetDTO eventDataSetDTO = new EventDataSetDTO();
|
EventDataSetDTO eventDataSetDTO = new EventDataSetDTO();
|
||||||
BeanUtils.copyProperties(eleEvtParm, eventDataSetDTO);
|
BeanUtils.copyProperties(eleEvtParm, eventDataSetDTO);
|
||||||
|
if (Objects.equals(eventDataSetDTO.getName(),"Evt_Param_Position")) {
|
||||||
|
continue;
|
||||||
|
// eventDataSetDTO.setValue(Objects.equals(temp.getLocation(),"grid")?"电网侧":"负载侧");
|
||||||
|
}
|
||||||
EventDataSetDTO evtData = evtDataService.getEventDataSet("evt_data", temp.getId(), eleEvtParm.getName());
|
EventDataSetDTO evtData = evtDataService.getEventDataSet("evt_data", temp.getId(), eleEvtParm.getName());
|
||||||
if (evtData == null) {
|
if (evtData == null) {
|
||||||
eventDataSetDTO.setValue("3.1415926");
|
eventDataSetDTO.setValue("3.1415926");
|
||||||
} else {
|
} else {
|
||||||
eventDataSetDTO.setValue(Optional.ofNullable(evtData.getValue()).orElse("3.1415926"));
|
eventDataSetDTO.setValue(Optional.ofNullable(evtData.getValue()).orElse("3.1415926"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//优化,删除监测点位置
|
||||||
|
// if (Objects.equals(temp.getEvtParamPosition(),"-") || Objects.isNull(temp.getEvtParamPosition())) {
|
||||||
|
// if (!Objects.isNull(temp.getLocation())) {
|
||||||
|
// temp.setEvtParamPosition(Objects.equals(temp.getLocation(),"grid")?"电网侧":"负载侧");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
eventDataSetDTOS.add(eventDataSetDTO);
|
eventDataSetDTOS.add(eventDataSetDTO);
|
||||||
}
|
}
|
||||||
temp.setDataSet(eventDataSetDTOS);
|
temp.setDataSet(eventDataSetDTOS);
|
||||||
@@ -111,6 +125,32 @@ public class CsEventPOServiceImpl extends ServiceImpl<CsEventPOMapper, CsEventPO
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<DataGroupEventVO> pageQueryByLineId(CsEventUserQueryPage csEventUserQueryPage) {
|
||||||
|
Page<DataGroupEventVO> result = new Page<>(csEventUserQueryPage.getPageNum(),csEventUserQueryPage.getPageSize());
|
||||||
|
//治理,无线混用会导致csEventUserQueryPage.getStartTime()为空,这里坐下特殊处理,当时间为空的时候默认查当天的数据
|
||||||
|
DateTime begin = DateUtil.beginOfDay(new Date());
|
||||||
|
DateTime end = DateUtil.endOfDay(new Date());
|
||||||
|
if(StringUtils.isNotBlank(csEventUserQueryPage.getStartTime())){
|
||||||
|
begin = DateUtil.parse(csEventUserQueryPage.getStartTime(), DatePattern.NORM_DATE_PATTERN);
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(csEventUserQueryPage.getEndTime())){
|
||||||
|
end = DateUtil.endOfDay(DateUtil.parse(csEventUserQueryPage.getEndTime(), DatePattern.NORM_DATE_PATTERN));
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<CsEventPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(CsEventPO::getLineId,csEventUserQueryPage.getLineId())
|
||||||
|
.eq(CsEventPO::getType,0).between(CsEventPO::getStartTime,begin,end)
|
||||||
|
.orderByDesc(CsEventPO::getStartTime);
|
||||||
|
Page<CsEventPO> page = this.page(new Page<>(csEventUserQueryPage.getPageNum(),csEventUserQueryPage.getPageSize()),lambdaQueryWrapper);
|
||||||
|
if(CollUtil.isNotEmpty(page.getRecords())){
|
||||||
|
List<DataGroupEventVO> dataGroupEventVOList = BeanUtil.copyToList(page.getRecords(),DataGroupEventVO.class);
|
||||||
|
result.setRecords(dataGroupEventVOList);
|
||||||
|
result.setTotal(page.getTotal());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void saveBatchEventList(List<CsEventPO> csEventPOS) {
|
public void saveBatchEventList(List<CsEventPO> csEventPOS) {
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
|
|||||||
List<CsLedgerVO> data = csLedgerFeignClient.getDeviceTree().getData();
|
List<CsLedgerVO> data = csLedgerFeignClient.getDeviceTree().getData();
|
||||||
|
|
||||||
List<String> collect = data.stream().map(CsLedgerVO::getChildren).
|
List<String> collect = data.stream().map(CsLedgerVO::getChildren).
|
||||||
|
flatMap(Collection::stream).
|
||||||
|
map(CsLedgerVO::getChildren).
|
||||||
flatMap(Collection::stream).
|
flatMap(Collection::stream).
|
||||||
map(CsLedgerVO::getChildren).
|
map(CsLedgerVO::getChildren).
|
||||||
flatMap(Collection::stream).
|
flatMap(Collection::stream).
|
||||||
@@ -286,6 +288,10 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
|
|||||||
for (EleEvtParm eleEvtParm : data1) {
|
for (EleEvtParm eleEvtParm : data1) {
|
||||||
EventDataSetDTO eventDataSetDTO = new EventDataSetDTO();
|
EventDataSetDTO eventDataSetDTO = new EventDataSetDTO();
|
||||||
BeanUtils.copyProperties(eleEvtParm,eventDataSetDTO);
|
BeanUtils.copyProperties(eleEvtParm,eventDataSetDTO);
|
||||||
|
if (Objects.equals(eventDataSetDTO.getName(),"Evt_Param_Position")) {
|
||||||
|
continue;
|
||||||
|
// eventDataSetDTO.setValue(Objects.equals(temp.getLocation(),"grid")?"电网侧":"负载侧");
|
||||||
|
}
|
||||||
EventDataSetDTO evtData = evtDataService.getEventDataSet("evt_data", temp.getId(), eleEvtParm.getName());
|
EventDataSetDTO evtData = evtDataService.getEventDataSet("evt_data", temp.getId(), eleEvtParm.getName());
|
||||||
if (evtData == null) {
|
if (evtData == null) {
|
||||||
eventDataSetDTO.setValue("-");
|
eventDataSetDTO.setValue("-");
|
||||||
@@ -293,7 +299,9 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
|
|||||||
eventDataSetDTO.setValue(Optional.ofNullable(evtData.getValue()).orElse("-"));
|
eventDataSetDTO.setValue(Optional.ofNullable(evtData.getValue()).orElse("-"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// if (Objects.equals(eventDataSetDTO.getName(),"Evt_Param_Position")) {
|
||||||
|
// eventDataSetDTO.setValue(Objects.equals(temp.getLocation(),"grid")?"电网侧":"负载侧");
|
||||||
|
// }
|
||||||
eventDataSetDTOS.add(eventDataSetDTO);
|
eventDataSetDTOS.add(eventDataSetDTO);
|
||||||
}
|
}
|
||||||
temp.setDataSet(eventDataSetDTOS);
|
temp.setDataSet(eventDataSetDTOS);
|
||||||
@@ -317,8 +325,13 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
|
|||||||
temp.setEvtParamPosition("-");
|
temp.setEvtParamPosition("-");
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
temp.setEvtParamPosition(evtParamPosition.get(0).getValue()+(Objects.isNull(evtParamPosition.get(0).getUnit())?"":evtParamPosition.get(0).getUnit()));
|
//temp.setEvtParamPosition(evtParamPosition.get(0).getValue()+(Objects.isNull(evtParamPosition.get(0).getUnit())?"":evtParamPosition.get(0).getUnit()));
|
||||||
|
temp.setEvtParamPosition(evtParamPosition.get(0).getValue());
|
||||||
|
}
|
||||||
|
if (Objects.equals(temp.getEvtParamPosition(),"-")) {
|
||||||
|
if (!Objects.isNull(temp.getLocation())) {
|
||||||
|
temp.setEvtParamPosition(Objects.equals(temp.getLocation(),"grid")?"电网侧":"负载侧");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<EventDataSetDTO> evtParamTm = eventDataSetDTOS.stream().
|
List<EventDataSetDTO> evtParamTm = eventDataSetDTOS.stream().
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
package com.njcn.csharmonic.service.impl;
|
package com.njcn.csharmonic.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.csdevice.api.CsLedgerFeignClient;
|
import com.njcn.csdevice.api.CsLedgerFeignClient;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||||
|
import com.njcn.csdevice.api.DataSetFeignClient;
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||||
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsDataSet;
|
||||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import com.njcn.csdevice.utils.DataChangeUtil;
|
import com.njcn.csdevice.utils.DataChangeUtil;
|
||||||
@@ -31,6 +37,8 @@ import java.util.Objects;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import static com.njcn.csharmonic.constant.HarmonicConstant.POWER_LIST;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
* Date: 2023/6/26 9:14【需求编号】
|
* Date: 2023/6/26 9:14【需求编号】
|
||||||
@@ -47,6 +55,8 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
|
|||||||
private final EquipmentFeignClient equipmentFeignClient;
|
private final EquipmentFeignClient equipmentFeignClient;
|
||||||
private final InfluxDbParamUtil influxDbParamUtil;
|
private final InfluxDbParamUtil influxDbParamUtil;
|
||||||
private final EpdFeignClient epdFeignClient;
|
private final EpdFeignClient epdFeignClient;
|
||||||
|
private final DataSetFeignClient dataSetFeignClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<List<ThdDataVO>> queryDataTrend(DevicDataTrendQueryParam devicDataTrendQueryParam) {
|
public List<List<ThdDataVO>> queryDataTrend(DevicDataTrendQueryParam devicDataTrendQueryParam) {
|
||||||
List<List<ThdDataVO>> result = new ArrayList<>();
|
List<List<ThdDataVO>> result = new ArrayList<>();
|
||||||
@@ -60,7 +70,10 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
|
|||||||
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of((data == null || data.isEmpty()) ? devicDataTrendQueryParam.getDevId() : data.get(0).getPid()).collect(Collectors.toList())).getData();
|
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of((data == null || data.isEmpty()) ? devicDataTrendQueryParam.getDevId() : data.get(0).getPid()).collect(Collectors.toList())).getData();
|
||||||
//根据lineId获取监测点pt、ct变比
|
//根据lineId获取监测点pt、ct变比
|
||||||
CsLinePO linePo = csLineFeignClient.queryLineById(Collections.singletonList(devicDataTrendQueryParam.getLineId())).getData().get(0);
|
CsLinePO linePo = csLineFeignClient.queryLineById(Collections.singletonList(devicDataTrendQueryParam.getLineId())).getData().get(0);
|
||||||
|
List<CsDataSet> csDataSetList = dataSetFeignClient.getDataSetBySetIds(Stream.of(linePo.getDataSetId()).collect(Collectors.toList())).getData();
|
||||||
|
if(CollUtil.isEmpty(csDataSetList) || StrUtil.isBlank(csDataSetList.get(0).getDataLevel())){
|
||||||
|
throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)");
|
||||||
|
}
|
||||||
devicDataTrendQueryParam.getStatisticalParams().forEach(temp->{
|
devicDataTrendQueryParam.getStatisticalParams().forEach(temp->{
|
||||||
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
||||||
commonQueryParam.setLineId(devicDataTrendQueryParam.getLineId());
|
commonQueryParam.setLineId(devicDataTrendQueryParam.getLineId());
|
||||||
@@ -81,15 +94,29 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
|
|||||||
vo.setTime(statisticalDataDTO.getTime());
|
vo.setTime(statisticalDataDTO.getTime());
|
||||||
vo.setStatMethod(statisticalDataDTO.getValueType());
|
vo.setStatMethod(statisticalDataDTO.getValueType());
|
||||||
//判断监测点类型 针对治理设备 模块数据是一次值、电能质量设备是二次值
|
//判断监测点类型 针对治理设备 模块数据是一次值、电能质量设备是二次值
|
||||||
if (linePo.getClDid() != 0 && Objects.equals(devicDataTrendQueryParam.getDataLevel(),"Primary") && ObjectUtil.isNotNull(epdPqd.getPrimaryFormula())) {
|
double value;
|
||||||
double secondaryData = DataChangeUtil.secondaryToPrimary(epdPqd.getPrimaryFormula(), statisticalDataDTO.getValue(), linePo.getPtRatio(), linePo.getCtRatio());
|
if (ObjectUtil.isNotNull(epdPqd.getPrimaryFormula()) && !Objects.equals(devicDataTrendQueryParam.getDataLevel(),csDataSetList.get(0).getDataLevel())) {
|
||||||
vo.setStatisticalData(BigDecimal.valueOf(secondaryData).setScale(4, RoundingMode.HALF_UP).doubleValue());
|
if("Primary".equals(csDataSetList.get(0).getDataLevel())){
|
||||||
|
value = DataChangeUtil.primaryToSecondary(epdPqd.getPrimaryFormula(), statisticalDataDTO.getValue(), linePo.getPtRatio(), linePo.getCtRatio());
|
||||||
|
}else {
|
||||||
|
value = DataChangeUtil.secondaryToPrimary(epdPqd.getPrimaryFormula(), statisticalDataDTO.getValue(), linePo.getPtRatio(), linePo.getCtRatio());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
vo.setStatisticalData(BigDecimal.valueOf(statisticalDataDTO.getValue()).setScale(4, RoundingMode.HALF_UP).doubleValue());
|
value= statisticalDataDTO.getValue();
|
||||||
}
|
}
|
||||||
|
if (changePower(epdPqd.getShowName())) {
|
||||||
|
value = value/1000;
|
||||||
|
}
|
||||||
|
vo.setStatisticalData(BigDecimal.valueOf(value).setScale(4, RoundingMode.HALF_UP).doubleValue());
|
||||||
|
|
||||||
vo.setStatisticalIndex(temp.getDataId());
|
vo.setStatisticalIndex(temp.getDataId());
|
||||||
vo.setStatisticalName(temp.getName());
|
vo.setStatisticalName(temp.getName());
|
||||||
vo.setUnit(temp.getUnit());
|
|
||||||
|
if (changePower(epdPqd.getShowName())) {
|
||||||
|
vo.setUnit("k" + temp.getUnit());
|
||||||
|
} else {
|
||||||
|
vo.setUnit(temp.getUnit());
|
||||||
|
}
|
||||||
vo.setAnotherName(temp.getAnotherName());
|
vo.setAnotherName(temp.getAnotherName());
|
||||||
return vo;
|
return vo;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
@@ -97,4 +124,14 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
|
|||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//判断功率是否需要转换
|
||||||
|
public boolean changePower(String name) {
|
||||||
|
return POWER_LIST.stream()
|
||||||
|
.anyMatch(name::contains);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,56 @@
|
|||||||
package com.njcn.csharmonic.service.impl;
|
package com.njcn.csharmonic.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||||
|
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
||||||
|
import com.njcn.access.api.CsTopicFeignClient;
|
||||||
|
import com.njcn.access.enums.AccessEnum;
|
||||||
|
import com.njcn.access.enums.TypeEnum;
|
||||||
|
import com.njcn.access.pojo.RspDataDto;
|
||||||
|
import com.njcn.access.pojo.dto.ReqAndResDto;
|
||||||
|
import com.njcn.access.pojo.dto.file.FileDto;
|
||||||
|
import com.njcn.access.utils.ChannelObjectUtil;
|
||||||
|
import com.njcn.access.utils.MqttUtil;
|
||||||
|
import com.njcn.common.config.GeneralInfo;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.csdevice.api.DeviceFtpFeignClient;
|
||||||
|
import com.njcn.csdevice.api.PortableOffLogFeignClient;
|
||||||
|
import com.njcn.csharmonic.enums.CsHarmonicResponseEnum;
|
||||||
import com.njcn.csharmonic.offline.constant.OfflineConstant;
|
import com.njcn.csharmonic.offline.constant.OfflineConstant;
|
||||||
import com.njcn.csharmonic.offline.log.Log;
|
import com.njcn.csharmonic.offline.log.Log;
|
||||||
import com.njcn.csharmonic.offline.log.vo.NewTaglogbuffer;
|
import com.njcn.csharmonic.offline.log.vo.NewTaglogbuffer;
|
||||||
|
import com.njcn.csharmonic.offline.log.vo.TagComtradeCfg;
|
||||||
import com.njcn.csharmonic.offline.mincfg.AnalyseComtradeCfg;
|
import com.njcn.csharmonic.offline.mincfg.AnalyseComtradeCfg;
|
||||||
import com.njcn.csharmonic.offline.mincfg.tagComtradeCfg;
|
|
||||||
import com.njcn.csharmonic.offline.vo.Response;
|
import com.njcn.csharmonic.offline.vo.Response;
|
||||||
|
import com.njcn.csharmonic.pojo.dto.MakeUpDto;
|
||||||
|
import com.njcn.csharmonic.pojo.param.MakeUpParam;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.MakeUpVo;
|
||||||
import com.njcn.csharmonic.service.OfflineDataUploadService;
|
import com.njcn.csharmonic.service.OfflineDataUploadService;
|
||||||
import com.njcn.influx.pojo.po.cs.PqdData;
|
import com.njcn.influx.pojo.po.cs.PqdData;
|
||||||
|
import com.njcn.oss.constant.OssPath;
|
||||||
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
|
import com.njcn.redis.pojo.enums.AppRedisKey;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.sf.json.JSONObject;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.*;
|
||||||
import java.io.ObjectOutputStream;
|
import java.nio.file.Files;
|
||||||
import java.util.ArrayList;
|
import java.time.Instant;
|
||||||
import java.util.List;
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static com.njcn.access.enums.TypeEnum.DATA_48;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类的介绍:离线数据上传解析服务实现类
|
* 类的介绍:离线数据上传解析服务实现类
|
||||||
@@ -27,8 +61,21 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class OfflineDataUploadServiceImpl implements OfflineDataUploadService {
|
public class OfflineDataUploadServiceImpl implements OfflineDataUploadService {
|
||||||
|
|
||||||
|
private final MqttPublisher publisher;
|
||||||
|
private final CsTopicFeignClient csTopicFeignClient;
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
private final ChannelObjectUtil channelObjectUtil;
|
||||||
|
private final MqttUtil mqttUtil;
|
||||||
|
private static Integer mid = 1;
|
||||||
|
private final DeviceFtpFeignClient deviceFtpFeignClient;
|
||||||
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
private final GeneralInfo generalInfo;
|
||||||
|
private final PortableOffLogFeignClient portableOffLogFeignClient;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] uploadAnalysis(List<MultipartFile> files,String type) throws Exception{
|
public byte[] uploadAnalysis(List<MultipartFile> files,String type) throws Exception{
|
||||||
byte[] bytes = null;
|
byte[] bytes = null;
|
||||||
@@ -53,8 +100,8 @@ public class OfflineDataUploadServiceImpl implements OfflineDataUploadService {
|
|||||||
for(MultipartFile file : files){
|
for(MultipartFile file : files){
|
||||||
Response response = new Response();
|
Response response = new Response();
|
||||||
response.setFilename(file.getOriginalFilename());
|
response.setFilename(file.getOriginalFilename());
|
||||||
if(OfflineConstant.COMTRADE.equals(type) && file.getOriginalFilename().indexOf(OfflineConstant.CFG) != -1) {
|
if(OfflineConstant.COMTRADE.equals(type) && Objects.requireNonNull(file.getOriginalFilename()).contains(OfflineConstant.CFG)) {
|
||||||
tagComtradeCfg tagComtradeCfg = null;
|
TagComtradeCfg tagComtradeCfg = null;
|
||||||
try {
|
try {
|
||||||
tagComtradeCfg = AnalyseComtradeCfg.analyseComtradeCfg(file);
|
tagComtradeCfg = AnalyseComtradeCfg.analyseComtradeCfg(file);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -62,7 +109,7 @@ public class OfflineDataUploadServiceImpl implements OfflineDataUploadService {
|
|||||||
response.setState(2);
|
response.setState(2);
|
||||||
}
|
}
|
||||||
response.setObj(tagComtradeCfg);
|
response.setObj(tagComtradeCfg);
|
||||||
}else if(OfflineConstant.LOG.equals(type) && file.getOriginalFilename().indexOf(OfflineConstant.BIN) != -1){
|
}else if(OfflineConstant.LOG.equals(type) && Objects.requireNonNull(file.getOriginalFilename()).contains(OfflineConstant.BIN)){
|
||||||
List<NewTaglogbuffer> newTaglogbuffers = null;
|
List<NewTaglogbuffer> newTaglogbuffers = null;
|
||||||
try {
|
try {
|
||||||
newTaglogbuffers = Log.convertLog(file);
|
newTaglogbuffers = Log.convertLog(file);
|
||||||
@@ -87,4 +134,343 @@ public class OfflineDataUploadServiceImpl implements OfflineDataUploadService {
|
|||||||
}
|
}
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MakeUpVo> getMakeUpData(String lineId) {
|
||||||
|
List<MakeUpVo> result = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
//询问装置项目信息
|
||||||
|
askProjectInfo(lineId,null, Integer.parseInt(TypeEnum.TYPE_6.getCode()),null,"DevCmd");
|
||||||
|
Thread.sleep(5000);
|
||||||
|
String key = AppRedisKey.PROJECT_INFO + lineId;
|
||||||
|
Object object = redisUtil.getObjectByKey(key);
|
||||||
|
if (!Objects.isNull(object)) {
|
||||||
|
// 创建 DateTimeFormatter 对象并指定格式
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
List<RspDataDto.ProjectInfo> projectInfoList = channelObjectUtil.objectToList(redisUtil.getObjectByKey(key),RspDataDto.ProjectInfo.class);
|
||||||
|
projectInfoList.forEach(item->{
|
||||||
|
MakeUpVo vo = new MakeUpVo();
|
||||||
|
vo.setType("dir");
|
||||||
|
BeanUtils.copyProperties(item,vo);
|
||||||
|
long startTime = item.getPrjTimeStart();
|
||||||
|
if (startTime != 0) {
|
||||||
|
LocalDateTime dateTime = Instant.ofEpochMilli(startTime*1000).atZone(ZoneId.systemDefault()).toLocalDateTime();
|
||||||
|
String formattedDate = dateTime.format(formatter);
|
||||||
|
vo.setStartTime(formattedDate);
|
||||||
|
}
|
||||||
|
long endTime = item.getPrjTimeEnd();
|
||||||
|
if (endTime != -1) {
|
||||||
|
LocalDateTime dateTime = Instant.ofEpochMilli(endTime*1000).atZone(ZoneId.systemDefault()).toLocalDateTime();
|
||||||
|
String formattedDate = dateTime.format(formatter);
|
||||||
|
vo.setEndTime(formattedDate);
|
||||||
|
}
|
||||||
|
result.add(vo);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MakeUpVo> askDirOrFile(String nDid, String prjName, String path, String fileType) {
|
||||||
|
List<MakeUpVo> result = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
//判断文件类型
|
||||||
|
//文件夹
|
||||||
|
if (Objects.equals("dir",fileType)) {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
askProjectInfo(null,nDid, Integer.parseInt(TypeEnum.TYPE_8.getCode()),path,"DevFileCmd");
|
||||||
|
Thread.sleep(2000);
|
||||||
|
String key = AppRedisKey.PROJECT_INFO + nDid;
|
||||||
|
Object object = redisUtil.getObjectByKey(key);
|
||||||
|
if (!Objects.isNull(object)) {
|
||||||
|
List<FileDto.DirInfo> projectInfoList = channelObjectUtil.objectToList(redisUtil.getObjectByKey(key),FileDto.DirInfo.class);
|
||||||
|
projectInfoList.forEach(item->{
|
||||||
|
MakeUpVo vo = new MakeUpVo();
|
||||||
|
vo.setPrjName(prjName);
|
||||||
|
vo.setPrjDataPath(item.getName());
|
||||||
|
vo.setType(item.getType());
|
||||||
|
vo.setSize(item.getSize());
|
||||||
|
if (item.getTime() != 0) {
|
||||||
|
LocalDateTime dateTime = Instant.ofEpochMilli(item.getTime()*1000).atZone(ZoneId.systemDefault()).toLocalDateTime();
|
||||||
|
String formattedDate = dateTime.format(formatter);
|
||||||
|
vo.setStartTime(formattedDate);
|
||||||
|
}
|
||||||
|
result.add(vo);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//文件
|
||||||
|
else {
|
||||||
|
System.out.println("file");
|
||||||
|
}
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void startMakeUpData(MakeUpParam param) {
|
||||||
|
List<String> fileList = new ArrayList<>();
|
||||||
|
Map<String,List<String>> map = new HashMap<>();
|
||||||
|
//组装文件路径
|
||||||
|
for (String s : param.getProList()) {
|
||||||
|
//稳态补招
|
||||||
|
if (param.getDataTypeList().contains(0)) {
|
||||||
|
String minPath = s + "/min";
|
||||||
|
List<FileDto.DirInfo> projectInfoList = getFileList(param.getLineId(),param.getNDid(),minPath);
|
||||||
|
if (CollectionUtil.isNotEmpty(projectInfoList)) {
|
||||||
|
projectInfoList.forEach(item->{
|
||||||
|
String linePath = item.getName();
|
||||||
|
if (timeRange(param.getStartTime(),param.getEndTime(),linePath,"min")) {
|
||||||
|
List<FileDto.DirInfo> lineDataList = getFileList(param.getLineId(),param.getNDid(),linePath);
|
||||||
|
if (CollectionUtil.isNotEmpty(lineDataList)) {
|
||||||
|
fileList.addAll(lineDataList.stream().map(FileDto.DirInfo::getName).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//暂态补招
|
||||||
|
if (param.getDataTypeList().contains(1)) {
|
||||||
|
//事件
|
||||||
|
String logPath = s + "/log";
|
||||||
|
List<FileDto.DirInfo> logList = getFileList(param.getLineId(),param.getNDid(),logPath);
|
||||||
|
if (CollectionUtil.isNotEmpty(logList)) {
|
||||||
|
logList.forEach(item->{
|
||||||
|
if (timeRange(param.getStartTime(),param.getEndTime(),item.getName(),"log")) {
|
||||||
|
fileList.add(item.getName());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//录波文件
|
||||||
|
String comtradePath = s + "/comtrade";
|
||||||
|
List<FileDto.DirInfo> comtradeList = getFileList(param.getLineId(),param.getNDid(),comtradePath);
|
||||||
|
if (CollectionUtil.isNotEmpty(comtradeList)) {
|
||||||
|
comtradeList.forEach(item->{
|
||||||
|
if (timeRange(param.getStartTime(),param.getEndTime(),item.getName(),"comtrade")) {
|
||||||
|
fileList.add(item.getName());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(fileList)) {
|
||||||
|
map.put(s,fileList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(map)) {
|
||||||
|
map.forEach((k,v)->{
|
||||||
|
String proName = k.replace("/bd0/cmn/",OssPath.DEV_MAKE_UP_PATH + param.getNDid() + "/");
|
||||||
|
String key = AppRedisKey.PROJECT_INFO + param.getNDid();
|
||||||
|
v.forEach(item->{
|
||||||
|
redisUtil.delete(key);
|
||||||
|
Object object = redisUtil.getObjectByKey(AppRedisKey.DEVICE_MID + param.getNDid());
|
||||||
|
if (!Objects.isNull(object)) {
|
||||||
|
mid = (Integer) object;
|
||||||
|
}
|
||||||
|
askFileInfo(param.getNDid(),mid,item);
|
||||||
|
try {
|
||||||
|
Thread.sleep(5000);
|
||||||
|
FileDto.FileInfo info = channelObjectUtil.objectToSingleObject(redisUtil.getObjectByKey(key),FileDto.FileInfo.class);
|
||||||
|
String path = deviceFtpFeignClient.downloadFile(param.getNDid(),item,info.getFileSize(),info.getFileCheck()).getData();
|
||||||
|
String lsFile = generalInfo.getBusinessTempPath() + File.separator + item.split(StrUtil.SLASH)[item.split(StrUtil.SLASH).length - 1];
|
||||||
|
moveFile(path,getFilePath(item,param.getNDid()),lsFile);
|
||||||
|
//删除临时文件
|
||||||
|
File file = new File(lsFile);
|
||||||
|
if (file.exists()) {
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
//删除下载文件
|
||||||
|
fileStorageUtil.deleteFile(path);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException(CsHarmonicResponseEnum.MAKE_UP_ERROR);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//下载完成,调用解析接口
|
||||||
|
portableOffLogFeignClient.dataOnlineRecruitment(param.getNDid(),param.getLineId(),proName);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间处理
|
||||||
|
*/
|
||||||
|
public boolean timeRange(String startTime, String endTime, String filePath, String type) {
|
||||||
|
boolean result;
|
||||||
|
String data;
|
||||||
|
data = filePath.split(StrUtil.SLASH)[filePath.split(StrUtil.SLASH).length - 1];
|
||||||
|
switch (type) {
|
||||||
|
case "log":
|
||||||
|
data = data.split("\\.")[0];
|
||||||
|
break;
|
||||||
|
case "comtrade":
|
||||||
|
data = data.split("_")[1];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
result = judgeTimeRange(startTime,endTime,data);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加时间判断
|
||||||
|
*/
|
||||||
|
public boolean judgeTimeRange(String startTime, String endTime, String data) {
|
||||||
|
boolean result = false;
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
DateTimeFormatter formatterNoDelimiter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||||
|
LocalDate startDate = LocalDate.parse(startTime, formatter);
|
||||||
|
LocalDate endDate = LocalDate.parse(endTime, formatter);
|
||||||
|
LocalDate targetDate = LocalDate.parse(data, formatterNoDelimiter);
|
||||||
|
if (!targetDate.isBefore(startDate) && !targetDate.isAfter(endDate)) {
|
||||||
|
log.info("{},日期在指定范围内",data);
|
||||||
|
result = true;
|
||||||
|
} else {
|
||||||
|
log.info("{},日期不在指定范围内",data);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 迁移文件
|
||||||
|
*/
|
||||||
|
public void moveFile(String oldPath, String newPath, String lsPath) {
|
||||||
|
try {
|
||||||
|
InputStream inputStream = fileStorageUtil.getFileStream(oldPath);
|
||||||
|
FileOutputStream fileOutputStream = new FileOutputStream(lsPath);
|
||||||
|
// 创建一个缓冲区
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int bytesRead;
|
||||||
|
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
||||||
|
fileOutputStream.write(buffer, 0, bytesRead);
|
||||||
|
}
|
||||||
|
File src = new File(lsPath);
|
||||||
|
src.getParentFile().mkdirs();
|
||||||
|
InputStream is = Files.newInputStream(src.toPath());
|
||||||
|
fileStorageUtil.uploadStreamSpecifyName(is, OssPath.DEV_MAKE_UP_PATH,newPath);
|
||||||
|
inputStream.close();
|
||||||
|
fileOutputStream.close();
|
||||||
|
is.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException(CsHarmonicResponseEnum.MAKE_UP_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 询问文件信息
|
||||||
|
*/
|
||||||
|
public void askFileInfo(String nDid, Integer mid, String fileName) {
|
||||||
|
String version = csTopicFeignClient.find(nDid).getData();
|
||||||
|
ReqAndResDto.Req reqAndResParam = new ReqAndResDto.Req();
|
||||||
|
reqAndResParam.setMid(mid);
|
||||||
|
reqAndResParam.setDid(0);
|
||||||
|
reqAndResParam.setPri(AccessEnum.FIRST_CHANNEL.getCode());
|
||||||
|
reqAndResParam.setType(Integer.parseInt(TypeEnum.TYPE_8.getCode()));
|
||||||
|
reqAndResParam.setExpire(-1);
|
||||||
|
String json = "{Name:\""+fileName+"\"}";
|
||||||
|
JSONObject jsonObject = JSONObject.fromObject(json);
|
||||||
|
reqAndResParam.setMsg(jsonObject);
|
||||||
|
log.info("请求文件信息报文:" + new Gson().toJson(reqAndResParam));
|
||||||
|
publisher.send("/Pfm/DevFileCmd/"+version+"/"+nDid,new Gson().toJson(reqAndResParam),1,false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文件数据
|
||||||
|
*/
|
||||||
|
public List<FileDto.DirInfo> getFileList(String lineId, String nDid, String path) {
|
||||||
|
String key = AppRedisKey.PROJECT_INFO + nDid;
|
||||||
|
redisUtil.delete(key);
|
||||||
|
List<FileDto.DirInfo> result = new ArrayList<>();
|
||||||
|
askProjectInfo(lineId,nDid, Integer.parseInt(TypeEnum.TYPE_8.getCode()),path,"DevFileCmd");
|
||||||
|
try {
|
||||||
|
Thread.sleep(5000);
|
||||||
|
Object object = redisUtil.getObjectByKey(key);
|
||||||
|
if (!Objects.isNull(object)) {
|
||||||
|
result = channelObjectUtil.objectToList(redisUtil.getObjectByKey(key),FileDto.DirInfo.class);
|
||||||
|
}
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 询问装置项目信息报文
|
||||||
|
*/
|
||||||
|
public void askProjectInfo(String lineId, String nDid, Integer type, String path, String topic) {
|
||||||
|
if (StringUtils.isNotBlank(lineId)) {
|
||||||
|
nDid = lineId.substring(0, lineId.length() - 1);
|
||||||
|
}
|
||||||
|
String version = csTopicFeignClient.find(nDid).getData();
|
||||||
|
ReqAndResDto.Req reqAndResParam = createRequestParameters(lineId, type, path);
|
||||||
|
publisher.send("/Pfm/"+topic+"/" + version + "/" + nDid, new Gson().toJson(reqAndResParam), 1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ReqAndResDto.Req createRequestParameters(String lineId, Integer type, String path) {
|
||||||
|
ReqAndResDto.Req reqAndResParam = new ReqAndResDto.Req();
|
||||||
|
reqAndResParam.setMid(1);
|
||||||
|
reqAndResParam.setDid(1);
|
||||||
|
reqAndResParam.setPri(AccessEnum.FIRST_CHANNEL.getCode());
|
||||||
|
reqAndResParam.setExpire(-1);
|
||||||
|
switch (type) {
|
||||||
|
case 8454:
|
||||||
|
handleType8454(reqAndResParam, lineId);
|
||||||
|
break;
|
||||||
|
case 8497:
|
||||||
|
handleType8497(reqAndResParam, path);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return reqAndResParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleType8454(ReqAndResDto.Req reqAndResParam, String lineId) {
|
||||||
|
if (StringUtils.isNotBlank(lineId)) {
|
||||||
|
int length = StringUtils.length(lineId);
|
||||||
|
Integer clDid = Integer.parseInt(lineId.substring(length - 1));
|
||||||
|
reqAndResParam.setType(8454);
|
||||||
|
MakeUpDto makeUpDto = new MakeUpDto();
|
||||||
|
makeUpDto.setClDid(clDid);
|
||||||
|
makeUpDto.setDataType(Integer.parseInt(DATA_48.getCode()));
|
||||||
|
makeUpDto.setDataAttr(0);
|
||||||
|
makeUpDto.setOperate(1);
|
||||||
|
makeUpDto.setStartTime(-1);
|
||||||
|
makeUpDto.setEndTime(-1);
|
||||||
|
reqAndResParam.setMsg(makeUpDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleType8497(ReqAndResDto.Req reqAndResParam, String path) {
|
||||||
|
reqAndResParam.setType(8497);
|
||||||
|
String json = String.format("{\"Name\":\"%s\"}", path);
|
||||||
|
JSONObject jsonObject = JSONObject.fromObject(json);
|
||||||
|
reqAndResParam.setMsg(jsonObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调整文件路径
|
||||||
|
*/
|
||||||
|
private String getFilePath(String path, String nDid) {
|
||||||
|
String[] parts = path.split("/");
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
boolean first = true;
|
||||||
|
for (int i = 3; i < parts.length; i++) {
|
||||||
|
if (!first) {
|
||||||
|
sb.append("/");
|
||||||
|
}
|
||||||
|
sb.append(parts[i]);
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
return nDid + "/" + sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,4 +19,21 @@
|
|||||||
<maven.compiler.source>8</maven.compiler.source>
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
</properties>
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>common-core</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>common-db</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package com.njcn.csreport.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/12 20:23【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.csreport.pojo.po.RStatDataID;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报表的表映射
|
||||||
|
*/
|
||||||
|
public enum ReportTableEnum {
|
||||||
|
R_STAT_DATA_V_D("r_stat_data_v_d","RStatDataVD"),
|
||||||
|
R_STAT_DATA_I_D("r_stat_data_i_d","RStatDataID"),
|
||||||
|
R_STAT_DATA_PLT_D("r_stat_data_plt_d","RStatDataPltD"),
|
||||||
|
R_STAT_DATA_FLUC_D("r_stat_data_fluc_d","RStatDataFlucD"),
|
||||||
|
R_STAT_DATA_FLICKER_D("r_stat_data_flicker_d","RStatDataFlickerD"),
|
||||||
|
R_STAT_DATA_HARMPHASIC_I_D("r_stat_data_harmphasic_i_d","RStatDataHarmphasicID"),
|
||||||
|
R_STAT_DATA_HARMPHASIC_V_D("r_stat_data_harmphasic_v_d","RStatDataHarmphasicVD"),
|
||||||
|
R_STAT_DATA_HARMPOWER_P_D("r_stat_data_harmpower_p_d","RStatDataHarmpowerPD"),
|
||||||
|
R_STAT_DATA_HARMPOWER_Q_D("r_stat_data_harmpower_q_d","RStatDataHarmpowerQD"),
|
||||||
|
R_STAT_DATA_HARMPOWER_S_D("r_stat_data_harmpower_s_d","RStatDataHarmpowerSD"),
|
||||||
|
R_STAT_DATA_HARMRATE_I_D("r_stat_data_harmrate_i_d","RStatDataInharmID"),
|
||||||
|
R_STAT_DATA_HARMRATE_V_D("r_stat_data_harmrate_v_d","RStatDataInharmVD"),
|
||||||
|
R_STAT_DATA_INHARM_I_D("r_stat_data_inharm_i_d","RStatDataHarmrateID"),
|
||||||
|
R_STAT_DATA_INHARM_V_D("r_stat_data_inharm_v_d","RStatDataHarmrateVD");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private final String tableName;
|
||||||
|
private final String entityName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ReportTableEnum(String tableName, String entityName) {
|
||||||
|
this.tableName = tableName;
|
||||||
|
this.entityName = entityName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有可执行的组件类型,
|
||||||
|
* 除了"目录"类型,其他都可以执行
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<String> getExecutableTypes() {
|
||||||
|
return Arrays.stream(ReportTableEnum.values()).map(tmep->{
|
||||||
|
return tmep.tableName;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过TableName获取Influxdb实体类
|
||||||
|
* @param tableName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getEntityName(String tableName) {
|
||||||
|
for (ReportTableEnum item : ReportTableEnum.values()) {
|
||||||
|
if (item.tableName.equals(tableName)) {
|
||||||
|
return item.entityName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.njcn.csreport.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/13 14:26【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "r_stat_data_flicker_d")
|
||||||
|
public class RStatDataFlickerD {
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time")
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "phasic_type")
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(value = "quality_flag")
|
||||||
|
private Integer qualityFlag;
|
||||||
|
|
||||||
|
@TableField(value = "fluc")
|
||||||
|
private Double fluc;
|
||||||
|
|
||||||
|
@TableField(value = "plt")
|
||||||
|
private Double plt;
|
||||||
|
|
||||||
|
@TableField(value = "pst")
|
||||||
|
private Double pst;
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.njcn.csreport.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/13 14:29【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "r_stat_data_fluc_d")
|
||||||
|
public class RStatDataFlucD {
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time")
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "phasic_type")
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(value = "quality_flag")
|
||||||
|
private Integer qualityFlag;
|
||||||
|
|
||||||
|
@TableField(value = "fluc")
|
||||||
|
private Double fluc;
|
||||||
|
|
||||||
|
@TableField(value = "fluccf")
|
||||||
|
private Double fluccf;
|
||||||
|
}
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
package com.njcn.csreport.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.lang.Double;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/13 14:29【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "r_stat_data_harmphasic_i_d")
|
||||||
|
public class RStatDataHarmphasicID {
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time")
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "phasic_type")
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(value = "quality_flag")
|
||||||
|
private Integer qualityFlag;
|
||||||
|
|
||||||
|
@TableField(value = "i_1")
|
||||||
|
private Double i1;
|
||||||
|
|
||||||
|
@TableField(value = "i_2")
|
||||||
|
private Double i2;
|
||||||
|
|
||||||
|
@TableField(value = "i_3")
|
||||||
|
private Double i3;
|
||||||
|
|
||||||
|
@TableField(value = "i_4")
|
||||||
|
private Double i4;
|
||||||
|
|
||||||
|
@TableField(value = "i_5")
|
||||||
|
private Double i5;
|
||||||
|
|
||||||
|
@TableField(value = "i_6")
|
||||||
|
private Double i6;
|
||||||
|
|
||||||
|
@TableField(value = "i_7")
|
||||||
|
private Double i7;
|
||||||
|
|
||||||
|
@TableField(value = "i_8")
|
||||||
|
private Double i8;
|
||||||
|
|
||||||
|
@TableField(value = "i_9")
|
||||||
|
private Double i9;
|
||||||
|
|
||||||
|
@TableField(value = "i_10")
|
||||||
|
private Double i10;
|
||||||
|
|
||||||
|
@TableField(value = "i_11")
|
||||||
|
private Double i11;
|
||||||
|
|
||||||
|
@TableField(value = "i_12")
|
||||||
|
private Double i12;
|
||||||
|
|
||||||
|
@TableField(value = "i_13")
|
||||||
|
private Double i13;
|
||||||
|
|
||||||
|
@TableField(value = "i_14")
|
||||||
|
private Double i14;
|
||||||
|
|
||||||
|
@TableField(value = "i_15")
|
||||||
|
private Double i15;
|
||||||
|
|
||||||
|
@TableField(value = "i_16")
|
||||||
|
private Double i16;
|
||||||
|
|
||||||
|
@TableField(value = "i_17")
|
||||||
|
private Double i17;
|
||||||
|
|
||||||
|
@TableField(value = "i_18")
|
||||||
|
private Double i18;
|
||||||
|
|
||||||
|
@TableField(value = "i_19")
|
||||||
|
private Double i19;
|
||||||
|
|
||||||
|
@TableField(value = "i_20")
|
||||||
|
private Double i20;
|
||||||
|
|
||||||
|
@TableField(value = "i_21")
|
||||||
|
private Double i21;
|
||||||
|
|
||||||
|
@TableField(value = "i_22")
|
||||||
|
private Double i22;
|
||||||
|
|
||||||
|
@TableField(value = "i_23")
|
||||||
|
private Double i23;
|
||||||
|
|
||||||
|
@TableField(value = "i_24")
|
||||||
|
private Double i24;
|
||||||
|
|
||||||
|
@TableField(value = "i_25")
|
||||||
|
private Double i25;
|
||||||
|
|
||||||
|
@TableField(value = "i_26")
|
||||||
|
private Double i26;
|
||||||
|
|
||||||
|
@TableField(value = "i_27")
|
||||||
|
private Double i27;
|
||||||
|
|
||||||
|
@TableField(value = "i_28")
|
||||||
|
private Double i28;
|
||||||
|
|
||||||
|
@TableField(value = "i_29")
|
||||||
|
private Double i29;
|
||||||
|
|
||||||
|
@TableField(value = "i_30")
|
||||||
|
private Double i30;
|
||||||
|
|
||||||
|
@TableField(value = "i_31")
|
||||||
|
private Double i31;
|
||||||
|
|
||||||
|
@TableField(value = "i_32")
|
||||||
|
private Double i32;
|
||||||
|
|
||||||
|
@TableField(value = "i_33")
|
||||||
|
private Double i33;
|
||||||
|
|
||||||
|
@TableField(value = "i_34")
|
||||||
|
private Double i34;
|
||||||
|
|
||||||
|
@TableField(value = "i_35")
|
||||||
|
private Double i35;
|
||||||
|
|
||||||
|
@TableField(value = "i_36")
|
||||||
|
private Double i36;
|
||||||
|
|
||||||
|
@TableField(value = "i_37")
|
||||||
|
private Double i37;
|
||||||
|
|
||||||
|
@TableField(value = "i_38")
|
||||||
|
private Double i38;
|
||||||
|
|
||||||
|
@TableField(value = "i_39")
|
||||||
|
private Double i39;
|
||||||
|
|
||||||
|
@TableField(value = "i_40")
|
||||||
|
private Double i40;
|
||||||
|
|
||||||
|
@TableField(value = "i_41")
|
||||||
|
private Double i41;
|
||||||
|
|
||||||
|
@TableField(value = "i_42")
|
||||||
|
private Double i42;
|
||||||
|
|
||||||
|
@TableField(value = "i_43")
|
||||||
|
private Double i43;
|
||||||
|
|
||||||
|
@TableField(value = "i_44")
|
||||||
|
private Double i44;
|
||||||
|
|
||||||
|
@TableField(value = "i_45")
|
||||||
|
private Double i45;
|
||||||
|
|
||||||
|
@TableField(value = "i_46")
|
||||||
|
private Double i46;
|
||||||
|
|
||||||
|
@TableField(value = "i_47")
|
||||||
|
private Double i47;
|
||||||
|
|
||||||
|
@TableField(value = "i_48")
|
||||||
|
private Double i48;
|
||||||
|
|
||||||
|
@TableField(value = "i_49")
|
||||||
|
private Double i49;
|
||||||
|
|
||||||
|
@TableField(value = "i_50")
|
||||||
|
private Double i50;
|
||||||
|
}
|
||||||
@@ -0,0 +1,207 @@
|
|||||||
|
package com.njcn.csreport.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.lang.Double;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/13 14:29【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "r_stat_data_harmphasic_v_d")
|
||||||
|
public class RStatDataHarmphasicVD {
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time")
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "phasic_type")
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@TableField(value = "quality_flag")
|
||||||
|
private Integer qualityFlag;
|
||||||
|
|
||||||
|
@TableField(value = "v_1")
|
||||||
|
private Double v1;
|
||||||
|
|
||||||
|
@TableField(value = "v_2")
|
||||||
|
private Double v2;
|
||||||
|
|
||||||
|
@TableField(value = "v_3")
|
||||||
|
private Double v3;
|
||||||
|
|
||||||
|
@TableField(value = "v_4")
|
||||||
|
private Double v4;
|
||||||
|
|
||||||
|
@TableField(value = "v_5")
|
||||||
|
private Double v5;
|
||||||
|
|
||||||
|
@TableField(value = "v_6")
|
||||||
|
private Double v6;
|
||||||
|
|
||||||
|
@TableField(value = "v_7")
|
||||||
|
private Double v7;
|
||||||
|
|
||||||
|
@TableField(value = "v_8")
|
||||||
|
private Double v8;
|
||||||
|
|
||||||
|
@TableField(value = "v_9")
|
||||||
|
private Double v9;
|
||||||
|
|
||||||
|
@TableField(value = "v_10")
|
||||||
|
private Double v10;
|
||||||
|
|
||||||
|
@TableField(value = "v_11")
|
||||||
|
private Double v11;
|
||||||
|
|
||||||
|
@TableField(value = "v_12")
|
||||||
|
private Double v12;
|
||||||
|
|
||||||
|
@TableField(value = "v_13")
|
||||||
|
private Double v13;
|
||||||
|
|
||||||
|
@TableField(value = "v_14")
|
||||||
|
private Double v14;
|
||||||
|
|
||||||
|
@TableField(value = "v_15")
|
||||||
|
private Double v15;
|
||||||
|
|
||||||
|
@TableField(value = "v_16")
|
||||||
|
private Double v16;
|
||||||
|
|
||||||
|
@TableField(value = "v_17")
|
||||||
|
private Double v17;
|
||||||
|
|
||||||
|
@TableField(value = "v_18")
|
||||||
|
private Double v18;
|
||||||
|
|
||||||
|
@TableField(value = "v_19")
|
||||||
|
private Double v19;
|
||||||
|
|
||||||
|
@TableField(value = "v_20")
|
||||||
|
private Double v20;
|
||||||
|
|
||||||
|
@TableField(value = "v_21")
|
||||||
|
private Double v21;
|
||||||
|
|
||||||
|
@TableField(value = "v_22")
|
||||||
|
private Double v22;
|
||||||
|
|
||||||
|
@TableField(value = "v_23")
|
||||||
|
private Double v23;
|
||||||
|
|
||||||
|
@TableField(value = "v_24")
|
||||||
|
private Double v24;
|
||||||
|
|
||||||
|
@TableField(value = "v_25")
|
||||||
|
private Double v25;
|
||||||
|
|
||||||
|
@TableField(value = "v_26")
|
||||||
|
private Double v26;
|
||||||
|
|
||||||
|
@TableField(value = "v_27")
|
||||||
|
private Double v27;
|
||||||
|
|
||||||
|
@TableField(value = "v_28")
|
||||||
|
private Double v28;
|
||||||
|
|
||||||
|
@TableField(value = "v_29")
|
||||||
|
private Double v29;
|
||||||
|
|
||||||
|
@TableField(value = "v_30")
|
||||||
|
private Double v30;
|
||||||
|
|
||||||
|
@TableField(value = "v_31")
|
||||||
|
private Double v31;
|
||||||
|
|
||||||
|
@TableField(value = "v_32")
|
||||||
|
private Double v32;
|
||||||
|
|
||||||
|
@TableField(value = "v_33")
|
||||||
|
private Double v33;
|
||||||
|
|
||||||
|
@TableField(value = "v_34")
|
||||||
|
private Double v34;
|
||||||
|
|
||||||
|
@TableField(value = "v_35")
|
||||||
|
private Double v35;
|
||||||
|
|
||||||
|
@TableField(value = "v_36")
|
||||||
|
private Double v36;
|
||||||
|
|
||||||
|
@TableField(value = "v_37")
|
||||||
|
private Double v37;
|
||||||
|
|
||||||
|
@TableField(value = "v_38")
|
||||||
|
private Double v38;
|
||||||
|
|
||||||
|
@TableField(value = "v_39")
|
||||||
|
private Double v39;
|
||||||
|
|
||||||
|
@TableField(value = "v_40")
|
||||||
|
private Double v40;
|
||||||
|
|
||||||
|
@TableField(value = "v_41")
|
||||||
|
private Double v41;
|
||||||
|
|
||||||
|
@TableField(value = "v_42")
|
||||||
|
private Double v42;
|
||||||
|
|
||||||
|
@TableField(value = "v_43")
|
||||||
|
private Double v43;
|
||||||
|
|
||||||
|
@TableField(value = "v_44")
|
||||||
|
private Double v44;
|
||||||
|
|
||||||
|
@TableField(value = "v_45")
|
||||||
|
private Double v45;
|
||||||
|
|
||||||
|
@TableField(value = "v_46")
|
||||||
|
private Double v46;
|
||||||
|
|
||||||
|
@TableField(value = "v_47")
|
||||||
|
private Double v47;
|
||||||
|
|
||||||
|
@TableField(value = "v_48")
|
||||||
|
private Double v48;
|
||||||
|
|
||||||
|
@TableField(value = "v_49")
|
||||||
|
private Double v49;
|
||||||
|
|
||||||
|
@TableField(value = "v_50")
|
||||||
|
private Double v50;
|
||||||
|
}
|
||||||
@@ -0,0 +1,217 @@
|
|||||||
|
package com.njcn.csreport.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.lang.Double;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/13 14:29【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "r_stat_data_harmpower_p_d")
|
||||||
|
public class RStatDataHarmpowerPD {
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time")
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "phasic_type")
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(value = "quality_flag")
|
||||||
|
private Integer qualityFlag;
|
||||||
|
|
||||||
|
@TableField(value = "p")
|
||||||
|
private Double p;
|
||||||
|
|
||||||
|
@TableField(value = "pf")
|
||||||
|
private Double pf;
|
||||||
|
|
||||||
|
@TableField(value = "df")
|
||||||
|
private Double df;
|
||||||
|
|
||||||
|
@TableField(value = "p_1")
|
||||||
|
private Double p1;
|
||||||
|
|
||||||
|
@TableField(value = "p_2")
|
||||||
|
private Double p2;
|
||||||
|
|
||||||
|
@TableField(value = "p_3")
|
||||||
|
private Double p3;
|
||||||
|
|
||||||
|
@TableField(value = "p_4")
|
||||||
|
private Double p4;
|
||||||
|
|
||||||
|
@TableField(value = "p_5")
|
||||||
|
private Double p5;
|
||||||
|
|
||||||
|
@TableField(value = "p_6")
|
||||||
|
private Double p6;
|
||||||
|
|
||||||
|
@TableField(value = "p_7")
|
||||||
|
private Double p7;
|
||||||
|
|
||||||
|
@TableField(value = "p_8")
|
||||||
|
private Double p8;
|
||||||
|
|
||||||
|
@TableField(value = "p_9")
|
||||||
|
private Double p9;
|
||||||
|
|
||||||
|
@TableField(value = "p_10")
|
||||||
|
private Double p10;
|
||||||
|
|
||||||
|
@TableField(value = "p_11")
|
||||||
|
private Double p11;
|
||||||
|
|
||||||
|
@TableField(value = "p_12")
|
||||||
|
private Double p12;
|
||||||
|
|
||||||
|
@TableField(value = "p_13")
|
||||||
|
private Double p13;
|
||||||
|
|
||||||
|
@TableField(value = "p_14")
|
||||||
|
private Double p14;
|
||||||
|
|
||||||
|
@TableField(value = "p_15")
|
||||||
|
private Double p15;
|
||||||
|
|
||||||
|
@TableField(value = "p_16")
|
||||||
|
private Double p16;
|
||||||
|
|
||||||
|
@TableField(value = "p_17")
|
||||||
|
private Double p17;
|
||||||
|
|
||||||
|
@TableField(value = "p_18")
|
||||||
|
private Double p18;
|
||||||
|
|
||||||
|
@TableField(value = "p_19")
|
||||||
|
private Double p19;
|
||||||
|
|
||||||
|
@TableField(value = "p_20")
|
||||||
|
private Double p20;
|
||||||
|
|
||||||
|
@TableField(value = "p_21")
|
||||||
|
private Double p21;
|
||||||
|
|
||||||
|
@TableField(value = "p_22")
|
||||||
|
private Double p22;
|
||||||
|
|
||||||
|
@TableField(value = "p_23")
|
||||||
|
private Double p23;
|
||||||
|
|
||||||
|
@TableField(value = "p_24")
|
||||||
|
private Double p24;
|
||||||
|
|
||||||
|
@TableField(value = "p_25")
|
||||||
|
private Double p25;
|
||||||
|
|
||||||
|
@TableField(value = "p_26")
|
||||||
|
private Double p26;
|
||||||
|
|
||||||
|
@TableField(value = "p_27")
|
||||||
|
private Double p27;
|
||||||
|
|
||||||
|
@TableField(value = "p_28")
|
||||||
|
private Double p28;
|
||||||
|
|
||||||
|
@TableField(value = "p_29")
|
||||||
|
private Double p29;
|
||||||
|
|
||||||
|
@TableField(value = "p_30")
|
||||||
|
private Double p30;
|
||||||
|
|
||||||
|
@TableField(value = "p_31")
|
||||||
|
private Double p31;
|
||||||
|
|
||||||
|
@TableField(value = "p_32")
|
||||||
|
private Double p32;
|
||||||
|
|
||||||
|
@TableField(value = "p_33")
|
||||||
|
private Double p33;
|
||||||
|
|
||||||
|
@TableField(value = "p_34")
|
||||||
|
private Double p34;
|
||||||
|
|
||||||
|
@TableField(value = "p_35")
|
||||||
|
private Double p35;
|
||||||
|
|
||||||
|
@TableField(value = "p_36")
|
||||||
|
private Double p36;
|
||||||
|
|
||||||
|
@TableField(value = "p_37")
|
||||||
|
private Double p37;
|
||||||
|
|
||||||
|
@TableField(value = "p_38")
|
||||||
|
private Double p38;
|
||||||
|
|
||||||
|
@TableField(value = "p_39")
|
||||||
|
private Double p39;
|
||||||
|
|
||||||
|
@TableField(value = "p_40")
|
||||||
|
private Double p40;
|
||||||
|
|
||||||
|
@TableField(value = "p_41")
|
||||||
|
private Double p41;
|
||||||
|
|
||||||
|
@TableField(value = "p_42")
|
||||||
|
private Double p42;
|
||||||
|
|
||||||
|
@TableField(value = "p_43")
|
||||||
|
private Double p43;
|
||||||
|
|
||||||
|
@TableField(value = "p_44")
|
||||||
|
private Double p44;
|
||||||
|
|
||||||
|
@TableField(value = "p_45")
|
||||||
|
private Double p45;
|
||||||
|
|
||||||
|
@TableField(value = "p_46")
|
||||||
|
private Double p46;
|
||||||
|
|
||||||
|
@TableField(value = "p_47")
|
||||||
|
private Double p47;
|
||||||
|
|
||||||
|
@TableField(value = "p_48")
|
||||||
|
private Double p48;
|
||||||
|
|
||||||
|
@TableField(value = "p_49")
|
||||||
|
private Double p49;
|
||||||
|
|
||||||
|
@TableField(value = "p_50")
|
||||||
|
private Double p50;
|
||||||
|
}
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
package com.njcn.csreport.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.lang.Double;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/13 14:29【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "r_stat_data_harmpower_q_d")
|
||||||
|
public class RStatDataHarmpowerQD {
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time")
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "phasic_type")
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(value = "quality_flag")
|
||||||
|
private Integer qualityFlag;
|
||||||
|
|
||||||
|
@TableField(value = "q")
|
||||||
|
private Double q;
|
||||||
|
|
||||||
|
@TableField(value = "q_1")
|
||||||
|
private Double q1;
|
||||||
|
|
||||||
|
@TableField(value = "q_2")
|
||||||
|
private Double q2;
|
||||||
|
|
||||||
|
@TableField(value = "q_3")
|
||||||
|
private Double q3;
|
||||||
|
|
||||||
|
@TableField(value = "q_4")
|
||||||
|
private Double q4;
|
||||||
|
|
||||||
|
@TableField(value = "q_5")
|
||||||
|
private Double q5;
|
||||||
|
|
||||||
|
@TableField(value = "q_6")
|
||||||
|
private Double q6;
|
||||||
|
|
||||||
|
@TableField(value = "q_7")
|
||||||
|
private Double q7;
|
||||||
|
|
||||||
|
@TableField(value = "q_8")
|
||||||
|
private Double q8;
|
||||||
|
|
||||||
|
@TableField(value = "q_9")
|
||||||
|
private Double q9;
|
||||||
|
|
||||||
|
@TableField(value = "q_10")
|
||||||
|
private Double q10;
|
||||||
|
|
||||||
|
@TableField(value = "q_11")
|
||||||
|
private Double q11;
|
||||||
|
|
||||||
|
@TableField(value = "q_12")
|
||||||
|
private Double q12;
|
||||||
|
|
||||||
|
@TableField(value = "q_13")
|
||||||
|
private Double q13;
|
||||||
|
|
||||||
|
@TableField(value = "q_14")
|
||||||
|
private Double q14;
|
||||||
|
|
||||||
|
@TableField(value = "q_15")
|
||||||
|
private Double q15;
|
||||||
|
|
||||||
|
@TableField(value = "q_16")
|
||||||
|
private Double q16;
|
||||||
|
|
||||||
|
@TableField(value = "q_17")
|
||||||
|
private Double q17;
|
||||||
|
|
||||||
|
@TableField(value = "q_18")
|
||||||
|
private Double q18;
|
||||||
|
|
||||||
|
@TableField(value = "q_19")
|
||||||
|
private Double q19;
|
||||||
|
|
||||||
|
@TableField(value = "q_20")
|
||||||
|
private Double q20;
|
||||||
|
|
||||||
|
@TableField(value = "q_21")
|
||||||
|
private Double q21;
|
||||||
|
|
||||||
|
@TableField(value = "q_22")
|
||||||
|
private Double q22;
|
||||||
|
|
||||||
|
@TableField(value = "q_23")
|
||||||
|
private Double q23;
|
||||||
|
|
||||||
|
@TableField(value = "q_24")
|
||||||
|
private Double q24;
|
||||||
|
|
||||||
|
@TableField(value = "q_25")
|
||||||
|
private Double q25;
|
||||||
|
|
||||||
|
@TableField(value = "q_26")
|
||||||
|
private Double q26;
|
||||||
|
|
||||||
|
@TableField(value = "q_27")
|
||||||
|
private Double q27;
|
||||||
|
|
||||||
|
@TableField(value = "q_28")
|
||||||
|
private Double q28;
|
||||||
|
|
||||||
|
@TableField(value = "q_29")
|
||||||
|
private Double q29;
|
||||||
|
|
||||||
|
@TableField(value = "q_30")
|
||||||
|
private Double q30;
|
||||||
|
|
||||||
|
@TableField(value = "q_31")
|
||||||
|
private Double q31;
|
||||||
|
|
||||||
|
@TableField(value = "q_32")
|
||||||
|
private Double q32;
|
||||||
|
|
||||||
|
@TableField(value = "q_33")
|
||||||
|
private Double q33;
|
||||||
|
|
||||||
|
@TableField(value = "q_34")
|
||||||
|
private Double q34;
|
||||||
|
|
||||||
|
@TableField(value = "q_35")
|
||||||
|
private Double q35;
|
||||||
|
|
||||||
|
@TableField(value = "q_36")
|
||||||
|
private Double q36;
|
||||||
|
|
||||||
|
@TableField(value = "q_37")
|
||||||
|
private Double q37;
|
||||||
|
|
||||||
|
@TableField(value = "q_38")
|
||||||
|
private Double q38;
|
||||||
|
|
||||||
|
@TableField(value = "q_39")
|
||||||
|
private Double q39;
|
||||||
|
|
||||||
|
@TableField(value = "q_40")
|
||||||
|
private Double q40;
|
||||||
|
|
||||||
|
@TableField(value = "q_41")
|
||||||
|
private Double q41;
|
||||||
|
|
||||||
|
@TableField(value = "q_42")
|
||||||
|
private Double q42;
|
||||||
|
|
||||||
|
@TableField(value = "q_43")
|
||||||
|
private Double q43;
|
||||||
|
|
||||||
|
@TableField(value = "q_44")
|
||||||
|
private Double q44;
|
||||||
|
|
||||||
|
@TableField(value = "q_45")
|
||||||
|
private Double q45;
|
||||||
|
|
||||||
|
@TableField(value = "q_46")
|
||||||
|
private Double q46;
|
||||||
|
|
||||||
|
@TableField(value = "q_47")
|
||||||
|
private Double q47;
|
||||||
|
|
||||||
|
@TableField(value = "q_48")
|
||||||
|
private Double q48;
|
||||||
|
|
||||||
|
@TableField(value = "q_49")
|
||||||
|
private Double q49;
|
||||||
|
|
||||||
|
@TableField(value = "q_50")
|
||||||
|
private Double q50;
|
||||||
|
}
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
package com.njcn.csreport.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.lang.Double;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/13 14:29【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "r_stat_data_harmpower_s_d")
|
||||||
|
public class RStatDataHarmpowerSD {
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time")
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "phasic_type")
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(value = "quality_flag")
|
||||||
|
private Integer qualityFlag;
|
||||||
|
|
||||||
|
@TableField(value = "s")
|
||||||
|
private Double s;
|
||||||
|
|
||||||
|
@TableField(value = "s_1")
|
||||||
|
private Double s1;
|
||||||
|
|
||||||
|
@TableField(value = "s_2")
|
||||||
|
private Double s2;
|
||||||
|
|
||||||
|
@TableField(value = "s_3")
|
||||||
|
private Double s3;
|
||||||
|
|
||||||
|
@TableField(value = "s_4")
|
||||||
|
private Double s4;
|
||||||
|
|
||||||
|
@TableField(value = "s_5")
|
||||||
|
private Double s5;
|
||||||
|
|
||||||
|
@TableField(value = "s_6")
|
||||||
|
private Double s6;
|
||||||
|
|
||||||
|
@TableField(value = "s_7")
|
||||||
|
private Double s7;
|
||||||
|
|
||||||
|
@TableField(value = "s_8")
|
||||||
|
private Double s8;
|
||||||
|
|
||||||
|
@TableField(value = "s_9")
|
||||||
|
private Double s9;
|
||||||
|
|
||||||
|
@TableField(value = "s_10")
|
||||||
|
private Double s10;
|
||||||
|
|
||||||
|
@TableField(value = "s_11")
|
||||||
|
private Double s11;
|
||||||
|
|
||||||
|
@TableField(value = "s_12")
|
||||||
|
private Double s12;
|
||||||
|
|
||||||
|
@TableField(value = "s_13")
|
||||||
|
private Double s13;
|
||||||
|
|
||||||
|
@TableField(value = "s_14")
|
||||||
|
private Double s14;
|
||||||
|
|
||||||
|
@TableField(value = "s_15")
|
||||||
|
private Double s15;
|
||||||
|
|
||||||
|
@TableField(value = "s_16")
|
||||||
|
private Double s16;
|
||||||
|
|
||||||
|
@TableField(value = "s_17")
|
||||||
|
private Double s17;
|
||||||
|
|
||||||
|
@TableField(value = "s_18")
|
||||||
|
private Double s18;
|
||||||
|
|
||||||
|
@TableField(value = "s_19")
|
||||||
|
private Double s19;
|
||||||
|
|
||||||
|
@TableField(value = "s_20")
|
||||||
|
private Double s20;
|
||||||
|
|
||||||
|
@TableField(value = "s_21")
|
||||||
|
private Double s21;
|
||||||
|
|
||||||
|
@TableField(value = "s_22")
|
||||||
|
private Double s22;
|
||||||
|
|
||||||
|
@TableField(value = "s_23")
|
||||||
|
private Double s23;
|
||||||
|
|
||||||
|
@TableField(value = "s_24")
|
||||||
|
private Double s24;
|
||||||
|
|
||||||
|
@TableField(value = "s_25")
|
||||||
|
private Double s25;
|
||||||
|
|
||||||
|
@TableField(value = "s_26")
|
||||||
|
private Double s26;
|
||||||
|
|
||||||
|
@TableField(value = "s_27")
|
||||||
|
private Double s27;
|
||||||
|
|
||||||
|
@TableField(value = "s_28")
|
||||||
|
private Double s28;
|
||||||
|
|
||||||
|
@TableField(value = "s_29")
|
||||||
|
private Double s29;
|
||||||
|
|
||||||
|
@TableField(value = "s_30")
|
||||||
|
private Double s30;
|
||||||
|
|
||||||
|
@TableField(value = "s_31")
|
||||||
|
private Double s31;
|
||||||
|
|
||||||
|
@TableField(value = "s_32")
|
||||||
|
private Double s32;
|
||||||
|
|
||||||
|
@TableField(value = "s_33")
|
||||||
|
private Double s33;
|
||||||
|
|
||||||
|
@TableField(value = "s_34")
|
||||||
|
private Double s34;
|
||||||
|
|
||||||
|
@TableField(value = "s_35")
|
||||||
|
private Double s35;
|
||||||
|
|
||||||
|
@TableField(value = "s_36")
|
||||||
|
private Double s36;
|
||||||
|
|
||||||
|
@TableField(value = "s_37")
|
||||||
|
private Double s37;
|
||||||
|
|
||||||
|
@TableField(value = "s_38")
|
||||||
|
private Double s38;
|
||||||
|
|
||||||
|
@TableField(value = "s_39")
|
||||||
|
private Double s39;
|
||||||
|
|
||||||
|
@TableField(value = "s_40")
|
||||||
|
private Double s40;
|
||||||
|
|
||||||
|
@TableField(value = "s_41")
|
||||||
|
private Double s41;
|
||||||
|
|
||||||
|
@TableField(value = "s_42")
|
||||||
|
private Double s42;
|
||||||
|
|
||||||
|
@TableField(value = "s_43")
|
||||||
|
private Double s43;
|
||||||
|
|
||||||
|
@TableField(value = "s_44")
|
||||||
|
private Double s44;
|
||||||
|
|
||||||
|
@TableField(value = "s_45")
|
||||||
|
private Double s45;
|
||||||
|
|
||||||
|
@TableField(value = "s_46")
|
||||||
|
private Double s46;
|
||||||
|
|
||||||
|
@TableField(value = "s_47")
|
||||||
|
private Double s47;
|
||||||
|
|
||||||
|
@TableField(value = "s_48")
|
||||||
|
private Double s48;
|
||||||
|
|
||||||
|
@TableField(value = "s_49")
|
||||||
|
private Double s49;
|
||||||
|
|
||||||
|
@TableField(value = "s_50")
|
||||||
|
private Double s50;
|
||||||
|
}
|
||||||
@@ -0,0 +1,207 @@
|
|||||||
|
package com.njcn.csreport.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.lang.Double;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/13 14:29【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "r_stat_data_harmrate_i_d")
|
||||||
|
public class RStatDataHarmrateID {
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time")
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "phasic_type")
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@TableField(value = "quality_flag")
|
||||||
|
private Integer qualityFlag;
|
||||||
|
|
||||||
|
@TableField(value = "i_1")
|
||||||
|
private Double i1;
|
||||||
|
|
||||||
|
@TableField(value = "i_2")
|
||||||
|
private Double i2;
|
||||||
|
|
||||||
|
@TableField(value = "i_3")
|
||||||
|
private Double i3;
|
||||||
|
|
||||||
|
@TableField(value = "i_4")
|
||||||
|
private Double i4;
|
||||||
|
|
||||||
|
@TableField(value = "i_5")
|
||||||
|
private Double i5;
|
||||||
|
|
||||||
|
@TableField(value = "i_6")
|
||||||
|
private Double i6;
|
||||||
|
|
||||||
|
@TableField(value = "i_7")
|
||||||
|
private Double i7;
|
||||||
|
|
||||||
|
@TableField(value = "i_8")
|
||||||
|
private Double i8;
|
||||||
|
|
||||||
|
@TableField(value = "i_9")
|
||||||
|
private Double i9;
|
||||||
|
|
||||||
|
@TableField(value = "i_10")
|
||||||
|
private Double i10;
|
||||||
|
|
||||||
|
@TableField(value = "i_11")
|
||||||
|
private Double i11;
|
||||||
|
|
||||||
|
@TableField(value = "i_12")
|
||||||
|
private Double i12;
|
||||||
|
|
||||||
|
@TableField(value = "i_13")
|
||||||
|
private Double i13;
|
||||||
|
|
||||||
|
@TableField(value = "i_14")
|
||||||
|
private Double i14;
|
||||||
|
|
||||||
|
@TableField(value = "i_15")
|
||||||
|
private Double i15;
|
||||||
|
|
||||||
|
@TableField(value = "i_16")
|
||||||
|
private Double i16;
|
||||||
|
|
||||||
|
@TableField(value = "i_17")
|
||||||
|
private Double i17;
|
||||||
|
|
||||||
|
@TableField(value = "i_18")
|
||||||
|
private Double i18;
|
||||||
|
|
||||||
|
@TableField(value = "i_19")
|
||||||
|
private Double i19;
|
||||||
|
|
||||||
|
@TableField(value = "i_20")
|
||||||
|
private Double i20;
|
||||||
|
|
||||||
|
@TableField(value = "i_21")
|
||||||
|
private Double i21;
|
||||||
|
|
||||||
|
@TableField(value = "i_22")
|
||||||
|
private Double i22;
|
||||||
|
|
||||||
|
@TableField(value = "i_23")
|
||||||
|
private Double i23;
|
||||||
|
|
||||||
|
@TableField(value = "i_24")
|
||||||
|
private Double i24;
|
||||||
|
|
||||||
|
@TableField(value = "i_25")
|
||||||
|
private Double i25;
|
||||||
|
|
||||||
|
@TableField(value = "i_26")
|
||||||
|
private Double i26;
|
||||||
|
|
||||||
|
@TableField(value = "i_27")
|
||||||
|
private Double i27;
|
||||||
|
|
||||||
|
@TableField(value = "i_28")
|
||||||
|
private Double i28;
|
||||||
|
|
||||||
|
@TableField(value = "i_29")
|
||||||
|
private Double i29;
|
||||||
|
|
||||||
|
@TableField(value = "i_30")
|
||||||
|
private Double i30;
|
||||||
|
|
||||||
|
@TableField(value = "i_31")
|
||||||
|
private Double i31;
|
||||||
|
|
||||||
|
@TableField(value = "i_32")
|
||||||
|
private Double i32;
|
||||||
|
|
||||||
|
@TableField(value = "i_33")
|
||||||
|
private Double i33;
|
||||||
|
|
||||||
|
@TableField(value = "i_34")
|
||||||
|
private Double i34;
|
||||||
|
|
||||||
|
@TableField(value = "i_35")
|
||||||
|
private Double i35;
|
||||||
|
|
||||||
|
@TableField(value = "i_36")
|
||||||
|
private Double i36;
|
||||||
|
|
||||||
|
@TableField(value = "i_37")
|
||||||
|
private Double i37;
|
||||||
|
|
||||||
|
@TableField(value = "i_38")
|
||||||
|
private Double i38;
|
||||||
|
|
||||||
|
@TableField(value = "i_39")
|
||||||
|
private Double i39;
|
||||||
|
|
||||||
|
@TableField(value = "i_40")
|
||||||
|
private Double i40;
|
||||||
|
|
||||||
|
@TableField(value = "i_41")
|
||||||
|
private Double i41;
|
||||||
|
|
||||||
|
@TableField(value = "i_42")
|
||||||
|
private Double i42;
|
||||||
|
|
||||||
|
@TableField(value = "i_43")
|
||||||
|
private Double i43;
|
||||||
|
|
||||||
|
@TableField(value = "i_44")
|
||||||
|
private Double i44;
|
||||||
|
|
||||||
|
@TableField(value = "i_45")
|
||||||
|
private Double i45;
|
||||||
|
|
||||||
|
@TableField(value = "i_46")
|
||||||
|
private Double i46;
|
||||||
|
|
||||||
|
@TableField(value = "i_47")
|
||||||
|
private Double i47;
|
||||||
|
|
||||||
|
@TableField(value = "i_48")
|
||||||
|
private Double i48;
|
||||||
|
|
||||||
|
@TableField(value = "i_49")
|
||||||
|
private Double i49;
|
||||||
|
|
||||||
|
@TableField(value = "i_50")
|
||||||
|
private Double i50;
|
||||||
|
}
|
||||||
@@ -0,0 +1,207 @@
|
|||||||
|
package com.njcn.csreport.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.lang.Double;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/13 14:29【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "r_stat_data_harmrate_v_d")
|
||||||
|
public class RStatDataHarmrateVD {
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time")
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "phasic_type")
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@TableField(value = "quality_flag")
|
||||||
|
private Integer qualityFlag;
|
||||||
|
|
||||||
|
@TableField(value = "v_1")
|
||||||
|
private Double v1;
|
||||||
|
|
||||||
|
@TableField(value = "v_2")
|
||||||
|
private Double v2;
|
||||||
|
|
||||||
|
@TableField(value = "v_3")
|
||||||
|
private Double v3;
|
||||||
|
|
||||||
|
@TableField(value = "v_4")
|
||||||
|
private Double v4;
|
||||||
|
|
||||||
|
@TableField(value = "v_5")
|
||||||
|
private Double v5;
|
||||||
|
|
||||||
|
@TableField(value = "v_6")
|
||||||
|
private Double v6;
|
||||||
|
|
||||||
|
@TableField(value = "v_7")
|
||||||
|
private Double v7;
|
||||||
|
|
||||||
|
@TableField(value = "v_8")
|
||||||
|
private Double v8;
|
||||||
|
|
||||||
|
@TableField(value = "v_9")
|
||||||
|
private Double v9;
|
||||||
|
|
||||||
|
@TableField(value = "v_10")
|
||||||
|
private Double v10;
|
||||||
|
|
||||||
|
@TableField(value = "v_11")
|
||||||
|
private Double v11;
|
||||||
|
|
||||||
|
@TableField(value = "v_12")
|
||||||
|
private Double v12;
|
||||||
|
|
||||||
|
@TableField(value = "v_13")
|
||||||
|
private Double v13;
|
||||||
|
|
||||||
|
@TableField(value = "v_14")
|
||||||
|
private Double v14;
|
||||||
|
|
||||||
|
@TableField(value = "v_15")
|
||||||
|
private Double v15;
|
||||||
|
|
||||||
|
@TableField(value = "v_16")
|
||||||
|
private Double v16;
|
||||||
|
|
||||||
|
@TableField(value = "v_17")
|
||||||
|
private Double v17;
|
||||||
|
|
||||||
|
@TableField(value = "v_18")
|
||||||
|
private Double v18;
|
||||||
|
|
||||||
|
@TableField(value = "v_19")
|
||||||
|
private Double v19;
|
||||||
|
|
||||||
|
@TableField(value = "v_20")
|
||||||
|
private Double v20;
|
||||||
|
|
||||||
|
@TableField(value = "v_21")
|
||||||
|
private Double v21;
|
||||||
|
|
||||||
|
@TableField(value = "v_22")
|
||||||
|
private Double v22;
|
||||||
|
|
||||||
|
@TableField(value = "v_23")
|
||||||
|
private Double v23;
|
||||||
|
|
||||||
|
@TableField(value = "v_24")
|
||||||
|
private Double v24;
|
||||||
|
|
||||||
|
@TableField(value = "v_25")
|
||||||
|
private Double v25;
|
||||||
|
|
||||||
|
@TableField(value = "v_26")
|
||||||
|
private Double v26;
|
||||||
|
|
||||||
|
@TableField(value = "v_27")
|
||||||
|
private Double v27;
|
||||||
|
|
||||||
|
@TableField(value = "v_28")
|
||||||
|
private Double v28;
|
||||||
|
|
||||||
|
@TableField(value = "v_29")
|
||||||
|
private Double v29;
|
||||||
|
|
||||||
|
@TableField(value = "v_30")
|
||||||
|
private Double v30;
|
||||||
|
|
||||||
|
@TableField(value = "v_31")
|
||||||
|
private Double v31;
|
||||||
|
|
||||||
|
@TableField(value = "v_32")
|
||||||
|
private Double v32;
|
||||||
|
|
||||||
|
@TableField(value = "v_33")
|
||||||
|
private Double v33;
|
||||||
|
|
||||||
|
@TableField(value = "v_34")
|
||||||
|
private Double v34;
|
||||||
|
|
||||||
|
@TableField(value = "v_35")
|
||||||
|
private Double v35;
|
||||||
|
|
||||||
|
@TableField(value = "v_36")
|
||||||
|
private Double v36;
|
||||||
|
|
||||||
|
@TableField(value = "v_37")
|
||||||
|
private Double v37;
|
||||||
|
|
||||||
|
@TableField(value = "v_38")
|
||||||
|
private Double v38;
|
||||||
|
|
||||||
|
@TableField(value = "v_39")
|
||||||
|
private Double v39;
|
||||||
|
|
||||||
|
@TableField(value = "v_40")
|
||||||
|
private Double v40;
|
||||||
|
|
||||||
|
@TableField(value = "v_41")
|
||||||
|
private Double v41;
|
||||||
|
|
||||||
|
@TableField(value = "v_42")
|
||||||
|
private Double v42;
|
||||||
|
|
||||||
|
@TableField(value = "v_43")
|
||||||
|
private Double v43;
|
||||||
|
|
||||||
|
@TableField(value = "v_44")
|
||||||
|
private Double v44;
|
||||||
|
|
||||||
|
@TableField(value = "v_45")
|
||||||
|
private Double v45;
|
||||||
|
|
||||||
|
@TableField(value = "v_46")
|
||||||
|
private Double v46;
|
||||||
|
|
||||||
|
@TableField(value = "v_47")
|
||||||
|
private Double v47;
|
||||||
|
|
||||||
|
@TableField(value = "v_48")
|
||||||
|
private Double v48;
|
||||||
|
|
||||||
|
@TableField(value = "v_49")
|
||||||
|
private Double v49;
|
||||||
|
|
||||||
|
@TableField(value = "v_50")
|
||||||
|
private Double v50;
|
||||||
|
}
|
||||||
@@ -0,0 +1,226 @@
|
|||||||
|
package com.njcn.csreport.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.lang.Double;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/13 14:29【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "r_stat_data_i_d")
|
||||||
|
public class RStatDataID {
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time")
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "phasic_type")
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(value = "quality_flag")
|
||||||
|
private Integer qualityFlag;
|
||||||
|
|
||||||
|
@TableField(value = "i_neg")
|
||||||
|
private Double iNeg;
|
||||||
|
|
||||||
|
@TableField(value = "i_pos")
|
||||||
|
private Double iPos;
|
||||||
|
|
||||||
|
@TableField(value = "i_thd")
|
||||||
|
private Double iThd;
|
||||||
|
|
||||||
|
@TableField(value = "i_unbalance")
|
||||||
|
private Double iUnbalance;
|
||||||
|
|
||||||
|
@TableField(value = "i_zero")
|
||||||
|
private Double iZero;
|
||||||
|
|
||||||
|
@TableField(value = "rms")
|
||||||
|
private Double rms;
|
||||||
|
|
||||||
|
@TableField(value = "i_1")
|
||||||
|
private Double i1;
|
||||||
|
|
||||||
|
@TableField(value = "i_2")
|
||||||
|
private Double i2;
|
||||||
|
|
||||||
|
@TableField(value = "i_3")
|
||||||
|
private Double i3;
|
||||||
|
|
||||||
|
@TableField(value = "i_4")
|
||||||
|
private Double i4;
|
||||||
|
|
||||||
|
@TableField(value = "i_5")
|
||||||
|
private Double i5;
|
||||||
|
|
||||||
|
@TableField(value = "i_6")
|
||||||
|
private Double i6;
|
||||||
|
|
||||||
|
@TableField(value = "i_7")
|
||||||
|
private Double i7;
|
||||||
|
|
||||||
|
@TableField(value = "i_8")
|
||||||
|
private Double i8;
|
||||||
|
|
||||||
|
@TableField(value = "i_9")
|
||||||
|
private Double i9;
|
||||||
|
|
||||||
|
@TableField(value = "i_10")
|
||||||
|
private Double i10;
|
||||||
|
|
||||||
|
@TableField(value = "i_11")
|
||||||
|
private Double i11;
|
||||||
|
|
||||||
|
@TableField(value = "i_12")
|
||||||
|
private Double i12;
|
||||||
|
|
||||||
|
@TableField(value = "i_13")
|
||||||
|
private Double i13;
|
||||||
|
|
||||||
|
@TableField(value = "i_14")
|
||||||
|
private Double i14;
|
||||||
|
|
||||||
|
@TableField(value = "i_15")
|
||||||
|
private Double i15;
|
||||||
|
|
||||||
|
@TableField(value = "i_16")
|
||||||
|
private Double i16;
|
||||||
|
|
||||||
|
@TableField(value = "i_17")
|
||||||
|
private Double i17;
|
||||||
|
|
||||||
|
@TableField(value = "i_18")
|
||||||
|
private Double i18;
|
||||||
|
|
||||||
|
@TableField(value = "i_19")
|
||||||
|
private Double i19;
|
||||||
|
|
||||||
|
@TableField(value = "i_20")
|
||||||
|
private Double i20;
|
||||||
|
|
||||||
|
@TableField(value = "i_21")
|
||||||
|
private Double i21;
|
||||||
|
|
||||||
|
@TableField(value = "i_22")
|
||||||
|
private Double i22;
|
||||||
|
|
||||||
|
@TableField(value = "i_23")
|
||||||
|
private Double i23;
|
||||||
|
|
||||||
|
@TableField(value = "i_24")
|
||||||
|
private Double i24;
|
||||||
|
|
||||||
|
@TableField(value = "i_25")
|
||||||
|
private Double i25;
|
||||||
|
|
||||||
|
@TableField(value = "i_26")
|
||||||
|
private Double i26;
|
||||||
|
|
||||||
|
@TableField(value = "i_27")
|
||||||
|
private Double i27;
|
||||||
|
|
||||||
|
@TableField(value = "i_28")
|
||||||
|
private Double i28;
|
||||||
|
|
||||||
|
@TableField(value = "i_29")
|
||||||
|
private Double i29;
|
||||||
|
|
||||||
|
@TableField(value = "i_30")
|
||||||
|
private Double i30;
|
||||||
|
|
||||||
|
@TableField(value = "i_31")
|
||||||
|
private Double i31;
|
||||||
|
|
||||||
|
@TableField(value = "i_32")
|
||||||
|
private Double i32;
|
||||||
|
|
||||||
|
@TableField(value = "i_33")
|
||||||
|
private Double i33;
|
||||||
|
|
||||||
|
@TableField(value = "i_34")
|
||||||
|
private Double i34;
|
||||||
|
|
||||||
|
@TableField(value = "i_35")
|
||||||
|
private Double i35;
|
||||||
|
|
||||||
|
@TableField(value = "i_36")
|
||||||
|
private Double i36;
|
||||||
|
|
||||||
|
@TableField(value = "i_37")
|
||||||
|
private Double i37;
|
||||||
|
|
||||||
|
@TableField(value = "i_38")
|
||||||
|
private Double i38;
|
||||||
|
|
||||||
|
@TableField(value = "i_39")
|
||||||
|
private Double i39;
|
||||||
|
|
||||||
|
@TableField(value = "i_40")
|
||||||
|
private Double i40;
|
||||||
|
|
||||||
|
@TableField(value = "i_41")
|
||||||
|
private Double i41;
|
||||||
|
|
||||||
|
@TableField(value = "i_42")
|
||||||
|
private Double i42;
|
||||||
|
|
||||||
|
@TableField(value = "i_43")
|
||||||
|
private Double i43;
|
||||||
|
|
||||||
|
@TableField(value = "i_44")
|
||||||
|
private Double i44;
|
||||||
|
|
||||||
|
@TableField(value = "i_45")
|
||||||
|
private Double i45;
|
||||||
|
|
||||||
|
@TableField(value = "i_46")
|
||||||
|
private Double i46;
|
||||||
|
|
||||||
|
@TableField(value = "i_47")
|
||||||
|
private Double i47;
|
||||||
|
|
||||||
|
@TableField(value = "i_48")
|
||||||
|
private Double i48;
|
||||||
|
|
||||||
|
@TableField(value = "i_49")
|
||||||
|
private Double i49;
|
||||||
|
|
||||||
|
@TableField(value = "i_50")
|
||||||
|
private Double i50;
|
||||||
|
}
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
package com.njcn.csreport.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.lang.Double;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/13 14:30【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "r_stat_data_inharm_i_d")
|
||||||
|
public class RStatDataInharmID {
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time")
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "phasic_type")
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(value = "quality_flag")
|
||||||
|
private Integer qualityFlag;
|
||||||
|
|
||||||
|
@TableField(value = "i_1")
|
||||||
|
private Double i1;
|
||||||
|
|
||||||
|
@TableField(value = "i_2")
|
||||||
|
private Double i2;
|
||||||
|
|
||||||
|
@TableField(value = "i_3")
|
||||||
|
private Double i3;
|
||||||
|
|
||||||
|
@TableField(value = "i_4")
|
||||||
|
private Double i4;
|
||||||
|
|
||||||
|
@TableField(value = "i_5")
|
||||||
|
private Double i5;
|
||||||
|
|
||||||
|
@TableField(value = "i_6")
|
||||||
|
private Double i6;
|
||||||
|
|
||||||
|
@TableField(value = "i_7")
|
||||||
|
private Double i7;
|
||||||
|
|
||||||
|
@TableField(value = "i_8")
|
||||||
|
private Double i8;
|
||||||
|
|
||||||
|
@TableField(value = "i_9")
|
||||||
|
private Double i9;
|
||||||
|
|
||||||
|
@TableField(value = "i_10")
|
||||||
|
private Double i10;
|
||||||
|
|
||||||
|
@TableField(value = "i_11")
|
||||||
|
private Double i11;
|
||||||
|
|
||||||
|
@TableField(value = "i_12")
|
||||||
|
private Double i12;
|
||||||
|
|
||||||
|
@TableField(value = "i_13")
|
||||||
|
private Double i13;
|
||||||
|
|
||||||
|
@TableField(value = "i_14")
|
||||||
|
private Double i14;
|
||||||
|
|
||||||
|
@TableField(value = "i_15")
|
||||||
|
private Double i15;
|
||||||
|
|
||||||
|
@TableField(value = "i_16")
|
||||||
|
private Double i16;
|
||||||
|
|
||||||
|
@TableField(value = "i_17")
|
||||||
|
private Double i17;
|
||||||
|
|
||||||
|
@TableField(value = "i_18")
|
||||||
|
private Double i18;
|
||||||
|
|
||||||
|
@TableField(value = "i_19")
|
||||||
|
private Double i19;
|
||||||
|
|
||||||
|
@TableField(value = "i_20")
|
||||||
|
private Double i20;
|
||||||
|
|
||||||
|
@TableField(value = "i_21")
|
||||||
|
private Double i21;
|
||||||
|
|
||||||
|
@TableField(value = "i_22")
|
||||||
|
private Double i22;
|
||||||
|
|
||||||
|
@TableField(value = "i_23")
|
||||||
|
private Double i23;
|
||||||
|
|
||||||
|
@TableField(value = "i_24")
|
||||||
|
private Double i24;
|
||||||
|
|
||||||
|
@TableField(value = "i_25")
|
||||||
|
private Double i25;
|
||||||
|
|
||||||
|
@TableField(value = "i_26")
|
||||||
|
private Double i26;
|
||||||
|
|
||||||
|
@TableField(value = "i_27")
|
||||||
|
private Double i27;
|
||||||
|
|
||||||
|
@TableField(value = "i_28")
|
||||||
|
private Double i28;
|
||||||
|
|
||||||
|
@TableField(value = "i_29")
|
||||||
|
private Double i29;
|
||||||
|
|
||||||
|
@TableField(value = "i_30")
|
||||||
|
private Double i30;
|
||||||
|
|
||||||
|
@TableField(value = "i_31")
|
||||||
|
private Double i31;
|
||||||
|
|
||||||
|
@TableField(value = "i_32")
|
||||||
|
private Double i32;
|
||||||
|
|
||||||
|
@TableField(value = "i_33")
|
||||||
|
private Double i33;
|
||||||
|
|
||||||
|
@TableField(value = "i_34")
|
||||||
|
private Double i34;
|
||||||
|
|
||||||
|
@TableField(value = "i_35")
|
||||||
|
private Double i35;
|
||||||
|
|
||||||
|
@TableField(value = "i_36")
|
||||||
|
private Double i36;
|
||||||
|
|
||||||
|
@TableField(value = "i_37")
|
||||||
|
private Double i37;
|
||||||
|
|
||||||
|
@TableField(value = "i_38")
|
||||||
|
private Double i38;
|
||||||
|
|
||||||
|
@TableField(value = "i_39")
|
||||||
|
private Double i39;
|
||||||
|
|
||||||
|
@TableField(value = "i_40")
|
||||||
|
private Double i40;
|
||||||
|
|
||||||
|
@TableField(value = "i_41")
|
||||||
|
private Double i41;
|
||||||
|
|
||||||
|
@TableField(value = "i_42")
|
||||||
|
private Double i42;
|
||||||
|
|
||||||
|
@TableField(value = "i_43")
|
||||||
|
private Double i43;
|
||||||
|
|
||||||
|
@TableField(value = "i_44")
|
||||||
|
private Double i44;
|
||||||
|
|
||||||
|
@TableField(value = "i_45")
|
||||||
|
private Double i45;
|
||||||
|
|
||||||
|
@TableField(value = "i_46")
|
||||||
|
private Double i46;
|
||||||
|
|
||||||
|
@TableField(value = "i_47")
|
||||||
|
private Double i47;
|
||||||
|
|
||||||
|
@TableField(value = "i_48")
|
||||||
|
private Double i48;
|
||||||
|
|
||||||
|
@TableField(value = "i_49")
|
||||||
|
private Double i49;
|
||||||
|
|
||||||
|
@TableField(value = "i_50")
|
||||||
|
private Double i50;
|
||||||
|
}
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
package com.njcn.csreport.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.lang.Double;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/13 14:30【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "r_stat_data_inharm_v_d")
|
||||||
|
public class RStatDataInharmVD {
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time")
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "phasic_type")
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(value = "quality_flag")
|
||||||
|
private Integer qualityFlag;
|
||||||
|
|
||||||
|
@TableField(value = "v_1")
|
||||||
|
private Double v1;
|
||||||
|
|
||||||
|
@TableField(value = "v_2")
|
||||||
|
private Double v2;
|
||||||
|
|
||||||
|
@TableField(value = "v_3")
|
||||||
|
private Double v3;
|
||||||
|
|
||||||
|
@TableField(value = "v_4")
|
||||||
|
private Double v4;
|
||||||
|
|
||||||
|
@TableField(value = "v_5")
|
||||||
|
private Double v5;
|
||||||
|
|
||||||
|
@TableField(value = "v_6")
|
||||||
|
private Double v6;
|
||||||
|
|
||||||
|
@TableField(value = "v_7")
|
||||||
|
private Double v7;
|
||||||
|
|
||||||
|
@TableField(value = "v_8")
|
||||||
|
private Double v8;
|
||||||
|
|
||||||
|
@TableField(value = "v_9")
|
||||||
|
private Double v9;
|
||||||
|
|
||||||
|
@TableField(value = "v_10")
|
||||||
|
private Double v10;
|
||||||
|
|
||||||
|
@TableField(value = "v_11")
|
||||||
|
private Double v11;
|
||||||
|
|
||||||
|
@TableField(value = "v_12")
|
||||||
|
private Double v12;
|
||||||
|
|
||||||
|
@TableField(value = "v_13")
|
||||||
|
private Double v13;
|
||||||
|
|
||||||
|
@TableField(value = "v_14")
|
||||||
|
private Double v14;
|
||||||
|
|
||||||
|
@TableField(value = "v_15")
|
||||||
|
private Double v15;
|
||||||
|
|
||||||
|
@TableField(value = "v_16")
|
||||||
|
private Double v16;
|
||||||
|
|
||||||
|
@TableField(value = "v_17")
|
||||||
|
private Double v17;
|
||||||
|
|
||||||
|
@TableField(value = "v_18")
|
||||||
|
private Double v18;
|
||||||
|
|
||||||
|
@TableField(value = "v_19")
|
||||||
|
private Double v19;
|
||||||
|
|
||||||
|
@TableField(value = "v_20")
|
||||||
|
private Double v20;
|
||||||
|
|
||||||
|
@TableField(value = "v_21")
|
||||||
|
private Double v21;
|
||||||
|
|
||||||
|
@TableField(value = "v_22")
|
||||||
|
private Double v22;
|
||||||
|
|
||||||
|
@TableField(value = "v_23")
|
||||||
|
private Double v23;
|
||||||
|
|
||||||
|
@TableField(value = "v_24")
|
||||||
|
private Double v24;
|
||||||
|
|
||||||
|
@TableField(value = "v_25")
|
||||||
|
private Double v25;
|
||||||
|
|
||||||
|
@TableField(value = "v_26")
|
||||||
|
private Double v26;
|
||||||
|
|
||||||
|
@TableField(value = "v_27")
|
||||||
|
private Double v27;
|
||||||
|
|
||||||
|
@TableField(value = "v_28")
|
||||||
|
private Double v28;
|
||||||
|
|
||||||
|
@TableField(value = "v_29")
|
||||||
|
private Double v29;
|
||||||
|
|
||||||
|
@TableField(value = "v_30")
|
||||||
|
private Double v30;
|
||||||
|
|
||||||
|
@TableField(value = "v_31")
|
||||||
|
private Double v31;
|
||||||
|
|
||||||
|
@TableField(value = "v_32")
|
||||||
|
private Double v32;
|
||||||
|
|
||||||
|
@TableField(value = "v_33")
|
||||||
|
private Double v33;
|
||||||
|
|
||||||
|
@TableField(value = "v_34")
|
||||||
|
private Double v34;
|
||||||
|
|
||||||
|
@TableField(value = "v_35")
|
||||||
|
private Double v35;
|
||||||
|
|
||||||
|
@TableField(value = "v_36")
|
||||||
|
private Double v36;
|
||||||
|
|
||||||
|
@TableField(value = "v_37")
|
||||||
|
private Double v37;
|
||||||
|
|
||||||
|
@TableField(value = "v_38")
|
||||||
|
private Double v38;
|
||||||
|
|
||||||
|
@TableField(value = "v_39")
|
||||||
|
private Double v39;
|
||||||
|
|
||||||
|
@TableField(value = "v_40")
|
||||||
|
private Double v40;
|
||||||
|
|
||||||
|
@TableField(value = "v_41")
|
||||||
|
private Double v41;
|
||||||
|
|
||||||
|
@TableField(value = "v_42")
|
||||||
|
private Double v42;
|
||||||
|
|
||||||
|
@TableField(value = "v_43")
|
||||||
|
private Double v43;
|
||||||
|
|
||||||
|
@TableField(value = "v_44")
|
||||||
|
private Double v44;
|
||||||
|
|
||||||
|
@TableField(value = "v_45")
|
||||||
|
private Double v45;
|
||||||
|
|
||||||
|
@TableField(value = "v_46")
|
||||||
|
private Double v46;
|
||||||
|
|
||||||
|
@TableField(value = "v_47")
|
||||||
|
private Double v47;
|
||||||
|
|
||||||
|
@TableField(value = "v_48")
|
||||||
|
private Double v48;
|
||||||
|
|
||||||
|
@TableField(value = "v_49")
|
||||||
|
private Double v49;
|
||||||
|
|
||||||
|
@TableField(value = "v_50")
|
||||||
|
private Double v50;
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.njcn.csreport.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/13 14:30【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "r_stat_data_plt_d")
|
||||||
|
public class RStatDataPltD {
|
||||||
|
/**
|
||||||
|
* 统计数据时间
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time")
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别,’A’表示A相,’B’表示B相,’C’表示C相,’T’表示总
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "phasic_type")
|
||||||
|
private String phasicType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "value_type")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(value = "quality_flag")
|
||||||
|
private Integer qualityFlag;
|
||||||
|
|
||||||
|
@TableField(value = "plt")
|
||||||
|
private Double plt;
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user