| | |
| | | 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; |
| | |
| | | |
| | | @Resource |
| | | private MemberDao memberDao; |
| | | |
| | | @Resource |
| | | private MemberSettingDao memberSettingDao; |
| | | |
| | | @Resource |
| | | private FollowFollowerProfitDao followFollowerProfitDao; |
| | | |
| | | @Resource |
| | | private FollowTraderInfoDao followTraderInfoDao; |
| | |
| | | // canAddMaxBond = BigDecimal.ZERO; |
| | | // } |
| | | BigDecimal canReduceMaxBond = holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getPrePaymentAmount()); |
| | | if (canReduceMaxBond.compareTo(BigDecimal.ZERO) < 0) { |
| | | canReduceMaxBond = BigDecimal.ZERO; |
| | | } |
| | | |
| | | if (rewardRatio.compareTo(BigDecimal.ZERO) < 0) { |
| | | canReduceMaxBond = canReduceMaxBond.add(rewardRatio); |
| | | } |
| | | |
| | | if (canReduceMaxBond.compareTo(BigDecimal.ZERO) < 0) { |
| | | canReduceMaxBond = BigDecimal.ZERO; |
| | | } |
| | | |
| | | holdOrderListVo.setCanReduceMaxBond(canReduceMaxBond); |
| | |
| | | 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(); |