xiaoyong931011
2021-03-03 85432ec0106fe27c2b2dbad5fdf0ea822e038859
20210303   交易员首页推荐
1 files added
6 files modified
65 ■■■■ changed files
src/main/java/com/xcong/excoin/modules/documentary/controller/DocumentaryController.java 3 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/dto/FollowTraderProfitInfoDto.java 25 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderInfoEntity.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderProfitInfoEntity.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java 3 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java 12 ●●●● patch | view | raw | blame | history
src/main/resources/mapper/documentary/FollowTraderProfitInfoDao.xml 12 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/controller/DocumentaryController.java
@@ -16,6 +16,7 @@
import com.xcong.excoin.modules.documentary.dto.DocumentaryOrderSetDto;
import com.xcong.excoin.modules.documentary.dto.FollowFollowerNoticeDto;
import com.xcong.excoin.modules.documentary.dto.FollowRecordsDto;
import com.xcong.excoin.modules.documentary.dto.FollowTraderProfitInfoDto;
import com.xcong.excoin.modules.documentary.dto.HistoryOrderRecordsDto;
import com.xcong.excoin.modules.documentary.dto.MyFollowOrderDto;
import com.xcong.excoin.modules.documentary.dto.MyFollowTraderInfoDto;
@@ -76,7 +77,7 @@
    @ApiOperation(value="交易员列表", notes="交易员列表")
    @ApiResponses({@ApiResponse( code = 200, message = "success", response = FollowTraderProfitInfoVo.class)})
    @PostMapping(value = "/getFollowTraderProfitInfo")
    public Result  getFollowTraderProfitInfo(@RequestBody @Valid RecordsPageDto recordsPageDto) {
    public Result  getFollowTraderProfitInfo(@RequestBody @Valid FollowTraderProfitInfoDto recordsPageDto) {
        return documentaryService.getFollowTraderProfitInfo(recordsPageDto);
    }
    
src/main/java/com/xcong/excoin/modules/documentary/dto/FollowTraderProfitInfoDto.java
New file
@@ -0,0 +1,25 @@
package com.xcong.excoin.modules.documentary.dto;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "FollowTraderProfitInfoDto", description = "参数接受类")
public class FollowTraderProfitInfoDto {
    @NotNull
    @Min(1)
    @ApiModelProperty(value = "第几页", example = "1")
    private int pageNum;
    @NotNull
    @ApiModelProperty(value = "每页数量", example = "10")
    private int pageSize;
    @ApiModelProperty(value = "1:首页", example = "1")
    private int type;
}
src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderInfoEntity.java
@@ -47,6 +47,12 @@
    private Integer isAll;
    public static final Integer IS_ALL_Y = 1;
    public static final Integer IS_ALL_N = 2;
    /**
     * 设置成首页
     */
    private Integer isSetFrist;
    public static final Integer IS_SETFRIST_Y = 1;
    /**
     * 利润
     */
src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderProfitInfoEntity.java
@@ -2,6 +2,7 @@
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xcong.excoin.common.system.base.BaseEntity;
@@ -53,5 +54,8 @@
     */
    private int totalOrderCnt;
    
    @TableField(exist = false)
    private int type;
}
src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java
@@ -9,6 +9,7 @@
import com.xcong.excoin.modules.documentary.dto.DocumentaryOrderSetDto;
import com.xcong.excoin.modules.documentary.dto.FollowFollowerNoticeDto;
import com.xcong.excoin.modules.documentary.dto.FollowRecordsDto;
import com.xcong.excoin.modules.documentary.dto.FollowTraderProfitInfoDto;
import com.xcong.excoin.modules.documentary.dto.HistoryOrderRecordsDto;
import com.xcong.excoin.modules.documentary.dto.MyFollowOrderDto;
import com.xcong.excoin.modules.documentary.dto.MyFollowTraderInfoDto;
@@ -23,7 +24,7 @@
    public Result getMemberIsTradeInfo();
    public Result getFollowTraderProfitInfo(@Valid RecordsPageDto recordsPageDto);
    public Result getFollowTraderProfitInfo(@Valid FollowTraderProfitInfoDto recordsPageDto);
    public Result getHistoryOrderRecords(@Valid HistoryOrderRecordsDto historyOrderRecordsDto);
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
@@ -41,6 +41,7 @@
import com.xcong.excoin.modules.documentary.dto.DocumentaryOrderSetDto;
import com.xcong.excoin.modules.documentary.dto.FollowFollowerNoticeDto;
import com.xcong.excoin.modules.documentary.dto.FollowRecordsDto;
import com.xcong.excoin.modules.documentary.dto.FollowTraderProfitInfoDto;
import com.xcong.excoin.modules.documentary.dto.HistoryOrderRecordsDto;
import com.xcong.excoin.modules.documentary.dto.MyFollowOrderDto;
import com.xcong.excoin.modules.documentary.dto.MyFollowTraderInfoDto;
@@ -143,10 +144,14 @@
    }
    @Override
    public Result getFollowTraderProfitInfo(@Valid RecordsPageDto recordsPageDto) {
    public Result getFollowTraderProfitInfo(@Valid FollowTraderProfitInfoDto recordsPageDto) {
        
        int type = recordsPageDto.getType();
        Page<FollowTraderProfitInfoVo> page = new Page<>(recordsPageDto.getPageNum(), recordsPageDto.getPageSize());
        FollowTraderProfitInfoEntity followTraderProfitInfoEntity = new FollowTraderProfitInfoEntity();
        if(FollowTraderInfoEntity.IS_SETFRIST_Y.equals(type)) {
            followTraderProfitInfoEntity.setType(type);
        }
        IPage<FollowTraderProfitInfoVo> followTraderProfitInfoList = followTraderProfitInfoDao.selectFollowTraderProfitInfoEntity(page, followTraderProfitInfoEntity);
        
        List<FollowTraderProfitInfoVo> followTraderProfitInfoVoList = followTraderProfitInfoList.getRecords();
@@ -874,11 +879,11 @@
                    TradeOrderInfoVo myFollowOrderVo = new TradeOrderInfoVo();
                    //获取交易员信息
                    Long orderId = contractHoldOrderEntity.getId();
                    myFollowOrderVo.setOrderId(orderId);
                    FollowTraderInfoEntity followTraderInfoEntity = followTraderInfoDao.selectTraderInfoByMemberId(memberId);
                    if(ObjectUtil.isNotEmpty(followTraderInfoEntity)) {
                        myFollowOrderVo.setOrderId(orderId);
                    String nickname = followTraderInfoEntity.getNickname();
                    myFollowOrderVo.setNickname(nickname);
                    String symbol = contractHoldOrderEntity.getSymbol();
                    myFollowOrderVo.setSymbol(symbol);
                    int orderType = contractHoldOrderEntity.getOpeningType();
@@ -928,6 +933,7 @@
                    myFollowOrderVos.add(myFollowOrderVo);
                }
            }
            }
        
        return Result.ok(myFollowOrderVos);
    }
src/main/resources/mapper/documentary/FollowTraderProfitInfoDao.xml
@@ -3,8 +3,16 @@
<mapper namespace="com.xcong.excoin.modules.documentary.dao.FollowTraderProfitInfoDao">
    
    <select id="selectFollowTraderProfitInfoEntity" resultType="com.xcong.excoin.modules.documentary.vo.FollowTraderProfitInfoVo">
        select * from follow_trader_profit_info f left join member m on f.member_id = m.id
        where m.is_trader = 1
        select * from follow_trader_profit_info f
            left join member m on f.member_id = m.id
            left join follow_trader_info t on t.member_id = f.member_id
        <where>
            m.is_trader = 1
            <if test="record.type != null and record.type != '' ">
                and t.is_set_frist = #{record.type}
            </if>
        </where>
        order by f.id desc
    </select>