hyy 1 kuukausi sitten
vanhempi
commit
0a5769f04a
10 muutettua tiedostoa jossa 242 lisäystä ja 48 poistoa
  1. 2 2
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimeninfo/vo/FossilSpecimenImportExcelVO.java
  2. 2 2
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimeninfo/vo/MeteoriteSpecimenImportExcelVO.java
  3. 2 2
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimeninfo/vo/MineralSpecimenImportExcelVO.java
  4. 2 2
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimeninfo/vo/RockSpecimenImportExcelVO.java
  5. 1 1
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimeninfo/vo/SpecimenImportExcelVO.java
  6. 2 2
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimeninfo/vo/SpecimenInfoExportRespVO.java
  7. 57 3
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimenoutbound/SpecimenOutboundController.java
  8. 139 0
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimenoutbound/vo/SpecimenOutboundExcelRespVO.java
  9. 34 33
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimenoutbound/vo/SpecimenOutboundRespVO.java
  10. 1 1
      yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/service/specimenoutbound/SpecimenOutboundServiceImpl.java

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

@@ -16,7 +16,7 @@ import java.math.BigDecimal;
 @Builder
 @AllArgsConstructor
 @NoArgsConstructor
-@Accessors(chain = false) // 设置 chain = false,避免用户导入有问题
+@Accessors(chain = false) //化石导入模板
 public class FossilSpecimenImportExcelVO {
 
     @ExcelProperty("标本编号")
@@ -77,7 +77,7 @@ public class FossilSpecimenImportExcelVO {
     @ExcelProperty("标本提供者")
     private String provider;
 
-    @ExcelProperty("单价")
+    @ExcelProperty("单价(元)")
     private BigDecimal specimenPrice;
 
     @ExcelProperty("入藏时间")

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

@@ -16,7 +16,7 @@ import java.math.BigDecimal;
 @Builder
 @AllArgsConstructor
 @NoArgsConstructor
-@Accessors(chain = false) // 设置 chain = false,避免用户导入有问题
+@Accessors(chain = false) // 陨石导入模板
 public class MeteoriteSpecimenImportExcelVO {
 
     @ExcelProperty("标本编号")
@@ -86,7 +86,7 @@ public class MeteoriteSpecimenImportExcelVO {
     @ExcelProperty("标本提供者")
     private String provider;
 
-    @ExcelProperty("单价")
+    @ExcelProperty("单价(元)")
     private BigDecimal specimenPrice;
 
     @ExcelProperty("入藏时间")

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

@@ -16,7 +16,7 @@ import java.math.BigDecimal;
 @Builder
 @AllArgsConstructor
 @NoArgsConstructor
-@Accessors(chain = false) // 设置 chain = false,避免用户导入有问题
+@Accessors(chain = false) // 矿物导入模板
 public class MineralSpecimenImportExcelVO {
     @ExcelProperty("标本编号")
     private String specimenNumber;
@@ -79,7 +79,7 @@ public class MineralSpecimenImportExcelVO {
     @ExcelProperty("标本提供者")
     private String provider;
 
-    @ExcelProperty("单价")
+    @ExcelProperty("单价(元)")
     private BigDecimal specimenPrice;
 
     @ExcelProperty("入藏时间")

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

@@ -16,7 +16,7 @@ import java.math.BigDecimal;
 @Builder
 @AllArgsConstructor
 @NoArgsConstructor
-@Accessors(chain = false) // 设置 chain = false,避免用户导入有问题
+@Accessors(chain = false)//岩石-矿石导入模板
 public class RockSpecimenImportExcelVO {
 
     @ExcelProperty("标本编号")
@@ -83,7 +83,7 @@ public class RockSpecimenImportExcelVO {
     @ExcelProperty("标本提供者")
     private String provider;
 
-    @ExcelProperty("单价")
+    @ExcelProperty("单价(元)")
     private BigDecimal specimenPrice;
 
     @ExcelProperty("入藏时间")

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

@@ -92,7 +92,7 @@ public class SpecimenImportExcelVO {
     @ExcelProperty("标本提供者")
     private String provider;
 
-    @ExcelProperty("单价")
+    @ExcelProperty("单价(元)")
     private BigDecimal specimenPrice;
 
     @ExcelProperty("入藏时间")

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

@@ -32,8 +32,8 @@ public class SpecimenInfoExportRespVO {
     @ExcelProperty("中文名称")
     private String chineseName;
 
-    @Schema(description = "文名称", example = "Maven")
-    @ExcelProperty("文名称")
+    @Schema(description = "文名称", example = "Maven")
+    @ExcelProperty("文名称")
     private String englishName;
 
     @Schema(description = "标本类型(矿物/矿石/岩石/化石/陨石)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")

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

@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.museums.controller.admin.specimenoutbound;
 import cn.iocoder.yudao.module.museums.controller.admin.specimeninfo.vo.SpecimenInfoPageReqVO;
 import cn.iocoder.yudao.module.museums.dal.mysql.specimenoutbound.SpecimenOutboundMapper;
 import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
+import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper;
 import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 import org.springframework.validation.annotation.Validated;
@@ -16,6 +17,7 @@ import javax.servlet.http.*;
 import java.time.LocalDateTime;
 import java.util.*;
 import java.io.IOException;
+import java.util.stream.Collectors;
 
 import cn.iocoder.yudao.framework.common.pojo.PageParam;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
@@ -47,6 +49,8 @@ public class SpecimenOutboundController {
     private SpecimenOutboundService specimenOutboundService;
     @Resource
     private PermissionApi permissionApi;
+    @Resource
+    private AdminUserMapper adminUserMapper;
 
     @PostMapping("/create")
     @Operation(summary = "创建标本出库申请")
@@ -150,19 +154,69 @@ public class SpecimenOutboundController {
         return success(result);
     }
 
+//    @GetMapping("/export-excel")
+//    @Operation(summary = "导出标本出库回库信息 Excel")
+//    @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:export')")
+//    @ApiAccessLog(operateType = EXPORT)
+//    public void exportSpecimenOutboundExcel(@Valid SpecimenOutboundPageReqVO pageReqVO,
+//              HttpServletResponse response) throws IOException {
+//        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+//        List<SpecimenOutboundDO> list = specimenOutboundService.getSpecimenOutboundPage(pageReqVO).getList();
+//        List<SpecimenOutboundDO> newList=  BeanUtils.toBean(list,);
+////        list.forEach(specimenOutbound->{
+////
+////        });
+//        // 导出 Excel
+//        ExcelUtils.write(response, "标本出库回库信息.xls", "数据", SpecimenOutboundRespVO.class,
+//                        BeanUtils.toBean(list, SpecimenOutboundRespVO.class));
+//    }
+
     @GetMapping("/export-excel")
     @Operation(summary = "导出标本出库回库信息 Excel")
     @PreAuthorize("@ss.hasPermission('museums:specimen-outbound:export')")
     @ApiAccessLog(operateType = EXPORT)
     public void exportSpecimenOutboundExcel(@Valid SpecimenOutboundPageReqVO pageReqVO,
-              HttpServletResponse response) throws IOException {
+                                            HttpServletResponse response) throws IOException {
         pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
         List<SpecimenOutboundDO> list = specimenOutboundService.getSpecimenOutboundPage(pageReqVO).getList();
+
+        // 转换成 SpecimenOutboundExcelRespVO 并替换字段为用户昵称
+        List<SpecimenOutboundExcelRespVO> responseList = list.stream().map(specimenOutbound -> {
+            SpecimenOutboundExcelRespVO respVO = BeanUtils.toBean(specimenOutbound, SpecimenOutboundExcelRespVO.class);
+
+            // 替换字段为用户昵称
+            if (specimenOutbound.getOperator() != null) {
+                String operatorNickname = adminUserMapper.selectNicknameByUserId(specimenOutbound.getOperator());
+                respVO.setOperatorNickname(operatorNickname);  // 出库员
+            }
+            if (specimenOutbound.getTwoOperator() != null) {
+                String twoOperatorNickname = adminUserMapper.selectNicknameByUserId(specimenOutbound.getTwoOperator());
+                respVO.setTwoOperatorNickname(twoOperatorNickname);  // 出库确认员
+            }
+            if (specimenOutbound.getReturnConfirm() != null) {
+                String returnConfirmNickname = adminUserMapper.selectNicknameByUserId(specimenOutbound.getReturnConfirm());
+                respVO.setReturnConfirmNickname(returnConfirmNickname);  // 一回库确认员
+            }
+            if (specimenOutbound.getTwoReturnConfirm() != null) {
+                String twoReturnConfirmNickname = adminUserMapper.selectNicknameByUserId(specimenOutbound.getTwoReturnConfirm());
+                respVO.setTwoReturnConfirmNickname(twoReturnConfirmNickname);  // 二回库确认员
+            }
+            if (specimenOutbound.getApproveUsers() != null) {
+                String approveUsersNickname = adminUserMapper.selectNicknameByUserId(specimenOutbound.getApproveUsers());
+                respVO.setApproveUsersNickname(approveUsersNickname);  // 一审审批员
+            }
+            if (specimenOutbound.getTwoApproveUsers() != null) {
+                String twoApproveUsersNickname = adminUserMapper.selectNicknameByUserId(specimenOutbound.getTwoApproveUsers());
+                respVO.setTwoApproveUsersNickname(twoApproveUsersNickname);  // 二审审批员
+            }
+            return respVO;
+        }).collect(Collectors.toList());
+
         // 导出 Excel
-        ExcelUtils.write(response, "标本出库回库信息.xls", "数据", SpecimenOutboundRespVO.class,
-                        BeanUtils.toBean(list, SpecimenOutboundRespVO.class));
+        ExcelUtils.write(response, "标本出库回库信息.xls", "数据", SpecimenOutboundExcelRespVO.class, responseList);
     }
 
+
     //工作台
     //统计本年标本每月出库数量。
     @GetMapping("/statistics/outgoing/{year}")

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

@@ -0,0 +1,139 @@
+package cn.iocoder.yudao.module.museums.controller.admin.specimenoutbound.vo;
+
+
+import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
+import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
+import cn.iocoder.yudao.module.museums.enums.DictTypeConstants;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 标本出库回库信息导出 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class SpecimenOutboundExcelRespVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @ExcelProperty("序号")
+    private Long id;
+
+    @Schema(description = "关联到总表中的标本ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty("关联到总表中的标本ID")
+    private String infoId;
+
+    @Schema(description = "申请出库的标本编号", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("申请出库的标本编号")
+    private String number;
+
+    @Schema(description = "申请人姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
+    @ExcelProperty("申请人姓名")
+    private String applicantName;
+
+    @Schema(description = "申请单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "地质博物馆")
+    @ExcelProperty("申请单位")
+    private String applicationUsage;
+
+    @Schema(description = "电话号码", requiredMode = Schema.RequiredMode.REQUIRED, example = "19900000000")
+    @ExcelProperty("电话号码")
+    private String phoneNumber;
+
+    @Schema(description = "研究项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研究")
+    @ExcelProperty("研究项目名称")
+    private String projectName;
+
+    @Schema(description = "项目开始时间")
+    @ExcelProperty("借用开始时间")
+    private LocalDateTime startTime;
+
+    @Schema(description = "项目结束时间")
+    @ExcelProperty("借用结束时间")
+    private LocalDateTime endTime;
+
+    @Schema(description = "出库备注信息")
+    @ExcelProperty("出库备注信息")
+    private String outboundRemarks;
+
+    @Schema(description = "出库附件上传")
+    @ExcelProperty("出库附件上传")
+    private String attachments;
+
+    @Schema(description = "审批状态", example = "2")
+    @ExcelProperty(value = "审批状态", converter = DictConvert.class)
+    @DictFormat(DictTypeConstants.MUSEUMS_APPROAL_STATUS)
+    private Integer status;
+
+    @Schema(description = "标本情况")
+    @ExcelProperty("标本情况")
+    private String specimenCondition;
+
+    @Schema(description = "出库时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("出库时间")
+    private LocalDateTime outgoingTime;
+
+    @Schema(description = "一审审批员")
+    @ExcelProperty("一审审批员")
+    private String approveUsersNickname;
+
+    @Schema(description = "一审审批建议", example = "27504")
+    @ExcelProperty("一审审批建议")
+    private String processInstanceId;
+
+    @Schema(description = "二审审批员")
+    @ExcelProperty("二审审批员")
+    private String twoApproveUsersNickname;
+
+    @Schema(description = "二审审批建议", example = "27504")
+    @ExcelProperty("二审审批建议")
+    private String rejectionReasons;
+
+    @Schema(description = "一审时间")
+    @ExcelProperty("一审时间")
+    private LocalDateTime approvalTime;
+
+    @Schema(description = "二审时间")
+    @ExcelProperty("二审时间")
+    private LocalDateTime twoApprovalTime;
+
+    @Schema(description = "出库员", example = "张三")
+    @ExcelProperty("出库员")
+    private String operatorNickname;
+
+    @Schema(description = "出库确认员")
+    @ExcelProperty("出库确认员")
+    private String twoOperatorNickname;
+
+    @Schema(description = "退还人")
+    @ExcelProperty("退还人")
+    private String returner;
+
+    @Schema(description = "点收人")
+    @ExcelProperty("点收人")
+    private String receiver;
+
+    @Schema(description = "退还日期")
+    @ExcelProperty("退还日期")
+    private LocalDateTime returnDate;
+
+    @Schema(description = "一回库确认员")
+    @ExcelProperty("一回库确认员")
+    private String returnConfirmNickname;
+
+    @Schema(description = "二回库确认员")
+    @ExcelProperty("二回库确认员")
+    private String twoReturnConfirmNickname;
+
+    @Schema(description = "回库备注信息")
+    @ExcelProperty("回库备注信息")
+    private String remarks;
+
+    @Schema(description = "回库附件上传", example = "2")
+    @ExcelProperty(value = "回库附件上传")
+    private String sampleStatus;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+}

+ 34 - 33
yudao-module-museums/yudao-module-museums-biz/src/main/java/cn/iocoder/yudao/module/museums/controller/admin/specimenoutbound/vo/SpecimenOutboundRespVO.java

@@ -14,7 +14,7 @@ import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
 public class SpecimenOutboundRespVO {
 
     @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
-    @ExcelProperty("主键")
+    @ExcelProperty("序号")
     private Long id;
 
     @Schema(description = "关联到总表中的标本ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@@ -42,11 +42,11 @@ public class SpecimenOutboundRespVO {
     private String projectName;
 
     @Schema(description = "项目开始时间")
-    @ExcelProperty("项目开始时间")
+    @ExcelProperty("借用开始时间")
     private LocalDateTime startTime;
 
     @Schema(description = "项目结束时间")
-    @ExcelProperty("项目结束时间")
+    @ExcelProperty("借用结束时间")
     private LocalDateTime endTime;
 
     @Schema(description = "出库备注信息")
@@ -62,10 +62,6 @@ public class SpecimenOutboundRespVO {
     @DictFormat(DictTypeConstants.MUSEUMS_APPROAL_STATUS)
     private Integer status;
 
-    @Schema(description = "回库备注信息")
-    @ExcelProperty("回库备注信息")
-    private String remarks;
-
     @Schema(description = "标本情况")
     @ExcelProperty("标本情况")
     private String specimenCondition;
@@ -74,28 +70,37 @@ public class SpecimenOutboundRespVO {
     @ExcelProperty("出库时间")
     private LocalDateTime outgoingTime;
 
-    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("创建时间")
-    private LocalDateTime createTime;
-
-    @Schema(description = "回库附件上传", example = "2")
-    @ExcelProperty(value = "回库附件上传")
-    private String sampleStatus;
+        @Schema(description = "一审批员")
+    @ExcelProperty("一审审批员")
+    private String approveUsers;
 
-    @Schema(description = "一审驳回原因", example = "27504")
-    @ExcelProperty("一审驳回原因")
+    @Schema(description = "一审审批建议", example = "27504")
+    @ExcelProperty("一审审批建议")
     private String processInstanceId;
 
-    @Schema(description = "二审驳回原因", example = "27504")
-    @ExcelProperty("二审驳回原因")
+    @Schema(description = "二审批员")
+    @ExcelProperty("二审批员")
+    private String twoApproveUsers;
+
+
+    @Schema(description = "二审审批建议", example = "27504")
+    @ExcelProperty("二审审批建议")
     private String rejectionReasons;
 
+    @Schema(description = "一审时间")
+    @ExcelProperty("一审时间")
+    private LocalDateTime approvalTime;
+
+    @Schema(description = "二审时间")
+    @ExcelProperty("二审时间")
+    private LocalDateTime twoApprovalTime;
+
     @Schema(description = "出库员")
     @ExcelProperty("出库员")
     private Long operator;
 
-    @Schema(description = "出库确认员B")
-    @ExcelProperty("出库确认员B")
+    @Schema(description = "出库确认员")
+    @ExcelProperty("出库确认员")
     private Long twoOperator;
 
     @Schema(description = "退还人")
@@ -118,21 +123,17 @@ public class SpecimenOutboundRespVO {
     @ExcelProperty("二回库确认员")
     private String twoReturnConfirm;
 
-    @Schema(description = "一审时间")
-    @ExcelProperty("一审时间")
-    private LocalDateTime approvalTime;
-
-    @Schema(description = "二审时间")
-    @ExcelProperty("二审时间")
-    private LocalDateTime twoApprovalTime;
+    @Schema(description = "回库备注信息")
+    @ExcelProperty("回库备注信息")
+    private String remarks;
 
-    @Schema(description = "一审批员")
-    @ExcelProperty("一审批员")
-    private String approveUsers;
+    @Schema(description = "回库附件上传", example = "2")
+    @ExcelProperty(value = "回库附件上传")
+    private String sampleStatus;
 
-    @Schema(description = "二审批员")
-    @ExcelProperty("二审批员")
-    private String twoApproveUsers;
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
 
     private Boolean isFirstOut;
 

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

@@ -448,7 +448,7 @@ public class SpecimenOutboundServiceImpl implements SpecimenOutboundService {
             throw exception(ONLY_OUTBOUND_SPECIMEN_CAN_REJECT_RETURNED);
         }
         //删除第一回库确认员
-        existingSpecimen.setReturnConfirm(0L).setReturnRejectReason(updateReqVO.getReturnRejectReason());
+        existingSpecimen.setReturnConfirm(-0L).setReturnRejectReason(updateReqVO.getReturnRejectReason());
 
         System.out.println(existingSpecimen.getReturnConfirm()+"=============================");
         // 更新数据库