|
@@ -20,6 +20,8 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
|
|
|
private HttpServletRequest request;
|
|
private HttpServletRequest request;
|
|
|
public HttpServletResponse response;
|
|
public HttpServletResponse response;
|
|
|
|
|
|
|
|
|
|
+ public Integer type;//1.今日 2.本月 3.本年
|
|
|
|
|
+
|
|
|
@Resource
|
|
@Resource
|
|
|
private IDCService idcService;
|
|
private IDCService idcService;
|
|
|
|
|
|
|
@@ -50,7 +52,7 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
|
|
|
public String getBookStatusData(){
|
|
public String getBookStatusData(){
|
|
|
JSONObject resultJson = new JSONObject();
|
|
JSONObject resultJson = new JSONObject();
|
|
|
List<IDCBookStatusEto> list = idcService.getBookStatusData();
|
|
List<IDCBookStatusEto> list = idcService.getBookStatusData();
|
|
|
- if (list == null && list.size()==0) {
|
|
|
|
|
|
|
+ if (list == null) {
|
|
|
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());
|
|
@@ -70,14 +72,14 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
|
|
|
public String getHotelData() {
|
|
public String getHotelData() {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
JSONObject resultJson = new JSONObject();
|
|
|
List<IDCHotelEto> list = idcService.getHotelData();
|
|
List<IDCHotelEto> list = idcService.getHotelData();
|
|
|
- if (list == null && list.size()==0) {
|
|
|
|
|
|
|
+ if (list == null) {
|
|
|
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("code", 200);
|
|
|
resultJson.put("data", list);
|
|
resultJson.put("data", list);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
return null;
|
|
@@ -89,15 +91,25 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
|
|
|
*/
|
|
*/
|
|
|
public String getRankBookNumData() {
|
|
public String getRankBookNumData() {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
JSONObject resultJson = new JSONObject();
|
|
|
- List<IDCRankEto> list = idcService.getRankBookNumData();
|
|
|
|
|
- if (list == null && list.size()==0) {
|
|
|
|
|
|
|
+ StringBuilder sqlx = new StringBuilder("");
|
|
|
|
|
+ if(type==1){
|
|
|
|
|
+ sqlx.append("AND DATE_FORMAT(pay_time,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(type==2){
|
|
|
|
|
+ sqlx.append("AND DATE_FORMAT(pay_time,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(type==3){
|
|
|
|
|
+ sqlx.append("AND DATE_FORMAT(pay_time,'%Y') = DATE_FORMAT(NOW(),'%Y')");
|
|
|
|
|
+ }
|
|
|
|
|
+ List<IDCRankEto> list = idcService.getRankBookNumData(sqlx.toString());
|
|
|
|
|
+ if (list == null) {
|
|
|
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("code", 200);
|
|
|
resultJson.put("data", list);
|
|
resultJson.put("data", list);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
return null;
|
|
@@ -109,15 +121,25 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
|
|
|
*/
|
|
*/
|
|
|
public String getRankSalesAmountData(){
|
|
public String getRankSalesAmountData(){
|
|
|
JSONObject resultJson = new JSONObject();
|
|
JSONObject resultJson = new JSONObject();
|
|
|
- List<IDCRankEto> list = idcService.getRankSalesAmountData();
|
|
|
|
|
- if (list == null && list.size()==0) {
|
|
|
|
|
|
|
+ StringBuilder sqlx = new StringBuilder("");
|
|
|
|
|
+ if(type==1){
|
|
|
|
|
+ sqlx.append("AND DATE_FORMAT(pay_time,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(type==2){
|
|
|
|
|
+ sqlx.append("AND DATE_FORMAT(pay_time,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(type==3){
|
|
|
|
|
+ sqlx.append("AND DATE_FORMAT(pay_time,'%Y') = DATE_FORMAT(NOW(),'%Y')");
|
|
|
|
|
+ }
|
|
|
|
|
+ List<IDCRankEto> list = idcService.getRankSalesAmountData(sqlx.toString());
|
|
|
|
|
+ if (list == null) {
|
|
|
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("code", 200);
|
|
|
resultJson.put("data", list);
|
|
resultJson.put("data", list);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
return null;
|