|
|
@@ -7,9 +7,13 @@ 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.http.HttpStatus;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -34,102 +38,172 @@ public class LISController {
|
|
|
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;
|
|
|
- }
|
|
|
+ @GetMapping("/GetGroupConfig")
|
|
|
+ @Operation(summary = "获取配置接口", description = "返回系统配置信息")
|
|
|
+ public ResponseEntity<Map<String, Object>> GetGroupConfig() {
|
|
|
+ Map<String, Object> response = new HashMap<>();
|
|
|
|
|
|
- @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;
|
|
|
+ try {
|
|
|
+ List<Map<String, Object>> configData = lisService.GetGroupConfig();
|
|
|
+
|
|
|
+ if (configData == null || configData.isEmpty()) {
|
|
|
+ response.put("state", 404);
|
|
|
+ response.put("message", "未找到配置信息");
|
|
|
+ return ResponseEntity.status(HttpStatus.NOT_FOUND).body(response);
|
|
|
+ }
|
|
|
+
|
|
|
+ response.put("state", 200);
|
|
|
+ response.put("message", "成功获取配置");
|
|
|
+ response.put("data", configData);
|
|
|
+ return ResponseEntity.ok(response);
|
|
|
+ } catch (Exception e) {
|
|
|
+ response.put("state", 500);
|
|
|
+ response.put("message", "服务器内部错误: " + e.getMessage());
|
|
|
+ return ResponseEntity.internalServerError().body(response);
|
|
|
}
|
|
|
- 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){
|
|
|
+ @PostMapping("/GetSampleList")
|
|
|
+ @Operation(summary = "获标本接口", description = "STATE:1 待保存 2 已保存 4 已废弃 多个STATE 1,2")
|
|
|
+ public ResponseEntity<Map<String, Object>> GetSampleList(
|
|
|
+ @RequestBody @Schema(name = "获标本接口", description = "请求示例",
|
|
|
+ example = "[{\"STATE\":\"1\",\"SAVE_DATE\":\"20250725\"}]")
|
|
|
+ List<Map<String, Object>> inputList) {
|
|
|
+
|
|
|
+ Map<String, Object> response = new HashMap<>();
|
|
|
+
|
|
|
if (inputList == null || inputList.isEmpty()) {
|
|
|
- return null;
|
|
|
+ response.put("state", 400);
|
|
|
+ response.put("message", "请求参数不能为空");
|
|
|
+ return ResponseEntity.badRequest().body(response);
|
|
|
}
|
|
|
- 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;
|
|
|
+ try {
|
|
|
+ List<Map<String, Object>> data = lisService.GetSampleList(inputList);
|
|
|
+ response.put("state", 200);
|
|
|
+ response.put("message", "成功");
|
|
|
+ response.put("data", data);
|
|
|
+ return ResponseEntity.ok(response);
|
|
|
+ } catch (Exception e) {
|
|
|
+ response.put("state", 500);
|
|
|
+ response.put("message", "服务器内部错误");
|
|
|
+ return ResponseEntity.internalServerError().body(response);
|
|
|
}
|
|
|
- List<Map<String, Object>> retValue = null;
|
|
|
- retValue = lisService.getDestorySampleList(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("/getDestoryedSampleList")
|
|
|
+// @Operation(summary = "获取已弃置接口", description = "")
|
|
|
+// public List<Map<String, Object>> getDestoryedSampleList(@RequestBody
|
|
|
+// @Schema(
|
|
|
+// name = "获取已弃置接口",
|
|
|
+// description = "请求示例",
|
|
|
+// exam ple = "[{\"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.getDestoryedSampleList(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;
|
|
|
+ @Operation(summary = "保存样本接口", description = "0成功,非0失败")
|
|
|
+ public ResponseEntity<Map<String, Object>> saveSample(
|
|
|
+ @RequestBody @Schema(name = "保存样本接口", description = "请求示例",
|
|
|
+ example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"OPERATIONNAME\":\"张三\"" +
|
|
|
+ ",\"RemoveSampleList\":[\"12345\",\"54321\"]}]"
|
|
|
+ )
|
|
|
+ List<Map<String, Object>> inputList) {
|
|
|
+
|
|
|
+ Map<String, Object> response = new HashMap<>();
|
|
|
+
|
|
|
if (inputList == null || inputList.isEmpty()) {
|
|
|
- return retValue;
|
|
|
+ response.put("state", 400);
|
|
|
+ response.put("message", "请求参数不能为空");
|
|
|
+ return ResponseEntity.badRequest().body(response);
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ int result = lisService.SaveSample(inputList);
|
|
|
+ response.put("state", result == 0 ? 200 : 500);
|
|
|
+ response.put("message", result == 0 ? "保存成功" : "保存失败");
|
|
|
+ response.put("data", result);
|
|
|
+ return ResponseEntity.ok(response);
|
|
|
+ } catch (Exception e) {
|
|
|
+ response.put("state", 500);
|
|
|
+ response.put("message", "服务器内部错误");
|
|
|
+ return ResponseEntity.internalServerError().body(response);
|
|
|
}
|
|
|
- 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;
|
|
|
+ @Operation(summary = "弃置样本接口", description = "0成功,非0失败")
|
|
|
+ public ResponseEntity<Map<String, Object>> DestorySample(@RequestBody
|
|
|
+ @Schema(
|
|
|
+ name = "弃置样本接口",
|
|
|
+ description = "请求示例",
|
|
|
+ example = "[{\"OPERATION_DATE\":\"20250725\",\"GROUPCODE\":\"G032\",\"OPERATIONNAME\":\"张三\"" +
|
|
|
+ ",\"RemoveSampleList\":[\"12345\",\"54321\"]}]"
|
|
|
+ )
|
|
|
+ List<Map<String, Object>> inputList){
|
|
|
+ Map<String, Object> response = new HashMap<>();
|
|
|
+
|
|
|
if (inputList == null || inputList.isEmpty()) {
|
|
|
- return retValue;
|
|
|
+ response.put("state", 400);
|
|
|
+ response.put("message", "请求参数不能为空");
|
|
|
+ return ResponseEntity.badRequest().body(response);
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ int result = lisService.DestorySample(inputList);
|
|
|
+ response.put("state", result == 0 ? 200 : 500);
|
|
|
+ response.put("message", result == 0 ? "保存成功" : "保存失败");
|
|
|
+ response.put("data", result);
|
|
|
+ return ResponseEntity.ok(response);
|
|
|
+ } catch (Exception e) {
|
|
|
+ response.put("state", 500);
|
|
|
+ response.put("message", "服务器内部错误");
|
|
|
+ return ResponseEntity.internalServerError().body(response);
|
|
|
}
|
|
|
- retValue = lisService.DestorySample(inputList);
|
|
|
- return retValue;
|
|
|
}
|
|
|
|
|
|
}
|