| | |
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoModifyRecord.ModifyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.exception.user.ThreeSaleException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.money.extract.BindingAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.service.inter.user.UserActiveLogService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoModifyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.tb.TaoBaoUnionAuthRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | | import com.yeshi.fanli.vo.user.UserInfoVO;
|
| | |
|
| | | import net.coobird.thumbnailator.Thumbnails;
|
| | |
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | |
|
| | | @Resource
|
| | | private UserRankService userRankService;
|
| | |
|
| | | @Resource
|
| | | private UserActiveLogService userActiveLogService;
|
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
| | |
|
| | | @Resource
|
| | | private SpreadUserImgService spreadUserImgService;
|
| | |
|
| | | @Resource
|
| | | private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
|
| | |
|
| | | @Resource
|
| | | private BindingAccountService bindingAccountService;
|
| | |
|
| | | @Lazy
|
| | | @Resource
|
| | |
| | | UserInfo temp = userInfoMapper.selectByPrimaryKey(form.getId());
|
| | | COSManager cosManager = COSManager.getInstance();
|
| | | InputStream inputStream = HttpUtil.getAsInputStream(temp.getPortrait());
|
| | | String uploadFile = cosManager.uploadFile(inputStream, UUID.randomUUID().toString()).getUrl();
|
| | | String uploadFile = cosManager.uploadFile(inputStream, FilePathEnum.userPortrait.getPath() + UUID.randomUUID().toString()).getUrl();
|
| | | UserInfo updateTemp = new UserInfo(temp.getId());
|
| | | updateTemp.setPortrait(uploadFile);
|
| | | userInfoMapper.updateByPrimaryKeySelective(updateTemp);
|
| | |
| | | return userInfoMapper.countAvaiableUser();
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | public boolean inviteWXUserInfo(String code, UserInfo inviter) {
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinWYUser(code);
|
| | | if (weiXinUser == null) {
|
| | | return false;
|
| | | }
|
| | | String wxUnionId = weiXinUser.getUnionid();
|
| | | UserInfo find = getUserByLoginTypeAndOpenId(Constant.WEIXIN, wxUnionId, Constant.APPID);
|
| | |
|
| | | if (find == null) {
|
| | | find = new UserInfo();
|
| | | find.setAppId(Constant.APPID);
|
| | | find.setWxUnionId(weiXinUser.getUnionid());
|
| | | String wxHeadImg = COSManager.getInstance()
|
| | | .uploadFile(HttpUtil.getAsInputStream(weiXinUser.getHeadimgurl()),
|
| | | Constant.WXHEADURL + UUID.randomUUID().toString())
|
| | | .getUrl();
|
| | | find.setPortrait(wxHeadImg);
|
| | | find.setWxPic(wxHeadImg);
|
| | | find.setNickName(weiXinUser.getNickname());
|
| | | find.setWxName(weiXinUser.getNickname());
|
| | | find.setLoginType(Constant.WEIXIN);
|
| | | find.setRank(0);
|
| | | find.setWxOpenId(weiXinUser.getOpenid());
|
| | | BusinessSystem system = new BusinessSystem(Constant.FANLI);
|
| | | system.setPlatform(1);
|
| | | find.setSystem(system);
|
| | | }
|
| | |
|
| | | try {
|
| | | threeSaleSerivce.bind(find, inviter);
|
| | | return true;
|
| | | } catch (ThreeSaleException e) {
|
| | | e.printStackTrace();
|
| | | return false;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Transactional
|
| | | public void unBindUserInfo(UserInfo user, int type) {
|
| | |
| | |
|
| | | @Override
|
| | | public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days,
|
| | | String startTime, String endTime) {
|
| | | return userInfoMapper.queryCount(userState, key, keyType, userRank, days, startTime, endTime);
|
| | | String startTime, String endTime,Integer userType, String level, Integer activeCode) {
|
| | | return userInfoMapper.queryCount(userState, key, keyType, userRank, days, startTime, endTime,userType, level, activeCode);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<UserInfoVO> query(long start, int count, Integer userState, String key, Integer keyType,
|
| | | String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode) {
|
| | | String userRank, Integer days, String startTime, String endTime, Integer orderField, Integer orderMode,
|
| | | Integer userType, String level, Integer activeCode) {
|
| | |
|
| | | List<UserInfoVO> userList = userInfoMapper.query(start, count, userState, key, keyType, userRank, days,
|
| | | startTime, endTime, orderField, orderMode);
|
| | | startTime, endTime, orderField, orderMode,userType, level, activeCode);
|
| | |
|
| | | if (userList == null || userList.size() == 0) {
|
| | | return null;
|
| | |
| | | // 二度队员数量
|
| | | int secondTeamCount = shareMapper.mySecondTeamCount(uid + "");
|
| | | userInfoVO.setCountLevelTwo(secondTeamCount);
|
| | | |
| | | String userLevel = userInfoVO.getUserLevel();
|
| | | if (!StringUtil.isNullOrEmpty(userLevel)) {
|
| | | userInfoVO.setUserLevel(UserLevelUtil.getByEnumName(userLevel).getName());
|
| | | }
|
| | | |
| | | String inviteCode = userInfoVO.getInviteCode();
|
| | | if (!StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | userInfoVO.setInviteCode("已激活");
|
| | | } else {
|
| | | userInfoVO.setInviteCode("未激活");
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | * @return
|
| | | */
|
| | | @Override
|
| | | public UserInfo getInfoByPhoneOrInviteCode(String phone, String inviteCode) {
|
| | | return userInfoMapper.getInfoByPhoneOrInviteCode(phone, inviteCode);
|
| | | public UserInfo getUserInfoByInviteCode(String inviteCode) {
|
| | | return userInfoMapper.getUserInfoByInviteCode(inviteCode);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | Thumbnails.of(file.getInputStream()).size(200, 200).toFile(targetPath);
|
| | |
|
| | | // 执行上传
|
| | | String filePath = "/img/user/" + UUID.randomUUID().toString().replace("-", "") + ".jpg";
|
| | | String filePath =FilePathEnum.userPortrait.getPath() + UUID.randomUUID().toString().replace("-", "") + ".jpg";
|
| | | String fileLink = COSManager.getInstance().uploadFile(new File(targetPath), filePath).getUrl();
|
| | |
|
| | | // 删除本地图片
|
| | |
| | | userInfoMapper.updateByPrimaryKeySelective(userInfo);
|
| | |
|
| | | // 删除原头像
|
| | | if (!StringUtil.isNullOrEmpty(portrait) && portrait.contains("/img/user/")) {
|
| | | if (!StringUtil.isNullOrEmpty(portrait)) {
|
| | | COSManager.getInstance().deleteFile(portrait);
|
| | | }
|
| | |
|
| | |
| | | return userInfoMapper.getAutoExtractUserTo1212(start, count);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserInfo selectAvailableByPrimaryKey(Long uid) {
|
| | | return userInfoMapper.selectAvailableByPrimaryKey(uid);
|
| | | }
|
| | |
|
| | |
|
| | | }
|