xiaoyong931011
2021-03-04 c0fac904e85b0b0131cde4c6b7f1e8de9f095089
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
@@ -11,6 +11,8 @@
import javax.validation.Valid;
import com.xcong.excoin.modules.documentary.common.NoticeConstant;
import com.xcong.excoin.modules.member.entity.MemberSettingEntity;
import com.xcong.excoin.modules.member.parameter.vo.MemberMessageReminderVo;
import com.xcong.excoin.utils.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -58,6 +60,7 @@
import com.xcong.excoin.modules.documentary.entity.FollowTraderLabelEntity;
import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity;
import com.xcong.excoin.modules.documentary.service.DocumentaryService;
import com.xcong.excoin.modules.documentary.vo.BeTraderConditionVo;
import com.xcong.excoin.modules.documentary.vo.DocumentaryOrderInfoVo;
import com.xcong.excoin.modules.documentary.vo.DocumentaryOrderSetInfoVo;
import com.xcong.excoin.modules.documentary.vo.FollowFollowerNoticeVo;
@@ -77,6 +80,7 @@
import com.xcong.excoin.modules.documentary.vo.TraderStatusVo;
import com.xcong.excoin.modules.member.dao.MemberDao;
import com.xcong.excoin.modules.member.dao.MemberLevelRateDao;
import com.xcong.excoin.modules.member.dao.MemberSettingDao;
import com.xcong.excoin.modules.member.dao.MemberWalletContractDao;
import com.xcong.excoin.modules.member.entity.MemberEntity;
import com.xcong.excoin.modules.member.entity.MemberLevelRateEntity;
@@ -125,6 +129,8 @@
    private FollowFollowerNoticeDao followFollowerNoticeDao;
    @Resource
    private FollowTraderLabelDao followTraderLabelDao;
    @Resource
    private MemberSettingDao memberSettingDao;
    
   
   @Override
@@ -1064,6 +1070,18 @@
        long id = outFollowInfoDto.getId();
        //获取【跟随者收益】
        FollowFollowerProfitEntity followFollowerProfitEntity = followFollowerProfitDao.selectById(id);
        //当前有跟单合约不允许移除
        //获取【跟随者-订单关联表】
        Map<String, Object> selectColumnMap = new HashMap<>();
        selectColumnMap.put("member_id", followFollowerProfitEntity.getMemberId());
        selectColumnMap.put("trade_member_id", memberId);
        selectColumnMap.put("order_type", FollowFollowerOrderRelationEntity.ORDER_TYPE_HOLD);
        List<FollowFollowerOrderRelationEntity> followFollowerOrderRelationEntitys = followFollowerOrderRelationDao.selectByMap(selectColumnMap);
        if(CollUtil.isNotEmpty(followFollowerOrderRelationEntitys)) {
           return Result.fail(MessageSourceUtils.getString("documentary_service_0019"));
        }
        followFollowerProfitEntity.setIsFollow(FollowFollowerProfitEntity.IS_FOLLOW_N);
        followFollowerProfitDao.updateById(followFollowerProfitEntity);
@@ -1089,6 +1107,7 @@
   }
   @Override
   @Transactional
   public Result getFollowFollowerNoticeList(FollowFollowerNoticeDto followFollowerNoticeDto) {
      //获取用户ID
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
@@ -1110,6 +1129,11 @@
            followFollowerNoticeVo.setCreateTime(createTime);
            arrayList.add(followFollowerNoticeVo);
         }
      }
      MemberSettingEntity memberSettingEntity = memberSettingDao.selectMemberSettingByMemberId(memberId);
      if(ObjectUtil.isNotEmpty(memberSettingEntity)) {
         memberSettingEntity.setMessageReminder(0);
         memberSettingDao.updateById(memberSettingEntity);
      }
        
      return Result.ok(arrayList);
@@ -1135,6 +1159,13 @@
      }
      return Result.ok(arrayList);
   }
   @Override
   public Result beTraderCondition() {
      String type = "apply_trader_rule";
      List<BeTraderConditionVo> beTraderConditionVos = followTraderInfoDao.selectBeTraderCondition(type);
      return Result.ok(beTraderConditionVos);
   }