From 997d3e2b2cf51c0a5cc91df39e2927da1ce8abe9 Mon Sep 17 00:00:00 2001 From: luyie Date: Tue, 13 Aug 2024 11:14:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?add:=E6=99=BA=E8=B0=B1=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=95=B0=E6=8D=AE=EF=BC=8C=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/common/utils/FileUtil.java | 45 ++++++++++++++++++++++ .../bigmodel/api/dto/BigModelAnalysisDTO.java | 2 +- .../controller/ZhipuAnalysisController.java | 36 +++++++++++++++++ .../zhipuai/controller/ZhipuController.java | 36 ----------------- .../zhipuai/entity/ZhipuAnalysisInfoEntity.java | 4 ++ .../zhipuai/handler/ZhipuAnalysisFactory.java | 8 ++-- .../zhipuai/handler/ZhipuAnalysisHandlerGlm4v.java | 14 +++---- .../service/impl/ZhipuAnalysisServiceImpl.java | 29 +++++++++----- .../hzims/bigmodel/zhipuai/utils/ZhipuUtil.java | 45 ---------------------- .../zhipuai/vo/ZhipuAnalysisFileRequest.java | 5 +-- .../bigmodel/zhipuai/vo/ZhipuAnalysisInfoVO.java | 11 ++++++ 11 files changed, 126 insertions(+), 109 deletions(-) create mode 100644 hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/FileUtil.java create mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/controller/ZhipuAnalysisController.java delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/controller/ZhipuController.java delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/utils/ZhipuUtil.java diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/FileUtil.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/FileUtil.java new file mode 100644 index 0000000..c6167b5 --- /dev/null +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/FileUtil.java @@ -0,0 +1,45 @@ +package com.hnac.hzims.common.utils; + +import lombok.extern.slf4j.Slf4j; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.Base64; + +/** + * @Author: ypj + * @Date: 2024/8/13 9:35 + */ +@Slf4j +public class FileUtil { + public static byte[] getFileBytes(String filePath) { + File file = new File(filePath); + FileInputStream fileInputStream = null; + byte[] bytes = null; + try { + fileInputStream = new FileInputStream(file); + bytes = new byte[(int) file.length()]; + fileInputStream.read(bytes); + return bytes; + } catch (Exception e) { + log.error("读取文件出错", e); + } finally { + if (null != fileInputStream) { + try { + fileInputStream.close(); + } catch (IOException ignore) { + } + } + } + return bytes; + } + + public static String getBase64(byte[] bytes) { + return Base64.getEncoder().encodeToString(bytes); + } + + public static String getBase64(String filePath) { + return getBase64(getFileBytes(filePath)); + } +} diff --git a/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/api/dto/BigModelAnalysisDTO.java b/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/api/dto/BigModelAnalysisDTO.java index 3f0e8a3..5694e33 100644 --- a/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/api/dto/BigModelAnalysisDTO.java +++ b/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/api/dto/BigModelAnalysisDTO.java @@ -15,6 +15,6 @@ public class BigModelAnalysisDTO { @ApiModelProperty("策略编码") private String code; - @ApiModelProperty("文件地址") + @ApiModelProperty("文件地址或文件的base64文件内容") private String url; } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/controller/ZhipuAnalysisController.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/controller/ZhipuAnalysisController.java new file mode 100644 index 0000000..e770857 --- /dev/null +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/controller/ZhipuAnalysisController.java @@ -0,0 +1,36 @@ +package com.hnac.hzims.bigmodel.zhipuai.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.bigmodel.zhipuai.service.ZhipuAnalysisService; +import com.hnac.hzims.bigmodel.zhipuai.vo.ZhipuAnalysisFileRequest; +import com.hnac.hzims.bigmodel.zhipuai.vo.ZhipuAnalysisFileResponse; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; + +/** + * @Author: ypj + * @Date: 2024/8/8 16:36 + */ +@RestController +@RequestMapping("zhipu") +@Api(value = "智谱", tags = "智谱") +@AllArgsConstructor +public class ZhipuAnalysisController { + + private final ZhipuAnalysisService analysisService; + + @PostMapping("/analysis") + @ApiOperation("分析") + @ApiOperationSupport(order = 1) + public R analysis(@RequestBody @Valid ZhipuAnalysisFileRequest request) { + return R.data(analysisService.analysis(request)); + } +} diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/controller/ZhipuController.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/controller/ZhipuController.java deleted file mode 100644 index cbdfe95..0000000 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/controller/ZhipuController.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.hnac.hzims.bigmodel.zhipuai.controller; - -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.hnac.hzims.bigmodel.zhipuai.service.ZhipuAnalysisService; -import com.hnac.hzims.bigmodel.zhipuai.vo.ZhipuAnalysisFileRequest; -import com.hnac.hzims.bigmodel.zhipuai.vo.ZhipuAnalysisFileResponse; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.AllArgsConstructor; -import org.springblade.core.tool.api.R; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.validation.Valid; - -/** - * @Author: ypj - * @Date: 2024/8/8 16:36 - */ -@RestController -@RequestMapping("zhipu") -@Api(value = "智谱", tags = "智谱") -@AllArgsConstructor -public class ZhipuController { - - private final ZhipuAnalysisService analysisService; - - @PostMapping("/analysis") - @ApiOperation("分析") - @ApiOperationSupport(order = 1) - public R analysis(@RequestBody @Valid ZhipuAnalysisFileRequest request) { - return R.data(analysisService.analysis(request)); - } -} diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/entity/ZhipuAnalysisInfoEntity.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/entity/ZhipuAnalysisInfoEntity.java index 7375afd..cacf55a 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/entity/ZhipuAnalysisInfoEntity.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/entity/ZhipuAnalysisInfoEntity.java @@ -50,4 +50,8 @@ public class ZhipuAnalysisInfoEntity extends BaseEntity { @TableField("RESULT_CONDITION") private String resultCondition; + @ApiModelProperty(value = "对比方式") + @TableField("RESULT_JUDGE_MODEL") + private String resultJudgeModel; + } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/handler/ZhipuAnalysisFactory.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/handler/ZhipuAnalysisFactory.java index 34f390e..e4945b3 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/handler/ZhipuAnalysisFactory.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/handler/ZhipuAnalysisFactory.java @@ -22,15 +22,15 @@ public class ZhipuAnalysisFactory { private static final Map analysisStrategyMap = new ConcurrentHashMap<>(); - public ZhipuAnalyser getAnalysisStrategy(final String modelName) { - ZhipuAnalyser result = ZhipuAnalysisFactory.analysisStrategyMap.get(modelName); + public ZhipuAnalyser getAnalysisStrategy(final String strategyCode) { + ZhipuAnalyser result = ZhipuAnalysisFactory.analysisStrategyMap.get(strategyCode); if (Objects.nonNull(result)) { return result; } - Optional strategyOptional = analysisStrategyList.stream().filter(strategy -> strategy.isSupport(modelName)).findFirst(); + Optional strategyOptional = analysisStrategyList.stream().filter(strategy -> strategy.isSupport(strategyCode)).findFirst(); if (strategyOptional.isPresent()) { result = strategyOptional.get(); - ZhipuAnalysisFactory.analysisStrategyMap.put(modelName, result); + ZhipuAnalysisFactory.analysisStrategyMap.put(strategyCode, result); } return result; } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/handler/ZhipuAnalysisHandlerGlm4v.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/handler/ZhipuAnalysisHandlerGlm4v.java index e24865b..5c8f425 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/handler/ZhipuAnalysisHandlerGlm4v.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/handler/ZhipuAnalysisHandlerGlm4v.java @@ -2,7 +2,6 @@ package com.hnac.hzims.bigmodel.zhipuai.handler; import com.hnac.hzims.bigmodel.zhipuai.constants.AnalysisModel; import com.hnac.hzims.bigmodel.zhipuai.entity.ZhipuAnalysisInfoEntity; -import com.zhipu.oapi.ClientV4; import com.zhipu.oapi.Constants; import com.zhipu.oapi.service.v4.model.ChatCompletionRequest; import com.zhipu.oapi.service.v4.model.ChatMessage; @@ -13,10 +12,7 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.jackson.JsonUtil; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @Author: ypj @@ -29,18 +25,18 @@ public class ZhipuAnalysisHandlerGlm4v extends AbstractZhipuAnalysisHandler { @Override public String getAnalysisStrategy() { - return AnalysisModel.GLM_4V.getCode(); + return Constants.ModelChatGLM4V; } @Override public String getAnalysisModel() { - return AnalysisModel.GLM_4V.getCode(); + return Constants.ModelChatGLM4V; } @Override public ModelApiResponse sendRequest(ZhipuAnalysisInfoEntity info, String url) { ChatCompletionRequest request = getRequest(info, url); - log.info("send zhipu ai request :{}", request); + log.info("send zhipu ai request :{}", Optional.ofNullable(request).map(i -> JsonUtil.toJson(i)).orElse("null")); return client.invokeModelApi(request); } @@ -75,7 +71,7 @@ public class ZhipuAnalysisHandlerGlm4v extends AbstractZhipuAnalysisHandler { @Override public String getResult(ZhipuAnalysisInfoEntity info, String url) { ModelApiResponse response = sendRequest(info, url); - log.info("get zhi pu ai response : {}", JsonUtil.toJson(response)); + log.info("get zhi pu ai response : {}", Optional.ofNullable(response).map(r -> JsonUtil.toJson(r)).orElse("null")); if (response.isSuccess()) { String resultJson = response.getData().getChoices().get(0).getMessage().getContent().toString(); resultJson = resultJson.substring(resultJson.indexOf("{"), resultJson.indexOf("}") + 1).trim(); diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/service/impl/ZhipuAnalysisServiceImpl.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/service/impl/ZhipuAnalysisServiceImpl.java index 6ea5bd6..401052e 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/service/impl/ZhipuAnalysisServiceImpl.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/service/impl/ZhipuAnalysisServiceImpl.java @@ -1,20 +1,23 @@ package com.hnac.hzims.bigmodel.zhipuai.service.impl; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hnac.hzims.bigmodel.zhipuai.entity.ZhipuAnalysisInfoEntity; import com.hnac.hzims.bigmodel.zhipuai.handler.ZhipuAnalyser; import com.hnac.hzims.bigmodel.zhipuai.handler.ZhipuAnalysisFactory; +import com.hnac.hzims.bigmodel.zhipuai.service.ZhipuAnalysisInfoService; import com.hnac.hzims.bigmodel.zhipuai.service.ZhipuAnalysisService; -import com.hnac.hzims.bigmodel.zhipuai.utils.ZhipuUtil; import com.hnac.hzims.bigmodel.zhipuai.vo.ZhipuAnalysisFileRequest; import com.hnac.hzims.bigmodel.zhipuai.vo.ZhipuAnalysisFileResponse; +import com.hnac.hzims.common.utils.FileUtil; import com.hnac.hzinfo.exception.HzServiceException; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tool.jackson.JsonUtil; import org.springblade.core.tool.utils.StringUtil; import org.springframework.stereotype.Service; import org.springframework.util.Assert; -import java.util.Objects; +import java.util.Optional; /** * @Author: ypj @@ -24,11 +27,14 @@ import java.util.Objects; @AllArgsConstructor @Slf4j public class ZhipuAnalysisServiceImpl implements ZhipuAnalysisService { + private final ZhipuAnalysisFactory analysisFactory; + private final ZhipuAnalysisInfoService infoService; + @Override public ZhipuAnalysisFileResponse analysis(ZhipuAnalysisFileRequest request) { - Assert.isTrue(StringUtil.isBlank(request.getFilePath()) && StringUtil.isBlank(request.getFileContent()) && StringUtil.isBlank(request.getUrl()), () -> { + Assert.isTrue(StringUtil.isNotBlank(request.getFilePath()) || StringUtil.isNotBlank(request.getUrl()), () -> { throw new HzServiceException("文件为空"); }); ZhipuAnalysisInfoEntity info = getAnalysisInfo(request); @@ -44,21 +50,24 @@ public class ZhipuAnalysisServiceImpl implements ZhipuAnalysisService { if (StringUtil.isNotBlank(request.getUrl())) { return request.getUrl(); } - if (StringUtil.isNotBlank(request.getFileContent())) { - return request.getFileContent(); - } if (StringUtil.isNotBlank(request.getFilePath())) { - return ZhipuUtil.getBase64(request.getFilePath()); + return FileUtil.getBase64(request.getFilePath()); } return null; } @Override public ZhipuAnalysisInfoEntity getAnalysisInfo(ZhipuAnalysisFileRequest request) { - if (Objects.isNull(request.getCode())) { - return request.toAnalysisInfo(); + ZhipuAnalysisInfoEntity result = null; + if (StringUtil.isBlank(request.getCode())) { + result = request.toAnalysisInfo(); + } else { + result = infoService.getOne(Wrappers.lambdaQuery() + .eq(ZhipuAnalysisInfoEntity::getCode, request.getCode()) + .last("limit 1;")); } - return null; + log.info("the analysis information is {}", Optional.ofNullable(result).map(r -> JsonUtil.toJson(r)).orElse("null")); + return result; } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/utils/ZhipuUtil.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/utils/ZhipuUtil.java deleted file mode 100644 index cec9ca8..0000000 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/utils/ZhipuUtil.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.hnac.hzims.bigmodel.zhipuai.utils; - -import lombok.extern.slf4j.Slf4j; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.Base64; - -/** - * @Author: ypj - * @Date: 2024/8/12 21:07 - */ -@Slf4j -public class ZhipuUtil { - - public static byte[] getFileBytes(String filePath) { - File file = new File(filePath); - FileInputStream fileInputStream = null; - try { - fileInputStream = new FileInputStream(file); - byte[] bytes = new byte[(int) file.length()]; - fileInputStream.read(bytes); - return bytes; - } catch (Exception e) { - log.error("读取文件出错", e); - } finally { - if (null != fileInputStream) { - try { - fileInputStream.close(); - } catch (IOException ignore) { - } - } - } - return null; - } - - public static String getBase64(byte[] bytes) { - return Base64.getEncoder().encodeToString(bytes); - } - - public static String getBase64(String filePath) { - return getBase64(getFileBytes(filePath)); - } -} diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/vo/ZhipuAnalysisFileRequest.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/vo/ZhipuAnalysisFileRequest.java index 50a0fae..451c4aa 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/vo/ZhipuAnalysisFileRequest.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/vo/ZhipuAnalysisFileRequest.java @@ -19,15 +19,12 @@ public class ZhipuAnalysisFileRequest { @ApiModelProperty("模型名称") private String model; - @ApiModelProperty("文件地址") + @ApiModelProperty("文件地址或文件的base64内容") private String url; @ApiModelProperty("本地文件路径") private String filePath; - @ApiModelProperty("文件内容") - private String fileContent; - @ApiModelProperty("发送内容") private String content; diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/vo/ZhipuAnalysisInfoVO.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/vo/ZhipuAnalysisInfoVO.java index 574dfd8..d5461b8 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/vo/ZhipuAnalysisInfoVO.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/vo/ZhipuAnalysisInfoVO.java @@ -1,5 +1,9 @@ package com.hnac.hzims.bigmodel.zhipuai.vo; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.hnac.hzims.bigmodel.zhipuai.entity.ZhipuAnalysisInfoEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -17,6 +21,10 @@ import javax.validation.constraints.NotNull; @Data @EqualsAndHashCode(callSuper = false) public class ZhipuAnalysisInfoVO { + @JsonSerialize(using = ToStringSerializer.class) + @ApiModelProperty(value = "主键id") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private Long id; @ApiModelProperty(value = "策略编码") @NotNull @@ -44,6 +52,9 @@ public class ZhipuAnalysisInfoVO { @ApiModelProperty(value = "结果对比内容") private String resultCondition; + @ApiModelProperty(value = "对比方式") + private String resultJudgeModel; + public ZhipuAnalysisInfoEntity toEntity() { return BeanUtil.copy(this, ZhipuAnalysisInfoEntity.class); } From 62add639e728eb1c99f3545824e2f36028b33f3a Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 13 Aug 2024 11:27:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?update:=20=E5=AE=89=E5=85=A8=E5=B7=A5?= =?UTF-8?q?=E5=99=A8=E5=85=B7=E7=B1=BB=E5=9E=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/safeproduct/entity/SafetyToolTypeEntity.java | 2 +- .../hzims/safeproduct/service/impl/SafetyToolTypeServiceImpl.java | 6 ++++++ hzims-service/safeproduct/src/main/resources/db/3.0.0.sql | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SafetyToolTypeEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SafetyToolTypeEntity.java index 0d689b2..b3113bc 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SafetyToolTypeEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SafetyToolTypeEntity.java @@ -51,7 +51,7 @@ public class SafetyToolTypeEntity extends TenantEntity { private Date sendTime; @ApiModelProperty(value = "机构id") - private Long deptId; + private String deptId; @ApiModelProperty(value = "机构名称") private String deptName; diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolTypeServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolTypeServiceImpl.java index 94ff245..39bc18d 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolTypeServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolTypeServiceImpl.java @@ -137,6 +137,9 @@ public class SafetyToolTypeServiceImpl extends ServiceImpl safetyToolTypePages = super.page(Condition.getPage(query), queryWrapper); IPage pages = new Page<>(); @@ -171,6 +174,9 @@ public class SafetyToolTypeServiceImpl extends ServiceImpl types = this.list(queryWrapper); if(CollectionUtil.isEmpty(types)){ diff --git a/hzims-service/safeproduct/src/main/resources/db/3.0.0.sql b/hzims-service/safeproduct/src/main/resources/db/3.0.0.sql index ac9d443..a090039 100644 --- a/hzims-service/safeproduct/src/main/resources/db/3.0.0.sql +++ b/hzims-service/safeproduct/src/main/resources/db/3.0.0.sql @@ -10,5 +10,5 @@ ALTER TABLE `hzims_risk_hazard_task` ADD COLUMN `remark` text NULL ; ALTER TABLE `hzims_safe_safety_tool_type` - ADD COLUMN `dept_id` bigint(20) DEFAULT NULL COMMENT '机构id', - ADD COLUMN `dept_name` varchar(20) DEFAULT NULL COMMENT '机构名称'; \ No newline at end of file + ADD COLUMN `dept_id` varchar(50) DEFAULT NULL COMMENT '机构id', + ADD COLUMN `dept_name` varchar(50) DEFAULT NULL COMMENT '机构名称'; \ No newline at end of file