using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using ESRI.ArcGIS.esriSystem; using ESRI.ArcGIS.Geodatabase; namespace Kingo.RuleCheck.XJRuleCheck { /// /// 通用类表内逻辑性检查 /// public class TYLBBNLJXCheck_DTB : RuleCheckBase_DTB { /* 说明:屏蔽规则:BN001 * 修改人:杨元芝 * 修改时间:2022-10-19 */ List ruleMethodNames = new List() { "BN002","BN003","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","DL102","DL103","DL104","DL105","DL106","DL010","DL011","DL081","DL063","XM001","XM002","DL001","TX030","LC002" }; 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 (gdpdjb is not null and CAST(gdpdjb as int) > 1) 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 = "对于调查为耕地类的图斑,当耕地坡度级别>1时,耕地类型不为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 = "对于调查为耕地类的图斑,当耕地坡度级别>1时,耕地类型不为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','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; } /// /// 恢复属性代码与地类编码逻辑一致性检查(当图斑地类编码为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、XG、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','XG','LS','LLJZ','FLS','LYFL')) or (DLBM IN ('0101','0102','0103') AND ZZSXDM NOT IN ('WG','XG','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、XG、LS、LLJZ、FLS、LYFL时,地类编码需为01类", ErrorType = "一类错误", RuleCode = "DL031", RuleContent = "当图斑种植属性代码为WG、XG、LS、LLJZ、FLS、LYFL时,若地类编码不为01类,认定为错误图斑", RuleName = "种植属性代码与地类编码逻辑一致性检查" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "种植属性代码为WG、XG、LS、LLJZ、FLS、LYFL时,地类编码需为01类规则检查失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "DL031", RuleContent = "当图斑种植属性代码为WG、XG、LS、LLJZ、FLS、LYFL时,若地类编码不为01类,认定为错误图斑", RuleName = "种植属性代码与地类编码逻辑一致性检查" }; rst.Add(ruleEntity); } return rst; } /// /// 种植属性代码与地类编码逻辑一致性检查(当图斑地类编码为01类时,种植属性代码不为WG、XG、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','XG','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、XG、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','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; } /// /// 城镇村属性码与地类编码逻辑一致性检查(地类编码为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 { 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 { 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(); 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; } /// /// 当城镇村属性码为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','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 ('HDGD','HQGD','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 = "当图斑细化代码为HDGD、HQGD、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 ({DLParams.cd_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 = "当图斑细化代码为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; } /// /// 当图斑细化代码为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 ({DLParams.ld_dlbms},'0404','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) { 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; } /// /// 线状地物宽度值域检查 /// /// public List XKDW001() { List rst = new List(); try { string sql = $"SELECT distinct BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}'and (DLBM NOT IN ('1009','1101','1107','1107A','1004','1003','1006') 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或空值", ErrorType = "二类错误", RuleCode = "XKDW001", RuleName = "线状地物宽度值域检查", RuleContent = "其他地类宽度值域必须为0或空值" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "其他地类宽度值域必须为0或空值规则检查失败:" + ex.Message, ErrorType = "二类错误", RuleCode = "XKDW001", RuleName = "线状地物宽度值域检查", RuleContent = "其他地类宽度值域必须为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 拆除未尽区”时,地类必须为建设用地、设施农用地或8801按原数据库上图;否则,认定为错误图斑) /// /// 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','8801')"; 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按原数据库上图", ErrorType = "一类错误", RuleCode = "DL062", RuleName = "单独图层图斑与地类逻辑性检查", RuleContent = "当单独图层代码为“1304 拆除未尽区”时,地类必须为建设用地、设施农用地或8801按原数据库上图;否则,认定为错误图斑" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "标记拆除未尽区的图斑,地类编码必须为建设用地、设施农用地或8801按原数据库上图规则检查失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "DL062", RuleName = "单独图层图斑与地类逻辑性检查", RuleContent = "当单独图层代码为“1304 拆除未尽区”时,地类必须为建设用地、设施农用地或8801按原数据库上图;否则,认定为错误图斑" }; 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('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时,若地类编码不为1003(不含A),认定为错误图斑。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "只有公路路面范围(不含护坡等道路附属设施)可上路面范围层规则检查失败:" + ex.Message, ErrorType = "二类错误", RuleCode = "DL082", RuleName = "路面范围与地类编码逻辑性检查", RuleContent = "当“单独图层代码”为1301时,若地类编码不为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 = "地类编码为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 = "地类编码为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','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 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','9901','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时,地类编码必须为耕地、建设用地或9901、9904", ErrorType = "一类错误", RuleCode = "DL102", RuleName = "推土区下地类检查", RuleContent = "当单独图层代码为1303时,地类编码必须为0101、0102、0103、05-09开头、1001、1002、1003、1004、1005、1007、1008、1009、1109、9901、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 ='9901' and DDTCBZ not in('1303','1302')"; 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 = "当地类编码为9901时,单独图层代码必须为1303。", ErrorType = "一类错误", RuleCode = "DL103", RuleName = "推土区下地类检查", RuleContent = "当地类编码为9901其时,单独图层代码必须为1303。否则,认定为错误图斑。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "DL103规则执行失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "DL103", RuleName = "推土区下地类检查", RuleContent = "当地类编码为9901其时,单独图层代码必须为1303。否则,认定为错误图斑。" }; 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','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、9905时,单独图层代码必须为一般地类。", ErrorType = "一类错误", RuleCode = "DL104", RuleName = "特殊地类单独图层标注检查", RuleContent = "当地类编码为9902、9903、9905时,单独图层代码必须为一般地类。否则,认定为错误图斑。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "DL104规则执行失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "DL104", RuleName = "特殊地类单独图层标注检查", RuleContent = "当地类编码为9902、9903、9905时,单独图层代码必须为一般地类。否则,认定为错误图斑。" }; result.Add(ruleEntity); } return result; } public List DL105() { string strInfo = string.Empty; List result = new List(); try { string sql = $"select bsm,bgqdlbm,bgqzzsxdm,bghdlbm,bghzzsxdm from dtbdltbgxgc 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) { strInfo = string.Empty; //若变更前地类为:01类,变更后地类为:02、03、04或1104,应标注恢复属性; if (item["bgqdlbm"].ToString().StartsWith("01") && (item["bghdlbm"].ToString().StartsWith("02") || item["bghdlbm"].ToString().StartsWith("03") || item["bghdlbm"].ToString().StartsWith("04") || item["bghdlbm"].ToString() == "1104") && string.IsNullOrEmpty(item["bghzzsxdm"].ToString())) { strInfo = "若变更前地类为:01类,变更后地类为:02、03、04或1104,应标注恢复属性。"; } //若变更前地类为:02、03、04或1104,且标注了恢复属性,则变更后地类为:02、03、04或1104图斑应标注恢复属性 else if (((item["bghdlbm"].ToString().StartsWith("02") || item["bghdlbm"].ToString().StartsWith("03") || item["bghdlbm"].ToString().StartsWith("04") || item["bghdlbm"].ToString() == "1104") && !string.IsNullOrEmpty(item["bgqzzsxdm"].ToString()) && ((item["bghdlbm"].ToString().StartsWith("02") || item["bghdlbm"].ToString().StartsWith("03") || item["bghdlbm"].ToString().StartsWith("04") || item["bghdlbm"].ToString() == "1104") && string.IsNullOrEmpty(item["bgqzzsxdm"].ToString())))) { strInfo = "若变更前地类为:02、03、04或1104,且标注了恢复属性,则变更后地类为:02、03、04或1104图斑应标注恢复属性。"; } //若变更前地类为:02、03、04或1104,且未标注恢复属性,则变更后地类为:02、03、04或1104图斑不应标注恢复属性 else if (((item["bghdlbm"].ToString().StartsWith("02") || item["bghdlbm"].ToString().StartsWith("03") || item["bghdlbm"].ToString().StartsWith("04") || item["bghdlbm"].ToString() == "1104") && string.IsNullOrEmpty(item["bgqzzsxdm"].ToString()) && ((item["bghdlbm"].ToString().StartsWith("02") || item["bghdlbm"].ToString().StartsWith("03") || item["bghdlbm"].ToString().StartsWith("04") || item["bghdlbm"].ToString() == "1104") && !string.IsNullOrEmpty(item["bgqzzsxdm"].ToString())))) { strInfo = "若变更前地类为:02、03、04或1104,且未标注恢复属性,则变更后地类为:02、03、04或1104图斑不应标注恢复属性。"; } //变更后地类不为:01、02、03、04或1104图斑不应标注恢复属性。 else if ((!item["bghdlbm"].ToString().StartsWith("01") || !item["bghdlbm"].ToString().StartsWith("02") || !item["bghdlbm"].ToString().StartsWith("03") || !item["bghdlbm"].ToString().StartsWith("04") || item["bghdlbm"].ToString() != "1104") && !string.IsNullOrEmpty(item["bgqzzsxdm"].ToString())) { break; } if(!string.IsNullOrEmpty(strInfo)) { result.Add(new RuleEntity() { CheckObject = "DTBDLTBGX层", ErrorId = $"{item["bsm"].ToString()}", BGFWBSM = $"{item["bsm"].ToString()}", ErrorTip = strInfo, ErrorType = "一类错误", RuleCode = "DL105", RuleName = "可标注属性检查", RuleContent = strInfo }); } } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX层", ErrorId = this.TBBSM, ErrorTip = "耕地类型检查执行失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "DL105", RuleName = "可标注属性检查", RuleContent = strInfo }; result.Add(ruleEntity); } return result; } public List DL106() { List result = new List(); try { string sql = $"select bsm from dtbdltbgx where tbbsm='{TBBSM}' and (gdpdjb is not null and cast(gdpdjb as int) = 1) and (gdlx <> '' and gdlx 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) { result.Add(new RuleEntity() { CheckObject = "DTBDLTBGX层", ErrorId = $"{item["BSM"].ToString()}", BGFWBSM = $"{item["BSM"].ToString()}", ErrorTip = "耕地坡度级别为1,耕地类型必须为空", ErrorType = "一类错误", RuleCode = "DL106", RuleName = "耕地类型检查", RuleContent = "若耕地坡度级别为1,耕地类型必须为空。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX层", ErrorId = this.TBBSM, ErrorTip = "耕地坡度级别为1,耕地类型必须为空。", ErrorType = "一类错误", RuleCode = "DL106", RuleName = "耕地类型检查", RuleContent = "若耕地坡度级别为1,耕地类型必须为空。" }; result.Add(ruleEntity); } return result; } public List DL001() { List result = new List(); try { string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and (DLBM is null or DLBM = '')"; 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 = "DL001", RuleName = "地类代码检查", RuleContent = "地类代码不能为空。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "地类编码不能为空。", ErrorType = "一类错误", RuleCode = "DL001", RuleName = "地类编码检查", RuleContent = "地类编码不能为空。" }; result.Add(ruleEntity); } return result; } /// /// 图斑项目信息检查 /// /// public List XM001() { List result = new List(); try { string sql = $"SELECT distinct BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and (SFXML is null or SFXML='' or SFXML not in('0','1','2') or (SFXML IN ('1','2') AND (XMLX IS NULL or xmlx='' OR XMMC IS NULL or XMMC='' OR XMBH is null or XMBH='' OR DKMC is null or DKMC='')) or ((SFXML<>'1' AND SFXML<>'2') AND (xmlx<>'' or XMMC<>'' or XMBH<>''or DKMC<>'')))"; 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 = "XM001", RuleName = "项目信息检查", RuleContent = "“变更类型”字段不允许为空;且“变更类型”字段选择“新增耕地”或“项目内非新增耕地”时,项目类型、项目名称、项目编号和地块名称字段不能为空;反之,必须为空。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "XM001规则执行失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "XM001", RuleName = "项目信息检查", RuleContent = "“变更类型”字段不允许为空;且“变更类型”字段选择“新增耕地”或“项目内非新增耕地”时,项目类型、项目名称、项目编号和地块名称字段不能为空;反之,必须为空。" }; result.Add(ruleEntity); } return result; } /// /// 变更类型字段,仅新增耕地图斑时,变更类型才可以选择是 /// /// public List XM002() { List result = new List(); try { string sql = $"select distinct A.BSM from DTBDLTBGX A LEFT JOIN DTBDLTBGXGC B ON A.BSM=B.bghTBBSM WHERE A.tbbsm='{TBBSM}' and A.SFXML not in('1','2') and B.bgqdlbm not like '01%' and B.tbbgmj > 30 and A.DLBM 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()}", BGFWBSM = $"{item["BSM"].ToString()}", ErrorTip = "若变更前地类不是耕地01类,变更后地类编码是耕地01类时,“变更类型”字段不为“新增耕地”或“项目内非新增耕地”,认定为错误图斑。", ErrorType = "一类错误", RuleCode = "XM002", RuleName = "变更类型检查", RuleContent = "若变更前地类不是耕地01类,变更后地类编码是耕地01类时,“变更类型”字段不为“新增耕地”或“项目内非新增耕地”,认定为错误图斑。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "XM002规则执行失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "XM002", RuleName = "变更类型检查", RuleContent = "若变更前地类不是耕地01类,变更后地类编码是耕地01类时,“变更类型”字段不为“是”,认定为错误图斑。" }; result.Add(ruleEntity); } return result; } /// /// 图斑流程信息检查 /// /// public List LC001() { List result = new List(); try { string sql = $"SELECT distinct BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and (LC is null or LC='') and (NF is null or NF='')"; 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 = "LX001", RuleName = "流程信息检查", RuleContent = "“流程”和“年份”字段不允许为空。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "LX001规则执行失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "LX001", RuleName = "流程信息检查", RuleContent = "“流程”和“年份”字段不允许为空。" }; result.Add(ruleEntity); } return result; } /// /// 校验码信息检查 /// /// public List LC002() { List result = new List(); try { string sql = $"SELECT BSM FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and (JYM is null or JYM = '')"; 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 = "LX002", RuleName = "流程信息检查", RuleContent = "“校验码”字段不允许为空。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "LX002规则执行失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "LX002", RuleName = "流程信息检查", RuleContent = "“校验码”字段不允许为空。" }; result.Add(ruleEntity); } return result; } /// /// DTBDLTBGX更新层图斑面积为小于30平,认定为错误图斑 /// /// public List TX030() { List result = new List(); try { string sql = $"SELECT bsm FROM DTBDLTBGX WHERE tbbsm='{TBBSM}' and tbmj < 30"; 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 = "TX030", RuleName = "流程信息检查", RuleContent = "变更范围不够上图面积。" }); } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "DTBDLTBGX", ErrorId = this.TBBSM, ErrorTip = "TX030规则执行失败:" + ex.Message, ErrorType = "一类错误", RuleCode = "TX030", RuleName = "流程信息检查", RuleContent = "变更范围不够上图面积。" }; result.Add(ruleEntity); } return result; } } }