Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

yumeng 2 éve
szülő
commit
6d47234a70

+ 2 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouPromoterMapper.java

@@ -102,4 +102,6 @@ public interface KuaishouPromoterMapper {
     String getRuleName(@Param("ruleId") Long ruleId);
 
     int addRule(@Param("promoterId") String promoterId, @Param("ruleId") Long ruleId, @Param("ruleName") String ruleName);
+
+    List<String> selectPromoterIdListByTime(@Param("userList") List<Long> userList, @Param("startDate") Long startDate, @Param("endDate") Long endDate);
 }

+ 2 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouPromoterService.java

@@ -81,4 +81,6 @@ public interface IKuaishouPromoterService {
     String getRuleName(Long ruleId);
 
     int addRule(String promoterId, Long ruleId, String ruleName);
+
+    List<String> selectPromoterIdListByTime(List<Long> userList, Long startDate, Long endDate);
 }

+ 12 - 4
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemCollectSamplesServiceImpl.java

@@ -447,7 +447,11 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
         JSONObject data = new JSONObject();
         List<String> promoterIds = null;
         if (Check.isNotNull(userList)) {
-            promoterIds = promoterService.selectPromoterIdList(userList, mediaId);
+            if ("2".equals(mediaId)) {
+                promoterIds = promoterService.selectPromoterIdListByTime(userList, DateUtils.strDateToInt(startDate), DateUtils.strDateToInt(endDate));
+            } else {
+                promoterIds = promoterService.selectPromoterIdList(userList, mediaId);
+            }
             if (Check.isNull(promoterIds)) {
                 return data;
             }
@@ -718,7 +722,11 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
         JSONObject data = new JSONObject();
         List<String> promoterIds = null;
         if (Check.isNotNull(userList)) {
-            promoterIds = promoterService.selectPromoterIdList(userList, mediaId);
+            if ("2".equals(mediaId)) {
+                promoterIds = promoterService.selectPromoterIdListByTime(userList, DateUtils.strDateToInt(startDate), DateUtils.strDateToInt(endDate));
+            } else {
+                promoterIds = promoterService.selectPromoterIdList(userList, mediaId);
+            }
             if (Check.isNull(promoterIds)) {
                 return data;
             }
@@ -735,8 +743,8 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
         map.put("userList", userList);
         map.put("promoterIds", promoterIds);
         if ("1".equals(mediaId)) {
-            map.put("startLong", Long.valueOf(startDate.replace("-","")));
-            map.put("endLong", Long.valueOf(endDate.replace("-","")));
+            map.put("startLong", Long.valueOf(startDate.replace("-", "")));
+            map.put("endLong", Long.valueOf(endDate.replace("-", "")));
         } else {
             map.put("startLong", DateUtils.getStartLongTime(startDate));
             map.put("endLong", DateUtils.getEndLongTime(endDate));

+ 10 - 5
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouPromoterServiceImpl.java

@@ -379,7 +379,12 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
 
     @Override
     public int addRule(String promoterId, Long ruleId, String ruleName) {
-        return kuaishouPromoterMapper.addRule(promoterId,ruleId,ruleName);
+        return kuaishouPromoterMapper.addRule(promoterId, ruleId, ruleName);
+    }
+
+    @Override
+    public List<String> selectPromoterIdListByTime(List<Long> userList, Long startDate, Long endDate) {
+        return kuaishouPromoterMapper.selectPromoterIdListByTime(userList, startDate, endDate);
     }
 
     @Override
@@ -500,13 +505,13 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
     }
 
     @Override
-    public List<String> selectPromoterIdList(List<Long> userList,String mediaId) {
-        return kuaishouPromoterMapper.selectPromoterIdList(userList,mediaId);
+    public List<String> selectPromoterIdList(List<Long> userList, String mediaId) {
+        return kuaishouPromoterMapper.selectPromoterIdList(userList, mediaId);
     }
 
     @Override
-    public JSONObject getgetMonthPromoterTotal(List<Long> userList, String start, String end,String mediaId) {
-        return kuaishouPromoterMapper.getgetMonthPromoterTotal(userList, start, end,mediaId);
+    public JSONObject getgetMonthPromoterTotal(List<Long> userList, String start, String end, String mediaId) {
+        return kuaishouPromoterMapper.getgetMonthPromoterTotal(userList, start, end, mediaId);
     }
 
     /**

+ 14 - 0
ruixuan-live/src/main/resources/mapper/isc/KuaishouPromoterMapper.xml

@@ -236,6 +236,20 @@
         </where>
     </select>
 
+    <select id="selectPromoterIdListByTime" resultType="String">
+        select promoter_id
+        from promoter_bind_channel_date
+        WHERE stat_date >= #{startDate}
+            AND stat_date &lt;= #{endDate}
+            <if test="userList != null ">
+                AND user_id in
+                <foreach collection="userList" item="item" separator=","
+                         open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+    </select>
+
     <select id="getOneByIdAndPromoterId" resultMap="KuaishouPromoterResult">
         <include refid="selectKuaishouPromoterVo"/>
         where promoter_id = #{promoterId}