| | |
| | | import javax.validation.Valid;
|
| | | import javax.validation.constraints.NotNull;
|
| | |
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.xcong.excoin.common.utils.RedisUtils;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | |
| | | 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.entity.FollowFollowerProfitEntity;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderLabelEntity;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity;
|
| | | import com.xcong.excoin.modules.documentary.mapper.FollowFollowerProfitMapper;
|
| | | import com.xcong.excoin.modules.documentary.mapper.FollowTraderInfoMapper;
|
| | | import com.xcong.excoin.modules.documentary.mapper.FollowTraderLabelMapper;
|
| | | import com.xcong.excoin.modules.documentary.mapper.FollowTraderProfitInfoMapper;
|
| | | import com.xcong.excoin.modules.documentary.service.DocumentaryService;
|
| | | import com.xcong.excoin.modules.member.entity.MemberAuthenticationEntity;
|
| | |
| | |
|
| | | private final FollowTraderInfoMapper followTraderInfoMapper;
|
| | |
|
| | | private final FollowFollowerProfitMapper followFollowerProfitMapper;
|
| | | |
| | | private final FollowTraderLabelMapper followTraderLabelMapper;
|
| | | |
| | | private final MemberAuthenticationMapper memberAuthenticationMapper;
|
| | |
|
| | | private final MemberMapper memberMapper;
|
| | |
|
| | | private final FollowTraderProfitInfoMapper followTraderProfitInfoMapper;
|
| | |
|
| | | private final RedisUtils redisUtils;
|
| | |
|
| | | @Override
|
| | | public IPage<FollowTraderInfoEntity> findTraderListInPage(FollowTraderInfoEntity followTraderInfoEntity,
|
| | |
| | | followTraderProfitInfoEntity.setTotalFollowerCnt(BigDecimal.ZERO);
|
| | | followTraderProfitInfoEntity.setTotalOrderCnt(BigDecimal.ZERO);
|
| | | followTraderProfitInfoMapper.insert(followTraderProfitInfoEntity);
|
| | |
|
| | | String token = redisUtils.getString("app_" + memberEntity.getId());
|
| | | redisUtils.set("app_" + token, JSONObject.toJSONString(memberEntity), 36000);
|
| | | }else {
|
| | | //更新【交易员信息表】数据
|
| | | selectById.setVerifyStatus(FollowTraderInfoEntity.VERIFYSTATUS_N);
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public FebsResponse traderGetOut(@NotNull(message = "{required}") Long id) {
|
| | | FollowTraderInfoEntity followTraderInfoEntity = followTraderInfoMapper.selectById(id);
|
| | | if(ObjectUtil.isEmpty(followTraderInfoEntity)) {
|
| | | return new FebsResponse().fail().message("交易员信息不存在");
|
| | | }
|
| | | Long memberId = followTraderInfoEntity.getMemberId();
|
| | | |
| | | Map<String, Object> columnMap = new HashMap<>();
|
| | | columnMap.put("trade_member_id", memberId);
|
| | | List<FollowFollowerProfitEntity> selectByMap = followFollowerProfitMapper.selectByMap(columnMap);
|
| | | if(CollUtil.isNotEmpty(selectByMap)) {
|
| | | for(FollowFollowerProfitEntity FollowFollowerProfitEntity : selectByMap ) {
|
| | | FollowFollowerProfitEntity.setIsFollow(FollowFollowerProfitEntity.IS_FOLLOW_N);
|
| | | followFollowerProfitMapper.updateById(FollowFollowerProfitEntity);
|
| | | }
|
| | | }
|
| | | followTraderInfoEntity.setVerifyStatus(FollowTraderInfoEntity.VERIFYSTATUS_N);
|
| | | followTraderInfoMapper.updateById(followTraderInfoEntity);
|
| | | MemberEntity memberEntity = memberMapper.selectById(memberId);
|
| | | memberEntity.setIsTrader(2);
|
| | | memberMapper.updateById(memberEntity);
|
| | |
| | | return new FebsResponse().success();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public IPage<FollowTraderLabelEntity> traderLabelList(FollowTraderLabelEntity followTraderLabelEntity,
|
| | | QueryRequest request) {
|
| | | Page<FollowTraderLabelEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
|
| | | IPage<FollowTraderLabelEntity> followTraderLabelEntitys = followTraderLabelMapper.findFollowTraderLabelEntitysInPage(page, followTraderLabelEntity);
|
| | | return followTraderLabelEntitys;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public FebsResponse traderLabelDelete(@NotNull(message = "{required}") Long id) {
|
| | | followTraderLabelMapper.deleteById(id);
|
| | | return new FebsResponse().success();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void followLabelSetAdd(@Valid FollowTraderLabelEntity followTraderLabelEntity) {
|
| | | |
| | | followTraderLabelMapper.insert(followTraderLabelEntity);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void followLabelSetUpdate(@Valid FollowTraderLabelEntity followTraderLabelEntity) {
|
| | | followTraderLabelMapper.updateById(followTraderLabelEntity);
|
| | | }
|
| | |
|
| | | }
|