3 Commits

Author SHA1 Message Date
7ddc42f2c4 文档修改 2024-06-05 16:14:55 +08:00
afed333294 线程池回滚 2024-05-10 01:30:10 +08:00
423ae62e51 后端bug修复 2024-05-09 14:08:19 +08:00
9 changed files with 110 additions and 121 deletions

102
README.md
View File

@@ -1,6 +1,7 @@
# 小鹿超市项目 # 小鹿超市项目
![](https://lsky.hhdxw.top/imghub/2024/02/image-202402201708423080.png) ![](https://lsky.hhdxw.top/imghub/2024/02/image-202402201708423080.png)
## 配置信息 ## 配置信息
### 服务器硬件配置 ### 服务器硬件配置
@@ -24,21 +25,21 @@
|-----|---------|----|---------|------| |-----|---------|----|---------|------|
| 腾讯云 | 2c2g3m | | 2024-06 | 北京 | | 腾讯云 | 2c2g3m | | 2024-06 | 北京 |
| 腾讯云 | 4c4g8m | | 2024-06 | 北京 | | 腾讯云 | 4c4g8m | | 2024-06 | 北京 |
| 华为云 | 2c4g1m | | 2024-02 | 北京 | | 华为云 | 2c4g1m | | 2024-06 | 北京 |
| 阿里云 | 2c2g2m | | 2024-06 | 乌兰察布 | | 阿里云 | 2c2g2m | | 2024-06 | 乌兰察布 |
| 雨云 | 8c8g80m | | 2024-03 | 洛杉矶 | | 雨云 | 8c8g80m | | 2024-03 | 洛杉矶 |
| | | | | | | | | | | |
### 服务器参数 ### 服务器参数
| 指标 | 参数 | | 指标 | 参数 |
|-----------|------| |------|------|
| 核心 | 24 | | 核心 | 24 |
| 线程 | 48 | | 线程 | 48 |
| 内存 | 64 | | 内存 | 128 |
| 固态硬盘 | 512G | | 固态硬盘 | 512G |
| 机械硬盘(未购买) | | | 机械硬盘 | 4T |
| | | | | |
### 环境配置需求 ### 环境配置需求
@@ -46,7 +47,7 @@
|-------|-----------------| |-------|-----------------|
| 底层虚拟化 | Debian12 PVE | | 底层虚拟化 | Debian12 PVE |
| 集群系统 | CentOS 8 Stream | | 集群系统 | CentOS 8 Stream |
| | | | 虚拟化系统 | CentOS 7.9 |
### 集群分配设置 ### 集群分配设置
@@ -78,66 +79,62 @@
| Elasticsearch | 7.17.7 | | | | | | | | Elasticsearch | 7.17.7 | | | | | | |
| Kinbana | 7.17.7 | | | | | | | | Kinbana | 7.17.7 | | | | | | |
| Nacos | 2.2.3 | | | | | | | | Nacos | 2.2.3 | | | | | | |
| | | | | | | | | | OSS | 阿里云/Minio | | | | | | |
| SkyWalking | 9.7.0 | | | | | | | | SkyWalking | 9.7.0 | | | | | | |
| DevOps | | | | | | | | | DevOps | Gitea+Jenkins+Kubernetes | | | | | | |
| Gitea | 1.21.3 | | | | | | | | Gitea | 1.21.3 | | | | | | |
| Nexus3 | 2023-12-27T07:29 | | | | | | | | Nexus3 | 2023-12-27T07:29 | | | | | | |
| HarBor | 2.8.0 | | | | | | |
## 技术栈 ## 技术栈
### 后端技术栈 ### 后端技术栈
| 核心技术 | | 核心技术 |
| :----------------------------------------------------------- | |:---------------------------------------------------------------------------------------------------------------------------------|
| SpringBoot简化新Spring应用的初始搭建以及开发过程 | | SpringBoot简化新Spring应用的初始搭建以及开发过程 |
| SpringCloud基于Spring Boot实现的云原生应用开发工具SpringCloud使用的技术Spring Cloud Gateway、Spring Cloud OpenFeign、Spring Cloud Alibaba Nacos等 | | SpringCloud基于Spring Boot实现的云原生应用开发工具SpringCloud使用的技术Spring Cloud Gateway、Spring Cloud OpenFeign、Spring Cloud Alibaba Nacos等 |
| MyBatis-Plus持久层框架 | | MyBatis-Plus持久层框架 |
| Redis缓存数据库 | | Redis缓存数据库 |
| Redisson基于redis的Java驻内存数据网格实现分布式锁 | | Redisson基于redis的Java驻内存数据网格实现分布式锁 |
| RabbitMQ消息中间件 | | RabbitMQ消息中间件 |
| ElasticSearch + Kibana: 全文检索服务器 +可视化数据监控 | | ElasticSearch + Kibana: 全文检索服务器 +可视化数据监控 |
| ThreadPoolExecutor线程池来实现异步操作提高效率 | | ThreadPoolExecutor线程池来实现异步操作提高效率 |
| OSS/MinIO文件存储服务 | | OSS/MinIO文件存储服务 |
| Knife4jSwaggerApi接口文档工具 | | Knife4jSwaggerApi接口文档工具 |
| Nginx负载均衡 | | Nginx负载均衡 |
| MySQL关系型数据库 | | MySQL关系型数据库 |
| 微信支付 | | 微信支付 |
| 微信小程序 | | 支付宝支付 |
| Docker容器技术 | | Docker容器技术 |
| DockerFile管理Docker镜像命令文本 | | DockerFile管理Docker镜像命令文本 |
| SkyWalking链路追踪、日志、监控框架 | | SkyWalking链路追踪、日志、监控框架 |
| |
| |
### 前端技术栈 ### 前端技术栈
| 核心技术 | | 核心技术 | |
| ------------------ | |--------------------|------|
| UinApp | | UinApp | |
| vue-admin-template | | vue-admin-template | |
| ElementUI | | ElementUI | |
| Axios | | Axios | |
| Node.js | | Node.js | |
| Npm | | Npm | |
| |
| |
| |
### 开发工具 ### 开发工具
| 开发工具 | 版本 | | 开发工具 | 版本 |
| ----------------------------- | -------------- | |-------------------------------|----------------|
| Intellil IDEA Ultimate | 2023.3.2 | | Intellil IDEA Ultimate | 2024.1.1 |
| DataGrip | 2023.3.2 | | DataGrip | 2024.1.1 |
| WebStorm | 2023.3.2 | | WebStorm | 2024.1.1 |
| HBuilderx | 3.8.12 | | HBuilderx | 3.8.12 |
| Google Chrome | 120.0.6099.216 | | Google Chrome | 120.0.6099.216 |
| Another Redis Desktop Manager | 1.6 | | Another Redis Desktop Manager | 1.6 |
| Apifox | 2.3.19 | | Apifox | 2.3.19 |
| Parallels Desktop | 18.1.1 | | Parallels Desktop | 18.1.1 |
| Termius | 8.4.0 | | Termius | 8.4.0 |
| 微信开发者工具 | 1.06.2306020 | | 微信开发者工具 | 1.06.2306020 |
### 操作系统 ### 操作系统
@@ -338,10 +335,3 @@ services:
start_period: 60s #⾸次检测延迟时间 start_period: 60s #⾸次检测延迟时间
``` ```
## 开发需求
| | | |
|------|------|------|
| | | |
| | | |
| | | |

View File

@@ -34,10 +34,10 @@ public class CodeGet {
// 3、数据源配置 // 3、数据源配置
DataSourceConfig dsc = new DataSourceConfig(); DataSourceConfig dsc = new DataSourceConfig();
dsc.setUrl("jdbc:mysql://82.157.68.223:3306/shequ-user?serverTimezone=GMT%2B8&useSSL=false"); dsc.setUrl("jdbc:mysql://82.157.68.223:3306/xlcs-user?serverTimezone=GMT%2B8&useSSL=false");
dsc.setDriverName("com.mysql.cj.jdbc.Driver"); dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUsername("shequ-user"); dsc.setUsername("xlcs-user");
dsc.setPassword("shequ-user"); dsc.setPassword("xlcs-user");
dsc.setDbType(DbType.MYSQL); dsc.setDbType(DbType.MYSQL);
mpg.setDataSource(dsc); mpg.setDataSource(dsc);

View File

@@ -8,4 +8,4 @@ spring:
username: nacos username: nacos
password: nacos password: nacos
enabled: true enabled: true
file-extension: yml file-extension: yml

View File

@@ -1,5 +1,10 @@
package com.yovinchen.xlcs.activity.service.impl; package com.yovinchen.xlcs.activity.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yovinchen.xlcs.activity.mapper.ActivityInfoMapper; import com.yovinchen.xlcs.activity.mapper.ActivityInfoMapper;
import com.yovinchen.xlcs.activity.mapper.ActivityRuleMapper; import com.yovinchen.xlcs.activity.mapper.ActivityRuleMapper;
import com.yovinchen.xlcs.activity.mapper.ActivitySkuMapper; import com.yovinchen.xlcs.activity.mapper.ActivitySkuMapper;
@@ -16,11 +21,6 @@ import com.yovinchen.xlcs.model.product.SkuInfo;
import com.yovinchen.xlcs.vo.activity.ActivityRuleVo; import com.yovinchen.xlcs.vo.activity.ActivityRuleVo;
import com.yovinchen.xlcs.vo.order.CartInfoVo; import com.yovinchen.xlcs.vo.order.CartInfoVo;
import com.yovinchen.xlcs.vo.order.OrderConfirmVo; import com.yovinchen.xlcs.vo.order.OrderConfirmVo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -70,10 +70,10 @@ public class ActivityInfoServiceImpl extends ServiceImpl<ActivityInfoMapper, Act
IPage<ActivityInfo> page = activityInfoMapper.selectPage(pageParam, queryWrapper); IPage<ActivityInfo> page = activityInfoMapper.selectPage(pageParam, queryWrapper);
page.getRecords() page.getRecords()
.forEach(item -> { .forEach(item -> {
item.setActivityTypeString(item.getActivityType() item.setActivityTypeString(item.getActivityType()
.getComment()); .getComment());
}); });
return page; return page;
} }
@@ -96,8 +96,8 @@ public class ActivityInfoServiceImpl extends ServiceImpl<ActivityInfoMapper, Act
activitySkuQueryWrapper.eq(ActivitySku::getActivityId, activityId); activitySkuQueryWrapper.eq(ActivitySku::getActivityId, activityId);
List<ActivitySku> activitySkuList = activitySkuMapper.selectList(activitySkuQueryWrapper); List<ActivitySku> activitySkuList = activitySkuMapper.selectList(activitySkuQueryWrapper);
List<Long> skuIdList = activitySkuList.stream() List<Long> skuIdList = activitySkuList.stream()
.map(ActivitySku::getSkuId) .map(ActivitySku::getSkuId)
.collect(Collectors.toList()); .collect(Collectors.toList());
List<SkuInfo> skuInfoList = null; List<SkuInfo> skuInfoList = null;
if (!skuIdList.isEmpty()) { if (!skuIdList.isEmpty()) {
@@ -159,8 +159,8 @@ public class ActivityInfoServiceImpl extends ServiceImpl<ActivityInfoMapper, Act
//从skuInfoList集合获取所有skuId //从skuInfoList集合获取所有skuId
List<Long> skuIdList = skuInfoList.stream() List<Long> skuIdList = skuInfoList.stream()
.map(SkuInfo::getId) .map(SkuInfo::getId)
.collect(Collectors.toList()); .collect(Collectors.toList());
//第二步 判断添加商品之前是否参加过活动, //第二步 判断添加商品之前是否参加过活动,
// 如果之前参加过,活动正在进行中,排除商品 // 如果之前参加过,活动正在进行中,排除商品
@@ -436,22 +436,10 @@ public class ActivityInfoServiceImpl extends ServiceImpl<ActivityInfoMapper, Act
optimalActivityRule.setReduceAmount(new BigDecimal("0")); optimalActivityRule.setReduceAmount(new BigDecimal("0"));
optimalActivityRule.setSelectType(1); optimalActivityRule.setSelectType(1);
String ruleDesc = "" + String ruleDesc = "" + optimalActivityRule.getConditionNum() + "元打" + optimalActivityRule.getBenefitDiscount() + "折,还差" + (totalNum - optimalActivityRule.getConditionNum()) + "";
optimalActivityRule.getConditionNum() +
"元打" +
optimalActivityRule.getBenefitDiscount() +
"折,还差" +
(totalNum - optimalActivityRule.getConditionNum()) +
"";
optimalActivityRule.setRuleDesc(ruleDesc); optimalActivityRule.setRuleDesc(ruleDesc);
} else { } else {
String ruleDesc = "" + String ruleDesc = "" + optimalActivityRule.getConditionNum() + "元打" + optimalActivityRule.getBenefitDiscount() + "折,已减" + optimalActivityRule.getReduceAmount() + "";
optimalActivityRule.getConditionNum() +
"元打" +
optimalActivityRule.getBenefitDiscount() +
"折,已减" +
optimalActivityRule.getReduceAmount() +
"";
optimalActivityRule.setRuleDesc(ruleDesc); optimalActivityRule.setRuleDesc(ruleDesc);
optimalActivityRule.setSelectType(2); optimalActivityRule.setSelectType(2);
} }
@@ -483,22 +471,10 @@ public class ActivityInfoServiceImpl extends ServiceImpl<ActivityInfoMapper, Act
optimalActivityRule.setReduceAmount(new BigDecimal("0")); optimalActivityRule.setReduceAmount(new BigDecimal("0"));
optimalActivityRule.setSelectType(1); optimalActivityRule.setSelectType(1);
String ruleDesc = "" + String ruleDesc = "" + optimalActivityRule.getConditionAmount() + "元减" + optimalActivityRule.getBenefitAmount() + "元,还差" + totalAmount.subtract(optimalActivityRule.getConditionAmount()) + "";
optimalActivityRule.getConditionAmount() +
"元减" +
optimalActivityRule.getBenefitAmount() +
"元,还差" +
totalAmount.subtract(optimalActivityRule.getConditionAmount()) +
"";
optimalActivityRule.setRuleDesc(ruleDesc); optimalActivityRule.setRuleDesc(ruleDesc);
} else { } else {
String ruleDesc = "" + String ruleDesc = "" + optimalActivityRule.getConditionAmount() + "元减" + optimalActivityRule.getBenefitAmount() + "元,已减" + optimalActivityRule.getReduceAmount() + "";
optimalActivityRule.getConditionAmount() +
"元减" +
optimalActivityRule.getBenefitAmount() +
"元,已减" +
optimalActivityRule.getReduceAmount() +
"";
optimalActivityRule.setRuleDesc(ruleDesc); optimalActivityRule.setRuleDesc(ruleDesc);
optimalActivityRule.setSelectType(2); optimalActivityRule.setSelectType(2);
} }

View File

@@ -153,7 +153,8 @@ public class CartInfoServiceImpl implements CartInfoService {
BoundHashOperations<String, String, CartInfo> hashOperations = redisTemplate.boundHashOps(cartKey); BoundHashOperations<String, String, CartInfo> hashOperations = redisTemplate.boundHashOps(cartKey);
List<CartInfo> cartInfoList = hashOperations.values(); List<CartInfo> cartInfoList = hashOperations.values();
for (CartInfo cartInfo : cartInfoList) { for (CartInfo cartInfo : cartInfoList) {
hashOperations.delete(cartInfo.getSkuId().toString()); hashOperations.delete(cartInfo.getSkuId()
.toString());
} }
} }
@@ -192,7 +193,8 @@ public class CartInfoServiceImpl implements CartInfoService {
cartInfoList = boundHashOperations.values(); cartInfoList = boundHashOperations.values();
if (!CollectionUtils.isEmpty(cartInfoList)) { if (!CollectionUtils.isEmpty(cartInfoList)) {
//根据商品添加时间,降序 //根据商品添加时间,降序
cartInfoList.sort((o1, o2) -> o1.getCreateTime().compareTo(o2.getCreateTime())); cartInfoList.sort((o1, o2) -> o1.getCreateTime()
.compareTo(o2.getCreateTime()));
} }
return cartInfoList; return cartInfoList;
} }
@@ -234,7 +236,8 @@ public class CartInfoServiceImpl implements CartInfoService {
List<CartInfo> cartInfoList = boundHashOperations.values(); List<CartInfo> cartInfoList = boundHashOperations.values();
cartInfoList.forEach(cartInfo -> { cartInfoList.forEach(cartInfo -> {
cartInfo.setIsChecked(isChecked); cartInfo.setIsChecked(isChecked);
boundHashOperations.put(cartInfo.getSkuId().toString(), cartInfo); boundHashOperations.put(cartInfo.getSkuId()
.toString(), cartInfo);
}); });
this.setCartKeyExpire(cartKey); this.setCartKeyExpire(cartKey);
} }
@@ -253,7 +256,8 @@ public class CartInfoServiceImpl implements CartInfoService {
skuIdList.forEach(skuId -> { skuIdList.forEach(skuId -> {
CartInfo cartInfo = boundHashOperations.get(skuId.toString()); CartInfo cartInfo = boundHashOperations.get(skuId.toString());
cartInfo.setIsChecked(isChecked); cartInfo.setIsChecked(isChecked);
boundHashOperations.put(cartInfo.getSkuId().toString(), cartInfo); boundHashOperations.put(cartInfo.getSkuId()
.toString(), cartInfo);
}); });
this.setCartKeyExpire(cartKey); this.setCartKeyExpire(cartKey);
} }
@@ -270,9 +274,9 @@ public class CartInfoServiceImpl implements CartInfoService {
BoundHashOperations<String, String, CartInfo> boundHashOperations = redisTemplate.boundHashOps(cartKey); BoundHashOperations<String, String, CartInfo> boundHashOperations = redisTemplate.boundHashOps(cartKey);
List<CartInfo> cartInfoList = boundHashOperations.values(); List<CartInfo> cartInfoList = boundHashOperations.values();
//isChecked = 1购物项选中 //isChecked = 1购物项选中
return cartInfoList.stream().filter(cartInfo -> { return cartInfoList != null ? cartInfoList.stream()
return cartInfo.getIsChecked().intValue() == 1; .filter(cartInfo -> cartInfo.getIsChecked() == 1)
}).collect(Collectors.toList()); .collect(Collectors.toList()) : null;
} }
/** /**
@@ -286,7 +290,9 @@ public class CartInfoServiceImpl implements CartInfoService {
List<CartInfo> cartInfoList = this.getCartCheckedList(userId); List<CartInfo> cartInfoList = this.getCartCheckedList(userId);
//查询list数据处理得到skuId集合 //查询list数据处理得到skuId集合
List<Long> skuIdList = cartInfoList.stream().map(item -> item.getSkuId()).collect(Collectors.toList()); List<Long> skuIdList = cartInfoList.stream()
.map(item -> item.getSkuId())
.collect(Collectors.toList());
//构建redis的key值 //构建redis的key值
// hash类型 key filed-value // hash类型 key filed-value

View File

@@ -101,6 +101,7 @@ public class WeXinServiceImpl implements WeixinService {
result.put("signType", "MD5"); result.put("signType", "MD5");
result.put("paySign", sign); result.put("paySign", sign);
result.put("package", packages); result.put("package", packages);
result.put("out_trade_no", paymentInfo.getOrderNo());
//6 返回结果 //6 返回结果
return result; return result;

View File

@@ -4,9 +4,9 @@ package com.yovinchen.xlcs.user.controller;
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.yovinchen.xlcs.common.result.Result; import com.yovinchen.xlcs.common.result.Result;
import com.yovinchen.xlcs.model.user.Leader;
import com.yovinchen.xlcs.user.service.LeaderService; import com.yovinchen.xlcs.user.service.LeaderService;
import com.yovinchen.xlcs.vo.user.LeaderQueryVo; import com.yovinchen.xlcs.vo.user.LeaderQueryVo;
import com.yovinchen.xlcs.vo.user.LeaderVo;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
/** /**
* <p> * <p>
* 团长表 前端控制器 * 配送员 前端控制器
* </p> * </p>
* *
* @author yovinchen * @author yovinchen
@@ -34,12 +34,12 @@ public class LeaderController {
// getPageCheckList // getPageCheckList
@ApiOperation(value = "获取页面列表") @ApiOperation(value = "获取页面列表")
@GetMapping("getPageCheckList/{page}/{limit}") @GetMapping("getPageCheckList/{page}/{limit}")
public Result<IPage<LeaderVo>> getPageCheckList(@ApiParam(name = "page", value = "当前页码", required = true) @PathVariable Long page, public Result getPageCheckList(@ApiParam(name = "page", value = "当前页码", required = true) @PathVariable Long page,
@ApiParam(name = "limit", value = "每页记录数", required = true) @PathVariable Long limit, @ApiParam(name = "limit", value = "每页记录数", required = true) @PathVariable Long limit,
@ApiParam(name = "LeaderQueryVo", value = "查询对象", required = false) LeaderQueryVo leaderQueryVo) { @ApiParam(name = "LeaderQueryVo", value = "查询对象", required = false) LeaderQueryVo leaderQueryVo) {
try { try {
Page<LeaderVo> pageParam = new Page<>(page, limit); Page<Leader> pageParam = new Page<>(page, limit);
IPage<LeaderVo> pageModel = leaderService.selectPage(pageParam, leaderQueryVo); IPage<Leader> pageModel = leaderService.selectPage(pageParam, leaderQueryVo);
return Result.ok(pageModel); return Result.ok(pageModel);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("获取sku分页列表异常", e); throw new RuntimeException("获取sku分页列表异常", e);

View File

@@ -5,11 +5,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yovinchen.xlcs.model.user.Leader; import com.yovinchen.xlcs.model.user.Leader;
import com.yovinchen.xlcs.vo.user.LeaderQueryVo; import com.yovinchen.xlcs.vo.user.LeaderQueryVo;
import com.yovinchen.xlcs.vo.user.LeaderVo;
/** /**
* <p> * <p>
* 团长表 服务类 * 配送员 服务类
* </p> * </p>
* *
* @author yovinchen * @author yovinchen
@@ -17,5 +16,5 @@ import com.yovinchen.xlcs.vo.user.LeaderVo;
*/ */
public interface LeaderService extends IService<Leader> { public interface LeaderService extends IService<Leader> {
IPage<LeaderVo> selectPage(Page<LeaderVo> pageParam, LeaderQueryVo leaderQueryVo); IPage<Leader> selectPage(Page<Leader> pageParam, LeaderQueryVo leaderQueryVo);
} }

View File

@@ -1,5 +1,6 @@
package com.yovinchen.xlcs.user.service.impl; package com.yovinchen.xlcs.user.service.impl;
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;
@@ -7,22 +8,38 @@ import com.yovinchen.xlcs.model.user.Leader;
import com.yovinchen.xlcs.user.mapper.LeaderMapper; import com.yovinchen.xlcs.user.mapper.LeaderMapper;
import com.yovinchen.xlcs.user.service.LeaderService; import com.yovinchen.xlcs.user.service.LeaderService;
import com.yovinchen.xlcs.vo.user.LeaderQueryVo; import com.yovinchen.xlcs.vo.user.LeaderQueryVo;
import com.yovinchen.xlcs.vo.user.LeaderVo; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
/** /**
* <p> * <p>
* 团长表 服务实现类 * 配送员 服务实现类
* </p> * </p>
* *
* @author yovinchen * @author yovinchen
* @since 2024-01-30 * @since 2024-01-30
*/ */
@Slf4j
@Service @Service
public class LeaderServiceImpl extends ServiceImpl<LeaderMapper, Leader> implements LeaderService { public class LeaderServiceImpl extends ServiceImpl<LeaderMapper, Leader> implements LeaderService {
/**
* 分页查询配送员
*
* @param pageParam
* @param leaderQueryVo
* @return
*/
@Override @Override
public IPage<LeaderVo> selectPage(Page<LeaderVo> pageParam, LeaderQueryVo leaderQueryVo) { public IPage<Leader> selectPage(Page<Leader> pageParam, LeaderQueryVo leaderQueryVo) {
return null; log.info("获取配送员分页列表入参{}", pageParam.toString() + leaderQueryVo.toString());
LambdaQueryWrapper<Leader> wrapper = new LambdaQueryWrapper<>();
String keyword = leaderQueryVo.getKeyword();
if (!StringUtils.isEmpty(keyword)) {
//封装条件
wrapper.like(Leader::getName, keyword);
}
return baseMapper.selectPage(pageParam, wrapper);
} }
} }