using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using ESRI.ArcGIS.Geodatabase; namespace Kingo.RuleCheck { public class JZZPCheck : RuleCheckBase { List ruleMethodNames = new List() { "WYZP001","WYJD001","WYDW001","WYLX001","WYJD002","WYZP003","WYZP004","JZBM001","JZZL001" }; 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 List WYZP001() { List result = new List(); try { System.Data.DataTable dataTable = this.mdbHelper.ExecuteDataTable($"SELECT * FROM (SELECT TBBSM,COUNT(1) AS GS FROM FJGX WHERE TBBSM IN (SELECT BSM FROM DTBDLTBGX A WHERE A.LJLX IS NULL OR A.LJLX='') GROUP BY TBBSM) WHERE GS<3 "); if (dataTable != null && dataTable.Rows.Count > 0) { foreach (DataRow item in dataTable.Rows) { result.Add(new RuleEntity() { CheckObject = "外业举证照片", ErrorId = item[0].ToString(), ErrorTip = "非类举类型的外业图斑,举证照片总数不可少于3张", ErrorType = "一类错误", RuleCode = "WYZP001", RuleName = "举证照片总数量检查", RuleContent = "对于外业图斑,若图斑“未举证类型”为“空”时,举证照片总数少于3张时,判定为错误图斑。" }); } } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "外业举证照片", ErrorId = "规则检查失败:" + ex.Message, ErrorTip = "非类举类型的外业图斑,举证照片总数不可少于3张", ErrorType = "一类错误", RuleCode = "WYZP001", RuleName = "举证照片总数量检查", RuleContent = "对于外业图斑,若图斑“未举证类型”为“空”时,举证照片总数少于3张时,判定为错误图斑。" }; result.Add(ruleEntity); } return result; } public List WYJD001() { List result = new List(); try { string sql= "SELECT arg,POINTS_JSON FROM WYHCFJ"; System.Data.DataTable dataTable = this.mdbHelper.ExecuteDataTable(sql); if (dataTable != null && dataTable.Rows.Count > 0) { foreach (DataRow item in dataTable.Rows) { string str = "pitch\":[0-9-]+"; Match match = Regex.Match(item[1].ToString(), str, RegexOptions.ECMAScript); //提取结果为2 Regex rg = new Regex("[0-9-]+"); var pitch= Convert.ToDouble(rg.Match(match.Value).Value); if (pitch > 30 || pitch < -30) { result.Add(new RuleEntity() { CheckObject = "外业举证照片", ErrorId = item[0].ToString(), ErrorTip = "实地举证照片俯仰角度异常,请核查或重新拍照举证", ErrorType = "二类错误", RuleCode = "WYJD001", RuleName = "举证特征照片俯仰角检查", RuleContent = "对于外业实地举证照片,若举证照片的俯仰角度不属于水平线上下30度范围内,判定为错误照片。" }); } } } } catch (Exception ex) { RuleEntity ruleEntity = new RuleEntity() { CheckObject = "外业举证照片", ErrorId = "规则检查失败:" + ex.Message, ErrorTip = "实地举证照片俯仰角度异常,请核查或重新拍照举证", ErrorType = "二类错误", RuleCode = "WYJD001", RuleName = "举证特征照片俯仰角检查", RuleContent = "对于外业实地举证照片,若举证照片的俯仰角度不属于水平线上下30度范围内,判定为错误照片。" }; result.Add(ruleEntity); } return result; } public List WYDW001() { List result = new List(); return result; } } }