private String getStoreNo(HttpServletRequest httpServletRequest) throws Exception {
String storeNo = "";
//JSON
BufferedReader streamReader = new BufferedReader(new InputStreamReader(httpServletRequest.getInputStream(), "UTF-8"));
StringBuilder sb = new StringBuilder();
String inputStr;
while ((inputStr = streamReader.readLine()) != null) {
sb.append(inputStr);
}
JSONObject jsonObject = JSONObject.parseObject(sb.toString());
if (EmptyUtil.notEmpty(jsonObject)) {
if (jsonObject.containsKey("storeNo")) {
storeNo = jsonObject.getString("storeNo");
} else if (jsonObject.containsKey("storeId")) {
storeNo = jsonObject.getString("storeId");
}
}
//GET
String storeNoGet = httpServletRequest.getParameter("storeNo");
if (EmptyUtil.notEmpty(storeNoGet)) {
storeNo = storeNoGet;
}
String storeIdGet = httpServletRequest.getParameter("storeId");
if (EmptyUtil.notEmpty(storeIdGet)) {
storeNo = storeIdGet;
}
//POST
Map parameterMap = httpServletRequest.getParameterMap();
if (EmptyUtil.notEmpty(parameterMap)) {
if (parameterMap.containsKey("storeNo")) {
storeNo = parameterMap.get("storeNo")[0];
} else if (parameterMap.containsKey("storeId")) {
storeNo = parameterMap.get("storeId")[0];
}
}
return storeNo;
}