|
|
|
|
@ -2787,14 +2787,14 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp<DroneCaseInfoSingl
|
|
|
|
|
// 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.xiangmu_no as caseNo,c.countyname,c.streetname,c.communityname,c.countyid,c.streetid,c.communityid,\r\n a.\"ProcessCode\" as processcode,a.\"ProcessId\" as processid,a.\"Type\" as type,a.\"ChildSchemeInfoCode\" as childSchemeInfoCode," +
|
|
|
|
|
$"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 ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工 问题整改','日常监管','监管问题整改','现场复核','监管接收')" +
|
|
|
|
|
$" 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" +
|
|
|
|
|
$"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,c.countyid,c.streetid,c.communityid," +
|
|
|
|
|
$"\r\n a.\"ProcessCode\" as processcode,a.\"ProcessId\" as processid,a.\"Type\" as type,a.\"ChildSchemeInfoCode\" as childSchemeInfoCode,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 ";
|
|
|
|
|
@ -2943,8 +2943,8 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp<DroneCaseInfoSingl
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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})) ";
|
|
|
|
|
// sqlpart = $" and (e.countyid in ({orgs}) or e.streetid in ({orgs}) or e.communityid in ({orgs})) ";
|
|
|
|
|
sqlpart = $" and (c.countyid in ({orgs}) or c.streetid in ({orgs}) or c.communityid in ({orgs})) ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var schemeCode = _configuration.GetSection("AppSetting:DroneCaseInfoSchemeCode").Value;
|
|
|
|
|
@ -2954,7 +2954,7 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp<DroneCaseInfoSingl
|
|
|
|
|
|
|
|
|
|
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' ";
|
|
|
|
|
$"b on a.\"ProcessId\"=b.\"Id\" \r\nLEFT JOIN drone_ssnyd c on b.\"InstanceInfo\"->>'pkeyValue'=c.\"Id\" where 1=1 ";
|
|
|
|
|
|
|
|
|
|
string sqlcount1 =
|
|
|
|
|
$"select count(a.*) from wf_task a LEFT JOIN wf_process " +
|
|
|
|
|
@ -2962,26 +2962,23 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp<DroneCaseInfoSingl
|
|
|
|
|
// $"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," +
|
|
|
|
|
sql = $"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,c.countyid,c.streetid,c.communityid,\r\n a.\"ProcessCode\" as processcode,a.\"ProcessId\" as processid,a.\"Type\" as type,a.\"ChildSchemeInfoCode\" as childSchemeInfoCode," +
|
|
|
|
|
$"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 ";
|
|
|
|
|
$"on b.\"InstanceInfo\"->>'pkeyValue'=c.\"Id\" where 1=1 and a.\"UnitName\" in ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工问题整改','日常监管','监管问题整改','现场复核','监管接收')" +
|
|
|
|
|
$" and a.\"State\"=1";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string sqlpart2 = sqlpart1 + $" and a.\"UnitName\" in ('开工核查','开工问题整改','建中核查','建中问题整改','完工核查','完工问题整改','日常监管','监管问题整改','现场复核','监管接收')";
|
|
|
|
|
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;
|
|
|
|
|
//var allCount1 = await client.Ado.GetIntAsync(sqlcount1 + sqlpart2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.caseNo))
|
|
|
|
|
{
|
|
|
|
|
//sqlpart = sqlpart + $" and e.xiangmu_no like '%" + req.caseNo + "%'";
|
|
|
|
|
sqlpart = sqlpart + $" and e.caseno like '%" + req.caseNo + "%'";
|
|
|
|
|
sqlpart = sqlpart + $" and c.xiangmu_no like '%" + req.caseNo + "%'";
|
|
|
|
|
//sqlpart = sqlpart + $" and e.caseno like '%" + req.caseNo + "%'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -3060,7 +3057,7 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp<DroneCaseInfoSingl
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sqlpart += $" ORDER BY e.createdate desc";
|
|
|
|
|
sqlpart += $" ORDER BY c.synchronoustime desc";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(sql + sqlpart);
|
|
|
|
|
@ -3827,6 +3824,196 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp<DroneCaseInfoSingl
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.jibenArea1) && !string.IsNullOrEmpty(req.jibenArea2))
|
|
|
|
|
{
|
|
|
|
|
sqlpart = sqlpart +
|
|
|
|
|
$" and CAST(COALESCE(NULLIF(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(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(yongjiujibennongtian_area, '')::numeric, 0) AS numeric)< " +
|
|
|
|
|
double.Parse(req.jibenArea2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sqlpart += $" ORDER BY synchronoustime desc";
|
|
|
|
|
var info = client.Ado.SqlQuery<CaseInfoTubanExport>(sql + sqlpart);
|
|
|
|
|
foreach (var item in info)
|
|
|
|
|
{
|
|
|
|
|
if ("其他".Equals(item.isIllegal))
|
|
|
|
|
{
|
|
|
|
|
item.actualUseTo = item.qitaUseTo;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Response<List<CaseInfoTubanExport>> response = new Response<List<CaseInfoTubanExport>>();
|
|
|
|
|
response.Result = info;
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
public Response<List<CaseInfoTubanExport>> ExprotLoadCaseInfoSsnyTuBanList(CaseInfoTuBanReq req)
|
|
|
|
|
{
|
|
|
|
|
var authStrategyContext = _auth.GetCurrentUser();
|
|
|
|
|
var user = authStrategyContext.User;
|
|
|
|
|
RefAsync<int> totalcount = 0;
|
|
|
|
|
string sql1 = "select min(\"Level\") from sys_userorg where \"UserId\"=" + user.Id;
|
|
|
|
|
int level = client.Ado.GetInt(sql1);
|
|
|
|
|
//该用户下包含所有部门
|
|
|
|
|
List<string> deplist = new List<string>();
|
|
|
|
|
string sqlpart = " ";
|
|
|
|
|
if (user != null && user.Id != -1 && level != 0)
|
|
|
|
|
{
|
|
|
|
|
var departs = client.Queryable<SysUserOrg>().Where(r => r.UserId == user.Id).ToList();
|
|
|
|
|
foreach (var item in departs)
|
|
|
|
|
{
|
|
|
|
|
var list = client.Queryable<SysOrg>().ToChildList(it => it.ParentId, item.OrgId)
|
|
|
|
|
?.Select(it => it.Id.ToString()).ToList();
|
|
|
|
|
deplist = deplist.Union(list).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string orgs = "\'" + string.Join("\',\'", deplist) + "\'";
|
|
|
|
|
sqlpart = $" and (countyid in ({orgs}) or streetid in ({orgs}) or communityid in ({orgs})) ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string sql =
|
|
|
|
|
$" select picihao,xjshenhejieguo,sjshenhejieguo,xianjiyijian,shijiyijian,verifyuser,case_description,hexiaoren,verifytime,hexiaotime,tubanlaiyuan,countyname,streetname,communityname,case_no as caseNo,synchronoustime identificationTime,area,\r\n gengdi_area as gengdiArea,typename,jieshou_people,jieshou_time,pandingyijushuoming,examiner_name,examine_time," +
|
|
|
|
|
$"transactor_name,transact_time,yongjiujibennongtian_area yongjiujibennongtianarea,remark,nongyongdi_area nongyongdiarea,shengtaibaohuhongxian_area shengtaibaohuhongxianarea," +
|
|
|
|
|
$"case when is_illegal=0 \r\n then '合法' when is_illegal=1 then '违法' when is_illegal=2 then '其他' else '违法' end as isIllegal,handle_status_name as handleStatusName," +
|
|
|
|
|
$"xiangmumc,xiangmuzhuti,actual_use_to as actualUseTo,case when weifaleixing=0 \r\n then '非农化违法用地' when weifaleixing=1 then '非粮化违法用地' end as weifaleixing," +
|
|
|
|
|
$"case when cast(measure_name AS numeric)=0 \r\n then '拆除复耕' when cast(measure_name AS numeric)=1 then '补办手续' end as measureName,\r\nqita_use_to as qitaUseTo,geomid\r\n from drone_ssnyd a " +
|
|
|
|
|
$" LEFT JOIN wf_process b on b.\"InstanceInfo\"->>'pkeyValue'=a.\"Id\" where 1=1 and is_closed=0 and b.\"Id\" is not null ";
|
|
|
|
|
if (req.year != 0)
|
|
|
|
|
{
|
|
|
|
|
sqlpart = sqlpart + $" and EXTRACT(YEAR FROM synchronoustime) = {req.year}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.startTime) && !string.IsNullOrEmpty(req.endTime))
|
|
|
|
|
{
|
|
|
|
|
DateTime datetime = DateTime.Parse(req.endTime);
|
|
|
|
|
DateTime datetime1 = datetime.AddDays(1);
|
|
|
|
|
sqlpart = sqlpart + $" and synchronoustime between TO_DATE('" + req.startTime +
|
|
|
|
|
$"','YYYY-MM-DD') and TO_DATE('" + datetime1.ToString("yyyy-MM-dd") + $"','YYYY-MM-DD')";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.weifaleixing))
|
|
|
|
|
{
|
|
|
|
|
// 判断违法
|
|
|
|
|
sqlpart = sqlpart + "and is_illegal = '1'";
|
|
|
|
|
sqlpart = sqlpart + $" and weifaleixing='" + req.weifaleixing + "'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.measureName))
|
|
|
|
|
{
|
|
|
|
|
// 判定违法
|
|
|
|
|
sqlpart = sqlpart + "and is_illegal = '1'";
|
|
|
|
|
sqlpart = sqlpart + $" and measure_name='" + req.measureName + "'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.typename))
|
|
|
|
|
{
|
|
|
|
|
sqlpart = sqlpart + $" and typename='" + req.typename + "'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.tubanlaiyuan))
|
|
|
|
|
{
|
|
|
|
|
var tubanlaiyuanList = req.tubanlaiyuan.Split(",").ToList();
|
|
|
|
|
sqlpart = sqlpart + $" and tubanlaiyuan in ('{string.Join("','", tubanlaiyuanList)}')";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.picihao))
|
|
|
|
|
{
|
|
|
|
|
sqlpart = sqlpart + $" and picihao='" + req.picihao + "'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.isBuildName))
|
|
|
|
|
{
|
|
|
|
|
sqlpart = sqlpart + $" and is_build_name='" + req.isBuildName + "'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (req.isIllegal < 5)
|
|
|
|
|
{
|
|
|
|
|
sqlpart = sqlpart + $" and is_illegal=" + req.isIllegal + "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.countyid))
|
|
|
|
|
{
|
|
|
|
|
sqlpart = sqlpart + $" and countyid='" + req.countyid + "'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.streetid))
|
|
|
|
|
{
|
|
|
|
|
sqlpart = sqlpart + $" and streetid='" + req.streetid + "'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.nowStatus))
|
|
|
|
|
{
|
|
|
|
|
string[] str = req.nowStatus.Split(",");
|
|
|
|
|
|
|
|
|
|
string strstatus = "";
|
|
|
|
|
for (int i = 0; i < str.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
strstatus = strstatus + "'" + str[i] + "'" + ",";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(strstatus))
|
|
|
|
|
{
|
|
|
|
|
string statuslist = strstatus.Substring(0, strstatus.Length - 1);
|
|
|
|
|
sqlpart = sqlpart + $" and handle_status_name in (" + statuslist + ")";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.caseNo))
|
|
|
|
|
{
|
|
|
|
|
sqlpart = sqlpart + $" and case_no like '%" + req.caseNo + "%'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.originalcaseno))
|
|
|
|
|
{
|
|
|
|
|
sqlpart = sqlpart + $" and original_case_no like '%" + req.originalcaseno + "%'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.tubanArea1) && !string.IsNullOrEmpty(req.tubanArea2))
|
|
|
|
|
{
|
|
|
|
|
sqlpart = sqlpart + $" and CAST(COALESCE(NULLIF(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(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(area, '')::numeric, 0) AS numeric)< " +
|
|
|
|
|
double.Parse(req.tubanArea2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.gengdiArea1) && !string.IsNullOrEmpty(req.gengdiArea2))
|
|
|
|
|
{
|
|
|
|
|
sqlpart = sqlpart + $" and CAST(COALESCE(NULLIF(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(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(gengdi_area, '')::numeric, 0) AS numeric)< " +
|
|
|
|
|
double.Parse(req.gengdiArea2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.jibenArea1) && !string.IsNullOrEmpty(req.jibenArea2))
|
|
|
|
|
{
|
|
|
|
|
sqlpart = sqlpart +
|
|
|
|
|
@ -6684,9 +6871,92 @@ public partial class DroneCaseInfoSingleApp : SqlSugarBaseApp<DroneCaseInfoSingl
|
|
|
|
|
Result = strings
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return new Response<List<string>>
|
|
|
|
|
{
|
|
|
|
|
Result = strings
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ExportCaseInfoSsnydShapefile(CaseInfoTuBanReq req, string shpFilePath, string shpFilePathzip)
|
|
|
|
|
{
|
|
|
|
|
var response = ExprotLoadCaseInfoSsnyTuBanList(req).Result;
|
|
|
|
|
List<CaseInfoTubanExport> list = new List<CaseInfoTubanExport>();
|
|
|
|
|
for (int i = 0; i < response.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
var caseinfo = response[i];
|
|
|
|
|
if (!string.IsNullOrEmpty(caseinfo.geomid))
|
|
|
|
|
{
|
|
|
|
|
list.Add(caseinfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<int> gids = list.SelectMany(item =>
|
|
|
|
|
item.geomid.Split(',')
|
|
|
|
|
.Select(id => int.TryParse(id, out var gid) ? gid : (int?)null)
|
|
|
|
|
.Where(gid => gid.HasValue)
|
|
|
|
|
.Select(gid => gid.Value)).ToList();
|
|
|
|
|
|
|
|
|
|
string gidsString = string.Join(",", gids);
|
|
|
|
|
//string query = $"SELECT a.gid, ST_AsText(a.geom) AS geom,b.tubanlaiyuan,b.case_no,b.countyname,b.streetname,b.communityname FROM drone_shp_data a left join drone_caseinfo_single b on a.relid=b.\"Id\" WHERE gid IN ({gidsString})";
|
|
|
|
|
string query =
|
|
|
|
|
$"SELECT gid,case_no,handle_status_name,typename,original_case_no,gengdi_area, is_illegal_name,is_intact_name," +
|
|
|
|
|
$"area,yongjiujibennongtian_area,xiangmumc,xiangmuzhuti,weifaleixing,measure_name,countyname,streetname,communityname,createtime,synchronoustime,tubanlaiyuan,ST_AsText(geom) AS geom FROM view_drone_caseinfo_shp WHERE gid IN ({gidsString})";
|
|
|
|
|
|
|
|
|
|
// 执行查询
|
|
|
|
|
var data = client.Ado.SqlQuery<dynamic>(query);
|
|
|
|
|
if (data == null || data.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("暂无数据");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<IFeature> features = new List<IFeature>();
|
|
|
|
|
|
|
|
|
|
foreach (var row in data)
|
|
|
|
|
{
|
|
|
|
|
var geometry = ParseGeometry(row.geom);
|
|
|
|
|
if (geometry == null)
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("数据不可用");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//var attributes = new AttributesTable
|
|
|
|
|
//{
|
|
|
|
|
// { "gid", row.gid },
|
|
|
|
|
// {"laiyuan",row.tubanlaiyuan==null?"无":row.tubanlaiyuan },
|
|
|
|
|
// {"case_no",row.case_no==null?"无":row.case_no },
|
|
|
|
|
// {"countyname",row.countyname==null?"无":row.countyname },
|
|
|
|
|
// {"streetname",row.streetname ==null?"无":row.streetname},
|
|
|
|
|
// {"comname",row.communityname ==null?"无":row.communityname}
|
|
|
|
|
|
|
|
|
|
//};
|
|
|
|
|
var attributes = new AttributesTable
|
|
|
|
|
{
|
|
|
|
|
{ "gid", row.gid },
|
|
|
|
|
{ "图斑编号", row.case_no == null ? "" : row.case_no },
|
|
|
|
|
{ "当前状态", row.handle_status_name == null ? "" : row.handle_status_name },
|
|
|
|
|
{ "判读状态", row.is_intact_name == null ? "" : row.is_intact_name },
|
|
|
|
|
{ "图斑类型", row.typename == null ? "" : row.typename },
|
|
|
|
|
{ "判定结果", row.is_illegal_name == null ? "" : row.is_illegal_name },
|
|
|
|
|
{ "图斑面积(亩)", row.area == null ? "" : row.area },
|
|
|
|
|
{ "耕地面积", row.gengdi_area == null ? "" : row.gengdi_area },
|
|
|
|
|
{ "永农面积", row.yongjiujibennongtian_area == null ? "" : row.yongjiujibennongtian_area },
|
|
|
|
|
{ "项目名称", row.xiangmumc == null ? "" : row.xiangmumc },
|
|
|
|
|
{ "违法类型", row.weifaleixing == null ? "" : row.weifaleixing.ToString() },
|
|
|
|
|
{ "处理措施", row.measure_name == null ? "" : row.measure_name },
|
|
|
|
|
{ "创建时间", row.synchronoustime == null ? "" : row.synchronoustime.ToString() },
|
|
|
|
|
{ "图斑来源", row.tubanlaiyuan == null ? "" : row.tubanlaiyuan },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IFeature feature = new Feature(geometry, attributes);
|
|
|
|
|
features.Add(feature);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (features.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("数据不可用");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 导出 SHP 文件及其关联文件
|
|
|
|
|
ExportToShapefileFour(shpFilePath, features);
|
|
|
|
|
// 将文件打包成 ZIP
|
|
|
|
|
CreateZipFromShapefiles(shpFilePath, shpFilePathzip);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|