validCalibration.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using com.hnshituo.core.webapp.vo;
  2. using Common;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace MeterConditionLibrary
  9. {
  10. public class validCalibration
  11. {
  12. public bool ValidMethod(MeterWorkCalibrationMain scale, out string msgInfo)
  13. {
  14. msgInfo = "";
  15. //若计量员记录则不验证,则为true
  16. if (PbCache.isNotValid)
  17. {
  18. return true;
  19. }
  20. MeterWorkCalibrationMainService service = new MeterWorkCalibrationMainService();
  21. RESTfulResult<List<MeterBaseCalibraRelation>> rmR = service.doQueryCalibrationWf(scale);
  22. if (rmR.Succeed)
  23. {
  24. //查到了数据就认为还有未校秤的数据
  25. if (rmR.Data != null && rmR.Data.Count > 0)
  26. {
  27. msgInfo = "未校秤无法计量";
  28. return false;
  29. }
  30. else
  31. {
  32. return true;
  33. }
  34. }
  35. else
  36. {
  37. msgInfo = "获取校秤数据失败";
  38. return false;
  39. }
  40. }
  41. }
  42. }