Sfoglia il codice sorgente

指定文案修改

yangzian 3 anni fa
parent
commit
a6229e8dab

+ 9 - 11
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/mapper/xml/ByteDanceGeneralCopywriterMapper.xml

@@ -9,21 +9,19 @@
             a.text_copywriter AS textCopywriter
         FROM
             ctop_bytedance_general_copywriter a
-        WHERE
-            1 = 1
+        <where>
             <if test="status!=null">and a.`status` = #{status}</if>
             <if test="keyWord!=null and keyWord!=''">and a.text_copywriter like concat('%',#{keyWord},'%')</if>
             <if test="startTime!=null and startTime!=''">and STR_TO_DATE(a.create_time,'%Y-%m-%d') &gt;= STR_TO_DATE(#{startTime},'%Y-%m-%d')</if>
             <if test="endTime!=null and endTime!=''">and STR_TO_DATE(a.create_time,'%Y-%m-%d') &lt;= STR_TO_DATE(#{endTime},'%Y-%m-%d')</if>
-        <if test="accountIds!=null and accountIds!=''">
-            AND a.account_id IN
-            <foreach item="item" index="index" collection="accountIds"
-                     open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-        GROUP BY
-        a.text_copywriter
+            <if test="accountIds!=null and accountIds!=''">
+                AND a.account_id IN
+                <foreach item="item" index="index" collection="accountIds"
+                         open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
 
     </select>
 

+ 18 - 96
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/mapper/xml/BytedanceVideoSlogenInfoMapper.xml

@@ -2,108 +2,30 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.bytedance.advertise.mapper.BytedanceVideoSlogenInfoMapper">
     <select id="selectVideoSlogenReportByAccountIdAndTitle" resultType="java.util.HashMap">
-
         SELECT
             a.id,
             a.status,
             a.slogan,
-            a.project_id AS projectId,
-            count(*) AS count,
-            sum(d.cost) AS cost,
-            sum(d.show_num) AS showNum,
-            sum(d.click) AS click,
-            sum(d.convert_num) AS convertNum
+            a.project_id AS projectId
         FROM
             ctop_bytedance_video_slogen_info a
-        LEFT JOIN (
-        SELECT
-            t1.id,
-            t1.title,
-            t2.signature,
-            t1.account_id
-        FROM
-        (
-        SELECT
-            cbc.*
-        FROM
-            ctop_bytedance_creative cbc
-        WHERE
-        account_id IN (
-        SELECT
-        CONCAT(
-        ctop_user_allocation.account_id,
-        ''
-        )
-        FROM
-        ctop_user_allocation
-        WHERE
-        1=1
-        <if test="projectIds!=null">
-            AND project_id IN
-            <foreach item="item" index="index" collection="projectIds"
-                     open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-        )
-        ) t1
-        LEFT JOIN (
-        SELECT
-        cbvi.*
-        FROM
-        ctop_bytedance_video_info cbvi
-        WHERE
-        account_id IN (
-        SELECT
-        ctop_user_allocation.account_id
-        FROM
-        ctop_user_allocation
-        WHERE
-        1=1
-        <if test="projectIds!=null">
-            AND project_id IN
-            <foreach item="item" index="index" collection="projectIds"
-                     open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-        )
-        ) t2 ON t1.video_id = t2.vid
-        AND t1.account_id = t2.account_id
-        LEFT JOIN ctop_user_allocation cua ON cua.account_id = t1.account_id
-        WHERE
-        1=1
-        <if test="projectIds!=null">
-            AND cua.project_id IN
-            <foreach item="item" index="index" collection="projectIds"
-                     open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-        ) b ON a.slogan = b.title
-        AND a.video_code = b.signature
-        LEFT JOIN ctop_bytedance_report_creative_daily d ON b.id = d.creative_id
-        WHERE
-        1=1
-        <if test="status!=null">and a.status = #{status}</if>
-        <if test="keyWord!=null and keyWord!=''">and a.slogan like concat('%',#{keyWord},'%')</if>
-        <if test="startTime!=null and startTime != ''">and STR_TO_DATE(d.stat_datetime,'%Y-%m-%d') &gt;=
-            STR_TO_DATE(#{startTime},'%Y-%m-%d')
-        </if>
-        <if test="endTime!=null and endTime!=''">and STR_TO_DATE(d.stat_datetime,'%Y-%m-%d') &lt;=
-            STR_TO_DATE(#{endTime},'%Y-%m-%d')
-        </if>
-        <if test="projectIds!=null">
-            AND a.project_id IN
-            <foreach item="item" index="index" collection="projectIds"
-                     open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-
-        GROUP BY
-        a.slogan
-
+            <where>
+                <if test="projectIds!=null">
+                    AND a.project_id IN
+                    <foreach item="item" index="index" collection="projectIds"
+                             open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+                <if test="status!=null">and a.status = #{status}</if>
+                <if test="keyWord!=null and keyWord!=''">and a.slogan like concat('%',#{keyWord},'%')</if>
+                <if test="startTime!=null and startTime != ''">and STR_TO_DATE(a.create_time,'%Y-%m-%d') &gt;=
+                    STR_TO_DATE(#{startTime},'%Y-%m-%d')
+                </if>
+                <if test="endTime!=null and endTime!=''">and STR_TO_DATE(a.create_time,'%Y-%m-%d') &lt;=
+                    STR_TO_DATE(#{endTime},'%Y-%m-%d')
+                </if>
+        </where>
 
     </select>
 

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/bytedance/advertise/controller/BytedanceGeneralCopywriterController.java

@@ -146,6 +146,9 @@ public class BytedanceGeneralCopywriterController {
                                       @RequestParam(value = "pageSize", defaultValue="10") Integer pageSize,
                                       @RequestParam(value = "status",required = false)  Integer status) {
         try {
+            if (Check.isNull(accountId)){
+                return Result.errorMsg("请选择账户。");
+            }
             String roleCode = sysRoleService.getRoleCodeByUserId(userId);
             if (Check.isNull(roleCode)){
                 return Result.errorMsg("请输入正确的用户id。");

+ 7 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/bytedance/advertise/controller/BytedanceVideoSlogenInfoController.java

@@ -16,7 +16,6 @@ import org.jeecg.modules.bytedance.advertise.entity.ByteDanceCreativeWordPackage
 import org.jeecg.modules.bytedance.advertise.entity.BytedanceVideoSlogenInfo;
 import org.jeecg.modules.bytedance.advertise.service.IByteDanceGeneralCopywriterService;
 import org.jeecg.modules.bytedance.advertise.service.IBytedanceVideoSlogenInfoService;
-import org.jeecg.modules.bytedance.advertise.service.impl.BytedanceVideoSlogenInfoServiceImpl;
 import org.jeecg.modules.bytedance.common.entity.MaterialInfo;
 import org.jeecg.modules.bytedance.common.service.IMaterialInfoService;
 import org.jeecg.modules.bytedance.common.utils.Check;
@@ -26,7 +25,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -85,6 +86,10 @@ public class BytedanceVideoSlogenInfoController {
 									  @RequestParam(value = "status",required = false) Integer status
 									) {
 		try {
+			if (Check.isNull(projectId)){
+				return Result.errorMsg("请选择项目。");
+			}
+
 			//查询用户角色
 			String roleCode = sysRoleService.getRoleCodeByUserId(userId);
 			if (Check.isNull(roleCode)){