Эх сурвалжийг харах

工作台、标本库管理、标本出/回库管理,补充

hyy 8 сар өмнө
parent
commit
d9315516f4

+ 4 - 93
yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimenoutbound/SpecimenOutboundController.java

@@ -168,108 +168,19 @@ public class SpecimenOutboundController {
     @Operation(summary = "根据出库登记情况统计本年标本出库信息")
     @Parameter(name = "year", description = "年份", required = true, example = "2024")
     @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:query')")
-    public CommonResult<List<SpecimenOutboundDO>> getOutboundStatistics(@PathVariable int year) {
-        List<SpecimenOutboundDO> outboundStatistics = specimenOutboundService.getOutboundStatistics(year);
+    public CommonResult<List<SpecimenOutboundOutgoingReqVO>> getOutboundStatistics(@PathVariable int year) {
+        List<SpecimenOutboundOutgoingReqVO> outboundStatistics = specimenOutboundService.getOutboundStatistics(year);
         return success(outboundStatistics);
     }
 
     @GetMapping("/statistics/return/{year}")
     @Operation(summary = "统计本年标本回库信息")
     @Parameter(name = "year", description = "年份", required = true, example = "2024")
-    public CommonResult<List<SpecimenOutboundDO>> getReturnStatistics(@PathVariable int year) {
-        List<SpecimenOutboundDO> result = specimenOutboundService.getReturnStatistics(year);
+    public CommonResult<List<SpecimenOutboundReturnReqVO>> getReturnStatistics(@PathVariable int year) {
+        List<SpecimenOutboundReturnReqVO> result = specimenOutboundService.getReturnStatistics(year);
         return success(result);
     }
 
-//    @GetMapping("/outboundOrder")
-//    @Operation(summary = "获得标本出库单")
-//    @Parameter(name = "infoIds", description = "标本ID列表", required = true, example = "1,2,3,4")
-//    @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:query')")
-//    public CommonResult<List<SpecimenOutboundInfoVO>> getSpecimenOutbound(@RequestParam("infoIds") String infoIds) {
-//        List<Long> ids = Arrays.stream(infoIds.split(","))
-//                .map(Long::valueOf)
-//                .collect(Collectors.toList());
-//        List<SpecimenOutboundDO> specimenOutbounds = specimenOutboundService.getSpecimenOutboundsByIds(ids);
-//
-//        // 手动转换 SpecimenOutboundDO 到 SpecimenOutboundRespVO
-//        List<SpecimenOutboundInfoVO> response = specimenOutbounds.stream()
-//                .map(outbound -> {
-//                    SpecimenOutboundInfoVO vo = new SpecimenOutboundInfoVO();
-//                    vo.setId(outbound.getId());
-//                    vo.setChineseName(outbound.getChineseName());
-//                    vo.setSpecimenNumber(outbound.getSpecimenNumber());
-//                    vo.setApplicantName(outbound.getApplicantName());
-//                    vo.setApplicationDate(outbound.getApplicationDate());
-//                    vo.setImagePath(outbound.getImagePath());
-//                    vo.setStorageLocation(outbound.getStorageLocation());
-//                    // 这里可以继续设置其他字段
-//                    return vo;
-//                })
-//                .collect(Collectors.toList());
-//
-    //能用
-//        return success(response);
-//    }
-
-//    @GetMapping("/specimenInfo")
-//    @Operation(summary = "获得标本信息")
-//    @Parameter(name = "outboundOrderId", description = "标本出库回库表的ID", required = true, example = "1")
-//    @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:query')")
-//    public CommonResult<List<SpecimenOutboundInfoVO>> getSpecimenInfo(@RequestParam("outboundOrderId") Long outboundOrderId) {
-//        // 根据出库单ID获取信息
-//        List<SpecimenOutboundDO> specimenOutbounds = specimenOutboundService.getSpecimenOutboundsByOutboundOrderId(outboundOrderId);
-//
-//        // 手动转换 SpecimenOutboundDO 到 SpecimenOutboundInfoVO
-//        List<SpecimenOutboundInfoVO> response = specimenOutbounds.stream()
-//                .map(outbound -> {
-//                    SpecimenOutboundInfoVO vo = new SpecimenOutboundInfoVO();
-//                    vo.setInfoId(outbound.getInfoId()); // 直接获取infoId
-//                    vo.setImagePath(outbound.getImagePath());
-//                    vo.setStorageLocation(outbound.getStorageLocation());
-//                    vo.setSpecimenNumber(outbound.getSpecimenNumber());
-//                    return vo;
-//                })
-//                .collect(Collectors.toList());
-//
-//        return success(response);
-//    }
-
-//    @GetMapping("/specimenInfo")
-//    @Operation(summary = "获得标本信息")
-//    @Parameter(name = "outboundOrderId", description = "标本出库回库表的ID", required = true, example = "1")
-//    @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:query')")
-//    public CommonResult<List<SpecimenOutboundInfoVO>> getSpecimenInfo(@RequestParam("outboundOrderId") Long outboundOrderId) {
-//        // 根据出库单ID获取信息
-//        List<SpecimenOutboundDO> specimenOutbounds = specimenOutboundService.getSpecimenOutboundsByOutboundOrderId(outboundOrderId);
-//
-//        // 手动转换 SpecimenOutboundDO 到 SpecimenOutboundInfoVO
-//        List<SpecimenOutboundInfoVO> response = specimenOutbounds.stream()
-//                .map(outbound -> {
-//                    SpecimenOutboundInfoVO vo = new SpecimenOutboundInfoVO();
-//                    vo.setInfoId(outbound.getInfoId()); // 直接获取infoId
-//                    vo.setImagePath(outbound.getImagePath());
-//                    vo.setStorageLocation(outbound.getStorageLocation());
-//                    vo.setSpecimenNumber(outbound.getSpecimenNumber());
-//                    return vo;
-//                })
-//                .collect(Collectors.toList());
-//
-//        return success(response);
-//    }
-
-//    @GetMapping("/specimenInfo")
-//    @Operation(summary = "获得标本出库回库信息")
-//    @Parameter(name = "id", description = "编号", required = true, example = "1024")
-//    @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:query')")
-//    public CommonResult<SpecimenOutboundWithInfoRespVO> getSpecimen(@RequestParam("id") Long id) {
-//        SpecimenOutboundWithInfoRespVO specimenOutbound = specimenOutboundService.getSpecimenOutboundWithInfo(id);
-//
-//        if (specimenOutbound == null) {
-//            throw exception(NO_PERMISSION_VIEW_NON_RETURNED_SPECIMENS);
-//        }
-//
-//        return success(specimenOutbound);
-//    }
 
     @GetMapping("/specimenInfo")
     @Operation(summary = "获得标本出库回库信息")

+ 60 - 0
yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimenoutbound/vo/SpecimenOutboundOutgoingReqVO.java

@@ -0,0 +1,60 @@
+package cn.iocoder.yudao.module.museums.controller.admin.specimenoutbound.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 根据出库登记情况统计本年标本出库信息/修改 Request VO")
+@Data
+
+public class SpecimenOutboundOutgoingReqVO {
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    private Long id;
+
+    @Schema(description = "关联到总表中的标本ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @NotEmpty(message = "关联到总表中的标本ID不能为空")
+    private String infoId;
+
+    @Schema(description = "中文名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
+//    @NotEmpty(message = "中文名称不能为空")
+    private String chinese;
+
+    @Schema(description = "申请出库的标本编号", requiredMode = Schema.RequiredMode.REQUIRED)
+//    @NotEmpty(message = "申请出库的标本编号不能为空")
+    private String number;
+
+    @Schema(description = "申请人或申请单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
+    @NotEmpty(message = "申请人或申请单位不能为空")
+    private String applicantName;
+
+    @Schema(description = "申请时间")
+    private LocalDateTime applicationDate;
+
+    @Schema(description = "申请出库的用途", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "申请出库的用途不能为空")
+    private String applicationUsage;
+
+
+    @Schema(description = "审批状态", example = "2")
+    private Integer status;
+
+    @Schema(description = "备注信息")
+    private String remarks;
+
+    @Schema(description = "出库时间")
+    private LocalDateTime outgoingTime;
+
+    @Schema(description = "标本情况")
+    private String specimenCondition;
+
+    @Schema(description = "标本状态(已出库、已回库、出库审批中)", example = "2")
+    private Integer sampleStatus;
+
+    @Schema(description = "出库员")
+    private Long operator;
+
+
+
+}

+ 2 - 2
yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/dal/mysql/specimenoutbound/SpecimenOutboundMapper.java

@@ -56,7 +56,7 @@ public interface SpecimenOutboundMapper extends BaseMapperX<SpecimenOutboundDO>
             "WHERE (status = 3 OR status = 4) " +
             "AND YEAR(application_date) = #{year} " +
             "AND deleted = 0")
-    List<SpecimenOutboundDO> selectOutgoingStatisticsByYear(int year);
+    List<SpecimenOutboundOutgoingReqVO> selectOutgoingStatisticsByYear(int year);
 
     /**
      * 根据年份统计已出库和已回库的标本信息
@@ -68,7 +68,7 @@ public interface SpecimenOutboundMapper extends BaseMapperX<SpecimenOutboundDO>
             "WHERE (status = 4) " +
             "AND YEAR(application_date) = #{year} " +
             "AND deleted = 0")
-    List<SpecimenOutboundDO> selectReturnStatisticsByYear(int year);
+    List<SpecimenOutboundReturnReqVO> selectReturnStatisticsByYear(int year);
 
     //根据出、回、入库登记统计标本历年增减情况
     @Select("SELECT * FROM museums_specimen_outbound WHERE deleted = 0")

+ 2 - 2
yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/service/specimenoutbound/SpecimenOutboundService.java

@@ -95,14 +95,14 @@ public interface SpecimenOutboundService {
      * @param year 年份
      * @return 标本出库信息列表
      */
-    List<SpecimenOutboundDO> getOutboundStatistics(int year);
+    List<SpecimenOutboundOutgoingReqVO> getOutboundStatistics(int year);
 
     /**
      * 根据回库的登记情况统计本年标本回库信息
      * @param year 年份
      * @return 标本回库信息列表
      */
-    List<SpecimenOutboundDO> getReturnStatistics(int year);
+    List<SpecimenOutboundReturnReqVO> getReturnStatistics(int year);
 
 
     /**

+ 2 - 2
yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/service/specimenoutbound/SpecimenOutboundServiceImpl.java

@@ -201,13 +201,13 @@ public class SpecimenOutboundServiceImpl implements SpecimenOutboundService {
     //工作台
     //根据出库的登记情况统计本年标本出库信息
     @Override
-    public List<SpecimenOutboundDO> getOutboundStatistics(int year) {
+    public List<SpecimenOutboundOutgoingReqVO> getOutboundStatistics(int year) {
         return specimenOutboundMapper.selectOutgoingStatisticsByYear(year);
     }
 
     //根据回库的登记情况统计本年标本回库信息
     @Override
-    public List<SpecimenOutboundDO> getReturnStatistics(int year) {
+    public List<SpecimenOutboundReturnReqVO> getReturnStatistics(int year) {
         return specimenOutboundMapper.selectReturnStatisticsByYear(year);
     }