Procházet zdrojové kódy

Merge remote-tracking branch 'origin/pre' into pre

zwhui před 2 roky
rodič
revize
dd6fb13d38

+ 3 - 0
netflix-dao/src/main/java/com/cyksj/mapper/corp/CorpUserMapper.java

@@ -17,4 +17,7 @@ public interface CorpUserMapper extends BaseMapper<CorpUser> {
 	@Select("select u.id from (select corp_user_id from corp_user_auth where wx_corp_id = #{wxCorpId} and external_userid = #{corpUserId} limit 1) ca inner join corp_user cu on cu.id = ca.corp_user_id and cu.unionid != ''" +
 			" inner join user u on u.uionid = cu.unionid")
 	Long selectUserIdByCropUserId(@Param("wxCorpId") Long wxCorpId, @Param("corpUserId") String corpUserId);
+
+	@Select("select external_userid from (select id from corp_user where unionid = #{unionid} limit 1 ) cu inner join corp_user_auth ca on ca.corp_user_id = cu.id limit 1")
+	String selectUserExternalUserId(String unionid);
 }

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

@@ -29,5 +29,5 @@ public interface CorpUserTagMapper extends BaseMapper<CorpUserTag> {
 
 	Page<CorpUserIntentionView> getCorpUserIntentionView(@Param("page") Page<CorpUserIntentionView> page, @Param("userId") Long userId, @Param("nickname") String nickname, @Param("tagIdStr") String tagId, @Param("thisDate") String date, @Param("intention") Integer intention);
 
-	List<CorpUserTag> selectIntentionUserTag(String groupName);
+	List<CorpUserTag> selectIntentionUserTag(@Param("externalUserId") String externalUserId, @Param("groupName") String groupName);
 }

+ 1 - 1
netflix-dao/src/main/resources/mapper/CorpUserFollowRelationMapper.xml

@@ -135,6 +135,6 @@
               where unionid = #{unionId} limit 1) cu
                  inner join corp_user_auth ca on ca.corp_user_id = cu.id
                  inner join corp_user_follow_relation cufr on cufr.corp_user_id = ca.external_userid
-        where cufr.follow_id = #{followId}
+        where cufr.follow_id = #{followId} limit 1
     </select>
 </mapper>

+ 9 - 8
netflix-dao/src/main/resources/mapper/CorpUserTagMapper.xml

@@ -89,20 +89,19 @@
         as intention
         from (select relation_id
         from `corp_user_tag` ct
-        where tag_id = #{tagIdStr}
-        group by relation_id
-        <if test="thisDate != null">
-            having date_format(min(ct.created_time),'%Y-%m-%d') = #{thisDate}
-        </if>) s
+        where tag_id = #{tagIdStr}) 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_user cu on cu.id = ca.corp_user_id
-        inner join corp_customer_acquistion_callback ccc on ccc.union_id = cu.unionid
+        inner join corp_user_pay_intention ccc on ccc.union_id = cu.unionid
+        <if test="thisDate != null">
+            and date_format(cu.created_time,'%Y-%m-%d') = #{thisDate}
+        </if>
         group by ccc.intention
     </select>
 
     <select id="getCorpUserIntentionView" resultType="com.cyksj.model.views.CorpUserIntentionView">
-        select cu.user_id,cu.name as nickname,cu.created_time,ccc.id as intentionId,ccc.intention
+        select cu.user_id,cu.name as nickname,cu.created_time,ccc2.id as intentionId,ccc.intention
         from (select distinct cu.*
         from (select DISTINCT relation_id from corp_user_tag where tag_id = #{tagIdStr}) ct
         inner join corp_user_follow_relation cufr on cufr.id = ct.relation_id
@@ -112,7 +111,8 @@
             where date_format(cu.created_time,'%Y-%m-%d') = #{thisDate}
         </if>
         ) cu
-        left join corp_customer_acquistion_callback ccc on ccc.union_id = cu.unionid
+        left join corp_user_pay_intention ccc on ccc.union_id = cu.unionid
+        left join corp_customer_acquistion_callback ccc2 on ccc2.union_id = cu.unionid
         <where>
             <if test="userId != null">
                 cu.user_id = #{userId}
@@ -131,5 +131,6 @@
         from corp_user_tag ct
                  inner join corp_user_follow_relation cufr on cufr.id = ct.relation_id
         where ct.group_name = #{groupName}
+        and cufr.corp_user_id = #{externalUserId}
     </select>
 </mapper>

+ 5 - 1
netflix-service/src/main/java/com/cyksj/service/chatgpt/impl/ChatGptAccountServiceImpl.java

@@ -745,7 +745,11 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
         view.setScore(Math.min(score, 200));
         view.setStatus(score >= 50 ? "繁忙" : "空闲"); // 或“繁忙”
 
-        view.setType(isPlus == 1 ? "plus" : "3.5");
+        if(carName.contains("T")){
+            view.setType("Team");
+        }else {
+            view.setType(isPlus == 1 ? "Plus" : "3.5");
+        }
         int use = getCarConversationCount(carId, 3L).intValue();
         view.setUse(use);
         Long aLong = carOaiLimit(carId);

+ 5 - 2
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpServiceImpl.java

@@ -401,8 +401,11 @@ public class CorpServiceImpl implements CorpService {
 		CorpUserPayIntention.Intention intention = CorpUserPayIntention.Intention.values()[corpUserPayIntention.getIntention()];
 		String tagName = intention.getTagName();
 		String tagId = intention.getTagId();
-
-		List<CorpUserTag> corpUserTags = corpUserTagMapper.selectIntentionUserTag(Constant.EP_INTENTION_GROUP_NAME);
+		String externalUserId = corpUserMapper.selectUserExternalUserId(corpUserPayIntention.getUnionId());
+		if (StrUtil.isEmpty(externalUserId)) {
+			return;
+		}
+		List<CorpUserTag> corpUserTags = corpUserTagMapper.selectIntentionUserTag(externalUserId, Constant.EP_INTENTION_GROUP_NAME);
 		//是否存在对应标签
 		AtomicBoolean isExistIntentionTag = new AtomicBoolean(false);
 		if (CollUtil.isNotEmpty(corpUserTags)) {

+ 8 - 1
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -43,6 +43,7 @@ import com.cyksj.mapper.*;
 import com.cyksj.mapper.channel.ChannelPopularizeMapper;
 import com.cyksj.mapper.channel.ShopConfigMapper;
 import com.cyksj.mapper.corp.CorpInteractiveUserOrderRelationMapper;
+import com.cyksj.mapper.corp.CorpUserMapper;
 import com.cyksj.mapper.corp.CorpUserTagMapper;
 import com.cyksj.mapper.manage.coupon.CouponDistributePopularizeMapper;
 import com.cyksj.mapper.manage.coupon.CouponMapper;
@@ -297,6 +298,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 
 	private final CorpUserTagMapper corpUserTagMapper;
 
+	private final CorpUserMapper corpUserMapper;
+
 	private final WxCorpOps wxCorpOps;
 
 	private final List<String> noChekGoodsTemp = List.of("Apple One", "Youtube", "Spotify");
@@ -3443,7 +3446,11 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		if (goodsDon != null && goodsDon.getId() == 15) {
 			User user = userMapper.selectById(userId);
 			if (user != null && StrUtil.isNotBlank(user.getUnionid())) {
-				List<CorpUserTag> corpUserTags = corpUserTagMapper.selectIntentionUserTag(Constant.EP_INTENTION_GROUP_NAME);
+				String externalUserId = corpUserMapper.selectUserExternalUserId(user.getUnionid());
+				if (StrUtil.isEmpty(externalUserId)) {
+					return;
+				}
+				List<CorpUserTag> corpUserTags = corpUserTagMapper.selectIntentionUserTag(externalUserId, Constant.EP_INTENTION_GROUP_NAME);
 				if (CollUtil.isNotEmpty(corpUserTags)) {
 					//删除之前的意向标签
 					corpUserTags.forEach(userTag -> {