| | |
| | | import com.yeshi.buwan.dao.user.LoginUserExtraDao; |
| | | import com.yeshi.buwan.domain.user.LoginUser; |
| | | import com.yeshi.buwan.domain.user.LoginUserExtra; |
| | | import com.yeshi.buwan.exception.LoginUserException; |
| | | import com.yeshi.buwan.exception.user.LoginUserException; |
| | | import com.yeshi.buwan.exception.PPTVException; |
| | | import com.yeshi.buwan.pptv.PPTVApiUtil; |
| | | import com.yeshi.buwan.pptv.PPTVUtil; |
| | | import com.yeshi.buwan.service.inter.LoginUserService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.yeshi.utils.StringUtil; |
| | | import org.yeshi.utils.entity.wx.WeiXinUser; |
| | | |
| | |
| | | public void initExtra(LoginUserExtra extra) { |
| | | if (extra.getCreateTime() == null) |
| | | extra.setCreateTime(new Date()); |
| | | extra.setPptvUid(PPTVUtil.getPPTVUid(extra.getId())); |
| | | loginUserExtraDao.save(extra); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public LoginUserExtra initPPTVUid(String uid) { |
| | | LoginUserExtra extra = loginUserExtraDao.get(uid); |
| | | if (extra != null) { |
| | | LoginUserExtra update = new LoginUserExtra(uid); |
| | | update.setPptvUid(PPTVUtil.getPPTVUid(uid)); |
| | | loginUserExtraDao.updateSelective(update); |
| | | extra.setPptvUid(update.getPptvUid()); |
| | | } |
| | | return extra; |
| | | } |
| | | |
| | | @Override |
| | | public void updateSelectiveByPrimaryKey(LoginUser loginUser) { |
| | | loginUserDao.updateSelective(loginUser); |
| | | } |
| | |
| | | if (StringUtil.isNullOrEmpty(openId)) { |
| | | throw new PPTVException(102, "openId获取失败"); |
| | | } |
| | | LoginUserExtra update=new LoginUserExtra(); |
| | | LoginUserExtra update = new LoginUserExtra(); |
| | | update.setId(uid); |
| | | update.setPptvOpenId(openId); |
| | | updateSelectiveByPrimaryKey(update); |
| | | return openId; |
| | | } |
| | | |
| | | @Override |
| | | public void setUtdId(String uid, String utdId) { |
| | | LoginUserExtra update = new LoginUserExtra(); |
| | | update.setId(uid); |
| | | update.setUtdId(utdId); |
| | | updateSelectiveByPrimaryKey(update); |
| | | } |
| | | } |