Browse Source

渠道号。。。兼容账户维度自动投放

zhaoxian 4 years ago
parent
commit
4178a81d02

+ 7 - 6
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/controller/KuaishouChannelController.java

@@ -63,11 +63,12 @@ public class KuaishouChannelController {
     private IKuaishouChannelService kuaishouChannelService;
     @Autowired
     private ISysRoleExtService sysRoleService;
+
     /**
      * 查询渠道号管理首页数据
      */
     @GetMapping(value = "/channelManagementHome")
-    public Result<Object> channelManagementHome(Long productId, Long projectId, Long accountId,String userId,
+    public Result<Object> channelManagementHome(Long productId, Long projectId, Long accountId, String userId,
                                                 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
         try {
@@ -77,7 +78,7 @@ public class KuaishouChannelController {
             }
 
             PageHelper.startPage(pageNo, pageSize);
-            return kuaishouChannelService.channelManagementHome(productId, projectId, accountId,userId);
+            return kuaishouChannelService.channelManagementHome(productId, projectId, accountId, userId);
         } catch (Exception e) {
             e.printStackTrace();
             return Result.error("查询渠道号管理首页数据异常");
@@ -273,13 +274,13 @@ public class KuaishouChannelController {
     /**
      * 通过账户查询渠道号级别
      */
-    @GetMapping(value = "/queryChannelLevel")
-    public Result<Object> queryChannelLevel(Long accountId) {
+    @PostMapping(value = "/queryChannelLevel")
+    public Result<Object> queryChannelLevel(@RequestParam JSONObject request) {
         try {
-            if (Check.isNull(accountId)) {
+            if (Check.isNull(request.getLong("accountId")) || Check.isNull(request.getJSONArray("appIdArray"))) {
                 return Result.error("缺失参数");
             }
-            return kuaishouChannelService.queryChannelLevel(accountId);
+            return kuaishouChannelService.queryChannelLevel(request);
         } catch (Exception e) {
             e.printStackTrace();
             log.error("通过账户查询渠道号级别异常", e);

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/mapper/KuaishouChannelMapper.java

@@ -44,5 +44,5 @@ public interface KuaishouChannelMapper extends BaseMapper<KuaishouChannel> {
 
     List<KuaishouChannel> queryChannelByHaveCycleTimes(@Param("haveCycleTimes") Integer haveCycleTimes, @Param("usageLevel") String usageLevel, @Param("strategys") List<KuaishouChannelCreateStrategy> strategys);
 
-    List<JSONObject> queryItemsListByAccountId(@Param("accountId") Long accountId);
+    List<JSONObject> queryItemsListByAccountId(@Param("accountId") Long accountId, @Param("appId") Long appId);
 }

+ 1 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/mapper/xml/KuaishouChannelMapper.xml

@@ -247,6 +247,7 @@
                 INNER JOIN ctop_kuaishou_channel_app_info tt4 ON tt1.app_id = tt4.app_id
         WHERE
             tt1.account_id = #{accountId}
+          AND tt1.app_id = #{appId}
         GROUP BY
             tt2.item_name
     </select>

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/IKuaishouChannelService.java

@@ -32,7 +32,7 @@ public interface IKuaishouChannelService extends IService<KuaishouChannel> {
 
     Result<Object> queryChannel(Long accountId, String usageLevel) throws Exception;
 
-    Result<Object> queryChannelLevel(Long accountId);
+    Result<Object> queryChannelLevel(JSONObject request);
 
     void callBackUpdateChannelRel(String level, String channelCode, Long accoountId, Long planId, Long groupId);
 }

+ 5 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/impl/KuaishouChannelServiceImpl.java

@@ -916,14 +916,17 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
     }
 
     @Override
-    public Result<Object> queryChannelLevel(Long accountId) {
+    public Result<Object> queryChannelLevel(JSONObject data) {
+        Long accountId = data.getLong("accountId");
+        JSONArray appIdArray = data.getJSONArray("appIdArray");
+        Long appId = appIdArray.getLong(0);
         KuaishouChannel channel = channelMapper.queryByAccountId(accountId);
         if (Check.isNull(channel)) {
             return Result.ok("没有渠道号");
         }
         JSONObject request = new JSONObject();
         if (channel.getIsHaveItem() == 1) {
-            List<JSONObject> list = channelMapper.queryItemsListByAccountId(accountId);
+            List<JSONObject> list = channelMapper.queryItemsListByAccountId(accountId,appId);
             request.put("list", list);
         }
         request.put("channel", channel);