Browse Source

Merge branch 'prod-5.1.3' of http://175.6.40.68:8081/Jone/hzims-back into prod-5.1.3

zhongwei
wangyinsheng 2 months ago
parent
commit
be9ae2982a
  1. 1
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java
  2. 7
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java
  3. 2
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java
  4. 20
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamLogServiceImpl.java
  5. 9
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java

1
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<DeviceAttrInfoDTO> list = deviceClient.listDeviceAttr().getData(); List<DeviceAttrInfoDTO> list = deviceClient.listDeviceAttr().getData();
if (null != list && !list.isEmpty()) { if (null != list && !list.isEmpty()) {
list.forEach(item -> { list.forEach(item -> {
item.setItemName(item.getProjectName() + " " + item.getDeviceName() + " " + item.getName());
String rule = AccessRules.getDescByCode(item.getRule()); String rule = AccessRules.getDescByCode(item.getRule());
if (null != rule) { if (null != rule) {
item.setRule(rule); item.setRule(rule);

7
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; package com.hnac.gglm.bigmodel.maintenance.controller;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@ -69,11 +70,7 @@ public class VectorParamController {
@ApiOperation(value = "删除向量参数配置") @ApiOperation(value = "删除向量参数配置")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 4)
public R remove(@RequestParam @ApiParam("主键ID,按逗号分隔") String ids) { public R remove(@RequestParam @ApiParam("主键ID,按逗号分隔") String ids) {
Boolean result = vectorParamService.removeByIds(Func.toLongList(",", ids)); return R.status(vectorParamService.removeByIdsWithLog(Func.toLongList(",", ids)));
if (result) {
vectorParamLogService.delete(Func.toLongList(",", ids));
}
return R.status(result);
} }
@PutMapping("/update") @PutMapping("/update")

2
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<VectorParamEntity> {
Boolean synchronization(List<Long> id ,String bladeToken, String hzinfoToken); Boolean synchronization(List<Long> id ,String bladeToken, String hzinfoToken);
Boolean synchronization(Long id, String bladeToken, String hzinfoToken); Boolean synchronization(Long id, String bladeToken, String hzinfoToken);
Boolean removeByIdsWithLog(List<Long> isList);
} }

20
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 com.hnac.gglm.bigmodel.maintenance.service.VectorParamLogService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/** /**
* @Author: ypj * @Author: ypj
@ -31,6 +29,7 @@ public class VectorParamLogServiceImpl extends ServiceImpl<VectorParamLogMapper,
return false; return false;
} }
req.setType(DataOperateType.CREATE.getCode()); req.setType(DataOperateType.CREATE.getCode());
req.setCreateUser(AuthUtil.getUserId());
return save(req); return save(req);
} }
@ -40,6 +39,7 @@ public class VectorParamLogServiceImpl extends ServiceImpl<VectorParamLogMapper,
return false; return false;
} }
req.setType(DataOperateType.UPDATE.getCode()); req.setType(DataOperateType.UPDATE.getCode());
req.setCreateUser(AuthUtil.getUserId());
return save(req); return save(req);
} }
@ -49,18 +49,19 @@ public class VectorParamLogServiceImpl extends ServiceImpl<VectorParamLogMapper,
return false; return false;
} }
req.setType(DataOperateType.RESET.getCode()); req.setType(DataOperateType.RESET.getCode());
req.setCreateUser(AuthUtil.getUserId());
return save(req); return save(req);
} }
@Override @Override
public Boolean delete(List<Long> ids) { public Boolean delete(List<Long> ids) {
ThreadPoolExecutor executor = new ThreadPoolExecutor(5, ids.size() > 5 ? ids.size() : 5, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); final Long userId = AuthUtil.getUserId();
ids.forEach(id -> { ids.forEach(id -> {
executor.execute(() -> { VectorParamLogEntity log = VectorParamLogEntity.builder()
save(VectorParamLogEntity.builder() .vectorParamId(id)
.vectorParamId(id) .type(DataOperateType.DELETE.getCode()).build();
.type(DataOperateType.DELETE.getCode()).build()); log.setCreateUser(userId);
}); save(log);
}); });
return Boolean.TRUE; return Boolean.TRUE;
} }
@ -71,6 +72,7 @@ public class VectorParamLogServiceImpl extends ServiceImpl<VectorParamLogMapper,
return false; return false;
} }
req.setType(DataOperateType.SYNCHRONIZATION.getCode()); req.setType(DataOperateType.SYNCHRONIZATION.getCode());
req.setCreateUser(AuthUtil.getUserId());
return save(req); return save(req);
} }
} }

9
hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java

@ -171,4 +171,13 @@ public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, Vecto
} }
return true; return true;
} }
@Override
public Boolean removeByIdsWithLog(List<Long> idList) {
Boolean result = baseMapper.deleteBatchIds(idList) > 0;
if (result) {
vectorParamLogService.delete(idList);
}
return result;
}
} }

Loading…
Cancel
Save