|
@@ -61,57 +61,8 @@ public class SpecimenOutboundController {
|
|
|
return success(true);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-// @PostMapping("/approveFirst")
|
|
|
-// @Operation(summary = "一审通过")
|
|
|
-// @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:approveFirst')")
|
|
|
-// public CommonResult<Void> approveFirstSpecimenOutbound(@RequestBody SpecimenOutboundApprovalReqVO req) {
|
|
|
-// req.setApproveUsers(getLoginUserId()); // 获取操作员ID
|
|
|
-//
|
|
|
-// req.setApprovalTime(LocalDateTime.now()); // 设置当前时间
|
|
|
-// req.setStatus(1); // 设置审批状态为一审通过
|
|
|
-// specimenOutboundService.updateStatus(req);
|
|
|
-// return success(null);
|
|
|
-// }
|
|
|
-// @PostMapping("/approveSecond")
|
|
|
-// @Operation(summary = "二审通过")
|
|
|
-// @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:approveSecond')")
|
|
|
-// public CommonResult<Void> approveSecondSpecimenOutbound(@RequestBody SpecimenOutboundApprovalReqVO req) {
|
|
|
-// req.setTwoApproveUsers(getLoginUserId()); // 获取二审操作员ID
|
|
|
-// req.setTwoApprovalTime(LocalDateTime.now()); // 设置当前时间
|
|
|
-// req.setStatus(5); // 设置审批状态为二审通过
|
|
|
-// specimenOutboundService.updateStatus(req);
|
|
|
-// return success(null);
|
|
|
-// }
|
|
|
-
|
|
|
-// @PostMapping("/approve")
|
|
|
-// @Operation(summary = "审批")
|
|
|
-// @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:approve')")
|
|
|
-// public CommonResult<Void> approveSpecimenOutbound(@RequestBody SpecimenOutboundApprovalReqVO req) {
|
|
|
-// // 获取当前操作员ID
|
|
|
-// Long operatorId = getLoginUserId();
|
|
|
-// LocalDateTime now = LocalDateTime.now();
|
|
|
-//
|
|
|
-// // 验证审批类型
|
|
|
-// if (req.getStatus() == 1 || req.getStatus() == 2) {
|
|
|
-// // 一审逻辑
|
|
|
-// req.setApproveUsers(operatorId);
|
|
|
-// req.setApprovalTime(now);
|
|
|
-// } else if (req.getStatus() == 5 || req.getStatus() == 6) {
|
|
|
-// // 二审逻辑
|
|
|
-// req.setTwoApproveUsers(operatorId);
|
|
|
-// req.setTwoApprovalTime(now);
|
|
|
-// } else {
|
|
|
-// throw new IllegalArgumentException("无效的审批状态");
|
|
|
-// }
|
|
|
-//
|
|
|
-// // 调用更新状态方法
|
|
|
-// specimenOutboundService.updateStatus(req);
|
|
|
-// return success(null);
|
|
|
-// }
|
|
|
-
|
|
|
@PostMapping("/approve")
|
|
|
- @Operation(summary = "审批")
|
|
|
+ @Operation(summary = "标本出库审批")
|
|
|
@PreAuthorize("@ss.hasPermission('museums:specimen-outbound:approve')")
|
|
|
public CommonResult<Void> approveSpecimenOutbound(@RequestBody SpecimenOutboundApprovalReqVO req) {
|
|
|
Long operatorId = getLoginUserId();
|
|
@@ -120,16 +71,16 @@ public class SpecimenOutboundController {
|
|
|
// 验证审批类型
|
|
|
if (req.getStatus() == 1 || req.getStatus() == 2) {
|
|
|
// 一审逻辑
|
|
|
- if (!permissionApi.hasAnyRoles(operatorId, "deputy_leader")) {
|
|
|
- throw new IllegalArgumentException("用户没有一审权限");
|
|
|
- }
|
|
|
+// if (!permissionApi.hasAnyRoles(operatorId, "deputy_leader")) {
|
|
|
+// throw new IllegalArgumentException("用户没有一审权限");
|
|
|
+// }
|
|
|
req.setApproveUsers(operatorId);
|
|
|
req.setApprovalTime(now);
|
|
|
} else if (req.getStatus() == 5 || req.getStatus() == 6) {
|
|
|
// 二审逻辑
|
|
|
- if (!permissionApi.hasAnyRoles(operatorId, "leadership")) {
|
|
|
- throw new IllegalArgumentException("用户没有二审权限");
|
|
|
- }
|
|
|
+// if (!permissionApi.hasAnyRoles(operatorId, "leadership")) {
|
|
|
+// throw new IllegalArgumentException("用户没有二审权限");
|
|
|
+// }
|
|
|
req.setTwoApproveUsers(operatorId);
|
|
|
req.setTwoApprovalTime(now);
|
|
|
} else {
|
|
@@ -140,35 +91,27 @@ public class SpecimenOutboundController {
|
|
|
return success(null);
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/rejectFirst")
|
|
|
- @Operation(summary = "一审驳回")
|
|
|
- @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:rejectFirst')")
|
|
|
- public CommonResult<Void> rejectFirstSpecimenOutbound(@Valid @RequestBody SpecimenOutboundApprovalReqVO req) {
|
|
|
- req.setApproveUsers(getLoginUserId()); // 获取操作员ID
|
|
|
- req.setApprovalTime(LocalDateTime.now()); // 设置当前时间
|
|
|
- req.setStatus(2); // 设置审批状态为一审驳回
|
|
|
- specimenOutboundService.updateStatus(req);
|
|
|
- return success(null);
|
|
|
+ @PutMapping("/recompile")
|
|
|
+ @Operation(summary = "修改标本出库信息")
|
|
|
+ @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:update')")
|
|
|
+ public CommonResult<Boolean> recompileSpecimenOutbound(@Valid @RequestBody SpecimenOutboundSaveReqVO updateReqVO) {
|
|
|
+ // 校验状态
|
|
|
+ if (updateReqVO.getStatus() == 0 || updateReqVO.getStatus() == 2 || updateReqVO.getStatus() == 6) {
|
|
|
+ // 根据状态更新
|
|
|
+ if (updateReqVO.getStatus() == 2) {
|
|
|
+ updateReqVO.setStatus(0); // 编辑后将状态变为0
|
|
|
+ } else if (updateReqVO.getStatus() == 6) {
|
|
|
+ updateReqVO.setStatus(1); // 编辑后将状态变为1
|
|
|
+ }
|
|
|
+ // 调用服务层更新方法
|
|
|
+ specimenOutboundService.recompileSpecimenOutbound(updateReqVO);
|
|
|
+ return success(true);
|
|
|
+ } else {
|
|
|
+ throw new IllegalArgumentException("无效的审批状态,无法编辑");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/rejectSecond")
|
|
|
- @Operation(summary = "二审驳回")
|
|
|
- @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:rejectSecond')")
|
|
|
- public CommonResult<Void> rejectSecondSpecimenOutbound(@Valid @RequestBody SpecimenOutboundApprovalReqVO req) {
|
|
|
- req.setTwoApproveUsers(getLoginUserId()); // 获取二审操作员ID
|
|
|
- req.setTwoApprovalTime(LocalDateTime.now()); // 设置当前时间
|
|
|
- req.setStatus(6); // 设置审批状态为二审驳回
|
|
|
- specimenOutboundService.updateStatus(req);
|
|
|
- return success(null);
|
|
|
- }
|
|
|
|
|
|
-// @GetMapping("/confirmOutbound")
|
|
|
-// @Operation(summary = "确认标本出库")
|
|
|
-// @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:confirm')")
|
|
|
-// public CommonResult<Boolean> confirmOutbound(@RequestParam("id") Long id) {
|
|
|
-// specimenOutboundService.confirmOutbound(id, getLoginUserId());
|
|
|
-// return success(true);
|
|
|
-// }
|
|
|
@PostMapping("/confirmOutbound")
|
|
|
@Operation(summary = "确认标本出库")
|
|
|
@PreAuthorize("@ss.hasPermission('museums:specimen-outbound:confirm')")
|
|
@@ -237,15 +180,6 @@ public class SpecimenOutboundController {
|
|
|
|
|
|
//工作台
|
|
|
//根据出库的登记情况统计本年标本出库信息。
|
|
|
-// @GetMapping("/statistics/outgoing/{year}")
|
|
|
-// @Operation(summary = "根据出库登记情况统计本年标本出库信息")
|
|
|
-// @Parameter(name = "year", description = "年份", required = true, example = "2024")
|
|
|
-// @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:query')")
|
|
|
-// public CommonResult<List<SpecimenOutboundOutgoingReqVO>> getOutboundStatistics(@PathVariable int year) {
|
|
|
-// List<SpecimenOutboundOutgoingReqVO> outboundStatistics = specimenOutboundService.getOutboundStatistics(year);
|
|
|
-// return success(outboundStatistics);
|
|
|
-// }
|
|
|
-
|
|
|
@GetMapping("/statistics/outgoing/{year}")
|
|
|
@Operation(summary = "根据出库登记情况统计本年标本出库信息")
|
|
|
@Parameter(name = "year", description = "年份", required = true, example = "2024")
|
|
@@ -269,14 +203,6 @@ public class SpecimenOutboundController {
|
|
|
return success(response);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-// @GetMapping("/statistics/return/{year}")
|
|
|
-// @Operation(summary = "统计本年标本回库信息")
|
|
|
-// @Parameter(name = "year", description = "年份", required = true, example = "2024")
|
|
|
-// public CommonResult<List<SpecimenOutboundReturnReqVO>> getReturnStatistics(@PathVariable int year) {
|
|
|
-// List<SpecimenOutboundReturnReqVO> result = specimenOutboundService.getReturnStatistics(year);
|
|
|
-// return success(result);
|
|
|
-// }
|
|
|
@GetMapping("/statistics/return/{year}")
|
|
|
@Operation(summary = "根据回库登记情况统计本年标本回库信息")
|
|
|
@Parameter(name = "year", description = "年份", required = true, example = "2024")
|