Revert "```"

This reverts commit abc0674531.
This commit is contained in:
2025-12-26 22:21:21 +08:00
parent ae6c486114
commit 3115e38cc4
920 changed files with 14452 additions and 107025 deletions

View File

@@ -14,7 +14,6 @@ import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.core.common.utils.DateUtils;
import com.core.common.utils.SecurityUtils;
import com.core.framework.config.TenantContext;
import com.openhis.common.constant.CommonConstants;
/**
@@ -101,15 +100,6 @@ public class HisQueryUtils {
return queryWrapper;
}
// 新增SQL转义方法防止注入风险
private static String escapeSql(String value) {
if (value == null) {
return "";
}
// 转义单引号PostgreSQL中用两个单引号表示一个单引号
return value.replace("'", "''");
}
/**
* 检查时间字符串是否符合指定格式
*
@@ -156,8 +146,6 @@ public class HisQueryUtils {
// 获取当前登录用户的租户 ID
if (SecurityUtils.getAuthentication() != null) {
return SecurityUtils.getLoginUser().getTenantId();
} else if (TenantContext.getCurrentTenant() != null) {
return TenantContext.getCurrentTenant();
}
return 0;
}

View File

@@ -1,56 +0,0 @@
package com.openhis.common.utils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.List;
/**
* 分页工具类
*/
public class PageUtils {
/**
* 手动分页
*
* @param allList 数据
* @param pageNo 页码
* @param pageSize 每页大小
* @return 分页数据
*/
public static <T> Page<T> buildPage(List<T> allList, long pageNo, long pageSize) {
Page<T> page = new Page<>();
int total = allList.size();
if (total == 0) {
page.setRecords(new ArrayList<>());
page.setTotal(0);
page.setCurrent(pageNo);
page.setSize(pageSize);
page.setPages(0L);
return page;
}
// 计算分页起始位置
int startIndex = (int)((pageNo - 1) * pageSize);
if (startIndex >= total) {
// 如果起始位置超过总数,返回最后一页
startIndex = (int)((total - 1) / pageSize * pageSize);
pageNo = (total + pageSize - 1) / pageSize;
}
int endIndex = (int)Math.min(startIndex + pageSize, total);
// 获取当前页数据
List<T> currentPageList = allList.subList(startIndex, endIndex);
// 设置分页信息
page.setRecords(new ArrayList<>(currentPageList));
page.setCurrent(pageNo);
page.setSize(pageSize);
page.setTotal(total);
page.setPages((total + pageSize - 1) / pageSize); // 计算总页数
return page;
}
}