添加邮箱作为查询条件

This commit is contained in:
wuchunlei
2025-04-30 14:18:39 +08:00
parent d02026567a
commit 1ab791b093
4 changed files with 25 additions and 16 deletions

View File

@@ -360,7 +360,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
wrapper.gt(requestVo.getStartTime()!=null,BuyOrder::getCreateTime,requestVo.getStartTime()); wrapper.gt(requestVo.getStartTime()!=null,BuyOrder::getCreateTime,requestVo.getStartTime());
wrapper.lt(requestVo.getEndTime()!=null,BuyOrder::getCreateTime,requestVo.getEndTime()); wrapper.lt(requestVo.getEndTime()!=null,BuyOrder::getCreateTime,requestVo.getEndTime());
wrapper.orderByDesc(BuyOrder::getCreateTime); wrapper.orderByDesc(BuyOrder::getCreateTime);
wrapper.and(StringUtils.isNotBlank(requestVo.getSearchKeyWord()),t->t.like(BuyOrder::getOrderSn,requestVo.getSearchKeyWord()).or().like(MyUserEntity::getTel,requestVo.getSearchKeyWord()).or().like(MyUserEntity::getName,requestVo.getSearchKeyWord()).or().like(BuyOrder::getShippingUser,requestVo.getSearchKeyWord()).or().like(BuyOrder::getUserPhone,requestVo.getSearchKeyWord())); wrapper.and(StringUtils.isNotBlank(requestVo.getSearchKeyWord()),t->t.like(BuyOrder::getOrderSn,requestVo.getSearchKeyWord()).or().like(MyUserEntity::getTel,requestVo.getSearchKeyWord()).or().like(MyUserEntity::getEmail,requestVo.getSearchKeyWord()).or().like(MyUserEntity::getName,requestVo.getSearchKeyWord()).or().like(BuyOrder::getShippingUser,requestVo.getSearchKeyWord()).or().like(BuyOrder::getUserPhone,requestVo.getSearchKeyWord()));
if(StringUtils.isNotBlank(requestVo.getProductName())){ if(StringUtils.isNotBlank(requestVo.getProductName())){
MPJLambdaWrapper<BuyOrderProduct> buyOrderProductMPJLambdaWrapper = new MPJLambdaWrapper<>(); MPJLambdaWrapper<BuyOrderProduct> buyOrderProductMPJLambdaWrapper = new MPJLambdaWrapper<>();
buyOrderProductMPJLambdaWrapper.selectAll(BuyOrderProduct.class); buyOrderProductMPJLambdaWrapper.selectAll(BuyOrderProduct.class);

View File

@@ -1,5 +1,6 @@
package com.peanut.modules.book.service.impl; package com.peanut.modules.book.service.impl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.common.utils.ExcludeEmptyQueryWrapper; import com.peanut.common.utils.ExcludeEmptyQueryWrapper;
import com.peanut.modules.common.entity.BookBuyConfigEntity; import com.peanut.modules.common.entity.BookBuyConfigEntity;
import com.peanut.modules.common.entity.MyUserEntity; import com.peanut.modules.common.entity.MyUserEntity;
@@ -27,9 +28,13 @@ public class PayPaymentOrderServiceImpl extends ServiceImpl<PayPaymentOrderDao,
public PageUtils queryPage(Map<String, Object> params) { public PageUtils queryPage(Map<String, Object> params) {
IPage<PayPaymentOrderEntity> page = this.page( IPage<PayPaymentOrderEntity> page = this.page(
new Query<PayPaymentOrderEntity>().getPage(params), new Query<PayPaymentOrderEntity>().getPage(params),
new ExcludeEmptyQueryWrapper<PayPaymentOrderEntity>() new MPJLambdaWrapper<PayPaymentOrderEntity>()
.eq("tel",params.get("key")) .leftJoin(MyUserEntity.class,MyUserEntity::getId,PayPaymentOrderEntity::getId)
.or().like("user_name",params.get("key")).orderByDesc("create_time") .selectAll(PayPaymentOrderEntity.class)
.and(t->t.like(MyUserEntity::getTel,params.get("key"))
.or().like(MyUserEntity::getEmail,params.get("key"))
.or().like("user_name",params.get("key")))
.orderByDesc("create_time")
); );

View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.common.utils.ExcludeEmptyQueryWrapper; import com.peanut.common.utils.ExcludeEmptyQueryWrapper;
import com.peanut.common.utils.PageUtils; import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.Query; import com.peanut.common.utils.Query;
@@ -31,14 +32,17 @@ public class TransactionDetailsServiceImpl extends ServiceImpl<TransactionDetail
@Override @Override
public PageUtils queryPage(Map<String, Object> params) { public PageUtils queryPage(Map<String, Object> params) {
String userId = (String) params.get("userId"); String userId = (String) params.get("userId");
IPage<TransactionDetailsEntity> page = this.page( IPage<TransactionDetailsEntity> page = this.page(
new Query<TransactionDetailsEntity>().getPage(params), new Query<TransactionDetailsEntity>().getPage(params),
new ExcludeEmptyQueryWrapper<TransactionDetailsEntity>() new MPJLambdaWrapper<TransactionDetailsEntity>()
.leftJoin(MyUserEntity.class,MyUserEntity::getId,TransactionDetailsEntity::getUserId)
.selectAll(TransactionDetailsEntity.class)
.eq(StringUtils.isNotBlank(userId),"user_id",userId) .eq(StringUtils.isNotBlank(userId),"user_id",userId)
.eq("tel",params.get("key")).or().like("user_name",params.get("key")).orderByDesc("create_time") .and(t->t.like(MyUserEntity::getTel,params.get("key"))
.or().like(MyUserEntity::getEmail,params.get("key"))
.or().like("user_name",params.get("key")))
.orderByDesc("create_time")
); );
return new PageUtils(page); return new PageUtils(page);
} }

View File

@@ -50,12 +50,12 @@ public class TransactionDetailsController {
wrapper.orderByDesc(TransactionDetailsEntity::getCreateTime); wrapper.orderByDesc(TransactionDetailsEntity::getCreateTime);
List<TransactionDetailsEntity> list = transactionDetailsService.list(wrapper); List<TransactionDetailsEntity> list = transactionDetailsService.list(wrapper);
for (TransactionDetailsEntity detail:list){ for (TransactionDetailsEntity detail:list){
if ("购买商品".equals(detail.getOrderType())){ String productName = "";
String productName = ""; String orderSn = detail.getRemark().contains("20")?detail.getRemark().substring(detail.getRemark().indexOf("20")):"";
String orderSn = detail.getRemark().substring(8); BuyOrder buyOrder = buyOrderService.getOne(new LambdaQueryWrapper<BuyOrder>()
BuyOrder buyOrder = buyOrderService.getOne(new LambdaQueryWrapper<BuyOrder>() .eq(BuyOrder::getOrderSn,orderSn));
.eq(BuyOrder::getOrderSn,orderSn)); if (buyOrder!=null){
if (buyOrder!=null){ if ("购买商品".equals(detail.getOrderType())){
List<BuyOrderProduct> products = buyOrderProductService.list(new LambdaQueryWrapper<BuyOrderProduct>() List<BuyOrderProduct> products = buyOrderProductService.list(new LambdaQueryWrapper<BuyOrderProduct>()
.eq(BuyOrderProduct::getOrderId,buyOrder.getOrderId())); .eq(BuyOrderProduct::getOrderId,buyOrder.getOrderId()));
for (BuyOrderProduct buyOrderProduct : products) { for (BuyOrderProduct buyOrderProduct : products) {
@@ -68,10 +68,10 @@ public class TransactionDetailsController {
} }
} }
} }
detail.setRelationId(buyOrder.getOrderId());
} }
detail.setProductName(productName); detail.setRelationId(buyOrder.getOrderId());
} }
detail.setProductName(productName);
} }
return R.ok().put("transactionDetailsList",list); return R.ok().put("transactionDetailsList",list);
} }