package com.jyxt.getdatabyrestful.controller; import com.jyxt.getdatabyrestful.service.LISService; 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 org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.*; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import java.util.List; import java.util.Map; @RestController @CrossOrigin(origins = "*") // 允许所有来源 @RequestMapping("/SampleProcess") // 基础路径 @Tag(name = "金源信通标本保存废弃相关接口", description = "") @ConditionalOnProperty( name = "interface.SampleProcess", havingValue = "1", matchIfMissing = false // 若配置不存在则禁用 ) public class LISController { @Autowired LISService lisService; // 示例:GET接口 @GetMapping("/test") @Operation(summary = "示例接口", description = "这是一个示例GET接口,点击右侧'try it out'测试接口能否正常调用") public String hello(@Parameter(description = "用户名", required = true) @RequestParam String name) { return "Hello, " + name; } @GetMapping("/getGroupConfig") @Operation(summary = "获取配置接口", description = "") public List> getGroupConfig(){ List> retValue = null; retValue = lisService.getGroupConfig(); return retValue; } @PostMapping("/getSaveSampleList") @Operation(summary = "获取待保存接口", description = "") public List> getSaveSampleList(@RequestBody @Schema( name = "获取待保存接口", description = "请求示例", example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"INSPECTION_ID\":\"\"" + ",\"PATIENT_NAME\":\"\",\"TEST_ORDER_NAME\":\"\"}]" ) List> inputList){ if (inputList == null || inputList.isEmpty()) { return null; } List> retValue = null; retValue = lisService.getSaveSampleList(inputList); return retValue; } @PostMapping("/getSavedSampleList") @Operation(summary = "获取已保存接口", description = "") public List> getSavedSampleList(@RequestBody @Schema( name = "获取已保存接口", description = "请求示例", example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"INSPECTION_ID\":\"\"" + ",\"PATIENT_NAME\":\"G032\",\"TEST_ORDER_NAME\":\"\"}]" ) List> inputList){ if (inputList == null || inputList.isEmpty()) { return null; } List> retValue = null; retValue = lisService.getSavedSampleList(inputList); return retValue; } @PostMapping("/getDestorySampleList") @Operation(summary = "获取待废弃接口", description = "") public List> getDestorySampleList(@RequestBody @Schema( name = "获取待废弃接口", description = "请求示例", example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"INSPECTION_ID\":\"\"" + ",\"PATIENT_NAME\":\"G032\",\"TEST_ORDER_NAME\":\"\"}]" ) List> inputList){ if (inputList == null || inputList.isEmpty()) { return null; } List> retValue = null; retValue = lisService.getDestorySampleList(inputList); return retValue; } @PostMapping("/SaveSample") @Operation(summary = "保存样本接口", description = "") public int SaveSample(@RequestBody @Schema( name = "保存样本接口", description = "请求示例", example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"OPERATIONNAME\":\"张三\"" + ",\"RemoveSampleList\":[\"12345\",\"54321\"]}]" ) List> inputList){ int retValue = 0; if (inputList == null || inputList.isEmpty()) { return retValue; } retValue = lisService.SaveSample(inputList); return retValue; } @PostMapping("/DestorySample") @Operation(summary = "弃置样本接口", description = "") public int DestorySample(@RequestBody @Schema( name = "弃置样本接口", description = "请求示例", example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"OPERATIONNAME\":\"张三\"" + ",\"RemoveSampleList\":[\"12345\",\"54321\"]}]" ) List> inputList){ int retValue = 0; if (inputList == null || inputList.isEmpty()) { return retValue; } retValue = lisService.DestorySample(inputList); return retValue; } }