wanger 1 rok pred
rodič
commit
64d4067f5b
18 zmenil súbory, kde vykonal 1074 pridanie a 41 odobranie
  1. 2 2
      onemap-common/onemap-common-core/src/main/java/com/onemap/common/core/utils/UnPackageUtils.java
  2. 15 0
      onemap-modules/onemap-api/src/main/java/com/onemap/api/controller/ResultSearchController.java
  3. 13 0
      onemap-modules/onemap-api/src/main/java/com/onemap/api/controller/ResultsController.java
  4. 266 0
      onemap-modules/onemap-api/src/main/java/com/onemap/api/domain/EscalationDTO.java
  5. 70 0
      onemap-modules/onemap-api/src/main/java/com/onemap/api/domain/EscalationFileDTO.java
  6. 107 0
      onemap-modules/onemap-api/src/main/java/com/onemap/api/domain/TCgglSjbzmlwjDto.java
  7. 205 0
      onemap-modules/onemap-api/src/main/java/com/onemap/api/domain/XzczghcgsbDTO.java
  8. 14 0
      onemap-modules/onemap-api/src/main/java/com/onemap/api/mapper/EscalationFileMapper.java
  9. 14 0
      onemap-modules/onemap-api/src/main/java/com/onemap/api/mapper/EscalationMapper.java
  10. 14 0
      onemap-modules/onemap-api/src/main/java/com/onemap/api/mapper/TCgglSjbzmlwjMapper.java
  11. 14 0
      onemap-modules/onemap-api/src/main/java/com/onemap/api/mapper/XzczghcgsbMapper.java
  12. 2 0
      onemap-modules/onemap-api/src/main/java/com/onemap/api/service/ResultSearchService.java
  13. 24 0
      onemap-modules/onemap-api/src/main/java/com/onemap/api/service/impl/ResultSearchServiceImpl.java
  14. 215 3
      onemap-modules/onemap-api/src/main/java/com/onemap/api/service/impl/ResultsServiceImpl.java
  15. 3 2
      onemap-modules/onemap-api/src/main/java/com/onemap/api/service/impl/ZhxzServiceImpl.java
  16. 17 29
      onemap-modules/onemap-api/src/main/java/com/onemap/api/util/Md5Utils.java
  17. 4 2
      onemap-modules/onemap-api/src/main/java/com/onemap/api/util/RInterfaceUtil.java
  18. 75 3
      onemap-modules/onemap-api/src/main/java/com/onemap/api/util/utils.java

+ 2 - 2
onemap-common/onemap-common-core/src/main/java/com/onemap/common/core/utils/UnPackageUtils.java

@@ -8,8 +8,8 @@ import java.io.File;
 import java.io.FileOutputStream;
 
 /**
- * @author : wangping
- * @createDate: 2021/7/12
+ * @author : wanger
+ * @createDate: 2025/2/18
  * @description:解压缩工具
  **/
 

+ 15 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/controller/ResultSearchController.java

@@ -74,4 +74,19 @@ public class ResultSearchController extends BaseController {
         return resultSearchService.downloadReoprt(id, solid, response);
     }
 
+    /**
+     * 查询修编待办成果列表
+     *
+     * @param ghlx         规划类型(总体规划、专项规划、乡镇规划、村庄规划、详细规划)
+     * @param current      页码,1为第一页
+     * @param size         页数量, 例:10表示单页显示10条数据
+     * @param divisionCode 行政区域代码
+     * @param subject      标题
+     * @return
+     */
+    @GetMapping("/landGetRevisePage")
+    public RequestResult landGetRevisePage(String ghlx, Integer current, Integer size, String divisionCode, String subject) {
+        return resultSearchService.landGetRevisePage(ghlx, current, size, divisionCode, subject);
+    }
+
 }

+ 13 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/controller/ResultsController.java

@@ -49,6 +49,19 @@ public class ResultsController extends BaseController {
         return ResultsService.upload(md5, chunk, file);
     }
 
+    /**
+     * 分片上传成果包  村庄规划
+     *
+     * @param md5
+     * @param chunk
+     * @param file
+     * @return
+     */
+    @PostMapping("/villageupload")
+    public RequestResult villageupload(String md5, Integer chunk, MultipartFile file) {
+        return ResultsService.upload(md5, chunk, file);
+    }
+
     /**
      * 合包并提交成果
      *

+ 266 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/domain/EscalationDTO.java

@@ -0,0 +1,266 @@
+package com.onemap.api.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+@TableName("t_cggl_escalation")
+public class EscalationDTO {
+    private String id;
+    private String name;
+    private String year;
+    private String xzqdm;
+    private String xzqmc;
+    private String uploadstatus;
+    private String plantype;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date uploadtime;
+    private String cglevel;
+    private String remark;
+    private String fileid;
+    private String bpdw;
+    private String lxr;
+    private String lxdh;
+    private String username;
+    private String instid;
+    private String scmodel;
+
+    public String getScmodel() {
+        return scmodel;
+    }
+
+    public void setScmodel(String scmodel) {
+        this.scmodel = scmodel;
+    }
+
+    public String getInstid() {
+        return instid;
+    }
+
+    public void setInstid(String instid) {
+        this.instid = instid;
+    }
+
+    /**
+     * 审查状态(审查状态  默认0待审(旗县)、1审查中(旗县)、2完结(旗县)、3退回(旗县)、4待审(市级)、5审查中(市级)、6完结(市级)、7退回(市级) )
+     */
+    private String sczt="0";
+    private String scresult;
+    private String scr;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date sctime;
+
+    private String gdbpath;
+
+    /**
+     * 旗县审查状态(审查状态  默认0 待审  1 审查中 2 完结 3退回 )
+     */
+    private String qxscresult;
+    private String qxscr;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date qxsctime;
+
+    private String qxgdbpath;
+
+    public String getQxscresult() {
+        return qxscresult;
+    }
+
+    public void setQxscresult(String qxscresult) {
+        this.qxscresult = qxscresult;
+    }
+
+    public String getQxscr() {
+        return qxscr;
+    }
+
+    public void setQxscr(String qxscr) {
+        this.qxscr = qxscr;
+    }
+
+    public Date getQxsctime() {
+        return qxsctime;
+    }
+
+    public void setQxsctime(Date qxsctime) {
+        this.qxsctime = qxsctime;
+    }
+
+    public String getQxgdbpath() {
+        return qxgdbpath;
+    }
+
+    public void setQxgdbpath(String qxgdbpath) {
+        this.qxgdbpath = qxgdbpath;
+    }
+
+    public String getScresult() {
+        return scresult;
+    }
+
+    public void setScresult(String scresult) {
+        this.scresult = scresult;
+    }
+
+    public String getScr() {
+        return scr;
+    }
+
+    public void setScr(String scr) {
+        this.scr = scr;
+    }
+
+    public Date getSctime() {
+        return sctime;
+    }
+
+    public void setSctime(Date sctime) {
+        this.sctime = sctime;
+    }
+
+    public String getGdbpath() {
+        return gdbpath;
+    }
+
+    public void setGdbpath(String gdbpath) {
+        this.gdbpath = gdbpath;
+    }
+
+
+
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getYear() {
+        return year;
+    }
+
+    public void setYear(String year) {
+        this.year = year;
+    }
+
+    public String getXzqdm() {
+        return xzqdm;
+    }
+
+    public void setXzqdm(String xzqdm) {
+        this.xzqdm = xzqdm;
+    }
+
+    public String getXzqmc() {
+        return xzqmc;
+    }
+
+    public void setXzqmc(String xzqmc) {
+        this.xzqmc = xzqmc;
+    }
+
+    public String getUploadstatus() {
+        return uploadstatus;
+    }
+
+    public void setUploadstatus(String uploadstatus) {
+        this.uploadstatus = uploadstatus;
+    }
+
+    public String getPlantype() {
+        return plantype;
+    }
+
+    public void setPlantype(String plantype) {
+        this.plantype = plantype;
+    }
+
+    public Date getUploadtime() {
+        return uploadtime;
+    }
+
+    public void setUploadtime(Date uploadtime) {
+        this.uploadtime = uploadtime;
+    }
+
+    public String getCglevel() {
+        return cglevel;
+    }
+
+    public void setCglevel(String cglevel) {
+        this.cglevel = cglevel;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getFileid() {
+        return fileid;
+    }
+
+    public void setFileid(String fileid) {
+        this.fileid = fileid;
+    }
+
+    public String getBpdw() {
+        return bpdw;
+    }
+
+    public void setBpdw(String bpdw) {
+        this.bpdw = bpdw;
+    }
+
+    public String getLxr() {
+        return lxr;
+    }
+
+    public void setLxr(String lxr) {
+        this.lxr = lxr;
+    }
+
+    public String getLxdh() {
+        return lxdh;
+    }
+
+    public void setLxdh(String lxdh) {
+        this.lxdh = lxdh;
+    }
+
+    public String getSczt() {
+        return sczt;
+    }
+
+    public void setSczt(String sczt) {
+        this.sczt = sczt;
+    }
+}

+ 70 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/domain/EscalationFileDTO.java

@@ -0,0 +1,70 @@
+package com.onemap.api.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+@TableName("t_cggl_escalation_file")
+public class EscalationFileDTO {
+    private String id;
+    private String name;
+    private String path;
+    private String remark;
+    private String status;
+    private String username;
+    private String unzippath;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    public String getUnzippath() {
+        return unzippath;
+    }
+
+    public void setUnzippath(String unzippath) {
+        this.unzippath = unzippath;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+}

+ 107 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/domain/TCgglSjbzmlwjDto.java

@@ -0,0 +1,107 @@
+package com.onemap.api.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+//数据标准目录文件
+@TableName("t_cggl_sjbzmlwj")
+public class TCgglSjbzmlwjDto {
+    private String bsm;
+    private String mlmc;
+    private String sjml;
+    private String gml;
+    private String gzmc;
+    private String wjgz_bsm;
+    private Integer px;
+    private String bz;
+    private String sjbz_bsm;
+    private Integer lx;
+    private String ystj;
+
+    public String getBsm() {
+        return bsm;
+    }
+
+    public void setBsm(String bsm) {
+        this.bsm = bsm;
+    }
+
+    public String getMlmc() {
+        return mlmc;
+    }
+
+    public void setMlmc(String mlmc) {
+        this.mlmc = mlmc;
+    }
+
+    public String getSjml() {
+        return sjml;
+    }
+
+    public void setSjml(String sjml) {
+        this.sjml = sjml;
+    }
+
+    public String getGml() {
+        return gml;
+    }
+
+    public void setGml(String gml) {
+        this.gml = gml;
+    }
+
+    public String getGzmc() {
+        return gzmc;
+    }
+
+    public void setGzmc(String gzmc) {
+        this.gzmc = gzmc;
+    }
+
+    public String getWjgz_bsm() {
+        return wjgz_bsm;
+    }
+
+    public void setWjgz_bsm(String wjgz_bsm) {
+        this.wjgz_bsm = wjgz_bsm;
+    }
+
+    public Integer getPx() {
+        return px;
+    }
+
+    public void setPx(Integer px) {
+        this.px = px;
+    }
+
+    public String getBz() {
+        return bz;
+    }
+
+    public void setBz(String bz) {
+        this.bz = bz;
+    }
+
+    public String getSjbz_bsm() {
+        return sjbz_bsm;
+    }
+
+    public void setSjbz_bsm(String sjbz_bsm) {
+        this.sjbz_bsm = sjbz_bsm;
+    }
+
+    public Integer getLx() {
+        return lx;
+    }
+
+    public void setLx(Integer lx) {
+        this.lx = lx;
+    }
+
+    public String getYstj() {
+        return ystj;
+    }
+
+    public void setYstj(String ystj) {
+        this.ystj = ystj;
+    }
+}

+ 205 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/domain/XzczghcgsbDTO.java

@@ -0,0 +1,205 @@
+package com.onemap.api.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+@TableName("t_xzczghcgsb")
+public class XzczghcgsbDTO {
+    private String uuid;
+    //任务ID
+    @TableField(value = "task_id")
+    private String taskId;
+
+    //上传状态
+    @TableField(value = "upload_status")
+    private int uploadStatus;
+    //上传时间
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField(value = "upload_time")
+    private Date uploadTime;
+    //文件路径
+    @TableField(value = "file_path")
+    private String filePath;
+    //文件名称
+    @TableField(value = "file_name")
+    private String fileName;
+    //文件名称
+    @TableField(value = "msg")
+    private String msg;
+    //上报状态
+    private String status;
+    //上报等级
+    private String cglevel;
+    //旗县行政区名称
+    private String county;
+    //乡镇行政区名称
+    private String town;
+    //村行政区名称
+    private String village;
+    //行政区名称
+    @TableField(value = "xzq_name")
+    private String xzqName;
+    //行政区代码
+    @TableField(value = "xzq_code")
+    private String xzqCode;
+    //年份
+    @TableField(value = "year")
+    private String year;
+    //流程主键(补正流程需要)对接自治区补正流程
+    @TableField(value = "instid")
+    private String instid;
+    private String bz;
+
+    public String getBz() {
+        return bz;
+    }
+
+    public void setBz(String bz) {
+        this.bz = bz;
+    }
+
+    public String getInstid() {
+        return instid;
+    }
+
+    public void setInstid(String instid) {
+        this.instid = instid;
+    }
+
+    public String getCglevel() {
+        return cglevel;
+    }
+
+    public void setCglevel(String cglevel) {
+        this.cglevel = cglevel;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getUuid() {
+        return uuid;
+    }
+
+    public void setUuid(String uuid) {
+        this.uuid = uuid;
+    }
+
+    public String getTaskId() {
+        return taskId;
+    }
+
+    public void setTaskId(String taskId) {
+        this.taskId = taskId;
+    }
+
+    public int getUploadStatus() {
+        return uploadStatus;
+    }
+
+    public void setUploadStatus(int uploadStatus) {
+        this.uploadStatus = uploadStatus;
+    }
+
+    public Date getUploadTime() {
+        return uploadTime;
+    }
+
+    public void setUploadTime(Date uploadTime) {
+        this.uploadTime = uploadTime;
+    }
+
+    public String getFilePath() {
+        return filePath;
+    }
+
+    public void setFilePath(String filePath) {
+        this.filePath = filePath;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public String getCounty() {
+        return county;
+    }
+
+    public void setCounty(String county) {
+        this.county = county;
+    }
+
+    public String getTown() {
+        return town;
+    }
+
+    public void setTown(String town) {
+        this.town = town;
+    }
+
+    public String getVillage() {
+        return village;
+    }
+
+    public void setVillage(String village) {
+        this.village = village;
+    }
+
+    public String getXzqCode() {
+        return xzqCode;
+    }
+
+    public String getXzqName() {
+        return xzqName;
+    }
+
+    public void setXzqName(String xzqName) {
+        this.xzqName = xzqName;
+    }
+
+    public void setXzqCode(String xzqCode) {
+        this.xzqCode = xzqCode;
+    }
+
+    public String getYear() {
+        return year;
+    }
+
+    public void setYear(String year) {
+        this.year = year;
+    }
+
+    @Override
+    public String toString() {
+        return "XzczghcgsbDTO{" +
+                "uuid='" + uuid + '\'' +
+                ", taskId='" + taskId + '\'' +
+                ", uploadStatus=" + uploadStatus +
+                ", uploadTime=" + uploadTime +
+                ", filePath='" + filePath + '\'' +
+                ", fileName='" + fileName + '\'' +
+                '}';
+    }
+}

+ 14 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/mapper/EscalationFileMapper.java

@@ -0,0 +1,14 @@
+package com.onemap.api.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.onemap.api.domain.EscalationDTO;
+import com.onemap.api.domain.EscalationFileDTO;
+
+/**
+ * 数据层
+ *
+ * @author onemap
+ */
+public interface EscalationFileMapper extends BaseMapper<EscalationFileDTO> {
+
+}

+ 14 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/mapper/EscalationMapper.java

@@ -0,0 +1,14 @@
+package com.onemap.api.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.onemap.api.domain.EscalationDTO;
+import com.onemap.api.domain.TSysOpenUser;
+
+/**
+ * 数据层
+ *
+ * @author onemap
+ */
+public interface EscalationMapper extends BaseMapper<EscalationDTO> {
+
+}

+ 14 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/mapper/TCgglSjbzmlwjMapper.java

@@ -0,0 +1,14 @@
+package com.onemap.api.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.onemap.api.domain.EscalationDTO;
+import com.onemap.api.domain.TCgglSjbzmlwjDto;
+
+/**
+ * 数据层
+ *
+ * @author onemap
+ */
+public interface TCgglSjbzmlwjMapper extends BaseMapper<TCgglSjbzmlwjDto> {
+
+}

+ 14 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/mapper/XzczghcgsbMapper.java

@@ -0,0 +1,14 @@
+package com.onemap.api.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.onemap.api.domain.EscalationDTO;
+import com.onemap.api.domain.XzczghcgsbDTO;
+
+/**
+ * 数据层
+ *
+ * @author onemap
+ */
+public interface XzczghcgsbMapper extends BaseMapper<XzczghcgsbDTO> {
+
+}

+ 2 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/service/ResultSearchService.java

@@ -14,4 +14,6 @@ public interface ResultSearchService {
     RequestResult getybspjl(String id, String instid);
 
     RequestResult downloadReoprt(String id, String solid, HttpServletResponse response);
+
+    RequestResult landGetRevisePage(String ghlx, Integer current, Integer size, String divisionCode, String subject);
 }

+ 24 - 0
onemap-modules/onemap-api/src/main/java/com/onemap/api/service/impl/ResultSearchServiceImpl.java

@@ -94,6 +94,30 @@ public class ResultSearchServiceImpl implements ResultSearchService {
         return changeResultObject(res, ghlx, null, null);
     }
 
+    @Override
+    public RequestResult landGetRevisePage(String ghlx, Integer current, Integer size, String divisionCode, String subject) {
+        JSONObject jsonObject = new JSONObject();
+        //TODO wanger 添加默认分页参数
+        if (current == null) {
+            jsonObject.put("current", 1);
+        } else {
+            jsonObject.put("current", current);
+        }
+        if (size == null) {
+            jsonObject.put("size", 999);
+        } else {
+            jsonObject.put("size", size);
+        }
+        if (StringUtils.isNotEmpty(subject)) {
+            jsonObject.put("title", subject);
+        }
+        if (StringUtils.isNotEmpty(divisionCode)) {
+            jsonObject.put("divisionCode", divisionCode);
+        }
+        JSONObject res = getRequestData(landGetRevisePageURI, jsonObject);
+        return changeResultObject(res, "村庄规划", null, null);
+    }
+
     @Override
     public RequestResult getybspjl(String id, String instid) {
         if (StringUtils.isEmpty(id) || StringUtils.isEmpty(instid)) {

+ 215 - 3
onemap-modules/onemap-api/src/main/java/com/onemap/api/service/impl/ResultsServiceImpl.java

@@ -2,14 +2,15 @@ package com.onemap.api.service.impl;
 
 import ch.qos.logback.core.util.FileUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.onemap.api.domain.*;
-import com.onemap.api.mapper.QxcgsbrwMapper;
-import com.onemap.api.mapper.QxcgsbrwfpMapper;
-import com.onemap.api.mapper.TSysOpenUserMapper;
+import com.onemap.api.mapper.*;
 import com.onemap.api.service.ResultsService;
 import com.onemap.common.core.constant.SecurityConstants;
 import com.onemap.common.core.domain.R;
 import com.onemap.common.core.utils.StringUtils;
+import com.onemap.common.core.utils.UnPackageUtils;
 import com.onemap.common.core.web.domain.RequestResult;
 import com.onemap.common.security.service.TokenService;
 import com.onemap.common.security.utils.SecurityUtils;
@@ -29,6 +30,7 @@ import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 import static com.onemap.api.util.Md5Utils.getMD5;
 import static com.onemap.api.util.utils.*;
@@ -43,10 +45,20 @@ public class ResultsServiceImpl implements ResultsService {
     private QxcgsbrwMapper qxcgsbrwMapper;
     @Autowired
     private QxcgsbrwfpMapper qxcgsbrwfpMapper;
+    @Autowired
+    private EscalationMapper escalationMapper;
+    @Autowired
+    private EscalationFileMapper escalationFileMapper;
+    @Autowired
+    private XzczghcgsbMapper xzczghcgsbMapper;
+    @Autowired
+    private TCgglSjbzmlwjMapper tCgglSjbzmlwjMapper;
     private Rwzt rwzt = new Rwzt();
     SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     @Value("${Cggl.temp}")
     private String tempfolder;
+    //成果级别
+    private String cglevel = "1";
 
     @Transactional(rollbackFor = Exception.class)
     @Override
@@ -223,6 +235,8 @@ public class ResultsServiceImpl implements ResultsService {
             loginfo("完成合包:" + folder);
         } catch (IOException e) {
             e.printStackTrace();
+            qxsbcg.setRwzt(rwzt.getHbsb());
+            qxcgsbrwMapper.update(qxsbcg, sbrwwrapper);
             return RequestResult.error("合包失败,没找到合包后的文件,请联系管理员");
         }
         File targetfile = new File(targetfilepath);
@@ -230,9 +244,207 @@ public class ResultsServiceImpl implements ResultsService {
         if (!fileMd5.equals(md5)) {
             return RequestResult.error("警告:文件的MD5不一致");
         }
+        //TODO wanger 进行数据解压
+        String filetype = StringUtils.getFileKzmx(filename);
+        String fileRelName = StringUtils.getFileRelName(filename);
+        String unzippath = folder + "" + fileRelName;
+        if (".zip".equals(filetype)) {
+            new UnPackageUtils().unPackZip(targetfile, folder);
+        } else if (".rar".equals(filetype)) {
+            //解压rar格式
+            new UnPackageUtils().unPackRar(targetfile, folder);
+        }
+        File unzipfile = new File(unzippath);
+        if (!unzipfile.exists()) {
+            return RequestResult.error("压缩包名称与解压后的文件名称不一致,请检查!");
+        }
+        //解析txt
+        String txtFilePath = FileSearch(unzippath, "基本信息.txt");
+        if (StringUtils.isEmpty(txtFilePath)) {
+            return RequestResult.error("成果包中必须包含“xxx基本信息.txt”文件,同时注意成果包中应包含“xxx规划成果”的根目录");
+        }
+        Map<String, String> txtMap = readTxt(txtFilePath);
+        ObjectMapper objectMapper = new ObjectMapper();
+        String txtjson = "";
+        try {
+            txtjson = objectMapper.writeValueAsString(txtMap);
+        } catch (JsonProcessingException e) {
+            e.printStackTrace();
+        }
+        String xmmc = txtMap.get("项目名称");
+        String xzqdm = txtMap.get("行政区代码");
+        String xzqmc = txtMap.get("行政区名称");
+        String ghlxtext = txtMap.get("规划类型");
+        String ghcjtext = txtMap.get("规划层级");
+        String ghxstext = txtMap.get("成果形式");
+        String pzsjtext = txtMap.get("批准时间");
+        String lxrtext = txtMap.get("联系人");
+        String lxdhtext = txtMap.get("联系电话");
+        //TODO wanger 对成果包进行校验
+        String sjbz_bsm = "";
+        if ("村庄规划".equals(ghlxtext)) {
+            sjbz_bsm = ghlxtext + "" + ghxstext;
+        } else {
+            sjbz_bsm = ghcjtext + "" + ghlxtext;
+        }
+        QueryWrapper<TCgglSjbzmlwjDto> sjbzwrapper = new QueryWrapper();
+        sjbzwrapper.eq("sjbz_bsm", sjbz_bsm);
+        sjbzwrapper.eq("ystj", "M");
+        sjbzwrapper.orderByAsc("px");
+        List<TCgglSjbzmlwjDto> sjbzlist = tCgglSjbzmlwjMapper.selectList(sjbzwrapper);
+        if (sjbzlist.size() == 0) {
+            return RequestResult.error(String.format("未授权的数据类型:%s,请联系管理人员!"), sjbz_bsm);
+        }
+        //记录缺失的文件列表  字符串类型
+        List<String> missfiles = new ArrayList<>();
+        missfiles = checkMustFiles(unzippath, sjbzlist, "", missfiles, xzqdm, xzqmc);
+        if (missfiles.size() > 0) {
+            return RequestResult.error(String.format("成果数据缺少以下目录或文件:%s", String.join("\n", missfiles)), missfiles);
+        }
+        qxsbcg.setRwzt(rwzt.getWc());
+        qxsbcg.setCglj(unzippath);
+        qxsbcg.setCgwj(targetfilepath);
+        qxcgsbrwMapper.update(qxsbcg, sbrwwrapper);
+        //TODO wanger 插入到系统成果表
+        String ghlx = qxsbcg.getGhlx();
+        if ("9".equals(ghlx)) {//村庄规划
+            XzczghcgsbDTO xzczghcgsbDTO = new XzczghcgsbDTO();
+            xzczghcgsbDTO.setCglevel(cglevel);
+            xzczghcgsbDTO.setUuid(StringUtils.getUUID());
+            xzczghcgsbDTO.setFileName(xmmc);
+            xzczghcgsbDTO.setFilePath(targetfilepath);
+            xzczghcgsbDTO.setUploadStatus(2);
+            xzczghcgsbDTO.setUploadTime(new Date());
+            xzczghcgsbDTO.setXzqName(xzqmc);
+            xzczghcgsbDTO.setXzqCode(xzqdm);
+            xzczghcgsbDTO.setStatus("10");
+            xzczghcgsbDTO.setYear(pzsjtext);
+            xzczghcgsbDTO.setBz(txtjson);
+            if (StringUtils.isNotEmpty(instid)) {
+                xzczghcgsbDTO.setInstid(instid);
+            }
+            xzczghcgsbMapper.insert(xzczghcgsbDTO);
+        } else {//总体规划表
+            String fileuuid = StringUtils.getUUID();
+            //TODO wanger 插入file表
+            EscalationFileDTO filedto = new EscalationFileDTO();
+            filedto.setId(fileuuid);
+            filedto.setName(filename);
+            filedto.setPath(targetfilepath);
+            filedto.setUnzippath(unzippath);
+            filedto.setStatus("9");
+            filedto.setUsername(user.getName());
+            escalationFileMapper.insert(filedto);
+            //TODO wanger 插入主表
+            EscalationDTO escalationDTO = new EscalationDTO();
+            escalationDTO.setId(StringUtils.getUUID());
+            escalationDTO.setCglevel(cglevel);
+            escalationDTO.setFileid(fileuuid);
+            escalationDTO.setPlantype(ghlx);
+            if (StringUtils.isNotEmpty(instid)) {
+                escalationDTO.setInstid(instid);
+            }
+            escalationDTO.setUploadstatus("0");
+            escalationDTO.setXzqdm(xzqdm);
+            escalationDTO.setXzqmc(xzqmc);
+            escalationDTO.setYear(pzsjtext);
+            escalationDTO.setUploadtime(new Date());
+            escalationDTO.setUsername(user.getName());
+            escalationDTO.setSczt("4");
+            escalationDTO.setName(xmmc);
+            escalationDTO.setLxdh(lxdhtext);
+            escalationDTO.setLxr(lxrtext);
+            escalationMapper.insert(escalationDTO);
+        }
         return RequestResult.success("操作成功", 1);
     }
 
+    /**
+     * 检查缺失的成果文件 递归调用  非常重要
+     *
+     * @param unzippath  文件路径
+     * @param sjbzlist   约定的数据标准检查项
+     * @param parentname 递归遍历用 父节点
+     * @param missfiles  缺失的文件列表
+     * @param xzqdm      行政区代码
+     * @param xzqmc      行政区名称
+     * @return List<String> missfiles  缺失的文件列表
+     */
+    public List<String> checkMustFiles(String unzippath, List<TCgglSjbzmlwjDto> sjbzlist, String parentname, List<String> missfiles, String xzqdm, String xzqmc) {
+        List<TCgglSjbzmlwjDto> filteredList = new ArrayList<>();
+        if (StringUtils.isNotEmpty(parentname)) {
+            filteredList = sjbzlist.stream()
+                    .filter(cur -> cur.getSjml() == parentname)
+                    .collect(Collectors.toList());
+        } else {
+            filteredList = sjbzlist.stream()
+                    .filter(cur -> cur.getSjml() == null)
+                    .collect(Collectors.toList());
+        }
+        for (TCgglSjbzmlwjDto dto : filteredList) {
+            Integer lx = dto.getLx();
+            String gzmc = dto.getGzmc();
+            String mlmc = dto.getMlmc();
+            String curpath = "";//当前的文件或文件夹路径地址
+            if (StringUtils.isNotEmpty(gzmc)) {
+                curpath = getAbFilepath(gzmc, xzqdm, xzqmc, unzippath);
+            } else {
+                curpath = unzippath + "\\" + mlmc;
+            }
+            if (curpath.contains("不符")) {
+                missfiles.add(curpath);
+                return missfiles;
+            }
+            File folder = new File(curpath);
+            if (lx == 0) {//文件夹
+                if (folder.exists() && folder.isDirectory()) {
+                    if (!curpath.endsWith(".gdb")) {
+                        checkMustFiles(curpath, sjbzlist, dto.getSjml(), missfiles, xzqdm, xzqmc);
+                    }
+                } else {
+                    missfiles.add(StringUtils.isNotEmpty(gzmc) ? gzmc : mlmc);
+                }
+            } else if (lx == 1) {//文件
+                if (!folder.exists()) {
+                    missfiles.add(StringUtils.isNotEmpty(gzmc) ? gzmc : mlmc);
+                }
+            }
+        }
+        return missfiles;
+    }
+
+    /**
+     * 通过文件验证规则  获取文件的绝对路径
+     *
+     * @param gzmc
+     * @param xzqdm
+     * @param xzqmc
+     * @param filepath
+     * @return
+     */
+    public String getAbFilepath(String gzmc, String xzqdm, String xzqmc, String filepath) {
+        List<String> matches = extractUniqueMatches(gzmc);
+        String relName = gzmc;
+        for (String matche : matches) {
+            if (matche.contains("行政区名称")) {
+                relName = relName.replace(matche, xzqmc);
+            }
+            if (matche.contains("行政区代码")) {
+                if (matche.contains(":")) {
+                    Integer len = Integer.valueOf(matche.split(":")[1].replace("}", ""));
+                    if (len > xzqdm.length()) {
+                        return "基本信息文件中的行政区代码长度与数据标准不符!";
+                    } else {
+                        relName = relName.replace(matche, xzqdm.substring(0, len));
+                    }
+                } else {
+                    relName = relName.replace(matche, xzqdm);
+                }
+            }
+        }
+        return filepath + "\\" + relName;
+    }
+
     /**
      * 通过当前登录用户token获取openuser表信息
      *

+ 3 - 2
onemap-modules/onemap-api/src/main/java/com/onemap/api/service/impl/ZhxzServiceImpl.java

@@ -43,9 +43,10 @@ public class ZhxzServiceImpl implements ZhxzService {
             return RequestResult.error("应用不存在,请检查并重新输入!");
         } else if (dto.getState() == 0) {
             return RequestResult.error("当前应用已禁用,请联系管理员!");
-        } else if (!ip.equals(dto.getIp())) {//TODO wanger 需不需要校验访问的IP地址
-            return RequestResult.error("非法登录!");
         }
+//        else if (!ip.equals(dto.getIp())) {//TODO wanger 需不需要校验访问的IP地址
+//            return RequestResult.error("非法登录!");
+//        }
         //获得appid绑定的用户名
         String username = dto.getName();
         // 查询用户信息

+ 17 - 29
onemap-modules/onemap-api/src/main/java/com/onemap/api/util/Md5Utils.java

@@ -11,45 +11,36 @@ import java.nio.charset.StandardCharsets;
 import java.security.MessageDigest;
 
 /**
- * Md5加密方法
- *
- * @author ruoyi
- */
-public class Md5Utils
-{
+ * @author : wanger
+ * @createDate: 2025/2/18
+ * @description:Md5加密方法
+ **/
+public class Md5Utils {
     private static final Logger log = LoggerFactory.getLogger(Md5Utils.class);
 
-    private static byte[] md5(String s)
-    {
+    private static byte[] md5(String s) {
         MessageDigest algorithm;
-        try
-        {
+        try {
             algorithm = MessageDigest.getInstance("MD5");
             algorithm.reset();
             algorithm.update(s.getBytes("UTF-8"));
             byte[] messageDigest = algorithm.digest();
             return messageDigest;
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             log.error("MD5 Error...", e);
         }
         return null;
     }
 
-    private static final String toHex(byte hash[])
-    {
-        if (hash == null)
-        {
+    private static final String toHex(byte hash[]) {
+        if (hash == null) {
             return null;
         }
         StringBuffer buf = new StringBuffer(hash.length * 2);
         int i;
 
-        for (i = 0; i < hash.length; i++)
-        {
-            if ((hash[i] & 0xff) < 0x10)
-            {
+        for (i = 0; i < hash.length; i++) {
+            if ((hash[i] & 0xff) < 0x10) {
                 buf.append("0");
             }
             buf.append(Long.toString(hash[i] & 0xff, 16));
@@ -57,14 +48,10 @@ public class Md5Utils
         return buf.toString();
     }
 
-    public static String hash(String s)
-    {
-        try
-        {
+    public static String hash(String s) {
+        try {
             return new String(toHex(md5(s)).getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8);
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             log.error("not supported charset...{}", e);
             return s;
         }
@@ -73,6 +60,7 @@ public class Md5Utils
 
     /**
      * 获取一个文件的md5值(可处理大文件)
+     *
      * @return md5 value
      */
     public static String getMD5(File file) {
@@ -91,7 +79,7 @@ public class Md5Utils
             return null;
         } finally {
             try {
-                if (fileInputStream != null){
+                if (fileInputStream != null) {
                     fileInputStream.close();
                 }
             } catch (IOException e) {

+ 4 - 2
onemap-modules/onemap-api/src/main/java/com/onemap/api/util/RInterfaceUtil.java

@@ -32,8 +32,10 @@ import java.util.Map;
 import java.util.Set;
 
 /**
- * 调用厅里接口工具类
- */
+ * @author : wanger
+ * @createDate: 2025/2/18
+ * @description:调用厅里接口工具类
+ **/
 public class RInterfaceUtil {
     public static String Authorization = "Basic c2FiZXI6c2FiZXJfc2VjcmV0";
     public static String TenantId = "000000";

+ 75 - 3
onemap-modules/onemap-api/src/main/java/com/onemap/api/util/utils.java

@@ -1,16 +1,22 @@
 package com.onemap.api.util;
 
+import com.onemap.common.core.utils.StringUtils;
+
 import java.io.*;
 import java.nio.file.Files;
 import java.nio.file.Paths;
-import java.util.List;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 import java.util.zip.ZipOutputStream;
 
 /**
- * 公用工具类
- */
+ * @author : wanger
+ * @createDate: 2025/2/18
+ * @description:公用工具类
+ **/
 public class utils {
     /**
      * 自治区成果包查询需要的plantype
@@ -112,4 +118,70 @@ public class utils {
         fos.flush();
         fos.close();
     }
+
+    /**
+     * 读取txt文本文件
+     *
+     * @param filepath
+     * @return Map<String, String>
+     */
+    public static Map<String, String> readTxt(String filepath) {
+        Map<String, String> resMap = new HashMap<>();
+        try {
+            File file = new File(filepath);
+            BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "GBK"));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                if (StringUtils.isNotEmpty(line)) {
+                    String[] curline = line.split("=");
+                    resMap.put(curline[0], curline[1]);
+                }
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return resMap;
+    }
+
+    /**
+     * 搜索文件夹下指定文件名结尾的文件  默认返回第一个
+     *
+     * @param filepath
+     * @param endsWith
+     * @return String
+     */
+    public static String FileSearch(String filepath, String endsWith) {
+        File folder = new File(filepath);
+        File[] files = folder.listFiles(new FilenameFilter() {
+            @Override
+            public boolean accept(File dir, String name) {
+                return name.endsWith(endsWith);
+            }
+        });
+        if (files != null) {
+            return files[0].getAbsolutePath();
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * 正则表达式  获取参数占位信息
+     *
+     * @param str
+     * @return
+     */
+    public static List<String> extractUniqueMatches(String str) {
+        // 定义正则表达式
+        Pattern regex = Pattern.compile("\\{.*?\\}", Pattern.CASE_INSENSITIVE);
+        Matcher matcher = regex.matcher(str);
+        // 用于存储匹配结果的集合
+        Set<String> uniqueMatches = new HashSet<>();
+        // 查找所有匹配项
+        while (matcher.find()) {
+            uniqueMatches.add(matcher.group());
+        }
+        // 将Set转换为List并返回
+        return new ArrayList<>(uniqueMatches);
+    }
 }