返回默认值
This commit is contained in:
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
* @author GYJoker
|
* @author GYJoker
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/test")
|
@RequestMapping("/notify/test")
|
||||||
public class TestController {
|
public class TestController {
|
||||||
@Resource
|
@Resource
|
||||||
private ShopUserFlowService shopUserFlowService;
|
private ShopUserFlowService shopUserFlowService;
|
||||||
|
|||||||
@@ -62,6 +62,15 @@ public class PageUtil {
|
|||||||
return new Page<>(pageNum, pageSize);
|
return new Page<>(pageNum, pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取空Page对象
|
||||||
|
*/
|
||||||
|
public <T> Page<T> emptyPage() {
|
||||||
|
return Page.of(1,10,0) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构造排序QueryWrapper
|
* 构造排序QueryWrapper
|
||||||
* 从param体获取
|
* 从param体获取
|
||||||
|
|||||||
@@ -473,7 +473,7 @@ public class CallTableServiceImpl extends ServiceImpl<CallTableMapper, CallTable
|
|||||||
} else {
|
} else {
|
||||||
List<CallTable> list = queryChain().eq(CallTable::getShopId, shopId).eq(CallTable::getState, 1).list();
|
List<CallTable> list = queryChain().eq(CallTable::getShopId, shopId).eq(CallTable::getState, 1).list();
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
return new Page<>();
|
return PageUtil.emptyPage();
|
||||||
}
|
}
|
||||||
tableIds = list.stream()
|
tableIds = list.stream()
|
||||||
.map(CallTable::getId)
|
.map(CallTable::getId)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.czg.market.service.GbWareService;
|
|||||||
import com.czg.sa.StpKit;
|
import com.czg.sa.StpKit;
|
||||||
import com.czg.service.market.mapper.GbWareMapper;
|
import com.czg.service.market.mapper.GbWareMapper;
|
||||||
import com.czg.utils.AssertUtil;
|
import com.czg.utils.AssertUtil;
|
||||||
|
import com.czg.utils.PageUtil;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
@@ -32,7 +33,7 @@ public class GbWareServiceImpl extends ServiceImpl<GbWareMapper, GbWare> impleme
|
|||||||
@Override
|
@Override
|
||||||
public Page<GbWare> getGbWarePage(GbWareQueryParamDTO param, Long shopId, boolean isAdmin) {
|
public Page<GbWare> getGbWarePage(GbWareQueryParamDTO param, Long shopId, boolean isAdmin) {
|
||||||
if (!isAdmin && !shopInfoService.checkSwitch(shopId, ShopSwitchTypeEnum.GROUP_BUY)) {
|
if (!isAdmin && !shopInfoService.checkSwitch(shopId, ShopSwitchTypeEnum.GROUP_BUY)) {
|
||||||
return new Page<>();
|
return PageUtil.emptyPage();
|
||||||
}
|
}
|
||||||
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
|
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
|
||||||
QueryWrapper queryWrapper = new QueryWrapper();
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
@@ -54,9 +55,7 @@ public class GbWareServiceImpl extends ServiceImpl<GbWareMapper, GbWare> impleme
|
|||||||
});
|
});
|
||||||
Page<GbWare> page = page(Page.of(param.getPage(), param.getSize()), queryWrapper);
|
Page<GbWare> page = page(Page.of(param.getPage(), param.getSize()), queryWrapper);
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
page.getRecords().forEach(item -> {
|
page.getRecords().forEach(item -> item.setShopId(shopId));
|
||||||
item.setShopId(shopId);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
|
|||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -43,7 +42,7 @@ public class MkPointsGoodsServiceImpl extends ServiceImpl<MkPointsGoodsMapper, M
|
|||||||
public Page<MkPointsGoods> getPointsGoodsPage(BaseQueryParam param, Long shopId) {
|
public Page<MkPointsGoods> getPointsGoodsPage(BaseQueryParam param, Long shopId) {
|
||||||
boolean exists = mkPointsConfigService.exists(query().eq(MkPointsConfig::getShopId, shopId).eq(MkPointsConfig::getEnablePointsMall, 1));
|
boolean exists = mkPointsConfigService.exists(query().eq(MkPointsConfig::getShopId, shopId).eq(MkPointsConfig::getEnablePointsMall, 1));
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
return new Page<>();
|
return PageUtil.emptyPage();
|
||||||
}
|
}
|
||||||
Page<MkPointsGoods> page = page(Page.of(param.getPage(), param.getSize()),
|
Page<MkPointsGoods> page = page(Page.of(param.getPage(), param.getSize()),
|
||||||
query()
|
query()
|
||||||
|
|||||||
@@ -31,11 +31,11 @@ public class MkPointsUserRecordServiceImpl extends ServiceImpl<MkPointsUserRecor
|
|||||||
@Override
|
@Override
|
||||||
public Page<MkPointsUserRecord> pageByPointsUserId(Integer page, Integer size, Long mkPointsUserId) {
|
public Page<MkPointsUserRecord> pageByPointsUserId(Integer page, Integer size, Long mkPointsUserId) {
|
||||||
if (mkPointsUserId == null) {
|
if (mkPointsUserId == null) {
|
||||||
return new Page<>();
|
return PageUtil.emptyPage();
|
||||||
}
|
}
|
||||||
ShopInfo shopInfo = shopInfoService.getById(StpKit.USER.getShopId());
|
ShopInfo shopInfo = shopInfoService.getById(StpKit.USER.getShopId());
|
||||||
if (shopInfo == null) {
|
if (shopInfo == null) {
|
||||||
return new Page<>();
|
return PageUtil.emptyPage();
|
||||||
}
|
}
|
||||||
Page<MkPointsUserRecord> pages = page(Page.of(page, size),
|
Page<MkPointsUserRecord> pages = page(Page.of(page, size),
|
||||||
query().eq(MkPointsUserRecord::getMkPointsUserId, mkPointsUserId).orderBy(MkPointsUserRecord::getCreateTime, false));
|
query().eq(MkPointsUserRecord::getMkPointsUserId, mkPointsUserId).orderBy(MkPointsUserRecord::getCreateTime, false));
|
||||||
@@ -46,7 +46,7 @@ public class MkPointsUserRecordServiceImpl extends ServiceImpl<MkPointsUserRecor
|
|||||||
@Override
|
@Override
|
||||||
public Page<MkPointsUserRecord> getPointsUserRecord(Integer page, Integer size, Long mkPointsUserId) {
|
public Page<MkPointsUserRecord> getPointsUserRecord(Integer page, Integer size, Long mkPointsUserId) {
|
||||||
if (mkPointsUserId == null) {
|
if (mkPointsUserId == null) {
|
||||||
return new Page<>();
|
return PageUtil.emptyPage();
|
||||||
}
|
}
|
||||||
PageHelper.startPage(page, size);
|
PageHelper.startPage(page, size);
|
||||||
List<MkPointsUserRecord> record = mapper.getPointsUserRecord(mkPointsUserId);
|
List<MkPointsUserRecord> record = mapper.getPointsUserRecord(mkPointsUserId);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import com.czg.market.service.MkPointsUserRecordService;
|
|||||||
import com.czg.market.service.MkPointsUserService;
|
import com.czg.market.service.MkPointsUserService;
|
||||||
import com.czg.sa.StpKit;
|
import com.czg.sa.StpKit;
|
||||||
import com.czg.service.market.mapper.MkPointsUserMapper;
|
import com.czg.service.market.mapper.MkPointsUserMapper;
|
||||||
|
import com.czg.utils.PageUtil;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@@ -50,7 +51,7 @@ public class MkPointsUserServiceImpl extends ServiceImpl<MkPointsUserMapper, MkP
|
|||||||
if (StrUtil.isNotBlank(phone)) {
|
if (StrUtil.isNotBlank(phone)) {
|
||||||
ShopUser one = shopUserService.getOne(query().eq(ShopUser::getPhone, phone).eq(ShopUser::getMainShopId, mainIdByShopId));
|
ShopUser one = shopUserService.getOne(query().eq(ShopUser::getPhone, phone).eq(ShopUser::getMainShopId, mainIdByShopId));
|
||||||
if (one == null) {
|
if (one == null) {
|
||||||
return new Page<>();
|
return PageUtil.emptyPage();
|
||||||
}
|
}
|
||||||
shopUserId = one.getId();
|
shopUserId = one.getId();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.czg.sa.StpKit;
|
|||||||
import com.czg.service.market.mapper.PpPackageMapper;
|
import com.czg.service.market.mapper.PpPackageMapper;
|
||||||
import com.czg.service.market.mapper.PpPackageOrderMapper;
|
import com.czg.service.market.mapper.PpPackageOrderMapper;
|
||||||
import com.czg.utils.AssertUtil;
|
import com.czg.utils.AssertUtil;
|
||||||
|
import com.czg.utils.PageUtil;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
import com.mybatisflex.core.update.UpdateChain;
|
import com.mybatisflex.core.update.UpdateChain;
|
||||||
@@ -168,7 +169,7 @@ public class PpPackageServiceImpl extends ServiceImpl<PpPackageMapper, PpPackage
|
|||||||
Integer promotionSwitch = getPackagePromotionSwitch(shopId);
|
Integer promotionSwitch = getPackagePromotionSwitch(shopId);
|
||||||
if (!isAdmin && SystemConstants.OneZero.ZERO == promotionSwitch) {
|
if (!isAdmin && SystemConstants.OneZero.ZERO == promotionSwitch) {
|
||||||
log.info("没有开启套餐推广");
|
log.info("没有开启套餐推广");
|
||||||
return new Page<>();
|
return PageUtil.emptyPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
|
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
|
|||||||
}
|
}
|
||||||
return PageUtil.convert(new PageInfo<>(coupons));
|
return PageUtil.convert(new PageInfo<>(coupons));
|
||||||
}
|
}
|
||||||
return new Page<>();
|
return PageUtil.emptyPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
.like(OrderDetail::getProductName, productName);
|
.like(OrderDetail::getProductName, productName);
|
||||||
like = orderDetailService.listAs(queryWrapper, Long.class);
|
like = orderDetailService.listAs(queryWrapper, Long.class);
|
||||||
if (CollUtil.isEmpty(like)) {
|
if (CollUtil.isEmpty(like)) {
|
||||||
return new Page<>();
|
return PageUtil.emptyPage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QueryWrapper queryWrapper = PageUtil.buildSortQueryWrapper();
|
QueryWrapper queryWrapper = PageUtil.buildSortQueryWrapper();
|
||||||
|
|||||||
Reference in New Issue
Block a user