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); 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; + } }