Explorar o código

地籍数据库系统增加文档结构表及程序

chenendian hai 5 meses
pai
achega
0f2a25fbbe
Modificáronse 22 ficheiros con 3687 adicións e 1 borrados
  1. 18 1
      siwei-api/siwei-api-system/src/main/java/com/siwei/system/api/domain/SysDept.java
  2. 34 0
      siwei-common/siwei-common-core/src/main/java/com/siwei/common/core/utils/StringUtils.java
  3. 15 0
      siwei-common/siwei-common-security/src/main/java/com/siwei/common/security/utils/SecurityUtils.java
  4. 177 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/ZymlController.java
  5. 67 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/DbfxLssjDTO.java
  6. 141 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/DbfxResourceDTO.java
  7. 76 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/ResourceAttrsDTO.java
  8. 22 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/ZymlBsmDTO.java
  9. 404 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/ZymlDTO.java
  10. 69 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/ZymlLegendDTO.java
  11. 75 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/ZymlTreeDTO.java
  12. 286 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/ZymlTreeDataDTO.java
  13. 51 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/cadastre/ZymlMapper.java
  14. 45 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/IZymlService.java
  15. 611 0
      siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/ZymlServiceImpl.java
  16. 440 0
      siwei-modules/siwei-apply/src/main/resources/mapper/cadastre/ZymlMapper.xml
  17. 117 0
      siwei-modules/siwei-system/src/main/java/com/siwei/system/controller/TYztZymlController.java
  18. 521 0
      siwei-modules/siwei-system/src/main/java/com/siwei/system/domain/TYztZyml.java
  19. 70 0
      siwei-modules/siwei-system/src/main/java/com/siwei/system/mapper/TYztZymlMapper.java
  20. 68 0
      siwei-modules/siwei-system/src/main/java/com/siwei/system/service/ITYztZymlService.java
  21. 137 0
      siwei-modules/siwei-system/src/main/java/com/siwei/system/service/impl/TYztZymlServiceImpl.java
  22. 243 0
      siwei-modules/siwei-system/src/main/resources/mapper/postgresql/system/TYztZymlMapper.xml

+ 18 - 1
siwei-api/siwei-api-system/src/main/java/com/siwei/system/api/domain/SysDept.java

@@ -51,7 +51,14 @@ public class SysDept extends BaseEntity
 
     /** 父部门名称 */
     private String parentName;
-    
+
+    /** 数据资源集 */
+    private String resources;
+
+
+    /** 行政区划 */
+    private String district;
+
     /** 子部门 */
     private List<SysDept> children = new ArrayList<SysDept>();
 
@@ -181,6 +188,16 @@ public class SysDept extends BaseEntity
         this.children = children;
     }
 
+
+
+    public String getResources() {
+        return resources;
+    }
+
+    public String getDistrict() {
+        return district;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 34 - 0
siwei-common/siwei-common-core/src/main/java/com/siwei/common/core/utils/StringUtils.java

@@ -1,8 +1,12 @@
 package com.siwei.common.core.utils;
 
+import java.text.SimpleDateFormat;
 import java.util.Collection;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
+
+import com.siwei.common.core.utils.uuid.UUID;
 import org.springframework.util.AntPathMatcher;
 import com.siwei.common.core.constant.Constants;
 import com.siwei.common.core.text.StrFormatter;
@@ -604,4 +608,34 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
         }
         return sb.toString();
     }
+
+    /**
+     * 判断行政区划是否参与业务数据查询
+     *
+     * @param xzqdm
+     * @return
+     */
+    public static Boolean isXzqhQuery(String xzqdm) {
+        return StringUtils.isNotEmpty(xzqdm) && xzqdm.length() > 4;
+    }
+
+    /**
+     * 随机数
+     *
+     * @return
+     */
+    public static String getUUID() {
+        return String.valueOf(UUID.randomUUID()).replaceAll("-", "");
+    }
+
+    /**
+     * 时间随机数
+     *
+     * @return
+     */
+    public static String getDateUUID() {
+        return getUUID() + "_" + new SimpleDateFormat("yyyyMMddHHmmssms").format(new Date());
+    }
+
+
 }

+ 15 - 0
siwei-common/siwei-common-security/src/main/java/com/siwei/common/security/utils/SecurityUtils.java

@@ -114,4 +114,19 @@ public class SecurityUtils
         BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
         return passwordEncoder.matches(rawPassword, encodedPassword);
     }
+
+
+
+    /**
+     * 获取登录用户行政区信息
+     *
+     * @return
+     */
+    public static String getLoginUserXzq() {
+        return getLoginUser().getSysUser().getDept().getDistrict();
+    }
+
+
+
+
 }

+ 177 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/ZymlController.java

@@ -0,0 +1,177 @@
+package com.siwei.apply.controller.cadastre;
+
+
+import com.siwei.apply.service.cadastre.IZymlService;
+import com.siwei.common.core.domain.R;
+import com.siwei.common.core.web.controller.BaseController;
+import com.siwei.common.security.utils.SecurityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/yzt/zyml")
+public class ZymlController extends BaseController {
+
+    @Autowired
+    private IZymlService zymlService;
+
+
+    /**
+     * 获取当前用户行政区划代码
+     *
+     * @return
+     */
+    @GetMapping("/GetXzqCode")
+    public R GetXzqCode() {
+        if (SecurityUtils.getLoginUser() == null || SecurityUtils.getLoginUser().getSysUser() == null) {
+            return R.fail(502,"请先登录");
+        }
+        String deptName = SecurityUtils.getLoginUser().getSysUser().getDept().getDeptName();
+        return zymlService.getXzqCode(deptName);
+    }
+
+    /**
+     * 获取资源目录列表
+     *
+     * @param param 预留
+     * @return
+     */
+    @GetMapping("/GetList")
+    public R GetList(String param) {
+        R list = zymlService.GetList(param);
+        return list;
+    }
+
+    /**
+     * 获取资源目录列表
+     *
+     * @param param 预留
+     * @return
+     */
+    @GetMapping("/GetTree")
+    public R GetTree(String param) {
+        R list = zymlService.GetTree(param);
+        return list;
+    }
+
+    /**
+     * 共享图层查询
+     *
+     * @return
+     */
+    @GetMapping("/GetTree/share")
+    public R GetTreeShare(String name) {
+        return zymlService.GetZymlShareList(name);
+    }
+
+    /**
+     * 获取资源目录树结构
+     *
+     * @param param 预留
+     * @return
+     */
+    @PostMapping("/getDataSourceTree")
+    public R getDataSourceTree(String param) {
+        R list = zymlService.getDataSourceTree(param);
+        return list;
+    }
+
+    /**
+     * 根据标识码获取资源详情
+     *
+     * @param bsm 数组字符串,逗号隔开
+     * @return
+     */
+    @RequestMapping("/GetByBsms")
+    public R GetByBsms(String bsm) {
+        R list = zymlService.GetByBsms(bsm);
+        return list;
+    }
+
+    /**
+     * 根据标识码获取资源详情
+     *
+     * @param bsm
+     * @return
+     */
+    @RequestMapping("/GetByBsm")
+    public R GetByBsm(String bsm) {
+        R list = zymlService.GetByBsm(bsm);
+        return list;
+    }
+
+    /**
+     * 获取我收藏的资源列表
+     *
+     * @param param 预留
+     * @return
+     */
+    @GetMapping("/GetMyCollect")
+    public R GetMyCollect(String param) {
+        R list = zymlService.GetMyCollect(param);
+        return list;
+    }
+
+    /**
+     * 根据资源标识码获取字段详情
+     *
+     * @param bsm 资源标识码
+     * @return
+     */
+    @GetMapping("/GetAttrs")
+    public R GetAttrs(String bsm) {
+        R list = zymlService.GetAttrs(bsm);
+        return list;
+    }
+
+    /**
+     * 收藏、取消收藏接口 内部做判断
+     *
+     * @param params {bsm:"001"}impStart
+     * @return
+     */
+    @PostMapping("/Collect")
+    public R Collect(@RequestBody Map params) {
+        R list = zymlService.Collect(params);
+        return list;
+    }
+
+    /**
+     * 获取对比分析数据资源列表
+     *
+     * @param param 预留
+     * @return
+     */
+    @GetMapping("/GetDbfxList")
+    public R GetDbfxList(String param) {
+        R list = zymlService.GetDbfxList(param);
+        return list;
+    }
+
+    /**
+     * 根据资源标识码获取图例配置信息
+     *
+     * @param zybsm 资源标识码
+     * @return
+     */
+    @GetMapping("/GetLegend")
+    public R GetLegend(String zybsm) {
+        R list = zymlService.GetLegend(zybsm);
+        return list;
+    }
+
+    /**
+     * 根据业务类型获取图例配置信息
+     *
+     * @param ywlx 业务类型
+     * @return
+     */
+    @RequestMapping("/GetLegendAttr")
+    public R GetLegendAttr(String ywlx) {
+        R list = zymlService.GetLegendAttr(ywlx);
+        return list;
+    }
+
+
+}

+ 67 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/DbfxLssjDTO.java

@@ -0,0 +1,67 @@
+package com.siwei.apply.domain.cadastre;
+
+public class DbfxLssjDTO {
+    private String epsg;
+    private String fzbsm;
+    private String type;
+    private String server_type;
+    private String url;
+    private String year;
+    private String zybsm;
+
+    public String getEpsg() {
+        return epsg;
+    }
+
+    public void setEpsg(String epsg) {
+        this.epsg = epsg;
+    }
+
+    public String getFzbsm() {
+        return fzbsm;
+    }
+
+    public void setFzbsm(String fzbsm) {
+        this.fzbsm = fzbsm;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getServer_type() {
+        return server_type;
+    }
+
+    public void setServer_type(String server_type) {
+        this.server_type = server_type;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getYear() {
+        return year;
+    }
+
+    public void setYear(String year) {
+        this.year = year;
+    }
+
+    public String getZybsm() {
+        return zybsm;
+    }
+
+    public void setZybsm(String zybsm) {
+        this.zybsm = zybsm;
+    }
+}

+ 141 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/DbfxResourceDTO.java

@@ -0,0 +1,141 @@
+package com.siwei.apply.domain.cadastre;
+
+import java.util.List;
+
+public class DbfxResourceDTO {
+    private String zybsm;
+    private String fzbsm;
+    private String bsm;
+    private String lxfz;
+    private String name;
+    private String type;
+    private String url;
+    private Integer sort;
+    private String server_type;
+    private String epsg;
+    private String year;
+    private String legend;
+    private String tjname;
+    private String xzq;
+    private List<DbfxLssjDTO> lssj;
+
+    public String getZybsm() {
+        return zybsm;
+    }
+
+    public void setZybsm(String zybsm) {
+        this.zybsm = zybsm;
+    }
+
+    public String getFzbsm() {
+        return fzbsm;
+    }
+
+    public void setFzbsm(String fzbsm) {
+        this.fzbsm = fzbsm;
+    }
+
+    public String getBsm() {
+        return bsm;
+    }
+
+    public void setBsm(String bsm) {
+        this.bsm = bsm;
+    }
+
+    public String getLxfz() {
+        return lxfz;
+    }
+
+    public void setLxfz(String lxfz) {
+        this.lxfz = lxfz;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public Integer getSort() {
+        return sort;
+    }
+
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
+
+    public String getServer_type() {
+        return server_type;
+    }
+
+    public void setServer_type(String server_type) {
+        this.server_type = server_type;
+    }
+
+    public String getEpsg() {
+        return epsg;
+    }
+
+    public void setEpsg(String epsg) {
+        this.epsg = epsg;
+    }
+
+    public String getYear() {
+        return year;
+    }
+
+    public void setYear(String year) {
+        this.year = year;
+    }
+
+    public String getLegend() {
+        return legend;
+    }
+
+    public void setLegend(String legend) {
+        this.legend = legend;
+    }
+
+    public String getTjname() {
+        return tjname;
+    }
+
+    public void setTjname(String tjname) {
+        this.tjname = tjname;
+    }
+
+    public String getXzq() {
+        return xzq;
+    }
+
+    public void setXzq(String xzq) {
+        this.xzq = xzq;
+    }
+
+    public List<DbfxLssjDTO> getLssj() {
+        return lssj;
+    }
+
+    public void setLssj(List<DbfxLssjDTO> lssj) {
+        this.lssj = lssj;
+    }
+}

+ 76 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/ResourceAttrsDTO.java

@@ -0,0 +1,76 @@
+package com.siwei.apply.domain.cadastre;
+
+public class ResourceAttrsDTO {
+    private String sxmc;
+    private String sxbm;
+    private String sxlx;
+    private Integer xssx;
+    private Integer sfcx;
+    private Integer sftj;
+    private String dw;
+    private String zdcx;
+
+    public String getSxmc() {
+        return sxmc;
+    }
+
+    public void setSxmc(String sxmc) {
+        this.sxmc = sxmc;
+    }
+
+    public String getSxbm() {
+        return sxbm;
+    }
+
+    public void setSxbm(String sxbm) {
+        this.sxbm = sxbm;
+    }
+
+    public String getSxlx() {
+        return sxlx;
+    }
+
+    public void setSxlx(String sxlx) {
+        this.sxlx = sxlx;
+    }
+
+    public Integer getXssx() {
+        return xssx;
+    }
+
+    public void setXssx(Integer xssx) {
+        this.xssx = xssx;
+    }
+
+    public Integer getSfcx() {
+        return sfcx;
+    }
+
+    public void setSfcx(Integer sfcx) {
+        this.sfcx = sfcx;
+    }
+
+    public Integer getSftj() {
+        return sftj;
+    }
+
+    public void setSftj(Integer sftj) {
+        this.sftj = sftj;
+    }
+
+    public String getDw() {
+        return dw;
+    }
+
+    public void setDw(String dw) {
+        this.dw = dw;
+    }
+
+    public String getZdcx() {
+        return zdcx;
+    }
+
+    public void setZdcx(String zdcx) {
+        this.zdcx = zdcx;
+    }
+}

+ 22 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/ZymlBsmDTO.java

@@ -0,0 +1,22 @@
+package com.siwei.apply.domain.cadastre;
+
+public class ZymlBsmDTO {
+    private String bsm;
+    private String username;
+
+    public String getBsm() {
+        return bsm;
+    }
+
+    public void setBsm(String bsm) {
+        this.bsm = bsm;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+}

+ 404 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/ZymlDTO.java

@@ -0,0 +1,404 @@
+package com.siwei.apply.domain.cadastre;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.util.Date;
+
+public class ZymlDTO {
+    private String my;
+    private Integer count;
+    private String fzbsm;
+    private String bsm;
+    private String name;
+    private String type;
+    private String pbsm;
+    private String icon;
+    private String url;
+    private Integer lev;
+    private Integer sort;
+    private Integer state;
+    private Integer parent;
+    private String serverType;
+    private Integer sflssj;
+    private Integer sfdbfx;
+    private Integer sfjl;
+    private Integer sfcx;
+    private Integer sftj;
+    private String epsg;
+    private String year;
+    private String sjlx;
+    private String sde;
+    private String gltj;
+    private String sjly;
+    private String legend;
+    private String ywlx;
+    private String datetime;
+    private String createperson;
+    private String fwmc;
+    private String fwgzkj;
+    private String fwys;
+    private String qpfa;
+    private String layergroup;
+    private String format;
+    private String maximumlevel;
+    private String minimumlevel;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date create_time;
+    private String create_by;
+    private String sharestate;
+    private String dataexplain;
+    private String geomfield;
+    private String layertype ;
+
+    public String getLayertype() {
+        return this.layertype;
+    }
+
+    public void setLayertype(final String layertype) {
+        this.layertype = layertype;
+    }
+
+    public String getGeomfield() {
+        return geomfield;
+    }
+
+    public void setGeomfield(String geomfield) {
+        this.geomfield = geomfield;
+    }
+
+    public String getYwlx() {
+        return ywlx;
+    }
+
+    public void setYwlx(String ywlx) {
+        this.ywlx = ywlx;
+    }
+
+    public String getServerType() {
+        return serverType;
+    }
+
+    public void setServerType(String serverType) {
+        this.serverType = serverType;
+    }
+
+    public String getDatetime() {
+        return datetime;
+    }
+
+    public void setDatetime(String datetime) {
+        this.datetime = datetime;
+    }
+
+    public String getCreateperson() {
+        return createperson;
+    }
+
+    public void setCreateperson(String createperson) {
+        this.createperson = createperson;
+    }
+
+    public String getMy() {
+        return my;
+    }
+
+    public void setMy(String my) {
+        this.my = my;
+    }
+
+    public Integer getCount() {
+        return count;
+    }
+
+    public void setCount(Integer count) {
+        this.count = count;
+    }
+
+    public String getFzbsm() {
+        return fzbsm;
+    }
+
+    public void setFzbsm(String fzbsm) {
+        this.fzbsm = fzbsm;
+    }
+
+    public String getBsm() {
+        return bsm;
+    }
+
+    public void setBsm(String bsm) {
+        this.bsm = bsm;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getPbsm() {
+        return pbsm;
+    }
+
+    public void setPbsm(String pbsm) {
+        this.pbsm = pbsm;
+    }
+
+    public String getIcon() {
+        return icon;
+    }
+
+    public void setIcon(String icon) {
+        this.icon = icon;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public Integer getLev() {
+        return lev;
+    }
+
+    public void setLev(Integer lev) {
+        this.lev = lev;
+    }
+
+    public Integer getSort() {
+        return sort;
+    }
+
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
+
+    public Integer getState() {
+        return state;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
+    public Integer getParent() {
+        return parent;
+    }
+
+    public void setParent(Integer parent) {
+        this.parent = parent;
+    }
+
+    public String getServer_type() {
+        return serverType;
+    }
+
+    public void setServer_type(String server_type) {
+        this.serverType = server_type;
+    }
+
+    public Integer getSflssj() {
+        return sflssj;
+    }
+
+    public void setSflssj(Integer sflssj) {
+        this.sflssj = sflssj;
+    }
+
+    public Integer getSfdbfx() {
+        return sfdbfx;
+    }
+
+    public void setSfdbfx(Integer sfdbfx) {
+        this.sfdbfx = sfdbfx;
+    }
+
+    public Integer getSfjl() {
+        return sfjl;
+    }
+
+    public void setSfjl(Integer sfjl) {
+        this.sfjl = sfjl;
+    }
+
+    public Integer getSfcx() {
+        return sfcx;
+    }
+
+    public void setSfcx(Integer sfcx) {
+        this.sfcx = sfcx;
+    }
+
+    public Integer getSftj() {
+        return sftj;
+    }
+
+    public void setSftj(Integer sftj) {
+        this.sftj = sftj;
+    }
+
+    public String getEpsg() {
+        return epsg;
+    }
+
+    public void setEpsg(String epsg) {
+        this.epsg = epsg;
+    }
+
+    public String getYear() {
+        return year;
+    }
+
+    public void setYear(String year) {
+        this.year = year;
+    }
+
+    public String getSjlx() {
+        return sjlx;
+    }
+
+    public void setSjlx(String sjlx) {
+        this.sjlx = sjlx;
+    }
+
+    public String getSde() {
+        return sde;
+    }
+
+    public void setSde(String sde) {
+        this.sde = sde;
+    }
+
+    public String getGltj() {
+        return gltj;
+    }
+
+    public void setGltj(String gltj) {
+        this.gltj = gltj;
+    }
+
+    public String getSjly() {
+        return sjly;
+    }
+
+    public void setSjly(String sjly) {
+        this.sjly = sjly;
+    }
+
+    public String getLegend() {
+        return legend;
+    }
+
+    public void setLegend(String legend) {
+        this.legend = legend;
+    }
+
+    public String getFwmc() {
+        return fwmc;
+    }
+
+    public void setFwmc(String fwmc) {
+        this.fwmc = fwmc;
+    }
+
+    public String getFwgzkj() {
+        return fwgzkj;
+    }
+
+    public void setFwgzkj(String fwgzkj) {
+        this.fwgzkj = fwgzkj;
+    }
+
+    public String getFwys() {
+        return fwys;
+    }
+
+    public void setFwys(String fwys) {
+        this.fwys = fwys;
+    }
+
+    public String getQpfa() {
+        return qpfa;
+    }
+
+    public void setQpfa(String qpfa) {
+        this.qpfa = qpfa;
+    }
+
+    public String getLayergroup() {
+        return layergroup;
+    }
+
+    public void setLayergroup(String layergroup) {
+        this.layergroup = layergroup;
+    }
+
+    public String getFormat() {
+        return format;
+    }
+
+    public void setFormat(String format) {
+        this.format = format;
+    }
+
+    public String getMaximumlevel() {
+        return maximumlevel;
+    }
+
+    public void setMaximumlevel(String maximumlevel) {
+        this.maximumlevel = maximumlevel;
+    }
+
+    public String getMinimumlevel() {
+        return minimumlevel;
+    }
+
+    public void setMinimumlevel(String minimumlevel) {
+        this.minimumlevel = minimumlevel;
+    }
+
+    public Date getCreate_time() {
+        return create_time;
+    }
+
+    public void setCreate_time(Date create_time) {
+        this.create_time = create_time;
+    }
+
+    public String getCreate_by() {
+        return create_by;
+    }
+
+    public void setCreate_by(String create_by) {
+        this.create_by = create_by;
+    }
+
+    public String getSharestate() {
+        return sharestate;
+    }
+
+    public void setSharestate(String sharestate) {
+        this.sharestate = sharestate;
+    }
+
+    public String getDataexplain() {
+        return dataexplain;
+    }
+
+    public void setDataexplain(String dataexplain) {
+        this.dataexplain = dataexplain;
+    }
+}

+ 69 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/ZymlLegendDTO.java

@@ -0,0 +1,69 @@
+package com.siwei.apply.domain.cadastre;
+
+
+//@TableName("t_yzt_zyml_tl")
+public class ZymlLegendDTO {
+    private String bsm;
+    private String zybsm;
+    private String zymc;
+    private String tldm;
+    private String tlmc;
+    private String tllx;
+    private String tlys;
+
+    public String getBsm() {
+        return bsm;
+    }
+
+    public void setBsm(String bsm) {
+        this.bsm = bsm;
+    }
+
+    public String getZybsm() {
+        return zybsm;
+    }
+
+    public void setZybsm(String zybsm) {
+        this.zybsm = zybsm;
+    }
+
+    public String getZymc() {
+        return zymc;
+    }
+
+    public void setZymc(String zymc) {
+        this.zymc = zymc;
+    }
+
+    public String getTldm() {
+        return tldm;
+    }
+
+    public void setTldm(String tldm) {
+        this.tldm = tldm;
+    }
+
+    public String getTlmc() {
+        return tlmc;
+    }
+
+    public void setTlmc(String tlmc) {
+        this.tlmc = tlmc;
+    }
+
+    public String getTllx() {
+        return tllx;
+    }
+
+    public void setTllx(String tllx) {
+        this.tllx = tllx;
+    }
+
+    public String getTlys() {
+        return tlys;
+    }
+
+    public void setTlys(String tlys) {
+        this.tlys = tlys;
+    }
+}

+ 75 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/ZymlTreeDTO.java

@@ -0,0 +1,75 @@
+package com.siwei.apply.domain.cadastre;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.ArrayList;
+import java.util.List;
+
+//资源目录树状结构实体类
+public class ZymlTreeDTO {
+    private String id;
+    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+    private String pid;
+    private String name;
+    private Integer type;
+    private String url;
+    @JsonProperty("isAuth")
+    private Boolean isAuth = false;
+    private List<ZymlTreeDTO> children = new ArrayList<>();
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getPid() {
+        return pid;
+    }
+
+    public void setPid(String pid) {
+        this.pid = pid;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public Boolean getIsAuth() {
+        return isAuth;
+    }
+
+    public void setIsAuth(Boolean auth) {
+        isAuth = auth;
+    }
+
+    public List<ZymlTreeDTO> getChildren() {
+        return children;
+    }
+
+    public void setChildren(List<ZymlTreeDTO> children) {
+        this.children = children;
+    }
+}

+ 286 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/ZymlTreeDataDTO.java

@@ -0,0 +1,286 @@
+package com.siwei.apply.domain.cadastre;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+//资源目录树状结构实体类
+public class ZymlTreeDataDTO {
+    private String id;
+    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
+    private String pid;
+    private String label;
+    private String title;
+    private String type;
+    private String url;
+    private String source;
+    private String parent;
+    private String legend;
+    private String favorite;
+    private Boolean disabled = false;
+    private Boolean checked = false;
+    private Boolean expand = false;
+    private Boolean contextmenu = false;
+    private String serverType;
+    private String fwmc;
+    private String fwgzkj;
+    private String fwys;
+    private String qpfa;
+    private String layergroup;
+    private String format;
+    private String maximumlevel;
+    private String minimumlevel;
+    private String sharestate;
+    private String year;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+    private String createBy;
+    private String dataexplain;
+    private String geomfield;
+    private List<ZymlTreeDataDTO> children = new ArrayList<>();
+
+    public String getGeomfield() {
+        return geomfield;
+    }
+
+    public void setGeomfield(String geomfield) {
+        this.geomfield = geomfield;
+    }
+
+    public String getParent() {
+        return parent;
+    }
+
+    public void setParent(String parent) {
+        this.parent = parent;
+    }
+
+    public String getLegend() {
+        return legend;
+    }
+
+    public void setLegend(String legend) {
+        this.legend = legend;
+    }
+
+    public String getSource() {
+        return source;
+    }
+
+    public void setSource(String source) {
+        this.source = source;
+    }
+
+    public Boolean getChecked() {
+        return checked;
+    }
+
+    public void setChecked(Boolean checked) {
+        this.checked = checked;
+    }
+
+    public String getFavorite() {
+        return favorite;
+    }
+
+    public void setFavorite(String favorite) {
+        this.favorite = favorite;
+    }
+
+    public Boolean getExpand() {
+        return expand;
+    }
+
+    public void setExpand(Boolean expand) {
+        this.expand = expand;
+    }
+
+    public Boolean getContextmenu() {
+        return contextmenu;
+    }
+
+    public void setContextmenu(Boolean contextmenu) {
+        this.contextmenu = contextmenu;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getLabel() {
+        return label;
+    }
+
+    public void setLabel(String label) {
+        this.label = label;
+    }
+
+    public Boolean getDisabled() {
+        return disabled;
+    }
+
+    public void setDisabled(Boolean disabled) {
+        this.disabled = disabled;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getPid() {
+        return pid;
+    }
+
+    public void setPid(String pid) {
+        this.pid = pid;
+    }
+
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+
+    public List<ZymlTreeDataDTO> getChildren() {
+        return children;
+    }
+
+    public void setChildren(List<ZymlTreeDataDTO> children) {
+        this.children = children;
+    }
+
+    public String getServerType() {
+        return serverType;
+    }
+
+    public void setServerType(String serverType) {
+        this.serverType = serverType;
+    }
+
+    public String getFwmc() {
+        return fwmc;
+    }
+
+    public void setFwmc(String fwmc) {
+        this.fwmc = fwmc;
+    }
+
+    public String getFwgzkj() {
+        return fwgzkj;
+    }
+
+    public void setFwgzkj(String fwgzkj) {
+        this.fwgzkj = fwgzkj;
+    }
+
+    public String getFwys() {
+        return fwys;
+    }
+
+    public void setFwys(String fwys) {
+        this.fwys = fwys;
+    }
+
+    public String getQpfa() {
+        return qpfa;
+    }
+
+    public void setQpfa(String qpfa) {
+        this.qpfa = qpfa;
+    }
+
+    public String getLayergroup() {
+        return layergroup;
+    }
+
+    public void setLayergroup(String layergroup) {
+        this.layergroup = layergroup;
+    }
+
+    public String getFormat() {
+        return format;
+    }
+
+    public void setFormat(String format) {
+        this.format = format;
+    }
+
+    public String getMaximumlevel() {
+        return maximumlevel;
+    }
+
+    public void setMaximumlevel(String maximumlevel) {
+        this.maximumlevel = maximumlevel;
+    }
+
+    public String getMinimumlevel() {
+        return minimumlevel;
+    }
+
+    public void setMinimumlevel(String minimumlevel) {
+        this.minimumlevel = minimumlevel;
+    }
+
+    public String getSharestate() {
+        return sharestate;
+    }
+
+    public void setSharestate(String sharestate) {
+        this.sharestate = sharestate;
+    }
+
+    public String getYear() {
+        return year;
+    }
+
+    public void setYear(String year) {
+        this.year = year;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(String createBy) {
+        this.createBy = createBy;
+    }
+
+    public String getDataexplain() {
+        return dataexplain;
+    }
+
+    public void setDataexplain(String dataexplain) {
+        this.dataexplain = dataexplain;
+    }
+}

+ 51 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/cadastre/ZymlMapper.java

@@ -0,0 +1,51 @@
+package com.siwei.apply.mapper.cadastre;
+
+import com.siwei.apply.domain.cadastre.*;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 资源目录 数据层
+ *
+ * @author onemap
+ */
+@Mapper
+public interface ZymlMapper {
+
+    List<ZymlDTO> GetListCondition(@Param("username") String username, @Param("bsm") String bsm, @Param("pbsm") String pbsm, @Param("name") String name, @Param("sharestate") String sharestate);
+
+    List<ZymlDTO> GetList(@Param("username") String username, @Param("param") String param, @Param("resources") String resources);
+
+    List<ZymlDTO> GetList4XZQH(@Param("username") String username, @Param("xzqh") String xzqh, @Param("param") String param);
+
+    List<ZymlDTO> GetByBsms(String[] bsm);
+
+    List<ZymlDTO> GetMyCollect(String username);
+
+    List<ZymlDTO> GetMyCollect4XZQH(@Param("username") String username, @Param("xzqh") String xzqh);
+
+    List<ResourceAttrsDTO> GetAttrs(String bsm);
+
+    void DeleteCollect(ZymlBsmDTO zymlBsmDTO);
+
+    Integer GetCollectCount(ZymlBsmDTO zymlBsmDTO);
+
+    Integer AddCollect(ZymlBsmDTO zymlBsmDTO);
+
+    List<DbfxResourceDTO> GetDbfxList(String param);
+
+    List<DbfxLssjDTO> GetLssjList(String param);
+
+    List<ZymlLegendDTO> GetLegend(String zybsm);
+
+    ZymlDTO GetByBsm(@Param("bsm") String bsm);
+
+    List<ZymlTreeDTO> GetTree(String s);
+
+    String getXzqCode(String deptName);
+
+    List<Map> GetLegendAttr(String ywlx);
+}

+ 45 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/IZymlService.java

@@ -0,0 +1,45 @@
+package com.siwei.apply.service.cadastre;
+
+
+import com.siwei.common.core.domain.R;
+
+import java.util.Map;
+
+public interface IZymlService {
+    R GetList(String param);
+
+    R GetByBsms(String bsm);
+
+    R GetMyCollect(String param);
+
+    R GetAttrs(String bsm);
+
+    R Collect(Map params);
+
+    R GetDbfxList(String param);
+
+    R GetLegend(String zybsm);
+
+    R GetByBsm(String bsm);
+
+    R getDataSourceTree(String param);
+
+    R getXzqCode(String deptName);
+
+    R GetLegendAttr(String ywlx);
+
+    R GetTree(String param);
+
+    /**
+     * 暂时放弃
+     * @param bsm
+     * @param pbsm
+     * @param name
+     * @param share
+     * @param subset
+     * @return
+     */
+    R GetZymlList(String bsm, String pbsm, String name, Boolean share,Boolean subset);
+
+    R GetZymlShareList( String name);
+}

+ 611 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/ZymlServiceImpl.java

@@ -0,0 +1,611 @@
+package com.siwei.apply.service.cadastre.impl;
+
+import com.siwei.apply.domain.cadastre.*;
+import com.siwei.apply.mapper.cadastre.ZymlMapper;
+import com.siwei.apply.service.cadastre.IZymlService;
+import com.siwei.common.core.domain.R;
+import com.siwei.common.core.utils.StringUtils;
+import com.siwei.common.security.utils.SecurityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+
+/**
+ * 这里修改不一致的返回
+ */
+@Service
+public class ZymlServiceImpl implements IZymlService {
+
+    @Autowired
+    private ZymlMapper zymlMapper;
+
+    /**
+     * 获取资源目录列表
+     *
+     * @param param 需要获取的目录节点bsm,用于抽取特定资源目录数据
+     * @return
+     */
+    @Override
+    public R GetList(String param) {
+        try {
+            List<ZymlDTO> res = new ArrayList<>();
+            if (StringUtils.isEmpty(SecurityUtils.getUsername())) {
+                res = zymlMapper.GetList("", param, "");
+            } else {
+                String resources = SecurityUtils.getLoginUser().getSysUser().getDept().getResources();
+                String username = SecurityUtils.getUsername();
+                if ("".equals(username)) {
+                    return R.fail(501, "登录信息获取失败");
+                }
+                String userXzqdm = SecurityUtils.getLoginUserXzq();
+                if (StringUtils.isNotEmpty(resources)) {
+                    res = zymlMapper.GetList(username, param, resources);
+                } else if (StringUtils.isXzqhQuery(userXzqdm)) {
+                    res = zymlMapper.GetList4XZQH(username, userXzqdm, param);
+                } else {
+                    res = zymlMapper.GetList(username, param, resources);
+                }
+            }
+            for (ZymlDTO zymlDTO : res) {
+                // TODO 转换arcgis服务地址 将http转换https
+                // zymlDTO.setUrl(StringUtils.convertArcgisHttpsUrl(zymlDTO.getUrl()));
+                if (zymlDTO.getParent() == 1 && zymlDTO.getCount() > 0) {
+                    zymlDTO.setName(zymlDTO.getName() + "[" + zymlDTO.getCount() + "]");
+                }
+            }
+            return R.ok(res, "成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(500, "失败");
+        }
+    }
+
+    /**
+     * 获取资源目录列表
+     *
+     * @param param 需要获取的目录节点bsm,用于抽取特定资源目录数据
+     * @return
+     */
+    @Override
+    public R GetTree(String param) {
+        try {
+            String resources = "";
+            List<ZymlDTO> res = new ArrayList<>();
+            if (StringUtils.isEmpty(SecurityUtils.getUsername())) {
+                if ("parent".equals(param)) {
+                    param = "";
+                    resources = "parent";
+                }
+                res = zymlMapper.GetList("admin", param, resources);
+            } else {
+                resources = SecurityUtils.getLoginUser().getSysUser().getDept().getResources();
+                if ("parent".equals(param)) {
+                    param = "";
+                    resources = "parent";
+                }
+                String username = SecurityUtils.getUsername();
+                if ("".equals(username)) {
+                    return R.fail(501, "登录信息获取失败");
+                }
+                String userXzqdm = SecurityUtils.getLoginUserXzq();
+                if (StringUtils.isNotEmpty(resources)) {
+                    res = zymlMapper.GetList(username, param, resources);
+                } else if (StringUtils.isXzqhQuery(userXzqdm)) {
+                    res = zymlMapper.GetList4XZQH(username, userXzqdm, param);
+                } else {
+                    res = zymlMapper.GetList(username, param, resources);
+                }
+            }
+            for (ZymlDTO zymlDTO : res) {
+                // TODO 转换arcgis服务地址 将http转换https
+                // zymlDTO.setUrl(StringUtils.convertArcgisHttpsUrl(zymlDTO.getUrl()));
+                if (zymlDTO.getParent() == 1 && zymlDTO.getCount() > 0) {
+                    zymlDTO.setName(zymlDTO.getName() + "[" + zymlDTO.getCount() + "]");
+                }
+            }
+            List<ZymlTreeDataDTO> treedata = new ArrayList<>();
+            for (int i = 0; i < res.size(); i++) {
+                ZymlDTO cur = res.get(i);
+                ZymlTreeDataDTO c = new ZymlTreeDataDTO();
+                // c.setDisabled((cur.getParent() == 1));
+                c.setId(cur.getBsm());
+                c.setPid(cur.getPbsm());
+                c.setLabel(cur.getName());
+                c.setParent(String.valueOf(cur.getParent()));
+                c.setTitle(cur.getName());
+                c.setType(cur.getType());
+                c.setLegend(cur.getLegend());
+                c.setUrl(cur.getUrl());
+                c.setSource(cur.getSde());
+                c.setFavorite(cur.getMy());
+                c.setMinimumlevel(cur.getMinimumlevel());
+                c.setMaximumlevel(cur.getMaximumlevel());
+                c.setFormat(cur.getFormat());
+                c.setLayergroup(cur.getLayergroup());
+                c.setQpfa(cur.getQpfa());
+                c.setFwys(cur.getFwys());
+                c.setFwgzkj(cur.getFwgzkj());
+                c.setFwmc(cur.getFwmc());
+                c.setServerType(cur.getServerType());
+                c.setGeomfield(cur.getGeomfield());
+                treedata.add(c);
+            }
+            List<ZymlTreeDataDTO> data = buildDeptTree2(treedata);
+            return R.ok(data, "成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(500, "失败");
+        }
+    }
+
+    @Override
+    public R GetByBsms(String bsm) {
+        try {
+            if (StringUtils.isEmpty(bsm)) {
+                return R.ok(new ArrayList<>(), "成功");
+            }
+            String[] params = bsm.split(",");
+            // String username = SecurityUtils.getUsername();
+            // if ("".equals(username)) {
+            // return R.error("登录信息获取失败", null);
+            // }
+            List<ZymlDTO> res = zymlMapper.GetByBsms(params);
+            return R.ok(res, "成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(500, "失败");
+        }
+    }
+
+    @Override
+    public R GetByBsm(String bsm) {
+        try {
+            if (StringUtils.isEmpty(bsm)) {
+                return R.ok(new ArrayList<>(), "成功");
+            }
+            // String username = SecurityUtils.getUsername();
+            // if ("".equals(username)) {
+            // return R.error("登录信息获取失败", null);
+            // }
+            ZymlDTO res = zymlMapper.GetByBsm(bsm);
+            return R.ok(res, "成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(500, "失败");
+        }
+    }
+
+    @Override
+    public R getDataSourceTree(String param) {
+        List<ZymlTreeDTO> res = zymlMapper.GetTree("");
+        List<ZymlTreeDTO> data = buildDeptTree(res);
+        return R.ok(data, "成功");
+    }
+
+    @Override
+    public R getXzqCode(String deptName) {
+        return R.ok(SecurityUtils.getLoginUserXzq());
+    }
+
+    @Override
+    public R GetLegendAttr(String ywlx) {
+        if (StringUtils.isEmpty(ywlx)) {
+            return R.fail(500, "参数未传递!");
+        }
+        List<Map> res = zymlMapper.GetLegendAttr(ywlx);
+        Map<String, String> data = new HashMap<>();
+        for (Map cur : res) {
+            data.put(cur.get("value").toString(), cur.get("name").toString());
+        }
+        return R.ok(data);
+    }
+
+    @Override
+    public R GetMyCollect(String param) {
+        try {
+            String username = SecurityUtils.getUsername();
+            if ("".equals(username)) {
+                username = "admin";
+                // return R.error("登录信息获取失败", null);
+            }
+            // String userXzqdm = SecurityUtils.getLoginUserXzq();
+            List<ZymlDTO> res = new ArrayList<>();
+            res = zymlMapper.GetMyCollect(username);
+            // if (StringUtils.isXzqhQuery(userXzqdm)) {
+            // res = zymlMapper.GetMyCollect4XZQH(username, userXzqdm);
+            // } else {
+            // res = zymlMapper.GetMyCollect(username);
+            // }
+            List<ZymlTreeDataDTO> treedata = new ArrayList<>();
+            for (int i = 0; i < res.size(); i++) {
+                ZymlDTO cur = res.get(i);
+                ZymlTreeDataDTO c = new ZymlTreeDataDTO();
+                // c.setDisabled((cur.getParent() == 1));
+                c.setId(cur.getBsm());
+                c.setPid(cur.getPbsm());
+                c.setLabel(cur.getName());
+                c.setTitle(cur.getName());
+                c.setType(cur.getType());
+                c.setSource(cur.getSde());
+                c.setFavorite(cur.getMy());
+                c.setUrl(cur.getUrl());
+                c.setLegend(cur.getLegend());
+                c.setServerType(cur.getServerType());
+                c.setFwgzkj(cur.getFwgzkj());
+                c.setFwmc(cur.getFwmc());
+                c.setFormat(cur.getFormat());
+                c.setGeomfield(cur.getGeomfield());
+                treedata.add(c);
+            }
+            return R.ok(treedata, "成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(500, "失败");
+        }
+    }
+
+    @Override
+    public R GetAttrs(String bsm) {
+        try {
+            if (StringUtils.isEmpty(bsm)) {
+                return R.ok(new ArrayList<>(), "成功");
+            }
+            List<ResourceAttrsDTO> res = zymlMapper.GetAttrs(bsm);
+            return R.ok(res, "成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(500, "失败");
+        }
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public R Collect(Map params) {
+        try {
+            if (StringUtils.isNull(params.get("bsm"))) {
+                return R.fail(500, "标识码为空");
+            }
+            String bsm = (String) params.get("bsm");
+            if (StringUtils.isEmpty(bsm)) {
+                return R.fail(500, "标识码为空");
+            }
+            String username = SecurityUtils.getUsername();
+            if ("".equals(username)) {
+                username = "admin";
+                // return R.error("登录信息获取失败", null);
+            }
+            ZymlBsmDTO zymlBsmDTO = new ZymlBsmDTO();
+            zymlBsmDTO.setBsm(bsm);
+            zymlBsmDTO.setUsername(username);
+            Integer count = zymlMapper.GetCollectCount(zymlBsmDTO);
+            if (count > 0) {
+                zymlMapper.DeleteCollect(zymlBsmDTO);
+            } else {
+                zymlMapper.AddCollect(zymlBsmDTO);
+            }
+            return R.ok(true, "成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(500, "失败");
+        }
+    }
+
+    @Override
+    public R GetDbfxList(String param) {
+        try {
+            List<DbfxResourceDTO> res = zymlMapper.GetDbfxList(param);
+            for (DbfxResourceDTO dbfxResourceDTO : res) {
+                if (!StringUtils.isEmpty(dbfxResourceDTO.getFzbsm())) {
+                    dbfxResourceDTO.setLssj(zymlMapper.GetLssjList(dbfxResourceDTO.getFzbsm()));
+                }
+            }
+            return R.ok(res, "成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(500, "失败");
+        }
+    }
+
+    @Override
+    public R GetLegend(String zybsm) {
+        if (StringUtils.isNull(zybsm)) {
+            return R.fail(500, "标识码为空");
+        }
+        try {
+            List<ZymlLegendDTO> res = zymlMapper.GetLegend(zybsm);
+            return R.ok(res, "成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(500, "失败");
+        }
+    }
+
+    /**
+     * 构建前端所需要树结构
+     *
+     * @param XzqDtos 行政区列表
+     * @return 树结构列表
+     */
+    public List<ZymlTreeDataDTO> buildDeptTree2(List<ZymlTreeDataDTO> XzqDtos) {
+        List<ZymlTreeDataDTO> returnList = new ArrayList<>();
+        List<String> tempList = new ArrayList<String>();
+        for (ZymlTreeDataDTO XzqDto : XzqDtos) {
+            tempList.add(XzqDto.getId());
+        }
+        for (ZymlTreeDataDTO XzqDto : XzqDtos) {
+            // 如果是顶级节点, 遍历该父节点的所有子节点
+            if (!tempList.contains(XzqDto.getPid())) {
+                recursionFn2(XzqDtos, XzqDto);
+                returnList.add(XzqDto);
+            }
+        }
+        if (returnList.isEmpty()) {
+            returnList = XzqDtos;
+        }
+        return returnList;
+    }
+
+    /**
+     * 递归列表
+     */
+    private void recursionFn2(List<ZymlTreeDataDTO> list, ZymlTreeDataDTO t) {
+        // 得到子节点列表
+        List<ZymlTreeDataDTO> childList = getChildList2(list, t);
+        t.setChildren(childList);
+        for (ZymlTreeDataDTO tChild : childList) {
+            if (hasChild2(list, tChild)) {
+                recursionFn2(list, tChild);
+            }
+        }
+    }
+
+    /**
+     * 得到子节点列表
+     */
+    private List<ZymlTreeDataDTO> getChildList2(List<ZymlTreeDataDTO> list, ZymlTreeDataDTO t) {
+        List<ZymlTreeDataDTO> tlist = new ArrayList<>();
+        Iterator<ZymlTreeDataDTO> it = list.iterator();
+        while (it.hasNext()) {
+            ZymlTreeDataDTO n = (ZymlTreeDataDTO) it.next();
+            if (StringUtils.isNotNull(n.getPid()) && t.getId().equals(n.getPid())) {
+                tlist.add(n);
+            }
+        }
+        return tlist;
+    }
+
+    /**
+     * 判断是否有子节点
+     */
+    private boolean hasChild2(List<ZymlTreeDataDTO> list, ZymlTreeDataDTO t) {
+        return getChildList2(list, t).size() > 0 ? true : false;
+    }
+
+    /**
+     * 构建前端所需要树结构
+     *
+     * @param XzqDtos 行政区列表
+     * @return 树结构列表
+     */
+    public List<ZymlTreeDTO> buildDeptTree(List<ZymlTreeDTO> XzqDtos) {
+        List<ZymlTreeDTO> returnList = new ArrayList<>();
+        List<String> tempList = new ArrayList<String>();
+        for (ZymlTreeDTO XzqDto : XzqDtos) {
+            tempList.add(XzqDto.getId());
+        }
+        for (ZymlTreeDTO XzqDto : XzqDtos) {
+            // 如果是顶级节点, 遍历该父节点的所有子节点
+            if (!tempList.contains(XzqDto.getPid())) {
+                recursionFn(XzqDtos, XzqDto);
+                returnList.add(XzqDto);
+            }
+        }
+        if (returnList.isEmpty()) {
+            returnList = XzqDtos;
+        }
+        return returnList;
+    }
+
+    /**
+     * 递归列表
+     */
+    private void recursionFn(List<ZymlTreeDTO> list, ZymlTreeDTO t) {
+        // 得到子节点列表
+        List<ZymlTreeDTO> childList = getChildList(list, t);
+        t.setChildren(childList);
+        for (ZymlTreeDTO tChild : childList) {
+            if (hasChild(list, tChild)) {
+                recursionFn(list, tChild);
+            }
+        }
+    }
+
+    /**
+     * 得到子节点列表
+     */
+    private List<ZymlTreeDTO> getChildList(List<ZymlTreeDTO> list, ZymlTreeDTO t) {
+        List<ZymlTreeDTO> tlist = new ArrayList<>();
+        Iterator<ZymlTreeDTO> it = list.iterator();
+        while (it.hasNext()) {
+            ZymlTreeDTO n = (ZymlTreeDTO) it.next();
+            if (StringUtils.isNotNull(n.getPid()) && t.getId().equals(n.getPid())) {
+                tlist.add(n);
+            }
+        }
+        return tlist;
+    }
+
+    /**
+     * 判断是否有子节点
+     */
+    private boolean hasChild(List<ZymlTreeDTO> list, ZymlTreeDTO t) {
+        return getChildList(list, t).size() > 0 ? true : false;
+    }
+
+    // 递归循环
+    public List<ZymlDTO> GetZymlSubsetList(String username, String pbsm, String name, Boolean share) {
+        String sharestate = null;
+        if (share != null && share == true) {
+            sharestate = "0";
+        }
+        List<ZymlDTO> ret = new ArrayList<>();
+        List<ZymlDTO> res = zymlMapper.GetListCondition(username, null, pbsm, name, sharestate);
+        for (ZymlDTO dto : res) {
+            List<ZymlDTO> subset = GetZymlSubsetList(username, dto.getBsm(), name, share);
+            ret.addAll(subset);
+        }
+        ret.addAll(res);
+        return ret;
+    }
+
+    @Override
+    public R GetZymlList(String bsm, String pbsm, String name, Boolean share, Boolean subset) {
+        try {
+            List<ZymlDTO> res = new ArrayList<>();
+            String sharestate = "1";
+            if (share != null && share == true) {
+                sharestate = "0";
+            }
+            // TODO 暂时为admin
+            // String username = SecurityUtils.getUsername();
+            String username = "admin";
+            if (StringUtils.isNotEmpty(username)) {
+                // 暂定管理员权限可以查询所有数据,其他只能看到自己的
+                if (username.equals("admin")) {
+                    username = null;
+                }
+            } else {
+                return R.fail(500, "参数缺失");
+            }
+            List<ZymlDTO> ret = zymlMapper.GetListCondition(username, bsm, pbsm, name, sharestate);
+            if (subset != null && subset) {
+                for (ZymlDTO dto : ret) {
+                    List<ZymlDTO> subsetList = GetZymlSubsetList(username, dto.getBsm(), name, share);
+                    res.addAll(subsetList);
+                }
+            }
+            res.addAll(ret);
+            List<ZymlTreeDataDTO> treedata = new ArrayList<>();
+            for (int i = 0; i < res.size(); i++) {
+                ZymlDTO cur = res.get(i);
+                ZymlTreeDataDTO c = new ZymlTreeDataDTO();
+                // c.setDisabled((cur.getParent() == 1));
+                c.setId(cur.getBsm());
+                c.setPid(cur.getPbsm());
+                c.setLabel(cur.getName());
+                c.setTitle(cur.getName());
+                c.setType(cur.getType());
+                c.setLegend(cur.getLegend());
+                c.setUrl(cur.getUrl());
+                c.setSource(cur.getSde());
+                c.setFavorite(cur.getMy());
+                c.setMinimumlevel(cur.getMinimumlevel());
+                c.setMaximumlevel(cur.getMaximumlevel());
+                c.setFormat(cur.getFormat());
+                c.setLayergroup(cur.getLayergroup());
+                c.setQpfa(cur.getQpfa());
+                c.setFwys(cur.getFwys());
+                c.setFwgzkj(cur.getFwgzkj());
+                c.setFwmc(cur.getFwmc());
+                c.setServerType(cur.getServerType());
+                c.setSharestate(cur.getSharestate());
+                c.setYear(cur.getYear());
+                treedata.add(c);
+            }
+            List<ZymlTreeDataDTO> data = buildDeptTree2(treedata);
+            return R.ok(data, "成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(500, "失败");
+        }
+    }
+
+    public R GetZymlShareList(String name) {
+        List<ZymlDTO> res = new ArrayList<>();
+        List<ZymlDTO> ret = zymlMapper.GetListCondition(null, null, null, null, null);
+        for (ZymlDTO dto : ret) {
+            List<ZymlDTO> subsetList = GetZymlSubsetList(null, dto.getBsm(), null, null);
+            res.addAll(subsetList);
+        }
+        res.addAll(ret);
+        List<ZymlTreeDataDTO> treedata = new ArrayList<>();
+        for (int i = 0; i < res.size(); i++) {
+            ZymlDTO cur = res.get(i);
+            ZymlTreeDataDTO c = new ZymlTreeDataDTO();
+            // c.setDisabled((cur.getParent() == 1));
+            c.setId(cur.getBsm());
+            c.setPid(cur.getPbsm());
+            c.setLabel(cur.getName());
+            c.setTitle(cur.getName());
+            c.setType(cur.getType());
+            c.setLegend(cur.getLegend());
+            c.setUrl(cur.getUrl());
+            c.setSource(cur.getSde());
+            c.setFavorite(cur.getMy());
+            c.setMinimumlevel(cur.getMinimumlevel());
+            c.setMaximumlevel(cur.getMaximumlevel());
+            c.setFormat(cur.getFormat());
+            c.setLayergroup(cur.getLayergroup());
+            c.setQpfa(cur.getQpfa());
+            c.setFwys(cur.getFwys());
+            c.setFwgzkj(cur.getFwgzkj());
+            c.setFwmc(cur.getFwmc());
+            c.setServerType(cur.getServerType());
+            c.setSharestate(cur.getSharestate());
+            c.setYear(cur.getYear());
+            c.setCreateBy(cur.getCreate_by());
+            c.setCreateTime(cur.getCreate_time());
+            c.setDataexplain(cur.getDataexplain());
+            treedata.add(c);
+        }
+        // 获取树
+        List<ZymlTreeDataDTO> newRET = new ArrayList<>();
+        List<ZymlTreeDataDTO> data = buildDeptTree2(treedata);
+        for (ZymlTreeDataDTO dto : data) {
+            Map<String, Object> statsMap = new HashMap<>();
+            statsMap.put("stats", false);
+            statsMap.put("id", dto.getId());
+            statsMap.put("data", dto);
+
+            Map<String, Object> retStatsMap = handleZymlTreeShare(statsMap);
+            Boolean retstats = (Boolean) retStatsMap.get("stats");
+            if (retstats) {
+                ZymlTreeDataDTO newData0 = (ZymlTreeDataDTO) retStatsMap.get("data");
+                newRET.add(newData0);
+            }
+        }
+
+        return R.ok(newRET);
+    }
+
+    private Map<String, Object> handleZymlTreeShare(Map<String, Object> data) {
+        ZymlTreeDataDTO dtoObj = (ZymlTreeDataDTO) data.get("data");
+        Boolean stats = (Boolean) data.get("stats");
+        // 判断是否是共享类型
+        String sharestate = dtoObj.getSharestate();
+        if (StringUtils.isNotEmpty(sharestate) && sharestate.equals("0")) {
+            stats = true;
+        }
+        List<ZymlTreeDataDTO> child = dtoObj.getChildren();
+        List<ZymlTreeDataDTO> newchild = new ArrayList<>();
+        for (ZymlTreeDataDTO dto : child) {
+            Map<String, Object> statsMap = new HashMap<>();
+            statsMap.put("stats", false);
+            statsMap.put("id", dto.getId());
+            statsMap.put("data", dto);
+            Map<String, Object> retStatsMap = handleZymlTreeShare(statsMap);
+            Boolean retstats = (Boolean) retStatsMap.get("stats");
+            if (retstats) {
+                ZymlTreeDataDTO newData0 = (ZymlTreeDataDTO) retStatsMap.get("data");
+                stats = true;
+                newchild.add(newData0);
+            }
+        }
+        dtoObj.setChildren(newchild);
+        data.put("data", dtoObj);
+        data.put("stats", stats);
+        return data;
+    }
+}

+ 440 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/cadastre/ZymlMapper.xml

@@ -0,0 +1,440 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--<mapper namespace="com.onemap.apply.mapper.yzt.ZymlMapper">-->
+<mapper namespace="com.siwei.apply.mapper.cadastre.ZymlMapper">
+    <select id="GetListCondition" parameterType="java.lang.String" resultType="com.siwei.apply.domain.cadastre.ZymlDTO">
+        select
+        (WITH RECURSIVE a AS (
+        SELECT g.bsm, g.pbsm, g.parent
+        FROM t_yzt_zyml g
+        WHERE bsm = t.bsm
+        UNION ALL
+        SELECT d.bsm, d.pbsm, d.parent
+        FROM t_yzt_zyml d
+        JOIN a ON a.bsm = d.pbsm )
+        SELECT count(1) FROM a where a.parent = '0') as "count",
+        t.bsm as "bsm",
+        t.name as "name",
+        t.type as "type",
+        t.pbsm as "pbsm",
+        t.icon as "icon",
+        t.url as "url",
+        t.lev as "lev",
+        t.sort as "sort",
+        t.state as "state",
+        t.parent as "parent",
+        case when t.sde is null then t.server_type else 'Arcgis' end as "server_type",
+        t.sflssj as "sflssj",
+        t.sfdbfx as "sfdbfx",
+        t.sfjl as "sfjl",
+        t.sfcx as "sfcx",
+        t.sftj as "sftj",
+        t.epsg as "epsg",
+        t.year as "year",
+        t.sjlx as "sjlx",
+        t.sde as "sde",
+        t.gltj as "gltj",
+        t.sjly as "sjly",
+        t.legend as "legend",
+        t.ywlx as "ywlx",
+        t.server_type as "serverType",
+        t.fwmc as "fwmc" ,
+        t.fwgzkj as "fwgzkj",
+        t.geomfield as "geomfield",
+        t.fwys as "fwys",
+        t.qpfa as "qpfa",
+        t.layergroup as "layergroup",
+        t.format as "format",
+        t.maximumlevel as "maximumlevel",
+        t.minimumlevel as "minimumlevel",
+        t.create_time as "create_time",
+        t.create_by as "create_by",
+        t.sharestate as "sharestate",
+        t.dataexplain as "dataexplain"
+        from t_yzt_zyml t
+        where 1 = 1
+        <choose>
+            <when test="bsm != null and bsm != ''">
+                and t.bsm = #{bsm}
+            </when>
+            <otherwise>
+                <choose>
+                    <when test="pbsm != null and pbsm != ''">
+                        and t.pbsm = #{pbsm}
+                    </when>
+                    <otherwise>
+                        and (T.pbsm is null or T.pbsm ='')
+                    </otherwise>
+                </choose>
+            </otherwise>
+        </choose>
+        <if test="name != null and name != ''">
+            and t.name like concat('%',#{name},'%')
+        </if>
+        <if test="sharestate != null and sharestate != ''">
+            and t.sharestate = #{sharestate}
+        </if>
+
+        order by t.lev,t.pbsm,t.sort
+    </select>
+    <select id="GetList" parameterType="java.lang.String" resultType="com.siwei.apply.domain.cadastre.ZymlDTO">
+        select
+        (WITH RECURSIVE a AS (
+        SELECT g.bsm, g.pbsm, g.parent
+        FROM t_yzt_zyml g
+        WHERE bsm = t.bsm
+        UNION ALL
+        SELECT d.bsm, d.pbsm, d.parent
+        FROM t_yzt_zyml d
+        JOIN a ON a.bsm = d.pbsm )
+        SELECT count(1) FROM a where a.parent = '0') as "count",
+        t.bsm as "bsm",
+        t.name as "name",
+        t.type as "type",
+        t.pbsm as "pbsm",
+        t.icon as "icon",
+        t.url as "url",
+        t.lev as "lev",
+        t.sort as "sort",
+        t.state as "state",
+        t.geomfield as "geomfield",
+        t.parent as "parent",
+        case when t.sde is null then t.server_type else 'Arcgis' end as "server_type",
+        t.sflssj as "sflssj",
+        t.sfdbfx as "sfdbfx",
+        t.sfjl as "sfjl",
+        t.sfcx as "sfcx",
+        t.sftj as "sftj",
+        t.epsg as "epsg",
+        t.year as "year",
+        t.sjlx as "sjlx",
+        t.sde as "sde",
+        t.gltj as "gltj",
+        t.sjly as "sjly",
+        t.legend as "legend",
+        t.ywlx as "ywlx",
+        t.server_type as "serverType",
+        t.fwmc as "fwmc" ,
+        t.fwgzkj as "fwgzkj",
+        t.fwys as "fwys",
+        t.qpfa as "qpfa",
+        t.layergroup as "layergroup",
+        t.format as "format",
+        t.maximumlevel as "maximumlevel",
+        t.minimumlevel as "minimumlevel",
+        t.create_time as "create_time",
+        t.create_by as "create_by",
+        (select distinct(uhbm) from t_yzt_zyml_my my where my.zy_bsm = t.bsm and my.uhbm = #{username}) as "my"
+        from t_yzt_zyml t
+        where 1 = 1
+        <if test="param != null and param != ''">
+            and t.bsm in (WITH RECURSIVE a AS (
+            SELECT g.bsm, g.pbsm
+            FROM t_yzt_zyml g
+            WHERE bsm = #{param}
+            UNION ALL
+            SELECT d.bsm, d.pbsm
+            FROM t_yzt_zyml d
+            JOIN a ON a.bsm = d.pbsm )
+            SELECT bsm FROM a order by a.bsm)
+        </if>
+        <if test="resources != null and resources != ''">
+            and t.parent = '1'
+        </if>
+        order by t.sort
+    </select>
+    <select id="GetList4XZQH" parameterType="java.lang.String" resultType="com.siwei.apply.domain.cadastre.ZymlDTO">
+        select
+        (select count(1) from ( select * from t_yzt_zyml ml left join t_yzt_db_layer dblayer2 on dblayer2.id = ml.sde
+        where dblayer2.source
+        like '%'||#{xzqh}||'%' or ml.sjly = #{xzqh} or ml.parent = 1)cou where cou.parent = 0
+        start with cou.bsm = t.bsm
+        connect by prior cou.bsm = cou.pbsm ) as "count",
+        t.bsm as "bsm",
+        t.name as "name",
+        case when t.sde is null then t.type else to_char(dblayer.servicetype) end as "type",
+        t.pbsm as "pbsm",
+        t.icon as "icon",
+        case when t.sde is null then t.url else to_char(dblayer.address) end as "url",
+        t.lev as "lev",
+        t.sort as "sort",
+        t.state as "state",
+        t.parent as "parent",
+        t.geomfield as "geomfield",
+        case when t.sde is null then t.server_type else 'Arcgis' end as "server_type",
+        t.sflssj as "sflssj",
+        t.sfdbfx as "sfdbfx",
+        t.sfjl as "sfjl",
+        t.sfcx as "sfcx",
+        t.sftj as "sftj",
+        t.epsg as "epsg",
+        t.year as "year",
+        t.sjlx as "sjlx",
+        t.sde as "sde",
+        t.gltj as "gltj",
+        t.sjly as "sjly",
+        t.legend as "legend",
+        t.ywlx as "ywlx",
+        (select distinct(uhbm) from t_yzt_zyml_my my where my.zy_bsm = t.bsm and my.uhbm = #{username}) as "my",
+        (select fzbsm from T_YZT_ZYML_LSSJ ls where ls.zybsm = t.bsm) as "fzbsm",
+        to_char(res.datetime ,'yyyy-MM-dd hh24:mi:ss') as "datetime",
+        (select usertable.nick_name from sys_user usertable where usertable.user_name = res.createperson) as
+        "createperson"
+        from t_yzt_zyml t left join t_yzt_db_layer dblayer on dblayer.id = t.sde
+        left join tb_resourcehooktb res on res.name = replace(dblayer.source, 'SDE.','')
+        where 1 = 1
+        <if test="param != null and param != ''">
+            and t.bsm in (select bsm
+            from t_yzt_zyml ml
+            start with ml.bsm = #{param}
+            connect by prior ml.bsm = ml.pbsm)
+        </if>
+        and (dblayer.id in ( select id from T_YZT_DB_LAYER where source
+        like '%'||#{xzqh}||'%' ) or PARENT = 1 or t.sjly = #{xzqh})
+        order by t.lev, t.sort
+    </select>
+    <select id="GetTree" parameterType="java.lang.String" resultType="com.siwei.apply.domain.cadastre.ZymlTreeDTO">
+        select
+           t.bsm as "id",
+          t.name as "name",
+          t.pbsm as "pid",
+          null as "url",
+          t.state as "state",
+          -- case when t.parent = 0 then 1 else 0 end  as "type"
+          case when t.parent::integer = 0 then 1 else 0 end  as "type"
+       from t_yzt_zyml t  order by t.lev,t.pbsm , t.sort
+    </select>
+
+    <select id="GetMyCollect" parameterType="java.lang.String" resultType="com.siwei.apply.domain.cadastre.ZymlDTO">
+        select
+          0 as "count",
+           t.bsm as "bsm",
+          t.name as "name",
+          t.fwmc as "fwmc",
+          t.fwgzkj as "fwgzkj",
+          t.type as "type",
+          t.format as "format",
+          t.pbsm as "pbsm",
+          t.geomfield as "geomfield",
+          t.icon as "icon",
+          t.url as "url",
+          t.lev as "lev",
+          t.sort as "sort",
+          t.state as "state",
+          t.parent as "parent",
+          t.server_type as "serverType",
+          t.sflssj as "sflssj",
+          t.sfdbfx as "sfdbfx",
+          t.sfjl as "sfjl",
+          t.sfcx as "sfcx",
+          t.sftj as "sftj",
+          t.epsg as "epsg",
+          t.year as "year",
+          t.sjlx as "sjlx",
+          t.sde as "sde",
+          t.gltj as "gltj",
+          t.sjly as "sjly",
+          t.legend as "legend",
+        t.ywlx as "ywlx",
+        #{username} as "my",
+        #{username} as "favorite"
+       from T_YZT_ZYML t
+       where t.bsm in ((select distinct(my.zy_bsm) from T_YZT_ZYML_MY my where my.uhbm = #{username})) order by t.bsm
+    </select>
+    <select id="GetMyCollect4XZQH" parameterType="java.lang.String" resultType="com.siwei.apply.domain.cadastre.ZymlDTO">
+        select
+          0 as "count",
+           t.bsm as "bsm",
+          t.name as "name",
+           case when t.sde is null then t.type else to_char(dblayer.servicetype) end as "type",
+          t.pbsm as "pbsm",
+          t.icon as "icon",
+          case when t.sde is null then t.url else to_char(dblayer.address) end as "url",
+          t.lev as "lev",
+          t.sort as "sort",
+          t.state as "state",
+          t.parent as "parent",
+          t.server_type as "server_type",
+          t.sflssj as "sflssj",
+          t.sfdbfx as "sfdbfx",
+          t.sfjl as "sfjl",
+        t.geomfield as "geomfield",
+          t.sfcx as "sfcx",
+          t.sftj as "sftj",
+          t.epsg as "epsg",
+          t.year as "year",
+          t.sjlx as "sjlx",
+          t.sde as "sde",
+          t.gltj as "gltj",
+          t.sjly as "sjly",
+          t.legend as "legend",
+        t.ywlx as "ywlx",
+        #{username} as "my",
+          null as "fzbsm",
+          to_char(res.datetime ,'yyyy-MM-dd hh24:mi:ss') as "datetime",
+        (select usertable.nick_name from sys_user usertable where usertable.user_name = res.createperson) as "createperson"
+       from T_YZT_ZYML t  left join t_yzt_db_layer dblayer on dblayer.id = t.sde
+       left join tb_resourcehooktb res on res.name = replace(dblayer.source, 'SDE.','')
+       where t.bsm in ((select distinct(my.zy_bsm) from T_YZT_ZYML_MY my where my.uhbm = #{username}))
+       order by t.bsm
+    </select>
+    <select id="GetByBsms" parameterType="java.lang.String" resultType="com.siwei.apply.domain.cadastre.ZymlDTO">
+        select
+        0 as "count",
+        t.bsm as "bsm",
+        t.name as "name",
+        t.type as "type",
+        t.pbsm as "pbsm",
+        t.icon as "icon",
+        t.url as "url",
+        t.lev as "lev",
+        t.sort as "sort",
+        t.geomfield as "geomfield",
+        t.state as "state",
+        t.parent as "parent",
+        t.server_type as "server_type",
+        t.sflssj as "sflssj",
+        t.sfdbfx as "sfdbfx",
+        t.sfjl as "sfjl",
+        t.sfcx as "sfcx",
+        t.sftj as "sftj",
+        t.epsg as "epsg",
+        t.year as "year",
+        t.sjlx as "sjlx",
+        t.sde as "sde",
+        t.gltj as "gltj",
+        t.sjly as "sjly",
+        t.legend as "legend",
+        t.ywlx as "ywlx",
+        t.create_time as "create_time",
+        t.create_by as "create_by",
+        null as "my",
+        null as "fzbsm"
+        from T_YZT_ZYML t where t.bsm in
+        <foreach collection="array" item="bsm" open="(" separator="," close=")">
+            #{bsm}
+        </foreach>
+        order by t.bsm
+    </select>
+
+    <select id="GetByBsm" parameterType="java.lang.String" resultType="com.siwei.apply.domain.cadastre.ZymlDTO">
+        select
+        0 as "count",
+        t.bsm as "bsm",
+        t.name as "name",
+        t.pbsm as "pbs  m",
+        t.icon as "icon",
+        t.url as "url",
+        t.lev as "lev",
+        t.sort as "sort",
+        t.state as "state",
+        t.parent as "parent",
+        t.server_type as "serverType",
+        t.sflssj as "sflssj",
+        t.sfdbfx as "sfdbfx",
+        t.sfjl as "sfjl",
+        t.sfcx as "sfcx",
+        t.sftj as "sftj",
+        t.epsg as "epsg",
+        t.year as "year",
+        t.sjlx as "sjlx",
+        t.sde as "sde",
+        t.gltj as "gltj",
+        t.sjly as "sjly",
+        t.legend as "legend",
+        t.ywlx as "ywlx",
+        t.fwmc as "fwmc" ,
+        t.fwgzkj as "fwgzkj",
+        t.fwys as "fwys",
+        t.qpfa as "qpfa",
+        t.layergroup as "layergroup",
+        t.format as "format",
+        t.maximumlevel as "maximumlevel",
+        t.minimumlevel as "minimumlevel",
+        t.create_time as "create_time",
+        t.create_by as "create_by",
+        t.dataexplain as "dataexplain",
+        null as "my",
+        null as "fzbsm"
+        from T_YZT_ZYML t
+        where t.bsm = #{bsm}
+    </select>
+    <select id="GetAttrs" parameterType="java.lang.String" resultType="com.siwei.apply.domain.cadastre.ResourceAttrsDTO">
+      select t.sxmc as "sxmc",
+             t.sxbm as "sxbm",
+             t.sxlx as "sxlx",
+             t.xssx as "xssx",
+             t.sfcx as "sfcx",
+             t.sftj as "sftj",
+             t.dw as "dw",
+             t.zdcx as "zdcx" from T_YZT_ZYSX t where t.zy_bsm = #{bsm}
+    </select>
+
+    <select id="GetCollectCount" parameterType="com.siwei.apply.domain.cadastre.ZymlBsmDTO" resultType="java.lang.Integer">
+      select count(1) from T_YZT_ZYML_MY t where t.uhbm = #{username} and t.zy_bsm = #{bsm}
+    </select>
+
+    <delete id="DeleteCollect" parameterType="com.siwei.apply.domain.cadastre.ZymlBsmDTO">
+ 		delete from T_YZT_ZYML_MY t where t.uhbm = #{username} and t.zy_bsm = #{bsm}
+ 	</delete>
+
+    <insert id="AddCollect" parameterType="com.siwei.apply.domain.cadastre.ZymlBsmDTO">
+        insert into T_YZT_ZYML_MY (uhbm,zy_bsm) values(#{username},#{bsm})
+    </insert>
+
+    <select id="GetDbfxList" parameterType="java.lang.String" resultType="com.siwei.apply.domain.cadastre.DbfxResourceDTO">
+      select t.bsm as "bsm",
+       case when zy.sde is null then zy.type else to_char(dblayer.servicetype) end as "type",
+       case when zy.sde is null then zy.url else to_char(dblayer.address) end as "url",
+       t.name as "name",
+       t.zybsm "zybsm",
+       t.lxfz as "lxfz",
+       t.sort as "sort",
+       t.tjname as "tjname",
+       t.xzq as "xzq" ,
+       zy.server_type as "server_type",
+       zy.epsg as "epsg",
+       zy.year as "year",
+       zy.legend as "legend",
+       zy.ywlx as "ywlx",
+       ls.fzbsm as "fzbsm"
+       from T_YZT_DBFX t
+       left join t_yzt_zyml zy on zy.bsm = t.zybsm
+        left join t_yzt_db_layer dblayer on dblayer.id = zy.sde
+       left join T_YZT_ZYML_LSSJ ls on ls.zybsm = t.zybsm
+    </select>
+
+    <select id="GetLssjList" parameterType="java.lang.String" resultType="com.siwei.apply.domain.cadastre.DbfxLssjDTO">
+      select
+       t.fzbsm as "fzbsm",
+       t.zybsm as "zybsm",
+       zy.epsg as "epsg",
+       zy.type as "type",
+       zy.server_type as "server_type",
+       zy.year as "year",
+       zy.url as "url"
+       from T_YZT_ZYML_LSSJ t
+       left join t_yzt_zyml zy on zy.bsm = t.zybsm
+       where t.fzbsm = #{param}  order by zy.year desc
+    </select>
+
+    <select id="GetLegend" parameterType="java.lang.String" resultType="com.siwei.apply.domain.cadastre.ZymlLegendDTO">
+      select t.bsm as "bsm",
+       t.zybsm as "zybsm",
+       t.zymc as "zymc",
+       t.tldm as "tldm",
+       t.tlmc as "tlmc",
+       t.tllx as "tllx",
+       t.tlys as "tlys" from t_yzt_zyml_tl t where t.zybsm = #{zybsm} order by t.tldm
+    </select>
+
+    <select id="getXzqCode" parameterType="java.lang.String" resultType="java.lang.String">
+      SELECT FD_CODE FROM "TB_DICT_XZQHDM" WHERE  FD_NAME = #{deptName}
+    </select>
+
+    <select id="GetLegendAttr" parameterType="java.lang.String" resultType="java.util.Map">
+      select t.name "name",t.value "value" from bs_dic t where t.type = #{ywlx}
+    </select>
+</mapper>

+ 117 - 0
siwei-modules/siwei-system/src/main/java/com/siwei/system/controller/TYztZymlController.java

@@ -0,0 +1,117 @@
+package com.siwei.system.controller;
+
+//import com.onemap.common.core.utils.poi.ExcelUtil;
+//import com.onemap.common.core.web.controller.BaseController;
+//import com.onemap.common.core.web.domain.AjaxResult;
+//import com.onemap.common.log.annotation.Log;
+//import com.onemap.common.log.enums.BusinessType;
+//import com.onemap.system.api.domain.SysDictData;
+//import com.onemap.system.domain.TYztZyml;
+//import com.onemap.system.service.ITYztZymlService;
+import com.siwei.common.core.utils.poi.ExcelUtil;
+import com.siwei.common.core.web.controller.BaseController;
+import com.siwei.common.core.web.domain.AjaxResult;
+import com.siwei.common.log.annotation.Log;
+import com.siwei.common.log.enums.BusinessType;
+import com.siwei.system.api.domain.SysDictData;
+import com.siwei.system.domain.TYztZyml;
+import com.siwei.system.service.ITYztZymlService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 数据资源目录Controller
+ * 
+ * @author onemap
+ * @date 2022-12-01
+ */
+@RestController
+@RequestMapping("/zyml")
+public class TYztZymlController extends BaseController
+{
+    @Autowired
+    private ITYztZymlService tYztZymlService;
+
+    /**
+     * 查询数据资源目录列表
+     */
+//    @RequiresPermissions("system:zyml:list")
+    @GetMapping("/list")
+    public AjaxResult list(TYztZyml tYztZyml)
+    {
+        List<TYztZyml> list = tYztZymlService.selectTYztZymlList(tYztZyml);
+        return success(list);
+    }
+
+    /**
+     * 查询数据资源目录列表
+     */
+//    @RequiresPermissions("system:zyml:list")
+    @GetMapping("/getDbLayers")
+    public AjaxResult getDbLayers()
+    {
+        List<SysDictData> list = tYztZymlService.getDbLayers();
+        return success(list);
+    }
+
+    /**
+     * 导出数据资源目录列表
+     */
+//    @RequiresPermissions("system:zyml:export")
+    @Log(title = "数据资源目录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TYztZyml tYztZyml)
+    {
+        List<TYztZyml> list = tYztZymlService.selectTYztZymlList(tYztZyml);
+        ExcelUtil<TYztZyml> util = new ExcelUtil<TYztZyml>(TYztZyml.class);
+        util.exportExcel(response, list, "数据资源目录数据");
+    }
+
+    /**
+     * 获取数据资源目录详细信息
+     */
+//    @RequiresPermissions("system:zyml:query")
+    @GetMapping(value = "/{bsm}")
+    public AjaxResult getInfo(@PathVariable("bsm") String bsm)
+    {
+        return success(tYztZymlService.selectTYztZymlByBsm(bsm));
+    }
+
+    /**
+     * 新增数据资源目录
+     */
+//    @RequiresPermissions("system:zyml:add")
+    @Log(title = "数据资源目录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TYztZyml tYztZyml)
+    {
+
+        return toAjax(tYztZymlService.insertTYztZyml(tYztZyml));
+    }
+
+    /**
+     * 修改数据资源目录
+     */
+//    @RequiresPermissions("system:zyml:edit")
+    @Log(title = "数据资源目录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TYztZyml tYztZyml)
+    {
+
+        return toAjax(tYztZymlService.updateTYztZyml(tYztZyml));
+    }
+
+    /**
+     * 删除数据资源目录
+     */
+//    @RequiresPermissions("system:zyml:remove")
+    @Log(title = "数据资源目录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{bsms}")
+    public AjaxResult remove(@PathVariable String[] bsms)
+    {
+        return toAjax(tYztZymlService.deleteTYztZymlByBsms(bsms));
+    }
+}

+ 521 - 0
siwei-modules/siwei-system/src/main/java/com/siwei/system/domain/TYztZyml.java

@@ -0,0 +1,521 @@
+package com.siwei.system.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+//import com.onemap.common.core.annotation.Excel;
+//import com.onemap.common.core.web.domain.TreeEntity;
+import com.siwei.common.core.annotation.Excel;
+import com.siwei.common.core.web.domain.TreeEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 数据资源目录对象 t_yzt_zyml
+ *
+ * @author onemap
+ */
+public class TYztZyml extends TreeEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 标识码
+     */
+    @Excel(name = "标识码")
+    private String bsm;
+
+    /**
+     * 名称
+     */
+    @Excel(name = "名称")
+    private String name;
+
+    /**
+     * 类型(Point、Line、Polygon、WMTS)
+     */
+    @Excel(name = "类型(Point、Line、Polygon、WMTS)")
+    private String type;
+
+    /**
+     * 父标识码
+     */
+    @Excel(name = "父标识码")
+    private String pbsm;
+
+    /**
+     * 图标
+     */
+    @Excel(name = "图标")
+    private String icon;
+
+    /**
+     * URL
+     */
+    @Excel(name = "URL")
+    private String url;
+
+    /**
+     * 级别
+     */
+    @Excel(name = "级别")
+    private Long lev;
+
+    /**
+     * 排序
+     */
+    @Excel(name = "排序")
+    private Long sort;
+
+    /**
+     * 状态
+     */
+    @Excel(name = "状态")
+    private String state;
+
+    /**
+     * 是否父节点(0否 1是)
+     */
+    @Excel(name = "是否父节点(0否 1是)")
+    private String parent;
+
+    /**
+     * 服务器类型(arcgis geoserver)
+     */
+    @Excel(name = "服务器类型(arcgis geoserver)")
+    private String serverType;
+
+    /**
+     * 是否历史数据(0否 1是)
+     */
+    @Excel(name = "是否历史数据(0否 1是)")
+    private Long sflssj;
+
+    /**
+     * 是否对比分析(0否 1是)
+     */
+    @Excel(name = "是否对比分析(0否 1是)")
+    private Long sfdbfx;
+
+    /**
+     * 是否卷帘(0否 1是)
+     */
+    @Excel(name = "是否卷帘(0否 1是)")
+    private Long sfjl;
+
+    /**
+     * 是否查询(0否 1是)
+     */
+    @Excel(name = "是否查询(0否 1是)")
+    private Long sfcx;
+
+    /**
+     * 是否统计(0否 1是)
+     */
+    @Excel(name = "是否统计(0否 1是)")
+    private Long sftj;
+
+    /**
+     * 数据坐标系
+     */
+    @Excel(name = "数据坐标系")
+    private String epsg;
+
+    /**
+     * 数据年份
+     */
+    @Excel(name = "数据年份")
+    private String year;
+
+    /**
+     * 数据类型(point、line、polyon、img、pdf)
+     */
+    @Excel(name = "数据类型(point、line、polyon、img、pdf)")
+    private String sjlx;
+
+    /**
+     * SDE表
+     */
+    @Excel(name = "SDE表")
+    private String sde;
+
+    /**
+     * 过滤条件
+     */
+    @Excel(name = "过滤条件")
+    private String gltj;
+
+    /**
+     * 数据来源
+     */
+    @Excel(name = "数据来源")
+    private String sjly;
+
+    /**
+     * 图例
+     */
+    @Excel(name = "图例")
+    private String legend;
+
+    /**
+     * 业务类型
+     */
+    @Excel(name = "业务类型")
+    private String ywlx;
+
+    @Excel(name = "服务名称")
+    private String fwmc;
+    @Excel(name = "服务工作空间")
+    private String fwgzkj;
+    @Excel(name = "服务样式")
+    private String fwys;
+    @Excel(name = "切片方案")
+    private String qpfa;
+    @Excel(name = "图层组名称")
+    private String layergroup;
+    @Excel(name = "格式")
+    private String format;
+    @Excel(name = "最大层级")
+    private Integer maximumlevel;
+    @Excel(name = "最小层级")
+    private Integer minimumlevel;
+    @Excel(name = "创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+    @Excel(name = "创建人")
+    private String createBy;
+    @Excel(name = "共享状态")
+    private String sharestate;
+    @Excel(name = "数据说明")
+    private String dataexplain;
+    @Excel(name = "geom字段")
+    private String geomfield;
+
+    public String getGeomfield() {
+        return geomfield;
+    }
+
+    public void setGeomfield(String geomfield) {
+        this.geomfield = geomfield;
+    }
+
+    public String getYwlx() {
+        return ywlx;
+    }
+
+    public void setYwlx(String ywlx) {
+        this.ywlx = ywlx;
+    }
+
+    public void setBsm(String bsm) {
+        this.bsm = bsm;
+    }
+
+    public String getBsm() {
+        return bsm;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setPbsm(String pbsm) {
+        this.pbsm = pbsm;
+    }
+
+    public String getPbsm() {
+        return pbsm;
+    }
+
+    public void setIcon(String icon) {
+        this.icon = icon;
+    }
+
+    public String getIcon() {
+        return icon;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setLev(Long lev) {
+        this.lev = lev;
+    }
+
+    public Long getLev() {
+        return lev;
+    }
+
+    public void setSort(Long sort) {
+        this.sort = sort;
+    }
+
+    public Long getSort() {
+        return sort;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setParent(String parent) {
+        this.parent = parent;
+    }
+
+    public String getParent() {
+        return parent;
+    }
+
+    public void setServerType(String serverType) {
+        this.serverType = serverType;
+    }
+
+    public String getServerType() {
+        return serverType;
+    }
+
+    public void setSflssj(Long sflssj) {
+        this.sflssj = sflssj;
+    }
+
+    public Long getSflssj() {
+        return sflssj;
+    }
+
+    public void setSfdbfx(Long sfdbfx) {
+        this.sfdbfx = sfdbfx;
+    }
+
+    public Long getSfdbfx() {
+        return sfdbfx;
+    }
+
+    public void setSfjl(Long sfjl) {
+        this.sfjl = sfjl;
+    }
+
+    public Long getSfjl() {
+        return sfjl;
+    }
+
+    public void setSfcx(Long sfcx) {
+        this.sfcx = sfcx;
+    }
+
+    public Long getSfcx() {
+        return sfcx;
+    }
+
+    public void setSftj(Long sftj) {
+        this.sftj = sftj;
+    }
+
+    public Long getSftj() {
+        return sftj;
+    }
+
+    public void setEpsg(String epsg) {
+        this.epsg = epsg;
+    }
+
+    public String getEpsg() {
+        return epsg;
+    }
+
+    public void setYear(String year) {
+        this.year = year;
+    }
+
+    public String getYear() {
+        return year;
+    }
+
+    public void setSjlx(String sjlx) {
+        this.sjlx = sjlx;
+    }
+
+    public String getSjlx() {
+        return sjlx;
+    }
+
+    public void setSde(String sde) {
+        this.sde = sde;
+    }
+
+    public String getSde() {
+        return sde;
+    }
+
+    public void setGltj(String gltj) {
+        this.gltj = gltj;
+    }
+
+    public String getGltj() {
+        return gltj;
+    }
+
+    public void setSjly(String sjly) {
+        this.sjly = sjly;
+    }
+
+    public String getSjly() {
+        return sjly;
+    }
+
+    public void setLegend(String legend) {
+        this.legend = legend;
+    }
+
+    public String getLegend() {
+        return legend;
+    }
+
+    public String getFwmc() {
+        return fwmc;
+    }
+
+    public void setFwmc(String fwmc) {
+        this.fwmc = fwmc;
+    }
+
+    public String getFwgzkj() {
+        return fwgzkj;
+    }
+
+    public void setFwgzkj(String fwgzkj) {
+        this.fwgzkj = fwgzkj;
+    }
+
+    public String getFwys() {
+        return fwys;
+    }
+
+    public void setFwys(String fwys) {
+        this.fwys = fwys;
+    }
+
+    public String getQpfa() {
+        return qpfa;
+    }
+
+    public void setQpfa(String qpfa) {
+        this.qpfa = qpfa;
+    }
+
+    public String getLayergroup() {
+        return layergroup;
+    }
+
+    public void setLayergroup(String layergroup) {
+        this.layergroup = layergroup;
+    }
+
+    public String getFormat() {
+        return format;
+    }
+
+    public void setFormat(String format) {
+        this.format = format;
+    }
+
+    public Integer getMaximumlevel() {
+        return maximumlevel;
+    }
+
+    public void setMaximumlevel(Integer maximumlevel) {
+        this.maximumlevel = maximumlevel;
+    }
+
+    public Integer getMinimumlevel() {
+        return minimumlevel;
+    }
+
+    public void setMinimumlevel(Integer minimumlevel) {
+        this.minimumlevel = minimumlevel;
+    }
+
+    @Override
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    @Override
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    @Override
+    public String getCreateBy() {
+        return createBy;
+    }
+
+    @Override
+    public void setCreateBy(String createBy) {
+        this.createBy = createBy;
+    }
+
+    public String getSharestate() {
+        return sharestate;
+    }
+
+    public void setSharestate(String sharestate) {
+        this.sharestate = sharestate;
+    }
+
+    public String getDataexplain() {
+        return dataexplain;
+    }
+
+    public void setDataexplain(String dataexplain) {
+        this.dataexplain = dataexplain;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("bsm", getBsm())
+                .append("name", getName())
+                .append("type", getType())
+                .append("pbsm", getPbsm())
+                .append("icon", getIcon())
+                .append("url", getUrl())
+                .append("lev", getLev())
+                .append("sort", getSort())
+                .append("state", getState())
+                .append("parent", getParent())
+                .append("serverType", getServerType())
+                .append("sflssj", getSflssj())
+                .append("sfdbfx", getSfdbfx())
+                .append("sfjl", getSfjl())
+                .append("sfcx", getSfcx())
+                .append("sftj", getSftj())
+                .append("epsg", getEpsg())
+                .append("year", getYear())
+                .append("sjlx", getSjlx())
+                .append("sde", getSde())
+                .append("gltj", getGltj())
+                .append("sjly", getSjly())
+                .append("legend", getLegend())
+                .toString();
+    }
+}

+ 70 - 0
siwei-modules/siwei-system/src/main/java/com/siwei/system/mapper/TYztZymlMapper.java

@@ -0,0 +1,70 @@
+package com.siwei.system.mapper;
+
+//import com.onemap.system.api.domain.SysDictData;
+//import com.onemap.system.domain.TYztZyml;
+
+import com.siwei.system.api.domain.SysDictData;
+import com.siwei.system.domain.TYztZyml;
+
+import java.util.List;
+
+/**
+ * 数据资源目录Mapper接口
+ * 
+ * @author onemap
+ * @date 2022-12-01
+ */
+public interface TYztZymlMapper 
+{
+    /**
+     * 查询数据资源目录
+     * 
+     * @param bsm 数据资源目录主键
+     * @return 数据资源目录
+     */
+    public TYztZyml selectTYztZymlByBsm(String bsm);
+
+    /**
+     * 查询数据资源目录列表
+     * 
+     * @param tYztZyml 数据资源目录
+     * @return 数据资源目录集合
+     */
+    public List<TYztZyml> selectTYztZymlList(TYztZyml tYztZyml);
+
+    /**
+     * 新增数据资源目录
+     * 
+     * @param tYztZyml 数据资源目录
+     * @return 结果
+     */
+    public int insertTYztZyml(TYztZyml tYztZyml);
+
+    /**
+     * 修改数据资源目录
+     * 
+     * @param tYztZyml 数据资源目录
+     * @return 结果
+     */
+    public int updateTYztZyml(TYztZyml tYztZyml);
+
+    /**
+     * 删除数据资源目录
+     * 
+     * @param bsm 数据资源目录主键
+     * @return 结果
+     */
+    public int deleteTYztZymlByBsm(String bsm);
+
+    /**
+     * 批量删除数据资源目录
+     * 
+     * @param bsms 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTYztZymlByBsms(String[] bsms);
+
+    List<SysDictData> getDbLayers();
+
+    String getDbLayerName(String dblayer);
+}

+ 68 - 0
siwei-modules/siwei-system/src/main/java/com/siwei/system/service/ITYztZymlService.java

@@ -0,0 +1,68 @@
+package com.siwei.system.service;
+
+//import com.onemap.system.api.domain.SysDictData;
+//import com.onemap.system.domain.TYztZyml;
+
+import com.siwei.system.api.domain.SysDictData;
+import com.siwei.system.domain.TYztZyml;
+
+import java.util.List;
+
+/**
+ * 数据资源目录Service接口
+ * 
+ * @author onemap
+ * @date 2022-12-01
+ */
+public interface ITYztZymlService 
+{
+    /**
+     * 查询数据资源目录
+     * 
+     * @param bsm 数据资源目录主键
+     * @return 数据资源目录
+     */
+    public TYztZyml selectTYztZymlByBsm(String bsm);
+
+    /**
+     * 查询数据资源目录列表
+     * 
+     * @param tYztZyml 数据资源目录
+     * @return 数据资源目录集合
+     */
+    public List<TYztZyml> selectTYztZymlList(TYztZyml tYztZyml);
+
+    /**
+     * 新增数据资源目录
+     * 
+     * @param tYztZyml 数据资源目录
+     * @return 结果
+     */
+    public int insertTYztZyml(TYztZyml tYztZyml);
+
+    /**
+     * 修改数据资源目录
+     * 
+     * @param tYztZyml 数据资源目录
+     * @return 结果
+     */
+    public int updateTYztZyml(TYztZyml tYztZyml);
+
+    /**
+     * 批量删除数据资源目录
+     * 
+     * @param bsms 需要删除的数据资源目录主键集合
+     * @return 结果
+     */
+    public int deleteTYztZymlByBsms(String[] bsms);
+
+    /**
+     * 删除数据资源目录信息
+     * 
+     * @param bsm 数据资源目录主键
+     * @return 结果
+     */
+    public int deleteTYztZymlByBsm(String bsm);
+
+    List<SysDictData> getDbLayers();
+}

+ 137 - 0
siwei-modules/siwei-system/src/main/java/com/siwei/system/service/impl/TYztZymlServiceImpl.java

@@ -0,0 +1,137 @@
+package com.siwei.system.service.impl;
+
+//import com.onemap.common.core.utils.StringUtils;
+//import com.onemap.common.security.utils.SecurityUtils;
+//import com.onemap.system.api.domain.SysDictData;
+//import com.onemap.system.domain.TYztZyml;
+//import com.onemap.system.mapper.TYztZymlMapper;
+//import com.onemap.system.service.ITYztZymlService;
+import com.siwei.common.core.utils.StringUtils;
+import com.siwei.common.security.utils.SecurityUtils;
+import com.siwei.system.api.domain.SysDictData;
+import com.siwei.system.domain.TYztZyml;
+import com.siwei.system.mapper.TYztZymlMapper;
+import com.siwei.system.service.ITYztZymlService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 数据资源目录Service业务层处理
+ *
+ * @author onemap
+ * @date 2022-12-01
+ */
+@Service
+public class TYztZymlServiceImpl implements ITYztZymlService {
+
+    @Resource
+    private TYztZymlMapper tYztZymlMapper;
+
+    /**
+     * 查询数据资源目录
+     *
+     * @param bsm 数据资源目录主键
+     * @return 数据资源目录
+     */
+    @Override
+    public TYztZyml selectTYztZymlByBsm(String bsm) {
+        return tYztZymlMapper.selectTYztZymlByBsm(bsm);
+    }
+
+    /**
+     * 查询数据资源目录列表
+     *
+     * @param tYztZyml 数据资源目录
+     * @return 数据资源目录
+     */
+    @Override
+    public List<TYztZyml> selectTYztZymlList(TYztZyml tYztZyml) {
+        return tYztZymlMapper.selectTYztZymlList(tYztZyml);
+    }
+
+    /**
+     * 新增数据资源目录
+     *
+     * @param tYztZyml 数据资源目录
+     * @return 结果
+     */
+    @Override
+    public int insertTYztZyml(TYztZyml tYztZyml) {
+        tYztZyml = filterZymlPbsm(tYztZyml);
+        tYztZyml.setCreateTime(new Date());
+        tYztZyml.setCreateBy(SecurityUtils.getUsername());
+        //判断不为空
+        if (!StringUtils.isEmpty(tYztZyml.getSde())) {
+            String[] dblayers = tYztZyml.getSde().split(",");
+            if (dblayers.length == 1) {
+                tYztZyml.setBsm(StringUtils.getUUID());
+                tYztZyml.setSde(dblayers[0]);
+                tYztZymlMapper.insertTYztZyml(tYztZyml);
+            } else {
+                for (int i = 0; i < dblayers.length; i++) {
+                    tYztZyml.setBsm(StringUtils.getUUID());
+                    tYztZyml.setSde(dblayers[i]);
+                    tYztZyml.setName(tYztZymlMapper.getDbLayerName(dblayers[i]));
+                    tYztZymlMapper.insertTYztZyml(tYztZyml);
+                }
+            }
+            return dblayers.length;
+        } else {
+            tYztZyml.setBsm(StringUtils.getUUID());
+            return tYztZymlMapper.insertTYztZyml(tYztZyml);
+        }
+    }
+
+    /**
+     * 修改数据资源目录
+     *
+     * @param tYztZyml 数据资源目录
+     * @return 结果
+     */
+    @Override
+    public int updateTYztZyml(TYztZyml tYztZyml) {
+        tYztZyml = filterZymlPbsm(tYztZyml);
+        if (StringUtils.isEmpty(tYztZyml.getBsm())) {
+            return insertTYztZyml(tYztZyml);
+        } else {
+            return tYztZymlMapper.updateTYztZyml(tYztZyml);
+        }
+    }
+
+    /**
+     * 批量删除数据资源目录
+     *
+     * @param bsms 需要删除的数据资源目录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTYztZymlByBsms(String[] bsms) {
+        return tYztZymlMapper.deleteTYztZymlByBsms(bsms);
+    }
+
+    /**
+     * 删除数据资源目录信息
+     *
+     * @param bsm 数据资源目录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTYztZymlByBsm(String bsm) {
+        return tYztZymlMapper.deleteTYztZymlByBsm(bsm);
+    }
+
+    @Override
+    public List<SysDictData> getDbLayers() {
+        return tYztZymlMapper.getDbLayers();
+    }
+
+    public TYztZyml filterZymlPbsm(TYztZyml tYztZyml) {
+        if ("0".equals(tYztZyml.getPbsm())) {
+            tYztZyml.setPbsm("");
+        }
+        return tYztZyml;
+    }
+}

+ 243 - 0
siwei-modules/siwei-system/src/main/resources/mapper/postgresql/system/TYztZymlMapper.xml

@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.siwei.system.mapper.TYztZymlMapper">
+
+    <resultMap type="com.siwei.system.domain.TYztZyml" id="TYztZymlResult">
+        <result property="bsm" column="bsm"/>
+        <result property="name" column="name"/>
+        <result property="type" column="type"/>
+        <result property="pbsm" column="pbsm"/>
+        <result property="icon" column="icon"/>
+        <result property="url" column="url"/>
+        <result property="lev" column="lev"/>
+        <result property="sort" column="sort"/>
+        <result property="state" column="state"/>
+        <result property="parent" column="parent"/>
+        <result property="serverType" column="server_type"/>
+        <result property="sflssj" column="sflssj"/>
+        <result property="sfdbfx" column="sfdbfx"/>
+        <result property="sfjl" column="sfjl"/>
+        <result property="sfcx" column="sfcx"/>
+        <result property="sftj" column="sftj"/>
+        <result property="epsg" column="epsg"/>
+        <result property="year" column="year"/>
+        <result property="sjlx" column="sjlx"/>
+        <result property="sde" column="sde"/>
+        <result property="gltj" column="gltj"/>
+        <result property="sjly" column="sjly"/>
+        <result property="legend" column="legend"/>
+        <result property="ywlx" column="ywlx"/>
+        <result property="fwmc" column="fwmc"/>
+        <result property="fwgzkj" column="fwgzkj"/>
+        <result property="fwys" column="fwys"/>
+        <result property="qpfa" column="qpfa"/>
+        <result property="layergroup" column="layergroup"/>
+        <result property="format" column="format"/>
+        <result property="maximumlevel" column="maximumlevel"/>
+        <result property="minimumlevel" column="minimumlevel"/>
+        <result property="createTime" column="create_time"/>
+        <result property="createBy" column="create_by"/>
+        <result property="sharestate" column="sharestate"/>
+        <result property="dataexplain" column="dataexplain"/>
+        <result property="geomfield" column="geomfield"/>
+    </resultMap>
+
+    <sql id="selectTYztZymlVo">
+        select bsm, name, type, pbsm, icon, url, lev, sort, state, parent, server_type, sflssj, sfdbfx, sfjl, sfcx, sftj, epsg,
+            year, sjlx, sde, gltj, sjly, legend, ywlx,dataexplain,geomfield,
+            fwmc,fwgzkj,fwys,qpfa,layergroup,format,maximumlevel,minimumlevel,create_time,create_by,sharestate from t_yzt_zyml
+    </sql>
+
+    <select id="getDbLayersMSN" parameterType="java.lang.String" resultType="com.siwei.system.api.domain.SysDictData">
+        SELECT t.id as "dict_value", t.layeralias as "dict_label",'dblayers' as "dict_type"
+        from T_YZT_DB_LAYER t
+                 left join t_yzt_zyml ml
+                           on ml.sde = t.id
+        where ml.sde is null
+    </select>
+
+    <select id="getDbLayers" parameterType="java.lang.String" resultType="com.siwei.system.api.domain.SysDictData">
+        SELECT t.id as "dict_value", t.layeralias as "dict_label",'dblayers' as "dict_type", t.source as "remark"
+        from T_YZT_DB_LAYER t
+    </select>
+
+
+    <select id="getDbLayerName" parameterType="java.lang.String" resultType="java.lang.String">
+        SELECT t.layeralias
+        from T_YZT_DB_LAYER t where id = #{dblayer}
+    </select>
+
+    <select id="selectTYztZymlList" parameterType="com.siwei.system.domain.TYztZyml" resultMap="TYztZymlResult">
+        <include refid="selectTYztZymlVo"/>
+        <where>
+            <if test="bsm != null  and bsm != ''">and bsm = #{bsm}</if>
+            <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
+            <if test="type != null  and type != ''">and type = #{type}</if>
+            <if test="pbsm != null  and pbsm != ''">and pbsm = #{pbsm}</if>
+            <if test="icon != null  and icon != ''">and icon = #{icon}</if>
+            <if test="url != null  and url != ''">and url = #{url}</if>
+            <if test="lev != null ">and lev = #{lev}</if>
+            <if test="sort != null ">and sort = #{sort}</if>
+            <if test="state != null ">and state = #{state}</if>
+            <if test="parent != null ">and parent = #{parent}</if>
+            <if test="serverType != null  and serverType != ''">and server_type = #{serverType}</if>
+            <if test="sflssj != null ">and sflssj = #{sflssj}</if>
+            <if test="sfdbfx != null ">and sfdbfx = #{sfdbfx}</if>
+            <if test="sfjl != null ">and sfjl = #{sfjl}</if>
+            <if test="sfcx != null ">and sfcx = #{sfcx}</if>
+            <if test="sftj != null ">and sftj = #{sftj}</if>
+            <if test="epsg != null  and epsg != ''">and epsg = #{epsg}</if>
+            <if test="year != null  and year != ''">and year = #{year}</if>
+            <if test="sjlx != null  and sjlx != ''">and sjlx = #{sjlx}</if>
+            <if test="sde != null  and sde != ''">and sde = #{sde}</if>
+            <if test="gltj != null  and gltj != ''">and gltj = #{gltj}</if>
+            <if test="sjly != null  and sjly != ''">and sjly = #{sjly}</if>
+            <if test="legend != null  and legend != ''">and legend = #{legend}</if>
+            <if test="ywlx != null  and ywlx != ''">and ywlx = #{ywlx}</if>
+            <if test="sharestate != null  and sharestate != ''">and sharestate = #{sharestate}</if>
+            <if test="geomfield != null  and geomfield != ''">and geomfield = #{geomfield}</if>
+        </where>
+        order by sort
+    </select>
+
+    <select id="selectTYztZymlByBsm" parameterType="String" resultMap="TYztZymlResult">
+        <include refid="selectTYztZymlVo"/>
+        where bsm = #{bsm}
+    </select>
+
+    <insert id="insertTYztZyml" parameterType="com.siwei.system.domain.TYztZyml">
+        insert into t_yzt_zyml
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="bsm != null and bsm != ''">bsm,</if>
+            <if test="name != null">name,</if>
+            <if test="type != null">type,</if>
+            <if test="pbsm != null">pbsm,</if>
+            <if test="icon != null">icon,</if>
+            <if test="url != null">url,</if>
+            <if test="lev != null">lev,</if>
+            <if test="sort != null">sort,</if>
+            <if test="state != null">state,</if>
+            <if test="parent != null">parent,</if>
+            <if test="serverType != null">server_type,</if>
+            <if test="sflssj != null">sflssj,</if>
+            <if test="sfdbfx != null">sfdbfx,</if>
+            <if test="sfjl != null">sfjl,</if>
+            <if test="sfcx != null">sfcx,</if>
+            <if test="sftj != null">sftj,</if>
+            <if test="epsg != null">epsg,</if>
+            <if test="year != null">year,</if>
+            <if test="sjlx != null">sjlx,</if>
+            <if test="sde != null">sde,</if>
+            <if test="gltj != null">gltj,</if>
+            <if test="sjly != null">sjly,</if>
+            <if test="legend != null">legend,</if>
+            <if test="ywlx != null">ywlx,</if>
+            <if test="fwmc != null">fwmc,</if>
+            <if test="fwgzkj != null">fwgzkj,</if>
+            <if test="fwys != null">fwys,</if>
+            <if test="qpfa != null">qpfa,</if>
+            <if test="layergroup != null">layergroup,</if>
+            <if test="format != null">format,</if>
+            <if test="maximumlevel != null">maximumlevel,</if>
+            <if test="minimumlevel != null">minimumlevel,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="sharestate != null">sharestate,</if>
+            <if test="dataexplain != null">dataexplain,</if>
+            <if test="geomfield != null">geomfield,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="bsm != null and bsm != ''">#{bsm},</if>
+            <if test="name != null">#{name},</if>
+            <if test="type != null">#{type},</if>
+            <if test="pbsm != null">#{pbsm},</if>
+            <if test="icon != null">#{icon},</if>
+            <if test="url != null">#{url},</if>
+            <if test="lev != null">#{lev},</if>
+            <if test="sort != null">#{sort},</if>
+            <if test="state != null">#{state},</if>
+            <if test="parent != null">#{parent},</if>
+            <if test="serverType != null">#{serverType},</if>
+            <if test="sflssj != null">#{sflssj},</if>
+            <if test="sfdbfx != null">#{sfdbfx},</if>
+            <if test="sfjl != null">#{sfjl},</if>
+            <if test="sfcx != null">#{sfcx},</if>
+            <if test="sftj != null">#{sftj},</if>
+            <if test="epsg != null">#{epsg},</if>
+            <if test="year != null">#{year},</if>
+            <if test="sjlx != null">#{sjlx},</if>
+            <if test="sde != null">#{sde},</if>
+            <if test="gltj != null">#{gltj},</if>
+            <if test="sjly != null">#{sjly},</if>
+            <if test="legend != null">#{legend},</if>
+            <if test="ywlx != null">#{ywlx},</if>
+            <if test="fwmc != null">#{fwmc},</if>
+            <if test="fwgzkj != null">#{fwgzkj},</if>
+            <if test="fwys != null">#{fwys},</if>
+            <if test="qpfa != null">#{qpfa},</if>
+            <if test="layergroup != null">#{layergroup},</if>
+            <if test="format != null">#{format},</if>
+            <if test="maximumlevel != null">#{maximumlevel},</if>
+            <if test="minimumlevel != null">#{minimumlevel},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="sharestate != null">#{sharestate},</if>
+            <if test="dataexplain != null">#{dataexplain},</if>
+            <if test="geomfield != null">#{geomfield},</if>
+        </trim>
+    </insert>
+
+    <update id="updateTYztZyml" parameterType="com.siwei.system.domain.TYztZyml">
+        update t_yzt_zyml
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="name != null">name = #{name},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="pbsm != null">pbsm = #{pbsm},</if>
+            <if test="icon != null">icon = #{icon},</if>
+            <if test="url != null">url = #{url},</if>
+            <if test="lev != null">lev = #{lev},</if>
+            <if test="sort != null">sort = #{sort},</if>
+            <if test="state != null">state = #{state},</if>
+            <if test="parent != null">parent = #{parent},</if>
+            <if test="serverType != null">server_type = #{serverType},</if>
+            <if test="sflssj != null">sflssj = #{sflssj},</if>
+            <if test="sfdbfx != null">sfdbfx = #{sfdbfx},</if>
+            <if test="sfjl != null">sfjl = #{sfjl},</if>
+            <if test="sfcx != null">sfcx = #{sfcx},</if>
+            <if test="sftj != null">sftj = #{sftj},</if>
+            <if test="epsg != null">epsg = #{epsg},</if>
+            <if test="year != null">year = #{year},</if>
+            <if test="sjlx != null">sjlx = #{sjlx},</if>
+            <if test="sde != null">sde = #{sde},</if>
+            <if test="gltj != null">gltj = #{gltj},</if>
+            <if test="sjly != null">sjly = #{sjly},</if>
+            <if test="legend != null">legend = #{legend},</if>
+            <if test="ywlx != null">ywlx = #{ywlx},</if>
+            <if test="fwmc != null">fwmc = #{fwmc},</if>
+            <if test="fwgzkj != null">fwgzkj = #{fwgzkj},</if>
+            <if test="fwys != null">fwys = #{fwys},</if>
+            <if test="qpfa != null">qpfa = #{qpfa},</if>
+            <if test="layergroup != null">layergroup = #{layergroup},</if>
+            <if test="format != null">format = #{format},</if>
+            <if test="maximumlevel != null">maximumlevel = #{maximumlevel},</if>
+            <if test="minimumlevel != null">minimumlevel = #{minimumlevel},</if>
+            <if test="sharestate != null">sharestate = #{sharestate},</if>
+            <if test="dataexplain != null">dataexplain=#{dataexplain},</if>
+            <if test="geomfield != null">geomfield=#{geomfield},</if>
+        </trim>
+        where bsm = #{bsm}
+    </update>
+
+    <delete id="deleteTYztZymlByBsm" parameterType="String">
+        delete from t_yzt_zyml where bsm = #{bsm}
+    </delete>
+
+    <delete id="deleteTYztZymlByBsms" parameterType="String">
+        delete from t_yzt_zyml where bsm in
+        <foreach item="bsm" collection="array" open="(" separator="," close=")">
+            #{bsm}
+        </foreach>
+    </delete>
+</mapper>