Переглянути джерело

controller方法位置迁移

syh 4 роки тому
батько
коміт
51a1665c8d

+ 9 - 12
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaishouStrategyController.java

@@ -1,11 +1,10 @@
-package cn.com.ctop.kuaishou.modules.batch.controller;
+package org.jeecg.modules.ads.controller;
 
 import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouStrategy;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouStrategyService;
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -13,23 +12,19 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.checkerframework.checker.units.qual.A;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.ads.service.IAiKuaishouStrategyService;
+import org.jeecg.modules.ads.service.IAiStrategyService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.entity.ImportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
@@ -57,6 +52,8 @@ import java.util.Map;
 public class KuaishouStrategyController {
     @Autowired
     private IKuaishouStrategyService kuaishouStrategyService;
+    @Autowired
+    private IAiStrategyService strategyService;
 
     /**
      * 分页列表查询
@@ -82,11 +79,10 @@ public class KuaishouStrategyController {
         result.setResult(pageList);
         return result;
     }
-
     /**
      * 添加
      *
-     * @param kuaishouStrategy
+     * @param data
      * @return
      */
     @AutoLog(value = "kuaishou.modules.batch-优化评估策略表-添加")
@@ -100,6 +96,7 @@ public class KuaishouStrategyController {
             }
             KuaishouStrategy strategy = JSONObject.toJavaObject(data, KuaishouStrategy.class);
             kuaishouStrategyService.save(strategy);
+            strategyService.createCreativeByStrategy(strategy);
             result.success("添加成功!");
         } catch (Exception e) {
             log.error(e.getMessage(), e);

+ 0 - 28
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouReportDailyMaterialMapper.xml

@@ -349,33 +349,5 @@
         and
             stat_date = #{date}
     </select>
-
-
-
-    <select id="getHighQualityMaterialId" resultType="com.xxl.job.executor.report.entity.KuaiShouReportDailyMaterial">
-    /*
-    根据account_id,获取project_id
-    得到该项目下,近 days 内,素材消耗排名前 num 的素材签名
-    */
-        select
-        material.signature
-        from
-        ctop_kuaishou_report_daily_material material
-        left join
-        ctop_user_allocation allocation
-        on material.account_id = allocation.account_id
-        where  allocation.project_id in
-               (select project_id from ctop_user_allocation where 1=1
-                                                              <if test="accountId!=null">
-                                                              and account_id = #{accountId}
-                                                              </if>)
-        and  to_days(now()) - to_days(material.stat_date) &lt;=  #{days}
-        and material.signature is not null
-        GROUP BY material.signature
-        order by sum_charge desc
-        limit #{highQualityNum}
-    </select>
-
-
 </mapper>