Ver Fonte

渠道号功能

zhaoxian há 3 anos atrás
pai
commit
9fc09ff554

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

@@ -2,6 +2,7 @@ package cn.com.ctop.kuaishou.modules.channel.service.impl;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.Product;
+import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.ProductMapper;
 import cn.com.ctop.common.module.mapper.ProjectMapper;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
@@ -851,10 +852,6 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
                 if (Check.isNull(isCycleTimes)) {
                     return Result.error("解析数据失败,文档中第" + (i + 1) + "行,是否循环列缺失数据");
                 }
-                String cycleTimes = eeu.getCellValue(row.getCell(17));
-                if (Check.isNull(cycleTimes)) {
-                    return Result.error("解析数据失败,文档中第" + (i + 1) + "行,循环次数列缺失数据");
-                }
                 //调起链接
                 String schemaUri = eeu.getCellValue(row.getCell(18));
                 //第三方actionBar监测链接
@@ -877,7 +874,6 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
                 obj.put("itemName", itemName);
                 obj.put("usageLevel", usageLevel.toLowerCase());
                 obj.put("isCycle", isCycleTimes);
-                obj.put("cycleTimes", cycleTimes);
                 obj.put("schemaUri", schemaUri);
                 obj.put("actionbarClickUrl", actionbarClickUrl);
                 obj.put("md5", md5);
@@ -909,6 +905,13 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
         try {
             KuaishouChannelCreateStrategy strategy = JSONObject.parseObject(request.toJSONString(), KuaishouChannelCreateStrategy.class);
             if (!Check.isNull(strategy)) {
+                QueryWrapper<UserAllocation> usqueryWrapper = new QueryWrapper<>();
+                usqueryWrapper.eq("account_id", strategy.getAccountId());
+                usqueryWrapper.eq("project_id", strategy.getProjectId());
+                UserAllocation userAllocation = userAllocationService.getOne(usqueryWrapper);
+                if (Check.isNull(userAllocation)) {
+                    return Result.error("账户和项目不匹配");
+                }
                 JSONObject obj = projectMapper.getProduct(strategy.getAccountId(), strategy.getProjectId());
                 if (!Check.isNull(obj)) {
                     strategy.setProjectId(obj.getLong("projectId"));
@@ -926,7 +929,7 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
                 KuaishouChannelCreateStrategy one = channelCreateStrategyService.getOne(queryWrapper);
                 if (!Check.isNull(one)) {
                     if (!one.getUsageLevel().equals(strategy.getUsageLevel())) {
-                        return Result.error("创建失败,使用层级字段与原有策略不一致");
+                        return Result.error("创建失败,使用层级字段与原有策略不一致");
                     }
                     //验证渠道号命名唯一
                     if (!checkChannelCode(strategy)) {