Browse Source

新增套系1.2

sjx 2 years ago
parent
commit
bf6153ed7a

+ 2 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PostCollectionsSystemController.java

@@ -1,16 +1,12 @@
 package com.ruoyi.web.controller.system;
 
-import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
-import java.util.stream.Collectors;
 import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.system.domain.vo.CollectionsVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.BeanUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -46,7 +42,7 @@ public class PostCollectionsSystemController extends BaseController
     public TableDataInfo list(PostCollectionsSystem postCollectionsSystem)
     {
         startPage();
-        List<CollectionsVo> list = postCollectionsSystemService.selectPostCollectionsSystemListPage(postCollectionsSystem);
+        List<PostCollectionsSystem> list = postCollectionsSystemService.selectPostCollectionsSystemList(postCollectionsSystem);
         return getDataTable(list);
     }
 
@@ -57,7 +53,7 @@ public class PostCollectionsSystemController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:system:export')")
     @Log(title = "藏品套系", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, PostCollectionsSystem postCollectionsSystem,int type)
+    public void export(HttpServletResponse response, PostCollectionsSystem postCollectionsSystem)
     {
         List<PostCollectionsSystem> list = postCollectionsSystemService.selectPostCollectionsSystemList(postCollectionsSystem);
         ExcelUtil<PostCollectionsSystem> util = new ExcelUtil<PostCollectionsSystem>(PostCollectionsSystem.class);

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PostCollectionsSystemMapper.java

@@ -67,4 +67,7 @@ public interface PostCollectionsSystemMapper
                                                             @Param("timeRight") Date timeRight);
 
     Integer getCopiesById(Long id);
+
+    // 查询该套系名 数量
+    int selectPostCollectionsSystemByName(PostCollectionsSystem postCollectionsSystem);
 }

+ 8 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/IPostCollectionsSystemService.java

@@ -66,8 +66,15 @@ public interface IPostCollectionsSystemService
 
     /**
      *  获取藏品数量
-     * @param postCollections
+     * @param id
      * @return 该套系下藏品数量
      */
     public int getCopies(Long id);
+
+    /**
+     *  用套系名称进行查询
+     * @param postCollectionsSystem
+     */
+    int selectPostCollectionsSystemByName(PostCollectionsSystem postCollectionsSystem);
 }
+

+ 9 - 4
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PostCollectionsSystemServiceImpl.java

@@ -76,9 +76,9 @@ public class PostCollectionsSystemServiceImpl implements IPostCollectionsSystemS
         }
 
         //补充字段
-        postCollectionsSystem.setCreateBy(getUsername());
+        postCollectionsSystem.setCreateUser(getUsername());
         postCollectionsSystem.setCreateTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getTime()));
-        postCollectionsSystem.setUpdateBy(getUsername());
+        postCollectionsSystem.setUpdateUser(getUsername());
         postCollectionsSystem.setUpdateTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getTime()));
         return postCollectionsSystemMapper.insertPostCollectionsSystem(postCollectionsSystem);
     }
@@ -93,7 +93,7 @@ public class PostCollectionsSystemServiceImpl implements IPostCollectionsSystemS
     public int updatePostCollectionsSystem(PostCollectionsSystem postCollectionsSystem)
     {
         //补充字段
-        postCollectionsSystem.setUpdateBy(getUsername());
+        postCollectionsSystem.setUpdateUser(getUsername());
         postCollectionsSystem.setUpdateTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getTime()));
         return postCollectionsSystemMapper.updatePostCollectionsSystem(postCollectionsSystem);
     }
@@ -139,7 +139,6 @@ public class PostCollectionsSystemServiceImpl implements IPostCollectionsSystemS
             }else {
                 //时间为空
                 return postCollectionsSystemMapper.selectPostListByTitleOrTime(title, TimeLeft, TimeRight);
-
             }
         } else {
             //标题为空
@@ -166,4 +165,10 @@ public class PostCollectionsSystemServiceImpl implements IPostCollectionsSystemS
     public int getCopies(Long id) {
         return postCollectionsSystemMapper.getCopiesById(id);
     }
+
+    @Override
+    public int selectPostCollectionsSystemByName(PostCollectionsSystem postCollectionsSystem) {
+        return postCollectionsSystemMapper.selectPostCollectionsSystemByName(postCollectionsSystem);
+    }
+
 }