using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using ESRI.ArcGIS.Geodatabase; namespace Kingo.RuleCheck.XJRuleCheck { /// /// 通用类表内逻辑性检查 /// public class TYLBBNLJXCheck_DTB : RuleCheckBase_DTB { List ruleMethodNames = new List() { "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","LHCD001","LHCD002","GCHZZ001","SZBZ001","ZZLX001","GFBQ001","GZ001" }; public override List ExcuteCheck(string sourePath, IWorkspace workspace) { return this.StartCheck(sourePath, workspace, ruleMethodNames); } public override List ExcuteCheck(IWorkspace workspace, List layerNames, List dataSetNames) { return this.StartCheck(workspace, ruleMethodNames, layerNames, dataSetNames); } public override List ExcuteCheck(string sourePath, Dictionary workspace) { return this.StartCheck(sourePath, workspace, ruleMethodNames); } public override List ExcuteCheck(string tbbsm, string sourePath, Dictionary workspace) { return this.StartCheck(tbbsm, sourePath, workspace, ruleMethodNames); } /// /// 地类编码与地类名称逻辑一致性检查(检查单图斑建库地类图斑层中地类编码与地类名称的对应关系是否满足建库方案相关规定。若不符合建库方案要求,认定为错误图斑) /// /// public List BN001() { List rst = new List(); 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; } /// /// 种植属性代码与种植属性名称逻辑一致性检查 /// /// public List BN002() { List rst = new List(); 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; } /// /// 图斑细化代码与图斑细化名称逻辑一致性检查 /// /// public List BN003() { List rst = new List(); 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; } /// /// 耕地类型与地类编码逻辑一致性检查 /// /// public List DL010() { List rst = new List(); 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 DL011() { List rst = new List(); 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; } /// /// 恢复属性代码与地类编码逻辑一致性检查(当图斑种植属性代码为JKHF、GCHF时,若地类编码不为0201、0201K、0202、0202K、0203、0203K、0204、0204K、0301、0301K、0302、0302K、0305、0307、0307K、0403K、0404、1104、1104A、1104K、其中之一,认定为错误图斑) /// /// public List DL021() { List rst = new List(); 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; } /// /// 恢复属性代码与地类编码逻辑一致性检查(当图斑地类编码为0201、0202、0203、0204、0301、0302、0305、0307、0404、1104、1104A时,种植属性代码不为JKHF、GCHF或空,认定为错误图斑) /// /// public List DL022() { List rst = new List(); try { string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}'and (DLBM IN ('0201','0202','0203','0204','0301','0302','0305','0307','0404','0404A','0404B','1104','1104A') 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 = "非可调整地类与恢复属性代码逻辑一致性检查", RuleContent = "当图斑地类编码为0201、0202、0203、0204、0301、0302、0305、0307、0404、0404A、0404B、1104、1104A时,种植属性代码不为JKHF、GCHF或空,认定为错误图斑。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "DL022规则检查失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "DL022", RuleName = "非可调整地类与恢复属性代码逻辑一致性检查", RuleContent= "当图斑地类编码为0201、0202、0203、0204、0301、0302、0305、0307、0404、0404A、0404B、1104、1104A时,种植属性代码不为JKHF、GCHF或空,认定为错误图斑。" }; rst.Add(ruleEntity); } return rst; } /// /// 恢复属性代码与地类编码逻辑一致性检查(当图斑地类编码为0201K、0202K、0203K、0204K、0301K、0302K、0307K、0403K、1104K时,种植属性代码不为JKHF或GCHF,认定为错误图斑) /// /// public List DL023() { List rst = new List(); 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; } /// /// 种植属性代码与地类编码逻辑一致性检查(当图斑种植属性代码为WG、LS、LLJZ、FLS、LYFL时,若地类编码不为01类,认定为错误图斑) /// /// public List DL031() { List rst = new List(); 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; } /// /// 种植属性代码与地类编码逻辑一致性检查(当图斑地类编码为01类时,种植属性代码不为WG、LS、LLJZ、FLS、LYFL时,认定为错误图斑) /// /// public List DL032() { List rst = new List(); 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; } /// /// 种植属性代码与地类编码逻辑一致性检查(当图斑地类编码为5以及本条(2)(3)外的其余地类编码,若图斑种植属性代码不为空,认定为错误图斑) /// /// public List DL033() { List rst = new List(); 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','0404','0404A','0404B','1104','1104A','1104K','0201K','0202K','0203K','0204K','0301K','0302K','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 = "非工作分类中的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; } /// /// 城镇村属性码与地类编码逻辑一致性检查(地类编码为05H1、0508、0602、0603、0701、0702、08H1、08H2、0809、0810、09、1004、1005、1201其中之一时,若城镇村属性码为空、201A、202A或203A其中之一时,认定为错误图斑) /// /// public List DL041() { List rst = new List(); try { if (PC != EnumPC.ZG) { return rst; } 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; } /// /// 城镇村属性码与地类编码逻辑一致性检查(当地类编码为0601时,城镇村属性码标注为空时,认定为错误图斑) /// /// public List DL042() { List rst = new List(); try { if (PC != EnumPC.ZG) { return rst; } 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; } /// /// 城镇村属性码与地类编码逻辑一致性检查(当城镇村属性码为204时,地类编码必须为0602或0603;否则,认定为错误图斑) /// /// public List DL043() { List rst = new List(); 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; } /// /// 城镇村属性码与地类编码逻辑一致性检查(当城镇村属性码为205时,地类编码必须为09) /// /// public List DL044() { List rst = new List(); 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; } /// /// 地类编码为1001、1002、1003、1006、1007、1008、1009、1109,或非建设用地的图斑,城镇村属性码为201、202、203、204、205,或为空 /// /// public List DL045() { List rst = new List(); try { if (PC != EnumPC.ZG) { return rst; } 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 = "DL045", RuleContent = "当城镇村属性码为201A、202A、203A时,地类编码必须为0601。", RuleName = "城镇村属性码与工业用地逻辑一致性检查" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "DL045规则检查失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "DL045", RuleContent = "当城镇村属性码为201A、202A、203A时,地类编码必须为0601。", RuleName = "城镇村属性码与工业用地逻辑一致性检查" }; rst.Add(ruleEntity); } return rst; } /// /// 当城镇村属性码为201A、202A、203A时,地类编码必须为0601。 /// /// public List DL046() { List rst = new List(); 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; } /// /// 图斑细化标注逻辑性检查(当地类编码不为01类、02类、03类、04类、0601、0602、1001、1003,或属于湿地的,图斑细化标注不为空时,认定为错误图斑) /// /// public List DL051() { List rst = new List(); 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','0404B','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; } /// /// 图斑细化标注逻辑性检查(当图斑细化代码为HDGD、HQGD、LQGD、MQGD、SHGD、SMGD、YJGD时,地类编码不为01类时,认定为错误图斑) /// /// public List DL052() { List rst = new List(); 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; } /// /// 图斑细化标注逻辑性检查(当图斑细化代码为HDGY、GTGY、MTGY、SNGY、BLGY、DLGY,地类编码不为0601的,认定为错误图斑) /// /// public List DL053() { List rst = new List(); 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; } /// /// 图斑细化标注逻辑性检查(当图斑细化代码为FQ时,地类编码不为0602、1001、1003其中之一的,认定为错误图斑) /// /// public List DL054() { List rst = new List(); 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; } /// /// 图斑细化标注逻辑性检查(当图斑细化代码为LQYD时,地类编码不为02类的,认定为错误图斑) /// /// public List DL055() { List rst = new List(); 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; } /// /// 图斑细化标注逻辑性检查(当图斑细化代码为GCCD时,地类编码不为04类的,认定为错误图斑) /// /// public List DL056() { List rst = new List(); try { string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}'and TBXHDM='GCCD' AND DLBM NOT IN ('04','0401','0402','0403','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 = "当图斑细化代码为GCCD时,地类编码需为04类(不包括0404A、0404B)。", ErrorType = "一类错误", RuleCode = "DL056", RuleContent = "当图斑细化代码为GCCD时,地类编码不为04类(除0404A、0404B)的,认定为错误图斑。", RuleName = "图斑细化标注逻辑性检查" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "DL056规则检查失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "DL056", RuleContent = "当图斑细化代码为GCCD时,地类编码不为04类(除0404A、0404B)的,认定为错误图斑。", RuleName = "图斑细化标注逻辑性检查" }; rst.Add(ruleEntity); } return rst; } /// /// 当图斑细化代码为LJTM时,地类编码不为03类、0404、0404A的,认定为错误图斑 /// /// public List DL057() { List rst = new List(); try { string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}'and TBXHDM='LJTM' AND DLBM NOT IN ('0301K','0303','0304','0306','0307','0307K','0404','0404A','0404B') "; 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、0404B的,认定为错误图斑。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "DL057规则检查失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "DL057", RuleName = "垃圾填埋标注与地类编码逻辑性检查", RuleContent = "当图斑细化代码为LJTM时,地类编码不为03类、0404、0404A、0404B的,认定为错误图斑。" }; rst.Add(ruleEntity); } return rst; } /// /// 线状地物宽度值域检查 /// /// public List XKDW001() { List rst = new List(); 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; } /// /// 单独图层图斑与地类逻辑性检查(当单独图层代码为“1301 临时用地”时,地类必须为建设用地;否则,认定为错误图斑) /// /// public List DL061() { List result = new List(); 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; } /// /// 单独图层图斑与地类逻辑性检查(当单独图层代码为“1304 拆除未尽区”时,地类必须为建设用地或设施农用地;否则,认定为错误图斑) /// /// public List DL062() { List result = new List(); 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 DL071() { List result = new List(); 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 DL072() { List result = new List(); 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 DL073() //{ // List result = new List(); // 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 BN004() { List result = new List(); 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 BN005() { List result = new List(); 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 DL081() { List result = new List(); 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; } /// /// 路面范围与地类编码逻辑性检查:当“单独图层代码”为1305时,若地类编码不为1001或1003(不含A),认定为错误图斑。 /// /// public List DL082() { List result = new List(); 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; } /// /// 路面范围与地类编码逻辑性检查:地类编码为1001、1003(不含A),单独图层代码不为1303或1305的,认定为错误图斑。 /// /// public List DL083() { List result = new List(); 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 DL063() { List result = new List(); 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 DL091() { List result = new List(); 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 DL092() { List result = new List(); try { string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and ljlx='农变未' and DLBM not in ('0404','0404A','0404B','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、0404B、1101、1102、1105、1106、1108、1204、1205、1206、1207的,认定为错误图斑。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "DL092规则检查失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "DL092", RuleName = "农变未地类逻辑性检查", RuleContent = "当类举类型为“农变未”时,若地类编码不为0404、0404A、0404B、1101、1102、1105、1106、1108、1204、1205、1206、1207的,认定为错误图斑。" }; result.Add(ruleEntity); } return result; } public List DL101() { List result = new List(); 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; } /// /// 推土区下地类检查 /// /// public List DL102() { List result = new List(); 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; } /// /// 推土区下地类检查 /// /// public List DL103() { List result = new List(); 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; } /// /// 特殊地类单独图层标注检查 /// /// public List DL104() { List result = new List(); 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 XH001() { List result = new List(); 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; } public List LHCD001() { List result = new List(); try { string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and ZZSXDM<>'JKHF' and DLBM='0404A'"; 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 = "LHCD001", RuleName = "绿化草地种植属性标注检查", RuleContent = "当地类编码为0404A时,种植属性代码需为JKHF。否则,认定为错误图斑。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "LHCD001规则执行失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "LHCD001", RuleName = "绿化草地种植属性标注检查", RuleContent = "当地类编码为0404A时,种植属性代码需为JKHF。否则,认定为错误图斑。" }; result.Add(ruleEntity); } return result; } public List LHCD002() { List result = new List(); try { string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and ZZSXDM<>'GCHF' and DLBM='0404B'"; 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 = "LHCD002", RuleName = "绿化草地种植属性标注检查", RuleContent = "当地类编码为0404B时,种植属性代码需为GCHF。否则,认定为错误图斑。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "LHCD002规则执行失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "LHCD002", RuleName = "绿化草地种植属性标注检查", RuleContent = "当地类编码为0404B时,种植属性代码需为GCHF。否则,认定为错误图斑。" }; result.Add(ruleEntity); } return result; } public List GCHZZ001() { List result = new List(); try { string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and DDTCBZ = '1306' and DLBM not in ('0601','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 = "GCHZZ001", RuleName = "工厂化种植单独图层标注逻辑性检查", RuleContent = "当单独图层代码为1306时,地类编码须为1202或0601;否则,认定为错误图斑。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "GCHZZ001:" + ex.Message, ErrorType = "一类错误", RuleCode = "GCHZZ001", RuleName = "工厂化种植单独图层标注逻辑性检查", RuleContent = "当单独图层代码为1306时,地类编码须为1202或0601;否则,认定为错误图斑。" }; result.Add(ruleEntity); } return result; } public List SZBZ001() { List result = new List(); try { string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and TBXHDM in ('MBYL','GYYL','GGJJ') and DLBM not in ({DLParams.yd_dlbms},{DLParams.ld_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) { result.Add(new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = $"{item["BSM"].ToString()}", BGFWBSM = $"{item["BSM"].ToString()}", ErrorTip = "当地类为园地、林地时,方可标注“木本油料”“工业原料”“干果经济”等信息。", ErrorType = "一类错误", RuleCode = "SZBZ001", RuleName = "树种类型标注逻辑性检查", RuleContent = "当图斑细化代码为“MBYL 木本油料”“GYYL 工业原料”“GGJJ 干果经济”时,地类编码必须为02类(含K),03类(含K);否则,认定为错误图斑。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "SZBZ001:" + ex.Message, ErrorType = "一类错误", RuleCode = "SZBZ001", RuleName = "树种类型标注逻辑性检查", RuleContent = "当图斑细化代码为“MBYL 木本油料”“GYYL 工业原料”“GGJJ 干果经济”时,地类编码必须为02类(含K),03类(含K);否则,认定为错误图斑。" }; result.Add(ruleEntity); } return result; } public List ZZLX001() { List result = new List(); RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "耕地、园地、林地必须标注“种植作物”信息。", ErrorType = "一类错误", RuleCode = "ZZLX001", RuleName = "种植作物种类逻辑性检查", RuleContent = "当地类编码为01类,且种植属性代码不为WG,以及地类编码为02类(含K),03类(含K,工作分类),图斑细化代码为“MBYL 木本油料”“GYYL 工业原料”“GGJJ 干果经济”时,“种植作物种类”不得为空;当“种植作物种类”不为空时,地类编码必须为01类、02类(含K),03类(含K,工作分类:0301,0301k,0302,0302k,0305,0307,,0307K)。" }; try { //2023-11-02 杨鑫 GD_166:8-通用类表内逻辑性检查【ZZLX001】 string sql = string.Format(@"select bsm, dlbm from DTBDLTBGX where tbbsm = '{0}' and (ZZZW = '' or ZZZW is null) and ((dlbm in ({1}) and zzsxdm is not null and zzsxdm <> 'WG') or (dlbm in ({2}, {3}) and tbxhdm in ('MBYL', 'GYYL', 'GGJJ'))) union select bsm, dlbm from DTBDLTBGX where tbbsm = '{0}' and (ZZZW <> '' and ZZZW is not null) and dlbm not in ({1}, {2}, {3})", TBBSM, DLParams.gd_dlbms, DLParams.yd_dlbms, DLParams.ld_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) { if (result.Where((el) => { return el.ErrorId == item["BSM"].ToString(); }).Count() <= 0) { result.Add(new RuleEntity() { CheckObject = ruleEntity.CheckObject, ErrorId = $"{item["BSM"].ToString()}", BGFWBSM = $"{item["BSM"].ToString()}", ErrorTip = ruleEntity.ErrorTip, ErrorType = ruleEntity.ErrorType, RuleCode = ruleEntity.RuleCode, RuleName = ruleEntity.RuleName, RuleContent = ruleEntity.RuleContent }); } } } catch (Exception ex) { ruleEntity.ErrorTip = "ZZLX001规则检查失败:" + ex.Message; result.Add(ruleEntity); } return result; } /// /// 光伏板区图斑地类编码逻辑性检查 /// /// public List GFBQ001() { List result = new List(); RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "标注光伏板区的图斑,相应地类应为耕地、其他园地、其他林地、天然牧草地、人工牧草地、其他草地、绿化草地、种植草皮、工业用地、河流水面、湖泊水面、水库水面、坑塘水面、养殖坑塘、可调整养殖坑塘、沿海滩涂、内陆滩涂、沟渠、盐碱地、沙地、裸土地、裸岩石砾地其中之一。", ErrorType = "一类错误", RuleCode = "GFBQ001", RuleName = "光伏板区图斑地类编码逻辑性检查", RuleContent = "对于单独图层标注1302的图斑,相应地类编码应为01类、0204、0307、0401、0403、0404、0404A、0404B、0601、1101-1104(包含A,K)、1105-1107(包含A,K)、1204-1207(包含A,K)其中之一。" }; try { string sql = $"select bsm from DTBDLTBGX where tbbsm = '{TBBSM}' and ddtcbz = '1302'" + $" and (dlbm is null or dlbm not in({DLParams.gd_dlbms},'0204','0307','0401','0403','0404','0404A','0404B','0601','1101','1102','1103','1104','1104A','1104K','1105','1106','1107','1107A','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 = ruleEntity.CheckObject, ErrorId = item["BSM"].ToString(), BGFWBSM = item["BSM"].ToString(), ErrorTip = ruleEntity.ErrorTip, ErrorType = ruleEntity.ErrorType, RuleCode = ruleEntity.RuleCode, RuleName = ruleEntity.RuleName, RuleContent = ruleEntity.RuleContent, }); } } catch (Exception ex) { ruleEntity.ErrorTip = "GFBQ001规则检查失败:" + ex.Message; result.Add(ruleEntity); } return result; } /// /// 跟踪图斑实地描述说明检查 /// /// public List GZ001() { List result = new List(); RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "跟踪图斑实地描述说明不可为空。", ErrorType = "一类错误", RuleCode = "GZ001", RuleName = "跟踪图斑实地描述说明检查", RuleContent = "图斑类型为“GZTB”时,实地描述说明字段必须大于10个字符。" }; try { //先把长度都不够或者空的筛选出来,再去判断字符个数 string sql = $"select bsm,sdmssm from DTBDLTBGX where tbbsm = '{TBBSM}' and tblx = 'GZTB'" + $" and (sdmssm is null or length(replace(sdmssm, ' ', '')) <= 10)"; DataTable dt = CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(this.SourcePath, sql); if (dt == null || dt.Rows.Count == 0) { return null; } foreach (DataRow item in dt.Rows) { int byteCount = 0; if (!item.IsNull("SDMSSM") && !string.IsNullOrWhiteSpace(item["SDMSSM"].ToString())) { byteCount = Encoding.Default.GetByteCount(item["SDMSSM"].ToString()); } if (byteCount < 10) { result.Add(new RuleEntity() { CheckObject = ruleEntity.CheckObject, ErrorId = item["BSM"].ToString(), BGFWBSM = item["BSM"].ToString(), ErrorTip = ruleEntity.ErrorTip, ErrorType = ruleEntity.ErrorType, RuleCode = ruleEntity.RuleCode, RuleName = ruleEntity.RuleName, RuleContent = ruleEntity.RuleContent, }); } } } catch (Exception ex) { ruleEntity.ErrorTip = "GZ001规则检查失败:" + ex.Message; result.Add(ruleEntity); } return result; } } }