| | |
| | | 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); |
| | |
| | | <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" /> |
对比新文件 |
| | |
| | | 锘縰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; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /// <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); |
| | | } |
| | |
| | | <?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"/> |