From 4031ec390f2d56ed061d00a3b333d9b186587b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=89=E6=88=90=E6=A5=BC?= <799806631@qq.com> Date: Sun, 25 May 2025 10:23:35 +0800 Subject: [PATCH 1/3] 1 --- .../ServiceApp/DroneCaseInfo/DroneCaseInfoSingleApp.cs | 10 +++++----- OpenAuth.WebApi/OpenAuth.WebApi.csproj.user | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenAuth.App/ServiceApp/DroneCaseInfo/DroneCaseInfoSingleApp.cs b/OpenAuth.App/ServiceApp/DroneCaseInfo/DroneCaseInfoSingleApp.cs index 3f0cac4..2412197 100644 --- a/OpenAuth.App/ServiceApp/DroneCaseInfo/DroneCaseInfoSingleApp.cs +++ b/OpenAuth.App/ServiceApp/DroneCaseInfo/DroneCaseInfoSingleApp.cs @@ -2790,16 +2790,16 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp>'pkeyValue'=c.\"Id\" where 1=1 and a.\"ProcessCode\"='004' and a.\"UnitName\" in ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工 问题整改','日常监管','监管问题整改','现场复核','子流程')" + + $"on b.\"InstanceInfo\"->>'pkeyValue'=c.\"Id\" where 1=1 and a.\"ProcessCode\"='004' and a.\"UnitName\" in ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工 问题整改','日常监管','监管问题整改','现场复核','监管接收')" + $" and a.\"State\"=1 ) UNION \r\n\r\n(select a.\"Id\" as taskId,a.\"UnitName\" as unitName,b.\"Title\" as title,c.synchronoustime as createDate,c.xiangmu_no as caseNo,c.countyname,c.streetname,c.communityname," + $"\r\n a.\"ProcessCode\" as processcode,a.\"ProcessId\" as processid,c.gengdi_area as gengdiArea,yongjiujibennongtian_area as yongjiujibennongtianArea ,nongyongdi_area as nongyongdiArea,c.geomid,c.\"Id\" as caseid\r\n" + $" from wf_task a LEFT JOIN wf_process b on a.\"ProcessId\"=b.\"Id\"\r\nLEFT JOIN drone_ssnyd_rcjg d on b.\"InstanceInfo\"->>'pkeyValue'=d.\"Id\" RIGHT JOIN drone_ssnyd c on c.\"Id\"=d.ssnyd_id where 1=1 " + - $" and a.\"ProcessCode\"='005' and a.\"UnitName\" in ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工 问题整改','日常监管','监管问题整改','现场复核','子流程') and a.\"State\"=1 )) e where 1=1 "; + $" and a.\"ProcessCode\"='005' and a.\"UnitName\" in ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工 问题整改','日常监管','监管问题整改','现场复核','监管接收') and a.\"State\"=1 )) e where 1=1 "; - string sqlpart2 = sqlpart1 + $" and a.\"UnitName\" in ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工问题整改','日常监管','监管问题整改','现场复核','子流程') and a.\"State\"=1 "; - allCount = await client.Ado.GetIntAsync(sqlcount + sqlpart2); - var allCount1 = await client.Ado.GetIntAsync(sqlcount1 + sqlpart2); + string sqlpart1 = sqlpart + $" and a.\"UnitName\" in ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工问题整改','日常监管','监管问题整改','现场复核','监管接收') and a.\"State\"=1 "; + allCount = await client.Ado.GetIntAsync(sqlcount + sqlpart1); + var allCount1 = await client.Ado.GetIntAsync(sqlcount1 + sqlpart1); allCount = allCount + allCount1; if (!string.IsNullOrEmpty(req.caseNo)) diff --git a/OpenAuth.WebApi/OpenAuth.WebApi.csproj.user b/OpenAuth.WebApi/OpenAuth.WebApi.csproj.user index b96aa8d..17081c6 100644 --- a/OpenAuth.WebApi/OpenAuth.WebApi.csproj.user +++ b/OpenAuth.WebApi/OpenAuth.WebApi.csproj.user @@ -3,7 +3,7 @@ MvcControllerEmptyScaffolder root/Common/MVC/Controller - D:\Projects\lanlingxian_ziranziyuanheguihua\OpenAuth.WebApi\Properties\PublishProfiles\IISProfile1.pubxml + E:\Project\2025_批后监管\OpenAuth.WebApi\Properties\PublishProfiles\IISProfile.pubxml OpenAuthApi From ec259a9b29c1ede8dfc467c1675878126ebe7bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=89=E6=88=90=E6=A5=BC?= <799806631@qq.com> Date: Sun, 25 May 2025 10:28:17 +0800 Subject: [PATCH 2/3] 1 --- .../DroneCaseInfo/DroneCaseInfoSingleApp.cs | 517 +++++++++--------- 1 file changed, 262 insertions(+), 255 deletions(-) diff --git a/OpenAuth.App/ServiceApp/DroneCaseInfo/DroneCaseInfoSingleApp.cs b/OpenAuth.App/ServiceApp/DroneCaseInfo/DroneCaseInfoSingleApp.cs index 2412197..79487d8 100644 --- a/OpenAuth.App/ServiceApp/DroneCaseInfo/DroneCaseInfoSingleApp.cs +++ b/OpenAuth.App/ServiceApp/DroneCaseInfo/DroneCaseInfoSingleApp.cs @@ -482,7 +482,7 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp c.identification_time > DateTime.Now.AddDays(-30) && c.identification_time < DateTime.Now.AddDays(-7)) //30天内 .WhereIF(req.out_time_flag == 5, c => c.identification_time < DateTime.Now.AddDays(-30)) //30天以上 - //是否处理 + //是否处理 .WhereIF(req.is_deal == 1, c => c.handle_status_id != 0 || (c.handle_status_id == 0 && c.is_jieshou == 1)) //是否整改完成 .WhereIF(req.is_complete == 0, c => c.handle_status_id != 2) @@ -1389,22 +1389,22 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp>'pkeyValue'=c.\"Id\" where 1=1 and a.\"ProcessCode\"='004' "; - string sqlcount1 = - $"select count(a.*) from wf_task a LEFT JOIN wf_process " + - $"b on a.\"ProcessId\"=b.\"Id\" \r\nLEFT JOIN drone_ssnyd_rcjg c on b.\"InstanceInfo\"->>'pkeyValue'=c.\"Id\" RIGHT JOIN drone_ssnyd d on d.\"Id\"=c.ssnyd_id where 1=1 and a.\"ProcessCode\"='005'"; + sqlcount = + $"select count(a.*) from wf_task a LEFT JOIN wf_process " + + $"b on a.\"ProcessId\"=b.\"Id\" \r\nLEFT JOIN drone_ssnyd c on b.\"InstanceInfo\"->>'pkeyValue'=c.\"Id\" where 1=1 and a.\"ProcessCode\"='004' "; + + string sqlcount1 = + $"select count(a.*) from wf_task a LEFT JOIN wf_process " + + $"b on a.\"ProcessId\"=b.\"Id\" \r\nLEFT JOIN drone_ssnyd_rcjg c on b.\"InstanceInfo\"->>'pkeyValue'=c.\"Id\" RIGHT JOIN drone_ssnyd d on d.\"Id\"=c.ssnyd_id where 1=1 and a.\"ProcessCode\"='005'"; // $"a.\"ProcessCode\"='" + // schemeCode + "' "; @@ -2795,11 +2795,11 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp>'pkeyValue'=d.\"Id\" RIGHT JOIN drone_ssnyd c on c.\"Id\"=d.ssnyd_id where 1=1 " + $" and a.\"ProcessCode\"='005' and a.\"UnitName\" in ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工 问题整改','日常监管','监管问题整改','现场复核','监管接收') and a.\"State\"=1 )) e where 1=1 "; - - string sqlpart1 = sqlpart + $" and a.\"UnitName\" in ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工问题整改','日常监管','监管问题整改','现场复核','监管接收') and a.\"State\"=1 "; - allCount = await client.Ado.GetIntAsync(sqlcount + sqlpart1); - var allCount1 = await client.Ado.GetIntAsync(sqlcount1 + sqlpart1); + + string sqlpart2 = sqlpart1 + $" and a.\"UnitName\" in ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工问题整改','日常监管','监管问题整改','现场复核','监管接收') and a.\"State\"=1 "; + allCount = await client.Ado.GetIntAsync(sqlcount + sqlpart2); + var allCount1 = await client.Ado.GetIntAsync(sqlcount1 + sqlpart2); allCount = allCount + allCount1; if (!string.IsNullOrEmpty(req.caseNo)) @@ -2807,7 +2807,7 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp(sql + sqlpart).ToPageListAsync(req.page, req.limit, totalcount); @@ -2907,10 +2907,10 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp dic = new Dictionary(); - + string sql = $"select a.\"Id\" as taskId,d.*\r\n from wf_task a LEFT JOIN wf_process b on a.\"ProcessId\"=b.\"Id\"\r\nLEFT JOIN drone_ssnyd_rcjg d " + - $" on b.\"InstanceInfo\"->>'pkeyValue'=d.\"Id\" where d.ssnyd_id='"+caseid+"' and is_lishi=1"; + $" on b.\"InstanceInfo\"->>'pkeyValue'=d.\"Id\" where d.ssnyd_id='" + caseid + "' and is_lishi=1"; var list = client.Ado.SqlQuery(sql); dic.Add("list", list); return new Response> @@ -2918,7 +2918,7 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp> loadStreet() + public Response> loadStreet() { var authStrategyContext = _auth.GetCurrentUser(); var user = authStrategyContext.User; @@ -3570,7 +3570,7 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp c.identification_time > DateTime.Now.AddDays(-30) && c.identification_time < DateTime.Now.AddDays(-7)) //30天内 .WhereIF(req.out_time_flag == 5, c => c.identification_time < DateTime.Now.AddDays(-30)) //30天以上 - //是否处理 - //.WhereIF(req.is_deal == 1, c => c.handle_status_id != 0 || (c.handle_status_id == 0 && c.is_examine == 1)) - //是否整改完成 + //是否处理 + //.WhereIF(req.is_deal == 1, c => c.handle_status_id != 0 || (c.handle_status_id == 0 && c.is_examine == 1)) + //是否整改完成 .WhereIF(req.is_complete == 0, c => c.handle_status_id != 2) //24小时未核查 // .WhereIF(req.is_not_deal_hour24 == 1, c => c.handle_status_id == 0 && (c.is_examine == null || c.is_examine == 0) && c.identification_time < DateTime.Now.AddDays(-1)) @@ -5679,15 +5679,16 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp0;"; + $"(select '" + geomwkt + $"' as geometry ) b) c where c.have_intersection>0;"; Console.Write(mianjisql); double gengdimianji = client.Ado.GetDouble(mianjisql); - tubanSplit.gengdi = Math.Round(gengdimianji*0.0015,2); + tubanSplit.gengdi = Math.Round(gengdimianji * 0.0015, 2); string jibensql = $"select sum(c.have_intersection) from (SELECT ST_Area(ST_Transform(st_setsrid(ST_Intersection(st_setsrid(ST_Force2D(a.geometry)\r\n , 4326)," + $"st_setsrid(ST_Force2D(b.geometry), 4326)),4326),4527)) AS have_intersection from geoserver_jibennongtian\r\n a ," + $"(select '" + geomwkt + $"' as geometry ) b) c where c.have_intersection>0;"; @@ -5703,8 +5704,8 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp0;"; double shengtaimianji = client.Ado.GetDouble(shengtaisql); tubanSplit.shengtaihongxian = Math.Round(shengtaimianji * 0.0015, 2); - string zongmianji = $"select sum(c.have_intersection) from (SELECT ST_Area(ST_Transform(st_setsrid(b.geometry, 4326), 4527)) AS have_intersection " + - $" from (select ST_Force2D('" + geomwkt + $"') as geometry) b) c"; + string zongmianji = $"select sum(c.have_intersection) from (SELECT ST_Area(ST_Transform(st_setsrid(b.geometry, 4326), 4527)) AS have_intersection " + + $" from (select ST_Force2D('" + geomwkt + $"') as geometry) b) c"; double totalmianji = client.Ado.GetDouble(zongmianji); tubanSplit.totalmianji = Math.Round(totalmianji * 0.0015, 2); return tubanSplit; @@ -5721,11 +5722,11 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp(sqlgeng); - tubanSplit.gengdituban = geng8.geomrounded; - } + /* if (!string.IsNullOrEmpty(tubanSplit.gengdituban)) + { + string sqlgeng = $"\r\nWITH test_abc AS (Select 1 as id,'"+ tubanSplit.gengdituban + $"' as geom )," + + $" original_points AS (\r\n\r\n SELECT \r\n id, \r\n (ST_DumpPoints(geom)).path[1] AS ring_index, \r\n (ST_DumpPoints(geom)).path[2] AS point_index, " + + $" ST_X((ST_DumpPoints(geom)).geom) AS lon,\r\n ST_Y((ST_DumpPoints(geom)).geom) AS lat\r\n FROM test_abc\r\n),\r\nrounded_points AS ( " + + $" SELECT \r\n id, ring_index,\r\n point_index,\r\n round(lon::numeric, 8) AS lon,\r\n round(lat::numeric, 8) AS lat\r\n FROM original_points\r\n)\r\n\r\nSELECT \r\n t.id,\r\n st_astext(ST_SetSRID(ST_MakePolygon(" + + $" ST_MakeLine(\r\n ARRAY(\r\n SELECT ST_MakePoint(p.lon, p.lat)\r\n FROM rounded_points p\r\n WHERE p.id = t.id AND p.ring_index = 1" + + $" ORDER BY p.point_index\r\n )\r\n )\r\n ), 4326)) AS geomrounded \r\nFROM test_abc t\r\nGROUP BY t.id;"; + var geng8 = client.Ado.SqlQuerySingle(sqlgeng); + tubanSplit.gengdituban = geng8.geomrounded; + } - if (!string.IsNullOrEmpty(tubanSplit.nongyongdituban)) - { - string sqlgeng = $"\r\nWITH test_abc AS (Select 1 as id,'" + tubanSplit.nongyongdituban + $"' as geom )," + - $" original_points AS (\r\n\r\n SELECT \r\n id, \r\n (ST_DumpPoints(geom)).path[1] AS ring_index, \r\n (ST_DumpPoints(geom)).path[2] AS point_index, " + - $" ST_X((ST_DumpPoints(geom)).geom) AS lon,\r\n ST_Y((ST_DumpPoints(geom)).geom) AS lat\r\n FROM test_abc\r\n),\r\nrounded_points AS ( " + - $" SELECT \r\n id, ring_index,\r\n point_index,\r\n round(lon::numeric, 8) AS lon,\r\n round(lat::numeric, 8) AS lat\r\n FROM original_points\r\n)\r\n\r\nSELECT \r\n t.id,\r\n st_astext(ST_SetSRID(ST_MakePolygon(" + - $" ST_MakeLine(\r\n ARRAY(\r\n SELECT ST_MakePoint(p.lon, p.lat)\r\n FROM rounded_points p\r\n WHERE p.id = t.id AND p.ring_index = 1" + - $" ORDER BY p.point_index\r\n )\r\n )\r\n ), 4326)) AS geomrounded \r\nFROM test_abc t\r\nGROUP BY t.id;"; - var geng8 = client.Ado.SqlQuerySingle(sqlgeng); - tubanSplit.nongyongdituban = geng8.geomrounded; - }*/ + if (!string.IsNullOrEmpty(tubanSplit.nongyongdituban)) + { + string sqlgeng = $"\r\nWITH test_abc AS (Select 1 as id,'" + tubanSplit.nongyongdituban + $"' as geom )," + + $" original_points AS (\r\n\r\n SELECT \r\n id, \r\n (ST_DumpPoints(geom)).path[1] AS ring_index, \r\n (ST_DumpPoints(geom)).path[2] AS point_index, " + + $" ST_X((ST_DumpPoints(geom)).geom) AS lon,\r\n ST_Y((ST_DumpPoints(geom)).geom) AS lat\r\n FROM test_abc\r\n),\r\nrounded_points AS ( " + + $" SELECT \r\n id, ring_index,\r\n point_index,\r\n round(lon::numeric, 8) AS lon,\r\n round(lat::numeric, 8) AS lat\r\n FROM original_points\r\n)\r\n\r\nSELECT \r\n t.id,\r\n st_astext(ST_SetSRID(ST_MakePolygon(" + + $" ST_MakeLine(\r\n ARRAY(\r\n SELECT ST_MakePoint(p.lon, p.lat)\r\n FROM rounded_points p\r\n WHERE p.id = t.id AND p.ring_index = 1" + + $" ORDER BY p.point_index\r\n )\r\n )\r\n ), 4326)) AS geomrounded \r\nFROM test_abc t\r\nGROUP BY t.id;"; + var geng8 = client.Ado.SqlQuerySingle(sqlgeng); + tubanSplit.nongyongdituban = geng8.geomrounded; + }*/ if (!string.IsNullOrEmpty(gengdigeom)) { difsql = difsql + $"(select ST_Force2D('" + gengdigeom + $"') as geom ) UNION"; @@ -5790,18 +5792,18 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp0;"; Console.Write(mianjisql); double gengdimianji = client.Ado.GetDouble(mianjisql); tubanSplit.gengdi = Math.Round(gengdimianji * 0.0015, 2); - /* string jibensql = $"select sum(c.have_intersection) from (SELECT ST_Area(ST_Transform(st_setsrid(ST_Intersection(st_setsrid(ST_Force2D(a.geometry)\r\n , 4326)," + - $"st_setsrid(ST_Force2D(b.geometry), 4326)),4326),4527)) AS have_intersection from geoserver_jibennongtian\r\n a ," + - $"(select '" + geomwkt + $"' as geometry ) b) c where c.have_intersection>0;"; - double jibenminaji = client.Ado.GetDouble(jibensql); - tubanSplit.jibennongtian = Math.Round(jibenminaji * 0.0015, 2);*/ + /* string jibensql = $"select sum(c.have_intersection) from (SELECT ST_Area(ST_Transform(st_setsrid(ST_Intersection(st_setsrid(ST_Force2D(a.geometry)\r\n , 4326)," + + $"st_setsrid(ST_Force2D(b.geometry), 4326)),4326),4527)) AS have_intersection from geoserver_jibennongtian\r\n a ," + + $"(select '" + geomwkt + $"' as geometry ) b) c where c.have_intersection>0;"; + double jibenminaji = client.Ado.GetDouble(jibensql); + tubanSplit.jibennongtian = Math.Round(jibenminaji * 0.0015, 2);*/ string nongyongsql = $"select sum(c.have_intersection) from (SELECT ST_Area(ST_Transform(st_setsrid(ST_Intersection(st_setsrid(ST_Force2D(a.geometry)\r\n , 4326)," + $"st_setsrid(ST_Force2D(b.geometry), 4326)),4326),4527)) AS have_intersection from geoserver_nongyongdi\r\n a ," + $"(select '" + geomwkt + $"' as geometry ) b) c where c.have_intersection>0;"; @@ -5811,7 +5813,7 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp0;"; @@ -5820,7 +5822,8 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp0;"; - + List nongyongmianji = client.Ado.SqlQuery(nongyongsql); tubanSplit.nongyongdituban = string.Join(",", nongyongmianji); string shengtaisql = $"select st_astext(c.geometry) from (SELECT a.geometry,ST_Area(ST_Transform(st_setsrid(ST_Intersection(st_setsrid(ST_Force2D(a.geometry)\r\n , 4326)," + $"st_setsrid(ST_Force2D(b.geometry), 4326)),4326),4527)) AS have_intersection from geoserver_shengtaihongxian\r\n a ," + $"(select '" + geomwkt + $"' as geometry ) b) c where c.have_intersection>0;"; - + List shengtaimianji = client.Ado.SqlQuery(shengtaisql); tubanSplit.shengtaihongxiantuban = string.Join(",", shengtaimianji); return tubanSplit; } - public List> rebackzhuantipic(string zhunti, string caseid) { - List> listobj = new List> (); - Zhuanti zhuanti = new Zhuanti (zhunti); - List> list = zhuanti.Names; + public List> rebackzhuantipic(string zhunti, string caseid) + { + List> listobj = new List>(); + Zhuanti zhuanti = new Zhuanti(zhunti); + List> list = zhuanti.Names; string daicha = zhuanti.daicha; string sql = $"select original_case_no from " + daicha + $" where \"Id\"='" + caseid + $"'"; string originalcaseno = client.Ado.GetString(sql); @@ -5870,8 +5874,10 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp(zhuantisql); - if (!string.IsNullOrEmpty(listdy.chufafujian)) - { - result = result + listdy.chufafujian + ","; - } + /* else if ("drone_caseinfo_stxf".Equals(dic["name"])) + { + string zhuantisql = $"select fujian chufafujian from " + dic["name"] + $" where original_case_no='" + originalcaseno + $"'"; + dynamic listdy = client.Ado.SqlQuerySingle(zhuantisql); + if (!string.IsNullOrEmpty(listdy.chufafujian)) + { + result = result + listdy.chufafujian + ","; + } - }*/ + }*/ else if ("drone_caseinfo_sthx".Equals(dic["name"])) { string zhuantisql = $"select anjianzhaopian as chufafujian from " + dic["name"] + $" where original_case_no='" + originalcaseno + $"' and is_closed = 0"; @@ -6068,7 +6074,7 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp listobj1 = new List(); for (int j = 0; j < listdys.Length; j++) { - + string path = listdys[j]; string sql2 = $"select * from drone_image_ref where \"FilePath\"='" + path + $"'"; dynamic listdy = client.Ado.SqlQuerySingle(sql2); if (listdy != null) { listobj1.Add(listdy); - + } - else { + else + { if (!string.IsNullOrEmpty(path)) { dynamic dy = new ExpandoObject(); dy.FilePath = path; listobj1.Add(dy); } - + } - - + + } dic.Add("val", listobj1); listobj.Add(dic); @@ -6111,9 +6118,9 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp /// /// - public async Task>> CopyImg(CopyImageReq req) + public async Task>> CopyImg(CopyImageReq req) { - using var httpClient = new HttpClient(); + using var httpClient = new HttpClient(); var config = ConfigHelper.GetConfigRoot(); var baseUrl = config["ImgServer"]; var url = baseUrl + "/api/Platform/NewCopyImg"; @@ -6138,9 +6145,9 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp(sql).First(); - + string sql = $"select * from drone_image_ref where \"FilePath\"='" + originalPath + $"'"; + DroneImageRef droneref = client.SqlQueryable(sql).First(); + if (droneref != null) { DroneImageRef droneImageRef = new DroneImageRef() @@ -6156,9 +6163,9 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp(droneImageRef).ExecuteCommandAsync(); } } - + } - + return new Response> { Result = strings @@ -6230,17 +6237,17 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp listdy = client.Ado.SqlQuery(zhuantisql); - if (listdy == null || listdy.Count == 0) - { - continue; - } - else - { - for (int j = 0; j < listdy.Count; j++) - { - if (!string.IsNullOrEmpty(listdy[j].chufafujian)) - { - result = result + listdy[j].chufafujian + ","; - } - if (!string.IsNullOrEmpty(listdy[j].luoshifile)) - { - result = result + listdy[j].luoshifile + ","; - } - if (!string.IsNullOrEmpty(listdy[j].fujianreform)) - { - result = result + listdy[j].fujianreform + ","; - } - } - } - } - else if ("drone_caseinfo_single".Equals(dic["name"])) -{ - string zhuantisql = $"select hefafujian as chufafujian,fujian luoshifile,qitafujian fujianreform,zhenggaifujian,yanshoubiao from " + dic["name"] + $" where original_case_no='" + originalcaseno + $"' and is_closed = 0 and \"Id\"!='" + caseid + $"'"; - List listdy = client.Ado.SqlQuery(zhuantisql); - if (listdy == null || listdy.Count == 0) - { - continue; - } - else - { - for (int j = 0; j < listdy.Count; j++) - { - if (!string.IsNullOrEmpty(listdy[j].chufafujian)) - { - result = result + listdy[j].chufafujian + ","; - } - if (!string.IsNullOrEmpty(listdy[j].luoshifile)) - { - result = result + listdy[j].luoshifile + ","; - } - if (!string.IsNullOrEmpty(listdy[j].fujianreform)) - { - result = result + listdy[j].fujianreform + ","; - } - if (!string.IsNullOrEmpty(listdy[j].zhenggaifujian)) - { - result = result + listdy[j].zhenggaifujian + ","; - } - - if (!string.IsNullOrEmpty(listdy[j].yanshoubiao)) { - result = result + listdy[j].yanshoubiao + ","; + result = result + listdy[j].chufafujian + ","; + } + if (!string.IsNullOrEmpty(listdy[j].luoshifile)) + { + result = result + listdy[j].luoshifile + ","; } } + } } - } - else if ("drone_caseinfo_wpxf".Equals(dic["name"])) -{ - string zhuantisql = $"select hefafujian as chufafujian,fujian luoshifile,qitafujian fujianreform,zhenggaifujian,yanshoubiao from " + dic["name"] + $" where original_case_no='" + originalcaseno + $"' and is_closed = 0 and \"Id\"!='" + caseid + $"'"; + else if ("drone_caseinfo_zdwt1".Equals(dic["name"])) + { + string zhuantisql = $"select hefafujian as chufafujian,fujian luoshifile,qitafujian fujianreform from " + dic["name"] + $" where original_case_no='" + originalcaseno + $"' and is_closed = 0 and \"Id\"!='" + caseid + $"'"; List listdy = client.Ado.SqlQuery(zhuantisql); if (listdy == null || listdy.Count == 0) { @@ -6340,32 +6284,95 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp listdy = client.Ado.SqlQuery(zhuantisql); + if (listdy == null || listdy.Count == 0) + { + continue; + } + else + { + for (int j = 0; j < listdy.Count; j++) { - result = result + listdy[j].luoshifile + ","; + if (!string.IsNullOrEmpty(listdy[j].chufafujian)) + { + result = result + listdy[j].chufafujian + ","; + } + if (!string.IsNullOrEmpty(listdy[j].luoshifile)) + { + result = result + listdy[j].luoshifile + ","; + } + if (!string.IsNullOrEmpty(listdy[j].fujianreform)) + { + result = result + listdy[j].fujianreform + ","; + } + if (!string.IsNullOrEmpty(listdy[j].zhenggaifujian)) + { + result = result + listdy[j].zhenggaifujian + ","; + } + + if (!string.IsNullOrEmpty(listdy[j].yanshoubiao)) + { + result = result + listdy[j].yanshoubiao + ","; + } } - if (!string.IsNullOrEmpty(listdy[j].fujianreform)) + } + } + else if ("drone_caseinfo_wpxf".Equals(dic["name"])) + { + string zhuantisql = $"select hefafujian as chufafujian,fujian luoshifile,qitafujian fujianreform,zhenggaifujian,yanshoubiao from " + dic["name"] + $" where original_case_no='" + originalcaseno + $"' and is_closed = 0 and \"Id\"!='" + caseid + $"'"; + List listdy = client.Ado.SqlQuery(zhuantisql); + if (listdy == null || listdy.Count == 0) + { + continue; + } + else + { + for (int j = 0; j < listdy.Count; j++) { - result = result + listdy[j].fujianreform + ","; - } - if (!string.IsNullOrEmpty(listdy[j].zhenggaifujian)) - { - result = result + listdy[j].zhenggaifujian + ","; - } + if (!string.IsNullOrEmpty(listdy[j].chufafujian)) + { + result = result + listdy[j].chufafujian + ","; + } + if (!string.IsNullOrEmpty(listdy[j].luoshifile)) + { + result = result + listdy[j].luoshifile + ","; + } + if (!string.IsNullOrEmpty(listdy[j].fujianreform)) + { + result = result + listdy[j].fujianreform + ","; + } + if (!string.IsNullOrEmpty(listdy[j].zhenggaifujian)) + { + result = result + listdy[j].zhenggaifujian + ","; + } if (!string.IsNullOrEmpty(listdy[j].yanshoubiao)) { result = result + listdy[j].yanshoubiao + ","; } } - } + } } else if ("drone_caseinfo_xcsj".Equals(dic["name"])) -{ - string zhuantisql = $"select hefafujian as chufafujian,fujian luoshifile,qitafujian fujianreform,zhenggaifujian,yanshoubiao from " + dic["name"] + $" where original_case_no='" + originalcaseno + $"' and is_closed = 0 and \"Id\"!='" + caseid + $"'"; + { + string zhuantisql = $"select hefafujian as chufafujian,fujian luoshifile,qitafujian fujianreform,zhenggaifujian,yanshoubiao from " + dic["name"] + $" where original_case_no='" + originalcaseno + $"' and is_closed = 0 and \"Id\"!='" + caseid + $"'"; List listdy = client.Ado.SqlQuery(zhuantisql); if (listdy == null || listdy.Count == 0) { @@ -6376,31 +6383,31 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp listdy = client.Ado.SqlQuery(zhuantisql); if (listdy == null || listdy.Count == 0) { @@ -6411,16 +6418,16 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp listdy = client.Ado.SqlQuery(zhuantisql); if (listdy == null || listdy.Count == 0) { @@ -6431,27 +6438,27 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp> listobj1 = new List>(); for (int j = 0; j < listdys.Length; j++) @@ -6463,7 +6470,7 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp Date: Sun, 25 May 2025 14:26:15 +0800 Subject: [PATCH 3/3] 1 --- .../DroneCaseInfo/DroneCaseInfoSingleApp.cs | 161 ++++++++++++++++++ .../DroneCaseInfoSingleController.cs | 7 + 2 files changed, 168 insertions(+) diff --git a/OpenAuth.App/ServiceApp/DroneCaseInfo/DroneCaseInfoSingleApp.cs b/OpenAuth.App/ServiceApp/DroneCaseInfo/DroneCaseInfoSingleApp.cs index 79487d8..b095b42 100644 --- a/OpenAuth.App/ServiceApp/DroneCaseInfo/DroneCaseInfoSingleApp.cs +++ b/OpenAuth.App/ServiceApp/DroneCaseInfo/DroneCaseInfoSingleApp.cs @@ -2918,6 +2918,167 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp>> LoadLanLingMyTask(TaskUncompletReq req) + { + //获取当前用户 + var authStrategyContext = _auth.GetCurrentUser(); + var user = authStrategyContext.User; + RefAsync totalcount = 0; + string sql1 = "select min(\"Level\") from sys_userorg where \"UserId\"=" + user.Id; + int level = client.Ado.GetInt(sql1); + //该用户下包含所有部门 + List deplist = new List(); + string sqlpart = " "; + string sqlpart1 = " "; + if (user != null && user.Id != -1 && level != 0) + { + var departs = client.Queryable().Where(r => r.UserId == user.Id).ToList(); + foreach (var item in departs) + { + var list = client.Queryable().ToChildList(it => it.ParentId, item.OrgId) + ?.Select(it => it.Id.ToString()).ToList(); + deplist = deplist.Union(list).ToList(); + } + + string orgs = "\'" + string.Join("\',\'", deplist) + "\'"; + sqlpart = $" and (e.countyid in ({orgs}) or e.streetid in ({orgs}) or e.communityid in ({orgs})) "; + sqlpart1 = $" and (c.countyid in ({orgs}) or c.streetid in ({orgs}) or c.communityid in ({orgs})) "; + } + + var schemeCode = _configuration.GetSection("AppSetting:DroneCaseInfoSchemeCode").Value; + string sql = ""; + string sqlcount = ""; + int allCount = 0; + + sqlcount = + $"select count(a.*) from wf_task a LEFT JOIN wf_process " + + $"b on a.\"ProcessId\"=b.\"Id\" \r\nLEFT JOIN drone_ssnyd c on b.\"InstanceInfo\"->>'pkeyValue'=c.\"Id\" where 1=1 and a.\"ProcessCode\"='004' "; + + string sqlcount1 = + $"select count(a.*) from wf_task a LEFT JOIN wf_process " + + $"b on a.\"ProcessId\"=b.\"Id\" \r\nLEFT JOIN drone_ssnyd_rcjg c on b.\"InstanceInfo\"->>'pkeyValue'=c.\"Id\" RIGHT JOIN drone_ssnyd d on d.\"Id\"=c.ssnyd_id where 1=1 and a.\"ProcessCode\"='005'"; + // $"a.\"ProcessCode\"='" + + // schemeCode + "' "; + + sql = $"select * from ((select a.\"Id\" as taskId,a.\"UnitName\" as unitName,b.\"Title\" as title,c.synchronoustime as createDate," + + $"c.xiangmu_no as caseNo,c.countyname,c.streetname,c.communityname,\r\n a.\"ProcessCode\" as processcode,a.\"ProcessId\" as processid," + + $"c.gengdi_area as gengdiArea,yongjiujibennongtian_area as yongjiujibennongtianArea ,nongyongdi_area as nongyongdiArea,c.geomid," + + $"c.\"Id\" as caseid\r\n from wf_task a LEFT JOIN wf_process b on a.\"ProcessId\"=b.\"Id\"\r\nLEFT JOIN drone_ssnyd c " + + $"on b.\"InstanceInfo\"->>'pkeyValue'=c.\"Id\" where 1=1 and a.\"ProcessCode\"='004' and a.\"UnitName\" in ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工 问题整改','日常监管','监管问题整改','现场复核','监管接收')" + + $" ) UNION \r\n\r\n(select a.\"Id\" as taskId,a.\"UnitName\" as unitName,b.\"Title\" as title,c.synchronoustime as createDate,c.xiangmu_no as caseNo,c.countyname,c.streetname,c.communityname," + + $"\r\n a.\"ProcessCode\" as processcode,a.\"ProcessId\" as processid,c.gengdi_area as gengdiArea,yongjiujibennongtian_area as yongjiujibennongtianArea ,nongyongdi_area as nongyongdiArea,c.geomid,c.\"Id\" as caseid\r\n" + + $" from wf_task a LEFT JOIN wf_process b on a.\"ProcessId\"=b.\"Id\"\r\nLEFT JOIN drone_ssnyd_rcjg d on b.\"InstanceInfo\"->>'pkeyValue'=d.\"Id\" RIGHT JOIN drone_ssnyd c on c.\"Id\"=d.ssnyd_id where 1=1 " + + $" and a.\"ProcessCode\"='005' and a.\"UnitName\" in ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工 问题整改','日常监管','监管问题整改','现场复核','监管接收'))) e where 1=1 "; + + + string sqlpart2 = sqlpart1 + $" and a.\"UnitName\" in ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工问题整改','日常监管','监管问题整改','现场复核','监管接收')"; + allCount = await client.Ado.GetIntAsync(sqlcount + sqlpart2); + var allCount1 = await client.Ado.GetIntAsync(sqlcount1 + sqlpart2); + allCount = allCount + allCount1; + + if (!string.IsNullOrEmpty(req.caseNo)) + { + sqlpart = sqlpart + $" and e.xiangmu_no like '%" + req.caseNo + "%'"; + } + + + + + if (!string.IsNullOrEmpty(req.tubanArea1) && !string.IsNullOrEmpty(req.tubanArea2)) + { + sqlpart = sqlpart + $" and CAST(COALESCE(NULLIF(c.area, '')::numeric, 0) AS numeric) between " + + double.Parse(req.tubanArea1) + " and " + + double.Parse(req.tubanArea2); + } + else if (!string.IsNullOrEmpty(req.tubanArea1) && string.IsNullOrEmpty(req.tubanArea2)) + { + sqlpart = sqlpart + $" and CAST(COALESCE(NULLIF(c.area, '')::numeric, 0) AS numeric)> " + + double.Parse(req.tubanArea1); + } + else if (string.IsNullOrEmpty(req.tubanArea1) && !string.IsNullOrEmpty(req.tubanArea2)) + { + sqlpart = sqlpart + $" and CAST(COALESCE(NULLIF(c.area, '')::numeric, 0) AS numeric)< " + + double.Parse(req.tubanArea2); + } + + if (!string.IsNullOrEmpty(req.gengdiArea1) && !string.IsNullOrEmpty(req.gengdiArea2)) + { + sqlpart = sqlpart + $" and CAST(COALESCE(NULLIF(c.gengdi_area, '')::numeric, 0) AS numeric) between " + + double.Parse(req.gengdiArea1) + + " and " + double.Parse(req.gengdiArea2); + } + else if (!string.IsNullOrEmpty(req.gengdiArea1) && string.IsNullOrEmpty(req.gengdiArea2)) + { + sqlpart = sqlpart + $" and CAST(COALESCE(NULLIF(c.gengdi_area, '')::numeric, 0) AS numeric)> " + + double.Parse(req.gengdiArea1); + } + else if (string.IsNullOrEmpty(req.gengdiArea1) && !string.IsNullOrEmpty(req.gengdiArea2)) + { + sqlpart = sqlpart + $" and CAST(COALESCE(NULLIF(c.gengdi_area, '')::numeric, 0) AS numeric)< " + + double.Parse(req.gengdiArea2); + } + + if (!string.IsNullOrEmpty(req.nongyongdiArea1) && !string.IsNullOrEmpty(req.nongyongdiArea2)) + { + sqlpart = sqlpart + + $" and CAST(COALESCE(NULLIF(c.nongyongdi_area, '')::numeric, 0) AS numeric) between " + + double.Parse(req.nongyongdiArea1) + + " and " + double.Parse(req.nongyongdiArea2); + } + else if (!string.IsNullOrEmpty(req.nongyongdiArea1) && string.IsNullOrEmpty(req.nongyongdiArea2)) + { + sqlpart = sqlpart + $" and CAST(COALESCE(NULLIF(c.nongyongdi_area, '')::numeric, 0) AS numeric)> " + + double.Parse(req.nongyongdiArea1); + } + else if (string.IsNullOrEmpty(req.nongyongdiArea1) && !string.IsNullOrEmpty(req.nongyongdiArea2)) + { + sqlpart = sqlpart + $" and CAST(COALESCE(NULLIF(c.nongyongdi_area, '')::numeric, 0) AS numeric)< " + + double.Parse(req.nongyongdiArea2); + } + + if (!string.IsNullOrEmpty(req.jibenArea1) && !string.IsNullOrEmpty(req.jibenArea2)) + { + sqlpart = sqlpart + + $" and CAST(COALESCE(NULLIF(c.yongjiujibennongtian_area, '')::numeric, 0) AS numeric) between " + + double.Parse(req.jibenArea1) + + " and " + double.Parse(req.jibenArea2); + } + else if (!string.IsNullOrEmpty(req.jibenArea1) && string.IsNullOrEmpty(req.jibenArea2)) + { + sqlpart = sqlpart + + $" and CAST(COALESCE(NULLIF(c.yongjiujibennongtian_area, '')::numeric, 0) AS numeric)> " + + double.Parse(req.jibenArea1); + } + else if (string.IsNullOrEmpty(req.jibenArea1) && !string.IsNullOrEmpty(req.jibenArea2)) + { + sqlpart = sqlpart + + $" and CAST(COALESCE(NULLIF(c.yongjiujibennongtian_area, '')::numeric, 0) AS numeric)< " + + double.Parse(req.jibenArea2); + } + + + sqlpart += $" ORDER BY e.createdate desc"; + + + Console.WriteLine(sql + sqlpart); + var info = await client.SqlQueryable(sql + sqlpart).ToPageListAsync(req.page, req.limit, totalcount); + + Dictionary dic = new Dictionary(); + dic.Add("allcount", allCount); + + PageInfo> list1 = new PageInfo> + { + Items = info, + Total = totalcount, + }; + dic.Add("list", list1); + return new Response> + { + Result = dic + }; + } + public Response> loadStreet() { var authStrategyContext = _auth.GetCurrentUser(); diff --git a/OpenAuth.WebApi/Controllers/ServiceControllers/DroneCaseInfoSingleController.cs b/OpenAuth.WebApi/Controllers/ServiceControllers/DroneCaseInfoSingleController.cs index 71120bb..4ad1a53 100644 --- a/OpenAuth.WebApi/Controllers/ServiceControllers/DroneCaseInfoSingleController.cs +++ b/OpenAuth.WebApi/Controllers/ServiceControllers/DroneCaseInfoSingleController.cs @@ -313,6 +313,13 @@ public class DroneCaseInfoSingleController : ControllerBase { return await _app.LoadLanLingChildTask(caseid); } + + [HttpGet] + public async Task>> LoadLanLingMyTask([FromQuery] TaskUncompletReq req) + { + return await _app.LoadLanLingMyTask(req); + } + [HttpGet] public Response> loadStreet() {