From 16a21995026ebf2b5853c5dee4b5a30a26e13abd Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Wed, 29 Jul 2020 11:26:55 +0800
Subject: [PATCH] 20200729  代码提交

---
 src/main/java/com/xcong/excoin/modules/member/entity/MemberEntity.java                      |    9 +++
 src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderProfitInfoDao.java       |    8 ++
 src/main/java/com/xcong/excoin/modules/documentary/vo/MemberIsTradeVo.java                  |   14 ++++
 src/main/java/com/xcong/excoin/modules/documentary/controller/DocumentaryController.java    |   39 +++++++++++++
 src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java          |   11 +++
 src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java |   42 ++++++++++++++
 src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderProfitInfoEntity.java |   57 +++++++++++++++++++
 7 files changed, 180 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/documentary/controller/DocumentaryController.java b/src/main/java/com/xcong/excoin/modules/documentary/controller/DocumentaryController.java
new file mode 100644
index 0000000..28ec4f5
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/documentary/controller/DocumentaryController.java
@@ -0,0 +1,39 @@
+package com.xcong.excoin.modules.documentary.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.xcong.excoin.common.response.Result;
+import com.xcong.excoin.modules.documentary.service.DocumentaryService;
+import com.xcong.excoin.modules.documentary.vo.MemberIsTradeVo;
+import com.xcong.excoin.modules.member.parameter.vo.AppVersionListVo;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import lombok.extern.slf4j.Slf4j;
+
+@RestController
+@Slf4j
+@RequestMapping(value = "/api/documentary")
+@Api(value = "MemberQuickBuySaleController", tags = "跟单")
+public class DocumentaryController {
+	
+	@Autowired
+	DocumentaryService documentaryService;
+	
+	/**
+	 *  获取用户类型是否是交易员
+	 */
+	@ApiOperation(value="getMemberIsTradeInfo", notes="获取用户类型是否是交易员")
+	@ApiResponses({@ApiResponse( code = 200, message = "success", response = MemberIsTradeVo.class)})
+	@GetMapping(value = "/getMemberIsTradeInfo")
+	public Result  getMemberIsTradeInfo() {
+		return documentaryService.getMemberIsTradeInfo();
+	}
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderProfitInfoDao.java b/src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderProfitInfoDao.java
new file mode 100644
index 0000000..d6c72c5
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderProfitInfoDao.java
@@ -0,0 +1,8 @@
+package com.xcong.excoin.modules.documentary.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity;
+
+public interface FollowTraderProfitInfoDao extends BaseMapper<FollowTraderProfitInfoEntity> {
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderProfitInfoEntity.java b/src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderProfitInfoEntity.java
new file mode 100644
index 0000000..be1a42e
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderProfitInfoEntity.java
@@ -0,0 +1,57 @@
+package com.xcong.excoin.modules.documentary.entity;
+
+import java.math.BigDecimal;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.xcong.excoin.common.system.base.BaseEntity;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 交易员收益信息
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName("follow_trader_profit_info")
+public class FollowTraderProfitInfoEntity extends BaseEntity{
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 6139436588367517567L;
+	
+	/**
+     * 交易员ID
+     */
+    private Long traderId;
+    /**
+     * 会员ID
+     */
+    private Long memberId;
+    /**
+     * 累计收益率
+     */
+    private BigDecimal totalProfitRatio;
+    /**
+     * 带单总收益
+     */
+    private BigDecimal totalProfit;
+    /**
+     * 跟随者总收益
+     */
+    private BigDecimal followerTotalProfit;
+    /**
+     * 胜率
+     */
+    private BigDecimal winRate;
+    /**
+     * 累计跟随人数
+     */
+    private BigDecimal totalFollowerCnt;
+    /**
+     * 交易笔数
+     */
+    private BigDecimal totalOrderCnt;
+    
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java b/src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java
new file mode 100644
index 0000000..d66d8ef
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java
@@ -0,0 +1,11 @@
+package com.xcong.excoin.modules.documentary.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xcong.excoin.common.response.Result;
+import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity;
+
+public interface DocumentaryService extends IService<FollowTraderProfitInfoEntity> {
+
+	public Result getMemberIsTradeInfo();
+
+}
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
new file mode 100644
index 0000000..16bf169
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
@@ -0,0 +1,42 @@
+package com.xcong.excoin.modules.documentary.service.impl;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xcong.excoin.common.LoginUserUtils;
+import com.xcong.excoin.common.response.Result;
+import com.xcong.excoin.modules.documentary.dao.FollowTraderProfitInfoDao;
+import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity;
+import com.xcong.excoin.modules.documentary.service.DocumentaryService;
+import com.xcong.excoin.modules.documentary.vo.MemberIsTradeVo;
+import com.xcong.excoin.modules.member.dao.MemberDao;
+import com.xcong.excoin.modules.member.entity.MemberEntity;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+@Service
+public class DocumentaryServiceImpl extends ServiceImpl<FollowTraderProfitInfoDao, FollowTraderProfitInfoEntity> implements DocumentaryService {
+
+	@Resource
+    private MemberDao memberDao;
+	
+	@Override
+	public Result getMemberIsTradeInfo() {
+		//获取用户ID
+        Long memberId = LoginUserUtils.getAppLoginUser().getId();
+        MemberEntity member = memberDao.selectById(memberId);
+        
+        Integer isTrader = member.getIsTrader();
+        MemberIsTradeVo memberIsTradeVo = new MemberIsTradeVo();
+        if(MemberEntity.IS_TRADER_Y.equals(isTrader)) {
+        	memberIsTradeVo.setIsTrade(MemberEntity.IS_TRADER_Y);
+        }else {
+        	memberIsTradeVo.setIsTrade(MemberEntity.IS_TRADER_N);
+        }
+        return Result.ok(memberIsTradeVo);
+	}
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/vo/MemberIsTradeVo.java b/src/main/java/com/xcong/excoin/modules/documentary/vo/MemberIsTradeVo.java
new file mode 100644
index 0000000..06e5e5d
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/documentary/vo/MemberIsTradeVo.java
@@ -0,0 +1,14 @@
+package com.xcong.excoin.modules.documentary.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "MemberInfoVo", description = "会员类型")
+public class MemberIsTradeVo {
+	
+	@ApiModelProperty(value = "类型:1:是交易员 2:否")
+    private Integer isTrade;
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/member/entity/MemberEntity.java b/src/main/java/com/xcong/excoin/modules/member/entity/MemberEntity.java
index 1268b7f..31126d9 100644
--- a/src/main/java/com/xcong/excoin/modules/member/entity/MemberEntity.java
+++ b/src/main/java/com/xcong/excoin/modules/member/entity/MemberEntity.java
@@ -74,6 +74,15 @@
     public static final int IS_PROFIT_Y = 1;
 
     public static final int IS_PROFIT_N = 0;
+    
+    public static final Integer IS_TRADER_Y = 1;
+    
+    public static final Integer IS_TRADER_N = 2;
+    
+    /**
+     * 1是2否
+     */
+    private Integer isTrader;
 
     /**
      * 手机号(包含国际手机号)

--
Gitblit v1.9.1