| | |
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserInviteSeparateMapper;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.ThreeSaleSeparateMQMsg;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInviteSeparate;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | @Service
|
| | | public class UserInviteSeparateServiceImpl implements UserInviteSeparateService {
|
| | |
| | | @Lazy
|
| | | @Resource
|
| | | private UserInviteValidNumService userInviteValidNumService;
|
| | | |
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void insertSelective(UserInviteSeparate record) {
|
| | |
| | | userInviteSeparateMapper.updateStateByWorkerIdAndBossId(workerId, bossId, UserInviteSeparate.STATE_SUCCESS);
|
| | | // 脱离邀请关系
|
| | | threeSaleSerivce.inviteSeparate(workerId, bossId);
|
| | | |
| | | if (!Constant.IS_TEST) {
|
| | | ThreeSaleSeparateMQMsg msg = new ThreeSaleSeparateMQMsg(bossId, workerId , new Date());
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.threeSaleSeparate, msg);
|
| | | producer.send(message);
|
| | | }
|
| | | |
| | | // 直接有效粉丝脱离-1
|
| | | userInviteValidNumService.reduceValidNumFirst(bossId, workerId);
|
| | | // 间接有效粉丝脱离-1
|