|
@@ -10,14 +10,17 @@ import net.sf.json.JSONObject;
|
|
|
import org.apache.struts2.ServletActionContext;
|
|
import org.apache.struts2.ServletActionContext;
|
|
|
import org.apache.struts2.interceptor.ServletRequestAware;
|
|
import org.apache.struts2.interceptor.ServletRequestAware;
|
|
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
|
|
public class IDCAction extends ActionSupport implements ServletRequestAware {
|
|
public class IDCAction extends ActionSupport implements ServletRequestAware {
|
|
|
|
|
|
|
|
private HttpServletRequest request;
|
|
private HttpServletRequest request;
|
|
|
public HttpServletResponse response;
|
|
public HttpServletResponse response;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
private IDCService idcService;
|
|
private IDCService idcService;
|
|
|
|
|
|
|
|
public HttpServletRequest getRequest() {
|
|
public HttpServletRequest getRequest() {
|
|
@@ -46,16 +49,16 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
|
|
|
*/
|
|
*/
|
|
|
public String getBookStatusData(){
|
|
public String getBookStatusData(){
|
|
|
JSONObject resultJson = new JSONObject();
|
|
JSONObject resultJson = new JSONObject();
|
|
|
- IDCBookStatusEto idcBookStatusEto = idcService.getBookStatusData();
|
|
|
|
|
- if (idcBookStatusEto == null) {
|
|
|
|
|
|
|
+ List<IDCBookStatusEto> list = idcService.getBookStatusData();
|
|
|
|
|
+ if (list == null && list.size()==0) {
|
|
|
resultJson.put("message", "数据为空");
|
|
resultJson.put("message", "数据为空");
|
|
|
resultJson.put("code", 500);
|
|
resultJson.put("code", 500);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
resultJson.put("message", "查询成功");
|
|
resultJson.put("message", "查询成功");
|
|
|
- resultJson.put("code", 500);
|
|
|
|
|
- resultJson.put("data", idcBookStatusEto);
|
|
|
|
|
|
|
+ resultJson.put("code", 200);
|
|
|
|
|
+ resultJson.put("data", list);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -66,8 +69,8 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
|
|
|
*/
|
|
*/
|
|
|
public String getHotelData() {
|
|
public String getHotelData() {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
JSONObject resultJson = new JSONObject();
|
|
|
- IDCHotelEto idcHotelEto = idcService.getHotelData();
|
|
|
|
|
- if (idcHotelEto == null) {
|
|
|
|
|
|
|
+ List<IDCHotelEto> list = idcService.getHotelData();
|
|
|
|
|
+ if (list == null && list.size()==0) {
|
|
|
resultJson.put("message", "数据为空");
|
|
resultJson.put("message", "数据为空");
|
|
|
resultJson.put("code", 500);
|
|
resultJson.put("code", 500);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
@@ -75,7 +78,7 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
}
|
|
|
resultJson.put("message", "查询成功");
|
|
resultJson.put("message", "查询成功");
|
|
|
resultJson.put("code", 500);
|
|
resultJson.put("code", 500);
|
|
|
- resultJson.put("data", idcHotelEto);
|
|
|
|
|
|
|
+ resultJson.put("data", list);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -86,8 +89,8 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
|
|
|
*/
|
|
*/
|
|
|
public String getRankBookNumData() {
|
|
public String getRankBookNumData() {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
JSONObject resultJson = new JSONObject();
|
|
|
- IDCRankEto idcRankEto = idcService.getRankBookNumData();
|
|
|
|
|
- if (idcRankEto == null) {
|
|
|
|
|
|
|
+ List<IDCRankEto> list = idcService.getRankBookNumData();
|
|
|
|
|
+ if (list == null && list.size()==0) {
|
|
|
resultJson.put("message", "数据为空");
|
|
resultJson.put("message", "数据为空");
|
|
|
resultJson.put("code", 500);
|
|
resultJson.put("code", 500);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
@@ -95,7 +98,7 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
}
|
|
|
resultJson.put("message", "查询成功");
|
|
resultJson.put("message", "查询成功");
|
|
|
resultJson.put("code", 500);
|
|
resultJson.put("code", 500);
|
|
|
- resultJson.put("data", idcRankEto);
|
|
|
|
|
|
|
+ resultJson.put("data", list);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -106,8 +109,8 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
|
|
|
*/
|
|
*/
|
|
|
public String getRankSalesAmountData(){
|
|
public String getRankSalesAmountData(){
|
|
|
JSONObject resultJson = new JSONObject();
|
|
JSONObject resultJson = new JSONObject();
|
|
|
- IDCRankEto idcRankEto = idcService.getRankSalesAmountData();
|
|
|
|
|
- if (idcRankEto == null) {
|
|
|
|
|
|
|
+ List<IDCRankEto> list = idcService.getRankSalesAmountData();
|
|
|
|
|
+ if (list == null && list.size()==0) {
|
|
|
resultJson.put("message", "数据为空");
|
|
resultJson.put("message", "数据为空");
|
|
|
resultJson.put("code", 500);
|
|
resultJson.put("code", 500);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
@@ -115,7 +118,7 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
}
|
|
|
resultJson.put("message", "查询成功");
|
|
resultJson.put("message", "查询成功");
|
|
|
resultJson.put("code", 500);
|
|
resultJson.put("code", 500);
|
|
|
- resultJson.put("data", idcRankEto);
|
|
|
|
|
|
|
+ resultJson.put("data", list);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|