Browse Source

改了报错信息

hyy 4 months ago
parent
commit
f934bc5a45
15 changed files with 221 additions and 249 deletions
  1. 2 5
      yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
  2. 0 1
      yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java
  3. 21 13
      yudao-module-museums/yudao-module-museums-api/src/main/java/cn/iocoder/yudao/module/museums/enums/ErrorCodeConstants.java
  4. 1 1
      yudao-module-museums/yudao-module-museums-api/src/main/java/cn/iocoder/yudao/module/museums/enums/social/LogRecordConstants.java
  5. 2 3
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimeninfo/SpecimenInfoController.java
  6. 59 59
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimeninfo/vo/SpecimenInfoExportReqVO.java
  7. 89 84
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimeninfo/vo/SpecimenInfoExportRespVO.java
  8. 5 4
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimenoutbound/vo/SpecimenOutboundSaveReqVO.java
  9. 4 3
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/dal/mysql/specimeninfo/SpecimenInfoMapper.java
  10. 8 0
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/dal/mysql/specimenoutbound/SpecimenOutboundMapper.java
  11. 0 5
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/service/museumsdocument/MuseumsDocumentServiceImpl.java
  12. 1 1
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/service/photos/PhotosServiceImpl.java
  13. 13 10
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/service/specimeninfo/SpecimenInfoServiceImpl.java
  14. 14 58
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/service/specimenoutbound/SpecimenOutboundServiceImpl.java
  15. 2 2
      yudao-server/src/main/resources/application.yaml

+ 2 - 5
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java

@@ -46,9 +46,8 @@ public class FileController {
         return success(fileService.createFile(file.getOriginalFilename(), path, IoUtil.readBytes(file.getInputStream())));
     }
 
-    //自加的
     @PostMapping("/museums-upload")
-    @Operation(summary = "上传博物馆文件", description = "模式二:后端上传文件,包含另一个字段")
+    @Operation(summary = "上传博物馆文件")
     @PreAuthorize("@ss.hasPermission('museums:specimen-info:file')")
     public CommonResult<String> uploadFileWithAnother(FileUploadReqVO uploadReqVO) throws Exception {
         MultipartFile file = uploadReqVO.getFile();
@@ -111,13 +110,11 @@ public class FileController {
         return success(BeanUtils.toBean(pageResult, FileRespVO.class));
     }
 
-    //自加的
     @GetMapping("/page/another")
-    @Operation(summary = "获得另一个字段为1的文件分页")
+    @Operation(summary = "获得博物馆文件分页")
     @PreAuthorize("@ss.hasPermission('infra:file:museums')")
     public CommonResult<PageResult<FileRespVO>> getFilePageWithAnotherOne(@Valid FilePageReqVO pageVO) {
         PageResult<FileDO> pageResult = fileService.getFilePageWithAnotherOne(pageVO);
         return success(BeanUtils.toBean(pageResult, FileRespVO.class));
     }
-
 }

+ 0 - 1
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java

@@ -42,7 +42,6 @@ public class FileServiceImpl implements FileService {
 
     @Override
     public PageResult<FileDO> getFilePageWithAnotherOne(FilePageReqVO pageReqVO) {
-        // 可以直接调用 mapper 的 selectPage 方法,添加 another 字段的条件
         return fileMapper.selectPageWithAnotherOne(pageReqVO);
     }
 

+ 21 - 13
yudao-module-museums/yudao-module-museums-api/src/main/java/cn/iocoder/yudao/module/museums/enums/ErrorCodeConstants.java

@@ -11,28 +11,36 @@ public class ErrorCodeConstants {
     // ========== 标本管理 1-016-000-000 ==========
     public static final ErrorCode SPECIMEN_INFO_NOT_EXISTS = new ErrorCode(1-016-000-000, "标本管理不存在");
     public static final ErrorCode SPECIMEN_INFO_LIST_IS_EMPTY = new ErrorCode(1-016-000-001, "标本excel列表为空");
-    public static final ErrorCode UPLOADED_FOLDER_CANNOT_EMPTY = new ErrorCode(1-016-000-002, "上传的压缩包不能为空");
-    public static final ErrorCode INVALID_IMAGE_FORMAT = new ErrorCode(1-016-000-003, "图片格式无效");
+    public static final ErrorCode UPLOADED_FOLDER_CANNOT_EMPTY = new ErrorCode(1-016-000-002, "上传的文件格式无效,仅支持 .zip 格式");
+    public static final ErrorCode INVALID_IMAGE_FORMAT = new ErrorCode(1-016-000-003, "图片格式不符合要求");
     public static final ErrorCode SPECIMEN_NUMBER_ALREADY_EXISTS_CANNOT_ADDED = new ErrorCode(1-016-000-004, "标本编号已存在,无法新增");
-    public static final ErrorCode SPECIMEN_NUMBER_NOT_EXISTS = new ErrorCode(1-016-000-005, "存在无效的标本编号");
+    public static final ErrorCode SPECIMEN_NUMBER_NOT_EXISTS = new ErrorCode(1-016-000-005, "标本编号无效或不存在");
+    public static final ErrorCode SPECIMEN_FILE_OR_IMAGE_REQUIRED = new ErrorCode(1-016-000-006, "请至少上传一个标本文件或一个图片文件");
+
     // ========== 标本出库回库信息 1-016-001-000 ==========
     public static final ErrorCode SPECIMEN_OUTBOUND_NOT_EXISTS = new ErrorCode(1-016-001-000, "标本出库回库信息不存在");
-    public static final ErrorCode NO_PERMISSION_VIEW_NON_RETURNED_SPECIMENS = new ErrorCode(1-016-001-001, "没有权限查看非已回库的标本出库信息");
+    public static final ErrorCode NO_PERMISSION_VIEW_NON_RETURNED_SPECIMENS = new ErrorCode(1-016-001-001, "没有权限查看回库的标本出库信息");
     public static final ErrorCode SPECIMEN_OUTBOUND_ORDER_NOT_EXISTS = new ErrorCode(1-016-001-002, "标本出库单信息不存在");
-    public static final ErrorCode SPECIMEN_IS_LENDING_OUT = new ErrorCode(1-016-001-003, "存在当前状态为借出中的标本,无法进行出库操作");
-    public static final ErrorCode USER_NOT_HAVE_THE_RIGHT_FIRST_INSTANCE = new ErrorCode(1-016-001-004, "用户没有一审权限");
-    public static final ErrorCode USER_NOT_HAVE_THE_RIGHT_SECOND_INSTANCE = new ErrorCode(1-016-001-005, "用户没有二审权限");
-    public static final ErrorCode INVALID_APPROVAL_STATUS = new ErrorCode(1-016-001-005, "无效的审批状态");
+    public static final ErrorCode SPECIMEN_IS_LENDING_OUT = new ErrorCode(1-016-001-003, "存在状态为借出中的标本,无法进行出库操作");
+    public static final ErrorCode USER_NOT_HAVE_THE_RIGHT_FIRST_INSTANCE = new ErrorCode(1-016-001-004, "您暂无一审权限,无法执行此操作");
+    public static final ErrorCode USER_NOT_HAVE_THE_RIGHT_SECOND_INSTANCE = new ErrorCode(1-016-001-005, "您暂无二审权限,无法执行此操作");
+    public static final ErrorCode INVALID_APPROVAL_STATUS = new ErrorCode(1-016-001-006, "审批状态无效");
+    public static final ErrorCode ONLY_STATUS_PENDING_CAN_FIRST_INSTANCE = new ErrorCode(1-016-001-007, "仅待审批状态的标本可进行一审操作");
+    public static final ErrorCode ONLY_PASSED_FIRST_CAN_SECOND_INSTANCE = new ErrorCode(1-016-001-010, "仅一审通过状态的标本可进行二审操作");
+    public static final ErrorCode APPROVING_REJECTION_MUST_FILL_REASON = new ErrorCode(1-016-001-011, "审批驳回时必须填写驳回原因");
+    public static final ErrorCode EXISTS_SPECIMEN_IS_LENDING_OUT = new ErrorCode(1-016-001-003, "存在状态为借出中的标本,无法提交出库申请");
+    public static final ErrorCode ONLY_PASSED_SECOND_INSTANCE_OUTBOUND = new ErrorCode(1-016-001-010, "仅二审通过状态的标本可确认出库");
+    public static final ErrorCode ONLY_OUTBOUND_SPECIMEN_CAN_RETURNED = new ErrorCode(1-016-001-010, "只有已出库状态的标本出库单才能进行回库操作");
 
     // ========== 博物馆照片组 1-016-002-000 ==========
-    public static final ErrorCode PHOTO_GROUP_NOT_EXISTS = new ErrorCode(1-016-002-000, "博物馆照片组不存在");
-    public static final ErrorCode PHOTO_GROUP_UPLOAD_FAILED = new ErrorCode(1-016-002-001, "照片组上传失败");
+    public static final ErrorCode PHOTO_GROUP_NOT_EXISTS = new ErrorCode(1-016-002-000, "博物馆照片组记录不存在");
+    public static final ErrorCode PHOTO_GROUP_UPLOAD_FAILED = new ErrorCode(1-016-002-001, "照片组上传失败,请检查上传文件");
     public static final ErrorCode PHOTO_GROUP_PACKAGE_FAILED_DECOMPRESS = new ErrorCode(1-016-002-002, "照片组上传失败");
-    public static final ErrorCode PHOTO_GROUP_MUST_BE_COMPRESSED_PACKAGE = new ErrorCode(1-016-002-003, "请上传图片压缩包");
+    public static final ErrorCode PHOTO_GROUP_MUST_BE_COMPRESSED_PACKAGE = new ErrorCode(1-016-002-003, "请上传已压缩的图片文件包");
 
     // ========== 博物馆文件管理 1-016-003-000 ==========
-    public static final ErrorCode DOCUMENT_NOT_EXISTS = new ErrorCode(1-016-003-000, "博物馆文件管理不存在");
+    public static final ErrorCode DOCUMENT_NOT_EXISTS = new ErrorCode(1-016-003-000, "指定的博物馆文件记录不存在");
 
     // ========== 博物馆照片 1-016-004-000 ==========
-    public static final ErrorCode PHOTOS_NOT_EXISTS = new ErrorCode(1-016-004-000, "博物馆照片不存在");
+    public static final ErrorCode PHOTOS_NOT_EXISTS = new ErrorCode(1-016-004-000, "博物馆照片记录不存在");
 }

+ 1 - 1
yudao-module-museums/yudao-module-museums-api/src/main/java/cn/iocoder/yudao/module/museums/enums/social/LogRecordConstants.java

@@ -31,5 +31,5 @@ public interface LogRecordConstants {
     String MUSEUMS_SPECIMEN_UPDATE_RETURN_SUCCESS = "更新了标本回库单【{{#existingSpecimen.id}}】, 标本情况: {{#existingSpecimen.specimenCondition}}, 退还人: {{#updateReqVO.returner}}, 点收人: {{#updateReqVO.receiver}}, 备注: {{#updateReqVO.remarks}}";
     String MUSEUMS_SPECIMEN_UPDATE_RECOMPILE_SUCCESS = "修改了标本出库单【{{#updateReqVO.id}}】:{_DIFF{#updateReqVO}}";
     String MUSEUMS_SPECIMEN_CREATE_CONFIEM_OUTBOUND_SUCCESS = "{{#operator}}确认了标本出库";
-    String MUSEUMS_SPECIMEN_APPROVE_OUTBOUND_SUCCESS = "审批结果:{{#approvalMessage}},审批人ID:{{#userId}},审批建议:{{#processInstanceId}}{{#rejectionReasons}}";
+    String MUSEUMS_SPECIMEN_APPROVE_OUTBOUND_SUCCESS = "审批结果:{{#approvalMessage}},审批人:{{#userNickname}},审批建议:{{#processInstanceId}}{{#rejectionReasons}}";
 }

+ 2 - 3
yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimeninfo/SpecimenInfoController.java

@@ -37,8 +37,7 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
 
 import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
 import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
-import static cn.iocoder.yudao.module.museums.enums.ErrorCodeConstants.INVALID_IMAGE_FORMAT;
-import static cn.iocoder.yudao.module.museums.enums.ErrorCodeConstants.NO_PERMISSION_VIEW_NON_RETURNED_SPECIMENS;
+import static cn.iocoder.yudao.module.museums.enums.ErrorCodeConstants.*;
 
 import cn.iocoder.yudao.module.museums.controller.admin.specimeninfo.vo.*;
 import cn.iocoder.yudao.module.museums.dal.dataobject.specimeninfo.SpecimenInfoDO;
@@ -193,7 +192,7 @@ public class SpecimenInfoController {
 
         // 如果没有上传任何文件,返回相应的提示信息
         if (importResult == null && imageFile == null) {
-            throw new Exception("请至少上传一个标本文件或一个图片文件。");
+            throw exception(SPECIMEN_FILE_OR_IMAGE_REQUIRED);
         }
 
         return success(importResult);

+ 59 - 59
yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimeninfo/vo/SpecimenInfoExportReqVO.java

@@ -18,72 +18,102 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
 @ToString(callSuper = true)
 public class SpecimenInfoExportReqVO extends PageParam {
 
-    @Schema(description = "标本类型(矿物、岩石矿石、化石、陨石)", example = "1")
-    private Integer specimenType;
-
     @Schema(description = "标本编号")
     private String specimenNumber;
 
     @Schema(description = "资产号")
     private String assetNumber;
 
-    @Schema(description = "存放位置")
-    private String storageLocation;
-
     @Schema(description = "中文名称", example = "赵六")
     private String chineseName;
 
     @Schema(description = "英文名称", example = "Maven")
     private String englishName;
 
-    @Schema(description = "成分")
+    @Schema(description = "标本类型(矿物/矿石/岩石/化石/陨石)", example = "1")
+    private Integer specimenType;
+
+    @Schema(description = "存放位置")
+    private String storageLocation;
+
+    @Schema(description = "保存类型(标本/原石/光片/薄片/切片/模型及其他)", example = "1")
+    private Integer preservationType;
+
+    @Schema(description = "保存状态(完整/受损/严重受损/无实物)", example = "1")
+    private Integer saveStatus;
+
+    @Schema(description = "数量(件/套)")
+    private String specimenAmount;
+
+    @Schema(description = "规格(cm)")
+    private String size;
+
+    @Schema(description = "重量(g)")
+    private String weight;
+
+    @Schema(description = "成分/化学式")
     private String composition;
 
-    @Schema(description = "产地")
+    @Schema(description = "产地/发现地(市级县级产地)")
     private String origin;
 
-    @Schema(description = "时代")
+    @Schema(description = "省")
+    private String economize;
+
+    @Schema(description = "国家")
+    private String country;
+
+    @Schema(description = "形成时代")
     private String era;
 
-    @Schema(description = "保存地层")
+    @Schema(description = "地质产状或位(产出状态,化石指产出层位)")
     private String preservedLayer;
 
-    @Schema(description = "陨石类型", example = "2")
+    @Schema(description = "分类(矿物的类型/岩石的类型/化石的类型/陨石的类型)")
     private String meteoriteType;
 
-    @Schema(description = "国际命名", example = "王五")
+    @Schema(description = "国际命名")
     private String internationalName;
 
-    @Schema(description = "保存类型(标本、光片、薄片模型及其他)", example = "1")
-    private Integer preservationType;
-
-    @Schema(description = "尺寸")
-    private String size;
+    @Schema(description = "发现时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] discoveryTime;
 
-    @Schema(description = "重量")
-    private String weight;
+    @Schema(description = "降落时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] fallTime;
 
-    @Schema(description = "来源(采购、捐赠、采集)")
+    @Schema(description = "来源(采购/捐赠/采集)")
     private Integer source;
 
-    @Schema(description = "标本提供者(供应商、捐赠人、采集人)")
+    @Schema(description = "标本提供者")
     private String provider;
 
-    @Schema(description = "用途")
-    private String purpose;
+    @Schema(description = "单价")
+    private String specimenPrice;
 
-    @Schema(description = "描述", example = "黑红色陨石")
-    private String description;
+    @Schema(description = "入藏时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] acquisitionTime;
+
+    @Schema(description = "主要用途(工业原料/药用/建材/科学研究/观赏/其它)", example = "1")
+    private Integer mainPurpose;
 
-    @Schema(description = "馆藏状态(在馆、借出、展陈)", example = "2")
+    @Schema(description = "具体用途")
+    private String purpose;
+
+    @Schema(description = "馆藏状态(在馆/展陈/借出)", example = "2")
     private Integer collectionStatus;
 
+    @Schema(description = "图片资料(图件名称)", example = "芋艿")
+    private String imageName;
+
+    @Schema(description = "文献资料")
+    private String description;
+
     @Schema(description = "备注")
     private String notes;
 
-    @Schema(description = "图片名称", example = "芋艿")
-    private String imageName;
-
     @Schema(description = "入库操作员")
     private String operator;
 
@@ -91,40 +121,10 @@ public class SpecimenInfoExportReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] entryDate;
 
-    @Schema(description = "发现时间")
-    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
-    private LocalDateTime[] discoveryTime;
-
-    @Schema(description = "降落时间")
-    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
-    private LocalDateTime[] fallTime;
-
     @Schema(description = "创建时间")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
-    @Schema(description = "入藏时间(购买、捐赠、采集时间)")
-    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
-    private LocalDateTime[] acquisitionTime;
-
     @Schema(description = "注销原因", example = "不香")
     private String deletedReason;
-
-    @Schema(description = "标本数量")
-    private String specimenAmount;
-
-    @Schema(description = "标本价格")
-    private String specimenPrice;
-
-    @Schema(description = "主要用途(工业原料/药用/建材/科学研究/观赏/其它)", example = "1")
-    private Integer mainPurpose;
-
-    @Schema(description = "保存状态(完整/受损/严重受损/无实物)", example = "1")
-    private Integer saveStatus;
-
-    @Schema(description = "省")
-    private String economize;
-
-    @Schema(description = "国家")
-    private String country;
 }

+ 89 - 84
yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimeninfo/vo/SpecimenInfoExportRespVO.java

@@ -20,11 +20,6 @@ public class SpecimenInfoExportRespVO {
     @ExcelProperty("序号")
     private Integer id;
 
-    @Schema(description = "标本类型(矿物、岩石矿石、化石、陨石)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
-    @ExcelProperty(value = "标本类型(矿物、岩石矿石、化石、陨石)", converter = DictConvert.class)
-    @DictFormat(DictTypeConstants.MUSEUMS_SPECIMEN_TYPE)
-    private Integer specimenType;
-
     @Schema(description = "标本编号", requiredMode = Schema.RequiredMode.REQUIRED)
     @ExcelProperty("标本编号")
     private String specimenNumber;
@@ -33,10 +28,6 @@ public class SpecimenInfoExportRespVO {
     @ExcelProperty("资产号")
     private String assetNumber;
 
-    @Schema(description = "存放位置")
-    @ExcelProperty("存放位置")
-    private String storageLocation;
-
     @Schema(description = "中文名称", example = "赵六")
     @ExcelProperty("中文名称")
     private String chineseName;
@@ -45,123 +36,137 @@ public class SpecimenInfoExportRespVO {
     @ExcelProperty("英文名称")
     private String englishName;
 
-    @Schema(description = "成分")
-    @ExcelProperty("成分")
+    @Schema(description = "标本类型(矿物/矿石/岩石/化石/陨石)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty(value = "标本类型(矿物/矿石/岩石/化石/陨石)", converter = DictConvert.class)
+    @DictFormat(DictTypeConstants.MUSEUMS_SPECIMEN_TYPE)
+    private Integer specimenType;
+
+    @Schema(description = "存放位置")
+    @ExcelProperty("存放位置")
+    private String storageLocation;
+
+    @Schema(description = "保存类型(标本/原石/光片/薄片/切片/模型及其他)", example = "1")
+    @ExcelProperty(value = "保存类型(标本/原石/光片/薄片/切片/模型及其他)", converter = DictConvert.class)
+    @DictFormat(DictTypeConstants.MUSEUMS_SPECIMEN_INFO)
+    private Integer preservationType;
+
+    @Schema(description = "保存状态(完整/受损/严重受损/无实物)", example = "1")
+    @ExcelProperty(value = "保存状态(完整/受损/严重受损/无实物)", converter = DictConvert.class)
+    @DictFormat(DictTypeConstants.MUSEUMS_SPECIMEN_PRESERVATION_STATUS)
+    private Integer saveStatus;
+
+    @Schema(description = "数量(件/套)")
+    @ExcelProperty("数量(件/套)")
+    private String specimenAmount;
+
+    @Schema(description = "规格(cm)")
+    @ExcelProperty("规格(cm)")
+    private String size;
+
+    @Schema(description = "重量(g)")
+    @ExcelProperty("重量(g)")
+    private String weight;
+
+    @Schema(description = "成分/化学式")
+    @ExcelProperty("成分/化学式")
     private String composition;
 
-    @Schema(description = "产地")
-    @ExcelProperty("产地")
+    @Schema(description = "产地/发现地(市级县级产地)")
+    @ExcelProperty("产地/发现地(市级县级产地)")
     private String origin;
 
-    @Schema(description = "时代")
-    @ExcelProperty("时代")
+    @Schema(description = "省")
+    @ExcelProperty("省")
+    private String economize;
+
+    @Schema(description = "国家")
+    @ExcelProperty("国家")
+    private String country;
+
+    @Schema(description = "形成时代")
+    @ExcelProperty("形成时代")
     private String era;
 
-    @Schema(description = "保存地层")
-    @ExcelProperty("保存地层")
+    @Schema(description = "地质产状或位(产出状态,化石指产出层位)")
+    @ExcelProperty("地质产状或位(产出状态,化石指产出层位)")
     private String preservedLayer;
 
-    @Schema(description = "陨石类型", example = "2")
-    @ExcelProperty("陨石类型")
+    @Schema(description = "分类(矿物的类型/岩石的类型/化石的类型/陨石的类型)")
+    @ExcelProperty("分类(矿物的类型/岩石的类型/化石的类型/陨石类型")
     private String meteoriteType;
 
-    @Schema(description = "国际命名", example = "王五")
+    @Schema(description = "国际命名")
     @ExcelProperty("国际命名")
     private String internationalName;
 
-    @Schema(description = "保存类型(标本、光片、薄片模型及其他)", example = "1")
-    @ExcelProperty(value = "保存类型(标本、光片、薄片模型及其他)", converter = DictConvert.class)
-    @DictFormat(DictTypeConstants.MUSEUMS_SPECIMEN_INFO)
-    private Integer preservationType;
-
-    @Schema(description = "尺寸")
-    @ExcelProperty("尺寸")
-    private String size;
+    @Schema(description = "发现时间")
+    @ExcelProperty("发现时间")
+    private LocalDateTime discoveryTime;
 
-    @Schema(description = "重量")
-    @ExcelProperty("重量")
-    private String weight;
+    @Schema(description = "降落时间")
+    @ExcelProperty("降落时间")
+    private LocalDateTime fallTime;
 
-    @Schema(description = "来源(采购、捐赠、采集)")
-    @ExcelProperty(value = "来源(采购、捐赠、采集)", converter = DictConvert.class)
+    @Schema(description = "来源(采购/捐赠/采集)")
+    @ExcelProperty(value = "来源(采购/捐赠/采集)", converter = DictConvert.class)
     @DictFormat(DictTypeConstants.MUSEUMS_SOURCE)
     private Integer source;
 
-    @Schema(description = "标本提供者(供应商、捐赠人、采集人)")
-    @ExcelProperty("标本提供者(供应商、捐赠人、采集人)")
+    @Schema(description = "标本提供者")
+    @ExcelProperty("标本提供者")
     private String provider;
 
-    @Schema(description = "用途")
-    @ExcelProperty("用途")
-    private String purpose;
+    @Schema(description = "单价")
+    @ExcelProperty("单价")
+    private String specimenPrice;
 
-    @Schema(description = "描述", example = "黑红色陨石")
-    @ExcelProperty("描述")
-    private String description;
+    @Schema(description = "入藏时间")
+    @ExcelProperty("入藏时间")
+    private LocalDateTime acquisitionTime;
+
+    @Schema(description = "主要用途(工业原料/药用/建材/科学研究/观赏/其它)", example = "1")
+    @ExcelProperty(value = "主要用途(工业原料/药用/建材/科学研究/观赏/其它)", converter = DictConvert.class)
+    @DictFormat(DictTypeConstants.MUSEUMS_SPECIMEN_MAIN_USES)
+    private Integer mainPurpose;
+
+    @Schema(description = "具体用途")
+    @ExcelProperty("具体用途")
+    private String purpose;
 
     @Schema(description = "馆藏状态(在馆、借出、展陈)", example = "2")
     @ExcelProperty(value = "馆藏状态(在馆、借出、展陈)", converter = DictConvert.class)
     @DictFormat(DictTypeConstants.MUSEUMS_COLLECTION_STATUS)
     private Integer collectionStatus;
 
+    @Schema(description = "图片资料(图件名称)", example = "芋艿")
+    @ExcelProperty("图片资料(图件名称)")
+    private String imageName;
+
+    @Schema(description = "文献资料")
+    @ExcelProperty("文献资料")
+    private String description;
+
     @Schema(description = "备注")
     @ExcelProperty("备注")
     private String notes;
 
-    @Schema(description = "图片名称", example = "芋艿")
-    @ExcelProperty("图片名称")
-    private String imageName;
-
-//    @Schema(description = "图片路径")
-//    @ExcelProperty("图片路径")
-//    private List<String> imagePath;
-
     @Schema(description = "入库操作员")
     @ExcelProperty("入库操作员")
     private String operator;
 
-    @Schema(description = "入库时间")
-    @ExcelProperty("入库时间")
-    private LocalDateTime entryDate;
-
-    @Schema(description = "发现时间")
-    @ExcelProperty("发现时间")
-    private LocalDateTime discoveryTime;
-
-    @Schema(description = "降落时间")
-    @ExcelProperty("降落时间")
-    private LocalDateTime fallTime;
+//    @Schema(description = "入库时间")
+//    @ExcelProperty("入库时间")
+//    private LocalDateTime entryDate;
 
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
     @ExcelProperty("创建时间")
     private LocalDateTime createTime;
 
-    @Schema(description = "入藏时间(购买、捐赠、采集时间)")
-    @ExcelProperty("入藏时间(购买、捐赠、采集时间)")
-    private LocalDateTime acquisitionTime;
-
     @Schema(description = "注销原因", example = "不香")
     @ExcelProperty("注销原因")
     private String deletedReason;
 
-    @Schema(description = "标本数量")
-    @ExcelProperty("标本数量")
-    private String specimenAmount;
-
-    @Schema(description = "标本价格")
-    @ExcelProperty("标本价格")
-    private String specimenPrice;
-
-    @Schema(description = "主要用途(工业原料/药用/建材/科学研究/观赏/其它)", example = "1")
-    private Integer mainPurpose;
-
-    @Schema(description = "保存状态(完整/受损/严重受损/无实物)", example = "1")
-    private Integer saveStatus;
-
-    @Schema(description = "省")
-    private String economize;
-
-    @Schema(description = "国家")
-    private String country;
-
+    //    @Schema(description = "图片路径")
+    //    @ExcelProperty("图片路径")
+    //    private List<String> imagePath;
 }

+ 5 - 4
yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimenoutbound/vo/SpecimenOutboundSaveReqVO.java

@@ -1,11 +1,11 @@
 package cn.iocoder.yudao.module.museums.controller.admin.specimenoutbound.vo;
 
+import cn.iocoder.yudao.framework.common.validation.Mobile;
 import com.mzt.logapi.starter.annotation.DiffLogField;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
 import java.util.*;
 import javax.validation.constraints.*;
-import org.springframework.format.annotation.DateTimeFormat;
 import java.time.LocalDateTime;
 
 @Schema(description = "管理后台 - 标本出库单填写 Request VO")
@@ -15,9 +15,9 @@ public class SpecimenOutboundSaveReqVO {
     @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
     private Long id;
 
-    @Schema(description = "关联到总表中的标本ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
-    @DiffLogField(name = "关联到总表中的标本ID")
-    private String infoId;
+//    @Schema(description = "关联到总表中的标本ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+//    @DiffLogField(name = "关联到总表中的标本ID")
+//    private String infoId;
 
     @Schema(description = "申请出库的标本编号", requiredMode = Schema.RequiredMode.REQUIRED)
     @NotEmpty(message = "申请出库的标本编号不能为空")
@@ -36,6 +36,7 @@ public class SpecimenOutboundSaveReqVO {
     @Schema(description = "电话号码", requiredMode = Schema.RequiredMode.REQUIRED)
     @NotEmpty(message = "电话号码不能为空")
     @DiffLogField(name = "电话号码")
+    @Mobile
     private String phoneNumber;
 
     @Schema(description = "研究项目名称", requiredMode = Schema.RequiredMode.REQUIRED)

+ 4 - 3
yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/dal/mysql/specimeninfo/SpecimenInfoMapper.java

@@ -6,9 +6,6 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
 import cn.iocoder.yudao.module.museums.dal.dataobject.specimeninfo.SpecimenInfoDO;
-import cn.iocoder.yudao.module.museums.dal.dataobject.specimenoutbound.SpecimenOutboundDO;
-import cn.iocoder.yudao.module.system.dal.dataobject.logger.OperateLogDO;
-import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import org.apache.ibatis.annotations.Mapper;
 import cn.iocoder.yudao.module.museums.controller.admin.specimeninfo.vo.*;
 import org.apache.ibatis.annotations.Param;
@@ -89,6 +86,10 @@ public interface SpecimenInfoMapper extends BaseMapperX<SpecimenInfoDO> {
                 .betweenIfPresent(SpecimenInfoDO::getCreateTime, reqVO.getCreateTime())
                 .betweenIfPresent(SpecimenInfoDO::getAcquisitionTime, reqVO.getAcquisitionTime())
                 .likeIfPresent(SpecimenInfoDO::getDeletedReason, reqVO.getDeletedReason())
+                .eqIfPresent(SpecimenInfoDO::getSaveStatus, reqVO.getSaveStatus())
+                .eqIfPresent(SpecimenInfoDO::getEconomize, reqVO.getEconomize())
+                .eqIfPresent(SpecimenInfoDO::getCountry, reqVO.getCountry())
+                .eqIfPresent(SpecimenInfoDO::getMainPurpose, reqVO.getMainPurpose())
                 .orderByDesc(SpecimenInfoDO::getId));
     }
 

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

@@ -25,6 +25,11 @@ public interface SpecimenOutboundMapper extends BaseMapperX<SpecimenOutboundDO>
                 .likeIfPresent(SpecimenOutboundDO::getNumber, reqVO.getNumber())
                 .likeIfPresent(SpecimenOutboundDO::getApplicantName, reqVO.getApplicantName())
                 .likeIfPresent(SpecimenOutboundDO::getApplicationUsage, reqVO.getApplicationUsage())
+                .likeIfPresent(SpecimenOutboundDO::getPhoneNumber, reqVO.getPhoneNumber())
+                .likeIfPresent(SpecimenOutboundDO::getProjectName, reqVO.getProjectName())
+                .betweenIfPresent(SpecimenOutboundDO::getStartTime, reqVO.getStartTime())
+                .betweenIfPresent(SpecimenOutboundDO::getEndTime, reqVO.getEndTime())
+                .likeIfPresent(SpecimenOutboundDO::getOutboundRemarks, reqVO.getOutboundRemarks())
                 .likeIfPresent(SpecimenOutboundDO::getAttachments, reqVO.getAttachments())
                 .eqIfPresent(SpecimenOutboundDO::getStatus, reqVO.getStatus())
                 .likeIfPresent(SpecimenOutboundDO::getRemarks, reqVO.getRemarks())
@@ -33,12 +38,15 @@ public interface SpecimenOutboundMapper extends BaseMapperX<SpecimenOutboundDO>
                 .betweenIfPresent(SpecimenOutboundDO::getCreateTime, reqVO.getCreateTime())
                 .eqIfPresent(SpecimenOutboundDO::getSampleStatus, reqVO.getSampleStatus())
                 .likeIfPresent(SpecimenOutboundDO::getProcessInstanceId, reqVO.getProcessInstanceId())
+                .likeIfPresent(SpecimenOutboundDO::getRejectionReasons, reqVO.getRejectionReasons())
                 .eqIfPresent(SpecimenOutboundDO::getOperator, reqVO.getOperator())
                 .eqIfPresent(SpecimenOutboundDO::getReturner, reqVO.getReturner())
                 .eqIfPresent(SpecimenOutboundDO::getReceiver, reqVO.getReceiver())
                 .betweenIfPresent(SpecimenOutboundDO::getReturnDate, reqVO.getReturnDate())
                 .betweenIfPresent(SpecimenOutboundDO::getApprovalTime, reqVO.getApprovalTime())
+                .betweenIfPresent(SpecimenOutboundDO::getTwoApprovalTime, reqVO.getTwoApprovalTime())
                 .eqIfPresent(SpecimenOutboundDO::getApproveUsers, reqVO.getApproveUsers())
+                .eqIfPresent(SpecimenOutboundDO::getTwoApproveUsers, reqVO.getTwoApproveUsers())
                 .orderByDesc(SpecimenOutboundDO::getId));
 
     }

+ 0 - 5
yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/service/museumsdocument/MuseumsDocumentServiceImpl.java

@@ -1,10 +1,5 @@
 package cn.iocoder.yudao.module.museums.service.museumsdocument;
 
-import cn.hutool.core.lang.Assert;
-import cn.hutool.core.util.StrUtil;
-import cn.iocoder.yudao.framework.common.util.io.FileUtils;
-import cn.iocoder.yudao.module.infra.framework.file.core.utils.FileTypeUtils;
-import lombok.SneakyThrows;
 import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import org.springframework.validation.annotation.Validated;

+ 1 - 1
yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/service/photos/PhotosServiceImpl.java

@@ -104,7 +104,7 @@ public class PhotosServiceImpl implements PhotosService {
 
         for (MultipartFile file : files) {
             if (!file.getOriginalFilename().endsWith(".zip")) {
-                throw new IllegalArgumentException("上传的文件必须是压缩包 (zip)");
+                throw exception(PHOTO_GROUP_MUST_BE_COMPRESSED_PACKAGE);
             }
 
             try (ZipInputStream zis = new ZipInputStream(file.getInputStream())) {

+ 13 - 10
yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/service/specimeninfo/SpecimenInfoServiceImpl.java

@@ -96,11 +96,9 @@ public class SpecimenInfoServiceImpl implements SpecimenInfoService {
     public void updateSpecimenInfo(SpecimenInfoSaveReqVO updateReqVO) {
         // 校验存在
         validateSpecimenInfoExists(updateReqVO.getId());
-
         // 更新
         SpecimenInfoDO updateObj = BeanUtils.toBean(updateReqVO, SpecimenInfoDO.class);
         specimenInfoMapper.updateById(updateObj);
-
         // 记录操作日志上下文
         LogRecordContext.putVariable("update-specimen", updateObj);
     }
@@ -220,12 +218,12 @@ public class SpecimenInfoServiceImpl implements SpecimenInfoService {
 
     private boolean isValidImageName(String imageNames) {
         if (imageNames == null || imageNames.trim().isEmpty()) {
-            return true; // 如果图片名称为空或仅含空格,则视为通过校验
+            return true;
         }
         String[] names = imageNames.split("、");
         for (String name : names) {
-            if (!name.matches(".+\\.(jpg|jpeg|png)$")) {
-                return false; // 只要有一个格式不正确就返回 false
+            if (!name.matches("(?i).+\\.(jpg|jpeg|png)$")) {
+                throw exception(INVALID_IMAGE_FORMAT);
             }
         }
         return true;
@@ -235,13 +233,14 @@ public class SpecimenInfoServiceImpl implements SpecimenInfoService {
     @Transactional(rollbackFor = Exception.class)
     public String importSpecimenImages(MultipartFile file) throws Exception {
         // 校验文件类型
-        if (!file.getOriginalFilename().endsWith(".zip")) {
+        if (!file.getOriginalFilename().toLowerCase().endsWith(".zip")) {
             throw exception(UPLOADED_FOLDER_CANNOT_EMPTY);
         }
 
         // 创建临时目录存放解压后的文件
         File tempDir = Files.createTempDirectory("specimen_images").toFile();
-        try (ZipInputStream zipInputStream = new ZipInputStream(file.getInputStream())) {
+        ZipInputStream zipInputStream = new ZipInputStream(file.getInputStream());
+        try {
             ZipEntry entry;
             while ((entry = zipInputStream.getNextEntry()) != null) {
                 if (!entry.isDirectory()) {
@@ -255,6 +254,7 @@ public class SpecimenInfoServiceImpl implements SpecimenInfoService {
                         }
                     }
                 }
+                zipInputStream.closeEntry();
             }
 
             // 处理每个图片文件
@@ -279,16 +279,16 @@ public class SpecimenInfoServiceImpl implements SpecimenInfoService {
                             // 添加新上传的路径
                             imagePathsSet.add(imagePath.trim());
 
-                            // 添加已存在的路径
+                            // 获取已存在的路径,并处理空值或无效的路径
                             String existingImagePaths = specimenInfo.getImagePath();
-                            if (existingImagePaths != null && !existingImagePaths.trim().isEmpty()) {
+                            if (existingImagePaths != null && !existingImagePaths.trim().isEmpty() && !existingImagePaths.equals("[]")) {
+                                // 如果原路径是有效的且不是空数组,则拆分并添加到 Set 中
                                 String[] existingPaths = existingImagePaths.split(",\\s*");
                                 Collections.addAll(imagePathsSet, existingPaths);
                             }
                         }
                     }
                 }
-
                 // 生成最终的逗号分隔的字符串
                 String newImagePaths = String.join(", ", imagePathsSet);
                 // 更新所有标本的信息,确保只更新一次
@@ -302,12 +302,15 @@ public class SpecimenInfoServiceImpl implements SpecimenInfoService {
                 }
             }
         } finally {
+            zipInputStream.close();
+
             // 清理临时文件
             FileUtils.deleteDirectory(tempDir);
         }
         return "标本图片导入成功";
     }
 
+
     //工作台
     //根据入库的登记情况统计本年标本入库信息
     @Override

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

@@ -28,6 +28,7 @@ import java.util.stream.Collectors;
 
 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
+import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserNickname;
 import static cn.iocoder.yudao.module.museums.enums.ErrorCodeConstants.*;
 import static cn.iocoder.yudao.module.museums.enums.social.LogRecordConstants.*;
 import static cn.iocoder.yudao.module.system.enums.LogRecordConstants.*;
@@ -66,7 +67,7 @@ public class SpecimenOutboundServiceImpl implements SpecimenOutboundService {
             if (specimenInfo.getCollectionStatus() == 0 || specimenInfo.getCollectionStatus() == 2) {
                 validInfoIds.add(String.valueOf(specimenInfo.getId()));
             } else {
-                throw exception(SPECIMEN_IS_LENDING_OUT);
+                throw exception(EXISTS_SPECIMEN_IS_LENDING_OUT);
             }
         }
 
@@ -98,24 +99,23 @@ public class SpecimenOutboundServiceImpl implements SpecimenOutboundService {
 
         // 验证状态
         if (specimenOutbound == null) {
-            throw new IllegalStateException("标本记录不存在");
+            throw exception(SPECIMEN_OUTBOUND_NOT_EXISTS);
         }
-
         String approvalMessage = getApprovalMessage(req.getStatus());
-        Long userId = getLoginUserId();
+        String userNickname = getLoginUserNickname();
 
         // 将对象添加到日志上下文中
         LogRecordContext.putVariable("specimenOutbound", specimenOutbound);
-        LogRecordContext.putVariable("userId", userId);
+        LogRecordContext.putVariable("userNickname", userNickname);
         LogRecordContext.putVariable("approvalMessage", approvalMessage);
 
         // 一审逻辑
         if (req.getStatus() == 1 || req.getStatus() == 2) {
             if (specimenOutbound.getStatus() != 0) {
-                throw new IllegalStateException("只有状态为待审批的标本才能进行一审");
+                throw exception(ONLY_STATUS_PENDING_CAN_FIRST_INSTANCE);
             }
             if (req.getStatus() == 2 && req.getProcessInstanceId() == null) {
-                throw new IllegalArgumentException("一审驳回时必须填写驳回原因");
+                throw exception(APPROVING_REJECTION_MUST_FILL_REASON);
             }
             specimenOutbound.setStatus(req.getStatus());
             specimenOutbound.setProcessInstanceId(req.getProcessInstanceId());
@@ -126,10 +126,10 @@ public class SpecimenOutboundServiceImpl implements SpecimenOutboundService {
         // 二审逻辑
         if (req.getStatus() == 5 || req.getStatus() == 6) {
             if (specimenOutbound.getStatus() != 1) {
-                throw new IllegalStateException("只有状态为一审通过的标本才能进行二审");
+                throw exception(ONLY_PASSED_FIRST_CAN_SECOND_INSTANCE);
             }
             if (req.getStatus() == 6 && req.getRejectionReasons() == null) {
-                throw new IllegalArgumentException("二审驳回时必须填写驳回原因");
+                throw exception(APPROVING_REJECTION_MUST_FILL_REASON);
             }
             specimenOutbound.setStatus(req.getStatus());
             specimenOutbound.setRejectionReasons(req.getRejectionReasons());
@@ -171,7 +171,7 @@ public class SpecimenOutboundServiceImpl implements SpecimenOutboundService {
             if (specimenInfo.getCollectionStatus() == 0 || specimenInfo.getCollectionStatus() == 2) {
                 validInfoIds.add(String.valueOf(specimenInfo.getId()));
             } else {
-                throw exception(SPECIMEN_IS_LENDING_OUT);
+                throw exception(EXISTS_SPECIMEN_IS_LENDING_OUT);
             }
         }
 
@@ -200,7 +200,7 @@ public class SpecimenOutboundServiceImpl implements SpecimenOutboundService {
         SpecimenOutboundDO existingSpecimen = specimenOutboundMapper.selectById(id);
         // 判断状态是否为审批通过(5)
         if (existingSpecimen == null || existingSpecimen.getStatus() != 5) {
-            return "只有状态为二审通过的标本才能确认出库";
+            throw exception(ONLY_PASSED_SECOND_INSTANCE_OUTBOUND);
         }
         existingSpecimen.setStatus(3) // 更新状态为已出库(3)
                 .setOperator(operator) // 设置出库员ID
@@ -222,15 +222,6 @@ public class SpecimenOutboundServiceImpl implements SpecimenOutboundService {
         return "标本ID:"+existingSpecimen.getInfoId()+"出库成功";
     }
 
-    //用来填写回库表单,为方便添加数据,现在先用上面这段
-//    @Override
-//    public void updateSpecimenOutbound(SpecimenOutboundSaveReqVO updateReqVO) {
-//        // 校验存在
-//        validateSpecimenOutboundExists(updateReqVO.getId());
-//        // 更新
-//        SpecimenOutboundDO updateObj = BeanUtils.toBean(updateReqVO, SpecimenOutboundDO.class);
-//        specimenOutboundMapper.updateById(updateObj);
-//    }
     //填写回库表单
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -246,7 +237,7 @@ public class SpecimenOutboundServiceImpl implements SpecimenOutboundService {
 
         // 判断状态是否为已出库(3)
         if (existingSpecimen == null || existingSpecimen.getStatus() != 3) {
-            throw new IllegalStateException("只能更新状态为已出库的标本回库单");
+            throw exception(ONLY_OUTBOUND_SPECIMEN_CAN_RETURNED);
         }
 
         // 使用链式调用合并设置
@@ -323,45 +314,15 @@ public class SpecimenOutboundServiceImpl implements SpecimenOutboundService {
         return specimenOutboundMapper.getMonthlyReturnStatistics(year);
     }
 
-    //获取出库表单的方法
-//    @Override
-//    public SpecimenOutboundWithInfoRespVO getSpecimenOutboundWithInfo(Long id) {
-//        // 查询出库信息
-//        SpecimenOutboundDO specimenOutbound = specimenOutboundMapper.selectById(id);
-//
-//        // 如果没有找到相关出库信息,返回 null 或抛出异常
-//        if (specimenOutbound == null) {
-//            return null; // 或抛出自定义异常
-//        }
-//
-//        // 查询关联的标本信息
-//        String infoIds = specimenOutbound.getInfoId();
-//        // 处理 infoId 字段
-//        infoIds = infoIds.replaceAll("[\\[\\] ]", ""); // 移除方括号和空格
-//        List<Long> idList = Arrays.stream(infoIds.split(","))
-//                .map(Long::parseLong)
-//                .collect(Collectors.toList());
-//
-//        // 查询所有关联的标本信息
-//        List<SpecimenOutboundFormRespVO> specimenInfoList = specimenInfoMapper.selectByIds(idList);
-//        SpecimenOutboundWithInfoRespVO response = BeanUtils.toBean(specimenOutbound,SpecimenOutboundWithInfoRespVO.class);
-//        List<SpecimenInfoRespVO> newSpecimenInfoList =BeanUtils.toBean(specimenInfoList,SpecimenInfoRespVO.class);
-//
-//        // 创建返回对象
-//        // 设置所有关联的标本信息
-//        response.setSpecimenInfoList(newSpecimenInfoList);
-//        return response;
-//    }
+    //获取出库表单
     @Override
     public SpecimenOutboundWithInfoRespVO getSpecimenOutboundWithInfo(Long id, SpecimenInfoPageReqVO pageReqVO) {
         // 查询出库信息
         SpecimenOutboundDO specimenOutbound = specimenOutboundMapper.selectById(id);
-
         // 如果没有找到相关出库信息,返回 null 或抛出异常
         if (specimenOutbound == null) {
-            return null; // 或抛出自定义异常
+            throw exception(SPECIMEN_OUTBOUND_NOT_EXISTS);
         }
-
         // 查询关联的标本信息
         String infoIds = specimenOutbound.getInfoId();
         // 处理 infoId 字段
@@ -373,17 +334,12 @@ public class SpecimenOutboundServiceImpl implements SpecimenOutboundService {
         // 这里修改为分页查询标本信息
         PageResult<SpecimenInfoDO> pageResult = specimenInfoMapper.selectPage(pageReqVO, new LambdaQueryWrapperX<SpecimenInfoDO>()
                 .inIfPresent(SpecimenInfoDO::getId, idList));  // 根据 infoIds 查询标本信息
-
         // 将 DO 转换为 VO
         PageResult<SpecimenInfoRespVO> pageResultVO = BeanUtils.toBean(pageResult, SpecimenInfoRespVO.class);
-
         // 创建返回对象
         SpecimenOutboundWithInfoRespVO response = BeanUtils.toBean(specimenOutbound, SpecimenOutboundWithInfoRespVO.class);
         // 设置分页后的标本信息列表
         response.setSpecimenInfoList(pageResultVO);
-
         return response;
     }
-
-
 }

+ 2 - 2
yudao-server/src/main/resources/application.yaml

@@ -13,8 +13,8 @@ spring:
   servlet:
     # 文件上传相关配置项
     multipart:
-      max-file-size: 16MB # 单个文件大小
-      max-request-size: 32MB # 设置总上传的文件大小
+      max-file-size: 100MB # 单个文件大小
+      max-request-size: 200MB # 设置总上传的文件大小
 
   # Jackson 配置项
   jackson: