管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-02-08 6eafc81a275b14cc6a2fc653f883e94c0313bc43
1
已添加1个文件
已修改6个文件
222 ■■■■ 文件已修改
DataLoader/CS/Importor.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DataLoader/CS/StaticData.cs 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DataLoader/DataLoader.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DataLoader/MainWindow.xaml.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DataLoader/Model/ViewData.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/up.html 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JavaCode/JavaCode.csproj 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DataLoader/CS/Importor.cs
@@ -14,6 +14,14 @@
{
    public class Importor
    {
        private static List<String> Exclusions = new List<string>() {
            "jp2.aux.xml",
            ".midx", ".strmi",
            ".rrd", ".img.aux.xml", ".hdr", ".img.enp", ".img.xml",
            ".tfw", ".tif.ovr", ".tif.aux.xml", ".tif.enp", ".tif.xml", ".prj",
            ".shx", ".dbf", ".cpg" //, ".prj"
        };
        private static PostgreHelper _ph = null;
        public static PostgreHelper Helper
@@ -65,6 +73,7 @@
                ViewData vd = new ViewData();
                vd.ID = i + 1;
                vd.FilePath = files[i];
                vd.Ext = System.IO.Path.GetExtension(files[i]);
                vd.Status = "准备";
                viewDatas.Add(vd);
@@ -94,7 +103,7 @@
                {
                    vd.Status = "生成MD5码...";
                    string guid = MD5Helper.GetMD5Hash(vd.FilePath);
                    if (IsFileExists(guid))
                    if (!Exclusions.Contains(vd.Ext) && IsFileExists(guid))
                    {
                        vd.Status = "已存在!";
                        return;
DataLoader/CS/StaticData.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataLoader.CS
{
    public class StaticData
    {
        /**
         * JP2文件扩展名
         */
        public static List<String> JP2_EXT = new List<String> { "jp2.aux.xml" };
        /**
         * MPT文件扩展名
         */
        public static List<String> MPT_EXT = new List<String> { ".midx", ".strmi" };
        /**
         * IMG文件扩展名
         */
        public static List<String> IMG_EXT = new List<String> { ".rrd", ".img.aux.xml", ".hdr", ".img.enp", ".img.xml" };
        /**
         * TIF文件扩展名
         */
        public static List<String> TIF_EXT = new List<String> { ".prj", ".tfw", ".tif.ovr", ".tif.aux.xml", ".tif.enp", ".tif.xml" };
        /**
         * TIFF文件扩展名
         */
        public static List<String> TIFF_EXT = new List<String> { ".prj", ".tfw", ".tiff.ovr", ".tiff.aux.xml", ".tiff.enp", ".tiff.xml" };
        /**
         * SHP文件扩展名
         */
        public static List<String> SHP_EXT = new List<String> { ".shx", ".dbf", ".prj", ".cpg" };
        /**
         * æ‰€æœ‰æ–‡ä»¶æ‰©å±•名
         */
        public static List<String> ALL_EXTENSION = new List<String> { ".pdf", ".xls", ".xlsx", ".doc", ".docx", ".ppt", ".pptx", ".shp", ".gdb", ".mdb", ".dwg", ".las", ".laz", ".cpt", ".mpt", ".fly", ".efb", ".g3d", ".fbx", ".obj", ".3dm", ".3dml", ".osgb", ".rvt", ".ifc", ".jpg", ".png", ".img", ".tif", ".tiff", ".bmp", ".gif", ".rmvb", ".rm", ".mp3", ".mp4", ".avi", ".wma", ".wmv", ".7z", ".rar", ".zip", ".db", ".jp2", ".txt", ".xml" };
    }
}
DataLoader/DataLoader.csproj
@@ -94,6 +94,7 @@
    <Compile Include="CS\Importor.cs" />
    <Compile Include="CS\LogOut.cs" />
    <Compile Include="CS\MD5Helper.cs" />
    <Compile Include="CS\StaticData.cs" />
    <Compile Include="Model\Tool.cs" />
    <Compile Include="CS\ModelHandler.cs" />
    <Compile Include="Model\NtstWeb.cs" />
DataLoader/MainWindow.xaml.cs
@@ -152,6 +152,7 @@
                MessageBox.Show("请选择入库目录!", "提示");
                return;
            }
            string[] files = Directory.GetFiles(SourcePath);
            if (null == files || files.Length == 0)
            {
DataLoader/Model/ViewData.cs
@@ -11,11 +11,9 @@
    {
        public event PropertyChangedEventHandler PropertyChanged;
        public string Ext { set; get; }
        private int _id;
        private string _filePath;
        private string _status;
        public ViewData()
        {
@@ -37,6 +35,8 @@
            }
        }
        private string _filePath;
        public string FilePath
        {
            set
@@ -53,6 +53,8 @@
            }
        }
        private string _status;
        public string Status
        {
            set
ExportMap/up.html
@@ -11,7 +11,7 @@
    var app = {};
    var path = "20230127";
    var url = "http://127.0.0.1:12316/server/";
    var token = "b2d58c3c-9d98-4e7f-a9c5-7682cc83bc38";
    var token = "dca04924-122a-4b1a-88b7-aca0c4a7ba47";
    $(function () {
      $("#pathSpan").html(path);
@@ -52,6 +52,15 @@
    }
  </script>
  <script>
    // æŸ¥è¯¢ç›®å½•
    function selectPath() {
      ajax(getUrl("dataUpload/selectPath"), "GET", null, null, null, function (rs) {
        console.log(rs);
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        path = rs.result;
      });
    }
    // ä¸Šä¼ æ–‡ä»¶
    function uploadFiles() {
      var formData = new FormData();
@@ -93,81 +102,6 @@
    function deleteFiles() {
      if (app.data == null) return;
      ajax(getUrl("dataUpload/deleteFiles"), "POST", JSON.stringify([app.data[0]]), null, null, function (rs) {
        console.log(rs);
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        selectFiles();
      });
    }
    // æ–‡ä»¶å…¥åº“
    function insertFiles() {
      if (app.data == null) return;
      var obj = {
        metaEntity: {
          depid: 1,
          dirid: 10,
          verid: 0,
          //type: "file",
          //cs: "CGCS 2000",
          //scale: "1:1000",
          //resolution: "0.5m",
          gather: "2022-10-03 15:00:00",
          descr: "测试文件上传",
        },
        fileEntities: app.data
      };
      ajax(getUrl("dataUpload/insertFiles"), "POST", JSON.stringify(obj), null, null, function (rs) {
        console.log(rs);
        app.data = null;
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
      });
    }
  </script>
  <script>
    // ä¸Šä¼ æ–‡ä»¶
    function uploadFiles2() {
      var formData = new FormData();
      var fs = document.getElementById("file1");
      for (var i = 0, c = fs.files.length; i < c; i++) {
        formData.append(fs.files[i].name, fs.files[i]); // fs.files[i].name,file
      }
      $.ajax(getUrl("dataLoader/uploadFiles") + "&path=" + path, {
        type: "post",
        data: formData,
        async: true,
        cache: false,
        processData: false,
        contentType: false,
        success: function (rs) {
          document.getElementById("file1").value = "";
          console.log(rs);
          alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        },
        error: function (e) {
          document.getElementById("file1").value = "";
          console.error(e);
          alert("上传文件失败!");
        }
      });
    }
    // æŸ¥è¯¢æ–‡ä»¶
    function selectFiles2() {
      ajax(getUrl("dataUpload/selectFiles") + "&path=" + path, "GET", null, null, null, function (rs) {
        console.log(rs);
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        app.data = rs.result;
      });
    }
    // åˆ é™¤æ–‡ä»¶
    function deleteFiles2() {
      if (app.data == null) return;
      ajax(getUrl("dataUpload/deleteFiles"), "POST", JSON.stringify([data[0]]), null, null, function (rs) {
        console.log(rs);
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
@@ -186,7 +120,7 @@
      });
    }
    // Xls入库
    // Xls入库 *
    function insertXls() {
      if (app.data == null) return;
@@ -362,6 +296,42 @@
      });
    }
    // æŒ‚载附件
    function uploadAnnex() {
      var formData = new FormData();
      var fs = document.getElementById("file1");
      if (fs.files.length == 0) {
        alert("请选择要上传的文件!");
        return;
      }
      for (var i = 0, c = fs.files.length; i < c; i++) {
        formData.append("file", fs.files[i]); // fs.files[i].name,file
      }
      formData.append("ids", 1209);
      formData.append("ids", 1180);
      formData.append("ids", 1387);
      //$.ajax(getUrl("dataUpload/uploadXlsAnnex") + "&path=" + path + "&ids=1209&ids=1180&ids=1387", {
      $.ajax(getUrl("dataUpload/uploadXlsAnnex") + "&path=" + path, {
        type: "post",
        data: formData,
        async: true,
        cache: false,
        processData: false,
        contentType: false,
        success: function (rs) {
          console.log(rs);
          document.getElementById("file1").value = "";
          alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        },
        error: function (e) {
          console.error(e);
          document.getElementById("file3").value = "";
          alert("上传文件失败!");
        }
      });
    }
    // ç©ºé—´æ•°æ®å…¥åº“
    function insertDbFiles() {
      ajax(getUrl("dataUpload/insertFiles"), "POST", JSON.stringify(dbFiles), null, null, function (rs) {
@@ -402,25 +372,18 @@
    <hr />
    <br />
    æ•°æ®ä¸Šä¼ ï¼š
    <input id="file1" type="file" multiple="multiple" />
    <input value="上传文件" type="button" onclick="uploadFiles();" />
    <input value="查询文件" type="button" onclick="selectFiles();" />
    <input value="删除文件" type="button" onclick="deleteFiles();" />
    <input value="文件入库" type="button" onclick="insertFiles();" />
    <hr />
    <br />
    æ•°æ®å…¥åº“:
    <input id="file2" type="file" multiple="multiple" accept=".xls,.xlsx,.mdb,.shp.zip,.gdb.zip" />
    <input value="上传文件" type="button" onclick="uploadFiles2();" />
    <input value="查询文件 *" type="button" onclick="selectFiles2();" />
    <input value="删除文件" type="button" onclick="deleteFiles2();" />
    <input value="Xls入库" type="button" onclick="insertXls();" />
    <input id="file1" type="file" multiple="multiple" accept=".xls,.xlsx,.mdb,.zip" />
    <input value="查询目录 *" type="button" onclick="selectPath();" />
    <input value="上传文件" type="button" onclick="uploadFiles();" />
    <input value="查询文件 *" type="button" onclick="selectFiles();" />
    <input value="删除文件" type="button" onclick="deleteFiles();" />
    <!--<input value="Xls入库" type="button" onclick="insertXls();" />-->
    <input value="读取映射 *" type="button" onclick="readMappers();" />
    <input value="综合数据入库 *" type="button" onclick="insertAllFiles();" />
    <input value="空间数据入库 *" type="button" onclick="insertDbFiles();" />
    <input value="多文件入库 *" type="button" onclick="insertMultiFiles();" />
    <input value="挂载附件 *" type="button" onclick="uploadAnnex();" />
    <hr />
    <br />
JavaCode/JavaCode.csproj
@@ -113,16 +113,16 @@
    </None>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="BsTemplate\Entity.java">
    <EmbeddedResource Include="cs\BsTemplate\Entity.java">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="BsTemplate\Mapper.java">
    <EmbeddedResource Include="cs\BsTemplate\Mapper.java">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="BsTemplate\GeoMapper.java">
    <EmbeddedResource Include="cs\BsTemplate\GeoMapper.java">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="BsTemplate\GeoEntity.java">
    <EmbeddedResource Include="cs\BsTemplate\GeoEntity.java">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <Content Include="DLL\Mono.Security.dll" />