管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-07-30 110685ca201361af20d758fce7cf8a89ab5362b6
1
已添加1个文件
已修改4个文件
136 ■■■■ 文件已修改
ExportMap/Controllers/ConvertController.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/ExportMap.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/CommonUtils.cs 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/Tools.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JavaCode/App.config 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/Controllers/ConvertController.cs
@@ -230,7 +230,34 @@
                if (null != msg) return msg;
                string err = null;
                List<int> rs = Tools.DeleteFiles(args, ref err);
                List<int> rs = CommonUtils.DeleteFiles(args, ref err);
                if (null == rs || rs.Count == 0)
                {
                    return ResponseMsg<string>.fail(null == err ? "澶辫触" : err);
                }
                return ResponseMsg<string>.success("鎴愬姛", string.Join(",", rs), rs.Count);
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                return ResponseMsg<string>.fail(ex.Message);
            }
        }
        /// <summary>
        /// 鍒犻櫎浠诲姟
        /// </summary>
        [HttpPost]
        public ResponseMsg<string> DeleteTask([FromBody]XYZArgs args)
        {
            try
            {
                ResponseMsg<string> msg = checkArgs(args, true);
                if (null != msg) return msg;
                string err = null;
                List<int> rs = CommonUtils.DeleteTask(args, ref err);
                if (null == rs || rs.Count == 0)
                {
                    return ResponseMsg<string>.fail(null == err ? "澶辫触" : err);
ExportMap/ExportMap.csproj
@@ -145,6 +145,7 @@
    <Compile Include="Controllers\TerraController.cs" />
    <Compile Include="Controllers\UploadController.cs" />
    <Compile Include="cs\CacheUtils.cs" />
    <Compile Include="cs\CommonUtils.cs" />
    <Compile Include="cs\ConvertUtils.cs" />
    <Compile Include="cs\CustomMultipartFormDataStreamProvider.cs" />
    <Compile Include="cs\ExportUtil.cs" />
ExportMap/cs/CommonUtils.cs
对比新文件
@@ -0,0 +1,67 @@
锘縰sing ExportMap.db;
using ExportMap.Models;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
namespace ExportMap.cs
{
    public class CommonUtils
    {
        /// <summary>
        /// 鍒犻櫎鏂囦欢
        /// </summary>
        public static List<int> DeleteFiles(XYZArgs args, ref string err)
        {
            List<SysPublish> pubs = PubDBHelper.SelectPublishs(args.ids);
            if (null == pubs || pubs.Count == 0) return null;
            List<int> list = new List<int>();
            foreach (SysPublish pub in pubs)
            {
                try
                {
                    if (string.IsNullOrEmpty(pub.url) || string.IsNullOrEmpty(pub.path)) continue;
                    String path = SGUtils.LFData + "\\" + pub.path.Replace("\\tileset.json", "");
                    if (pub.url.Contains("/SG/") || !Directory.Exists(path))
                    {
                        list.Add(pub.id);
                        continue;
                    }
                    Tools.DelPath(path);
                    list.Add(pub.id);
                }
                catch (Exception ex)
                {
                    LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                    err = ex.Message;
                }
            }
            return list;
        }
        /// <summary>
        /// 鍒犻櫎浠诲姟
        /// </summary>
        public static List<int> DeleteTask(XYZArgs args, ref string err)
        {
            List<int> list = new List<int>();
            try
            {
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                err = ex.Message;
            }
            return list;
        }
    }
}
ExportMap/cs/Tools.cs
@@ -288,41 +288,6 @@
            }
        }
        /// <summary>
        /// 鍒犻櫎鏂囦欢
        /// </summary>
        public static List<int> DeleteFiles(XYZArgs args, ref string err)
        {
            List<SysPublish> pubs = PubDBHelper.SelectPublishs(args.ids);
            if (null == pubs || pubs.Count == 0) return null;
            List<int> list = new List<int>();
            foreach (SysPublish pub in pubs)
            {
                try
                {
                    if (string.IsNullOrEmpty(pub.url) || string.IsNullOrEmpty(pub.path)) continue;
                    String path = SGUtils.LFData + "\\" + pub.path.Replace("\\tileset.json", "");
                    if (pub.url.Contains("/SG/") || !Directory.Exists(path))
                    {
                        list.Add(pub.id);
                        continue;
                    }
                    DelPath(path);
                    list.Add(pub.id);
                }
                catch (Exception ex)
                {
                    LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                    err = ex.Message;
                }
            }
            return list;
        }
        [DllImport("ReadLas.dll")]
        public extern static int get_las_cs(string file_name);
    }
JavaCode/App.config
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<configuration>
  <appSettings>
    <!--<add key="pgConn" value="Server=127.0.0.1;Port=5433;Database=langfang;User Id=postgres;Password=postgres;"/>-->
    <add key="pgConn" value="Server=127.0.0.1;Port=5433;Database=langfang;User Id=postgres;Password=postgres;"/>
    <!--<add key="pgConn" value="Server=192.168.20.205;Port=5433;Database=langfang;User Id=postgres;Password=Postgres!_14_Lf;"/>-->
    <add key="pgConn" value="Server=192.168.20.83;Port=5433;Database=moon;User Id=postgres;Password=Postgres!_14_moon;"/>
    <!--<add key="pgConn" value="Server=192.168.20.83;Port=5433;Database=moon;User Id=postgres;Password=Postgres!_14_moon;"/>-->
  </appSettings>
  <startup> 
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>