Ver código fonte

Merge branch 'master' of http://gogs.gisvg.com/lsq/museum-java

# Conflicts:
#	yudao-module-museum/yudao-module-museum-biz/src/main/java/cn/iocoder/yudao/module/museum/controller/admin/museuminfo/MuseumInfoController.java
Crazy 3 meses atrás
pai
commit
0a33cfd29b

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

@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import javax.validation.Valid;
 import javax.validation.Valid;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
 
@@ -47,7 +48,8 @@ public class MuseumInfoController {
     public CommonResult<Boolean> updateMuseumInfo(@RequestBody MuseumInfoSaveVO saveVO){
     public CommonResult<Boolean> updateMuseumInfo(@RequestBody MuseumInfoSaveVO saveVO){
         museumInfoService.updateMuseumInfo(saveVO);
         museumInfoService.updateMuseumInfo(saveVO);
         return CommonResult.success(true);
         return CommonResult.success(true);
-//         saveVO.setSampleType(1);
+
+
     }
     }
 
 
     //TODO 需要提供原因,调用更新方法
     //TODO 需要提供原因,调用更新方法
@@ -55,17 +57,16 @@ public class MuseumInfoController {
     @Operation(summary = "删除标本")
     @Operation(summary = "删除标本")
     public CommonResult<Boolean> deleteMuseumInfo(@RequestParam("id") Integer id,@RequestParam("reason") String reason){
     public CommonResult<Boolean> deleteMuseumInfo(@RequestParam("id") Integer id,@RequestParam("reason") String reason){
         museumInfoService.deleteMuseumInfo(id,reason);
         museumInfoService.deleteMuseumInfo(id,reason);
-
-//        result.put("删除原因:",提取方法…);
+//        result.put("删除原因:",);
         return CommonResult.success(true);
         return CommonResult.success(true);
     }
     }
 
 
 
 
     @GetMapping("/get")
     @GetMapping("/get")
     @Operation(summary = "id查找")
     @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);
+    public CommonResult<MuseumInfoRespVO> selectMuseumInfo(@RequestParam("id") Integer id){
+        MuseumInfoDO result = museumInfoService.selectMuseumInfo(id);
+        MuseumInfoRespVO result1 = BeanUtils.toBean(result,MuseumInfoRespVO.class);
       return CommonResult.success(result1);
       return CommonResult.success(result1);
     }
     }
 
 
@@ -89,13 +90,27 @@ public class MuseumInfoController {
 //            返回某种标本类型的List数组
 //            返回某种标本类型的List数组
 //            Integer
 //            Integer
 //    Map<> 键值对
 //    Map<> 键值对
+    @GetMapping("/sampleTypeCount")
+    @Operation(summary = "标本类型计数")
+    public CommonResult<Map<String,Integer>> getMap(@RequestParam("sampleType") Integer sampleType){
+          Map<String,Integer> result =museumInfoService.MuseumInfoBySampleType(sampleType);
+//          标本类型:矿石-1 岩石-2 矿物-3 陨石-4
+          Integer Type = sampleType;
+          result.put("标本类型:",Type);
+          return CommonResult.success(result);
+    }
+
+    @GetMapping("/saveCount")
+    @Operation(summary = "标本出入库状态计数")
+    public CommonResult<Map<String,Integer>> getSave(@RequestParam("save") Integer save){
+        Map<String,Integer> result =museumInfoService.MuseumInfoBySave(save);
+//        状态:在库-1 出库-0
+        Integer Condition = save;
+        result.put("状态",Condition);
+        return CommonResult.success(result);
+    }
+
 
 
-//    public CommonResult<Map<String,Integer>> getMap(@RequestParam("id") Integer id){
-//          Map<String,Integer> result =new HashMap<>();
-//          Integer Ynmber = null;
-//          result.put("陨石数量",Ynmber);
-//          return CommonResult.success(result);
-//    }
 
 
 //   public CommonResult<MuseumTextRespVO> getdo(@RequestParam("id") Integer id){
 //   public CommonResult<MuseumTextRespVO> getdo(@RequestParam("id") Integer id){
 //          MuseumTextRespVO DO =new MuseumTextRespVO();
 //          MuseumTextRespVO DO =new MuseumTextRespVO();

+ 13 - 1
yudao-module-museum/yudao-module-museum-biz/src/main/java/cn/iocoder/yudao/module/museum/controller/admin/museumpicture/PictureGroupController.java

@@ -1,21 +1,26 @@
 package cn.iocoder.yudao.module.museum.controller.admin.museumpicture;
 package cn.iocoder.yudao.module.museum.controller.admin.museumpicture;
 
 
 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
 import cn.iocoder.yudao.module.museum.controller.admin.museumpicture.vo.PictureGroupRespVO;
 import cn.iocoder.yudao.module.museum.controller.admin.museumpicture.vo.PictureGroupRespVO;
 import cn.iocoder.yudao.module.museum.controller.admin.museumpicture.vo.PictureGroupSaveVO;
 import cn.iocoder.yudao.module.museum.controller.admin.museumpicture.vo.PictureGroupSaveVO;
+import cn.iocoder.yudao.module.museum.controller.admin.museumpicture.vo.PicturePageReqVO;
 import cn.iocoder.yudao.module.museum.dal.database.museumpicture.PictureGroupDO;
 import cn.iocoder.yudao.module.museum.dal.database.museumpicture.PictureGroupDO;
 import cn.iocoder.yudao.module.museum.service.museumpicture.PictureGroupService;
 import cn.iocoder.yudao.module.museum.service.museumpicture.PictureGroupService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 
 
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
 @Tag(name = "博物馆-图片组")
 @Tag(name = "博物馆-图片组")
 @RestController
 @RestController
-@RequestMapping("/museum/picture group")
+@RequestMapping("/museum/pictureGroup")
 @Validated
 @Validated
 
 
 public class PictureGroupController {
 public class PictureGroupController {
@@ -52,4 +57,11 @@ public class PictureGroupController {
     }
     }
     //TODO 需要一个查·
     //TODO 需要一个查·
 
 
+    @GetMapping("/page")
+    @Operation(summary = "获得照片组分页")
+    @PreAuthorize("@ss.hasPermission('system:tenant:query')")
+    public CommonResult<PageResult<PictureGroupRespVO>> getPictureGroupPage(@Validated PicturePageReqVO pageVO) {
+        PageResult<PictureGroupDO> pageResult = PictureGroupService.getPictureGroupPage(pageVO);
+        return success(BeanUtils.toBean(pageResult, PictureGroupRespVO.class));
+    }
 }
 }

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

@@ -13,6 +13,7 @@ import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
 import org.apache.ibatis.annotations.Update;
 
 
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 @Mapper
 @Mapper
 public interface MuseumInfoMapper extends BaseMapperX<MuseumInfoDO> {
 public interface MuseumInfoMapper extends BaseMapperX<MuseumInfoDO> {
@@ -30,21 +31,27 @@ public interface MuseumInfoMapper extends BaseMapperX<MuseumInfoDO> {
      * 查询标本
      * 查询标本
      * */
      * */
     @Select("SELECT * FROM museum_info WHERE id =#{id} AND deleted =0 ")
     @Select("SELECT * FROM museum_info WHERE id =#{id} AND deleted =0 ")
-    List<MuseumInfoDO> selectMuseumInfoById(@Param("id") Integer id);
+    MuseumInfoDO selectMuseumInfoById(@Param("id") Integer id);
     /**
     /**
      * 查询标本编号
      * 查询标本编号
      * */
      * */
-    @Select("SELECT * FROM museum_info WHERE sample_id =#{sampleId} ")
+    @Select("SELECT * FROM museum_info WHERE sample_id =#{sampleId} AND deleted =0")
     MuseumInfoDO getMuseumInfoBySampleId(@Param("sampleId") String sampleId);
     MuseumInfoDO getMuseumInfoBySampleId(@Param("sampleId") String sampleId);
     /**
     /**
      * 查询标本类型
      * 查询标本类型
      */
      */
-    @Select("SELECT * FROM museum_info WHERE sample_type  =#{sampleType}")
+    @Select("SELECT * FROM museum_info WHERE sample_type  =#{sampleType} AND deleted =0")
     List<MuseumInfoDO> selectMuseumInfoListBySampleType(@Param("sampleType") Integer sampleType);
     List<MuseumInfoDO> selectMuseumInfoListBySampleType(@Param("sampleType") Integer sampleType);
-
-//    @Select("SELECT COUNT(*)  FROM museum_info WHERE sample_type  =#{sampleType} ")
-//    Integer countMuseumInfoBySampleType(@Param("sampleType") Integer sampleType);
-
+    /**
+     * 标本类型计数
+     * */
+    @Select("SELECT COUNT(*)  FROM museum_info WHERE sample_type =#{sampleType} AND deleted =0 AND save =1")
+    Map<String,Integer> countMuseumInfoBySampleType(@Param("sampleType") Integer sampleType);
+    /**
+     * 标本出入库状态计数
+     * */
+    @Select("SELECT COUNT(*)  FROM museum_info  WHERE save =#{save} AND deleted =0")
+    Map<String,Integer> countMuseumInfoBySave(@Param("save") Integer save);
 
 
     default PageResult<MuseumInfoDO> selectPage(MuseumInfoPageReqVO pageReqVO) {
     default PageResult<MuseumInfoDO> selectPage(MuseumInfoPageReqVO pageReqVO) {
         LambdaQueryWrapperX<MuseumInfoDO> queryWrapper = new LambdaQueryWrapperX<>();
         LambdaQueryWrapperX<MuseumInfoDO> queryWrapper = new LambdaQueryWrapperX<>();

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

@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 @Service
 @Service
 public interface MuseumInfoService {
 public interface MuseumInfoService {
@@ -28,7 +29,7 @@ public interface MuseumInfoService {
    /**
    /**
     * 查询标本
     * 查询标本
     * */
     * */
-   List<MuseumInfoDO> selectMuseumInfo (Integer id);
+   MuseumInfoDO selectMuseumInfo (Integer id);
 
 
    /**
    /**
     * 查询标本编号
     * 查询标本编号
@@ -45,4 +46,12 @@ public interface MuseumInfoService {
     * @return 分页列表
     * @return 分页列表
     */
     */
     PageResult<MuseumInfoDO> getMuseumInfoPage(MuseumInfoPageReqVO pageReqVO);
     PageResult<MuseumInfoDO> getMuseumInfoPage(MuseumInfoPageReqVO pageReqVO);
+   /**
+    * 标本类型计数
+    * */
+   Map<String,Integer> MuseumInfoBySampleType(Integer sampleType);
+   /**
+    * 标本出入库状态计数
+    * */
+   Map<String,Integer> MuseumInfoBySave(Integer save);
 }
 }

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

@@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.Set;
 
 
 import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.singleton;
 import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.singleton;
@@ -41,8 +42,8 @@ public  class  MuseumInfoServiceImpl implements MuseumInfoService {
     */
     */
    @Override
    @Override
    public void deleteMuseumInfo(Integer id,String reason) {
    public void deleteMuseumInfo(Integer id,String reason) {
-//      museumInfoMapper.deleteMuseumInfo(id);
-      museumInfoMapper.deleteById(id);
+      museumInfoMapper.deleteMuseumInfo(id,reason);
+//      museumInfoMapper.deleteById(id);
    }
    }
    /**
    /**
     * 删除标本
     * 删除标本
@@ -52,7 +53,7 @@ public  class  MuseumInfoServiceImpl implements MuseumInfoService {
     * 查询标本id
     * 查询标本id
     */
     */
    @Override
    @Override
-   public List<MuseumInfoDO> selectMuseumInfo(Integer id) {
+   public MuseumInfoDO selectMuseumInfo(Integer id) {
       return museumInfoMapper.selectMuseumInfoById(id);
       return museumInfoMapper.selectMuseumInfoById(id);
    }
    }
 
 
@@ -77,8 +78,20 @@ public  class  MuseumInfoServiceImpl implements MuseumInfoService {
    public PageResult<MuseumInfoDO> getMuseumInfoPage(MuseumInfoPageReqVO pageReqVO){
    public PageResult<MuseumInfoDO> getMuseumInfoPage(MuseumInfoPageReqVO pageReqVO){
       return museumInfoMapper.selectPage(pageReqVO);
       return museumInfoMapper.selectPage(pageReqVO);
    }
    }
-
-
+   /**
+    * 标本类型计数
+    * */
+   @Override
+   public Map<String,Integer> MuseumInfoBySampleType(Integer sampleType){
+      return museumInfoMapper.countMuseumInfoBySampleType(sampleType);
+   }
+   /**
+    * 标本出入库状态计数
+    * */
+   @Override
+   public Map<String,Integer> MuseumInfoBySave(Integer save) {
+      return museumInfoMapper.countMuseumInfoBySave(save);
+   }
 }
 }
 
 
 
 

+ 3 - 0
yudao-module-museum/yudao-module-museum-biz/src/main/java/cn/iocoder/yudao/module/museum/service/museumpicture/PictureGroupService.java

@@ -1,6 +1,8 @@
 package cn.iocoder.yudao.module.museum.service.museumpicture;
 package cn.iocoder.yudao.module.museum.service.museumpicture;
 
 
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.module.museum.controller.admin.museumpicture.vo.PictureGroupSaveVO;
 import cn.iocoder.yudao.module.museum.controller.admin.museumpicture.vo.PictureGroupSaveVO;
+import cn.iocoder.yudao.module.museum.controller.admin.museumpicture.vo.PicturePageReqVO;
 import cn.iocoder.yudao.module.museum.dal.database.museumpicture.PictureGroupDO;
 import cn.iocoder.yudao.module.museum.dal.database.museumpicture.PictureGroupDO;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -23,4 +25,5 @@ public interface PictureGroupService {
      * */
      * */
     PictureGroupDO selectPictureGroup(Integer id);
     PictureGroupDO selectPictureGroup(Integer id);
 
 
+    PageResult<PictureGroupDO> getPictureGroupPage(PicturePageReqVO pageVO);
 }
 }