You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
690 lines
39 KiB
690 lines
39 KiB
using System; |
|
using System.Collections.Generic; |
|
using System.Data; |
|
using System.Linq; |
|
using System.Text; |
|
using System.Threading.Tasks; |
|
using ESRI.ArcGIS.Geodatabase; |
|
|
|
namespace Kingo.RuleCheck |
|
{ |
|
|
|
/// <summary> |
|
/// 地类属性与举证照片逻辑性检查 |
|
/// </summary> |
|
public class DLSXYJZZPCheck : RuleCheckBase |
|
{ |
|
List<string> ruleMethodNames = new List<string>() { |
|
"JZ001","JZ002","JZ003","JZ004","JZ005","JZ007","JZ008","JZ009","JZ010","JZ011","JZ012","JZ013","WYZP011","BCSM001","BCSM002" |
|
}; |
|
|
|
public override List<RuleEntity> ExcuteCheck(string sourePath, IWorkspace workspace) |
|
{ |
|
return this.StartCheck(sourePath, workspace, ruleMethodNames); |
|
} |
|
|
|
public override List<RuleEntity> ExcuteCheck(IWorkspace workspace, List<string> layerNames, List<string> dataSetNames) |
|
{ |
|
return this.StartCheck(workspace, ruleMethodNames, layerNames, dataSetNames); |
|
} |
|
|
|
public override List<RuleEntity> ExcuteCheck(string sourePath, Dictionary<string, IWorkspace> workspace) |
|
{ |
|
return this.StartCheck(sourePath, workspace, ruleMethodNames); |
|
} |
|
|
|
|
|
public List<RuleEntity> JZ001() |
|
{ |
|
List<RuleEntity> result = new List<RuleEntity>(); |
|
try |
|
{ |
|
//2021/8/4修改当图斑无附件时,无法检测出来问题。SELECT * FROM (SELECT TBBSM,COUNT(1) AS GS FROM FJGX WHERE TBBSM IN (SELECT BSM FROM DTBDLTBGX WHERE DLBM IN ('0101','0102','0103')) GROUP BY TBBSM) WHERE GS<3 |
|
System.Data.DataTable dataTable = this.mdbHelper.ExecuteDataTable($"select bsm from DTBDLTBGX where DLBM IN ('0101','0102','0103') and bsm not in (select tbbsm FROM FJGX group by tbbsm having count(tbbsm) >0)"); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
foreach (DataRow item in dataTable.Rows) |
|
{ |
|
result.Add(new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = item[0].ToString(), |
|
ErrorTip = "耕地类图斑必须进行外业实地举证", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ001", |
|
RuleName = "耕地类图斑与举证照片逻辑性检查", |
|
RuleContent = "对于“地类编码”字段值域为“01类”的图斑,若不存在实地举证照片,认定为错误图斑。" |
|
}); |
|
} |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
RuleEntity ruleEntity = new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = "规则检查失败:" + ex.Message, |
|
ErrorTip = "耕地类图斑必须进行外业实地举证", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ001", |
|
RuleName = "耕地类图斑与举证照片逻辑性检查", |
|
RuleContent = "对于“地类编码”字段值域为“01类”的图斑,若不存在实地举证照片,认定为错误图斑。" |
|
}; |
|
result.Add(ruleEntity); |
|
} |
|
return result; |
|
} |
|
|
|
public List<RuleEntity> JZ002() |
|
{ |
|
List<RuleEntity> result = new List<RuleEntity>(); |
|
try |
|
{ |
|
DataTable dataTable = this.mdbHelper.ExecuteDataTable($"SELECT distinct A.BSM FROM DTBDLTBGX A LEFT JOIN FJGX B ON A.BSM=B.TBBSM WHERE A.DDTCBZ IN ('1301','1302','1303','1304') AND (B.TBBSM IS NULL OR B.TBBSM ='' or (A.LJLX IS NOT NULL and A.LJLX<>''))"); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
foreach (DataRow item in dataTable.Rows) |
|
{ |
|
result.Add(new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = item[0].ToString(), |
|
ErrorTip = "临时用地、光伏板区、推土区、拆除未尽区图斑必须进行外业实地举证,且不得标记类举类型", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ002", |
|
RuleName = "独立图层图斑与举证照片逻辑性检查", |
|
RuleContent = "对于“独立图层代码”字段值域为“1301”、“1302”、“1303”或“1304”的图斑,若“类举类型”字段不为“空”,认定为错误图斑。若不存在实地举证照片,认定为错误图斑" |
|
}); |
|
} |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
RuleEntity ruleEntity = new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = "规则检查失败:" + ex.Message, |
|
ErrorTip = "临时用地、光伏板区、推土区、拆除未尽区图斑必须进行外业实地举证,且不得标记类举类型", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ002", |
|
RuleName = "独立图层图斑与举证照片逻辑性检查", |
|
RuleContent = "对于“独立图层代码”字段值域为“1301”、“1302”、“1303”或“1304”的图斑,若“类举类型”字段不为“空”,认定为错误图斑。若不存在实地举证照片,认定为错误图斑" |
|
}; |
|
result.Add(ruleEntity); |
|
} |
|
return result; |
|
} |
|
|
|
public List<RuleEntity> JZ003() |
|
{ |
|
List<RuleEntity> result = new List<RuleEntity>(); |
|
//try |
|
//{ |
|
// DataTable dataTable = this.mdbHelper.ExecuteDataTable($"SELECT * FROM (SELECT TBBSM,COUNT(1) AS GS FROM FJGX WHERE TBBSM IN (SELECT BSM FROM DTBDLTBGX WHERE DLBM='1202') GROUP BY TBBSM) WHERE GS<3 "); |
|
// if (dataTable != null && dataTable.Rows.Count > 0) |
|
// { |
|
// foreach (DataRow item in dataTable.Rows) |
|
// { |
|
// result.Add(new RuleEntity() |
|
// { |
|
// CheckObject = "DTBDLTBGX", |
|
// ErrorId = item[0].ToString(), |
|
// ErrorTip = "设施农用地图斑必须存在特征照片", |
|
// ErrorType = "一类错误", |
|
// RuleCode = "JZ003", |
|
// RuleName = "设施农用地图斑与举证照片逻辑性检查", |
|
// RuleContent = "对于“地类编码”字段值域为“1202”的图斑,若不存在特征照片,认定为错误图斑" |
|
// }); |
|
// } |
|
// } |
|
//} |
|
//catch (Exception ex) |
|
//{ |
|
// RuleEntity ruleEntity = new RuleEntity() |
|
// { |
|
// CheckObject = "DTBDLTBGX", |
|
// ErrorId = "规则检查失败:" + ex.Message, |
|
// ErrorTip = "设施农用地图斑必须存在特征照片", |
|
// ErrorType = "一类错误", |
|
// RuleCode = "JZ003", |
|
// RuleName = "设施农用地图斑与举证照片逻辑性检查", |
|
// RuleContent = "对于“地类编码”字段值域为“1202”的图斑,若不存在特征照片,认定为错误图斑" |
|
// }; |
|
// result.Add(ruleEntity); |
|
//} |
|
return result; |
|
} |
|
|
|
public List<RuleEntity> JZ004() |
|
{ |
|
List<RuleEntity> result = new List<RuleEntity>(); |
|
try |
|
{ |
|
//2021/8/4修改 $"SELECT C.BSM FROM (SELECT A.BSM,B.TBBGMJ,B.BGQTBDLMJ,A.LJLX FROM DTBDLTBGX A LEFT JOIN DTBDLTBGXGC B ON A.BSM=B.BGHTBBSM WHERE B.BGQDLBM IN ({DLParams.nyd_dlbms}) AND B.BGHDLBM NOT IN ({DLParams.wlyd_dlbms})) C LEFT JOIN FJGX D ON C.BSM=D.TBBSM WHERE ((TBBGMJ>400 OR TBBGMJ/BGQTBDLMJ>0.3) AND (LJLX IS NOT NULL OR LJLX<>'')) OR D.TBBSM IS NULL OR D.TBBSM='' " |
|
var sql = $"select BGHTBBSM from DTBDLTBGXGC where BGQDLBM IN ('0101','0102','0103','0201','0201K','0202','0202K','0203','0203K','0204','0204K','0301','0301K','0302','0302K','0303','0304','0305','0306','0307','0307K','0401','0402','0403','0403K','1006','1103','1104','1104A','1104K','1107','1107A','1202','1203') and bghdlbm in ('0404','0404A','1108','1204','1205','1206','1207') and (TBBGMJ>400 or TBBGMJ/BGQTBDLMJ>0.3) and (BGHTBBSM not in(select tbbsm FROM FJGX group by tbbsm having count(tbbsm) >0) or BGHTBBSM not in (select bsm FROM DTBDLTBGX where ljlx='农变未'))"; |
|
DataTable dataTable = this.mdbHelper.ExecuteDataTable(sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
foreach (DataRow item in dataTable.Rows) |
|
{ |
|
result.Add(new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = item[0].ToString(), |
|
ErrorTip = "农用地变未利用地图斑必须存在实地举证照片,且类举类型必须为农变未", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ004", |
|
RuleName = "农用地变未利用地图斑与举证照片逻辑性检查", |
|
RuleContent = "对于DTBDLTBGXGC层中,变更前地类为农用地(地类编码属于01-03、0401-0403、1006、1103-1104、1107、1202-1203的)、变更后地类编码为0404、0404A、1108、1204、1205、1206、1207的,当面积大于等于400平方米,或占原图斑面积超过30%时,若相应DTBDLTBGX层图斑“类举类型”字段不为“农变未”,认定为错误图斑。若相应DTBDLTBGX层图斑不存在实地举证照片,认定为错误图斑。" |
|
}); |
|
} |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
RuleEntity ruleEntity = new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = "规则检查失败:" + ex.Message, |
|
ErrorTip = "设施农用地图斑必须存在特征照片,且类举类型必须为农变未", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ004", |
|
RuleName = "设施农用地图斑与举证照片逻辑性检查", |
|
RuleContent = "对于DTBDLTBGXGC层中,变更前地类为农用地(地类编码属于01-03、0401-0403、1006、1103-1104、1107、1202-1203的)、变更后地类编码为0404、0404A、1108、1204、1205、1206、1207的,当面积大于等于400平方米,或占原图斑面积超过30%时,若相应DTBDLTBGX层图斑“类举类型”字段不为“农变未”,认定为错误图斑。若相应DTBDLTBGX层图斑不存在实地举证照片,认定为错误图斑。" |
|
}; |
|
result.Add(ruleEntity); |
|
} |
|
return result; |
|
} |
|
|
|
public List<RuleEntity> JZ005() |
|
{ |
|
List<RuleEntity> result = new List<RuleEntity>(); |
|
try |
|
{ |
|
var sql = $"SELECT BSM FROM DTBDLTBGX WHERE ((LJLX is not null and LJLX<>'' and (tbybh is null or tbybh='')) or (bsm in (select tbbsm FROM FJGX group by tbbsm having count(tbbsm) >0)) and (tbybh is null or tbybh='') or (tbybh is not null and tbybh<>'' and (LJLX is null or LJLX='' or bsm in (select tbbsm FROM FJGX group by tbbsm having count(tbbsm) >0))))"; |
|
DataTable dataTable = this.mdbHelper.ExecuteDataTable(sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
foreach (DataRow item in dataTable.Rows) |
|
{ |
|
result.Add(new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = item[0].ToString(), |
|
ErrorTip = "采用实地举证或标记“类举类型”的图斑,图斑预编号不可为空", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ005", |
|
RuleName = "图斑预编号逻辑性检查", |
|
RuleContent = "(1)若“类举类型”字段不为“空”,且图斑预编号为“空”的,判定为错误图斑。若图斑存在实地举证照片,且图斑预编号为“空”,判定为错误图斑。(2)当“图斑预编号”不为空时,“类举类型”字段为空或图斑不存在实地举证照片,认定为错误图斑" |
|
}); |
|
} |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
RuleEntity ruleEntity = new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = "规则检查失败:" + ex.Message, |
|
ErrorTip = "采用实地举证或标记“类举类型”的图斑,图斑预编号不可为空", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ005", |
|
RuleName = "图斑预编号逻辑性检查", |
|
RuleContent = "(1)若“类举类型”字段不为“空”,且图斑预编号为“空”的,判定为错误图斑。若图斑存在实地举证照片,且图斑预编号为“空”,判定为错误图斑。(2)当“图斑预编号”不为空时,“类举类型”字段为空或图斑不存在实地举证照片,认定为错误图斑" |
|
}; |
|
result.Add(ruleEntity); |
|
} |
|
return result; |
|
} |
|
|
|
//public List<RuleEntity> JZ006() |
|
//{ |
|
// List<RuleEntity> result = new List<RuleEntity>(); |
|
// try |
|
// { |
|
// DataTable dataTable = this.mdbHelper.ExecuteDataTable($"SELECT A.BSM FROM DTBDLTBGX A LEFT JOIN FJGX B ON A.BSM=B.TBBSM WHERE A.LJLX IS NOT NULL AND A.LJLX<>'' AND B.TBBSM IS NOT NULL AND B.TBBSM<>'' GROUP BY A.BSM "); |
|
// if (dataTable != null && dataTable.Rows.Count > 0) |
|
// { |
|
// foreach (DataRow item in dataTable.Rows) |
|
// { |
|
// result.Add(new RuleEntity() |
|
// { |
|
// CheckObject = "DTBDLTBGX", |
|
// ErrorId = item[0].ToString(), |
|
// ErrorTip = "采用实地举证的图斑,不可标注类举类型", |
|
// ErrorType = "一类错误", |
|
// RuleCode = "JZ006", |
|
// RuleName = "图斑预编号与类举类型逻辑性检查", |
|
// RuleContent = "图斑存在实地举证照片时,若“类举类型”字段不为“空”,认定为错误图斑。" |
|
// }); |
|
// } |
|
// } |
|
// } |
|
// catch (Exception ex) |
|
// { |
|
// RuleEntity ruleEntity = new RuleEntity() |
|
// { |
|
// CheckObject = "DTBDLTBGX", |
|
// ErrorId = "规则检查失败:" + ex.Message, |
|
// ErrorTip = "采用实地举证的图斑,不可标注类举类型", |
|
// ErrorType = "一类错误", |
|
// RuleCode = "JZ006", |
|
// RuleName = "图斑预编号与类举类型逻辑性检查", |
|
// RuleContent = "图斑存在实地举证照片时,若“类举类型”字段不为“空”,认定为错误图斑。" |
|
// }; |
|
// result.Add(ruleEntity); |
|
// } |
|
// return result; |
|
//} |
|
|
|
public List<RuleEntity> JZ007() |
|
{ |
|
List<RuleEntity> result = new List<RuleEntity>(); |
|
try |
|
{ |
|
DataTable dataTable = this.mdbHelper.ExecuteDataTable($"SELECT BSM FROM DTBDLTBGX WHERE (TBYBH IS NOT NULL AND TBYBH<>'' AND SFJZ='否') OR (TBYBH='' AND SFJZ='是')"); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
foreach (DataRow item in dataTable.Rows) |
|
{ |
|
result.Add(new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = item[0].ToString(), |
|
ErrorTip = "实地举证或标记类举类型的图斑,“是否举证”字段需填“是”;否则,应填“否”", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ007", |
|
RuleName = "图斑举证信息填写检查", |
|
RuleContent = "若图斑“图斑预编号”字段不为空,“是否举证”字段值为“否”时,认定为错误图斑。当DLTB层图斑“图斑预编号”字段为空,“是否举证”字段值为“是”时,认定为错误图斑。" |
|
}); |
|
} |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
RuleEntity ruleEntity = new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = "规则检查失败:" + ex.Message, |
|
ErrorTip = "实地举证或标记类举类型的图斑,“是否举证”字段需填“是”;否则,应填“否”", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ007", |
|
RuleName = "图斑举证信息填写检查", |
|
RuleContent = "若图斑“图斑预编号”字段不为空,“是否举证”字段值为“否”时,认定为错误图斑。当DLTB层图斑“图斑预编号”字段为空,“是否举证”字段值为“是”时,认定为错误图斑。" |
|
}; |
|
result.Add(ruleEntity); |
|
} |
|
return result; |
|
} |
|
|
|
public List<RuleEntity> JZ008() |
|
{ |
|
List<RuleEntity> result = new List<RuleEntity>(); |
|
try |
|
{ |
|
string sql = "SELECT A.BSM FROM DTBDLTBGX A LEFT JOIN (SELECT BGHTBBSM,SUM(TBBGMJ) AS MJ FROM DTBDLTBGXGC where not((BGQDLBM=BGHDLBM or (BGHDLBM in ('0404A','1001A','1002A','1003A','1004A') and left(BGHDLBM,4)=BGQDLBM)) and BGHTBXHDM=BGQTBXHDM and BGHZZSXDM=BGQZZSXDM) GROUP BY BGHTBBSM) B ON A.BSM=B.BGHTBBSM WHERE B.MJ/A.TBMJ>0.1 AND not(SFGX=DLBM or (DLBM in ('0404A','1001A','1002A','1003A','1004A') and left(DLBM,4)=SFGX))"; |
|
DataTable dataTable = this.mdbHelper.ExecuteDataTable(sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
foreach (DataRow item in dataTable.Rows) |
|
{ |
|
result.Add(new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = item[0].ToString(), |
|
ErrorTip = "变化图斑“是否更新”字段应填写相应地类编码", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ008", |
|
RuleName = "变化图斑变更信息填写检查", |
|
RuleContent = "DTBDLTBGX层图斑相对于基础库变化部分的面积占图斑面积的比例在10%及以上时,若“是否更新”字段值不为相应“地类编码”,认定为错误图斑。" |
|
}); |
|
} |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
RuleEntity ruleEntity = new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = "规则检查失败:" + ex.Message, |
|
ErrorTip = "变化图斑“是否更新”字段应填写相应地类编码", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ008", |
|
RuleName = "变化图斑变更信息填写检查", |
|
RuleContent = "DTBDLTBGX层图斑相对于基础库变化部分的面积占图斑面积的比例在10%及以上时,若“是否更新”字段值不为相应“地类编码”,认定为错误图斑。" |
|
}; |
|
result.Add(ruleEntity); |
|
} |
|
return result; |
|
} |
|
|
|
public List<RuleEntity> JZ009() |
|
{ |
|
List<RuleEntity> result = new List<RuleEntity>(); |
|
try |
|
{ |
|
//2021/8/4修改 SELECT A.BSM FROM DTBDLTBGX A LEFT JOIN (SELECT BGHTBBSM,SUM(TBBGMJ) AS MJ FROM DTBDLTBGXGC GROUP BY BGHTBBSM) B ON A.BSM=B.BGHTBBSM WHERE B.MJ/A.TBMJ<0.1 AND SFGX<>'否' |
|
//2021/8/19修改 SELECT A.BSM,B.MJ/A.TBMJ FROM DTBDLTBGX A LEFT JOIN (SELECT BGHTBBSM,SUM(TBBGMJ) AS MJ FROM DTBDLTBGXGC S where S.BGHZZSXDM=S.BGQZZSXDM AND S.BGHTBXHDM=S.BGQTBXHDM AND (S.BGQDLBM=s.BGHDLBM or (s.BGHDLBM in ('0404A','1001A','1002A','1003A','1004A') and left(BGHDLBM,4)=S.BGQDLBM)) group by BGHTBBSM) B ON A.BSM=B.BGHTBBSM WHERE B.MJ/A.TBMJ>0.9 AND SFGX<>'否' |
|
var sql = $"SELECT A.BSM,B.MJ/A.TBMJ FROM DTBDLTBGX A LEFT JOIN (SELECT BGHTBBSM,SUM(TBBGMJ) AS MJ FROM DTBDLTBGXGC S where S.BGHZZSXDM=S.BGQZZSXDM AND S.BGHTBXHDM=S.BGQTBXHDM AND (S.BGQDLBM=s.BGHDLBM or (s.BGHDLBM in ('0404A','1001A','1002A','1003A','1004A') and left(BGHDLBM,4)=S.BGQDLBM)) group by BGHTBBSM) B ON A.BSM=B.BGHTBBSM WHERE B.MJ/A.TBMJ>0.9 AND SFGX<>'否'"; |
|
DataTable dataTable = this.mdbHelper.ExecuteDataTable(sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
foreach (DataRow item in dataTable.Rows) |
|
{ |
|
result.Add(new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = item[0].ToString(), |
|
ErrorTip = "未变化图斑“是否更新”字段应填写“否”", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ009", |
|
RuleName = "未变化图斑变更信息填写检查", |
|
RuleContent = "单图斑填写“地类编码”“种植属性代码”“图斑细化代码”【“地类编码”必填,“种植属性代码”“图斑细化代码”可以为空,为空时默认为已填写】,将这三个属性与单图斑叠加到的基础库图斑“地类编码”“种植属性代码”“图斑细化代码”进行比较,完全一致的部分认定为“未变化部分”【其中单图斑为0404A、1001A、1002A、1003A、1004A默认与基础库0404、1001、1002、1003、1004相同】,当“未变化部分”面积之和A占单图斑面积的比例大于等于90%时,若“是否更新”不为“否”认定为错误。" |
|
}); |
|
} |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
RuleEntity ruleEntity = new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = "规则检查失败:" + ex.Message, |
|
ErrorTip = "未变化图斑“是否更新”字段应填写“否”", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ009", |
|
RuleName = "未变化图斑变更信息填写检查", |
|
RuleContent = "DTBDLTBGX层图斑相对于基础库变化部分的面积占图斑面积的比例在10%以下时,若“是否更新”字段值不为“否”,认定为错误图斑。" |
|
}; |
|
result.Add(ruleEntity); |
|
} |
|
return result; |
|
} |
|
|
|
public List<RuleEntity> JZ010() |
|
{ |
|
List<RuleEntity> result = new List<RuleEntity>(); |
|
try |
|
{ |
|
var sql = $"select bsm from DTBDLTBGX where TBLX='JZ' and (LJLX NOT IN ('类举举证','承诺举证','军事用地','实地无法到达','图斑不够上图面积') and bsm not in (select tbbsm FROM FJGX group by tbbsm having count(tbbsm) > 0))"; |
|
DataTable dataTable = this.mdbHelper.ExecuteDataTable(sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
foreach (DataRow item in dataTable.Rows) |
|
{ |
|
result.Add(new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = item[0].ToString(), |
|
ErrorTip = "外业图斑必须实地举证", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ010", |
|
RuleName = "图斑修改类型与图斑预编号逻辑性检查", |
|
RuleContent = "若DLTB层图斑类型为“JZ”时,必须存在实地举证照片或“类举类型”字段为“类举举证”、“承诺举证”、“军事用地”、“实地无法到达”、“图斑不够上图面积”;否则,判定为错误图斑。" |
|
}); |
|
} |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
RuleEntity ruleEntity = new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = "规则检查失败:" + ex.Message, |
|
ErrorTip = "外业图斑必须实地举证", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ010", |
|
RuleName = "图斑修改类型与图斑预编号逻辑性检查", |
|
RuleContent = "若DLTB层图斑类型为“JZ”时,必须存在实地举证照片或“类举类型”字段为“类举举证”、“承诺举证”、“军事用地”、“实地无法到达”、“图斑不够上图面积”;否则,判定为错误图斑。" |
|
}; |
|
result.Add(ruleEntity); |
|
} |
|
return result; |
|
} |
|
|
|
//public List<RuleEntity> JZ011() |
|
//{ |
|
// List<RuleEntity> result = new List<RuleEntity>(); |
|
// try |
|
// { |
|
// DataTable dataTable = this.mdbHelper.ExecuteDataTable($"SELECT BSM FROM DTBDLTBGX WHERE TBLX='外业图斑' AND LJLX IS NOT NULL AND LJLX NOT IN ('类举','承诺举证','军事用地','无法到达')"); |
|
// if (dataTable != null && dataTable.Rows.Count > 0) |
|
// { |
|
// foreach (DataRow item in dataTable.Rows) |
|
// { |
|
// result.Add(new RuleEntity() |
|
// { |
|
// CheckObject = "DTBDLTBGX", |
|
// ErrorId = item[0].ToString(), |
|
// ErrorTip = "外业修改图斑若标注类举类型,只可为“类举”、“承诺举证”、“军事用地”、“无法到达”其中之一", |
|
// ErrorType = "一类错误", |
|
// RuleCode = "JZ011", |
|
// RuleName = "图斑修改类型与图斑类举类型逻辑性检查", |
|
// RuleContent = "当“图斑类型”为“外业图斑”时,“类举类型”字段若不为空,字段值需为“类举”、“承诺举证”、“军事用地”、“无法到达”其中之一;否则,认定为错误图斑。" |
|
// }); |
|
// } |
|
// } |
|
// } |
|
// catch (Exception ex) |
|
// { |
|
// RuleEntity ruleEntity = new RuleEntity() |
|
// { |
|
// CheckObject = "DTBDLTBGX", |
|
// ErrorId = "规则检查失败:" + ex.Message, |
|
// ErrorTip = "外业修改图斑若标注类举类型,只可为“类举”、“承诺举证”、“军事用地”、“无法到达”其中之一", |
|
// ErrorType = "一类错误", |
|
// RuleCode = "JZ011", |
|
// RuleName = "图斑修改类型与图斑类举类型逻辑性检查", |
|
// RuleContent = "当“图斑类型”为“外业图斑”时,“类举类型”字段若不为空,字段值需为“类举”、“承诺举证”、“军事用地”、“无法到达”其中之一;否则,认定为错误图斑。" |
|
// }; |
|
// result.Add(ruleEntity); |
|
// } |
|
// return result; |
|
//} |
|
|
|
public List<RuleEntity> JZ012() |
|
{ |
|
List<RuleEntity> result = new List<RuleEntity>(); |
|
try |
|
{ |
|
string sql = "SELECT BSM FROM DTBDLTBGX WHERE SFJZ='否' AND LENB(QKSM)<5"; |
|
DataTable dataTable = this.mdbHelper.ExecuteDataTable(sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
foreach (DataRow item in dataTable.Rows) |
|
{ |
|
result.Add(new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = item[0].ToString(), |
|
ErrorTip = "未举证图斑必须填写情况说明", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ012", |
|
RuleName = "“是否举证”填写情况逻辑性检查", |
|
RuleContent = "若图斑字段“是否举证”列为“否”,“情况说明”字段为空或小于5个字符,判定为错误图斑。" |
|
}); |
|
} |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
RuleEntity ruleEntity = new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = "规则检查失败:" + ex.Message, |
|
ErrorTip = "未举证图斑必须填写情况说明", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ012", |
|
RuleName = "“是否举证”填写情况逻辑性检查", |
|
RuleContent = "若图斑字段“是否举证”列为“否”,“情况说明”字段为空或小于5个字符,判定为错误图斑。" |
|
}; |
|
result.Add(ruleEntity); |
|
} |
|
return result; |
|
} |
|
|
|
public List<RuleEntity> JZ013() |
|
{ |
|
List<RuleEntity> result = new List<RuleEntity>(); |
|
try |
|
{ |
|
DataTable dataTable = this.mdbHelper.ExecuteDataTable($"SELECT BSM FROM DTBDLTBGX WHERE SFGX='否' AND (WBGYY IS NULL OR LENB(WBGYY)<5)"); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
foreach (DataRow item in dataTable.Rows) |
|
{ |
|
result.Add(new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = item[0].ToString(), |
|
ErrorTip = "未变化图斑必须填写未更新原因", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ013", |
|
RuleName = "未变化图斑逻辑性检查", |
|
RuleContent = "若图斑字段“是否更新”列为“否”,“未更新原因”字段为空或小于5个字符,判定为错误图斑。" |
|
}); |
|
} |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
RuleEntity ruleEntity = new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = "规则检查失败:" + ex.Message, |
|
ErrorTip = "未变化图斑必须填写未更新原因", |
|
ErrorType = "一类错误", |
|
RuleCode = "JZ013", |
|
RuleName = "未变化图斑逻辑性检查", |
|
RuleContent = "若图斑字段“是否更新”列为“否”,“未更新原因”字段为空或小于5个字符,判定为错误图斑。" |
|
}; |
|
result.Add(ruleEntity); |
|
} |
|
return result; |
|
} |
|
|
|
public List<RuleEntity> WYZP011() |
|
{ |
|
List<RuleEntity> result = new List<RuleEntity>(); |
|
try |
|
{ |
|
string sql = "select bsm from DTBDLTBGX where LJLX in ('','农变未','水旱轮作') and bsm not in (select tbbsm from(select gx.tbbsm,sum(case when mode='7' then 0 else 1 end) zpsum,sum(case when mode='7' then 1 else 0 end) wrjsum from FJGX gx left join WYHCFJ fj on gx.fjarg=fj.arg) where zpsum>=3 or wrjsum>=2)"; |
|
System.Data.DataTable dataTable = this.mdbHelper.ExecuteDataTable(sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
foreach (DataRow item in dataTable.Rows) |
|
{ |
|
result.Add(new RuleEntity() |
|
{ |
|
CheckObject = "外业举证照片", |
|
ErrorId = item[0].ToString(), |
|
ErrorTip = "非类举类型的外业图斑,举证照片总数不可少于3张", |
|
ErrorType = "一类错误", |
|
RuleCode = "WYZP011", |
|
RuleName = "举证照片总数量检查", |
|
RuleContent = "对于DTBDLTBGX层,若图斑“未举证类型”为“空”“农变未”“水旱轮作”时,举证照片总数少于3张时,判定为错误图斑" |
|
}); |
|
} |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
RuleEntity ruleEntity = new RuleEntity() |
|
{ |
|
CheckObject = "外业举证照片", |
|
ErrorId = "规则检查失败:" + ex.Message, |
|
ErrorTip = "非类举类型的外业图斑,举证照片总数不可少于3张", |
|
ErrorType = "一类错误", |
|
RuleCode = "WYZP011", |
|
RuleName = "举证照片总数量检查", |
|
RuleContent = "对于DTBDLTBGX层,若图斑“未举证类型”为“空”“农变未”“水旱轮作”时,举证照片总数少于3张时,判定为错误图斑" |
|
}; |
|
result.Add(ruleEntity); |
|
} |
|
return result; |
|
} |
|
|
|
public List<RuleEntity> BCSM001() |
|
{ |
|
List<RuleEntity> result = new List<RuleEntity>(); |
|
try |
|
{ |
|
string sql = "select bsm from DTBDLTBGX where LJLX='农变未' and LENB(NBWQKSM)<10"; |
|
System.Data.DataTable dataTable = this.mdbHelper.ExecuteDataTable(sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
foreach (DataRow item in dataTable.Rows) |
|
{ |
|
result.Add(new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = item[0].ToString(), |
|
ErrorTip = "标记“农变未”的图斑,“农变未情况说明”字段内容不可少于10个字符", |
|
ErrorType = "一类错误", |
|
RuleCode = "BCSM001", |
|
RuleName = "农变未图斑农变未情况说明逻辑性检查", |
|
RuleContent = "对于DTBDLTBGX层,若图斑“未举证类型”为“农变未”时,“农变未情况说明”字段不可小于10个字符;否则,判定为错误图斑。" |
|
}); |
|
} |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
RuleEntity ruleEntity = new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = "规则检查失败:" + ex.Message, |
|
ErrorTip = "标记“农变未”的图斑,“农变未情况说明”字段内容不可少于10个字符", |
|
ErrorType = "一类错误", |
|
RuleCode = "BCSM001", |
|
RuleName = "农变未图斑农变未情况说明逻辑性检查", |
|
RuleContent = "对于DTBDLTBGX层,若图斑“未举证类型”为“农变未”时,“农变未情况说明”字段不可小于10个字符;否则,判定为错误图斑。" |
|
}; |
|
result.Add(ruleEntity); |
|
} |
|
return result; |
|
} |
|
|
|
public List<RuleEntity> BCSM002() |
|
{ |
|
List<RuleEntity> result = new List<RuleEntity>(); |
|
try |
|
{ |
|
string sql = "select bsm from DTBDLTBGX where LJLX='水旱轮作' and LENB(SHLZQKSM)<10"; |
|
System.Data.DataTable dataTable = this.mdbHelper.ExecuteDataTable(sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
foreach (DataRow item in dataTable.Rows) |
|
{ |
|
result.Add(new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = item[0].ToString(), |
|
ErrorTip = "标记“水旱轮作”的图斑,“水旱轮作情况说明”字段内容不可少于10个字符", |
|
ErrorType = "一类错误", |
|
RuleCode = "BCSM002", |
|
RuleName = "水旱轮作图斑水旱轮作情况说明逻辑性检查", |
|
RuleContent = "对于DTBDLTBGX层,若图斑“未举证类型”为“水旱轮作”时,“水旱轮作情况说明”字段不可小于10个字符;否则,判定为错误图斑。" |
|
}); |
|
} |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
RuleEntity ruleEntity = new RuleEntity() |
|
{ |
|
CheckObject = "DTBDLTBGX", |
|
ErrorId = "规则检查失败:" + ex.Message, |
|
ErrorTip = "标记“水旱轮作”的图斑,“水旱轮作情况说明”字段内容不可少于10个字符", |
|
ErrorType = "一类错误", |
|
RuleCode = "WYZP011", |
|
RuleName = "水旱轮作图斑水旱轮作情况说明逻辑性检查", |
|
RuleContent = "对于DTBDLTBGX层,若图斑“未举证类型”为“水旱轮作”时,“水旱轮作情况说明”字段不可小于10个字符;否则,判定为错误图斑。" |
|
}; |
|
result.Add(ruleEntity); |
|
} |
|
return result; |
|
} |
|
} |
|
}
|
|
|