xiaoyong931011
2020-07-31 38d37033e6faa269cfc63e2e584bde7f48125d22
20200731  代码提交
3 files modified
34 ■■■■ changed files
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowFollowerOrderRelationDao.java 4 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java 17 ●●●● patch | view | raw | blame | history
src/main/resources/mapper/documentary/FollowFollowerOrderRelationDao.xml 13 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowFollowerOrderRelationDao.java
@@ -10,5 +10,7 @@
 */
public interface FollowFollowerOrderRelationDao extends BaseMapper<FollowFollowerOrderRelationEntity> {
    FollowFollowerOrderRelationEntity selectOneByorderIdandMemberId(@Param("orderId")Long orderId,@Param("memberId") Long memberId);
    FollowFollowerOrderRelationEntity selectHistoryOneByorderId(@Param("orderId")Long orderId);
    FollowFollowerOrderRelationEntity selectNowOneByorderId(@Param("orderId")Long orderId);
}
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
@@ -10,6 +10,7 @@
import javax.annotation.Resource;
import javax.validation.Valid;
import org.apache.http.impl.NoConnectionReuseStrategy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -254,6 +255,14 @@
            if(CollUtil.isNotEmpty(records)) {
                for(ContractOrderEntity contractOrderEntity : records) {
                    MyFollowOrderVo myFollowOrderVo = new MyFollowOrderVo();
                    //获取交易员信息
                    Long orderId = contractOrderEntity.getId();
                    FollowFollowerOrderRelationEntity FollowFollowerOrderRelation = followFollowerOrderRelationDao.selectHistoryOneByorderId(orderId);
                    Long tradeId = FollowFollowerOrderRelation.getTradeId();
                    FollowTraderInfoEntity followTraderInfoEntity = followTraderInfoDao.selectById(tradeId);
                    String nickname = followTraderInfoEntity.getNickname();
                    myFollowOrderVo.setNickname(nickname);
                    String symbol = contractOrderEntity.getSymbol();
                    myFollowOrderVo.setSymbol(symbol);
                    int orderType = contractOrderEntity.getOrderType();
@@ -301,7 +310,7 @@
                    MyFollowOrderVo myFollowOrderVo = new MyFollowOrderVo();
                    //获取交易员信息
                    Long orderId = contractHoldOrderEntity.getId();
                    FollowFollowerOrderRelationEntity FollowFollowerOrderRelation = followFollowerOrderRelationDao.selectOneByorderIdandMemberId(orderId,memberId);
                    FollowFollowerOrderRelationEntity FollowFollowerOrderRelation = followFollowerOrderRelationDao.selectNowOneByorderId(orderId);
                    Long tradeId = FollowFollowerOrderRelation.getTradeId();
                    FollowTraderInfoEntity followTraderInfoEntity = followTraderInfoDao.selectById(tradeId);
                    String nickname = followTraderInfoEntity.getNickname();
@@ -365,9 +374,7 @@
    public Result getMyFollowTraderInfo(@Valid MyFollowTraderInfoDto myFollowTraderInfoDto) {
        //获取用户ID
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
        Page<MyFollowTraderInfoVo> result = new Page<>();
        List<MyFollowTraderInfoVo> myFollowOrderVos = result.getRecords();
        List<MyFollowTraderInfoVo> myFollowOrderVos = new ArrayList<>();
        
        Page<FollowFollowerProfitEntity> page = new Page<>(myFollowTraderInfoDto.getPageNum(), myFollowTraderInfoDto.getPageSize());
        IPage<FollowFollowerProfitEntity> followFollowerProfitEntitys = followFollowerProfitDao.selectFollowFollowerProfitEntitys(page, memberId);
@@ -389,7 +396,7 @@
                myFollowOrderVos.add(myFollowTraderInfoVo);
            }
        }
        return Result.ok(result);
        return Result.ok(myFollowOrderVos);
    }
    @Override
src/main/resources/mapper/documentary/FollowFollowerOrderRelationDao.xml
@@ -2,14 +2,19 @@
<!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.FollowFollowerOrderRelationDao">
    
    <select id="selectOneByorderIdandMemberId" resultType="com.xcong.excoin.modules.documentary.entity.FollowFollowerOrderRelationEntity">
    <select id="selectHistoryOneByorderId" resultType="com.xcong.excoin.modules.documentary.entity.FollowFollowerOrderRelationEntity">
        SELECT
            *
        FROM
            follow_follower_order_relation 
        WHERE
            member_id = #{memberId}
            and order_id = #{orderId}
        WHERE order_id = #{orderId} and order_type = 2
    </select>
    <select id="selectNowOneByorderId" resultType="com.xcong.excoin.modules.documentary.entity.FollowFollowerOrderRelationEntity">
        SELECT
            *
        FROM
            follow_follower_order_relation
        WHERE order_id = #{orderId} and order_type = 1
    </select>
    
</mapper>