Selaa lähdekoodia

渠道号功能

zhaoxian 3 vuotta sitten
vanhempi
commit
42131bb5a4
15 muutettua tiedostoa jossa 739 lisäystä ja 483 poistoa
  1. 2 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/AiKuaishouUnitLevelOperationRecordMapper.java
  2. 5 5
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAccountAutoDoServiceImpl.java
  3. 75 32
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/controller/KuaishouChannelController.java
  4. 16 13
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/entity/KuaishouChannel.java
  5. 11 8
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/entity/KuaishouChannelCreateStrategy.java
  6. 97 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/entity/KuaishouChannelUpdateRecord.java
  7. 4 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/mapper/KuaishouChannelMapper.java
  8. 15 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/mapper/KuaishouChannelUpdateRecordMapper.java
  9. 47 66
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/mapper/xml/KuaishouChannelMapper.xml
  10. 5 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/mapper/xml/KuaishouChannelUpdateRecordMapper.xml
  11. 2 3
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/IKuaishouChannelService.java
  12. 15 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/IKuaishouChannelUpdateRecordService.java
  13. 425 352
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/impl/KuaishouChannelServiceImpl.java
  14. 19 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/impl/KuaishouChannelUpdateRecordServiceImpl.java
  15. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouAudienceReportDailyService.java

+ 2 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/AiKuaishouUnitLevelOperationRecordMapper.java

@@ -2,6 +2,7 @@ package cn.com.ctop.kuaishou.modules.ai.mapper;
 
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouUnitLevelOperationRecord;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.Date;
 import java.util.List;
@@ -15,5 +16,5 @@ import java.util.List;
 public interface AiKuaishouUnitLevelOperationRecordMapper extends BaseMapper<AiKuaishouUnitLevelOperationRecord> {
     List<AiKuaishouUnitLevelOperationRecord> selectAllByAccountId(Date startDate, Date endDate);
     List<Long> selectAllAccountIds(Date startDate, Date endDate);
-    List<AiKuaishouUnitLevelOperationRecord> selectAllByAccountIdAndDate(Long accountId, Date startDate, Date endDate);
+    List<AiKuaishouUnitLevelOperationRecord> selectAllByAccountIdAndDate(@Param("accountId") Long accountId, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
 }

+ 5 - 5
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAccountAutoDoServiceImpl.java

@@ -144,17 +144,17 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
             //1上新
             unitNum = this.autoCreateCreative(strategy, 1, unitNum);
         }
-        if (unitNum >= 1 && strategy.getSourceMaterial().contains("3")) {
+        if (unitNum >= 1 && "3".contains(strategy.getSourceMaterial())) {
             log.info("{}自定义组创建不足,剩余需要创建个数{},使用高质量素材创建", strategy.getAccountId(), unitNum);
             //3历史遗漏
             unitNum = this.autoCreateCreative(strategy, 3, unitNum);
         }
-        if (unitNum >= 1 && strategy.getSourceMaterial().contains("2")) {
+        if (unitNum >= 1 && "2".contains(strategy.getSourceMaterial())) {
             log.info("{}自定义组创建不足,剩余需要创建个数{},使用高质量素材创建", strategy.getAccountId(), unitNum);
             //2高质量素材
             unitNum = this.autoCreateCreative(strategy, 2, unitNum);
         }
-        if (unitNum >= 1 && strategy.getSourceMaterial().contains("4")) {
+        if (unitNum >= 1 && "4".contains(strategy.getSourceMaterial())) {
             //4历史打捞素材
             log.info("{}自定义组创建不足,剩余需要创建个数{},使用历史打捞素材创建", strategy.getAccountId(), unitNum);
             this.autoCreateCreative(strategy, 4, unitNum);
@@ -482,7 +482,7 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
             //1上新
             unitNum = this.autoCreateProgramCreative(strategy, 1, unitNum);
         }
-        if (unitNum >= 1 && strategy.getSourceMaterial().contains("2")) {
+        if (unitNum >= 1 && "2".contains(strategy.getSourceMaterial())) {
             log.info("{}程序化组创建不足,剩余需要创建个数{},使用高质量素材创建", strategy.getAccountId(), unitNum);
             //2高质量素材
             unitNum = this.autoCreateProgramCreative(strategy, 2, unitNum);
@@ -2317,7 +2317,7 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
 
 
     /**
-     * 组创建是否超限
+     * 组 创建是否超限
      */
     @Override
     public Boolean getUnitOverrun(Long accountId) {

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

@@ -68,17 +68,17 @@ public class KuaishouChannelController {
      * 查询渠道号管理首页数据
      */
     @GetMapping(value = "/channelManagementHome")
-    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) {
+    public Result<Object> channelManagementHome(KuaishouChannel kuaishouChannel, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
         try {
-            String roleCode = sysRoleService.getRoleCodeByUserId(userId);
-            if ("admin".equals(roleCode) || "sale".contains(roleCode) || "meidaManager".equals(roleCode)) {
-                userId = null;
+            String roleCode = sysRoleService.getRoleCodeByUserId(kuaishouChannel.getUserId());
+            if (Check.isNull(roleCode)) {
+                return Result.error("缺失 人员信息");
+            }
+            if ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
+                kuaishouChannel.setUserId(null);
             }
-
             PageHelper.startPage(pageNo, pageSize);
-            return kuaishouChannelService.channelManagementHome(productId, projectId, accountId, userId);
+            return kuaishouChannelService.channelManagementHome(kuaishouChannel);
         } catch (Exception e) {
             e.printStackTrace();
             return Result.error("查询渠道号管理首页数据异常");
@@ -92,10 +92,14 @@ public class KuaishouChannelController {
     @GetMapping(value = "/channelNumberDetails")
     public Result<Object> channelNumberDetails(KuaishouChannel kuaishouChannel, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
         try {
-            if (Check.isNull(kuaishouChannel.getAccountId()) && Check.isNull(kuaishouChannel.getProjectId())) {
+            if (Check.isNull(kuaishouChannel.getAccountId())) {
                 return Result.error("请选择账户");
             }
             return kuaishouChannelService.channelNumberDetails(kuaishouChannel, pageNo, pageSize);
+
+
+
+
         } catch (Exception e) {
             e.printStackTrace();
             return Result.error("查询渠道号详情异常");
@@ -139,10 +143,10 @@ public class KuaishouChannelController {
 
 
     /**
-     * 修改渠道号
+     * 修改渠道号状态
      */
-    @GetMapping(value = "/updateChannel")
-    public Result<Object> updateChannel(KuaishouChannel channel) {
+    @GetMapping(value = "/updateChannelState")
+    public Result<Object> updateChannelState(KuaishouChannel channel) {
         try {
             if (Check.isNull(channel.getId())) {
                 return Result.error("缺失参数");
@@ -161,6 +165,41 @@ public class KuaishouChannelController {
     }
 
     /**
+     * 修改首页账户渠道号状态
+     */
+    @GetMapping(value = "/updateAccountChannelState")
+    public Result<Object> updateAccountChannelState(KuaishouChannel channel) {
+        try {
+            if (Check.isNull(channel.getAccountId())) {
+                return Result.error("缺失参数");
+            }
+            QueryWrapper<KuaishouChannel> wrapper = new QueryWrapper<>();
+            wrapper.eq("account_id", channel.getAccountId());
+            kuaishouChannelService.update(channel, wrapper);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("修改渠道号异常");
+        }
+        return Result.ok("修改成功");
+    }
+
+    /**
+     * 修改渠道号
+     */
+    @GetMapping(value = "/updateChannels")
+    public Result<Object> updateChannels(KuaishouChannel channel) {
+        try {
+            if (Check.isNull(channel.getAccountId())||Check.isNull(channel.getUserId())) {
+                return Result.error("缺失参数");
+            }
+            return kuaishouChannelService.updateChannels(channel);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("修改渠道号异常");
+        }
+    }
+
+    /**
      * 导出单品模板
      */
     @GetMapping("/exportChannelTemplate")
@@ -172,28 +211,46 @@ public class KuaishouChannelController {
             OutputStream os = response.getOutputStream();
             ExportExcelUtils eeu = new ExportExcelUtils();
             XSSFWorkbook workbook = new XSSFWorkbook();
-            String[] titles = {"产品(固定项,勿修改)", "项目(固定项,勿修改)", "使用范围(1代表账户,2代表项目)", "账户ID(和项目对应)", "渠道号创建人(固定项,勿修改)", "渠道号(如:数字加字母)", "渠道号名称", "下载链接", "应用包名", "应用名称", "应用标记", "隐私政策链接"
-                    , "第三方点击监测链接", "是否关联单品(0代表不关联,1代表关联)", "关联单品名称", "使用层级(账户:account,计划:plan,组:group)", "是否循环(0代表不循环,1代表循环)", "循环次数", "调起链接(选填)", "第三方actionBar监测链接(选填)"};
+            String[] titles = {
+                    "产品(固定项,勿修改)",
+                    "项目(固定项,勿修改)",
+                    "渠道号创建人(固定项,勿修改)",
+                    "使用范围(1代表账户,2代表项目)",
+                    "账户ID(和项目对应)",
+                    "渠道号(如:数字加字母)",
+                    "渠道号名称",
+                    "下载链接",
+                    "应用包名",
+                    "应用名称",
+                    "应用标记",
+                    "隐私政策链接",
+                    "第三方点击监测链接",
+                    "是否关联单品(0代表不关联,1代表关联)",
+                    "关联单品名称",
+                    "使用层级(账户:account,计划:plan,组:group)",
+                    "是否循环(0代表不循环,1代表循环)",
+                    "调起链接(选填)",
+                    "第三方actionBar监测链接(选填)"
+            };
             List<List<Object>> list = new ArrayList<>();
             List<Object> ids = new ArrayList<>();
             ids.add(productId);//产品
             ids.add(projectId);//项目
+            ids.add(userId);//渠道号创建人
             ids.add(1);//使用范围(1项目,2账户)
             ids.add(23212);//账户ID
-            ids.add(userId);//渠道号创建人
             ids.add("KS_0001");//渠道号(数字加字母)
             ids.add("快手0001");//渠道号名称
             ids.add("http://test.com.cn");//下载链接
             ids.add("com.test.hcst");//应用包名
             ids.add("示例包_HCST");//应用名称
             ids.add("hcst");//应用标记
-            ids.add("http://test.com.cn");//隐私政策链接
-            ids.add("http://test.com.cn");//第三方点击监测链接
+            ids.add("http://test123.com.cn");//隐私政策链接
+            ids.add("http://test123456.com.cn");//第三方点击监测链接
             ids.add(1);//是否关联单品(0否,1是)
             ids.add("剑来");//关联单品名称
             ids.add("account");//使用层级(账户:account,计划:plan,组:group)
             ids.add(1);//是否循环(0否,1是)
-            ids.add(10);//循环次数
             list.add(ids);
             eeu.exportExcelForAttendance(workbook, 0, "Sheet1", titles, list);
             eeu.putResponseHeader(response, "渠道号模板.xlsx");
@@ -241,20 +298,6 @@ public class KuaishouChannelController {
     }
 
     /**
-     * 定制创建渠道号
-     */
-    @PostMapping(value = "/customizedCreate")
-    public Result<Object> customizedCreate(@RequestBody JSONObject request) {
-        try {
-            return kuaishouChannelService.customizedCreate(request, 3);
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error("定制创建渠道号异常", e);
-            return Result.error("定制创建渠道号失败," + e.getMessage());
-        }
-    }
-
-    /**
      * 通过账户查询渠道号接口
      */
     @PostMapping(value = "/queryChannel")

+ 16 - 13
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/entity/KuaishouChannel.java

@@ -74,7 +74,12 @@ public class KuaishouChannel {
     private Integer createType;
 
     /**
-     * 状态 0无效,1有效
+     * 渠道号状态 0无效,1有效
+     */
+    private Integer channelState;
+
+    /**
+     * 账户是否使用渠道号 0不用,1使用
      */
     private Integer state;
 
@@ -175,18 +180,6 @@ public class KuaishouChannel {
     @ApiModelProperty(value = "是否循环重复使用 0:否,1:是")
     private Integer isCycle;
     /**
-     * 可循环次数
-     */
-    @Excel(name = "可循环次数", width = 15)
-    @ApiModelProperty(value = "可循环次数")
-    private Integer cycleTimes;
-    /**
-     * 已循环次数
-     */
-    @Excel(name = "已循环次数", width = 15)
-    @ApiModelProperty(value = "已循环次数")
-    private Integer haveCycleTimes;
-    /**
      * createTime
      */
     @ApiModelProperty(value = "createTime")
@@ -202,4 +195,14 @@ public class KuaishouChannel {
 
     @TableField(exist = false)
     private List<KuaishouChannelItems> items;
+
+    @TableField(exist = false)
+    private String authName;
+
+    @TableField(exist = false)
+    private Long campaignId;
+
+    @TableField(exist = false)
+    private Long unitId;
+
 }

+ 11 - 8
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/entity/KuaishouChannelCreateStrategy.java

@@ -64,7 +64,7 @@ public class KuaishouChannelCreateStrategy {
     @ApiModelProperty(value = "账户id")
     private Long accountId;
     /**
-     * 创建方式 1-批量,2-excel导入,3-自定义
+     * 创建方式 1-批量,2-excel导入
      */
     @Excel(name = "创建方式 1-批量,2-excel导入,3-自定义", width = 15)
     @ApiModelProperty(value = "创建方式 1-批量,2-excel导入,3-自定义")
@@ -88,6 +88,10 @@ public class KuaishouChannelCreateStrategy {
     @ApiModelProperty(value = "编号长度")
     private Integer numberLength;
     /**
+     * 编号原始值
+     */
+    private String numberValue;
+    /**
      * 编号最小值
      */
     @Excel(name = "编号最小值", width = 15)
@@ -148,12 +152,6 @@ public class KuaishouChannelCreateStrategy {
     @ApiModelProperty(value = "是否循环重复使用 0:否,1:是")
     private Integer isCycle;
     /**
-     * 可循环次数
-     */
-    @Excel(name = "可循环次数", width = 15)
-    @ApiModelProperty(value = "可循环次数")
-    private Integer cycleTimes;
-    /**
      * 应用标记
      */
     @Excel(name = "应用标记", width = 15)
@@ -187,6 +185,7 @@ public class KuaishouChannelCreateStrategy {
     @Excel(name = "图片MD5标识", width = 15)
     @ApiModelProperty(value = "图片MD5标识")
     private String imageToken;
+
     /**
      * createTime
      */
@@ -198,7 +197,6 @@ public class KuaishouChannelCreateStrategy {
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
 
-    @TableField(exist = false)
     private Long appId;
 
     @TableField(exist = false)
@@ -207,4 +205,9 @@ public class KuaishouChannelCreateStrategy {
     @TableField(exist = false)
     private String itemName;
 
+    @TableField(exist = false)
+    private String projectName;
+    @TableField(exist = false)
+    private String ProductName;
+
 }

+ 97 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/entity/KuaishouChannelUpdateRecord.java

@@ -0,0 +1,97 @@
+package cn.com.ctop.kuaishou.modules.channel.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * 渠道号修改记录留存表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-11-17
+ */
+@Data
+@TableName("ctop_kuaishou_channel_update_record")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_channel_update_record对象", description = "渠道号修改记录留存表")
+public class KuaishouChannelUpdateRecord {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 操作人
+     */
+    @Excel(name = "操作人", width = 15)
+    @ApiModelProperty(value = "操作人")
+    private String userId;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+    /**
+     * 调起链接
+     */
+    @Excel(name = "调起链接", width = 15)
+    @ApiModelProperty(value = "调起链接")
+    private String schemaUri;
+    /**
+     * 第三方点击检测链接
+     */
+    @Excel(name = "第三方点击检测链接", width = 15)
+    @ApiModelProperty(value = "第三方点击检测链接")
+    private String clickTrackUrl;
+    /**
+     * 第三方点击按钮监测链接
+     */
+    @Excel(name = "第三方点击按钮监测链接", width = 15)
+    @ApiModelProperty(value = "第三方点击按钮监测链接")
+    private String actionbarClickUrl;
+    /**
+     * 是否关联单品 0:否,1:是
+     */
+    @Excel(name = "是否关联单品 0:否,1:是", width = 15)
+    @ApiModelProperty(value = "是否关联单品 0:否,1:是")
+    private Integer isHaveItem;
+    /**
+     * 是否循环使用 0:否,1:是
+     */
+    @Excel(name = "是否循环使用 0:否,1:是", width = 15)
+    @ApiModelProperty(value = "是否循环使用 0:否,1:是")
+    private Integer isCycle;
+    /**
+     * 操作时间
+     */
+    @Excel(name = "操作时间", width = 15)
+    @ApiModelProperty(value = "操作时间")
+    private String operationTime;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

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

@@ -18,7 +18,7 @@ import java.util.List;
  */
 public interface KuaishouChannelMapper extends BaseMapper<KuaishouChannel> {
 
-    List<JSONObject> channelManagementHome(@Param("productId") Long productId, @Param("projectId") Long projectId, @Param("accountId") Long accountId, @Param("userId") String userId);
+    List<JSONObject> channelManagementHome(KuaishouChannel kuaishouChannel);
 
     Long channelNumberDetailsTotal(KuaishouChannel kuaishouChannel);
 
@@ -26,7 +26,7 @@ public interface KuaishouChannelMapper extends BaseMapper<KuaishouChannel> {
 
     Long channelNumberUsageDetailsListTotal(KuaishouChannel kuaishouChannel);
 
-    List<JSONObject> channelNumberUsageDetailsList(KuaishouChannel kuaishouChannel);
+    List<KuaishouChannel> channelNumberUsageDetailsList(KuaishouChannel kuaishouChannel);
 
     List<JSONObject> channelNumberBindingItemInfo(@Param("request") JSONArray request);
 
@@ -49,4 +49,6 @@ public interface KuaishouChannelMapper extends BaseMapper<KuaishouChannel> {
     KuaishouChannel queryUsedChannel(@Param("accountId") Long accountId, @Param("campaignId") Long campaignId, @Param("level") String level);
 
     List<JSONObject> queryChannelList(@Param("accountId") Long accountId, @Param("appName") String appName);
+
+    List<KuaishouChannel> queryChannelListByAccount(@Param("accountId") Long accountId);
 }

+ 15 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/mapper/KuaishouChannelUpdateRecordMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.channel.mapper;
+
+import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannelUpdateRecord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 渠道号修改记录留存表
+ *
+ * @author jeecg-boot
+ * 2021-11-17
+ * @version V1.0
+ */
+public interface KuaishouChannelUpdateRecordMapper extends BaseMapper<KuaishouChannelUpdateRecord> {
+
+}

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

@@ -3,8 +3,8 @@
 <mapper namespace="cn.com.ctop.kuaishou.modules.channel.mapper.KuaishouChannelMapper">
 
     <select id="channelManagementHome" resultType="com.alibaba.fastjson.JSONObject">
-        SELECT * FROM (
         SELECT
+               t1.id,
         IFNULL(t1.product_name, '')as 'productName',
         IFNULL(t1.project_name, '')as 'projectName',
         IFNULL(t1.account_id, '')as 'accountId',
@@ -12,51 +12,31 @@
         IFNULL(t2.realname, '')as 'realname',
         MAX(t1.state_date) as 'stateDate',
         IFNULL(t1.create_type, '') as 'createType',
+        IFNULL(t1.state,0) as 'state',
+        usage_level as 'usageLevel',
+        (select auth_name from ctop_user_allocation where account_id = t1.account_id) as 'authName',
         t1.create_time
         FROM ctop_kuaishou_channel t1
         LEFT JOIN sys_user t2 ON t1.user_id = t2.id
-        where account_id is not null
-        <if test="userId != null">
-            and t1.user_id = #{userId}
-        </if>
-        <if test="projectId != null">
-            and project_id = #{projectId}
-        </if>
-        <if test="productId != null">
-            and product_id = #{productId}
-        </if>
-        <if test="accountId != null">
-            and account_id= #{accountId}
-        </if>
+        <where>
+            <if test="userId != null">
+                and t1.user_id = #{userId}
+            </if>
+            <if test="projectId != null">
+                and project_id = #{projectId}
+            </if>
+            <if test="productId != null">
+                and product_id = #{productId}
+            </if>
+            <if test="accountId != null">
+                and account_id= #{accountId}
+            </if>
+            <if test="state != null">
+                and state= #{state}
+            </if>
+        </where>
         GROUP BY account_id
-        UNION ALL
-        SELECT
-        IFNULL(t1.product_name, '')as 'productName',
-        IFNULL(t1.project_name, '')as 'projectName',
-        IFNULL(t1.account_id, '')as 'accountId',
-        IFNULL(t1.project_id, '')as 'projectId',
-        IFNULL(t2.realname, '')as 'realname',
-        MAX(t1.state_date) as 'stateDate',
-        IFNULL(t1.create_type, '') as 'createType',
-        t1.create_time
-        FROM ctop_kuaishou_channel t1
-        LEFT JOIN sys_user t2 ON t1.user_id = t2.id
-        where account_id is null
-        <if test="userId != null">
-            and t1.user_id = #{userId}
-        </if>
-        <if test="projectId != null">
-            and project_id = #{projectId}
-        </if>
-        <if test="productId != null">
-            and product_id = #{productId}
-        </if>
-        <if test="accountId != null">
-            and account_id= #{accountId}
-        </if>
-        GROUP BY project_id
-        ) t
-        ORDER BY t.create_time DESC
+        ORDER BY create_time DESC
     </select>
 
     <select id="channelNumberDetailsTotal" resultType="java.lang.Long">
@@ -66,12 +46,6 @@
             <if test="accountId != null">
                 AND account_id = #{accountId}
             </if>
-            <if test="projectId != null">
-                AND project_id = #{projectId}
-            </if>
-            <if test="createType != null">
-                AND create_type = #{createType}
-            </if>
             <if test="channelName != null">
                 AND LOCATE(#{channelName},channel_name)
             </if>
@@ -88,12 +62,6 @@
             <if test="accountId != null">
                 AND account_id = #{accountId}
             </if>
-            <if test="projectId != null">
-                AND project_id = #{projectId}
-            </if>
-            <if test="createType != null">
-                AND create_type = #{createType}
-            </if>
             <if test="channelName != null">
                 AND LOCATE(#{channelName},channel_name)
             </if>
@@ -115,22 +83,23 @@
           AND t3.unit_id is not null
     </select>
 
-    <select id="channelNumberUsageDetailsList" resultType="com.alibaba.fastjson.JSONObject">
-        SELECT CASE
-                   t1.usage_range
-                   WHEN 1 THEN
-                       '账户'
-                   WHEN 2 THEN
-                       '项目'
-                   ELSE ''
-                   END AS 'usageRange', IFNULL(t3.channel_code, '') AS 'channelCode', IFNULL(t1.project_name, '') AS 'projectName', IFNULL(t2.auth_name, '') AS 'authName', IFNULL(t3.account_id, '') AS 'accountId', IFNULL(t3.campaign_id, '') AS 'campaignId', IFNULL(t3.unit_id, '') AS 'unitId'
+    <select id="channelNumberUsageDetailsList" resultType="cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannel">
+        SELECT  t1.usage_level,
+               t3.channel_code,
+               t1.channel_name,
+              t1.project_name,
+              t2.auth_name,
+              t3.account_id,
+              t3.campaign_id,
+              t3.unit_id,
+               t3.create_time
         FROM ctop_kuaishou_channel_rel t3
-                 INNER JOIN ctop_kuaishou_channel t1 ON t1.account_id = t3.account_id
-            AND t1.channel_code = t3.channel_code
-                 LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
+        INNER JOIN ctop_kuaishou_channel t1 ON t1.account_id = t3.account_id AND t1.channel_code = t3.channel_code
+        LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
         WHERE t3.account_id = #{accountId}
           AND t3.channel_code = #{channelCode}
           AND t3.unit_id is not null
+          order by t3.create_time
     </select>
 
     <select id="channelNumberBindingItemInfo" resultType="com.alibaba.fastjson.JSONObject">
@@ -290,6 +259,18 @@
   </select>
 
 
+     <select id="queryChannelListByAccount" resultType="cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannel">
+      SELECT
+          id,
+          channel_code
+      FROM
+          ctop_kuaishou_channel
+      WHERE channel_state = 1
+        AND state = 1
+        AND account_id = #{accountId}
+    </select>
+
+
     <select id="queryUsedChannel" resultType="cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannel">
         SELECT t2.*
         FROM ctop_kuaishou_channel_rel t1

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

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.channel.mapper.KuaishouChannelUpdateRecordMapper">
+
+</mapper>

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

@@ -16,7 +16,7 @@ import org.springframework.web.multipart.MultipartFile;
  */
 public interface IKuaishouChannelService extends IService<KuaishouChannel> {
 
-    Result<Object> channelManagementHome(Long productId, Long projectId, Long accountId, String userId);
+    Result<Object> channelManagementHome(KuaishouChannel kuaishouChannel);
 
     Result<Object> channelNumberDetails(KuaishouChannel kuaishouCha, Integer pageNo, Integer pageSizennel);
 
@@ -28,8 +28,6 @@ public interface IKuaishouChannelService extends IService<KuaishouChannel> {
 
     Result<Object> systemBatchCreation(JSONObject request);
 
-    Result<Object> customizedCreate(JSONObject request, Integer createType) throws Exception;
-
     Result<Object> queryChannel(Long accountId, String usageLevel, String appName, String photoName) throws Exception;
 
     Result<Object> queryChannelLevel(JSONObject request);
@@ -40,4 +38,5 @@ public interface IKuaishouChannelService extends IService<KuaishouChannel> {
 
     Result<Object> queryChannelList(Long accountId, String appName);
 
+    Result<Object> updateChannels(KuaishouChannel channel);
 }

+ 15 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/IKuaishouChannelUpdateRecordService.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.channel.service;
+
+import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannelUpdateRecord;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 渠道号修改记录留存表
+ *
+ * @author jeecg-boot
+ * 2021-11-17
+ * @version V1.0
+ */
+public interface IKuaishouChannelUpdateRecordService extends IService<KuaishouChannelUpdateRecord> {
+
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 425 - 352
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/impl/KuaishouChannelServiceImpl.java


+ 19 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/impl/KuaishouChannelUpdateRecordServiceImpl.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.channel.service.impl;
+
+import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannelUpdateRecord;
+import cn.com.ctop.kuaishou.modules.channel.mapper.KuaishouChannelUpdateRecordMapper;
+import cn.com.ctop.kuaishou.modules.channel.service.IKuaishouChannelUpdateRecordService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 渠道号修改记录留存表
+ *
+ * @author jeecg-boot
+ * 2021-11-17
+ * @version V1.0
+ */
+@Service
+public class KuaishouChannelUpdateRecordServiceImpl extends ServiceImpl<KuaishouChannelUpdateRecordMapper, KuaishouChannelUpdateRecord> implements IKuaishouChannelUpdateRecordService {
+
+}

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

@@ -12,7 +12,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @Version: V1.0
  */
 public interface IKuaishouAudienceReportDailyService extends IService<KuaishouAudienceReportDaily> {
-    /**
+    /*
      * 人群分析报表
      *
      * @param