|
|
@@ -16,6 +16,7 @@ import com.cyksj.common.util.corp.WxCryptUtil;
|
|
|
import com.cyksj.config.corp.WeChatCorpFactory;
|
|
|
import com.cyksj.config.corp.YHLXWxCorpConfig;
|
|
|
import com.cyksj.dto.CorpOauth2UserInfo;
|
|
|
+import com.cyksj.mapper.OrderDonMapper;
|
|
|
import com.cyksj.mapper.corp.*;
|
|
|
import com.cyksj.model.dto.WxCorpEncryptDto;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
@@ -90,6 +91,9 @@ public class CorpServiceImpl implements CorpService {
|
|
|
@Autowired
|
|
|
private CorpUserTagMapper corpUserTagMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private OrderDonMapper orderDonMapper;
|
|
|
+
|
|
|
@Autowired
|
|
|
private CorpUserFollowRelationMapper corpUserFollowRelationMapper;
|
|
|
|
|
|
@@ -425,7 +429,23 @@ public class CorpServiceImpl implements CorpService {
|
|
|
});
|
|
|
}
|
|
|
if (!isExistIntentionTag.get()) {
|
|
|
- insertUserIntentionTag(corpUserPayIntention, tagId, tagName);
|
|
|
+ CorpUser corpUser = corpUserMapper.selectOne(Wrappers.lambdaQuery(CorpUser.class)
|
|
|
+ .eq(CorpUser::getUnionid, corpUserPayIntention.getUnionId())
|
|
|
+ .last("limit 1"));
|
|
|
+ Boolean isPayEp = false;
|
|
|
+ if (corpUser != null && corpUser.getUserId() != 0) {
|
|
|
+ //是否买过设备
|
|
|
+ Integer selectCount = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
+ .eq(OrderDon::getGoodsId, 15)
|
|
|
+ .eq(OrderDon::getUserId, corpUser.getUserId())
|
|
|
+ .notIn(OrderDon::getStatus, Constant.noOrderAllStatus));
|
|
|
+ if (selectCount > 0) {
|
|
|
+ isPayEp = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!isPayEp) {
|
|
|
+ insertUserIntentionTag(corpUserPayIntention, tagId, tagName);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|