|
@@ -1,18 +1,14 @@
|
|
package com.onemap.apply.service.impl.yzt;
|
|
package com.onemap.apply.service.impl.yzt;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.onemap.apply.domain.yzt.*;
|
|
import com.onemap.apply.domain.yzt.*;
|
|
|
|
+import com.onemap.apply.mapper.yzt.CollectionMapper;
|
|
import com.onemap.apply.mapper.yzt.SearchMapper;
|
|
import com.onemap.apply.mapper.yzt.SearchMapper;
|
|
-import com.onemap.apply.mapper.yzt.ZymlMapper;
|
|
|
|
import com.onemap.apply.service.yzt.ISearchService;
|
|
import com.onemap.apply.service.yzt.ISearchService;
|
|
-import com.onemap.apply.service.yzt.IZymlService;
|
|
|
|
-import com.onemap.common.core.utils.StringUtils;
|
|
|
|
import com.onemap.common.core.web.domain.RequestResult;
|
|
import com.onemap.common.core.web.domain.RequestResult;
|
|
import com.onemap.common.datasource.annotation.Slave;
|
|
import com.onemap.common.datasource.annotation.Slave;
|
|
-import com.onemap.common.security.utils.SecurityUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
@@ -21,6 +17,8 @@ public class SearchServiceImpl implements ISearchService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private SearchMapper searchMapper;
|
|
private SearchMapper searchMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private CollectionMapper collectionMapper;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -38,4 +36,43 @@ public class SearchServiceImpl implements ISearchService {
|
|
}
|
|
}
|
|
return RequestResult.error("查询成功!");
|
|
return RequestResult.error("查询成功!");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public RequestResult bookmark(PoiSearchDTO poiSearchDTO) {
|
|
|
|
+ try {
|
|
|
|
+ Map data = new HashMap();
|
|
|
|
+ List<CollectionDTO> res = searchMapper.bookmark(poiSearchDTO.getName(), poiSearchDTO.getType(), poiSearchDTO.getLimit(), poiSearchDTO.getOffset());
|
|
|
|
+ data.put("data", res);
|
|
|
|
+ Integer count = searchMapper.bookmarkcount(poiSearchDTO.getName(), poiSearchDTO.getType());
|
|
|
|
+ data.put("count", count);
|
|
|
|
+ return RequestResult.success("查询成功!", data);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ return RequestResult.error("查询成功!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public RequestResult bookmarkAdd(CollectionDTO collectionDTO) {
|
|
|
|
+ try {
|
|
|
|
+ collectionMapper.insert(collectionDTO);
|
|
|
|
+ return RequestResult.success("保存成功!", 1);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ return RequestResult.error("保存失败!", 0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public RequestResult bookmarkDel(String id) {
|
|
|
|
+ try {
|
|
|
|
+ QueryWrapper<CollectionDTO> wrapper = new QueryWrapper();
|
|
|
|
+ wrapper.eq("id", id);
|
|
|
|
+ collectionMapper.delete(wrapper);
|
|
|
|
+ return RequestResult.success("删除成功!", 1);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ return RequestResult.error("删除失败!", 0);
|
|
|
|
+ }
|
|
}
|
|
}
|