|
|
@@ -20,7 +20,9 @@ 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.GroupsRelationMapper;
|
|
|
import com.cyksj.mapper.OrderDonMapper;
|
|
|
+import com.cyksj.mapper.UserTicketClearedRecordMapper;
|
|
|
import com.cyksj.mapper.corp.*;
|
|
|
import com.cyksj.mapper.corp.kf.*;
|
|
|
import com.cyksj.model.dto.CorpKfServicerDto;
|
|
|
@@ -39,6 +41,8 @@ import com.cyksj.service.corp.msg.CorpEventActionService;
|
|
|
import com.cyksj.service.corp.msg.CorpMessageHandler;
|
|
|
import com.cyksj.service.corp.msg.CorpMessageRouter;
|
|
|
import com.cyksj.service.order.OrderDonPostService;
|
|
|
+import com.cyksj.service.relation.GroupRelationFrontService;
|
|
|
+import com.cyksj.service.user.UserBindRelationService;
|
|
|
import com.cyksj.util.WxCorpUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
@@ -130,6 +134,18 @@ public class CorpServiceImpl implements CorpService {
|
|
|
@Autowired
|
|
|
private CorpKfServicerStatusChangeRecordMapper corpKfServicerStatusChangeRecordMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserBindRelationService userBindRelationService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private GroupsRelationMapper relationMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private UserTicketClearedRecordMapper userTicketClearedRecordMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private GroupRelationFrontService groupRelationFrontService;
|
|
|
+
|
|
|
@PostConstruct
|
|
|
private void init() {
|
|
|
corpMessageRouter = new CorpMessageRouter(this)
|
|
|
@@ -510,6 +526,23 @@ public class CorpServiceImpl implements CorpService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void sendCCTrialTicket(Long userId) {
|
|
|
+ //是否拥有这张车票
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ Integer selectCount = relationMapper.selectCountByGoodsId(userIdList, Constant.CLAUDE_CODE_GOODS_ID, DateTime.now());
|
|
|
+ if (selectCount > 0) {
|
|
|
+ throw BusinessRuntimeException.getInstance("已有claude code车票");
|
|
|
+ }
|
|
|
+ Integer count = userTicketClearedRecordMapper.selectCount(Wrappers.lambdaQuery(UserTicketClearedRecord.class).in(UserTicketClearedRecord::getUserId, userIdList).eq(UserTicketClearedRecord::getSkuId, Constant.DISTRIBUTE_CLAUDE_CODE_TRIAL_SKU_ID));
|
|
|
+ if (count > 0) {
|
|
|
+ throw BusinessRuntimeException.getInstance("已领取claude code体验天卡");
|
|
|
+ }
|
|
|
+
|
|
|
+ //发送claude code 体验卡
|
|
|
+ Long relationId = groupRelationFrontService.getTrialTicketByUserIdAndGoodsId(userId, Constant.DISTRIBUTE_CLAUDE_CODE_TRIAL_SKU_ID, 1);
|
|
|
+ }
|
|
|
+
|
|
|
public void insertUserIntentionTag(CorpUserPayIntention corpUserPayIntention, String tagId, String tagName) {
|
|
|
CorpUserFollowRelation corpUserFollowRelation = corpUserFollowRelationMapper.getCorpUserFollowRelation(corpUserPayIntention.getUnionId(), corpUserPayIntention.getFollowId());
|
|
|
if (corpUserFollowRelation == null) {
|