validArea.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Common;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using com.hnshituo.core.webapp.vo;
  8. namespace MeterConditionLibrary
  9. {
  10. public class validArea
  11. {
  12. MeterWorkCarActualFirstService meterWorkCarActualFirstService = new MeterWorkCarActualFirstService();
  13. MeterBaseSpotInfoService meterBaseSpotInfoService = new MeterBaseSpotInfoService();
  14. public bool ValidMethod(MeterBaseSpotInfo spot,string carNo)
  15. {
  16. //查询该车号一次数据
  17. RESTfulResult<List<MeterWorkCarActualFirst>> rmFirst = meterWorkCarActualFirstService.doQueryByFlag(new MeterWorkCarActualFirst { carNo = carNo });
  18. if (rmFirst.Succeed)
  19. {
  20. if (rmFirst.Data == null || rmFirst.Data.Count == 0)
  21. {
  22. return true;
  23. }
  24. else
  25. {
  26. //查询称点信息
  27. RESTfulResult<List<MeterBaseSpotInfo>> rmSpot = meterBaseSpotInfoService.doQueryWf(new MeterBaseSpotInfo { baseSpotNo = rmFirst.Data[0].baseSpotNo });
  28. if (rmSpot.Succeed)
  29. {
  30. if (rmSpot.Data == null || rmSpot.Data.Count == 0)
  31. {
  32. return true;
  33. }
  34. else
  35. {
  36. if (rmSpot.Data[0].spotAreaNo == spot.spotAreaNo)
  37. {
  38. return true;
  39. }
  40. else
  41. {
  42. return false;
  43. }
  44. }
  45. }
  46. }
  47. }
  48. return true;
  49. }
  50. }
  51. }