| | |
| | | package com.vci.starter.web.util; |
| | | |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | | import com.vci.starter.web.constant.VConstant; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.http.MediaType; |
| | | |
| | | import javax.servlet.http.Cookie; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.net.URLDecoder; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | |
| | | * @param isQueryTotal 是否查询总数 |
| | | */ |
| | | public static void setQueryTotal(HttpServletRequest request, boolean isQueryTotal){ |
| | | WebThreadLocalUtil.getNeedQueryTotalInThread().set(isQueryTotal?"true":"false"); |
| | | WebThreadLocalUtil.setNeedQueryTotalInThread(isQueryTotal?"true":"false"); |
| | | //request.setAttribute(webProperties.getQueryTotalSessionName(), isQueryTotal); |
| | | } |
| | | |
| | |
| | | tempFileForDownloadMap.remove(uuid); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 内容编码 |
| | | * |
| | | * @param str 内容 |
| | | * @return 编码后的内容 |
| | | */ |
| | | public static String urlEncode(String str) { |
| | | try { |
| | | return URLEncoder.encode(str, VConstant.UTF8); |
| | | } catch (UnsupportedEncodingException e) { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 内容解码 |
| | | * |
| | | * @param str 内容 |
| | | * @return 解码后的内容 |
| | | */ |
| | | public static String urlDecode(String str) { |
| | | try { |
| | | return URLDecoder.decode(str, VConstant.UTF8); |
| | | } catch (UnsupportedEncodingException e) { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | } |
| | | } |