|
@@ -20,6 +20,7 @@ import com.community.huiju.model.TpTicket;
|
20
|
20
|
import com.community.huiju.model.User;
|
21
|
21
|
import com.community.huiju.service.IHotelService;
|
22
|
22
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
23
|
+import org.apache.commons.lang3.StringUtils;
|
23
|
24
|
import org.springframework.beans.factory.annotation.Autowired;
|
24
|
25
|
import org.springframework.stereotype.Service;
|
25
|
26
|
|
|
@@ -212,6 +213,11 @@ public class HotelServiceImpl extends ServiceImpl<HotelMapper, Hotel> implements
|
212
|
213
|
*/
|
213
|
214
|
@Override
|
214
|
215
|
public ResponseBean addHotel(Hotel hotel, UserElement userElement) {
|
|
216
|
+ ResponseBean responseBean = new ResponseBean();
|
|
217
|
+ if (StringUtils.isBlank(hotel.getHotelLongitude()) || StringUtils.isBlank(hotel.getHotelLatitude())) {
|
|
218
|
+ responseBean.addError("地理坐标不能为空!");
|
|
219
|
+ return responseBean;
|
|
220
|
+ }
|
215
|
221
|
if (hotel.getHotelSettingValue()){
|
216
|
222
|
// 为true时判断tp_hotel_setting是否存在当前小区
|
217
|
223
|
QueryWrapper<HotelSetting> hotelSettingQuery = new QueryWrapper<>();
|
|
@@ -229,7 +235,6 @@ public class HotelServiceImpl extends ServiceImpl<HotelMapper, Hotel> implements
|
229
|
235
|
queryWrapper.eq("community_id",userElement.getCommunityId());
|
230
|
236
|
hotelSettingMapper.delete(queryWrapper);
|
231
|
237
|
}
|
232
|
|
- ResponseBean responseBean = new ResponseBean();
|
233
|
238
|
if (null != hotel.getId()){
|
234
|
239
|
updateHotel(hotel,userElement);
|
235
|
240
|
}else{
|