From e608048cf0ca1456e8c21ee54a97c7550eb7c3db Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 21 二月 2023 15:01:30 +0800 Subject: [PATCH] 1 --- DataLoader/MainWindow.xaml.cs | 6 ++ DataLoader/CS/Importor.cs | 24 ++++++------ DataLoader/MainWindow.xaml | 9 +++- JavaCode/App.config | 4 +- ExportMap/up.html | 19 ++++++++- JavaCode/FrmMyBatisPlus.cs | 2 JavaCode/JavaCode.csproj | 16 ++++++-- ExportMap/lf.html | 28 +++++++------- 8 files changed, 69 insertions(+), 39 deletions(-) diff --git a/DataLoader/CS/Importor.cs b/DataLoader/CS/Importor.cs index 401565e..b454147 100644 --- a/DataLoader/CS/Importor.cs +++ b/DataLoader/CS/Importor.cs @@ -95,7 +95,7 @@ vd.Meta.create_user = Tool.UserId; } - public static void ImportFiles(ObservableCollection<ViewData> viewDatas, string target) + public static void ImportFiles(ObservableCollection<ViewData> viewDatas, string target, int start) { Parallel.ForEach(viewDatas, (vd, ParallelLoopState) => { @@ -109,21 +109,15 @@ return; } - vd.Status = "鎻掑叆鏁版嵁搴�..."; - int start = GetSubPath(target, 1); - SysMeta mf = GetMetaFile(vd, start, guid); + vd.Status = "鑾峰彇鏁版嵁鐩綍..."; + int subPath = GetSubPath(target, start); + SysMeta mf = GetMetaFile(vd, subPath, guid); vd.Status = "澶嶅埗鏂囦欢..."; CopyFile(vd.FilePath, Path.Combine(target, mf.path)); - int metaId = InsertMeta(mf); - if (metaId == 0) - { - vd.Status = "鍏冩暟鎹嚭閿欙紒"; - return; - } - - vd.Status = "瀹屾垚銆�"; + vd.Status = "鍑嗗鍏ュ簱"; + vd.Meta = mf; } catch (Exception ex) { @@ -131,6 +125,12 @@ vd.Status = "澶辫触锛�"; } }); + + foreach (ViewData vd in viewDatas) + { + int metaId = InsertMeta(vd.Meta); + vd.Status = metaId == 0 ? "鍏冩暟鎹嚭閿欙紒" : "瀹屾垚銆�"; + } } public static void ImportFiles2(ObservableCollection<ViewData> viewDatas, string target) diff --git a/DataLoader/MainWindow.xaml b/DataLoader/MainWindow.xaml index f31e51c..8c06ecc 100644 --- a/DataLoader/MainWindow.xaml +++ b/DataLoader/MainWindow.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="500" Width="750" Loaded="Window_Loaded" - Title="鏁版嵁鍏ュ簱 v1.3" WindowStartupLocation="CenterScreen"> + Title="鏁版嵁鍏ュ簱 v1.4" WindowStartupLocation="CenterScreen"> <Window.Resources> <Style x:Key="btn" TargetType="Button"> <Setter Property="Background" Value="#005699"/> @@ -60,9 +60,11 @@ <Label Grid.Row="2" Grid.Column="0" Content="鍏ュ簱鐩綍锛�" VerticalAlignment="Center" HorizontalAlignment="Right" /> <TextBox x:Name="tbTarget" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Style="{StaticResource tb}" Text="{Binding Path=TargetPath, Mode=TwoWay}"/> - <Button x:Name="btnTarget" Grid.Row="2" Grid.Column="4" Content="閫� 鎷�" Style="{StaticResource btn}" Click="Target_MouseLeftButtonDown"/> - <ScrollViewer Grid.Row="3" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="4" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Margin="2"> + <Label Grid.Row="3" Grid.Column="0" Content="璧峰缂栧彿锛�" VerticalAlignment="Center" HorizontalAlignment="Right" /> + <TextBox x:Name="tbStart" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3" Style="{StaticResource tb}" Text="1"/> + + <ScrollViewer Grid.Row="4" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="4" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Margin="2"> <ListView x:Name="lvView"> <ListView.View> <GridView> @@ -83,6 +85,7 @@ </ListView> </ScrollViewer> + <Button x:Name="btnTarget" Grid.Row="2" Grid.Column="4" Content="閫� 鎷�" Style="{StaticResource btn}" Click="Target_MouseLeftButtonDown"/> <Button x:Name="btnLoad" Grid.Row="3" Grid.Column="4" Content="鍔� 杞�" Style="{StaticResource btn}" Click="Load_MouseLeftButtonDown"/> <Button x:Name="btnImport" Grid.Row="4" Grid.Column="4" Content="瀵� 鍏�" Style="{StaticResource btn}" Click="Import_MouseLeftButtonDown"/> </Grid> diff --git a/DataLoader/MainWindow.xaml.cs b/DataLoader/MainWindow.xaml.cs index d6103d2..f38af9d 100644 --- a/DataLoader/MainWindow.xaml.cs +++ b/DataLoader/MainWindow.xaml.cs @@ -169,9 +169,13 @@ { if (viewDatas.Count == 0) return; + string str = this.tbStart.Text.Trim(); + int start = 1; + int.TryParse(str, out start); + Thread thread = new Thread(new ThreadStart(() => { - Importor.ImportFiles(viewDatas, TargetPath); + Importor.ImportFiles(viewDatas, TargetPath, start); lvView.Dispatcher.BeginInvoke((ThreadStart)delegate { ICollectionView view = CollectionViewSource.GetDefaultView(viewDatas); diff --git a/ExportMap/lf.html b/ExportMap/lf.html index 8cfe080..5754538 100644 --- a/ExportMap/lf.html +++ b/ExportMap/lf.html @@ -7,6 +7,10 @@ <script src="js/rsa.min.js"></script> <script src="js/rollups.js"></script> <script> + var url = "http://127.0.0.1:12316/server/"; + var token = "?token=9c62ba00-5c82-40c2-a210-6aecc33e8c96"; + // 椤圭洰,绔欏満,绠¢亾涓績绾�,鎴樼暐閫氶亾,鐭㈤噺鍥�,褰卞儚娉ㄨ,褰卞儚鍥� + window.onload = function () { getPublicKey(); } @@ -170,21 +174,21 @@ }); } - function downloadShp() { + function downloadMarkShp() { var data = [ - { id: 1, name: "Point-1", props: "{}", wkt: "POINT(95.80461853400004 34.13862467200005)" }, - { id: 2, name: "Linestring-1", props: "{}", wkt: "LINESTRING(04.98985101830993 37.43840773692756,104.99318913447104 37.43883729720358)" }, - { id: 3, name: "Polygon-1", props: "{}", wkt: "POLYGON((104.9907822932683 37.43532941961706,104.99088987736599 37.43532941961706,104.9908670336867 37.4349030213574,104.99078327712658 37.4349030213574,104.9907822932683 37.43532941961706))" } + { id: 1, name: "Point-1", bak: "{}", wkt: "POINT(95.80461853400004 34.13862467200005)" }, + { id: 2, name: "Linestring-1", bak: "{}", wkt: "LINESTRING(04.98985101830993 37.43840773692756,104.99318913447104 37.43883729720358)" }, + { id: 3, name: "Polygon-1", bak: "{}", wkt: "POLYGON((104.9907822932683 37.43532941961706,104.99088987736599 37.43532941961706,104.9908670336867 37.4349030213574,104.99078327712658 37.4349030213574,104.9907822932683 37.43532941961706))" } ]; - ajax(url + "mark/downloadShp" + token, "POST", JSON.stringify(data), "json", null, function (rs) { + ajax(url + "comprehensive/downloadShp" + token, "POST", JSON.stringify(data), "json", null, function (rs) { alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result); // 涓嬭浇鏂囦欢 if (rs && rs.code == 200) { var a = document.createElement('a'); // 鍒涘缓涓�涓猘鏍囩鍏冪礌 a.style.display = 'none'; // 璁剧疆鍏冪礌涓嶅彲瑙� - // http://127.0.0.1:12316/mark/downloadFile?guid=5ce046cc05b186332775c03ac6792caf - a.href = url + "mark/downloadFile" + token + "&guid=" + rs.result; + // http://127.0.0.1:12316/server/comprehensive/downloadFile?guid=5f0d5b61ca8cd79a07502f308c2f4dcc + a.href = url + "comprehensive/downloadFile" + token + "&guid=" + rs.result; document.body.appendChild(a); // 鍔犲叆 a.click(); // 瑙﹀彂鐐瑰嚮,涓嬭浇 @@ -228,7 +232,7 @@ function downloadFile() { var a = document.createElement('a'); // 鍒涘缓涓�涓猘鏍囩鍏冪礌 a.style.display = 'none'; // 璁剧疆鍏冪礌涓嶅彲瑙� - a.href = url + "mark/downloadFile" + token + "&guid=" + "5ce046cc05b186332775c03ac6792caf"; + a.href = url + "comprehensive/downloadFile" + token + "&guid=" + "5ce046cc05b186332775c03ac6792caf"; document.body.appendChild(a); // 鍔犲叆 a.click(); // 瑙﹀彂鐐瑰嚮,涓嬭浇 @@ -254,7 +258,7 @@ return; } - $.ajax(url + "mark/uploadShp" + token, { + $.ajax(url + "comprehensive/uploadShp" + token, { type: "post", data: formData, async: true, @@ -319,10 +323,6 @@ } </script> <script> - var url = "http://127.0.0.1:12316/server/"; - var token = "?token=37da6489-9286-4cb6-9662-69d464238e9b"; - // 椤圭洰,绔欏満,绠¢亾涓績绾�,鎴樼暐閫氶亾,鐭㈤噺鍥�,褰卞儚娉ㄨ,褰卞儚鍥� - function exportMap1() { var page = $("#selectPage").find("option:selected").text(); var data = { @@ -394,8 +394,8 @@ <input type="button" value="Ajax涓婁紶" onclick="ajxUpload()" /> <input type="button" value="uploadData" onclick="uploadData();" /> <input type="button" value="uploadShpForWKT" onclick="uploadShpForWKT();" /> - <input type="button" value="uploadShp" onclick="downloadShp();" /> <input type="button" value="downloadFile" onclick="downloadFile();" /> + <input type="button" value="downloadMarkShp" onclick="downloadMarkShp();" /> <input type="button" value="uploadShpForMark" onclick="uploadShpForMark();" /> <input type="button" value="绠$嚎鍒嗘瀽" onclick="pipeAnalysis()" /> <input type="button" value="绠$嚎鍒嗘瀽涓嬭浇" onclick="downloadPipeReq()" /> diff --git a/ExportMap/up.html b/ExportMap/up.html index 0b38045..0ef9c9e 100644 --- a/ExportMap/up.html +++ b/ExportMap/up.html @@ -11,7 +11,7 @@ var app = {}; var path = "20230127"; var url = "http://127.0.0.1:12316/server/"; - var token = "dca04924-122a-4b1a-88b7-aca0c4a7ba47"; + var token = "ff471511-9bdb-40fc-bca0-559437954911"; $(function () { $("#pathSpan").html(path); @@ -32,7 +32,6 @@ }, error: function (e) { console.error(e); - fn(); } }); } @@ -184,6 +183,7 @@ } </script> <script> + // 璇锋眰涓嬭浇 function downloadReq() { var obj = { pwd: encrypt.encrypt("Test!321&456"), @@ -235,6 +235,20 @@ }; ajax(getUrl("dataLib/downloadDbReq"), "POST", JSON.stringify(obj), null, null, function (rs) { + console.log(rs); + alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result); + }); + } + + // 璇锋眰瀹炰綋涓嬭浇 + function downloadEntityReq() { + var obj = { + entities: ["bpachydrogeology"], // bpachydrogeology,bhydrogeologyattach + filter: null, + pwd: encrypt.encrypt("Test!321&456") + }; + + ajax(getUrl("dataLib/downloadEntityReq"), "POST", JSON.stringify(obj), null, null, function (rs) { console.log(rs); alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result); }); @@ -403,6 +417,7 @@ 绌洪棿鏁版嵁锛� <input value="璇锋眰涓嬭浇" type="button" onclick="downloadDbReq();" /> <input value="涓嬭浇鏂囦欢" type="button" onclick="selectDownloadFile();" /> + <input value="璇锋眰瀹炰綋涓嬭浇" type="button" onclick="downloadEntityReq();" /> <hr /> <br /> diff --git a/JavaCode/App.config b/JavaCode/App.config index a0f7406..a6ea01d 100644 --- a/JavaCode/App.config +++ b/JavaCode/App.config @@ -2,9 +2,9 @@ <configuration> <appSettings> <!-- 1639612 --> - <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;"/>--> <!-- 20582 --> - <!--<add key="pgConn" value="Server=192.168.20.39;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;"/> </appSettings> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> diff --git a/JavaCode/FrmMyBatisPlus.cs b/JavaCode/FrmMyBatisPlus.cs index bcf3c5a..13abb6c 100644 --- a/JavaCode/FrmMyBatisPlus.cs +++ b/JavaCode/FrmMyBatisPlus.cs @@ -17,7 +17,7 @@ public partial class FrmMyBatisPlus : Form { #region 鎴愬憳鍙橀噺+鏋勯�犲嚱鏁� - private static List<string> excludes = new List<string>() { "gid", "objectid", "eventid", "dirid", "depid", "verid", "createtime", "createuser", "updateuser", "updatetime", "geom", "shape_leng", "shape_area" }; + private static List<string> excludes = new List<string>() { "gid", "parentid", "objectid", "eventid", "dirid", "depid", "verid", "createtime", "createuser", "updateuser", "updatetime", "geom", "shape_leng", "shape_area" }; string baseDir = AppDomain.CurrentDomain.BaseDirectory; diff --git a/JavaCode/JavaCode.csproj b/JavaCode/JavaCode.csproj index 7427611..f2ad35c 100644 --- a/JavaCode/JavaCode.csproj +++ b/JavaCode/JavaCode.csproj @@ -113,10 +113,18 @@ </None> </ItemGroup> <ItemGroup> - <Content Include="BsTemplate\Entity.java" /> - <Content Include="BsTemplate\GeoEntity.java" /> - <Content Include="BsTemplate\GeoMapper.java" /> - <Content Include="BsTemplate\Mapper.java" /> + <EmbeddedResource Include="BsTemplate\Entity.java"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="BsTemplate\GeoEntity.java"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="BsTemplate\GeoMapper.java"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="BsTemplate\Mapper.java"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> <Content Include="DLL\Mono.Security.dll" /> <Content Include="DLL\Npgsql.dll" /> <Content Include="SysTemplate\pg.sql" /> -- Gitblit v1.9.3