yang_shj
2 months ago
29 changed files with 1195 additions and 336 deletions
@ -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; |
||||
} |
||||
} |
@ -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)); |
||||
} |
||||
} |
@ -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)); |
||||
} |
||||
} |
@ -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)); |
||||
} |
||||
} |
@ -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; |
||||
} |
@ -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; |
||||
|
||||
} |
@ -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; |
||||
|
||||
} |
@ -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> { |
||||
} |
@ -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> { |
||||
} |
@ -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> { |
||||
} |
@ -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); |
||||
} |
@ -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); |
||||
} |
@ -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); |
||||
} |
@ -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); |
||||
} |
||||
|
||||
} |
@ -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); |
||||
} |
||||
} |
@ -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); |
||||
} |
||||
} |
@ -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; |
||||
} |
@ -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; |
||||
} |
@ -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; |
||||
} |
@ -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; |
||||
} |
Loading…
Reference in new issue