Compare commits
10 Commits
2025-10
...
0227d0731c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0227d0731c | ||
|
|
e34721c035 | ||
| 2451df7d8d | |||
| 6e5aab4791 | |||
| adb811e9df | |||
|
|
340ba18f99 | ||
|
|
e320685af1 | ||
|
|
400b9fd9c1 | ||
|
|
ce0b9892c2 | ||
| 2fb11ecaaf |
@@ -35,12 +35,6 @@
|
|||||||
<artifactId>common-microservice</artifactId>
|
<artifactId>common-microservice</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<artifactId>cs-warn-api</artifactId>
|
|
||||||
<version>1.0.0</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>user-api</artifactId>
|
<artifactId>user-api</artifactId>
|
||||||
@@ -59,6 +53,12 @@
|
|||||||
<artifactId>common-device-biz</artifactId>
|
<artifactId>common-device-biz</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.afterturn</groupId>
|
||||||
|
<artifactId>easypoi-base</artifactId>
|
||||||
|
<version>4.4.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.njcn.csdevice.api;
|
|||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.fallback.CsDeviceUserClientFallbackFactory;
|
import com.njcn.csdevice.api.fallback.CsDeviceUserClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -22,4 +23,10 @@ public interface CsDeviceUserFeignClient {
|
|||||||
|
|
||||||
@PostMapping("/findUserById")
|
@PostMapping("/findUserById")
|
||||||
HttpResult<List<String>> findUserById(@RequestParam("id") String id);
|
HttpResult<List<String>> findUserById(@RequestParam("id") String id);
|
||||||
|
|
||||||
|
@PostMapping("/findDevByUserId")
|
||||||
|
HttpResult<List<String>> findDevByUserId(@RequestParam("id") String id);
|
||||||
|
|
||||||
|
@PostMapping("/channelDevByUserId")
|
||||||
|
HttpResult<List<String>> channelDevByUserId(@RequestBody UserDevParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,5 +42,15 @@ public interface CsLedgerFeignClient {
|
|||||||
@PostMapping("/getAllLedger")
|
@PostMapping("/getAllLedger")
|
||||||
HttpResult<List<CsLedgerVO>> getAllLedger();
|
HttpResult<List<CsLedgerVO>> getAllLedger();
|
||||||
|
|
||||||
|
@PostMapping("/getInfoByIds")
|
||||||
|
HttpResult<List<DevDetailDTO>> getInfoByIds(@RequestBody @Validated List<String> list);
|
||||||
|
|
||||||
|
@PostMapping("/getDevInfoByEngineerIds")
|
||||||
|
@ApiOperation("根据工程获取设备信息")
|
||||||
|
HttpResult<List<DevDetailDTO>> getDevInfoByEngineerIds(@RequestBody @Validated List<String> list);
|
||||||
|
|
||||||
|
@PostMapping("/getEngineeringHaveDevs")
|
||||||
|
@ApiOperation("根据工程信息获取有设备的工程")
|
||||||
|
HttpResult<List<DevDetailDTO>> getEngineeringHaveDevs(@RequestBody @Validated List<String> list);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.csdevice.api.fallback.CsLineClientFallbackFactory;
|
import com.njcn.csdevice.api.fallback.CsLineClientFallbackFactory;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -48,4 +49,17 @@ public interface CsLineFeignClient {
|
|||||||
|
|
||||||
@PostMapping("/updateLineDataByList")
|
@PostMapping("/updateLineDataByList")
|
||||||
HttpResult<String> updateDataByList(@RequestParam("list") List<String> list, @RequestParam("id") String id, @RequestParam("setId") String setId);
|
HttpResult<String> updateDataByList(@RequestParam("list") List<String> list, @RequestParam("id") String id, @RequestParam("setId") String setId);
|
||||||
|
|
||||||
|
@PostMapping("/getLineByName")
|
||||||
|
HttpResult<List<CsLinePO>> getLineByName(@RequestParam("lineName") String lineName);
|
||||||
|
|
||||||
|
@PostMapping("/getAllLine")
|
||||||
|
HttpResult<List<String>> getAllLine();
|
||||||
|
|
||||||
|
@PostMapping("/getOverLimitDataByIds")
|
||||||
|
HttpResult<List<Overlimit>> getOverLimitData(@RequestBody List<String> ids);
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
HttpResult<List<CsLinePO>> list(@RequestBody CsLinePO param);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.CsDeviceUserFeignClient;
|
import com.njcn.csdevice.api.CsDeviceUserFeignClient;
|
||||||
|
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -38,6 +39,18 @@ public class CsDeviceUserClientFallbackFactory implements FallbackFactory<CsDevi
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<String>> findDevByUserId(String id) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据用户Id查询设备集合",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<String>> channelDevByUserId(UserDevParam param) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据用户Id解绑设备集合异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,24 @@ public class CsLedgerFeignClientFallbackFactory implements FallbackFactory<CsLed
|
|||||||
log.error("{}异常,降级处理,异常为:{}","获取台账树所有数据",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","获取台账树所有数据",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<DevDetailDTO>> getInfoByIds(List<String> list) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据设备集合查询工程,设备信息",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<DevDetailDTO>> getDevInfoByEngineerIds(List<String> list) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据工程获取设备信息",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<DevDetailDTO>> getEngineeringHaveDevs(List<String> list) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据工程获取设备信息",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -86,6 +87,28 @@ public class CsLineClientFallbackFactory implements FallbackFactory<CsLineFeignC
|
|||||||
log.error("{}异常,降级处理,异常为:{}","根据装置集合修改监测点信息",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","根据装置集合修改监测点信息",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<String>> getAllLine() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","获取所有监测点id",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<Overlimit>> getOverLimitData(List<String> ids) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据监测点id集合获取国标限值异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<CsLinePO>> getLineByName(String lineName) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据名称查询监测点异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<CsLinePO>> list(CsLinePO param) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","查询监测点列表异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,4 +105,27 @@ public class CsLineParam extends BaseEntity {
|
|||||||
* 运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)
|
* 运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)
|
||||||
*/
|
*/
|
||||||
private Integer runStatus;
|
private Integer runStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短路容量
|
||||||
|
*/
|
||||||
|
private Integer shortCircuitCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备容量
|
||||||
|
*/
|
||||||
|
private Integer devCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基准容量
|
||||||
|
*/
|
||||||
|
private Integer basicCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议容量
|
||||||
|
*/
|
||||||
|
private Integer protocolCapacity;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.njcn.csdevice.pojo.param;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UserDevParam implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty(value="用户id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="设备集合id")
|
||||||
|
private List<String> list;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -122,4 +122,14 @@ public class CsLinePO extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
@TableField(value = "line_no")
|
@TableField(value = "line_no")
|
||||||
private Integer lineNo;
|
private Integer lineNo;
|
||||||
}
|
/**
|
||||||
|
* 监测对象类型
|
||||||
|
*/
|
||||||
|
@TableField(value = "monitor_obj")
|
||||||
|
private String monitorObj;
|
||||||
|
/**
|
||||||
|
* 是否治理(0:未治理 1:已治理)
|
||||||
|
*/
|
||||||
|
@TableField(value = "is_govern")
|
||||||
|
private Integer govern;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.njcn.csdevice.pojo.vo;
|
package com.njcn.csdevice.pojo.vo;
|
||||||
|
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|||||||
@@ -88,11 +88,6 @@
|
|||||||
<artifactId>hutool-all</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
<version>5.8.5</version>
|
<version>5.8.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<artifactId>cs-warn-api</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- zxing生成二维码 -->
|
<!-- zxing生成二维码 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -153,12 +148,21 @@
|
|||||||
<artifactId>access-api</artifactId>
|
<artifactId>access-api</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>common-mq</artifactId>
|
<artifactId>common-mq</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<scope>compile</scope>
|
</dependency>
|
||||||
</dependency>
|
<dependency>
|
||||||
|
<groupId>org.apache.rocketmq</groupId>
|
||||||
|
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||||
|
<version>2.2.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn.platform</groupId>
|
||||||
|
<artifactId>message-api</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -12,7 +12,10 @@ import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
|||||||
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
||||||
import com.njcn.csdevice.service.ICsGroupService;
|
import com.njcn.csdevice.service.ICsGroupService;
|
||||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||||
|
import com.njcn.csharmonic.param.FittingDataQueryParam;
|
||||||
|
import com.njcn.csharmonic.param.TrendDataQueryParam;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -21,6 +24,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.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -143,5 +147,26 @@ public class CsGroupController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/trendData")
|
||||||
|
@ApiOperation("查询指标趋势图数据")
|
||||||
|
@ApiImplicitParam(name = "param",required = true)
|
||||||
|
public HttpResult<List<ThdDataVO>> trendData(@RequestBody @Validated TrendDataQueryParam param){
|
||||||
|
String methodDescribe = getMethodDescribe("trendData");
|
||||||
|
List<ThdDataVO> list = csGroupService.trendData(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/fittingData")
|
||||||
|
@ApiOperation("查询指标拟合图数据")
|
||||||
|
@ApiImplicitParam(name = "param",required = true)
|
||||||
|
public HttpResult<List<ThdDataVO>> fittingData(@RequestBody @Validated FittingDataQueryParam param){
|
||||||
|
String methodDescribe = getMethodDescribe("fittingData");
|
||||||
|
List<ThdDataVO> list = csGroupService.fittingData(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.csdevice.enums.DeviceOperate;
|
import com.njcn.csdevice.enums.DeviceOperate;
|
||||||
|
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
||||||
import com.njcn.csdevice.pojo.vo.DevUserVO;
|
import com.njcn.csdevice.pojo.vo.DevUserVO;
|
||||||
@@ -140,4 +141,24 @@ public class DeviceUserController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/findDevByUserId")
|
||||||
|
@ApiOperation("根据用户Id查询设备集合")
|
||||||
|
@ApiImplicitParam(name = "id", value = "用户id", required = true)
|
||||||
|
public HttpResult<List<String>> findDevByUserId(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("findDevByUserId");
|
||||||
|
List<String> list = csDeviceUserPOService.findDevByUserId(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/channelDevByUserId")
|
||||||
|
@ApiOperation("根据用户Id解绑设备集合")
|
||||||
|
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||||
|
public HttpResult<List<String>> channelDevByUserId(@RequestBody UserDevParam param){
|
||||||
|
String methodDescribe = getMethodDescribe("channelDevByUserId");
|
||||||
|
csDeviceUserPOService.channelDevByUserId(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -405,4 +405,14 @@ public class EquipmentDeliveryController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getRunPortableDev")
|
||||||
|
@ApiOperation("获取用户未绑定的在运的便携式设备")
|
||||||
|
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
||||||
|
public HttpResult<List<CsEquipmentDeliveryPO>> getRunPortableDev(@RequestParam("userId") String userId){
|
||||||
|
String methodDescribe = getMethodDescribe("getRunPortableDev");
|
||||||
|
List<CsEquipmentDeliveryPO> result = csEquipmentDeliveryService.getRunPortableDev(userId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -165,5 +165,35 @@ public class CsLedgerController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getInfoByIds")
|
||||||
|
@ApiOperation("根据设备集合查询工程,设备信息")
|
||||||
|
@ApiImplicitParam(name = "list", value = "查询条件", required = true)
|
||||||
|
public HttpResult<List<DevDetailDTO>> getInfoByIds(@RequestBody @Validated List<String> list){
|
||||||
|
String methodDescribe = getMethodDescribe("getInfoByIds");
|
||||||
|
List<DevDetailDTO> details = csLedgerService.getInfoByIds(list);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, details, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getDevInfoByEngineerIds")
|
||||||
|
@ApiOperation("根据工程获取设备信息")
|
||||||
|
@ApiImplicitParam(name = "list", value = "查询条件", required = true)
|
||||||
|
public HttpResult<List<DevDetailDTO>> getDevInfoByEngineerIds(@RequestBody @Validated List<String> list){
|
||||||
|
String methodDescribe = getMethodDescribe("getDevInfoByEngineerIds");
|
||||||
|
List<DevDetailDTO> details = csLedgerService.getDevInfoByEngineerIds(list);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, details, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getEngineeringHaveDevs")
|
||||||
|
@ApiOperation("根据工程信息获取有设备的工程")
|
||||||
|
@ApiImplicitParam(name = "list", value = "查询条件", required = true)
|
||||||
|
public HttpResult<List<DevDetailDTO>> getEngineeringHaveDevs(@RequestBody @Validated List<String> list){
|
||||||
|
String methodDescribe = getMethodDescribe("getEngineeringHaveDevs");
|
||||||
|
List<DevDetailDTO> details = csLedgerService.getEngineeringHaveDevs(list);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, details, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.csdevice.controller.line;
|
package com.njcn.csdevice.controller.line;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.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;
|
||||||
@@ -136,12 +137,12 @@ public class CslineController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getOverLimitData")
|
@PostMapping("/getOverLimitDataByIds")
|
||||||
@ApiOperation("根据监测点id获取国标限值")
|
@ApiOperation("根据监测点id集合获取国标限值")
|
||||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
@ApiImplicitParam(name = "ids", value = "监测点id集合", required = true)
|
||||||
public HttpResult<Overlimit> getOverLimitData(@RequestParam("id") String id) {
|
public HttpResult<List<Overlimit>> getOverLimitData(@RequestBody List<String> ids) {
|
||||||
String methodDescribe = getMethodDescribe("getOverLimitData");
|
String methodDescribe = getMethodDescribe("getOverLimitDataByIds");
|
||||||
Overlimit result = overlimitMapper.selectById(id);
|
List<Overlimit> result = overlimitMapper.selectBatchIds(ids);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,4 +221,36 @@ public class CslineController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getAllLine")
|
||||||
|
@ApiOperation("获取系统中所有监测点id")
|
||||||
|
public HttpResult<List<String>> getAllLine(){
|
||||||
|
String methodDescribe = getMethodDescribe("getAllLine");
|
||||||
|
List<String> list = csLinePOService.getAllLine();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getLineByName")
|
||||||
|
@ApiOperation("根据名称获取监测点")
|
||||||
|
@ApiImplicitParam(name = "lineName", value = "监测点名称", required = true)
|
||||||
|
public HttpResult<List<CsLinePO>> getLineByName(@RequestParam("lineName") String lineName) {
|
||||||
|
String methodDescribe = getMethodDescribe("getLineByName");
|
||||||
|
List<CsLinePO> list = csLinePOService.getLineByName(lineName);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ApiOperation("查询监测点列表")
|
||||||
|
@ApiImplicitParam(name = "param", value = "param", required = true)
|
||||||
|
public HttpResult<List<CsLinePO>> list(@RequestBody CsLinePO param) {
|
||||||
|
String methodDescribe = getMethodDescribe("list");
|
||||||
|
List<CsLinePO> list = csLinePOService.list(new LambdaQueryWrapper<CsLinePO>()
|
||||||
|
.eq(StrUtil.isNotBlank(param.getPosition()), CsLinePO::getPosition, param.getPosition())
|
||||||
|
.orderByAsc(CsLinePO::getName));
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
|||||||
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
||||||
import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
||||||
import com.njcn.csdevice.pojo.po.CsEngineeringPO;
|
import com.njcn.csdevice.pojo.po.CsEngineeringPO;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
||||||
import com.njcn.csdevice.service.CsEngineeringService;
|
import com.njcn.csdevice.service.CsEngineeringService;
|
||||||
@@ -94,4 +95,14 @@ public class EngineeringController extends BaseController {
|
|||||||
CsEngineeringPO po = csEngineeringService.queryEngineeringById(id);
|
CsEngineeringPO po = csEngineeringService.queryEngineeringById(id);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getUnlinkedEngineering")
|
||||||
|
@ApiOperation("获取用户未绑定的工程信息")
|
||||||
|
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
||||||
|
public HttpResult<List<CsEngineeringPO>> getUnlinkedEngineering(@RequestParam("userId") String userId){
|
||||||
|
String methodDescribe = getMethodDescribe("getUnlinkedEngineering");
|
||||||
|
List<CsEngineeringPO> result = csEngineeringService.getUnlinkedEngineering(userId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
from
|
from
|
||||||
cs_equipment_delivery
|
cs_equipment_delivery
|
||||||
<where>
|
<where>
|
||||||
1=1
|
dev_access_method = 'MQTT'
|
||||||
<if test="queryParam.process != null and queryParam.process !=''">
|
<if test="queryParam.process != null and queryParam.process !=''">
|
||||||
and process = #{queryParam.process}
|
and process = #{queryParam.process}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.csdevice.service;
|
package com.njcn.csdevice.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
||||||
import com.njcn.csdevice.pojo.vo.DevUserVO;
|
import com.njcn.csdevice.pojo.vo.DevUserVO;
|
||||||
@@ -48,4 +49,8 @@ public interface CsDeviceUserPOService extends IService<CsDeviceUserPO>{
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<String> findUserById(String devId);
|
List<String> findUserById(String devId);
|
||||||
|
|
||||||
|
List<String> findDevByUserId(String userId);
|
||||||
|
|
||||||
|
void channelDevByUserId(UserDevParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,4 +57,6 @@ public interface CsEngineeringService extends IService<CsEngineeringPO>{
|
|||||||
List<CsEngineeringPO> getEngineerings(List<String> list);
|
List<CsEngineeringPO> getEngineerings(List<String> list);
|
||||||
|
|
||||||
CsEngineeringPO queryEngineeringById(String id);
|
CsEngineeringPO queryEngineeringById(String id);
|
||||||
|
|
||||||
|
List<CsEngineeringPO> getUnlinkedEngineering(String userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,4 +193,6 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
|||||||
|
|
||||||
List<CsEquipmentDeliveryPO> getListByIds(List<String> devList);
|
List<CsEquipmentDeliveryPO> getListByIds(List<String> devList);
|
||||||
|
|
||||||
|
List<CsEquipmentDeliveryPO> getRunPortableDev(String userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,4 +70,6 @@ public interface CsLinePOService extends IService<CsLinePO>{
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<CsLinePO> getLineByName(String lineName);
|
List<CsLinePO> getLineByName(String lineName);
|
||||||
|
|
||||||
|
List<String> getAllLine();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,11 @@ import com.njcn.csdevice.pojo.po.CsGroup;
|
|||||||
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
||||||
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
||||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||||
|
import com.njcn.csharmonic.param.FittingDataQueryParam;
|
||||||
|
import com.njcn.csharmonic.param.TrendDataQueryParam;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -78,4 +79,16 @@ public interface ICsGroupService extends IService<CsGroup> {
|
|||||||
*/
|
*/
|
||||||
void deleteGroup(String groupId);
|
void deleteGroup(String groupId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询趋势数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ThdDataVO> trendData(TrendDataQueryParam trendDataQueryParam);
|
||||||
|
/**
|
||||||
|
* 查询指标拟合图数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ThdDataVO> fittingData(FittingDataQueryParam fittingDataQueryParam);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,4 +85,11 @@ public interface ICsLedgerService extends IService<CsLedger> {
|
|||||||
List<CsLedgerVO> getProAndEngineer(List<String> id);
|
List<CsLedgerVO> getProAndEngineer(List<String> id);
|
||||||
|
|
||||||
CsLedgerVO cldTree();
|
CsLedgerVO cldTree();
|
||||||
|
|
||||||
|
List<DevDetailDTO> getInfoByIds(List<String> list);
|
||||||
|
|
||||||
|
List<DevDetailDTO> getDevInfoByEngineerIds(List<String> list);
|
||||||
|
|
||||||
|
List<DevDetailDTO> getEngineeringHaveDevs(List<String> list);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
@@ -12,6 +11,7 @@ import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
|||||||
import com.njcn.csdevice.mapper.CsDeviceUserPOMapper;
|
import com.njcn.csdevice.mapper.CsDeviceUserPOMapper;
|
||||||
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
||||||
import com.njcn.csdevice.mapper.CsMarketDataMapper;
|
import com.njcn.csdevice.mapper.CsMarketDataMapper;
|
||||||
|
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||||
import com.njcn.csdevice.pojo.po.*;
|
import com.njcn.csdevice.pojo.po.*;
|
||||||
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
||||||
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
||||||
@@ -51,22 +51,17 @@ import static java.util.Objects.isNull;
|
|||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper, CsDeviceUserPO> implements CsDeviceUserPOService{
|
public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper, CsDeviceUserPO> implements CsDeviceUserPOService{
|
||||||
private final CsDevModelRelationService csDevModelRelationService;
|
|
||||||
|
|
||||||
|
private final CsDevModelRelationService csDevModelRelationService;
|
||||||
private final ICsLedgerService iCsLedgerService;
|
private final ICsLedgerService iCsLedgerService;
|
||||||
// private final CsEquipmentAlarmFeignClient csEquipmentAlarmFeignClient;
|
|
||||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||||
private final RoleEngineerDevService roleEngineerDevService;
|
private final RoleEngineerDevService roleEngineerDevService;
|
||||||
|
|
||||||
private final AppLineTopologyDiagramService appLineTopologyDiagramService;
|
private final AppLineTopologyDiagramService appLineTopologyDiagramService;
|
||||||
|
|
||||||
private final CsTouristDataPOService csTouristDataPOService;
|
private final CsTouristDataPOService csTouristDataPOService;
|
||||||
|
|
||||||
private final CsLinePOService csLinePOService;
|
private final CsLinePOService csLinePOService;
|
||||||
private final CsMarketDataMapper csMarketDataMapper;
|
private final CsMarketDataMapper csMarketDataMapper;
|
||||||
private final EventUserFeignClient eventUserFeignClient;
|
private final EventUserFeignClient eventUserFeignClient;
|
||||||
private final UserFeignClient userFeignClient;
|
private final UserFeignClient userFeignClient;
|
||||||
|
|
||||||
private final FeedBackFeignClient feedBackFeignClient;
|
private final FeedBackFeignClient feedBackFeignClient;
|
||||||
private final IMqttUserService mqttUserService;
|
private final IMqttUserService mqttUserService;
|
||||||
|
|
||||||
@@ -407,4 +402,22 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> findDevByUserId(String userId) {
|
||||||
|
List<String> result = new ArrayList<>();
|
||||||
|
List<CsDeviceUserPO> list = this.lambdaQuery().eq(CsDeviceUserPO::getPrimaryUserId,userId).list();
|
||||||
|
if (CollectionUtil.isNotEmpty(list)){
|
||||||
|
result = list.stream().map(CsDeviceUserPO::getDeviceId).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void channelDevByUserId(UserDevParam param) {
|
||||||
|
LambdaQueryWrapper<CsDeviceUserPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(CsDeviceUserPO::getPrimaryUserId,param.getUserId())
|
||||||
|
.in(CsDeviceUserPO::getDeviceId,param.getList());
|
||||||
|
this.remove(queryWrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,17 +2,20 @@ package com.njcn.csdevice.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.Query;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.csdevice.api.CsDeviceUserFeignClient;
|
||||||
|
import com.njcn.csdevice.api.CsLedgerFeignClient;
|
||||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
import com.njcn.csdevice.mapper.CsEngineeringMapper;
|
import com.njcn.csdevice.mapper.CsEngineeringMapper;
|
||||||
import com.njcn.csdevice.mapper.CsEngineeringUserMapper;
|
import com.njcn.csdevice.mapper.CsEngineeringUserMapper;
|
||||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||||
import com.njcn.csdevice.mapper.CsMarketDataMapper;
|
import com.njcn.csdevice.mapper.CsMarketDataMapper;
|
||||||
|
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||||
import com.njcn.csdevice.pojo.param.CsEngineeringAddParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringAddParm;
|
||||||
import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
||||||
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
||||||
@@ -20,7 +23,6 @@ import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
|||||||
import com.njcn.csdevice.pojo.po.*;
|
import com.njcn.csdevice.pojo.po.*;
|
||||||
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
||||||
import com.njcn.csdevice.service.CsEngineeringService;
|
import com.njcn.csdevice.service.CsEngineeringService;
|
||||||
import com.njcn.csdevice.service.CsMarketDataService;
|
|
||||||
import com.njcn.csdevice.service.CsTouristDataPOService;
|
import com.njcn.csdevice.service.CsTouristDataPOService;
|
||||||
import com.njcn.redis.utils.RedisUtil;
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
import com.njcn.system.api.AreaFeignClient;
|
import com.njcn.system.api.AreaFeignClient;
|
||||||
@@ -34,10 +36,8 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.function.Function;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,12 +58,10 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
|||||||
private final CsLedgerMapper csLedgerMapper;
|
private final CsLedgerMapper csLedgerMapper;
|
||||||
private final CsEngineeringUserMapper csEngineeringUserMapper;
|
private final CsEngineeringUserMapper csEngineeringUserMapper;
|
||||||
private final RoleEngineerDevServiceImpl roleEngineerDevService;
|
private final RoleEngineerDevServiceImpl roleEngineerDevService;
|
||||||
|
|
||||||
private final CsMarketDataMapper csMarketDataMapper;
|
private final CsMarketDataMapper csMarketDataMapper;
|
||||||
private final CsTouristDataPOService csTouristDataPOService;
|
private final CsTouristDataPOService csTouristDataPOService;
|
||||||
|
private final CsLedgerFeignClient csLedgerFeignClient;
|
||||||
|
private final CsDeviceUserFeignClient csDeviceUserFeignClient;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
@@ -222,6 +220,45 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
|||||||
return this.lambdaQuery().eq(CsEngineeringPO::getId,id).eq(CsEngineeringPO::getStatus,"1").one();
|
return this.lambdaQuery().eq(CsEngineeringPO::getId,id).eq(CsEngineeringPO::getStatus,"1").one();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CsEngineeringPO> getUnlinkedEngineering(String userId) {
|
||||||
|
List<CsEngineeringPO> result = new ArrayList<>();
|
||||||
|
List<String> list1 = new ArrayList<>();
|
||||||
|
//根据用户信息获取设备信息
|
||||||
|
List<String> devList = csDeviceUserFeignClient.findDevByUserId(userId).getData();
|
||||||
|
//根据设备查询工程信息
|
||||||
|
if (CollectionUtil.isNotEmpty(devList)) {
|
||||||
|
List<DevDetailDTO> ledger = csLedgerFeignClient.getInfoByIds(devList).getData();
|
||||||
|
ledger.forEach(item->{
|
||||||
|
if (!Objects.equals(item.getEngineeringid(),"/")) {
|
||||||
|
list1.add(item.getEngineeringid());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//获取有设备的工程信息
|
||||||
|
LambdaQueryWrapper<CsEngineeringPO> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper2.eq(CsEngineeringPO::getStatus,"1");
|
||||||
|
if (CollectionUtil.isNotEmpty(list1)) {
|
||||||
|
queryWrapper2.notIn(CsEngineeringPO::getId,list1);
|
||||||
|
}
|
||||||
|
List<CsEngineeringPO> list = this.baseMapper.selectList(queryWrapper2);
|
||||||
|
//剔除没有设备的工程
|
||||||
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
|
Map<String, CsEngineeringPO> map = list.stream().collect(Collectors.toMap(CsEngineeringPO::getId, Function.identity()));
|
||||||
|
List<String> list2 = list.stream().map(CsEngineeringPO::getId).collect(Collectors.toList());
|
||||||
|
List<DevDetailDTO> ledger = csLedgerFeignClient.getEngineeringHaveDevs(list2).getData();
|
||||||
|
if (CollectionUtil.isNotEmpty(ledger)) {
|
||||||
|
ledger.forEach(item->{
|
||||||
|
CsEngineeringPO po = new CsEngineeringPO();
|
||||||
|
po.setId(item.getEngineeringid());
|
||||||
|
po.setName(map.get(item.getEngineeringid()).getName());
|
||||||
|
result.add(po);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getAreaById(String id){
|
public String getAreaById(String id){
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ import com.njcn.system.enums.DicDataEnum;
|
|||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
import com.njcn.system.enums.DicTreeEnum;
|
import com.njcn.system.enums.DicTreeEnum;
|
||||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||||
|
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||||
import com.njcn.user.enums.AppRoleEnum;
|
import com.njcn.user.enums.AppRoleEnum;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -985,6 +986,25 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
return this.lambdaQuery().in(CsEquipmentDeliveryPO::getId,devList).list();
|
return this.lambdaQuery().in(CsEquipmentDeliveryPO::getId,devList).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CsEquipmentDeliveryPO> getRunPortableDev(String userId) {
|
||||||
|
List<CsEquipmentDeliveryPO> result = new ArrayList<>();
|
||||||
|
DictTreeVO vo = dictTreeFeignClient.queryByCode(DicDataEnum.PORTABLE.getCode()).getData();
|
||||||
|
if (ObjectUtil.isNotNull(vo)) {
|
||||||
|
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getDevType,vo.getId())
|
||||||
|
.ne(CsEquipmentDeliveryPO::getRunStatus,0)
|
||||||
|
.eq(CsEquipmentDeliveryPO::getUsageStatus,1);
|
||||||
|
//获取用户已经绑定的便携式设备
|
||||||
|
List<String> devList = csDeviceUserPOService.findDevByUserId(userId);
|
||||||
|
if (CollectionUtil.isNotEmpty(devList)) {
|
||||||
|
lambdaQueryWrapper.notIn(CsEquipmentDeliveryPO::getId,devList);
|
||||||
|
}
|
||||||
|
result = this.list(lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//根据前置机id获取装置数量
|
//根据前置机id获取装置数量
|
||||||
public List<CsEquipmentDeliveryPO> getListByNodeId(String nodeId) {
|
public List<CsEquipmentDeliveryPO> getListByNodeId(String nodeId) {
|
||||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
package com.njcn.csdevice.service.impl;
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -33,6 +36,8 @@ import com.njcn.csharmonic.api.EventFeignClient;
|
|||||||
import com.njcn.csharmonic.constant.HarmonicConstant;
|
import com.njcn.csharmonic.constant.HarmonicConstant;
|
||||||
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||||
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
||||||
|
import com.njcn.csharmonic.param.FittingDataQueryParam;
|
||||||
|
import com.njcn.csharmonic.param.TrendDataQueryParam;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
@@ -42,7 +47,7 @@ import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
|||||||
import com.njcn.influx.service.CommonService;
|
import com.njcn.influx.service.CommonService;
|
||||||
import com.njcn.influx.service.EvtDataService;
|
import com.njcn.influx.service.EvtDataService;
|
||||||
import com.njcn.system.api.CsStatisticalSetFeignClient;
|
import com.njcn.system.api.CsStatisticalSetFeignClient;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DictTreeFeignClient;
|
||||||
import com.njcn.system.api.EleEvtFeignClient;
|
import com.njcn.system.api.EleEvtFeignClient;
|
||||||
import com.njcn.system.api.EpdFeignClient;
|
import com.njcn.system.api.EpdFeignClient;
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
@@ -59,6 +64,7 @@ import java.lang.reflect.Field;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
import java.time.Instant;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@@ -85,7 +91,6 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
private final EpdFeignClient epdFeignClient;
|
private final EpdFeignClient epdFeignClient;
|
||||||
private final CsLineFeignClient csLineFeignClient;
|
private final CsLineFeignClient csLineFeignClient;
|
||||||
private final ICsLedgerService iCsLedgerService;
|
private final ICsLedgerService iCsLedgerService;
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
|
||||||
private final EquipmentFeignClient equipmentFeignClient;
|
private final EquipmentFeignClient equipmentFeignClient;
|
||||||
private final CsStatisticalSetFeignClient csStatisticalSetFeignClient;
|
private final CsStatisticalSetFeignClient csStatisticalSetFeignClient;
|
||||||
private final EvtDataService evtDataService;
|
private final EvtDataService evtDataService;
|
||||||
@@ -95,6 +100,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
private final CsDataSetMapper csDataSetMapper;
|
private final CsDataSetMapper csDataSetMapper;
|
||||||
private final EventFeignClient eventFeignClient;
|
private final EventFeignClient eventFeignClient;
|
||||||
private final InfluxDbParamUtil influxDbParamUtil;
|
private final InfluxDbParamUtil influxDbParamUtil;
|
||||||
|
private final DictTreeFeignClient dictTreeFeignClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -784,6 +790,346 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ThdDataVO> trendData(TrendDataQueryParam trendDataQueryParam) {
|
||||||
|
List<ThdDataVO> result = new ArrayList<>();
|
||||||
|
CsLinePO finalCsLinePO = csLineFeignClient.getById(trendDataQueryParam.getLineId()).getData();
|
||||||
|
CsDataSet csDataSet = csDataSetMapper.selectOne(new LambdaQueryWrapper<CsDataSet>().eq(CsDataSet::getId,finalCsLinePO.getDataSetId()));
|
||||||
|
if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())){
|
||||||
|
throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)");
|
||||||
|
}
|
||||||
|
Double ct = finalCsLinePO.getCtRatio();
|
||||||
|
Double pt = finalCsLinePO.getPtRatio();
|
||||||
|
if(CollectionUtil.isNotEmpty(trendDataQueryParam.getList())) {
|
||||||
|
for (TrendDataQueryParam param : trendDataQueryParam.getList()) {
|
||||||
|
List<EleEpdPqd> eleEpdPqds = csStatisticalSetFeignClient.queryStatisticalSelect(param.getStatisticalId()).getData();
|
||||||
|
for (EleEpdPqd epdPqd : eleEpdPqds) {
|
||||||
|
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
||||||
|
commonQueryParam.setLineId(finalCsLinePO.getLineId());
|
||||||
|
commonQueryParam.setTableName(influxDbParamUtil.getTableNameByClassId(epdPqd.getClassId()));
|
||||||
|
commonQueryParam.setColumnName(epdPqd.getName() + (StringUtils.isEmpty(param.getFrequency()) ? "" : "_" + param.getFrequency()));
|
||||||
|
commonQueryParam.setPhasic(epdPqd.getPhase());
|
||||||
|
|
||||||
|
commonQueryParam.setStartTime(DateUtil.format(DateUtil.parse(trendDataQueryParam.getSearchBeginTime(), DatePattern.NORM_DATE_PATTERN), DatePattern.NORM_DATETIME_PATTERN));
|
||||||
|
commonQueryParam.setEndTime(DateUtil.format(DateUtil.endOfDay(DateUtil.parse(trendDataQueryParam.getSearchEndTime(), DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATETIME_PATTERN));
|
||||||
|
|
||||||
|
commonQueryParam.setDataType(trendDataQueryParam.getValueType());
|
||||||
|
|
||||||
|
commonQueryParam.setClDid(influxDbParamUtil.getClDidByLineId(finalCsLinePO.getLineId()));
|
||||||
|
|
||||||
|
List<StatisticalDataDTO> deviceRtData = commonService.getNewDeviceRtDataByTime(Collections.singletonList(commonQueryParam));
|
||||||
|
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||||
|
String unit;
|
||||||
|
ThdDataVO vo = new ThdDataVO();
|
||||||
|
vo.setLineId(temp.getLineId());
|
||||||
|
vo.setPhase(Objects.equals("M", temp.getPhaseType()) ? null : temp.getPhaseType());
|
||||||
|
String position = finalCsLinePO.getPosition();
|
||||||
|
vo.setPosition(position);
|
||||||
|
vo.setTime(temp.getTime());
|
||||||
|
vo.setStatMethod(temp.getValueType());
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||||
|
if (temp.getValue() != null) {
|
||||||
|
double re = 0;
|
||||||
|
if (Objects.equals("Primary", trendDataQueryParam.getDataLevel())) {
|
||||||
|
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||||
|
if (HarmonicConstant.POWER_LIST.contains(epdPqd.getShowName())) {
|
||||||
|
re = Objects.isNull(temp.getValue()) ? 3.14159 : Double.parseDouble(df.format(temp.getValue() / 1000));
|
||||||
|
vo.setStatisticalData(re);
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
} else {
|
||||||
|
vo.setStatisticalData(Objects.isNull(temp.getValue()) ? 3.14159 : Double.parseDouble(df.format(temp.getValue())));
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||||
|
switch (epdPqd.getPrimaryFormula()) {
|
||||||
|
case "*PT":
|
||||||
|
re = temp.getValue() * pt / 1000;
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
case "*CT":
|
||||||
|
re = temp.getValue() * ct;
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
case "*PT*CT":
|
||||||
|
re = temp.getValue() * pt * ct / 1000;
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
re = temp.getValue();
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||||
|
} else {
|
||||||
|
re = temp.getValue();
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||||
|
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||||
|
switch (epdPqd.getPrimaryFormula()) {
|
||||||
|
case "*PT":
|
||||||
|
re = temp.getValue() / pt;
|
||||||
|
break;
|
||||||
|
case "*CT":
|
||||||
|
re = temp.getValue() / ct;
|
||||||
|
break;
|
||||||
|
case "*PT*CT":
|
||||||
|
re = temp.getValue() / pt / ct;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
re = temp.getValue();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||||
|
} else {
|
||||||
|
re = temp.getValue();
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||||
|
}
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
vo.setStatisticalData(null);
|
||||||
|
if (Objects.equals("Primary", trendDataQueryParam.getDataLevel())) {
|
||||||
|
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
} else {
|
||||||
|
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||||
|
switch (epdPqd.getPrimaryFormula()) {
|
||||||
|
case "*PT":
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
case "*CT":
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
case "*PT*CT":
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vo.setUnit(unit);
|
||||||
|
vo.setStatisticalIndex(epdPqd.getId());
|
||||||
|
vo.setStatisticalName(epdPqd.getName());
|
||||||
|
vo.setAnotherName(epdPqd.getShowName());
|
||||||
|
return vo;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
result.addAll(collect1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ThdDataVO> fittingData(FittingDataQueryParam fittingDataQueryParam) {
|
||||||
|
List<ThdDataVO> result = new ArrayList<>();
|
||||||
|
CsLinePO finalCsLinePO = csLineFeignClient.getById(fittingDataQueryParam.getLineId()).getData();
|
||||||
|
CsDataSet csDataSet = csDataSetMapper.selectOne(new LambdaQueryWrapper<CsDataSet>().eq(CsDataSet::getId,finalCsLinePO.getDataSetId()));
|
||||||
|
if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())){
|
||||||
|
throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)");
|
||||||
|
}
|
||||||
|
Double ct = finalCsLinePO.getCtRatio();
|
||||||
|
Double pt = finalCsLinePO.getPtRatio();
|
||||||
|
// String position = finalCsLinePO.getPosition();
|
||||||
|
Overlimit overlimit = overlimitMapper.selectById(finalCsLinePO.getLineId());
|
||||||
|
JSONObject entries = JSONUtil.parseObj(overlimit);
|
||||||
|
if(CollectionUtil.isNotEmpty(fittingDataQueryParam.getList())) {
|
||||||
|
for (FittingDataQueryParam param : fittingDataQueryParam.getList()) {
|
||||||
|
String dictCode = dictTreeFeignClient.queryById(param.getStatisticalId()).getData().getCode();
|
||||||
|
List<EleEpdPqd> eleEpdPqds = csStatisticalSetFeignClient.queryStatisticalSelect(param.getStatisticalId()).getData();
|
||||||
|
List<ThdDataVO> dataList = new ArrayList<>();
|
||||||
|
for (EleEpdPqd epdPqd : eleEpdPqds) {
|
||||||
|
CommonQueryParam commonQueryParam = new CommonQueryParam();
|
||||||
|
commonQueryParam.setLineId(finalCsLinePO.getLineId());
|
||||||
|
commonQueryParam.setTableName(influxDbParamUtil.getTableNameByClassId(epdPqd.getClassId()));
|
||||||
|
commonQueryParam.setColumnName(epdPqd.getName() + (StringUtils.isEmpty(param.getFrequency()) ? "" : "_" + param.getFrequency()));
|
||||||
|
commonQueryParam.setPhasic(epdPqd.getPhase());
|
||||||
|
|
||||||
|
commonQueryParam.setStartTime(DateUtil.format(DateUtil.parse(fittingDataQueryParam.getSearchBeginTime(), DatePattern.NORM_DATE_PATTERN), DatePattern.NORM_DATETIME_PATTERN));
|
||||||
|
commonQueryParam.setEndTime(DateUtil.format(DateUtil.endOfDay(DateUtil.parse(fittingDataQueryParam.getSearchEndTime(), DatePattern.NORM_DATE_PATTERN)), DatePattern.NORM_DATETIME_PATTERN));
|
||||||
|
// 兼容用户功率需要该参数过滤
|
||||||
|
String dataType = param.getValueType();
|
||||||
|
if (StrUtil.isEmpty(dataType)) {
|
||||||
|
// 电能质量指标,取限值计算类型,判断是否越限
|
||||||
|
dataType = epdPqd.getFormula();
|
||||||
|
}
|
||||||
|
commonQueryParam.setDataType(dataType);
|
||||||
|
|
||||||
|
commonQueryParam.setClDid(influxDbParamUtil.getClDidByLineId(finalCsLinePO.getLineId()));
|
||||||
|
|
||||||
|
List<StatisticalDataDTO> deviceRtData = commonService.getNewDeviceRtDataByTime(Collections.singletonList(commonQueryParam));
|
||||||
|
dataList = deviceRtData.stream().map(temp -> {
|
||||||
|
String unit;
|
||||||
|
ThdDataVO vo = new ThdDataVO();
|
||||||
|
vo.setLineId(temp.getLineId());
|
||||||
|
// vo.setLineName(finalCsLinePO.getName());
|
||||||
|
vo.setPhase(Objects.equals("M", temp.getPhaseType()) ? null : temp.getPhaseType());
|
||||||
|
// vo.setPosition(position);
|
||||||
|
vo.setTime(temp.getTime());
|
||||||
|
vo.setStatMethod(commonQueryParam.getDataType());
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||||
|
if (temp.getValue() != null) {
|
||||||
|
double re;
|
||||||
|
if (Objects.equals("Primary", fittingDataQueryParam.getDataLevel())) {
|
||||||
|
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||||
|
if (HarmonicConstant.POWER_LIST.contains(epdPqd.getShowName())) {
|
||||||
|
re = Objects.isNull(temp.getValue()) ? 3.14159 : Double.parseDouble(df.format(temp.getValue() / 1000));
|
||||||
|
vo.setStatisticalData(re);
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
} else {
|
||||||
|
vo.setStatisticalData(Objects.isNull(temp.getValue()) ? 3.14159 : Double.parseDouble(df.format(temp.getValue())));
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||||
|
switch (epdPqd.getPrimaryFormula()) {
|
||||||
|
case "*PT":
|
||||||
|
re = temp.getValue() * pt / 1000;
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
case "*CT":
|
||||||
|
re = temp.getValue() * ct;
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
case "*PT*CT":
|
||||||
|
re = temp.getValue() * pt * ct / 1000;
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
re = temp.getValue();
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||||
|
} else {
|
||||||
|
re = temp.getValue();
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||||
|
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||||
|
switch (epdPqd.getPrimaryFormula()) {
|
||||||
|
case "*PT":
|
||||||
|
re = temp.getValue() / pt;
|
||||||
|
break;
|
||||||
|
case "*CT":
|
||||||
|
re = temp.getValue() / ct;
|
||||||
|
break;
|
||||||
|
case "*PT*CT":
|
||||||
|
re = temp.getValue() / pt / ct;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
re = temp.getValue();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||||
|
} else {
|
||||||
|
re = temp.getValue();
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||||
|
}
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
vo.setStatisticalData(null);
|
||||||
|
if (Objects.equals("Primary", fittingDataQueryParam.getDataLevel())) {
|
||||||
|
if (Objects.equals("Primary", csDataSet.getDataLevel())) {
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
} else {
|
||||||
|
if (Objects.nonNull(epdPqd.getPrimaryFormula())) {
|
||||||
|
switch (epdPqd.getPrimaryFormula()) {
|
||||||
|
case "*PT":
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
case "*CT":
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
case "*PT*CT":
|
||||||
|
unit = "k" + epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unit = epdPqd.getUnit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vo.setUnit(unit);
|
||||||
|
// vo.setStatisticalIndex(epdPqd.getId());
|
||||||
|
// vo.setStatisticalName(epdPqd.getName());
|
||||||
|
vo.setStatisticalIndex(param.getStatisticalId());
|
||||||
|
vo.setAnotherName(epdPqd.getShowName());
|
||||||
|
return vo;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
// 电能质量指标(越限为1,不越限为0)
|
||||||
|
List<String> hasKeys = entries.keySet().stream().filter(key -> key.startsWith(dictCode)).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(hasKeys)) {
|
||||||
|
List<ThdDataVO> limitDataList = new ArrayList<>();
|
||||||
|
Map<Instant, List<ThdDataVO>> timeMap = dataList.stream().collect(Collectors.groupingBy(ThdDataVO::getTime));
|
||||||
|
// 限值
|
||||||
|
ThdDataVO data;
|
||||||
|
for (Map.Entry<Instant, List<ThdDataVO>> entry: timeMap.entrySet()) {
|
||||||
|
data = new ThdDataVO();
|
||||||
|
List<ThdDataVO> list = entry.getValue();
|
||||||
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
|
ThdDataVO thdDataVO = list.get(0);
|
||||||
|
// data.setPosition(thdDataVO.getPosition());
|
||||||
|
data.setLineId(thdDataVO.getLineId());
|
||||||
|
// data.setLineName(thdDataVO.getLineName());
|
||||||
|
data.setFrequency(param.getFrequency());
|
||||||
|
data.setStatMethod(thdDataVO.getStatMethod());
|
||||||
|
data.setUnit(thdDataVO.getUnit());
|
||||||
|
data.setAnotherName(thdDataVO.getAnotherName());
|
||||||
|
data.setStatisticalIndex(param.getStatisticalId());
|
||||||
|
}
|
||||||
|
Instant time = entry.getKey();
|
||||||
|
data.setTime(time);
|
||||||
|
|
||||||
|
double limitValue = entries.getDouble(dictCode + (StringUtils.isEmpty(param.getFrequency()) ? "" : param.getFrequency()));
|
||||||
|
double maxValue = list.stream().filter(v -> ObjectUtil.isNotEmpty(v.getStatisticalData())).mapToDouble(ThdDataVO::getStatisticalData).max().orElse(0.0);
|
||||||
|
// 越限为1,不越限为0
|
||||||
|
data.setStatisticalData(maxValue > limitValue ? 1.0 : 0.0);
|
||||||
|
limitDataList.add(data);
|
||||||
|
}
|
||||||
|
limitDataList.sort(Comparator.comparing(ThdDataVO::getTime));
|
||||||
|
result.addAll(limitDataList);
|
||||||
|
} else {
|
||||||
|
result.addAll(dataList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private List<EnergyTemplateVO> getChildren(String tabId, List<EnergyTemplateVO> all) {
|
private List<EnergyTemplateVO> getChildren(String tabId, List<EnergyTemplateVO> all) {
|
||||||
return all.stream().filter(item -> item.getPid().equals(tabId)).collect(Collectors.toList());
|
return all.stream().filter(item -> item.getPid().equals(tabId)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ import cn.hutool.core.bean.BeanUtil;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.csdevice.constant.DataParam;
|
import com.njcn.csdevice.constant.DataParam;
|
||||||
|
import com.njcn.csdevice.controller.project.EngineeringController;
|
||||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||||
import com.njcn.csdevice.mapper.*;
|
import com.njcn.csdevice.mapper.*;
|
||||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||||
@@ -22,6 +24,8 @@ import com.njcn.system.api.DictTreeFeignClient;
|
|||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.system.pojo.po.Area;
|
import com.njcn.system.pojo.po.Area;
|
||||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||||
|
import com.njcn.user.enums.AppRoleEnum;
|
||||||
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -53,6 +57,8 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||||
private final ICsDataSetService csDataSetService;
|
private final ICsDataSetService csDataSetService;
|
||||||
private final DictTreeFeignClient dictTreeFeignClient;
|
private final DictTreeFeignClient dictTreeFeignClient;
|
||||||
|
private final EngineeringController engineeringController;
|
||||||
|
private final CsDeviceUserPOMapper csDeviceUserPOMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CsLedgerVO> getLedgerTree() {
|
public List<CsLedgerVO> getLedgerTree() {
|
||||||
@@ -190,10 +196,29 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
portable.setName(DataParam.portableDev);
|
portable.setName(DataParam.portableDev);
|
||||||
portable.setPid("0");
|
portable.setPid("0");
|
||||||
portable.setId(IdUtil.simpleUUID());
|
portable.setId(IdUtil.simpleUUID());
|
||||||
//针对未启用的装置判断
|
|
||||||
List<CsLedgerVO> ledger = allList.stream()
|
//根据当前用户获取便携式设备
|
||||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
List<CsLedgerVO> ledger;
|
||||||
.collect(Collectors.toList());
|
String role = RequestUtil.getUserRole();
|
||||||
|
List<String> roles = JSONArray.parseArray(role, String.class);
|
||||||
|
if(roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.getCode())){
|
||||||
|
ledger = allList.stream()
|
||||||
|
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
LambdaQueryWrapper<CsDeviceUserPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(CsDeviceUserPO::getPrimaryUserId,RequestUtil.getUserIndex());
|
||||||
|
List<CsDeviceUserPO> list1 = csDeviceUserPOMapper.selectList(queryWrapper);
|
||||||
|
List<String> result = new ArrayList<>();
|
||||||
|
if (CollectionUtil.isNotEmpty(list1)){
|
||||||
|
result = list1.stream().map(CsDeviceUserPO::getDeviceId).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
//针对未启用的装置判断
|
||||||
|
List<String> finalResult = result;
|
||||||
|
ledger = allList.stream()
|
||||||
|
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0") && finalResult.contains(item.getId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
Map<String, CsEquipmentDeliveryPO> poMap2 = ledger.stream()
|
Map<String, CsEquipmentDeliveryPO> poMap2 = ledger.stream()
|
||||||
.collect(Collectors.toMap(
|
.collect(Collectors.toMap(
|
||||||
CsLedgerVO::getId,
|
CsLedgerVO::getId,
|
||||||
@@ -376,10 +401,28 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
portable.setPid("0");
|
portable.setPid("0");
|
||||||
portable.setId(IdUtil.simpleUUID());
|
portable.setId(IdUtil.simpleUUID());
|
||||||
|
|
||||||
//针对未启用的装置判断
|
List<CsLedgerVO> ledger;
|
||||||
List<CsLedgerVO> ledger = allList.stream()
|
String role = RequestUtil.getUserRole();
|
||||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
List<String> roles = JSONArray.parseArray(role, String.class);
|
||||||
.collect(Collectors.toList());
|
if(roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.getCode())){
|
||||||
|
ledger = allList.stream()
|
||||||
|
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
LambdaQueryWrapper<CsDeviceUserPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(CsDeviceUserPO::getPrimaryUserId,RequestUtil.getUserIndex());
|
||||||
|
List<CsDeviceUserPO> list1 = csDeviceUserPOMapper.selectList(queryWrapper);
|
||||||
|
List<String> result = new ArrayList<>();
|
||||||
|
if (CollectionUtil.isNotEmpty(list1)){
|
||||||
|
result = list1.stream().map(CsDeviceUserPO::getDeviceId).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
//针对未启用的装置判断
|
||||||
|
List<String> finalResult = result;
|
||||||
|
ledger = allList.stream()
|
||||||
|
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0") && finalResult.contains(item.getId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, CsEquipmentDeliveryPO> poMap2 = ledger.stream()
|
Map<String, CsEquipmentDeliveryPO> poMap2 = ledger.stream()
|
||||||
.collect(Collectors.toMap(
|
.collect(Collectors.toMap(
|
||||||
CsLedgerVO::getId,
|
CsLedgerVO::getId,
|
||||||
@@ -743,6 +786,78 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
return government;
|
return government;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DevDetailDTO> getInfoByIds(List<String> list) {
|
||||||
|
List<DevDetailDTO> details = new ArrayList<>();
|
||||||
|
List<CsLedger> ledgers = this.listByIds(list);
|
||||||
|
Set<String> enginingeringIds = new HashSet<>();
|
||||||
|
ledgers.forEach(item->{
|
||||||
|
DevDetailDTO device = new DevDetailDTO();
|
||||||
|
if(Objects.equals(item.getPid(),"0")){
|
||||||
|
device.setEquipmentName(item.getName());
|
||||||
|
device.setEquipmentId(item.getId());
|
||||||
|
device.setProjectId("/");
|
||||||
|
device.setProjectName("/");
|
||||||
|
device.setEngineeringid("/");
|
||||||
|
device.setEngineeringName("/");
|
||||||
|
details.add(device);
|
||||||
|
} else {
|
||||||
|
enginingeringIds.add(item.getPids().split(",")[1]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (CollectionUtil.isNotEmpty(enginingeringIds)) {
|
||||||
|
List<CsLedger> engineer = this.listByIds(enginingeringIds);
|
||||||
|
engineer.forEach(item->{
|
||||||
|
DevDetailDTO detail = new DevDetailDTO();
|
||||||
|
detail.setEngineeringid(item.getId());
|
||||||
|
detail.setEngineeringName(item.getName());
|
||||||
|
details.add(detail);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return details;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DevDetailDTO> getDevInfoByEngineerIds(List<String> list) {
|
||||||
|
List<DevDetailDTO> details = new ArrayList<>();
|
||||||
|
LambdaQueryWrapper<CsLedger> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.in(CsLedger::getPid, list);
|
||||||
|
List<CsLedger> project = this.list(queryWrapper);
|
||||||
|
//工程id
|
||||||
|
List<String> projectIds = project.stream().map(CsLedger::getId).collect(Collectors.toList());
|
||||||
|
LambdaQueryWrapper<CsLedger> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper2.in(CsLedger::getPid, projectIds);
|
||||||
|
List<CsLedger> dev = this.list(queryWrapper2);
|
||||||
|
dev.forEach(item->{
|
||||||
|
DevDetailDTO detail = new DevDetailDTO();
|
||||||
|
detail.setEquipmentName(item.getName());
|
||||||
|
detail.setEquipmentId(item.getId());
|
||||||
|
details.add(detail);
|
||||||
|
});
|
||||||
|
return details;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DevDetailDTO> getEngineeringHaveDevs(List<String> list) {
|
||||||
|
List<DevDetailDTO> result = new ArrayList<>();
|
||||||
|
list.forEach(item->{
|
||||||
|
LambdaQueryWrapper<CsLedger> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(CsLedger::getPid, item);
|
||||||
|
List<CsLedger> project = this.list(queryWrapper);
|
||||||
|
//工程id
|
||||||
|
List<String> projectIds = project.stream().map(CsLedger::getId).collect(Collectors.toList());
|
||||||
|
LambdaQueryWrapper<CsLedger> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper2.in(CsLedger::getPid, projectIds);
|
||||||
|
List<CsLedger> dev = this.list(queryWrapper2);
|
||||||
|
if (CollectionUtil.isNotEmpty(dev)) {
|
||||||
|
DevDetailDTO dto = new DevDetailDTO();
|
||||||
|
dto.setEngineeringid(item);
|
||||||
|
result.add(dto);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取子节点
|
* 获取子节点
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -216,6 +216,16 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
|||||||
return this.lambdaQuery().like(CsLinePO::getName,lineName).list();
|
return this.lambdaQuery().like(CsLinePO::getName,lineName).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getAllLine() {
|
||||||
|
return this.lambdaQuery()
|
||||||
|
.eq(CsLinePO::getStatus, 1)
|
||||||
|
.list()
|
||||||
|
.stream()
|
||||||
|
.map(CsLinePO::getLineId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 1.平台端默认配置拓扑图模板,包含拓扑图信息(cs_topology_diagram_template)和拓扑图上监测点的点位信息(cs_line_topology_template)
|
// * 1.平台端默认配置拓扑图模板,包含拓扑图信息(cs_topology_diagram_template)和拓扑图上监测点的点位信息(cs_line_topology_template)
|
||||||
// *
|
// *
|
||||||
|
|||||||
@@ -88,11 +88,13 @@ public class CsTerminalReplyServiceImpl extends ServiceImpl<CsTerminalReplyMappe
|
|||||||
devNameListString = "[" + item.getDeviceName() + "]";
|
devNameListString = "[" + item.getDeviceName() + "]";
|
||||||
}
|
}
|
||||||
if (item.getIsReceived() == 0) {
|
if (item.getIsReceived() == 0) {
|
||||||
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备" + code + "数据失败";
|
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备未收到应答";
|
||||||
//将cs_terminal_logs数据置为未发送
|
//将cs_terminal_logs数据置为未发送
|
||||||
csTerminalLogsService.updateLaterData(item.getDeviceId(),item.getCode());
|
csTerminalLogsService.updateLaterData(item.getDeviceId(),item.getCode());
|
||||||
} else {
|
} else if (item.getIsReceived() == 1){
|
||||||
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备" + code + "数据成功";
|
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备" + code + "数据成功";
|
||||||
|
} else {
|
||||||
|
key = nodeName + item.getProcessNo() + "号进程下," + devNameListString + "设备" + code + "数据失败";
|
||||||
}
|
}
|
||||||
result.add(key);
|
result.add(key);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.alibaba.csp.sentinel.util.StringUtil;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.njcn.access.utils.ChannelObjectUtil;
|
import com.njcn.access.utils.ChannelObjectUtil;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.csdevice.mapper.OverlimitMapper;
|
||||||
import com.njcn.csdevice.param.IcdBzParam;
|
import com.njcn.csdevice.param.IcdBzParam;
|
||||||
import com.njcn.csdevice.param.IcdLedgerParam;
|
import com.njcn.csdevice.param.IcdLedgerParam;
|
||||||
import com.njcn.csdevice.param.IcdParam;
|
import com.njcn.csdevice.param.IcdParam;
|
||||||
@@ -23,6 +24,8 @@ import com.njcn.csdevice.pojo.vo.DeviceInfo;
|
|||||||
import com.njcn.csdevice.service.*;
|
import com.njcn.csdevice.service.*;
|
||||||
import com.njcn.csharmonic.api.EventFeignClient;
|
import com.njcn.csharmonic.api.EventFeignClient;
|
||||||
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
|
import com.njcn.device.biz.utils.COverlimitUtil;
|
||||||
import com.njcn.mq.message.BZEventMessage;
|
import com.njcn.mq.message.BZEventMessage;
|
||||||
import com.njcn.mq.template.BZEventMessageTemplate;
|
import com.njcn.mq.template.BZEventMessageTemplate;
|
||||||
import com.njcn.redis.pojo.enums.AppRedisKey;
|
import com.njcn.redis.pojo.enums.AppRedisKey;
|
||||||
@@ -58,6 +61,7 @@ class IcdServiceImpl implements IcdService {
|
|||||||
private final EventFeignClient eventFeignClient;
|
private final EventFeignClient eventFeignClient;
|
||||||
private final ICsTerminalLogsService csTerminalLogsService;
|
private final ICsTerminalLogsService csTerminalLogsService;
|
||||||
private final ICsTerminalReplyService csTerminalReplyService;
|
private final ICsTerminalReplyService csTerminalReplyService;
|
||||||
|
private final OverlimitMapper overlimitMapper;
|
||||||
private final DateTimeFormatter microsecondFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSS");
|
private final DateTimeFormatter microsecondFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSS");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -123,7 +127,6 @@ class IcdServiceImpl implements IcdService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void addLedgerInfo(IcdLedgerParam param) {
|
public void addLedgerInfo(IcdLedgerParam param) {
|
||||||
// 第一种:全流程创建
|
// 第一种:全流程创建
|
||||||
if (isAllIndicesNull(param)) {
|
if (isAllIndicesNull(param)) {
|
||||||
@@ -579,7 +582,8 @@ class IcdServiceImpl implements IcdService {
|
|||||||
&& ObjectUtil.isNull(param.getDevIndex());
|
&& ObjectUtil.isNull(param.getDevIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleFullProcessCreation(@NotNull IcdLedgerParam param) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void handleFullProcessCreation(@NotNull IcdLedgerParam param) {
|
||||||
if (ObjectUtil.isNotNull(param.getEngineering())) {
|
if (ObjectUtil.isNotNull(param.getEngineering())) {
|
||||||
CsEngineeringPO po1 = csEngineeringService.addEngineering(param.getEngineering());
|
CsEngineeringPO po1 = csEngineeringService.addEngineering(param.getEngineering());
|
||||||
param.setEngineeringIndex(po1.getId());
|
param.setEngineeringIndex(po1.getId());
|
||||||
@@ -587,15 +591,18 @@ class IcdServiceImpl implements IcdService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleFromEngineeringCreation(IcdLedgerParam param) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void handleFromEngineeringCreation(IcdLedgerParam param) {
|
||||||
createProjectAndDevices(param);
|
createProjectAndDevices(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleFromProjectCreation(IcdLedgerParam param) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void handleFromProjectCreation(IcdLedgerParam param) {
|
||||||
saveDevicesAndLines(param);
|
saveDevicesAndLines(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleFromDeviceCreation(IcdLedgerParam param) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void handleFromDeviceCreation(IcdLedgerParam param) {
|
||||||
saveLines(param);
|
saveLines(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -628,8 +635,8 @@ class IcdServiceImpl implements IcdService {
|
|||||||
saveLines(param);
|
saveLines(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveLines(IcdLedgerParam param) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
List<CsLinePO> list = new ArrayList<>();
|
public void saveLines(IcdLedgerParam param) {
|
||||||
List<CsLineParam> lineList = param.getLine();
|
List<CsLineParam> lineList = param.getLine();
|
||||||
if (CollectionUtil.isNotEmpty(lineList)) {
|
if (CollectionUtil.isNotEmpty(lineList)) {
|
||||||
boolean result = checkAndAlertDuplicates(lineList);
|
boolean result = checkAndAlertDuplicates(lineList);
|
||||||
@@ -651,7 +658,10 @@ class IcdServiceImpl implements IcdService {
|
|||||||
line.setDevId(param.getDevIndex());
|
line.setDevId(param.getDevIndex());
|
||||||
}
|
}
|
||||||
CsLinePO po = csLinePOService.addCldLine(line);
|
CsLinePO po = csLinePOService.addCldLine(line);
|
||||||
list.add(po);
|
//新增监测点限值
|
||||||
|
Overlimit overlimit = COverlimitUtil.globalAssemble(line.getVolGrade().floatValue(), line.getProtocolCapacity().floatValue(),line.getDevCapacity().floatValue(),line.getShortCircuitCapacity().floatValue(),0,0);
|
||||||
|
overlimit.setId(po.getLineId());
|
||||||
|
overlimitMapper.insert(overlimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
//新增台账日志
|
//新增台账日志
|
||||||
|
|||||||
@@ -61,26 +61,24 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
});
|
});
|
||||||
List<CsDeviceUserPO> csDeviceUserPOS = csDeviceUserPOMapper.selectList(csDeviceUserPOQueryWrapper);
|
List<CsDeviceUserPO> csDeviceUserPOS = csDeviceUserPOMapper.selectList(csDeviceUserPOQueryWrapper);
|
||||||
List<String> collect1 = csDeviceUserPOS.stream().map(CsDeviceUserPO::getDeviceId).distinct().collect(Collectors.toList());
|
List<String> collect1 = csDeviceUserPOS.stream().map(CsDeviceUserPO::getDeviceId).distinct().collect(Collectors.toList());
|
||||||
if(CollectionUtils.isEmpty(collect1)){
|
if (!CollectionUtils.isEmpty(collect1)) {
|
||||||
return collect;
|
csLedgerQueryWrapper.in("id", collect1).eq("level", 2);
|
||||||
}else{
|
|
||||||
csLedgerQueryWrapper.in("id",collect1).eq("level",2);
|
|
||||||
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
||||||
List<String> collect2 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList());
|
List<String> collect2 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList());
|
||||||
csLedgerQueryWrapper.clear();
|
csLedgerQueryWrapper.clear();
|
||||||
if(CollectionUtils.isEmpty(collect2)){
|
if (CollectionUtils.isEmpty(collect2)) {
|
||||||
return collect;
|
return collect;
|
||||||
}
|
}
|
||||||
csLedgerQueryWrapper.in("id",collect2).eq("level",1);
|
csLedgerQueryWrapper.in("id", collect2).eq("level", 1);
|
||||||
csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
||||||
List<String> collect3 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList());
|
List<String> collect3 = csLedgers.stream().map(CsLedger::getPid).distinct().collect(Collectors.toList());
|
||||||
if(CollectionUtils.isEmpty(collect3)){
|
if (CollectionUtils.isEmpty(collect3)) {
|
||||||
return collect;
|
return collect;
|
||||||
}
|
}
|
||||||
collect.addAll(collect3);
|
collect.addAll(collect3);
|
||||||
collect = collect.stream().distinct().collect(Collectors.toList());
|
collect = collect.stream().distinct().collect(Collectors.toList());
|
||||||
return collect;
|
|
||||||
}
|
}
|
||||||
|
return collect;
|
||||||
|
|
||||||
} else if ( Objects.equals(role,AppRoleEnum.MARKET_USER.getCode())||
|
} else if ( Objects.equals(role,AppRoleEnum.MARKET_USER.getCode())||
|
||||||
Objects.equals(role, AppRoleEnum.ENGINEERING_USER.getCode())) {
|
Objects.equals(role, AppRoleEnum.ENGINEERING_USER.getCode())) {
|
||||||
@@ -94,7 +92,9 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
List<CsTouristDataPO> csTouristDataPOS = csTouristDataPOMapper.selectList(null);
|
List<CsTouristDataPO> csTouristDataPOS = csTouristDataPOMapper.selectList(null);
|
||||||
collect = csTouristDataPOS.stream().map(CsTouristDataPO::getEnginerId).distinct().collect(Collectors.toList());
|
collect = csTouristDataPOS.stream().map(CsTouristDataPO::getEnginerId).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
}else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode())||Objects.equals(role,"bxs_user")){
|
}
|
||||||
|
// ||Objects.equals(role,"bxs_user")
|
||||||
|
else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode())){
|
||||||
List<CsEngineeringPO> csEngineeringPOS = csEngineeringMapper.selectList(null);
|
List<CsEngineeringPO> csEngineeringPOS = csEngineeringMapper.selectList(null);
|
||||||
collect =csEngineeringPOS.stream().filter(temp->Objects.equals(temp.getStatus(),"1")).map(CsEngineeringPO::getId).collect(Collectors.toList());
|
collect =csEngineeringPOS.stream().filter(temp->Objects.equals(temp.getStatus(),"1")).map(CsEngineeringPO::getId).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
@@ -196,7 +196,9 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
List<CsTouristDataPO> csTouristDataPOS = csTouristDataPOMapper.selectList(null);
|
List<CsTouristDataPO> csTouristDataPOS = csTouristDataPOMapper.selectList(null);
|
||||||
collect = csTouristDataPOS.stream().map(CsTouristDataPO::getDeviceId).distinct().collect(Collectors.toList());
|
collect = csTouristDataPOS.stream().map(CsTouristDataPO::getDeviceId).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
}else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode())||Objects.equals(role,"bxs_user")){
|
}
|
||||||
|
// ||Objects.equals(role,"bxs_user")
|
||||||
|
else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode())){
|
||||||
csLedgerQueryWrapper.clear();
|
csLedgerQueryWrapper.clear();
|
||||||
csLedgerQueryWrapper.eq("level",2).eq("state",1);
|
csLedgerQueryWrapper.eq("level",2).eq("state",1);
|
||||||
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class InfluxDbParamUtil {
|
|||||||
//如果是云前置设备,直接返回clDid
|
//如果是云前置设备,直接返回clDid
|
||||||
boolean isCLdDevice = DicDataEnum.DEV_CLD.getCode().equals(dictTreeFeignClient.queryById(csEquipmentDeliveryDTOList.get(0).getDevType()).getData().getCode());
|
boolean isCLdDevice = DicDataEnum.DEV_CLD.getCode().equals(dictTreeFeignClient.queryById(csEquipmentDeliveryDTOList.get(0).getDevType()).getData().getCode());
|
||||||
if(isCLdDevice){
|
if(isCLdDevice){
|
||||||
// return String.valueOf(finalCsLinePOList.get(0).getLineNo());
|
return String.valueOf(finalCsLinePOList.get(0).getLineNo());
|
||||||
}
|
}
|
||||||
//之后的逻辑还是按照原来的不变
|
//之后的逻辑还是按照原来的不变
|
||||||
String position = csLineFeignClient.getPositionById(lineId).getData();
|
String position = csLineFeignClient.getPositionById(lineId).getData();
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.njcn.csharmonic.param;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FittingDataQueryParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "监测点")
|
||||||
|
@NotBlank(message = "监测点ID不可为空")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "searchBeginTime", value = "开始时间")
|
||||||
|
@NotBlank(message = "起始时间不可为空")
|
||||||
|
@DateTimeStrValid(message = "起始时间格式出错")
|
||||||
|
private String searchBeginTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "searchEndTime", value = "结束时间")
|
||||||
|
@NotBlank(message = "结束时间不可为空")
|
||||||
|
private String searchEndTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用于选择多个指标及谐波次数")
|
||||||
|
List<FittingDataQueryParam> list;
|
||||||
|
@ApiModelProperty(value = "指标组id")
|
||||||
|
private String statisticalId;
|
||||||
|
@ApiModelProperty(value = "一次值:Primary;二次值:Secondary")
|
||||||
|
private String dataLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "取值类型:Max,Min,cp95,avg(用户功率专用)")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "频次2-50(谐波电压、谐波电流专用)")
|
||||||
|
private String frequency;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.njcn.csharmonic.param;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TrendDataQueryParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "监测点")
|
||||||
|
@NotBlank(message = "监测点ID不可为空")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "searchBeginTime", value = "开始时间")
|
||||||
|
@NotBlank(message = "起始时间不可为空")
|
||||||
|
@DateTimeStrValid(message = "起始时间格式出错")
|
||||||
|
private String searchBeginTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "searchEndTime", value = "结束时间")
|
||||||
|
@NotBlank(message = "结束时间不可为空")
|
||||||
|
private String searchEndTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用于选择多个指标及谐波次数")
|
||||||
|
List<TrendDataQueryParam> list;
|
||||||
|
@ApiModelProperty(value = "指标组id")
|
||||||
|
private String statisticalId;
|
||||||
|
@ApiModelProperty(value = "取值类型(Max,Min,cp95,avg)")
|
||||||
|
private String valueType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "一次值:Primary;二次值:Secondary")
|
||||||
|
private String dataLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "频次2-50")
|
||||||
|
private String frequency;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ import lombok.NoArgsConstructor;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName(value = "cs_configuration")
|
@TableName(value = "cs_configuration")
|
||||||
public class CsConfigurationPO extends BaseEntity {
|
public class CsConfigurationPO extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public class CsPagePO extends BaseEntity {
|
|||||||
@TableField(value = "`status`")
|
@TableField(value = "`status`")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
public static final String COL_ID = "id";
|
public static final String COL_ID = "id";
|
||||||
@@ -74,4 +75,7 @@ public class CsPagePO extends BaseEntity {
|
|||||||
public static final String COL_UPDATE_BY = "update_by";
|
public static final String COL_UPDATE_BY = "update_by";
|
||||||
|
|
||||||
public static final String COL_UPDATE_TIME = "update_time";
|
public static final String COL_UPDATE_TIME = "update_time";
|
||||||
|
|
||||||
|
public static final String SORT = "sort";
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
String name = csConfigurationPO.getName();
|
String name = csConfigurationPO.getName();
|
||||||
Integer count = this.lambdaQuery().eq(CsConfigurationPO::getName, name).eq(CsConfigurationPO::getStatus, "1").count();
|
Integer count = this.lambdaQuery().eq(CsConfigurationPO::getName, name).eq(CsConfigurationPO::getStatus, "1").count();
|
||||||
if(count>1){
|
if(count>1){
|
||||||
throw new BusinessException("存在相同的组态项目名称");
|
throw new BusinessException("存在相同的组态项目名称在其他工程项目中,无法新建");
|
||||||
}
|
}
|
||||||
return save;
|
return save;
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,12 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
boolean b = this.updateById(csConfigurationPO);
|
boolean b = this.updateById(csConfigurationPO);
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
Integer count = this.lambdaQuery().eq(CsConfigurationPO::getName, auditParm.getName()).ne(CsConfigurationPO::getId,auditParm.getId()).eq(CsConfigurationPO::getStatus, "1").count();
|
||||||
|
if(count>0){
|
||||||
|
throw new BusinessException("修改名称失败,存在相同的组态项目");
|
||||||
|
}
|
||||||
BeanUtils.copyProperties(auditParm,csConfigurationPO);
|
BeanUtils.copyProperties(auditParm,csConfigurationPO);
|
||||||
|
|
||||||
List<String> projectIds = auditParm.getProjectIds();
|
List<String> projectIds = auditParm.getProjectIds();
|
||||||
if(!CollectionUtils.isEmpty(projectIds)){
|
if(!CollectionUtils.isEmpty(projectIds)){
|
||||||
String projects = String.join(",", projectIds);
|
String projects = String.join(",", projectIds);
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public class CsPagePOServiceImpl extends ServiceImpl<CsPagePOMapper, CsPagePO> i
|
|||||||
queryWrapper.eq(StringUtils.isNotBlank (csPageParam.getPid()),CsPagePO.COL_PID,csPageParam.getPid()).
|
queryWrapper.eq(StringUtils.isNotBlank (csPageParam.getPid()),CsPagePO.COL_PID,csPageParam.getPid()).
|
||||||
like(StringUtils.isNotBlank (csPageParam.getSearchValue()),CsPagePO.COL_NAME,csPageParam.getSearchValue()).
|
like(StringUtils.isNotBlank (csPageParam.getSearchValue()),CsPagePO.COL_NAME,csPageParam.getSearchValue()).
|
||||||
eq ("status",1).
|
eq ("status",1).
|
||||||
orderByAsc(CsPagePO.COL_KID);
|
orderByAsc(CsPagePO.SORT);
|
||||||
|
|
||||||
IPage<CsPagePO> pageData = this.page(new Page<>(csPageParam.getPageNum(), csPageParam.getPageSize()), queryWrapper);
|
IPage<CsPagePO> pageData = this.page(new Page<>(csPageParam.getPageNum(), csPageParam.getPageSize()), queryWrapper);
|
||||||
List<String> collect1 = pageData.getRecords().stream().map(CsPagePO::getCreateBy).collect(Collectors.toList());
|
List<String> collect1 = pageData.getRecords().stream().map(CsPagePO::getCreateBy).collect(Collectors.toList());
|
||||||
@@ -123,7 +123,7 @@ public class CsPagePOServiceImpl extends ServiceImpl<CsPagePOMapper, CsPagePO> i
|
|||||||
CsPageVO csPageVO = new CsPageVO();
|
CsPageVO csPageVO = new CsPageVO();
|
||||||
CsConfigurationPO csConfigurationPO = csConfigurationMapper.selectById(temp.getPid());
|
CsConfigurationPO csConfigurationPO = csConfigurationMapper.selectById(temp.getPid());
|
||||||
BeanUtils.copyProperties(temp, csPageVO);
|
BeanUtils.copyProperties(temp, csPageVO);
|
||||||
csPageVO.setKId(temp.getKId());
|
// csPageVO.setKId(temp.getKId());
|
||||||
csPageVO.setConfigurationName(csConfigurationPO.getName());
|
csPageVO.setConfigurationName(csConfigurationPO.getName());
|
||||||
InputStream fileStream = fileStorageUtil.getFileStream(temp.getPath());
|
InputStream fileStream = fileStorageUtil.getFileStream(temp.getPath());
|
||||||
String text = new BufferedReader(
|
String text = new BufferedReader(
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.njcn.cssystem.pojo.param;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WlUserParam implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工程id集合")
|
||||||
|
private List<String> engineeringList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "便携式设备id")
|
||||||
|
private List<String> portableDevList;
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.njcn.cssystem.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WlUserVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工程集合")
|
||||||
|
private List<EngineeringVo> engineeringList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "便携式设备集合")
|
||||||
|
private List<portableDevVo> portableDevList;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class EngineeringVo implements Serializable{
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工程id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工程名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class portableDevVo implements Serializable{
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设备id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设备名称")
|
||||||
|
private String name;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.njcn.cssystem.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.common.utils.LogUtil;
|
||||||
|
import com.njcn.cssystem.pojo.param.WlUserParam;
|
||||||
|
import com.njcn.cssystem.pojo.vo.WlUserVo;
|
||||||
|
import com.njcn.cssystem.service.IWlUserService;
|
||||||
|
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 xy
|
||||||
|
* @since 2025-11-12
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wlUser")
|
||||||
|
@Api(tags = "用户设备分配")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class WlUserController extends BaseController {
|
||||||
|
|
||||||
|
private final IWlUserService wlUserService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||||
|
@PostMapping("/selectDevByUserId")
|
||||||
|
@ApiOperation("根据用户id查询工程和便携式设备")
|
||||||
|
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
||||||
|
public HttpResult<WlUserVo> selectDevByUserId(@RequestParam @Validated String userId ) {
|
||||||
|
String methodDescribe = getMethodDescribe("selectDevByUserId");
|
||||||
|
LogUtil.njcnDebug(log, "{},用户数据为:{}", methodDescribe, userId);
|
||||||
|
WlUserVo vo = wlUserService.selectDevByUserId(userId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/addUserDev")
|
||||||
|
@ApiOperation("用户绑定工程和便携式设备")
|
||||||
|
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||||
|
public HttpResult<WlUserVo> addUserDev(@RequestBody @Validated WlUserParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("addUserDev");
|
||||||
|
LogUtil.njcnDebug(log, "{},参数:{}", methodDescribe, param);
|
||||||
|
wlUserService.addUserDev(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||||
|
@PostMapping("/deleteUserDev")
|
||||||
|
@ApiOperation("用户取消绑定工程和便携式设备")
|
||||||
|
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||||
|
public HttpResult<WlUserVo> deleteUserDev(@RequestBody @Validated WlUserParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("deleteUserDev");
|
||||||
|
LogUtil.njcnDebug(log, "{},参数:{}", methodDescribe, param);
|
||||||
|
wlUserService.deleteUserDev(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.cssystem.service;
|
||||||
|
|
||||||
|
import com.njcn.cssystem.pojo.param.WlUserParam;
|
||||||
|
import com.njcn.cssystem.pojo.vo.WlUserVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
public interface IWlUserService {
|
||||||
|
|
||||||
|
WlUserVo selectDevByUserId(String userId);
|
||||||
|
|
||||||
|
void addUserDev(WlUserParam param);
|
||||||
|
|
||||||
|
void deleteUserDev(WlUserParam param);
|
||||||
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package com.njcn.cssystem.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.njcn.csdevice.api.CsDeviceUserFeignClient;
|
||||||
|
import com.njcn.csdevice.api.CsLedgerFeignClient;
|
||||||
|
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||||
|
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
|
import com.njcn.cssystem.pojo.param.WlUserParam;
|
||||||
|
import com.njcn.cssystem.pojo.vo.WlUserVo;
|
||||||
|
import com.njcn.cssystem.service.IWlUserService;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class WlUserServiceImpl implements IWlUserService {
|
||||||
|
|
||||||
|
private final CsDeviceUserFeignClient csDeviceUserFeignClient;
|
||||||
|
private final CsLedgerFeignClient csLedgerFeignClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WlUserVo selectDevByUserId(String userId) {
|
||||||
|
WlUserVo wlUserVo = new WlUserVo();
|
||||||
|
List<WlUserVo.EngineeringVo> list1 = new ArrayList<>();
|
||||||
|
List<WlUserVo.portableDevVo> list2 = new ArrayList<>();
|
||||||
|
//根据用户信息获取设备信息
|
||||||
|
List<String> devList = csDeviceUserFeignClient.findDevByUserId(userId).getData();
|
||||||
|
//根据设备查询工程信息
|
||||||
|
if (CollectionUtil.isNotEmpty(devList)) {
|
||||||
|
List<DevDetailDTO> ledger = csLedgerFeignClient.getInfoByIds(devList).getData();
|
||||||
|
ledger.forEach(item->{
|
||||||
|
if (Objects.equals(item.getEngineeringid(),"/")) {
|
||||||
|
WlUserVo.portableDevVo portableDevVo = new WlUserVo.portableDevVo();
|
||||||
|
portableDevVo.setId(item.getEquipmentId());
|
||||||
|
portableDevVo.setName(item.getEquipmentName());
|
||||||
|
list2.add(portableDevVo);
|
||||||
|
} else {
|
||||||
|
WlUserVo.EngineeringVo engineeringVo = new WlUserVo.EngineeringVo();
|
||||||
|
engineeringVo.setId(item.getEngineeringid());
|
||||||
|
engineeringVo.setName(item.getEngineeringName());
|
||||||
|
list1.add(engineeringVo);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
wlUserVo.setEngineeringList(list1);
|
||||||
|
wlUserVo.setPortableDevList(list2);
|
||||||
|
return wlUserVo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addUserDev(WlUserParam param) {
|
||||||
|
List<String> devList = new ArrayList<>();
|
||||||
|
if (CollectionUtil.isNotEmpty(param.getEngineeringList())) {
|
||||||
|
//根据工程id获取设备id
|
||||||
|
List<DevDetailDTO> dto = csLedgerFeignClient.getDevInfoByEngineerIds(param.getEngineeringList()).getData();
|
||||||
|
if (CollectionUtil.isNotEmpty(dto)) {
|
||||||
|
devList.addAll(dto.stream().map(DevDetailDTO::getEquipmentId).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(param.getPortableDevList())) {
|
||||||
|
devList.addAll(param.getPortableDevList());
|
||||||
|
}
|
||||||
|
//存储用户和设备的关系
|
||||||
|
if (CollectionUtil.isNotEmpty(devList)) {
|
||||||
|
List<CsDeviceUserPO> list = new ArrayList<>();
|
||||||
|
devList.forEach(item->{
|
||||||
|
CsDeviceUserPO po = new CsDeviceUserPO();
|
||||||
|
po.setPrimaryUserId(param.getUserId());
|
||||||
|
po.setSubUserId(param.getUserId());
|
||||||
|
po.setDeviceId(item);
|
||||||
|
po.setStatus("1");
|
||||||
|
list.add(po);
|
||||||
|
});
|
||||||
|
csDeviceUserFeignClient.add(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteUserDev(WlUserParam param) {
|
||||||
|
List<String> devList = new ArrayList<>();
|
||||||
|
if (CollectionUtil.isNotEmpty(param.getEngineeringList())) {
|
||||||
|
//根据工程id获取设备id
|
||||||
|
List<DevDetailDTO> dto = csLedgerFeignClient.getDevInfoByEngineerIds(param.getEngineeringList()).getData();
|
||||||
|
if (CollectionUtil.isNotEmpty(dto)) {
|
||||||
|
devList.addAll(dto.stream().map(DevDetailDTO::getEquipmentId).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(param.getPortableDevList())) {
|
||||||
|
devList.addAll(param.getPortableDevList());
|
||||||
|
}
|
||||||
|
//解绑用户和设备的关系
|
||||||
|
if (CollectionUtil.isNotEmpty(devList)) {
|
||||||
|
UserDevParam par = new UserDevParam();
|
||||||
|
par.setUserId(param.getUserId());
|
||||||
|
par.setList(devList);
|
||||||
|
csDeviceUserFeignClient.channelDevByUserId(par);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user