| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserExtraTaoBaoInfoMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class UserExtraTaoBaoInfoServiceImpl implements UserExtraTaoBaoInfoService {
|
| | |
| | | private UserExtraTaoBaoInfoMapper userExtraTaoBaoInfoMapper;
|
| | |
|
| | | @Override
|
| | | public void addRelationId(Long uid, String relationId) {
|
| | | public void addRelationId(Long uid, String relationId, String taoBaoUid, boolean valid) {
|
| | | if (uid == null || relationId == null)
|
| | | return;
|
| | | UserExtraTaoBaoInfo info = getByUid(uid);
|
| | | if (info == null) {
|
| | | info = new UserExtraTaoBaoInfo();
|
| | | info.setUser(new UserInfo(uid));
|
| | | info.setCreateTime(new Date());
|
| | | info.setRelationId(relationId);
|
| | | info.setRelationUpdateTime(new Date());
|
| | | info.setRelationValid(valid);
|
| | | info.setTaoBaoUid(taoBaoUid);
|
| | | userExtraTaoBaoInfoMapper.insertSelective(info);
|
| | | } else {
|
| | | UserExtraTaoBaoInfo update = new UserExtraTaoBaoInfo();
|
| | | update.setId(info.getId());
|
| | | update.setRelationId(relationId);
|
| | | update.setRelationValid(valid);
|
| | | update.setRelationUpdateTime(new Date());
|
| | | update.setTaoBaoUid(taoBaoUid);
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void addSpecialId(Long uid, String specialId) {
|
| | | public void addSpecialId(Long uid, String specialId, String taoBaoUid, boolean valid) {
|
| | | if (uid == null || specialId == null)
|
| | | return;
|
| | | UserExtraTaoBaoInfo info = getByUid(uid);
|
| | | if (info == null) {
|
| | | info = new UserExtraTaoBaoInfo();
|
| | | info.setUser(new UserInfo(uid));
|
| | | info.setCreateTime(new Date());
|
| | | info.setSpecialId(specialId);
|
| | | info.setSpecialUpdateTime(new Date());
|
| | | info.setSpecialValid(valid);
|
| | | info.setTaoBaoUid(taoBaoUid);
|
| | | userExtraTaoBaoInfoMapper.insertSelective(info);
|
| | | } else {
|
| | | UserExtraTaoBaoInfo update = new UserExtraTaoBaoInfo();
|
| | | update.setId(info.getId());
|
| | | update.setSpecialId(specialId);
|
| | | update.setSpecialUpdateTime(new Date());
|
| | | update.setSpecialValid(valid);
|
| | | update.setTaoBaoUid(taoBaoUid);
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | |
| | | return userExtraTaoBaoInfoMapper.selectByUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateSelective(UserExtraTaoBaoInfo ue) {
|
| | | if (ue == null || ue.getId() == null)
|
| | | return;
|
| | | userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(ue);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void unBindUid(Long uid) {
|
| | | userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | }
|
| | |
|
| | | @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);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserExtraTaoBaoInfo getByRelationId(String relationId) {
|
| | | if (StringUtil.isNullOrEmpty(relationId))
|
| | | return null;
|
| | | return userExtraTaoBaoInfoMapper.selectByRelationIdWithUidNotNull(relationId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserExtraTaoBaoInfo getBySpecialId(String specialId) {
|
| | | if (StringUtil.isNullOrEmpty(specialId))
|
| | | return null;
|
| | | return userExtraTaoBaoInfoMapper.selectBySpecialIdWithUidNotNull(specialId);
|
| | | }
|
| | |
|
| | | }
|