|
|
@@ -1,5 +1,6 @@
|
|
|
package com.zhiqiyun.open.router.apis;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
@@ -13,6 +14,8 @@ import com.zhiqiyun.open.core.service.PlaceCategoryService;
|
|
|
import com.zhiqiyun.open.router.request.place.CategoryPageRequest;
|
|
|
import com.zhiqiyun.open.router.request.place.CategoryRequest;
|
|
|
import com.zhiqiyun.open.router.request.place.PlaceInfoRequest;
|
|
|
+import com.zhiqiyun.open.router.request.place.PlaceInfoSaveRequest;
|
|
|
+import com.zhiqiyun.open.utils.DateUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -91,4 +94,28 @@ public class PlaceApi {
|
|
|
}
|
|
|
return OapResponse.success().setBody(resultData);
|
|
|
}
|
|
|
+
|
|
|
+ @ServiceMethod(method = "list.place.info.save", title = "文旅场所保存")
|
|
|
+ public OapResponse listPlaceInfoSave(PlaceInfoSaveRequest request) {
|
|
|
+ PlaceBaseInfo placeBaseInfo = new PlaceBaseInfo();
|
|
|
+ placeBaseInfo.setCategoryId(request.getCategoryId());
|
|
|
+ placeBaseInfo.setAddress(request.getAddress());
|
|
|
+ placeBaseInfo.setName(request.getName());
|
|
|
+ placeBaseInfo.setLitpics(JSONArray.parseArray(request.getLitpics(), String.class));
|
|
|
+ placeBaseInfo.setContacts(request.getContacts());
|
|
|
+ placeBaseInfo.setContactNumber(request.getContactNumber());
|
|
|
+ placeBaseInfo.setBrief(request.getBrief());
|
|
|
+ placeBaseInfo.setLat(request.getLat());
|
|
|
+ placeBaseInfo.setLng(request.getLng());
|
|
|
+ placeBaseInfo.setId(request.getId());
|
|
|
+ if (placeBaseInfo.getId() != null) {
|
|
|
+ placeBaseInfo.setUpdatedTime(DateUtil.current());
|
|
|
+ placeBaseInfoService.updateById(placeBaseInfo);
|
|
|
+ } else {
|
|
|
+ placeBaseInfo.setUpdatedTime(DateUtil.current());
|
|
|
+ placeBaseInfo.setCreatedTime(DateUtil.current());
|
|
|
+ placeBaseInfoService.save(placeBaseInfo);
|
|
|
+ }
|
|
|
+ return OapResponse.success().setBody(placeBaseInfo);
|
|
|
+ }
|
|
|
}
|