| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | |
| | | @Service
|
| | | public class UserExtraTaoBaoInfoServiceImpl implements UserExtraTaoBaoInfoService {
|
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoMapper userExtraTaoBaoInfoMapper;
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoMapper userExtraTaoBaoInfoMapper;
|
| | |
|
| | | @Resource
|
| | | private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
|
| | | @Resource
|
| | | private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
|
| | |
|
| | | @Resource
|
| | | private UserAccountBindingHistoryService userAccountBindingHistoryService;
|
| | | @Resource
|
| | | private UserAccountBindingHistoryService userAccountBindingHistoryService;
|
| | |
|
| | | @Resource
|
| | | private RocketMQManager rocketMQManager;
|
| | | @Resource
|
| | | private RocketMQManager rocketMQManager;
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void addRelationId(Long uid, String relationId, String taoBaoUid, String nickName, boolean valid)
|
| | | throws UserExtraTaoBaoInfoException {
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | if (uid == null || StringUtil.isNullOrEmpty(relationId) || StringUtil.isNullOrEmpty(taoBaoUid)) {
|
| | | throw new UserExtraTaoBaoInfoException(1, "传递参数为空");
|
| | | }
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void addRelationId(Long uid, String relationId, String taoBaoUid, String nickName, boolean valid)
|
| | | throws UserExtraTaoBaoInfoException {
|
| | |
|
| | | // 验证taoBaoUid是否被封禁
|
| | | if (validateTaoBaoUidForbidden(taoBaoUid)) {
|
| | | throw new UserExtraTaoBaoInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
|
| | | }
|
| | | if (uid == null || StringUtil.isNullOrEmpty(relationId) || StringUtil.isNullOrEmpty(taoBaoUid)) {
|
| | | throw new UserExtraTaoBaoInfoException(1, "传递参数为空");
|
| | | }
|
| | |
|
| | | UserExtraTaoBaoInfo taoBaoInfo = new UserExtraTaoBaoInfo();
|
| | | taoBaoInfo.setUser(new UserInfo(uid));
|
| | | taoBaoInfo.setTaoBaoNickName(nickName);
|
| | | taoBaoInfo.setTaoBaoUid(taoBaoUid);
|
| | | taoBaoInfo.setRelationId(relationId);
|
| | | taoBaoInfo.setRelationValid(valid);
|
| | | taoBaoInfo.setRelationUpdateTime(new Date());
|
| | | // 验证taoBaoUid是否被封禁
|
| | | if (validateTaoBaoUidForbidden(taoBaoUid)) {
|
| | | throw new UserExtraTaoBaoInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
|
| | | }
|
| | |
|
| | | userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | //清除该用户的授权信息
|
| | | // userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | SystemEnum system = userInfoService.getUserSystem(uid);
|
| | | List<UserExtraTaoBaoInfo> list = userExtraTaoBaoInfoMapper.listByTaoBaoUid(taoBaoUid,system);
|
| | | UserExtraTaoBaoInfo existInfo = null;
|
| | | if (list != null)
|
| | | for (UserExtraTaoBaoInfo tb : list) {
|
| | | SystemEnum se = userInfoService.getUserSystem(tb.getUser().getId());
|
| | | if (se == system) {
|
| | | existInfo = tb;
|
| | | break;
|
| | | }
|
| | | }
|
| | | UserExtraTaoBaoInfo taoBaoInfo = new UserExtraTaoBaoInfo();
|
| | | taoBaoInfo.setUser(new UserInfo(uid));
|
| | | taoBaoInfo.setTaoBaoNickName(nickName);
|
| | | taoBaoInfo.setTaoBaoUid(taoBaoUid);
|
| | | taoBaoInfo.setRelationId(relationId);
|
| | | taoBaoInfo.setRelationValid(valid);
|
| | | taoBaoInfo.setRelationUpdateTime(new Date());
|
| | |
|
| | | List<UserExtraTaoBaoInfo> list = userExtraTaoBaoInfoMapper.listByTaoBaoUid(taoBaoUid);
|
| | | if (list == null || list.size() == 0) {
|
| | | // 新增
|
| | | taoBaoInfo.setCreateTime(new Date());
|
| | | userExtraTaoBaoInfoMapper.insertSelective(taoBaoInfo);
|
| | | } else {
|
| | | // 取第一个替换uid 等信息
|
| | | taoBaoInfo.setId(list.get(0).getId());
|
| | | taoBaoInfo.setUpdateTime(new Date());
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(taoBaoInfo);
|
| | |
|
| | | // // 清空多余已绑定数据
|
| | | // if (list.size() > 1) {
|
| | | // for (int i = 1; i < list.size(); i++) {
|
| | | // clearTaoBaoInfo(list.get(i));
|
| | | // }
|
| | | // }
|
| | | }
|
| | | }
|
| | | if (existInfo==null) {
|
| | | // 新增
|
| | | taoBaoInfo.setCreateTime(new Date());
|
| | | userExtraTaoBaoInfoMapper.insertSelective(taoBaoInfo);
|
| | | } else {
|
| | | // 取第一个替换uid 等信息
|
| | | taoBaoInfo.setId(existInfo.getId());
|
| | | taoBaoInfo.setUpdateTime(new Date());
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(taoBaoInfo);
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void addSpecialId(Long uid, String specialId, String taoBaoUid, String nickName, boolean valid)
|
| | | throws UserExtraTaoBaoInfoException {
|
| | | // // 清空多余已绑定数据
|
| | | // if (list.size() > 1) {
|
| | | // for (int i = 1; i < list.size(); i++) {
|
| | | // clearTaoBaoInfo(list.get(i));
|
| | | // }
|
| | | // }
|
| | | }
|
| | | }
|
| | |
|
| | | if (uid == null || StringUtil.isNullOrEmpty(specialId) || StringUtil.isNullOrEmpty(taoBaoUid)) {
|
| | | throw new UserExtraTaoBaoInfoException(1, "传递参数为空");
|
| | | }
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void addSpecialId(Long uid, String specialId, String taoBaoUid, String nickName, boolean valid)
|
| | | throws UserExtraTaoBaoInfoException {
|
| | |
|
| | | // 验证taoBaoUid是否被封禁
|
| | | if (validateTaoBaoUidForbidden(taoBaoUid)) {
|
| | | throw new UserExtraTaoBaoInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
|
| | | }
|
| | | if (uid == null || StringUtil.isNullOrEmpty(specialId) || StringUtil.isNullOrEmpty(taoBaoUid)) {
|
| | | throw new UserExtraTaoBaoInfoException(1, "传递参数为空");
|
| | | }
|
| | |
|
| | | UserExtraTaoBaoInfo taoBaoInfo = new UserExtraTaoBaoInfo();
|
| | | taoBaoInfo.setUser(new UserInfo(uid));
|
| | | taoBaoInfo.setTaoBaoNickName(nickName);
|
| | | taoBaoInfo.setTaoBaoUid(taoBaoUid);
|
| | | taoBaoInfo.setSpecialValid(valid);
|
| | | taoBaoInfo.setSpecialId(specialId);
|
| | | taoBaoInfo.setSpecialUpdateTime(new Date());
|
| | | // 验证taoBaoUid是否被封禁
|
| | | if (validateTaoBaoUidForbidden(taoBaoUid)) {
|
| | | throw new UserExtraTaoBaoInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
|
| | | }
|
| | |
|
| | | userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | // userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | SystemEnum system = userInfoService.getUserSystem(uid);
|
| | |
|
| | | List<UserExtraTaoBaoInfo> list = userExtraTaoBaoInfoMapper.listByTaoBaoUid(taoBaoUid);
|
| | | if (list == null || list.size() == 0) {
|
| | | // 新增
|
| | | taoBaoInfo.setCreateTime(new Date());
|
| | | userExtraTaoBaoInfoMapper.insertSelective(taoBaoInfo);
|
| | | } else {
|
| | | // 取第一个替换uid 等信息
|
| | | taoBaoInfo.setId(list.get(0).getId());
|
| | | taoBaoInfo.setUpdateTime(new Date());
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(taoBaoInfo);
|
| | | UserExtraTaoBaoInfo taoBaoInfo = new UserExtraTaoBaoInfo();
|
| | | taoBaoInfo.setUser(new UserInfo(uid));
|
| | | taoBaoInfo.setTaoBaoNickName(nickName);
|
| | | taoBaoInfo.setTaoBaoUid(taoBaoUid);
|
| | | taoBaoInfo.setSpecialValid(valid);
|
| | | taoBaoInfo.setSpecialId(specialId);
|
| | | taoBaoInfo.setSpecialUpdateTime(new Date());
|
| | |
|
| | | // 清空多余已绑定数据
|
| | | if (list.size() > 1) {
|
| | | for (int i = 1; i < list.size(); i++) {
|
| | | clearTaoBaoInfo(list.get(i));
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void saveUserTaoBaoInfo(Long uid, String relationId, String specialId, String taoBaoUid, String nickName,
|
| | | boolean valid) throws UserExtraTaoBaoInfoException {
|
| | | List<UserExtraTaoBaoInfo> list = userExtraTaoBaoInfoMapper.listByTaoBaoUid(taoBaoUid,system);
|
| | | if (list == null || list.size() == 0) {
|
| | | // 新增
|
| | | taoBaoInfo.setCreateTime(new Date());
|
| | | userExtraTaoBaoInfoMapper.insertSelective(taoBaoInfo);
|
| | | } else {
|
| | | // 取第一个替换uid 等信息
|
| | | taoBaoInfo.setId(list.get(0).getId());
|
| | | taoBaoInfo.setUpdateTime(new Date());
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(taoBaoInfo);
|
| | |
|
| | | if (uid == null || StringUtil.isNullOrEmpty(relationId) || StringUtil.isNullOrEmpty(specialId)
|
| | | || StringUtil.isNullOrEmpty(taoBaoUid)) {
|
| | | throw new UserExtraTaoBaoInfoException(1, "传递参数部分为空");
|
| | | }
|
| | | // 清空多余已绑定数据
|
| | | if (list.size() > 1) {
|
| | | for (int i = 1; i < list.size(); i++) {
|
| | | clearTaoBaoInfo(list.get(i));
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // 验证taoBaoUid是否被封禁
|
| | | if (validateTaoBaoUidForbidden(taoBaoUid)) {
|
| | | throw new UserExtraTaoBaoInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
|
| | | }
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void saveUserTaoBaoInfo(Long uid, String relationId, String specialId, String taoBaoUid, String nickName,
|
| | | boolean valid) throws UserExtraTaoBaoInfoException {
|
| | |
|
| | | UserExtraTaoBaoInfo taoBaoInfo = new UserExtraTaoBaoInfo();
|
| | | taoBaoInfo.setTaoBaoUid(taoBaoUid);
|
| | | taoBaoInfo.setTaoBaoNickName(nickName);
|
| | | taoBaoInfo.setUser(new UserInfo(uid));
|
| | | // 渠道
|
| | | taoBaoInfo.setRelationValid(valid);
|
| | | taoBaoInfo.setRelationId(relationId);
|
| | | taoBaoInfo.setRelationUpdateTime(new Date());
|
| | | // 绑定
|
| | | taoBaoInfo.setSpecialValid(valid);
|
| | | taoBaoInfo.setSpecialId(specialId);
|
| | | taoBaoInfo.setSpecialUpdateTime(new Date());
|
| | | if (uid == null || StringUtil.isNullOrEmpty(relationId) || StringUtil.isNullOrEmpty(specialId)
|
| | | || StringUtil.isNullOrEmpty(taoBaoUid)) {
|
| | | throw new UserExtraTaoBaoInfoException(1, "传递参数部分为空");
|
| | | }
|
| | |
|
| | | List<UserExtraTaoBaoInfo> list = userExtraTaoBaoInfoMapper.listByTaoBaoUid(taoBaoUid);
|
| | | // 验证taoBaoUid是否被封禁
|
| | | if (validateTaoBaoUidForbidden(taoBaoUid)) {
|
| | | throw new UserExtraTaoBaoInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
|
| | | }
|
| | |
|
| | | // 判断之前用户是否绑定过
|
| | | UserExtraTaoBaoInfo info = userExtraTaoBaoInfoMapper.selectByUid(uid);
|
| | | SystemEnum system=userInfoService.getUserSystem(uid);
|
| | |
|
| | | // 清除之前的用户ID
|
| | | userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | Long fromUid = null;
|
| | | UserExtraTaoBaoInfo taoBaoInfo = new UserExtraTaoBaoInfo();
|
| | | taoBaoInfo.setTaoBaoUid(taoBaoUid);
|
| | | taoBaoInfo.setTaoBaoNickName(nickName);
|
| | | taoBaoInfo.setUser(new UserInfo(uid));
|
| | | // 渠道
|
| | | taoBaoInfo.setRelationValid(valid);
|
| | | taoBaoInfo.setRelationId(relationId);
|
| | | taoBaoInfo.setRelationUpdateTime(new Date());
|
| | | // 绑定
|
| | | taoBaoInfo.setSpecialValid(valid);
|
| | | taoBaoInfo.setSpecialId(specialId);
|
| | | taoBaoInfo.setSpecialUpdateTime(new Date());
|
| | |
|
| | | 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());
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(taoBaoInfo);
|
| | | List<UserExtraTaoBaoInfo> list = userExtraTaoBaoInfoMapper.listByTaoBaoUid(taoBaoUid,system);
|
| | |
|
| | | // 清空多余已绑定数据
|
| | | if (list.size() > 1) {
|
| | | for (int i = 1; i < list.size(); i++) {
|
| | | clearTaoBaoInfo(list.get(i));
|
| | | }
|
| | | }
|
| | | }
|
| | | // 判断之前用户是否绑定过
|
| | | UserExtraTaoBaoInfo info = userExtraTaoBaoInfoMapper.selectByUid(uid);
|
| | |
|
| | | // 加入绑定记录
|
| | | UserAccountBindingHistory history = new UserAccountBindingHistory();
|
| | | history.setContent(taoBaoUid);
|
| | | history.setType(UserAccountBindingHistory.TYPE_TB);
|
| | | history.setUid(uid);
|
| | | // 清除之前的用户ID
|
| | | userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | Long fromUid = null;
|
| | |
|
| | | // 之前已经绑定电话号码
|
| | | if (info != null)
|
| | | history.setFirst(false);
|
| | | else
|
| | | history.setFirst(true);
|
| | | userAccountBindingHistoryService.addUserAccountBindingHistory(history);
|
| | | 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());
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(taoBaoInfo);
|
| | |
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.taobaoBindSuccess,
|
| | | new TaoBaoBindSuccessMQMsg(uid, fromUid, taoBaoUid, new Date()));
|
| | | |
| | | rocketMQManager.sendNormalMsg(message, null);
|
| | | }
|
| | | // 清空多余已绑定数据
|
| | | if (list.size() > 1) {
|
| | | for (int i = 1; i < list.size(); i++) {
|
| | | clearTaoBaoInfo(list.get(i));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 验证taoBaoUid 是否被封
|
| | | * |
| | | * @param taoBaoUid
|
| | | * @return
|
| | | */
|
| | | public boolean validateTaoBaoUidForbidden(String taoBaoUid) {
|
| | | boolean validate = false;
|
| | | ForbiddenUserIdentifyCode identifyCode = forbiddenUserIdentifyCodeService
|
| | | .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.taobaoUid, taoBaoUid);
|
| | | // 账号被封
|
| | | if (identifyCode != null && identifyCode.getEffective() != null && identifyCode.getEffective()) {
|
| | | validate = true;
|
| | | }
|
| | | return validate;
|
| | | }
|
| | | // 加入绑定记录
|
| | | UserAccountBindingHistory history = new UserAccountBindingHistory();
|
| | | history.setContent(taoBaoUid);
|
| | | history.setType(UserAccountBindingHistory.TYPE_TB);
|
| | | history.setUid(uid);
|
| | |
|
| | | /**
|
| | | * 清空多余绑定淘宝账号信息
|
| | | * |
| | | * @param otherInfo
|
| | | */
|
| | | public void clearTaoBaoInfo(UserExtraTaoBaoInfo otherInfo) {
|
| | | otherInfo.setUser(null);
|
| | | otherInfo.setTaoBaoUid(null);
|
| | | otherInfo.setTaoBaoNickName(null);
|
| | | // 之前已经绑定电话号码
|
| | | if (info != null)
|
| | | history.setFirst(false);
|
| | | else
|
| | | history.setFirst(true);
|
| | | userAccountBindingHistoryService.addUserAccountBindingHistory(history);
|
| | |
|
| | | otherInfo.setRelationValid(null);
|
| | | otherInfo.setRelationId(null);
|
| | | otherInfo.setRelationUpdateTime(null);
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.taobaoBindSuccess,
|
| | | new TaoBaoBindSuccessMQMsg(uid, fromUid, taoBaoUid, new Date()));
|
| | |
|
| | | otherInfo.setSpecialValid(null);
|
| | | otherInfo.setSpecialId(null);
|
| | | otherInfo.setSpecialUpdateTime(new Date());
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKey(otherInfo);
|
| | | }
|
| | | rocketMQManager.sendNormalMsg(message, null);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserExtraTaoBaoInfo getByUid(Long uid) {
|
| | | return userExtraTaoBaoInfoMapper.selectByUid(uid);
|
| | | }
|
| | | /**
|
| | | * 验证taoBaoUid 是否被封
|
| | | *
|
| | | * @param taoBaoUid
|
| | | * @return
|
| | | */
|
| | | public boolean validateTaoBaoUidForbidden(String taoBaoUid) {
|
| | | boolean validate = false;
|
| | | ForbiddenUserIdentifyCode identifyCode = forbiddenUserIdentifyCodeService
|
| | | .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.taobaoUid, taoBaoUid);
|
| | | // 账号被封
|
| | | if (identifyCode != null && identifyCode.getEffective() != null && identifyCode.getEffective()) {
|
| | | validate = true;
|
| | | }
|
| | | return validate;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateSelective(UserExtraTaoBaoInfo ue) {
|
| | | if (ue == null || ue.getId() == null)
|
| | | return;
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(ue);
|
| | | }
|
| | | /**
|
| | | * 清空多余绑定淘宝账号信息
|
| | | *
|
| | | * @param otherInfo
|
| | | */
|
| | | public void clearTaoBaoInfo(UserExtraTaoBaoInfo otherInfo) {
|
| | | otherInfo.setUser(null);
|
| | | otherInfo.setTaoBaoUid(null);
|
| | | otherInfo.setTaoBaoNickName(null);
|
| | |
|
| | | @Override
|
| | | public void unBindUid(Long uid) {
|
| | | userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | }
|
| | | otherInfo.setRelationValid(null);
|
| | | otherInfo.setRelationId(null);
|
| | | otherInfo.setRelationUpdateTime(null);
|
| | |
|
| | | @Override
|
| | | public void bindTaoBaoOrderEnd6Num(String taoBaoUid, String orderId) {
|
| | | if (taoBaoUid == null || StringUtil.isNullOrEmpty(orderId))
|
| | | return;
|
| | | UserExtraTaoBaoInfo extraInfo = userExtraTaoBaoInfoMapper.selectByTaoBaoUid(taoBaoUid);
|
| | | if (extraInfo != null) {
|
| | | UserExtraTaoBaoInfo update = new UserExtraTaoBaoInfo();
|
| | | update.setId(extraInfo.getId());
|
| | | update.setTaoBaoOrderEnd6Num(orderId);
|
| | | update.setUpdateTime(new Date());
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | otherInfo.setSpecialValid(null);
|
| | | otherInfo.setSpecialId(null);
|
| | | otherInfo.setSpecialUpdateTime(new Date());
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKey(otherInfo);
|
| | | }
|
| | |
|
| | | }
|
| | | @Override
|
| | | public UserExtraTaoBaoInfo getByUid(Long uid) {
|
| | | return userExtraTaoBaoInfoMapper.selectByUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserExtraTaoBaoInfo getByRelationId(String relationId) {
|
| | | if (StringUtil.isNullOrEmpty(relationId))
|
| | | return null;
|
| | | return userExtraTaoBaoInfoMapper.selectByRelationIdWithUidNotNull(relationId);
|
| | | }
|
| | | @Override
|
| | | public void updateSelective(UserExtraTaoBaoInfo ue) {
|
| | | if (ue == null || ue.getId() == null)
|
| | | return;
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(ue);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserExtraTaoBaoInfo getBySpecialId(String specialId) {
|
| | | if (StringUtil.isNullOrEmpty(specialId))
|
| | | return null;
|
| | | return userExtraTaoBaoInfoMapper.selectBySpecialIdWithUidNotNull(specialId);
|
| | | }
|
| | | @Override
|
| | | public void unBindUid(Long uid) {
|
| | | userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String getRelationIdByUid(Long uid) {
|
| | | UserExtraTaoBaoInfo extraInfo = getByUid(uid);
|
| | | String relationId = null;
|
| | | if (extraInfo != null && extraInfo.getRelationId() != null && extraInfo.getRelationValid() != null
|
| | | && extraInfo.getRelationValid() == true)
|
| | | relationId = extraInfo.getRelationId();
|
| | | return relationId;
|
| | | }
|
| | | @Override
|
| | | public void bindTaoBaoOrderEnd6Num(String taoBaoUid, String orderId) {
|
| | | if (taoBaoUid == null || StringUtil.isNullOrEmpty(orderId))
|
| | | return;
|
| | | UserExtraTaoBaoInfo extraInfo = userExtraTaoBaoInfoMapper.selectByTaoBaoUid(taoBaoUid,null);
|
| | | if (extraInfo != null) {
|
| | | UserExtraTaoBaoInfo update = new UserExtraTaoBaoInfo();
|
| | | update.setId(extraInfo.getId());
|
| | | update.setTaoBaoOrderEnd6Num(orderId);
|
| | | update.setUpdateTime(new Date());
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserExtraTaoBaoInfo getByRelationId(String relationId,SystemEnum system) {
|
| | | if (StringUtil.isNullOrEmpty(relationId))
|
| | | return null;
|
| | | return userExtraTaoBaoInfoMapper.selectByRelationIdWithUidNotNull(relationId,system);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserExtraTaoBaoInfo getBySpecialId(String specialId,SystemEnum system) {
|
| | | if (StringUtil.isNullOrEmpty(specialId))
|
| | | return null;
|
| | | return userExtraTaoBaoInfoMapper.selectBySpecialIdWithUidNotNull(specialId,system);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String getRelationIdByUid(Long uid) {
|
| | | UserExtraTaoBaoInfo extraInfo = getByUid(uid);
|
| | | String relationId = null;
|
| | | if (extraInfo != null && extraInfo.getRelationId() != null && extraInfo.getRelationValid() != null
|
| | | && extraInfo.getRelationValid() == true)
|
| | | relationId = extraInfo.getRelationId();
|
| | | return relationId;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String getSpecialIdByUid(Long uid) {
|
| | | UserExtraTaoBaoInfo extraInfo = getByUid(uid);
|
| | | String specialId = null;
|
| | | if (extraInfo != null && extraInfo.getSpecialId() != null && extraInfo.getSpecialValid() != null
|
| | | && extraInfo.getSpecialValid() == true)
|
| | | specialId = extraInfo.getSpecialId();
|
| | | return specialId;
|
| | | }
|
| | |
|
| | | }
|