|
@@ -52,6 +52,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
import java.util.Optional;
|
|
@@ -98,6 +99,31 @@ public class CmsGroupRelationController {
|
|
|
|
|
|
|
|
private final GptRechargeCardKeyChannelMapper gptRechargeCardKeyChannelMapper;
|
|
private final GptRechargeCardKeyChannelMapper gptRechargeCardKeyChannelMapper;
|
|
|
|
|
|
|
|
|
|
+ private List<Long> getOrderRelationIds(OrderDon orderDon) {
|
|
|
|
|
+ List<Long> relationIds = new ArrayList<>();
|
|
|
|
|
+ if (orderDon.getNum() != null && orderDon.getNum() > 1) {
|
|
|
|
|
+ relationIds.addAll(orderDonTicketRecordMapper.selectList(
|
|
|
|
|
+ Wrappers.lambdaQuery(OrderDonTicketRecord.class)
|
|
|
|
|
+ .select(OrderDonTicketRecord::getRelationId)
|
|
|
|
|
+ .eq(OrderDonTicketRecord::getOrderId, orderDon.getId())
|
|
|
|
|
+ .eq(OrderDonTicketRecord::getStatus, OrderDonTicketRecord.Status.success)
|
|
|
|
|
+ .isNotNull(OrderDonTicketRecord::getRelationId))
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .map(OrderDonTicketRecord::getRelationId)
|
|
|
|
|
+ .distinct()
|
|
|
|
|
+ .collect(Collectors.toList()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (orderDon.getRelationId() != null && orderDon.getRelationId() > 0
|
|
|
|
|
+ && !relationIds.contains(orderDon.getRelationId())) {
|
|
|
|
|
+ relationIds.add(orderDon.getRelationId());
|
|
|
|
|
+ }
|
|
|
|
|
+ // An empty IN list has database-dependent semantics; use an impossible relation id.
|
|
|
|
|
+ if (relationIds.isEmpty()) {
|
|
|
|
|
+ relationIds.add(0L);
|
|
|
|
|
+ }
|
|
|
|
|
+ return relationIds;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@GetMapping("/get")
|
|
@GetMapping("/get")
|
|
|
public Result<List<GroupsRelationBackView>> get(){
|
|
public Result<List<GroupsRelationBackView>> get(){
|
|
|
List<GroupsRelationBackView> search = beanSearcher.searchAll(GroupsRelationBackView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
List<GroupsRelationBackView> search = beanSearcher.searchAll(GroupsRelationBackView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
@@ -131,12 +157,14 @@ public class CmsGroupRelationController {
|
|
|
.eq(StrUtil.isNotBlank(orderNo), OrderDon::getOrderNo, orderNo)
|
|
.eq(StrUtil.isNotBlank(orderNo), OrderDon::getOrderNo, orderNo)
|
|
|
.eq(StrUtil.isNotBlank(transactionId), OrderDon::getTransactionId, transactionId)
|
|
.eq(StrUtil.isNotBlank(transactionId), OrderDon::getTransactionId, transactionId)
|
|
|
.last("limit 1"));
|
|
.last("limit 1"));
|
|
|
- Long relationId = 0l;
|
|
|
|
|
if (orderDon != null) {
|
|
if (orderDon != null) {
|
|
|
- relationId = orderDon.getRelationId();
|
|
|
|
|
builder.field(GroupsRelationRechargeView::getUserId, orderDon.getUserId());
|
|
builder.field(GroupsRelationRechargeView::getUserId, orderDon.getUserId());
|
|
|
|
|
+ List<Long> relationIds = getOrderRelationIds(orderDon);
|
|
|
|
|
+ builder.field(GroupsRelationRechargeView::getRelationId, relationIds)
|
|
|
|
|
+ .op(Operator.InList);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ builder.field(GroupsRelationRechargeView::getRelationId, 0L);
|
|
|
}
|
|
}
|
|
|
- builder.field(GroupsRelationRechargeView::getRelationId, relationId);
|
|
|
|
|
}
|
|
}
|
|
|
if (isVipError != null) {
|
|
if (isVipError != null) {
|
|
|
builder.field(GroupsRelationRechargeView::getRechargeStatus, GroupsRelation.RechargeStatus.recharge_error.name());
|
|
builder.field(GroupsRelationRechargeView::getRechargeStatus, GroupsRelation.RechargeStatus.recharge_error.name());
|
|
@@ -193,12 +221,14 @@ public class CmsGroupRelationController {
|
|
|
OrderDon orderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
|
|
OrderDon orderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
.eq(OrderDon::getOrderNo, orderNo)
|
|
.eq(OrderDon::getOrderNo, orderNo)
|
|
|
.last("limit 1"));
|
|
.last("limit 1"));
|
|
|
- Long relationId = 0l;
|
|
|
|
|
if (orderDon != null) {
|
|
if (orderDon != null) {
|
|
|
- relationId = orderDon.getRelationId();
|
|
|
|
|
builder.field(ExcelRechargeAccountData::getUserId, orderDon.getUserId());
|
|
builder.field(ExcelRechargeAccountData::getUserId, orderDon.getUserId());
|
|
|
|
|
+ List<Long> relationIds = getOrderRelationIds(orderDon);
|
|
|
|
|
+ builder.field(ExcelRechargeAccountData::getRelationId, relationIds)
|
|
|
|
|
+ .op(Operator.InList);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ builder.field(ExcelRechargeAccountData::getRelationId, 0L);
|
|
|
}
|
|
}
|
|
|
- builder.field(ExcelRechargeAccountData::getRelationId, relationId);
|
|
|
|
|
}
|
|
}
|
|
|
if (isVipError != null) {
|
|
if (isVipError != null) {
|
|
|
builder.field(ExcelRechargeAccountData::getRechargeStatus, GroupsRelation.RechargeStatus.recharge_error.name());
|
|
builder.field(ExcelRechargeAccountData::getRechargeStatus, GroupsRelation.RechargeStatus.recharge_error.name());
|