xiaoyong931011
2020-07-29 69fd409bbd0cdce5b376be46e7ca5828568607c9
20200729  代码提交
8 files added
4 files modified
296 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/documentary/controller/DocumentaryController.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderInfoDao.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderProfitDetailDao.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderProfitInfoDao.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderInfoEntity.java 63 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderProfitDetailEntity.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java 48 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/vo/FollowTraderProfitInfoListVo.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/vo/FollowTraderProfitInfoVo.java 72 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/documentary/FollowTraderInfoDao.xml 9 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/documentary/FollowTraderProfitInfoDao.xml 11 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/controller/DocumentaryController.java
@@ -1,12 +1,16 @@
package com.xcong.excoin.modules.documentary.controller;
import javax.validation.Valid;
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.RequestBody;
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.coin.parameter.dto.RecordsPageDto;
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;
@@ -36,4 +40,23 @@
        return documentaryService.getMemberIsTradeInfo();
    }
    /**
     *  交易员收益信息列表
     */
    @ApiOperation(value="getFollowTraderProfitInfo", notes="交易员收益信息列表")
    @ApiResponses({@ApiResponse( code = 200, message = "success", response = MemberIsTradeVo.class)})
    @GetMapping(value = "/getFollowTraderProfitInfo")
    public Result  getFollowTraderProfitInfo(@RequestBody @Valid RecordsPageDto recordsPageDto) {
        return documentaryService.getFollowTraderProfitInfo(recordsPageDto);
    }
}
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderInfoDao.java
New file
@@ -0,0 +1,12 @@
package com.xcong.excoin.modules.documentary.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
import io.lettuce.core.dynamic.annotation.Param;
public interface FollowTraderInfoDao extends BaseMapper<FollowTraderInfoEntity> {
    FollowTraderInfoEntity selectFollowTraderInfoEntityBytreaderId(@Param("traderId")Long traderId);
}
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderProfitDetailDao.java
New file
@@ -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.FollowTraderProfitDetailEntity;
public interface FollowTraderProfitDetailDao extends BaseMapper<FollowTraderProfitDetailEntity> {
}
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderProfitInfoDao.java
@@ -1,8 +1,16 @@
package com.xcong.excoin.modules.documentary.dao;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity;
import com.xcong.excoin.modules.documentary.vo.FollowTraderProfitInfoVo;
public interface FollowTraderProfitInfoDao extends BaseMapper<FollowTraderProfitInfoEntity> {
    IPage<FollowTraderProfitInfoVo> selectFollowTraderProfitInfoEntity(Page<FollowTraderProfitInfoVo> page,
            @Param("record")FollowTraderProfitInfoEntity memberAccountMoneyChange);
}
src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderInfoEntity.java
New file
@@ -0,0 +1,63 @@
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_info")
public class FollowTraderInfoEntity extends BaseEntity{
    /**
     *
     */
    private static final long serialVersionUID = 1L;
     /**
     * 会员ID
     */
    private Long memberId;
    /**
     * 头像
     */
    private String avatar;
    /**
     * 名称
     */
    private String nickname;
    /**
     * 宣言
     */
    private String declaration;
    /**
     * 是否满员 1-是2-否
     */
    private Integer isAll;
    public static final Integer IS_ALL_Y = 1;
    public static final Integer IS_ALL_N = 2;
    /**
     * 利润
     */
    private BigDecimal profitRatio;
    /**
     * 审核状态 1通过2不通过3待审核
     */
    private Integer verifyStatus;
    public static final Integer VERIFYSTATUS_Y = 1;
    public static final Integer VERIFYSTATUS_ING = 2;
    public static final Integer VERIFYSTATUS_N = 3;
    /**
     * 是否开启带单 1是2否
     */
    private Integer isOpen;
    public static final Integer ISOPEN_Y = 1;
    public static final Integer ISOPEN_N = 2;
}
src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderProfitDetailEntity.java
New file
@@ -0,0 +1,20 @@
package com.xcong.excoin.modules.documentary.entity;
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_detail")
public class FollowTraderProfitDetailEntity extends BaseEntity{/**
     *
     */
    private static final long serialVersionUID = 1L;
}
src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java
@@ -1,11 +1,16 @@
package com.xcong.excoin.modules.documentary.service;
import javax.validation.Valid;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xcong.excoin.common.response.Result;
import com.xcong.excoin.modules.coin.parameter.dto.RecordsPageDto;
import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity;
public interface DocumentaryService extends IService<FollowTraderProfitInfoEntity> {
    public Result getMemberIsTradeInfo();
    public Result getFollowTraderProfitInfo(@Valid RecordsPageDto recordsPageDto);
}
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
@@ -1,19 +1,34 @@
package com.xcong.excoin.modules.documentary.service.impl;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.coin.entity.MemberAccountMoneyChange;
import com.xcong.excoin.modules.coin.entity.OrderCoinsDealEntity;
import com.xcong.excoin.modules.coin.parameter.dto.RecordsPageDto;
import com.xcong.excoin.modules.documentary.dao.FollowTraderInfoDao;
import com.xcong.excoin.modules.documentary.dao.FollowTraderProfitDetailDao;
import com.xcong.excoin.modules.documentary.dao.FollowTraderProfitInfoDao;
import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity;
import com.xcong.excoin.modules.documentary.service.DocumentaryService;
import com.xcong.excoin.modules.documentary.vo.FollowTraderProfitInfoVo;
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 cn.hutool.core.collection.CollUtil;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@@ -22,6 +37,12 @@
    @Resource
    private MemberDao memberDao;
    @Resource
    private FollowTraderInfoDao followTraderInfoDao;
    @Resource
    private FollowTraderProfitDetailDao followTraderProfitDetailDao;
    @Resource
    private FollowTraderProfitInfoDao followTraderProfitInfoDao;
    
    @Override
    public Result getMemberIsTradeInfo() {
@@ -39,4 +60,31 @@
        return Result.ok(memberIsTradeVo);
    }
    @Override
    public Result getFollowTraderProfitInfo(@Valid RecordsPageDto recordsPageDto) {
        Page<FollowTraderProfitInfoVo> page = new Page<>(recordsPageDto.getPageNum(), recordsPageDto.getPageSize());
        FollowTraderProfitInfoEntity memberAccountMoneyChange = new FollowTraderProfitInfoEntity();
        IPage<FollowTraderProfitInfoVo> FollowTraderProfitInfoList = followTraderProfitInfoDao.selectFollowTraderProfitInfoEntity(page, memberAccountMoneyChange);
        List<FollowTraderProfitInfoVo> FollowTraderProfitInfoVoList = FollowTraderProfitInfoList.getRecords();
        if(CollUtil.isNotEmpty(FollowTraderProfitInfoVoList)) {
            for(FollowTraderProfitInfoVo FollowTraderProfitInfoVo : FollowTraderProfitInfoVoList) {
                Long traderId = FollowTraderProfitInfoVo.getTraderId();
                FollowTraderInfoEntity followTraderInfoEntity = followTraderInfoDao.selectFollowTraderInfoEntityBytreaderId(traderId);
                String avatar = followTraderInfoEntity.getAvatar();
                FollowTraderProfitInfoVo.setAvatar(avatar);
                String nickname = followTraderInfoEntity.getNickname();
                FollowTraderProfitInfoVo.setNickname(nickname);
                String declaration = followTraderInfoEntity.getDeclaration();
                FollowTraderProfitInfoVo.setDeclaration(declaration);
                Integer isAll = followTraderInfoEntity.getIsAll();
                FollowTraderProfitInfoVo.setIsAll(isAll);
                Integer isOpen = followTraderInfoEntity.getIsOpen();
                FollowTraderProfitInfoVo.setIsOpen(isOpen);
            }
        }
        return Result.ok(FollowTraderProfitInfoVoList);
    }
}
src/main/java/com/xcong/excoin/modules/documentary/vo/FollowTraderProfitInfoListVo.java
New file
@@ -0,0 +1,17 @@
package com.xcong.excoin.modules.documentary.vo;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "FollowTraderProfitInfoListVo", description = "交易员列表")
public class FollowTraderProfitInfoListVo {
    @ApiModelProperty(value = "交易员信息")
    private List<FollowTraderProfitInfoVo> followTraderProfitInfoVo;
}
src/main/java/com/xcong/excoin/modules/documentary/vo/FollowTraderProfitInfoVo.java
New file
@@ -0,0 +1,72 @@
package com.xcong.excoin.modules.documentary.vo;
import java.math.BigDecimal;
import com.xcong.excoin.common.system.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel(value = "FollowTraderProfitInfoVo", description = "交易员信息")
public class FollowTraderProfitInfoVo extends BaseEntity{
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    /**
     * 交易员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;
    /**
     * 头像
     */
    private String avatar;
    /**
     * 名称
     */
    private String nickname;
    /**
     * 宣言
     */
    private String declaration;
    /**
     * 是否满员 1-是2-否
     */
    private Integer isAll;
    /**
     * 是否开启带单 1是2否
     */
    private Integer isOpen;
}
src/main/resources/mapper/documentary/FollowTraderInfoDao.xml
New file
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xcong.excoin.modules.documentary.dao.FollowTraderInfoDao">
    <select id="selectFollowTraderInfoEntityBytreaderId" resultType="com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity">
        select * from follow_trader_info where id = #{traderId}
    </select>
</mapper>
src/main/resources/mapper/documentary/FollowTraderProfitInfoDao.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xcong.excoin.modules.documentary.dao.FollowTraderProfitInfoDao">
    <select id="selectFollowTraderProfitInfoEntity" resultType="com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity">
        select * from follow_trader_profit_info
        order by id desc
    </select>
</mapper>