年度变更建库软件5.0版本
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.

1450 lines
72 KiB

6 months ago
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.Geodatabase;
namespace Kingo.RuleCheck
{
/// <summary>
/// 通用类表内逻辑性检查
/// </summary>
public class TYLBBNLJXCheck : RuleCheckBase
{
List<string> ruleMethodNames = new List<string>()
{
"BN001","BN002","BN003","DL010","DL011","DL021","DL022","DL023","DL031","DL032","DL033","DL041","DL042","DL043","DL044","DL045","DL051","DL052","DL053","DL054","DL055","DL056","DL057","XKDW001","DL061","DL062","DL071","DL072","DL073","BN004","DL081","DL082"
};
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);
}
/// <summary>
/// 地类编码与地类名称逻辑一致性检查(检查单图斑建库地类图斑层中地类编码与地类名称的对应关系是否满足建库方案相关规定。若不符合建库方案要求,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> BN001()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = "SELECT BSM,DLBM,DLMC FROM DTBDLTBGX";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
string dlbm = item["DLBM"].ToString();
string dlmc = item["DLMC"].ToString();
if (DLParams.DLBMDIC.ContainsKey(dlbm))
{
if (DLParams.DLBMDIC[dlbm] != dlmc)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "图斑地类编码与地类名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN001",
RuleName = "地类编码与地类名称逻辑一致性检查"
});
}
}
else
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "图斑地类编码与地类名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN001",
RuleName = "地类编码与地类名称逻辑一致性检查"
});
}
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "图斑地类编码与地类名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN001",
RuleName = "地类编码与地类名称逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 种植属性代码与种植属性名称逻辑一致性检查
/// </summary>
/// <returns></returns>
public List<RuleEntity> BN002()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
//'WG未耕种', 'LS种植粮食作物', 'FLS种植非粮食作物', 'LYFL粮与非粮轮作', 'LLJZ林粮间作', 'JKHF即可恢复','GCHF工程恢复',
string sql = "SELECT BSM,ZZSXDM,ZZSXMC from DTBDLTBGX WHERE ZZSXDM+ZZSXMC NOT IN('')";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
string zzsxdm = item["ZZSXDM"].ToString();
string zzsxmc = item["ZZSXMC"].ToString();
if (DLParams.ZZSCDIC.ContainsKey(zzsxdm))
{
if (DLParams.ZZSCDIC[zzsxdm] != zzsxmc)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "图斑种植属性代码与种植属性名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN002",
RuleContent= "检查DTBDLTBGX层中种植属性代码与种植属性名称的对应关系是否满足建库方案相关规定。若不符合建库方案要求,认定为错误图斑。",
RuleName = "种植属性代码与种植属性名称逻辑一致性检查"
});
}
}
else
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "图斑种植属性代码与种植属性名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN002",
RuleName = "种植属性代码与种植属性名称逻辑一致性检查"
});
}
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "图斑种植属性代码与种植属性名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN002",
RuleName = "种植属性代码与种植属性名称逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 图斑细化代码与图斑细化名称逻辑一致性检查
/// </summary>
/// <returns></returns>
public List<RuleEntity> BN003()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
//'HDGD河道耕地', 'HQGD湖区耕地', 'LQGD林区耕地', 'MQGD牧区耕地', 'SHGD沙荒耕地', 'SMGD石漠化耕地','YJGD盐碱化耕地', 'LQYD林区种植园用地', 'GCCD灌丛草地', 'HDGY火电工业用地', 'GTGY钢铁工业用地','MTGY煤炭工业用地', 'SNGY水泥工业用地', 'BLGY玻璃工业用地', 'DLGY电解铝工业用地', 'FQ废弃',
string sql = "SELECT BSM,TBXHDM,TBXHMC from DTBDLTBGX WHERE TBXHDM+TBXHMC NOT IN ('')";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
string tbxhdm = item["TBXHDM"].ToString();
string tbxhmc = item["TBXHMC"].ToString();
if (DLParams.TBXHDMDIC.ContainsKey(tbxhdm))
{
if (DLParams.TBXHDMDIC[tbxhdm] != tbxhmc)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "图斑图斑细化代码与图斑细化名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN003",
RuleContent= "检查DTBDLTBGX层中图斑细化代码与图斑细化名称的对应关系是否满足建库方案相关规定。若不符合建库方案要求,认定为错误图斑。",
RuleName = "图斑细化代码与图斑细化名称逻辑一致性检查"
});
}
}
else
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "图斑图斑细化代码与图斑细化名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN003",
RuleName = "图斑细化代码与图斑细化名称逻辑一致性检查"
});
}
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "图斑图斑细化代码与图斑细化名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN003",
RuleName = "图斑细化代码与图斑细化名称逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 耕地类型与地类编码逻辑一致性检查
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL010()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE DLBM IN ({DLParams.gd_dlbms}) AND GDLX<>'TT' AND GDLX<>'PD'";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "耕地类图斑“耕地类型”字段必须依据实地情况填写“TT”或“PD”",
ErrorType = "一类错误",
RuleCode = "DL010",
RuleContent= "对于调查为耕地类的图斑,耕地类型不为TT 梯田或PD 坡地的,认定为错误图斑。对于图斑地类不为01类,耕地类型不能标记TT和PD的图斑。",
RuleName = "耕地类型与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "耕地类图斑“耕地类型”字段必须依据实地情况填写“TT”或“PD”",
ErrorType = "一类错误",
RuleCode = "DL010",
RuleContent = "对于调查为耕地类的图斑,耕地类型不为TT 梯田或PD 坡地的,认定为错误图斑。对于图斑地类不为01类,耕地类型不能标记TT和PD的图斑。",
RuleName = "耕地类型与地类编码逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
public List<RuleEntity> DL011()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE DLBM not IN ({DLParams.gd_dlbms}) AND GDLX IN ('TT','PD')";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "标记耕地类型的图斑地类编码必须为耕地",
ErrorType = "一类错误",
RuleCode = "DL011",
RuleContent = "对于耕地类型为TT 梯田或PD 坡地的,若地类编码不为01类,认定为错误图斑",
RuleName = "耕地类型与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "标记耕地类型的图斑地类编码必须为耕地",
ErrorType = "一类错误",
RuleCode = "DL011",
RuleContent = "对于耕地类型为TT 梯田或PD 坡地的,若地类编码不为01类,认定为错误图斑",
RuleName = "耕地类型与地类编码逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 恢复属性代码与地类编码逻辑一致性检查(当图斑种植属性代码为JKHF、GCHF时,若地类编码不为0201、0201K、0202、0202K、0203、0203K、0204、0204K、0301、0301K、0302、0302K、0305、0307、0307K、0403K、0404、1104、1104A、1104K、其中之一,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL021()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE (ZZSXDM in ('JKHF','GCHF') and DLBM not in('0201','0201K','0202','0202K','0203','0203K','0204','0204K','0301','0301K','0302','0302K','0305','0307','0307K','0403K','0404A','1104','1104A','1104K'))";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "图斑标注恢复属性时,地类编码必须为工作分类中的02类、03类、0403K、0404A及1104类(包括带K地类)",
ErrorType = "一类错误",
RuleContent= "当图斑种植属性代码为JKHF、GCHF时,若地类编码不为0201、0201K、0202、0202K、0203、0203K、0204、0204K、0301、0301K、0302、0302K、0305、0307、0307K、0403K、0404A、1104、1104A、1104K、其中之一,认定为错误图斑",
RuleCode = "DL021",
RuleName = "恢复属性代码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "图斑标注恢复属性时,地类编码必须为工作分类中的02类、03类、0403K、0404A及1104类(包括带K地类)",
ErrorType = "一类错误",
RuleContent = "当图斑种植属性代码为JKHF、GCHF时,若地类编码不为0201、0201K、0202、0202K、0203、0203K、0204、0204K、0301、0301K、0302、0302K、0305、0307、0307K、0403K、0404A、1104、1104A、1104K、其中之一,认定为错误图斑",
RuleCode = "DL021",
RuleName = "恢复属性代码与地类编码逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 恢复属性代码与地类编码逻辑一致性检查(当图斑地类编码为0201、0202、0203、0204、0301、0302、0305、0307、0404、1104、1104A时,种植属性代码不为JKHF、GCHF或空,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL022()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE (DLBM IN ('0201','0202','0203','0204','0301','0302','0305','0307','0404A','1104','1104A') AND ZZSXDM NOT in ('JKHF','GCHF',''))";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "图斑地类编码为工作分类中的02类、03类、04类及1104类时(不包括带K地类),种植属性代码必须为JKHF、GCHF或空",
ErrorType = "一类错误",
RuleCode = "DL022",
RuleName = "恢复属性代码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "图斑地类编码为工作分类中的02类、03类、04类及1104类时(不包括带K地类),种植属性代码必须为JKHF、GCHF或空",
ErrorType = "一类错误",
RuleCode = "DL022",
RuleName = "恢复属性代码与地类编码逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 恢复属性代码与地类编码逻辑一致性检查(当图斑地类编码为0201K、0202K、0203K、0204K、0301K、0302K、0307K、0403K、1104K时,种植属性代码不为JKHF或GCHF,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL023()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE DLBM IN ('0201K','0202K','0203K','0204K','0301K','0302K','0307K','0403K','1104K') AND ZZSXDM<>'JKHF' AND ZZSXDM<>'GCHF' ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "图斑地类编码为带K地类时,种植属性代码必须为JKHF或GCHF",
ErrorType = "一类错误",
RuleCode = "DL023",
RuleName = "恢复属性代码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "图斑地类编码为带K地类时,种e植属性代码必须为JKHF或GCHF",
ErrorType = "一类错误",
RuleCode = "DL023",
RuleName = "恢复属性代码与地类编码逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 种植属性代码与地类编码逻辑一致性检查(当图斑种植属性代码为WG、LS、LLJZ、FLS、LYFL时,若地类编码不为01类,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL031()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE (DLBM NOT IN ('0101','0102','0103') AND ZZSXDM IN ('WG','LS','LLJZ','FLS','LYFL')) or (DLBM IN ('0101','0102','0103') AND ZZSXDM NOT IN ('WG','LS','LLJZ','FLS','LYFL'))";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "种植属性代码为WG、LS、LLJZ、FLS、LYFL时,地类编码需为01类",
ErrorType = "一类错误",
RuleCode = "DL031",
RuleContent= "当图斑种植属性代码为WG、LS、LLJZ、FLS、LYFL时,若地类编码不为01类,认定为错误图斑",
RuleName = "种植属性代码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "种植属性代码为WG、LS、LLJZ、FLS、LYFL时,地类编码需为01类",
ErrorType = "一类错误",
RuleCode = "DL031",
RuleContent = "当图斑种植属性代码为WG、LS、LLJZ、FLS、LYFL时,若地类编码不为01类,认定为错误图斑",
RuleName = "种植属性代码与地类编码逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 种植属性代码与地类编码逻辑一致性检查(当图斑地类编码为01类时,种植属性代码不为WG、LS、LLJZ、FLS、LYFL时,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL032()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE DLBM IN ({DLParams.gd_dlbms}) AND ZZSXDM NOT IN ('WG','LS','LLJZ','FLS','LYFL') ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "地类编码需为01类时,种植属性代码需为WG、LS、LLJZ、FLS、LYFL其中之一",
ErrorType = "一类错误",
RuleCode = "DL032",
RuleName = "种植属性代码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "地类编码需为01类时,种植属性代码需为WG、LS、LLJZ、FLS、LYFL其中之一",
ErrorType = "一类错误",
RuleCode = "DL032",
RuleName = "种植属性代码与地类编码逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 种植属性代码与地类编码逻辑一致性检查(当图斑地类编码为5以及本条(2)(3)外的其余地类编码,若图斑种植属性代码不为空,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL033()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE (ZZSXDM<>'' and DLBM not in ('0101','0102','0103','0201','0202','0203','0204','0301','0302','0305','0307','0404A','1104','1104A','1104K','0201K','0202K','0203K','0204K','0301K','0302K','0307K','0403K'))";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "非工作分类中的01类、02类、03类、0403K、0404及1104类,不可填写种植属性代码",
ErrorType = "一类错误",
RuleContent= "当图斑地类编码为0101、0102、0103、0201、0202、0203、0204、0301、0302、0305、0307、0404A、1104、1104A、0201K、0202K、0203K、0204K、0301K、0302K、0307K、0403K外的其余地类编码,若图斑种植属性代码不为空,认定为错误图斑",
RuleCode = "DL033",
RuleName = "种植属性代码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "非工作分类中的01类、02类、03类、0403K、0404及1104类,不可填写种植属性代码",
ErrorType = "一类错误",
RuleContent = "当图斑地类编码为0101、0102、0103、0201、0202、0203、0204、0301、0302、0305、0307、0404A、1104、1104A、0201K、0202K、0203K、0204K、0301K、0302K、0307K、0403K外的其余地类编码,若图斑种植属性代码不为空,认定为错误图斑",
RuleCode = "DL033",
RuleName = "种植属性代码与地类编码逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 城镇村属性码与地类编码逻辑一致性检查(地类编码为05H1、0508、0602、0603、0701、0702、08H1、08H2、0809、0810、09、1004、1005、1201其中之一时,若城镇村属性码为空、201A、202A或203A其中之一时,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL041()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE DLBM IN ('05H1','0508','0602','0603','0701','0702','08H1','08H2','08H2A','0809','0810','0810A','09','1004','1005','1201') AND (CZCSXM IS NULL OR CZCSXM='' OR CZCSXM='201A' OR CZCSXM='202A' OR CZCSXM='203A') ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "非工业用地的建设用地,城镇村属性码不可为空,或标注201A、202A或203A",
ErrorType = "一类错误",
RuleCode = "DL041",
RuleContent= "地类编码为05H1、0508、0602、0603、0701、0702、08H1、08H2、08H2A、0809、0810、0810A、09、1004、1005、1201其中之一时,若城镇村属性码为空、201A、202A或203A其中之一时,认定为错误图斑。",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "非工业用地的建设用地,城镇村属性码不可为空,或标注201A、202A或203A",
ErrorType = "一类错误",
RuleCode = "DL041",
RuleContent = "地类编码为05H1、0508、0602、0603、0701、0702、08H1、08H2、08H2A、0809、0810、0810A、09、1004、1005、1201其中之一时,若城镇村属性码为空、201A、202A或203A其中之一时,认定为错误图斑。",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 城镇村属性码与地类编码逻辑一致性检查(当地类编码为0601时,城镇村属性码标注为空时,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL042()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE DLBM='0601' AND CZCSXM='' ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "工业用地城镇村属性码不可为空",
ErrorType = "一类错误",
RuleCode = "DL042",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "工业用地城镇村属性码不可为空",
ErrorType = "一类错误",
RuleCode = "DL042",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 城镇村属性码与地类编码逻辑一致性检查(当城镇村属性码为204时,地类编码必须为0602或0603;否则,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL043()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE DLBM NOT IN ('0602','0603') AND CZCSXM='204' ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "城镇村属性码为204的图斑,地类编码必须为0602或0603",
ErrorType = "一类错误",
RuleCode = "DL043",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "城镇村属性码为204的图斑,地类编码必须为0602或0603",
ErrorType = "一类错误",
RuleCode = "DL043",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 城镇村属性码与地类编码逻辑一致性检查(当城镇村属性码为205时,地类编码必须为09)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL044()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE DLBM<>'09' AND CZCSXM='205' ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "城镇村属性码为205的图斑,地类编码必须为09",
ErrorType = "一类错误",
RuleCode = "DL044",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "城镇村属性码为205的图斑,地类编码必须为09",
ErrorType = "一类错误",
RuleCode = "DL044",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 地类编码为1001、1002、1003、1006、1007、1008、1009、1109,或非建设用地的图斑,城镇村属性码为201、202、203、204、205,或为空
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL045()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE DLBM NOT IN ('05H1','0508','0601','0602','0603','0701','0702','08H1','08H2','08H2A','0809','0810','0810A','09','1004','1005','1201') AND CZCSXM not in ('')";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "地类编码不为05-09、1004、1005、1201的图斑时,城镇村属性码必须为空",
ErrorType = "一类错误",
RuleCode = "DL045",
RuleContent= "除以上地类编码外的其余图斑,城镇村属性码需为空",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "地类编码不为05-09、1004、1005、1201的图斑时,城镇村属性码必须为空",
ErrorType = "一类错误",
RuleCode = "DL045",
RuleContent = "除以上地类编码外的其余图斑,城镇村属性码需为空",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 图斑细化标注逻辑性检查(当地类编码不为01类、02类、03类、04类、0601、0602、1001、1003,或属于湿地的,图斑细化标注不为空时,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL051()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE DLBM NOT IN ('0101','0102','0103','0201','0201K','0202','0202K','0203','0203K','0204','0204K','0301','0301K','0302','0302K','0305','0307','0307K','0401','0403','0403K','0404','0404A','0601','0602','1001','1003','0303','0304','0306','0402','0603','1105','1106','1108') AND TBXHDM<>'' ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "地类编码不为01类、02类、03类、04类、0601、0602、1001、1003,或属于湿地的,不可填写图斑细化标注",
ErrorType = "一类错误",
RuleContent= "当地类编码不为01类、02类、03类、04类、0601、0602、1001、1003,或属于湿地的,图斑细化标注不为空时,认定为错误图斑。",
RuleCode = "DL051",
RuleName = "图斑细化标注逻辑性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "地类编码为01类、02类、03类、04类、0601、0602、1001、1003,或属于湿地的,不可填写图斑细化标注",
ErrorType = "一类错误",
RuleContent = "当地类编码不为01类、02类、03类、04类、0601、0602、1001、1003,或属于湿地的,图斑细化标注不为空时,认定为错误图斑。",
RuleCode = "DL051",
RuleName = "图斑细化标注逻辑性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 图斑细化标注逻辑性检查(当图斑细化代码为HDGD、HQGD、LQGD、MQGD、SHGD、SMGD、YJGD时,地类编码不为01类时,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL052()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE TBXHDM IN ('HDGD','HQGD','LQGD','MQGD','SHGD','SMGD','YJGD') AND DLBM NOT IN ({DLParams.gd_dlbms}) ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "当图斑细化代码为HDGD、HQGD、LQGD、MQGD、SHGD、SMGD、YJGD时,地类编码必须为01类",
ErrorType = "一类错误",
RuleCode = "DL052",
RuleName = "图斑细化标注逻辑性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "当图斑细化代码为HDGD、HQGD、LQGD、MQGD、SHGD、SMGD、YJGD时,地类编码必须为01类",
ErrorType = "一类错误",
RuleCode = "DL052",
RuleName = "图斑细化标注逻辑性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 图斑细化标注逻辑性检查(当图斑细化代码为HDGY、GTGY、MTGY、SNGY、BLGY、DLGY,地类编码不为0601的,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL053()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE TBXHDM IN ('HDGY','GTGY','MTGY','SNGY','BLGY','DLGY') AND DLBM<>'0601' ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "当图斑细化代码为HDGY、GTGY、MTGY、SNGY、BLGY、DLGY的,地类编码必须为0601",
ErrorType = "一类错误",
RuleCode = "DL053",
RuleName = "图斑细化标注逻辑性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "当图斑细化代码为HDGY、GTGY、MTGY、SNGY、BLGY、DLGY的,地类编码必须为0601",
ErrorType = "一类错误",
RuleCode = "DL053",
RuleName = "图斑细化标注逻辑性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 图斑细化标注逻辑性检查(当图斑细化代码为FQ时,地类编码不为0602、1001、1003其中之一的,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL054()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE TBXHDM='FQ' AND DLBM NOT IN ('0602','1001','1003') ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "当图斑细化代码为FQ时,地类编码需为0602、1001、1003其中之一",
ErrorType = "一类错误",
RuleCode = "DL054",
RuleName = "图斑细化标注逻辑性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "当图斑细化代码为FQ时,地类编码需为0602、1001、1003其中之一",
ErrorType = "一类错误",
RuleCode = "DL054",
RuleName = "图斑细化标注逻辑性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 图斑细化标注逻辑性检查(当图斑细化代码为LQYD时,地类编码不为02类的,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL055()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE TBXHDM='LQYD' AND DLBM NOT IN ('0201','0202','0203','0204') ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "当图斑细化代码为LQYD时,地类编码需为0201、0202、0203、0204",
ErrorType = "一类错误",
RuleCode = "DL055",
RuleName = "图斑细化标注逻辑性检查",
RuleContent= "当图斑细化代码为LQYD时,地类编码不为0201、0202、0203、0204的,认定为错误图斑"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "当当图斑细化代码为LQYD时,地类编码需为0201、0202、0203、0204",
ErrorType = "一类错误",
RuleCode = "DL055",
RuleName = "图斑细化标注逻辑性检查",
RuleContent = "当图斑细化代码为LQYD时,地类编码不为0201、0202、0203、0204的,认定为错误图斑"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 图斑细化标注逻辑性检查(当图斑细化代码为GCCD时,地类编码不为04类的,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL056()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE TBXHDM='GCCD' AND DLBM NOT IN ({DLParams.cd_dlbms}) ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "当图斑细化代码为GCCD时,地类编码需为04类",
ErrorType = "一类错误",
RuleCode = "DL056",
RuleName = "图斑细化标注逻辑性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "当图斑细化代码为GCCD时,地类编码需为04类",
ErrorType = "一类错误",
RuleCode = "DL056",
RuleName = "图斑细化标注逻辑性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 当图斑细化代码为LJTM时,地类编码不为03类、0404、0404A的,认定为错误图斑
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL057()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE TBXHDM='LJTM' AND DLBM NOT IN ({DLParams.ld_dlbms},'0404','0404A') ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "当图斑细化代码为LJTM时,地类编码需为0404、0404A或03类。",
ErrorType = "一类错误",
RuleCode = "DL057",
RuleName = "图斑细化标注逻辑性检查",
RuleContent= "当图斑细化代码为LJTM时,地类编码不为03类、0404、0404A的,认定为错误图斑"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "当图斑细化代码为LJTM时,地类编码需为0404、0404A或03类。",
ErrorType = "一类错误",
RuleCode = "DL057",
RuleName = "图斑细化标注逻辑性检查",
RuleContent = "当图斑细化代码为LJTM时,地类编码不为03类、0404、0404A的,认定为错误图斑"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 线状地物宽度值域检查
/// </summary>
/// <returns></returns>
public List<RuleEntity> XKDW001()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE (DLBM IN ('1001','1002','1003','1004','1006','1009','1107','1107A') AND (XZDWKD=0 OR XZDWKD IS NULL)) OR (DLBM NOT IN ('1001','1002','1003','1004','1006','1009','1107','1107A') AND (XZDWKD<>0 and XZDWKD IS NOT NULL))";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
return null;
foreach (DataRow item in dt.Rows)
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "铁路、公路、管道用地、农村道路和沟渠等现状地物必须填写宽度值(不包括0),其他地类宽度值域必须为0或空值",
ErrorType = "一类错误",
RuleCode = "XKDW001",
RuleName = "线状地物宽度值域检查",
RuleContent= "1)当地类为铁路、公路、管道用地、农村道路和沟渠等线形地物时(即地类编码为1001、1002、1003、1004、1006、1009、1107、1107A),线状地物宽度等于0或空,认定为错误图斑。(2)当地类为非河流、铁路、公路、管道用地、农村道路和沟渠,字段不为0或空值,认定为错误图斑。"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "铁路、公路、管道用地、农村道路和沟渠等现状地物必须填写宽度值(不包括0),其他地类宽度值域必须为0或空值",
ErrorType = "一类错误",
RuleCode = "XKDW001",
RuleName = "线状地物宽度值域检查",
RuleContent = "1)当地类为铁路、公路、管道用地、农村道路和沟渠等线形地物时(即地类编码为1001、1002、1003、1004、1006、1009、1107、1107A),线状地物宽度等于0或空,认定为错误图斑。(2)当地类为非河流、铁路、公路、管道用地、农村道路和沟渠,字段不为0或空值,认定为错误图斑。"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 单独图层图斑与地类逻辑性检查(当单独图层代码为“1301 临时用地”时,地类必须为建设用地;否则,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL061()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
//1201排除
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE DDTCBZ='1301' AND DLBM NOT IN ('05H1','0508','0601','0602','0603','0701','0702','08H1','08H2','08H2A','0809','0810','0810A','09','1001','1002','1003','1004','1005','1007','1008','1009','1109') ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0) return null;
foreach (DataRow item in dt.Rows)
{
result.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "标记临时用地的图斑,地类编码必须为建设用地",
ErrorType = "一类错误",
RuleCode = "DL061",
RuleName = "单独图层图斑与地类逻辑性检查",
RuleContent = "当单独图层代码为“1301 临时用地”时,地类必须为建设用地;否则,认定为错误图斑"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "标记临时用地的图斑,地类编码必须为建设用地",
ErrorType = "一类错误",
RuleCode = "DL061",
RuleName = "单独图层图斑与地类逻辑性检查",
RuleContent = "当单独图层代码为“1301 临时用地”时,地类必须为建设用地;否则,认定为错误图斑"
};
result.Add(ruleEntity);
}
return result;
}
/// <summary>
/// 单独图层图斑与地类逻辑性检查(当单独图层代码为“1304 拆除未尽区”时,地类必须为建设用地或设施农用地;否则,认定为错误图斑)
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL062()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE DDTCBZ='1304' AND DLBM NOT IN ('05H1','0508','0601','0602','0603','0701','0702','08H1','08H2','08H2A','0809','0810','0810A','09','1001','1002','1003','1004','1005','1007','1008','1009','1109','1202')";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0) return null;
foreach (DataRow item in dt.Rows)
{
result.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "标记拆除未尽区的图斑,地类编码必须为建设用地或设施农用地",
ErrorType = "一类错误",
RuleCode = "DL062",
RuleName = "单独图层图斑与地类逻辑性检查",
RuleContent = "当单独图层代码为“1304 拆除未尽区”时,地类必须为建设用地或设施农用地;否则,认定为错误图斑"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "标记拆除未尽区的图斑,地类编码必须为建设用地或设施农用地",
ErrorType = "一类错误",
RuleCode = "DL062",
RuleName = "单独图层图斑与地类逻辑性检查",
RuleContent = "当单独图层代码为“1304 拆除未尽区”时,地类必须为建设用地或设施农用地;否则,认定为错误图斑"
};
result.Add(ruleEntity);
}
return result;
}
public List<RuleEntity> DL071()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE TBXHDM='LQYD' AND ZZSXDM IS NOT NULL AND ZZSXDM<>'' ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0) return null;
foreach (DataRow item in dt.Rows)
{
result.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "当图斑细化代码为LQYD时,种植属性代码必须为空",
ErrorType = "一类错误",
RuleCode = "DL071",
RuleName = "图斑细化代码与种植属性代码逻辑性检查",
RuleContent = "当图斑细化代码为LQYD时,种植属性代码必须为空;否则,认定为错误图斑"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "当图斑细化代码为LQYD时,种植属性代码必须为空",
ErrorType = "一类错误",
RuleCode = "DL071",
RuleName = "图斑细化代码与种植属性代码逻辑性检查",
RuleContent = "当图斑细化代码为LQYD时,种植属性代码必须为空;否则,认定为错误图斑"
};
result.Add(ruleEntity);
}
return result;
}
public List<RuleEntity> DL072()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBLSYDGX WHERE GLTBBSM NOT IN (SELECT BSM FROM DTBDLTBGX) ";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0) return null;
foreach (DataRow item in dt.Rows)
{
result.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "DTBLSYDGX层要素的关联图斑标识码与图形对应DTBDLTBGX层图斑标识码一致",
ErrorType = "一类错误",
RuleCode = "DL072",
RuleName = "临时用地与地类图斑逻辑性检查",
RuleContent = "DTBLSYDGX层要素的关联图斑标识码与图形对应DTBDLTBGX层图斑标识码一致,若不一致,认定为错误图斑"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "DTBLSYDGX层要素的关联图斑标识码与图形对应DTBDLTBGX层图斑标识码一致",
ErrorType = "一类错误",
RuleCode = "DL072",
RuleName = "临时用地与地类图斑逻辑性检查",
RuleContent = "DTBLSYDGX层要素的关联图斑标识码与图形对应DTBDLTBGX层图斑标识码一致,若不一致,认定为错误图斑"
};
result.Add(ruleEntity);
}
return result;
}
//public List<RuleEntity> DL073()
//{
// List<RuleEntity> result = new List<RuleEntity>();
// try
// {
// string sql = $"SELECT BSM FROM DTBDLTBGXGC WHERE BGQDLBM=BGHDLBM AND BGQTBXHDM=BGHTBXHDM AND BGQZZSXDM=BGHZZSXDM AND BGQXZDWKD<>BGHXZDWKD ";
// DataTable dt = mdbHelper.ExecuteDataTable(sql);
// if (dt == null || dt.Rows.Count <= 0) return null;
// foreach (DataRow item in dt.Rows)
// {
// result.Add(new RuleEntity()
// {
// CheckObject = "DTBDLTBGX",
// ErrorId = $"{item["BSM"].ToString()}",
// ErrorTip = "地类未发生变化的线状地物图斑,线状地物宽度不得改变",
// ErrorType = "一类错误",
// RuleCode = "DL073",
// RuleName = "未发生地类变化线状地物宽度检查",
// RuleContent = "若图斑变更前与变更后“地类编码”、“图斑细化代码”、“种植属性代码”不发生变化时,变更前后线状地物宽度需一致;若不一致,认定为错误图斑"
// });
// }
// }
// catch (Exception ex)
// {
// RuleEntity ruleEntity = new RuleEntity()
// {
// CheckObject = "DTBDLTBGX",
// ErrorId = "规则检查失败:" + ex.Message,
// ErrorTip = "地类未发生变化的线状地物图斑,线状地物宽度不得改变",
// ErrorType = "一类错误",
// RuleCode = "DL073",
// RuleName = "未发生地类变化线状地物宽度检查",
// RuleContent = "若图斑变更前与变更后“地类编码”、“图斑细化代码”、“种植属性代码”不发生变化时,变更前后线状地物宽度需一致;若不一致,认定为错误图斑"
// };
// result.Add(ruleEntity);
// }
// return result;
//}
public List<RuleEntity> BN004()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE DDTCBZ+DDTCMC NOT IN('','1301临时用地','1302光伏板区','1303推土区','1304拆除未尽区','1305路面范围')";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0) return null;
foreach (DataRow item in dt.Rows)
{
result.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "单独图层代码与单独图层名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN004",
RuleName = "单独图层代码与单独图层名称逻辑一致性检查",
RuleContent = "检查DTBDLTBGX层中单独图层代码与单独图层名称的对应关系是否满足建库方案相关规定。若不符合建库方案要求,认定为错误图斑"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "单独图层代码与单独图层名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN004",
RuleName = "单独图层代码与单独图层名称逻辑一致性检查",
RuleContent = "检查DTBDLTBGX层中单独图层代码与单独图层名称的对应关系是否满足建库方案相关规定。若不符合建库方案要求,认定为错误图斑"
};
result.Add(ruleEntity);
}
return result;
}
public List<RuleEntity> DL081()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE KCDLBM<>'' and DLBM not like '01%'";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0) return null;
foreach (DataRow item in dt.Rows)
{
result.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "只有耕地类可填写扣除地类编码",
ErrorType = "一类错误",
RuleCode = "DL081",
RuleName = "扣除地类编码与地类编码逻辑性检查",
RuleContent = "当扣除地类编码不为空时,地类编码必须为01类;否则,认定为错误图斑。"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "只有耕地类可填写扣除地类编码",
ErrorType = "一类错误",
RuleCode = "DL081",
RuleName = "扣除地类编码与地类编码逻辑性检查",
RuleContent = "当扣除地类编码不为空时,地类编码必须为01类;否则,认定为错误图斑。"
};
result.Add(ruleEntity);
}
return result;
}
public List<RuleEntity> DL082()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE DDTCBZ='1305' and DLBM not in('1001','1003')";
DataTable dt = mdbHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0) return null;
foreach (DataRow item in dt.Rows)
{
result.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
ErrorTip = "只有铁路和公路路面范围(不含护坡等道路附属设施)可上路面范围层",
ErrorType = "一类错误",
RuleCode = "DL082",
RuleName = "路面范围与地类编码逻辑性检查",
RuleContent = "当“单独图层代码”为1301时,若地类编码不为1001或1003(不含A),认定为错误图斑。"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = "规则检查失败:" + ex.Message,
ErrorTip = "只有铁路和公路路面范围(不含护坡等道路附属设施)可上路面范围层",
ErrorType = "一类错误",
RuleCode = "DL082",
RuleName = "路面范围与地类编码逻辑性检查",
RuleContent = "当“单独图层代码”为1301时,若地类编码不为1001或1003(不含A),认定为错误图斑。"
};
result.Add(ruleEntity);
}
return result;
}
}
}