Compare commits

..

2 Commits

7 changed files with 70 additions and 12 deletions

View File

@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.core.page.*; import cn.iocoder.yudao.module.core.page.*;
import cn.iocoder.yudao.module.core.text.HttpStatus; import cn.iocoder.yudao.module.core.text.HttpStatus;
import cn.iocoder.yudao.util.StringUtils; import cn.iocoder.yudao.util.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.http.client.utils.DateUtils; import org.apache.http.client.utils.DateUtils;
@ -51,7 +52,11 @@ public class BaseController
*/ */
protected void startPage() protected void startPage()
{ {
PageUtils.startPage(); // 这里直接调用 MyBatis-Plus 的分页插件
PageDomain pageDomain = TableSupport.buildPageRequest();
// 开始分页
Page<Object> page = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize());
} }
/** /**

View File

@ -41,8 +41,12 @@ public class InspectionFileController extends BaseController
public TableDataInfo list(InspectionFile inspectionFile) throws Exception { public TableDataInfo list(InspectionFile inspectionFile) throws Exception {
ShopMallPartners partners = partnerService.shopInfoByUserId(); ShopMallPartners partners = partnerService.shopInfoByUserId();
inspectionFile.setPartnerId(partners.getPartnerId()); inspectionFile.setPartnerId(partners.getPartnerId());
startPage(); startPage();
// 使用MyBatis-Plus的分页查询将结果转换为Page对象
List<InspectionFile> list = inspectionFileService.selectInspectionFileList(inspectionFile); List<InspectionFile> list = inspectionFileService.selectInspectionFileList(inspectionFile);
return getDataTable(list); return getDataTable(list);
} }

View File

@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.inspection.service;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import cn.iocoder.yudao.module.inspection.entity.InspectionFile; import cn.iocoder.yudao.module.inspection.entity.InspectionFile;
@ -60,4 +62,14 @@ public interface IInspectionFileService extends IService<InspectionFile>
* @return 结果 * @return 结果
*/ */
public int deleteInspectionFileById(Long id); public int deleteInspectionFileById(Long id);
/**
* 分页查询 InspectionFile 列表
*
* @param page 分页对象
* @param inspectionFile 查询条件
* @return 分页结果
*/
IPage<InspectionFile> selectInspectionFileList(Page<InspectionFile> page, InspectionFile inspectionFile);
} }

View File

@ -5,6 +5,9 @@ import java.util.List;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.iocoder.yudao.util.DateUtils; import cn.iocoder.yudao.util.DateUtils;
import cn.iocoder.yudao.module.inspection.entity.WarnMessage; import cn.iocoder.yudao.module.inspection.entity.WarnMessage;
@ -165,4 +168,13 @@ public class InspectionFileServiceImpl extends ServiceImpl<InspectionFileMapper,
return 1; return 1;
} }
@Override
public IPage<InspectionFile> selectInspectionFileList(Page<InspectionFile> page, InspectionFile inspectionFile) {
// 创建一个空的 QueryWrapper
QueryWrapper<InspectionFile> queryWrapper = new QueryWrapper<>();
// 直接调用 MyBatis-Plus page 方法进行分页查询
return this.page(page, queryWrapper); // 返回符合条件的分页查询结果
}
} }

View File

@ -116,36 +116,59 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
for (RescueDeptDriver deptDriver : driverIPage.getRecords()) { for (RescueDeptDriver deptDriver : driverIPage.getRecords()) {
DeptRespDTO dept = deptService.getDept(deptDriver.getDeptId()); DeptRespDTO dept = deptService.getDept(deptDriver.getDeptId());
deptDriver.setDeptName(dept.getName()); deptDriver.setDeptName(dept.getName());
String firstDriverIds = deptDriver.getFirstDriverIds(); String firstDriverIds = deptDriver.getFirstDriverIds();
if (StringUtils.isNotEmpty(firstDriverIds)) { if (StringUtils.isNotEmpty(firstDriverIds)) {
StringJoiner tempStr = new StringJoiner("|"); StringJoiner tempStr = new StringJoiner("|");
String[] driverIds = firstDriverIds.split(","); String[] driverIds = firstDriverIds.split(",");
for (String driverId : driverIds) { for (String driverId : driverIds) {
DriverInfo driverInfo = driverInfoService.getById(driverId); DriverInfo driverInfo = driverInfoService.getById(driverId);
if (driverInfo != null) {
AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId()); AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId());
if (sysUser != null) {
tempStr.add(sysUser.getNickname()); tempStr.add(sysUser.getNickname());
} else {
tempStr.add("未知用户");
}
}
} }
deptDriver.setFirstDriverName(tempStr.toString()); deptDriver.setFirstDriverName(tempStr.toString());
} }
// secondDriverIds thirdDriverIds 进行类似的处理
String secondDriverIds = deptDriver.getSecondDriverIds(); String secondDriverIds = deptDriver.getSecondDriverIds();
if (StringUtils.isNotEmpty(secondDriverIds)) { if (StringUtils.isNotEmpty(secondDriverIds)) {
String[] driverIds = secondDriverIds.split(",");
StringJoiner tempStr = new StringJoiner("|"); StringJoiner tempStr = new StringJoiner("|");
String[] driverIds = secondDriverIds.split(",");
for (String driverId : driverIds) { for (String driverId : driverIds) {
DriverInfo driverInfo = driverInfoService.getById(driverId); DriverInfo driverInfo = driverInfoService.getById(driverId);
if (driverInfo != null) {
AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId()); AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId());
if (sysUser != null) {
tempStr.add(sysUser.getNickname()); tempStr.add(sysUser.getNickname());
} else {
tempStr.add("未知用户");
}
}
} }
deptDriver.setSecondDriverName(tempStr.toString()); deptDriver.setSecondDriverName(tempStr.toString());
} }
// thirdDriverIds 进行类似的处理
String thirdDriverIds = deptDriver.getThirdDriverIds(); String thirdDriverIds = deptDriver.getThirdDriverIds();
if (StringUtils.isNotEmpty(thirdDriverIds)) { if (StringUtils.isNotEmpty(thirdDriverIds)) {
String[] driverIds = thirdDriverIds.split(",");
StringJoiner tempStr = new StringJoiner("|"); StringJoiner tempStr = new StringJoiner("|");
String[] driverIds = thirdDriverIds.split(",");
for (String driverId : driverIds) { for (String driverId : driverIds) {
DriverInfo driverInfo = driverInfoService.getById(driverId); DriverInfo driverInfo = driverInfoService.getById(driverId);
if (driverInfo != null) {
AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId()); AdminUserRespDTO sysUser = userService.getUser(driverInfo.getUserId());
if (sysUser != null) {
tempStr.add(sysUser.getNickname()); tempStr.add(sysUser.getNickname());
} else {
tempStr.add("未知用户");
}
}
} }
deptDriver.setThirdDriverName(tempStr.toString()); deptDriver.setThirdDriverName(tempStr.toString());
} }
@ -153,6 +176,7 @@ public class RescueDeptDriverServiceImpl extends ServiceImpl<RescueDeptDriverMap
return driverIPage; return driverIPage;
} }
/** /**
* 新增救援客户司机分配 * 新增救援客户司机分配
* *

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
"avatar": "", "avatar": "",
"version": "4.9.2", "version": "4.9.2",
"createdTime": "2024-10-9 10:34:15", "createdTime": "2024-10-9 10:34:15",
"updatedTime": "2024-10-12 13:40:15", "updatedTime": "2024-10-14 10:36:09",
"dbConns": [], "dbConns": [],
"profile": { "profile": {
"default": { "default": {
@ -683,7 +683,7 @@
"optionsFetcher": "" "optionsFetcher": ""
} }
}, },
"menuWidth": "273px" "menuWidth": "286px"
}, },
"entities": [ "entities": [
{ {