Browse Source

Merge remote-tracking branch 'origin/prod-5.1.3' into prod-5.1.3

zhongwei
yang_shj 2 months ago
parent
commit
c88ec91f5c
  1. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/entity/RunMonthEntity.java
  2. 32
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/constants/StoreStatus.java
  3. 83
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/AgentLogController.java
  4. 72
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/KnowledgeFileFragmentController.java
  5. 85
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/KnowledgeFileInfoController.java
  6. 7
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/VectorParamController.java
  7. 94
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/AgentLogEntity.java
  8. 46
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/KnowledgeFileFragment.java
  9. 68
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/KnowledgeFileInfo.java
  10. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/VectorParamEntity.java
  11. 11
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/mapper/AgentLogMapper.java
  12. 11
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/mapper/KnowledgeFileFragmentMapper.java
  13. 11
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/mapper/KnowledgeFileInfoMapper.java
  14. 19
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/AgentLogService.java
  15. 14
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/KnowledgeFileFragmentService.java
  16. 13
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/KnowledgeFileInfoService.java
  17. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/VectorParamService.java
  18. 74
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/AgentLogServiceImpl.java
  19. 34
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/KnowledgeFileFragmentServiceImpl.java
  20. 36
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/KnowledgeFileInfoServiceImpl.java
  21. 127
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java
  22. 16
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/vo/IdRequest.java
  23. 19
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/vo/IdsRequest.java
  24. 19
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/vo/LabelRequest.java
  25. 41
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/RunMonthController.java
  26. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/RunMonthService.java
  27. 492
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/RunMonthServiceImpl.java
  28. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/RunMonthEvaluateVO.java
  29. 4
      hzims-service/operational/src/main/resources/db/3.0.3.sql

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/report/entity/RunMonthEntity.java

@ -44,4 +44,10 @@ public class RunMonthEntity extends TenantEntity {
@ApiModelProperty("分析结果")
private String analyseResult;
@ApiModelProperty("评价")
private String evaluation;
@ApiModelProperty("重新判定的结论")
private String conclusion;
}

32
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/constants/StoreStatus.java

@ -0,0 +1,32 @@
package com.hnac.hzims.bigmodel.maintenance.constants;
import lombok.Getter;
/**
* @Author: ypj
* @Date: 2024/9/11 16:16
*/
@Getter
public enum StoreStatus {
NOT_STORE(0, "未入库"),
STORED(1, "已入库"),
STORING(2, "入库中");
private final int code;
private final String msg;
StoreStatus(int code, String msg) {
this.code = code;
this.msg = msg;
}
public static StoreStatus getInstance(int code) {
for (StoreStatus status : StoreStatus.values()) {
if (status.getCode() == code) {
return status;
}
}
return null;
}
}

83
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/AgentLogController.java

@ -0,0 +1,83 @@
package com.hnac.hzims.bigmodel.maintenance.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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 com.hnac.hzims.bigmodel.maintenance.vo.LabelRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.web.bind.annotation.*;
/**
* @Author: ypj
* @Date: 2024/9/9 10:37
*/
@RestController
@Slf4j
@AllArgsConstructor
@RequestMapping("/label")
@Api(value = "问题标注", tags = "问题标注")
public class AgentLogController {
private final AgentLogService agentLogService;
@GetMapping("/listPage")
@ApiOperation(value = "分页查询")
@ApiOperationSupport(order = 1)
public R<IPage<AgentLogEntity>> listPage(Query query, AgentLogEntity req) {
return R.data(agentLogService.listPage(Condition.getPage(query), req));
}
@GetMapping("/detail")
@ApiOperation(value = "查看详情")
@ApiOperationSupport(order = 2)
public R<AgentLogEntity> detail(@RequestParam @ApiParam("主键ID") Long id) {
return R.data(agentLogService.getById(id));
}
@PostMapping("/save")
@ApiOperation(value = "保存")
@ApiOperationSupport(order = 3)
public R save(@RequestBody AgentLogEntity req) {
return R.status(agentLogService.save(req));
}
@DeleteMapping("/remove")
@ApiOperation(value = "删除")
@ApiOperationSupport(order = 4)
public R remove(@RequestParam @ApiParam("主键ID,按逗号分隔") String ids) {
return R.status(agentLogService.removeByIds(Func.toLongList(",", ids)));
}
@PutMapping("/update")
@ApiOperation(value = "编辑")
@ApiOperationSupport(order = 5)
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));
}
@PutMapping("/label")
@ApiOperation(value = "标注")
@ApiOperationSupport(order = 7)
public R label(@RequestBody LabelRequest req) {
return R.status(agentLogService.label(req));
}
}

72
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/KnowledgeFileFragmentController.java

@ -0,0 +1,72 @@
package com.hnac.hzims.bigmodel.maintenance.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.bigmodel.maintenance.entity.KnowledgeFileFragment;
import com.hnac.hzims.bigmodel.maintenance.service.KnowledgeFileFragmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @Author: ypj
* @Date: 2024/9/11 11:56
*/
@RestController
@Slf4j
@RequestMapping("/knowledge/fragment")
@AllArgsConstructor
@Api(value = "知识库文件分片管理", tags = "知识库文件分片管理")
public class KnowledgeFileFragmentController {
private final KnowledgeFileFragmentService knowledgeFileFragmentService;
@GetMapping("/listPage")
@ApiOperation(value = "分页查询")
@ApiOperationSupport(order = 1)
public R<IPage<KnowledgeFileFragment>> listPage(Query query, KnowledgeFileFragment req) {
return R.data(knowledgeFileFragmentService.page(Condition.getPage(query), Condition.getQueryWrapper(new KnowledgeFileFragment(), req)));
}
@GetMapping("/detail")
@ApiOperation(value = "查看详情")
@ApiOperationSupport(order = 2)
public R<KnowledgeFileFragment> detail(@RequestParam @ApiParam("主键ID") Long id) {
return R.data(knowledgeFileFragmentService.getById(id));
}
@PostMapping("/save")
@ApiOperation(value = "保存")
@ApiOperationSupport(order = 3)
public R save(@RequestBody KnowledgeFileFragment req) {
return R.status(knowledgeFileFragmentService.save(req));
}
@PutMapping("/update")
@ApiOperation(value = "编辑")
@ApiOperationSupport(order = 4)
public R update(@RequestBody KnowledgeFileFragment req) {
return R.status(knowledgeFileFragmentService.updateById(req));
}
@DeleteMapping("/remove")
@ApiOperation(value = "删除")
@ApiOperationSupport(order = 5)
public R remove(@RequestParam @ApiParam("主键ID,按逗号分隔") String ids) {
return R.status(knowledgeFileFragmentService.removeByIds(Func.toLongList(",", ids)));
}
@GetMapping("/getByDocId")
@ApiOperation(value = "根据文档ID获取分片,不分页")
public R<List<KnowledgeFileFragment>> getByDocId(@RequestParam @ApiParam("主键ID") Long docId) {
return R.data(knowledgeFileFragmentService.getByDocId(docId));
}
}

85
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/KnowledgeFileInfoController.java

@ -0,0 +1,85 @@
package com.hnac.hzims.bigmodel.maintenance.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.bigmodel.maintenance.entity.KnowledgeFileInfo;
import com.hnac.hzims.bigmodel.maintenance.service.KnowledgeFileInfoService;
import com.hnac.hzims.bigmodel.maintenance.vo.IdRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.oss.model.BladeFile;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.resource.feign.IOssClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
/**
* @Author: ypj
* @Date: 2024/9/10 16:44
*/
@RestController
@Slf4j
@RequestMapping("/knowledge/file")
@Api(value = "知识库文件管理", tags = "知识库文件管理")
@AllArgsConstructor
public class KnowledgeFileInfoController {
private final KnowledgeFileInfoService knowledgeFileInfoService;
private final IOssClient ossClient;
@GetMapping("/listPage")
@ApiOperation(value = "分页查询")
@ApiOperationSupport(order = 1)
public R<IPage<KnowledgeFileInfo>> listPage(Query query, KnowledgeFileInfo req) {
return R.data(knowledgeFileInfoService.page(Condition.getPage(query),
Condition.getQueryWrapper(new KnowledgeFileInfo(), req).orderByDesc(KnowledgeFileInfo::getCreateTime)));
}
@GetMapping("/detail")
@ApiOperation(value = "查看详情")
@ApiOperationSupport(order = 2)
public R<KnowledgeFileInfo> detail(@RequestParam @ApiParam("主键ID") Long id) {
return R.data(knowledgeFileInfoService.getById(id));
}
@PostMapping("/save")
@ApiOperation(value = "保存")
@ApiOperationSupport(order = 3)
public R save(@RequestBody KnowledgeFileInfo req) {
return R.status(knowledgeFileInfoService.save(req));
}
@PutMapping("/update")
@ApiOperation(value = "编辑")
@ApiOperationSupport(order = 4)
public R update(@RequestBody KnowledgeFileInfo req) {
return R.status(knowledgeFileInfoService.updateById(req));
}
@DeleteMapping("/remove")
@ApiOperation(value = "删除")
@ApiOperationSupport(order = 5)
public R remove(@RequestParam @ApiParam("主键ID,按逗号分隔") String ids) {
return R.status(knowledgeFileInfoService.removeByIds(Func.toLongList(",", ids)));
}
@PostMapping(value = "/upload", produces = MediaType.APPLICATION_PROBLEM_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@ApiOperation(value = "上传文件")
@ApiOperationSupport(order = 6)
public R<BladeFile> upload(@ApiParam(value = "上传文件", required = true) @RequestPart("file") MultipartFile file) {
return ossClient.putFile(file);
}
@PostMapping("/store")
@ApiOperation(value = "入库")
@ApiOperationSupport(order = 7)
public R store(@RequestBody IdRequest req) {
return R.status(knowledgeFileInfoService.store(req));
}
}

7
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/VectorParamController.java

@ -5,6 +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.IdsRequest;
import com.hnac.hzinfo.api.annotation.ApiInterface;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -107,11 +108,11 @@ public class VectorParamController {
return R.data(vectorParamService.getUrlResponseKeyList(url, bladeToken, hzinfoToken));
}
@PutMapping("/synchronization")
@PutMapping("/synchronization/")
@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) throws JsonProcessingException {
return R.status(vectorParamService.synchronization(bladeToken, hzinfoToken));
@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));
}
}

94
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/AgentLogEntity.java

@ -0,0 +1,94 @@
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;
import java.util.Date;
/**
* @Author: ypj
* @Date: 2024/9/9 10:38
*/
@ApiModel("问题标注")
@TableName("gglm_agent_log")
@Data
public class AgentLogEntity extends TenantEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("对话id")
@TableField("chat_id")
@QueryField(condition = SqlCondition.EQUAL)
private String chatId;
@ApiModelProperty("问题id")
@TableField("q_id")
@QueryField(condition = SqlCondition.EQUAL)
@JSONField(name = "qId")
private String qId;
@ApiModelProperty("模型名称")
@QueryField(condition = SqlCondition.EQUAL)
@TableField("model_name")
private String modelName;
@ApiModelProperty("问题来源")
@QueryField(condition = SqlCondition.EQUAL)
private String agent;
@ApiModelProperty("问题")
@QueryField(condition = SqlCondition.LIKE)
private String q;
@ApiModelProperty("问题提示")
@QueryField(condition = SqlCondition.LIKE)
@TableField("prompt")
@JSONField(name = "prompt")
private String prompt;
@ApiModelProperty("系统提示")
@QueryField(condition = SqlCondition.LIKE)
@TableField("system")
private String system;
@ApiModelProperty("答案")
@QueryField(condition = SqlCondition.LIKE)
private String a;
@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("标注结果,0为错误,1为正确")
@QueryField(condition = SqlCondition.EQUAL)
@TableField("label_result")
private int labelResult;
@ApiModelProperty("标注内容,json字符串,答案类型不一样格式不一样")
@QueryField(condition = SqlCondition.LIKE)
@TableField("label_content")
private String labelContent;
@ApiModelProperty("标注人名称")
@QueryField(condition = SqlCondition.LIKE)
@TableField("label_operator")
private String labelOperator;
@ApiModelProperty("标注时间")
@QueryField(condition = SqlCondition.EQUAL)
@TableField("label_time")
private Date labelTime;
}

46
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/KnowledgeFileFragment.java

@ -0,0 +1,46 @@
package com.hnac.hzims.bigmodel.maintenance.entity;
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 lombok.EqualsAndHashCode;
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;
/**
* @Author: ypj
* @Date: 2024/9/11 9:58
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("knowledge_file_fragment")
@ApiModel(value = "知识库文件分片信息",description = "知识库文件分片信息")
public class KnowledgeFileFragment extends TenantEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("文档ID")
@TableField("DOC_ID")
@QueryField(condition = SqlCondition.EQUAL)
private Long docId;
@ApiModelProperty("文档问题")
@TableField("DOC_QS")
@QueryField(condition = SqlCondition.LIKE)
private String docQs;
@ApiModelProperty("文档内容")
@TableField("DOC_CONTENT")
@QueryField(condition = SqlCondition.LIKE)
private String docContent;
@ApiModelProperty("文档页码")
@TableField("DOC_PAGE_INDEX")
@QueryField(condition = SqlCondition.EQUAL)
private Integer docPageIndex;
}

68
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/KnowledgeFileInfo.java

@ -0,0 +1,68 @@
package com.hnac.hzims.bigmodel.maintenance.entity;
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 lombok.EqualsAndHashCode;
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;
/**
* @Author: ypj
* @Date: 2024/9/10 15:17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("knowledge_file_info")
@ApiModel(value = "知识库文件信息",description = "知识库文件信息")
public class KnowledgeFileInfo extends TenantEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("文件名称")
@QueryField(condition = SqlCondition.LIKE)
private String name;
@ApiModelProperty("文件url")
@QueryField(condition = SqlCondition.LIKE)
private String url;
@ApiModelProperty("文件大小")
@QueryField(condition = SqlCondition.EQUAL)
private Long size;
@ApiModelProperty("简介")
@QueryField(condition = SqlCondition.LIKE)
private String briefs;
@ApiModelProperty("标签")
@QueryField(condition = SqlCondition.LIKE)
private String tags;
@ApiModelProperty("业务领域")
@QueryField(condition = SqlCondition.EQUAL)
private String domain;
@ApiModelProperty("权限等级,5个等级")
@TableField("AUTHORITY_CLASS")
@QueryField(condition = SqlCondition.EQUAL)
private Integer authorityClass;
@ApiModelProperty("是否可见,0为不可见,1为可见")
@QueryField(condition = SqlCondition.EQUAL)
private Integer visible;
@ApiModelProperty("文件状态,0为未入库,1为已入库,2为入库中")
@TableField("FILE_STATUS")
@QueryField(condition = SqlCondition.EQUAL)
private Integer fileStatus;
@ApiModelProperty("备注")
@QueryField(condition = SqlCondition.LIKE)
private String remark;
}

2
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/VectorParamEntity.java

@ -16,7 +16,7 @@ import java.io.Serializable;
* @Date: 2024/9/2 14:54
*/
@ApiModel("向量参数配置")
@TableName("HZIMS_VECTOR_PARAM")
@TableName("gglm_vector_param")
@Data
public class VectorParamEntity extends TenantEntity implements Serializable {
private static final long serialVersionUID = 1L;

11
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/mapper/AgentLogMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.bigmodel.maintenance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.bigmodel.maintenance.entity.AgentLogEntity;
/**
* @Author: ypj
* @Date: 2024/9/9 11:07
*/
public interface AgentLogMapper extends BaseMapper<AgentLogEntity> {
}

11
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/mapper/KnowledgeFileFragmentMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.bigmodel.maintenance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.bigmodel.maintenance.entity.KnowledgeFileFragment;
/**
* @Author: ypj
* @Date: 2024/9/11 10:49
*/
public interface KnowledgeFileFragmentMapper extends BaseMapper<KnowledgeFileFragment> {
}

11
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/mapper/KnowledgeFileInfoMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.bigmodel.maintenance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.bigmodel.maintenance.entity.KnowledgeFileInfo;
/**
* @Author: ypj
* @Date: 2024/9/10 16:41
*/
public interface KnowledgeFileInfoMapper extends BaseMapper<KnowledgeFileInfo> {
}

19
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/AgentLogService.java

@ -0,0 +1,19 @@
package com.hnac.hzims.bigmodel.maintenance.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.bigmodel.maintenance.entity.AgentLogEntity;
import com.hnac.hzims.bigmodel.maintenance.vo.IdsRequest;
import com.hnac.hzims.bigmodel.maintenance.vo.LabelRequest;
/**
* @Author: ypj
* @Date: 2024/9/9 11:08
*/
public interface AgentLogService extends IService<AgentLogEntity> {
Boolean BatchLabel(IdsRequest ids);
Boolean label(LabelRequest req);
IPage<AgentLogEntity> listPage(IPage<AgentLogEntity> page, AgentLogEntity req);
}

14
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/KnowledgeFileFragmentService.java

@ -0,0 +1,14 @@
package com.hnac.hzims.bigmodel.maintenance.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.bigmodel.maintenance.entity.KnowledgeFileFragment;
import java.util.List;
/**
* @Author: ypj
* @Date: 2024/9/11 10:50
*/
public interface KnowledgeFileFragmentService extends IService<KnowledgeFileFragment> {
List<KnowledgeFileFragment> getByDocId(Long docId);
}

13
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/KnowledgeFileInfoService.java

@ -0,0 +1,13 @@
package com.hnac.hzims.bigmodel.maintenance.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.bigmodel.maintenance.entity.KnowledgeFileInfo;
import com.hnac.hzims.bigmodel.maintenance.vo.IdRequest;
/**
* @Author: ypj
* @Date: 2024/9/10 16:42
*/
public interface KnowledgeFileInfoService extends IService<KnowledgeFileInfo> {
Boolean store(IdRequest req);
}

2
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/VectorParamService.java

@ -18,5 +18,5 @@ public interface VectorParamService extends IService<VectorParamEntity> {
List<String> getUrlResponseKeyList(String url, String bladeToken, String hzinfoToken);
Boolean synchronization(String bladeToken, String hzinfoToken);
Boolean synchronization(List<Long> id ,String bladeToken, String hzinfoToken);
}

74
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/AgentLogServiceImpl.java

@ -0,0 +1,74 @@
package com.hnac.hzims.bigmodel.maintenance.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
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 com.hnac.hzims.bigmodel.maintenance.vo.LabelRequest;
import lombok.AllArgsConstructor;
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.StringUtil;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* @Author: ypj
* @Date: 2024/9/9 11:10
*/
@Service
@Slf4j
@AllArgsConstructor
@DS("hznlm")
public class AgentLogServiceImpl extends ServiceImpl<AgentLogMapper, AgentLogEntity> implements AgentLogService {
@Override
public Boolean BatchLabel(IdsRequest ids) {
Date now = new Date();
return this.update(Wrappers.<AgentLogEntity>lambdaUpdate()
.set(AgentLogEntity::getLabelStatus, 1)
.set(AgentLogEntity::getLabelResult, 1)
.set(AgentLogEntity::getLabelOperator, AuthUtil.getUserName())
.set(AgentLogEntity::getLabelTime, now)
.set(AgentLogEntity::getUpdateTime, now)
.in(AgentLogEntity::getId, ids.getIds()));
}
@Override
public Boolean label(LabelRequest req) {
AgentLogEntity entity = this.getById(req.getId());
if (entity != null) {
int labelResult = StringUtil.isBlank(req.getLabelContent()) || req.getLabelContent().equals(entity.getA()) ? 1 : 0;
Date now = new Date();
return this.update(Wrappers.<AgentLogEntity>lambdaUpdate()
.set(AgentLogEntity::getLabelStatus, 1)
.set(AgentLogEntity::getLabelResult, labelResult)
.set(StringUtil.isNotBlank(req.getLabelContent()), AgentLogEntity::getLabelContent, req.getLabelContent())
.set(AgentLogEntity::getLabelOperator, AuthUtil.getUserName())
.set(AgentLogEntity::getLabelTime, now)
.set(AgentLogEntity::getUpdateTime, now)
.eq(AgentLogEntity::getId, req.getId()));
}
return false;
}
@Override
public IPage<AgentLogEntity> listPage(IPage<AgentLogEntity> page, AgentLogEntity req) {
LambdaQueryWrapper<AgentLogEntity> queryWrapper = Wrappers.<AgentLogEntity>lambdaQuery()
.eq(ObjectUtil.isNotEmpty(req.getId()), AgentLogEntity::getId, req.getId())
.eq(ObjectUtil.isNotEmpty(req.getChatId()), AgentLogEntity::getChatId, req.getChatId())
.eq(ObjectUtil.isNotEmpty(req.getQId()), AgentLogEntity::getQId, req.getQId())
.eq(ObjectUtil.isNotEmpty(req.getModelName()), AgentLogEntity::getModelName, req.getModelName())
.orderByDesc(AgentLogEntity::getCreateTime)
.orderByAsc(AgentLogEntity::getChatId);
return this.page(page, queryWrapper);
}
}

34
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/KnowledgeFileFragmentServiceImpl.java

@ -0,0 +1,34 @@
package com.hnac.hzims.bigmodel.maintenance.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.bigmodel.maintenance.entity.KnowledgeFileFragment;
import com.hnac.hzims.bigmodel.maintenance.mapper.KnowledgeFileFragmentMapper;
import com.hnac.hzims.bigmodel.maintenance.service.KnowledgeFileFragmentService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author: ypj
* @Date: 2024/9/11 10:51
*/
@Service
@Slf4j
@AllArgsConstructor
@DS("hznlm")
public class KnowledgeFileFragmentServiceImpl extends ServiceImpl<KnowledgeFileFragmentMapper, KnowledgeFileFragment> implements KnowledgeFileFragmentService {
private KnowledgeFileFragmentMapper knowledgeFileFragmentMapper;
@Override
public List<KnowledgeFileFragment> getByDocId(Long docId) {
LambdaQueryWrapper<KnowledgeFileFragment> queryWrapper = Wrappers.<KnowledgeFileFragment>lambdaQuery()
.eq(KnowledgeFileFragment::getDocId, docId)
.orderByAsc(KnowledgeFileFragment::getDocPageIndex);
return knowledgeFileFragmentMapper.selectList(queryWrapper);
}
}

36
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/KnowledgeFileInfoServiceImpl.java

@ -0,0 +1,36 @@
package com.hnac.hzims.bigmodel.maintenance.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.bigmodel.maintenance.constants.StoreStatus;
import com.hnac.hzims.bigmodel.maintenance.entity.KnowledgeFileInfo;
import com.hnac.hzims.bigmodel.maintenance.mapper.KnowledgeFileInfoMapper;
import com.hnac.hzims.bigmodel.maintenance.service.KnowledgeFileInfoService;
import com.hnac.hzims.bigmodel.maintenance.vo.IdRequest;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @Author: ypj
* @Date: 2024/9/10 16:43
*/
@Service
@Slf4j
@AllArgsConstructor
@DS("hznlm")
public class KnowledgeFileInfoServiceImpl extends ServiceImpl<KnowledgeFileInfoMapper, KnowledgeFileInfo> implements KnowledgeFileInfoService {
private final KnowledgeFileInfoMapper knowledgeFileInfoMapper;
@Override
public Boolean store(IdRequest req) {
KnowledgeFileInfo knowledgeFileInfo = knowledgeFileInfoMapper.selectById(req.getId());
LambdaUpdateWrapper<KnowledgeFileInfo> queryWrapper = Wrappers.<KnowledgeFileInfo>lambdaUpdate()
.set(KnowledgeFileInfo::getFileStatus, StoreStatus.STORING.getCode())
.eq(KnowledgeFileInfo::getId, req.getId());
return this.update(queryWrapper);
}
}

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

@ -5,6 +5,8 @@ import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
@ -16,7 +18,6 @@ import com.hnac.hzims.bigmodel.maintenance.service.VectorParamService;
import com.hnac.hzims.bigmodel.maintenance.vo.VectorUrlResponse;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
@ -30,6 +31,7 @@ import java.util.*;
@Service
@Slf4j
@AllArgsConstructor
@DS("hznlm")
public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, VectorParamEntity> implements VectorParamService {
private static final String CLIENT_SIGN = "vector_param";
@ -49,59 +51,58 @@ public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, Vecto
.header("Hzinfo-Auth", hzinfoToken).execute();
if (response.getStatus() == HttpServletResponse.SC_OK) {
String body = response.body();
log.info("getUrlResponse:" + body);
JSONObject jsonObject = JSON.parseObject(body);
VectorUrlResponse result = new VectorUrlResponse();
result.setOriginalData(JSONArray.parseArray(jsonObject.getString("data")).toJavaList(JSONObject.class));
// try {
// ObjectMapper mapper = new ObjectMapper();
// JsonNode rootNode = mapper.readTree(body);
// if (rootNode.isArray()) {
// return getUrlResponseByArray(rootNode);
// }
// JsonNode dataNode = rootNode.findValue("data");
// if (dataNode != null && dataNode.isArray()) {
// return getUrlResponseByArray(dataNode);
// }
// if (dataNode != null) {
// return getUrlResponseByObject(dataNode);
// }
// if (rootNode != null) {
// return getUrlResponseByObject(rootNode);
// }
// } catch (JsonProcessingException e) {
// log.error("getUrlResponse error", e);
// }
log.info("vector url response url:{}, response:{}", url, body);
try {
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(body);
if (rootNode.isArray()) {
return getUrlResponseByArray(rootNode);
}
JsonNode dataNode = rootNode.findValue("data");
if (dataNode != null && dataNode.isArray()) {
return getUrlResponseByArray(dataNode);
}
if (dataNode != null) {
return getUrlResponseByObject(dataNode);
}
if (rootNode != null) {
return getUrlResponseByObject(rootNode);
}
} catch (JsonProcessingException e) {
log.error("getUrlResponse error", e);
}
}
return null;
}
// private VectorUrlResponse getUrlResponseByArray(JsonNode rootNode) throws JsonProcessingException {
// VectorUrlResponse result = new VectorUrlResponse();
// result.setOriginalData(rootNode);
// JsonNode item = rootNode.get(0);
// if (item != null) {
// List<String> keyList = new ArrayList<>();
// Iterator<String> iterator = item.fieldNames();
// while (iterator.hasNext()) {
// keyList.add(iterator.next());
// }
// result.setKeyList(keyList);
// }
// return result;
// }
private VectorUrlResponse getUrlResponseByArray(JsonNode rootNode) throws JsonProcessingException {
VectorUrlResponse result = new VectorUrlResponse();
result.setOriginalData(JSONArray.parseArray(rootNode.toPrettyString()).toJavaList(JSONObject.class));
JsonNode item = rootNode.get(0);
if (item != null) {
List<String> keyList = new ArrayList<>();
Iterator<String> iterator = item.fieldNames();
while (iterator.hasNext()) {
keyList.add(iterator.next());
}
result.setKeyList(keyList);
}
return result;
}
// private VectorUrlResponse getUrlResponseByObject(JsonNode rootNode) throws JsonProcessingException {
// VectorUrlResponse result = new VectorUrlResponse();
// result.setOriginalData(rootNode);
// List<String> keyList = new ArrayList<>();
// Iterator<String> iterator = rootNode.fieldNames();
// while (iterator.hasNext()) {
// keyList.add(iterator.next());
// }
// result.setKeyList(keyList);
// return result;
// }
private VectorUrlResponse getUrlResponseByObject(JsonNode rootNode) throws JsonProcessingException {
VectorUrlResponse result = new VectorUrlResponse();
List<JSONObject> originalData = new ArrayList<>();
originalData.add(JSON.parseObject(rootNode.toPrettyString()));
result.setOriginalData(originalData);
List<String> keyList = new ArrayList<>();
Iterator<String> iterator = rootNode.fieldNames();
while (iterator.hasNext()) {
keyList.add(iterator.next());
}
result.setKeyList(keyList);
return result;
}
@Override
public List<String> getUrlResponseKeyList(String url, String bladeToken, String hzinfoToken) {
@ -110,12 +111,15 @@ public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, Vecto
}
@Override
public Boolean synchronization(String bladeToken, String hzinfoToken) {
List<VectorParamEntity> list = this.list();
if (CollectionUtil.isEmpty(list)) {
public Boolean synchronization(List<Long> ids, String bladeToken, String hzinfoToken) {
if (null == ids && ids.isEmpty()) {
return false;
}
for (Long id : ids) {
VectorParamEntity entity = getById(id);
if (null == entity) {
return false;
}
for (VectorParamEntity entity : list) {
VectorUrlResponse response = getUrlResponse(entity.getUrl(), bladeToken, hzinfoToken);
if (response != null) {
ObjectMapper mapper = new ObjectMapper();
@ -123,7 +127,7 @@ public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, Vecto
try {
rootNode = mapper.readTree(entity.getAttributeMap());
} catch (JsonProcessingException e) {
e.printStackTrace();
log.error("getUrlResponseKeyList error", e);
}
Map<String, String> attrMap = new HashMap<>();
Iterator<String> iterator = rootNode.fieldNames();
@ -131,24 +135,11 @@ public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, Vecto
String key = iterator.next();
attrMap.put(key, rootNode.findValue(key).textValue());
}
List<Object> dataList = new ArrayList();
JsonNode dataObject = (JsonNode) response.getOriginalData();
if (dataObject.isArray()) {
Iterator<JsonNode> dataIterator = dataObject.iterator();
while (dataIterator.hasNext()) {
dataList.add(toJsonObject(dataIterator.next()));
}
} else {
dataList.add(toJsonObject(dataObject));
}
weaviateService.saveBatch(response.getOriginalData(), entity.getTableName(), attrMap);
this.update(Wrappers.<VectorParamEntity>lambdaUpdate().eq(VectorParamEntity::getId, id).set(VectorParamEntity::getUpdateTime, new Date()));
}
}
return true;
}
private JSONObject toJsonObject(JsonNode node) {
JSONObject jsonObject = JSON.parseObject(node.toString());
return jsonObject;
}
}

16
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/vo/IdRequest.java

@ -0,0 +1,16 @@
package com.hnac.hzims.bigmodel.maintenance.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: ypj
* @Date: 2024/9/11 14:16
*/
@Data
@ApiModel("单id操作请求")
public class IdRequest {
@ApiModelProperty("主键ID")
private Long id;
}

19
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/vo/IdsRequest.java

@ -0,0 +1,19 @@
package com.hnac.hzims.bigmodel.maintenance.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @Author: ypj
* @Date: 2024/9/7 11:04
*/
@Data
@ApiModel("批量操作请求")
public class IdsRequest {
@ApiModelProperty("主键ID,按逗号分隔")
private List<Long> ids;
}

19
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/vo/LabelRequest.java

@ -0,0 +1,19 @@
package com.hnac.hzims.bigmodel.maintenance.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: ypj
* @Date: 2024/9/10 14:04
*/
@Data
@ApiModel("标注")
public class LabelRequest {
@ApiModelProperty("主键ID")
private Long id;
@ApiModelProperty("标注内容,json字符串,答案类型不一样格式不一样")
private String labelContent;
}

41
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/RunMonthController.java

@ -3,21 +3,19 @@ package com.hnac.hzims.operational.report.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.operational.report.entity.RunMonthEntity;
import com.hnac.hzims.operational.report.service.RunMonthService;
import com.hnac.hzims.operational.report.vo.RunMonthEvaluateVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* @author ysj
*/
@RestController
@Api(value = "运行月报",tags = "生产月报")
@Api(value = "运行月报", tags = "生产月报")
@AllArgsConstructor
@RequestMapping("/run/month")
public class RunMonthController {
@ -26,41 +24,48 @@ public class RunMonthController {
@GetMapping("/generate")
@ApiOperation(value = "生成站点月报",notes = "生成站点月报")
@ApiOperation(value = "生成站点月报", notes = "生成站点月报")
@ApiOperationSupport(order = 1)
public R<Boolean> generate(@RequestParam("mon") String mon,
@RequestParam("stationCode") String stationCode){
return R.data(runMonthService.generate(mon,stationCode));
@RequestParam("stationCode") String stationCode) {
return R.data(runMonthService.generate(mon, stationCode));
}
@GetMapping("/check")
@ApiOperation(value = "查询站点月报数据",notes = "查询站点月报数据")
@ApiOperation(value = "查询站点月报数据", notes = "查询站点月报数据")
@ApiOperationSupport(order = 2)
public R<Boolean> check(@RequestParam("stationCode") String stationCode){
public R<Boolean> check(@RequestParam("stationCode") String stationCode) {
return R.data(runMonthService.check(stationCode));
}
@GetMapping("/data")
@ApiOperation(value = "查询站点月报数据",notes = "查询站点月报数据")
@ApiOperation(value = "查询站点月报数据", notes = "查询站点月报数据")
@ApiOperationSupport(order = 3)
public R<RunMonthEntity> data(@RequestParam("mon") String mon,
@RequestParam("stationCode") String stationCode){
return R.data(runMonthService.data(mon,stationCode));
@RequestParam("stationCode") String stationCode) {
return R.data(runMonthService.data(mon, stationCode));
}
@GetMapping("/export")
@ApiOperation(value = "导出站点运行月报",notes = "导出站点运行月报")
@ApiOperation(value = "导出站点运行月报", notes = "导出站点运行月报")
@ApiOperationSupport(order = 4)
public void export(@RequestParam("mon") String mon,
@RequestParam("stationCode") String stationCode){
runMonthService.export(mon,stationCode);
@RequestParam("stationCode") String stationCode) {
runMonthService.export(mon, stationCode);
}
@GetMapping("/generateAnalyseResult")
@ApiOperation(value = "生成分析结果",notes = "生成分析结果")
@ApiOperation(value = "生成分析结果", notes = "生成分析结果")
@ApiOperationSupport(order = 5)
public R generateAnalyseResult(@RequestParam @ApiParam("查询月份") String month, @RequestParam @ApiParam("站点编号") String stationCode) {
runMonthService.generateAnalyseResult(month,stationCode);
runMonthService.generateAnalyseResult(month, stationCode);
return R.success("调用成功!");
}
@PutMapping("/evaluate")
@ApiOperation(value = "站点月报评价", notes = "站点月报评价")
@ApiOperationSupport(order = 6)
public R evaluate(@RequestBody RunMonthEvaluateVO req) {
return R.data(runMonthService.evaluate(req));
}
}

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/RunMonthService.java

@ -2,6 +2,7 @@ package com.hnac.hzims.operational.report.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.operational.report.entity.RunMonthEntity;
import com.hnac.hzims.operational.report.vo.RunMonthEvaluateVO;
/**
@ -19,9 +20,12 @@ public interface RunMonthService extends IService<RunMonthEntity> {
/**
* 生成分析结果
*
* @param month 月份
* @param stationCode 站点编号
* @return 大模型调用结果
*/
Boolean generateAnalyseResult(String month,String stationCode);
Boolean generateAnalyseResult(String month, String stationCode);
Boolean evaluate(RunMonthEvaluateVO req);
}

492
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/RunMonthServiceImpl.java

File diff suppressed because it is too large Load Diff

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/vo/RunMonthEvaluateVO.java

@ -0,0 +1,15 @@
package com.hnac.hzims.operational.report.vo;
import lombok.Data;
/**
* @Author: ypj
* @Date: 2024/9/6 14:50
*/
@Data
public class RunMonthEvaluateVO {
private String content;
private Long id;
private String evaluation;
private String type;
}

4
hzims-service/operational/src/main/resources/db/3.0.3.sql

@ -0,0 +1,4 @@
--
ALTER TABLE `hzims_run_month_report`
ADD COLUMN `CONCLUSION` text NULL COMMENT '重新判定的结论' ;
ALTER TABLE `hzims_run_month_report` ADD COLUMN `EVALUATION` text NULL COMMENT '评价';
Loading…
Cancel
Save