From af051d7a0fa660f874e0f2aacff6c10219e62c91 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Thu, 04 Mar 2021 17:06:16 +0800
Subject: [PATCH] 20210304   申请交易员,信息初始化,由前端传入

---
 src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java |   37 ++++++++++++++++++++++++++++---------
 1 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java b/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
index 92712d1..e25ce5f 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
+++ b/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
@@ -16,6 +16,7 @@
 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;
@@ -39,6 +40,7 @@
 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;
@@ -718,7 +720,15 @@
 
 	@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);
@@ -756,15 +766,24 @@
         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);

--
Gitblit v1.9.1