Files
his/src/main/java/com/openhis/web/outpatient/controller/CheckRequestController.java
2026-05-27 02:08:50 +08:00

39 lines
1.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.openhis.web.outpatient.controller;
import com.openhis.web.outpatient.service.CheckRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 检查申请接口
*
* 修复 Bug #550
* 1. 前端已改为手动控制勾选,后端需要确保一次只能提交同一检查项目的唯一记录。
* 2. 防止重复提交导致明细耦合,新增校验逻辑。
*/
@RestController
@RequestMapping("/outpatient/check-requests")
public class CheckRequestController {
@Autowired
private CheckRequestService checkRequestService;
@GetMapping
public List<Map<String, Object>> list() {
return checkRequestService.listPendingRequests();
}
@PostMapping("/submit")
public Map<String, Object> submit(@RequestBody List<Map<String, Object>> selected) {
try {
checkRequestService.validateAndSubmit(selected);
return Map.of("code", 200, "msg", "提交成功");
} catch (IllegalArgumentException e) {
return Map.of("code", 400, "msg", e.getMessage());
}
}
}