| | |
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserExtraTaoBaoInfoMapper;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.TaoBaoBindSuccessMQMsg;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | @Service
|
| | | public class UserExtraTaoBaoInfoServiceImpl implements UserExtraTaoBaoInfoService {
|
| | |
| | | @Resource
|
| | | private UserAccountBindingHistoryService userAccountBindingHistoryService;
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void addRelationId(Long uid, String relationId, String taoBaoUid, String nickName, boolean valid)
|
| | | throws UserExtraTaoBaoInfoException {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void addSpecialId(Long uid, String specialId, String taoBaoUid, String nickName, boolean valid)
|
| | | throws UserExtraTaoBaoInfoException {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void saveUserTaoBaoInfo(Long uid, String relationId, String specialId, String taoBaoUid, String nickName,
|
| | | boolean valid) throws UserExtraTaoBaoInfoException {
|
| | |
| | |
|
| | | // 清除之前的用户ID
|
| | | userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | Long fromUid = null;
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | // 新增
|
| | | taoBaoInfo.setCreateTime(new Date());
|
| | | userExtraTaoBaoInfoMapper.insertSelective(taoBaoInfo);
|
| | | } else {
|
| | | if (list.get(0).getUser() != null)
|
| | | fromUid = list.get(0).getUser().getId();
|
| | | // 取第一个替换uid 等信息
|
| | | taoBaoInfo.setId(list.get(0).getId());
|
| | | taoBaoInfo.setUpdateTime(new Date());
|
| | |
| | | else
|
| | | history.setFirst(true);
|
| | | userAccountBindingHistoryService.addUserAccountBindingHistory(history);
|
| | |
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.taobaoBindSuccess,
|
| | | new TaoBaoBindSuccessMQMsg(uid, fromUid, taoBaoUid, new Date()));
|
| | | producer.send(message);
|
| | | }
|
| | |
|
| | | /**
|