yumeng vor 2 Jahren
Ursprung
Commit
59b1040c68

+ 9 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouItemCollectSamplesController.java

@@ -772,7 +772,7 @@ public class KuaishouItemCollectSamplesController extends BaseController {
 
     @GetMapping("/samplesCheck")
     @ResponseBody
-    public JSONObject samplesCheck(Long itemId, Long promoterId,Long userId) {
+    public JSONObject samplesCheck(Long itemId, Long promoterId, Long userId) {
         JSONObject returnJson = new JSONObject();
         try {
 
@@ -791,9 +791,16 @@ public class KuaishouItemCollectSamplesController extends BaseController {
                 throw new Exception("该达人未录入");
             }
 
+            Long id = null;
+            KuaishouPromoter userPromoterInfo = promoterService.getOnlyPromoterInfoByUserId(promoterId, userId);
+            if (!Check.isNull(userPromoterInfo)) {
+                id = userPromoterInfo.getId();
+            } else {
+                id = onlyPromoterInfo.getId();
+            }
             returnJson.put("code", 0);
             returnJson.put("message", "校验通过");
-            returnJson.put("id", onlyPromoterInfo.getId());
+            returnJson.put("id", id);
         } catch (Exception e) {
             returnJson.put("code", 500);
             returnJson.put("message", e.getMessage());

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

@@ -89,4 +89,5 @@ public interface KuaishouPromoterMapper {
     List<JSONObject> getPromoterLabel(@Param("promoterId") Long promoterId, @Param("userId") Long userId);
 
 
+    KuaishouPromoter getOnlyPromoterInfoByUserId(@Param("promoterId") Long promoterId,@Param("userId") Long userId);
 }

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

@@ -73,4 +73,6 @@ public interface IKuaishouPromoterService {
     void updateFollowUpRecords(JSONObject result);
 
     Result getGongHaiVideoSales(Long promoterId);
+
+    KuaishouPromoter getOnlyPromoterInfoByUserId(Long promoterId, Long userId);
 }

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

@@ -312,6 +312,11 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
     }
 
     @Override
+    public KuaishouPromoter getOnlyPromoterInfoByUserId(Long promoterId, Long userId) {
+        return kuaishouPromoterMapper.getOnlyPromoterInfoByUserId(promoterId,userId);
+    }
+
+    @Override
     public Result updatePromoterLabel(JSONObject result) {
         Long promoterId = result.getLong("promoterId");
         Long userId = result.getLong("userId");

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

@@ -417,4 +417,12 @@
           AND user_id = #{userId}
         order by t2.id
     </select>
+    <select id="getOnlyPromoterInfoByUserId" resultType="com.ruixuan.isc.entity.KuaishouPromoter">
+        <include refid="selectKuaishouPromoterVo"/>
+        where promoter_id = #{promoterId}
+        <if test="userId != null ">
+            AND user_id = #{userId}
+        </if>
+        limit 1
+    </select>
 </mapper>