diff --git a/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/api/constants/MqttTopicConstants.java b/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/api/constants/MqttTopicConstants.java index 183b2d6..d4166d4 100644 --- a/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/api/constants/MqttTopicConstants.java +++ b/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/api/constants/MqttTopicConstants.java @@ -21,5 +21,10 @@ public interface MqttTopicConstants { */ String RUN_REPORT_ANALYSE_RESULT = "topic_run_report_analyse_result"; + /** + * 识别结果 + */ + String IDENTITY_RESULT = "topic_hznlm_identify_result"; + } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/database/controller/WeaviateController.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/database/controller/WeaviateController.java new file mode 100644 index 0000000..7683887 --- /dev/null +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/database/controller/WeaviateController.java @@ -0,0 +1,38 @@ +package com.hnac.hzims.bigmodel.database.controller; + +import com.hnac.hzims.bigmodel.database.dto.WeaviateSaveDTO; +import com.hnac.hzims.bigmodel.database.service.WeaviateService; +import io.weaviate.client.v1.data.model.WeaviateObject; +import lombok.AllArgsConstructor; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @Author: huangxing + * @Date: 2024/09/04 14:16 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/weaviate") +public class WeaviateController { + + private final WeaviateService weaviateService; + + @PostMapping("/saveBatch") + public R saveBatch(@RequestBody WeaviateSaveDTO req) { + weaviateService.saveBatch(req.getEntities(), req.getClassName(), req.getAttrsMap()); + return R.success("操作成功!"); + } + + @GetMapping("/list") + public R> list(@RequestParam(value = "id",required = false) String id, @RequestParam("className") String className) { + return R.data(weaviateService.list(id,className)); + } + + @DeleteMapping("/removeById") + public R removeById(@RequestParam(value = "id",required = false) String id, @RequestParam("className") String className) { + return R.status(weaviateService.delete(id,className)); + } +} diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/database/dto/WeaviateSaveDTO.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/database/dto/WeaviateSaveDTO.java new file mode 100644 index 0000000..715298e --- /dev/null +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/database/dto/WeaviateSaveDTO.java @@ -0,0 +1,33 @@ +package com.hnac.hzims.bigmodel.database.dto; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * @Author: huangxing + * @Date: 2024/09/04 14:36 + */ +@Data +@EqualsAndHashCode +public class WeaviateSaveDTO implements Serializable { + + /** + * 向量数据库表名 + */ + private String className; + + /** + * 向量数据库属性名 + */ + private Map attrsMap; + + /** + * 向量数据库存入对象列表 + */ + private List entities; + +} diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/database/service/WeaviateService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/database/service/WeaviateService.java index cbc926b..5b0f00e 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/database/service/WeaviateService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/database/service/WeaviateService.java @@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject; import com.google.common.collect.Lists; import com.hnac.hzims.bigmodel.configuration.BigModelInvokeApi; import com.hnac.hzinfo.exception.HzServiceException; +import io.weaviate.client.WeaviateClient; import io.weaviate.client.base.Result; import io.weaviate.client.v1.data.api.ObjectCreator; import io.weaviate.client.v1.data.api.ObjectDeleter; @@ -38,10 +39,7 @@ import java.util.stream.IntStream; @Slf4j public class WeaviateService { - private final ObjectCreator objectCreator; - private final ObjectUpdater objectUpdater; - private final ObjectDeleter objectDeleter; - private final ObjectsGetter objectsGetter; + private final WeaviateClient weaviateClient; private final BigModelInvokeApi invokeApi; @Value("${gglm.vectorUrl}") @@ -55,7 +53,7 @@ public class WeaviateService { * @return 保存操作结果 */ public Boolean save(Object entity, String className, List attrs) { - ObjectCreator creator = objectCreator.withClassName(className); + ObjectCreator creator = weaviateClient.data().creator().withClassName(className); if(Func.isNotEmpty(attrs)) { JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(entity)); List vectors = attrs.stream().map(attr -> jsonObject.getString(attr)).collect(Collectors.toList()); @@ -74,7 +72,7 @@ public class WeaviateService { * @return 保存操作结果 */ public Boolean saveBatch(List entities,String className, Map attrsMap) { - ObjectCreator creator = objectCreator.withClassName(className); + ObjectCreator creator = weaviateClient.data().creator().withClassName(className); List vectorStrs = Lists.newArrayList(); List attrs = Lists.newArrayList(); if(Func.isNotEmpty(attrsMap)) { @@ -91,7 +89,12 @@ public class WeaviateService { Float[] vectors = this.compute(vectorStrs); List> vector = this.splitVector(entities.size(), attrsMap, vectors); for(int i = 0; i < entities.size(); i++) { - creator.withProperties(BeanUtil.toMap(entities.get(i))).withVectors(vector.get(i)).run(); + // log.info("vector:{}",JSON.toJSONString(vector.get(i))); + JSONObject object = JSONObject.parseObject(JSON.toJSONString(entities.get(i))); + Map properties = new HashMap<>(); + object.forEach((k,v) -> properties.put(k,v)); + log.info("properties:{}",JSON.toJSONString(properties)); + creator.withProperties(properties).withVectors(vector.get(i)).run(); } } else { entities.forEach(entity -> creator.withProperties(BeanUtil.toMap(entity)).run()); @@ -105,18 +108,15 @@ public class WeaviateService { * @param className 表名 * @return 删除结果 */ - public Boolean deleteByClassName(String className) { - Result result = objectDeleter.withClassName(className).run(); - return !result.hasErrors(); - } - - /** - * 删除向量数据库(ID) - * @param id 向量数据库ID - * @return 删除结果 - */ - public Boolean deleteById(String id) { - Result result = objectDeleter.withID(id).run(); + public Boolean delete(String id,String className) { + ObjectDeleter deleter = weaviateClient.data().deleter(); + if(Func.isNotEmpty(id)) { + deleter.withID(id); + } + if(Func.isNotEmpty(className)) { + deleter.withClassName(className); + } + Result result = deleter.run(); return !result.hasErrors(); } @@ -126,7 +126,7 @@ public class WeaviateService { * @return 更新结果 */ public Boolean updateById(String id, Object entity, String className, Map attrMap) { - ObjectUpdater updater = objectUpdater.withClassName(className).withID(id).withProperties(BeanUtil.toMap(entity)); + ObjectUpdater updater = weaviateClient.data().updater().withClassName(className).withID(id).withProperties(BeanUtil.toMap(entity)); // 计算向量 Map vector = new HashMap<>(); if(Func.isNotEmpty(attrMap)) { @@ -143,7 +143,8 @@ public class WeaviateService { return !result.hasErrors(); } - public List list(String id,String className) { + public List list(String id,String className) { + ObjectsGetter objectsGetter = weaviateClient.data().objectsGetter(); if(Func.isNotEmpty(id)) { objectsGetter.withID(id); } @@ -154,7 +155,7 @@ public class WeaviateService { if(result.hasErrors()) { throw new HzServiceException("查询失败!"); } - return result.getResult().stream().map(WeaviateObject::getProperties).collect(Collectors.toList()); + return result.getResult(); } /** @@ -176,10 +177,11 @@ public class WeaviateService { List splitIndex = this.getSplitIndex(vectors.size(), attrsMap.size()); AtomicInteger i = new AtomicInteger(); attrsMap.forEach((k,v) -> { - List vector = vectors.subList(splitIndex.get(i.get()), splitIndex.get(i.get() + (vectors.size() / attrsMap.size()))); + List vector = vectors.subList(splitIndex.get(i.get()), splitIndex.get(i.get()) + (vectors.size() / attrsMap.size())); vectorMap.put(k, vector.toArray(new Float[vector.size()])); i.getAndIncrement(); }); + result.add(vectorMap); }); return result; } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/factory/AnswerResolveFactory.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/factory/AnswerResolveFactory.java index 9d79754..12aefc3 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/factory/AnswerResolveFactory.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/factory/AnswerResolveFactory.java @@ -21,6 +21,7 @@ public class AnswerResolveFactory { public static final String REMOTE_ANSWER_SERVICE = "remoteAnswerResolveService"; public static final String PARAM_ANSWER_SERVICE = "paramAnswerResolveService"; public static final String PRE_ANSWER_SERVICE = "preAnswerResolveService"; + public static final String CONTROL_DEVICE_SERVICE = "controlAnswerResolveService"; public static IAnswerResolveService getResolveService(Object extra) { String funcCode = JSONObject.parseObject(JSON.toJSONString(extra)).getString("func"); @@ -44,6 +45,8 @@ public class AnswerResolveFactory { return SpringUtil.getBean(REMOTE_ANSWER_SERVICE); case SHOW_PARAM: return SpringUtil.getBean(PARAM_ANSWER_SERVICE); + case CONTROL_DEVICE: + return SpringUtil.getBean(CONTROL_DEVICE_SERVICE); default: return null; } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ControlAnswerResolveServiceImpl.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ControlAnswerResolveServiceImpl.java new file mode 100644 index 0000000..8037e44 --- /dev/null +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ControlAnswerResolveServiceImpl.java @@ -0,0 +1,32 @@ +package com.hnac.hzims.bigmodel.interactive.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.hnac.hzims.bigmodel.interactive.factory.AnswerResolveFactory; +import com.hnac.hzims.bigmodel.interactive.service.IAnswerResolveService; +import com.hnac.hzims.bigmodel.interactive.vo.AnswerVO; +import com.hnac.hzims.bigmodel.interactive.vo.ExtraVO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @Author: huangxing + * @Date: 2024/08/30 11:33 + */ +@Service(AnswerResolveFactory.CONTROL_DEVICE_SERVICE) +@Slf4j +public class ControlAnswerResolveServiceImpl implements IAnswerResolveService { + + @Override + public AnswerVO resolve(AnswerVO answer) { + Object[] extraArray = this.extraStream(answer).map(this::getExtra).toArray(); + answer.setExtras(extraArray); + return answer; + } + + @Override + public ExtraVO getExtra(JSONObject originExtra) { + log.info("控制指令传参为:{}", JSON.toJSONString(originExtra)); + return null; + } +} diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java index 328e7b0..b5621d3 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/AnswerVO.java @@ -65,8 +65,7 @@ public class AnswerVO implements Serializable { return new AnswerVO(sessionId,userId,0,-2,null,query, InfoMessageConstant.ERROR_MESSAGE, null,null,new String[]{InfoMessageConstant.ERROR_MESSAGE}); } - public static void error(AnswerVO usualVO) { - usualVO.setRunning(0); - usualVO.setStatus(-2); + public static AnswerVO progress(String sessionId,String userId,String query,String message,Integer status) { + return new AnswerVO(sessionId,userId,1,status,null,query, message, null,null,new String[]{message}); } } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/VectorParamController.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/VectorParamController.java index 86b9031..13b0475 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/VectorParamController.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/VectorParamController.java @@ -17,6 +17,7 @@ import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -76,8 +77,10 @@ public class VectorParamController { @GetMapping("/getUrlResponse") @ApiOperation(value = "通过url获取向量参数数据") @ApiOperationSupport(order = 7) - public R getUrlResponse(@RequestParam String url, @RequestHeader("Blade-Auth") String token) { - return R.data(vectorParamService.getUrlResponse(url, token)); + public R getUrlResponse(@RequestParam String url, + @RequestHeader(name = "Blade-Auth", value = "Blade-Auth", required = false) String bladeToken, + @RequestHeader(name = "Hzinfo-Auth", value = "Hzinfo-Auth", required = false) String hzinfoToken) { + return R.data(vectorParamService.getUrlResponse(url, bladeToken, hzinfoToken)); } @GetMapping("/getTestData") @@ -91,4 +94,13 @@ public class VectorParamController { data.put("data", "data"); return R.data(data); } + + @GetMapping("/getUrlResponseKeyList") + @ApiOperation(value = "获取url返回的key列表") + @ApiOperationSupport(order = 9) + public R> getUrlResponseKeyList(@RequestParam String url, + @RequestHeader(name = "Blade-Auth", value = "Blade-Auth", required = false) String bladeToken, + @RequestHeader(name = "Hzinfo-Auth", value = "Hzinfo-Auth", required = false) String hzinfoToken) { + return R.data(vectorParamService.getUrlResponseKeyList(url, bladeToken, hzinfoToken)); + } } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/VectorParamEntity.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/VectorParamEntity.java index c1f6ed6..f38826f 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/VectorParamEntity.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/VectorParamEntity.java @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +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; @@ -21,6 +23,7 @@ public class VectorParamEntity extends TenantEntity implements Serializable { @ApiModelProperty("参数名称") @TableField("NAME") + @QueryField(condition = SqlCondition.LIKE) private String name; @ApiModelProperty("url") diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/VectorParamService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/VectorParamService.java index 392a877..4fac0be 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/VectorParamService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/VectorParamService.java @@ -3,6 +3,7 @@ package com.hnac.hzims.bigmodel.maintenance.service; import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.bigmodel.maintenance.entity.VectorParamEntity; +import java.util.List; import java.util.Map; /** @@ -13,5 +14,7 @@ import java.util.Map; public interface VectorParamService extends IService { String getAuthorization(); - Map getUrlResponse(String url, String token); + Map getUrlResponse(String url, String bladeToken ,String hzinfoToken); + + List getUrlResponseKeyList(String url, String bladeToken, String hzinfoToken); } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java index 65e2545..0878002 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java @@ -6,12 +6,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.bigmodel.maintenance.entity.VectorParamEntity; import com.hnac.hzims.bigmodel.maintenance.mapper.VectorParamMapper; import com.hnac.hzims.bigmodel.maintenance.service.VectorParamService; +import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.jackson.JsonUtil; import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletResponse; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; import java.util.Base64; +import java.util.List; import java.util.Map; /** @@ -19,6 +22,7 @@ import java.util.Map; * @Date: 2024/9/2 16:14 */ @Service +@Slf4j public class VectorParamServiceImpl extends ServiceImpl implements VectorParamService { private static final String CLIENT_SIGN = "vector_param"; @@ -29,13 +33,27 @@ public class VectorParamServiceImpl extends ServiceImpl getUrlResponseKeyList(String url, String bladeToken, String hzinfoToken) { + List result = new ArrayList<>(); + Map map = getUrlResponse(url, bladeToken, hzinfoToken); + Map data = ((Map) map.get("data")); + if (data != null) { + result.addAll(data.keySet()); + } else { + result.addAll(map.keySet()); + } + return result; + } } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/FrontEndInteractiveSchedule.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/FrontEndInteractiveSchedule.java index d4bf7e7..6ffbf5a 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/FrontEndInteractiveSchedule.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/FrontEndInteractiveSchedule.java @@ -50,34 +50,35 @@ public class FrontEndInteractiveSchedule { return ReturnT.SUCCESS; } List answerList = hznlmInvokeService.getAnswerBySessionIds(String.join(",", sessionIds)); - answerList.stream().parallel().forEach(answerVO -> CompletableFuture.runAsync(() -> { - // 如果已经获取到答案 则删除缓存 - if(answerVO.getRunning() == 0) { - log.info("获取大模型解析答案:{}" , JSON.toJSONString(answerVO)); - sessionRedisManager.removeSessionId(answerVO.getChatId()); - } - Object[] extras = answerVO.getExtras(); - if(ObjectUtil.isNotEmpty(answerVO.getExtras()) && extras.length > 0){ - try { - // 解析答案 - Object[] resolveExtras = Arrays.stream(extras).map(extra -> { - IAnswerResolveService answerResolveService = AnswerResolveFactory.getResolveService(extra); - if(Func.isNotEmpty(answerResolveService)) { - JSONObject extraObject = JSONObject.parseObject(JSON.toJSONString(extra)); - return answerResolveService.getExtra(extraObject); - } - return extra; - }).map(JSON::toJSONString).toArray(); - answerVO.setExtras(resolveExtras); - } - catch(Exception e) { - log.error("An error occurred",e); - AnswerVO.error(answerVO.getChatId(), answerVO.getUserId(), answerVO.getQuery()); - } - } - TextMessage message = InteractiveSessionManager.getTextMessage("1",JSON.toJSONString(answerVO)); - wsService.sendMessage(answerVO.getChatId(),message); - }, getAnswerPoolExecutor)); + answerList.stream().parallel().forEach(answerVO -> CompletableFuture.runAsync(() -> this.formatAnswer(answerVO), getAnswerPoolExecutor)); return ReturnT.SUCCESS; } + + private void formatAnswer(AnswerVO answerVO) { + // 如果已经获取到答案 则删除缓存 + if(answerVO.getRunning() == 0) { + log.info("获取大模型解析答案:{}", JSON.toJSONString(answerVO)); + sessionRedisManager.removeSessionId(answerVO.getChatId()); + } + Object[] extras = answerVO.getExtras(); + // 格式化 extra + if(Func.isNotEmpty(extras)) { + try { + Object[] resolveExtras = Arrays.stream(extras).map(extra -> { + IAnswerResolveService answerResolveService = AnswerResolveFactory.getResolveService(extra); + if (Func.isNotEmpty(answerResolveService)) { + JSONObject extraObject = JSONObject.parseObject(JSON.toJSONString(extra)); + return answerResolveService.getExtra(extraObject); + } + return extra; + }).map(JSON::toJSONString).toArray(); + answerVO.setExtras(resolveExtras); + } catch(Exception e) { + log.error("An error occurred",e); + AnswerVO.error(answerVO.getChatId(), answerVO.getUserId(), answerVO.getQuery()); + } + } + TextMessage message = InteractiveSessionManager.getTextMessage("1",JSON.toJSONString(answerVO)); + wsService.sendMessage(answerVO.getChatId(),message); + } } diff --git a/hzims-service/hzims-big-model/src/main/resources/template/template.yml b/hzims-service/hzims-big-model/src/main/resources/template/template.yml index ea6a966..8674b5f 100644 --- a/hzims-service/hzims-big-model/src/main/resources/template/template.yml +++ b/hzims-service/hzims-big-model/src/main/resources/template/template.yml @@ -63,7 +63,7 @@ gglm: smartReportGeneratePower: "/custom/smart_report_generate_power" assistantAnalyseAsk: "/qa/assistant_analyse_ask" updateKnowledge: "/kn/update_knowledge" - compute: "compute" + compute: "/compute" swagger: base-packages: com.hnac.hzims.bigmodel @@ -84,4 +84,11 @@ xxl: bigmodel: zhipuai: url: https://open.bigmodel.cn/api/paas/v4/chat/completions - apiSecret: dfd23052747674818c7ac6f9922beff1.n2o5JEdfnrLbFU53 \ No newline at end of file + apiSecret: dfd23052747674818c7ac6f9922beff1.n2o5JEdfnrLbFU53 + +weaviate: + datasource: + schema: http + host: 192.168.60.16 + port: 9992 + apiKey: 123 diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/config/XxlJobConfig.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/config/XxlJobConfig.java index b9e8f2c..6cfe4e7 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/config/XxlJobConfig.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/config/XxlJobConfig.java @@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration; * * @author xuxueli 2017-04-28 */ -@Configuration +//@Configuration @Slf4j public class XxlJobConfig { diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ObjectUserMapper.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ObjectUserMapper.java index 58c01bd..7a42592 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ObjectUserMapper.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ObjectUserMapper.java @@ -1,5 +1,6 @@ package com.hnac.hzinfo.inspect.obj.mapper; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import org.springblade.core.datascope.annotation.UserDataAuth; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzinfo.inspect.obj.entity.ObjectUserEntity; @@ -16,5 +17,6 @@ import java.util.List; public interface ObjectUserMapper extends BaseMapper{ @UserDataAuth + @InterceptorIgnore(tenantLine = "true") List getPageList(@Param("user") ObjectUserListQuery user); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ProjectContentMapper.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ProjectContentMapper.java index 4bbad5a..7ab8ae1 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ProjectContentMapper.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ProjectContentMapper.java @@ -1,5 +1,6 @@ package com.hnac.hzinfo.inspect.obj.mapper; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzinfo.inspect.obj.entity.ContentEntity; import com.hnac.hzinfo.inspect.obj.entity.ProjectContentEntity; @@ -18,6 +19,7 @@ public interface ProjectContentMapper extends BaseMapper{ * @param projectId 项目id * @return */ + @InterceptorIgnore(tenantLine = "true") List getListByProjectId(Long projectId); /** @@ -26,6 +28,7 @@ public interface ProjectContentMapper extends BaseMapper{ * @param projectId 项目id * @return */ + @InterceptorIgnore(tenantLine = "true") List getListByPrjId(Long projectId); @@ -35,5 +38,6 @@ public interface ProjectContentMapper extends BaseMapper{ * @param projectId * @return */ + @InterceptorIgnore(tenantLine = "true") Integer getMaxSortProjectContentByProjectId(Long projectId); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/TemplateProjectMapper.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/TemplateProjectMapper.java index 4e67f3b..2a718db 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/TemplateProjectMapper.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/TemplateProjectMapper.java @@ -1,5 +1,6 @@ package com.hnac.hzinfo.inspect.obj.mapper; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzinfo.inspect.obj.entity.TemplateProjectEntity; import com.hnac.hzinfo.inspect.obj.vo.ProjectContentDto; @@ -17,6 +18,7 @@ public interface TemplateProjectMapper extends BaseMapper * 根据模板id获取项目 * @param templateId */ + @InterceptorIgnore(tenantLine = "true") List getListByTemplateId(Long templateId); /** @@ -24,6 +26,7 @@ public interface TemplateProjectMapper extends BaseMapper * 根据模板id获取项目内容 * @param templateId */ + @InterceptorIgnore(tenantLine = "true") List getProjectsByTemplateId(Long templateId); /** @@ -31,5 +34,6 @@ public interface TemplateProjectMapper extends BaseMapper * @param templateId * @return */ + @InterceptorIgnore(tenantLine = "true") Integer getMaxSortTemplateProjectByTemplateId(Long templateId); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskObjectMapper.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskObjectMapper.java index 6366203..40c29ae 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskObjectMapper.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskObjectMapper.java @@ -1,5 +1,6 @@ package com.hnac.hzinfo.inspect.task.mapper; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzinfo.inspect.task.entity.TaskObjectEntity; import com.hnac.hzinfo.inspect.task.vo.TaskObjectOfflineVO; @@ -17,9 +18,12 @@ import java.util.List; @Mapper public interface TaskObjectMapper extends BaseMapper { + @InterceptorIgnore(tenantLine = "true") List getTaskObjects(@Param("to") TaskObjectEntity to); + @InterceptorIgnore(tenantLine = "true") List getTaskObjectsDetail(@Param("to") TaskObjectEntity to); + @InterceptorIgnore(tenantLine = "true") List getExObjectData(@Param("taskIds") List taskIds); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskObjectProjectContentMapper.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskObjectProjectContentMapper.java index a4bb9dd..3d33b96 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskObjectProjectContentMapper.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskObjectProjectContentMapper.java @@ -1,5 +1,6 @@ package com.hnac.hzinfo.inspect.task.mapper; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzinfo.inspect.task.entity.TaskObjectProjectContentEntity; import org.apache.ibatis.annotations.Mapper; @@ -15,5 +16,6 @@ import java.util.List; @Mapper public interface TaskObjectProjectContentMapper extends BaseMapper { + @InterceptorIgnore(tenantLine = "true") List getTaskObjectProjectContents(@Param("topc")TaskObjectProjectContentEntity topc); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskObjectProjectMapper.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskObjectProjectMapper.java index 5576f33..2f26684 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskObjectProjectMapper.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskObjectProjectMapper.java @@ -1,5 +1,6 @@ package com.hnac.hzinfo.inspect.task.mapper; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzinfo.inspect.task.entity.TaskObjectProjectEntity; import com.hnac.hzinfo.inspect.task.vo.TaskObjectProjectOfflineVO; @@ -16,7 +17,9 @@ import java.util.List; @Mapper public interface TaskObjectProjectMapper extends BaseMapper { + @InterceptorIgnore(tenantLine = "true") List getTaskObjectProjects(@Param("top")TaskObjectProjectEntity top); + @InterceptorIgnore(tenantLine = "true") List getObjectProjectData(@Param("taskIds") List taskIds); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskUserMapper.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskUserMapper.java index cf02c0e..7069d1b 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskUserMapper.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskUserMapper.java @@ -1,5 +1,6 @@ package com.hnac.hzinfo.inspect.task.mapper; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzinfo.inspect.task.entity.TaskUserEntity; import org.apache.ibatis.annotations.Mapper; @@ -19,9 +20,12 @@ public interface TaskUserMapper extends BaseMapper { * @param planId 计划id * @return */ + @InterceptorIgnore(tenantLine = "true") int deleteByPlanId(@Param("planId") Long planId); + @InterceptorIgnore(tenantLine = "true") int updateDeleteStatus(@Param("taskId") Long taskId); + @InterceptorIgnore(tenantLine = "true") List getOfflineTaskUser(@Param("taskIds") List taskIds); } diff --git a/hzims-service/inspect/src/main/resources/template/template.yml b/hzims-service/inspect/src/main/resources/template/template.yml index d98efae..b76ac2c 100644 --- a/hzims-service/inspect/src/main/resources/template/template.yml +++ b/hzims-service/inspect/src/main/resources/template/template.yml @@ -36,8 +36,8 @@ swagger: xxl: job: auto: - registry: 0 - accessToken: '' + registry: 1 + accessToken: 'hzinfo88238888!' admin: addresses: http://${hzims.xxljob.ip}:${hzims.xxljob.port}/xxl-job-admin executor: diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/config/XxlJobConfig.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/config/XxlJobConfig.java index 87e5702..abd57d1 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/config/XxlJobConfig.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/config/XxlJobConfig.java @@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration; * * @author xuxueli 2017-04-28 */ -@Configuration +//@Configuration @Slf4j public class XxlJobConfig { diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java index 702c252..7ce7f09 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java @@ -237,7 +237,7 @@ public class SafetyToolServiceImpl extends ServiceImpl pdfList = new ArrayList<>(entityList.size()); entityList.forEach(entity -> { - String imgPath = uploadPath + "/" + entity.getTenantId() + entity.getToolCode() + UPLOAD_IMG_SUFFIX; + String imgPath = uploadPath + "/" + entity.getTenantId() + entity.getToolCode().trim() + UPLOAD_IMG_SUFFIX; File file = new File(imgPath); if (!file.exists()) { /**生成二维码**/ diff --git a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/config/XxlJobConfig.java b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/config/XxlJobConfig.java index 17addb3..9218773 100644 --- a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/config/XxlJobConfig.java +++ b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/config/XxlJobConfig.java @@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration; * * @author xuxueli 2017-04-28 */ -@Configuration +//@Configuration @Slf4j public class XxlJobConfig { diff --git a/hzims-service/weather/src/main/resources/template/template.yml b/hzims-service/weather/src/main/resources/template/template.yml index 07e71e7..4f99325 100644 --- a/hzims-service/weather/src/main/resources/template/template.yml +++ b/hzims-service/weather/src/main/resources/template/template.yml @@ -30,8 +30,8 @@ mybatis-plus: xxl: job: auto: - registry: 0 - accessToken: '' + registry: 1 + accessToken: 'hzinfo88238888!' admin: addresses: "http://${hzims.xxljob.ip}:${hzims.xxljob.port}/xxl-job-admin" executor: