检查项目设置->套餐设置->套餐管理
This commit is contained in:
@@ -19,6 +19,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -68,12 +69,63 @@ public class CheckTypeController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取检查套餐列表
|
||||
* 获取检查套餐列表(支持分页和筛选)
|
||||
*/
|
||||
@GetMapping({"/package/list", "/check-package/list"})
|
||||
public AjaxResult packageList() {
|
||||
List<CheckPackage> list = checkPackageService.list();
|
||||
return AjaxResult.success(list);
|
||||
public AjaxResult packageList(
|
||||
@RequestParam(required = false) Integer pageNo,
|
||||
@RequestParam(required = false) Integer pageSize,
|
||||
@RequestParam(required = false) String organization,
|
||||
@RequestParam(required = false) String packageName,
|
||||
@RequestParam(required = false) String packageLevel,
|
||||
@RequestParam(required = false) String packageType,
|
||||
@RequestParam(required = false) String department,
|
||||
@RequestParam(required = false) String user,
|
||||
@RequestParam(required = false) String startDate,
|
||||
@RequestParam(required = false) String endDate) {
|
||||
|
||||
LambdaQueryWrapper<CheckPackage> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 添加筛选条件
|
||||
if (organization != null && !organization.isEmpty()) {
|
||||
wrapper.eq(CheckPackage::getOrganization, organization);
|
||||
}
|
||||
if (packageName != null && !packageName.isEmpty()) {
|
||||
wrapper.like(CheckPackage::getPackageName, packageName);
|
||||
}
|
||||
if (packageLevel != null && !packageLevel.isEmpty()) {
|
||||
wrapper.eq(CheckPackage::getPackageLevel, packageLevel);
|
||||
}
|
||||
if (packageType != null && !packageType.isEmpty()) {
|
||||
wrapper.eq(CheckPackage::getPackageType, packageType);
|
||||
}
|
||||
if (department != null && !department.isEmpty()) {
|
||||
wrapper.like(CheckPackage::getDepartment, department);
|
||||
}
|
||||
if (user != null && !user.isEmpty()) {
|
||||
wrapper.like(CheckPackage::getUser, user);
|
||||
}
|
||||
if (startDate != null && !startDate.isEmpty()) {
|
||||
wrapper.ge(CheckPackage::getMaintainDate, LocalDate.parse(startDate));
|
||||
}
|
||||
if (endDate != null && !endDate.isEmpty()) {
|
||||
wrapper.le(CheckPackage::getMaintainDate, LocalDate.parse(endDate));
|
||||
}
|
||||
|
||||
// 按更新时间倒序排列
|
||||
wrapper.orderByDesc(CheckPackage::getUpdateTime);
|
||||
|
||||
// 如果需要分页
|
||||
if (pageNo != null && pageSize != null) {
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page<CheckPackage> page =
|
||||
new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(pageNo, pageSize);
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page<CheckPackage> result =
|
||||
checkPackageService.page(page, wrapper);
|
||||
return AjaxResult.success(result);
|
||||
} else {
|
||||
List<CheckPackage> list = checkPackageService.list(wrapper);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user