|
|
@@ -84,13 +84,6 @@ public class hotelAction extends ActionSupport implements ServletRequestAware {
|
|
|
BeanUtils.copyProperties(hotelEto,hotel);
|
|
|
int hotelId = hotel.getId()!= null ? hotel.getId():Math.toIntExact(UUIDUtil.generateID());
|
|
|
int m = 0;
|
|
|
- //保存基本信息
|
|
|
- if(hotel.getId()!= null){
|
|
|
- m = hotelService.updateHotel(hotel);
|
|
|
- }else{
|
|
|
- hotel.setId(hotelId);
|
|
|
- m = hotelService.insertHotel(hotel);
|
|
|
- }
|
|
|
//保存详细图附件
|
|
|
if(hotelEto.getFileList()!=null && hotelEto.getFileList().size()>0){
|
|
|
if(hotel.getId()!= null){
|
|
|
@@ -105,6 +98,13 @@ public class hotelAction extends ActionSupport implements ServletRequestAware {
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
+ //保存基本信息
|
|
|
+ if(hotel.getId()!= null){
|
|
|
+ m = hotelService.updateHotel(hotel);
|
|
|
+ }else{
|
|
|
+ hotel.setId(hotelId);
|
|
|
+ m = hotelService.insertHotel(hotel);
|
|
|
+ }
|
|
|
if (m > 0) {
|
|
|
resultJson.put("message", "维护成功");
|
|
|
resultJson.put("code", 200);
|
|
|
@@ -144,15 +144,19 @@ public class hotelAction extends ActionSupport implements ServletRequestAware {
|
|
|
//查询民宿信息
|
|
|
Hotel hotel = hotelService.getOen(s1.toString());
|
|
|
HotelEto hotelEto = new HotelEto();
|
|
|
- BeanUtils.copyProperties(adminManager,hotelEto);
|
|
|
- BeanUtils.copyProperties(hotel,hotelEto);
|
|
|
+ if(adminManager!=null){
|
|
|
+ BeanUtils.copyProperties(adminManager,hotelEto);
|
|
|
+ }
|
|
|
+ if(hotel!=null){
|
|
|
+ BeanUtils.copyProperties(hotel,hotelEto);
|
|
|
+ }
|
|
|
StringBuilder fileSqlx = new StringBuilder("");
|
|
|
fileSqlx.append("and link_id = '").append(id).append("'");
|
|
|
List<File> fileList = fileService.queryList(fileSqlx.toString());
|
|
|
hotelEto.setFileList(fileList);
|
|
|
resultJson.put("message", "查询成功");
|
|
|
resultJson.put("code", 200);
|
|
|
- resultJson.put("date", hotelEto);
|
|
|
+ resultJson.put("data", hotelEto);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
@@ -253,7 +257,7 @@ public class hotelAction extends ActionSupport implements ServletRequestAware {
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
- if(hotelDict.getName()==null || hotelDict.getCode()==null){
|
|
|
+ if(hotelDict.getName()==null){
|
|
|
resultJson.put("message", "各参数不能为空");
|
|
|
resultJson.put("code", 500);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -276,7 +280,7 @@ public class hotelAction extends ActionSupport implements ServletRequestAware {
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
- int m = hotelDictService.insertHotelDict(hotelDict);
|
|
|
+ int m = hotelDictService.updateHotelDict(hotelDict);
|
|
|
if (m > 0) {
|
|
|
resultJson.put("message", "修改成功");
|
|
|
resultJson.put("code", 200);
|
|
|
@@ -336,13 +340,13 @@ public class hotelAction extends ActionSupport implements ServletRequestAware {
|
|
|
StringBuilder s3 = new StringBuilder("");
|
|
|
StringBuilder s4 = new StringBuilder("");
|
|
|
if(code==null){//查询全部
|
|
|
- s1.append("and code = '1'");
|
|
|
+ s1.append("and code = 1");
|
|
|
List<HotelDict> list1 = hotelDictService.queryList(s1.toString());
|
|
|
- s2.append("and code = '2'");
|
|
|
+ s2.append("and code = 2");
|
|
|
List<HotelDict> list2 = hotelDictService.queryList(s2.toString());
|
|
|
- s1.append("and code = '3'");
|
|
|
+ s3.append("and code = 3");
|
|
|
List<HotelDict> list3 = hotelDictService.queryList(s3.toString());
|
|
|
- s1.append("and code = '4'");
|
|
|
+ s4.append("and code = 4");
|
|
|
List<HotelDict> list4 = hotelDictService.queryList(s4.toString());
|
|
|
resultJson.put("message", "查询成功");
|
|
|
resultJson.put("code", 200);
|
|
|
@@ -353,11 +357,12 @@ public class hotelAction extends ActionSupport implements ServletRequestAware {
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}else{
|
|
|
- s1.append("and code = '").append(code).append("'");
|
|
|
+ s1.append("and code = ").append(code);
|
|
|
List<HotelDict> list1 = hotelDictService.queryList(s1.toString());
|
|
|
resultJson.put("message", "查询成功");
|
|
|
resultJson.put("code", 200);
|
|
|
- resultJson.put("date1", list1);
|
|
|
+ resultJson.put("data"+code, list1);
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
}
|