Browse Source

更新新增标本编号不能重复功能,更新标本类型查找,将id查找变成list形式,增加删除原因

lwh 2 months ago
parent
commit
d42d564412

+ 1 - 1
yudao-module-museum/yudao-module-museum-biz/src/main/java/cn/iocoder/yudao/module/museum/controller/admin/museumflow/MuseumFlowController.java

@@ -60,7 +60,7 @@ public class MuseumFlowController {
         if(result == null){
             return CommonResult.error(200,"样品不存在");
         }
-        int condition=result.getCondition();
+        int condition=result.getSave();
         //      0现为已出库,1为未出库或已回库,2为审批中,3为审批通过
         if(condition == 0){
             return CommonResult.error(200,"样品不在库中");

+ 14 - 49
yudao-module-museum/yudao-module-museum-biz/src/main/java/cn/iocoder/yudao/module/museum/controller/admin/museuminfo/MuseumInfoController.java

@@ -54,72 +54,37 @@ public class MuseumInfoController {
     //TODO 需要提供原因,调用更新方法
     @DeleteMapping("/delete")
     @Operation(summary = "删除标本")
-    public CommonResult<Boolean> deleteMuseumInfo(@RequestParam("id") Integer id){
-        museumInfoService.deleteMuseumInfo(id);
+    public CommonResult<Boolean> deleteMuseumInfo(@RequestParam("id") Integer id,@RequestParam("reason") String reason){
+        museumInfoService.deleteMuseumInfo(id,reason);
+
+//        result.put("删除原因:",提取方法…);
         return CommonResult.success(true);
     }
-    //    @DeleteMapping("/delete")
-//    @Operation(summary = "删除")
-//    public CommonResult<Boolean> deleteMuseumText(@RequestParam("id") Integer id ){
-//        MuseumTextSaveVO saveVO =new MuseumTextSaveVO();
-////        saveVO.setId();
-////        saveVO.set()
-////        museumTextService.updateMuseumText(saveVO);
-//
-//        museumTextService.deleteMuseumText(id);
-//        return CommonResult.success(true);
 
 
     @GetMapping("/get")
-    @Operation(summary = "查找标本")
-    public CommonResult<MuseumInfoRespVO> selectMuseumInfo(@RequestParam("id") Integer id){
-        MuseumInfoDO result = museumInfoService.selectMuseumInfo(id);
-        MuseumInfoRespVO result1 = BeanUtils.toBean(result,MuseumInfoRespVO.class);
+    @Operation(summary = "id查找")
+    public CommonResult<List<MuseumInfoRespVO>> selectMuseumInfo(@RequestParam("id") Integer id){
+        List<MuseumInfoDO> result = museumInfoService.selectMuseumInfo(id);
+        List<MuseumInfoRespVO> result1 = BeanUtils.toBean(result,MuseumInfoRespVO.class);
       return CommonResult.success(result1);
     }
 
     @GetMapping("/selectMuseumInfoList")
-    @Operation(summary = "查询SampleTypeList")
-    public CommonResult<List<MuseumInfoDO>> getMuseumInfoList(@RequestParam("sampleType") Integer sampleType){
+    @Operation(summary = "标本类型查找")
+    public CommonResult<List<MuseumInfoRespVO>> getMuseumInfoList(@RequestParam("sampleType") Integer sampleType){
         List<MuseumInfoDO> result = museumInfoService.selectMuseumInfoListBySampleType(sampleType);
-        return CommonResult.success(result);
+        List<MuseumInfoRespVO> result1 = BeanUtils.toBean(result,MuseumInfoRespVO.class);
+        return CommonResult.success(result1);
     }
 
     @GetMapping("/page")
     @Operation(summary = "获取分页")
-    @PreAuthorize("@ss.hasPermission('museum:museuminfo:query')")
-    public CommonResult<PageResult<MuseumInfoRespVO>> getMuseumInfoPage(@Valid MuseumInfoPageReqVO pageVO){
-        PageResult<MuseumInfoDO> pageResult = museumInfoService.getMuseumInfoPage(pageVO);
-        return success(BeanUtils.toBean(pageResult, MuseumInfoRespVO.class));
+    public PageResult<MuseumInfoDO> getMuseumInfoPage(@Valid MuseumInfoPageReqVO pageReqVO){
+        return  museumInfoService.getMuseumInfoPage(pageReqVO);
     }
 
 
-
-
-
-
-//    @GetMapping("/get")
-//    @Operation(summary = "list数组")
-//   public CommonResult<MuseumInfoRespVO> getdo(@RequestParam("sampleType") Integer sampleType){
-//          MuseumInfoRespVO list =new MuseumInfoRespVO();
-//          Integer Ynmber =  selectMuseumInfoBySampleType(1)
-//          Integer  hs =  selectMuseumInfoBySampleType(2)
-
-//          DO.setYnmber(Ynmber);
-
-
-//    public CommonResult<MuseumInfoRespVO> getMuseumInfo(@RequestParam("sampleId") String sampleId){
-//
-//    }
-
-
-    //@GetMapping("/get")
-//    @Operation(summary = "查询")
-//    public CommonResult<List<MuseumTextRespVO>> getMuseumText(@RequestParam("id") Integer id){
-//
-//    }
-
-//    1.
     //TODO LIST Map
 //    TODO     1.2.3.代表哪种标本类型
 //            返回某种标本类型的List数组

+ 4 - 0
yudao-module-museum/yudao-module-museum-biz/src/main/java/cn/iocoder/yudao/module/museum/controller/admin/museuminfo/vo/MuseumInfoPageReqVO.java

@@ -14,13 +14,17 @@ import java.time.LocalDateTime;
 @EqualsAndHashCode(callSuper = true)
 @ToString(callSuper = true)
 public class MuseumInfoPageReqVO extends PageParam {
+
+    @Schema(description = "标本id")
     private Integer id;
 
     @Schema(description = "标本编号")
     private String sampleId;
 
+    @Schema(description = "标本类型")
     private Integer sampleType;
 
+    @Schema(description = "存放位置")
     private String place;
     
 }

+ 33 - 12
yudao-module-museum/yudao-module-museum-biz/src/main/java/cn/iocoder/yudao/module/museum/controller/admin/museuminfo/vo/MuseumInfoRespVO.java

@@ -10,56 +10,77 @@ import java.time.LocalDateTime;
 @Data
 @ExcelIgnoreUnannotated
 public class MuseumInfoRespVO {
+//private Integer Ynumber;
 
-    //    private Integer Ynumber;
+    @Schema(description = "标本id")
     private Integer id;
 
     @Schema(description = "标本编号")
     private String sampleId;
 
+    @Schema(description = "标本类型")
     private Integer sampleType;
 
+    @Schema(description = "存放位置")
     private String place;
 
+    @Schema(description = "中文名称")
     private String chineseName;
 
+    @Schema(description = "英文名称")
     private String englishName;
 
+    @Schema(description = "国际名称")
     private String internationName;
 
+    @Schema(description = "保存类型")
     private Integer keepType;
 
+    @Schema(description = "成份")
     private String element;
 
+    @Schema(description = "产地")
     private String  local;
 
+    @Schema(description = "时代")
     private LocalDateTime bronTime ;
 
+    @Schema(description = "保存地层")
     private String stratum;
 
+    @Schema(description = "发现时间")
     private LocalDateTime findTime;
 
+    @Schema(description = "尺寸")
     private String size;
 
+    @Schema(description = "重量")
     private Long weight;
 
+    @Schema(description = "来源")
     private String origin;
 
-    private String offerMan;
-
+    @Schema(description = "描述")
     private String character;
 
-//    private Integer condition;
+    @Schema(description = "馆藏状态")
+    private Integer save;
+
+    @Schema(description = "入馆时间")
+    private String saveTime;
+
+    @Schema(description = "用途")
+    private String Use;
 
-//    private String joinTime;
+    @Schema(description = "资产号")
+    private String fundId;
 
-//    private String useWay;
+    @Schema(description = "删除原因")
+    private String reason;
 
-//    private String moneyId;
+    @Schema(description = "标本图片")
+    private String picture;
 
-//    private String deleteReason;
-//
-//    private String samplePicture;
-//
-//    private String tip;
+    @Schema(description = "备注")
+    private String sampleTip;
 }

+ 36 - 15
yudao-module-museum/yudao-module-museum-biz/src/main/java/cn/iocoder/yudao/module/museum/controller/admin/museuminfo/vo/MuseumInfoSaveVO.java

@@ -9,54 +9,75 @@ import java.time.LocalDateTime;
 @Data
 public class MuseumInfoSaveVO {
 
+    @Schema(description = "标本id")
     private Integer id;
 
     @Schema(description = "标本编号")
     private String sampleId;
 
+    @Schema(description = "标本类型")
     private Integer sampleType;
 
+    @Schema(description = "存放位置")
     private String place;
 
+    @Schema(description = "中文名称")
     private String chineseName;
 
+    @Schema(description = "英文名称")
     private String englishName;
 
+    @Schema(description = "国际名称")
     private String internationName;
 
+    @Schema(description = "保存类型")
     private Integer keepType;
 
+    @Schema(description = "成份")
     private String element;
 
+    @Schema(description = "产地")
     private String  local;
 
+    @Schema(description = "时代")
     private LocalDateTime bronTime ;
 
+    @Schema(description = "保存地层")
     private String stratum;
 
+    @Schema(description = "发现时间")
     private LocalDateTime findTime;
 
+    @Schema(description = "尺寸")
     private String size;
 
+    @Schema(description = "重量")
     private Long weight;
 
+    @Schema(description = "来源")
     private String origin;
 
-    private String offerMan;
-
+    @Schema(description = "描述")
     private String character;
 
-//    private Integer condition;
-//
-//    private String joinTime;
-//
-//    private String useWay;
-//
-//    private String moneyId;
-//
-//    private String deleteReason;
-//
-//    private String samplePicture;
-//
-//    private String tip;
+    @Schema(description = "馆藏状态")
+    private Integer save;
+
+    @Schema(description = "入馆时间")
+    private String saveTime;
+
+    @Schema(description = "用途")
+    private String Use;
+
+    @Schema(description = "资产号")
+    private String fundId;
+
+    @Schema(description = "删除原因")
+    private String reason;
+
+    @Schema(description = "标本图片")
+    private String picture;
+
+    @Schema(description = "备注")
+    private String sampleTip;
 }

+ 53 - 29
yudao-module-museum/yudao-module-museum-biz/src/main/java/cn/iocoder/yudao/module/museum/dal/database/museuminfo/MuseumInfoDO.java

@@ -85,10 +85,6 @@ public class MuseumInfoDO extends BaseDO {
      * 来源
      */
     private String origin;
-    /**
-     * 标本提供者
-     */
-    private String offerMan;
     /**
      * 描述
      */
@@ -96,30 +92,58 @@ public class MuseumInfoDO extends BaseDO {
     /**
      * 馆藏状态
      */
-//    private Integer condition;
-//    /**
-//     * 入藏时间
-//     */
-//    private String joinTime;
-//    /**
-//     * 用途
-//     */
-//    private String useWay;
-//    /**
-//     * 资产号
-//     */
-//    private String moneyId;
-//    /**
-//     * 删除原因
-//     */
-//    private String deleteReason;
-//    /**
-//     * 标本图片
-//     */
-//    private String samplePicture;
-//    /**
-//     * 备注
-//     */
-//    private String tip;
+    private Integer save;
+    /**
+     * 入藏时间
+     */
+    private String saveTime;
+    /**
+     * 用途
+     */
+    private String Use;
+    /**
+     * 资产号
+     */
+    private String fundId;
+    /**
+     * 删除原因
+     */
+    private String reason;
+    /**
+     * 标本图片
+     */
+    private String picture;
+    /**
+     * 备注
+     */
+    private String sampleTip;
 
 }
+///**
+// * 馆藏状态
+// */
+//private Integer condition;
+///**
+// * 入藏时间
+// */
+//private String joinTime;
+///**
+// * 用途
+// */
+//private String useWay;
+///**
+// * 资产号
+// */
+//private String moneyId;
+///**
+// * 删除原因
+// */
+//private String deleteReason;
+///**
+// * 标本图片
+// */
+//private String samplePicture;
+///**
+// * 备注
+// */
+//private String tip;

+ 27 - 15
yudao-module-museum/yudao-module-museum-biz/src/main/java/cn/iocoder/yudao/module/museum/dal/mysql/museuminfo/MuseumInfoMapper.java

@@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.iocoder.yudao.module.museum.controller.admin.museuminfo.vo.MuseumInfoPageReqVO;
+import cn.iocoder.yudao.module.museum.dal.database.museumflow.MuseumFlowDO;
 import cn.iocoder.yudao.module.museum.dal.database.museuminfo.MuseumInfoDO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
@@ -15,19 +16,29 @@ import java.util.List;
 
 @Mapper
 public interface MuseumInfoMapper extends BaseMapperX<MuseumInfoDO> {
-
+    /**
+     * 更新标本
+     * */
     @Update("UPDATE museum_info SET sample_type=#{sampleType}, place=#{place},chinese_name=#{chineseName} WHERE id =#{id}")
     void updateMuseumInfo(MuseumInfoDO museumInfoDO);
-
-    @Update("UPDATE museum_info SET deleted=1  WHERE id =#{id}")
-    void deleteMuseumInfo(Integer id);
-
+    /**
+     * 删除标本
+     * */
+    @Update("UPDATE museum_info SET deleted=1,reason=#{reason}  WHERE id =#{id}")
+    void deleteMuseumInfo(Integer id,String reason);
+    /**
+     * 查询标本
+     * */
     @Select("SELECT * FROM museum_info WHERE id =#{id} AND deleted =0 ")
-    MuseumInfoDO selectMuseumInfoById(@Param("id") Integer id);
-
+    List<MuseumInfoDO> selectMuseumInfoById(@Param("id") Integer id);
+    /**
+     * 查询标本编号
+     * */
     @Select("SELECT * FROM museum_info WHERE sample_id =#{sampleId} ")
     MuseumInfoDO getMuseumInfoBySampleId(@Param("sampleId") String sampleId);
-
+    /**
+     * 查询标本类型
+     */
     @Select("SELECT * FROM museum_info WHERE sample_type  =#{sampleType}")
     List<MuseumInfoDO> selectMuseumInfoListBySampleType(@Param("sampleType") Integer sampleType);
 
@@ -35,13 +46,14 @@ public interface MuseumInfoMapper extends BaseMapperX<MuseumInfoDO> {
 //    Integer countMuseumInfoBySampleType(@Param("sampleType") Integer sampleType);
 
 
-    default PageResult<MuseumInfoDO> selectPage(MuseumInfoPageReqVO reqVO) {
-        return selectPage(reqVO, new LambdaQueryWrapperX<MuseumInfoDO>())
-//                .likeIfPresent(MuseumInfoDO::getSampleId,reqVO.getSampleId())
-//                .eqIfPresent(MuseumInfoDO::getSampleType,reqVO.getSampleType())
-//                .likeIfPresent(MuseumInfoDO::getPlace,reqVO.getPlace())
-//                .orderByDesc(reqVO.getId() != null,MuseumInfoDO::getId));
-                ;}
+    default PageResult<MuseumInfoDO> selectPage(MuseumInfoPageReqVO pageReqVO) {
+        LambdaQueryWrapperX<MuseumInfoDO> queryWrapper = new LambdaQueryWrapperX<>();
+        queryWrapper.likeIfPresent(MuseumInfoDO::getSampleId, pageReqVO.getSampleId())
+                .eqIfPresent(MuseumInfoDO::getSampleType, pageReqVO.getSampleType())
+                .likeIfPresent(MuseumInfoDO::getPlace, pageReqVO.getPlace())
+                .orderByDesc(MuseumInfoDO::getId);
+        return selectPage(pageReqVO, queryWrapper);
+    }
 
 //    default PageResult<MuseumInfoDO> selectPage1(MuseumInfoPageReqVO reqVO) {
 //        return selectPage(reqVO, new LambdaQueryWrapperX<MuseumInfoDO>()

+ 6 - 6
yudao-module-museum/yudao-module-museum-biz/src/main/java/cn/iocoder/yudao/module/museum/service/museuminfo/MuseumInfoService.java

@@ -22,27 +22,27 @@ public interface MuseumInfoService {
    void updateMuseumInfo(MuseumInfoSaveVO saveVO);
 
    /**
-    * 删除标本
+    * 删除标本(原因)
     * */
-   void deleteMuseumInfo(Integer id);
+   void deleteMuseumInfo(Integer id,String reason);
    /**
     * 查询标本
     * */
-   MuseumInfoDO selectMuseumInfo (Integer id);
+   List<MuseumInfoDO> selectMuseumInfo (Integer id);
 
    /**
     * 查询标本编号
     * */
    MuseumInfoDO getMuseumInfoBySampleId(String sampleId);
    /**
-   * 查询标本类型List
+   * 查询标本类型
    * */
    List<MuseumInfoDO> selectMuseumInfoListBySampleType(Integer sampleType);
     /**
     * 分页列表
     *
-    * @param pageVO 分页条件
+    * @param pageReqVO 分页条件
     * @return 分页列表
     */
-   PageResult<MuseumInfoDO> getMuseumInfoPage(MuseumInfoPageReqVO pageVO);
+    PageResult<MuseumInfoDO> getMuseumInfoPage(MuseumInfoPageReqVO pageReqVO);
 }

+ 9 - 8
yudao-module-museum/yudao-module-museum-biz/src/main/java/cn/iocoder/yudao/module/museum/service/museuminfo/MuseumInfoServiceImpl.java

@@ -40,28 +40,31 @@ public  class  MuseumInfoServiceImpl implements MuseumInfoService {
     * 删除标本
     */
    @Override
-   public void deleteMuseumInfo(Integer id) {
+   public void deleteMuseumInfo(Integer id,String reason) {
 //      museumInfoMapper.deleteMuseumInfo(id);
       museumInfoMapper.deleteById(id);
    }
+   /**
+    * 删除标本
+    */
 
    /**
     * 查询标本id
     */
    @Override
-   public MuseumInfoDO selectMuseumInfo(Integer id) {
+   public List<MuseumInfoDO> selectMuseumInfo(Integer id) {
       return museumInfoMapper.selectMuseumInfoById(id);
    }
 
    /**
-    * 查询标本SampleId
+    * 查询标本编号
     */
    @Override
    public MuseumInfoDO getMuseumInfoBySampleId (String sampleId) {
       return museumInfoMapper.getMuseumInfoBySampleId(sampleId);
    }
    /**
-    * 查询SampleTypeList
+    * 查询标本类型
     */
    @Override
    public List<MuseumInfoDO> selectMuseumInfoListBySampleType(Integer sampleType){
@@ -71,10 +74,8 @@ public  class  MuseumInfoServiceImpl implements MuseumInfoService {
    * 分页列表
     */
    @Override
-   public PageResult<MuseumInfoDO> getMuseumInfoPage(MuseumInfoPageReqVO reqVO){
-//      Set<Long> ids = reqVO.getId() != null ?
-//              permissionService.getUserRoleIdListByRoleId(singleton(reqVO.getRoleId())) : null;
-      return museumInfoMapper.selectPage(reqVO);
+   public PageResult<MuseumInfoDO> getMuseumInfoPage(MuseumInfoPageReqVO pageReqVO){
+      return museumInfoMapper.selectPage(pageReqVO);
    }