Selaa lähdekoodia

地籍管理上传文件,入库文件实现,新增类等

chenendian 2 kuukautta sitten
vanhempi
commit
3310109ded

+ 0 - 3
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/ThematicController.java

@@ -8,9 +8,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
-import java.net.http.HttpResponse;
-import java.util.HashMap;
-import java.util.Map;
 
 
 /**
 /**
  * 专题图制图 控制器
  * 专题图制图 控制器

+ 283 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/TdgySjDTO.java

@@ -0,0 +1,283 @@
+package com.siwei.apply.domain.cadastre;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.Date;
+
+public class TdgySjDTO {
+    private Integer id;
+    private String xmmc;
+    private String tdzl;
+    private String crmj;
+    private String tdyt;
+    private String rjl;
+    private String cjj;
+    private String gylx;
+    private String cjr;
+    private String pzjg;
+    private String pzwh;
+    private String pzrq;
+    private String xzqh;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date create_time;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date update_time;
+    private String sulx;
+    private String srf;
+    private String crmj_m;
+    private String tdsyq;
+    private String htbh;
+    private String jbr;
+    private String zdyt;
+    private String cqzh;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date ydkgsj;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date ydjgsj;
+    private Boolean sfjg;
+    private Boolean sfkg;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date sjkgsj;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date sjjgsj;
+    private String sjnf;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getXmmc() {
+        return xmmc;
+    }
+
+    public void setXmmc(String xmmc) {
+        this.xmmc = xmmc;
+    }
+
+    public String getTdzl() {
+        return tdzl;
+    }
+
+    public void setTdzl(String tdzl) {
+        this.tdzl = tdzl;
+    }
+
+    public String getCrmj() {
+        return crmj;
+    }
+
+    public void setCrmj(String crmj) {
+        this.crmj = crmj;
+    }
+
+    public String getTdyt() {
+        return tdyt;
+    }
+
+    public void setTdyt(String tdyt) {
+        this.tdyt = tdyt;
+    }
+
+    public String getRjl() {
+        return rjl;
+    }
+
+    public void setRjl(String rjl) {
+        this.rjl = rjl;
+    }
+
+    public String getCjj() {
+        return cjj;
+    }
+
+    public void setCjj(String cjj) {
+        this.cjj = cjj;
+    }
+
+    public String getGylx() {
+        return gylx;
+    }
+
+    public void setGylx(String gylx) {
+        this.gylx = gylx;
+    }
+
+    public String getCjr() {
+        return cjr;
+    }
+
+    public void setCjr(String cjr) {
+        this.cjr = cjr;
+    }
+
+    public String getPzjg() {
+        return pzjg;
+    }
+
+    public void setPzjg(String pzjg) {
+        this.pzjg = pzjg;
+    }
+
+    public String getPzwh() {
+        return pzwh;
+    }
+
+    public void setPzwh(String pzwh) {
+        this.pzwh = pzwh;
+    }
+
+    public String getPzrq() {
+        return pzrq;
+    }
+
+    public void setPzrq(String pzrq) {
+        this.pzrq = pzrq;
+    }
+
+    public String getXzqh() {
+        return xzqh;
+    }
+
+    public void setXzqh(String xzqh) {
+        this.xzqh = xzqh;
+    }
+
+    public Date getCreate_time() {
+        return create_time;
+    }
+
+    public void setCreate_time(Date create_time) {
+        this.create_time = create_time;
+    }
+
+    public Date getUpdate_time() {
+        return update_time;
+    }
+
+    public void setUpdate_time(Date update_time) {
+        this.update_time = update_time;
+    }
+
+    public String getSulx() {
+        return sulx;
+    }
+
+    public void setSulx(String sulx) {
+        this.sulx = sulx;
+    }
+
+    public String getSrf() {
+        return srf;
+    }
+
+    public void setSrf(String srf) {
+        this.srf = srf;
+    }
+
+    public String getCrmj_m() {
+        return crmj_m;
+    }
+
+    public void setCrmj_m(String crmj_m) {
+        this.crmj_m = crmj_m;
+    }
+
+    public String getTdsyq() {
+        return tdsyq;
+    }
+
+    public void setTdsyq(String tdsyq) {
+        this.tdsyq = tdsyq;
+    }
+
+    public String getHtbh() {
+        return htbh;
+    }
+
+    public void setHtbh(String htbh) {
+        this.htbh = htbh;
+    }
+
+    public String getJbr() {
+        return jbr;
+    }
+
+    public void setJbr(String jbr) {
+        this.jbr = jbr;
+    }
+
+    public String getZdyt() {
+        return zdyt;
+    }
+
+    public void setZdyt(String zdyt) {
+        this.zdyt = zdyt;
+    }
+
+    public String getCqzh() {
+        return cqzh;
+    }
+
+    public void setCqzh(String cqzh) {
+        this.cqzh = cqzh;
+    }
+
+    public Date getYdkgsj() {
+        return ydkgsj;
+    }
+
+    public void setYdkgsj(Date ydkgsj) {
+        this.ydkgsj = ydkgsj;
+    }
+
+    public Date getYdjgsj() {
+        return ydjgsj;
+    }
+
+    public void setYdjgsj(Date ydjgsj) {
+        this.ydjgsj = ydjgsj;
+    }
+
+    public Boolean getSfjg() {
+        return sfjg;
+    }
+
+    public void setSfjg(Boolean sfjg) {
+        this.sfjg = sfjg;
+    }
+
+    public Boolean getSfkg() {
+        return sfkg;
+    }
+
+    public void setSfkg(Boolean sfkg) {
+        this.sfkg = sfkg;
+    }
+
+    public Date getSjkgsj() {
+        return sjkgsj;
+    }
+
+    public void setSjkgsj(Date sjkgsj) {
+        this.sjkgsj = sjkgsj;
+    }
+
+    public Date getSjjgsj() {
+        return sjjgsj;
+    }
+
+    public void setSjjgsj(Date sjjgsj) {
+        this.sjjgsj = sjjgsj;
+    }
+
+    public String getSjnf() {
+        return sjnf;
+    }
+
+    public void setSjnf(String sjnf) {
+        this.sjnf = sjnf;
+    }
+}

+ 5 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/CadastreFileMapper.java

@@ -61,5 +61,10 @@ public interface CadastreFileMapper {
 
 
     String selectGeoms(String tableName);
     String selectGeoms(String tableName);
 
 
+    /**
+     * 增加valid_flag字段
+     */
+    void addValidFlagColumn(@Param("tableName") String tableName);
+
 
 
 }
 }

+ 53 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/cadastre/TdgySjMapper.java

@@ -0,0 +1,53 @@
+package com.siwei.apply.mapper.cadastre;
+
+import com.siwei.apply.domain.cadastre.TdgySjDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
+/**
+ * 土地供应实际用地情况表 数据层
+ */
+@Mapper
+public interface TdgySjMapper {
+
+    /**
+     * 查询列表
+     * 
+     * @param tdgySjDTO
+     * @return
+     */
+    List<TdgySjDTO> selectList(TdgySjDTO tdgySjDTO);
+
+    /**
+     * 根据ID查询
+     * 
+     * @param id
+     * @return
+     */
+    TdgySjDTO selectById(@Param("id") Integer id);
+
+    /**
+     * 新增
+     * 
+     * @param tdgySjDTO
+     * @return
+     */
+    int insert(TdgySjDTO tdgySjDTO);
+
+    /**
+     * 修改
+     * 
+     * @param tdgySjDTO
+     * @return
+     */
+    int update(TdgySjDTO tdgySjDTO);
+
+    /**
+     * 删除
+     * 
+     * @param id
+     * @return
+     */
+    int deleteById(@Param("id") Integer id);
+}

+ 6 - 9
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/CadastreManageServiceImpl.java

@@ -123,16 +123,13 @@ public class CadastreManageServiceImpl implements CadastreManageService {
         compareResultVo.setUploadId(uploadId);
         compareResultVo.setUploadId(uploadId);
         compareResultVo.setResultStatus(true);
         compareResultVo.setResultStatus(true);
 
 
-
-
+        cadastreFileMapper.addValidFlagColumn("t_cgzj_cwtc_m");
 //        //todo 这里进行
 //        //todo 这里进行
 //        List<Map<String,String>> collumTypes =  cadastreFileMapper.selectTableCollumAndType("mzdzw");
 //        List<Map<String,String>> collumTypes =  cadastreFileMapper.selectTableCollumAndType("mzdzw");
-//        if(true){
-//            log.info(collumTypes.toString());
-//            return compareResultVo;
-//        }
-
-
+        if(true){
+            //log.info(collumTypes.toString());
+            return compareResultVo;
+        }
 
 
 
 
         try {
         try {
@@ -395,7 +392,7 @@ public class CadastreManageServiceImpl implements CadastreManageService {
             for (int i = 0; i < feature.GetFieldCount(); i++) {
             for (int i = 0; i < feature.GetFieldCount(); i++) {
                 String fieldName = feature.GetFieldDefnRef(i).GetName();
                 String fieldName = feature.GetFieldDefnRef(i).GetName();
                 if(fieldNameAndTypeMap.containsKey(fieldName.toLowerCase())) {
                 if(fieldNameAndTypeMap.containsKey(fieldName.toLowerCase())) {
-                    String fieldType = fieldNameAndTypeMap.get(fieldName);
+                    String fieldType = fieldNameAndTypeMap.get(fieldName.toLowerCase());
                     if (StringUtils.containsIgnoreCase(fieldType, "character")) {
                     if (StringUtils.containsIgnoreCase(fieldType, "character")) {
                         map.put(fieldName, feature.GetFieldAsString(i));
                         map.put(fieldName, feature.GetFieldAsString(i));
                     } else if (StringUtils.containsIgnoreCase(fieldType, "integer")) {
                     } else if (StringUtils.containsIgnoreCase(fieldType, "integer")) {

+ 26 - 33
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/utils/ServiceFileUtil.java

@@ -20,7 +20,7 @@ import java.util.stream.Collectors;
  * 文件工具类
  * 文件工具类
  */
  */
 public class ServiceFileUtil {
 public class ServiceFileUtil {
-    
+
     private static final Logger logger = LoggerFactory.getLogger(ServiceFileUtil.class);
     private static final Logger logger = LoggerFactory.getLogger(ServiceFileUtil.class);
 
 
     private static final String createFilePath = "/home/siwei/uploadPath";
     private static final String createFilePath = "/home/siwei/uploadPath";
@@ -28,83 +28,80 @@ public class ServiceFileUtil {
     /**
     /**
      * 编码目录名
      * 编码目录名
      */
      */
-    public static final String extractFilename(String name)
-    {
+    public static final String extractFilename(String name) {
         return StringUtils.format("{}/{}_{}", DateUtils.datePath(),
         return StringUtils.format("{}/{}_{}", DateUtils.datePath(),
                 FilenameUtils.getBaseName(name), Seq.getId(Seq.uploadSeqType));
                 FilenameUtils.getBaseName(name), Seq.getId(Seq.uploadSeqType));
     }
     }
 
 
 
 
-
     //给定一个名称创建一个目录,返回路径
     //给定一个名称创建一个目录,返回路径
-    public static String  createDirectory(String directoryName) {
+    public static String createDirectory(String directoryName) {
         String directoryPathAndName = null;
         String directoryPathAndName = null;
         try {
         try {
-            directoryPathAndName =createFilePath+"/"+ extractFilename(directoryName);
+            directoryPathAndName = createFilePath + "/" + extractFilename(directoryName);
             Path file = Paths.get(directoryPathAndName);
             Path file = Paths.get(directoryPathAndName);
             if (Files.exists(file)) {
             if (Files.exists(file)) {
                 logger.warn("处理文件失败:文件不存在: {}", directoryPathAndName);
                 logger.warn("处理文件失败:文件不存在: {}", directoryPathAndName);
-            }else {
+            } else {
                 //直接创建目录
                 //直接创建目录
                 Path extractPath = Paths.get(directoryPathAndName);
                 Path extractPath = Paths.get(directoryPathAndName);
                 Files.createDirectories(extractPath);
                 Files.createDirectories(extractPath);
             }
             }
         } catch (IOException e) {
         } catch (IOException e) {
-            throw new ServiceException("创建目录失败,请检查!"+e.getMessage());
+            throw new ServiceException("创建目录失败,请检查!" + e.getMessage());
         }
         }
         return directoryPathAndName;
         return directoryPathAndName;
     }
     }
 
 
     //给定一个名称创建一个目录,返回路径
     //给定一个名称创建一个目录,返回路径
-    public static String  createMultipartDirectory(String directoryName,String[] subDirectoryName) {
+    public static String createMultipartDirectory(String directoryName, String[] subDirectoryName) {
         String directoryPath = createFilePath;
         String directoryPath = createFilePath;
         directoryName = extractFilename(directoryName);
         directoryName = extractFilename(directoryName);
-        String directoryPathAndName = createDirectory(directoryPath,directoryName);
+        String directoryPathAndName = createDirectory(directoryPath, directoryName);
         Arrays.stream(subDirectoryName).forEach(name -> {
         Arrays.stream(subDirectoryName).forEach(name -> {
-            createDirectory(directoryPathAndName,name);
+            createDirectory(directoryPathAndName, name);
         });
         });
-        return directoryPath+"/"+ directoryName;
+        return directoryPath + "/" + directoryName;
     }
     }
 
 
 
 
     //给定一个名称创建一个目录,返回路径
     //给定一个名称创建一个目录,返回路径
-    public static String  createDirectory(String directoryPath, String directoryName) {
+    public static String createDirectory(String directoryPath, String directoryName) {
         String directoryPathAndName = null;
         String directoryPathAndName = null;
         try {
         try {
-            directoryPathAndName =directoryPath+"/"+ directoryName;
+            directoryPathAndName = directoryPath + "/" + directoryName;
             Path file = Paths.get(directoryPathAndName);
             Path file = Paths.get(directoryPathAndName);
             if (Files.exists(file)) {
             if (Files.exists(file)) {
                 logger.warn("处理文件失败:文件不存在: {}", directoryPathAndName);
                 logger.warn("处理文件失败:文件不存在: {}", directoryPathAndName);
-            }else {
+            } else {
                 //直接创建目录
                 //直接创建目录
                 Path extractPath = Paths.get(directoryPathAndName);
                 Path extractPath = Paths.get(directoryPathAndName);
                 Files.createDirectories(extractPath);
                 Files.createDirectories(extractPath);
             }
             }
         } catch (IOException e) {
         } catch (IOException e) {
-            throw new ServiceException("创建目录失败,请检查!"+e.getMessage());
+            throw new ServiceException("创建目录失败,请检查!" + e.getMessage());
         }
         }
         return directoryPathAndName;
         return directoryPathAndName;
     }
     }
 
 
 
 
-
     //给定一个名称创建一个目录,返回路径
     //给定一个名称创建一个目录,返回路径
-    public static String  moveFileToDirectory(String filePath,String directoryPath) {
+    public static String moveFileToDirectory(String filePath, String directoryPath) {
         Path file = Paths.get(filePath);
         Path file = Paths.get(filePath);
         Path dirPath = Paths.get(directoryPath);
         Path dirPath = Paths.get(directoryPath);
         if (!Files.exists(file)) {
         if (!Files.exists(file)) {
-            logger.warn("处理文件失败,文件不存在: {}",filePath);
-            throw new ServiceException("处理文件失败:文件不存在: "+filePath);
+            logger.warn("处理文件失败,文件不存在: {}", filePath);
+            throw new ServiceException("处理文件失败:文件不存在: " + filePath);
         }
         }
         if (!Files.exists(dirPath)) {
         if (!Files.exists(dirPath)) {
             logger.warn("目录不存在: {}", directoryPath);
             logger.warn("目录不存在: {}", directoryPath);
-            throw new ServiceException("目录不存在: "+directoryPath);
+            throw new ServiceException("目录不存在: " + directoryPath);
         }
         }
         //这里拼接文件名
         //这里拼接文件名
-        if(directoryPath.endsWith("/")){
-            directoryPath+=file.getFileName();
-        }else {
-            directoryPath+="/"+file.getFileName();
+        if (directoryPath.endsWith("/")) {
+            directoryPath += file.getFileName();
+        } else {
+            directoryPath += "/" + file.getFileName();
         }
         }
         dirPath = Paths.get(directoryPath);
         dirPath = Paths.get(directoryPath);
         try {
         try {
@@ -121,7 +118,7 @@ public class ServiceFileUtil {
         Path dirPath = Paths.get(directoryPath);
         Path dirPath = Paths.get(directoryPath);
         if (!Files.exists(dirPath)) {
         if (!Files.exists(dirPath)) {
             logger.warn("目录不存在: {}", directoryPath);
             logger.warn("目录不存在: {}", directoryPath);
-            throw new ServiceException("目录不存在: "+directoryPath);
+            throw new ServiceException("目录不存在: " + directoryPath);
         }
         }
         Files.walk(dirPath)
         Files.walk(dirPath)
                 .sorted(Comparator.reverseOrder())
                 .sorted(Comparator.reverseOrder())
@@ -132,6 +129,7 @@ public class ServiceFileUtil {
     /**
     /**
      *
      *
      * 获取目录下的所有文件列表
      * 获取目录下的所有文件列表
+     *
      * @param directoryPath
      * @param directoryPath
      * @throws IOException
      * @throws IOException
      */
      */
@@ -142,8 +140,8 @@ public class ServiceFileUtil {
             return null;
             return null;
         }
         }
         List<Path> list = Files.walk(dirPath, Integer.MAX_VALUE)
         List<Path> list = Files.walk(dirPath, Integer.MAX_VALUE)
-        .filter(Files::isRegularFile).collect(Collectors.toList());
-        return  list;
+                .filter(Files::isRegularFile).collect(Collectors.toList());
+        return list;
     }
     }
 
 
 
 
@@ -166,9 +164,4 @@ public class ServiceFileUtil {
     }
     }
 
 
 
 
-
-
-
-
-
 }
 }

+ 4 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/cadastre/CadastreFileMapper.xml

@@ -142,6 +142,10 @@
         from vector.${tableName} gd
         from vector.${tableName} gd
     </select>
     </select>
 
 
+    <update id="addValidFlagColumn">
+        ALTER TABLE vector.${tableName} ADD COLUMN IF NOT EXISTS valid_flag int2
+    </update>
+