Compare commits
58 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 814b5757fd | |||
| 9d2b4b97f9 | |||
| ee07f7a5e2 | |||
| 214f297297 | |||
|
|
b908186758 | ||
| 0d1c142885 | |||
| 43b8473976 | |||
| 8c442d8897 | |||
| 066dceaeaf | |||
| 9dca3408ae | |||
| 0d7d1781e3 | |||
| b794842d33 | |||
| 5e0c2d5cbc | |||
| 6c9a33c05d | |||
| a847f541f1 | |||
| 94b5b92991 | |||
| 882d56a2c5 | |||
| 1629e1c4cc | |||
| 45846e1889 | |||
| 030384333e | |||
| dc9958b249 | |||
| a607437225 | |||
| d277eba5fb | |||
| 913c2ef262 | |||
| 0fe80e12b5 | |||
| ffb6ead753 | |||
| 6782b19b7d | |||
| eeb22c749a | |||
| 31c21a43f4 | |||
| a923978f72 | |||
| 40588c6cd4 | |||
| cb76943f0f | |||
| 660925df31 | |||
| 0ce5840d02 | |||
| 9bd6ca43e1 | |||
| d6056e2cac | |||
| 8d8eb4d274 | |||
| b045860a43 | |||
| c0c3ae4e41 | |||
| 443adfaa37 | |||
| a314b3c862 | |||
| 282a592a13 | |||
| 0f839dfd5b | |||
| 45f706475b | |||
| 0a06d2d5eb | |||
| bba6da3c7d | |||
| 71d59528a3 | |||
| 06de2121f6 | |||
| 65d39224ed | |||
| fda83a1bd9 | |||
| 4ee41b833b | |||
|
|
cd07f8bee3 | ||
| 58a559b7b7 | |||
|
|
52342d736d | ||
| 6f5ffb8395 | |||
|
|
ed7c02a116 | ||
|
|
e12d23d4e1 | ||
| 0965eed31b |
@@ -0,0 +1,20 @@
|
||||
package com.njcn.csdevice.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.fallback.CsCommunicateFeignClientFallbackFactory;
|
||||
import com.njcn.csdevice.pojo.dto.PqsCommunicateDto;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/pqsCommunicate", fallbackFactory = CsCommunicateFeignClientFallbackFactory.class,contextId = "pqsCommunicate")
|
||||
|
||||
public interface CsCommunicateFeignClient {
|
||||
|
||||
@PostMapping("/insertion")
|
||||
HttpResult<String> insertion(@RequestBody PqsCommunicateDto pqsCommunicateDto);
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.njcn.csdevice.api;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.api.fallback.CsLedgerFeignClientFallbackFactory;
|
||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
||||
@@ -39,4 +43,9 @@ public interface CsLedgerFeignClient {
|
||||
@PostMapping("/deviceTree")
|
||||
@ApiOperation("三层设备树(装置层)")
|
||||
HttpResult<List<CsLedgerVO>> getDeviceTree();
|
||||
}
|
||||
|
||||
@PostMapping("/getAllLedger")
|
||||
HttpResult<List<CsLedgerVO>> getAllLedger();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -44,5 +44,8 @@ public interface CsLineFeignClient {
|
||||
HttpResult<CsLinePO> getById(@RequestParam("lineId") String lineId);
|
||||
|
||||
@PostMapping("/getLinesByDevList")
|
||||
HttpResult<List<CsLinePO>> getLinesByDevList(@RequestParam("ids") List<String> ids);
|
||||
HttpResult<List<CsLinePO>> getLinesByDevList(@RequestBody List<String> ids);
|
||||
|
||||
@PostMapping("/updateLineDataByList")
|
||||
HttpResult<String> updateDataByList(@RequestParam("list") List<String> list, @RequestParam("id") String id, @RequestParam("setId") String setId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.csdevice.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.fallback.CsTerminalLogsClientFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/csTerminalLogs", fallbackFactory = CsTerminalLogsClientFallbackFactory.class,contextId = "csTerminalLogs")
|
||||
|
||||
public interface CsTerminalLogsFeignClient {
|
||||
|
||||
@PostMapping("/updateLaterData")
|
||||
HttpResult<String> updateLaterData(@RequestParam("id") String id, @RequestParam("code") String code);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.csdevice.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.fallback.CsTerminalReplyClientFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/csTerminalReply", fallbackFactory = CsTerminalReplyClientFallbackFactory.class,contextId = "csTerminalReply")
|
||||
|
||||
public interface CsTerminalReplyFeignClient {
|
||||
|
||||
@PostMapping("/updateData")
|
||||
HttpResult<String> updateData(@RequestParam("id") String id,@RequestParam("state") Integer state,@RequestParam("deviceId") String deviceId);
|
||||
|
||||
}
|
||||
@@ -1,17 +1,10 @@
|
||||
package com.njcn.csdevice.api;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.api.fallback.DataSetFeignClientFallbackFactory;
|
||||
import com.njcn.csdevice.pojo.po.CsDataSet;
|
||||
import com.njcn.csdevice.pojo.vo.LineTargetVO;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@@ -28,4 +28,7 @@ public interface DevModelRelationFeignClient {
|
||||
@PostMapping("/getModelByType")
|
||||
HttpResult<String> getModelByType(@RequestParam("devId") String devId, @RequestParam("type") Integer type);
|
||||
|
||||
@PostMapping("/updateDataByList")
|
||||
HttpResult<String> updateDataByList(@RequestParam("list") List<String> list, @RequestParam("id") String id);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
package com.njcn.csdevice.api;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.api.fallback.EquipmentFeignClientFallbackFactory;
|
||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -56,4 +64,13 @@ public interface EquipmentFeignClient {
|
||||
|
||||
@PostMapping("/judgeDevModel")
|
||||
HttpResult<Boolean> judgeDevModel(@RequestParam("nDid") String nDid);
|
||||
|
||||
@PostMapping("/getDevByLineId")
|
||||
HttpResult<CsEquipmentDeliveryPO> getDevByLineId(@RequestParam("lineId") String lineId);
|
||||
|
||||
@PostMapping("/updateCldDevStatus")
|
||||
HttpResult<Boolean> updateCldDevStatus(@RequestParam("nodeId") String nodeId, @RequestParam("processNo") Integer processNo);
|
||||
|
||||
@PostMapping("/flipCldDevStatus")
|
||||
HttpResult<Boolean> flipCldDevStatus(@RequestParam("devId") String devId, @RequestParam("status") Integer status);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.csdevice.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.fallback.IntegrityClientFallbackFactory;
|
||||
import com.njcn.csdevice.pojo.po.RStatIntegrityD;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/rStatIntegrityD", fallbackFactory = IntegrityClientFallbackFactory.class,contextId = "rStatIntegrityD")
|
||||
public interface IntegrityFeignClient {
|
||||
|
||||
@PostMapping("/list")
|
||||
HttpResult<List<RStatIntegrityD>> list(@Validated @RequestParam("list") List<String> list, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.csdevice.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.fallback.NodeFallbackFactory;
|
||||
import com.njcn.csdevice.pojo.po.Node;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/node", fallbackFactory = NodeFallbackFactory.class,contextId = "node")
|
||||
public interface NodeFeignClient {
|
||||
|
||||
@ApiOperation("获取全部前置机")
|
||||
@GetMapping("/nodeAllList")
|
||||
HttpResult<List<Node>> nodeAllList();
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.csdevice.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.fallback.onlineRateClientFallbackFactory;
|
||||
import com.njcn.csdevice.pojo.po.RStatOnlineRateD;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/rStatOnlineRateD", fallbackFactory = onlineRateClientFallbackFactory.class,contextId = "rStatOnlineRateD")
|
||||
public interface OnlineRateFeignClient {
|
||||
|
||||
@PostMapping("/list")
|
||||
HttpResult<List<RStatOnlineRateD>> list(@Validated @RequestParam("list") List<String> list, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime);
|
||||
|
||||
}
|
||||
@@ -54,4 +54,7 @@ public interface WlRecordFeignClient {
|
||||
|
||||
@PostMapping("/findDevBaseDataByLineId")
|
||||
HttpResult<List<RecordVo>> findDevBaseDataByLineId(@RequestBody @Validated WlRecordParam.lineRecord param);
|
||||
|
||||
@GetMapping("/getTestRecordById")
|
||||
HttpResult<RecordVo.RecordItemVo> getTestRecordById(@RequestParam("testRecordId") @Validated String testRecordId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.njcn.csdevice.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.CsCommunicateFeignClient;
|
||||
import com.njcn.csdevice.pojo.dto.PqsCommunicateDto;
|
||||
import com.njcn.csdevice.utils.CsDeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/4/10 20:09
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CsCommunicateFeignClientFallbackFactory implements FallbackFactory<CsCommunicateFeignClient> {
|
||||
@Override
|
||||
public CsCommunicateFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (cause.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
exceptionEnum = CsDeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new CsCommunicateFeignClient() {
|
||||
@Override
|
||||
public HttpResult<String> insertion(PqsCommunicateDto pqsCommunicateDto) {
|
||||
log.error("{}异常,降级处理,异常为:{}","新增记录",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -62,6 +62,12 @@ public class CsLedgerFeignClientFallbackFactory implements FallbackFactory<CsLed
|
||||
log.error("{}异常,降级处理,异常为:{}","查询设备树",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<CsLedgerVO>> getAllLedger() {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取台账树所有数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,6 +80,12 @@ public class CsLineClientFallbackFactory implements FallbackFactory<CsLineFeignC
|
||||
log.error("{}异常,降级处理,异常为:{}","根据装置id集合获取监测点id集合",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> updateDataByList(List<String> list, String id, String setId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据装置集合修改监测点信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.csdevice.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.CsTerminalLogsFeignClient;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CsTerminalLogsClientFallbackFactory implements FallbackFactory<CsTerminalLogsFeignClient> {
|
||||
@Override
|
||||
public CsTerminalLogsFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (cause.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new CsTerminalLogsFeignClient() {
|
||||
@Override
|
||||
public HttpResult<String> updateLaterData(String id, String code) {
|
||||
log.error("{}异常,降级处理,异常为:{}","更新最新一组数据的推送状态",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.csdevice.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.CsTerminalReplyFeignClient;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CsTerminalReplyClientFallbackFactory implements FallbackFactory<CsTerminalReplyFeignClient> {
|
||||
@Override
|
||||
public CsTerminalReplyFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (cause.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new CsTerminalReplyFeignClient() {
|
||||
@Override
|
||||
public HttpResult<String> updateData(String id, Integer state, String deviceId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","更新推送结果",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,12 @@ public class DevModelRelationFeignClientFallbackFactory implements FallbackFacto
|
||||
log.error("{}异常,降级处理,异常为:{}","根据装置类型查询模板",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> updateDataByList(List<String> list, String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据装置集合修改模板信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,6 +83,25 @@ public class EquipmentFeignClientFallbackFactory implements FallbackFactory<Equi
|
||||
log.error("{}异常,降级处理,异常为:{}","判断设备型号",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<CsEquipmentDeliveryPO> getDevByLineId(String lineId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据监测点id查询装置信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Boolean> updateCldDevStatus(String nodeId, Integer processNo) {
|
||||
log.error("{}异常,降级处理,异常为:{}","云前置心跳丢失切换设备状态",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Boolean> flipCldDevStatus(String devId, Integer status) {
|
||||
log.error("{}异常,降级处理,异常为:{}","云前置设备状态翻转",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.njcn.csdevice.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.IntegrityFeignClient;
|
||||
import com.njcn.csdevice.pojo.po.RStatIntegrityD;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class IntegrityClientFallbackFactory implements FallbackFactory<IntegrityFeignClient> {
|
||||
@Override
|
||||
public IntegrityFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (cause.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new IntegrityFeignClient() {
|
||||
|
||||
@Override
|
||||
public HttpResult<List<RStatIntegrityD>> list(List<String> list, String startTime, String endTime) {
|
||||
log.error("{}异常,降级处理,异常为:{}","查询数据异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.njcn.csdevice.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.NodeFeignClient;
|
||||
import com.njcn.csdevice.pojo.po.Node;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class NodeFallbackFactory implements FallbackFactory<NodeFeignClient> {
|
||||
@Override
|
||||
public NodeFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (cause.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new NodeFeignClient() {
|
||||
|
||||
@Override
|
||||
public HttpResult<List<Node>> nodeAllList() {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取全部前置机异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -70,6 +70,12 @@ public class WlRecordClientFallbackFactory implements FallbackFactory<WlRecordFe
|
||||
log.error("{}异常,降级处理,异常为:{}","根据监测点id查询装置基础数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<RecordVo.RecordItemVo> getTestRecordById(String testRecordId) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据测试项ID查询测试项信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.njcn.csdevice.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.OnlineRateFeignClient;
|
||||
import com.njcn.csdevice.pojo.po.RStatOnlineRateD;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class onlineRateClientFallbackFactory implements FallbackFactory<OnlineRateFeignClient> {
|
||||
@Override
|
||||
public OnlineRateFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (cause.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new OnlineRateFeignClient() {
|
||||
|
||||
@Override
|
||||
public HttpResult<List<RStatOnlineRateD>> list(List<String> list, String startTime, String endTime) {
|
||||
log.error("{}异常,降级处理,异常为:{}","查询数据异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,8 @@ public interface DataParam {
|
||||
|
||||
String GOVERNANCE_SYSTEM = "治理系统";
|
||||
|
||||
String cldDev = "云前置设备";
|
||||
|
||||
String EvtParamPhase = "Evt_Param_Phase";
|
||||
|
||||
String EvtParamDepth = "Evt_Param_VVaDepth";
|
||||
|
||||
@@ -35,7 +35,6 @@ public enum AlgorithmResponseEnum {
|
||||
CHIRLDREN2_EXIST("A00514","项目下存在设备,不能删除"),
|
||||
CHIRLDREN3_EXIST("A00516","存在设备使用拓扑图,不能删除"),
|
||||
|
||||
|
||||
DATA_ARRAY_MISSING("A00515","详细数据为空"),
|
||||
UNKNOW_ROLE("A00515","角色无权限操作"),
|
||||
DATA_MISSING("A00516","数据缺失"),
|
||||
@@ -48,6 +47,13 @@ public enum AlgorithmResponseEnum {
|
||||
RECORD_FILE_LOST("A00516","record.bin文件缺失,请检查上传文件夹"),
|
||||
LINE_NUM_MISMATCH("A00516","上传文件的监测点序号和选择的监测点不匹配,请检查"),
|
||||
DEV_OFFLINE("A00516","装置未连接MQTT服务器"),
|
||||
OVER_MAX_DEV_COUNT("A00517","前置机超出最大支持装置数"),
|
||||
DEV_OLD_DATA("A00519","进程数修改失败,原进程数下存在装置,请修改装置进程号"),
|
||||
DEV_EXIST_DATA("A00520","删除失败,前置机下存在装置"),
|
||||
|
||||
CLD_MODEL_MISSING("A00521","云前置模板缺失,请检查模板信息"),
|
||||
CLD_MODEL_MORE("A00521","存在多个云前置模板,请检查模板信息"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.njcn.csdevice.param;
|
||||
|
||||
import com.njcn.csdevice.pojo.param.AppProjectAddParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEngineeringAddParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEquipmentDeliveryAddParm;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Data
|
||||
public class IcdLedgerParam implements Serializable {
|
||||
|
||||
@ApiModelProperty("工程索引")
|
||||
private String engineeringIndex;
|
||||
|
||||
@ApiModelProperty("项目索引")
|
||||
private String projectIndex;
|
||||
|
||||
@ApiModelProperty("设备id")
|
||||
private String devIndex;
|
||||
|
||||
@ApiModelProperty("设备和mac关系")
|
||||
private Map<String,String> devMacMap;
|
||||
|
||||
@ApiModelProperty("设备mac和设备信息关系")
|
||||
private Map<String, CsEquipmentDeliveryPO> devMap;
|
||||
|
||||
@ApiModelProperty("工程信息")
|
||||
private CsEngineeringAddParm engineering;
|
||||
|
||||
@ApiModelProperty("项目信息")
|
||||
private AppProjectAddParm project;
|
||||
|
||||
@ApiModelProperty("装置信息")
|
||||
private List<CsEquipmentDeliveryAddParm> device;
|
||||
|
||||
@ApiModelProperty("监测点信息")
|
||||
private List<CsLineParam> line;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.csdevice.param;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Data
|
||||
public class IcdParam implements Serializable {
|
||||
|
||||
@ApiModelProperty("前置id,不传时查询所有的终端台账信息")
|
||||
@NotBlank(message = "前置id不可为空")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("终端运行状态,不传则查询所有的终端信息 (0:运行;1:检修;2:停运;3:调试;4:退运)")
|
||||
private List<Integer> runFlag;
|
||||
|
||||
@ApiModelProperty("终端型号(集合为空查询所有icd模型)")
|
||||
private List<String> devType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.njcn.csdevice.param;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监测点有效数值统计数据评估入参
|
||||
*
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/6 20:36
|
||||
*/
|
||||
@Data
|
||||
public class LineCountEvaluateParam implements Serializable {
|
||||
|
||||
/**
|
||||
* 监测点编号集合
|
||||
*/
|
||||
private List<String> lineId;
|
||||
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String tableName;
|
||||
|
||||
/**
|
||||
* 相别集合
|
||||
*/
|
||||
private List<String> phasicType;
|
||||
|
||||
/**
|
||||
* 值类型
|
||||
*/
|
||||
private List<String> valueType;
|
||||
|
||||
/**
|
||||
* 异常数据时间集合
|
||||
* Map<String,List<String>> key:监测点id value:异常时间集合
|
||||
*/
|
||||
private Map<String, List<String>> abnormalTime;
|
||||
|
||||
/**
|
||||
* 列名
|
||||
*/
|
||||
private String columnName;
|
||||
|
||||
/**
|
||||
* 最小值 >=
|
||||
*/
|
||||
private String ge;
|
||||
|
||||
/**
|
||||
* 最大值 <=
|
||||
*/
|
||||
private String lt;
|
||||
|
||||
/**
|
||||
* 数据类型 判断获取数据是否排除暂态异常数据
|
||||
*/
|
||||
private Boolean dataType = true;
|
||||
|
||||
private String startTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.csdevice.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/10 10:01
|
||||
*/
|
||||
@Data
|
||||
public class PqsCommunicateDto implements Serializable {
|
||||
|
||||
private String time;
|
||||
|
||||
private String devId;
|
||||
|
||||
private String description;
|
||||
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@@ -20,16 +19,16 @@ import java.util.List;
|
||||
@Data
|
||||
public class AppProjectAddParm {
|
||||
|
||||
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value="项目名称")
|
||||
@NotBlank(message="项目名称不能为空!")
|
||||
private String name;
|
||||
|
||||
@NotBlank(message="工程id不能为空!")
|
||||
//@NotBlank(message="工程id不能为空!")
|
||||
private String engineeringId;
|
||||
|
||||
private String icdEngineeringId;
|
||||
|
||||
/**
|
||||
* 地市Id
|
||||
|
||||
@@ -5,6 +5,7 @@ import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -17,8 +18,7 @@ import javax.validation.constraints.Pattern;
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class CsEquipmentDeliveryAddParm{
|
||||
|
||||
public class CsEquipmentDeliveryAddParm implements Serializable {
|
||||
|
||||
/**
|
||||
* 装置名称
|
||||
@@ -39,7 +39,6 @@ public class CsEquipmentDeliveryAddParm{
|
||||
* 装置mac地址
|
||||
*/
|
||||
@ApiModelProperty(value="装置mac地址")
|
||||
// @NotBlank(message="装置mac地址不能为空!")
|
||||
private String mac;
|
||||
|
||||
/**
|
||||
@@ -56,56 +55,12 @@ public class CsEquipmentDeliveryAddParm{
|
||||
@NotBlank(message="装置型号不能为空!")
|
||||
private String devModel;
|
||||
|
||||
// /**
|
||||
// * 装置程序版本
|
||||
// */
|
||||
// @ApiModelProperty(value="装置程序版本")
|
||||
// @NotBlank(message="装置程序版本不能为空!")
|
||||
// private String programVersion;
|
||||
|
||||
// /**
|
||||
// * 调试人员
|
||||
// */
|
||||
// @ApiModelProperty(value="调试人员")
|
||||
// @NotBlank(message="调试人员不能为空!")
|
||||
// private String debugPerson;
|
||||
//
|
||||
// /**
|
||||
// * 出厂日期
|
||||
// */
|
||||
// @ApiModelProperty(value="出厂日期")
|
||||
// @NotNull(message="出厂日期不能为空!")
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
// private Date producteTime;
|
||||
//
|
||||
// /**
|
||||
// * 检修日期
|
||||
// */
|
||||
// @ApiModelProperty(value="检修日期")
|
||||
// @NotNull(message="检修日期不能为空!")
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
// private Date checkTime;
|
||||
//
|
||||
// /**
|
||||
// * 调试日期
|
||||
// */
|
||||
// @ApiModelProperty(value="调试日期")
|
||||
// @NotNull(message="调试日期不能为空!")
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
// private Date debugTime;
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
@ApiModelProperty(value="合同号")
|
||||
private String cntractNo;
|
||||
|
||||
// /**
|
||||
// * 营销经理
|
||||
// */
|
||||
// @ApiModelProperty(value="营销经理")
|
||||
// private String salesManager;
|
||||
|
||||
/**
|
||||
* 装置接入方式
|
||||
*/
|
||||
@@ -127,4 +82,19 @@ public class CsEquipmentDeliveryAddParm{
|
||||
@ApiModelProperty(value="排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value="前置机id")
|
||||
private String nodeId;
|
||||
|
||||
@ApiModelProperty(value="前置机进程号")
|
||||
private Integer nodeProcess;
|
||||
|
||||
@ApiModelProperty(value="模板id")
|
||||
private String modelId;
|
||||
|
||||
@ApiModelProperty(value="工程id")
|
||||
private String engineeringId;
|
||||
|
||||
@ApiModelProperty(value="项目id")
|
||||
private String projectId;
|
||||
|
||||
}
|
||||
@@ -95,4 +95,10 @@ public class CsEquipmentDeliveryAuditParm {
|
||||
|
||||
@ApiModelProperty(value="排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value="前置机id")
|
||||
private String nodeId;
|
||||
|
||||
@ApiModelProperty(value="前置机进程号")
|
||||
private Integer nodeProcess;
|
||||
}
|
||||
@@ -34,4 +34,10 @@ public class CsEquipmentDeliveryQueryParm extends BaseParam {
|
||||
@ApiModelProperty("运行状态 1:离线 2:在线")
|
||||
private Integer runStatus;
|
||||
|
||||
@ApiModelProperty("流程步骤")
|
||||
private Integer process;
|
||||
|
||||
@ApiModelProperty("物联通讯状态 0:未连接 1:已连接")
|
||||
private Integer connectStatus;
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.csdevice.pojo.param;
|
||||
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -18,25 +19,71 @@ public class CsLineParam extends BaseEntity {
|
||||
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 监测点名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value="工程id")
|
||||
private String engineeringId;
|
||||
|
||||
@ApiModelProperty(value="项目id")
|
||||
private String projectId;
|
||||
|
||||
/**
|
||||
* 装置id
|
||||
*/
|
||||
private String devId;
|
||||
|
||||
/**
|
||||
* 装置mac
|
||||
*/
|
||||
private String devMac;
|
||||
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
private Double volGrade;
|
||||
|
||||
/**
|
||||
* PT变比
|
||||
* 接线方式
|
||||
*/
|
||||
private Integer conType;
|
||||
|
||||
/**
|
||||
* PT一次变比
|
||||
*/
|
||||
private Double ptRatio;
|
||||
|
||||
/**
|
||||
* CT变比
|
||||
* PT二次变比
|
||||
*/
|
||||
private Double pt2Ratio;
|
||||
|
||||
/**
|
||||
* CT一次变比
|
||||
*/
|
||||
private Double ctRatio;
|
||||
|
||||
/**
|
||||
* 接线方式
|
||||
* CT二次变比
|
||||
*/
|
||||
private Integer conType;
|
||||
private Double ct2Ratio;
|
||||
|
||||
/**
|
||||
* 逻辑子设备id
|
||||
*/
|
||||
private Integer clDid;
|
||||
|
||||
/**
|
||||
* 监测点线路号
|
||||
*/
|
||||
private Integer lineNo;
|
||||
|
||||
/**
|
||||
* 统计间隔
|
||||
*/
|
||||
private Integer lineInterval;
|
||||
|
||||
/**
|
||||
* 模板id
|
||||
@@ -49,8 +96,7 @@ public class CsLineParam extends BaseEntity {
|
||||
private String dataSetId;
|
||||
|
||||
/**
|
||||
* 统计间隔
|
||||
* 运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)
|
||||
*/
|
||||
private Integer lineInterval;
|
||||
|
||||
private Integer runStatus;
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.njcn.csdevice.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/14
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class NodeParam {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty(name = "name",value = "前置服务器名称")
|
||||
@NotBlank(message = "前置机名称不能为空")
|
||||
@Pattern(regexp = PatternRegex.DEV_NAME_REGEX, message = ValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 服务器IP
|
||||
*/
|
||||
@ApiModelProperty(name = "ip",value = "服务器IP")
|
||||
@NotBlank(message = "前置机IP不能为空")
|
||||
@Pattern(regexp = PatternRegex.IP_REGEX, message = ValidMessage.IP_FORMAT_ERROR)
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ApiModelProperty(name = "remark",value = "描述")
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 状态 前置等级
|
||||
*/
|
||||
@ApiModelProperty(name = "nodeGrade",value = "前置等级")
|
||||
@NotNull(message = "前置机等级不可为空")
|
||||
private Integer nodeGrade;
|
||||
|
||||
/**
|
||||
* 前置机支持最大装置数
|
||||
*/
|
||||
@ApiModelProperty(name = "nodeDevNum",value = "前置机支持最大装置数")
|
||||
@NotNull(message = "前置机支持最大装置数不可为空")
|
||||
@Min(value = 1, message = "装置数不可小于1")
|
||||
@Max(value = 1000, message = "装置数不可大于1000")
|
||||
private Integer nodeDevNum;
|
||||
|
||||
/**
|
||||
* 前置机支持最大进程数量
|
||||
*/
|
||||
@ApiModelProperty(name = "nodeDevNum",value = "前置机支持最大进程数量")
|
||||
@NotNull(message = "前置机支持最大进程数量")
|
||||
@Min(value = 1, message = "最大进程数量不可小于1")
|
||||
@Max(value = 10, message = "最大进程数量不可大于10")
|
||||
private Integer maxProcessNum;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ApiModelProperty(name = "sort",value = "排序")
|
||||
@NotNull(message = "排序不可为空")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class NodeUpdateParam extends NodeParam {
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 前置查询
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class NodeQueryParam extends BaseParam {
|
||||
@ApiModelProperty("前置等级")
|
||||
private Integer nodeGrade;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -64,8 +64,6 @@ public class CsEquipmentDeliveryPO extends BaseEntity {
|
||||
@TableField(value = "dev_access_method")
|
||||
private String devAccessMethod;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
@@ -120,4 +118,16 @@ public class CsEquipmentDeliveryPO extends BaseEntity {
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 前置服务器IP
|
||||
*/
|
||||
@TableField(value = "node_id")
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 前置进程号
|
||||
*/
|
||||
@TableField(value = "node_process")
|
||||
private Integer nodeProcess;
|
||||
|
||||
}
|
||||
@@ -66,12 +66,24 @@ public class CsLinePO extends BaseEntity {
|
||||
@TableField(value = "pt_ratio")
|
||||
private Double ptRatio;
|
||||
|
||||
/**
|
||||
* PT2次变比
|
||||
*/
|
||||
@TableField(value = "pt2_ratio")
|
||||
private Double pt2Ratio;
|
||||
|
||||
/**
|
||||
* CT变比
|
||||
*/
|
||||
@TableField(value = "ct_ratio")
|
||||
private Double ctRatio;
|
||||
|
||||
/**
|
||||
* CT2变比
|
||||
*/
|
||||
@TableField(value = "ct2_ratio")
|
||||
private Double ct2Ratio;
|
||||
|
||||
/**
|
||||
* 状态(0:删除 1:正常)
|
||||
*/
|
||||
@@ -86,9 +98,6 @@ public class CsLinePO extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 逻辑子设备id(与模板对应)
|
||||
* 治理监测点 0
|
||||
* 负载监测点 1
|
||||
* 电网监测点 2
|
||||
*/
|
||||
@TableField(value = "clDid")
|
||||
private Integer clDid;
|
||||
@@ -101,4 +110,16 @@ public class CsLinePO extends BaseEntity {
|
||||
*/
|
||||
@TableField(value = "line_interval")
|
||||
private Integer lineInterval;
|
||||
|
||||
/**
|
||||
* 运行状态
|
||||
*/
|
||||
@TableField(value = "run_status")
|
||||
private Integer runStatus;
|
||||
|
||||
/**
|
||||
* 监测点线路号
|
||||
*/
|
||||
@TableField(value = "line_no")
|
||||
private Integer lineNo;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.njcn.csdevice.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-09-26
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("cs_terminal_logs")
|
||||
public class CsTerminalLogs extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 前置服务器id
|
||||
*/
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 进程号
|
||||
*/
|
||||
private Integer nodeProcess;
|
||||
|
||||
/**
|
||||
* 操作类型(0:新增 1:修改 2:删除)
|
||||
*/
|
||||
private Integer operateType;
|
||||
|
||||
/**
|
||||
* 是否推送(0未推送 1已推送)
|
||||
*/
|
||||
private Integer isPush;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.njcn.csdevice.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-10-09
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("cs_terminal_reply")
|
||||
public class CsTerminalReply extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 消息id
|
||||
*/
|
||||
private String replyId;
|
||||
|
||||
/**
|
||||
* 操作类型
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 前置id
|
||||
*/
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 进程号
|
||||
*/
|
||||
private Integer processNo;
|
||||
|
||||
/**
|
||||
* 设备id集合
|
||||
*/
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 是否收到(0:未收到 1:收到)
|
||||
*/
|
||||
private Integer isReceived;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.njcn.csdevice.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("pq_node")
|
||||
public class Node extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 前置序号
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 服务器IP
|
||||
*/
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 状态 前置等级
|
||||
*/
|
||||
private Integer nodeGrade;
|
||||
|
||||
/**
|
||||
* 前置机支持最大装置数
|
||||
*/
|
||||
private Integer nodeDevNum;
|
||||
|
||||
|
||||
/**
|
||||
* 前置机支持最大进程数量
|
||||
*/
|
||||
private Integer maxProcessNum;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.njcn.csdevice.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据完整性日表
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-06-23
|
||||
*/
|
||||
@Data
|
||||
@TableName("r_stat_integrity_d")
|
||||
public class RStatIntegrityD implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@MppMultiId
|
||||
private LocalDate timeId;
|
||||
|
||||
@MppMultiId
|
||||
private String lineIndex;
|
||||
|
||||
private Integer dueTime;
|
||||
|
||||
private Integer realTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.njcn.csdevice.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 在线率日表
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-06-23
|
||||
*/
|
||||
@Data
|
||||
@TableName("r_stat_onlinerate_d")
|
||||
public class RStatOnlineRateD implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@MppMultiId
|
||||
private LocalDate timeId;
|
||||
|
||||
@MppMultiId
|
||||
private String devIndex;
|
||||
|
||||
private Integer onlineMin;
|
||||
|
||||
private Integer offlineMin;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import com.njcn.csdevice.pojo.po.AppProjectPO;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/ //台账信息
|
||||
@Data
|
||||
public class CldLedgerVo implements Serializable {
|
||||
|
||||
@ApiModelProperty("工程id")
|
||||
private String engineeringId;
|
||||
|
||||
@ApiModelProperty(value = "工程名称")
|
||||
private String engineeringName;
|
||||
|
||||
@ApiModelProperty(value = "省")
|
||||
private String province;
|
||||
|
||||
@ApiModelProperty(value = "市")
|
||||
private String city;
|
||||
|
||||
@ApiModelProperty(value = "工程描述")
|
||||
private String engineeringDescription;
|
||||
|
||||
@ApiModelProperty(value = "项目信息")
|
||||
private List<AppProjectPO> projectInfoList;
|
||||
|
||||
@ApiModelProperty(value = "设备信息")
|
||||
private List<CsEquipmentDeliveryPO> deviceInfoList;
|
||||
|
||||
@ApiModelProperty(value = "监测点信息")
|
||||
private List<CsLinePO> lineInfoList;
|
||||
|
||||
}
|
||||
@@ -86,6 +86,12 @@ public class CsEquipmentDeliveryVO extends BaseEntity {
|
||||
@ApiModelProperty(value="装置使用状态(0:停用 1:启用)")
|
||||
private Integer usageStatus ;
|
||||
|
||||
@ApiModelProperty(value="装置与MQTT服务器连接状态")
|
||||
private String connectStatus ;
|
||||
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value="前置服务器id")
|
||||
private String nodeId ;
|
||||
|
||||
}
|
||||
@@ -23,13 +23,25 @@ public class CsLedgerVO implements Serializable {
|
||||
@ApiModelProperty(name = "pid",value = "父id")
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty(name = "pids",value = "父id集合")
|
||||
private String pids;
|
||||
|
||||
@ApiModelProperty(name = "name",value = "名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(name = "path",value = "拓扑图路径")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty(name = "provinceId",value = "省Id")
|
||||
private String provinceId;
|
||||
|
||||
|
||||
@ApiModelProperty(name = "cityId",value = "市Id")
|
||||
private String cityId;
|
||||
|
||||
@ApiModelProperty(name = "area",value = "区域")
|
||||
private String area;
|
||||
|
||||
@ApiModelProperty(name = "remark",value = "备注")
|
||||
private String remark;
|
||||
|
||||
@@ -54,6 +66,9 @@ public class CsLedgerVO implements Serializable {
|
||||
@ApiModelProperty(name = "conType",value = "接线方式 0-星型 1-角型 2-V型")
|
||||
private Integer conType;
|
||||
|
||||
@ApiModelProperty(name = "process",value = "流程状态")
|
||||
private Integer process;
|
||||
|
||||
@ApiModelProperty(name = "children",value = "子节点")
|
||||
private List<CsLedgerVO> children = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
//台账信息
|
||||
@Data
|
||||
public class DeviceInfo implements Serializable {
|
||||
|
||||
@ApiModelProperty("终端索引")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("终端mac")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty("终端型号")
|
||||
private String devType;
|
||||
|
||||
@ApiModelProperty("终端名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("前置机序号")
|
||||
private Integer node;
|
||||
|
||||
@ApiModelProperty("开启的进程数")
|
||||
private Integer maxProcessNum;
|
||||
|
||||
@ApiModelProperty("对时启动标志")
|
||||
private boolean rightTime;
|
||||
|
||||
@ApiModelProperty("监测点集合")
|
||||
private List<MonitorInfo> monitorData;
|
||||
|
||||
//终端下的监测点信息
|
||||
@Data
|
||||
public static class MonitorInfo implements Serializable {
|
||||
|
||||
@ApiModelProperty("监测点索引")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("监测点逻辑号")
|
||||
private String lineNo;
|
||||
|
||||
@ApiModelProperty("监测点电压等级")
|
||||
private String voltageLevel;
|
||||
|
||||
@ApiModelProperty("监测点运行状态 0:运行;1:检修;2:停运;3:调试;4:退运")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("监测点接线方式 0-星型 1-角型 2-V型")
|
||||
private String ptType;
|
||||
|
||||
@ApiModelProperty("装置id")
|
||||
private String deviceId;
|
||||
|
||||
@ApiModelProperty("pt1")
|
||||
private Double pt1;
|
||||
|
||||
@ApiModelProperty("pt2")
|
||||
private Double pt2;
|
||||
|
||||
@ApiModelProperty("ct1")
|
||||
private Double ct1;
|
||||
|
||||
@ApiModelProperty("ct2")
|
||||
private Double ct2;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Data
|
||||
public class EachModuleVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("模块名称")
|
||||
private String moduleName;
|
||||
|
||||
@ApiModelProperty("模块状态")
|
||||
private String moduleState;
|
||||
|
||||
@ApiModelProperty("模块运行状态数据")
|
||||
List<HarmonicVo> dataList;
|
||||
|
||||
@ApiModelProperty("负载电流数据")
|
||||
List<DataVo> loadList;
|
||||
|
||||
@ApiModelProperty("模块输出电流")
|
||||
List<DataVo> modOutList;
|
||||
|
||||
@ApiModelProperty("模块温度")
|
||||
List<DataVo> temperatureList;
|
||||
|
||||
@Data
|
||||
public static class HarmonicVo implements Serializable {
|
||||
|
||||
@ApiModelProperty("稳态数据时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime time;
|
||||
|
||||
@ApiModelProperty("模块状态 0-离线,1-运行,2-停止,3-故障")
|
||||
private String stateDesc;
|
||||
|
||||
@ApiModelProperty("数据类型 0-稳态数据 1-事件数据 2-主动触发")
|
||||
private Integer dataType;
|
||||
|
||||
@ApiModelProperty("事件code")
|
||||
private String eventCode;
|
||||
|
||||
@ApiModelProperty("事件名称")
|
||||
private String eventName;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class DataVo implements Serializable {
|
||||
|
||||
@ApiModelProperty("稳态数据时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime time;
|
||||
|
||||
@ApiModelProperty("相别")
|
||||
private String phasicType;
|
||||
|
||||
@ApiModelProperty("数据")
|
||||
private Double data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.po.Node;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Data
|
||||
public class NodeProcessDeviceVo implements Serializable {
|
||||
|
||||
private Node node;
|
||||
|
||||
private List<ProcessDevice> processDeviceList;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public static class ProcessDevice implements Serializable{
|
||||
private Integer processNo;
|
||||
private String processState;
|
||||
private List<CsEquipmentDeliveryPO> deviceInfoList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -153,6 +153,12 @@
|
||||
<artifactId>access-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-mq</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.csdevice.controller.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
*
|
||||
* 动态注解类
|
||||
*
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/7 11:00
|
||||
*/
|
||||
@Target({ElementType.TYPE,ElementType.METHOD,ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface InsertBean {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.csdevice.controller.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
*
|
||||
* 动态注解类
|
||||
*
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/7 11:00
|
||||
*/
|
||||
@Target({ElementType.TYPE,ElementType.METHOD,ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface QueryBean {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.njcn.csdevice.controller.bean;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.controller.annotation.InsertBean;
|
||||
import com.njcn.csdevice.controller.annotation.QueryBean;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/7 11:31
|
||||
*/
|
||||
@Component
|
||||
public class DynamicBeanProcessor implements BeanPostProcessor {
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext context;
|
||||
|
||||
/**
|
||||
* 查询配置
|
||||
*/
|
||||
@Value("${data.source.query:Influxdb}")
|
||||
private String queryParam;
|
||||
|
||||
/**
|
||||
* 插入配置
|
||||
*/
|
||||
@Value("${data.source.insert:Relation}")
|
||||
private String insertParam;
|
||||
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
|
||||
if (bean.getClass().isAnnotationPresent(Controller.class) || bean.getClass().isAnnotationPresent(RestController.class) || bean.getClass().isAnnotationPresent(Service.class)) {
|
||||
processFields(bean);
|
||||
}
|
||||
return bean;
|
||||
}
|
||||
|
||||
private void processFields(Object bean) {
|
||||
Field[] fields = bean.getClass().getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
String beanId;
|
||||
Class<?> type = field.getType();
|
||||
// 判断是否是接口类型,并且是否是注解指定类库
|
||||
if (type.isInterface() && (field.isAnnotationPresent(QueryBean.class) || field.isAnnotationPresent(InsertBean.class))) {
|
||||
String name = type.getName();
|
||||
beanId = name.substring(name.lastIndexOf(".") + 2);
|
||||
if (field.isAnnotationPresent(QueryBean.class)) {
|
||||
beanId = queryParam + beanId + "Impl";
|
||||
} else if (field.isAnnotationPresent(InsertBean.class)) {
|
||||
beanId = insertParam + beanId + "Impl";
|
||||
}
|
||||
try {
|
||||
field.setAccessible(true);
|
||||
field.set(bean, context.getBean(beanId));
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new BusinessException("获取动态实现类失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
||||
return bean;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.njcn.csdevice.controller.data;
|
||||
|
||||
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.csdevice.controller.annotation.QueryBean;
|
||||
import com.njcn.csdevice.param.LineCountEvaluateParam;
|
||||
import com.njcn.csdevice.pojo.dto.PqsCommunicateDto;
|
||||
import com.njcn.csdevice.service.ICsCommunicateService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/6 19:48
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RestController
|
||||
@RequestMapping("/pqsCommunicate")
|
||||
@Api(tags = "获取装置上下线记录")
|
||||
public class PqsCommunicateController extends BaseController {
|
||||
|
||||
@QueryBean
|
||||
private ICsCommunicateService pqsCommunicateCvtQuery;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getRawDataLatest")
|
||||
@ApiOperation("获取取出最新装置数据")
|
||||
public HttpResult<List<PqsCommunicateDto>> getRawDataLatest(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getRawDataLatest");
|
||||
List<PqsCommunicateDto> rawData = pqsCommunicateCvtQuery.getRawDataLatest(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rawData, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getRawData")
|
||||
@ApiOperation("获取原始数据")
|
||||
public HttpResult<List<PqsCommunicateDto>> getRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getRawData");
|
||||
List<PqsCommunicateDto> rawData = pqsCommunicateCvtQuery.getRawData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rawData, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getRawDataEnd")
|
||||
@ApiOperation("获取是否有当天最后一条数据")
|
||||
public HttpResult<List<PqsCommunicateDto>> getRawDataEnd(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getRawData");
|
||||
List<PqsCommunicateDto> rawData = pqsCommunicateCvtQuery.getRawDataEnd(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rawData, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/insertion")
|
||||
@ApiOperation("插入数据")
|
||||
public HttpResult<String> insertion(@RequestBody PqsCommunicateDto pqsCommunicateDto) {
|
||||
String methodDescribe = getMethodDescribe("insertion");
|
||||
pqsCommunicateCvtQuery.insertion(pqsCommunicateDto);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.njcn.csdevice.controller.data;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.csdevice.service.IRStatIntegrityDService;
|
||||
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据完整性日表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-06-23
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/rStatIntegrityD")
|
||||
@Api(tags = "数据完整性接口")
|
||||
@AllArgsConstructor
|
||||
public class RStatIntegrityDController extends BaseController {
|
||||
|
||||
private final IRStatIntegrityDService irStatIntegrityDService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增数据完整性(可根据时间段进行补召)")
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
public HttpResult<String> addData(@RequestBody @Validated StatisticsDataParam param){
|
||||
String methodDescribe = getMethodDescribe("addData");
|
||||
irStatIntegrityDService.addData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/list")
|
||||
@ApiOperation("获取数据")
|
||||
public HttpResult<List<RStatIntegrityD>> list(@Validated @RequestParam("list") List<String> list, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime){
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
List<RStatIntegrityD> result = irStatIntegrityDService.getData(list,startTime,endTime);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.njcn.csdevice.controller.data;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.pojo.po.RStatOnlineRateD;
|
||||
import com.njcn.csdevice.service.IRStatOnlineRateDService;
|
||||
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 在线率日表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-06-23
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/rStatOnlineRateD")
|
||||
@Api(tags = "终端在线率接口")
|
||||
@AllArgsConstructor
|
||||
public class RStatOnlineRateDController extends BaseController {
|
||||
|
||||
private final IRStatOnlineRateDService rStatOnlineRateDService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增终端在线率(可根据时间段进行补召)")
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
public HttpResult<String> addData(@RequestBody @Validated StatisticsDataParam param){
|
||||
String methodDescribe = getMethodDescribe("addData");
|
||||
rStatOnlineRateDService.addData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/list")
|
||||
@ApiOperation("获取数据")
|
||||
public HttpResult<List<RStatOnlineRateD>> list(@Validated @RequestParam("list") List<String> list, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime){
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
List<RStatOnlineRateD> result = rStatOnlineRateDService.getData(list,startTime,endTime);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class DevModelController extends BaseController {
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/AuditDevModel")
|
||||
@ApiOperation("更新/删除出厂设备")
|
||||
@ApiOperation("更新/删除设备模板参数")
|
||||
@ApiImplicitParam(name = "csDevModelAuditParm", value = "更新/删除设备模板参数", required = true)
|
||||
public HttpResult<Boolean> AuditDevModel(@RequestBody @Validated CsDevModelAuditParm csDevModelAuditParm ){
|
||||
String methodDescribe = getMethodDescribe("AuditDevModel");
|
||||
|
||||
@@ -93,8 +93,8 @@ public class DevModelRelationController extends BaseController {
|
||||
@PostMapping("/getModelByType")
|
||||
@ApiOperation("根据装置类型查询模板")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "devId", value = "装置id", required = true),
|
||||
@ApiImplicitParam(name = "type", value = "模板类型", required = true)
|
||||
@ApiImplicitParam(name = "devId", value = "装置id", required = true),
|
||||
@ApiImplicitParam(name = "type", value = "模板类型", required = true)
|
||||
})
|
||||
@ApiIgnore
|
||||
public HttpResult<String> getModelByType(@RequestParam("devId") String devId, @RequestParam("type") Integer type){
|
||||
@@ -103,4 +103,18 @@ public class DevModelRelationController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, modelId, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateDataByList")
|
||||
@ApiOperation("根据装置集合修改模板信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "list", value = "装置id集合", required = true),
|
||||
@ApiImplicitParam(name = "id", value = "模板id", required = true)
|
||||
})
|
||||
@ApiIgnore
|
||||
public HttpResult<String> updateDataByList(@RequestParam("list") List<String> list, @RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("updateDataByList");
|
||||
csDevModelRelationService.updateDataByList(list,id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.constant.DataParam;
|
||||
import com.njcn.csdevice.enums.DeviceOperate;
|
||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||
import com.njcn.csdevice.pojo.param.*;
|
||||
@@ -46,7 +45,6 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
@@ -61,12 +59,9 @@ import java.util.stream.Stream;
|
||||
@Api(tags = " 出厂设备")
|
||||
@AllArgsConstructor
|
||||
public class EquipmentDeliveryController extends BaseController {
|
||||
|
||||
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
||||
|
||||
private final IMqttUserService mqttUserService;
|
||||
private final CsDevModelRelationService csDevModelRelationService;
|
||||
|
||||
private final DictTreeFeignClient dictTreeFeignClient;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@@ -88,7 +83,6 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/AuditEquipmentDelivery")
|
||||
@ApiOperation("删除出厂设备")
|
||||
@@ -118,16 +112,13 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryEquipmentByndid")
|
||||
@ApiOperation("通过ndid查询出厂设备")
|
||||
@ApiImplicitParam(name = "ndid", value = "网关识别码", required = true)
|
||||
public HttpResult<CsEquipmentDeliveryVO> queryEquipmentByndid(@RequestParam("ndid")String ndid){
|
||||
String methodDescribe = getMethodDescribe("queryEquipmentByndid");
|
||||
|
||||
CsEquipmentDeliveryVO csEquipmentDeliveryVO = csEquipmentDeliveryService.queryEquipmentByndid (ndid);
|
||||
CsEquipmentDeliveryVO csEquipmentDeliveryVO = csEquipmentDeliveryService.queryEquipmentByndid (ndid);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csEquipmentDeliveryVO, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -149,11 +140,12 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
@ApiImplicitParam(name = "status", value = "状态", required = true)
|
||||
})
|
||||
@DeviceLog(operateType = DeviceOperate.UPDATESTATUSBYNDID)
|
||||
public HttpResult<Boolean> updateStatusBynDid(@RequestParam("nDId") String nDid,@RequestParam("status") Integer status){
|
||||
public HttpResult<Boolean> updateStatusBynDid(@RequestParam("nDId") String nDid,@RequestParam("status") Integer status){
|
||||
String methodDescribe = getMethodDescribe("updateStatusBynDid");
|
||||
csEquipmentDeliveryService.updateStatusBynDid(nDid,status);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryEquipmentById")
|
||||
@ApiOperation("设备查询通过id获取")
|
||||
@@ -178,14 +170,6 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
public HttpResult<Page<CsEquipmentDeliveryVO>> list(@RequestBody CsEquipmentDeliveryQueryParm param){
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
Page<CsEquipmentDeliveryVO> page = csEquipmentDeliveryService.list(param);
|
||||
//新增逻辑(只针对便携式设备):修改设备中的未注册状态(status = 1)改为5(前端定义的字典也即未接入)
|
||||
for(CsEquipmentDeliveryVO csEquipmentDeliveryVO : page.getRecords()){
|
||||
if(DataParam.portableDevType.equals(csEquipmentDeliveryVO.getDevType()) && csEquipmentDeliveryVO.getStatus() == 1){
|
||||
csEquipmentDeliveryVO.setStatus(5);
|
||||
} else if (DataParam.portableDevType.equals(csEquipmentDeliveryVO.getDevType()) && csEquipmentDeliveryVO.getStatus() == 2) {
|
||||
csEquipmentDeliveryVO.setStatus(6);
|
||||
}
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -228,13 +212,11 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@ApiOperation("导出设备模板")
|
||||
@GetMapping(value = "getExcelTemplate")
|
||||
public HttpResult<String> getExcelTemplate(HttpServletResponse response) {
|
||||
String methodDescribe = getMethodDescribe("getExcelTemplate");
|
||||
|
||||
ExportParams exportParams = new ExportParams("批量导入模板(请严格按照模板标准填入数据)", "终端入网检测录入信息");
|
||||
exportParams.setStyle(ExcelStyleUtil.class);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, DeviceExcelTemplete.class, new ArrayList<DeviceExcelTemplete>());
|
||||
@@ -257,9 +239,20 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
@PostMapping(value = "importEquipment")
|
||||
public HttpResult<String> importEquipment(@ApiParam(value = "文件", required = true) @RequestPart("file") MultipartFile file, HttpServletResponse response) {
|
||||
String methodDescribe = getMethodDescribe("importEquipment");
|
||||
csEquipmentDeliveryService.importEquipment(file, response);
|
||||
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryService.importEquipment(file, response);
|
||||
if (!CollectionUtils.isEmpty(csEquipmentDeliveryPOS)){
|
||||
csEquipmentDeliveryPOS.forEach(temp->{
|
||||
//查询mqtt用户名和密码是否存在
|
||||
boolean result = mqttUserService.findMqttUser(temp.getNdid());
|
||||
if (result){
|
||||
//初始化装置mqtt连接信息(使用sha256加密)
|
||||
mqttUserService.insertMqttUser(temp.getNdid());
|
||||
}
|
||||
});
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@ApiOperation("联调完成")
|
||||
@PostMapping(value = "testcompletion")
|
||||
@@ -282,8 +275,8 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
@PostMapping("/updateSoftInfo")
|
||||
@ApiOperation("更新设备软件信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "nDid", value = "网络设备码", required = true),
|
||||
@ApiImplicitParam(name = "id", value = "软件信息id", required = true)
|
||||
@ApiImplicitParam(name = "nDid", value = "网络设备码", required = true),
|
||||
@ApiImplicitParam(name = "id", value = "软件信息id", required = true)
|
||||
})
|
||||
@ApiIgnore
|
||||
public HttpResult<String> updateSoftInfo(@RequestParam("nDid") String nDid,@RequestParam("id") String id){
|
||||
@@ -306,7 +299,6 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/rebootDevice")
|
||||
@ApiOperation("重启设备")
|
||||
@@ -339,4 +331,74 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getDevByLineId")
|
||||
@ApiOperation("根据监测点id查询装置信息")
|
||||
public HttpResult<CsEquipmentDeliveryPO> getDevByLineId(@RequestParam("lineId") String lineId){
|
||||
String methodDescribe = getMethodDescribe("getDevByLineId");
|
||||
CsEquipmentDeliveryPO po = csEquipmentDeliveryService.getDevByLineId(lineId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/addCldDev")
|
||||
@ApiOperation("新增云前置设备")
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
@DeviceLog(operateType = DeviceOperate.ADD)
|
||||
public HttpResult<CsEquipmentDeliveryPO> addCldDev(@RequestBody @Validated CsEquipmentDeliveryAddParm param){
|
||||
String methodDescribe = getMethodDescribe("addCldDev");
|
||||
CsEquipmentDeliveryPO po = csEquipmentDeliveryService.saveCld(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/delCldDev")
|
||||
@ApiOperation("删除云前置设备")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true)
|
||||
@DeviceLog(operateType = DeviceOperate.DELETE)
|
||||
public HttpResult<Boolean> delCldDev(@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("delCldDev");
|
||||
boolean result = csEquipmentDeliveryService.delCldDev(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateCldDev")
|
||||
@ApiOperation("修改云前置设备")
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
@DeviceLog(operateType = DeviceOperate.UPDATE)
|
||||
public HttpResult<Boolean> updateCldDev(@RequestBody @Validated CsEquipmentDeliveryAuditParm param){
|
||||
String methodDescribe = getMethodDescribe("updateCldDev");
|
||||
boolean result = csEquipmentDeliveryService.updateCldDev(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateCldDevStatus")
|
||||
@ApiOperation("云前置心跳丢失切换设备状态")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "nodeId", value = "前置服务器id", required = true),
|
||||
@ApiImplicitParam(name = "processNo", value = "进程号", required = true)
|
||||
})
|
||||
@ApiIgnore
|
||||
public HttpResult<Boolean> updateCldDevStatus(@RequestParam("nodeId") String nodeId, @RequestParam("processNo") Integer processNo){
|
||||
String methodDescribe = getMethodDescribe("updateCldDevStatus");
|
||||
csEquipmentDeliveryService.updateCldDevStatus(nodeId,processNo);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/flipCldDevStatus")
|
||||
@ApiOperation("云前置设备状态翻转")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "devId", value = "设备id", required = true),
|
||||
@ApiImplicitParam(name = "status", value = "状态", required = true)
|
||||
})
|
||||
@ApiIgnore
|
||||
public HttpResult<Boolean> flipCldDevStatus(@RequestParam("devId") String devId, @RequestParam("status") Integer status){
|
||||
String methodDescribe = getMethodDescribe("flipCldDevStatus");
|
||||
csEquipmentDeliveryService.flipCldDevStatus(devId,status);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.njcn.csdevice.controller.icd;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.service.ICsTerminalLogsService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-09-26
|
||||
*/
|
||||
@Slf4j
|
||||
@RequestMapping("/csTerminalLogs")
|
||||
@RestController
|
||||
@Api(tags = "云前置台账信息日志")
|
||||
@AllArgsConstructor
|
||||
public class CsTerminalLogsController extends BaseController {
|
||||
|
||||
private final ICsTerminalLogsService csTerminalLogsService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/pushCldInfo")
|
||||
@ApiOperation("推送日志台账信息")
|
||||
public HttpResult<String> pushCldInfo(){
|
||||
String methodDescribe = getMethodDescribe("pushCldInfo");
|
||||
String result = csTerminalLogsService.pushCldInfo();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateCldInfo")
|
||||
@ApiOperation("更新日志台账信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "设备id", required = true),
|
||||
@ApiImplicitParam(name = "code", value = "流程状态", required = true)
|
||||
})
|
||||
public HttpResult<String> updateCldInfo(@RequestParam String id, @RequestParam Integer code){
|
||||
String methodDescribe = getMethodDescribe("updateCldInfo");
|
||||
csTerminalLogsService.updateLogs(id,code);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateLaterData")
|
||||
@ApiOperation("更新最新一组数据的推送状态")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "设备id", required = true),
|
||||
@ApiImplicitParam(name = "code", value = "流程状态", required = true)
|
||||
})
|
||||
public HttpResult<String> updateLaterData(@RequestParam String id, @RequestParam String code){
|
||||
String methodDescribe = getMethodDescribe("updateLaterData");
|
||||
csTerminalLogsService.updateLaterData(id,code);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.njcn.csdevice.controller.icd;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.service.ICsTerminalReplyService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-10-09
|
||||
*/
|
||||
@Slf4j
|
||||
@RequestMapping("/csTerminalReply")
|
||||
@RestController
|
||||
@Api(tags = "云前置台账信息响应记录")
|
||||
@AllArgsConstructor
|
||||
|
||||
public class CsTerminalReplyController extends BaseController {
|
||||
|
||||
private final ICsTerminalReplyService csTerminalReplyService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryData")
|
||||
@ApiOperation("查询推送结果")
|
||||
public HttpResult<List<String>> queryData(){
|
||||
String methodDescribe = getMethodDescribe("queryData");
|
||||
List<String> result = csTerminalReplyService.queryReplyData();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateData")
|
||||
@ApiOperation("更新推送结果")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "参数", required = true),
|
||||
@ApiImplicitParam(name = "state", value = "状态", required = true),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true)
|
||||
})
|
||||
public HttpResult<String> updateData(@RequestParam String id,@RequestParam Integer state,@RequestParam String deviceId){
|
||||
String methodDescribe = getMethodDescribe("updateData");
|
||||
csTerminalReplyService.updateReplyData(id,state,deviceId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.njcn.csdevice.controller.icd;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.param.IcdLedgerParam;
|
||||
import com.njcn.csdevice.param.IcdParam;
|
||||
import com.njcn.csdevice.pojo.vo.CldLedgerVo;
|
||||
import com.njcn.csdevice.pojo.vo.DeviceInfo;
|
||||
import com.njcn.csdevice.service.IcdService;
|
||||
import com.njcn.mq.message.CldControlMessage;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/icd")
|
||||
@Api(tags = "云前置改造")
|
||||
@AllArgsConstructor
|
||||
public class IcdController extends BaseController {
|
||||
|
||||
private final IcdService icdService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLedgerInfo")
|
||||
@ApiOperation("获取台账信息")
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
public HttpResult<List<DeviceInfo>> getLedgerInfo(@RequestBody @Validated IcdParam param){
|
||||
String methodDescribe = getMethodDescribe("getLedgerInfo");
|
||||
List<DeviceInfo> result = icdService.getLedgerInfo(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/addLedgerInfo")
|
||||
@ApiOperation("新增台账信息")
|
||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||
public HttpResult<List<DeviceInfo>> addLedgerInfo(@RequestBody @Validated IcdLedgerParam param){
|
||||
String methodDescribe = getMethodDescribe("addLedgerInfo");
|
||||
icdService.addLedgerInfo(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLedgerById")
|
||||
@ApiOperation("根据Id获取台账信息")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true)
|
||||
public HttpResult<CldLedgerVo> getLedgerById(@RequestParam String id){
|
||||
String methodDescribe = getMethodDescribe("getLedgerById");
|
||||
CldLedgerVo vo = icdService.getLedgerById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/restartProcess")
|
||||
@ApiOperation("重启前置机进程")
|
||||
@ApiImplicitParam(name = "message", value = "message", required = true)
|
||||
public HttpResult<String> restartProcess(@RequestBody CldControlMessage message){
|
||||
String methodDescribe = getMethodDescribe("restartProcess");
|
||||
icdService.restartProcess(message);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
package com.njcn.csdevice.controller.icd;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.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.csdevice.pojo.param.NodeParam;
|
||||
import com.njcn.csdevice.pojo.po.Node;
|
||||
import com.njcn.csdevice.pojo.vo.NodeProcessDeviceVo;
|
||||
import com.njcn.csdevice.service.INodeService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 前置程序控制器
|
||||
* @author xy
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "前置机管理")
|
||||
@RestController
|
||||
@RequestMapping("node")
|
||||
@RequiredArgsConstructor
|
||||
public class NodeController extends BaseController {
|
||||
|
||||
private final INodeService iNodeService;
|
||||
|
||||
/**
|
||||
* 新增前置机
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("新增前置机")
|
||||
@ApiImplicitParam(value = "前置机信息",name = "nodeParam",required = true)
|
||||
@PostMapping("addNode")
|
||||
public HttpResult<Boolean> addNode(@Validated @RequestBody NodeParam nodeParam){
|
||||
String methodDescribe = getMethodDescribe("addNode");
|
||||
boolean result = iNodeService.addNode(nodeParam);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改前置机
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@ApiOperation("修改前置机")
|
||||
@ApiImplicitParam(value = "前置机信息",name = "updateNodeParam",required = true)
|
||||
@PutMapping("updateNode")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.UPDATE)
|
||||
public HttpResult<Boolean> updateNode(@Validated @RequestBody NodeParam.NodeUpdateParam updateNodeParam){
|
||||
String methodDescribe = getMethodDescribe("updateNode");
|
||||
boolean result = iNodeService.updateNode(updateNodeParam);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除前置
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@ApiOperation(value = "删除前置机")
|
||||
@ApiImplicitParam(value = "前置机id",name = "id",required = true)
|
||||
@PostMapping("delNode")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
||||
public HttpResult<Boolean> delNode(@Validated @NotNull(message = "id不可为空") @RequestParam("id")String id){
|
||||
String methodDescribe = getMethodDescribe("delNode");
|
||||
boolean result = iNodeService.delNode(id);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 变更前置机状态
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@ApiOperation(value = "变更前置机状态")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(value = "前置机id",name = "id",required = true ),
|
||||
@ApiImplicitParam(value = "前置机状态",name = "state",required = true )
|
||||
})
|
||||
@PostMapping("updateNodeState")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.UPDATE)
|
||||
public HttpResult<Boolean> updateNodeState(@Validated @NotNull(message = "id不可为空") @RequestParam("id")String id,@NotNull(message = "状态不为空") @RequestParam("state")Integer state){
|
||||
String methodDescribe = getMethodDescribe("updateNodeState");
|
||||
boolean result = iNodeService.updateNodeState(id,state);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部前置机分页
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@ApiOperation("获取全部前置机")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@PostMapping("nodeList")
|
||||
public HttpResult<Page<Node>> nodeList(@RequestBody NodeParam.NodeQueryParam nodeQueryParam){
|
||||
String methodDescribe = getMethodDescribe("nodeList");
|
||||
Page<Node> page = iNodeService.nodeList(nodeQueryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部前置机不分页
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@ApiOperation("获取全部前置机")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@GetMapping("/nodeAllList")
|
||||
public HttpResult<List<Node>> nodeAllList(){
|
||||
String methodDescribe = getMethodDescribe("nodeAllList");
|
||||
List<Node> resList = iNodeService.nodeAllList();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, resList, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id获取前置机
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@ApiOperation("根据id获取前置机")
|
||||
@ApiImplicitParam(value = "前置机id",name = "id",required = true)
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@GetMapping("/getNodeById")
|
||||
public HttpResult<Node> getNodeById(@Validated @NotNull(message = "id不可为空") @RequestParam("id")String id){
|
||||
String methodDescribe = getMethodDescribe("getNodeById");
|
||||
Node node = iNodeService.getNodeById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, node, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据前置机id获取下面的进程和设备
|
||||
* @author xy
|
||||
*/
|
||||
@ApiOperation("根据前置机id获取下面的进程和设备")
|
||||
@ApiImplicitParam(value = "前置机id",name = "id",required = true)
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@GetMapping("/getProcessNoAndDeviceById")
|
||||
public HttpResult<NodeProcessDeviceVo> getProcessNoAndDeviceById(@Validated @NotNull(message = "id不可为空") @RequestParam("id")String id){
|
||||
String methodDescribe = getMethodDescribe("getProcessNoAndDeviceById");
|
||||
NodeProcessDeviceVo vo = iNodeService.getProcessNoAndDeviceById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
||||
import com.njcn.csdevice.pojo.param.CsLedgerParam;
|
||||
@@ -39,6 +40,7 @@ import java.util.List;
|
||||
public class CsLedgerController extends BaseController {
|
||||
|
||||
private final ICsLedgerService csLedgerService;
|
||||
private final CsLedgerMapper csLedgerMapper;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/tree")
|
||||
@@ -145,5 +147,23 @@ public class CsLedgerController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, details, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getAllLedger")
|
||||
@ApiOperation("获取台账树所有数据")
|
||||
public HttpResult<List<CsLedgerVO>> getAllLedger(){
|
||||
String methodDescribe = getMethodDescribe("getAllLedger");
|
||||
List<CsLedgerVO> allList = csLedgerMapper.getAll();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, allList, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/cldTree")
|
||||
@ApiOperation("云前置树")
|
||||
public HttpResult<CsLedgerVO> cldTree(){
|
||||
String methodDescribe = getMethodDescribe("cldTree");
|
||||
CsLedgerVO vo = csLedgerService.cldTree();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.mapper.CsLinePOMapper;
|
||||
import com.njcn.csdevice.mapper.OverlimitMapper;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
@@ -16,6 +15,7 @@ import com.njcn.device.biz.utils.COverlimitUtil;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -41,9 +41,7 @@ import java.util.List;
|
||||
public class CslineController extends BaseController {
|
||||
|
||||
private final CsLinePOService csLinePOService;
|
||||
|
||||
private final OverlimitMapper overlimitMapper;
|
||||
private final CsLinePOMapper csLinePOMapper;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryLineById")
|
||||
@@ -92,16 +90,6 @@ public class CslineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @PostMapping("/addLineList")
|
||||
// @ApiOperation("批量新增监测点及绑定关系")
|
||||
// @ApiImplicitParam(name = "list", value = "监测点数据集", required = true)
|
||||
// public HttpResult<String> addLines(@RequestBody List<CsLineParm> list){
|
||||
// String methodDescribe = getMethodDescribe("addLines");
|
||||
// csLinePOService.addLines(list);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
// }
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/findByNdid")
|
||||
@ApiOperation("根据ndid查询监测点")
|
||||
@@ -157,14 +145,79 @@ public class CslineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @PostMapping("/getLinesByDevList")
|
||||
// @ApiOperation("根据装置id集合获取监测点id集合")
|
||||
// @ApiImplicitParam(name = "ids", value = "装置id集合", required = true)
|
||||
// public HttpResult<List<CsLinePO>> getLinesByDevList(@RequestParam("ids") List<String> ids) {
|
||||
// String methodDescribe = getMethodDescribe("getLinesByDevList");
|
||||
// List<CsLinePO> list = csLinePOService.getLinesByDevList(ids);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
// }
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLinesByDevList")
|
||||
@ApiOperation("根据装置id集合获取监测点id集合")
|
||||
@ApiImplicitParam(name = "ids", value = "装置id集合", required = true)
|
||||
public HttpResult<List<CsLinePO>> getLinesByDevList(@RequestParam("ids") List<String> ids) {
|
||||
public HttpResult<List<CsLinePO>> getLinesByDevList(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("getLinesByDevList");
|
||||
List<CsLinePO> list = csLinePOService.getLinesByDevList(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/addCldLine")
|
||||
@ApiOperation("新增云前置监测点")
|
||||
@ApiImplicitParam(name = "param", value = "param", required = true)
|
||||
public HttpResult<List<CsLinePO>> addCldLine(@RequestBody @Validated CsLineParam param) {
|
||||
String methodDescribe = getMethodDescribe("addCldLine");
|
||||
csLinePOService.addCldLine(param);
|
||||
//新增监测点限值
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(param.getVolGrade().floatValue(),10f,10f,10f,0,1);
|
||||
overlimit.setId(param.getLineId());
|
||||
overlimitMapper.deleteById(param.getLineId());
|
||||
overlimitMapper.insert(overlimit);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateCldLine")
|
||||
@ApiOperation("修改云前置监测点")
|
||||
@ApiImplicitParam(name = "param", value = "param", required = true)
|
||||
public HttpResult<List<CsLinePO>> updateCldLine(@RequestBody CsLineParam param) {
|
||||
String methodDescribe = getMethodDescribe("updateCldLine");
|
||||
csLinePOService.updateCldLine(param);
|
||||
//修改监测点限值
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(param.getVolGrade().floatValue(),10f,10f,10f,0,1);
|
||||
overlimit.setId(param.getLineId());
|
||||
overlimitMapper.deleteById(param.getLineId());
|
||||
overlimitMapper.insert(overlimit);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/delCldLine")
|
||||
@ApiOperation("删除云前置监测点")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<List<CsLinePO>> delCldLine(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("delCldLine");
|
||||
csLinePOService.deleteCldLine(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateLineDataByList")
|
||||
@ApiOperation("根据装置集合修改监测点信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "list", value = "装置id集合", required = true),
|
||||
@ApiImplicitParam(name = "id", value = "模板id", required = true),
|
||||
@ApiImplicitParam(name = "setId", value = "数据集id", required = true),
|
||||
})
|
||||
@ApiIgnore
|
||||
public HttpResult<String> updateDataByList(@RequestParam("list") List<String> list, @RequestParam("id") String id, @RequestParam("setId") String setId){
|
||||
String methodDescribe = getMethodDescribe("updateLineDataByList");
|
||||
csLinePOService.updateLineDataByList(list,id,setId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.csdevice.controller.project;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
@@ -68,8 +69,8 @@ public class AppProjectController extends BaseController {
|
||||
public HttpResult<Boolean> addAppProject(@Validated AppProjectAddParm appProjectAddParm){
|
||||
String methodDescribe = getMethodDescribe("addAppProject");
|
||||
|
||||
Boolean flag = appProjectService.addAppProject(appProjectAddParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
AppProjectPO po = appProjectService.addAppProject(appProjectAddParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, ObjectUtil.isNotNull(po), methodDescribe);
|
||||
}
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/auditAppProject")
|
||||
@@ -80,4 +81,14 @@ public class AppProjectController extends BaseController {
|
||||
Boolean flag = appProjectService.AuditAppProject(appProjectAuditParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateProject")
|
||||
@ApiOperation("web修改项目信息")
|
||||
public HttpResult<Boolean> updateProject(@RequestBody @Validated AppProjectAuditParm appProjectAuditParm){
|
||||
String methodDescribe = getMethodDescribe("updateProject");
|
||||
Boolean flag = appProjectService.updateProject(appProjectAuditParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, 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.CsEngineeringQueryParm;
|
||||
import com.njcn.csdevice.pojo.po.CsEngineeringPO;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
||||
import com.njcn.csdevice.service.CsEngineeringService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -20,10 +21,7 @@ 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.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -42,10 +40,8 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public class EngineeringController extends BaseController {
|
||||
|
||||
|
||||
private final CsEngineeringService csEngineeringService;
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/addEngineering")
|
||||
@ApiOperation("新增工程")
|
||||
@@ -88,4 +84,14 @@ public class EngineeringController extends BaseController {
|
||||
IPage<CsEngineeringVO> page = csEngineeringService.queryEngineeringPage(csEngineeringQueryPageParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryEngineeringById")
|
||||
@ApiOperation("工程查询通过id获取")
|
||||
@ApiImplicitParam(name = "id", value = "工程id", required = true)
|
||||
public HttpResult<CsEngineeringPO> queryEngineeringById(@RequestParam String id){
|
||||
String methodDescribe = getMethodDescribe("queryEngineeringById");
|
||||
CsEngineeringPO po = csEngineeringService.queryEngineeringById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class WlRecordController extends BaseController {
|
||||
@GetMapping("/getTestRecordById")
|
||||
@ApiOperation("根据测试项ID查询测试项信息")
|
||||
@ApiImplicitParam(name = "testRecordId", value = "测试项ID", required = true)
|
||||
public HttpResult<RecordVo.RecordItemVo> getTestRecordById(@RequestParam @Validated String testRecordId) {
|
||||
public HttpResult<RecordVo.RecordItemVo> getTestRecordById(@RequestParam("testRecordId") @Validated String testRecordId) {
|
||||
String methodDescribe = getMethodDescribe("getTestRecordById");
|
||||
LogUtil.njcnDebug(log, "{},测试项id为:{}", methodDescribe, testRecordId);
|
||||
RecordVo.RecordItemVo result = wlRecordService.getTestRecordById(testRecordId);
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.njcn.csdevice.job;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import com.njcn.csdevice.service.IRStatIntegrityDService;
|
||||
import com.njcn.csdevice.service.IRStatOnlineRateDService;
|
||||
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Component
|
||||
@EnableScheduling
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class DayDataJob {
|
||||
|
||||
private final IRStatIntegrityDService statIntegrityDService;
|
||||
private final IRStatOnlineRateDService statOnlineRateDService;
|
||||
|
||||
/**
|
||||
* 每天1点计算治理设备的完整性
|
||||
*
|
||||
* @date 2025/7/1
|
||||
*/
|
||||
@Scheduled(cron = "0 0 1 * * ?")
|
||||
public void lineIntegrityJob() {
|
||||
StatisticsDataParam param = new StatisticsDataParam();
|
||||
LocalDate yesterday = LocalDate.now().minusDays(1);
|
||||
LocalDateTime start = yesterday.atStartOfDay();
|
||||
LocalDateTime end = yesterday.atTime(23, 59, 59);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN);
|
||||
param.setStartTime(start.format(formatter));
|
||||
param.setEndTime(end.format(formatter));
|
||||
statIntegrityDService.addData(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 每天2点计算治理设备的在线率
|
||||
*
|
||||
* @date 2025/7/1
|
||||
*/
|
||||
@Scheduled(cron = "0 30 1 * * ?")
|
||||
public void devOnlineRateJob() {
|
||||
StatisticsDataParam param = new StatisticsDataParam();
|
||||
LocalDate yesterday = LocalDate.now().minusDays(1);
|
||||
LocalDateTime start = yesterday.atStartOfDay();
|
||||
LocalDateTime end = yesterday.atTime(23, 59, 59);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN);
|
||||
param.setStartTime(start.format(formatter));
|
||||
param.setEndTime(end.format(formatter));
|
||||
statOnlineRateDService.addData(param);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.csdevice.pojo.param.CsEquipmentDeliveryQueryParm;
|
||||
import com.njcn.csdevice.pojo.param.ProjectEquipmentQueryParm;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
||||
@@ -20,10 +22,19 @@ import java.util.List;
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@DS("master")
|
||||
public interface CsEquipmentDeliveryMapper extends BaseMapper<CsEquipmentDeliveryPO> {
|
||||
Page<ProjectEquipmentVO> queryProjectEquipmentVO(Page<ProjectEquipmentVO> returnpage,@Param("projectEquipmentQueryParm")ProjectEquipmentQueryParm projectEquipmentQueryParm,@Param("device")List<String> device);
|
||||
|
||||
Page<CsEquipmentDeliveryVO> page(Page<CsEquipmentDeliveryPO> returnpage, @Param("ew") QueryWrapper<CsEquipmentDeliveryPO> queryWrapper);
|
||||
|
||||
//获取符合条件的设备列表
|
||||
List<CsEquipmentDeliveryVO> getList(@Param("queryParam") CsEquipmentDeliveryQueryParm queryParam);
|
||||
|
||||
//获取符合条件的设备数量
|
||||
int getCounts(@Param("queryParam") CsEquipmentDeliveryQueryParm queryParam);
|
||||
|
||||
int getListByNodeProcess(@Param("nodeId")String nodeId,@Param("process")Integer process);
|
||||
|
||||
List<CsEquipmentDeliveryPO> getDataByNodeIdAndProcessNo(@Param("nodeId")String nodeId,@Param("process")Integer process);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsTerminalLogs;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-09-26
|
||||
*/
|
||||
public interface CsTerminalLogsMapper extends BaseMapper<CsTerminalLogs> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsTerminalReply;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-10-09
|
||||
*/
|
||||
public interface CsTerminalReplyMapper extends BaseMapper<CsTerminalReply> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.csdevice.param.IcdParam;
|
||||
import com.njcn.csdevice.pojo.po.Node;
|
||||
import com.njcn.csdevice.pojo.vo.DeviceInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
@DS("sjzx")
|
||||
public interface NodeMapper extends BaseMapper<Node> {
|
||||
|
||||
List<DeviceInfo> nodeDeviceList(@Param("nodeDeviceParam") IcdParam icdParam);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.csdevice.pojo.po.RStatIntegrityD;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据完整性日表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-06-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface RStatIntegrityDMapper extends MppBaseMapper<RStatIntegrityD> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.csdevice.pojo.po.RStatOnlineRateD;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 在线率日表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-06-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface RStatOnlineRateDMapper extends MppBaseMapper<RStatOnlineRateD> {
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
where
|
||||
pid = #{modelId}
|
||||
and cl_dev = #{clDev}
|
||||
and data_type in ('Stat',NULL)
|
||||
and (data_type = 'Stat' or data_type IS NULL)
|
||||
order by type,cl_dev
|
||||
</select>
|
||||
|
||||
|
||||
@@ -87,5 +87,66 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getList" resultType="CsEquipmentDeliveryVO">
|
||||
select
|
||||
*
|
||||
from
|
||||
cs_equipment_delivery
|
||||
<where>
|
||||
1=1
|
||||
<if test="queryParam.process != null and queryParam.process !=''">
|
||||
and process = #{queryParam.process}
|
||||
</if>
|
||||
<if test="queryParam.runStatus != null and queryParam.runStatus !=''">
|
||||
and run_status = #{queryParam.runStatus}
|
||||
</if>
|
||||
<if test="queryParam.searchValue != null and queryParam.searchValue !=''">
|
||||
and (name like concat('%',#{queryParam.searchValue},'%') or ndid like concat('%',#{queryParam.searchValue},'%'))
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getCounts" resultType="int">
|
||||
select
|
||||
count(1)
|
||||
from
|
||||
cs_equipment_delivery
|
||||
<where>
|
||||
1=1
|
||||
<if test="queryParam.process != null and queryParam.process !=''">
|
||||
and process = #{queryParam.process}
|
||||
</if>
|
||||
<if test="queryParam.runStatus != null and queryParam.runStatus !=''">
|
||||
and run_status = #{queryParam.runStatus}
|
||||
</if>
|
||||
<if test="queryParam.searchValue != null and queryParam.searchValue !=''">
|
||||
and (name like concat('%',#{queryParam.searchValue},'%') or ndid like concat('%',#{queryParam.searchValue},'%'))
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getListByNodeProcess" resultType="int">
|
||||
select
|
||||
count(1)
|
||||
from
|
||||
cs_equipment_delivery
|
||||
where
|
||||
node_id = #{nodeId} and run_status != 0
|
||||
<if test="process != null and process !=''">
|
||||
and node_process > #{process}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getDataByNodeIdAndProcessNo" resultType="com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO">
|
||||
select
|
||||
*
|
||||
from
|
||||
cs_equipment_delivery
|
||||
where
|
||||
node_id = #{nodeId} and run_status != 0
|
||||
<if test="process != null and process !=''">
|
||||
and node_process = #{process}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -32,7 +32,7 @@
|
||||
</resultMap>
|
||||
<select id="getAll" resultType="CsLedgerVO">
|
||||
select
|
||||
id,pid,name,level,sort
|
||||
id,pid,pids,name,level,sort
|
||||
from
|
||||
cs_ledger
|
||||
where
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.csdevice.mapper.NodeMapper">
|
||||
|
||||
<select id="nodeDeviceList" resultType="com.njcn.csdevice.pojo.vo.DeviceInfo">
|
||||
SELECT
|
||||
pq_device.Id id,
|
||||
pq_device.IP ip,
|
||||
s1.Name devType,
|
||||
pq_device.Port port,
|
||||
pq_line.Name name,
|
||||
sub.Name subName,
|
||||
pq_device.Update_Time updateTime,
|
||||
s2.Name manufacturer,
|
||||
pq_device.Com_Flag status,
|
||||
pq_device.Series series,
|
||||
pq_device_process.process_no processNo,
|
||||
pq_device.Dev_Key devKey,
|
||||
pq_node.max_Process_Num maxProcessNum
|
||||
FROM
|
||||
pq_device
|
||||
LEFT JOIN pq_node ON pq_node.Id = pq_device.Node_Id
|
||||
LEFT JOIN pq_line on pq_device.id = pq_line.id
|
||||
LEFT JOIN pq_line sub on pq_line.pid = sub.id
|
||||
LEFT JOIN pq_device_process on pq_device_process.id = pq_device.id
|
||||
LEFT JOIN pq_dev_type s1 ON pq_device.Dev_Type = s1.id
|
||||
LEFT JOIN sys_dict_data s2 ON pq_device.Manufacturer = s2.id
|
||||
<where>
|
||||
<if test="nodeDeviceParam.ip!=null and nodeDeviceParam.ip != ''">
|
||||
pq_node.ip=#{nodeDeviceParam.ip}
|
||||
</if>
|
||||
<if test="nodeDeviceParam.devId!=null and nodeDeviceParam.devId != ''">
|
||||
pq_device.id=#{nodeDeviceParam.devId}
|
||||
</if>
|
||||
<if test="nodeDeviceParam.runFlag!=null and nodeDeviceParam.runFlag.size()!=0">
|
||||
AND pq_device.Run_Flag in
|
||||
<foreach collection="nodeDeviceParam.runFlag" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -27,8 +27,8 @@ public interface AppProjectService extends IService<AppProjectPO> {
|
||||
* @return: java.lang.Boolean
|
||||
* @Author: clam
|
||||
* @Date: 2023/3/27
|
||||
*/
|
||||
Boolean addAppProject(AppProjectAddParm appProjectAddOrAuditParm);
|
||||
*/
|
||||
AppProjectPO addAppProject(AppProjectAddParm appProjectAddOrAuditParm);
|
||||
/**
|
||||
* @Description: AuditAppProject
|
||||
* @Param: [appProjectAuditParm]
|
||||
@@ -37,6 +37,9 @@ public interface AppProjectService extends IService<AppProjectPO> {
|
||||
* @Date: 2023/3/27
|
||||
*/
|
||||
Boolean AuditAppProject(AppProjectAuditParm appProjectAuditParm);
|
||||
|
||||
Boolean updateProject(AppProjectAuditParm appProjectAuditParm);
|
||||
|
||||
/**
|
||||
* @Description: queryProject
|
||||
* @Param: [appProjectQueryParm]
|
||||
|
||||
@@ -55,5 +55,5 @@ public interface CsDevModelRelationService extends IService<CsDevModelRelationPO
|
||||
|
||||
String getVersionByDevId(String devId);
|
||||
|
||||
|
||||
void updateDataByList(List<String> list, String id);
|
||||
}
|
||||
|
||||
@@ -76,4 +76,10 @@ public interface CsDevModelService extends IService<CsDevModelPO>{
|
||||
*/
|
||||
CsDevModelPO getModelById(String id);
|
||||
|
||||
/**
|
||||
* 获取云前置模板
|
||||
* @return
|
||||
*/
|
||||
CsDevModelPO getCldModel();
|
||||
|
||||
}
|
||||
|
||||
@@ -55,4 +55,6 @@ public interface CsEngineeringService extends IService<CsEngineeringPO>{
|
||||
* @return
|
||||
*/
|
||||
List<CsEngineeringPO> getEngineerings(List<String> list);
|
||||
|
||||
CsEngineeringPO queryEngineeringById(String id);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
||||
import com.njcn.csdevice.pojo.vo.DeviceManagerVO;
|
||||
import com.njcn.csdevice.pojo.vo.ProjectEquipmentVO;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -32,30 +33,30 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
||||
*/
|
||||
void refreshDeviceDataCache();
|
||||
|
||||
/**
|
||||
* @Description: save
|
||||
* @Param: [csEquipmentDeliveryAddParm]
|
||||
* @return: java.lang.Boolean
|
||||
* @Author: clam
|
||||
* @Date: 2023/3/31
|
||||
*/
|
||||
CsEquipmentDeliveryPO save(CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm);
|
||||
/**
|
||||
* @Description: AuditEquipmentDelivery
|
||||
* @Param: [id]
|
||||
* @return: java.lang.Boolean
|
||||
* @Author: clam
|
||||
* @Date: 2023/3/31
|
||||
*/
|
||||
Boolean AuditEquipmentDelivery(String id);
|
||||
/**
|
||||
* @Description: queryEquipmentByndid
|
||||
* @Param: [ndid]
|
||||
* @return: com.njcn.algorithm.pojo.vo.CsEquipmentDeliveryVO
|
||||
* @Author: clam
|
||||
* @Date: 2023/3/31
|
||||
*/
|
||||
CsEquipmentDeliveryVO queryEquipmentByndid(String ndid);
|
||||
/**
|
||||
* @Description: save
|
||||
* @Param: [csEquipmentDeliveryAddParm]
|
||||
* @return: java.lang.Boolean
|
||||
* @Author: clam
|
||||
* @Date: 2023/3/31
|
||||
*/
|
||||
CsEquipmentDeliveryPO save(CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm);
|
||||
/**
|
||||
* @Description: AuditEquipmentDelivery
|
||||
* @Param: [id]
|
||||
* @return: java.lang.Boolean
|
||||
* @Author: clam
|
||||
* @Date: 2023/3/31
|
||||
*/
|
||||
Boolean AuditEquipmentDelivery(String id);
|
||||
/**
|
||||
* @Description: queryEquipmentByndid
|
||||
* @Param: [ndid]
|
||||
* @return: com.njcn.algorithm.pojo.vo.CsEquipmentDeliveryVO
|
||||
* @Author: clam
|
||||
* @Date: 2023/3/31
|
||||
*/
|
||||
CsEquipmentDeliveryVO queryEquipmentByndid(String ndid);
|
||||
/**
|
||||
* @Description: queryEquipmentByProject
|
||||
* @Param: [projectEquipmentQueryParm]
|
||||
@@ -99,7 +100,7 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
||||
*/
|
||||
CsEquipmentDeliveryPO findDevByNDid(String nDid);
|
||||
|
||||
void importEquipment(MultipartFile file, HttpServletResponse response);
|
||||
List<CsEquipmentDeliveryPO> importEquipment(MultipartFile file, HttpServletResponse response);
|
||||
|
||||
void delete(String devId);
|
||||
|
||||
@@ -133,4 +134,55 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
||||
* 判断设备型号
|
||||
*/
|
||||
boolean judgeDevModel(String nDid);
|
||||
|
||||
CsEquipmentDeliveryPO getDevByLineId(String lineId);
|
||||
|
||||
/**
|
||||
* 新增云前置设备
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
CsEquipmentDeliveryPO saveCld(CsEquipmentDeliveryAddParm param);
|
||||
|
||||
/**
|
||||
* 删除云前置设备
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Boolean delCldDev(String id);
|
||||
|
||||
/**
|
||||
* 更新云前置设备
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Boolean updateCldDev(CsEquipmentDeliveryAuditParm param);
|
||||
|
||||
/**
|
||||
* 根据前置ip和运行状态获取装置数据
|
||||
* @param id
|
||||
* @param runFlag
|
||||
* @return
|
||||
*/
|
||||
List<CsEquipmentDeliveryPO> getCldDevByIp(String id, List<Integer> runFlag);
|
||||
|
||||
/**
|
||||
* 根据前置id和进程号修改设备状态;同时修改设备下的监测点的状态
|
||||
*/
|
||||
void updateCldDevStatus(String nodeId, Integer processNo);
|
||||
|
||||
/**
|
||||
* 根据设备id和状态来修改设备运行状态;同时修改设备下的监测点的状态
|
||||
* @param devId
|
||||
* @param status
|
||||
*/
|
||||
void flipCldDevStatus(String devId, Integer status);
|
||||
|
||||
/**
|
||||
* 根据项目id获取设备列表
|
||||
*/
|
||||
List<CsEquipmentDeliveryPO> getDevListByProjectId(String projectId);
|
||||
|
||||
List<CsEquipmentDeliveryPO> getDataByNodeIdAndProcessNo(String nodeId, Integer processNo);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.csdevice.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -47,4 +48,19 @@ public interface CsLinePOService extends IService<CsLinePO>{
|
||||
void updateIds(CsLineParam csLineParam);
|
||||
|
||||
List<CsLinePO> getLinesByDevList(List<String> list);
|
||||
|
||||
CsLinePO addCldLine(CsLineParam param);
|
||||
|
||||
void updateCldLine(CsLineParam param);
|
||||
|
||||
void deleteCldLine(String id);
|
||||
|
||||
/**
|
||||
* 修改监测点状态为停运
|
||||
* @param lineList 监测点集合
|
||||
* @param status 运行状态
|
||||
*/
|
||||
void updateCldLineStatus(List<CsLinePO> lineList, Integer status);
|
||||
|
||||
void updateLineDataByList(List<String> list, String id, String setId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
|
||||
import com.njcn.csdevice.param.LineCountEvaluateParam;
|
||||
import com.njcn.csdevice.pojo.dto.PqsCommunicateDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/6 10:22
|
||||
*/
|
||||
public interface ICsCommunicateService {
|
||||
|
||||
/**
|
||||
* 取出最新装置数据
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
List<PqsCommunicateDto> getRawDataLatest(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 获取时间范围数据
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
List<PqsCommunicateDto> getRawData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
*是否有当天最后一条数据
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
List<PqsCommunicateDto> getRawDataEnd(LineCountEvaluateParam lineParam);
|
||||
|
||||
void insertion(PqsCommunicateDto pqsCommunicateDto);
|
||||
}
|
||||
@@ -76,4 +76,13 @@ public interface ICsLedgerService extends IService<CsLedger> {
|
||||
DevDetailDTO queryDevDetail(String devId);
|
||||
|
||||
List<CsLedgerVO> getztProjectTree();
|
||||
|
||||
/**
|
||||
* 根据设备集合获取项目和工程
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<CsLedgerVO> getProAndEngineer(List<String> id);
|
||||
|
||||
CsLedgerVO cldTree();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.po.CsTerminalLogs;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-09-26
|
||||
*/
|
||||
public interface ICsTerminalLogsService extends IService<CsTerminalLogs> {
|
||||
|
||||
/**
|
||||
* 更新台账操作日志信息
|
||||
*/
|
||||
void updateLogs(String id, Integer code);
|
||||
|
||||
/**
|
||||
* 推送台账操作日志信息
|
||||
*/
|
||||
String pushCldInfo();
|
||||
|
||||
void updateLaterData(String id, String code);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.po.CsTerminalReply;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-10-09
|
||||
*/
|
||||
public interface ICsTerminalReplyService extends IService<CsTerminalReply> {
|
||||
|
||||
List<String> queryReplyData();
|
||||
|
||||
void updateReplyData(String id,Integer state,String deviceId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.param.NodeParam;
|
||||
import com.njcn.csdevice.pojo.po.Node;
|
||||
import com.njcn.csdevice.pojo.vo.NodeProcessDeviceVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
public interface INodeService extends IService<Node> {
|
||||
|
||||
|
||||
/**
|
||||
* 新增前置机
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
boolean addNode(NodeParam nodeParam);
|
||||
|
||||
/**
|
||||
* 修改前置机
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
boolean updateNode(NodeParam.NodeUpdateParam nodeParam);
|
||||
|
||||
/**
|
||||
* 删除前置机
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
boolean delNode(String id);
|
||||
|
||||
/**
|
||||
* 修改前置机状态
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
boolean updateNodeState(String id, Integer state);
|
||||
|
||||
/**
|
||||
* 查询前置机列表
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
Page<Node> nodeList(NodeParam.NodeQueryParam nodeQueryParam);
|
||||
|
||||
/**
|
||||
* 查询前置机列表不分页
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
List<Node> nodeAllList();
|
||||
|
||||
/**
|
||||
* 根据前置机id获取前置机
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
Node getNodeById(String id);
|
||||
|
||||
/**
|
||||
* 根据前置机名称获取详细信息
|
||||
* @param nodeName 前置机名称
|
||||
* @return 前置信息
|
||||
*/
|
||||
Node getNodeByNodeName(String nodeName);
|
||||
|
||||
Node getNodeByIp(String ip);
|
||||
|
||||
NodeProcessDeviceVo getProcessNoAndDeviceById(String id);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据完整性日表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-06-23
|
||||
*/
|
||||
public interface IRStatIntegrityDService extends IService<RStatIntegrityD> {
|
||||
|
||||
void addData(StatisticsDataParam param);
|
||||
|
||||
List<RStatIntegrityD> getData(List<String> list, String startTime, String endTime);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.po.RStatOnlineRateD;
|
||||
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 在线率日表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-06-23
|
||||
*/
|
||||
public interface IRStatOnlineRateDService extends IService<RStatOnlineRateD> {
|
||||
|
||||
void addData(StatisticsDataParam param);
|
||||
|
||||
List<RStatOnlineRateD> getData(List<String> list, String startTime, String endTime);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.njcn.csdevice.param.IcdLedgerParam;
|
||||
import com.njcn.csdevice.param.IcdParam;
|
||||
import com.njcn.csdevice.pojo.vo.CldLedgerVo;
|
||||
import com.njcn.csdevice.pojo.vo.DeviceInfo;
|
||||
import com.njcn.mq.message.CldControlMessage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IcdService {
|
||||
|
||||
List<DeviceInfo> getLedgerInfo(IcdParam param);
|
||||
|
||||
void addLedgerInfo(IcdLedgerParam param);
|
||||
|
||||
CldLedgerVo getLedgerById(String id);
|
||||
|
||||
void restartProcess(CldControlMessage message);
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.stream.CollectorUtil;
|
||||
import com.alibaba.cloud.commons.lang.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
@@ -55,7 +56,7 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean addAppProject(AppProjectAddParm appProjectAddOrAuditParm) {
|
||||
public AppProjectPO addAppProject(AppProjectAddParm appProjectAddOrAuditParm) {
|
||||
AppProjectPO appProjectPO = new AppProjectPO ( );
|
||||
// Boolean result = checkName (appProjectAddOrAuditParm.getUserId ( ), appProjectAddOrAuditParm.getName ( ));
|
||||
// if (result) {
|
||||
@@ -109,19 +110,33 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
||||
}
|
||||
}
|
||||
|
||||
CsLedger csLedger = csLedgerMapper.selectById(appProjectAddOrAuditParm.getEngineeringId());
|
||||
Optional.ofNullable(csLedger).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.ENGINEERING_DATA_ERROR));
|
||||
CsLedger csLedger1 = new CsLedger();
|
||||
csLedger1.setId(appProjectPO.getId());
|
||||
csLedger1.setPid(appProjectAddOrAuditParm.getEngineeringId());
|
||||
csLedger1.setPids(csLedger.getPids()+ ","+appProjectAddOrAuditParm.getEngineeringId());
|
||||
csLedger1.setLevel(1);
|
||||
csLedger1.setName(appProjectPO.getName());
|
||||
csLedger1.setState(1);
|
||||
csLedger1.setSort(0);
|
||||
csLedgerMapper.insert(csLedger1);
|
||||
|
||||
return save;
|
||||
//云协议工程
|
||||
if (Objects.nonNull(appProjectAddOrAuditParm.getIcdEngineeringId())){
|
||||
CsLedger csLedger1 = new CsLedger();
|
||||
csLedger1.setId(appProjectPO.getId());
|
||||
csLedger1.setPid(appProjectAddOrAuditParm.getEngineeringId());
|
||||
csLedger1.setPids("0,"+appProjectAddOrAuditParm.getEngineeringId());
|
||||
csLedger1.setLevel(1);
|
||||
csLedger1.setName(appProjectPO.getName());
|
||||
csLedger1.setState(1);
|
||||
csLedger1.setSort(0);
|
||||
csLedgerMapper.insert(csLedger1);
|
||||
}
|
||||
//其他工程
|
||||
else {
|
||||
CsLedger csLedger = csLedgerMapper.selectById(appProjectAddOrAuditParm.getEngineeringId());
|
||||
Optional.ofNullable(csLedger).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.ENGINEERING_DATA_ERROR));
|
||||
CsLedger csLedger1 = new CsLedger();
|
||||
csLedger1.setId(appProjectPO.getId());
|
||||
csLedger1.setPid(appProjectAddOrAuditParm.getEngineeringId());
|
||||
csLedger1.setPids(csLedger.getPids()+ ","+appProjectAddOrAuditParm.getEngineeringId());
|
||||
csLedger1.setLevel(1);
|
||||
csLedger1.setName(appProjectPO.getName());
|
||||
csLedger1.setState(1);
|
||||
csLedger1.setSort(0);
|
||||
csLedgerMapper.insert(csLedger1);
|
||||
}
|
||||
return appProjectPO;
|
||||
}
|
||||
|
||||
private Boolean checkName( String name,String id,String engineeringId) {
|
||||
@@ -132,7 +147,7 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
||||
// eq ("user_id", userId).
|
||||
eq ("name", name);
|
||||
Integer integer = csLedgerMapper.selectCount (queryWrapper);
|
||||
return integer > 0 ? true : false;
|
||||
return integer > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -249,7 +264,25 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
||||
csLedger2.setName(appProjectAuditParm.getName());
|
||||
}
|
||||
csLedgerMapper.updateById(csLedger2);
|
||||
return i == 1 ? true : false;
|
||||
return i == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = BusinessException.class)
|
||||
public Boolean updateProject(AppProjectAuditParm appProjectAuditParm) {
|
||||
//修改项目表
|
||||
this.lambdaUpdate().set(AppProjectPO::getName,appProjectAuditParm.getName())
|
||||
.set(AppProjectPO::getArea,appProjectAuditParm.getArea())
|
||||
.set(AppProjectPO::getDescription,appProjectAuditParm.getDescription())
|
||||
.eq(AppProjectPO::getId,appProjectAuditParm.getId())
|
||||
.eq(AppProjectPO::getStatus,"1")
|
||||
.update();
|
||||
//修改台账表
|
||||
CsLedger csLedger = new CsLedger();
|
||||
csLedger.setId(appProjectAuditParm.getId());
|
||||
csLedger.setName(appProjectAuditParm.getName());
|
||||
csLedgerMapper.updateById(csLedger);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -324,10 +357,14 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
||||
|
||||
@Override
|
||||
public List<AppProjectPO> getProjectByEngineering(List<String> list) {
|
||||
List<AppProjectPO> result = new ArrayList<>();
|
||||
QueryWrapper<CsLedger> csLedgerQueryWrapper = new QueryWrapper();
|
||||
csLedgerQueryWrapper.lambda().in(CsLedger::getPid, list).eq(CsLedger::getState,1);
|
||||
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
||||
List<String> collect = csLedgers.stream().map(CsLedger::getId).collect(Collectors.toList());
|
||||
return this.lambdaQuery().in(AppProjectPO::getId,collect).list();
|
||||
if (CollectionUtil.isNotEmpty(csLedgers)) {
|
||||
List<String> collect = csLedgers.stream().map(CsLedger::getId).collect(Collectors.toList());
|
||||
result = this.lambdaQuery().in(AppProjectPO::getId,collect).list();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
@@ -101,4 +102,11 @@ public class CsDevModelRelationServiceImpl extends ServiceImpl<CsDevModelRelatio
|
||||
public String getVersionByDevId(String devId) {
|
||||
return this.baseMapper.getVersionByDevId(devId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDataByList(List<String> list, String id) {
|
||||
LambdaUpdateWrapper<CsDevModelRelationPO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.in(CsDevModelRelationPO::getDevId,list).set(CsDevModelRelationPO::getModelId,id);
|
||||
this.update(updateWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.mapper.CsDevModelMapper;
|
||||
import com.njcn.csdevice.pojo.param.CsDevModelAddParm;
|
||||
import com.njcn.csdevice.pojo.param.CsDevModelAuditParm;
|
||||
@@ -17,6 +19,8 @@ import com.njcn.csdevice.service.ICsDataArrayService;
|
||||
import com.njcn.csdevice.service.ICsDataSetService;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.api.DictTreeFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicTreeEnum;
|
||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -26,6 +30,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -157,4 +162,20 @@ public class CsDevModelServiceImpl extends ServiceImpl<CsDevModelMapper, CsDevMo
|
||||
return this.lambdaQuery().eq(CsDevModelPO::getId,id).one();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CsDevModelPO getCldModel() {
|
||||
List<CsDevModelPO> list = this.lambdaQuery()
|
||||
.eq(CsDevModelPO::getDevTypeName, DicDataEnum.DEV_CLD.getCode())
|
||||
.eq(CsDevModelPO::getStatus,1)
|
||||
.list();
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
throw new BusinessException(AlgorithmResponseEnum.CLD_MODEL_MISSING);
|
||||
} else {
|
||||
if (list.size() > 1) {
|
||||
throw new BusinessException(AlgorithmResponseEnum.CLD_MODEL_MORE);
|
||||
}
|
||||
}
|
||||
return list.get(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -217,6 +217,11 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
||||
return this.lambdaQuery().in(CsEngineeringPO::getId,list).eq(CsEngineeringPO::getStatus,"1").list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CsEngineeringPO queryEngineeringById(String id) {
|
||||
return this.lambdaQuery().eq(CsEngineeringPO::getId,id).eq(CsEngineeringPO::getStatus,"1").one();
|
||||
}
|
||||
|
||||
|
||||
public String getAreaById(String id){
|
||||
|
||||
|
||||
@@ -6,9 +6,10 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -18,11 +19,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.access.api.AskDeviceDataFeignClient;
|
||||
import com.njcn.access.utils.MqttUtil;
|
||||
import com.njcn.common.pojo.dto.DeviceLogDTO;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.api.CsLogsFeignClient;
|
||||
import com.njcn.csdevice.constant.DataParam;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||
import com.njcn.csdevice.mapper.CsSoftInfoMapper;
|
||||
import com.njcn.csdevice.mapper.CsTerminalLogsMapper;
|
||||
import com.njcn.csdevice.pojo.param.*;
|
||||
import com.njcn.csdevice.pojo.po.*;
|
||||
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
||||
@@ -32,7 +38,6 @@ import com.njcn.csdevice.service.*;
|
||||
import com.njcn.csdevice.util.QRCodeUtil;
|
||||
import com.njcn.csdevice.utils.ExcelStyleUtil;
|
||||
import com.njcn.csdevice.utils.StringUtil;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.redis.pojo.enums.AppRedisKey;
|
||||
@@ -43,8 +48,7 @@ import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.enums.DicTreeEnum;
|
||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.user.enums.AppRoleEnum;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -64,9 +68,8 @@ import java.io.InputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/3/30 16:23【需求编号】
|
||||
@@ -77,7 +80,6 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliveryMapper, CsEquipmentDeliveryPO> implements CsEquipmentDeliveryService{
|
||||
|
||||
private final CsDevModelRelationService csDevModelRelationService;
|
||||
private final ICsDataSetService csDataSetService;
|
||||
private final ICsLedgerService csLedgerService;
|
||||
@@ -93,6 +95,14 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
private final AskDeviceDataFeignClient askDeviceDataFeignClient;
|
||||
private final RedisUtil redisUtil;
|
||||
private final CsSoftInfoMapper csSoftInfoMapper;
|
||||
private final IMqttUserService mqttUserService;
|
||||
private final MqttUtil mqttUtil;
|
||||
private final CsLogsFeignClient csLogsFeignClient;
|
||||
private final INodeService nodeService;
|
||||
private final CsDevModelService csDevModelService;
|
||||
private final CsLedgerMapper csLedgerMapper;
|
||||
private final CsTerminalLogsMapper csTerminalLogsMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public void refreshDeviceDataCache() {
|
||||
@@ -138,7 +148,6 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
csEquipmentProcess.setStartTime(LocalDateTime.now());
|
||||
csEquipmentProcess.setProcess(1);
|
||||
csEquipmentProcess.setStatus (1);
|
||||
|
||||
csEquipmentProcessPOService.save(csEquipmentProcess);
|
||||
result = this.save (csEquipmentDeliveryPo);
|
||||
if (result) {
|
||||
@@ -148,8 +157,8 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
}
|
||||
|
||||
@Override
|
||||
// @Transactional(rollbackFor = {Exception.class}, propagation = Propagation.REQUIRED)
|
||||
public Boolean AuditEquipmentDelivery(String id) {
|
||||
CsEquipmentDeliveryPO one = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getId, id).one();
|
||||
//物理删除
|
||||
QueryWrapper<CsEquipmentDeliveryPO> wrapper = new QueryWrapper();
|
||||
wrapper.eq ("id", id);
|
||||
@@ -181,8 +190,6 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
/*后续徐那边做处理*/
|
||||
// CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.getBaseMapper().selectById(id);
|
||||
// mqttUserService.deleteUser(csEquipmentDeliveryPO.getNdid());
|
||||
|
||||
|
||||
csDevModelRelationService.lambdaUpdate().eq(CsDevModelRelationPO::getDevId,id).set(CsDevModelRelationPO::getStatus,0).update();
|
||||
if (update) {
|
||||
refreshDeviceDataCache();
|
||||
@@ -200,6 +207,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
BeanUtils.copyProperties (csEquipmentDeliveryPO,result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public CsEquipmentDeliveryPO queryEquipmentPOByndid(String ndid) {
|
||||
QueryWrapper<CsEquipmentDeliveryPO> wrapper = new QueryWrapper();
|
||||
wrapper.eq ("ndid", ndid);
|
||||
@@ -215,7 +223,6 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
if(CollectionUtils.isEmpty(device)){
|
||||
return returnpage;
|
||||
}
|
||||
|
||||
Page<ProjectEquipmentVO> list = this.baseMapper.queryProjectEquipmentVO(returnpage,projectEquipmentQueryParm,device);
|
||||
list.getRecords().stream().forEach(temp->{
|
||||
temp.setIsPrimaryUser(csDeviceUserPOService.isPrimaryUser(temp.getEquipmentId()));
|
||||
@@ -224,20 +231,22 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateEquipmentDelivery(CsEquipmentDeliveryAuditParm csEquipmentDeliveryAuditParm) {
|
||||
StringUtil.containsSpecialCharacters(csEquipmentDeliveryAuditParm.getNdid());
|
||||
|
||||
|
||||
boolean result;
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getNdid,csEquipmentDeliveryAuditParm.getNdid())
|
||||
.in(CsEquipmentDeliveryPO::getStatus,Arrays.asList(1,2,3))
|
||||
.ne(CsEquipmentDeliveryPO::getId, csEquipmentDeliveryAuditParm.getId());
|
||||
.in(CsEquipmentDeliveryPO::getStatus,Arrays.asList(1,2,3))
|
||||
.ne(CsEquipmentDeliveryPO::getId, csEquipmentDeliveryAuditParm.getId());
|
||||
int countByAccount = this.count(lambdaQueryWrapper);
|
||||
//大于等于1个则表示重复
|
||||
if (countByAccount >= 1) {
|
||||
throw new BusinessException(AlgorithmResponseEnum.NDID_ERROR);
|
||||
}
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper2 = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper2.eq(CsEquipmentDeliveryPO::getId, csEquipmentDeliveryAuditParm.getId());
|
||||
CsEquipmentDeliveryPO po = this.baseMapper.selectOne(lambdaQueryWrapper2);
|
||||
List<CsEquipmentDeliveryPO> list = this.lambdaQuery()
|
||||
.ne(CsEquipmentDeliveryPO::getId, csEquipmentDeliveryAuditParm.getId())
|
||||
.ne(CsEquipmentDeliveryPO::getNdid, csEquipmentDeliveryAuditParm.getNdid())
|
||||
@@ -249,8 +258,22 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPo = new CsEquipmentDeliveryPO();
|
||||
BeanUtils.copyProperties (csEquipmentDeliveryAuditParm, csEquipmentDeliveryPo);
|
||||
result = this.updateById(csEquipmentDeliveryPo);
|
||||
//修改台账树中的设备名称
|
||||
CsLedger csLedger = csLedgerService.findDataById(csEquipmentDeliveryAuditParm.getId());
|
||||
CsLedgerParam.Update csLedgerParam = new CsLedgerParam.Update();
|
||||
BeanUtils.copyProperties (csLedger, csLedgerParam);
|
||||
csLedgerParam.setName(csEquipmentDeliveryAuditParm.getName());
|
||||
csLedgerService.updateLedgerTree(csLedgerParam);
|
||||
if (result) {
|
||||
refreshDeviceDataCache();
|
||||
if (!Objects.equals(po.getUsageStatus(),csEquipmentDeliveryAuditParm.getUsageStatus())) {
|
||||
DeviceLogDTO dto = new DeviceLogDTO();
|
||||
dto.setUserName(RequestUtil.getUsername());
|
||||
dto.setOperate("设备使用状态被修改");
|
||||
dto.setResult(1);
|
||||
dto.setLoginName(RequestUtil.getLoginName());
|
||||
csLogsFeignClient.addUserLog(dto);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -268,54 +291,44 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
|
||||
@Override
|
||||
public Page<CsEquipmentDeliveryVO> list(CsEquipmentDeliveryQueryParm queryParam) {
|
||||
QueryWrapper<CsEquipmentDeliveryPO> queryWrapper = new QueryWrapper<CsEquipmentDeliveryPO>();
|
||||
if (ObjectUtil.isNotNull(queryParam)) {
|
||||
//查询参数不为空,进行条件填充
|
||||
if (StrUtil.isNotBlank(queryParam.getSearchValue())) {
|
||||
//部门根据名称模糊查询
|
||||
queryWrapper
|
||||
.and(param -> param.like("cs_equipment_delivery.name", queryParam.getSearchValue())
|
||||
.or().like("cs_equipment_delivery.ndid", queryParam.getSearchValue())
|
||||
.or().like("cs_equipment_delivery.mac", queryParam.getSearchValue()));
|
||||
Page<CsEquipmentDeliveryVO> page = new Page<> ();
|
||||
page.setCurrent(queryParam.getPageNum());
|
||||
page.setSize(queryParam.getPageSize());
|
||||
queryParam.setPageNum((queryParam.getPageNum()-1)*queryParam.getPageSize());
|
||||
int total = this.baseMapper.getCounts(queryParam);
|
||||
if (total > 0) {
|
||||
List<CsEquipmentDeliveryVO> recordList = this.baseMapper.getList(queryParam);
|
||||
//新增逻辑(只针对便携式设备):修改设备中的未注册状态(status = 1)改为5(前端定义的字典也即未接入)
|
||||
for(CsEquipmentDeliveryVO csEquipmentDeliveryVO : recordList){
|
||||
if(DataParam.portableDevType.equals(csEquipmentDeliveryVO.getDevType()) && csEquipmentDeliveryVO.getStatus() == 1){
|
||||
csEquipmentDeliveryVO.setStatus(5);
|
||||
} else if (DataParam.portableDevType.equals(csEquipmentDeliveryVO.getDevType()) && csEquipmentDeliveryVO.getStatus() == 2) {
|
||||
csEquipmentDeliveryVO.setStatus(6);
|
||||
}
|
||||
//判断装置是否已经连接上mqtt服务器
|
||||
String clientName = "NJCN-" + csEquipmentDeliveryVO.getNdid().substring(csEquipmentDeliveryVO.getNdid().length() - 6);
|
||||
boolean mqttClient = mqttUtil.judgeClientOnline(clientName);
|
||||
if (mqttClient) {
|
||||
csEquipmentDeliveryVO.setConnectStatus("已连接");
|
||||
} else {
|
||||
csEquipmentDeliveryVO.setConnectStatus("未连接");
|
||||
}
|
||||
}
|
||||
//排序
|
||||
if (ObjectUtil.isAllNotEmpty(queryParam.getSortBy(), queryParam.getOrderBy())) {
|
||||
queryWrapper.orderBy(true, queryParam.getOrderBy().equalsIgnoreCase(DbConstant.ASC), StrUtil.toUnderlineCase(queryParam.getSortBy()));
|
||||
} else {
|
||||
//默认根据创建时间排序
|
||||
queryWrapper.orderBy(true, false, "create_time");
|
||||
if (ObjectUtil.isNotNull(queryParam.getConnectStatus())) {
|
||||
recordList = recordList.stream()
|
||||
.filter(item -> queryParam.getConnectStatus() == 0
|
||||
? "未连接".equals(item.getConnectStatus())
|
||||
: "已连接".equals(item.getConnectStatus()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
page.setTotal(CollectionUtil.isEmpty(recordList) ? 0 : recordList.size());
|
||||
page.setRecords(recordList);
|
||||
}
|
||||
if (StrUtil.isNotBlank(queryParam.getDevType()) && !Objects.isNull(queryParam.getDevType())){
|
||||
queryWrapper.eq("cs_equipment_delivery.dev_type", queryParam.getDevType());
|
||||
}
|
||||
if (StrUtil.isNotBlank(queryParam.getDevModel()) && !Objects.isNull(queryParam.getDevModel())){
|
||||
queryWrapper.eq("cs_equipment_delivery.dev_model", queryParam.getDevModel());
|
||||
}
|
||||
if (StrUtil.isNotBlank(queryParam.getDevAccessMethod()) && !Objects.isNull(queryParam.getDevAccessMethod())){
|
||||
queryWrapper.eq("cs_equipment_delivery.dev_access_method", queryParam.getDevAccessMethod());
|
||||
}
|
||||
if (!Objects.isNull(queryParam.getStatus())){
|
||||
queryWrapper.eq("cs_equipment_delivery.status", queryParam.getStatus());
|
||||
} else {
|
||||
queryWrapper.in("cs_equipment_delivery.status", Arrays.asList(1,2,3));
|
||||
}
|
||||
if (!Objects.isNull(queryParam.getRunStatus())){
|
||||
queryWrapper.eq("cs_equipment_delivery.run_status", queryParam.getRunStatus());
|
||||
} else {
|
||||
queryWrapper.in("cs_equipment_delivery.run_status", Arrays.asList(1,2));
|
||||
}
|
||||
Page<CsEquipmentDeliveryVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), queryWrapper);
|
||||
page.getRecords().forEach(item->{
|
||||
if (!Objects.isNull(item.getQrPath())){
|
||||
item.setQrPath(item.getQrPath());
|
||||
}
|
||||
});
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceManagerVO getDeviceData(String deviceId, String type, String lineId) {
|
||||
public DeviceManagerVO getDeviceData(String deviceId, String type, String lineId) {
|
||||
DeviceManagerVO deviceManagerVo = new DeviceManagerVO();
|
||||
List<DeviceManagerVO.DataSetVO> dataSetList = new ArrayList<>();
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPo = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getId, deviceId).one();
|
||||
@@ -348,17 +361,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
List<CsDataSet> dataSet = new ArrayList<>();
|
||||
//治理监测点
|
||||
if (Objects.equals(code, DicDataEnum.OUTPUT_SIDE.getCode())){
|
||||
// select
|
||||
// t1.id
|
||||
// from
|
||||
// cs_dev_model_relation t0
|
||||
// left join cs_dev_model t1 on
|
||||
// t0.model_id = t1.id
|
||||
// where
|
||||
// t0.status="1" and
|
||||
// t0.dev_id = #{devId} and t1.`type` = #{type}
|
||||
modelId = csDevModelRelationService.getModelByType(deviceId,0);
|
||||
//select * from cs_data_set where pid = modelId and clDev = 0
|
||||
dataSet = csDataSetService.findDataSetByModelId(modelId,0);
|
||||
}
|
||||
//电网侧监测点
|
||||
@@ -372,7 +375,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
dataSet = csDataSetService.findDataSetByModelId(modelId,2);
|
||||
}
|
||||
setDataSetValues(csEquipmentDeliveryPo, dataSet, dataSetList, type, deviceManagerVo);
|
||||
}else if(Objects.equals(devTypeCode, DicDataEnum.PORTABLE.getCode())){
|
||||
} else if(Objects.equals(devTypeCode, DicDataEnum.PORTABLE.getCode()) || Objects.equals(devTypeCode, DicDataEnum.DEV_CLD.getCode())){
|
||||
List<CsDataSet> dataSet = new ArrayList<>();
|
||||
List<CsDevModelRelationPO> modelId = csDevModelRelationService.findModelByDevId(deviceId);
|
||||
if (CollUtil.isNotEmpty(modelId)){
|
||||
@@ -401,15 +404,31 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
} else {
|
||||
CsDataSet item = dataSet.get(0);
|
||||
boolean isPortableDevice = DataParam.portableDevType.equals(csEquipmentDeliveryPo.getDevType());
|
||||
boolean isCLdDevice = DicDataEnum.DEV_CLD.getCode().equals(dictTreeFeignClient.queryById(csEquipmentDeliveryPo.getDevType()).getData().getCode());
|
||||
|
||||
addDataSet(dataSetList, item, "最新数据", "rt");
|
||||
addDataSet(dataSetList, item, "历史统计数据", "history");
|
||||
addDataSet(dataSetList, item, "历史趋势", "trenddata");
|
||||
if (item.getClDev() == 0 && item.getType() == 0) {
|
||||
//限制角色展示
|
||||
String role = RequestUtil.getUserRole();
|
||||
List<String> strings = JSONArray.parseArray(role, String.class);
|
||||
if (strings.contains(AppRoleEnum.ENGINEERING_USER.getCode())
|
||||
|| strings.contains(AppRoleEnum.OPERATION_MANAGER.getCode())
|
||||
|| strings.contains(AppRoleEnum.ROOT.getCode())) {
|
||||
addDataSet(dataSetList, item, "模块数据", "moduleData");
|
||||
}
|
||||
}
|
||||
if (isPortableDevice) {
|
||||
// 便携式设备特有的数据集
|
||||
addDataSet(dataSetList, item, "实时数据", "realtimedata");
|
||||
addDataSet(dataSetList, item, "暂态事件", "event");
|
||||
addDataSet(dataSetList, item, "测试项日志", "items");
|
||||
}
|
||||
if (isCLdDevice) {
|
||||
// 云前置数据集
|
||||
addDataSet(dataSetList, item, "实时数据", "realtimedata");
|
||||
}
|
||||
deviceManagerVo.setDataLevel(item.getDataLevel());
|
||||
}
|
||||
deviceManagerVo.setDataSetList(dataSetList);
|
||||
@@ -446,7 +465,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void importEquipment(MultipartFile file, HttpServletResponse response) {
|
||||
public List<CsEquipmentDeliveryPO> importEquipment(MultipartFile file, HttpServletResponse response) {
|
||||
ImportParams params = new ImportParams ( );
|
||||
params.setHeadRows(1);
|
||||
params.setTitleRows(1);
|
||||
@@ -459,10 +478,8 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
//如果存在非法数据,将不合格的数据导出
|
||||
List<DeviceExcelTemplete> trueCollect = new ArrayList<> ( );
|
||||
List<DeviceExcelTemplete.IllegalityDeviceExcelTemplete> falseCollect = new ArrayList<> ( );
|
||||
|
||||
for (int i = 0; i < terminalBaseList.getList ( ).size ( ); i++) {
|
||||
DeviceExcelTemplete deviceExcelTemplete = terminalBaseList.getList ( ).get (i);
|
||||
|
||||
if(!deviceExcelTemplete.getNdid().matches(regex)){
|
||||
DeviceExcelTemplete.IllegalityDeviceExcelTemplete idlegalityDeviceException = new DeviceExcelTemplete.IllegalityDeviceExcelTemplete();
|
||||
BeanUtils.copyProperties(deviceExcelTemplete,idlegalityDeviceException);
|
||||
@@ -470,7 +487,6 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
falseCollect.add(idlegalityDeviceException);
|
||||
continue;
|
||||
}
|
||||
|
||||
CsEquipmentDeliveryPO po = this.queryEquipmentPOByndid (deviceExcelTemplete.getNdid ( ));
|
||||
if(!Objects.isNull (po)){
|
||||
DeviceExcelTemplete.IllegalityDeviceExcelTemplete idlegalityDeviceException = new DeviceExcelTemplete.IllegalityDeviceExcelTemplete();
|
||||
@@ -491,7 +507,6 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
//设备类型
|
||||
List<SysDicTreePO> children = deviceType.get(0).getChildren();
|
||||
Map<String, SysDicTreePO> map = children.stream().collect(Collectors.toMap(SysDicTreePO::getName, dictTreeVO -> dictTreeVO));
|
||||
|
||||
List<SysDicTreePO> collect = children.stream().filter(temp -> Objects.equals(temp.getName(), deviceExcelTemplete.getDevType())).collect(Collectors.toList());
|
||||
SysDicTreePO sysDicTreePO = map.get(deviceExcelTemplete.getDevType());
|
||||
if(CollectionUtils.isEmpty(collect)){
|
||||
@@ -502,15 +517,11 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
continue;
|
||||
}else {
|
||||
deviceExcelTemplete.setDevType(map.get(deviceExcelTemplete.getDevType()).getId());
|
||||
|
||||
}
|
||||
|
||||
//设备型号
|
||||
List<SysDicTreePO> children1 = sysDicTreePO.getChildren();
|
||||
Map<String, SysDicTreePO> map2 = children1.stream().collect(Collectors.toMap(SysDicTreePO::getName, dictTreeVO -> dictTreeVO));
|
||||
|
||||
List<SysDicTreePO> collect2 = children1.stream().filter(temp -> Objects.equals(temp.getName(), deviceExcelTemplete.getDevModel())).collect(Collectors.toList());
|
||||
|
||||
if(CollectionUtils.isEmpty(collect2)){
|
||||
DeviceExcelTemplete.IllegalityDeviceExcelTemplete idlegalityDeviceException = new DeviceExcelTemplete.IllegalityDeviceExcelTemplete();
|
||||
BeanUtils.copyProperties(deviceExcelTemplete,idlegalityDeviceException);
|
||||
@@ -521,8 +532,6 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
deviceExcelTemplete.setDevModel(map2.get(deviceExcelTemplete.getDevModel()).getId());
|
||||
trueCollect.add(deviceExcelTemplete);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (!CollectionUtils.isEmpty (trueCollect)) {
|
||||
List<CsEquipmentProcessPO> collect1 = new ArrayList<>();
|
||||
@@ -536,7 +545,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
csEquipmentDeliveryPO.setRunStatus(1);
|
||||
csEquipmentDeliveryPO.setStatus(1);
|
||||
csEquipmentDeliveryPO.setProcess(2);
|
||||
|
||||
csEquipmentDeliveryPO.setSort(100);
|
||||
CsEquipmentProcessPO csEquipmentProcess = new CsEquipmentProcessPO();
|
||||
csEquipmentProcess.setDevId(csEquipmentDeliveryPO.getNdid());
|
||||
csEquipmentProcess.setOperator(RequestUtil.getUserIndex());
|
||||
@@ -548,27 +557,29 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
}).collect (Collectors.toList ( ));
|
||||
csEquipmentProcessPOService.saveBatch(collect1,500);
|
||||
this.saveOrUpdateBatch (collect, 500);
|
||||
return collect;
|
||||
}
|
||||
if (!CollectionUtils.isEmpty (falseCollect)) {
|
||||
ExportParams exportExcel = new ExportParams ("批量导入模板(请严格按照模板标准填入数据)", "非法设备信息");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel (exportExcel, DeviceExcelTemplete.IllegalityDeviceExcelTemplete.class, falseCollect);
|
||||
ExcelStyleUtil.exportFileByWorkbook (workbook, "非法设备信息.xlsx", response);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace ( );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* 物理删除设备相关数据
|
||||
*
|
||||
* 2.删除cs_ledger
|
||||
* 3.删除cs_dev_model_relation
|
||||
* 4.删除cs_line
|
||||
* 5.删除cs_line_topology_diagram
|
||||
* 6.删除cs_device_user
|
||||
* */
|
||||
* 物理删除设备相关数据
|
||||
*
|
||||
* 2.删除cs_ledger
|
||||
* 3.删除cs_dev_model_relation
|
||||
* 4.删除cs_line
|
||||
* 5.删除cs_line_topology_diagram
|
||||
* 6.删除cs_device_user
|
||||
* */
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(String devId) {
|
||||
@@ -628,11 +639,10 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
@Override
|
||||
public void deleteTest(String deviceId, Integer type ,String remark) {
|
||||
CsEquipmentDeliveryPO one = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getId, deviceId).one();
|
||||
|
||||
this.lambdaUpdate().eq(CsEquipmentDeliveryPO::getId,deviceId).
|
||||
// set(CsEquipmentDeliveryPO::getStatus,1).
|
||||
// set(CsEquipmentDeliveryPO::getRunStatus,1).
|
||||
set(CsEquipmentDeliveryPO::getProcess,type).update();
|
||||
set(CsEquipmentDeliveryPO::getProcess,type).update();
|
||||
this.delete(deviceId);
|
||||
List<CsEquipmentProcessPO> list = csEquipmentProcessPOService.lambdaQuery().eq(CsEquipmentProcessPO::getDevId, one.getNdid()).
|
||||
eq(CsEquipmentProcessPO::getProcess, type).orderByDesc(CsEquipmentProcessPO::getStartTime).list();
|
||||
@@ -650,8 +660,8 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
boolean result;
|
||||
LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.eq(CsEquipmentDeliveryPO::getNdid,nDid)
|
||||
.ne(CsEquipmentDeliveryPO::getRunStatus,0)
|
||||
.set(CsEquipmentDeliveryPO::getSoftinfoId,id);
|
||||
.ne(CsEquipmentDeliveryPO::getRunStatus,0)
|
||||
.set(CsEquipmentDeliveryPO::getSoftinfoId,id);
|
||||
result = this.update(lambdaUpdateWrapper);
|
||||
if (result) {
|
||||
refreshDeviceDataCache();
|
||||
@@ -709,6 +719,277 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CsEquipmentDeliveryPO getDevByLineId(String lineId) {
|
||||
CsLinePO linePO = csLinePOService.getById(lineId);
|
||||
return this.lambdaQuery().eq(CsEquipmentDeliveryPO::getId,linePO.getDeviceId()).ne(CsEquipmentDeliveryPO::getRunStatus,0).one();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public CsEquipmentDeliveryPO saveCld(CsEquipmentDeliveryAddParm param) {
|
||||
boolean result;
|
||||
CsEquipmentDeliveryPO one = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getName, param.getName()).ne(CsEquipmentDeliveryPO::getRunStatus, 0).one();
|
||||
if(Objects.nonNull (one)){
|
||||
throw new BusinessException ("设备名称不能重复");
|
||||
}
|
||||
StringUtil.containsSpecialCharacters(param.getNdid());
|
||||
CsEquipmentDeliveryPO po = this.queryEquipmentPOByndid (param.getNdid());
|
||||
if(!Objects.isNull (po)){
|
||||
throw new BusinessException (AlgorithmResponseEnum.NDID_ERROR);
|
||||
}
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPo = new CsEquipmentDeliveryPO();
|
||||
BeanUtils.copyProperties (param,csEquipmentDeliveryPo);
|
||||
csEquipmentDeliveryPo.setStatus(3);
|
||||
csEquipmentDeliveryPo.setRunStatus(1);
|
||||
csEquipmentDeliveryPo.setUsageStatus(1);
|
||||
csEquipmentDeliveryPo.setProcess(4);
|
||||
csEquipmentDeliveryPo.setMac(param.getMac());
|
||||
|
||||
//这边自动分配前置机进程号,需要做判断 1.新增装置时,判断是否已经是最大装置数量;2.根据进程号,选择最少的分配
|
||||
csEquipmentDeliveryPo.setNodeId(param.getNodeId());
|
||||
//判断1
|
||||
Node node = nodeService.getNodeById(param.getNodeId());
|
||||
List<CsEquipmentDeliveryPO> devList = getListByNodeId(param.getNodeId());
|
||||
if (ObjectUtil.isNotEmpty(devList) && devList.size() >= node.getNodeDevNum()) {
|
||||
throw new BusinessException (AlgorithmResponseEnum.OVER_MAX_DEV_COUNT);
|
||||
}
|
||||
//判断2
|
||||
int process = findLeastFrequentProcess(devList,node.getMaxProcessNum());
|
||||
csEquipmentDeliveryPo.setNodeProcess(process);
|
||||
result = this.save(csEquipmentDeliveryPo);
|
||||
|
||||
//新增设备与模板之间的关系 获取云前置模板
|
||||
CsDevModelPO csDevModelPO = csDevModelService.getCldModel();
|
||||
CsDevModelRelationAddParm relationAddParam = new CsDevModelRelationAddParm();
|
||||
relationAddParam.setDevId(csEquipmentDeliveryPo.getId());
|
||||
relationAddParam.setModelId(csDevModelPO.getId());
|
||||
relationAddParam.setDid(1);
|
||||
CsDevModelRelationPO relation = csDevModelRelationService.addDevModelRelation(relationAddParam);
|
||||
|
||||
//新增台账数据
|
||||
CsLedger csLedger = new CsLedger();
|
||||
csLedger.setId(csEquipmentDeliveryPo.getId());
|
||||
csLedger.setPid(param.getProjectId());
|
||||
csLedger.setPids("0," + param.getEngineeringId() + "," + param.getProjectId());
|
||||
csLedger.setLevel(2);
|
||||
csLedger.setName(param.getName());
|
||||
csLedger.setState(1);
|
||||
csLedger.setSort(0);
|
||||
int addLedger = csLedgerMapper.insert(csLedger);
|
||||
|
||||
if (result && ObjectUtil.isNotNull(relation) && addLedger > 0) {
|
||||
refreshDeviceDataCache();
|
||||
}
|
||||
return csEquipmentDeliveryPo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean delCldDev(String id) {
|
||||
CsEquipmentDeliveryPO one = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getId, id).one();
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getId,id);
|
||||
boolean update = this.remove(lambdaQueryWrapper);
|
||||
List<CsLedger> list = csLedgerService.lambdaQuery().eq(CsLedger::getPid, id).list();
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
List<String> collect = list.stream().map(CsLedger::getId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<CsLinePO> csLinePOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
csLinePOLambdaQueryWrapper.in(CsLinePO::getLineId,collect);
|
||||
csLinePOService.remove(csLinePOLambdaQueryWrapper);
|
||||
}
|
||||
LambdaQueryWrapper<CsLedger> csLedgerLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
csLedgerLambdaQueryWrapper.clear();
|
||||
csLedgerLambdaQueryWrapper.eq(CsLedger::getId,id);
|
||||
csLedgerService.remove(csLedgerLambdaQueryWrapper);
|
||||
csLedgerLambdaQueryWrapper.clear();
|
||||
csLedgerLambdaQueryWrapper.eq(CsLedger::getPid,id);
|
||||
csLedgerService.remove(csLedgerLambdaQueryWrapper);
|
||||
csDevModelRelationService.lambdaUpdate().eq(CsDevModelRelationPO::getDevId,id).set(CsDevModelRelationPO::getStatus,0).update();
|
||||
if (update) {
|
||||
refreshDeviceDataCache();
|
||||
}
|
||||
//新增操作日志
|
||||
CsTerminalLogs csTerminalLogs = new CsTerminalLogs();
|
||||
csTerminalLogs.setDeviceId(id);
|
||||
csTerminalLogs.setOperateType(2);
|
||||
csTerminalLogs.setIsPush(0);
|
||||
csTerminalLogs.setNodeId(one.getNodeId());
|
||||
csTerminalLogs.setNodeProcess(one.getNodeProcess());
|
||||
csTerminalLogsMapper.insert(csTerminalLogs);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateCldDev(CsEquipmentDeliveryAuditParm param) {
|
||||
//云前置设备判断,修改云前置判断设备是否达到上限
|
||||
if(ObjectUtil.isNotNull(param.getNodeId())){
|
||||
Node node = nodeService.getNodeById(param.getNodeId());
|
||||
List<CsEquipmentDeliveryPO> devList = getListByNodeId(param.getNodeId());
|
||||
if (ObjectUtil.isNotEmpty(devList) && devList.size() >= node.getNodeDevNum()) {
|
||||
throw new BusinessException (AlgorithmResponseEnum.OVER_MAX_DEV_COUNT);
|
||||
}
|
||||
//自动分配进程号
|
||||
int process = findLeastFrequentProcess(devList,node.getMaxProcessNum());
|
||||
param.setNodeProcess(process);
|
||||
}
|
||||
StringUtil.containsSpecialCharacters(param.getNdid());
|
||||
boolean result;
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getNdid,param.getNdid())
|
||||
.in(CsEquipmentDeliveryPO::getStatus,Arrays.asList(1,2,3))
|
||||
.ne(CsEquipmentDeliveryPO::getId, param.getId());
|
||||
int countByAccount = this.count(lambdaQueryWrapper);
|
||||
//大于等于1个则表示重复
|
||||
if (countByAccount >= 1) {
|
||||
throw new BusinessException(AlgorithmResponseEnum.NDID_ERROR);
|
||||
}
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper2 = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper2.eq(CsEquipmentDeliveryPO::getId, param.getId());
|
||||
CsEquipmentDeliveryPO po = this.baseMapper.selectOne(lambdaQueryWrapper2);
|
||||
List<CsEquipmentDeliveryPO> list = this.lambdaQuery()
|
||||
.ne(CsEquipmentDeliveryPO::getId, param.getId())
|
||||
.ne(CsEquipmentDeliveryPO::getNdid, param.getNdid())
|
||||
.eq(CsEquipmentDeliveryPO::getName, param.getName())
|
||||
.ne(CsEquipmentDeliveryPO::getRunStatus, 0).list();
|
||||
if(!CollectionUtils.isEmpty (list)){
|
||||
throw new BusinessException ("设备名称不能重复");
|
||||
}
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPo = new CsEquipmentDeliveryPO();
|
||||
BeanUtils.copyProperties (param, csEquipmentDeliveryPo);
|
||||
String path = this.createPath(param.getNdid());
|
||||
csEquipmentDeliveryPo.setMac(path);
|
||||
result = this.updateById(csEquipmentDeliveryPo);
|
||||
//修改台账树中的设备名称
|
||||
CsLedger csLedger = csLedgerService.findDataById(param.getId());
|
||||
if (!Objects.isNull(csLedger)) {
|
||||
CsLedgerParam.Update csLedgerParam = new CsLedgerParam.Update();
|
||||
BeanUtils.copyProperties (csLedger, csLedgerParam);
|
||||
csLedgerParam.setName(param.getName());
|
||||
csLedgerService.updateLedgerTree(csLedgerParam);
|
||||
}
|
||||
if (result) {
|
||||
refreshDeviceDataCache();
|
||||
if (!Objects.equals(po.getUsageStatus(),param.getUsageStatus())) {
|
||||
DeviceLogDTO dto = new DeviceLogDTO();
|
||||
dto.setUserName(RequestUtil.getUsername());
|
||||
dto.setOperate("设备使用状态被修改");
|
||||
dto.setResult(1);
|
||||
dto.setLoginName(RequestUtil.getLoginName());
|
||||
csLogsFeignClient.addUserLog(dto);
|
||||
}
|
||||
}
|
||||
//新增台账日志
|
||||
CsTerminalLogs csTerminalLogs = new CsTerminalLogs();
|
||||
csTerminalLogs.setDeviceId(csEquipmentDeliveryPo.getId());
|
||||
csTerminalLogs.setOperateType(1);
|
||||
csTerminalLogs.setIsPush(0);
|
||||
csTerminalLogsMapper.insert(csTerminalLogs);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsEquipmentDeliveryPO> getCldDevByIp(String id, List<Integer> runFlag) {
|
||||
//运行状态转换
|
||||
List<Integer> state = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(runFlag)) {
|
||||
if (runFlag.contains(0)) {
|
||||
state.add(1);
|
||||
}
|
||||
if (runFlag.contains(2)) {
|
||||
state.add(0);
|
||||
}
|
||||
//fixme 目前治理设备只有启用和停用,没有那么多状态,如果前置传递其他状态,先设置一个不存在的状态
|
||||
state.add(9);
|
||||
}
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getNodeId,id)
|
||||
.in(ObjectUtil.isNotEmpty(state),CsEquipmentDeliveryPO::getUsageStatus,state);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateCldDevStatus(String nodeId, Integer processNo) {
|
||||
//获取需要修改的设备信息
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getNodeId,nodeId)
|
||||
.eq(CsEquipmentDeliveryPO::getNodeProcess,processNo)
|
||||
.eq(CsEquipmentDeliveryPO::getUsageStatus,1)
|
||||
.eq(CsEquipmentDeliveryPO::getRunStatus,2);
|
||||
List<CsEquipmentDeliveryPO> devList = this.list(lambdaQueryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(devList)) {
|
||||
//修改设备运行状态
|
||||
devList.forEach(item->{item.setRunStatus(1);});
|
||||
this.updateBatchById(devList);
|
||||
//修改监测点运行状态
|
||||
List<String> devIdList = devList.stream().map(CsEquipmentDeliveryPO::getId).collect(Collectors.toList());
|
||||
List<CsLinePO> lineList = csLinePOService.getLinesByDevList(devIdList);
|
||||
csLinePOService.updateCldLineStatus(lineList,2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flipCldDevStatus(String devId, Integer status) {
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getId,devId)
|
||||
.eq(CsEquipmentDeliveryPO::getUsageStatus,1)
|
||||
.ne(CsEquipmentDeliveryPO::getUsageStatus,0);
|
||||
CsEquipmentDeliveryPO po = this.getOne(lambdaQueryWrapper);
|
||||
if (ObjectUtil.isNotNull(po)) {
|
||||
po.setRunStatus(status);
|
||||
this.updateById(po);
|
||||
//修改监测点运行状态
|
||||
List<CsLinePO> lineList = csLinePOService.getLinesByDevList(Collections.singletonList(po.getId()));
|
||||
csLinePOService.updateCldLineStatus(lineList,status==1?2:0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsEquipmentDeliveryPO> getDevListByProjectId(String projectId) {
|
||||
QueryWrapper<CsLedger> csLedgerQueryWrapper = new QueryWrapper();
|
||||
csLedgerQueryWrapper.lambda().eq(CsLedger::getPid, projectId).eq(CsLedger::getState,1);
|
||||
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
||||
if (CollectionUtil.isEmpty(csLedgers)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<String> collect = csLedgers.stream().map(CsLedger::getId).collect(Collectors.toList());
|
||||
return this.lambdaQuery().in(CsEquipmentDeliveryPO::getId,collect).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsEquipmentDeliveryPO> getDataByNodeIdAndProcessNo(String nodeId, Integer processNo) {
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getNodeId,nodeId)
|
||||
.ne(CsEquipmentDeliveryPO::getRunStatus,0)
|
||||
.eq(CsEquipmentDeliveryPO::getDevAccessMethod,"CLD");
|
||||
if (ObjectUtil.isNotNull(processNo)) {
|
||||
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getNodeProcess,processNo);
|
||||
}
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
//根据前置机id获取装置数量
|
||||
public List<CsEquipmentDeliveryPO> getListByNodeId(String nodeId) {
|
||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getNodeId,nodeId)
|
||||
.in(CsEquipmentDeliveryPO::getRunStatus,Arrays.asList(1,2));
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public int findLeastFrequentProcess(List<CsEquipmentDeliveryPO> items, Integer process) {
|
||||
Map<Integer, Long> processCounts = items.stream()
|
||||
.collect(Collectors.groupingBy(CsEquipmentDeliveryPO::getNodeProcess, Collectors.counting()));
|
||||
for (int i = 1; i <= process; i++) {
|
||||
processCounts.putIfAbsent(i, 0L);
|
||||
}
|
||||
//如果列表为空,默认返回1
|
||||
return processCounts.entrySet().stream()
|
||||
.min(Comparator.comparingLong(Map.Entry::getValue))
|
||||
.map(Map.Entry::getKey)
|
||||
.orElse(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ndid生成二维码
|
||||
* @param ndid
|
||||
@@ -728,7 +1009,6 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
e.printStackTrace();
|
||||
}
|
||||
return filePath;
|
||||
|
||||
}
|
||||
|
||||
public InputStream bufferedImageToInputStream(BufferedImage image) {
|
||||
@@ -742,6 +1022,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/*将ndid转成mac地址*/
|
||||
public String createPath(String nDid) {
|
||||
// 使用StringBuilder来构建新的字符串
|
||||
@@ -763,4 +1044,4 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
}
|
||||
return output.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -337,8 +337,8 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
||||
if (Objects.equals("Primary",commonStatisticalQueryParam.getDataLevel())) {
|
||||
if (Objects.equals("Primary",csDataSet.getDataLevel())) {
|
||||
if (HarmonicConstant.POWER_LIST.contains(epdPqd.getShowName())) {
|
||||
re = Objects.isNull(temp.getValue()) ? 3.14159 : temp.getValue() / 1000;
|
||||
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||
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())));
|
||||
|
||||
@@ -7,9 +7,11 @@ import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||
import com.njcn.csdevice.constant.DataParam;
|
||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||
import com.njcn.csdevice.mapper.*;
|
||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
||||
import com.njcn.csdevice.pojo.param.CsLedgerParam;
|
||||
@@ -18,7 +20,10 @@ import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
||||
import com.njcn.csdevice.service.*;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.api.AreaFeignClient;
|
||||
import com.njcn.system.api.DictTreeFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.pojo.po.Area;
|
||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -49,6 +54,8 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
private final CsDevModelRelationService csDevModelRelationService;
|
||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||
private final ICsDataSetService csDataSetService;
|
||||
private final EquipmentFeignClient equipmentFeignClient;
|
||||
private final DictTreeFeignClient dictTreeFeignClient;
|
||||
|
||||
@Override
|
||||
public List<CsLedgerVO> getLedgerTree() {
|
||||
@@ -72,6 +79,29 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
/*获取用户工程,设备信息过滤*/
|
||||
List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
||||
List<String> device = roleEngineerDevService.getDevice();
|
||||
//区分治理装置和云前置装置
|
||||
List<String> zhiLianDevice = new ArrayList<>();
|
||||
List<String> cldDevice = new ArrayList<>();
|
||||
List<CsEquipmentDeliveryDTO> csEquipmentDeliveryPOS = equipmentFeignClient.queryDeviceById(device).getData();
|
||||
if (CollectionUtil.isNotEmpty(csEquipmentDeliveryPOS)) {
|
||||
DictTreeVO vo1 = dictTreeFeignClient.queryByCode(DicDataEnum.DEV_CLD.getCode()).getData();
|
||||
Optional.ofNullable(vo1)
|
||||
.map(DictTreeVO::getId)
|
||||
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
||||
.filter(item -> Objects.equals(item.getDevType(), id))
|
||||
.map(CsEquipmentDeliveryDTO::getId)
|
||||
.forEach(cldDevice::add)
|
||||
);
|
||||
DictTreeVO vo2 = dictTreeFeignClient.queryByCode(DicDataEnum.CONNECT_DEV.getCode()).getData();
|
||||
Optional.ofNullable(vo2)
|
||||
.map(DictTreeVO::getId)
|
||||
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
||||
.filter(item -> Objects.equals(item.getDevType(), id))
|
||||
.map(CsEquipmentDeliveryDTO::getId)
|
||||
.forEach(zhiLianDevice::add)
|
||||
);
|
||||
}
|
||||
|
||||
engineeringList = allList.stream().filter(item->roleengineer.contains(item.getId())).collect(Collectors.toList());
|
||||
List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
|
||||
@@ -85,12 +115,26 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
));
|
||||
|
||||
List<CsLedgerVO> deviceList = allList.stream()
|
||||
.filter(item -> device.contains(item.getId()) && !Objects.equals(item.getPid(), "0"))
|
||||
.filter(item -> zhiLianDevice.contains(item.getId()) && !Objects.equals(item.getPid(), "0"))
|
||||
.peek(item -> {
|
||||
CsEquipmentDeliveryPO po = poMap.get(item.getId());
|
||||
item.setComFlag(po.getRunStatus());
|
||||
item.setNDId(po.getNdid());
|
||||
item.setType("device");
|
||||
item.setProcess(po.getProcess());
|
||||
})
|
||||
.filter(item -> Objects.equals(poMap.get(item.getId()).getUsageStatus(), 1))
|
||||
.sorted(Comparator.comparing(CsLedgerVO::getSort))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<CsLedgerVO> cldDeviceList = allList.stream()
|
||||
.filter(item -> cldDevice.contains(item.getId()) && !Objects.equals(item.getPid(), "0"))
|
||||
.peek(item -> {
|
||||
CsEquipmentDeliveryPO po = poMap.get(item.getId());
|
||||
item.setComFlag(po.getRunStatus());
|
||||
item.setNDId(po.getNdid());
|
||||
item.setType("device");
|
||||
item.setProcess(po.getProcess());
|
||||
})
|
||||
.filter(item -> Objects.equals(poMap.get(item.getId()).getUsageStatus(), 1))
|
||||
.sorted(Comparator.comparing(CsLedgerVO::getSort))
|
||||
@@ -115,10 +159,35 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
}
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
checkDevSetData(deviceList);
|
||||
deviceList.forEach(dev -> dev.setChildren(getChildren(dev, finalLineList)));
|
||||
projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
|
||||
engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList)));
|
||||
List<CsLedgerVO> engineeringList1 = new ArrayList<>();
|
||||
List<CsLedgerVO> projectList1 = new ArrayList<>();
|
||||
List<String> dev = deviceList.stream().map(CsLedgerVO::getId).collect(Collectors.toList());
|
||||
List<CsLedgerVO> ledger1 = getProAndEngineer(dev);
|
||||
if (CollectionUtil.isNotEmpty(ledger1)) {
|
||||
deviceList.forEach(dev1 -> dev1.setChildren(getChildren(dev1, finalLineList)));
|
||||
engineeringList1 = ledger1.stream().filter(item -> item.getLevel().equals(LineBaseEnum.ENGINEERING_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
projectList1 = ledger1.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
projectList1.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
|
||||
List<CsLedgerVO> finalProjectList = projectList1;
|
||||
engineeringList1.forEach(eng -> eng.setChildren(getChildren(eng, finalProjectList)));
|
||||
}
|
||||
|
||||
checkDevSetData(cldDeviceList);
|
||||
List<CsLedgerVO> engineeringList2 = new ArrayList<>();
|
||||
List<CsLedgerVO> projectList2 = new ArrayList<>();
|
||||
List<String> dev2 = cldDeviceList.stream().map(CsLedgerVO::getId).collect(Collectors.toList());
|
||||
List<CsLedgerVO> ledger2 = getProAndEngineer(dev2);
|
||||
if (CollectionUtil.isNotEmpty(ledger2)) {
|
||||
cldDeviceList.forEach(dev1 -> dev1.setChildren(getChildren(dev1, finalLineList)));
|
||||
engineeringList2 = ledger2.stream().filter(item -> item.getLevel().equals(LineBaseEnum.ENGINEERING_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
projectList2 = ledger2.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
projectList2.forEach(pro -> pro.setChildren(getChildren(pro, cldDeviceList)));
|
||||
List<CsLedgerVO> finalProjectList = projectList2;
|
||||
engineeringList2.forEach(eng -> eng.setChildren(getChildren(eng, finalProjectList)));
|
||||
}
|
||||
|
||||
//获取便携式设备树
|
||||
CsLedgerVO portable = new CsLedgerVO();
|
||||
portable.setLevel(0);
|
||||
@@ -148,7 +217,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
.filter(c -> poMap2.get(c.getId()).getUsageStatus() == 1)
|
||||
.collect(Collectors.toList());
|
||||
portables = portables.stream().sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
portables.forEach(dev -> dev.setChildren(getChildren(dev, finalLineList)));
|
||||
portables.forEach(dev3 -> dev3.setChildren(getChildren(dev3, finalLineList)));
|
||||
checkDevSetData(portables);
|
||||
portable.setChildren(portables);
|
||||
|
||||
@@ -157,7 +226,16 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
government.setName(DataParam.governmentDev);
|
||||
government.setPid("0");
|
||||
government.setId(IdUtil.simpleUUID());
|
||||
government.setChildren(engineeringList);
|
||||
government.setChildren(engineeringList1);
|
||||
|
||||
//获取云前置设备树
|
||||
CsLedgerVO cld = new CsLedgerVO();
|
||||
cld.setLevel(0);
|
||||
cld.setName(DataParam.cldDev);
|
||||
cld.setPid("0");
|
||||
cld.setId(IdUtil.simpleUUID());
|
||||
cld.setChildren(engineeringList2);
|
||||
|
||||
List<CsLedgerVO> tree = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(portables)) {
|
||||
tree.add(portable);
|
||||
@@ -165,6 +243,9 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
if (CollUtil.isNotEmpty(deviceList)) {
|
||||
tree.add(government);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(cldDeviceList)) {
|
||||
tree.add(cld);
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
//剔除未接入的设备(根据status判断不太稳,所有这里直接判断该设备有没有对应的模板指标)
|
||||
@@ -203,6 +284,28 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
/*获取用户工程,设备信息过滤*/
|
||||
List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
||||
List<String> device = roleEngineerDevService.getDevice();
|
||||
|
||||
List<String> zhiLianDevice = new ArrayList<>();
|
||||
List<String> cldDevice = new ArrayList<>();
|
||||
List<CsEquipmentDeliveryDTO> csEquipmentDeliveryPOS = equipmentFeignClient.queryDeviceById(device).getData();
|
||||
if (CollectionUtil.isNotEmpty(csEquipmentDeliveryPOS)) {
|
||||
DictTreeVO vo1 = dictTreeFeignClient.queryByCode(DicDataEnum.DEV_CLD.getCode()).getData();
|
||||
Optional.ofNullable(vo1)
|
||||
.map(DictTreeVO::getId)
|
||||
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
||||
.filter(item -> Objects.equals(item.getDevType(), id))
|
||||
.map(CsEquipmentDeliveryDTO::getId)
|
||||
.forEach(cldDevice::add)
|
||||
);
|
||||
DictTreeVO vo2 = dictTreeFeignClient.queryByCode(DicDataEnum.CONNECT_DEV.getCode()).getData();
|
||||
Optional.ofNullable(vo2)
|
||||
.map(DictTreeVO::getId)
|
||||
.ifPresent(id -> csEquipmentDeliveryPOS.stream()
|
||||
.filter(item -> Objects.equals(item.getDevType(), id))
|
||||
.map(CsEquipmentDeliveryDTO::getId)
|
||||
.forEach(zhiLianDevice::add)
|
||||
);
|
||||
}
|
||||
engineeringList = allList.stream().filter(item->roleengineer.contains(item.getId())).collect(Collectors.toList());
|
||||
List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
|
||||
@@ -215,21 +318,59 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
csEquipmentDeliveryMapper::selectById
|
||||
));
|
||||
|
||||
//获取治理设备
|
||||
List<CsLedgerVO> deviceList = allList.stream()
|
||||
.filter(item -> device.contains(item.getId()) && !Objects.equals(item.getPid(), "0"))
|
||||
.filter(item -> zhiLianDevice.contains(item.getId()) && !Objects.equals(item.getPid(), "0"))
|
||||
.peek(item -> {
|
||||
CsEquipmentDeliveryPO po = poMap.get(item.getId());
|
||||
item.setComFlag(po.getRunStatus());
|
||||
item.setNDId(po.getNdid());
|
||||
item.setType("device");
|
||||
item.setProcess(po.getProcess());
|
||||
})
|
||||
.filter(item -> Objects.equals(poMap.get(item.getId()).getUsageStatus(), 1))
|
||||
.sorted(Comparator.comparing(CsLedgerVO::getSort))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<CsLedgerVO> engineeringList1 = new ArrayList<>();
|
||||
List<CsLedgerVO> projectList1 = new ArrayList<>();
|
||||
checkDevSetData(deviceList);
|
||||
projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
|
||||
engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList)));
|
||||
List<String> dev = deviceList.stream().map(CsLedgerVO::getId).collect(Collectors.toList());
|
||||
List<CsLedgerVO> ledger1 = getProAndEngineer(dev);
|
||||
if (CollectionUtil.isNotEmpty(ledger1)) {
|
||||
engineeringList1 = ledger1.stream().filter(item -> item.getLevel().equals(LineBaseEnum.ENGINEERING_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
projectList1 = ledger1.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
projectList1.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
|
||||
List<CsLedgerVO> finalProjectList = projectList1;
|
||||
engineeringList1.forEach(eng -> eng.setChildren(getChildren(eng, finalProjectList)));
|
||||
}
|
||||
|
||||
//获取云前置设备
|
||||
List<CsLedgerVO> cldDevList = allList.stream()
|
||||
.filter(item -> cldDevice.contains(item.getId()) && !Objects.equals(item.getPid(), "0"))
|
||||
.peek(item -> {
|
||||
CsEquipmentDeliveryPO po = poMap.get(item.getId());
|
||||
item.setComFlag(po.getRunStatus());
|
||||
item.setNDId(po.getNdid());
|
||||
item.setType("device");
|
||||
item.setProcess(po.getProcess());
|
||||
})
|
||||
.filter(item -> Objects.equals(poMap.get(item.getId()).getUsageStatus(), 1))
|
||||
.sorted(Comparator.comparing(CsLedgerVO::getSort))
|
||||
.collect(Collectors.toList());
|
||||
checkDevSetData(cldDevList);
|
||||
List<CsLedgerVO> engineeringList2 = new ArrayList<>();
|
||||
List<CsLedgerVO> projectList2 = new ArrayList<>();
|
||||
|
||||
List<String> dev2 = cldDevList.stream().map(CsLedgerVO::getId).collect(Collectors.toList());
|
||||
List<CsLedgerVO> ledger2 = getProAndEngineer(dev2);
|
||||
if (CollectionUtil.isNotEmpty(ledger2)) {
|
||||
engineeringList2 = ledger2.stream().filter(item -> item.getLevel().equals(LineBaseEnum.ENGINEERING_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
projectList2 = ledger2.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||
projectList2.forEach(pro -> pro.setChildren(getChildren(pro, cldDevList)));
|
||||
List<CsLedgerVO> finalProjectList = projectList2;
|
||||
engineeringList2.forEach(eng -> eng.setChildren(getChildren(eng, finalProjectList)));
|
||||
}
|
||||
|
||||
//获取便携式设备树
|
||||
CsLedgerVO portable = new CsLedgerVO();
|
||||
@@ -269,7 +410,16 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
government.setName(DataParam.governmentDev);
|
||||
government.setPid("0");
|
||||
government.setId(IdUtil.simpleUUID());
|
||||
government.setChildren(engineeringList);
|
||||
government.setChildren(engineeringList1);
|
||||
|
||||
//获取云前置设备树
|
||||
CsLedgerVO cld = new CsLedgerVO();
|
||||
cld.setLevel(0);
|
||||
cld.setName(DataParam.cldDev);
|
||||
cld.setPid("0");
|
||||
cld.setId(IdUtil.simpleUUID());
|
||||
cld.setChildren(engineeringList2);
|
||||
|
||||
List<CsLedgerVO> tree = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(portables)) {
|
||||
tree.add(portable);
|
||||
@@ -277,6 +427,9 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
if (CollUtil.isNotEmpty(deviceList)) {
|
||||
tree.add(government);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(cldDevList)) {
|
||||
tree.add(cld);
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
@@ -353,10 +506,13 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
engineeringList.forEach(eng -> {
|
||||
CsEngineeringPO csEngineeringPO = csEngineeringMapper.selectById(eng.getId());
|
||||
eng.setArea(this.getAreaById(csEngineeringPO.getProvince())+this.getAreaById(csEngineeringPO.getCity()));
|
||||
eng.setProvinceId(csEngineeringPO.getProvince());
|
||||
eng.setCityId(csEngineeringPO.getCity());
|
||||
eng.setRemark(csEngineeringPO.getDescription());
|
||||
eng.setChildren(getChildren(eng, projectList));
|
||||
}
|
||||
);
|
||||
|
||||
return engineeringList;
|
||||
}
|
||||
|
||||
@@ -468,6 +624,111 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
return tree;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsLedgerVO> getProAndEngineer(List<String> id) {
|
||||
List<CsLedgerVO> result = new ArrayList<>();
|
||||
List<CsLedgerVO> allList = this.baseMapper.getAll();
|
||||
Set<String> idSet = new HashSet<>(id);
|
||||
if (CollectionUtil.isNotEmpty(id)) {
|
||||
id.forEach(item->{
|
||||
allList.forEach(item2->{
|
||||
if (Objects.equals(item2.getId(),item)) {
|
||||
idSet.addAll(Arrays.asList(item2.getPids().split( ",")));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(idSet)) {
|
||||
idSet.forEach(item->{
|
||||
allList.forEach(item2->{
|
||||
if (Objects.equals(item2.getId(),item)) {
|
||||
result.add(item2);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CsLedgerVO cldTree() {
|
||||
|
||||
List<CsLedgerVO> engineerTree = new ArrayList<>();
|
||||
List<CsLedgerVO> projectTree = new ArrayList<>();
|
||||
List<CsLedgerVO> deviceTree = new ArrayList<>();
|
||||
List<CsLedgerVO> lineTree = new ArrayList<>();
|
||||
|
||||
List<CsLedgerVO> allList = this.baseMapper.getAll();
|
||||
if (CollectionUtil.isNotEmpty(allList)) {
|
||||
//工程集合
|
||||
List<CsLedgerVO> tree1 = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.ENGINEERING_LEVEL.getCode())).collect(Collectors.toList());
|
||||
//项目集合
|
||||
List<CsLedgerVO> tree2 = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).collect(Collectors.toList());
|
||||
//设备集合
|
||||
List<CsLedgerVO> tree3 = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.DEVICE_LEVEL.getCode())).collect(Collectors.toList());
|
||||
//监测点集合
|
||||
List<CsLedgerVO> tree4 = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.LINE_LEVEL.getCode())).collect(Collectors.toList());
|
||||
|
||||
//筛选出云前置设备
|
||||
if (CollectionUtil.isNotEmpty(tree3)) {
|
||||
Set<String> list1 = new HashSet<>();
|
||||
List<String> devList = tree3.stream().map(CsLedgerVO::getId).collect(Collectors.toList());
|
||||
List<CsEquipmentDeliveryPO> devs = csEquipmentDeliveryMapper.selectBatchIds(devList);
|
||||
DictTreeVO vo1 = dictTreeFeignClient.queryByCode(DicDataEnum.DEV_CLD.getCode()).getData();
|
||||
|
||||
//list1是 cld设备
|
||||
devs.forEach(item->{
|
||||
if (item.getDevType().equals(vo1.getId())) {
|
||||
list1.add(item.getId());
|
||||
}
|
||||
});
|
||||
//list2是 非cld设备
|
||||
Set<String> list2 = devList.stream().filter(item -> !list1.contains(item)).collect(Collectors.toSet());
|
||||
List<CsLedgerVO> tree5 = tree3.stream().filter(vo -> list2.contains(vo.getId())).collect(Collectors.toList());
|
||||
Set<String> list3 = tree5.stream().map(CsLedgerVO::getPid).collect(Collectors.toSet());
|
||||
projectTree = tree2.stream().filter(vo -> !list3.contains(vo.getId())).collect(Collectors.toList());
|
||||
|
||||
|
||||
List<CsLedgerVO> tree6 = tree2.stream().filter(vo -> list3.contains(vo.getId())).collect(Collectors.toList());
|
||||
Set<String> proList = tree6.stream().map(CsLedgerVO::getPid).collect(Collectors.toSet());
|
||||
engineerTree = tree1.stream().filter(vo -> !proList.contains(vo.getId())).collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtil.isNotEmpty(list1)) {
|
||||
deviceTree = tree3.stream().filter(vo -> list1.contains(vo.getId())).collect(Collectors.toList());
|
||||
lineTree = tree4.stream().filter(vo -> list1.contains(vo.getPid())).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(deviceTree)) {
|
||||
List<CsLedgerVO> finalLineTree = lineTree;
|
||||
deviceTree.forEach(item->{
|
||||
item.setChildren(getChildren(item, finalLineTree));
|
||||
});
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(projectTree)) {
|
||||
List<CsLedgerVO> finalDeviceTree = deviceTree;
|
||||
projectTree.forEach(item->{
|
||||
item.setChildren(getChildren(item, finalDeviceTree));
|
||||
});
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(engineerTree)) {
|
||||
List<CsLedgerVO> finalProjectTree = projectTree;
|
||||
engineerTree.forEach(item->{
|
||||
item.setChildren(getChildren(item, finalProjectTree));
|
||||
});
|
||||
}
|
||||
|
||||
CsLedgerVO government = new CsLedgerVO();
|
||||
government.setLevel(0);
|
||||
government.setName(DataParam.cldDev);
|
||||
government.setPid("0");
|
||||
government.setId(IdUtil.simpleUUID());
|
||||
government.setChildren(engineerTree);
|
||||
|
||||
return government;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取子节点
|
||||
*/
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||
import com.njcn.csdevice.mapper.CsLinePOMapper;
|
||||
import com.njcn.csdevice.mapper.CsTerminalLogsMapper;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.po.*;
|
||||
import com.njcn.csdevice.service.CsDevModelService;
|
||||
import com.njcn.csdevice.service.CsLinePOService;
|
||||
import com.njcn.csdevice.service.ICsDataSetService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -29,7 +37,12 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> implements CsLinePOService{
|
||||
|
||||
private final CsLedgerMapper csLedgerMapper;
|
||||
private final CsDevModelService csDevModelService;
|
||||
private final ICsDataSetService csDataSetService;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final CsTerminalLogsMapper csTerminalLogsMapper;
|
||||
|
||||
@Override
|
||||
public List<CsLinePO> getLineByDev(List<String> list) {
|
||||
@@ -85,7 +98,117 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
||||
|
||||
@Override
|
||||
public List<CsLinePO> getLinesByDevList(List<String> list) {
|
||||
return this.lambdaQuery().in(CsLinePO::getDevId,list).eq(CsLinePO::getStatus,1).list();
|
||||
return this.lambdaQuery().in(CsLinePO::getDeviceId,list).eq(CsLinePO::getStatus,1).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public CsLinePO addCldLine(CsLineParam param) {
|
||||
String lineId = param.getDevMac().replace(":","") + param.getLineNo();
|
||||
CsLinePO po = new CsLinePO();
|
||||
//1.新增监测点信息
|
||||
BeanUtils.copyProperties(param,po);
|
||||
po.setStatus(1);
|
||||
po.setRunStatus(2);
|
||||
po.setLineId(param.getDevMac().replace(":","") + param.getLineNo());
|
||||
//模板id
|
||||
CsDevModelPO po1 = csDevModelService.getCldModel();
|
||||
po.setDataModelId(po1.getId());
|
||||
//设备id
|
||||
po.setDeviceId(param.getDevId());
|
||||
//数据集id
|
||||
List<CsDataSet> list = csDataSetService.findDataSetByModelId(po1.getId());
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
po.setDataSetId(list.get(0).getId());
|
||||
po.setClDid(list.get(0).getClDev());
|
||||
}
|
||||
//监测位置
|
||||
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.GRID_SIDE.getCode()).getData();
|
||||
po.setPosition(data.getId());
|
||||
this.save(po);
|
||||
|
||||
//2.新增台账树信息
|
||||
CsLedger csLedger = new CsLedger();
|
||||
csLedger.setId(lineId);
|
||||
csLedger.setPid(param.getDevId());
|
||||
csLedger.setPids("0," + param.getEngineeringId() + "," + param.getProjectId() + "," + param.getDevId());
|
||||
csLedger.setName(param.getName());
|
||||
csLedger.setLevel(3);
|
||||
csLedger.setState(1);
|
||||
csLedger.setSort(0);
|
||||
csLedgerMapper.insert(csLedger);
|
||||
return po;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateCldLine(CsLineParam param) {
|
||||
LambdaQueryWrapper<CsLinePO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(CsLinePO::getDeviceId,param.getDevId())
|
||||
.ne(CsLinePO::getLineId,param.getLineId())
|
||||
.eq(CsLinePO::getLineNo,param.getLineNo())
|
||||
.eq(CsLinePO::getStatus,1);
|
||||
List<CsLinePO> lineList = this.list(wrapper);
|
||||
if (CollectionUtil.isNotEmpty(lineList)) {
|
||||
throw new BusinessException("监测点线路号重复,请调整!");
|
||||
}
|
||||
LambdaUpdateWrapper<CsLinePO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.eq(CsLinePO::getLineId,param.getLineId())
|
||||
.eq(CsLinePO::getStatus,1)
|
||||
.set(CsLinePO::getName,param.getName())
|
||||
.set(CsLinePO::getLineNo,param.getLineNo())
|
||||
.set(CsLinePO::getConType,param.getConType())
|
||||
.set(CsLinePO::getLineInterval,param.getLineInterval())
|
||||
.set(CsLinePO::getPtRatio,param.getPtRatio())
|
||||
.set(CsLinePO::getPt2Ratio,param.getPt2Ratio())
|
||||
.set(CsLinePO::getCtRatio,param.getCtRatio())
|
||||
.set(CsLinePO::getCt2Ratio,param.getCt2Ratio())
|
||||
.set(CsLinePO::getVolGrade,param.getVolGrade())
|
||||
.set(CsLinePO::getRunStatus,param.getRunStatus());
|
||||
this.update(lambdaUpdateWrapper);
|
||||
|
||||
//修改台账树中监测点的名称
|
||||
QueryWrapper<CsLedger> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("state",1).eq("id",param.getLineId());
|
||||
CsLedger csLedger = csLedgerMapper.selectOne(queryWrapper);
|
||||
csLedger.setName(param.getName());
|
||||
csLedgerMapper.updateById(csLedger);
|
||||
|
||||
//新增台账日志
|
||||
CsTerminalLogs csTerminalLogs = new CsTerminalLogs();
|
||||
csTerminalLogs.setDeviceId(param.getDevId());
|
||||
csTerminalLogs.setOperateType(1);
|
||||
csTerminalLogs.setIsPush(0);
|
||||
csTerminalLogsMapper.insert(csTerminalLogs);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteCldLine(String id) {
|
||||
CsLinePO po = this.getById(id);
|
||||
|
||||
this.removeById(id);
|
||||
csLedgerMapper.deleteById(id);
|
||||
|
||||
//新增台账日志
|
||||
CsTerminalLogs csTerminalLogs = new CsTerminalLogs();
|
||||
csTerminalLogs.setDeviceId(po.getDeviceId());
|
||||
csTerminalLogs.setOperateType(1);
|
||||
csTerminalLogs.setIsPush(0);
|
||||
csTerminalLogsMapper.insert(csTerminalLogs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCldLineStatus(List<CsLinePO> lineList, Integer status) {
|
||||
lineList.forEach(item->{item.setRunStatus(status);});
|
||||
this.updateBatchById(lineList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLineDataByList(List<String> list, String id, String setId) {
|
||||
LambdaUpdateWrapper<CsLinePO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.in(CsLinePO::getDeviceId,list).set(CsLinePO::getDataModelId,id).set(CsLinePO::getDataSetId,setId);
|
||||
this.update(updateWrapper);
|
||||
}
|
||||
|
||||
// /**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user