魏熙美 6 vuotta sitten
vanhempi
commit
fd17267f0b

+ 6
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/HotelServiceImpl.java Näytä tiedosto

@@ -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{

+ 4
- 0
VUECODE/smart-property-manage/src/views/grogshop/configindex.vue Näytä tiedosto

@@ -212,6 +212,10 @@ export default {
212 212
       this.$refs[formName].resetFields()
213 213
     },
214 214
     updateRental() {
215
+      if (this.listData.hotelLongitude === '' || this.listData.hotelLatitude === '') {
216
+        this.$message.error('地理坐标不能为空!')
217
+        return
218
+      }
215 219
       // 加载框
216 220
       const loading = this.$loading({
217 221
         lock: true,