|
|
@@ -3,6 +3,8 @@ package com.mokamrp.privates.service.pangu.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashOasBox;
|
|
|
import com.mokamrp.privates.mapper.pangu.FosterwxCashOasBoxMapper;
|
|
|
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashOasBoxMobileGroup;
|
|
|
+import com.mokamrp.privates.service.pangu.FosterwxCashOasBoxMobileGroupService;
|
|
|
import com.mokamrp.privates.service.pangu.FosterwxCashOasBoxService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.mokamrp.privates.utils.StringUtils;
|
|
|
@@ -16,6 +18,7 @@ import org.springframework.transaction.annotation.Isolation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
@@ -31,6 +34,9 @@ public class FosterwxCashOasBoxServiceImpl extends ServiceImpl<FosterwxCashOasBo
|
|
|
@Autowired
|
|
|
public FosterwxCashOasBoxMapper fosterwxCashOasBoxMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ public FosterwxCashOasBoxMobileGroupService fosterwxCashOasBoxMobileGroupService;
|
|
|
+
|
|
|
/**
|
|
|
* 获取数据列表 支持分页
|
|
|
*
|
|
|
@@ -68,9 +74,11 @@ public class FosterwxCashOasBoxServiceImpl extends ServiceImpl<FosterwxCashOasBo
|
|
|
* @return
|
|
|
*/
|
|
|
public FosterwxCashOasBox getRandBox(Integer groupId) {
|
|
|
+ List<FosterwxCashOasBoxMobileGroup> mobileGroupList = fosterwxCashOasBoxMobileGroupService.list(new QueryWrapper<FosterwxCashOasBoxMobileGroup>().eq("cash_mobile_group_id",groupId));
|
|
|
+ List<Integer> boxOasIds = mobileGroupList.stream().map(FosterwxCashOasBoxMobileGroup::getOasBoxId).collect(Collectors.toList());
|
|
|
List<FosterwxCashOasBox> list = this.list(new QueryWrapper<FosterwxCashOasBox>()
|
|
|
.eq("type", 1)
|
|
|
- .eq("group_id", groupId)
|
|
|
+ .in("id", boxOasIds)
|
|
|
.lt("send_text_cnt", 90)
|
|
|
.eq("fobidden_status", 1));
|
|
|
if (list == null || list.size() <= 0) {
|
|
|
@@ -89,9 +97,11 @@ public class FosterwxCashOasBoxServiceImpl extends ServiceImpl<FosterwxCashOasBo
|
|
|
* @return
|
|
|
*/
|
|
|
public FosterwxCashOasBox getRandOas(Integer groupId) {
|
|
|
+ List<FosterwxCashOasBoxMobileGroup> mobileGroupList = fosterwxCashOasBoxMobileGroupService.list(new QueryWrapper<FosterwxCashOasBoxMobileGroup>().eq("cash_mobile_group_id",groupId));
|
|
|
+ List<Integer> boxOasIds = mobileGroupList.stream().map(FosterwxCashOasBoxMobileGroup::getOasBoxId).collect(Collectors.toList());
|
|
|
List<FosterwxCashOasBox> list = this.list(new QueryWrapper<FosterwxCashOasBox>()
|
|
|
.eq("type", 2)
|
|
|
- .eq("group_id", groupId)
|
|
|
+ .in("id", boxOasIds)
|
|
|
.lt("send_text_cnt", 90)
|
|
|
.eq("fobidden_status", 1));
|
|
|
if (list == null || list.size() <= 0) {
|