xiaoyong931011
2021-01-08 6113e3d0e87f6dddb943f1a405128805fbebc089
20210108
7 files modified
59 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java 15 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowFollowerProfitDao.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/dto/UpdateTradeSetInfoDto.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java 21 ●●●●● patch | view | raw | blame | history
src/main/resources/i18n/messages_en_US.properties 3 ●●●●● patch | view | raw | blame | history
src/main/resources/i18n/messages_zh_CN.properties 3 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/documentary/FollowFollowerProfitDao.xml 11 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java
@@ -24,8 +24,10 @@
import com.xcong.excoin.modules.contract.parameter.vo.*;
import com.xcong.excoin.modules.contract.service.ContractHoldOrderService;
import com.xcong.excoin.modules.documentary.dao.FollowFollowerOrderRelationDao;
import com.xcong.excoin.modules.documentary.dao.FollowFollowerProfitDao;
import com.xcong.excoin.modules.documentary.dao.FollowTraderInfoDao;
import com.xcong.excoin.modules.documentary.entity.FollowFollowerOrderRelationEntity;
import com.xcong.excoin.modules.documentary.entity.FollowFollowerProfitEntity;
import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
import com.xcong.excoin.modules.member.dao.MemberDao;
import com.xcong.excoin.modules.member.dao.MemberLevelRateDao;
@@ -86,8 +88,12 @@
    @Resource
    private MemberDao memberDao;
    @Resource
    private MemberSettingDao memberSettingDao;
    @Resource
    private FollowFollowerProfitDao followFollowerProfitDao;
    @Resource
    private FollowTraderInfoDao followTraderInfoDao;
@@ -970,6 +976,15 @@
        if (CollUtil.isNotEmpty(list) || CollUtil.isNotEmpty(entrustList)) {
            return Result.fail("存在持仓/委托, 无法更改");
        }
        /**
         * 验证用户是否存在跟随交易员
         * 是:不允许切换成全仓模式
         */
        List<FollowFollowerProfitEntity> followFollowerProfitEntitys = followFollowerProfitDao.selectByMemberIdandIsFollow(member.getId(),FollowFollowerProfitEntity.IS_FOLLOW_Y);
        if(CollUtil.isNotEmpty(followFollowerProfitEntitys)) {
            return Result.fail(MessageSourceUtils.getString("documentary_service_0018"));
        }
        Integer positionType = member.getContractPositionType() == ContractEntrustOrderEntity.POSITION_TYPE_ADD ? ContractEntrustOrderEntity.POSITION_TYPE_ALL : ContractEntrustOrderEntity.POSITION_TYPE_ADD;
        MemberEntity updateEntity = new MemberEntity();
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowFollowerProfitDao.java
@@ -43,4 +43,6 @@
    BigDecimal selectAllFollowerProfit(@Param("tradeMemberId") Long tradeMemberId);
    
    List<FollowFollowerProfitEntity> selectByMemberIdandIsFollow(@Param("id") Long id, @Param("isFollowY") Integer isFollowY);
}
src/main/java/com/xcong/excoin/modules/documentary/dto/UpdateTradeSetInfoDto.java
@@ -9,16 +9,16 @@
@Data
@ApiModel(value = "UpdateTradeSetInfoDto", description = "参数接受类")
public class UpdateTradeSetInfoDto {
        @NotNull
        @ApiModelProperty("头像")
        private String avatar;
        @NotNull
        @NotNull(message = "名称不能为空")
        @ApiModelProperty("名称")
        private String nickname;
        @NotNull
        @ApiModelProperty("是否开启带单 1是2否")
        private int isOpen;
        @NotNull
        @NotNull(message = "宣言不能为空")
        @ApiModelProperty("宣言")
        private String declaration;
        
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
@@ -24,6 +24,7 @@
import com.xcong.excoin.modules.coin.parameter.dto.RecordsPageDto;
import com.xcong.excoin.modules.contract.dao.ContractHoldOrderDao;
import com.xcong.excoin.modules.contract.dao.ContractOrderDao;
import com.xcong.excoin.modules.contract.entity.ContractEntrustOrderEntity;
import com.xcong.excoin.modules.contract.entity.ContractHoldOrderEntity;
import com.xcong.excoin.modules.contract.entity.ContractOrderEntity;
import com.xcong.excoin.modules.documentary.dao.FollowFollowerNoticeDao;
@@ -458,6 +459,20 @@
        if (traderInfoEntity != null) {
            return Result.fail(MessageSourceUtils.getString("documentary_service_0014"));
        }
        //判断当前用户是否是逐仓模式
        MemberEntity selectById2 = memberDao.selectById(memberId);
        Integer contractPositionType = selectById2.getContractPositionType();
        if(ContractEntrustOrderEntity.POSITION_TYPE_ADD != contractPositionType) {
            return Result.fail(MessageSourceUtils.getString("documentary_service_0017"));
        }
        //判断交易员是否开启了跟单
        FollowTraderInfoEntity selectById = followTraderInfoDao.selectById(traderId);
        Integer isOpen = selectById.getIsOpen();
        if(FollowTraderInfoEntity.ISOPEN_Y != isOpen) {
            return Result.fail(MessageSourceUtils.getString("documentary_service_0016"));
        }
        FollowFollowerSettingEntity isExistSetting = followFollowerSettingDao.selectOneBymemberIdAndTradeId(memberId, traderId);
        if (isExistSetting == null) {
@@ -719,6 +734,8 @@
        FollowTraderInfoEntity followTraderInfoEntity = followTraderInfoDao.selectTraderInfoByMemberId(memberId);
        
        TradeSetInfoVo tradeSetInfoVo = new TradeSetInfoVo();
        Long id = followTraderInfoEntity.getId();
        tradeSetInfoVo.setTradeId(id);
        String avatar = followTraderInfoEntity.getAvatar();
        tradeSetInfoVo.setAvatar(avatar);
        String nickname = followTraderInfoEntity.getNickname();
@@ -735,6 +752,10 @@
        //获取用户ID
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
        FollowTraderInfoEntity followTraderInfoEntity = followTraderInfoDao.selectTraderInfoByMemberId(memberId);
        /**
         * todo
         * 当前交易员有合约多单,是否可以直接调整【是否带单】,是否需要在调整前【判断是否已经有带单的合约单】
         */
        String avatar = updateTradeSetInfoDto.getAvatar();
        String nickname = updateTradeSetInfoDto.getNickname();
        String declaration = updateTradeSetInfoDto.getDeclaration();
src/main/resources/i18n/messages_en_US.properties
@@ -227,6 +227,9 @@
documentary_service_0013=Please close the position after applying
documentary_service_0014=The current status cannot be followed
documentary_service_0015=Please cancel and apply again
documentary_service_0016=The trader has been set not to follow orders
documentary_service_0017=Please change the contract to separate margin mode
documentary_service_0018=In documentary, cannot adjust to full position margin mode
uploadFile_controller_0001=Upload failed
src/main/resources/i18n/messages_zh_CN.properties
@@ -227,6 +227,9 @@
documentary_service_0013=请平仓后,在申请
documentary_service_0014=当前状态不能进行跟单
documentary_service_0015=当前有跟单,请取消再申请
documentary_service_0016=该交易员已设置不能跟单
documentary_service_0017=请将合约修改为分仓保证金模式
documentary_service_0018=正在跟单中,无法调整为全仓保证金模式
uploadFile_controller_0001=上传失败
src/main/resources/mapper/documentary/FollowFollowerProfitDao.xml
@@ -1,6 +1,17 @@
<?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.FollowFollowerProfitDao">
    <select id="selectByMemberIdandIsFollow" resultType="com.xcong.excoin.modules.documentary.entity.FollowFollowerProfitEntity">
        SELECT
            *
        FROM
            follow_follower_profit
        WHERE
            member_id = #{id}
            and is_follow = #{isFollowY}
        order by create_time desc
    </select>
    <select id="selectFollowRecords" resultType="com.xcong.excoin.modules.documentary.vo.FollowRecordsVo">
        SELECT