Ver Fonte

Merge branch 'add_fans_delaped' into pre

zoujiajian há 2 anos atrás
pai
commit
ef51263fb3

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/mapper/corp/CorpUserTagMapper.java

@@ -26,7 +26,7 @@ public interface CorpUserTagMapper extends BaseMapper<CorpUserTag> {
 
 	List<Long> getTagIdByCorpUserId(Long corpUserId);
 
-	UserIntentionPieView getUserIntentionPie(@Param("tagIdStr") String tagId, @Param("thisDate") String date);
+	List<UserIntentionPieView> getUserIntentionPie(@Param("tagIdStr") String tagId, @Param("thisDate") String date);
 
 	Page<CorpUserIntentionView> getCorpUserIntentionView(@Param("page") Page<CorpUserIntentionView> page, @Param("userId") Long userId, @Param("nickname") String nickname, @Param("tagIdStr") String tagId, @Param("thisDate") String date);
 }

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/entity/CorpCustomerAcquisitionLinkPopularize.java

@@ -36,7 +36,7 @@ public class CorpCustomerAcquisitionLinkPopularize extends BaseEntity {
     private Long time;
 
     /**
-     * 类型为 加粉,是否要延期回传
+     * 是否记录回传
      */
     private Boolean delayedPost;
 

+ 3 - 2
netflix-dao/src/main/resources/mapper/CorpUserTagMapper.xml

@@ -99,7 +99,8 @@
         </if>) s
         left join corp_user_follow_relation cufr on cufr.id = s.relation_id
         left join corp_user_auth ca on ca.external_userid = cufr.corp_user_id
-        inner join corp_customer_acquistion_callback ccc on ccc.corp_user_id = ca.corp_user_id
+        left join corp_user cu on cu.id = ca.corp_user_id
+        inner join corp_customer_acquistion_callback ccc on ccc.union_id = cu.unionid
         group by ccc.intention
     </select>
 
@@ -113,8 +114,8 @@
         </if>) s
         left join corp_user_follow_relation cufr on cufr.id = s.relation_id
         left join corp_user_auth ca on ca.external_userid = cufr.corp_user_id
-        left join corp_customer_acquistion_callback ccc on ccc.corp_user_id = ca.corp_user_id
         left join corp_user cu on cu.id = ca.corp_user_id
+        left join corp_customer_acquistion_callback ccc on ccc.union_id = cu.unionid
         <where>
             <if test="userId != null">
                 cu.user_id = #{userId}

+ 17 - 15
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpEventActionServiceImpl.java

@@ -1100,21 +1100,7 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
 					//如果为加粉则直接回传
 					if (corpCustomerAcquisitionLinkPopularize.getType() == 1) {
 						//如果需要延后主动回传的做持久化.
-						if(corpCustomerAcquisitionLinkPopularize.getDelayedPost()){
-							CorpCustomerAcquistionCallback corpCustomerAcquistionCallback =
-									corpCustomerAcquistionCallbackMapper.selectOne(Wrappers.lambdaQuery(CorpCustomerAcquistionCallback.class).eq(CorpCustomerAcquistionCallback::getCallback, callback).eq(CorpCustomerAcquistionCallback::getUnionId, unionId));
-							if(corpCustomerAcquistionCallback == null){
-								corpCustomerAcquistionCallback = new CorpCustomerAcquistionCallback();
-							}
-							corpCustomerAcquistionCallback.setCallback(callback);
-							corpCustomerAcquistionCallback.setEvent(corpCustomerAcquistionCallback.getEvent());
-							corpCustomerAcquistionCallback.setUnionId(unionId);
-							if(corpCustomerAcquistionCallback.getId() != null){
-								corpCustomerAcquistionCallbackMapper.updateById(corpCustomerAcquistionCallback);
-							}else {
-								corpCustomerAcquistionCallbackMapper.insert(corpCustomerAcquistionCallback);
-							}
-						}else {
+						if(!corpCustomerAcquisitionLinkPopularize.getDelayedPost()){
 							postData(callback, corpCustomerAcquisitionLinkPopularize.getEvent());
 						}
 					}else {
@@ -1126,6 +1112,22 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
 						//深度回传.
 						redisService.set(String.format(RedisService.key.CORP_CUSTOMER_ACQUISTION_UNIONID_CLICKID.getName(),unionId), json, corpCustomerAcquisitionLinkPopularize.getTime() * 60 * 60);
 					}
+
+					if(corpCustomerAcquisitionLinkPopularize.getDelayedPost()){
+						CorpCustomerAcquistionCallback corpCustomerAcquistionCallback =
+								corpCustomerAcquistionCallbackMapper.selectOne(Wrappers.lambdaQuery(CorpCustomerAcquistionCallback.class).eq(CorpCustomerAcquistionCallback::getCallback, callback).eq(CorpCustomerAcquistionCallback::getUnionId, unionId));
+						if(corpCustomerAcquistionCallback == null){
+							corpCustomerAcquistionCallback = new CorpCustomerAcquistionCallback();
+						}
+						corpCustomerAcquistionCallback.setCallback(callback);
+						corpCustomerAcquistionCallback.setEvent(corpCustomerAcquistionCallback.getEvent());
+						corpCustomerAcquistionCallback.setUnionId(unionId);
+						if(corpCustomerAcquistionCallback.getId() != null){
+							corpCustomerAcquistionCallbackMapper.updateById(corpCustomerAcquistionCallback);
+						}else {
+							corpCustomerAcquistionCallbackMapper.insert(corpCustomerAcquistionCallback);
+						}
+					}
 				}
 			}
 		}

+ 3 - 3
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/WxCorpController.java

@@ -357,9 +357,9 @@ public class WxCorpController {
 	 * 用户意愿饼图
 	 */
 	@GetMapping("/get/user/intention/pie")
-	public Result<UserIntentionPieView> getUserIntentionPie(String tagId, String date) {
-		UserIntentionPieView userIntentionPieView = corpUserTagMapper.getUserIntentionPie(tagId, date);
-		return GatewayResponse.SUCCESS.newBuilder().toResult(userIntentionPieView);
+	public Result<List<UserIntentionPieView>> getUserIntentionPie(String tagId, String date) {
+		List<UserIntentionPieView> userIntentionPieViews = corpUserTagMapper.getUserIntentionPie(tagId, date);
+		return GatewayResponse.SUCCESS.newBuilder().toResult(userIntentionPieViews);
 	}
 
 	/**