更新后端,采用Springboot+mybatis

This commit is contained in:
季圣华
2018-12-19 23:54:53 +08:00
parent bb6f5528a7
commit 5cc26a22f2
1672 changed files with 52804 additions and 156085 deletions

View File

@@ -0,0 +1,40 @@
package com.jsh.erp.utils;
import javax.servlet.http.HttpServletRequest;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
/**
* @author jishenghua qq752718920 2018-10-7 15:26:27
*/
public class ParamUtils {
public static String getPageOffset(Integer currentPage, Integer pageSize) {
if (currentPage != null && pageSize != null) {
int offset = (currentPage - 1) * pageSize;
if (offset < 0) {
return 0 + "";
} else {
return offset + "";
}
}
return null;
}
public static HashMap<String, String> requestToMap(HttpServletRequest request) {
HashMap<String, String> parameterMap = new HashMap<String, String>();
Enumeration<String> names = request.getParameterNames();
if (names != null) {
for (String name : Collections.list(names)) {
parameterMap.put(name, request.getParameter(name));
/*HttpMethod method = HttpMethod.valueOf(request.getMethod());
if (method == GET || method == DELETE)
parameterMap.put(name, transcoding(request.getParameter(name)));
else
parameterMap.put(name, request.getParameter(name));*/
}
}
return parameterMap;
}
}