| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- 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<Map<String, Object>> getGroupConfig(){
- List<Map<String, Object>> retValue = null;
- retValue = lisService.getGroupConfig();
- return retValue;
- }
- @PostMapping("/getSaveSampleList")
- @Operation(summary = "获取待保存接口", description = "")
- public List<Map<String, Object>> getSaveSampleList(@RequestBody
- @Schema(
- name = "获取待保存接口",
- description = "请求示例",
- example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"INSPECTION_ID\":\"\"" +
- ",\"PATIENT_NAME\":\"\",\"TEST_ORDER_NAME\":\"\"}]"
- )
- List<Map<String, Object>> inputList){
- if (inputList == null || inputList.isEmpty()) {
- return null;
- }
- List<Map<String, Object>> retValue = null;
- retValue = lisService.getSaveSampleList(inputList);
- return retValue;
- }
- @PostMapping("/getSavedSampleList")
- @Operation(summary = "获取已保存接口", description = "")
- public List<Map<String, Object>> getSavedSampleList(@RequestBody
- @Schema(
- name = "获取已保存接口",
- description = "请求示例",
- example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"INSPECTION_ID\":\"\"" +
- ",\"PATIENT_NAME\":\"G032\",\"TEST_ORDER_NAME\":\"\"}]"
- )
- List<Map<String, Object>> inputList){
- if (inputList == null || inputList.isEmpty()) {
- return null;
- }
- List<Map<String, Object>> retValue = null;
- retValue = lisService.getSavedSampleList(inputList);
- return retValue;
- }
- @PostMapping("/getDestorySampleList")
- @Operation(summary = "获取待废弃接口", description = "")
- public List<Map<String, Object>> getDestorySampleList(@RequestBody
- @Schema(
- name = "获取待废弃接口",
- description = "请求示例",
- example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"INSPECTION_ID\":\"\"" +
- ",\"PATIENT_NAME\":\"G032\",\"TEST_ORDER_NAME\":\"\"}]"
- )
- List<Map<String, Object>> inputList){
- if (inputList == null || inputList.isEmpty()) {
- return null;
- }
- List<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> inputList){
- int retValue = 0;
- if (inputList == null || inputList.isEmpty()) {
- return retValue;
- }
- retValue = lisService.DestorySample(inputList);
- return retValue;
- }
- }
|