评估申请调研大模型解析申请信息
This commit is contained in:
@@ -4,7 +4,11 @@ import com.rj.entity.LbAssessmentApply;
|
||||
import com.rj.service.ILbAssessmentApplyService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -19,6 +23,30 @@ public class LbAssessmentApplyController {
|
||||
@Autowired
|
||||
private ILbAssessmentApplyService lbAssessmentApplyService;
|
||||
|
||||
@Data
|
||||
@Schema(description = "大模型解析申请评估信息请求体")
|
||||
public static class ParseAssessmentTextRequest {
|
||||
@Schema(description = "申请评估原文", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotBlank(message = "申请评估文本不能为空")
|
||||
private String assessmentText;
|
||||
|
||||
@Schema(description = "当前登录人租户ID")
|
||||
private String tenantId;
|
||||
}
|
||||
|
||||
@PostMapping("/parseAssessmentApplyFromText")
|
||||
@Operation(summary = "大模型解析申请评估文本为实体", description = "根据自然语言申请评估信息调用大模型抽取字段,返回 LbAssessmentApply(不落库)")
|
||||
public ResponseEntity<Map<String, Object>> parseAssessmentApplyFromText(
|
||||
@Parameter(description = "申请评估文本与租户ID", required = true) @Valid @RequestBody ParseAssessmentTextRequest body) {
|
||||
Map<String, Object> result = lbAssessmentApplyService.parseFromAssessmentTextByLlm(
|
||||
body.getAssessmentText(), body.getTenantId());
|
||||
Boolean success = (Boolean) result.get("success");
|
||||
if (success != null && success) {
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "新增")
|
||||
public ResponseEntity<Map<String, Object>> add(
|
||||
@@ -64,9 +92,13 @@ public class LbAssessmentApplyController {
|
||||
@RequestParam(required = false) String applicantName,
|
||||
@RequestParam(required = false) String applicantPhone,
|
||||
@RequestParam(required = false) String colleagueName,
|
||||
@RequestParam(required = false) String teamLeaderName) {
|
||||
@RequestParam(required = false) String teamLeaderName,
|
||||
@RequestParam(required = false) String assessmentTeacherName,
|
||||
@RequestParam(required = false) String moderatorName,
|
||||
@RequestParam(required = false) String meetingNumber) {
|
||||
Map<String, Object> result = lbAssessmentApplyService.pageQuery(
|
||||
current, size, tenantId, applicantName, applicantPhone, colleagueName, teamLeaderName
|
||||
current, size, tenantId, applicantName, applicantPhone, colleagueName, teamLeaderName,
|
||||
assessmentTeacherName, moderatorName, meetingNumber
|
||||
);
|
||||
Boolean success = (Boolean) result.get("success");
|
||||
if (success != null && success) {
|
||||
|
||||
Reference in New Issue
Block a user