Compare commits
49 Commits
4ee100a72b
...
2026-03
| Author | SHA1 | Date | |
|---|---|---|---|
| e7ba886b94 | |||
| c0cccc3479 | |||
| dbe09d70f4 | |||
| 33da822317 | |||
| 720afd42df | |||
| fc7694a1db | |||
| 349ee472d9 | |||
| 844f30965e | |||
| 6e0a36fd80 | |||
| bd1fb82532 | |||
| 3727b5777e | |||
| c3cb9a5f85 | |||
| 05ef7028c4 | |||
| 736b0a6e60 | |||
| cc63cead04 | |||
| 30bc3c7448 | |||
| 51a16c5701 | |||
| 4497699178 | |||
| 0ac51648f4 | |||
| fb515cca9b | |||
| 14d77725aa | |||
| ee87ffb0d4 | |||
| 5ff8c946aa | |||
| cccc73f211 | |||
| 4882151ccd | |||
| b774b7ce91 | |||
| 6b0feb1320 | |||
| e92326c55d | |||
| 7abbfd500b | |||
| 77360ef468 | |||
| b38d3bad1b | |||
| 27aebf2ca4 | |||
| 9981b04ed6 | |||
| f8c9828369 | |||
| 0d652b9f4d | |||
| 3ea67da152 | |||
| c7dce89d36 | |||
| e7dbee2df5 | |||
| 29168bbd9f | |||
| 56d88939c4 | |||
| bc6f3dca80 | |||
| 2957188466 | |||
| 2894a4780b | |||
| 240ec304b0 | |||
| ae09cc1996 | |||
| efdb1781da | |||
|
|
46aef0d97f | ||
|
|
5539c8fed5 | ||
|
|
10d93c260c |
@@ -4,18 +4,14 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.njcn.cloud.enums.app.UserCodeEnum;
|
import com.njcn.cloud.enums.app.UserCodeEnum;
|
||||||
import com.njcn.cloud.pojo.vo.AdminStatistic.Integrity;
|
import com.njcn.cloud.pojo.vo.AdminStatistic.Integrity;
|
||||||
import com.njcn.cloud.pojo.vo.AdminStatistic.StaticInfo;
|
|
||||||
import com.njcn.cloud.service.AdminStatistic.DataIntegrityService;
|
import com.njcn.cloud.service.AdminStatistic.DataIntegrityService;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||||
import com.njcn.device.pq.api.LineFeignClient;
|
import com.njcn.device.pq.api.LineFeignClient;
|
||||||
import com.njcn.device.pq.api.LineIntegrityClient;
|
import com.njcn.device.pq.api.LineIntegrityClient;
|
||||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
|
||||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
|
||||||
import com.njcn.device.pq.pojo.vo.LineDeviceStateVO;
|
import com.njcn.device.pq.pojo.vo.LineDeviceStateVO;
|
||||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
|
||||||
import com.njcn.user.api.UserFeignClient;
|
import com.njcn.user.api.UserFeignClient;
|
||||||
import com.njcn.user.pojo.po.User;
|
import com.njcn.user.pojo.po.User;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|||||||
@@ -10,12 +10,14 @@ import com.njcn.common.pojo.exception.BusinessException;
|
|||||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
|
||||||
import com.njcn.user.api.UserFeignClient;
|
import com.njcn.user.api.UserFeignClient;
|
||||||
import com.njcn.user.pojo.po.User;
|
import com.njcn.user.pojo.po.User;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -54,7 +56,7 @@ public class StaticServiceImpl implements StaticService {
|
|||||||
//获取终端信息
|
//获取终端信息
|
||||||
List<DevDetail> devDetails = generalDeviceInfoClient.getDevInfoByIds(new ArrayList<>()).getData();
|
List<DevDetail> devDetails = generalDeviceInfoClient.getDevInfoByIds(new ArrayList<>()).getData();
|
||||||
//获取终端在线率
|
//获取终端在线率
|
||||||
List<RStatOnlinerateVO> onlineRates = generalDeviceInfoClient.getOnlineRateByDevIds(param).getData();
|
List<RStatOnlineRateVO> onlineRates = generalDeviceInfoClient.getOnlineRateByDevIds(param).getData();
|
||||||
//异常终端数据
|
//异常终端数据
|
||||||
long count = devDetails.stream().filter(x -> 0==x.getComFlag()).count();
|
long count = devDetails.stream().filter(x -> 0==x.getComFlag()).count();
|
||||||
StaticInfo info=new StaticInfo();
|
StaticInfo info=new StaticInfo();
|
||||||
@@ -63,14 +65,14 @@ public class StaticServiceImpl implements StaticService {
|
|||||||
info.setOnlineRatez(data);
|
info.setOnlineRatez(data);
|
||||||
info.setComError(count);
|
info.setComError(count);
|
||||||
List<StaticInfo.DevStatic> list=new ArrayList<>();
|
List<StaticInfo.DevStatic> list=new ArrayList<>();
|
||||||
Map<String, Float> onlineRateMap = onlineRates.stream().collect(Collectors.toMap(RStatOnlinerateVO::getDevIndex, RStatOnlinerateVO::getOnlineRate));
|
Map<String, BigDecimal> onlineRateMap = onlineRates.stream().collect(Collectors.toMap(RStatOnlineRateVO::getDevIndex, RStatOnlineRateVO::getOnlineRate));
|
||||||
StaticInfo.DevStatic devStatic;
|
StaticInfo.DevStatic devStatic;
|
||||||
for (DevDetail devDetail : devDetails) {
|
for (DevDetail devDetail : devDetails) {
|
||||||
devStatic=new StaticInfo.DevStatic();
|
devStatic=new StaticInfo.DevStatic();
|
||||||
devStatic.setDevIndex(devDetail.getDevIndex());
|
devStatic.setDevIndex(devDetail.getDevIndex());
|
||||||
devStatic.setDevName(devDetail.getDevName());
|
devStatic.setDevName(devDetail.getDevName());
|
||||||
devStatic.setIp(devDetail.getIp());
|
devStatic.setIp(devDetail.getIp());
|
||||||
devStatic.setOnlineRate(onlineRateMap.get(devDetail.getDevIndex()));
|
devStatic.setOnlineRate(onlineRateMap.get(devDetail.getDevIndex()).setScale(3, RoundingMode.HALF_UP).floatValue());
|
||||||
devStatic.setGdName(devDetail.getGdName());
|
devStatic.setGdName(devDetail.getGdName());
|
||||||
devStatic.setSubName(devDetail.getBdzName());
|
devStatic.setSubName(devDetail.getBdzName());
|
||||||
devStatic.setTimeId(devDetail.getTimeID());
|
devStatic.setTimeId(devDetail.getTimeID());
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ package com.njcn.csdevice.api;
|
|||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.fallback.AppProjectClientFallbackFactory;
|
import com.njcn.csdevice.api.fallback.AppProjectClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.pojo.param.AppProjectAddParm;
|
||||||
import com.njcn.csdevice.pojo.po.AppProjectPO;
|
import com.njcn.csdevice.pojo.po.AppProjectPO;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -19,4 +21,11 @@ public interface AppProjectFeignClient {
|
|||||||
|
|
||||||
@PostMapping("/queryProjectById")
|
@PostMapping("/queryProjectById")
|
||||||
HttpResult<List<AppProjectPO>> queryProjectById(@RequestParam("ids") List<String> ids);
|
HttpResult<List<AppProjectPO>> queryProjectById(@RequestParam("ids") List<String> ids);
|
||||||
|
|
||||||
|
@PostMapping("/getProjectByName")
|
||||||
|
HttpResult<AppProjectPO> getProjectByName(@RequestParam("name") String name);
|
||||||
|
|
||||||
|
@PostMapping("/addAppProject")
|
||||||
|
HttpResult<AppProjectPO> addAppProject(@RequestBody AppProjectAddParm appProjectAddParm);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.csdevice.api.fallback.CsDeviceUserClientFallbackFactory;
|
import com.njcn.csdevice.api.fallback.CsDeviceUserClientFallbackFactory;
|
||||||
import com.njcn.csdevice.pojo.param.UserDevParam;
|
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.DevUserVO;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
@@ -29,4 +31,11 @@ public interface CsDeviceUserFeignClient {
|
|||||||
|
|
||||||
@PostMapping("/channelDevByUserId")
|
@PostMapping("/channelDevByUserId")
|
||||||
HttpResult<List<String>> channelDevByUserId(@RequestBody UserDevParam param);
|
HttpResult<List<String>> channelDevByUserId(@RequestBody UserDevParam param);
|
||||||
|
|
||||||
|
@PostMapping("/queryUserById")
|
||||||
|
HttpResult<DevUserVO> queryUserById(@RequestParam("devId") String devId);
|
||||||
|
|
||||||
|
@PostMapping("/getList")
|
||||||
|
@ApiOperation("根据设备集合获取数据")
|
||||||
|
HttpResult<List<CsDeviceUserPO>> getList(@RequestBody UserDevParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,10 @@ public interface CsLedgerFeignClient {
|
|||||||
@PostMapping("/queryDevDetail")
|
@PostMapping("/queryDevDetail")
|
||||||
HttpResult<DevDetailDTO> queryDevDetail(@RequestParam("devId") String devId);
|
HttpResult<DevDetailDTO> queryDevDetail(@RequestParam("devId") String devId);
|
||||||
|
|
||||||
|
@PostMapping("/lineTree")
|
||||||
|
@ApiOperation("五层设备树(监测点层,根节点为治理设备和便携式设备)")
|
||||||
|
HttpResult<List<CsLedgerVO>> lineTree();
|
||||||
|
|
||||||
@PostMapping("/deviceTree")
|
@PostMapping("/deviceTree")
|
||||||
@ApiOperation("三层设备树(装置层)")
|
@ApiOperation("三层设备树(装置层)")
|
||||||
HttpResult<List<CsLedgerVO>> getDeviceTree();
|
HttpResult<List<CsLedgerVO>> getDeviceTree();
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.csdevice.api.fallback.CsLineClientFallbackFactory;
|
import com.njcn.csdevice.api.fallback.CsLineClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.pojo.dto.CsLineDTO;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
||||||
@@ -14,11 +15,13 @@ import com.njcn.device.biz.pojo.po.Overlimit;
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author xy
|
* @author xy
|
||||||
@@ -38,6 +41,10 @@ public interface CsLineFeignClient {
|
|||||||
@PostMapping("/findByNdid")
|
@PostMapping("/findByNdid")
|
||||||
HttpResult<List<CsLinePO>> findByNdid(@RequestParam("id") String id);
|
HttpResult<List<CsLinePO>> findByNdid(@RequestParam("id") String id);
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/getCustomDetailByLineId")
|
||||||
|
HttpResult<Map<String,String>> getCustomDetailByLineId(@RequestParam("id") String id);
|
||||||
|
|
||||||
@PostMapping("/getPositionById")
|
@PostMapping("/getPositionById")
|
||||||
HttpResult<String> getPositionById(@RequestParam("id") String id);
|
HttpResult<String> getPositionById(@RequestParam("id") String id);
|
||||||
|
|
||||||
@@ -62,6 +69,9 @@ public interface CsLineFeignClient {
|
|||||||
@PostMapping("/getAllLine")
|
@PostMapping("/getAllLine")
|
||||||
HttpResult<List<String>> getAllLine();
|
HttpResult<List<String>> getAllLine();
|
||||||
|
|
||||||
|
@PostMapping("/getAllLineDetail")
|
||||||
|
HttpResult<List<CsLineDTO>> getAllLineDetail();
|
||||||
|
|
||||||
@PostMapping("/getOverLimitDataByIds")
|
@PostMapping("/getOverLimitDataByIds")
|
||||||
HttpResult<List<Overlimit>> getOverLimitData(@RequestBody List<String> ids);
|
HttpResult<List<Overlimit>> getOverLimitData(@RequestBody List<String> ids);
|
||||||
|
|
||||||
@@ -75,4 +85,7 @@ public interface CsLineFeignClient {
|
|||||||
@PostMapping("/getLineDetailData")
|
@PostMapping("/getLineDetailData")
|
||||||
HttpResult<LineDetailDataVO> getLineDetailData(@RequestParam("id") String id);
|
HttpResult<LineDetailDataVO> getLineDetailData(@RequestParam("id") String id);
|
||||||
|
|
||||||
|
@GetMapping("/getSimpleLine")
|
||||||
|
HttpResult<List<CsLinePO>> getSimpleLine();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.njcn.csdevice.api;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.csdevice.api.fallback.CsMarketDataClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.pojo.vo.CsMarketDataVO;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
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 = "/csMarketData", fallbackFactory = CsMarketDataClientFallbackFactory.class,contextId = "csMarketData")
|
||||||
|
public interface CsMarketDataFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/insert")
|
||||||
|
HttpResult<Boolean> insertData(@RequestParam("userId")String userId, @RequestParam("engineeringId")String engineeringId);
|
||||||
|
|
||||||
|
@PostMapping("/queryByUseId")
|
||||||
|
HttpResult<List<CsMarketDataVO>> queryByUseId(@RequestParam("userId")String userId);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@ package com.njcn.csdevice.api;
|
|||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.fallback.CsOverLimitFallbackFactory;
|
import com.njcn.csdevice.api.fallback.CsOverLimitFallbackFactory;
|
||||||
import com.njcn.csdevice.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
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.ProcessFeignClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsUserPins;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/csUserPins", fallbackFactory = ProcessFeignClientFallbackFactory.class,contextId = "csUserPins")
|
||||||
|
|
||||||
|
public interface CsUserPinsFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/getPinToTopList")
|
||||||
|
HttpResult<List<CsUserPins>> getPinToTopList();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
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.AppProjectClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.pojo.param.CsEngineeringAddParm;
|
||||||
|
import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsEngineeringPO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/engineering", fallbackFactory = AppProjectClientFallbackFactory.class,contextId = "engineering")
|
||||||
|
public interface EngineeringFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/queryEngineering")
|
||||||
|
HttpResult<List<CsEngineeringVO>> queryEngineering(@Validated @RequestBody CsEngineeringQueryParm csEngineeringQueryParm);
|
||||||
|
|
||||||
|
@PostMapping("/getEngineeringByName")
|
||||||
|
HttpResult<CsEngineeringPO> getEngineeringByName(@RequestParam("name") String name);
|
||||||
|
|
||||||
|
@PostMapping("/addEngineering")
|
||||||
|
HttpResult<CsEngineeringPO> addEngineering(@Validated @RequestBody CsEngineeringAddParm csEngineeringAddParm);
|
||||||
|
}
|
||||||
@@ -1,22 +1,14 @@
|
|||||||
package com.njcn.csdevice.api;
|
package com.njcn.csdevice.api;
|
||||||
|
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
|
||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
|
||||||
import com.njcn.csdevice.api.fallback.EquipmentFeignClientFallbackFactory;
|
import com.njcn.csdevice.api.fallback.EquipmentFeignClientFallbackFactory;
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -59,6 +51,9 @@ public interface EquipmentFeignClient {
|
|||||||
@PostMapping("/updateModuleNumber")
|
@PostMapping("/updateModuleNumber")
|
||||||
HttpResult<String> updateModuleNumber(@RequestParam("nDid") String nDid,@RequestParam("number") Integer number);
|
HttpResult<String> updateModuleNumber(@RequestParam("nDid") String nDid,@RequestParam("number") Integer number);
|
||||||
|
|
||||||
|
@PostMapping("/updateLedger")
|
||||||
|
HttpResult<String> updateLedger(@RequestParam("nDid") String nDid,@RequestParam("engineeringId") String engineeringId,@RequestParam("projectId") String projectId);
|
||||||
|
|
||||||
@PostMapping("/getAll")
|
@PostMapping("/getAll")
|
||||||
HttpResult<List<CsEquipmentDeliveryPO>> getAll();
|
HttpResult<List<CsEquipmentDeliveryPO>> getAll();
|
||||||
|
|
||||||
@@ -72,5 +67,5 @@ public interface EquipmentFeignClient {
|
|||||||
HttpResult<Boolean> updateCldDevStatus(@RequestParam("nodeId") String nodeId, @RequestParam("processNo") Integer processNo);
|
HttpResult<Boolean> updateCldDevStatus(@RequestParam("nodeId") String nodeId, @RequestParam("processNo") Integer processNo);
|
||||||
|
|
||||||
@PostMapping("/flipCldDevStatus")
|
@PostMapping("/flipCldDevStatus")
|
||||||
HttpResult<Boolean> flipCldDevStatus(@RequestParam("devId") String devId, @RequestParam("status") Integer status);
|
HttpResult<Boolean> flipCldDevStatus(@RequestParam("date") String date, @RequestParam("devId") String devId, @RequestParam("status") Integer status);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,12 @@ package com.njcn.csdevice.api;
|
|||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.fallback.IntegrityClientFallbackFactory;
|
import com.njcn.csdevice.api.fallback.IntegrityClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.param.IcdBzParam;
|
||||||
import com.njcn.csdevice.pojo.po.RStatIntegrityD;
|
import com.njcn.csdevice.pojo.po.RStatIntegrityD;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -18,6 +19,6 @@ import java.util.List;
|
|||||||
public interface IntegrityFeignClient {
|
public interface IntegrityFeignClient {
|
||||||
|
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
HttpResult<List<RStatIntegrityD>> list(@Validated @RequestParam("list") List<String> list, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime);
|
HttpResult<List<RStatIntegrityD>> list(@RequestBody @Validated IcdBzParam param);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,12 @@ package com.njcn.csdevice.api;
|
|||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.fallback.onlineRateClientFallbackFactory;
|
import com.njcn.csdevice.api.fallback.onlineRateClientFallbackFactory;
|
||||||
|
import com.njcn.csdevice.param.IcdBzParam;
|
||||||
import com.njcn.csdevice.pojo.po.RStatOnlineRateD;
|
import com.njcn.csdevice.pojo.po.RStatOnlineRateD;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -18,6 +19,6 @@ import java.util.List;
|
|||||||
public interface OnlineRateFeignClient {
|
public interface OnlineRateFeignClient {
|
||||||
|
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
HttpResult<List<RStatOnlineRateD>> list(@Validated @RequestParam("list") List<String> list, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime);
|
HttpResult<List<RStatOnlineRateD>> list(@RequestBody @Validated IcdBzParam param);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.AppProjectFeignClient;
|
import com.njcn.csdevice.api.AppProjectFeignClient;
|
||||||
|
import com.njcn.csdevice.pojo.param.AppProjectAddParm;
|
||||||
import com.njcn.csdevice.pojo.po.AppProjectPO;
|
import com.njcn.csdevice.pojo.po.AppProjectPO;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -32,6 +33,18 @@ public class AppProjectClientFallbackFactory implements FallbackFactory<AppProje
|
|||||||
log.error("{}异常,降级处理,异常为:{}","获取项目详情接口异常",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","获取项目详情接口异常",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<AppProjectPO> getProjectByName(String name) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据项目名称获取项目信息异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<AppProjectPO> addAppProject(AppProjectAddParm appProjectAddParm) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","新增项目异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.csdevice.api.CsDeviceUserFeignClient;
|
import com.njcn.csdevice.api.CsDeviceUserFeignClient;
|
||||||
import com.njcn.csdevice.pojo.param.UserDevParam;
|
import com.njcn.csdevice.pojo.param.UserDevParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.DevUserVO;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -51,6 +52,18 @@ public class CsDeviceUserClientFallbackFactory implements FallbackFactory<CsDevi
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<DevUserVO> queryUserById(String devId) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","获取设备主/子用户数据异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<CsDeviceUserPO>> getList(UserDevParam param) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据设备集合获取数据异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,12 @@ public class CsLedgerFeignClientFallbackFactory implements FallbackFactory<CsLed
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<CsLedgerVO>> lineTree() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","查询监测点数数据异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<List<CsLedgerVO>> getDeviceTree() {
|
public HttpResult<List<CsLedgerVO>> getDeviceTree() {
|
||||||
log.error("{}异常,降级处理,异常为:{}","查询设备树",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","查询设备树",cause.toString());
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||||
|
import com.njcn.csdevice.pojo.dto.CsLineDTO;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
||||||
@@ -14,6 +15,7 @@ import org.springframework.stereotype.Component;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author xy
|
* @author xy
|
||||||
@@ -54,6 +56,12 @@ public class CsLineClientFallbackFactory implements FallbackFactory<CsLineFeignC
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<Map<String,String>> getCustomDetailByLineId(@RequestParam("id") String id) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据id查询监测点",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<String> getPositionById(String id) {
|
public HttpResult<String> getPositionById(String id) {
|
||||||
log.error("{}异常,降级处理,异常为:{}","通过id查询监测点位置",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","通过id查询监测点位置",cause.toString());
|
||||||
@@ -96,6 +104,12 @@ public class CsLineClientFallbackFactory implements FallbackFactory<CsLineFeignC
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<CsLineDTO>> getAllLineDetail() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","获取系统中所有监测点id详情异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<List<Overlimit>> getOverLimitData(List<String> ids) {
|
public HttpResult<List<Overlimit>> getOverLimitData(List<String> ids) {
|
||||||
log.error("{}异常,降级处理,异常为:{}","根据监测点id集合获取国标限值异常",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","根据监测点id集合获取国标限值异常",cause.toString());
|
||||||
@@ -124,6 +138,12 @@ public class CsLineClientFallbackFactory implements FallbackFactory<CsLineFeignC
|
|||||||
log.error("{}异常,降级处理,异常为:{}","查询监测点详情异常",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","查询监测点详情异常",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<CsLinePO>> getSimpleLine() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","查询登录用户拥有的监测点台账",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
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.CsMarketDataFeignClient;
|
||||||
|
import com.njcn.csdevice.pojo.vo.CsMarketDataVO;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class CsMarketDataClientFallbackFactory implements FallbackFactory<CsMarketDataFeignClient> {
|
||||||
|
@Override
|
||||||
|
public CsMarketDataFeignClient create(Throwable cause) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if (cause.getCause() instanceof BusinessException) {
|
||||||
|
BusinessException businessException = (BusinessException) cause.getCause();
|
||||||
|
}
|
||||||
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
|
return new CsMarketDataFeignClient() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<Boolean> insertData(String userId, String engineeringId) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据用户、工程新增数据异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<CsMarketDataVO>> queryByUseId(String userId) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","查询营销,工程数据异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.CsOverLimitClient;
|
import com.njcn.csdevice.api.CsOverLimitClient;
|
||||||
import com.njcn.csdevice.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.njcn.csdevice.api.fallback;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.csdevice.api.CsUserPinsFeignClient;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsUserPins;
|
||||||
|
import com.njcn.csdevice.utils.CsDeviceEnumUtil;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 20:09
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class CsUserPinsFeignClientFallbackFactory implements FallbackFactory<CsUserPinsFeignClient> {
|
||||||
|
@Override
|
||||||
|
public CsUserPinsFeignClient 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 CsUserPinsFeignClient() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<CsUserPins>> getPinToTopList() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","获取用户置顶设备(工程)数据异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
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.EngineeringFeignClient;
|
||||||
|
import com.njcn.csdevice.pojo.param.CsEngineeringAddParm;
|
||||||
|
import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsEngineeringPO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class EngineeringClientFallbackFactory implements FallbackFactory<EngineeringFeignClient> {
|
||||||
|
@Override
|
||||||
|
public EngineeringFeignClient create(Throwable cause) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if (cause.getCause() instanceof BusinessException) {
|
||||||
|
BusinessException businessException = (BusinessException) cause.getCause();
|
||||||
|
}
|
||||||
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
|
return new EngineeringFeignClient() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<CsEngineeringVO>> queryEngineering(CsEngineeringQueryParm csEngineeringQueryParm) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","查询工程列表接口异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<CsEngineeringPO> getEngineeringByName(String name) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据工程名称获取工程信息异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<CsEngineeringPO> addEngineering(CsEngineeringAddParm csEngineeringAddParm) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","新增工程异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -72,6 +72,12 @@ public class EquipmentFeignClientFallbackFactory implements FallbackFactory<Equi
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> updateLedger(String nDid, String engineeringId, String projectId) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","更新设备预设工程和项目id数据异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<List<CsEquipmentDeliveryPO>> getAll() {
|
public HttpResult<List<CsEquipmentDeliveryPO>> getAll() {
|
||||||
log.error("{}异常,降级处理,异常为:{}","获取所有装置",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","获取所有装置",cause.toString());
|
||||||
@@ -97,7 +103,7 @@ public class EquipmentFeignClientFallbackFactory implements FallbackFactory<Equi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<Boolean> flipCldDevStatus(String devId, Integer status) {
|
public HttpResult<Boolean> flipCldDevStatus(String date, String devId, Integer status) {
|
||||||
log.error("{}异常,降级处理,异常为:{}","云前置设备状态翻转",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","云前置设备状态翻转",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.IntegrityFeignClient;
|
import com.njcn.csdevice.api.IntegrityFeignClient;
|
||||||
|
import com.njcn.csdevice.param.IcdBzParam;
|
||||||
import com.njcn.csdevice.pojo.po.RStatIntegrityD;
|
import com.njcn.csdevice.pojo.po.RStatIntegrityD;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -26,9 +27,8 @@ public class IntegrityClientFallbackFactory implements FallbackFactory<Integrity
|
|||||||
}
|
}
|
||||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
return new IntegrityFeignClient() {
|
return new IntegrityFeignClient() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<List<RStatIntegrityD>> list(List<String> list, String startTime, String endTime) {
|
public HttpResult<List<RStatIntegrityD>> list(IcdBzParam param) {
|
||||||
log.error("{}异常,降级处理,异常为:{}","查询数据异常",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","查询数据异常",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.csdevice.api.OnlineRateFeignClient;
|
import com.njcn.csdevice.api.OnlineRateFeignClient;
|
||||||
|
import com.njcn.csdevice.param.IcdBzParam;
|
||||||
import com.njcn.csdevice.pojo.po.RStatOnlineRateD;
|
import com.njcn.csdevice.pojo.po.RStatOnlineRateD;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -28,7 +29,7 @@ public class onlineRateClientFallbackFactory implements FallbackFactory<OnlineRa
|
|||||||
return new OnlineRateFeignClient() {
|
return new OnlineRateFeignClient() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<List<RStatOnlineRateD>> list(List<String> list, String startTime, String endTime) {
|
public HttpResult<List<RStatOnlineRateD>> list(IcdBzParam param) {
|
||||||
log.error("{}异常,降级处理,异常为:{}","查询数据异常",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","查询数据异常",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public interface DataParam {
|
|||||||
|
|
||||||
String GOVERNANCE_SYSTEM = "治理系统";
|
String GOVERNANCE_SYSTEM = "治理系统";
|
||||||
|
|
||||||
String cldDev = "在线设备";
|
String cldDev = "监测设备";
|
||||||
|
|
||||||
String EvtParamPhase = "Evt_Param_Phase";
|
String EvtParamPhase = "Evt_Param_Phase";
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.csdevice.param;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CsUserPinsParam implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty("用户id")
|
||||||
|
@NotBlank(message = "用户id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@ApiModelProperty("目标类型:1-设备,2-工程")
|
||||||
|
@NotNull(message = "目标类型:1-设备,2-工程")
|
||||||
|
private Integer targetType;
|
||||||
|
|
||||||
|
@ApiModelProperty("目标ID(设备ID或工程ID)")
|
||||||
|
@NotBlank(message = "目标ID(设备ID或工程ID)不能为空")
|
||||||
|
private String targetId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -100,4 +100,19 @@ public class CsEquipmentDeliveryDTO {
|
|||||||
|
|
||||||
private Integer moduleNumber;
|
private Integer moduleNumber;
|
||||||
private Integer process;
|
private Integer process;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前置服务器IP
|
||||||
|
*/
|
||||||
|
private String nodeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前置进程号
|
||||||
|
*/
|
||||||
|
private Integer nodeProcess;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志等级(NORMAL、DEBUG、WARN、ERROR)
|
||||||
|
*/
|
||||||
|
private String devLogLevel;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
package com.njcn.csdevice.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class CsLineDTO implements Serializable {
|
||||||
|
/**
|
||||||
|
* 监测点id
|
||||||
|
*/
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置id
|
||||||
|
*/
|
||||||
|
private String deviceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置id
|
||||||
|
*/
|
||||||
|
private String deviceType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典表:安装位置(负载侧,电网侧, 输出侧)
|
||||||
|
*/
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据集id
|
||||||
|
*/
|
||||||
|
private String dataSetId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板id
|
||||||
|
*/
|
||||||
|
private String dataModelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级
|
||||||
|
*/
|
||||||
|
private Double volGrade;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT变比
|
||||||
|
*/
|
||||||
|
private Double ptRatio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT2次变比
|
||||||
|
*/
|
||||||
|
private Double pt2Ratio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CT变比
|
||||||
|
*/
|
||||||
|
private Double ctRatio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CT2变比
|
||||||
|
*/
|
||||||
|
private Double ct2Ratio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0:删除 1:正常)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接线方式(0-星型 1-角型 2-V型)
|
||||||
|
*/
|
||||||
|
private Integer conType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑子设备id(与模板对应)
|
||||||
|
*/
|
||||||
|
private Integer clDid;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点统计间隔
|
||||||
|
*/
|
||||||
|
private Integer lineInterval;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运行状态
|
||||||
|
*/
|
||||||
|
private Integer runStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点线路号
|
||||||
|
*/
|
||||||
|
private Integer lineNo;
|
||||||
|
/**
|
||||||
|
* 监测对象类型
|
||||||
|
*/
|
||||||
|
private String monitorObj;
|
||||||
|
/**
|
||||||
|
* 是否治理(0:未治理 1:已治理)
|
||||||
|
*/
|
||||||
|
private Integer govern;
|
||||||
|
|
||||||
|
private String monitorUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短路容量
|
||||||
|
*/
|
||||||
|
private Double shortCircuitCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备容量
|
||||||
|
*/
|
||||||
|
private Double devCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基准容量
|
||||||
|
*/
|
||||||
|
private Double basicCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议容量
|
||||||
|
*/
|
||||||
|
private Double protocolCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 治理报告文件路径
|
||||||
|
*/
|
||||||
|
private String reportFilePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志等级(NORMAL、DEBUG、WARN、ERROR)
|
||||||
|
*/
|
||||||
|
private String lineLogLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是主要监测点(0: 不是 1:是)
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Integer isImportant;
|
||||||
|
}
|
||||||
@@ -31,4 +31,10 @@ public class DevDetailDTO {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "设备名称")
|
@ApiModelProperty(value = "设备名称")
|
||||||
private String equipmentName;
|
private String equipmentName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设备通讯状态")
|
||||||
|
private Integer runStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设备MAC地址")
|
||||||
|
private String devMac;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.njcn.csdevice.pojo.dto;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
* Date: 2023/8/1 15:25【需求编号】
|
* Date: 2023/8/1 15:25【需求编号】
|
||||||
@@ -26,4 +28,29 @@ public class LineParamDTO {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "监测点id")
|
@ApiModelProperty(value = "监测点id")
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "时间类型 0:日报 1:月报")
|
||||||
|
private Integer timeType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "时间")
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "起始时间")
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "结束时间")
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "集合")
|
||||||
|
private List<String> list;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class DevParamDTO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "时间")
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设备id集合")
|
||||||
|
private List<String> devList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,4 +55,7 @@ public class AppProjectAddParm {
|
|||||||
@ApiModelProperty(value="拓扑图模版id集合")
|
@ApiModelProperty(value="拓扑图模版id集合")
|
||||||
private List<String> topoIds;
|
private List<String> topoIds;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,4 +44,7 @@ public class AppProjectAuditParm {
|
|||||||
private List<String> topoIds;
|
private List<String> topoIds;
|
||||||
|
|
||||||
private List<String> newTopoIds;
|
private List<String> newTopoIds;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="排序")
|
||||||
|
private Integer sort;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ public class CsEngineeringAddParm {
|
|||||||
@ApiModelProperty(value = "描述")
|
@ApiModelProperty(value = "描述")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -54,6 +54,7 @@ public class CsEngineeringAuditParm {
|
|||||||
@ApiModelProperty(value="0:删除 1:正常")
|
@ApiModelProperty(value="0:删除 1:正常")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -97,4 +97,13 @@ public class CsEquipmentDeliveryAddParm implements Serializable {
|
|||||||
@ApiModelProperty(value="项目id")
|
@ApiModelProperty(value="项目id")
|
||||||
private String projectId;
|
private String projectId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="日志等级(NORMAL、DEBUG、WARN、ERROR)")
|
||||||
|
private String devLogLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="所属工程")
|
||||||
|
private String associatedEngineering;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="所属项目")
|
||||||
|
private String associatedProject;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -101,4 +101,13 @@ public class CsEquipmentDeliveryAuditParm {
|
|||||||
|
|
||||||
@ApiModelProperty(value="前置机进程号")
|
@ApiModelProperty(value="前置机进程号")
|
||||||
private Integer nodeProcess;
|
private Integer nodeProcess;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="日志等级(NORMAL、DEBUG、WARN、ERROR)")
|
||||||
|
private String devLogLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="所属工程")
|
||||||
|
private String associatedEngineering;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="所属项目")
|
||||||
|
private String associatedProject;
|
||||||
}
|
}
|
||||||
@@ -56,6 +56,8 @@ public class CsLedgerParam extends BaseEntity {
|
|||||||
@NotBlank(message = "台账表Id不能为空")
|
@NotBlank(message = "台账表Id不能为空")
|
||||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
private String pids;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -140,6 +140,19 @@ public class CsLineParam extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String monitorUser;
|
private String monitorUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测位置
|
||||||
|
*/
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志等级(NORMAL、DEBUG、WARN、ERROR)
|
||||||
|
*/
|
||||||
|
private String lineLogLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是主要监测点(0: 不是 1:是)
|
||||||
|
*/
|
||||||
|
private Integer isImportant;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -23,31 +23,31 @@ public class DeviceExcelTemplete implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 装置名称
|
* 装置名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "装置名称", width = 15)
|
@Excel(name = "设备名称", width = 15)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 网关识别码
|
* 网关识别码
|
||||||
*/
|
*/
|
||||||
@Excel(name = "网关识别码", width = 15)
|
@Excel(name = "网络设备ID", width = 15)
|
||||||
private String ndid;
|
private String ndid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装置类型(直连设备、网关设备、装置)
|
* 装置类型(直连设备、网关设备、装置)
|
||||||
*/
|
*/
|
||||||
@Excel(name = "装置类型(直连设备,网关设备)", width = 30)
|
@Excel(name = "设备类型(直连设备,网关设备、便携式设备)", width = 30)
|
||||||
private String devType;
|
private String devType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装置型号(pqs588、pqs680...)
|
* 装置型号(pqs588、pqs680...)
|
||||||
*/
|
*/
|
||||||
@Excel(name = "装置型号", width = 15)
|
@Excel(name = "设备型号", width = 15)
|
||||||
private String devModel;
|
private String devModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装置接入方式(mqtt、cloud)
|
* 装置接入方式(mqtt、cloud)
|
||||||
*/
|
*/
|
||||||
@Excel(name = "装置接入方式(mqtt、cloud)", width = 25)
|
@Excel(name = "通讯协议(MQTT、CLD)", width = 25)
|
||||||
private String devAccessMethod;
|
private String devAccessMethod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -28,26 +28,18 @@ public class AppProjectPO extends BaseEntity {
|
|||||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目名称
|
* 项目名称
|
||||||
*/
|
*/
|
||||||
@TableField(value = "name")
|
@TableField(value = "name")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
// @TableField(value = "engineering_id")
|
|
||||||
// private String engineeringId;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 地市Id
|
* 地市Id
|
||||||
*/
|
*/
|
||||||
@TableField(value = "area")
|
@TableField(value = "area")
|
||||||
private String area;
|
private String area;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0:删除 1:正常
|
* 0:删除 1:正常
|
||||||
*/
|
*/
|
||||||
@@ -57,5 +49,8 @@ public class AppProjectPO extends BaseEntity {
|
|||||||
@TableField(value = "description")
|
@TableField(value = "description")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
@TableField(value = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -64,5 +64,10 @@ public class CsEngineeringPO extends BaseEntity {
|
|||||||
@TableField(value = "status")
|
@TableField(value = "status")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
@TableField(value = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -130,4 +130,22 @@ public class CsEquipmentDeliveryPO extends BaseEntity {
|
|||||||
@TableField(value = "node_process")
|
@TableField(value = "node_process")
|
||||||
private Integer nodeProcess;
|
private Integer nodeProcess;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志等级(NORMAL、DEBUG、WARN、ERROR)
|
||||||
|
*/
|
||||||
|
@TableField(value = "dev_log_level")
|
||||||
|
private String devLogLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属工程
|
||||||
|
*/
|
||||||
|
@TableField(value = "associated_engineering")
|
||||||
|
private String associatedEngineering;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属项目
|
||||||
|
*/
|
||||||
|
@TableField(value = "associated_project")
|
||||||
|
private String associatedProject;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -165,4 +165,16 @@ public class CsLinePO extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
@TableField(value = "report_file_path")
|
@TableField(value = "report_file_path")
|
||||||
private String reportFilePath;
|
private String reportFilePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志等级(NORMAL、DEBUG、WARN、ERROR)
|
||||||
|
*/
|
||||||
|
@TableField(value = "line_log_level")
|
||||||
|
private String lineLogLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是主要监测点(0: 不是 1:是)
|
||||||
|
*/
|
||||||
|
@TableField(value = "is_important")
|
||||||
|
private Integer isImportant;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.njcn.csdevice.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户置顶表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2026-03-04
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("cs_user_pins")
|
||||||
|
public class CsUserPins extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标类型:1-设备,2-工程
|
||||||
|
*/
|
||||||
|
private Integer targetType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标ID(设备ID或工程ID)
|
||||||
|
*/
|
||||||
|
private String targetId;
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -31,7 +31,7 @@ public class CldLedgerVo implements Serializable {
|
|||||||
private String engineeringDescription;
|
private String engineeringDescription;
|
||||||
|
|
||||||
@ApiModelProperty(value = "项目信息")
|
@ApiModelProperty(value = "项目信息")
|
||||||
private List<AppProjectPO> projectInfoList;
|
private List<ProjectVO> projectInfoList;
|
||||||
|
|
||||||
@ApiModelProperty(value = "设备信息")
|
@ApiModelProperty(value = "设备信息")
|
||||||
private List<CsEquipmentDeliveryPO> deviceInfoList;
|
private List<CsEquipmentDeliveryPO> deviceInfoList;
|
||||||
@@ -39,4 +39,7 @@ public class CldLedgerVo implements Serializable {
|
|||||||
@ApiModelProperty(value = "监测点信息")
|
@ApiModelProperty(value = "监测点信息")
|
||||||
private List<CsLinePO> lineInfoList;
|
private List<CsLinePO> lineInfoList;
|
||||||
|
|
||||||
|
@ApiModelProperty("工程排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -67,5 +67,6 @@ public class CsEngineeringVO extends BaseEntity {
|
|||||||
@ApiModelProperty(value = "状态")
|
@ApiModelProperty(value = "状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
private Integer sort;
|
||||||
}
|
}
|
||||||
@@ -94,4 +94,16 @@ public class CsEquipmentDeliveryVO extends BaseEntity {
|
|||||||
@ApiModelProperty(value="前置服务器id")
|
@ApiModelProperty(value="前置服务器id")
|
||||||
private String nodeId ;
|
private String nodeId ;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="所属工程id")
|
||||||
|
private String associatedEngineering;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="所属工程名称")
|
||||||
|
private String associatedEngineeringName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="所属项目id")
|
||||||
|
private String associatedProject;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="所属项目名称")
|
||||||
|
private String associatedProjectName;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -69,6 +69,12 @@ public class CsLedgerVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "process",value = "流程状态")
|
@ApiModelProperty(name = "process",value = "流程状态")
|
||||||
private Integer process;
|
private Integer process;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "isTop",value = "是否置顶,默认不置顶")
|
||||||
|
private Integer isTop = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "devConType",value = "设备连接方式 MQTT || CLD")
|
||||||
|
private String devConType;
|
||||||
|
|
||||||
@ApiModelProperty(name = "children",value = "子节点")
|
@ApiModelProperty(name = "children",value = "子节点")
|
||||||
private List<CsLedgerVO> children = new ArrayList<>();
|
private List<CsLedgerVO> children = new ArrayList<>();
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,54 +16,59 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class DevCountVO {
|
public class DevCountVO implements Serializable {
|
||||||
//
|
|
||||||
@ApiModelProperty(value = "设备在线总数")
|
/** 所有工程相关数据 **/
|
||||||
private Integer onLineDevCount;
|
@ApiModelProperty(value = "所有工程设备在线总数")
|
||||||
|
private Integer onLineDevCount = 0;
|
||||||
private List<CsEquipmentDeliveryPO> onLineDevs;
|
private List<CsEquipmentDeliveryPO> onLineDevs;
|
||||||
|
|
||||||
@ApiModelProperty(value = "设备离线总数")
|
@ApiModelProperty(value = "所有工程设备离线总数")
|
||||||
private Integer offLineDevCount;
|
private Integer offLineDevCount = 0;
|
||||||
private List<CsEquipmentDeliveryPO> offLineDevs;
|
private List<CsEquipmentDeliveryPO> offLineDevs;
|
||||||
@ApiModelProperty(value = "警告数")
|
|
||||||
private Integer alarmCount;
|
@ApiModelProperty(value = "所有工程暂态事件数量(未读)")
|
||||||
@ApiModelProperty(value = "事件数")
|
private Integer eventCount = 0;
|
||||||
private Integer eventCount;
|
|
||||||
|
@ApiModelProperty(value = "所有工程稳态事件数量(未读)")
|
||||||
|
private Integer harmonicCount = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所有工程运行告警数量(未读)")
|
||||||
|
private Integer alarmCount = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所有工程运行事件数量(未读)")
|
||||||
|
private Integer runCount = 0;
|
||||||
|
|
||||||
@ApiModelProperty(value = "工程个数")
|
@ApiModelProperty(value = "工程个数")
|
||||||
private Integer eningerCount;
|
private Integer eningerCount = 0;
|
||||||
|
|
||||||
@ApiModelProperty(value = "运行事件数")
|
|
||||||
private Integer runCount;
|
|
||||||
@ApiModelProperty(value = "稳态件数")
|
|
||||||
private Integer harmonicCount;
|
|
||||||
|
|
||||||
|
/** 当前工程相关数据 **/
|
||||||
@ApiModelProperty(value = "当前工程id")
|
@ApiModelProperty(value = "当前工程id")
|
||||||
private String currentId;
|
private String currentId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "当前工程设备在线总数")
|
@ApiModelProperty(value = "当前工程设备在线总数")
|
||||||
private Integer currentOnLineDevCount;
|
private Integer currentOnLineDevCount = 0;
|
||||||
private List<CsEquipmentDeliveryPO> currentOnLineDevs;
|
private List<CsEquipmentDeliveryPO> currentOnLineDevs;
|
||||||
|
|
||||||
@ApiModelProperty(value = "当前工程设备离线总数")
|
@ApiModelProperty(value = "当前工程设备离线总数")
|
||||||
private Integer currentOffLineDevCount;
|
private Integer currentOffLineDevCount = 0;
|
||||||
private List<CsEquipmentDeliveryPO> currentOffLineDevs;
|
private List<CsEquipmentDeliveryPO> currentOffLineDevs;
|
||||||
|
|
||||||
@ApiModelProperty(value = "设备警告数")
|
@ApiModelProperty(value = "当前工程暂态事件数量(未读)")
|
||||||
private Integer currentAlarmCount;
|
private Integer currentEventCount = 0;
|
||||||
@ApiModelProperty(value = "暂态事件数")
|
|
||||||
private Integer currentEventCount;
|
@ApiModelProperty(value = "当前工程稳态事件数量(未读)")
|
||||||
@ApiModelProperty(value = "运行事件数")
|
private Integer currentHarmonicCount = 0;
|
||||||
private Integer currentRunCount;
|
|
||||||
@ApiModelProperty(value = "稳态件数")
|
@ApiModelProperty(value = "当前工程运行告警数量(未读)")
|
||||||
private Integer currentHarmonicCount;
|
private Integer currentAlarmCount = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "当前工程运行事件数量(未读)")
|
||||||
|
private Integer currentRunCount = 0;
|
||||||
|
|
||||||
@ApiModelProperty(value = "当前项目数")
|
@ApiModelProperty(value = "当前项目数")
|
||||||
private Integer currentProjectCount;
|
private Integer currentProjectCount = 0;
|
||||||
|
|
||||||
@ApiModelProperty(value = "反馈数")
|
@ApiModelProperty(value = "反馈数")
|
||||||
private Integer feedBackCount;
|
private Integer feedBackCount = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import lombok.Data;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
//台账信息
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/ //台账信息
|
||||||
@Data
|
@Data
|
||||||
public class DeviceInfo implements Serializable {
|
public class DeviceInfo implements Serializable {
|
||||||
|
|
||||||
@@ -31,6 +33,9 @@ public class DeviceInfo implements Serializable {
|
|||||||
@ApiModelProperty("对时启动标志")
|
@ApiModelProperty("对时启动标志")
|
||||||
private boolean rightTime;
|
private boolean rightTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("终端日志等级")
|
||||||
|
private String devLogLevel;
|
||||||
|
|
||||||
@ApiModelProperty("监测点集合")
|
@ApiModelProperty("监测点集合")
|
||||||
private List<MonitorInfo> monitorData;
|
private List<MonitorInfo> monitorData;
|
||||||
|
|
||||||
@@ -70,6 +75,9 @@ public class DeviceInfo implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty("ct2")
|
@ApiModelProperty("ct2")
|
||||||
private Double ct2;
|
private Double ct2;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点日志等级")
|
||||||
|
private String lineLogLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.njcn.csdevice.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2026/3/5
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EngineeringHomePageVO implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "engineeringId",value = "工程id")
|
||||||
|
private String engineeringId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "engineeringName",value = "工程名称")
|
||||||
|
private String engineeringName;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "devTotal",value = "设备总数")
|
||||||
|
private Integer devTotal = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "onlineDevTotal",value = "在线设备数")
|
||||||
|
private Integer onlineDevTotal = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "offlineDevTotal",value = "离线设备数")
|
||||||
|
private Integer offlineDevTotal = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "alarmTotal",value = "告警数量(未读)")
|
||||||
|
private Integer alarmTotal = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "isTop",value = "是否置顶 0:未置顶 1:已置顶")
|
||||||
|
private Integer isTop = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "sort",value = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.njcn.csdevice.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
* 日志信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EngineeringProjectRelationVo implements Serializable {
|
||||||
|
|
||||||
|
//工程信息
|
||||||
|
@ApiModelProperty("工程id")
|
||||||
|
private String engineeringId;
|
||||||
|
|
||||||
|
@ApiModelProperty("工程名称")
|
||||||
|
private String engineeringName;
|
||||||
|
|
||||||
|
@ApiModelProperty("省ID")
|
||||||
|
private String provinceId;
|
||||||
|
|
||||||
|
@ApiModelProperty("市ID")
|
||||||
|
private String cityId;
|
||||||
|
|
||||||
|
@ApiModelProperty("区域名称")
|
||||||
|
private String engineeringAreaName;
|
||||||
|
|
||||||
|
@ApiModelProperty("工程备注")
|
||||||
|
private String engineeringRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("工程排序")
|
||||||
|
private Integer engineeringSort;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目信息")
|
||||||
|
private List<ProjectInfo> projectInfoList;
|
||||||
|
|
||||||
|
//项目信息
|
||||||
|
@Data
|
||||||
|
public static class ProjectInfo implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty("项目id")
|
||||||
|
private String projectId;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目地址")
|
||||||
|
private String projectArea;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目备注")
|
||||||
|
private String projectRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目排序")
|
||||||
|
private Integer projectSort;
|
||||||
|
|
||||||
|
@ApiModelProperty("拓扑图id")
|
||||||
|
private String topologyInfoId;
|
||||||
|
|
||||||
|
@ApiModelProperty("拓扑图信息")
|
||||||
|
private String topologyInfo;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -132,4 +132,7 @@ public class LineDetailDataVO {
|
|||||||
|
|
||||||
@ApiModelProperty(name = "对象类型大类")
|
@ApiModelProperty(name = "对象类型大类")
|
||||||
private String bigObjType;
|
private String bigObjType;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "监测点数据类型 一次值:Primary 二次值:Secondary")
|
||||||
|
private String dataLevel;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.njcn.csdevice.pojo.vo;
|
package com.njcn.csdevice.pojo.vo;
|
||||||
|
|
||||||
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -54,4 +57,16 @@ public class ProjectEquipmentVO {
|
|||||||
@ApiModelProperty(value = "设备nDid")
|
@ApiModelProperty(value = "设备nDid")
|
||||||
private String nDid;
|
private String nDid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否置顶(0:未置顶 1:置顶),默认是0")
|
||||||
|
private Integer isTop = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设备类型(监测设备:DEV_CLD 治理设备:Direct_Connected_Device)")
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "监测点集合")
|
||||||
|
private List<CsLinePO> lineList;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.csdevice.pojo.vo;
|
||||||
|
|
||||||
|
import com.njcn.csdevice.pojo.po.AppProjectPO;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 徐扬
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class ProjectVO extends AppProjectPO {
|
||||||
|
|
||||||
|
private String topoId;
|
||||||
|
}
|
||||||
@@ -1,383 +1,383 @@
|
|||||||
package com.njcn.csdevice.utils;
|
//package com.njcn.csdevice.utils;
|
||||||
|
//
|
||||||
import com.njcn.csdevice.pojo.po.Overlimit;
|
//import com.njcn.csdevice.pojo.po.Overlimit;
|
||||||
import com.njcn.device.biz.enums.RunFlagEnum;
|
//import com.njcn.device.biz.enums.RunFlagEnum;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
//import com.njcn.system.enums.DicDataEnum;
|
||||||
|
//
|
||||||
import java.math.BigDecimal;
|
//import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
//import java.math.RoundingMode;
|
||||||
import java.util.Objects;
|
//import java.util.Objects;
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* pqs
|
// * pqs
|
||||||
* 限值计算工具类
|
// * 限值计算工具类
|
||||||
*
|
// *
|
||||||
* @author cdf
|
// * @author cdf
|
||||||
* @date 2023/5/15
|
// * @date 2023/5/15
|
||||||
*/
|
// */
|
||||||
public class COverlimitUtil {
|
//public class COverlimitUtil {
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 谐波电流系数
|
// * 谐波电流系数
|
||||||
*/
|
// */
|
||||||
private static final double[][] ARR = {
|
// private static final double[][] ARR = {
|
||||||
{78, 62, 39, 62, 26, 44, 19, 21, 16, 28, 13, 24, 11, 12, 9.7, 18, 8.6, 16, 7.8, 8.9, 7.1, 14, 6.5, 12, 6.0, 6.9, 5.6, 11, 5.2, 10, 4.9, 5.6, 4.6, 8.9, 4.3, 8.4, 4.1, 4.8, 3.9, 7.6, 3.7, 7.2, 3.5, 4.1, 3.4, 6.6, 3.3, 6.3, 3.1},
|
// {78, 62, 39, 62, 26, 44, 19, 21, 16, 28, 13, 24, 11, 12, 9.7, 18, 8.6, 16, 7.8, 8.9, 7.1, 14, 6.5, 12, 6.0, 6.9, 5.6, 11, 5.2, 10, 4.9, 5.6, 4.6, 8.9, 4.3, 8.4, 4.1, 4.8, 3.9, 7.6, 3.7, 7.2, 3.5, 4.1, 3.4, 6.6, 3.3, 6.3, 3.1},
|
||||||
{43, 34, 21, 34, 14, 24, 11, 11, 8.5, 16, 7.1, 13, 6.1, 6.8, 5.3, 10, 4.7, 9, 4.3, 4.9, 3.9, 7.4, 3.6, 6.8, 3.3, 3.8, 3.1, 5.9, 2.9, 5.5, 2.7, 3.1, 2.5, 4.9, 2.4, 4.6, 2.3, 2.6, 2.2, 4.1, 2.0, 4.0, 2.0, 2.3, 1.9, 3.6, 1.8, 3.5, 1.7},
|
// {43, 34, 21, 34, 14, 24, 11, 11, 8.5, 16, 7.1, 13, 6.1, 6.8, 5.3, 10, 4.7, 9, 4.3, 4.9, 3.9, 7.4, 3.6, 6.8, 3.3, 3.8, 3.1, 5.9, 2.9, 5.5, 2.7, 3.1, 2.5, 4.9, 2.4, 4.6, 2.3, 2.6, 2.2, 4.1, 2.0, 4.0, 2.0, 2.3, 1.9, 3.6, 1.8, 3.5, 1.7},
|
||||||
{26, 20, 13, 20, 8.5, 15, 6.4, 6.8, 5.1, 9.3, 4.3, 7.9, 3.7, 4.1, 3.2, 6, 2.8, 5.4, 2.6, 2.9, 2.3, 4.5, 2.1, 4.1, 2.0, 2.2, 1.9, 3.4, 1.7, 3.2, 1.6, 1.8, 1.5, 2.9, 1.4, 2.7, 1.4, 1.5, 1.3, 2.4, 1.2, 2.3, 1.2, 1.3, 1.1, 2.1, 1.1, 2.0, 1.0},
|
// {26, 20, 13, 20, 8.5, 15, 6.4, 6.8, 5.1, 9.3, 4.3, 7.9, 3.7, 4.1, 3.2, 6, 2.8, 5.4, 2.6, 2.9, 2.3, 4.5, 2.1, 4.1, 2.0, 2.2, 1.9, 3.4, 1.7, 3.2, 1.6, 1.8, 1.5, 2.9, 1.4, 2.7, 1.4, 1.5, 1.3, 2.4, 1.2, 2.3, 1.2, 1.3, 1.1, 2.1, 1.1, 2.0, 1.0},
|
||||||
{15, 12, 7.7, 12, 5.1, 8.8, 3.8, 4.1, 3.1, 5.6, 2.6, 4.7, 2.2, 2.5, 1.9, 3.6, 1.7, 3.2, 1.5, 1.8, 1.4, 2.7, 1.3, 2.5, 1.2, 1.3, 1.1, 2.1, 1.0, 1.9, 0.9, 1.1, 0.9, 1.7, 0.8, 1.6, 0.8, 0.9, 0.8, 1.5, 0.7, 1.4, 0.7, 0.8, 0.7, 1.3, 0.6, 1.2, 0.6},
|
// {15, 12, 7.7, 12, 5.1, 8.8, 3.8, 4.1, 3.1, 5.6, 2.6, 4.7, 2.2, 2.5, 1.9, 3.6, 1.7, 3.2, 1.5, 1.8, 1.4, 2.7, 1.3, 2.5, 1.2, 1.3, 1.1, 2.1, 1.0, 1.9, 0.9, 1.1, 0.9, 1.7, 0.8, 1.6, 0.8, 0.9, 0.8, 1.5, 0.7, 1.4, 0.7, 0.8, 0.7, 1.3, 0.6, 1.2, 0.6},
|
||||||
{16, 13, 8.1, 13, 5.4, 9.3, 4.1, 4.3, 3.3, 5.9, 2.7, 5, 2.3, 2.6, 2, 3.8, 1.8, 3.4, 1.6, 1.9, 1.5, 2.8, 1.4, 2.6, 1.2, 1.4, 1.1, 2.2, 1.1, 2.1, 1.0, 1.2, 0.9, 1.9, 0.9, 1.8, 0.8, 1.0, 0.8, 1.6, 0.8, 1.5, 0.7, 0.9, 0.7, 1.4, 0.7, 1.3, 0.6},
|
// {16, 13, 8.1, 13, 5.4, 9.3, 4.1, 4.3, 3.3, 5.9, 2.7, 5, 2.3, 2.6, 2, 3.8, 1.8, 3.4, 1.6, 1.9, 1.5, 2.8, 1.4, 2.6, 1.2, 1.4, 1.1, 2.2, 1.1, 2.1, 1.0, 1.2, 0.9, 1.9, 0.9, 1.8, 0.8, 1.0, 0.8, 1.6, 0.8, 1.5, 0.7, 0.9, 0.7, 1.4, 0.7, 1.3, 0.6},
|
||||||
{12, 9.6, 6, 9.6, 4, 6.8, 3, 3.2, 2.4, 4.3, 2, 3.7, 1.7, 1.9, 1.5, 2.8, 1.3, 2.5, 1.2, 1.4, 1.1, 2.1, 1, 1.9, 0.9, 1.1, 0.9, 1.7, 0.8, 1.5, 0.8, 0.9, 0.7, 1.4, 0.7, 1.3, 0.6, 0.7, 0.6, 1.2, 0.6, 1.1, 0.5, 0.6, 0.5, 1.0, 0.5, 1.0, 0.5}
|
// {12, 9.6, 6, 9.6, 4, 6.8, 3, 3.2, 2.4, 4.3, 2, 3.7, 1.7, 1.9, 1.5, 2.8, 1.3, 2.5, 1.2, 1.4, 1.1, 2.1, 1, 1.9, 0.9, 1.1, 0.9, 1.7, 0.8, 1.5, 0.8, 0.9, 0.7, 1.4, 0.7, 1.3, 0.6, 0.7, 0.6, 1.2, 0.6, 1.1, 0.5, 0.6, 0.5, 1.0, 0.5, 1.0, 0.5}
|
||||||
};
|
// };
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 计算监测点限值
|
// * 计算监测点限值
|
||||||
* @param voltageLevel 电压等级(10kV = 10 220kV = 220 )
|
// * @param voltageLevel 电压等级(10kV = 10 220kV = 220 )
|
||||||
* @param protocolCapacity 协议容量
|
// * @param protocolCapacity 协议容量
|
||||||
* @param devCapacity 设备容量
|
// * @param devCapacity 设备容量
|
||||||
* @param shortCapacity 短路容量
|
// * @param shortCapacity 短路容量
|
||||||
* @param powerFlag 0.用户侧 1.电网侧
|
// * @param powerFlag 0.用户侧 1.电网侧
|
||||||
* @param lineType 0.主网 1.配网 需要注意配网目前没有四种容量,谐波电流幅值限值,负序电流限值无法计算默认-3.14159
|
// * @param lineType 0.主网 1.配网 需要注意配网目前没有四种容量,谐波电流幅值限值,负序电流限值无法计算默认-3.14159
|
||||||
*/
|
// */
|
||||||
public static Overlimit globalAssemble(Float voltageLevel, Float protocolCapacity, Float devCapacity,
|
// public static Overlimit globalAssemble(Float voltageLevel, Float protocolCapacity, Float devCapacity,
|
||||||
Float shortCapacity, Integer powerFlag, Integer lineType) {
|
// Float shortCapacity, Integer powerFlag, Integer lineType) {
|
||||||
Overlimit overlimit = new Overlimit();
|
// Overlimit overlimit = new Overlimit();
|
||||||
voltageDeviation(overlimit,voltageLevel);
|
// voltageDeviation(overlimit,voltageLevel);
|
||||||
frequency(overlimit);
|
// frequency(overlimit);
|
||||||
voltageFluctuation(overlimit,voltageLevel);
|
// voltageFluctuation(overlimit,voltageLevel);
|
||||||
voltageFlicker(overlimit,voltageLevel);
|
// voltageFlicker(overlimit,voltageLevel);
|
||||||
totalHarmonicDistortion(overlimit,voltageLevel);
|
// totalHarmonicDistortion(overlimit,voltageLevel);
|
||||||
uHarm(overlimit,voltageLevel);
|
// uHarm(overlimit,voltageLevel);
|
||||||
threeVoltageUnbalance(overlimit);
|
// threeVoltageUnbalance(overlimit);
|
||||||
interharmonicCurrent(overlimit,voltageLevel);
|
// interharmonicCurrent(overlimit,voltageLevel);
|
||||||
|
//
|
||||||
if(Objects.equals(lineType, RunFlagEnum.PW_FLAG.getStatus())) {
|
// if(Objects.equals(lineType, RunFlagEnum.PW_FLAG.getStatus())) {
|
||||||
//配网
|
// //配网
|
||||||
Float[] iHarmTem = new Float[49];
|
// Float[] iHarmTem = new Float[49];
|
||||||
for (int i = 0; i <= 48; i++) {
|
// for (int i = 0; i <= 48; i++) {
|
||||||
|
//
|
||||||
iHarmTem[i] = -3.14159f;
|
// iHarmTem[i] = -3.14159f;
|
||||||
}
|
// }
|
||||||
overlimit.buildIHarm(iHarmTem);
|
// overlimit.buildIHarm(iHarmTem);
|
||||||
overlimit.setINeg(-3.14159f);
|
// overlimit.setINeg(-3.14159f);
|
||||||
}else {
|
// }else {
|
||||||
//主网
|
// //主网
|
||||||
iHarm(overlimit, voltageLevel, protocolCapacity, devCapacity, shortCapacity);
|
// iHarm(overlimit, voltageLevel, protocolCapacity, devCapacity, shortCapacity);
|
||||||
negativeSequenceCurrent(overlimit, voltageLevel, shortCapacity);
|
// negativeSequenceCurrent(overlimit, voltageLevel, shortCapacity);
|
||||||
}
|
// }
|
||||||
return overlimit;
|
// return overlimit;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 电压偏差限值
|
// * 电压偏差限值
|
||||||
*
|
// *
|
||||||
*/
|
// */
|
||||||
public static void voltageDeviation(Overlimit overlimit,Float voltageLevel) {
|
// public static void voltageDeviation(Overlimit overlimit,Float voltageLevel) {
|
||||||
float voltageDev = 3.14159f,uvoltageDev = 3.14159f;
|
// float voltageDev = 3.14159f,uvoltageDev = 3.14159f;
|
||||||
if(voltageLevel <= Float.parseFloat(DicDataEnum.V220.getCode())){
|
// if(voltageLevel <= Float.parseFloat(DicDataEnum.V220.getCode())){
|
||||||
voltageDev = 7.0f;
|
// voltageDev = 7.0f;
|
||||||
uvoltageDev=-10.0f;
|
// uvoltageDev=-10.0f;
|
||||||
}else if(voltageLevel>Float.parseFloat(DicDataEnum.V220.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV20.getCode())){
|
// }else if(voltageLevel>Float.parseFloat(DicDataEnum.V220.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV20.getCode())){
|
||||||
voltageDev = 7.0f;
|
// voltageDev = 7.0f;
|
||||||
uvoltageDev=-7.0f;
|
// uvoltageDev=-7.0f;
|
||||||
}else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV20.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV35.getCode())){
|
// }else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV20.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV35.getCode())){
|
||||||
voltageDev = 7.0f;
|
// voltageDev = 7.0f;
|
||||||
uvoltageDev=-7.0f;
|
// uvoltageDev=-7.0f;
|
||||||
}else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV35.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV66.getCode())){
|
// }else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV35.getCode())&&voltageLevel<Float.parseFloat(DicDataEnum.KV66.getCode())){
|
||||||
voltageDev = 10.0f;
|
// voltageDev = 10.0f;
|
||||||
uvoltageDev=-10.0f;
|
// uvoltageDev=-10.0f;
|
||||||
}else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV66.getCode())&&voltageLevel<=Float.parseFloat(DicDataEnum.KV110.getCode())){
|
// }else if(voltageLevel>=Float.parseFloat(DicDataEnum.KV66.getCode())&&voltageLevel<=Float.parseFloat(DicDataEnum.KV110.getCode())){
|
||||||
voltageDev = 7.0f;
|
// voltageDev = 7.0f;
|
||||||
uvoltageDev=-3.0f;
|
// uvoltageDev=-3.0f;
|
||||||
}else if(voltageLevel>Float.parseFloat(DicDataEnum.KV110.getCode())){
|
// }else if(voltageLevel>Float.parseFloat(DicDataEnum.KV110.getCode())){
|
||||||
voltageDev = 10.0f;
|
// voltageDev = 10.0f;
|
||||||
uvoltageDev=-10.0f;
|
// uvoltageDev=-10.0f;
|
||||||
}
|
// }
|
||||||
overlimit.setVoltageDev(voltageDev);
|
// overlimit.setVoltageDev(voltageDev);
|
||||||
overlimit.setUvoltageDev(uvoltageDev);
|
// overlimit.setUvoltageDev(uvoltageDev);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 频率偏差
|
// * 频率偏差
|
||||||
* 默认限值:±0.2Hz(即:-0.2 Hz≤限值≤0.2 Hz)
|
// * 默认限值:±0.2Hz(即:-0.2 Hz≤限值≤0.2 Hz)
|
||||||
*/
|
// */
|
||||||
public static void frequency(Overlimit overlimit) {
|
// public static void frequency(Overlimit overlimit) {
|
||||||
overlimit.setFreqDev(0.2f);
|
// overlimit.setFreqDev(0.2f);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 电压波动
|
// * 电压波动
|
||||||
* 对LV、MV:0≤限值≤3%;对HV:0≤限值≤2.5%。
|
// * 对LV、MV:0≤限值≤3%;对HV:0≤限值≤2.5%。
|
||||||
* LV、MV、HV的定义:
|
// * LV、MV、HV的定义:
|
||||||
* 低压(LV) UN≤1kV
|
// * 低压(LV) UN≤1kV
|
||||||
* 中压(MV) 1kV<UN≤35kV
|
// * 中压(MV) 1kV<UN≤35kV
|
||||||
* 高压(HV) 35kV<UN≤220kV
|
// * 高压(HV) 35kV<UN≤220kV
|
||||||
* 超高压(EHV),220kV<UN,参照HV执行
|
// * 超高压(EHV),220kV<UN,参照HV执行
|
||||||
*/
|
// */
|
||||||
public static void voltageFluctuation(Overlimit overlimit, Float voltageLevel) {
|
// public static void voltageFluctuation(Overlimit overlimit, Float voltageLevel) {
|
||||||
if (voltageLevel < Float.parseFloat(DicDataEnum.KV35.getCode())) {
|
// if (voltageLevel < Float.parseFloat(DicDataEnum.KV35.getCode())) {
|
||||||
overlimit.setVoltageFluctuation(3.0f);
|
// overlimit.setVoltageFluctuation(3.0f);
|
||||||
} else {
|
// } else {
|
||||||
overlimit.setVoltageFluctuation(2.5f);
|
// overlimit.setVoltageFluctuation(2.5f);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 电压闪变
|
// * 电压闪变
|
||||||
* ≤110kV 1
|
// * ≤110kV 1
|
||||||
* >110kV 0.8
|
// * >110kV 0.8
|
||||||
*/
|
// */
|
||||||
public static void voltageFlicker(Overlimit overlimit, Float voltageLevel) {
|
// public static void voltageFlicker(Overlimit overlimit, Float voltageLevel) {
|
||||||
if (voltageLevel <= Float.parseFloat(DicDataEnum.KV110.getCode())) {
|
// if (voltageLevel <= Float.parseFloat(DicDataEnum.KV110.getCode())) {
|
||||||
overlimit.setFlicker(1.0f);
|
// overlimit.setFlicker(1.0f);
|
||||||
} else {
|
// } else {
|
||||||
overlimit.setFlicker(0.8f);
|
// overlimit.setFlicker(0.8f);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 总谐波电压畸变率
|
// * 总谐波电压畸变率
|
||||||
*
|
// *
|
||||||
*
|
// *
|
||||||
*/
|
// */
|
||||||
public static void totalHarmonicDistortion(Overlimit overlimit, Float voltageLevel) {
|
// public static void totalHarmonicDistortion(Overlimit overlimit, Float voltageLevel) {
|
||||||
float result = 3.14159f;
|
// float result = 3.14159f;
|
||||||
if (voltageLevel < Float.parseFloat(DicDataEnum.KV6.getCode())) {
|
// if (voltageLevel < Float.parseFloat(DicDataEnum.KV6.getCode())) {
|
||||||
result = 5.0f;
|
// result = 5.0f;
|
||||||
} else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV6.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV20.getCode())){
|
// } else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV6.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV20.getCode())){
|
||||||
result = 4.0f;
|
// result = 4.0f;
|
||||||
} else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV35.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV66.getCode())){
|
// } else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV35.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV66.getCode())){
|
||||||
result = 3.0f;
|
// result = 3.0f;
|
||||||
} else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV110.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV1000.getCode())){
|
// } else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV110.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV1000.getCode())){
|
||||||
result = 2.0f;
|
// result = 2.0f;
|
||||||
}
|
// }
|
||||||
overlimit.setUaberrance(result);
|
// overlimit.setUaberrance(result);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 谐波电压含有率
|
// * 谐波电压含有率
|
||||||
*/
|
// */
|
||||||
public static void uHarm(Overlimit overlimit, Float voltageLevel) {
|
// public static void uHarm(Overlimit overlimit, Float voltageLevel) {
|
||||||
float resultOdd = 3.14159f,resultEven = 3.14159f;
|
// float resultOdd = 3.14159f,resultEven = 3.14159f;
|
||||||
if (voltageLevel < Float.parseFloat(DicDataEnum.KV6.getCode())) {
|
// if (voltageLevel < Float.parseFloat(DicDataEnum.KV6.getCode())) {
|
||||||
resultOdd = 4.0f;
|
// resultOdd = 4.0f;
|
||||||
resultEven = 2.0f;
|
// resultEven = 2.0f;
|
||||||
} else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV6.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV20.getCode())){
|
// } else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV6.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV20.getCode())){
|
||||||
resultOdd = 3.2f;
|
// resultOdd = 3.2f;
|
||||||
resultEven = 1.6f;
|
// resultEven = 1.6f;
|
||||||
} else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV35.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV66.getCode())){
|
// } else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV35.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV66.getCode())){
|
||||||
resultOdd = 2.4f;
|
// resultOdd = 2.4f;
|
||||||
resultEven = 1.2f;
|
// resultEven = 1.2f;
|
||||||
} else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV110.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV1000.getCode())){
|
// } else if(voltageLevel >= Float.parseFloat(DicDataEnum.KV110.getCode()) && voltageLevel <= Float.parseFloat(DicDataEnum.KV1000.getCode())){
|
||||||
resultOdd = 1.6f;
|
// resultOdd = 1.6f;
|
||||||
resultEven = 0.8f;
|
// resultEven = 0.8f;
|
||||||
}
|
// }
|
||||||
overlimit.buildUharm(resultEven,resultOdd);
|
// overlimit.buildUharm(resultEven,resultOdd);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 负序电压不平衡(三相电压不平衡度)
|
// * 负序电压不平衡(三相电压不平衡度)
|
||||||
*
|
// *
|
||||||
*/
|
// */
|
||||||
public static void threeVoltageUnbalance(Overlimit overlimit) {
|
// public static void threeVoltageUnbalance(Overlimit overlimit) {
|
||||||
overlimit.setUbalance(2.0f);
|
// overlimit.setUbalance(2.0f);
|
||||||
overlimit.setShortUbalance(4.0f);
|
// overlimit.setShortUbalance(4.0f);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
/*---------------------------------谐波电流限值start-----------------------------------*/
|
// /*---------------------------------谐波电流限值start-----------------------------------*/
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 谐波电流限值
|
// * 谐波电流限值
|
||||||
*/
|
// */
|
||||||
public static void iHarm(Overlimit overlimit, Float voltageLevel,Float protocolCapacity,Float devCapacity,Float shortCapacity) {
|
// public static void iHarm(Overlimit overlimit, Float voltageLevel,Float protocolCapacity,Float devCapacity,Float shortCapacity) {
|
||||||
float calCap = shortCapacity/getDlCapByVoltageLevel(voltageLevel);
|
// float calCap = shortCapacity/getDlCapByVoltageLevel(voltageLevel);
|
||||||
//24谐波电流幅值
|
// //24谐波电流幅值
|
||||||
Float[] iHarmTem = new Float[49];
|
// Float[] iHarmTem = new Float[49];
|
||||||
for (int i = 0; i <= 48; i++) {
|
// for (int i = 0; i <= 48; i++) {
|
||||||
float inHarm = iHarmCalculate(i+2,voltageLevel,protocolCapacity,devCapacity,calCap);
|
// float inHarm = iHarmCalculate(i+2,voltageLevel,protocolCapacity,devCapacity,calCap);
|
||||||
iHarmTem[i] = inHarm;
|
// iHarmTem[i] = inHarm;
|
||||||
}
|
// }
|
||||||
overlimit.buildIHarm(iHarmTem);
|
// overlimit.buildIHarm(iHarmTem);
|
||||||
}
|
// }
|
||||||
/**
|
// /**
|
||||||
* @Description: iHarmCalculate
|
// * @Description: iHarmCalculate
|
||||||
* @Param: protocolCapacity 协议容量 devCapacity设备容量 calCap 短路容量
|
// * @Param: protocolCapacity 协议容量 devCapacity设备容量 calCap 短路容量
|
||||||
* @return: float
|
// * @return: float
|
||||||
* @Author: clam
|
// * @Author: clam
|
||||||
* @Date: 2024/2/4
|
// * @Date: 2024/2/4
|
||||||
*/
|
// */
|
||||||
private static float iHarmCalculate(int nHarm, Float voltageLevel,float protocolCapacity, float devCapacity,float calCap) {
|
// private static float iHarmCalculate(int nHarm, Float voltageLevel,float protocolCapacity, float devCapacity,float calCap) {
|
||||||
double tag = calCap*getHarmTag(nHarm,voltageLevel);
|
// double tag = calCap*getHarmTag(nHarm,voltageLevel);
|
||||||
Double limit = getHarmonicLimit(nHarm,tag,new BigDecimal(String.valueOf(devCapacity)).doubleValue(),new BigDecimal(String.valueOf(protocolCapacity)).doubleValue());
|
// Double limit = getHarmonicLimit(nHarm,tag,new BigDecimal(String.valueOf(devCapacity)).doubleValue(),new BigDecimal(String.valueOf(protocolCapacity)).doubleValue());
|
||||||
BigDecimal bigDecimal = BigDecimal.valueOf(limit).setScale(4,RoundingMode.HALF_UP);
|
// BigDecimal bigDecimal = BigDecimal.valueOf(limit).setScale(4,RoundingMode.HALF_UP);
|
||||||
return bigDecimal.floatValue();
|
// return bigDecimal.floatValue();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 电流谐波限值
|
// * 电流谐波限值
|
||||||
*/
|
// */
|
||||||
private static Double getHarmTag(Integer iCount, Float voltageLevel) {
|
// private static Double getHarmTag(Integer iCount, Float voltageLevel) {
|
||||||
int x, y;
|
// int x, y;
|
||||||
if (voltageLevel < DicDataEnum.KV6.getValue()) {
|
// if (voltageLevel < DicDataEnum.KV6.getValue()) {
|
||||||
x = 0;
|
// x = 0;
|
||||||
} else if (voltageLevel<DicDataEnum.KV10.getValue()) {
|
// } else if (voltageLevel<DicDataEnum.KV10.getValue()) {
|
||||||
x = 1;
|
// x = 1;
|
||||||
} else if (voltageLevel<DicDataEnum.KV35.getValue()) {
|
// } else if (voltageLevel<DicDataEnum.KV35.getValue()) {
|
||||||
x = 2;
|
// x = 2;
|
||||||
} else if (voltageLevel<DicDataEnum.KV66.getValue()) {
|
// } else if (voltageLevel<DicDataEnum.KV66.getValue()) {
|
||||||
x = 3;
|
// x = 3;
|
||||||
} else if (voltageLevel<DicDataEnum.KV110.getValue()) {
|
// } else if (voltageLevel<DicDataEnum.KV110.getValue()) {
|
||||||
x = 4;
|
// x = 4;
|
||||||
} else {
|
// } else {
|
||||||
x = 5;
|
// x = 5;
|
||||||
}
|
// }
|
||||||
y = iCount - 2;
|
// y = iCount - 2;
|
||||||
return ARR[x][y];
|
// return ARR[x][y];
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 相位叠加系数的取值
|
// * 相位叠加系数的取值
|
||||||
*/
|
// */
|
||||||
public static Double getHarmonicLimit(Integer times, double iTag, double supply, double user) {
|
// public static Double getHarmonicLimit(Integer times, double iTag, double supply, double user) {
|
||||||
if (supply == 0) {
|
// if (supply == 0) {
|
||||||
return 0.0;
|
// return 0.0;
|
||||||
}
|
// }
|
||||||
double coefficient = 2.0;
|
// double coefficient = 2.0;
|
||||||
if (times == 3) {
|
// if (times == 3) {
|
||||||
coefficient = 1.1;
|
// coefficient = 1.1;
|
||||||
} else if (times == 5) {
|
// } else if (times == 5) {
|
||||||
coefficient = 1.2;
|
// coefficient = 1.2;
|
||||||
} else if (times == 7) {
|
// } else if (times == 7) {
|
||||||
coefficient = 1.4;
|
// coefficient = 1.4;
|
||||||
} else if (times == 11) {
|
// } else if (times == 11) {
|
||||||
coefficient = 1.8;
|
// coefficient = 1.8;
|
||||||
} else if (times == 13) {
|
// } else if (times == 13) {
|
||||||
coefficient = 1.9;
|
// coefficient = 1.9;
|
||||||
}
|
// }
|
||||||
BigDecimal bd = new BigDecimal(iTag * Math.pow((user / supply), (1 / coefficient)));
|
// BigDecimal bd = new BigDecimal(iTag * Math.pow((user / supply), (1 / coefficient)));
|
||||||
bd = bd.setScale(6, RoundingMode.HALF_UP);
|
// bd = bd.setScale(6, RoundingMode.HALF_UP);
|
||||||
return Double.parseDouble(bd.toString());
|
// return Double.parseDouble(bd.toString());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 根据电压等级获取基准短路容量
|
// * 根据电压等级获取基准短路容量
|
||||||
*/
|
// */
|
||||||
public static float getDlCapByVoltageLevel(Float voltageLevel){
|
// public static float getDlCapByVoltageLevel(Float voltageLevel){
|
||||||
float capValue;
|
// float capValue;
|
||||||
if(voltageLevel< DicDataEnum.KV06.getValue()){
|
// if(voltageLevel< DicDataEnum.KV06.getValue()){
|
||||||
capValue = 10;
|
// capValue = 10;
|
||||||
}else if(voltageLevel<DicDataEnum.KV20.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV20.getValue()){
|
||||||
capValue = 100;
|
// capValue = 100;
|
||||||
}else if(voltageLevel<DicDataEnum.KV35.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV35.getValue()){
|
||||||
capValue = 200;
|
// capValue = 200;
|
||||||
}else if(voltageLevel<DicDataEnum.KV66.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV66.getValue()){
|
||||||
capValue = 250;
|
// capValue = 250;
|
||||||
}else if(voltageLevel<DicDataEnum.KV110.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV110.getValue()){
|
||||||
capValue = 500;
|
// capValue = 500;
|
||||||
}else if(voltageLevel<DicDataEnum.KV220.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV220.getValue()){
|
||||||
capValue = 750;
|
// capValue = 750;
|
||||||
}else if(voltageLevel<DicDataEnum.KV330.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV330.getValue()){
|
||||||
capValue = 2000;
|
// capValue = 2000;
|
||||||
}else if(voltageLevel<DicDataEnum.KV500.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV500.getValue()){
|
||||||
capValue = 3000;
|
// capValue = 3000;
|
||||||
}else if(voltageLevel<DicDataEnum.KV750.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV750.getValue()){
|
||||||
capValue = 4500;
|
// capValue = 4500;
|
||||||
}else if(voltageLevel<DicDataEnum.KV1000.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV1000.getValue()){
|
||||||
capValue = 7000;
|
// capValue = 7000;
|
||||||
}else {
|
// }else {
|
||||||
capValue = 9000;
|
// capValue = 9000;
|
||||||
}
|
// }
|
||||||
return capValue;
|
// return capValue;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
/*---------------------------------谐波电流限值end-----------------------------------*/
|
// /*---------------------------------谐波电流限值end-----------------------------------*/
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 间谐波电压含有率
|
// * 间谐波电压含有率
|
||||||
*/
|
// */
|
||||||
|
//
|
||||||
public static void interharmonicCurrent(Overlimit overlimit,Float voltageLevel){
|
// public static void interharmonicCurrent(Overlimit overlimit,Float voltageLevel){
|
||||||
float aValue,bValue;
|
// float aValue,bValue;
|
||||||
if(voltageLevel <= DicDataEnum.KV1.getValue()){
|
// if(voltageLevel <= DicDataEnum.KV1.getValue()){
|
||||||
aValue = 0.2f;bValue = 0.5f;
|
// aValue = 0.2f;bValue = 0.5f;
|
||||||
}else {
|
// }else {
|
||||||
aValue = 0.16f;bValue = 0.4f;
|
// aValue = 0.16f;bValue = 0.4f;
|
||||||
}
|
// }
|
||||||
overlimit.setInuharm1(aValue);
|
// overlimit.setInuharm1(aValue);
|
||||||
overlimit.setInuharm2(aValue);
|
// overlimit.setInuharm2(aValue);
|
||||||
|
//
|
||||||
overlimit.setInuharm3(bValue);
|
// overlimit.setInuharm3(bValue);
|
||||||
overlimit.setInuharm4(bValue);
|
// overlimit.setInuharm4(bValue);
|
||||||
overlimit.setInuharm5(bValue);
|
// overlimit.setInuharm5(bValue);
|
||||||
overlimit.setInuharm6(bValue);
|
// overlimit.setInuharm6(bValue);
|
||||||
overlimit.setInuharm7(bValue);
|
// overlimit.setInuharm7(bValue);
|
||||||
overlimit.setInuharm8(bValue);
|
// overlimit.setInuharm8(bValue);
|
||||||
overlimit.setInuharm9(bValue);
|
// overlimit.setInuharm9(bValue);
|
||||||
overlimit.setInuharm10(bValue);
|
// overlimit.setInuharm10(bValue);
|
||||||
overlimit.setInuharm11(bValue);
|
// overlimit.setInuharm11(bValue);
|
||||||
overlimit.setInuharm12(bValue);
|
// overlimit.setInuharm12(bValue);
|
||||||
overlimit.setInuharm13(bValue);
|
// overlimit.setInuharm13(bValue);
|
||||||
overlimit.setInuharm14(bValue);
|
// overlimit.setInuharm14(bValue);
|
||||||
overlimit.setInuharm15(bValue);
|
// overlimit.setInuharm15(bValue);
|
||||||
overlimit.setInuharm16(bValue);
|
// overlimit.setInuharm16(bValue);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 负序电流限值
|
// * 负序电流限值
|
||||||
*/
|
// */
|
||||||
public static void negativeSequenceCurrent(Overlimit overlimit,Float voltageLevel,Float shortCapacity){
|
// public static void negativeSequenceCurrent(Overlimit overlimit,Float voltageLevel,Float shortCapacity){
|
||||||
double v = (0.013*shortCapacity*1000)/(getUl(voltageLevel)*Math.sqrt(3));
|
// double v = (0.013*shortCapacity*1000)/(getUl(voltageLevel)*Math.sqrt(3));
|
||||||
overlimit.setINeg((float) v);
|
// overlimit.setINeg((float) v);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 获取额定线电压
|
// * 获取额定线电压
|
||||||
*/
|
// */
|
||||||
private static float getUl(Float voltageLevel){
|
// private static float getUl(Float voltageLevel){
|
||||||
float value;
|
// float value;
|
||||||
if(voltageLevel<DicDataEnum.KV6.getValue()){
|
// if(voltageLevel<DicDataEnum.KV6.getValue()){
|
||||||
value = 0.4f;
|
// value = 0.4f;
|
||||||
}else if(voltageLevel<DicDataEnum.KV10.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV10.getValue()){
|
||||||
value = 6.3f;
|
// value = 6.3f;
|
||||||
}else if(voltageLevel<DicDataEnum.KV20.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV20.getValue()){
|
||||||
value = 10.5f;
|
// value = 10.5f;
|
||||||
}else if(voltageLevel<DicDataEnum.KV35.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV35.getValue()){
|
||||||
value = 21.0f;
|
// value = 21.0f;
|
||||||
}else if(voltageLevel<DicDataEnum.KV66.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV66.getValue()){
|
||||||
value = 36.5f;
|
// value = 36.5f;
|
||||||
}else if(voltageLevel<DicDataEnum.KV110.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV110.getValue()){
|
||||||
value = 69.0f;
|
// value = 69.0f;
|
||||||
}else if(voltageLevel<DicDataEnum.KV220.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV220.getValue()){
|
||||||
value = 115.5f;
|
// value = 115.5f;
|
||||||
}else if(voltageLevel<DicDataEnum.KV330.getValue()){
|
// }else if(voltageLevel<DicDataEnum.KV330.getValue()){
|
||||||
value = 230.0f;
|
// value = 230.0f;
|
||||||
}else {
|
// }else {
|
||||||
value = 345.0f;
|
// value = 345.0f;
|
||||||
}
|
// }
|
||||||
return value;
|
// return value;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
public static void main(String[] args) {
|
// public static void main(String[] args) {
|
||||||
System.out.println("sss");
|
// System.out.println("sss");
|
||||||
float aa = iHarmCalculate(9,500f,10,10,0.002222222222f);
|
// float aa = iHarmCalculate(9,500f,10,10,0.002222222222f);
|
||||||
|
//
|
||||||
System.out.println(aa);
|
// System.out.println(aa);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.csdevice.pojo.po.Overlimit;
|
|
||||||
import com.njcn.csdevice.pojo.vo.LineOverLimitVO;
|
import com.njcn.csdevice.pojo.vo.LineOverLimitVO;
|
||||||
import com.njcn.csdevice.service.IOverLimitService;
|
import com.njcn.csdevice.service.IOverLimitService;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
|||||||
@@ -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.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.param.IcdBzParam;
|
||||||
import com.njcn.csdevice.pojo.po.RStatIntegrityD;
|
import com.njcn.csdevice.pojo.po.RStatIntegrityD;
|
||||||
import com.njcn.csdevice.service.IRStatIntegrityDService;
|
import com.njcn.csdevice.service.IRStatIntegrityDService;
|
||||||
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
||||||
@@ -50,9 +51,9 @@ public class RStatIntegrityDController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ApiOperation("获取数据")
|
@ApiOperation("获取数据")
|
||||||
public HttpResult<List<RStatIntegrityD>> list(@Validated @RequestParam("list") List<String> list, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime){
|
public HttpResult<List<RStatIntegrityD>> list(@RequestBody @Validated IcdBzParam param){
|
||||||
String methodDescribe = getMethodDescribe("list");
|
String methodDescribe = getMethodDescribe("list");
|
||||||
List<RStatIntegrityD> result = irStatIntegrityDService.getData(list,startTime,endTime);
|
List<RStatIntegrityD> result = irStatIntegrityDService.getData(param.getLineList(),param.getStartTime(),param.getEndTime());
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, 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.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.param.IcdBzParam;
|
||||||
import com.njcn.csdevice.pojo.po.RStatOnlineRateD;
|
import com.njcn.csdevice.pojo.po.RStatOnlineRateD;
|
||||||
import com.njcn.csdevice.service.IRStatOnlineRateDService;
|
import com.njcn.csdevice.service.IRStatOnlineRateDService;
|
||||||
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
import com.njcn.csharmonic.pojo.param.StatisticsDataParam;
|
||||||
@@ -16,7 +17,10 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
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;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -50,9 +54,9 @@ public class RStatOnlineRateDController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ApiOperation("获取数据")
|
@ApiOperation("获取数据")
|
||||||
public HttpResult<List<RStatOnlineRateD>> list(@Validated @RequestParam("list") List<String> list, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime){
|
public HttpResult<List<RStatOnlineRateD>> list(@RequestBody @Validated IcdBzParam param){
|
||||||
String methodDescribe = getMethodDescribe("list");
|
String methodDescribe = getMethodDescribe("list");
|
||||||
List<RStatOnlineRateD> result = rStatOnlineRateDService.getData(list,startTime,endTime);
|
List<RStatOnlineRateD> result = rStatOnlineRateDService.getData(param.getLineList(),param.getStartTime(),param.getEndTime());
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.njcn.web.advice.DeviceLog;
|
|||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -77,11 +78,13 @@ public class DeviceUserController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/devCount")
|
@PostMapping("/devCount")
|
||||||
@ApiOperation("设备统计")
|
@ApiOperation("设备统计")
|
||||||
@ApiImplicitParam(name = "id", value = "工程id", required = true)
|
@ApiImplicitParams({
|
||||||
public HttpResult<DevCountVO> devCount(@RequestParam("id") String id){
|
@ApiImplicitParam(name = "id", value = "工程id"),
|
||||||
|
@ApiImplicitParam(name = "time", value = "时间")
|
||||||
|
})
|
||||||
|
public HttpResult<DevCountVO> devCount(@RequestParam("id") String id,@RequestParam("time") String time){
|
||||||
String methodDescribe = getMethodDescribe("devCount");
|
String methodDescribe = getMethodDescribe("devCount");
|
||||||
|
DevCountVO result = csDeviceUserPOService.devCount(id,time);
|
||||||
DevCountVO result = csDeviceUserPOService.devCount (id);
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,4 +164,14 @@ public class DeviceUserController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getList")
|
||||||
|
@ApiOperation("根据设备集合获取数据")
|
||||||
|
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||||
|
public HttpResult<List<CsDeviceUserPO>> getList(@RequestBody UserDevParam param){
|
||||||
|
String methodDescribe = getMethodDescribe("getList");
|
||||||
|
List<CsDeviceUserPO> list = csDeviceUserPOService.getList(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -303,6 +303,20 @@ public class EquipmentDeliveryController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/updateLedger")
|
||||||
|
@ApiOperation("更新设备预设工程和项目id")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "nDid", value = "网络设备码", required = true),
|
||||||
|
@ApiImplicitParam(name = "engineeringId", value = "工程id", required = true),
|
||||||
|
@ApiImplicitParam(name = "projectId", value = "项目id", required = true)
|
||||||
|
})
|
||||||
|
public HttpResult<String> updateLedger(@RequestParam("nDid") String nDid,@RequestParam("engineeringId") String engineeringId,@RequestParam("projectId") String projectId){
|
||||||
|
String methodDescribe = getMethodDescribe("updateLedger");
|
||||||
|
csEquipmentDeliveryService.updateLedger(nDid,engineeringId,projectId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/rebootDevice")
|
@PostMapping("/rebootDevice")
|
||||||
@ApiOperation("重启设备")
|
@ApiOperation("重启设备")
|
||||||
@@ -395,13 +409,14 @@ public class EquipmentDeliveryController extends BaseController {
|
|||||||
@PostMapping("/flipCldDevStatus")
|
@PostMapping("/flipCldDevStatus")
|
||||||
@ApiOperation("云前置设备状态翻转")
|
@ApiOperation("云前置设备状态翻转")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "date", value = "时间", required = true),
|
||||||
@ApiImplicitParam(name = "devId", value = "设备id", required = true),
|
@ApiImplicitParam(name = "devId", value = "设备id", required = true),
|
||||||
@ApiImplicitParam(name = "status", value = "状态", required = true)
|
@ApiImplicitParam(name = "status", value = "状态", required = true)
|
||||||
})
|
})
|
||||||
@ApiIgnore
|
@ApiIgnore
|
||||||
public HttpResult<Boolean> flipCldDevStatus(@RequestParam("devId") String devId, @RequestParam("status") Integer status){
|
public HttpResult<Boolean> flipCldDevStatus(@RequestParam("date") String date, @RequestParam("devId") String devId, @RequestParam("status") Integer status){
|
||||||
String methodDescribe = getMethodDescribe("flipCldDevStatus");
|
String methodDescribe = getMethodDescribe("flipCldDevStatus");
|
||||||
csEquipmentDeliveryService.flipCldDevStatus(devId,status);
|
csEquipmentDeliveryService.flipCldDevStatus(date,devId,status);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class IcdController extends BaseController {
|
|||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/bzFileByEventId")
|
@PostMapping("/bzFileByEventId")
|
||||||
@ApiOperation("指定事件补召波形")
|
@ApiOperation("指定事件补召波形指令下发")
|
||||||
@ApiImplicitParam(name = "eventId", value = "事件id", required = true)
|
@ApiImplicitParam(name = "eventId", value = "事件id", required = true)
|
||||||
public HttpResult<String> bzFileByEventId(@RequestParam String eventId){
|
public HttpResult<String> bzFileByEventId(@RequestParam String eventId){
|
||||||
String methodDescribe = getMethodDescribe("bzFileByEventId");
|
String methodDescribe = getMethodDescribe("bzFileByEventId");
|
||||||
@@ -77,7 +77,7 @@ public class IcdController extends BaseController {
|
|||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/bzEvent")
|
@PostMapping("/bzEvent")
|
||||||
@ApiOperation("补召事件")
|
@ApiOperation("补召事件指令下发")
|
||||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||||
public HttpResult<String> bzEvent(@RequestBody @Validated IcdBzParam param){
|
public HttpResult<String> bzEvent(@RequestBody @Validated IcdBzParam param){
|
||||||
String methodDescribe = getMethodDescribe("bzEvent");
|
String methodDescribe = getMethodDescribe("bzEvent");
|
||||||
@@ -87,7 +87,7 @@ public class IcdController extends BaseController {
|
|||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/bzFile")
|
@PostMapping("/bzFile")
|
||||||
@ApiOperation("补召波形")
|
@ApiOperation("补召波形指令下发")
|
||||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||||
public HttpResult<String> bzFile(@RequestBody @Validated IcdBzParam param){
|
public HttpResult<String> bzFile(@RequestBody @Validated IcdBzParam param){
|
||||||
String methodDescribe = getMethodDescribe("bzFile");
|
String methodDescribe = getMethodDescribe("bzFile");
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.njcn.csdevice.mapper.PqsDeviceUnitMapper;
|
|||||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
|
import com.njcn.csdevice.service.CsCommTerminalService;
|
||||||
import com.njcn.csdevice.service.CsDeviceUserPOService;
|
import com.njcn.csdevice.service.CsDeviceUserPOService;
|
||||||
import com.njcn.csdevice.service.CsEquipmentDeliveryService;
|
import com.njcn.csdevice.service.CsEquipmentDeliveryService;
|
||||||
import com.njcn.csdevice.service.CsLinePOService;
|
import com.njcn.csdevice.service.CsLinePOService;
|
||||||
@@ -47,13 +48,8 @@ import java.util.stream.Collectors;
|
|||||||
@Api(tags = "通用台账查询")
|
@Api(tags = "通用台账查询")
|
||||||
public class CsCommTerminalController extends BaseController {
|
public class CsCommTerminalController extends BaseController {
|
||||||
|
|
||||||
private final PqsDeviceUnitMapper pqsDeviceUnitMapper;
|
|
||||||
|
|
||||||
private final CsDeviceUserPOService csDeviceUserPOService;
|
private final CsCommTerminalService commTerminalService;
|
||||||
|
|
||||||
private final CsLinePOService csLinePOService;
|
|
||||||
private final UserFeignClient userFeignClient;
|
|
||||||
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户获取设备信息
|
* 根据用户获取设备信息
|
||||||
@@ -64,7 +60,7 @@ public class CsCommTerminalController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
||||||
public HttpResult<List<String>> getDevIdsByUser(@RequestParam("userId") String userId) {
|
public HttpResult<List<String>> getDevIdsByUser(@RequestParam("userId") String userId) {
|
||||||
String methodDescribe = getMethodDescribe("getDevIdsByUser");
|
String methodDescribe = getMethodDescribe("getDevIdsByUser");
|
||||||
List<String> devIds = commGetDevIds(userId);
|
List<String> devIds = commTerminalService.commGetDevIds(userId);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, devIds, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, devIds, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,19 +73,8 @@ public class CsCommTerminalController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
||||||
public HttpResult<List<String>> getLineIdsByUser(@RequestParam("userId") String userId) {
|
public HttpResult<List<String>> getLineIdsByUser(@RequestParam("userId") String userId) {
|
||||||
String methodDescribe = getMethodDescribe("getLineIdsByUser");
|
String methodDescribe = getMethodDescribe("getLineIdsByUser");
|
||||||
List<String> devIds = commGetDevIds(userId);
|
List<String> lineIds = commTerminalService.getLineIdsByUser(userId);
|
||||||
if(CollUtil.isNotEmpty(devIds)){
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineIds, methodDescribe);
|
||||||
List<CsLinePO> poList = csLinePOService.lambdaQuery().select(CsLinePO::getLineId).in(CsLinePO::getDeviceId,devIds)
|
|
||||||
.eq(CsLinePO::getStatus,DataStateEnum.ENABLE.getCode()).list();
|
|
||||||
if(CollUtil.isEmpty(poList)){
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Collections.emptyList(), methodDescribe);
|
|
||||||
}else {
|
|
||||||
List<String> result = poList.stream().map(CsLinePO::getLineId).distinct().collect(Collectors.toList());
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Collections.emptyList(), methodDescribe);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -101,37 +86,12 @@ public class CsCommTerminalController extends BaseController {
|
|||||||
@ApiOperation("根据登录用户id获取电能质量用户id集合")
|
@ApiOperation("根据登录用户id获取电能质量用户id集合")
|
||||||
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
||||||
public HttpResult<List<String>> getPqUserIdsByUser(@RequestParam("userId") String userId) {
|
public HttpResult<List<String>> getPqUserIdsByUser(@RequestParam("userId") String userId) {
|
||||||
String methodDescribe = getMethodDescribe("getPqUserIdsByUser");
|
String methodDescribe = getMethodDescribe("getLineIdsByUser");
|
||||||
|
List<String> lineIds = commTerminalService.getPqUserIdsByUser(userId);
|
||||||
List<String> devIds = commGetDevIds(userId);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineIds, methodDescribe);
|
||||||
if(CollUtil.isNotEmpty(devIds)){
|
|
||||||
List<CsLinePO> poList = csLinePOService.lambdaQuery().select(CsLinePO::getLineId,CsLinePO::getMonitorUser).in(CsLinePO::getDeviceId,devIds)
|
|
||||||
.eq(CsLinePO::getStatus,DataStateEnum.ENABLE.getCode()).list();
|
|
||||||
if(CollUtil.isEmpty(poList)){
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Collections.emptyList(), methodDescribe);
|
|
||||||
}else {
|
|
||||||
List<String> result = poList.stream().map(CsLinePO::getMonitorUser).distinct().collect(Collectors.toList());
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Collections.emptyList(), methodDescribe);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private List<String> commGetDevIds(String userId){
|
|
||||||
UserVO userVO = userFeignClient.getUserById(userId).getData();
|
|
||||||
List<String> devIds;
|
|
||||||
if(userVO.getType().equals(UserType.SUPER_ADMINISTRATOR ) || userVO.getType().equals(UserType.ADMINISTRATOR )){
|
|
||||||
devIds = csEquipmentDeliveryService.getAll().stream().map(CsEquipmentDeliveryPO::getId).collect(Collectors.toList());
|
|
||||||
}else {
|
|
||||||
List<CsDeviceUserPO> devList = csDeviceUserPOService.lambdaQuery().select(CsDeviceUserPO::getDeviceId)
|
|
||||||
.and(w->w.eq(CsDeviceUserPO::getPrimaryUserId,userId).or().eq(CsDeviceUserPO::getSubUserId,userId))
|
|
||||||
.eq(CsDeviceUserPO::getStatus, DataStateEnum.ENABLE.getCode()).list();
|
|
||||||
devIds = devList.stream().map(CsDeviceUserPO::getDeviceId).distinct().collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
return devIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过监测点获取监测点数据单位
|
* 通过监测点获取监测点数据单位
|
||||||
@@ -144,11 +104,7 @@ public class CsCommTerminalController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "lineId", value = "实体", required = true)
|
@ApiImplicitParam(name = "lineId", value = "实体", required = true)
|
||||||
public HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId) {
|
public HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId) {
|
||||||
String methodDescribe = getMethodDescribe("lineUnitDetail");
|
String methodDescribe = getMethodDescribe("lineUnitDetail");
|
||||||
|
PqsDeviceUnit pqsDeviceUnit = commTerminalService.lineUnitDetail(lineId);
|
||||||
PqsDeviceUnit pqsDeviceUnit = pqsDeviceUnitMapper.selectById(lineId);
|
|
||||||
if(Objects.isNull(pqsDeviceUnit)){
|
|
||||||
pqsDeviceUnit = new PqsDeviceUnit();
|
|
||||||
}
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnit, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnit, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,18 +54,29 @@ public class CsLedgerController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/lineTree")
|
@PostMapping("/lineTree")
|
||||||
@ApiOperation("五层设备树(监测点层,根节点为治理设备和便携式设备)")
|
@ApiOperation("五层设备树(监测点层,根节点为治理设备和便携式设备)")
|
||||||
public HttpResult<List<CsLedgerVO>> lineTree(){
|
@ApiImplicitParam(name = "type", value = "台账树类型")
|
||||||
|
public HttpResult<List<CsLedgerVO>> lineTree(@RequestParam(required = false) @Validated String type){
|
||||||
String methodDescribe = getMethodDescribe("lineTree");
|
String methodDescribe = getMethodDescribe("lineTree");
|
||||||
List<CsLedgerVO> list = csLedgerService.getLineTree();
|
List<CsLedgerVO> list = csLedgerService.getLineTree(type);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/AppLineTree")
|
||||||
|
@ApiOperation("app端监测点树")
|
||||||
|
public HttpResult<List<CsLedgerVO>> appLineTree(){
|
||||||
|
String methodDescribe = getMethodDescribe("AppLineTree");
|
||||||
|
List<CsLedgerVO> list = csLedgerService.appLineTree();
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/deviceTree")
|
@PostMapping("/deviceTree")
|
||||||
@ApiOperation("四层设备树(装置层,根节点为治理设备和便携式设备)")
|
@ApiOperation("四层设备树(装置层,根节点为治理设备和便携式设备)")
|
||||||
public HttpResult<List<CsLedgerVO>> getDeviceTree(){
|
@ApiImplicitParam(name = "type", value = "台账树类型")
|
||||||
|
public HttpResult<List<CsLedgerVO>> getDeviceTree(@RequestParam(required = false) @Validated String type){
|
||||||
String methodDescribe = getMethodDescribe("getDeviceTree");
|
String methodDescribe = getMethodDescribe("getDeviceTree");
|
||||||
List<CsLedgerVO> list = csLedgerService.getDeviceTree();
|
List<CsLedgerVO> list = csLedgerService.getDeviceTree(type);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,6 +89,16 @@ public class CsLedgerController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/objTree")
|
||||||
|
@ApiOperation("三层对象用户树")
|
||||||
|
public HttpResult<List<CsLedgerVO>> objTree(){
|
||||||
|
String methodDescribe = getMethodDescribe("getProjectTree");
|
||||||
|
List<CsLedgerVO> list = csLedgerService.objTree();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增台账信息")
|
@ApiOperation("新增台账信息")
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.njcn.csdevice.controller.line;
|
package com.njcn.csdevice.controller.line;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
@@ -8,14 +7,15 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.csdevice.mapper.OverlimitMapper;
|
import com.njcn.csdevice.pojo.dto.CsLineDTO;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
||||||
import com.njcn.csdevice.pojo.po.Overlimit;
|
|
||||||
import com.njcn.csdevice.pojo.vo.PqSensitiveUserLineVO;
|
import com.njcn.csdevice.pojo.vo.PqSensitiveUserLineVO;
|
||||||
import com.njcn.csdevice.service.CsLinePOService;
|
import com.njcn.csdevice.service.CsLinePOService;
|
||||||
import com.njcn.csdevice.utils.COverlimitUtil;
|
import com.njcn.device.biz.mapper.OverLimitWlMapper;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
|
import com.njcn.device.biz.utils.COverlimitUtil;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import com.njcn.web.pojo.param.BaseParam;
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
@@ -28,6 +28,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
@@ -44,7 +45,7 @@ import java.util.List;
|
|||||||
public class CslineController extends BaseController {
|
public class CslineController extends BaseController {
|
||||||
|
|
||||||
private final CsLinePOService csLinePOService;
|
private final CsLinePOService csLinePOService;
|
||||||
private final OverlimitMapper overlimitMapper;
|
private final OverLimitWlMapper overLimitWlMapper;
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/queryLineById")
|
@PostMapping("/queryLineById")
|
||||||
@@ -87,8 +88,8 @@ public class CslineController extends BaseController {
|
|||||||
for(CsLinePO csLinePO: list){
|
for(CsLinePO csLinePO: list){
|
||||||
Overlimit overlimit = COverlimitUtil.globalAssemble(csLinePO.getVolGrade().floatValue(),10f,10f,10f,0,1);
|
Overlimit overlimit = COverlimitUtil.globalAssemble(csLinePO.getVolGrade().floatValue(),10f,10f,10f,0,1);
|
||||||
overlimit.setId(csLinePO.getLineId());
|
overlimit.setId(csLinePO.getLineId());
|
||||||
overlimitMapper.deleteById(csLinePO.getLineId());
|
overLimitWlMapper.deleteById(csLinePO.getLineId());
|
||||||
overlimitMapper.insert(overlimit);
|
overLimitWlMapper.insert(overlimit);
|
||||||
}
|
}
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
@@ -104,6 +105,17 @@ public class CslineController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineList, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineList, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/getCustomDetailByLineId")
|
||||||
|
@ApiOperation("根据id查询监测点")
|
||||||
|
public HttpResult<Map<String,String>> getCustomDetailByLineId(@RequestParam String id){
|
||||||
|
String methodDescribe = getMethodDescribe("getCustomDetailByLineId");
|
||||||
|
Map<String,String> map = csLinePOService.getCustomDetailByLineId(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, map, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/updateLine")
|
@PostMapping("/updateLine")
|
||||||
@ApiOperation("修改监测点信息")
|
@ApiOperation("修改监测点信息")
|
||||||
@@ -144,7 +156,17 @@ public class CslineController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "ids", value = "监测点id集合", required = true)
|
@ApiImplicitParam(name = "ids", value = "监测点id集合", required = true)
|
||||||
public HttpResult<List<Overlimit>> getOverLimitData(@RequestBody List<String> ids) {
|
public HttpResult<List<Overlimit>> getOverLimitData(@RequestBody List<String> ids) {
|
||||||
String methodDescribe = getMethodDescribe("getOverLimitDataByIds");
|
String methodDescribe = getMethodDescribe("getOverLimitDataByIds");
|
||||||
List<Overlimit> result = overlimitMapper.selectBatchIds(ids);
|
List<Overlimit> result = overLimitWlMapper.selectBatchIds(ids);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getOverLimitData")
|
||||||
|
@ApiOperation("根据监测点id获取国标限值")
|
||||||
|
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||||
|
public HttpResult<Overlimit> getOverLimitData(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("getOverLimitData");
|
||||||
|
Overlimit result = overLimitWlMapper.selectById(id);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,10 +198,10 @@ public class CslineController extends BaseController {
|
|||||||
String methodDescribe = getMethodDescribe("addCldLine");
|
String methodDescribe = getMethodDescribe("addCldLine");
|
||||||
csLinePOService.addCldLine(param);
|
csLinePOService.addCldLine(param);
|
||||||
//新增监测点限值
|
//新增监测点限值
|
||||||
Overlimit overlimit = COverlimitUtil.globalAssemble(param.getVolGrade().floatValue(),10f,10f,10f,0,1);
|
Overlimit overlimit = COverlimitUtil.globalAssemble(param.getVolGrade().floatValue(),param.getProtocolCapacity().floatValue(),param.getDevCapacity().floatValue(),param.getShortCircuitCapacity().floatValue(),0,0);
|
||||||
overlimit.setId(param.getLineId());
|
overlimit.setId(param.getLineId());
|
||||||
overlimitMapper.deleteById(param.getLineId());
|
overLimitWlMapper.deleteById(param.getLineId());
|
||||||
overlimitMapper.insert(overlimit);
|
overLimitWlMapper.insert(overlimit);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,10 +213,10 @@ public class CslineController extends BaseController {
|
|||||||
String methodDescribe = getMethodDescribe("updateCldLine");
|
String methodDescribe = getMethodDescribe("updateCldLine");
|
||||||
csLinePOService.updateCldLine(param);
|
csLinePOService.updateCldLine(param);
|
||||||
//修改监测点限值
|
//修改监测点限值
|
||||||
Overlimit overlimit = COverlimitUtil.globalAssemble(param.getVolGrade().floatValue(),10f,10f,10f,0,1);
|
Overlimit overlimit = COverlimitUtil.globalAssemble(param.getVolGrade().floatValue(),param.getProtocolCapacity().floatValue(),param.getDevCapacity().floatValue(),param.getShortCircuitCapacity().floatValue(),0,0);
|
||||||
overlimit.setId(param.getLineId());
|
overlimit.setId(param.getLineId());
|
||||||
overlimitMapper.deleteById(param.getLineId());
|
overLimitWlMapper.deleteById(param.getLineId());
|
||||||
overlimitMapper.insert(overlimit);
|
overLimitWlMapper.insert(overlimit);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,6 +227,7 @@ public class CslineController extends BaseController {
|
|||||||
public HttpResult<List<CsLinePO>> delCldLine(@RequestParam("id") String id) {
|
public HttpResult<List<CsLinePO>> delCldLine(@RequestParam("id") String id) {
|
||||||
String methodDescribe = getMethodDescribe("delCldLine");
|
String methodDescribe = getMethodDescribe("delCldLine");
|
||||||
csLinePOService.deleteCldLine(id);
|
csLinePOService.deleteCldLine(id);
|
||||||
|
overLimitWlMapper.deleteById(id);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,6 +255,15 @@ public class CslineController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getAllLineDetail")
|
||||||
|
@ApiOperation("获取所有监测点id详情")
|
||||||
|
public HttpResult<List<CsLineDTO>> getAllLineDetail(){
|
||||||
|
String methodDescribe = getMethodDescribe("getAllLineDetail");
|
||||||
|
List<CsLineDTO> list = csLinePOService.getAllLineDetail();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@GetMapping("/getSimpleLine")
|
@GetMapping("/getSimpleLine")
|
||||||
@ApiOperation("查询登录用户拥有的监测点台账")
|
@ApiOperation("查询登录用户拥有的监测点台账")
|
||||||
@@ -258,10 +290,7 @@ public class CslineController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "param", value = "param", required = true)
|
@ApiImplicitParam(name = "param", value = "param", required = true)
|
||||||
public HttpResult<List<CsLinePO>> list(@RequestBody CsLinePO param) {
|
public HttpResult<List<CsLinePO>> list(@RequestBody CsLinePO param) {
|
||||||
String methodDescribe = getMethodDescribe("list");
|
String methodDescribe = getMethodDescribe("list");
|
||||||
List<CsLinePO> list = csLinePOService.list(new LambdaQueryWrapper<CsLinePO>()
|
List<CsLinePO> list = csLinePOService.getLineList(param);
|
||||||
.eq(CsLinePO::getStatus, 1)
|
|
||||||
.eq(StrUtil.isNotBlank(param.getPosition()), CsLinePO::getPosition, param.getPosition())
|
|
||||||
.orderByAsc(CsLinePO::getName));
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,7 +309,7 @@ public class CslineController extends BaseController {
|
|||||||
@ApiOperation("获取敏感负荷用户监测点列表")
|
@ApiOperation("获取敏感负荷用户监测点列表")
|
||||||
@ApiImplicitParam(name = "param", value = "查询参数", required = true)
|
@ApiImplicitParam(name = "param", value = "查询参数", required = true)
|
||||||
public HttpResult<Page<PqSensitiveUserLineVO>> getSensitiveUserLineList(@RequestBody BaseParam param) {
|
public HttpResult<Page<PqSensitiveUserLineVO>> getSensitiveUserLineList(@RequestBody BaseParam param) {
|
||||||
String methodDescribe = getMethodDescribe("getList");
|
String methodDescribe = getMethodDescribe("getSensitiveUserLineList");
|
||||||
Page<PqSensitiveUserLineVO> page = csLinePOService.getSensitiveUserLineList(param);
|
Page<PqSensitiveUserLineVO> page = csLinePOService.getSensitiveUserLineList(param);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.njcn.csdevice.controller.project;
|
package com.njcn.csdevice.controller.project;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
@@ -66,11 +65,11 @@ public class AppProjectController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/addAppProject")
|
@PostMapping("/addAppProject")
|
||||||
@ApiOperation("新增项目")
|
@ApiOperation("新增项目")
|
||||||
public HttpResult<Boolean> addAppProject(@Validated AppProjectAddParm appProjectAddParm){
|
public HttpResult<AppProjectPO> addAppProject(@Validated @RequestBody AppProjectAddParm appProjectAddParm){
|
||||||
String methodDescribe = getMethodDescribe("addAppProject");
|
String methodDescribe = getMethodDescribe("addAppProject");
|
||||||
|
|
||||||
AppProjectPO po = appProjectService.addAppProject(appProjectAddParm);
|
AppProjectPO po = appProjectService.addAppProject(appProjectAddParm);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, ObjectUtil.isNotNull(po), methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||||
}
|
}
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/auditAppProject")
|
@PostMapping("/auditAppProject")
|
||||||
@@ -91,4 +90,14 @@ public class AppProjectController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getProjectByName")
|
||||||
|
@ApiOperation("根据项目名称获取项目信息")
|
||||||
|
@ApiImplicitParam(name = "name", value = "项目名称", required = true)
|
||||||
|
public HttpResult<AppProjectPO> getProjectByName(@RequestParam("name") String name){
|
||||||
|
String methodDescribe = getMethodDescribe("getProjectByName");
|
||||||
|
AppProjectPO po = appProjectService.getProjectByName(name);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,4 +99,13 @@ public class CsMarketDataController extends BaseController {
|
|||||||
List<CsMarketDataVO> list = csMarketDataService.queryAllEnginner(userId);
|
List<CsMarketDataVO> list = csMarketDataService.queryAllEnginner(userId);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/insert")
|
||||||
|
@ApiOperation("根据用户、工程新增数据")
|
||||||
|
public HttpResult<Boolean> insertData(@RequestParam("userId")String userId, @RequestParam("engineeringId")String engineeringId){
|
||||||
|
String methodDescribe = getMethodDescribe("insertData");
|
||||||
|
Boolean result = csMarketDataService.insertData(userId,engineeringId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.njcn.csdevice.controller.project;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.param.CsUserPinsParam;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsUserPins;
|
||||||
|
import com.njcn.csdevice.service.ICsUserPinsService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户置顶表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2026-03-04
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/csUserPins")
|
||||||
|
@Api(tags = "置顶设备(工程)")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CsUserPinsController extends BaseController {
|
||||||
|
|
||||||
|
private final ICsUserPinsService csUserPinsService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/engineeringPinToTop")
|
||||||
|
@ApiOperation("用户置顶工程(取消置顶)")
|
||||||
|
public HttpResult<Boolean> engineeringPinToTop(@Validated @RequestBody CsUserPinsParam param){
|
||||||
|
String methodDescribe = getMethodDescribe("engineeringPinToTop");
|
||||||
|
Boolean result = csUserPinsService.engineeringPinToTop(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getPinToTopList")
|
||||||
|
@ApiOperation("获取用户置顶设备(工程)")
|
||||||
|
public HttpResult<List<CsUserPins>> getPinToTopList(){
|
||||||
|
String methodDescribe = getMethodDescribe("getPinToTopList");
|
||||||
|
List<CsUserPins> result = csUserPinsService.getPinToTopList();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -11,8 +11,6 @@ import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
|||||||
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
||||||
import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
||||||
import com.njcn.csdevice.pojo.po.CsEngineeringPO;
|
import com.njcn.csdevice.pojo.po.CsEngineeringPO;
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
|
||||||
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
||||||
import com.njcn.csdevice.service.CsEngineeringService;
|
import com.njcn.csdevice.service.CsEngineeringService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
@@ -105,4 +103,15 @@ public class EngineeringController extends BaseController {
|
|||||||
List<CsEngineeringPO> result = csEngineeringService.getUnlinkedEngineering(userId);
|
List<CsEngineeringPO> result = csEngineeringService.getUnlinkedEngineering(userId);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getEngineeringByName")
|
||||||
|
@ApiOperation("根据工程名称获取工程信息")
|
||||||
|
@ApiImplicitParam(name = "name", value = "工程名称", required = true)
|
||||||
|
public HttpResult<CsEngineeringPO> getEngineeringByName(@RequestParam("name") String name){
|
||||||
|
String methodDescribe = getMethodDescribe("getEngineeringByName");
|
||||||
|
CsEngineeringPO po = csEngineeringService.getEngineeringByName(name);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package com.njcn.csdevice.controller.project;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.pojo.param.AppProjectAddParm;
|
||||||
|
import com.njcn.csdevice.pojo.param.AppProjectAuditParm;
|
||||||
|
import com.njcn.csdevice.pojo.param.CsEngineeringAddParm;
|
||||||
|
import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
||||||
|
import com.njcn.csdevice.pojo.vo.EngineeringProjectRelationVo;
|
||||||
|
import com.njcn.csdevice.service.IEngineeringProjectService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
* @date 2026/1/29
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/engineeringProjectRelation")
|
||||||
|
@Api(tags = " 工程信息管理(不分权限)")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class EngineeringProjectController extends BaseController {
|
||||||
|
|
||||||
|
private final IEngineeringProjectService csEngineeringService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/addEngineering")
|
||||||
|
@ApiOperation("新增工程信息")
|
||||||
|
public HttpResult<Boolean> addEngineering(@Validated @RequestBody CsEngineeringAddParm csEngineeringAddParm){
|
||||||
|
String methodDescribe = getMethodDescribe("addEngineering");
|
||||||
|
boolean result = csEngineeringService.addEngineering(csEngineeringAddParm);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/updateEngineering")
|
||||||
|
@ApiOperation("修改工程信息")
|
||||||
|
public HttpResult<Boolean> updateEngineering(@Validated @RequestBody CsEngineeringAuditParm csEngineeringAuditParm){
|
||||||
|
String methodDescribe = getMethodDescribe("updateEngineering");
|
||||||
|
boolean result = csEngineeringService.updateEngineering(csEngineeringAuditParm);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/deleteEngineering")
|
||||||
|
@ApiOperation("删除工程信息")
|
||||||
|
public HttpResult<Boolean> deleteEngineering(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("deleteEngineering");
|
||||||
|
boolean result = csEngineeringService.deleteEngineering(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/addProject")
|
||||||
|
@ApiOperation("新增项目信息")
|
||||||
|
public HttpResult<Boolean> addProject(@Validated @RequestBody AppProjectAddParm param){
|
||||||
|
String methodDescribe = getMethodDescribe("addProject");
|
||||||
|
boolean result = csEngineeringService.addProject(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/updateProject")
|
||||||
|
@ApiOperation("修改项目信息")
|
||||||
|
public HttpResult<Boolean> updateProject(@Validated @RequestBody AppProjectAuditParm param){
|
||||||
|
String methodDescribe = getMethodDescribe("updateProject");
|
||||||
|
boolean result = csEngineeringService.updateProject(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/deleteProject")
|
||||||
|
@ApiOperation("删除项目信息")
|
||||||
|
public HttpResult<Boolean> deleteProject(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("deleteProject");
|
||||||
|
boolean result = csEngineeringService.deleteProject(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ApiOperation("查询工程信息列表")
|
||||||
|
public HttpResult<List<EngineeringProjectRelationVo>> getList(){
|
||||||
|
String methodDescribe = getMethodDescribe("getList");
|
||||||
|
List<EngineeringProjectRelationVo> result = csEngineeringService.getList();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,9 @@ package com.njcn.csdevice.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -12,4 +15,17 @@ import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
|||||||
* @version V1.0.0
|
* @version V1.0.0
|
||||||
*/
|
*/
|
||||||
public interface CsDeviceUserPOMapper extends BaseMapper<CsDeviceUserPO> {
|
public interface CsDeviceUserPOMapper extends BaseMapper<CsDeviceUserPO> {
|
||||||
|
|
||||||
|
//查询暂态事件(未读)
|
||||||
|
int queryTempEvent(@Param("userId") String userId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("ids") List<String> ids);
|
||||||
|
|
||||||
|
//查询稳态事件(未读)
|
||||||
|
int queryTempHarmonic(@Param("userId") String userId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("ids") List<String> ids);
|
||||||
|
|
||||||
|
//查询告警事件(未读)
|
||||||
|
int queryAlarmEvent(@Param("userId") String userId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("ids") List<String> ids);
|
||||||
|
|
||||||
|
//查询运行事件(未读)
|
||||||
|
int queryRunEvent(@Param("userId") String userId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("ids") List<String> ids);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.njcn.csdevice.mapper;
|
package com.njcn.csdevice.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.csdevice.pojo.dto.CsLineDTO;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -17,4 +19,9 @@ import java.util.List;
|
|||||||
public interface CsLinePOMapper extends BaseMapper<CsLinePO> {
|
public interface CsLinePOMapper extends BaseMapper<CsLinePO> {
|
||||||
|
|
||||||
List<CsLinePO> findByNdid(@Param("id") String id);
|
List<CsLinePO> findByNdid(@Param("id") String id);
|
||||||
|
|
||||||
|
|
||||||
|
Map<String,String> getCustomDetailByLineId(@Param("lineId")String lineId);
|
||||||
|
|
||||||
|
List<CsLineDTO> findLineList();
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.csdevice.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsUserPins;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户置顶表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2026-03-04
|
||||||
|
*/
|
||||||
|
public interface CsUserPinsMapper extends BaseMapper<CsUserPins> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package com.njcn.csdevice.mapper;
|
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.njcn.csdevice.pojo.po.Overlimit;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Mapper 接口
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author cdf
|
|
||||||
* @since 2022-01-04
|
|
||||||
*/
|
|
||||||
@DS("sjzx")
|
|
||||||
@Mapper
|
|
||||||
public interface OverlimitMapper extends BaseMapper<Overlimit> {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -45,6 +45,7 @@
|
|||||||
<if test="temp!=null and temp.searchValue != null and temp.searchValue !=''">
|
<if test="temp!=null and temp.searchValue != null and temp.searchValue !=''">
|
||||||
AND a.`name` like concat('%',#{temp.searchValue},'%')
|
AND a.`name` like concat('%',#{temp.searchValue},'%')
|
||||||
</if>
|
</if>
|
||||||
|
AND a.`name` != '便携式项目'
|
||||||
order by a.create_time desc
|
order by a.create_time desc
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -16,4 +16,72 @@
|
|||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
primary_user_id, sub_user_id, device_id, create_by, create_time, update_by, update_time
|
primary_user_id, sub_user_id, device_id, create_by, create_time, update_by, update_time
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="queryTempEvent" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
COUNT(1)
|
||||||
|
FROM
|
||||||
|
cs_event_user t1 right join cs_event t2 on t1.event_id = t2.id
|
||||||
|
WHERE
|
||||||
|
t1.user_id = #{userId}
|
||||||
|
and t1.`status`= 0
|
||||||
|
and t2.type = 0
|
||||||
|
<if test="ids != null and ids.size > 0">
|
||||||
|
and t2.line_id in
|
||||||
|
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="queryAlarmEvent" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
COUNT(1)
|
||||||
|
FROM
|
||||||
|
cs_event_user t1 right join cs_alarm t2 on t1.event_id = t2.id
|
||||||
|
WHERE
|
||||||
|
t1.user_id = #{userId}
|
||||||
|
and t1.`status`= 0
|
||||||
|
<if test="ids != null and ids.size > 0">
|
||||||
|
and (
|
||||||
|
<foreach collection="ids" item="tag" separator=" OR ">
|
||||||
|
FIND_IN_SET(#{tag}, t2.dev_list) > 0
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="queryRunEvent" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
COUNT(1)
|
||||||
|
FROM
|
||||||
|
cs_event_user t1 right join cs_event t2 on t1.event_id = t2.id
|
||||||
|
WHERE
|
||||||
|
t1.user_id = #{userId}
|
||||||
|
and t1.`status`= 0
|
||||||
|
and t2.type = 2
|
||||||
|
<if test="ids != null and ids.size > 0">
|
||||||
|
and t2.device_id in
|
||||||
|
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="queryTempHarmonic" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
COUNT(1)
|
||||||
|
FROM
|
||||||
|
cs_event_user t1 right join cs_harmonic t2 on t1.event_id = t2.id
|
||||||
|
WHERE
|
||||||
|
t1.user_id = #{userId}
|
||||||
|
and t1.`status`= 0
|
||||||
|
<if test="ids != null and ids.size > 0">
|
||||||
|
and t2.line_id in
|
||||||
|
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -41,7 +41,9 @@
|
|||||||
c.create_time createTime,
|
c.create_time createTime,
|
||||||
c.run_status,
|
c.run_status,
|
||||||
c.mac mac,
|
c.mac mac,
|
||||||
c.process process
|
c.process process,
|
||||||
|
c.sort sort,
|
||||||
|
c.dev_type devType
|
||||||
FROM
|
FROM
|
||||||
(select * from cs_ledger where LEVEL = 0 and State =1
|
(select * from cs_ledger where LEVEL = 0 and State =1
|
||||||
) a,
|
) a,
|
||||||
@@ -97,9 +99,14 @@
|
|||||||
<if test="queryParam.process != null and queryParam.process !=''">
|
<if test="queryParam.process != null and queryParam.process !=''">
|
||||||
and process = #{queryParam.process}
|
and process = #{queryParam.process}
|
||||||
</if>
|
</if>
|
||||||
<if test="queryParam.runStatus != null and queryParam.runStatus !=''">
|
<choose>
|
||||||
and run_status = #{queryParam.runStatus}
|
<when test="queryParam.runStatus != null and queryParam.runStatus != ''">
|
||||||
</if>
|
AND run_status = #{queryParam.runStatus}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
AND run_status IN (1,2)
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
<if test="queryParam.searchValue != null and queryParam.searchValue !=''">
|
<if test="queryParam.searchValue != null and queryParam.searchValue !=''">
|
||||||
and (name like concat('%',#{queryParam.searchValue},'%') or ndid like concat('%',#{queryParam.searchValue},'%'))
|
and (name like concat('%',#{queryParam.searchValue},'%') or ndid like concat('%',#{queryParam.searchValue},'%'))
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -33,4 +33,35 @@
|
|||||||
where
|
where
|
||||||
t0.ndid = #{id}
|
t0.ndid = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getCustomDetailByLineId" resultType="map">
|
||||||
|
SELECT
|
||||||
|
line.line_id as lineId,
|
||||||
|
line.name as lineName,
|
||||||
|
concat(round(line.pt_ratio,0), ':', round(IFNULL(line.pt2_ratio, 1), 0)) as pt,
|
||||||
|
concat(round(line.ct_ratio,0), ':', round(IFNULL(line.ct2_ratio, 1), 0)) as ct,
|
||||||
|
line.dev_capacity as Dev_Capacity,
|
||||||
|
line.short_circuit_capacity as Short_Capacity,
|
||||||
|
line.basic_capacity as Standard_Capacity,
|
||||||
|
line.protocol_capacity as Deal_Capacity,
|
||||||
|
line.vol_grade AS voltageLevel,
|
||||||
|
dataSet.data_level AS level
|
||||||
|
FROM
|
||||||
|
cs_line line
|
||||||
|
left JOIN cs_data_set dataSet on line.data_set_id = dataSet.id
|
||||||
|
WHERE
|
||||||
|
line.line_id = #{lineId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findLineList" resultType="com.njcn.csdevice.pojo.dto.CsLineDTO">
|
||||||
|
SELECT
|
||||||
|
t1.*,
|
||||||
|
t2.dev_type deviceType
|
||||||
|
FROM
|
||||||
|
cs_line t1
|
||||||
|
LEFT JOIN cs_equipment_delivery t2 ON t1.device_id = t2.id
|
||||||
|
WHERE
|
||||||
|
t1.`status` = 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -55,4 +55,14 @@ public interface AppProjectService extends IService<AppProjectPO> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<AppProjectPO> getProjectByEngineering(List<String> list);
|
List<AppProjectPO> getProjectByEngineering(List<String> list);
|
||||||
|
|
||||||
|
|
||||||
|
AppProjectPO add(AppProjectAddParm param);
|
||||||
|
|
||||||
|
AppProjectPO updateData(AppProjectAuditParm param);
|
||||||
|
|
||||||
|
boolean delete(String id);
|
||||||
|
|
||||||
|
AppProjectPO getProjectByName(String name);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,4 +56,6 @@ public interface AppTopologyDiagramService extends IService<AppTopologyDiagramPO
|
|||||||
IPage<AppTopologyDiagramVO> queryTopologyDiagramPage(AppTopologyDiagramQueryPageParm appTopologyDiagramQueryPageParm);
|
IPage<AppTopologyDiagramVO> queryTopologyDiagramPage(AppTopologyDiagramQueryPageParm appTopologyDiagramQueryPageParm);
|
||||||
|
|
||||||
Boolean checkCanDelete(String id);
|
Boolean checkCanDelete(String id);
|
||||||
|
|
||||||
|
AppTopologyDiagramPO getByProjectId(String projectId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.njcn.csdevice.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface CsCommTerminalService {
|
||||||
|
|
||||||
|
List<String> getLineIdsByUser(String userId);
|
||||||
|
|
||||||
|
List<String> getPqUserIdsByUser(String userId);
|
||||||
|
|
||||||
|
PqsDeviceUnit lineUnitDetail(String lineId);
|
||||||
|
|
||||||
|
List<String> commGetDevIds(String userId);
|
||||||
|
}
|
||||||
@@ -23,7 +23,7 @@ public interface CsDeviceUserPOService extends IService<CsDeviceUserPO>{
|
|||||||
|
|
||||||
Boolean share(List<String> ids);
|
Boolean share(List<String> ids);
|
||||||
|
|
||||||
DevCountVO devCount(String id);
|
DevCountVO devCount(String id,String time);
|
||||||
|
|
||||||
String isPrimaryUser(String deviceId);
|
String isPrimaryUser(String deviceId);
|
||||||
|
|
||||||
@@ -53,4 +53,6 @@ public interface CsDeviceUserPOService extends IService<CsDeviceUserPO>{
|
|||||||
List<String> findDevByUserId(String userId);
|
List<String> findDevByUserId(String userId);
|
||||||
|
|
||||||
void channelDevByUserId(UserDevParam param);
|
void channelDevByUserId(UserDevParam param);
|
||||||
|
|
||||||
|
List<CsDeviceUserPO> getList(UserDevParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,4 +59,13 @@ public interface CsEngineeringService extends IService<CsEngineeringPO>{
|
|||||||
CsEngineeringPO queryEngineeringById(String id);
|
CsEngineeringPO queryEngineeringById(String id);
|
||||||
|
|
||||||
List<CsEngineeringPO> getUnlinkedEngineering(String userId);
|
List<CsEngineeringPO> getUnlinkedEngineering(String userId);
|
||||||
|
|
||||||
|
CsEngineeringPO add(CsEngineeringAddParm csEngineeringAddParm);
|
||||||
|
|
||||||
|
CsEngineeringPO updateData(CsEngineeringAuditParm csEngineeringAuditParm);
|
||||||
|
|
||||||
|
boolean deleteData(String id);
|
||||||
|
|
||||||
|
CsEngineeringPO getEngineeringByName(String name);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,6 +122,8 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
|||||||
*/
|
*/
|
||||||
void updateModuleNumber(String nDid, Integer number);
|
void updateModuleNumber(String nDid, Integer number);
|
||||||
|
|
||||||
|
void updateLedger(String nDid,String engineeringId,String projectId);
|
||||||
|
|
||||||
boolean rebootDevice(String nDid);
|
boolean rebootDevice(String nDid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -179,10 +181,11 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据设备id和状态来修改设备运行状态;同时修改设备下的监测点的状态
|
* 根据设备id和状态来修改设备运行状态;同时修改设备下的监测点的状态
|
||||||
|
* @param date
|
||||||
* @param devId
|
* @param devId
|
||||||
* @param status
|
* @param status
|
||||||
*/
|
*/
|
||||||
void flipCldDevStatus(String devId, Integer status);
|
void flipCldDevStatus(String date, String devId, Integer status);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据项目id获取设备列表
|
* 根据项目id获取设备列表
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.njcn.csdevice.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.csdevice.pojo.dto.CsLineDTO;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
import com.njcn.csdevice.pojo.vo.LineDetailDataVO;
|
||||||
@@ -10,6 +11,7 @@ import com.njcn.web.pojo.param.BaseParam;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -39,6 +41,9 @@ public interface CsLinePOService extends IService<CsLinePO>{
|
|||||||
*/
|
*/
|
||||||
List<CsLinePO> findByNdid(String id);
|
List<CsLinePO> findByNdid(String id);
|
||||||
|
|
||||||
|
|
||||||
|
Map<String,String> getCustomDetailByLineId(String lineId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新监测点信息
|
* 更新监测点信息
|
||||||
* @param csLineParam
|
* @param csLineParam
|
||||||
@@ -77,6 +82,8 @@ public interface CsLinePOService extends IService<CsLinePO>{
|
|||||||
|
|
||||||
List<String> getAllLine();
|
List<String> getAllLine();
|
||||||
|
|
||||||
|
List<CsLineDTO> getAllLineDetail();
|
||||||
|
|
||||||
List<CsLinePO> getSimpleLine();
|
List<CsLinePO> getSimpleLine();
|
||||||
|
|
||||||
List<CsLinePO> getLineBySensitiveUser(List<String> list);
|
List<CsLinePO> getLineBySensitiveUser(List<String> list);
|
||||||
@@ -91,4 +98,6 @@ public interface CsLinePOService extends IService<CsLinePO>{
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
LineDetailDataVO getLineDetailData(String id);
|
LineDetailDataVO getLineDetailData(String id);
|
||||||
|
|
||||||
|
List<CsLinePO> getLineList(CsLinePO param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,4 +30,6 @@ public interface CsMarketDataService extends IService<CsMarketData> {
|
|||||||
List<CsMarketDataVO> queryAllEnginner(String userId);
|
List<CsMarketDataVO> queryAllEnginner(String userId);
|
||||||
|
|
||||||
Boolean follow(EngineerIdParam engineerIdParams);
|
Boolean follow(EngineerIdParam engineerIdParams);
|
||||||
|
|
||||||
|
Boolean insertData(String userId,String engineeringId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,13 +29,15 @@ public interface ICsLedgerService extends IService<CsLedger> {
|
|||||||
* 获取终端台账树
|
* 获取终端台账树
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<CsLedgerVO> getLineTree();
|
List<CsLedgerVO> getLineTree(String type);
|
||||||
|
|
||||||
|
List<CsLedgerVO> appLineTree();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 终端三层树
|
* 终端三层树
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<CsLedgerVO> getDeviceTree();
|
List<CsLedgerVO> getDeviceTree(String type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增台账数据
|
* 新增台账数据
|
||||||
@@ -77,6 +79,9 @@ public interface ICsLedgerService extends IService<CsLedger> {
|
|||||||
|
|
||||||
List<CsLedgerVO> getztProjectTree();
|
List<CsLedgerVO> getztProjectTree();
|
||||||
|
|
||||||
|
|
||||||
|
List<CsLedgerVO> objTree();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据设备集合获取项目和工程
|
* 根据设备集合获取项目和工程
|
||||||
* @param id
|
* @param id
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.njcn.csdevice.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.csdevice.param.CsUserPinsParam;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsUserPins;
|
||||||
|
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户置顶表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2026-03-04
|
||||||
|
*/
|
||||||
|
public interface ICsUserPinsService extends IService<CsUserPins> {
|
||||||
|
|
||||||
|
boolean engineeringPinToTop(CsUserPinsParam param);
|
||||||
|
|
||||||
|
List<CsUserPins> getPinToTopList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对台账树中存在置顶的数据进行排序
|
||||||
|
*
|
||||||
|
* @param list 置顶数据
|
||||||
|
* @param tree 台账树
|
||||||
|
* @param level 树的层级
|
||||||
|
* 如果第一层不是工程,并且是5层树,level = 5 ,5层树层级必须是 0:设备类型 1:工程 2:项目 3:设备 4:监测点
|
||||||
|
* 如果第一层是工程,level = 4 ,4层树层级必须是 0:工程 1:项目 2:设备 3:监测点,其余层级的树也可以使用level = 4,只要是工程、项目、设备、监测点这样的结构就行
|
||||||
|
*/
|
||||||
|
void channelTree(List<CsUserPins> list, List<CsLedgerVO> tree, Integer level);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.njcn.csdevice.service;
|
||||||
|
|
||||||
|
import com.njcn.csdevice.pojo.param.AppProjectAddParm;
|
||||||
|
import com.njcn.csdevice.pojo.param.AppProjectAuditParm;
|
||||||
|
import com.njcn.csdevice.pojo.param.CsEngineeringAddParm;
|
||||||
|
import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
||||||
|
import com.njcn.csdevice.pojo.vo.EngineeringProjectRelationVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 组和指标关系表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @since 2023-06-19
|
||||||
|
*/
|
||||||
|
public interface IEngineeringProjectService {
|
||||||
|
|
||||||
|
boolean addEngineering(CsEngineeringAddParm csEngineeringAddParm);
|
||||||
|
|
||||||
|
boolean updateEngineering(CsEngineeringAuditParm csEngineeringAuditParm);
|
||||||
|
|
||||||
|
boolean deleteEngineering(String id);
|
||||||
|
|
||||||
|
boolean addProject(AppProjectAddParm param);
|
||||||
|
|
||||||
|
boolean updateProject(AppProjectAuditParm param);
|
||||||
|
|
||||||
|
boolean deleteProject(String id);
|
||||||
|
|
||||||
|
List<EngineeringProjectRelationVo> getList();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,8 +2,8 @@ package com.njcn.csdevice.service;
|
|||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.csdevice.pojo.po.Overlimit;
|
|
||||||
import com.njcn.csdevice.pojo.vo.LineOverLimitVO;
|
import com.njcn.csdevice.pojo.vo.LineOverLimitVO;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package com.njcn.csdevice.service.impl;
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.stream.CollectorUtil;
|
|
||||||
import com.alibaba.cloud.commons.lang.StringUtils;
|
import com.alibaba.cloud.commons.lang.StringUtils;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -17,7 +18,6 @@ import com.njcn.csdevice.pojo.param.*;
|
|||||||
import com.njcn.csdevice.pojo.po.*;
|
import com.njcn.csdevice.pojo.po.*;
|
||||||
import com.njcn.csdevice.pojo.vo.AppProjectVO;
|
import com.njcn.csdevice.pojo.vo.AppProjectVO;
|
||||||
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
||||||
import com.njcn.csdevice.pojo.vo.CsLineTopologyTemplateVO;
|
|
||||||
import com.njcn.csdevice.service.AppProjectService;
|
import com.njcn.csdevice.service.AppProjectService;
|
||||||
import com.njcn.csdevice.service.AppTopologyDiagramService;
|
import com.njcn.csdevice.service.AppTopologyDiagramService;
|
||||||
import com.njcn.csdevice.service.CsLineTopologyTemplateService;
|
import com.njcn.csdevice.service.CsLineTopologyTemplateService;
|
||||||
@@ -58,10 +58,6 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public AppProjectPO addAppProject(AppProjectAddParm appProjectAddOrAuditParm) {
|
public AppProjectPO addAppProject(AppProjectAddParm appProjectAddOrAuditParm) {
|
||||||
AppProjectPO appProjectPO = new AppProjectPO ( );
|
AppProjectPO appProjectPO = new AppProjectPO ( );
|
||||||
// Boolean result = checkName (appProjectAddOrAuditParm.getUserId ( ), appProjectAddOrAuditParm.getName ( ));
|
|
||||||
// if (result) {
|
|
||||||
// throw new BusinessException (AlgorithmResponseEnum.PROJECT_COMMON_ERROR);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if(checkName(appProjectAddOrAuditParm.getName(),"",appProjectAddOrAuditParm.getEngineeringId())){
|
if(checkName(appProjectAddOrAuditParm.getName(),"",appProjectAddOrAuditParm.getEngineeringId())){
|
||||||
throw new BusinessException(AlgorithmResponseEnum.PROJECT_COMMON_ERROR);
|
throw new BusinessException(AlgorithmResponseEnum.PROJECT_COMMON_ERROR);
|
||||||
@@ -82,22 +78,8 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
|||||||
appTopologyDiagramPO.setStatus ("1");
|
appTopologyDiagramPO.setStatus ("1");
|
||||||
appTopologyDiagramPO.setTopoId(temp);
|
appTopologyDiagramPO.setTopoId(temp);
|
||||||
appTopologyDiagramService.save(appTopologyDiagramPO);
|
appTopologyDiagramService.save(appTopologyDiagramPO);
|
||||||
|
|
||||||
//如何使用拓扑图模板生成监测点模版
|
|
||||||
// List<CsLineTopologyTemplateVO> csLineTopologyTemplateVOS = csLineTopologyDiagramTemplateService.queryByTopoId(temp);
|
|
||||||
// List<CsLineTopologyTemplate> collect = csLineTopologyTemplateVOS.stream().map(temp1 -> {
|
|
||||||
// CsLineTopologyTemplate csLineTopologyTemplate = new CsLineTopologyTemplate();
|
|
||||||
// BeanUtils.copyProperties(temp1, csLineTopologyTemplate);
|
|
||||||
// csLineTopologyTemplate.setId(null);
|
|
||||||
// csLineTopologyTemplate.setStatus("1");
|
|
||||||
// csLineTopologyTemplate.setTopoId(appTopologyDiagramPO.getId());
|
|
||||||
// return csLineTopologyTemplate;
|
|
||||||
// }).collect(Collectors.toList());
|
|
||||||
// csLineTopologyTemplates.addAll(collect);
|
|
||||||
});
|
});
|
||||||
csLineTopologyDiagramTemplateService.saveBatch(csLineTopologyTemplates);
|
csLineTopologyDiagramTemplateService.saveBatch(csLineTopologyTemplates);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(Objects.nonNull( appProjectAddOrAuditParm.getFiles ( ))){
|
if(Objects.nonNull( appProjectAddOrAuditParm.getFiles ( ))){
|
||||||
for (int i = 0; i < appProjectAddOrAuditParm.getFiles ( ).length; i++) {
|
for (int i = 0; i < appProjectAddOrAuditParm.getFiles ( ).length; i++) {
|
||||||
@@ -158,13 +140,6 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
|||||||
QueryWrapper<AppProjectPO> queryWrapper = new QueryWrapper ( );
|
QueryWrapper<AppProjectPO> queryWrapper = new QueryWrapper ( );
|
||||||
queryWrapper.eq ("id", appProjectAuditParm.getId ( ));
|
queryWrapper.eq ("id", appProjectAuditParm.getId ( ));
|
||||||
AppProjectPO appProjectPO1 = appProjectMapper.selectOne (queryWrapper);
|
AppProjectPO appProjectPO1 = appProjectMapper.selectOne (queryWrapper);
|
||||||
// if (appProjectAuditParm.getUserId ( ) != null || appProjectAuditParm.getName ( ) != null) {
|
|
||||||
// Boolean result = checkName (appProjectAuditParm.getUserId ( ) != null ? appProjectAuditParm.getUserId ( ) : appProjectPO1.getUserId ( ),
|
|
||||||
// appProjectAuditParm.getName ( ) != null ? appProjectAuditParm.getName ( ) : appProjectPO1.getName ( ));
|
|
||||||
// if (result) {
|
|
||||||
// throw new BusinessException (AlgorithmResponseEnum.PROJECT_COMMON_ERROR);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//删除项目
|
//删除项目
|
||||||
if(Objects.equals("0",appProjectAuditParm.getStatus())){
|
if(Objects.equals("0",appProjectAuditParm.getStatus())){
|
||||||
QueryWrapper<CsLedger> queryWrapper1 = new QueryWrapper<>();
|
QueryWrapper<CsLedger> queryWrapper1 = new QueryWrapper<>();
|
||||||
@@ -176,38 +151,26 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
|||||||
this.lambdaUpdate().eq(AppProjectPO::getId,appProjectAuditParm.getId()).set(AppProjectPO::getStatus,"0").update();
|
this.lambdaUpdate().eq(AppProjectPO::getId,appProjectAuditParm.getId()).set(AppProjectPO::getStatus,"0").update();
|
||||||
appTopologyDiagramService.lambdaUpdate().eq(AppTopologyDiagramPO::getProjectId,appProjectAuditParm.getId()).set(AppTopologyDiagramPO::getStatus,"0").update();
|
appTopologyDiagramService.lambdaUpdate().eq(AppTopologyDiagramPO::getProjectId,appProjectAuditParm.getId()).set(AppTopologyDiagramPO::getStatus,"0").update();
|
||||||
CsLedger csLedger1 = new CsLedger();
|
CsLedger csLedger1 = new CsLedger();
|
||||||
|
|
||||||
csLedger1.setId(appProjectAuditParm.getId());
|
csLedger1.setId(appProjectAuditParm.getId());
|
||||||
|
|
||||||
csLedger1.setState(0);
|
csLedger1.setState(0);
|
||||||
csLedger1.setState(0);
|
csLedger1.setState(0);
|
||||||
csLedgerMapper.updateById(csLedger1);
|
csLedgerMapper.updateById(csLedger1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(checkName(appProjectAuditParm.getName(),appProjectAuditParm.getId(),appProjectAuditParm.getEngineeringId())){
|
if(checkName(appProjectAuditParm.getName(),appProjectAuditParm.getId(),appProjectAuditParm.getEngineeringId())){
|
||||||
throw new BusinessException(AlgorithmResponseEnum.PROJECT_COMMON_ERROR);
|
throw new BusinessException(AlgorithmResponseEnum.PROJECT_COMMON_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BeanUtils.copyProperties (appProjectAuditParm, appProjectPO);
|
BeanUtils.copyProperties (appProjectAuditParm, appProjectPO);
|
||||||
UpdateWrapper<AppProjectPO> updateWrapper = new UpdateWrapper ( );
|
UpdateWrapper<AppProjectPO> updateWrapper = new UpdateWrapper ( );
|
||||||
updateWrapper.eq ("id", appProjectAuditParm.getId ( ));
|
updateWrapper.eq ("id", appProjectAuditParm.getId ( ));
|
||||||
|
|
||||||
int i = appProjectMapper.update (appProjectPO, updateWrapper);
|
int i = appProjectMapper.update (appProjectPO, updateWrapper);
|
||||||
// Boolean result = checkName (appProjectPO.getUserId ( ), appProjectPO.getName ( ));
|
|
||||||
// if (result) {
|
|
||||||
// throw new BusinessException (AlgorithmResponseEnum.PROJECT_COMMON_ERROR);
|
|
||||||
// }
|
|
||||||
//删除拓扑图
|
//删除拓扑图
|
||||||
if(CollectionUtils.isEmpty(appProjectAuditParm.getNewTopoIds())){
|
if(CollectionUtils.isEmpty(appProjectAuditParm.getNewTopoIds())){
|
||||||
appTopologyDiagramService.lambdaUpdate().eq(AppTopologyDiagramPO::getProjectId,appProjectAuditParm.getId()).set(AppTopologyDiagramPO::getStatus,"0").update();
|
appTopologyDiagramService.lambdaUpdate().eq(AppTopologyDiagramPO::getProjectId,appProjectAuditParm.getId()).set(AppTopologyDiagramPO::getStatus,"0").update();
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
appTopologyDiagramService.lambdaUpdate().eq(AppTopologyDiagramPO::getProjectId,appProjectAuditParm.getId()).notIn(AppTopologyDiagramPO::getId,appProjectAuditParm.getNewTopoIds()).set(AppTopologyDiagramPO::getStatus,"0").update();
|
appTopologyDiagramService.lambdaUpdate().eq(AppTopologyDiagramPO::getProjectId,appProjectAuditParm.getId()).notIn(AppTopologyDiagramPO::getId,appProjectAuditParm.getNewTopoIds()).set(AppTopologyDiagramPO::getStatus,"0").update();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//如何使用拓扑图模板则将拓扑图模板复制绑定
|
//如何使用拓扑图模板则将拓扑图模板复制绑定
|
||||||
@@ -228,26 +191,11 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
|||||||
appTopologyDiagramPO.setStatus ("1");
|
appTopologyDiagramPO.setStatus ("1");
|
||||||
appTopologyDiagramPO.setTopoId(temp);
|
appTopologyDiagramPO.setTopoId(temp);
|
||||||
appTopologyDiagramService.save(appTopologyDiagramPO);
|
appTopologyDiagramService.save(appTopologyDiagramPO);
|
||||||
|
|
||||||
//如何使用拓扑图模板生成监测点模版
|
|
||||||
// List<CsLineTopologyTemplateVO> csLineTopologyTemplateVOS = csLineTopologyDiagramTemplateService.queryByTopoId(temp);
|
|
||||||
// List<CsLineTopologyTemplate> collect = csLineTopologyTemplateVOS.stream().map(temp1 -> {
|
|
||||||
// CsLineTopologyTemplate csLineTopologyTemplate = new CsLineTopologyTemplate();
|
|
||||||
// BeanUtils.copyProperties(temp1, csLineTopologyTemplate);
|
|
||||||
// csLineTopologyTemplate.setId(null);
|
|
||||||
// csLineTopologyTemplate.setStatus("1");
|
|
||||||
// csLineTopologyTemplate.setTopoId(appTopologyDiagramPO.getId());
|
|
||||||
// return csLineTopologyTemplate;
|
|
||||||
// }).collect(Collectors.toList());
|
|
||||||
// csLineTopologyTemplates.addAll(collect);
|
|
||||||
});
|
});
|
||||||
csLineTopologyDiagramTemplateService.saveBatch(csLineTopologyTemplates);
|
csLineTopologyDiagramTemplateService.saveBatch(csLineTopologyTemplates);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(Objects.nonNull( appProjectAuditParm.getFiles ( ))){
|
if(Objects.nonNull( appProjectAuditParm.getFiles ( ))){
|
||||||
for (int k = 0; k < appProjectAuditParm.getFiles ( ).length; k++) {
|
for (int k = 0; k < appProjectAuditParm.getFiles ( ).length; k++) {
|
||||||
|
|
||||||
AppTopologyDiagramAddParm appTopologyDiagramAddParm = new AppTopologyDiagramAddParm ( );
|
AppTopologyDiagramAddParm appTopologyDiagramAddParm = new AppTopologyDiagramAddParm ( );
|
||||||
appTopologyDiagramAddParm.setProjectId (appProjectPO.getId ( ));
|
appTopologyDiagramAddParm.setProjectId (appProjectPO.getId ( ));
|
||||||
appTopologyDiagramAddParm.setTopologyDiagramName (appProjectAuditParm.getFiles ( )[k].getOriginalFilename ( ));
|
appTopologyDiagramAddParm.setTopologyDiagramName (appProjectAuditParm.getFiles ( )[k].getOriginalFilename ( ));
|
||||||
@@ -256,10 +204,8 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CsLedger csLedger2 = new CsLedger();
|
CsLedger csLedger2 = new CsLedger();
|
||||||
csLedger2.setId(appProjectAuditParm.getId());
|
csLedger2.setId(appProjectAuditParm.getId());
|
||||||
|
|
||||||
if(StringUtils.isNotBlank(appProjectAuditParm.getName())){
|
if(StringUtils.isNotBlank(appProjectAuditParm.getName())){
|
||||||
csLedger2.setName(appProjectAuditParm.getName());
|
csLedger2.setName(appProjectAuditParm.getName());
|
||||||
}
|
}
|
||||||
@@ -367,4 +313,49 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AppProjectPO add(AppProjectAddParm param) {
|
||||||
|
AppProjectPO po = new AppProjectPO ( );
|
||||||
|
List<AppProjectPO> list = this.lambdaQuery().eq(AppProjectPO::getName, param.getName()).eq(AppProjectPO::getStatus, "1").list();
|
||||||
|
if(!list.isEmpty()){
|
||||||
|
throw new BusinessException("新增失败,项目名重复");
|
||||||
|
}
|
||||||
|
BeanUtils.copyProperties (param, po);
|
||||||
|
po.setStatus ("1");
|
||||||
|
this.save(po);
|
||||||
|
return po;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AppProjectPO updateData(AppProjectAuditParm param) {
|
||||||
|
List<AppProjectPO> list = this.lambdaQuery()
|
||||||
|
.eq(AppProjectPO::getName, param.getName())
|
||||||
|
.eq(AppProjectPO::getStatus, "1")
|
||||||
|
.ne(AppProjectPO::getId, param.getId())
|
||||||
|
.list();
|
||||||
|
if(!list.isEmpty()){
|
||||||
|
throw new BusinessException("修改失败,项目名重复");
|
||||||
|
}
|
||||||
|
AppProjectPO po = new AppProjectPO ();
|
||||||
|
BeanUtils.copyProperties (param, po);
|
||||||
|
this.updateById(po);
|
||||||
|
return po;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean delete(String id) {
|
||||||
|
LambdaUpdateWrapper<AppProjectPO> queryWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
queryWrapper.eq(AppProjectPO::getId,id).set(AppProjectPO::getStatus,"0");
|
||||||
|
return this.update(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AppProjectPO getProjectByName(String name) {
|
||||||
|
LambdaQueryWrapper<AppProjectPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(AppProjectPO::getName,name).eq(AppProjectPO::getStatus,1);
|
||||||
|
return this.getOne(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.njcn.csdevice.service.impl;
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.Query;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@@ -10,15 +10,18 @@ import com.google.common.base.Objects;
|
|||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.csdevice.constant.DataParam;
|
import com.njcn.csdevice.constant.DataParam;
|
||||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
import com.njcn.csdevice.mapper.*;
|
import com.njcn.csdevice.mapper.AppLineTopologyDiagramMapper;
|
||||||
|
import com.njcn.csdevice.mapper.AppProjectMapper;
|
||||||
|
import com.njcn.csdevice.mapper.AppTopologyDiagramMapper;
|
||||||
import com.njcn.csdevice.pojo.param.AppTopologyDiagramAddParm;
|
import com.njcn.csdevice.pojo.param.AppTopologyDiagramAddParm;
|
||||||
import com.njcn.csdevice.pojo.param.AppTopologyDiagramAuditParm;
|
import com.njcn.csdevice.pojo.param.AppTopologyDiagramAuditParm;
|
||||||
import com.njcn.csdevice.pojo.param.AppTopologyDiagramQueryPageParm;
|
import com.njcn.csdevice.pojo.param.AppTopologyDiagramQueryPageParm;
|
||||||
import com.njcn.csdevice.pojo.param.AppTopologyDiagramQueryParm;
|
import com.njcn.csdevice.pojo.param.AppTopologyDiagramQueryParm;
|
||||||
import com.njcn.csdevice.pojo.po.*;
|
import com.njcn.csdevice.pojo.po.AppLineTopologyDiagramPO;
|
||||||
|
import com.njcn.csdevice.pojo.po.AppProjectPO;
|
||||||
|
import com.njcn.csdevice.pojo.po.AppTopologyDiagramPO;
|
||||||
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
||||||
import com.njcn.csdevice.pojo.vo.CsLineTopologyTemplateVO;
|
import com.njcn.csdevice.pojo.vo.CsLineTopologyTemplateVO;
|
||||||
import com.njcn.csdevice.service.AppLineTopologyDiagramService;
|
|
||||||
import com.njcn.csdevice.service.AppTopologyDiagramService;
|
import com.njcn.csdevice.service.AppTopologyDiagramService;
|
||||||
import com.njcn.csdevice.service.CsLineTopologyTemplateService;
|
import com.njcn.csdevice.service.CsLineTopologyTemplateService;
|
||||||
import com.njcn.oss.constant.OssPath;
|
import com.njcn.oss.constant.OssPath;
|
||||||
@@ -178,4 +181,11 @@ public class AppTopologyDiagramServiceImpl extends ServiceImpl<AppTopologyDiagra
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AppTopologyDiagramPO getByProjectId(String projectId) {
|
||||||
|
LambdaQueryWrapper<AppTopologyDiagramPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(AppTopologyDiagramPO::getProjectId,projectId).eq(AppTopologyDiagramPO::getStatus,"1");
|
||||||
|
return this.getOne(queryWrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,123 @@
|
|||||||
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.csdevice.mapper.CsLinePOMapper;
|
||||||
|
import com.njcn.csdevice.mapper.PqsDeviceUnitMapper;
|
||||||
|
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.CsMarketDataVO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.CsTouristDataParmVO;
|
||||||
|
import com.njcn.csdevice.service.*;
|
||||||
|
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||||
|
import com.njcn.user.api.UserFeignClient;
|
||||||
|
import com.njcn.user.enums.AppRoleEnum;
|
||||||
|
import com.njcn.user.pojo.constant.UserType;
|
||||||
|
import com.njcn.user.pojo.vo.UserVO;
|
||||||
|
import com.njcn.web.utils.RequestUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-12-23
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CsCommTerminalServiceImpl implements CsCommTerminalService {
|
||||||
|
|
||||||
|
private final PqsDeviceUnitMapper pqsDeviceUnitMapper;
|
||||||
|
private final CsDeviceUserPOService csDeviceUserPOService;
|
||||||
|
private final CsLinePOMapper csLinePOMapper;
|
||||||
|
private final UserFeignClient userFeignClient;
|
||||||
|
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
|
||||||
|
private final CsMarketDataService csMarketDataService;
|
||||||
|
private final ICsLedgerService csLedgerService;
|
||||||
|
private final CsTouristDataPOService csTouristDataPOService;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getLineIdsByUser(String userId) {
|
||||||
|
List<String> result = new ArrayList<>();
|
||||||
|
List<String> devIds = commGetDevIds(userId);
|
||||||
|
if (CollUtil.isEmpty(devIds)) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<CsLinePO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.select(CsLinePO::getLineId).in(CsLinePO::getDeviceId, devIds)
|
||||||
|
.eq(CsLinePO::getStatus, DataStateEnum.ENABLE.getCode());
|
||||||
|
List<CsLinePO> poList = csLinePOMapper.selectList(lambdaQueryWrapper);
|
||||||
|
if (CollUtil.isNotEmpty(poList)) {
|
||||||
|
result = poList.stream().map(CsLinePO::getLineId).distinct().collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getPqUserIdsByUser(String userId) {
|
||||||
|
List<String> result = new ArrayList<>();
|
||||||
|
List<String> devIds = commGetDevIds(userId);
|
||||||
|
if (CollUtil.isEmpty(devIds)) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<CsLinePO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.select(CsLinePO::getLineId, CsLinePO::getMonitorUser).in(CsLinePO::getDeviceId, devIds)
|
||||||
|
.eq(CsLinePO::getStatus, DataStateEnum.ENABLE.getCode());
|
||||||
|
List<CsLinePO> poList =csLinePOMapper.selectList(lambdaQueryWrapper);
|
||||||
|
if (CollUtil.isNotEmpty(poList)) {
|
||||||
|
result = poList.stream().map(CsLinePO::getMonitorUser).distinct().collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PqsDeviceUnit lineUnitDetail(String lineId) {
|
||||||
|
PqsDeviceUnit pqsDeviceUnit = pqsDeviceUnitMapper.selectById(lineId);
|
||||||
|
if(Objects.isNull(pqsDeviceUnit)){
|
||||||
|
pqsDeviceUnit = new PqsDeviceUnit();
|
||||||
|
}
|
||||||
|
return pqsDeviceUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> commGetDevIds(String userId) {
|
||||||
|
UserVO userVO = userFeignClient.getUserById(userId).getData();
|
||||||
|
List<String> devIds;
|
||||||
|
if (userVO.getType().equals(UserType.SUPER_ADMINISTRATOR) || userVO.getType().equals(UserType.ADMINISTRATOR)) {
|
||||||
|
devIds = csEquipmentDeliveryService.getAll().stream().map(CsEquipmentDeliveryPO::getId).collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
List<CsDeviceUserPO> devList = csDeviceUserPOService.lambdaQuery().select(CsDeviceUserPO::getDeviceId)
|
||||||
|
.and(w -> w.eq(CsDeviceUserPO::getPrimaryUserId, userId).or().eq(CsDeviceUserPO::getSubUserId, userId))
|
||||||
|
.eq(CsDeviceUserPO::getStatus, DataStateEnum.ENABLE.getCode()).list();
|
||||||
|
devIds = devList.stream().map(CsDeviceUserPO::getDeviceId).distinct().collect(Collectors.toList());
|
||||||
|
//note 黄是在cs_market_data写入数据,是用户和工程的关系;
|
||||||
|
// 但是权限根据用户和设备来判断会有问题,还需要用户和工程的关系(针对营销 工程用户),所以这边还要添加用户和工程的关系
|
||||||
|
List<CsMarketDataVO> list = csMarketDataService.queryByUseId(userId);
|
||||||
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
|
List<String> engineerIds = list.stream().map(CsMarketDataVO::getEngineerId).distinct().collect(Collectors.toList());
|
||||||
|
List<DevDetailDTO> devs = csLedgerService.getDevInfoByEngineerIds(engineerIds);
|
||||||
|
devIds.addAll(devs.stream().map(DevDetailDTO::getEquipmentId).distinct().collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
//note 如果是游客,则还需要加入系统配置的设备
|
||||||
|
String roleString = RequestUtil.getUserRole();
|
||||||
|
if (roleString.contains(AppRoleEnum.TOURIST.getCode())) {
|
||||||
|
devIds.addAll(csTouristDataPOService.queryAll().stream().map(CsTouristDataParmVO::getDeviceId).distinct().collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!CollUtil.isEmpty(devIds)) {
|
||||||
|
devIds = devIds.stream().distinct().collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
return devIds;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -50,12 +50,12 @@ public class CsDevCapacityPOServiceImpl extends ServiceImpl<CsDevCapacityPOMappe
|
|||||||
public Double getDevCapacity(String id) {
|
public Double getDevCapacity(String id) {
|
||||||
List<CsLinePO> csLinePOS = csLinePOService.queryByDevId(id);
|
List<CsLinePO> csLinePOS = csLinePOService.queryByDevId(id);
|
||||||
|
|
||||||
String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId();
|
//String areaId = dicDataFeignClient.getDicDataByCode(DicDataEnum.OUTPUT_SIDE.getCode()).getData().getId();
|
||||||
|
|
||||||
Optional.ofNullable(csLinePOS).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
|
//Optional.ofNullable(csLinePOS).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
|
||||||
List<CsLinePO> collect1 = csLinePOS.stream().filter(temp -> Objects.equals(areaId, temp.getPosition())).collect(Collectors.toList());
|
//List<CsLinePO> collect1 = csLinePOS.stream().filter(temp -> Objects.equals(areaId, temp.getPosition())).collect(Collectors.toList());
|
||||||
/*治理侧监测点*/
|
/*治理侧监测点*/
|
||||||
CsLinePO csLinePO = collect1.get(0);
|
CsLinePO csLinePO = csLinePOS.get(0);
|
||||||
CsDevCapacityPO one = this.lambdaQuery().eq(CsDevCapacityPO::getLineId, csLinePO.getLineId()).eq(CsDevCapacityPO::getCldid, 0).one();
|
CsDevCapacityPO one = this.lambdaQuery().eq(CsDevCapacityPO::getLineId, csLinePO.getLineId()).eq(CsDevCapacityPO::getCldid, 0).one();
|
||||||
// Optional.ofNullable(one).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.DATA_MISSING));
|
// Optional.ofNullable(one).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.DATA_MISSING));
|
||||||
if(Objects.isNull(one)){
|
if(Objects.isNull(one)){
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
@@ -18,22 +17,19 @@ import com.njcn.csdevice.pojo.vo.DevCountVO;
|
|||||||
import com.njcn.csdevice.pojo.vo.DevUserVO;
|
import com.njcn.csdevice.pojo.vo.DevUserVO;
|
||||||
import com.njcn.csdevice.service.*;
|
import com.njcn.csdevice.service.*;
|
||||||
import com.njcn.csharmonic.api.EventUserFeignClient;
|
import com.njcn.csharmonic.api.EventUserFeignClient;
|
||||||
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
|
||||||
import com.njcn.csharmonic.pojo.vo.EventDetailVO;
|
|
||||||
import com.njcn.cssystem.api.FeedBackFeignClient;
|
import com.njcn.cssystem.api.FeedBackFeignClient;
|
||||||
import com.njcn.cssystem.pojo.param.CsFeedbackQueryParm;
|
import com.njcn.harmonic.utils.PublicDataUtils;
|
||||||
import com.njcn.cssystem.pojo.vo.CsFeedbackVO;
|
|
||||||
import com.njcn.user.api.UserFeignClient;
|
import com.njcn.user.api.UserFeignClient;
|
||||||
import com.njcn.user.enums.AppRoleEnum;
|
import com.njcn.user.enums.AppRoleEnum;
|
||||||
import com.njcn.user.pojo.po.User;
|
import com.njcn.user.pojo.po.User;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -122,114 +118,251 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DevCountVO devCount(String id) {
|
public DevCountVO devCount(String id,String time) {
|
||||||
QueryWrapper<CsEquipmentDeliveryPO> queryWrapper = new QueryWrapper<>();
|
DevCountVO vo = new DevCountVO();
|
||||||
|
//获取app用户的台账树,包含四个层级 工程、项目、设备、监测点
|
||||||
DevCountVO devCountVO = new DevCountVO();
|
List<CsLedgerVO> appLedger = iCsLedgerService.appLineTree();
|
||||||
|
if (CollectionUtil.isNotEmpty(appLedger)) {
|
||||||
String userRole = RequestUtil.getUserRole();
|
//获取第一层项目层级
|
||||||
List<String> strings = JSONArray.parseArray(userRole, String.class);
|
List<CsLedgerVO> firstLevelList = new ArrayList<>();
|
||||||
if(CollectionUtils.isEmpty(strings)){
|
//获取第三层设备层级
|
||||||
throw new BusinessException(AlgorithmResponseEnum.UNKNOW_ROLE);
|
List<CsLedgerVO> thirdLevelList = new ArrayList<>();
|
||||||
|
for (CsLedgerVO firstLevel : appLedger) {
|
||||||
|
firstLevelList.add(firstLevel);
|
||||||
|
if (CollectionUtil.isNotEmpty(firstLevel.getChildren())) {
|
||||||
|
for (CsLedgerVO secondLevel : firstLevel.getChildren()) {
|
||||||
|
if (CollectionUtil.isNotEmpty(secondLevel.getChildren())) {
|
||||||
|
thirdLevelList.addAll(secondLevel.getChildren());
|
||||||
}
|
}
|
||||||
userRole=strings.get(0);
|
}
|
||||||
|
}
|
||||||
List<String> device = roleEngineerDevService.getDevice();
|
}
|
||||||
if(CollectionUtils.isEmpty(device)){
|
//note 所有工程数据
|
||||||
devCountVO.setOnLineDevCount(0);
|
//获取工程数量
|
||||||
devCountVO.setOnLineDevs(new ArrayList<>());
|
if (CollectionUtil.isNotEmpty(firstLevelList)) {
|
||||||
devCountVO.setOffLineDevCount(0);
|
vo.setEningerCount(firstLevelList.size());
|
||||||
devCountVO.setOffLineDevs(new ArrayList<>());
|
|
||||||
}else {
|
|
||||||
queryWrapper.clear();
|
|
||||||
queryWrapper.in("id",device);
|
|
||||||
|
|
||||||
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryMapper.selectList(queryWrapper);
|
|
||||||
List<CsEquipmentDeliveryPO> collect = csEquipmentDeliveryPOS.stream().filter(temp -> temp.getRunStatus() == 1).collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryPO> collect2= csEquipmentDeliveryPOS.stream().filter(temp -> temp.getRunStatus() == 2).collect(Collectors.toList());
|
|
||||||
devCountVO.setOnLineDevCount(collect2.size());
|
|
||||||
devCountVO.setOnLineDevs(collect2);
|
|
||||||
devCountVO.setOffLineDevCount(collect.size());
|
|
||||||
devCountVO.setOffLineDevs(collect);
|
|
||||||
List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
|
||||||
devCountVO.setEningerCount(roleengineer.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<CsLedgerVO> deviceTree = iCsLedgerService.getDeviceTree();
|
//获取设备总数、在线设备、离线设备
|
||||||
//由于多加了一程便携式设备
|
if (CollectionUtil.isNotEmpty(thirdLevelList)) {
|
||||||
List<String> collect1 = deviceTree.stream()
|
List<String> devIds = thirdLevelList.stream().map(CsLedgerVO::getId).collect(Collectors.toList());
|
||||||
.map(CsLedgerVO::getChildren).flatMap(Collection::stream)
|
List<CsEquipmentDeliveryPO> devList = csEquipmentDeliveryMapper.selectBatchIds(devIds);
|
||||||
.filter(temp -> temp.getId().equals(id))
|
//在线设备
|
||||||
.map(CsLedgerVO::getChildren).flatMap(Collection::stream)
|
List<CsEquipmentDeliveryPO> onlineDevs = devList.stream().filter(dev -> Objects.equals(dev.getRunStatus(), 2)).collect(Collectors.toList());
|
||||||
.map(CsLedgerVO::getChildren).flatMap(Collection::stream)
|
if (CollectionUtil.isNotEmpty(onlineDevs)) {
|
||||||
.map(CsLedgerVO::getId).collect(Collectors.toList());
|
vo.setOnLineDevCount(onlineDevs.size());
|
||||||
//求交集
|
vo.setOnLineDevs(onlineDevs);
|
||||||
device.retainAll(collect1);
|
|
||||||
if(CollectionUtils.isEmpty(device)){
|
|
||||||
devCountVO.setCurrentOnLineDevCount(0);
|
|
||||||
devCountVO.setCurrentOnLineDevs(new ArrayList<>());
|
|
||||||
devCountVO.setCurrentOffLineDevCount(0);
|
|
||||||
devCountVO.setCurrentOffLineDevs(new ArrayList<>());
|
|
||||||
devCountVO.setCurrentProjectCount(0);
|
|
||||||
|
|
||||||
}else {
|
|
||||||
queryWrapper.clear();
|
|
||||||
queryWrapper.in("id",device);
|
|
||||||
|
|
||||||
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryMapper.selectList(queryWrapper);
|
|
||||||
List<CsEquipmentDeliveryPO> collect = csEquipmentDeliveryPOS.stream().filter(temp -> temp.getRunStatus() == 1).collect(Collectors.toList());
|
|
||||||
List<CsEquipmentDeliveryPO> collect2= csEquipmentDeliveryPOS.stream().filter(temp -> temp.getRunStatus() == 2).collect(Collectors.toList());
|
|
||||||
devCountVO.setCurrentOnLineDevCount(collect2.size());
|
|
||||||
devCountVO.setCurrentOnLineDevs(collect2);
|
|
||||||
devCountVO.setCurrentOffLineDevCount(collect.size());
|
|
||||||
devCountVO.setCurrentOffLineDevs(collect);
|
|
||||||
List<CsLedger> list = iCsLedgerService.lambdaQuery().eq(CsLedger::getPid, id).eq(CsLedger::getState, 1).list();
|
|
||||||
devCountVO.setCurrentProjectCount(list.size());
|
|
||||||
}
|
}
|
||||||
CsEventUserQueryParam csEventUserQueryParam = new CsEventUserQueryParam();
|
//离线设备
|
||||||
csEventUserQueryParam.setStatus("0");
|
List<CsEquipmentDeliveryPO> offlineDevs = devList.stream().filter(dev -> Objects.equals(dev.getRunStatus(), 1)).collect(Collectors.toList());
|
||||||
List<EventDetailVO> data = eventUserFeignClient.queryEventList(csEventUserQueryParam).getData();
|
if (CollectionUtil.isNotEmpty(offlineDevs)) {
|
||||||
List<EventDetailVO> event = data.stream().filter(temp -> temp.getType() == 0).collect(Collectors.toList());
|
vo.setOffLineDevCount(offlineDevs.size());
|
||||||
List<EventDetailVO> harmonic = data.stream().filter(temp -> temp.getType() == 1).collect(Collectors.toList());
|
vo.setOffLineDevs(offlineDevs);
|
||||||
List<EventDetailVO> alarm = data.stream().filter(temp -> temp.getType() == 3).collect(Collectors.toList());
|
|
||||||
|
|
||||||
if(Objects.equals(userRole, AppRoleEnum.APP_VIP_USER.getCode())){
|
|
||||||
alarm = alarm.stream().filter(temp -> Objects.equals("3", temp.getLevel())).collect(Collectors.toList());
|
|
||||||
}
|
}
|
||||||
List<EventDetailVO> run = data.stream().filter(temp -> temp.getType() == 2).collect(Collectors.toList());
|
}
|
||||||
if(Objects.equals(userRole,AppRoleEnum.APP_VIP_USER.getCode())||Objects.equals(userRole,AppRoleEnum.TOURIST.getCode())
|
//获取未读事件数量
|
||||||
||Objects.equals(userRole,AppRoleEnum.MARKET_USER.getCode())){
|
int eventCount = this.baseMapper.queryTempEvent(RequestUtil.getUserIndex(),PublicDataUtils.calculateMonthStart(time),PublicDataUtils.calculateMonthEnd(time),null);
|
||||||
devCountVO.setFeedBackCount(0);
|
vo.setEventCount(eventCount);
|
||||||
|
|
||||||
}else {
|
int harmonicCount = this.baseMapper.queryTempHarmonic(RequestUtil.getUserIndex(),PublicDataUtils.calculateMonthStart(time),PublicDataUtils.calculateMonthEnd(time),null);
|
||||||
CsFeedbackQueryParm csFeedbackQueryParm = new CsFeedbackQueryParm();
|
vo.setHarmonicCount(harmonicCount);
|
||||||
csFeedbackQueryParm.setPageNum(1);
|
|
||||||
csFeedbackQueryParm.setPageSize(100000);
|
int alarmCount = this.baseMapper.queryAlarmEvent(RequestUtil.getUserIndex(),PublicDataUtils.calculateMonthStart(time),PublicDataUtils.calculateMonthEnd(time),null);
|
||||||
csFeedbackQueryParm.setStatus("1");
|
vo.setAlarmCount(alarmCount);
|
||||||
Page<CsFeedbackVO> data1 = feedBackFeignClient.queryFeedBackPage(csFeedbackQueryParm).getData();
|
|
||||||
List<CsFeedbackVO> collect = data1.getRecords().stream().filter(temp -> !Objects.equals(temp.getUserId(), RequestUtil.getUserIndex())).collect(Collectors.toList());
|
int runCount = this.baseMapper.queryRunEvent(RequestUtil.getUserIndex(),PublicDataUtils.calculateMonthStart(time),PublicDataUtils.calculateMonthEnd(time),null);
|
||||||
devCountVO.setFeedBackCount(collect.size());
|
vo.setRunCount(runCount);
|
||||||
|
|
||||||
|
//note 当前工程数据
|
||||||
|
//当前工程id
|
||||||
|
vo.setCurrentId(id);
|
||||||
|
//设备集合
|
||||||
|
List<String> currentDevIds = new ArrayList<>();
|
||||||
|
//监测点集合
|
||||||
|
List<String> currentLineIds = new ArrayList<>();
|
||||||
|
//获取第一层项目层级
|
||||||
|
List<CsLedgerVO> currentProjectIds = new ArrayList<>();
|
||||||
|
// 遍历树结构,找到匹配的工程节点
|
||||||
|
for (CsLedgerVO engineering : appLedger) {
|
||||||
|
if (id.equals(engineering.getId())) {
|
||||||
|
// 找到工程节点,获取其子节点(项目层级)
|
||||||
|
if (CollectionUtil.isNotEmpty(engineering.getChildren())) {
|
||||||
|
for (CsLedgerVO project : engineering.getChildren()) {
|
||||||
|
currentProjectIds.add(project);
|
||||||
|
// 获取项目下的设备层级
|
||||||
|
if (CollectionUtil.isNotEmpty(project.getChildren())) {
|
||||||
|
currentDevIds.addAll(project.getChildren().stream().map(CsLedgerVO::getId).collect(Collectors.toList()));
|
||||||
|
// 获取设备下的监测点层级
|
||||||
|
for (CsLedgerVO device : project.getChildren()) {
|
||||||
|
if (CollectionUtil.isNotEmpty(device.getChildren())) {
|
||||||
|
currentLineIds.addAll(device.getChildren().stream().map(CsLedgerVO::getId).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//获取项目数量
|
||||||
|
if (CollectionUtil.isNotEmpty(currentProjectIds)) {
|
||||||
|
vo.setCurrentProjectCount(currentProjectIds.size());
|
||||||
|
}
|
||||||
|
//获取设备总数、在线设备、离线设备
|
||||||
|
if (CollectionUtil.isNotEmpty(currentDevIds)) {
|
||||||
|
List<CsEquipmentDeliveryPO> devList = csEquipmentDeliveryMapper.selectBatchIds(currentDevIds);
|
||||||
|
//在线设备
|
||||||
|
List<CsEquipmentDeliveryPO> onlineDevs = devList.stream().filter(dev -> Objects.equals(dev.getRunStatus(), 2)).collect(Collectors.toList());
|
||||||
|
if (CollectionUtil.isNotEmpty(onlineDevs)) {
|
||||||
|
vo.setCurrentOnLineDevCount(onlineDevs.size());
|
||||||
|
vo.setCurrentOnLineDevs(onlineDevs);
|
||||||
|
}
|
||||||
|
//离线设备
|
||||||
|
List<CsEquipmentDeliveryPO> offlineDevs = devList.stream().filter(dev -> Objects.equals(dev.getRunStatus(), 1)).collect(Collectors.toList());
|
||||||
|
if (CollectionUtil.isNotEmpty(offlineDevs)) {
|
||||||
|
vo.setCurrentOffLineDevCount(offlineDevs.size());
|
||||||
|
vo.setCurrentOffLineDevs(offlineDevs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//获取未读事件数量
|
||||||
|
if (CollectionUtil.isNotEmpty(currentLineIds)) {
|
||||||
|
int eventCount2 = this.baseMapper.queryTempEvent(RequestUtil.getUserIndex(),PublicDataUtils.calculateMonthStart(time),PublicDataUtils.calculateMonthEnd(time),currentLineIds);
|
||||||
|
vo.setCurrentEventCount(eventCount2);
|
||||||
|
|
||||||
|
int harmonicCount2 = this.baseMapper.queryTempHarmonic(RequestUtil.getUserIndex(),PublicDataUtils.calculateMonthStart(time),PublicDataUtils.calculateMonthEnd(time),currentLineIds);
|
||||||
|
vo.setCurrentHarmonicCount(harmonicCount2);
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(currentDevIds)) {
|
||||||
|
int alarmCount2 = this.baseMapper.queryAlarmEvent(RequestUtil.getUserIndex(),PublicDataUtils.calculateMonthStart(time),PublicDataUtils.calculateMonthEnd(time),currentDevIds);
|
||||||
|
vo.setCurrentAlarmCount(alarmCount2);
|
||||||
|
|
||||||
|
int runCount2 = this.baseMapper.queryRunEvent(RequestUtil.getUserIndex(),PublicDataUtils.calculateMonthStart(time),PublicDataUtils.calculateMonthEnd(time),currentDevIds);
|
||||||
|
vo.setCurrentRunCount(runCount2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo 后续添加警告数,事件数
|
// @Override
|
||||||
devCountVO.setEventCount(event.size());
|
// public DevCountVO devCount(String id,String time) {
|
||||||
devCountVO.setAlarmCount(alarm.size());
|
// QueryWrapper<CsEquipmentDeliveryPO> queryWrapper = new QueryWrapper<>();
|
||||||
devCountVO.setRunCount(run.size());
|
//
|
||||||
devCountVO.setHarmonicCount(harmonic.size());
|
// DevCountVO devCountVO = new DevCountVO();
|
||||||
List<EventDetailVO> curEvent = event.stream().filter(temp -> Objects.equals(temp.getEngineeringid(), id)).collect(Collectors.toList());
|
//
|
||||||
List<EventDetailVO> curHarmonic = harmonic.stream().filter(temp -> Objects.equals(temp.getEngineeringid(), id)).collect(Collectors.toList());
|
// String userRole = RequestUtil.getUserRole();
|
||||||
List<EventDetailVO> curAlarm = alarm.stream().filter(temp -> Objects.equals(temp.getEngineeringid(), id)).collect(Collectors.toList());
|
// List<String> strings = JSONArray.parseArray(userRole, String.class);
|
||||||
List<EventDetailVO> curRun = run.stream().filter(temp -> Objects.equals(temp.getEngineeringid(), id)).collect(Collectors.toList());
|
// if(CollectionUtils.isEmpty(strings)){
|
||||||
|
// throw new BusinessException(AlgorithmResponseEnum.UNKNOW_ROLE);
|
||||||
devCountVO.setCurrentEventCount(curEvent.size());
|
//
|
||||||
devCountVO.setCurrentAlarmCount(curAlarm.size());
|
// }
|
||||||
devCountVO.setCurrentRunCount(curRun.size());
|
// userRole=strings.get(0);
|
||||||
devCountVO.setCurrentHarmonicCount(curHarmonic.size());
|
//
|
||||||
|
// List<String> device = roleEngineerDevService.getDevice();
|
||||||
|
// if(CollectionUtils.isEmpty(device)){
|
||||||
return devCountVO;
|
// devCountVO.setOnLineDevCount(0);
|
||||||
}
|
// devCountVO.setOnLineDevs(new ArrayList<>());
|
||||||
|
// devCountVO.setOffLineDevCount(0);
|
||||||
|
// devCountVO.setOffLineDevs(new ArrayList<>());
|
||||||
|
// }else {
|
||||||
|
// queryWrapper.clear();
|
||||||
|
// queryWrapper.in("id",device);
|
||||||
|
//
|
||||||
|
// List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryMapper.selectList(queryWrapper);
|
||||||
|
// List<CsEquipmentDeliveryPO> collect = csEquipmentDeliveryPOS.stream().filter(temp -> temp.getRunStatus() == 1).collect(Collectors.toList());
|
||||||
|
// List<CsEquipmentDeliveryPO> collect2= csEquipmentDeliveryPOS.stream().filter(temp -> temp.getRunStatus() == 2).collect(Collectors.toList());
|
||||||
|
// devCountVO.setOnLineDevCount(collect2.size());
|
||||||
|
// devCountVO.setOnLineDevs(collect2);
|
||||||
|
// devCountVO.setOffLineDevCount(collect.size());
|
||||||
|
// devCountVO.setOffLineDevs(collect);
|
||||||
|
// List<String> roleengineer = roleEngineerDevService.getRoleengineer();
|
||||||
|
// devCountVO.setEningerCount(roleengineer.size());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// List<CsLedgerVO> deviceTree = iCsLedgerService.getDeviceTree(null);
|
||||||
|
// //由于多加了一程便携式设备
|
||||||
|
// List<String> collect1 = deviceTree.stream()
|
||||||
|
// .map(CsLedgerVO::getChildren).flatMap(Collection::stream)
|
||||||
|
// .filter(temp -> temp.getId().equals(id))
|
||||||
|
// .map(CsLedgerVO::getChildren).flatMap(Collection::stream)
|
||||||
|
// .map(CsLedgerVO::getChildren).flatMap(Collection::stream)
|
||||||
|
// .map(CsLedgerVO::getId).collect(Collectors.toList());
|
||||||
|
// //求交集
|
||||||
|
// device.retainAll(collect1);
|
||||||
|
// if(CollectionUtils.isEmpty(device)){
|
||||||
|
// devCountVO.setCurrentOnLineDevCount(0);
|
||||||
|
// devCountVO.setCurrentOnLineDevs(new ArrayList<>());
|
||||||
|
// devCountVO.setCurrentOffLineDevCount(0);
|
||||||
|
// devCountVO.setCurrentOffLineDevs(new ArrayList<>());
|
||||||
|
// devCountVO.setCurrentProjectCount(0);
|
||||||
|
//
|
||||||
|
// }else {
|
||||||
|
// queryWrapper.clear();
|
||||||
|
// queryWrapper.in("id",device);
|
||||||
|
//
|
||||||
|
// List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryMapper.selectList(queryWrapper);
|
||||||
|
// List<CsEquipmentDeliveryPO> collect = csEquipmentDeliveryPOS.stream().filter(temp -> temp.getRunStatus() == 1).collect(Collectors.toList());
|
||||||
|
// List<CsEquipmentDeliveryPO> collect2= csEquipmentDeliveryPOS.stream().filter(temp -> temp.getRunStatus() == 2).collect(Collectors.toList());
|
||||||
|
// devCountVO.setCurrentOnLineDevCount(collect2.size());
|
||||||
|
// devCountVO.setCurrentOnLineDevs(collect2);
|
||||||
|
// devCountVO.setCurrentOffLineDevCount(collect.size());
|
||||||
|
// devCountVO.setCurrentOffLineDevs(collect);
|
||||||
|
// List<CsLedger> list = iCsLedgerService.lambdaQuery().eq(CsLedger::getPid, id).eq(CsLedger::getState, 1).list();
|
||||||
|
// devCountVO.setCurrentProjectCount(list.size());
|
||||||
|
// }
|
||||||
|
// CsEventUserQueryParam csEventUserQueryParam = new CsEventUserQueryParam();
|
||||||
|
// csEventUserQueryParam.setStatus("0");
|
||||||
|
//
|
||||||
|
// //查询暂态事件、运行事件还是使用之前的方法
|
||||||
|
// List<EventDetailVO> data = eventUserFeignClient.queryEventList(csEventUserQueryParam).getData();
|
||||||
|
// //查询稳态事件 先获取监测点id
|
||||||
|
// csLinePOService.getLinesByDevList(device);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// //查询运行告警事件
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// List<EventDetailVO> event = data.stream().filter(temp -> temp.getType() == 0).collect(Collectors.toList());
|
||||||
|
// List<EventDetailVO> harmonic = data.stream().filter(temp -> temp.getType() == 1).collect(Collectors.toList());
|
||||||
|
// List<EventDetailVO> alarm = data.stream().filter(temp -> temp.getType() == 3).collect(Collectors.toList());
|
||||||
|
//
|
||||||
|
// if(Objects.equals(userRole, AppRoleEnum.APP_VIP_USER.getCode())){
|
||||||
|
// alarm = alarm.stream().filter(temp -> Objects.equals("3", temp.getLevel())).collect(Collectors.toList());
|
||||||
|
// }
|
||||||
|
// List<EventDetailVO> run = data.stream().filter(temp -> temp.getType() == 2).collect(Collectors.toList());
|
||||||
|
// if(Objects.equals(userRole,AppRoleEnum.APP_VIP_USER.getCode())||Objects.equals(userRole,AppRoleEnum.TOURIST.getCode())
|
||||||
|
// ||Objects.equals(userRole,AppRoleEnum.MARKET_USER.getCode())){
|
||||||
|
// devCountVO.setFeedBackCount(0);
|
||||||
|
//
|
||||||
|
// }else {
|
||||||
|
// CsFeedbackQueryParm csFeedbackQueryParm = new CsFeedbackQueryParm();
|
||||||
|
// csFeedbackQueryParm.setPageNum(1);
|
||||||
|
// csFeedbackQueryParm.setPageSize(100000);
|
||||||
|
// csFeedbackQueryParm.setStatus("1");
|
||||||
|
// Page<CsFeedbackVO> data1 = feedBackFeignClient.queryFeedBackPage(csFeedbackQueryParm).getData();
|
||||||
|
// List<CsFeedbackVO> collect = data1.getRecords().stream().filter(temp -> !Objects.equals(temp.getUserId(), RequestUtil.getUserIndex())).collect(Collectors.toList());
|
||||||
|
// devCountVO.setFeedBackCount(collect.size());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //todo 后续添加警告数,事件数
|
||||||
|
// devCountVO.setEventCount(event.size());
|
||||||
|
// devCountVO.setAlarmCount(alarm.size());
|
||||||
|
// devCountVO.setRunCount(run.size());
|
||||||
|
// devCountVO.setHarmonicCount(harmonic.size());
|
||||||
|
// List<EventDetailVO> curEvent = event.stream().filter(temp -> Objects.equals(temp.getEngineeringid(), id)).collect(Collectors.toList());
|
||||||
|
// List<EventDetailVO> curHarmonic = harmonic.stream().filter(temp -> Objects.equals(temp.getEngineeringid(), id)).collect(Collectors.toList());
|
||||||
|
// List<EventDetailVO> curAlarm = alarm.stream().filter(temp -> Objects.equals(temp.getEngineeringid(), id)).collect(Collectors.toList());
|
||||||
|
// List<EventDetailVO> curRun = run.stream().filter(temp -> Objects.equals(temp.getEngineeringid(), id)).collect(Collectors.toList());
|
||||||
|
//
|
||||||
|
// devCountVO.setCurrentEventCount(curEvent.size());
|
||||||
|
// devCountVO.setCurrentAlarmCount(curAlarm.size());
|
||||||
|
// devCountVO.setCurrentRunCount(curRun.size());
|
||||||
|
// devCountVO.setCurrentHarmonicCount(curHarmonic.size());
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// return devCountVO;
|
||||||
|
// }
|
||||||
/**
|
/**
|
||||||
* @Description: 判断当前用户是否是主用户 0-否1-是
|
* @Description: 判断当前用户是否是主用户 0-否1-是
|
||||||
* @Param:
|
* @Param:
|
||||||
@@ -406,7 +539,12 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
|||||||
@Override
|
@Override
|
||||||
public List<String> findDevByUserId(String userId) {
|
public List<String> findDevByUserId(String userId) {
|
||||||
List<String> result = new ArrayList<>();
|
List<String> result = new ArrayList<>();
|
||||||
List<CsDeviceUserPO> list = this.lambdaQuery().eq(CsDeviceUserPO::getPrimaryUserId,userId).list();
|
LambdaQueryWrapper<CsDeviceUserPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.and(wrapper ->
|
||||||
|
wrapper.eq(CsDeviceUserPO::getPrimaryUserId, userId)
|
||||||
|
.or()
|
||||||
|
.eq(CsDeviceUserPO::getSubUserId, userId));
|
||||||
|
List<CsDeviceUserPO> list = this.list(queryWrapper);
|
||||||
if (CollectionUtil.isNotEmpty(list)){
|
if (CollectionUtil.isNotEmpty(list)){
|
||||||
result = list.stream().map(CsDeviceUserPO::getDeviceId).collect(Collectors.toList());
|
result = list.stream().map(CsDeviceUserPO::getDeviceId).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
@@ -416,8 +554,28 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
|||||||
@Override
|
@Override
|
||||||
public void channelDevByUserId(UserDevParam param) {
|
public void channelDevByUserId(UserDevParam param) {
|
||||||
LambdaQueryWrapper<CsDeviceUserPO> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<CsDeviceUserPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(CsDeviceUserPO::getPrimaryUserId,param.getUserId())
|
queryWrapper.and(wrapper ->
|
||||||
.in(CsDeviceUserPO::getDeviceId,param.getList());
|
wrapper.eq(CsDeviceUserPO::getPrimaryUserId, param.getUserId())
|
||||||
|
.or()
|
||||||
|
.eq(CsDeviceUserPO::getSubUserId, param.getUserId())
|
||||||
|
).in(CsDeviceUserPO::getDeviceId, param.getList());
|
||||||
this.remove(queryWrapper);
|
this.remove(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CsDeviceUserPO> getList(UserDevParam param) {
|
||||||
|
LambdaQueryWrapper<CsDeviceUserPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
if (StringUtils.isNotBlank(param.getUserId())) {
|
||||||
|
queryWrapper.and(wrapper ->
|
||||||
|
wrapper.eq(CsDeviceUserPO::getPrimaryUserId, param.getUserId())
|
||||||
|
.or()
|
||||||
|
.eq(CsDeviceUserPO::getSubUserId, param.getUserId())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(param.getList())) {
|
||||||
|
queryWrapper.in(CsDeviceUserPO::getDeviceId, param.getList());
|
||||||
|
}
|
||||||
|
queryWrapper.eq(CsDeviceUserPO::getStatus, "1");
|
||||||
|
return this.list(queryWrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@@ -83,7 +84,7 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
|||||||
csLedger1.setLevel(0);
|
csLedger1.setLevel(0);
|
||||||
csLedger1.setName(csEngineeringPO.getName());
|
csLedger1.setName(csEngineeringPO.getName());
|
||||||
csLedger1.setState(1);
|
csLedger1.setState(1);
|
||||||
csLedger1.setSort(0);
|
csLedger1.setSort(csEngineeringAddParm.getSort());
|
||||||
csLedgerMapper.insert(csLedger1);
|
csLedgerMapper.insert(csLedger1);
|
||||||
//绑定用户
|
//绑定用户
|
||||||
CsEngineeringUserPO po = new CsEngineeringUserPO();
|
CsEngineeringUserPO po = new CsEngineeringUserPO();
|
||||||
@@ -163,8 +164,9 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
|||||||
|
|
||||||
queryWrapper.eq (StringUtils.isNotBlank (csEngineeringQueryParm.getProvince ()),"province",csEngineeringQueryParm.getProvince ()).
|
queryWrapper.eq (StringUtils.isNotBlank (csEngineeringQueryParm.getProvince ()),"province",csEngineeringQueryParm.getProvince ()).
|
||||||
eq (StringUtils.isNotBlank (csEngineeringQueryParm.getCity ()),"city",csEngineeringQueryParm.getCity ()).
|
eq (StringUtils.isNotBlank (csEngineeringQueryParm.getCity ()),"city",csEngineeringQueryParm.getCity ()).
|
||||||
eq ("status","1" ).
|
eq ("status","1" )
|
||||||
like (StringUtils.isNotBlank (csEngineeringQueryParm.getName ()),"name",csEngineeringQueryParm.getName ()).orderByDesc("create_time");
|
.ne("name","便携式工程").
|
||||||
|
like (StringUtils.isNotBlank (csEngineeringQueryParm.getName ()),"name",csEngineeringQueryParm.getName ()).orderByAsc("sort");
|
||||||
List<CsEngineeringPO> csEngineeringPOS = this.getBaseMapper ( ).selectList (queryWrapper);
|
List<CsEngineeringPO> csEngineeringPOS = this.getBaseMapper ( ).selectList (queryWrapper);
|
||||||
csEngineeringVOList = csEngineeringPOS.stream ().map (temp->{
|
csEngineeringVOList = csEngineeringPOS.stream ().map (temp->{
|
||||||
CsEngineeringVO vo = new CsEngineeringVO();
|
CsEngineeringVO vo = new CsEngineeringVO();
|
||||||
@@ -195,6 +197,7 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
|||||||
queryWrapper.eq (StringUtils.isNotBlank (csEngineeringQueryPageParm.getProvince ()),"province",csEngineeringQueryPageParm.getProvince ()).
|
queryWrapper.eq (StringUtils.isNotBlank (csEngineeringQueryPageParm.getProvince ()),"province",csEngineeringQueryPageParm.getProvince ()).
|
||||||
eq (StringUtils.isNotBlank (csEngineeringQueryPageParm.getCity ()),"city",csEngineeringQueryPageParm.getCity ()).
|
eq (StringUtils.isNotBlank (csEngineeringQueryPageParm.getCity ()),"city",csEngineeringQueryPageParm.getCity ()).
|
||||||
eq ("status","1" ).
|
eq ("status","1" ).
|
||||||
|
ne("name","便携式工程").
|
||||||
like (StringUtils.isNotBlank (csEngineeringQueryPageParm.getName ()),"name",csEngineeringQueryPageParm.getName ()).orderByDesc("create_time");
|
like (StringUtils.isNotBlank (csEngineeringQueryPageParm.getName ()),"name",csEngineeringQueryPageParm.getName ()).orderByDesc("create_time");
|
||||||
Page<CsEngineeringPO> csEngineeringPOPage = this.getBaseMapper ( ).selectPage (tempPage, queryWrapper);
|
Page<CsEngineeringPO> csEngineeringPOPage = this.getBaseMapper ( ).selectPage (tempPage, queryWrapper);
|
||||||
List<CsEngineeringVO> collect = csEngineeringPOPage.getRecords ( ).stream ( ).map (temp -> {
|
List<CsEngineeringVO> collect = csEngineeringPOPage.getRecords ( ).stream ( ).map (temp -> {
|
||||||
@@ -259,6 +262,49 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CsEngineeringPO add(CsEngineeringAddParm csEngineeringAddParm) {
|
||||||
|
List<CsEngineeringPO> list = this.lambdaQuery().eq(CsEngineeringPO::getName, csEngineeringAddParm.getName()).eq(CsEngineeringPO::getStatus, "1").list();
|
||||||
|
if(!list.isEmpty()){
|
||||||
|
throw new BusinessException("新增失败,工程名重复");
|
||||||
|
}
|
||||||
|
//新增工程
|
||||||
|
CsEngineeringPO po = new CsEngineeringPO ();
|
||||||
|
BeanUtils.copyProperties (csEngineeringAddParm, po);
|
||||||
|
po.setStatus ("1");
|
||||||
|
this.save(po);
|
||||||
|
return po;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CsEngineeringPO updateData(CsEngineeringAuditParm csEngineeringAuditParm) {
|
||||||
|
List<CsEngineeringPO> list = this.lambdaQuery()
|
||||||
|
.eq(CsEngineeringPO::getName, csEngineeringAuditParm.getName())
|
||||||
|
.eq(CsEngineeringPO::getStatus, "1")
|
||||||
|
.ne(CsEngineeringPO::getId, csEngineeringAuditParm.getId())
|
||||||
|
.list();
|
||||||
|
if(!list.isEmpty()){
|
||||||
|
throw new BusinessException("修改失败,工程名重复");
|
||||||
|
}
|
||||||
|
CsEngineeringPO po = new CsEngineeringPO();
|
||||||
|
BeanUtils.copyProperties(csEngineeringAuditParm, po);
|
||||||
|
this.updateById(po);
|
||||||
|
return po;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean deleteData(String id) {
|
||||||
|
LambdaUpdateWrapper<CsEngineeringPO> queryWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
queryWrapper.eq(CsEngineeringPO::getId,id).set(CsEngineeringPO::getStatus,"0");
|
||||||
|
return this.update(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CsEngineeringPO getEngineeringByName(String name) {
|
||||||
|
LambdaQueryWrapper<CsEngineeringPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(CsEngineeringPO::getName,name).eq(CsEngineeringPO::getStatus,1);
|
||||||
|
return this.getOne(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
public String getAreaById(String id){
|
public String getAreaById(String id){
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import cn.afterturn.easypoi.excel.entity.ImportParams;
|
|||||||
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
|
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.text.StrPool;
|
import cn.hutool.core.text.StrPool;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
@@ -23,12 +24,14 @@ import com.njcn.access.utils.MqttUtil;
|
|||||||
import com.njcn.common.pojo.dto.DeviceLogDTO;
|
import com.njcn.common.pojo.dto.DeviceLogDTO;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.csdevice.api.CsLogsFeignClient;
|
import com.njcn.csdevice.api.CsLogsFeignClient;
|
||||||
|
import com.njcn.csdevice.api.EngineeringFeignClient;
|
||||||
import com.njcn.csdevice.constant.DataParam;
|
import com.njcn.csdevice.constant.DataParam;
|
||||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
||||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||||
import com.njcn.csdevice.mapper.CsSoftInfoMapper;
|
import com.njcn.csdevice.mapper.CsSoftInfoMapper;
|
||||||
import com.njcn.csdevice.mapper.CsTerminalLogsMapper;
|
import com.njcn.csdevice.mapper.CsTerminalLogsMapper;
|
||||||
|
import com.njcn.csdevice.pojo.dto.PqsCommunicateDto;
|
||||||
import com.njcn.csdevice.pojo.param.*;
|
import com.njcn.csdevice.pojo.param.*;
|
||||||
import com.njcn.csdevice.pojo.po.*;
|
import com.njcn.csdevice.pojo.po.*;
|
||||||
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
||||||
@@ -46,7 +49,6 @@ import com.njcn.system.api.DicDataFeignClient;
|
|||||||
import com.njcn.system.api.DictTreeFeignClient;
|
import com.njcn.system.api.DictTreeFeignClient;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
import com.njcn.system.enums.DicTreeEnum;
|
|
||||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||||
import com.njcn.user.enums.AppRoleEnum;
|
import com.njcn.user.enums.AppRoleEnum;
|
||||||
@@ -67,6 +69,7 @@ import java.io.ByteArrayOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
/**
|
/**
|
||||||
@@ -103,7 +106,9 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
private final CsDevModelService csDevModelService;
|
private final CsDevModelService csDevModelService;
|
||||||
private final CsLedgerMapper csLedgerMapper;
|
private final CsLedgerMapper csLedgerMapper;
|
||||||
private final CsTerminalLogsMapper csTerminalLogsMapper;
|
private final CsTerminalLogsMapper csTerminalLogsMapper;
|
||||||
|
private final ICsCommunicateService csCommunicateService;
|
||||||
|
private final ICsUserPinsService csUserPinsService;
|
||||||
|
private final EngineeringFeignClient engineeringFeignClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void refreshDeviceDataCache() {
|
public void refreshDeviceDataCache() {
|
||||||
@@ -117,8 +122,12 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public CsEquipmentDeliveryPO save(CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm) {
|
public CsEquipmentDeliveryPO save(CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm) {
|
||||||
boolean result;
|
boolean result;
|
||||||
CsEquipmentDeliveryPO one = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getName, csEquipmentDeliveryAddParm.getName()).ne(CsEquipmentDeliveryPO::getRunStatus, 0).one();
|
List<CsEquipmentDeliveryPO> one = this.lambdaQuery()
|
||||||
if(Objects.nonNull (one)){
|
.eq(CsEquipmentDeliveryPO::getName, csEquipmentDeliveryAddParm.getName())
|
||||||
|
.ne(CsEquipmentDeliveryPO::getRunStatus, 0)
|
||||||
|
.eq(CsEquipmentDeliveryPO::getDevAccessMethod, "MQTT")
|
||||||
|
.list();
|
||||||
|
if(CollUtil.isNotEmpty(one)){
|
||||||
throw new BusinessException ("设备名称不能重复");
|
throw new BusinessException ("设备名称不能重复");
|
||||||
}
|
}
|
||||||
StringUtil.containsSpecialCharacters(csEquipmentDeliveryAddParm.getNdid());
|
StringUtil.containsSpecialCharacters(csEquipmentDeliveryAddParm.getNdid());
|
||||||
@@ -131,12 +140,13 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
csEquipmentDeliveryPo.setStatus (1);
|
csEquipmentDeliveryPo.setStatus (1);
|
||||||
csEquipmentDeliveryPo.setRunStatus(1);
|
csEquipmentDeliveryPo.setRunStatus(1);
|
||||||
csEquipmentDeliveryPo.setUsageStatus(1);
|
csEquipmentDeliveryPo.setUsageStatus(1);
|
||||||
String code = dictTreeFeignClient.queryById(csEquipmentDeliveryAddParm.getDevType()).getData().getCode();
|
// String code = dictTreeFeignClient.queryById(csEquipmentDeliveryAddParm.getDevType()).getData().getCode();
|
||||||
if (Objects.equals(DicDataEnum.PORTABLE.getCode(),code)) {
|
// if (Objects.equals(DicDataEnum.PORTABLE.getCode(),code)) {
|
||||||
|
// csEquipmentDeliveryPo.setProcess(4);
|
||||||
|
// } else if (Objects.equals(DicDataEnum.CONNECT_DEV.getCode(),code)) {
|
||||||
|
// csEquipmentDeliveryPo.setProcess(2);
|
||||||
|
// }
|
||||||
csEquipmentDeliveryPo.setProcess(4);
|
csEquipmentDeliveryPo.setProcess(4);
|
||||||
} else if (Objects.equals(DicDataEnum.CONNECT_DEV.getCode(),code)) {
|
|
||||||
csEquipmentDeliveryPo.setProcess(2);
|
|
||||||
}
|
|
||||||
//生成二维码文件
|
//生成二维码文件
|
||||||
String qr = this.createQr(csEquipmentDeliveryAddParm.getNdid());
|
String qr = this.createQr(csEquipmentDeliveryAddParm.getNdid());
|
||||||
csEquipmentDeliveryPo.setQrPath(qr);
|
csEquipmentDeliveryPo.setQrPath(qr);
|
||||||
@@ -147,11 +157,16 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
csEquipmentProcess.setDevId(csEquipmentDeliveryAddParm.getNdid());
|
csEquipmentProcess.setDevId(csEquipmentDeliveryAddParm.getNdid());
|
||||||
csEquipmentProcess.setOperator(RequestUtil.getUserIndex());
|
csEquipmentProcess.setOperator(RequestUtil.getUserIndex());
|
||||||
csEquipmentProcess.setStartTime(LocalDateTime.now());
|
csEquipmentProcess.setStartTime(LocalDateTime.now());
|
||||||
csEquipmentProcess.setProcess(1);
|
// csEquipmentProcess.setProcess(1);
|
||||||
|
csEquipmentProcess.setProcess(4);
|
||||||
csEquipmentProcess.setStatus (1);
|
csEquipmentProcess.setStatus (1);
|
||||||
csEquipmentProcessPOService.save(csEquipmentProcess);
|
csEquipmentProcessPOService.save(csEquipmentProcess);
|
||||||
result = this.save (csEquipmentDeliveryPo);
|
result = this.save (csEquipmentDeliveryPo);
|
||||||
if (result) {
|
|
||||||
|
//谁新建的设备,则认为是该设备的主用户,新建用户设备关系表数据
|
||||||
|
boolean addUser = csDeviceUserPOService.add(csEquipmentDeliveryPo.getId());
|
||||||
|
|
||||||
|
if (result && addUser) {
|
||||||
refreshDeviceDataCache();
|
refreshDeviceDataCache();
|
||||||
}
|
}
|
||||||
return csEquipmentDeliveryPo;
|
return csEquipmentDeliveryPo;
|
||||||
@@ -206,6 +221,8 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
BeanUtils.copyProperties (csEquipmentDeliveryPO,result);
|
BeanUtils.copyProperties (csEquipmentDeliveryPO,result);
|
||||||
|
result.setAssociatedEngineeringName(csLedgerService.findDataById(csEquipmentDeliveryPO.getAssociatedEngineering()).getName());
|
||||||
|
result.setAssociatedProjectName(csLedgerService.findDataById(csEquipmentDeliveryPO.getAssociatedProject()).getName());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,9 +242,49 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
return returnpage;
|
return returnpage;
|
||||||
}
|
}
|
||||||
Page<ProjectEquipmentVO> list = this.baseMapper.queryProjectEquipmentVO(returnpage,projectEquipmentQueryParm,device);
|
Page<ProjectEquipmentVO> list = this.baseMapper.queryProjectEquipmentVO(returnpage,projectEquipmentQueryParm,device);
|
||||||
list.getRecords().stream().forEach(temp->{
|
//根据设备id获取监测点id集合
|
||||||
|
List<CsLinePO> lineIds = csLinePOService.getLineByDev(device);
|
||||||
|
|
||||||
|
|
||||||
|
List<ProjectEquipmentVO> recordList = new ArrayList<>();
|
||||||
|
list.getRecords().forEach(temp->{
|
||||||
temp.setIsPrimaryUser(csDeviceUserPOService.isPrimaryUser(temp.getEquipmentId()));
|
temp.setIsPrimaryUser(csDeviceUserPOService.isPrimaryUser(temp.getEquipmentId()));
|
||||||
|
//获取设备类型
|
||||||
|
SysDicTreePO po = dictTreeFeignClient.queryById(temp.getDevType()).getData();
|
||||||
|
temp.setDevType(po.getCode());
|
||||||
|
temp.setLineList(lineIds.stream().filter(line -> line.getDevId().equals(temp.getEquipmentId())).sorted(Comparator.comparing(CsLinePO::getLineId)).collect(Collectors.toList()));
|
||||||
|
if (!Objects.equals(DicDataEnum.PORTABLE.getCode(),temp.getDevType())) {
|
||||||
|
recordList.add(temp);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//获取用户置顶的设备
|
||||||
|
List<CsUserPins> topList = csUserPinsService.getPinToTopList();
|
||||||
|
List<String> targetIdList = topList.stream()
|
||||||
|
.filter(item -> Objects.equals(item.getTargetType(), 1))
|
||||||
|
.map(CsUserPins::getTargetId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (CollectionUtil.isNotEmpty(targetIdList)) {
|
||||||
|
List<ProjectEquipmentVO> matchedList = new ArrayList<>();
|
||||||
|
List<ProjectEquipmentVO> unmatchedList = new ArrayList<>();
|
||||||
|
for (ProjectEquipmentVO node : recordList) {
|
||||||
|
if (targetIdList.contains(node.getEquipmentId())) {
|
||||||
|
node.setIsTop(1);
|
||||||
|
matchedList.add(node);
|
||||||
|
} else {
|
||||||
|
unmatchedList.add(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 根据 targetIdList 的顺序对匹配的节点进行排序
|
||||||
|
matchedList.sort(Comparator.comparingInt(node -> targetIdList.indexOf(node.getEquipmentId())));
|
||||||
|
// 未匹配的节点按照原有的 sort 字段排序,处理 null 值情况
|
||||||
|
unmatchedList.sort(Comparator.comparing(node -> node.getSort() != null ? node.getSort() : Integer.MAX_VALUE));
|
||||||
|
// 清空原列表并添加排序后的数据
|
||||||
|
recordList.clear();
|
||||||
|
recordList.addAll(matchedList);
|
||||||
|
recordList.addAll(unmatchedList);
|
||||||
|
list.setRecords(recordList);
|
||||||
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,12 +316,14 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
CsEquipmentDeliveryPO csEquipmentDeliveryPo = new CsEquipmentDeliveryPO();
|
CsEquipmentDeliveryPO csEquipmentDeliveryPo = new CsEquipmentDeliveryPO();
|
||||||
BeanUtils.copyProperties (csEquipmentDeliveryAuditParm, csEquipmentDeliveryPo);
|
BeanUtils.copyProperties (csEquipmentDeliveryAuditParm, csEquipmentDeliveryPo);
|
||||||
result = this.updateById(csEquipmentDeliveryPo);
|
result = this.updateById(csEquipmentDeliveryPo);
|
||||||
//修改台账树中的设备名称
|
//如果是已经接入的设备需要修改台账树中的设备名称
|
||||||
CsLedger csLedger = csLedgerService.findDataById(csEquipmentDeliveryAuditParm.getId());
|
CsLedger csLedger = csLedgerService.findDataById(csEquipmentDeliveryAuditParm.getId());
|
||||||
|
if (ObjectUtil.isNotNull(csLedger)) {
|
||||||
CsLedgerParam.Update csLedgerParam = new CsLedgerParam.Update();
|
CsLedgerParam.Update csLedgerParam = new CsLedgerParam.Update();
|
||||||
BeanUtils.copyProperties (csLedger, csLedgerParam);
|
BeanUtils.copyProperties (csLedger, csLedgerParam);
|
||||||
csLedgerParam.setName(csEquipmentDeliveryAuditParm.getName());
|
csLedgerParam.setName(csEquipmentDeliveryAuditParm.getName());
|
||||||
csLedgerService.updateLedgerTree(csLedgerParam);
|
csLedgerService.updateLedgerTree(csLedgerParam);
|
||||||
|
}
|
||||||
if (result) {
|
if (result) {
|
||||||
refreshDeviceDataCache();
|
refreshDeviceDataCache();
|
||||||
if (!Objects.equals(po.getUsageStatus(),csEquipmentDeliveryAuditParm.getUsageStatus())) {
|
if (!Objects.equals(po.getUsageStatus(),csEquipmentDeliveryAuditParm.getUsageStatus())) {
|
||||||
@@ -376,7 +435,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
dataSet = csDataSetService.findDataSetByModelId(modelId,2);
|
dataSet = csDataSetService.findDataSetByModelId(modelId,2);
|
||||||
}
|
}
|
||||||
setDataSetValues(csEquipmentDeliveryPo, dataSet, dataSetList, type, deviceManagerVo);
|
setDataSetValues(csEquipmentDeliveryPo, dataSet, dataSetList, type, deviceManagerVo);
|
||||||
} else if(Objects.equals(devTypeCode, DicDataEnum.PORTABLE.getCode()) || Objects.equals(devTypeCode, DicDataEnum.DEV_CLD.getCode())){
|
} else if(Objects.equals(devTypeCode, DicDataEnum.PORTABLE.getCode())){
|
||||||
List<CsDataSet> dataSet = new ArrayList<>();
|
List<CsDataSet> dataSet = new ArrayList<>();
|
||||||
List<CsDevModelRelationPO> modelId = csDevModelRelationService.findModelByDevId(deviceId);
|
List<CsDevModelRelationPO> modelId = csDevModelRelationService.findModelByDevId(deviceId);
|
||||||
if (CollUtil.isNotEmpty(modelId)){
|
if (CollUtil.isNotEmpty(modelId)){
|
||||||
@@ -385,6 +444,15 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
}
|
}
|
||||||
setDataSetValues(csEquipmentDeliveryPo, dataSet, dataSetList, type, deviceManagerVo);
|
setDataSetValues(csEquipmentDeliveryPo, dataSet, dataSetList, type, deviceManagerVo);
|
||||||
}
|
}
|
||||||
|
} else if(Objects.equals(devTypeCode, DicDataEnum.DEV_CLD.getCode())){
|
||||||
|
List<CsDataSet> dataSet = new ArrayList<>();
|
||||||
|
List<CsDevModelRelationPO> modelId = csDevModelRelationService.findModelByDevId(deviceId);
|
||||||
|
if (CollUtil.isNotEmpty(modelId)){
|
||||||
|
for (CsDevModelRelationPO item : modelId) {
|
||||||
|
dataSet.addAll(csDataSetService.findDataSetByModelId(item.getModelId(),1));
|
||||||
|
}
|
||||||
|
setDataSetValues(csEquipmentDeliveryPo, dataSet, dataSetList, type, deviceManagerVo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return deviceManagerVo;
|
return deviceManagerVo;
|
||||||
@@ -431,12 +499,14 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
addDataSet(dataSetList, item, "实时数据", "realtimedata");
|
addDataSet(dataSetList, item, "实时数据", "realtimedata");
|
||||||
addDataSet(dataSetList, item, "暂态事件", "event");
|
addDataSet(dataSetList, item, "暂态事件", "event");
|
||||||
}
|
}
|
||||||
|
addDataSet(dataSetList, item, "运行趋势", "devRunTrend");
|
||||||
deviceManagerVo.setDataLevel(item.getDataLevel());
|
deviceManagerVo.setDataLevel(item.getDataLevel());
|
||||||
}
|
}
|
||||||
deviceManagerVo.setDataSetList(dataSetList);
|
deviceManagerVo.setDataSetList(dataSetList);
|
||||||
List<CsLinePO> csLinePOS = csLinePOService.findByNdid(csEquipmentDeliveryPo.getNdid());
|
List<CsLinePO> csLinePOS = csLinePOService.findByNdid(csEquipmentDeliveryPo.getNdid());
|
||||||
if(!csLinePOS.isEmpty() && csLinePOS.get(0)!=null){
|
if(!csLinePOS.isEmpty()){
|
||||||
deviceManagerVo.setTime(csLinePOService.findByNdid(csEquipmentDeliveryPo.getNdid()).get(0).getCreateTime());
|
Optional<CsLinePO> earliest = csLinePOS.stream().min(Comparator.comparing(CsLinePO::getCreateTime));
|
||||||
|
deviceManagerVo.setTime(earliest.map(CsLinePO::getCreateTime).orElse(null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -546,13 +616,15 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
csEquipmentDeliveryPO.setMac(path);
|
csEquipmentDeliveryPO.setMac(path);
|
||||||
csEquipmentDeliveryPO.setRunStatus(1);
|
csEquipmentDeliveryPO.setRunStatus(1);
|
||||||
csEquipmentDeliveryPO.setStatus(1);
|
csEquipmentDeliveryPO.setStatus(1);
|
||||||
csEquipmentDeliveryPO.setProcess(2);
|
// csEquipmentDeliveryPO.setProcess(2);
|
||||||
|
csEquipmentDeliveryPO.setProcess(4);
|
||||||
csEquipmentDeliveryPO.setSort(100);
|
csEquipmentDeliveryPO.setSort(100);
|
||||||
CsEquipmentProcessPO csEquipmentProcess = new CsEquipmentProcessPO();
|
CsEquipmentProcessPO csEquipmentProcess = new CsEquipmentProcessPO();
|
||||||
csEquipmentProcess.setDevId(csEquipmentDeliveryPO.getNdid());
|
csEquipmentProcess.setDevId(csEquipmentDeliveryPO.getNdid());
|
||||||
csEquipmentProcess.setOperator(RequestUtil.getUserIndex());
|
csEquipmentProcess.setOperator(RequestUtil.getUserIndex());
|
||||||
csEquipmentProcess.setStartTime(LocalDateTime.now());
|
csEquipmentProcess.setStartTime(LocalDateTime.now());
|
||||||
csEquipmentProcess.setProcess(1);
|
// csEquipmentProcess.setProcess(1);
|
||||||
|
csEquipmentProcess.setProcess(4);
|
||||||
csEquipmentProcess.setStatus(1);
|
csEquipmentProcess.setStatus(1);
|
||||||
collect1.add(csEquipmentProcess);
|
collect1.add(csEquipmentProcess);
|
||||||
return csEquipmentDeliveryPO;
|
return csEquipmentDeliveryPO;
|
||||||
@@ -683,6 +755,20 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateLedger(String nDid,String engineeringId,String projectId) {
|
||||||
|
boolean result;
|
||||||
|
LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
lambdaUpdateWrapper.eq(CsEquipmentDeliveryPO::getNdid,nDid)
|
||||||
|
.ne(CsEquipmentDeliveryPO::getRunStatus,0)
|
||||||
|
.set(CsEquipmentDeliveryPO::getAssociatedEngineering,engineeringId)
|
||||||
|
.set(CsEquipmentDeliveryPO::getAssociatedProject,projectId);
|
||||||
|
result = this.update(lambdaUpdateWrapper);
|
||||||
|
if (result) {
|
||||||
|
refreshDeviceDataCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean rebootDevice(String nDid) {
|
public boolean rebootDevice(String nDid) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
@@ -722,9 +808,9 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
boolean result = false;
|
boolean result = false;
|
||||||
//获取装置id
|
//获取装置id
|
||||||
CsEquipmentDeliveryPO po = findDevByNDid(nDid);
|
CsEquipmentDeliveryPO po = findDevByNDid(nDid);
|
||||||
//设备型号
|
//设备类型
|
||||||
String code = dictTreeFeignClient.queryById(po.getDevModel()).getData().getCode();
|
String code = dictTreeFeignClient.queryById(po.getDevType()).getData().getCode();
|
||||||
if (Objects.equals(DicTreeEnum.PQ_COM.getCode(),code)) {
|
if (Objects.equals(DicDataEnum.DEV_CLD.getCode(),code) || Objects.equals(DicDataEnum.CONNECT_DEV.getCode(),code)) {
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -740,10 +826,11 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public CsEquipmentDeliveryPO saveCld(CsEquipmentDeliveryAddParm param) {
|
public CsEquipmentDeliveryPO saveCld(CsEquipmentDeliveryAddParm param) {
|
||||||
boolean result;
|
boolean result;
|
||||||
CsEquipmentDeliveryPO one = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getName, param.getName()).ne(CsEquipmentDeliveryPO::getRunStatus, 0).one();
|
//设备名称可以重复
|
||||||
if(Objects.nonNull (one)){
|
//CsEquipmentDeliveryPO one = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getName, param.getName()).ne(CsEquipmentDeliveryPO::getRunStatus, 0).one();
|
||||||
throw new BusinessException ("设备名称不能重复");
|
//if(Objects.nonNull (one)){
|
||||||
}
|
// throw new BusinessException ("设备名称不能重复");
|
||||||
|
//}
|
||||||
StringUtil.containsSpecialCharacters(param.getNdid());
|
StringUtil.containsSpecialCharacters(param.getNdid());
|
||||||
CsEquipmentDeliveryPO po = this.queryEquipmentPOByndid (param.getNdid());
|
CsEquipmentDeliveryPO po = this.queryEquipmentPOByndid (param.getNdid());
|
||||||
if(!Objects.isNull (po)){
|
if(!Objects.isNull (po)){
|
||||||
@@ -789,7 +876,10 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
csLedger.setSort(0);
|
csLedger.setSort(0);
|
||||||
int addLedger = csLedgerMapper.insert(csLedger);
|
int addLedger = csLedgerMapper.insert(csLedger);
|
||||||
|
|
||||||
if (result && ObjectUtil.isNotNull(relation) && addLedger > 0) {
|
//谁新建的设备,则认为是该设备的主用户,新建用户设备关系表数据
|
||||||
|
boolean addUser = csDeviceUserPOService.add(csEquipmentDeliveryPo.getId());
|
||||||
|
|
||||||
|
if (result && ObjectUtil.isNotNull(relation) && addLedger > 0 && addUser) {
|
||||||
refreshDeviceDataCache();
|
refreshDeviceDataCache();
|
||||||
}
|
}
|
||||||
return csEquipmentDeliveryPo;
|
return csEquipmentDeliveryPo;
|
||||||
@@ -932,17 +1022,17 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
List<CsEquipmentDeliveryPO> devList = this.list(lambdaQueryWrapper);
|
List<CsEquipmentDeliveryPO> devList = this.list(lambdaQueryWrapper);
|
||||||
if (CollectionUtil.isNotEmpty(devList)) {
|
if (CollectionUtil.isNotEmpty(devList)) {
|
||||||
//修改设备运行状态
|
//修改设备运行状态
|
||||||
devList.forEach(item->{item.setRunStatus(1);});
|
devList.forEach(item->{
|
||||||
|
item.setRunStatus(1);
|
||||||
|
insertPqsCommunicateRecord(LocalDateTime.now().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)), item.getNdid(), 0);
|
||||||
|
});
|
||||||
this.updateBatchById(devList);
|
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
|
@Override
|
||||||
public void flipCldDevStatus(String devId, Integer status) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void flipCldDevStatus(String time, String devId, Integer status) {
|
||||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getId,devId)
|
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getId,devId)
|
||||||
.eq(CsEquipmentDeliveryPO::getUsageStatus,1)
|
.eq(CsEquipmentDeliveryPO::getUsageStatus,1)
|
||||||
@@ -951,12 +1041,22 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
if (ObjectUtil.isNotNull(po)) {
|
if (ObjectUtil.isNotNull(po)) {
|
||||||
po.setRunStatus(status);
|
po.setRunStatus(status);
|
||||||
this.updateById(po);
|
this.updateById(po);
|
||||||
//修改监测点运行状态
|
//修改设备的运行状态,则录入influxdb表数据
|
||||||
List<CsLinePO> lineList = csLinePOService.getLinesByDevList(Collections.singletonList(po.getId()));
|
int communicateType = status == 2 ? 1 : 0;
|
||||||
csLinePOService.updateCldLineStatus(lineList,status==1?2:0);
|
insertPqsCommunicateRecord(time, po.getNdid(), communicateType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 时序数据库写入数据
|
||||||
|
private void insertPqsCommunicateRecord(String time, String devId, Integer status) {
|
||||||
|
PqsCommunicateDto pqsCommunicateDto = new PqsCommunicateDto();
|
||||||
|
pqsCommunicateDto.setTime(time);
|
||||||
|
pqsCommunicateDto.setDevId(devId);
|
||||||
|
pqsCommunicateDto.setType(status);
|
||||||
|
pqsCommunicateDto.setDescription(status == 0 ? "通讯中断" : "通讯正常");
|
||||||
|
csCommunicateService.insertion(pqsCommunicateDto);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CsEquipmentDeliveryPO> getDevListByProjectId(String projectId) {
|
public List<CsEquipmentDeliveryPO> getDevListByProjectId(String projectId) {
|
||||||
QueryWrapper<CsLedger> csLedgerQueryWrapper = new QueryWrapper();
|
QueryWrapper<CsLedger> csLedgerQueryWrapper = new QueryWrapper();
|
||||||
@@ -990,7 +1090,9 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
public List<CsEquipmentDeliveryPO> getRunPortableDev(String userId) {
|
public List<CsEquipmentDeliveryPO> getRunPortableDev(String userId) {
|
||||||
List<CsEquipmentDeliveryPO> result = new ArrayList<>();
|
List<CsEquipmentDeliveryPO> result = new ArrayList<>();
|
||||||
DictTreeVO vo = dictTreeFeignClient.queryByCode(DicDataEnum.PORTABLE.getCode()).getData();
|
DictTreeVO vo = dictTreeFeignClient.queryByCode(DicDataEnum.PORTABLE.getCode()).getData();
|
||||||
if (ObjectUtil.isNotNull(vo)) {
|
if (ObjectUtil.isNull(vo)) {
|
||||||
|
throw new BusinessException("便携式设备类型字典缺失");
|
||||||
|
}
|
||||||
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getDevType,vo.getId())
|
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getDevType,vo.getId())
|
||||||
.ne(CsEquipmentDeliveryPO::getRunStatus,0)
|
.ne(CsEquipmentDeliveryPO::getRunStatus,0)
|
||||||
@@ -1001,6 +1103,23 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
lambdaQueryWrapper.notIn(CsEquipmentDeliveryPO::getId,devList);
|
lambdaQueryWrapper.notIn(CsEquipmentDeliveryPO::getId,devList);
|
||||||
}
|
}
|
||||||
result = this.list(lambdaQueryWrapper);
|
result = this.list(lambdaQueryWrapper);
|
||||||
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
|
//获取已经接入过系统的设备,未接入的不给分配
|
||||||
|
LambdaQueryWrapper<CsLedger> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
List<String> ids = result.stream().map(CsEquipmentDeliveryPO::getId).collect(Collectors.toList());
|
||||||
|
queryWrapper.in(CsLedger::getId,ids);
|
||||||
|
List<CsLedger> list = csLedgerService.list(queryWrapper);
|
||||||
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
|
Set<String> idSet = list.stream()
|
||||||
|
.map(CsLedger::getId)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
return result.stream()
|
||||||
|
.filter(data -> idSet.contains(data.getId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
result.clear();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.json.JSONConfig;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@@ -19,7 +20,10 @@ import com.njcn.csdevice.api.EquipmentFeignClient;
|
|||||||
import com.njcn.csdevice.constant.DataParam;
|
import com.njcn.csdevice.constant.DataParam;
|
||||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||||
import com.njcn.csdevice.mapper.*;
|
import com.njcn.csdevice.mapper.CsDataArrayMapper;
|
||||||
|
import com.njcn.csdevice.mapper.CsDataSetMapper;
|
||||||
|
import com.njcn.csdevice.mapper.CsGroArrMapper;
|
||||||
|
import com.njcn.csdevice.mapper.CsGroupMapper;
|
||||||
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
|
||||||
import com.njcn.csdevice.pojo.param.EnergyBaseParam;
|
import com.njcn.csdevice.pojo.param.EnergyBaseParam;
|
||||||
import com.njcn.csdevice.pojo.po.*;
|
import com.njcn.csdevice.pojo.po.*;
|
||||||
@@ -37,6 +41,8 @@ import com.njcn.csharmonic.constant.HarmonicConstant;
|
|||||||
import com.njcn.csharmonic.param.*;
|
import com.njcn.csharmonic.param.*;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
|
import com.njcn.device.biz.mapper.OverLimitWlMapper;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import com.njcn.influx.pojo.bo.CommonQueryParam;
|
import com.njcn.influx.pojo.bo.CommonQueryParam;
|
||||||
import com.njcn.influx.pojo.dto.EventDataSetDTO;
|
import com.njcn.influx.pojo.dto.EventDataSetDTO;
|
||||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||||
@@ -59,6 +65,11 @@ import java.math.BigDecimal;
|
|||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.ZonedDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@@ -90,12 +101,14 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
private final EvtDataService evtDataService;
|
private final EvtDataService evtDataService;
|
||||||
private final DecimalFormat df = new DecimalFormat("#0.00");
|
private final DecimalFormat df = new DecimalFormat("#0.00");
|
||||||
private final EleEvtFeignClient eleEvtFeignClient;
|
private final EleEvtFeignClient eleEvtFeignClient;
|
||||||
private final OverlimitMapper overlimitMapper;
|
private final OverLimitWlMapper overLimitWlMapper;
|
||||||
private final CsDataSetMapper csDataSetMapper;
|
private final CsDataSetMapper csDataSetMapper;
|
||||||
private final EventFeignClient eventFeignClient;
|
private final EventFeignClient eventFeignClient;
|
||||||
private final InfluxDbParamUtil influxDbParamUtil;
|
private final InfluxDbParamUtil influxDbParamUtil;
|
||||||
private final DictTreeFeignClient dictTreeFeignClient;
|
private final DictTreeFeignClient dictTreeFeignClient;
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
private static final ZoneId DEFAULT_ZONE = ZoneId.systemDefault();
|
||||||
|
|
||||||
private final String GRID_SIDE_DICT_CODE = "Grid_Side";
|
private final String GRID_SIDE_DICT_CODE = "Grid_Side";
|
||||||
private final String LOAD_SIDE_DICT_CODE = "Load_Side";
|
private final String LOAD_SIDE_DICT_CODE = "Load_Side";
|
||||||
@@ -296,9 +309,9 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
//传1 则是趋势数据tab页面
|
//传1 则是趋势数据tab页面
|
||||||
if("1".equals(type)){
|
if("1".equals(type)){
|
||||||
formatQueryParamList(commonStatisticalQueryParam);
|
formatQueryParamList(commonStatisticalQueryParam);
|
||||||
List<ThdDataVO> result = new ArrayList();
|
List<ThdDataVO> result = new ArrayList<>();
|
||||||
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(commonStatisticalQueryParam.getDevId()).collect(Collectors.toList())).getData();
|
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(commonStatisticalQueryParam.getDevId()).collect(Collectors.toList())).getData();
|
||||||
List<CsLinePO> finalCsLinePOList = csLineFeignClient.queryLineById(Arrays.asList(commonStatisticalQueryParam.getLineId())).getData();
|
List<CsLinePO> finalCsLinePOList = csLineFeignClient.queryLineById(Collections.singletonList(commonStatisticalQueryParam.getLineId())).getData();
|
||||||
CsDataSet csDataSet = csDataSetMapper.selectOne(new LambdaQueryWrapper<CsDataSet>().eq(CsDataSet::getId,finalCsLinePOList.get(0).getDataSetId()));
|
CsDataSet csDataSet = csDataSetMapper.selectOne(new LambdaQueryWrapper<CsDataSet>().eq(CsDataSet::getId,finalCsLinePOList.get(0).getDataSetId()));
|
||||||
if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())){
|
if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())){
|
||||||
throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)");
|
throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)");
|
||||||
@@ -438,6 +451,21 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
vo.setAnotherName(epdPqd.getShowName());
|
vo.setAnotherName(epdPqd.getShowName());
|
||||||
return vo;
|
return vo;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
//长时闪变
|
||||||
|
if (Objects.equals(epdPqd.getOtherName(), "plt")) {
|
||||||
|
List<Instant> timeInstants = getTimeInstants(commonStatisticalQueryParam.getStartTime(), commonStatisticalQueryParam.getEndTime(), 2, ChronoUnit.HOURS, DEFAULT_ZONE);
|
||||||
|
collect1 = collect1.stream()
|
||||||
|
.filter(vo -> timeInstants.contains(vo.getTime()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
//短时闪变 || 电压波动
|
||||||
|
else if (Objects.equals(epdPqd.getOtherName(), "pst") || Objects.equals(epdPqd.getOtherName(), "fluc")) {
|
||||||
|
List<Instant> timeInstants = getTimeInstants(commonStatisticalQueryParam.getStartTime(), commonStatisticalQueryParam.getEndTime(), 10, ChronoUnit.MINUTES, DEFAULT_ZONE);
|
||||||
|
collect1 = collect1.stream()
|
||||||
|
.filter(vo -> timeInstants.contains(vo.getTime()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
result.addAll(collect1);
|
result.addAll(collect1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -555,6 +583,20 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<Instant> getTimeInstants(String startDateStr, String endDateStr, long interval, ChronoUnit unit, ZoneId zone) {
|
||||||
|
List<Instant> instants = new ArrayList<>();
|
||||||
|
LocalDate startDate = LocalDate.parse(startDateStr, DATE_FORMATTER);
|
||||||
|
LocalDate endDate = LocalDate.parse(endDateStr, DATE_FORMATTER);
|
||||||
|
// 转换为指定时区的 ZonedDateTime
|
||||||
|
ZonedDateTime current = startDate.atStartOfDay(zone);
|
||||||
|
ZonedDateTime endDateTime = endDate.atTime(23, 59, 59).atZone(zone);
|
||||||
|
while (!current.isAfter(endDateTime)) {
|
||||||
|
instants.add(current.toInstant());
|
||||||
|
current = current.plus(interval, unit);
|
||||||
|
}
|
||||||
|
return instants;
|
||||||
|
}
|
||||||
|
|
||||||
private void formatQueryParamList(CommonStatisticalQueryParam commonStatisticalQueryParam){
|
private void formatQueryParamList(CommonStatisticalQueryParam commonStatisticalQueryParam){
|
||||||
List<CommonStatisticalQueryParam> list = new ArrayList<>();
|
List<CommonStatisticalQueryParam> list = new ArrayList<>();
|
||||||
if(commonStatisticalQueryParam.getList() != null && commonStatisticalQueryParam.getList().size() > 0){
|
if(commonStatisticalQueryParam.getList() != null && commonStatisticalQueryParam.getList().size() > 0){
|
||||||
@@ -579,7 +621,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
@Override
|
@Override
|
||||||
public List<ThdDataTdVO> getDeviceTrendData(String devId, String lineId,String groupId) {
|
public List<ThdDataTdVO> getDeviceTrendData(String devId, String lineId,String groupId) {
|
||||||
List<ThdDataTdVO> data = new ArrayList();
|
List<ThdDataTdVO> data = new ArrayList();
|
||||||
List<Overlimit> overlimits = overlimitMapper.selectBatchIds(Arrays.asList(lineId));
|
List<Overlimit> overlimits = overLimitWlMapper.selectBatchIds(Arrays.asList(lineId));
|
||||||
List<CsLinePO> finalCsLinePOList = csLineFeignClient.queryLineById(Arrays.asList(lineId)).getData();
|
List<CsLinePO> finalCsLinePOList = csLineFeignClient.queryLineById(Arrays.asList(lineId)).getData();
|
||||||
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(devId).collect(Collectors.toList())).getData();
|
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(devId).collect(Collectors.toList())).getData();
|
||||||
//便携式设备-稳态指标-实时数据-指标
|
//便携式设备-稳态指标-实时数据-指标
|
||||||
@@ -928,6 +970,21 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
vo.setAnotherName(epdPqd.getShowName());
|
vo.setAnotherName(epdPqd.getShowName());
|
||||||
return vo;
|
return vo;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
//长时闪变
|
||||||
|
if (Objects.equals(epdPqd.getOtherName(), "plt")) {
|
||||||
|
List<Instant> timeInstants = getTimeInstants(trendDataQueryParam.getSearchBeginTime(), trendDataQueryParam.getSearchEndTime(), 2, ChronoUnit.HOURS, DEFAULT_ZONE);
|
||||||
|
collect1 = collect1.stream()
|
||||||
|
.filter(vo -> timeInstants.contains(vo.getTime()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
//短时闪变 || 电压波动
|
||||||
|
else if (Objects.equals(epdPqd.getOtherName(), "pst") || Objects.equals(epdPqd.getOtherName(), "fluc")) {
|
||||||
|
List<Instant> timeInstants = getTimeInstants(trendDataQueryParam.getSearchBeginTime(), trendDataQueryParam.getSearchEndTime(), 10, ChronoUnit.MINUTES, DEFAULT_ZONE);
|
||||||
|
collect1 = collect1.stream()
|
||||||
|
.filter(vo -> timeInstants.contains(vo.getTime()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
result.addAll(collect1);
|
result.addAll(collect1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -941,13 +998,16 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
CsLinePO finalCsLinePO = csLineFeignClient.getById(fittingDataQueryParam.getLineId()).getData();
|
CsLinePO finalCsLinePO = csLineFeignClient.getById(fittingDataQueryParam.getLineId()).getData();
|
||||||
CsDataSet csDataSet = csDataSetMapper.selectOne(new LambdaQueryWrapper<CsDataSet>().eq(CsDataSet::getId,finalCsLinePO.getDataSetId()));
|
CsDataSet csDataSet = csDataSetMapper.selectOne(new LambdaQueryWrapper<CsDataSet>().eq(CsDataSet::getId,finalCsLinePO.getDataSetId()));
|
||||||
if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())){
|
if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())){
|
||||||
throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)");
|
throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)");
|
||||||
}
|
}
|
||||||
Double ct = finalCsLinePO.getCtRatio();
|
Double ct = finalCsLinePO.getCtRatio();
|
||||||
Double pt = finalCsLinePO.getPtRatio();
|
Double pt = finalCsLinePO.getPtRatio();
|
||||||
// String position = finalCsLinePO.getPosition();
|
// String position = finalCsLinePO.getPosition();
|
||||||
Overlimit overlimit = overlimitMapper.selectById(finalCsLinePO.getLineId());
|
Overlimit overlimit = overLimitWlMapper.selectById(finalCsLinePO.getLineId());
|
||||||
JSONObject entries = JSONUtil.parseObj(overlimit);
|
if (Objects.isNull(overlimit)) {
|
||||||
|
throw new BusinessException("当前测点限值信息缺失,请联系管理员排查");
|
||||||
|
}
|
||||||
|
JSONObject entries = JSONUtil.parseObj(overlimit, new JSONConfig().setIgnoreNullValue(false));
|
||||||
if(CollectionUtil.isNotEmpty(fittingDataQueryParam.getList())) {
|
if(CollectionUtil.isNotEmpty(fittingDataQueryParam.getList())) {
|
||||||
for (FittingDataQueryParam param : fittingDataQueryParam.getList()) {
|
for (FittingDataQueryParam param : fittingDataQueryParam.getList()) {
|
||||||
String dictCode = dictTreeFeignClient.queryById(param.getStatisticalId()).getData().getCode();
|
String dictCode = dictTreeFeignClient.queryById(param.getStatisticalId()).getData().getCode();
|
||||||
@@ -1131,6 +1191,9 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
@Override
|
@Override
|
||||||
public Map<String, List<ThdDataVO>> sensitiveUserTrendData(SensitiveUserTrendDataQueryParam param) {
|
public Map<String, List<ThdDataVO>> sensitiveUserTrendData(SensitiveUserTrendDataQueryParam param) {
|
||||||
Map<String, List<ThdDataVO>> result = new HashMap<>();
|
Map<String, List<ThdDataVO>> result = new HashMap<>();
|
||||||
|
if (Objects.isNull(param.getSensitiveUserId())) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
result.put("before", new ArrayList<>());
|
result.put("before", new ArrayList<>());
|
||||||
result.put("after", new ArrayList<>());
|
result.put("after", new ArrayList<>());
|
||||||
String sensitiveUserId = param.getSensitiveUserId();
|
String sensitiveUserId = param.getSensitiveUserId();
|
||||||
@@ -1150,7 +1213,9 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
List<SensitiveUserTrendDataQueryParam> paramList = param.getList();
|
List<SensitiveUserTrendDataQueryParam> paramList = param.getList();
|
||||||
List<TrendDataQueryParam> indexList = paramList.stream().map(item -> {
|
List<TrendDataQueryParam> indexList = paramList.stream().map(item -> {
|
||||||
TrendDataQueryParam queryParam = new TrendDataQueryParam();
|
TrendDataQueryParam queryParam = new TrendDataQueryParam();
|
||||||
queryParam.setFrequency(item.getFrequency());
|
if (ObjectUtil.isNotNull(param.getHarmonicCount())) {
|
||||||
|
queryParam.setFrequency(String.valueOf(param.getHarmonicCount()));
|
||||||
|
}
|
||||||
queryParam.setStatisticalId(item.getStatisticalId());
|
queryParam.setStatisticalId(item.getStatisticalId());
|
||||||
return queryParam;
|
return queryParam;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user