From e7b3676abc943827dd0f2ec90612853305ae545c Mon Sep 17 00:00:00 2001 From: luyie Date: Mon, 23 Sep 2024 12:04:37 +0800 Subject: [PATCH 01/10] =?UTF-8?q?fix:=E5=90=91=E9=87=8F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E5=90=8C=E6=AD=A5=E6=97=B6=EF=BC=8C=E8=B6=85=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E5=88=B7=E6=96=B0=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maintenance/mapper/VectorParamMapper.java | 3 + .../maintenance/service/VectorParamService.java | 2 + .../service/impl/VectorParamServiceImpl.java | 66 ++++++++++++++-------- 3 files changed, 47 insertions(+), 24 deletions(-) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/VectorParamMapper.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/VectorParamMapper.java index 6dc3e63..9fbfb79 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/VectorParamMapper.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/VectorParamMapper.java @@ -1,5 +1,6 @@ package com.hnac.gglm.bigmodel.maintenance.mapper; +import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.gglm.bigmodel.maintenance.entity.VectorParamEntity; @@ -7,5 +8,7 @@ import com.hnac.gglm.bigmodel.maintenance.entity.VectorParamEntity; * @Author: ypj * @Date: 2024/09/02 15:12 */ + +@DS("hznlm") public interface VectorParamMapper extends BaseMapper { } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java index 8553964..760447c 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java @@ -19,4 +19,6 @@ public interface VectorParamService extends IService { List getUrlResponseKeyList(String url, String bladeToken, String hzinfoToken); Boolean synchronization(List id ,String bladeToken, String hzinfoToken); + + Boolean synchronization(Long id, String bladeToken, String hzinfoToken); } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java index 86e4921..bc836a2 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java @@ -12,10 +12,10 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.hnac.gglm.bigmodel.database.service.WeaviateService; -import com.hnac.gglm.bigmodel.maintenance.vo.VectorUrlResponse; import com.hnac.gglm.bigmodel.maintenance.entity.VectorParamEntity; import com.hnac.gglm.bigmodel.maintenance.mapper.VectorParamMapper; import com.hnac.gglm.bigmodel.maintenance.service.VectorParamService; +import com.hnac.gglm.bigmodel.maintenance.vo.VectorUrlResponse; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -23,6 +23,9 @@ import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletResponse; import java.nio.charset.StandardCharsets; import java.util.*; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; /** * @Author: ypj @@ -115,32 +118,47 @@ public class VectorParamServiceImpl extends ServiceImpl attrMap = new HashMap<>(); - Iterator iterator = rootNode.fieldNames(); - while (iterator.hasNext()) { - String key = iterator.next(); - attrMap.put(key, rootNode.findValue(key).textValue()); + ThreadPoolExecutor executor = new ThreadPoolExecutor(5, ids.size() > 5 ? ids.size() : 5, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue()); + ids.forEach(id -> { + executor.execute(() -> { + if (synchronization(id, bladeToken, hzinfoToken)) { + log.info("synchronization vector param id:{} success", id); + } else { + log.error("synchronization vector param id:{} fail", id); } - String tableName = entity.getTableName().replace(entity.getProjectPrefix() + "_",""); - weaviateService.saveBatch(response.getOriginalData(), tableName, attrMap); - this.update(Wrappers.lambdaUpdate().eq(VectorParamEntity::getId, id).set(VectorParamEntity::getUpdateTime, new Date())); + }); + }); + executor.shutdown(); + return true; + } + + + @Override + public Boolean synchronization(Long id, String bladeToken, String hzinfoToken) { + VectorParamEntity entity = baseMapper.selectById(id); + if (null == entity) { + return false; + } + log.info("synchronization vector param id:{}", id); + VectorUrlResponse response = getUrlResponse(entity.getUrl(), bladeToken, hzinfoToken); + if (response != null) { + ObjectMapper mapper = new ObjectMapper(); + JsonNode rootNode = null; + try { + rootNode = mapper.readTree(entity.getAttributeMap()); + } catch (JsonProcessingException e) { + log.error("getUrlResponseKeyList error", e); + } + Map attrMap = new HashMap<>(); + Iterator iterator = rootNode.fieldNames(); + while (iterator.hasNext()) { + String key = iterator.next(); + attrMap.put(key, rootNode.findValue(key).textValue()); } + String tableName = entity.getTableName().replace(entity.getProjectPrefix() + "_", ""); + weaviateService.saveBatch(response.getOriginalData(), tableName, attrMap); + return this.update(Wrappers.lambdaUpdate().eq(VectorParamEntity::getId, id).set(VectorParamEntity::getUpdateTime, new Date())); } return true; } - } From 25f5bef5fefc5fc4831f18f569c7ebc96a99e65e Mon Sep 17 00:00:00 2001 From: luyie Date: Mon, 23 Sep 2024 14:59:32 +0800 Subject: [PATCH 02/10] =?UTF-8?q?add:=E5=90=91=E9=87=8F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maintenance/constants/DataOperateType.java | 32 +++++++ .../controller/VectorParamController.java | 26 +++++- .../controller/VectorParamLogController.java | 99 ++++++++++++++++++++++ .../maintenance/entity/VectorParamLogEntity.java | 44 ++++++++++ .../maintenance/mapper/VectorParamLogMapper.java | 13 +++ .../maintenance/service/VectorParamLogService.java | 22 +++++ .../service/impl/VectorParamLogServiceImpl.java | 76 +++++++++++++++++ .../service/impl/VectorParamServiceImpl.java | 12 ++- 8 files changed, 320 insertions(+), 4 deletions(-) create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/constants/DataOperateType.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamLogController.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/VectorParamLogEntity.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/VectorParamLogMapper.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamLogService.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamLogServiceImpl.java diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/constants/DataOperateType.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/constants/DataOperateType.java new file mode 100644 index 0000000..6abaf17 --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/constants/DataOperateType.java @@ -0,0 +1,32 @@ +package com.hnac.gglm.bigmodel.maintenance.constants; + +import lombok.Getter; + +/** + * @Author: ypj + * @Date: 2024/9/23 14:18 + */ +@Getter +public enum DataOperateType { + CREATE("CREATE", "新增"), + UPDATE("UPDATE", "更新"), + RESET("RESET", "重置"), + DELETE("DELETE", "删除"), + SYNCHRONIZATION("SYNCHRONIZATION", "同步"); + private final String code; + private final String msg; + + DataOperateType(String code, String msg) { + this.code = code; + this.msg = msg; + } + + public static DataOperateType getInstance(String code) { + for (DataOperateType dataOperateType : DataOperateType.values()) { + if (dataOperateType.getCode().equals(code)) { + return dataOperateType; + } + } + return null; + } +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java index 1f6d690..6deaddd 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java @@ -3,7 +3,10 @@ package com.hnac.gglm.bigmodel.maintenance.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.fasterxml.jackson.core.JsonProcessingException; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.gglm.bigmodel.maintenance.constants.DataOperateType; import com.hnac.gglm.bigmodel.maintenance.entity.VectorParamEntity; +import com.hnac.gglm.bigmodel.maintenance.entity.VectorParamLogEntity; +import com.hnac.gglm.bigmodel.maintenance.service.VectorParamLogService; import com.hnac.gglm.bigmodel.maintenance.service.VectorParamService; import com.hnac.gglm.bigmodel.maintenance.vo.IdsRequest; import com.hnac.hzinfo.api.annotation.ApiInterface; @@ -33,6 +36,7 @@ import java.util.Map; @Slf4j public class VectorParamController { private final VectorParamService vectorParamService; + private final VectorParamLogService vectorParamLogService; @GetMapping("/listPage") @ApiOperation(value = "分页查询") @@ -52,21 +56,37 @@ public class VectorParamController { @ApiOperation(value = "保存向量参数配置") @ApiOperationSupport(order = 3) public R save(@RequestBody VectorParamEntity req) { - return R.status(vectorParamService.save(req)); + Boolean result = vectorParamService.save(req); + if (result) { + vectorParamLogService.create(VectorParamLogEntity.builder() + .vectorParamId(req.getId()) + .type(DataOperateType.CREATE.getCode()).build()); + } + return R.status(result); } @DeleteMapping("/remove") @ApiOperation(value = "删除向量参数配置") @ApiOperationSupport(order = 4) public R remove(@RequestParam @ApiParam("主键ID,按逗号分隔") String ids) { - return R.status(vectorParamService.removeByIds(Func.toLongList(",", ids))); + Boolean result = vectorParamService.removeByIds(Func.toLongList(",", ids)); + if (result) { + vectorParamLogService.delete(Func.toLongList(",", ids)); + } + return R.status(result); } @PutMapping("/update") @ApiOperation(value = "编辑向量参数配置") @ApiOperationSupport(order = 5) public R update(@RequestBody VectorParamEntity req) { - return R.status(vectorParamService.updateById(req)); + Boolean result = vectorParamService.updateById(req); + if (result) { + vectorParamLogService.edit(VectorParamLogEntity.builder() + .vectorParamId(req.getId()) + .type(DataOperateType.UPDATE.getCode()).build()); + } + return R.status(result); } @GetMapping("/getAuthorization") diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamLogController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamLogController.java new file mode 100644 index 0000000..5e46a8a --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamLogController.java @@ -0,0 +1,99 @@ +package com.hnac.gglm.bigmodel.maintenance.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.gglm.bigmodel.maintenance.entity.VectorParamLogEntity; +import com.hnac.gglm.bigmodel.maintenance.service.VectorParamLogService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +/** + * @Author: ypj + * @Date: 2024/9/23 13:50 + */ +@RestController +@RequestMapping("/vector/log") +@Api(value = "向量参数配置日志", tags = "向量参数配置日志") +@AllArgsConstructor +@Slf4j +public class VectorParamLogController { + private final VectorParamLogService vectorParamLogService; + + @GetMapping("/listPage") + @ApiOperation(value = "分页查询") + @ApiOperationSupport(order = 1) + public R> listPage(Query query, VectorParamLogEntity req) { + return R.data(vectorParamLogService.page(Condition.getPage(query), Condition.getQueryWrapper(new VectorParamLogEntity(), req))); + } + + @GetMapping("/detail") + @ApiOperation(value = "查看详情") + @ApiOperationSupport(order = 2) + public R detail(@RequestParam @ApiParam("主键ID") Long id) { + return R.data(vectorParamLogService.getById(id)); + } + + @GetMapping("/save") + @ApiOperation(value = "保存向量参数配置日志") + @ApiOperationSupport(order = 3) + public R save(@RequestBody VectorParamLogEntity req) { + return R.status(vectorParamLogService.save(req)); + } + + @GetMapping("/remove") + @ApiOperation(value = "删除向量参数配置日志") + @ApiOperationSupport(order = 4) + public R remove(@RequestParam @ApiParam("主键ID,按逗号分隔") String ids) { + return R.status(vectorParamLogService.removeByIds(Func.toLongList(",", ids))); + } + + @PutMapping("/update") + @ApiOperation(value = "编辑向量参数配置日志") + @ApiOperationSupport(order = 5) + public R update(@RequestBody VectorParamLogEntity req) { + return R.status(vectorParamLogService.updateById(req)); + } + + @PostMapping("/create") + @ApiOperation(value = "创建向量参数配置操作记录") + @ApiOperationSupport(order = 6) + public R create(@RequestBody VectorParamLogEntity req) { + return R.status(vectorParamLogService.create(req)); + } + + @PostMapping("/edit") + @ApiOperation(value = "编辑向量参数配置操作记录") + @ApiOperationSupport(order = 7) + public R edit(@RequestBody VectorParamLogEntity req) { + return R.status(vectorParamLogService.edit(req)); + } + + @PostMapping("/reset") + @ApiOperation(value = "重置向量参数配置操作记录") + @ApiOperationSupport(order = 8) + public R reset(@RequestBody VectorParamLogEntity req) { + return R.status(vectorParamLogService.reset(req)); + } + + @PostMapping("/delete") + @ApiOperation(value = "删除向量参数配置操作记录") + @ApiOperationSupport(order = 9) + public R delete(@RequestParam @ApiParam("主键ID,按逗号分隔") String ids) { + return R.status(vectorParamLogService.delete(Func.toLongList(",", ids))); + } + + @PostMapping("/synchronization") + @ApiOperation(value = "同步向量参数配置操作记录") + @ApiOperationSupport(order = 10) + public R synchronization(@RequestBody VectorParamLogEntity req) { + return R.status(vectorParamLogService.synchronization(req)); + } +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/VectorParamLogEntity.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/VectorParamLogEntity.java new file mode 100644 index 0000000..4975205 --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/VectorParamLogEntity.java @@ -0,0 +1,44 @@ +package com.hnac.gglm.bigmodel.maintenance.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; +import org.springblade.core.tenant.mp.TenantEntity; + +import java.io.Serializable; + +/** + * @Author: ypj + * @Date: 2024/9/23 12:07 + */ +@ApiModel("向量参数配置日志") +@TableName("gglm_vector_param_log") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class VectorParamLogEntity extends TenantEntity implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("参数id") + @TableField("VECTOR_PARAM_ID") + @QueryField(condition = SqlCondition.EQUAL) + private Long vectorParamId; + + @ApiModelProperty("日志内容") + @TableField("CONTENT") + @QueryField(condition = SqlCondition.LIKE) + private String content; + + @ApiModelProperty("日志类型,新增CREATE,更新UPDATE,重置RESET") + @TableField("TYPE") + @QueryField(condition = SqlCondition.EQUAL) + private String type; +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/VectorParamLogMapper.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/VectorParamLogMapper.java new file mode 100644 index 0000000..ed1188b --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/VectorParamLogMapper.java @@ -0,0 +1,13 @@ +package com.hnac.gglm.bigmodel.maintenance.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.gglm.bigmodel.maintenance.entity.VectorParamLogEntity; + +/** + * @Author: ypj + * @Date: 2024/9/23 13:59 + */ +@DS("hznlm") +public interface VectorParamLogMapper extends BaseMapper { +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamLogService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamLogService.java new file mode 100644 index 0000000..9cf5a1e --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamLogService.java @@ -0,0 +1,22 @@ +package com.hnac.gglm.bigmodel.maintenance.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.gglm.bigmodel.maintenance.entity.VectorParamLogEntity; + +import java.util.List; + +/** + * @Author: ypj + * @Date: 2024/9/23 13:56 + */ +public interface VectorParamLogService extends IService { + Boolean create(VectorParamLogEntity req); + + Boolean edit(VectorParamLogEntity req); + + Boolean reset(VectorParamLogEntity req); + + Boolean delete(List ids); + + Boolean synchronization(VectorParamLogEntity req); +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamLogServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamLogServiceImpl.java new file mode 100644 index 0000000..d0e5660 --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamLogServiceImpl.java @@ -0,0 +1,76 @@ +package com.hnac.gglm.bigmodel.maintenance.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.gglm.bigmodel.maintenance.constants.DataOperateType; +import com.hnac.gglm.bigmodel.maintenance.entity.VectorParamLogEntity; +import com.hnac.gglm.bigmodel.maintenance.mapper.VectorParamLogMapper; +import com.hnac.gglm.bigmodel.maintenance.service.VectorParamLogService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +/** + * @Author: ypj + * @Date: 2024/9/23 13:57 + */ +@Service +@Slf4j +@AllArgsConstructor +@DS("hznlm") +public class VectorParamLogServiceImpl extends ServiceImpl implements VectorParamLogService { + @Override + public Boolean create(VectorParamLogEntity req) { + if (ObjectUtil.isEmpty(req.getVectorParamId())) { + return false; + } + req.setType(DataOperateType.CREATE.getCode()); + return save(req); + } + + @Override + public Boolean edit(VectorParamLogEntity req) { + if (ObjectUtil.isEmpty(req.getVectorParamId())) { + return false; + } + req.setType(DataOperateType.UPDATE.getCode()); + return save(req); + } + + @Override + public Boolean reset(VectorParamLogEntity req) { + if (ObjectUtil.isEmpty(req.getVectorParamId())) { + return false; + } + req.setType(DataOperateType.RESET.getCode()); + return save(req); + } + + @Override + public Boolean delete(List ids) { + ThreadPoolExecutor executor = new ThreadPoolExecutor(5, ids.size() > 5 ? ids.size() : 5, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue()); + ids.forEach(id -> { + executor.execute(() -> { + save(VectorParamLogEntity.builder() + .vectorParamId(id) + .type(DataOperateType.DELETE.getCode()).build()); + }); + }); + return Boolean.TRUE; + } + + @Override + public Boolean synchronization(VectorParamLogEntity req) { + if (ObjectUtil.isEmpty(req.getVectorParamId())) { + return false; + } + req.setType(DataOperateType.SYNCHRONIZATION.getCode()); + return save(req); + } +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java index bc836a2..b69e884 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java @@ -12,8 +12,11 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.hnac.gglm.bigmodel.database.service.WeaviateService; +import com.hnac.gglm.bigmodel.maintenance.constants.DataOperateType; import com.hnac.gglm.bigmodel.maintenance.entity.VectorParamEntity; +import com.hnac.gglm.bigmodel.maintenance.entity.VectorParamLogEntity; import com.hnac.gglm.bigmodel.maintenance.mapper.VectorParamMapper; +import com.hnac.gglm.bigmodel.maintenance.service.VectorParamLogService; import com.hnac.gglm.bigmodel.maintenance.service.VectorParamService; import com.hnac.gglm.bigmodel.maintenance.vo.VectorUrlResponse; import lombok.AllArgsConstructor; @@ -40,6 +43,7 @@ public class VectorParamServiceImpl extends ServiceImpllambdaUpdate().eq(VectorParamEntity::getId, id).set(VectorParamEntity::getUpdateTime, new Date())); + if (this.update(Wrappers.lambdaUpdate().eq(VectorParamEntity::getId, id).set(VectorParamEntity::getUpdateTime, new Date()))) { + return vectorParamLogService.synchronization(VectorParamLogEntity.builder() + .vectorParamId(id) + .type(DataOperateType.SYNCHRONIZATION.getCode()).build()); + } else { + return false; + } } return true; } From 6b776053f349f76f7791760b2338dd84da3fffc4 Mon Sep 17 00:00:00 2001 From: wangyinsheng <2310589501@qq.com> Date: Mon, 23 Sep 2024 15:28:27 +0800 Subject: [PATCH 03/10] =?UTF-8?q?fix:=E5=A2=9E=E5=8A=A0@ApiInterface?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operational/station/controller/StationVideoTypeController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java index 252e1c4..25cc6b8 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java @@ -26,6 +26,7 @@ import com.hnac.hzims.operational.station.vo.StationVO; import com.hnac.hzims.operational.station.vo.StationVideoTypeVO; import com.hnac.hzims.operational.station.vo.VideoMonitorVO; import com.hnac.hzims.operational.station.wrapper.StationVideoTypeWrapper; +import com.hnac.hzinfo.api.annotation.ApiInterface; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -390,6 +391,7 @@ public class StationVideoTypeController extends BladeController { @GetMapping ("/listAll") @ApiOperationSupport(order = 200) @ApiOperation(value = "获取所有站点视频") + @ApiInterface public R> listAll() { return R.data(stationVideoTypeService.listAll()); } From dca6fa4a8d64750542625cc8d1c328abf85eb977 Mon Sep 17 00:00:00 2001 From: luyie Date: Mon, 23 Sep 2024 16:11:44 +0800 Subject: [PATCH 04/10] =?UTF-8?q?add:=E5=90=91=E9=87=8F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/VectorParamController.java | 7 ++----- .../maintenance/service/VectorParamService.java | 2 ++ .../service/impl/VectorParamLogServiceImpl.java | 20 +++++++++++--------- .../service/impl/VectorParamServiceImpl.java | 9 +++++++++ 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java index 6deaddd..fc42a5e 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java @@ -1,5 +1,6 @@ package com.hnac.gglm.bigmodel.maintenance.controller; +import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.metadata.IPage; import com.fasterxml.jackson.core.JsonProcessingException; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; @@ -69,11 +70,7 @@ public class VectorParamController { @ApiOperation(value = "删除向量参数配置") @ApiOperationSupport(order = 4) public R remove(@RequestParam @ApiParam("主键ID,按逗号分隔") String ids) { - Boolean result = vectorParamService.removeByIds(Func.toLongList(",", ids)); - if (result) { - vectorParamLogService.delete(Func.toLongList(",", ids)); - } - return R.status(result); + return R.status(vectorParamService.removeByIdsWithLog(Func.toLongList(",", ids))); } @PutMapping("/update") diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java index 760447c..2b65868 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java @@ -21,4 +21,6 @@ public interface VectorParamService extends IService { Boolean synchronization(List id ,String bladeToken, String hzinfoToken); Boolean synchronization(Long id, String bladeToken, String hzinfoToken); + + Boolean removeByIdsWithLog(List isList); } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamLogServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamLogServiceImpl.java index d0e5660..6332c3f 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamLogServiceImpl.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamLogServiceImpl.java @@ -8,13 +8,11 @@ import com.hnac.gglm.bigmodel.maintenance.mapper.VectorParamLogMapper; import com.hnac.gglm.bigmodel.maintenance.service.VectorParamLogService; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.utils.ObjectUtil; import org.springframework.stereotype.Service; import java.util.List; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; /** * @Author: ypj @@ -31,6 +29,7 @@ public class VectorParamLogServiceImpl extends ServiceImpl ids) { - ThreadPoolExecutor executor = new ThreadPoolExecutor(5, ids.size() > 5 ? ids.size() : 5, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue()); + final Long userId = AuthUtil.getUserId(); ids.forEach(id -> { - executor.execute(() -> { - save(VectorParamLogEntity.builder() - .vectorParamId(id) - .type(DataOperateType.DELETE.getCode()).build()); - }); + VectorParamLogEntity log = VectorParamLogEntity.builder() + .vectorParamId(id) + .type(DataOperateType.DELETE.getCode()).build(); + log.setCreateUser(userId); + save(log); }); return Boolean.TRUE; } @@ -71,6 +72,7 @@ public class VectorParamLogServiceImpl extends ServiceImpl idList) { + Boolean result = baseMapper.deleteBatchIds(idList) > 0; + if (result) { + vectorParamLogService.delete(idList); + } + return result; + } } From 97fbdd4d8c588e9c9f54d4570806eb60a162bec5 Mon Sep 17 00:00:00 2001 From: luyie Date: Mon, 23 Sep 2024 17:02:12 +0800 Subject: [PATCH 05/10] =?UTF-8?q?add:=E5=90=91=E9=87=8F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=EF=BC=8C=E8=AE=BE=E5=A4=87=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java index 795a628..657b7f9 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java @@ -75,7 +75,6 @@ public class VectorDataServiceImpl implements VectorDataService { List list = deviceClient.listDeviceAttr().getData(); if (null != list && !list.isEmpty()) { list.forEach(item -> { - item.setItemName(item.getProjectName() + " " + item.getDeviceName() + " " + item.getName()); String rule = AccessRules.getDescByCode(item.getRule()); if (null != rule) { item.setRule(rule); From 511224e9475365d1158743442c1b997c7db67979 Mon Sep 17 00:00:00 2001 From: wangyinsheng <2310589501@qq.com> Date: Mon, 23 Sep 2024 17:10:02 +0800 Subject: [PATCH 06/10] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceFuncDTO.java | 4 ++-- .../hnac/gglm/bigmodel/maintenance/service/DataInstructService.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceFuncDTO.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceFuncDTO.java index c60ee79..44cc106 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceFuncDTO.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceFuncDTO.java @@ -22,7 +22,7 @@ public class DeviceFuncDTO { @ApiModelProperty("遥控的设备ID") private String deviceId; - @ApiModelProperty("用于展示和匹配的全称,一般可设为 站点名称-遥控名称") - private String itemName; + @ApiModelProperty("遥控名称") + private String ykName; } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataInstructService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataInstructService.java index e137678..f8e0600 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataInstructService.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataInstructService.java @@ -61,7 +61,7 @@ public class DataInstructService extends BaseServiceImpl Date: Mon, 23 Sep 2024 18:08:18 +0800 Subject: [PATCH 07/10] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceAttrDTO.java | 3 --- .../com/hnac/gglm/bigmodel/maintenance/service/DataRecordService.java | 1 - 2 files changed, 4 deletions(-) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceAttrDTO.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceAttrDTO.java index adcc3d4..94f6458 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceAttrDTO.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceAttrDTO.java @@ -22,9 +22,6 @@ public class DeviceAttrDTO { @ApiModelProperty("遥控的设备ID") private String deviceId; - @ApiModelProperty("用于展示和匹配的全称,一般可设为 站点名称-遥控名称") - private String itemName; - @ApiModelProperty("记录名称") private String recordName; diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataRecordService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataRecordService.java index f0368eb..5c026d5 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataRecordService.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataRecordService.java @@ -92,7 +92,6 @@ public class DataRecordService extends BaseServiceImpl Date: Mon, 23 Sep 2024 18:29:53 +0800 Subject: [PATCH 08/10] =?UTF-8?q?add:=E5=90=91=E9=87=8F=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=EF=BC=8C=E5=A4=9A=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/VectorParamController.java | 17 ++--------------- .../maintenance/service/VectorParamService.java | 4 ++++ .../service/impl/VectorParamServiceImpl.java | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java index fc42a5e..e1fc722 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java @@ -37,7 +37,6 @@ import java.util.Map; @Slf4j public class VectorParamController { private final VectorParamService vectorParamService; - private final VectorParamLogService vectorParamLogService; @GetMapping("/listPage") @ApiOperation(value = "分页查询") @@ -57,13 +56,7 @@ public class VectorParamController { @ApiOperation(value = "保存向量参数配置") @ApiOperationSupport(order = 3) public R save(@RequestBody VectorParamEntity req) { - Boolean result = vectorParamService.save(req); - if (result) { - vectorParamLogService.create(VectorParamLogEntity.builder() - .vectorParamId(req.getId()) - .type(DataOperateType.CREATE.getCode()).build()); - } - return R.status(result); + return R.status(vectorParamService.saveWithLog(req)); } @DeleteMapping("/remove") @@ -77,13 +70,7 @@ public class VectorParamController { @ApiOperation(value = "编辑向量参数配置") @ApiOperationSupport(order = 5) public R update(@RequestBody VectorParamEntity req) { - Boolean result = vectorParamService.updateById(req); - if (result) { - vectorParamLogService.edit(VectorParamLogEntity.builder() - .vectorParamId(req.getId()) - .type(DataOperateType.UPDATE.getCode()).build()); - } - return R.status(result); + return R.status(vectorParamService.updateWithLog(req)); } @GetMapping("/getAuthorization") diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java index 2b65868..57f3b74 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java @@ -23,4 +23,8 @@ public interface VectorParamService extends IService { Boolean synchronization(Long id, String bladeToken, String hzinfoToken); Boolean removeByIdsWithLog(List isList); + + Boolean saveWithLog(VectorParamEntity req); + + Boolean updateWithLog(VectorParamEntity req); } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java index d64ddf6..df4f20f 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java @@ -180,4 +180,26 @@ public class VectorParamServiceImpl extends ServiceImpl 0; + if (result) { + vectorParamLogService.create(VectorParamLogEntity.builder() + .vectorParamId(req.getId()) + .type(DataOperateType.CREATE.getCode()).build()); + } + return result; + } + + @Override + public Boolean updateWithLog(VectorParamEntity req) { + Boolean result = baseMapper.updateById(req) > 0; + if (result) { + vectorParamLogService.edit(VectorParamLogEntity.builder() + .vectorParamId(req.getId()) + .type(DataOperateType.UPDATE.getCode()).build()); + } + return result; + } } From 04382a943ae696d965ca99ca17cbefa71f08a943 Mon Sep 17 00:00:00 2001 From: luyie Date: Mon, 23 Sep 2024 20:04:17 +0800 Subject: [PATCH 09/10] =?UTF-8?q?add:=E7=94=BB=E5=B8=83=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=AB=99=E7=82=B9=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/service/impl/VectorDataServiceImpl.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java index 657b7f9..6e5b1fa 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java @@ -10,6 +10,8 @@ import com.hnac.hzinfo.sdk.v5.model.ModelClient; import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO; +import com.hnac.hzinfo.sdk.v5.project.ProjectClient; +import com.hnac.hzinfo.sdk.v5.project.vo.ProjectNameVo; import com.hnac.hzinfo.sdk.v5.scada.ScadaClient; import com.hnac.hzinfo.sdk.v5.scada.vo.CanvasInfo; import lombok.AllArgsConstructor; @@ -19,6 +21,7 @@ import org.springframework.stereotype.Service; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -32,6 +35,7 @@ public class VectorDataServiceImpl implements VectorDataService { private final ModelClient modelClient; private final DeviceClient deviceClient; private final ScadaClient scadaClient; + private final ProjectClient projectClient; @Override @@ -91,6 +95,19 @@ public class VectorDataServiceImpl implements VectorDataService { @Override public List getScadaCanvas() { - return scadaClient.listCanvas().getData(); + List list = scadaClient.listCanvas().getData(); + List projectIds = list.stream().map(CanvasInfo::getProjectId).collect(Collectors.toList()); + List nameList = projectClient.getProjectNameList(projectIds).getData(); + if (null == nameList || nameList.isEmpty()) { + return list; + } + Map map = nameList.stream().collect(Collectors.toMap(ProjectNameVo::getId, ProjectNameVo::getName)); + list.forEach(item -> { + String projectName = map.get(item.getProjectId()); + if (null != projectName) { + item.setProjectName(projectName); + } + }); + return list; } } From 39173704c9d1348b88a0b71e14ddecc728abdfd8 Mon Sep 17 00:00:00 2001 From: luyie Date: Mon, 23 Sep 2024 20:19:35 +0800 Subject: [PATCH 10/10] =?UTF-8?q?add:=E7=94=BB=E5=B8=83=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=AB=99=E7=82=B9=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java index 6e5b1fa..eb82c3f 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java @@ -96,6 +96,9 @@ public class VectorDataServiceImpl implements VectorDataService { @Override public List getScadaCanvas() { List list = scadaClient.listCanvas().getData(); + if (null == list || list.isEmpty()) { + return new LinkedList<>(); + } List projectIds = list.stream().map(CanvasInfo::getProjectId).collect(Collectors.toList()); List nameList = projectClient.getProjectNameList(projectIds).getData(); if (null == nameList || nameList.isEmpty()) {