|
@@ -6,6 +6,7 @@ import com.onemap.apply.mapper.yzt.XzqMapper;
|
|
|
import com.onemap.apply.service.yzt.IXzqService;
|
|
|
import com.onemap.common.core.utils.StringUtils;
|
|
|
import com.onemap.common.core.web.domain.RequestResult;
|
|
|
+import com.onemap.common.datasource.annotation.Slave;
|
|
|
import com.onemap.system.api.domain.SysDept;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -21,6 +22,7 @@ public class XzqServiceImpl implements IXzqService {
|
|
|
private XzqMapper xzqMapper;
|
|
|
|
|
|
@Override
|
|
|
+ @Slave
|
|
|
public RequestResult GetXzq(Boolean city) {
|
|
|
try{
|
|
|
List<XzqSqlDTO> res = xzqMapper.GetXzq(city,"");
|
|
@@ -44,6 +46,7 @@ public class XzqServiceImpl implements IXzqService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Slave
|
|
|
public RequestResult GetXzqList(Boolean city) {
|
|
|
try{
|
|
|
List<XzqSqlDTO> res = xzqMapper.GetXzqList(city);
|
|
@@ -65,6 +68,18 @@ public class XzqServiceImpl implements IXzqService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Slave
|
|
|
+ public RequestResult GetGeom(String id) {
|
|
|
+ try{
|
|
|
+ String wkt = xzqMapper.GetGeom(id);
|
|
|
+ return RequestResult.success("成功", wkt);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return RequestResult.error("失败", null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 构建前端所需要树结构
|
|
|
*
|
|
@@ -96,7 +111,11 @@ public class XzqServiceImpl implements IXzqService {
|
|
|
private void recursionFn(List<XzqDTO> list, XzqDTO t) {
|
|
|
// 得到子节点列表
|
|
|
List<XzqDTO> childList = getChildList(list, t);
|
|
|
- t.setChildren(childList);
|
|
|
+ if(childList.size() > 0){
|
|
|
+ t.setChildren(childList);
|
|
|
+ }else{
|
|
|
+ t.setChildren(null);
|
|
|
+ }
|
|
|
for (XzqDTO tChild : childList) {
|
|
|
if (hasChild(list, tChild)) {
|
|
|
recursionFn(list, tChild);
|