|
|
@@ -2,7 +2,11 @@ package com.cyksj.service.nano.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.cyksj.mapper.GroupsMapper;
|
|
|
+import com.cyksj.mapper.GroupsRelationMapper;
|
|
|
import com.cyksj.mapper.NanoUserQuotaMapper;
|
|
|
+import com.cyksj.model.entity.GroupsRelation;
|
|
|
+import com.cyksj.model.entity.GroupsTrips;
|
|
|
import com.cyksj.model.entity.NanoUserQuota;
|
|
|
import com.cyksj.model.views.NanoUserQuotaInfoView;
|
|
|
import com.cyksj.service.nano.NanoService;
|
|
|
@@ -21,12 +25,22 @@ public class NanoServiceImpl implements NanoService {
|
|
|
private final UserBindRelationService userBindRelationService;
|
|
|
|
|
|
private final NanoUserQuotaMapper nanoUserQuotaMapper;
|
|
|
+
|
|
|
+ private final GroupsRelationMapper groupsRelationMapper;
|
|
|
+
|
|
|
+ private final GroupsMapper groupsMapper;
|
|
|
@Override
|
|
|
public NanoUserQuotaInfoView getUserSubsInfo(long userId) {
|
|
|
List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
NanoUserQuota nanoUserQuota = nanoUserQuotaMapper.selectOne(Wrappers.lambdaQuery(NanoUserQuota.class).in(NanoUserQuota::getUid, userIdList).last("limit 1"));
|
|
|
- NanoUserQuotaInfoView nanoUserQuotaInfoView = new NanoUserQuotaInfoView();
|
|
|
- BeanUtil.copyProperties(nanoUserQuota, nanoUserQuotaInfoView);
|
|
|
- return nanoUserQuotaInfoView;
|
|
|
+ if (nanoUserQuota != null) {
|
|
|
+ GroupsRelation relation = groupsRelationMapper.selectById(nanoUserQuota.getRelationId());
|
|
|
+ GroupsTrips groupsTrips = groupsMapper.selectById(relation.getGroupsId());
|
|
|
+ NanoUserQuotaInfoView nanoUserQuotaInfoView = new NanoUserQuotaInfoView();
|
|
|
+ BeanUtil.copyProperties(nanoUserQuota, nanoUserQuotaInfoView);
|
|
|
+ nanoUserQuotaInfoView.setSkuId(groupsTrips.getSkuId());
|
|
|
+ return nanoUserQuotaInfoView;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
}
|
|
|
}
|