|
|
@@ -244,7 +244,14 @@ public class advertiseAction extends ActionSupport implements ServletRequestAwar
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
+ if (open.size()==1 && ids.contains(advertise.getId()) && advertise.getState()==0){
|
|
|
+ resultjson.put("message", "必须保留一个广告");
|
|
|
+ resultjson.put("code", 500);
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
if (advertise.getJumpWay().equals("小程序") && advertise.getJumpDirection().equals("民宿") && !advertise.getJumpPoint().equals("首页")){
|
|
|
AdminManager adminManager = adminManagerService.getById(Integer.parseInt(advertise.getJumpPoint()));
|
|
|
HotelDict hotelDict = hotelDictService.getById(Integer.parseInt(adminManager.getHotelTownship()));
|
|
|
@@ -389,6 +396,12 @@ public class advertiseAction extends ActionSupport implements ServletRequestAwar
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
+ if (open.size()==1 && ids.contains(advertise.getId()) && state==0){
|
|
|
+ resultJson.put("message", "必须保留一个广告");
|
|
|
+ resultJson.put("code", 500);
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
int m = advertiseService.updateState(id,state,TimeExchange.getTime());
|
|
|
if (m>0){
|