LISController.java 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. package com.jyxt.getdatabyrestful.controller;
  2. import com.jyxt.getdatabyrestful.service.LISService;
  3. import io.swagger.v3.oas.annotations.Operation;
  4. import io.swagger.v3.oas.annotations.Parameter;
  5. import io.swagger.v3.oas.annotations.media.Schema;
  6. import io.swagger.v3.oas.annotations.tags.Tag;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
  9. import org.springframework.web.bind.annotation.*;
  10. import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
  11. import java.util.List;
  12. import java.util.Map;
  13. @RestController
  14. @CrossOrigin(origins = "*") // 允许所有来源
  15. @RequestMapping("/SampleProcess") // 基础路径
  16. @Tag(name = "金源信通标本保存废弃相关接口", description = "")
  17. @ConditionalOnProperty(
  18. name = "interface.SampleProcess",
  19. havingValue = "1",
  20. matchIfMissing = false // 若配置不存在则禁用
  21. )
  22. public class LISController {
  23. @Autowired
  24. LISService lisService;
  25. // 示例:GET接口
  26. @GetMapping("/test")
  27. @Operation(summary = "示例接口", description = "这是一个示例GET接口,点击右侧'try it out'测试接口能否正常调用")
  28. public String hello(@Parameter(description = "用户名", required = true)
  29. @RequestParam String name) {
  30. return "Hello, " + name;
  31. }
  32. @GetMapping("/getGroupConfig")
  33. @Operation(summary = "获取配置接口", description = "")
  34. public List<Map<String, Object>> getGroupConfig(){
  35. List<Map<String, Object>> retValue = null;
  36. retValue = lisService.getGroupConfig();
  37. return retValue;
  38. }
  39. @PostMapping("/getSaveSampleList")
  40. @Operation(summary = "获取待保存接口", description = "")
  41. public List<Map<String, Object>> getSaveSampleList(@RequestBody
  42. @Schema(
  43. name = "获取待保存接口",
  44. description = "请求示例",
  45. example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"INSPECTION_ID\":\"\"" +
  46. ",\"PATIENT_NAME\":\"\",\"TEST_ORDER_NAME\":\"\"}]"
  47. )
  48. List<Map<String, Object>> inputList){
  49. if (inputList == null || inputList.isEmpty()) {
  50. return null;
  51. }
  52. List<Map<String, Object>> retValue = null;
  53. retValue = lisService.getSaveSampleList(inputList);
  54. return retValue;
  55. }
  56. @PostMapping("/getSavedSampleList")
  57. @Operation(summary = "获取已保存接口", description = "")
  58. public List<Map<String, Object>> getSavedSampleList(@RequestBody
  59. @Schema(
  60. name = "获取已保存接口",
  61. description = "请求示例",
  62. example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"INSPECTION_ID\":\"\"" +
  63. ",\"PATIENT_NAME\":\"G032\",\"TEST_ORDER_NAME\":\"\"}]"
  64. )
  65. List<Map<String, Object>> inputList){
  66. if (inputList == null || inputList.isEmpty()) {
  67. return null;
  68. }
  69. List<Map<String, Object>> retValue = null;
  70. retValue = lisService.getSavedSampleList(inputList);
  71. return retValue;
  72. }
  73. @PostMapping("/getDestorySampleList")
  74. @Operation(summary = "获取待废弃接口", description = "")
  75. public List<Map<String, Object>> getDestorySampleList(@RequestBody
  76. @Schema(
  77. name = "获取待废弃接口",
  78. description = "请求示例",
  79. example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"INSPECTION_ID\":\"\"" +
  80. ",\"PATIENT_NAME\":\"G032\",\"TEST_ORDER_NAME\":\"\"}]"
  81. )
  82. List<Map<String, Object>> inputList){
  83. if (inputList == null || inputList.isEmpty()) {
  84. return null;
  85. }
  86. List<Map<String, Object>> retValue = null;
  87. retValue = lisService.getDestorySampleList(inputList);
  88. return retValue;
  89. }
  90. @PostMapping("/SaveSample")
  91. @Operation(summary = "保存样本接口", description = "")
  92. public int SaveSample(@RequestBody
  93. @Schema(
  94. name = "保存样本接口",
  95. description = "请求示例",
  96. example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"OPERATIONNAME\":\"张三\"" +
  97. ",\"RemoveSampleList\":[\"12345\",\"54321\"]}]"
  98. )
  99. List<Map<String, Object>> inputList){
  100. int retValue = 0;
  101. if (inputList == null || inputList.isEmpty()) {
  102. return retValue;
  103. }
  104. retValue = lisService.SaveSample(inputList);
  105. return retValue;
  106. }
  107. @PostMapping("/DestorySample")
  108. @Operation(summary = "弃置样本接口", description = "")
  109. public int DestorySample(@RequestBody
  110. @Schema(
  111. name = "弃置样本接口",
  112. description = "请求示例",
  113. example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"OPERATIONNAME\":\"张三\"" +
  114. ",\"RemoveSampleList\":[\"12345\",\"54321\"]}]"
  115. )
  116. List<Map<String, Object>> inputList){
  117. int retValue = 0;
  118. if (inputList == null || inputList.isEmpty()) {
  119. return retValue;
  120. }
  121. retValue = lisService.DestorySample(inputList);
  122. return retValue;
  123. }
  124. }