From bb5c1ddfafb7048edb7a206cdb3325fb483a89c5 Mon Sep 17 00:00:00 2001 From: huangzj <826100833@qq.com> Date: Tue, 31 Oct 2023 10:58:30 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CsDeviceUserPOServiceImpl.java | 2 +- .../impl/CsEquipmentDeliveryServiceImpl.java | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDeviceUserPOServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDeviceUserPOServiceImpl.java index 46061fa..d750c56 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDeviceUserPOServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDeviceUserPOServiceImpl.java @@ -302,7 +302,7 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl list1 = iCsLedgerService.lambdaQuery().eq(CsLedger::getPid, eid).list(); - if(!com.alibaba.nacos.client.naming.utils.CollectionUtils.isEmpty(list1)){ + if(!CollectionUtils.isEmpty(list1)){ List collect = list1.stream().map(CsLedger::getId).collect(Collectors.toList()); LambdaQueryWrapper csLinePOLambdaQueryWrapper = new LambdaQueryWrapper<>(); csLinePOLambdaQueryWrapper.in(CsLinePO::getLineId,collect); diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsEquipmentDeliveryServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsEquipmentDeliveryServiceImpl.java index 1c5b40d..d2125c0 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsEquipmentDeliveryServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsEquipmentDeliveryServiceImpl.java @@ -125,10 +125,10 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl wrapper = new UpdateWrapper(); + //物理删除 + QueryWrapper wrapper = new QueryWrapper(); wrapper.eq ("id", id); - wrapper.set ("run_status", "0"); - boolean update = this.update (wrapper); + boolean update = this.remove (wrapper); //删除deviceuser表里的设备,游客数据设备,删除监测点相关数据 List list = csLedgerService.lambdaQuery().eq(CsLedger::getPid, id).list(); if(!CollectionUtils.isEmpty(list)){ @@ -153,9 +153,9 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl queryWrap = new QueryWrapper<>(); queryWrap.eq("device_id",id); csTouristDataPOService.getBaseMapper().delete(queryWrap); - - CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.getBaseMapper().selectById(id); - mqttUserService.deleteUser(csEquipmentDeliveryPO.getNdid()); + /*后续徐那边做处理*/ +// CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.getBaseMapper().selectById(id); +// mqttUserService.deleteUser(csEquipmentDeliveryPO.getNdid()); csDevModelRelationService.lambdaUpdate().eq(CsDevModelRelationPO::getDevId,id).set(CsDevModelRelationPO::getStatus,0).update(); @@ -496,8 +496,8 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl list = csEquipmentProcessPOService.lambdaQuery().eq(CsEquipmentProcessPO::getDevId, one.getNdid()). @@ -516,8 +516,8 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl list = csEquipmentProcessPOService.lambdaQuery().eq(CsEquipmentProcessPO::getDevId, one.getNdid()). From 06acf7cec7457e3d1fff90f94325fcb03801f074 Mon Sep 17 00:00:00 2001 From: huangzj <826100833@qq.com> Date: Tue, 31 Oct 2023 11:03:35 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9okhttp=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cs-device/cs-device-boot/pom.xml | 20 +++++------ cs-harmonic/cs-harmonic-boot/pom.xml | 20 +++++------ pom.xml | 50 +++++++++++++++++++++++++--- 3 files changed, 65 insertions(+), 25 deletions(-) diff --git a/cs-device/cs-device-boot/pom.xml b/cs-device/cs-device-boot/pom.xml index 110ca75..d007fbd 100644 --- a/cs-device/cs-device-boot/pom.xml +++ b/cs-device/cs-device-boot/pom.xml @@ -63,16 +63,16 @@ pqs-influx 0.0.1-SNAPSHOT - - com.squareup.okhttp3 - okhttp - 4.9.0 - - - com.squareup.okhttp3 - logging-interceptor - 4.9.0 - + + + + + + + + + + com.njcn user-api diff --git a/cs-harmonic/cs-harmonic-boot/pom.xml b/cs-harmonic/cs-harmonic-boot/pom.xml index c2acfeb..cc43399 100644 --- a/cs-harmonic/cs-harmonic-boot/pom.xml +++ b/cs-harmonic/cs-harmonic-boot/pom.xml @@ -46,16 +46,16 @@ ${project.version} - - com.squareup.okhttp3 - okhttp - 4.9.0 - - - com.squareup.okhttp3 - logging-interceptor - 4.9.0 - + + + + + + + + + + com.njcn cs-harmonic-api diff --git a/pom.xml b/pom.xml index 7b01bdd..95b2804 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.njcn @@ -28,8 +28,8 @@ ${middle.server.url}:18848 - 415a1c87-33aa-47bd-8e25-13cc456c87ed - + eccf606c-4213-4ee1-846e-a265a50ae355 + ${middle.server.url}:8080 @@ -85,7 +85,7 @@ 1.2.7 4.4.0 0.5.3 - 4.8.1 + 4.9.0 8.2.1 1.7.0-Hoxton @@ -332,10 +332,50 @@ progressbar ${progressbar.version} + + com.squareup.okhttp3 + logging-interceptor + ${okhttp3.version} + + + com.squareup.okhttp3 + mockwebserver + ${okhttp3.version} + + + com.squareup.okhttp3 + okcurl + ${okhttp3.version} + com.squareup.okhttp3 okhttp - ${okhttp.version} + ${okhttp3.version} + + + com.squareup.okhttp3 + okhttp-dnsoverhttps + ${okhttp3.version} + + + com.squareup.okhttp3 + okhttp-sse + ${okhttp3.version} + + + com.squareup.okhttp3 + okhttp-testing-support + ${okhttp3.version} + + + com.squareup.okhttp3 + okhttp-tls + ${okhttp3.version} + + + com.squareup.okhttp3 + okhttp-urlconnection + ${okhttp3.version} io.minio From ca75ef7102e74186ff4b8efb2753106c8070aa49 Mon Sep 17 00:00:00 2001 From: huangzj <826100833@qq.com> Date: Tue, 31 Oct 2023 11:45:13 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CsLedgerServiceImpl.java | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsLedgerServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsLedgerServiceImpl.java index cb10dbc..78f7002 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsLedgerServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsLedgerServiceImpl.java @@ -5,17 +5,11 @@ import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.njcn.csdevice.enums.LineBaseEnum; -import com.njcn.csdevice.mapper.AppProjectMapper; -import com.njcn.csdevice.mapper.AppTopologyDiagramMapper; -import com.njcn.csdevice.mapper.CsEngineeringMapper; -import com.njcn.csdevice.mapper.CsLedgerMapper; +import com.njcn.csdevice.mapper.*; import com.njcn.csdevice.pojo.dto.DevDetailDTO; import com.njcn.csdevice.pojo.dto.LineParamDTO; import com.njcn.csdevice.pojo.param.CsLedgerParam; -import com.njcn.csdevice.pojo.po.AppProjectPO; -import com.njcn.csdevice.pojo.po.AppTopologyDiagramPO; -import com.njcn.csdevice.pojo.po.CsEngineeringPO; -import com.njcn.csdevice.pojo.po.CsLedger; +import com.njcn.csdevice.pojo.po.*; import com.njcn.csdevice.pojo.vo.CsLedgerVO; import com.njcn.csdevice.service.CsLinePOService; import com.njcn.csdevice.service.ICsEngineeringUserService; @@ -57,6 +51,9 @@ public class CsLedgerServiceImpl extends ServiceImpl i private final FileStorageUtil fileStorageUtil; private final RoleEngineerDevService roleEngineerDevService; + private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper; + + @Override public List getLedgerTree() { @@ -92,7 +89,15 @@ public class CsLedgerServiceImpl extends ServiceImpl i // } List projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); // List deviceList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.DEVICE_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); - List deviceList = allList.stream().filter(item -> device.contains(item.getId())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); + List deviceList = allList.stream().filter(item -> device.contains(item.getId())). + map( + temp->{ + CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(temp.getId()); + temp.setComFlag(csEquipmentDeliveryPO.getRunStatus()); + return temp; + } + ). + sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); List lineList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.LINE_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); // List collect = lineList.stream().map(CsLedgerVO::getId).collect(Collectors.toList()); @@ -125,7 +130,15 @@ public class CsLedgerServiceImpl extends ServiceImpl i // } List projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); // List deviceList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.DEVICE_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); - List deviceList = allList.stream().filter(item -> device.contains(item.getId())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); + List deviceList = allList.stream().filter(item -> device.contains(item.getId())). + map( + temp->{ + CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(temp.getId()); + temp.setComFlag(csEquipmentDeliveryPO.getRunStatus()); + return temp; + } + ). + sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList))); engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList))); From 8699e95f1cbf591400a3589fb49afebe8e432b04 Mon Sep 17 00:00:00 2001 From: xuyang <748613696@qq.com> Date: Tue, 31 Oct 2023 12:34:51 +0800 Subject: [PATCH 04/13] =?UTF-8?q?SQL=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/njcn/csdevice/mapper/mapping/CsDataArrayMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsDataArrayMapper.xml b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsDataArrayMapper.xml index d2b9dcf..bdf5a6a 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsDataArrayMapper.xml +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsDataArrayMapper.xml @@ -96,9 +96,9 @@ from cs_equipment_delivery t0 left join - cs_dev_model_relation t1 on t0.id = t1.dev_id + cs_dev_model_relation t1 on t0.id = t1.dev_id and t1.status = 1 left join - cs_dev_model t2 on t1.model_id = t2.id + cs_dev_model t2 on t1.model_id = t2.id and t2.status = 1 left join cs_data_set t3 on t3.pid = t2.id left join cs_data_array t4 on t3.id = t4.pid where From 19439b0512c84d6e2c282afa2f93e30a85585247 Mon Sep 17 00:00:00 2001 From: xuyang <748613696@qq.com> Date: Tue, 31 Oct 2023 13:29:14 +0800 Subject: [PATCH 05/13] =?UTF-8?q?mqtt=E8=B4=A6=E5=8F=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipment/EquipmentDeliveryController.java | 10 +++++++--- .../com/njcn/csdevice/service/IMqttUserService.java | 7 +++++++ .../csdevice/service/impl/MqttUserServiceImpl.java | 7 +++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/EquipmentDeliveryController.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/EquipmentDeliveryController.java index ad4d9e1..5d07027 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/EquipmentDeliveryController.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/EquipmentDeliveryController.java @@ -67,10 +67,14 @@ public class EquipmentDeliveryController extends BaseController { @DeviceLog(operateType = DeviceOperate.ADD) public HttpResult addEquipmentDelivery(@RequestBody @Validated CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm){ String methodDescribe = getMethodDescribe("addEquipmentDelivery"); - Boolean flag = csEquipmentDeliveryService.save (csEquipmentDeliveryAddParm); + Boolean flag = csEquipmentDeliveryService.save(csEquipmentDeliveryAddParm); if (flag){ - //初始化装置mqtt连接信息(使用sha256加密) - mqttUserService.insertMqttUser(csEquipmentDeliveryAddParm.getNdid()); + //查询mqtt用户名和密码是否存在 + boolean result = mqttUserService.findMqttUser(csEquipmentDeliveryAddParm.getNdid()); + if (result){ + //初始化装置mqtt连接信息(使用sha256加密) + mqttUserService.insertMqttUser(csEquipmentDeliveryAddParm.getNdid()); + } } return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe); } diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/IMqttUserService.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/IMqttUserService.java index 6311359..02f67cd 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/IMqttUserService.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/IMqttUserService.java @@ -13,6 +13,13 @@ import com.njcn.csdevice.pojo.po.MqttUser; */ public interface IMqttUserService extends IService { + /** + * 查询新增的mqtt用户名和密码是否存在 + * @param userName 用户名 + * @return boolean + */ + boolean findMqttUser(String userName); + /** * 根据密码生成mqtt连接信息 * @param password diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/MqttUserServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/MqttUserServiceImpl.java index 6a06acb..c8965bb 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/MqttUserServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/MqttUserServiceImpl.java @@ -9,6 +9,7 @@ import com.njcn.csdevice.pojo.po.MqttUser; import com.njcn.csdevice.service.IMqttUserService; import org.springframework.stereotype.Service; +import java.util.Objects; import java.util.Random; /** @@ -23,6 +24,12 @@ import java.util.Random; @DS("mqtt") public class MqttUserServiceImpl extends ServiceImpl implements IMqttUserService { + @Override + public boolean findMqttUser(String userName) { + MqttUser mqttUser = this.lambdaQuery().eq(MqttUser::getUsername,userName).one(); + return Objects.isNull(mqttUser); + } + @Override public void insertMqttUser(String password) { Random r = new Random(); From bb77b984b35e7b82c07a1820a2f8e59fb5fb839e Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Tue, 31 Oct 2023 14:43:01 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 95b2804..3e92c28 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ 1.2.7 4.4.0 0.5.3 - 4.9.0 + 4.5.0 8.2.1 1.7.0-Hoxton From 2b54b2ae20e9aa60cecf31a5eb7062fc50015088 Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Tue, 31 Oct 2023 15:02:30 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3e92c28..95b2804 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ 1.2.7 4.4.0 0.5.3 - 4.5.0 + 4.9.0 8.2.1 1.7.0-Hoxton From f4de861a3b7f3538c4c56cff37cd701b622e8d6d Mon Sep 17 00:00:00 2001 From: huangzj <826100833@qq.com> Date: Tue, 31 Oct 2023 15:24:58 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cs-device/cs-device-boot/pom.xml | 20 ++++++++++---------- cs-harmonic/cs-harmonic-boot/pom.xml | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cs-device/cs-device-boot/pom.xml b/cs-device/cs-device-boot/pom.xml index d007fbd..110ca75 100644 --- a/cs-device/cs-device-boot/pom.xml +++ b/cs-device/cs-device-boot/pom.xml @@ -63,16 +63,16 @@ pqs-influx 0.0.1-SNAPSHOT - - - - - - - - - - + + com.squareup.okhttp3 + okhttp + 4.9.0 + + + com.squareup.okhttp3 + logging-interceptor + 4.9.0 + com.njcn user-api diff --git a/cs-harmonic/cs-harmonic-boot/pom.xml b/cs-harmonic/cs-harmonic-boot/pom.xml index cc43399..c2acfeb 100644 --- a/cs-harmonic/cs-harmonic-boot/pom.xml +++ b/cs-harmonic/cs-harmonic-boot/pom.xml @@ -46,16 +46,16 @@ ${project.version} - - - - - - - - - - + + com.squareup.okhttp3 + okhttp + 4.9.0 + + + com.squareup.okhttp3 + logging-interceptor + 4.9.0 + com.njcn cs-harmonic-api From 925f48ff8132f175a69d381e00559a17ccafc379 Mon Sep 17 00:00:00 2001 From: huangzj <826100833@qq.com> Date: Thu, 2 Nov 2023 15:53:00 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/njcn/csharmonic/pojo/vo/ThdDataVO.java | 8 +++++--- .../service/impl/DeviceDataTrendServiceImpl.java | 2 +- .../service/impl/StableDataServiceImpl.java | 14 +++++++------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/vo/ThdDataVO.java b/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/vo/ThdDataVO.java index 4b6fa7f..9efbb40 100644 --- a/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/vo/ThdDataVO.java +++ b/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/vo/ThdDataVO.java @@ -1,9 +1,12 @@ package com.njcn.csharmonic.pojo.vo; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.njcn.common.utils.serializer.InstantDateSerializer; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; +import java.time.Instant; import java.time.LocalDateTime; /** @@ -15,9 +18,8 @@ import java.time.LocalDateTime; */ @Data public class ThdDataVO { - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") - private LocalDateTime time; + @JsonSerialize(using = InstantDateSerializer.class) + private Instant time; private String lineId; private String position; private String lineName; diff --git a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/DeviceDataTrendServiceImpl.java b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/DeviceDataTrendServiceImpl.java index 147fc1b..b3b6df6 100644 --- a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/DeviceDataTrendServiceImpl.java +++ b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/DeviceDataTrendServiceImpl.java @@ -64,7 +64,7 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService { vo.setLineId(statisticalDataDTO.getLineId()); vo.setPhase(statisticalDataDTO.getPhaseType()); - vo.setTime(statisticalDataDTO.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); + vo.setTime(statisticalDataDTO.getTime()); vo.setStatMethod(statisticalDataDTO.getValueType()); vo.setStatisticalData(BigDecimal.valueOf(statisticalDataDTO.getValue()).setScale(4, RoundingMode.UP).doubleValue()); vo.setStatisticalIndex(temp.getDataId()); diff --git a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/StableDataServiceImpl.java b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/StableDataServiceImpl.java index 252a7ef..7d80cfe 100644 --- a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/StableDataServiceImpl.java +++ b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/StableDataServiceImpl.java @@ -80,7 +80,7 @@ public class StableDataServiceImpl implements StableDataService { ThdDataVO thdDataVO = new ThdDataVO(); BeanUtils.copyProperties(temp,thdDataVO); thdDataVO.setStatisticalName(statisticalName); - thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); + thdDataVO.setTime(temp.getTime()); String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition(); thdDataVO.setPosition(position); Double statisticalValue = 0.00; @@ -106,7 +106,7 @@ public class StableDataServiceImpl implements StableDataService { ThdDataVO thdDataVO = new ThdDataVO(); BeanUtils.copyProperties(temp,thdDataVO); thdDataVO.setStatisticalName(thdDataQueryParm.getStatisticalName()); - thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); + thdDataVO.setTime(temp.getTime()); String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition(); thdDataVO.setPosition(position); Double statisticalValue = 0.00; @@ -133,7 +133,7 @@ public class StableDataServiceImpl implements StableDataService { ThdDataVO thdDataVO = new ThdDataVO(); BeanUtils.copyProperties(temp,thdDataVO); thdDataVO.setStatisticalName(statisticalName); - thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); + thdDataVO.setTime(temp.getTime()); String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition(); thdDataVO.setPosition(position); Double statisticalValue = 0.00; @@ -158,7 +158,7 @@ public class StableDataServiceImpl implements StableDataService { ThdDataVO thdDataVO = new ThdDataVO(); BeanUtils.copyProperties(temp,thdDataVO); thdDataVO.setStatisticalName(thdDataQueryParm.getStatisticalName()); - thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); + thdDataVO.setTime(temp.getTime()); String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition(); thdDataVO.setPosition(position); Double statisticalValue = 0.00; @@ -214,7 +214,7 @@ public class StableDataServiceImpl implements StableDataService { vo.setPhase(phaseReflection(temp.getPhaseType())); String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition(); vo.setPosition(position); - vo.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); + vo.setTime(temp.getTime()); vo.setStatMethod(temp.getValueType()); vo.setStatisticalData(Double.valueOf(df.format(temp.getValue()))); vo.setStatisticalIndex(data.getId()); @@ -265,7 +265,7 @@ public class StableDataServiceImpl implements StableDataService { vo.setPhase(temp.getPhaseType()); String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition(); vo.setPosition(position); - vo.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); + vo.setTime(temp.getTime()); vo.setStatMethod(temp.getValueType()); vo.setStatisticalData(Double.valueOf(df.format(temp.getValue()))); vo.setStatisticalIndex(epdPqd.getId()); @@ -325,7 +325,7 @@ public class StableDataServiceImpl implements StableDataService { vo.setLineName(lineName); vo.setPosition(position); - vo.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); + vo.setTime(temp.getTime()); vo.setStatMethod(temp.getValueType()); vo.setStatisticalData(Double.valueOf(df.format(temp.getValue()))); vo.setStatisticalIndex(epdPqd.getId()); From a855ba0c542da3f38894eda25962a0bd8c0ae6f1 Mon Sep 17 00:00:00 2001 From: xuyang <748613696@qq.com> Date: Fri, 3 Nov 2023 09:18:41 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../csdevice/service/impl/CsDevCapacityPOServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDevCapacityPOServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDevCapacityPOServiceImpl.java index 673b7f5..7a05dd9 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDevCapacityPOServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDevCapacityPOServiceImpl.java @@ -57,9 +57,10 @@ public class CsDevCapacityPOServiceImpl extends ServiceImpl new BusinessException(AlgorithmResponseEnum.DATA_MISSING)); - - +// Optional.ofNullable(one).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.DATA_MISSING)); + if(Objects.isNull(one)){ + return 0.0; + } return Double.valueOf(df.format(one.getCapacity()*0.1)); } } From 140b08982b639cbb3cbcd099f44b0cf83b3ad159 Mon Sep 17 00:00:00 2001 From: huangzj <826100833@qq.com> Date: Fri, 3 Nov 2023 13:37:11 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E6=B3=A8=E8=A7=A3=E6=8E=89=E8=BF=90?= =?UTF-8?q?=E7=BB=B4=E4=BA=BA=E5=91=98=E7=9C=8B=E4=BA=8B=E4=BB=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/njcn/csdevice/pojo/vo/DevCountVO.java | 4 ++-- .../service/impl/CsEventUserPOServiceImpl.java | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/DevCountVO.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/DevCountVO.java index c22b074..fce640a 100644 --- a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/DevCountVO.java +++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/DevCountVO.java @@ -56,10 +56,10 @@ public class DevCountVO { @ApiModelProperty(value = "稳态件数") private Integer currentHarmonicCount; - @ApiModelProperty(value = "项目数") + @ApiModelProperty(value = "当前项目数") private Integer currentProjectCount; - @ApiModelProperty(value = "项目数") + @ApiModelProperty(value = "反馈数") private Integer feedBackCount; diff --git a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CsEventUserPOServiceImpl.java b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CsEventUserPOServiceImpl.java index 4ae115c..7c2bcce 100644 --- a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CsEventUserPOServiceImpl.java +++ b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CsEventUserPOServiceImpl.java @@ -81,11 +81,11 @@ public class CsEventUserPOServiceImpl extends ServiceImpl data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.APP_EVENT.getCode()).getData(); @@ -227,10 +227,10 @@ public class CsEventUserPOServiceImpl extends ServiceImpl deviceId = new ArrayList<>(); List data = csLedgerFeignClient.getDeviceTree().getData(); From 0c93cd9387eab8545e984a8055ca0bb5190e8a20 Mon Sep 17 00:00:00 2001 From: huangzj <826100833@qq.com> Date: Fri, 3 Nov 2023 13:48:55 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../njcn/csdevice/service/impl/RoleEngineerDevServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/RoleEngineerDevServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/RoleEngineerDevServiceImpl.java index f9282b8..da9adb0 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/RoleEngineerDevServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/RoleEngineerDevServiceImpl.java @@ -99,7 +99,7 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService { }else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode())){ List csEngineeringPOS = csEngineeringMapper.selectList(null); - collect =csEngineeringPOS.stream().map(CsEngineeringPO::getId).collect(Collectors.toList()); + collect =csEngineeringPOS.stream().filter(temp->Objects.equals(temp.getStatus(),1)).map(CsEngineeringPO::getId).collect(Collectors.toList()); } return collect; From 0be5dadfacc8f0ff5d8646e88ceb4f182b723a01 Mon Sep 17 00:00:00 2001 From: huangzj <826100833@qq.com> Date: Fri, 3 Nov 2023 13:59:12 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../njcn/csdevice/service/impl/RoleEngineerDevServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/RoleEngineerDevServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/RoleEngineerDevServiceImpl.java index da9adb0..076afd1 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/RoleEngineerDevServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/RoleEngineerDevServiceImpl.java @@ -99,7 +99,7 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService { }else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode())){ List csEngineeringPOS = csEngineeringMapper.selectList(null); - collect =csEngineeringPOS.stream().filter(temp->Objects.equals(temp.getStatus(),1)).map(CsEngineeringPO::getId).collect(Collectors.toList()); + collect =csEngineeringPOS.stream().filter(temp->Objects.equals(temp.getStatus(),"1")).map(CsEngineeringPO::getId).collect(Collectors.toList()); } return collect;