ソースを参照

领样增加关联商品ID校验

yumeng 2 年 前
コミット
8c5489c898

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

@@ -114,5 +114,7 @@ public interface KuaishouItemCollectSamplesMapper {
     void batchProcess(@Param("ids") JSONArray ids,@Param("status") Integer status);
 
     List<KuaishouItemCollectSamples> getListByPromoterId(@Param("promoterId") Long promoterId);
+
+    Integer checkByRelateIdAndPromoterId(@Param("relateId") Long relateId, @Param("promoterId") Long promoterId);
 }
 

+ 5 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemCollectSamplesServiceImpl.java

@@ -173,14 +173,18 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
         for (int i = 0; i < itemIds.size(); i++) {
             Long itemId = itemIds.getLong(i);
             JSONObject itemJson = itemMap.get(itemId);
+
             for (int j = 0; j < ids.size(); j++) {
                 Long id = ids.getLong(j);
                 JSONObject promoterJson = promoterMap.get(id);
                 if (Check.isNull(promoterJson)) {
                     continue;
                 }
+
+                Long relateId =     itemJson.getLong("relateId");
                 Long promoterId = promoterJson.getLong("promoterId");
-                Integer count = kuaishouItemCollectSamplesMapper.check(itemId, promoterId);
+              //  Integer count = kuaishouItemCollectSamplesMapper.check(itemId, promoterId);
+                Integer count = kuaishouItemCollectSamplesMapper.checkByRelateIdAndPromoterId(relateId, promoterId);
                 if (count > 0) {
                     sampleReceivedCount++;
                     continue;

+ 14 - 1
ruixuan-live/src/main/resources/mapper/isc/KuaishouItemCollectSamplesMapper.xml

@@ -176,7 +176,8 @@
         regimental_promotion as 'regimentalPromotion',
         commission_rate as 'commissionRate',
         user_id as 'userId',
-        user_name as 'userName'
+        user_name as 'userName',
+        relate_id as 'relateId'
         from kuaishou_item_list
         where 1 =1
         <if test='itemIds != null and itemIds.size() > 0'>
@@ -690,5 +691,17 @@
             AND validorder &lt;= #{validorderEnd}
         </if>
     </select>
+    <select id="checkByRelateIdAndPromoterId" resultType="java.lang.Integer">
+        select count(1)
+        from kuaishou_item_collect_samples
+        where item_id in(
+        select  item_id  from kuaishou_item_list
+        where relate_id = #{relateId}
+        group by item_id
+        )
+          and promoter_id = #{promoterId}
+          and collect_sample_status != 2
+
+    </select>
 
 </mapper>