yumeng 2 éve
szülő
commit
b3ddfc5ca1

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

@@ -181,9 +181,9 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
                     continue;
                 }
 
-                Long relateId =     itemJson.getLong("relateId");
+                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++;
@@ -225,7 +225,13 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
         for (int i = 0; i < temCollectSamples.size(); i++) {
             JSONObject sampleJson = temCollectSamples.getJSONObject(i);
             KuaishouItemCollectSamples sample = new KuaishouItemCollectSamples();
-            sample.setItemId(sampleJson.getLong("itemId"));
+            Long itemId = sampleJson.getLong("itemId");
+            Long promoterId = sampleJson.getLong("promoterId");
+            Integer check = kuaishouItemCollectSamplesMapper.check(itemId, promoterId);
+            if (check > 0) {
+                continue;
+            }
+            sample.setItemId(itemId);
             sample.setItemTitle(sampleJson.getString("itemTitle"));
             sample.setItemPrice(sampleJson.getLong("itemPrice"));
             sample.setItemImgUrl(sampleJson.getString("itemImgUrl"));
@@ -239,7 +245,7 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
             sample.setCollectSampleId(sampleJson.getLong("collectSampleId"));
             sample.setCollectSampleName(sampleJson.getString("collectSampleName"));
             sample.setPartnerRecommendText(sampleJson.getString("partnerRecommendText"));
-            sample.setPromoterId(sampleJson.getLong("promoterId"));
+            sample.setPromoterId(promoterId);
             sample.setPromoterPhone(sampleJson.getString("promoterPhone"));
             sample.setPromoterAddress(sampleJson.getString("promoterAddress"));
             sample.setConsignee(sampleJson.getString("consignee"));
@@ -665,8 +671,8 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
     }
 
     @Override
-    public List<KuaishouItemCollectSamples> getListByPromoterId(Long promoterId,Long userId) {
-        return kuaishouItemCollectSamplesMapper.getListByPromoterId(promoterId,userId);
+    public List<KuaishouItemCollectSamples> getListByPromoterId(Long promoterId, Long userId) {
+        return kuaishouItemCollectSamplesMapper.getListByPromoterId(promoterId, userId);
     }
 
     // 渠道—数据分析