| | |
| | | import com.xcong.excoin.common.entity.FebsResponse;
|
| | | import com.xcong.excoin.common.entity.QueryRequest;
|
| | | import com.xcong.excoin.modules.documentary.dto.FollowTraderInfoDto;
|
| | | import com.xcong.excoin.modules.documentary.dto.ModifyProfitRatioDto;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowFollowerProfitEntity;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderLabelEntity;
|
| | |
| | |
|
| | | import cn.hutool.core.collection.CollUtil;
|
| | | import cn.hutool.core.util.ObjectUtil;
|
| | | import cn.hutool.core.util.StrUtil;
|
| | | import lombok.RequiredArgsConstructor;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | |
|
| | |
| | | if(ObjectUtil.isEmpty(selectById)) {
|
| | | return new FebsResponse().fail().message("交易员信息不存在");
|
| | | }
|
| | | BigDecimal profitRatio = BigDecimal.ZERO;
|
| | | String profitRatioStr = followTraderInfoDto.getProfitRatio();
|
| | | if(StrUtil.isNotEmpty(profitRatioStr)) {
|
| | | profitRatio = new BigDecimal(profitRatioStr);
|
| | | }
|
| | | String isok = followTraderInfoDto.getIsok();
|
| | | if("1".equals(isok)) {
|
| | | //更新【会员信息表】数据
|
| | |
| | | memberEntity.setIsTrader(1);
|
| | | memberMapper.updateById(memberEntity);
|
| | | //更新【交易员信息表】数据
|
| | | selectById.setProfitRatio(profitRatio);
|
| | | selectById.setVerifyStatus(FollowTraderInfoEntity.VERIFYSTATUS_Y);
|
| | | followTraderInfoMapper.updateById(selectById);
|
| | | //新增【交易员收益信息 】数据
|
| | |
| | | followTraderLabelMapper.updateById(followTraderLabelEntity);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public IPage<FollowTraderProfitInfoEntity> findTraderDataInfoInfoInPage(FollowTraderProfitInfoEntity followTraderProfitInfoEntity, QueryRequest request) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public FebsResponse modifyProfitRatio(@Valid ModifyProfitRatioDto modifyProfitRatioDto) {
|
| | | Long id = modifyProfitRatioDto.getId();
|
| | | FollowTraderInfoEntity selectById = followTraderInfoMapper.selectById(id);
|
| | | if(ObjectUtil.isEmpty(selectById)) {
|
| | | return new FebsResponse().fail().message("交易员信息不存在");
|
| | | }
|
| | | BigDecimal profitRatio = BigDecimal.ZERO;
|
| | | String profitRatioStr = modifyProfitRatioDto.getProfitRatio();
|
| | | if(StrUtil.isNotEmpty(profitRatioStr)) {
|
| | | profitRatio = new BigDecimal(profitRatioStr);
|
| | | }
|
| | | //更新【交易员信息表】数据
|
| | | selectById.setProfitRatio(profitRatio);
|
| | | selectById.setVerifyStatus(FollowTraderInfoEntity.VERIFYSTATUS_Y);
|
| | | followTraderInfoMapper.updateById(selectById);
|
| | | return new FebsResponse().success();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public FebsResponse traderGetOn(@NotNull(message = "{required}") Long id) {
|
| | | FollowTraderInfoEntity followTraderInfoEntity = followTraderInfoMapper.selectById(id);
|
| | | if(ObjectUtil.isEmpty(followTraderInfoEntity)) {
|
| | | return new FebsResponse().fail().message("交易员信息不存在");
|
| | | }
|
| | | followTraderInfoEntity.setIsSetFrist(FollowTraderInfoEntity.IS_SETFRIST_Y);
|
| | | followTraderInfoMapper.updateById(followTraderInfoEntity);
|
| | | return new FebsResponse().success();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public FebsResponse traderGetOutFrist(@NotNull(message = "{required}") Long id) {
|
| | | FollowTraderInfoEntity followTraderInfoEntity = followTraderInfoMapper.selectById(id);
|
| | | if(ObjectUtil.isEmpty(followTraderInfoEntity)) {
|
| | | return new FebsResponse().fail().message("交易员信息不存在");
|
| | | }
|
| | | followTraderInfoEntity.setIsSetFrist(FollowTraderInfoEntity.IS_SETFRIST_N);
|
| | | followTraderInfoMapper.updateById(followTraderInfoEntity);
|
| | | return new FebsResponse().success();
|
| | | }
|
| | |
|
| | | }
|