validUnloadAutomatic.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using com.hnshituo.core.webapp.vo;
  2. using Common;
  3. using System;
  4. using System.Collections.Generic;
  5. namespace MeterConditionLibrary
  6. {
  7. /// <summary>
  8. /// 九钢专用
  9. /// </summary>
  10. public class validUnloadAutomatic
  11. {
  12. public void ValidMethod(PreTrackScale scale)
  13. {
  14. Log lg = Log.GetInstance();
  15. try
  16. {
  17. string sqlUload = @"select t.matter_no, t.prediction_type,t.meter_type_no from meter_base_auto_unload t where "
  18. +"t.matter_no = '" + scale.matterNo + "' and t.prediction_type= '" + scale.predictionType + "' and t.meter_type_no='" + scale.meterTypeNo + "' and VALUE_FLAG ='0'";
  19. PbModelDbService<List<PreTrackScale>> pbModelDbServiceLims = new PbModelDbService<List<PreTrackScale>>();
  20. RESTfulResult<List<PreTrackScale>> rESLims2 = pbModelDbServiceLims.executeSqlDataWf(sqlUload);
  21. if (rESLims2 != null && rESLims2.Data != null && rESLims2.Data.Count > 0)
  22. {
  23. //自动装卸货
  24. string sqlaDoUload = @"update METER_WORK_PRE_LINK set VALUE_FLAG = '1' ,UPDATE_MAN_NO = 'system', "
  25. + "UPDATE_MAN_NAME = '自动装卸货' ,UPDATE_TIME = sysdate where PREDICTION_NO = '" + scale.predictionNo + "' and LINK_CODE in ('001021004','001021007') and VALUE_FLAG ='0'";
  26. RESTfulResult<List<PreTrackScale>> resultUpdate = pbModelDbServiceLims.executeSqlDataWf(sqlaDoUload);
  27. if (!resultUpdate.Succeed)
  28. {
  29. lg.WriteLog(17, "车号:" + scale.carNo + ";预报编号:" + scale.predictionNo + "自动装卸货失败!" + resultUpdate.ResultMessage);
  30. }
  31. else
  32. {
  33. lg.WriteLog(17, "车号:" + scale.carNo + ";预报编号:" + scale.predictionNo + "自动装卸货完成!");
  34. }
  35. }
  36. }
  37. catch (Exception ex)
  38. {
  39. lg.WriteLog(17, "validUnloadAutomatic的ValidMethod方法" + ex);
  40. }
  41. }
  42. }
  43. }