123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- using QM.KJGH.Model.KJGH;
- using QM.KJGH.Model.View;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using WS;
- using WS.IO.Office;
- namespace QM.KJGH.CGGL.Model.QxCghj
- {
-
-
-
- public class TjpgzbReportIo
- {
-
-
-
- [Export("指标编号", 1)]
- public string code { set; get; }
-
-
-
- [Export("行政区划代码", 2)]
- public string xzqdm { set; get; }
-
-
-
-
-
-
- [Export("监测时间", 3)]
- public string monitorTime { set; get; }
-
-
-
- [Export("监测值", 4)]
- public string monitorValue { set; get; }
-
-
-
- [Export("近期规划年", 5)]
- public string targetYear { set; get; }
-
-
-
- [Export("近期规划值", 6)]
- public string targetValue { set; get; }
-
-
-
- [Export("基期年", 7)]
- public string baseYear { set; get; }
-
-
-
- [Export("基期值", 8)]
- public string baseValue { set; get; }
-
-
-
- [Export("远期规划目标年", 9)]
- public string forwardTargetYear { set; get; }
-
-
-
- [Export("远期规划目标值", 10)]
- public string forwardTargetValue { set; get; }
- public string JCSJLX { get
- {
- var len = monitorTime.Trim().Length;
- switch (len)
- {
- case 4:
- return "年";
- case 6:
- return "季";
- case 7:
- return "月";
- default:
- return "";
- }
- }
- }
-
-
-
-
- public string CheckData(Dictionary<string, string> listZbx, Dictionary<string, string> listXzq)
- {
- List<string> msgs = new List<string>();
- #region 必填性
- if (string.IsNullOrWhiteSpace(code))
- msgs.Add($"指标编号(code)不能为空");
- if (string.IsNullOrWhiteSpace(xzqdm))
- msgs.Add($"行政区划代码(xzqdm)不能为空");
- if (string.IsNullOrWhiteSpace(monitorTime))
- msgs.Add($"监测时间(monitorTime)不能为空");
- if (string.IsNullOrWhiteSpace(monitorValue))
- msgs.Add($"监测值(monitorValue)不能为空");
- #endregion
- #region 完整性
- if (string.IsNullOrWhiteSpace(targetYear) != string.IsNullOrWhiteSpace(targetValue))
- msgs.Add($"近期规划年(targetYear)、近期规划值(targetValue)必须都为空或都不为空");
- if (string.IsNullOrWhiteSpace(baseYear) != string.IsNullOrWhiteSpace(baseValue))
- msgs.Add($"基期年(baseYear)、基期值(baseValue)必须都为空或都不为空");
- if (string.IsNullOrWhiteSpace(forwardTargetYear) != string.IsNullOrWhiteSpace(forwardTargetValue))
- msgs.Add($"远期规划目标年(forwardTargetYear)、远期规划目标值(forwardTargetValue)必须都为空或都不为空");
- #endregion
- #region 正确性
- if (!listZbx.Keys.Contains(code))
- msgs.Add($"指标编号({code})不存在");
- if (!listXzq.Keys.Contains(xzqdm))
- msgs.Add($"行政区划代码({xzqdm})不存在");
- #endregion
- if (msgs.Count > 0)
- return msgs.Join("、");
- return string.Empty;
- }
- }
- }
|