compare.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using com.hnshituo.core.webapp.vo;
  2. using Common;
  3. using System;
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace MeterSceneLibrary
  10. {
  11. public class compare
  12. {
  13. private rtInfo rt = new rtInfo();
  14. MeterWorkCompareSpotScaleService meterWorkCompareSpotScaleService = new MeterWorkCompareSpotScaleService();
  15. MeterWorkCompareSpotService meterWorkCompareSpotService = new MeterWorkCompareSpotService();
  16. private JISCO.SaveMethod saveMethod = new JISCO.SaveMethod();
  17. public rtInfo MeterMethod(PreTrackScale scale)
  18. {
  19. RESTfulResult<List<MeterWorkCompareSpotSacle>> reSacle = meterWorkCompareSpotScaleService.doQuery(new MeterWorkCompareSpotSacle { carNo = PbCache.lockCarNo,valueFlag = "1" });
  20. if (reSacle.Succeed)
  21. {
  22. if (reSacle.Data == null || reSacle.Data.Count == 0)
  23. {
  24. rt = saveMethod.doError("未查询到较称预约");
  25. rt.resultInfo = "未查询到较称预约";
  26. PbCache.LEDResultMessage = "未查询到较称预约";
  27. PbCache.voiceType = 25;
  28. PbCache.monitorResultMessage = "车号"+PbCache.lockCarNo+ "未查询到较称预约";
  29. }
  30. else
  31. {
  32. Hashtable hashtable = new Hashtable();
  33. hashtable.Add("carNo", PbCache.lockCarNo);
  34. hashtable.Add("weight", int.Parse(PbCache.lockWgt.ToString()));
  35. hashtable.Add("spotName", PbCache.sportInfo.baseSpotName);
  36. hashtable.Add("spotNo", PbCache.sportInfo.baseSpotNo);
  37. hashtable.Add("scaleNo", reSacle.Data[0].CompareSpotScaleId);
  38. hashtable.Add("name", "admin");
  39. hashtable.Add("compareType", "2");
  40. rt = saveMethod.doCompare(hashtable);
  41. PbCache.voiceType = 16;
  42. PbCache.LEDResultMessage = string.Format("车号{0},较秤完成,重量{1}吨", PbCache.lockWgt, Math.Round((PbCache.lockWgt / 1000), 2));
  43. }
  44. }
  45. // 后台失败处理
  46. if (!rt.result)
  47. {
  48. rt.resultInfo = "称重数据保存失败";
  49. PbCache.voiceType = 25;
  50. PbCache.LEDResultMessage = "计量失败,请联系计量大厅";
  51. PbCache.monitorResultMessage = "";
  52. }
  53. return rt;
  54. }
  55. }
  56. }