Browse Source

将获取渠道商家库列表从GET改为POST

云殇忆 1 year ago
parent
commit
157b6239b8

+ 2 - 2
ruoyi-demo/src/main/java/com/ruoyi/demo/controller/WdInfoController.java

@@ -64,8 +64,8 @@ public class WdInfoController {
      * @param bo
      * @return
      */
-    @GetMapping("/channelList")
-    public R channelList(ChannelBo bo){
+    @PostMapping("/channelList")
+    public R channelList(@RequestBody ChannelBo bo){
         return R.ok(wdInfoService.searchChannel(bo));
     }
 }

+ 4 - 3
ruoyi-demo/src/main/java/com/ruoyi/demo/entity/bo/ChannelBo.java

@@ -3,13 +3,14 @@ package com.ruoyi.demo.entity.bo;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 @Data
 public class ChannelBo {
     int pageSize = 10;
     int pageNum = 1;
     private String text;
-    private String[] typeCodeBys;
-    private String[] addrCodes;
-    private BigDecimal[] indexScore;
+    private List<String> typeCodeBys;
+    private List<String> addrCodes;
+    private List<BigDecimal> indexScore;
 }

+ 5 - 5
ruoyi-demo/src/main/java/com/ruoyi/demo/service/impl/WdInfoServiceImpl.java

@@ -162,7 +162,7 @@ public class WdInfoServiceImpl implements WdInfoService {
         // 网点分类(犇云)
         List<String> types = new ArrayList<>();
         if (bo.getTypeCodeBys() != null)
-            if (bo.getTypeCodeBys().length > 0) {
+            if (bo.getTypeCodeBys().size() > 0) {
                 for (String type : bo.getTypeCodeBys())
                     types.addAll(categoryUtil.getAllOtherTypeBy(type));
             } else
@@ -174,7 +174,7 @@ public class WdInfoServiceImpl implements WdInfoService {
         // 地区码
         List<String> addrs = new ArrayList<>();
         if (bo.getAddrCodes() != null)
-            if (bo.getAddrCodes().length > 0) {
+            if (bo.getAddrCodes().size() > 0) {
                 for (String addr : bo.getAddrCodes())
                     addrs.addAll(categoryUtil.getAllOtherAddrCode(addr));
             } else
@@ -185,9 +185,9 @@ public class WdInfoServiceImpl implements WdInfoService {
 
         // 潜力值
         if (bo.getIndexScore() != null)
-            if (bo.getIndexScore().length == 2)
-                wdInfoQueryWrapper.ge("index_score", bo.getIndexScore()[0])
-                    .le("index_score", bo.getIndexScore()[1]);
+            if (bo.getIndexScore().size() == 2)
+                wdInfoQueryWrapper.ge("index_score", bo.getIndexScore().get(0))
+                    .le("index_score", bo.getIndexScore().get(1));
 
         Page<WdInfo> page = new Page<>(bo.getPageNum(), bo.getPageSize());
         return wdInfoMapper.selectChannel(page, wdInfoQueryWrapper);