From a1a739bef72ae9dd7ffa96ccc1994dac1baf9596 Mon Sep 17 00:00:00 2001 From: luyie Date: Mon, 9 Sep 2024 20:56:48 +0800 Subject: [PATCH] =?UTF-8?q?add:=E5=A4=A7=E6=A8=A1=E5=9E=8B=EF=BC=8C?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=A0=87=E6=B3=A8=EF=BC=8C=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maintenance/controller/AgentLogController.java | 13 +++++++++++- .../controller/VectorParamController.java | 4 ++-- .../maintenance/entity/AgentLogEntity.java | 24 ++++++++++++++++++++++ .../maintenance/service/AgentLogService.java | 2 ++ .../service/impl/AgentLogServiceImpl.java | 9 ++++++++ .../hzims/bigmodel/maintenance/vo/IdsRequest.java | 15 ++++++++++++++ .../maintenance/vo/VectorSynchronizeRequest.java | 15 -------------- .../report/service/impl/RunMonthServiceImpl.java | 11 ++++++++++ 8 files changed, 75 insertions(+), 18 deletions(-) create mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/vo/IdsRequest.java delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/vo/VectorSynchronizeRequest.java diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/AgentLogController.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/AgentLogController.java index 3fdb5e3..fc81a73 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/AgentLogController.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/AgentLogController.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.bigmodel.maintenance.entity.AgentLogEntity; import com.hnac.hzims.bigmodel.maintenance.service.AgentLogService; +import com.hnac.hzims.bigmodel.maintenance.vo.IdsRequest; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; @@ -21,6 +23,8 @@ import org.springframework.web.bind.annotation.*; @RestController @Slf4j @AllArgsConstructor +@RequestMapping("/label") +@Api(value = "问题标注", tags = "问题标注") public class AgentLogController { private final AgentLogService agentLogService; @@ -41,7 +45,7 @@ public class AgentLogController { @PostMapping("/save") @ApiOperation(value = "保存") @ApiOperationSupport(order = 3) - public R save(@RequestParam AgentLogEntity req) { + public R save(@RequestBody AgentLogEntity req) { return R.status(agentLogService.save(req)); } @@ -58,4 +62,11 @@ public class AgentLogController { public R update(@RequestBody AgentLogEntity req) { return R.status(agentLogService.updateById(req)); } + + @PutMapping("/batchLabel") + @ApiOperation(value = "批量标注") + @ApiOperationSupport(order = 6) + public R BatchLabel(@RequestBody IdsRequest ids) { + return R.status(agentLogService.BatchLabel(ids)); + } } 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 a5db614..e178519 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 @@ -5,7 +5,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.bigmodel.maintenance.entity.VectorParamEntity; import com.hnac.hzims.bigmodel.maintenance.service.VectorParamService; -import com.hnac.hzims.bigmodel.maintenance.vo.VectorSynchronizeRequest; +import com.hnac.hzims.bigmodel.maintenance.vo.IdsRequest; import com.hnac.hzinfo.api.annotation.ApiInterface; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -112,7 +112,7 @@ public class VectorParamController { @ApiOperation(value = "同步") @ApiOperationSupport(order = 10) public R synchronization(@RequestHeader(name = "Blade-Auth", value = "Blade-Auth", required = false) String bladeToken, - @RequestHeader(name = "Hzinfo-Auth", value = "Hzinfo-Auth", required = false) String hzinfoToken, @RequestBody VectorSynchronizeRequest req) throws JsonProcessingException { + @RequestHeader(name = "Hzinfo-Auth", value = "Hzinfo-Auth", required = false) String hzinfoToken, @RequestBody IdsRequest req) throws JsonProcessingException { return R.status(vectorParamService.synchronization(req.getIds(), bladeToken, hzinfoToken)); } } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/AgentLogEntity.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/AgentLogEntity.java index b28e64b..e23c793 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/AgentLogEntity.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/AgentLogEntity.java @@ -1,10 +1,13 @@ package com.hnac.hzims.bigmodel.maintenance.entity; +import com.alibaba.fastjson.annotation.JSONField; import com.baomidou.mybatisplus.annotation.TableField; 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,30 +24,51 @@ public class AgentLogEntity extends TenantEntity implements Serializable { @ApiModelProperty("对话id") @TableField("CHAT_ID") + @QueryField(condition = SqlCondition.EQUAL) private String chatId; @ApiModelProperty("问题id") @TableField("Q_ID") + @QueryField(condition = SqlCondition.EQUAL) private String qId; @ApiModelProperty("问题来源") + @QueryField(condition = SqlCondition.EQUAL) private String agent; @ApiModelProperty("问题") + @QueryField(condition = SqlCondition.LIKE) private String q; + @ApiModelProperty("问题提示") + @QueryField(condition = SqlCondition.LIKE) + @TableField("Q_HINT") + @JSONField(name = "qHint") + private String qHint; + @ApiModelProperty("答案") + @QueryField(condition = SqlCondition.LIKE) private String a; @ApiModelProperty("答案类型") + @QueryField(condition = SqlCondition.EQUAL) + @TableField("A_TYPE") + @JSONField(name = "aType") private String aType; @ApiModelProperty("用户结论,0为错误,1为正确") + @QueryField(condition = SqlCondition.EQUAL) + @TableField("USER_CONCLUSION") private int userConclusion; @ApiModelProperty("标注状态,0为未标注,1为已标注") + @QueryField(condition = SqlCondition.EQUAL) + @TableField("LABEL_STATUS") private int labelStatus; @ApiModelProperty("标注内容,json字符串,答案类型不一样格式不一样") + @QueryField(condition = SqlCondition.LIKE) + @TableField("LABEL_CONTENT") private String labelContent; + } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/AgentLogService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/AgentLogService.java index 40a2fce..35bc35a 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/AgentLogService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/AgentLogService.java @@ -2,10 +2,12 @@ package com.hnac.hzims.bigmodel.maintenance.service; import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.bigmodel.maintenance.entity.AgentLogEntity; +import com.hnac.hzims.bigmodel.maintenance.vo.IdsRequest; /** * @Author: ypj * @Date: 2024/9/9 11:08 */ public interface AgentLogService extends IService { + Boolean BatchLabel(IdsRequest ids); } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/AgentLogServiceImpl.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/AgentLogServiceImpl.java index 4d55558..85c3e40 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/AgentLogServiceImpl.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/AgentLogServiceImpl.java @@ -1,10 +1,12 @@ package com.hnac.hzims.bigmodel.maintenance.service.impl; import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.bigmodel.maintenance.entity.AgentLogEntity; import com.hnac.hzims.bigmodel.maintenance.mapper.AgentLogMapper; import com.hnac.hzims.bigmodel.maintenance.service.AgentLogService; +import com.hnac.hzims.bigmodel.maintenance.vo.IdsRequest; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -19,4 +21,11 @@ import org.springframework.stereotype.Service; @DS("hznlm") public class AgentLogServiceImpl extends ServiceImpl implements AgentLogService { + @Override + public Boolean BatchLabel(IdsRequest ids) { + return this.update(Wrappers.lambdaUpdate() + .set(AgentLogEntity::getLabelStatus, 1) + .in(AgentLogEntity::getId, ids.getIds())); + } + } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/vo/IdsRequest.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/vo/IdsRequest.java new file mode 100644 index 0000000..122aa7c --- /dev/null +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/vo/IdsRequest.java @@ -0,0 +1,15 @@ +package com.hnac.hzims.bigmodel.maintenance.vo; + +import lombok.Data; + +import java.util.List; + +/** + * @Author: ypj + * @Date: 2024/9/7 11:04 + */ +@Data +public class IdsRequest { + + private List ids; +} diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/vo/VectorSynchronizeRequest.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/vo/VectorSynchronizeRequest.java deleted file mode 100644 index c3b0a54..0000000 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/vo/VectorSynchronizeRequest.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.hnac.hzims.bigmodel.maintenance.vo; - -import lombok.Data; - -import java.util.List; - -/** - * @Author: ypj - * @Date: 2024/9/7 11:04 - */ -@Data -public class VectorSynchronizeRequest { - - private List ids; -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/RunMonthServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/RunMonthServiceImpl.java index 7cbe87a..9c89fc7 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/RunMonthServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/RunMonthServiceImpl.java @@ -875,23 +875,34 @@ public class RunMonthServiceImpl extends ServiceImpl analyseResultMap = new HashMap<>(); + if (StringUtil.isNotBlank(analyseResult)) { + analyseResultMap = JsonUtil.toMap(analyseResult); + } + String conclusion = entity.getConclusion(); Map conclusionMap = new HashMap<>(); if (StringUtil.isNotBlank(conclusion)) { conclusionMap = JsonUtil.toMap(conclusion); } + String evaluation = entity.getEvaluation(); Map evaluationMap = new HashMap<>(); if (StringUtil.isNotBlank(evaluation)) { evaluationMap = JsonUtil.toMap(evaluation); } + + // 更新 if (StringUtil.isNotBlank(req.getContent())) { conclusionMap.put(req.getType(), req.getContent()); + analyseResultMap.put(req.getType(), req.getContent()); } if (StringUtil.isNotBlank(req.getEvaluation())) { evaluationMap.put(req.getType(), req.getEvaluation()); } return this.update(Wrappers.lambdaUpdate() + .set(RunMonthEntity::getAnalyseResult, JsonUtil.toJson(analyseResultMap)) .set(RunMonthEntity::getConclusion, JsonUtil.toJson(conclusionMap)) .set(RunMonthEntity::getEvaluation, JsonUtil.toJson(evaluationMap)) .eq(RunMonthEntity::getId, req.getId()));