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

1975 lines
100 KiB

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.Geodatabase;
namespace Kingo.RuleCheck.XJRuleCheck
{
/// <summary>
/// 通用类表内逻辑性检查
/// </summary>
public class TYLBBNLJXCheck_DTB : RuleCheckBase_DTB
{
List<string> ruleMethodNames = new List<string>()
{
//"BN001","BN002","BN003","DL010","DL011","DL021","DL022","DL023","DL031","DL032","DL033","DL041","DL042","DL043","DL044","DL045","DL046","DL051","DL052","DL053","DL054","DL055","DL056","DL057","XKDW001","DL061","DL062","DL071","DL072","DL073","BN004","BN005","DL082","DL083","DL091","DL092","DL101","DL102","DL103","DL104","DL081","DL063","XH001"
"BN001","BN002","BN003","DL010","DL011","DL021","DL022","DL023","DL031","DL032","DL033","DL041","DL042","DL043","DL044","DL045","DL046","DL051","DL052","DL053","DL054","DL055","DL056","DL057","XKDW001","DL061","DL062","DL071","DL072","DL073","DL082","DL083","DL091","DL092","DL101","DL102","DL103","DL104","DL081","DL063","XH001"
};
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, IFeatureClass> workspace)
{
return this.StartCheck(sourePath, workspace, ruleMethodNames);
}
public override List<RuleEntity> ExcuteCheck(string tbbsm, string sourePath, Dictionary<string, IFeatureClass> workspace)
{
return this.StartCheck(tbbsm, 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 where tbbsm='{TBBSM}'";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "图斑地类编码与地类名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN001",
RuleName = "地类编码与地类名称逻辑一致性检查"
});
}
}
else
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "图斑地类编码与地类名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN001",
RuleName = "地类编码与地类名称逻辑一致性检查"
});
}
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "图斑地类编码与地类名称对应关系不符合要求规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and ZZSXDM||ZZSXMC NOT IN('')";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "图斑种植属性代码与种植属性名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN002",
RuleContent = "检查DTBDLTBGX层中种植属性代码与种植属性名称的对应关系是否满足建库方案相关规定。若不符合建库方案要求,认定为错误图斑。",
RuleName = "种植属性代码与种植属性名称逻辑一致性检查"
});
}
}
else
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "图斑种植属性代码与种植属性名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN002",
RuleName = "种植属性代码与种植属性名称逻辑一致性检查"
});
}
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "图斑种植属性代码与种植属性名称对应关系不符合要求规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and TBXHDM||TBXHMC NOT IN ('')";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "图斑图斑细化代码与图斑细化名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN003",
RuleContent = "检查DTBDLTBGX层中图斑细化代码与图斑细化名称的对应关系是否满足建库方案相关规定。若不符合建库方案要求,认定为错误图斑。",
RuleName = "图斑细化代码与图斑细化名称逻辑一致性检查"
});
}
}
else
{
rst.Add(new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = $"{item["BSM"].ToString()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "图斑图斑细化代码与图斑细化名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN003",
RuleName = "图斑细化代码与图斑细化名称逻辑一致性检查"
});
}
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "图斑图斑细化代码与图斑细化名称对应关系不符合要求规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and DLBM IN ({DLParams.gd_dlbms}) AND GDLX<>'TT' AND GDLX<>'PD'";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{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 = this.TBBSM,
ErrorTip = "耕地类图斑“耕地类型”字段必须依据实地情况填写“TT”或“PD”规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and DLBM not IN ({DLParams.gd_dlbms}) AND GDLX IN ('TT','PD')";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "标记耕地类型的图斑地类编码必须为耕地",
ErrorType = "一类错误",
RuleCode = "DL011",
RuleContent = "对于耕地类型为TT 梯田或PD 坡地的,若地类编码不为01类,认定为错误图斑",
RuleName = "耕地类型与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "标记耕地类型的图斑地类编码必须为耕地规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and (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','0404'))";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "图斑标注恢复属性时,地类编码必须为工作分类中的02类、03类、0403K、0404、0404A及1104类(包括带K地类)",
ErrorType = "一类错误",
RuleContent = "当图斑种植属性代码为JKHF、GCHF时,若地类编码不为0201、0201K、0202、0202K、0203、0203K、0204、0204K、0301、0301K、0302、0302K、0305、0307、0307K、0403K、0404、0404A、1104、1104A、1104K、其中之一,认定为错误图斑",
RuleCode = "DL021",
RuleName = "恢复属性代码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "图斑标注恢复属性时,地类编码必须为工作分类中的02类、03类、0403K、0404、0404A及1104类(包括带K地类)规则检查失败:" + ex.Message,
ErrorType = "一类错误",
RuleContent = "当图斑种植属性代码为JKHF、GCHF时,若地类编码不为0201、0201K、0202、0202K、0203、0203K、0204、0204K、0301、0301K、0302、0302K、0305、0307、0307K、0403K、0404、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 tbbsm='{TBBSM}'and (DLBM IN ('0201','0202','0203','0204','0301','0302','0305','0307','0404A','1104','1104A','0404') AND ZZSXDM NOT in ('JKHF','GCHF',''))";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "图斑地类编码为工作分类中的02类、03类、0404、0404A及1104类时(不包括带K地类),种植属性代码必须为JKHF、GCHF或空",
ErrorType = "一类错误",
RuleCode = "DL022",
RuleName = "恢复属性代码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "图斑地类编码为工作分类中的02类、03类、0404、0404A及1104类时(不包括带K地类),种植属性代码必须为JKHF、GCHF或空规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and DLBM IN ('0201K','0202K','0203K','0204K','0301K','0302K','0307K','0403K','1104K') AND ZZSXDM<>'JKHF' AND ZZSXDM<>'GCHF' ";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "图斑地类编码为带K地类时,种植属性代码必须为JKHF或GCHF",
ErrorType = "一类错误",
RuleCode = "DL023",
RuleName = "恢复属性代码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "图斑地类编码为带K地类时,种植属性代码必须为JKHF或GCHF规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and ((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 = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{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 = this.TBBSM,
ErrorTip = "种植属性代码为WG、LS、LLJZ、FLS、LYFL时,地类编码需为01类规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and DLBM IN ({DLParams.gd_dlbms}) AND ZZSXDM NOT IN ('WG','LS','LLJZ','FLS','LYFL') ";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "地类编码需为01类时,种植属性代码需为WG、LS、LLJZ、FLS、LYFL其中之一",
ErrorType = "一类错误",
RuleCode = "DL032",
RuleName = "种植属性代码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "地类编码需为01类时,种植属性代码需为WG、LS、LLJZ、FLS、LYFL其中之一规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and (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','0404'))";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "非工作分类中的01类、02类、03类、0403K、0404、0404A及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 = this.TBBSM,
ErrorTip = "非工作分类中的01类、02类、03类、0403K、0404A及1104类,不可填写种植属性代码规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and 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 = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{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 = this.TBBSM,
ErrorTip = "非工业用地的建设用地,城镇村属性码不可为空,或标注201A、202A或203A规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and DLBM='0601' AND CZCSXM='' ";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "工业用地城镇村属性码不可为空",
ErrorType = "一类错误",
RuleCode = "DL042",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "工业用地城镇村属性码不可为空规则检查失败:" + ex.Message,
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>();
return rst;
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}'and DLBM NOT IN ('0602','0603') AND CZCSXM='204' ";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "城镇村属性码为204的图斑,地类编码必须为0602或0603",
ErrorType = "一类错误",
RuleCode = "DL043",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "城镇村属性码为204的图斑,地类编码必须为0602或0603规则检查失败:" + ex.Message,
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>();
return rst;
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}'and DLBM<>'09' AND CZCSXM='205' ";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "城镇村属性码为205的图斑,地类编码必须为09",
ErrorType = "一类错误",
RuleCode = "DL044",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "城镇村属性码为205的图斑,地类编码必须为09规则检查失败:" + ex.Message,
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>();
return rst;
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}'and 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 = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "地类编码不为05-09、1004、1005、1201的图斑时,城镇村属性码必须为空",
ErrorType = "一类错误",
RuleCode = "DL045",
RuleContent = "除以上地类编码外的其余图斑,城镇村属性码需为空",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "地类编码不为05-09、1004、1005、1201的图斑时,城镇村属性码必须为空规则检查失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "DL045",
RuleContent = "除以上地类编码外的其余图斑,城镇村属性码需为空",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
};
rst.Add(ruleEntity);
}
return rst;
}
/// <summary>
/// 当城镇村属性码为201A、202A、203A时,地类编码必须为0601。
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL046()
{
List<RuleEntity> rst = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}'and DLBM NOT IN ('0601') AND CZCSXM in ('201A','202A','203A')";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "城镇村属性码为201A、202A、203A时,地类编码必须为0601",
ErrorType = "一类错误",
RuleCode = "DL046",
RuleContent = "当城镇村属性码为201A、202A、203A时,地类编码必须为0601",
RuleName = "城镇村属性码与地类编码逻辑一致性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "DL046(城镇村属性码为201A、202A、203A时,地类编码必须为0601)规则检查失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "DL046",
RuleContent = "城镇村属性码为201A、202A、203A时,地类编码必须为0601",
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 tbbsm='{TBBSM}'and 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') AND TBXHDM<>'' ";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{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 = this.TBBSM,
ErrorTip = "地类编码为01类、02类、03类、04类、0601、0602、1001、1003,或属于湿地的,不可填写图斑细化标注规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and TBXHDM IN ('LQGD','MQGD','SHGD','SMGD','YJGD') AND DLBM NOT IN ({DLParams.gd_dlbms}) ";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "当图斑细化代码为LQGD、MQGD、SHGD、SMGD、YJGD时,地类编码必须为01类",
ErrorType = "一类错误",
RuleCode = "DL052",
RuleName = "图斑细化标注逻辑性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "当图斑细化代码为HDGD、HQGD、LQGD、MQGD、SHGD、SMGD、YJGD时,地类编码必须为01类规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and TBXHDM IN ('HDGY','GTGY','MTGY','SNGY','BLGY','DLGY') AND DLBM<>'0601' ";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{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 = this.TBBSM,
ErrorTip = "当图斑细化代码为HDGY、GTGY、MTGY、SNGY、BLGY、DLGY的,地类编码必须为0601规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and TBXHDM='FQ' AND DLBM NOT IN ('0602','1001','1003') ";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "当图斑细化代码为FQ时,地类编码需为0602、1001、1003其中之一",
ErrorType = "一类错误",
RuleCode = "DL054",
RuleName = "图斑细化标注逻辑性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "当图斑细化代码为FQ时,地类编码需为0602、1001、1003其中之一规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and TBXHDM='LQYD' AND DLBM NOT IN ('0201','0202','0203','0204') ";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{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 = this.TBBSM,
ErrorTip = "当当图斑细化代码为LQYD时,地类编码需为0201、0202、0203、0204规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and TBXHDM='GCCD' AND DLBM NOT IN ('04','0401','0402','0403','0403K','0404') ";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "当图斑细化代码为GCCD时,地类编码需为04类(不包括0404A)",
ErrorType = "一类错误",
RuleCode = "DL056",
RuleContent = "图斑细化代码为GCCD时,地类编码需为04类(不包括0404A)",
RuleName = "图斑细化标注逻辑性检查"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "DL056(图斑细化代码为GCCD时,地类编码需为04类(不包括0404A))规则检查失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "DL056",
RuleContent = "图斑细化代码为GCCD时,地类编码需为04类(不包括0404A)",
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 tbbsm='{TBBSM}'and TBXHDM='LJTM' AND DLBM NOT IN ('0301K','0303','0304','0306','0307','0307K','0403K') ";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{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 = this.TBBSM,
ErrorTip = "当图斑细化代码为LJTM时,地类编码需为0404、0404A或03类规则检查失败:" + ex.Message,
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 distinct BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}'and ((DLBM IN ('1009','1101','1107','1107A') AND (XZDWKD=0 OR XZDWKD IS NULL)) OR (DLBM NOT IN ('1009','1101','1107','1107A') AND (XZDWKD<>0 and XZDWKD IS NOT NULL)))";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "河流水面、干渠和沟渠等线状地物必须填写宽度值(不包括0),其他地类宽度值域必须为0或空值",
ErrorType = "一类错误",
RuleCode = "XKDW001",
RuleName = "线状地物宽度值域检查",
RuleContent = "河流水面、干渠和沟渠等线状地物必须填写宽度值(不包括0),其他地类宽度值域必须为0或空值"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "河流水面、干渠和沟渠等线状地物必须填写宽度值(不包括0),其他地类宽度值域必须为0或空值规则检查失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "XKDW001",
RuleName = "线状地物宽度值域检查",
RuleContent = "河流水面、干渠和沟渠等线状地物必须填写宽度值(不包括0),其他地类宽度值域必须为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 tbbsm='{TBBSM}'and 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','1001A','1002A','1003A','1004A') ";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "标记临时用地的图斑,地类编码必须为建设用地",
ErrorType = "一类错误",
RuleCode = "DL061",
RuleName = "单独图层图斑与地类逻辑性检查",
RuleContent = "当单独图层代码为“1301 临时用地”时,地类必须为建设用地;否则,认定为错误图斑"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "标记临时用地的图斑,地类编码必须为建设用地规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and 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','1001A','1002A','1003A','1004A')";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "标记拆除未尽区的图斑,地类编码必须为建设用地或设施农用地",
ErrorType = "一类错误",
RuleCode = "DL062",
RuleName = "单独图层图斑与地类逻辑性检查",
RuleContent = "当单独图层代码为“1304 拆除未尽区”时,地类必须为建设用地或设施农用地;否则,认定为错误图斑"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "标记拆除未尽区的图斑,地类编码必须为建设用地或设施农用地规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}'and TBXHDM='LQYD' AND ZZSXDM IS NOT NULL AND ZZSXDM<>'' ";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "当图斑细化代码为LQYD时,种植属性代码必须为空",
ErrorType = "一类错误",
RuleCode = "DL071",
RuleName = "图斑细化代码与种植属性代码逻辑性检查",
RuleContent = "当图斑细化代码为LQYD时,种植属性代码必须为空;否则,认定为错误图斑"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "当图斑细化代码为LQYD时,种植属性代码必须为空规则检查失败:" + ex.Message,
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 B.BSM from DTBDLTBGX b left join DTBLSYDGX A ON A.BSM =b.bsm WHERE b.tbbsm='{TBBSM}'and GLTBBSM NOT IN (SELECT BSM FROM DTBDLTBGX)";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "DTBLSYDGX层要素的关联图斑标识码与图形对应DTBDLTBGX层图斑标识码一致",
ErrorType = "一类错误",
RuleCode = "DL072",
RuleName = "临时用地与地类图斑逻辑性检查",
RuleContent = "DTBLSYDGX层要素的关联图斑标识码与图形对应DTBDLTBGX层图斑标识码一致,若不一致,认定为错误图斑"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "DTBLSYDGX层要素的关联图斑标识码与图形对应DTBDLTBGX层图斑标识码一致规则检查失败:" + ex.Message,
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 tbbsm='{TBBSM}' and DDTCBZ||DDTCMC NOT IN('','一般地类一般地类','1301临时用地','1302光伏板区','1303推土区','1304拆除未尽区','1305路面范围','1306荒草地特征图斑(基础库地类非建设用地、设施农用地)','1307荒草地特征图斑(基础库地类建设用地或设施农用地)','1308翻土特征图斑')";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "单独图层代码与单独图层名称对应关系不符合要求",
ErrorType = "一类错误",
RuleCode = "BN004",
RuleName = "单独图层代码与单独图层名称逻辑一致性检查",
RuleContent = "检查DTBDLTBGX层中单独图层代码与单独图层名称的对应关系是否满足建库方案相关规定。若不符合建库方案要求,认定为错误图斑"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "单独图层代码与单独图层名称对应关系不符合要求规则检查失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "BN004",
RuleName = "单独图层代码与单独图层名称逻辑一致性检查",
RuleContent = "检查DTBDLTBGX层中单独图层代码与单独图层名称的对应关系是否满足建库方案相关规定。若不符合建库方案要求,认定为错误图斑"
};
result.Add(ruleEntity);
}
return result;
}
public List<RuleEntity> BN005()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and DDTCBZ||DDTCMC NOT IN('','一般地类一般地类','1301临时用地','1302光伏板区','1303推土区','1304拆除未尽区','1305路面范围','1306荒草地特征图斑(基础库地类非建设用地、设施农用地)','1307荒草地特征图斑(基础库地类建设用地或设施农用地)','1308翻土特征图斑')";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "图层信息不能为空",
ErrorType = "一类错误",
RuleCode = "BN005",
RuleName = "单独图层代码与单独图层名称逻辑一致性检查",
RuleContent = "图层信息不能为空"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "图层信息不能为空规则检查失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "BN005",
RuleName = "单独图层代码与单独图层名称逻辑一致性检查",
RuleContent = "图层信息不能为空"
};
result.Add(ruleEntity);
}
return result;
}
public List<RuleEntity> DL081()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and KCDLBM<>'' and DLBM not like '01%'";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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 = this.TBBSM,
ErrorTip = "只有耕地类可填写扣除地类编码规则检查失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "DL081",
RuleName = "扣除地类编码与地类编码逻辑性检查",
RuleContent = "当扣除地类编码不为空时,地类编码必须为01类;否则,认定为错误图斑。"
};
result.Add(ruleEntity);
}
return result;
}
/// <summary>
/// 路面范围与地类编码逻辑性检查:当“单独图层代码”为1305时,若地类编码不为1001或1003(不含A),认定为错误图斑。
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL082()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and DDTCBZ='1305' and DLBM not in('1001','1003')";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "只有铁路和公路路面范围(不含护坡等道路附属设施)可上路面范围层",
ErrorType = "一类错误",
RuleCode = "DL082",
RuleName = "路面范围与地类编码逻辑性检查",
RuleContent = "当“单独图层代码”为1301时,若地类编码不为1001或1003(不含A),认定为错误图斑。"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "只有铁路和公路路面范围(不含护坡等道路附属设施)可上路面范围层规则检查失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "DL082",
RuleName = "路面范围与地类编码逻辑性检查",
RuleContent = "当“单独图层代码”为1301时,若地类编码不为1001或1003(不含A),认定为错误图斑。"
};
result.Add(ruleEntity);
}
return result;
}
/// <summary>
/// 路面范围与地类编码逻辑性检查:地类编码为1001、1003(不含A),单独图层代码不为1303或1305的,认定为错误图斑。
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL083()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and DDTCBZ not in('1303','1304','1305') and DLBM in('1001','1003')";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "铁路和公路,必须标注“单独图层代码”为1303或1304或1305",
ErrorType = "一类错误",
RuleCode = "DL083",
RuleName = "路面范围与地类编码逻辑性检查",
RuleContent = "地类编码为1001、1003(不含A),单独图层代码不为1303或1304或1305的,认定为错误图斑。"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "DL083规则检查失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "DL083",
RuleName = "路面范围与地类编码逻辑性检查",
RuleContent = "地类编码为1001、1003(不含A),单独图层代码不为1303或1304或1305的,认定为错误图斑。"
};
result.Add(ruleEntity);
}
return result;
}
public List<RuleEntity> DL063()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT t.BSM FROM DTBDLTBGX t LEFT JOIN DTBDLTBGXGC t1 on t.BSM=t1.BGHTBBSM WHERE t.TBBSM='{TBBSM}' AND t.DDTCBZ='1304' AND (t.DLBM in ({DLParams.jsyd_dlbms}) or t.DLBM='1202') AND t1.BGQDLBM<>t1.BGHDLBM AND (t1.BGQDLBM in({DLParams.jsyd_dlbms}) or t1.BGQDLBM='1202')";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "拆除未尽区需按原数据库地类进行上图",
ErrorType = "一类错误",
RuleCode = "DL063",
RuleName = "拆除未尽区还原地类逻辑性检查",
RuleContent = "当单独图层代码为“1304 拆除未尽区”时,若地类为建设用地、设施农用地,相应DTBDLTBGXGC层中,变更前地类编码与变更后地类编码需一致;若不一致,变更前地类编码需不为建设用地、设施农用地;否则,认定为错误图斑。"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "DL063规则检查失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "DL063",
RuleName = "拆除未尽区还原地类逻辑性检查",
RuleContent = "当单独图层代码为“1304 拆除未尽区”时,若地类为建设用地、设施农用地,相应DTBDLTBGXGC层中,变更前地类编码与变更后地类编码需一致;若不一致,变更前地类编码需不为建设用地、设施农用地;否则,认定为错误图斑。"
};
result.Add(ruleEntity);
}
return result;
}
public List<RuleEntity> DL091()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and ljlx='水旱轮作' and DLBM<>'0101'";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "只有地类为水田时,方可标注“水旱轮作”",
ErrorType = "一类错误",
RuleCode = "DL091",
RuleName = "水旱轮作地类逻辑性检查",
RuleContent = "当类举类型为“水旱轮作”时,若地类编码不为0101,认定为错误图斑。"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "只有地类为水田时,方可标注“水旱轮作”规则检查失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "DL091",
RuleName = "水旱轮作地类逻辑性检查",
RuleContent = "当类举类型为“水旱轮作”时,若地类编码不为0101,认定为错误图斑。"
};
result.Add(ruleEntity);
}
return result;
}
public List<RuleEntity> DL092()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and ljlx='农变未' and DLBM not in ('0404','0404A','1101','1102','1105','1106','1108','1204','1205','1206','1207')";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "只有地类为未利用地时,方可标注“农变未”",
ErrorType = "一类错误",
RuleCode = "DL092",
RuleName = "农变未地类逻辑性检查",
RuleContent = "当类举类型为“农变未”时,若地类编码不为0404、0404A、1101、1102、1105、1106、1108、1204、1205、1206、1207的,认定为错误图斑"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "只有地类为未利用地时,方可标注“农变未”规则检查失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "DL092",
RuleName = "农变未地类逻辑性检查",
RuleContent = "当类举类型为“农变未”时,若地类编码不为0404、0404A、1101、1102、1105、1106、1108、1204、1205、1206、1207的,认定为错误图斑"
};
result.Add(ruleEntity);
}
return result;
}
public List<RuleEntity> DL101()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and DLBM in ('1202','1006') and (ydyhfl='' or YDYHFL is null)";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "当地类编码为1202、1006时,用地用海分类字段不可为空",
ErrorType = "一类错误",
RuleCode = "DL101",
RuleName = "用地用海分类字段填写",
RuleContent = "当地类编码为1202、1006时,用地用海分类字段不可为空"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "当地类编码为1202、1006时,用地用海分类字段不可为空规则检查失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "DL101",
RuleName = "用地用海分类字段填写",
RuleContent = "当地类编码为1202、1006时,用地用海分类字段不可为空"
};
result.Add(ruleEntity);
}
return result;
}
/// <summary>
/// 推土区下地类检查
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL102()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and DLBM not in ('0101','0102','0103','1001','1002','1003','1004','1005','1007','1008','1009','1109','8801','9904') AND DLBM NOT like '05%' AND DLBM NOT like '06%' AND DLBM NOT like '07%' AND DLBM NOT like '08%' AND DLBM NOT like '09%' and DDTCBZ = '1303'";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "当单独图层代码为1303时,地类编码必须为耕地、建设用地或8801、9904",
ErrorType = "一类错误",
RuleCode = "DL102",
RuleName = "推土区下地类检查",
RuleContent = "当单独图层代码为1303时,地类编码必须为0101、0102、0103、05-09开头、1001、1002、1003、1004、1005、1007、1008、1009、1109、8801、9904其中之一。否则,认定为错误图斑。"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "DL102规则执行失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "DL102",
RuleName = "推土区下地类检查",
RuleContent = "当单独图层代码为1303时,地类编码必须为0101、0102、0103、05-09、1001、1002、1003、1004、1005、1007、1008、1009、1109、9901其中之一。否则,认定为错误图斑。"
};
result.Add(ruleEntity);
}
return result;
}
/// <summary>
/// 推土区下地类检查
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL103()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and DLBM ='8801' and DDTCBZ not in('1303')";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "当地类编码为8801其时,单独图层代码必须为1303其中之一。",
ErrorType = "一类错误",
RuleCode = "DL103",
RuleName = "推土区下地类检查",
RuleContent = "当地类编码为8801其时,单独图层代码必须为1303其中之一。否则,认定为错误图斑。"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "DL103规则执行失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "DL103",
RuleName = "推土区下地类检查",
RuleContent = "当地类编码为8801其时,单独图层代码必须为1303、1306、1307、1308其中之一。否则,认定为错误图斑。"
};
result.Add(ruleEntity);
}
return result;
}
/// <summary>
/// 特殊地类单独图层标注检查
/// </summary>
/// <returns></returns>
public List<RuleEntity> DL104()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and DLBM in('9902','9903','9904','9905') and DDTCBZ <> '一般地类'";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "当地类编码为9902、9903、9904、9905时,单独图层代码必须为一般地类。",
ErrorType = "一类错误",
RuleCode = "DL104",
RuleName = "特殊地类单独图层标注检查",
RuleContent = "当地类编码为9902、9903、9904、9905时,单独图层代码必须为一般地类。否则,认定为错误图斑。"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "DL104规则执行失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "DL104",
RuleName = "特殊地类单独图层标注检查",
RuleContent = "当地类编码为9902、9903、9904、9905时,单独图层代码必须为一般地类。否则,认定为错误图斑。"
};
result.Add(ruleEntity);
}
return result;
}
public List<RuleEntity> XH001()
{
List<RuleEntity> result = new List<RuleEntity>();
try
{
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and TBXHDM in ('HDGD','HQGD','LQGD','MQGD') and ZZSXDM='WG'";
DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, 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()}",
BGFWBSM = $"{item["BSM"].ToString()}",
ErrorTip = "当河道、湖区、林区、牧区耕地不得标注未耕种",
ErrorType = "一类错误",
RuleCode = "XH001",
RuleName = "河道、湖区、林区、牧区耕地与未耕种属性逻辑性检查",
RuleContent = "当图斑细化代码为HDGD、HQGD、LQGD、MQGD时,种植属性代码为WG,认定为错误图斑。"
});
}
}
catch (Exception ex)
{
RuleEntity ruleEntity = new RuleEntity()
{
CheckObject = "DTBDLTBGX",
ErrorId = this.TBBSM,
ErrorTip = "DL103规则执行失败:" + ex.Message,
ErrorType = "一类错误",
RuleCode = "XH001",
RuleName = "河道、湖区、林区、牧区耕地与未耕种属性逻辑性检查",
RuleContent = "当图斑细化代码为HDGD、HQGD、LQGD、MQGD时,种植属性代码为WG,认定为错误图斑。"
};
result.Add(ruleEntity);
}
return result;
}
}
}