| | |
| | | import com.xcong.excoin.utils.*;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
| | |
| | | import com.xcong.excoin.modules.documentary.dao.FollowTraderLabelDao;
|
| | | import com.xcong.excoin.modules.documentary.dao.FollowTraderProfitDetailDao;
|
| | | import com.xcong.excoin.modules.documentary.dao.FollowTraderProfitInfoDao;
|
| | | import com.xcong.excoin.modules.documentary.dto.BeTraderDto;
|
| | | import com.xcong.excoin.modules.documentary.dto.CancelDocumentaryOrderSetDto;
|
| | | import com.xcong.excoin.modules.documentary.dto.DocumentaryOrderSetDto;
|
| | | import com.xcong.excoin.modules.documentary.dto.FollowFollowerNoticeDto;
|
| | |
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public Result beTrader() {
|
| | | public Result beTrader(@Valid BeTraderDto beTraderDto) {
|
| | | //头像
|
| | | String avatar = beTraderDto.getAvatar();
|
| | | //昵称
|
| | | String nickname = beTraderDto.getNickname();
|
| | | //宣言
|
| | | String declaration = beTraderDto.getDeclaration();
|
| | | //标签
|
| | | String labels = beTraderDto.getLabels();
|
| | | //获取用户ID
|
| | | Long memberId = LoginUserUtils.getAppLoginUser().getId();
|
| | | MemberEntity memberEntity = memberDao.selectById(memberId);
|
| | |
| | | followTraderInfoEntity.setMemberId(memberId);
|
| | | followTraderInfoEntity.setProfitRatio(BigDecimal.valueOf(0.1));
|
| | | // followTraderInfoEntity.setAvatar(FollowTraderInfoEntity.AVATAR_DEFAULT);
|
| | | String phone = memberEntity.getPhone();
|
| | | String email = memberEntity.getEmail();
|
| | | if(StrUtil.isNotEmpty(phone)) {
|
| | | followTraderInfoEntity.setNickname(phone.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"));
|
| | | }else {
|
| | | followTraderInfoEntity.setNickname(email.replaceAll("(\\w?)(\\w+)(\\w)(@\\w+\\.[a-z]+(\\.[a-z]+)?)","$1****$3$4"));
|
| | | // String phone = memberEntity.getPhone();
|
| | | // String email = memberEntity.getEmail();
|
| | | // if(StrUtil.isNotEmpty(phone)) {
|
| | | // followTraderInfoEntity.setNickname(phone.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"));
|
| | | // }else {
|
| | | // followTraderInfoEntity.setNickname(email.replaceAll("(\\w?)(\\w+)(\\w)(@\\w+\\.[a-z]+(\\.[a-z]+)?)","$1****$3$4"));
|
| | | // }
|
| | | if(StrUtil.isNotEmpty(avatar)) {
|
| | | followTraderInfoEntity.setAvatar(avatar);
|
| | | }
|
| | | followTraderInfoEntity.setNicknameState(FollowTraderInfoEntity.STATE_N);
|
| | | followTraderInfoEntity.setDeclaration(FollowTraderInfoEntity.DECLARATION_DEFAULT);
|
| | | followTraderInfoEntity.setNickname(nickname);
|
| | | followTraderInfoEntity.setNicknameState(FollowTraderInfoEntity.STATE_Y);
|
| | | if(StrUtil.isEmpty(declaration)) {
|
| | | followTraderInfoEntity.setDeclaration(FollowTraderInfoEntity.DECLARATION_DEFAULT);
|
| | | }else {
|
| | | followTraderInfoEntity.setDeclaration(declaration);
|
| | | }
|
| | | followTraderInfoEntity.setLabels(labels);
|
| | | followTraderInfoEntity.setIsAll(FollowTraderInfoEntity.IS_ALL_N);
|
| | | followTraderInfoEntity.setProfitRatio(BigDecimal.ZERO);
|
| | | followTraderInfoEntity.setVerifyStatus(FollowTraderInfoEntity.VERIFYSTATUS_ING);
|