duyong 4 anni fa
parent
commit
97ce74d452

+ 179 - 131
CarMeterSystem/frmOneYardToEnd.cs

@@ -36,6 +36,7 @@ namespace CarMeterSystem
         private MeterBaseMatterInfoService matterInfoService = new MeterBaseMatterInfoService(); //物料信息
         private PreTrackScaleService PreTrackScaleService = new PreTrackScaleService();
         private MeterWorkScheduledHelpService meterWorkScheduledHelpService = new MeterWorkScheduledHelpService();
+        MeterWorkCompareSpotScaleService meterWorkCompareSpotScaleService = new MeterWorkCompareSpotScaleService();
 
         private validTermTareCar termTareCar = new validTermTareCar();//验证是否可留期限皮
         private validRecoverInfo recoverInfo = new validRecoverInfo();//验证是否需要复磅以及是否满足复磅条件
@@ -108,7 +109,21 @@ namespace CarMeterSystem
         {
             try
             {
-                    if (PbCache.collect == null) return;
+                bool isCompare = false;
+
+                RESTfulResult<List<MeterWorkCompareSpotSacle>> reSacle = meterWorkCompareSpotScaleService.doQuery(new MeterWorkCompareSpotSacle { carNo = PbCache.lockCarNo });
+                if (reSacle.Succeed)
+                {
+                    if (reSacle.Data == null || reSacle.Data.Count == 0)
+                    { }
+                    else
+                    {
+                        isCompare = true;
+                    }
+                }
+
+
+                if (PbCache.collect == null) return;
                 PbCache.isLockFrm = true;
                 PbCache.lockCarNo = PbCache.collect.carno;
                 PbCache.lockWgt = PbCache.collect.weight;
@@ -168,7 +183,7 @@ namespace CarMeterSystem
                 }
 
                 //判断区域是否正确
-                if (!areaInfo.ValidMethod(PbCache.sportInfo, txtCarNo.Text) && PbCache.monitor.validArea == "1")
+                if (!areaInfo.ValidMethod(PbCache.sportInfo, txtCarNo.Text) && PbCache.monitor.validArea == "1" && !isCompare)
                 {
                     PbCache.isLockFrm = false;
                     btnSave.Enabled = true;
@@ -280,184 +295,217 @@ namespace CarMeterSystem
                     //}
 
                     #region 酒钢业务流程判断
-                    // 把车号加上-
-                    string tempCarNo = PbCache.lockCarNo;
-                    RESTfulResult<List<MeterBaseCar>> resCarList = carService.doQueryCarList(new MeterBaseCar { carNo = tempCarNo });
-                    RESTfulResult<rtInfo> strRm = new RESTfulResult<rtInfo>();
-                    if (resCarList.Succeed)
+                    if (isCompare)
                     {
-                        if (resCarList.Data != null && resCarList.Data.Count == 1)
+                        ExecuteMethod em = new ExecuteMethod();
+                        RESTfulResult<rtInfo> strRm = new RESTfulResult<rtInfo>();
+                        try
                         {
-                            MeterBaseCar car = resCarList.Data[0];
-
-                            ExecuteMethod em = new ExecuteMethod();
-
-                            //判断是否为外发试验性称量,预防超载或欠载(不算正常计量)(吉瑞、铁合金车辆)
-                            bool isjT = false; 
-
-                            if (car.belongUnitTypeNo == "000000" || car.belongUnitTypeNo == "000001")
+                            btnSave.Enabled = false;
+                            strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "compare", "MeterMethod", new object[] { new PreTrackScale { } });
+                            setMsg(strRm.ResultMessage);
+                            strMsg = strRm.ResultMessage;
+                            if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                            {
+                                led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                            }
+                        }
+                        catch (Exception exp)
+                        {
+                            PbCache.ResultMessage = "获取计量场景信息失败,请点击语音求助";
+                            //这里是未找到方法的情况
+                            lg.WriteLog(3, "获取场景失败!" + strRm.ResultMessage);
+                            setMsg(PbCache.ResultMessage);
+                            if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
                             {
-                                isjT = true;
+                                led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
                             }
-                            // 厂内车辆
-                            if (car.carTypeNo == "001004003" || isjT)
+                            //break;
+                            return;
+                        }
+                    }
+                    else
+                    {
+                        // 把车号加上-
+                        string tempCarNo = PbCache.lockCarNo;
+                        RESTfulResult<List<MeterBaseCar>> resCarList = carService.doQueryCarList(new MeterBaseCar { carNo = tempCarNo });
+                        RESTfulResult<rtInfo> strRm = new RESTfulResult<rtInfo>();
+                        if (resCarList.Succeed)
+                        {
+                            if (resCarList.Data != null && resCarList.Data.Count == 1)
                             {
-                                try
+                                MeterBaseCar car = resCarList.Data[0];
+
+                                ExecuteMethod em = new ExecuteMethod();
+
+                                //判断是否为外发试验性称量,预防超载或欠载(不算正常计量)(吉瑞、铁合金车辆)
+                                bool isjT = false;
+
+                                if (car.belongUnitTypeNo == "000000" || car.belongUnitTypeNo == "000001")
                                 {
-                                    btnSave.Enabled = false;
-                                    if (isjT)
-                                    {
-                                        strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "InnerCarJISCO", "MeterMethod", new object[] { new PreTrackScale { carNo = PbCache.lockCarNo } });
-                                    }
-                                    else
+                                    isjT = true;
+                                }
+                                // 厂内车辆
+                                if (car.carTypeNo == "001004003" || isjT)
+                                {
+                                    try
                                     {
-                                        strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "InnerCarJISCO", "MeterMethod", new object[] { new PreTrackScale { } });
+                                        btnSave.Enabled = false;
+                                        if (isjT)
+                                        {
+                                            strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "InnerCarJISCO", "MeterMethod", new object[] { new PreTrackScale { carNo = PbCache.lockCarNo } });
+                                        }
+                                        else
+                                        {
+                                            strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "InnerCarJISCO", "MeterMethod", new object[] { new PreTrackScale { } });
+                                        }
+                                        setMsg(strRm.ResultMessage);
+                                        strMsg = strRm.ResultMessage;
+                                        if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                        {
+                                            led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        }
                                     }
-                                    setMsg(strRm.ResultMessage);
-                                    strMsg = strRm.ResultMessage;
-                                    if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                    catch (Exception exp)
                                     {
-                                        led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        PbCache.ResultMessage = "获取计量场景信息失败,请点击语音求助";
+                                        //这里是未找到方法的情况
+                                        lg.WriteLog(3, "获取场景失败!" + strRm.ResultMessage);
+                                        setMsg(PbCache.ResultMessage);
+                                        if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                        {
+                                            led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        }
+                                        //break;
+                                        return;
                                     }
                                 }
-                                catch (Exception exp)
+                                // 厂外车辆
+                                else if (car.carTypeNo == "001004002" && !isjT)
                                 {
-                                    PbCache.ResultMessage = "获取计量场景信息失败,请点击语音求助";
-                                    //这里是未找到方法的情况
-                                    lg.WriteLog(3, "获取场景失败!" + strRm.ResultMessage);
-                                    setMsg(PbCache.ResultMessage);
-                                    if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                    try
                                     {
-                                        led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        btnSave.Enabled = false;
+                                        strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "OuterCarJISCO", "MeterMethod", new object[] { new PreTrackScale { } });
+                                        setMsg(strRm.ResultMessage);
+                                        strMsg = strRm.ResultMessage;
+                                        if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                        {
+                                            led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        }
                                     }
-                                    //break;
-                                    return;
-                                }
-                            }
-                            // 厂外车辆
-                            else if (car.carTypeNo == "001004002" && !isjT)
-                            {
-                                try
-                                {
-                                    btnSave.Enabled = false;
-                                    strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "OuterCarJISCO", "MeterMethod", new object[] { new PreTrackScale { } });
-                                    setMsg(strRm.ResultMessage);
-                                    strMsg = strRm.ResultMessage;
-                                    if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                    catch (Exception exp)
                                     {
-                                        led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        PbCache.ResultMessage = "获取计量场景信息失败,请点击语音求助";
+                                        //这里是未找到方法的情况
+                                        lg.WriteLog(3, "获取场景失败!" + strRm.ResultMessage);
+                                        setMsg(PbCache.ResultMessage);
+                                        if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                        {
+                                            led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        }
+                                        //break;
+                                        return;
                                     }
                                 }
-                                catch (Exception exp)
+
+                                if (strRm.Succeed)
                                 {
-                                    PbCache.ResultMessage = "获取计量场景信息失败,请点击语音求助";
-                                    //这里是未找到方法的情况
-                                    lg.WriteLog(3, "获取场景失败!" + strRm.ResultMessage);
-                                    setMsg(PbCache.ResultMessage);
-                                    if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                    if (strRm.Data.isError)
                                     {
-                                        led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        //如果是报错则直接不执行,并写入信息到界面,同时调用语音播报
+                                        vicPlayClass.GetVoicePlay("计量数据保存失败", PbCache.collect.carno);
+                                        PbCache.ResultMessage = strRm.Data.resultInfo;
+                                        PbCache.monitorResultMessage = strRm.Data.resultInfo;
+                                        PbCache.isLockFrm = false;
+                                        btnSave.Enabled = true;
+                                        setMsg(PbCache.ResultMessage);
+                                        Monitor(strRm.Data);
+                                        if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                        {
+                                            led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        }
+                                        return;
                                     }
-                                    //break;
-                                    return;
-                                }
-                            }
 
-                            if (strRm.Succeed)
-                            {
-                                if (strRm.Data.isError)
+                                    if (strRm.Data.result) //说明:标识当前跑了一个场景成功了;场景完成后则返回,不再进行下一个场景的执行操作;
+                                    {
+                                        PbCache.ResultMessage = strRm.Data.resultInfo; //语音提示文件
+                                        setMsg(PbCache.ResultMessage);
+                                        Monitor(strRm.Data);
+                                        if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                        {
+                                            led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        }
+                                        //return;
+                                    }
+                                    else
+                                    {
+                                        //说明:不满足场景的的要求,不能进行return,继续下一个场景,若所有的场景都失败,则提示“未找到计量场景配置信息” 
+                                        //ResultMessage = strRm.Data.resultInfo;
+                                        //return strRm.Data.result;  //2021-3-18 杨秀东注释;要处理一车联运(多场景)的数据;问题:提示信息会出现问题
+                                    }
+                                }
+                                else
                                 {
-                                    //如果是报错则直接不执行,并写入信息到界面,同时调用语音播报
                                     vicPlayClass.GetVoicePlay("计量数据保存失败", PbCache.collect.carno);
-                                    PbCache.ResultMessage = strRm.Data.resultInfo;
-                                    PbCache.monitorResultMessage = strRm.Data.resultInfo;
+                                    PbCache.ResultMessage = strRm.ResultMessage;
                                     PbCache.isLockFrm = false;
                                     btnSave.Enabled = true;
                                     setMsg(PbCache.ResultMessage);
+
+                                    // todo:更新监控表,此秤点求助状态为求助中
+                                    if (PbCache.monitor.isHelp == "0")
+                                    {
+                                        RESTfulResult<string> rms = monitor.doUpdateWf(new MeterWorkMonitor { pointNo = PbCache.sportInfo.baseSpotNo, isHelp = "1" });
+                                        if (!rms.Succeed)
+                                        {
+                                            lg.WriteLog(3, PbCache.lockCarNo + "求助写入失败");
+                                        }
+                                    }
                                     Monitor(strRm.Data);
                                     if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
                                     {
                                         led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
                                     }
                                     return;
-                                }
 
-                                if (strRm.Data.result) //说明:标识当前跑了一个场景成功了;场景完成后则返回,不再进行下一个场景的执行操作;
+                                }
+                            }
+                            else
+                            {
+                                if (string.IsNullOrEmpty(tempCarNo))
                                 {
-                                    PbCache.ResultMessage = strRm.Data.resultInfo; //语音提示文件
-                                    setMsg(PbCache.ResultMessage);
-                                    Monitor(strRm.Data);
-                                    if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
-                                    {
-                                        led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
-                                    }
-                                    //return;
+                                    PbCache.ResultMessage += "车号为空,请联系处理";
+                                    PbCache.monitorResultMessage = "车号为空,请联系处理";
                                 }
                                 else
                                 {
-                                    //说明:不满足场景的的要求,不能进行return,继续下一个场景,若所有的场景都失败,则提示“未找到计量场景配置信息” 
-                                    //ResultMessage = strRm.Data.resultInfo;
-                                    //return strRm.Data.result;  //2021-3-18 杨秀东注释;要处理一车联运(多场景)的数据;问题:提示信息会出现问题
+                                    PbCache.ResultMessage += "车号未注册,请联系处理";
+                                    PbCache.monitorResultMessage = "车号未注册,请联系处理";
                                 }
-                            }
-                            else
-                            {
-                                vicPlayClass.GetVoicePlay("计量数据保存失败", PbCache.collect.carno);
-                                PbCache.ResultMessage = strRm.ResultMessage;
                                 PbCache.isLockFrm = false;
                                 btnSave.Enabled = true;
-                                setMsg(PbCache.ResultMessage);
 
-                                // todo:更新监控表,此秤点求助状态为求助中
-                                if (PbCache.monitor.isHelp == "0")
-                                {
-                                    RESTfulResult<string> rms = monitor.doUpdateWf(new MeterWorkMonitor { pointNo = PbCache.sportInfo.baseSpotNo, isHelp = "1" });
-                                    if (!rms.Succeed)
-                                    {
-                                        lg.WriteLog(3, PbCache.lockCarNo + "求助写入失败");
-                                    }
-                                }
-                                Monitor(strRm.Data);
+                                setMsg(PbCache.ResultMessage);
+                                rtInfo rt = new rtInfo();
+                                rt.isWarn = true;
+                                rt.WarnContent = "carErr";
+                                Monitor(rt);
                                 if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
                                 {
                                     led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
                                 }
+                                if (!string.IsNullOrEmpty(tempCarNo))
+                                {
+                                    carService.addCar(new MeterBaseCar { carNo = tempCarNo, carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
+                                }
                                 return;
-
-                            }
-                        }
-                        else
-                        {
-                            if (string.IsNullOrEmpty(tempCarNo))
-                            {
-                                PbCache.ResultMessage += "车号为空,请联系处理";
-                                PbCache.monitorResultMessage = "车号为空,请联系处理";
-                            }
-                            else
-                            {
-                                PbCache.ResultMessage += "车号未注册,请联系处理";
-                                PbCache.monitorResultMessage = "车号未注册,请联系处理";
-                            }
-                            PbCache.isLockFrm = false;
-                            btnSave.Enabled = true;
-                            
-                            setMsg(PbCache.ResultMessage);
-                            rtInfo rt = new rtInfo();
-                            rt.isWarn = true;
-                            rt.WarnContent = "carErr";
-                            Monitor(rt);
-                            if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
-                            {
-                                led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
-                            }
-                            if (!string.IsNullOrEmpty(tempCarNo))
-                            {
-                                carService.addCar(new MeterBaseCar { carNo = tempCarNo,carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
                             }
-                            return;
                         }
+                        #endregion
                     }
-                    #endregion
+
 
                     #region 期限皮显示及保存
 

+ 25 - 2
Common/DbOption/work/MeterWorkCompareSpotScaleService.cs

@@ -1,12 +1,35 @@
-using System;
+using com.hnshituo.core.webapp.vo;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace Common.DbOption.work
+namespace Common
 {
     public class MeterWorkCompareSpotScaleService
     {
+        /// <summary>
+        /// 基础信息查询
+        /// </summary>
+        /// <param name="info"></param>
+        /// <returns></returns>
+        public RESTfulResult<List<MeterWorkCompareSpotSacle>> doQuery(MeterWorkCompareSpotSacle info)
+        {
+            DbHelper db = new DbHelper();
+            RESTfulResult<PageList<List<MeterWorkCompareSpotSacle>>> rm = db.doOption<PageList<List<MeterWorkCompareSpotSacle>>>("meterworkcomparespotsacles", "/", new object[] { info }, 1);
+
+            RESTfulResult<List<MeterWorkCompareSpotSacle>> result = new RESTfulResult<List<MeterWorkCompareSpotSacle>>();
+            result.Succeed = rm.Succeed;
+            result.Status = rm.Status;
+            result.Message = rm.Message;
+            result.ResultMessage = rm.ResultMessage;
+            result.Code = rm.Code;
+            if (rm.Succeed && rm.Data != null && rm.Data.list.Count > 0)
+            {
+                result.Data = rm.Data.list;
+            }
+            return result;
+        }
     }
 }

+ 71 - 2
Common/DbOption/work/MeterWorkCompareSpotService.cs

@@ -1,12 +1,81 @@
-using System;
+using com.hnshituo.core.webapp.vo;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace Common.DbOption.work
+namespace Common
 {
     public class MeterWorkCompareSpotService
     {
+        /// <summary>
+        /// 基础信息查询
+        /// </summary>
+        /// <param name="info"></param>
+        /// <returns></returns>
+        public RESTfulResult<List<MeterWorkCompareSpot>> doQuery(MeterWorkCompareSpot info)
+        {
+            DbHelper db = new DbHelper();
+            RESTfulResult<PageList<List<MeterWorkCompareSpot>>> rm = db.doOption<PageList<List<MeterWorkCompareSpot>>>("meterworkcomparespots", "/", new object[] { info }, 1);
+
+            RESTfulResult<List<MeterWorkCompareSpot>> result = new RESTfulResult<List<MeterWorkCompareSpot>>();
+            result.Succeed = rm.Succeed;
+            result.Status = rm.Status;
+            result.Message = rm.Message;
+            result.ResultMessage = rm.ResultMessage;
+            result.Code = rm.Code;
+            if (rm.Succeed && rm.Data != null && rm.Data.list.Count > 0)
+            {
+                result.Data = rm.Data.list;
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// 添加
+        /// </summary>
+        /// <param name="info"></param>
+        /// <returns></returns>
+        public RESTfulResult<List<MeterWorkCompareSpot>> doAdd(MeterWorkCompareSpot info)
+        {
+            DbHelper db = new DbHelper();
+            RESTfulResult<PageList<List<MeterWorkCompareSpot>>> rm = db.doOption<PageList<List<MeterWorkCompareSpot>>>("meterworkcomparespots", "/", new object[] { info }, 1);
+
+            RESTfulResult<List<MeterWorkCompareSpot>> result = new RESTfulResult<List<MeterWorkCompareSpot>>();
+            result.Succeed = rm.Succeed;
+            result.Status = rm.Status;
+            result.Message = rm.Message;
+            result.ResultMessage = rm.ResultMessage;
+            result.Code = rm.Code;
+            if (rm.Succeed && rm.Data != null && rm.Data.list.Count > 0)
+            {
+                result.Data = rm.Data.list;
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// 添加
+        /// </summary>
+        /// <param name="info"></param>
+        /// <returns></returns>
+        public RESTfulResult<List<MeterWorkCompareSpot>> doMofity(MeterWorkCompareSpot info)
+        {
+            DbHelper db = new DbHelper();
+            RESTfulResult<PageList<List<MeterWorkCompareSpot>>> rm = db.doOption<PageList<List<MeterWorkCompareSpot>>>("meterworkcomparespots", "/", new object[] { info }, 1);
+
+            RESTfulResult<List<MeterWorkCompareSpot>> result = new RESTfulResult<List<MeterWorkCompareSpot>>();
+            result.Succeed = rm.Succeed;
+            result.Status = rm.Status;
+            result.Message = rm.Message;
+            result.ResultMessage = rm.ResultMessage;
+            result.Code = rm.Code;
+            if (rm.Succeed && rm.Data != null && rm.Data.list.Count > 0)
+            {
+                result.Data = rm.Data.list;
+            }
+            return result;
+        }
     }
 }

+ 55 - 0
Common/vo/work/MeterWorkCompareSpot.cs

@@ -102,5 +102,60 @@ namespace Common
 		/// 时间5
 		/// <summary>
 		public DateTime? weightDate5 { get; set; }
+
+		/// <summary>
+		/// 计量点编号1
+		/// <summary>
+		public string baseSpotNo1 { get; set; }
+
+		/// <summary>
+		/// 计量点名称1
+		/// <summary>
+		public string baseSpotName1 { get; set; }
+
+		/// <summary>
+		/// 计量点编号2
+		/// <summary>
+		public string baseSpotNo2 { get; set; }
+
+		/// <summary>
+		/// 计量点名称2
+		/// <summary>
+		public string baseSpotName2 { get; set; }
+
+		/// <summary>
+		/// 计量点编号3
+		/// <summary>
+		public string baseSpotNo3 { get; set; }
+
+		/// <summary>
+		/// 计量点名称3
+		/// <summary>
+		public string baseSpotName3 { get; set; }
+
+		/// <summary>
+		/// 计量点编号4
+		/// <summary>
+		public string baseSpotNo4 { get; set; }
+
+		/// <summary>
+		/// 计量点名称4
+		/// <summary>
+		public string baseSpotName4 { get; set; }
+
+		/// <summary>
+		/// 计量点编号5
+		/// <summary>
+		public string baseSpotNo5 { get; set; }
+
+		/// <summary>
+		/// 计量点名称5
+		/// <summary>
+		public string baseSpotName5 { get; set; }
+
+		/// <summary>
+		/// 较称类型(1:断差;2:较称)
+		/// <summary>
+		public string compareType { get; set; }
 	}
 }

+ 324 - 3
MeterSceneLibrary/JISCO/InnerCarJISCO.cs

@@ -384,6 +384,71 @@ namespace MeterSceneLibrary
                                             }
                                         }
                                         #endregion
+                                        #region 车号-物料
+                                        if (AppConfigCache.TareControlType == "3")
+                                        {
+                                            // 判断收发货单位是否具有期限皮重权限
+                                            MeterBaseUnitInfoService meterBaseUnitInfoService = new MeterBaseUnitInfoService();
+                                            MeterBaseUnitInfo meterBaseUnitInfo = new MeterBaseUnitInfo();
+                                            meterBaseUnitInfo.matterNo = rmScale.Data[0].matterNo;
+                                            meterBaseUnitInfo.matterName = rmScale.Data[0].matterName;
+                                            meterBaseUnitInfo.allowedTareWeight = "1";
+                                            RESTfulResult<List<MeterBaseUnitInfo>> tareUnitResult = meterBaseUnitInfoService.doQueryWf(meterBaseUnitInfo);
+                                            if (tareUnitResult.Succeed)
+                                            {
+                                                if (tareUnitResult.Data == null || tareUnitResult.Data.Count == 0)
+                                                {
+                                                    mwaf.weightType = "0";
+                                                    // 只保存一次计量数据
+                                                    rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
+                                                    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                                }
+                                                else
+                                                {
+                                                    if (tareUnitResult.Data[0].caoNo != "" && tareUnitResult.Data[0].caoNo != PbCache.lockCarNo)
+                                                    {
+                                                        mwaf.weightType = "0";
+                                                        // 只保存一次计量数据
+                                                        rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
+                                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                                    }
+                                                    else
+                                                    {
+                                                        MeterBaseTermTareDataService meterBaseTermTareDataService = new MeterBaseTermTareDataService();
+                                                        RESTfulResult<MeterBaseTermTareData> termTareData = meterBaseTermTareDataService.doQueryPageWf(new MeterBaseTermTareData { carNo = PbCache.lockCarNo, valueFlag = "0" });
+                                                        if (termTareData.Succeed)
+                                                        {
+                                                            if (termTareData.Data == null)
+                                                            {
+                                                                mwaf.weightType = "0";
+                                                                // 只保存一次计量数据
+                                                                rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
+                                                                rt.resultInfo += ",期限皮不存在或者已过期,请留存期限皮";
+                                                                PbCache.ResultMessage = "计量成功,期限皮不存在或者已过期,请留存期限皮";
+                                                                PbCache.monitorResultMessage = "计量成功,期限皮不存在或者已过期,请留存期限皮";
+                                                                PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,期限皮不存在或者已过期请留存期限皮", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                                            }
+                                                            else
+                                                            {
+                                                                // 存在使用期限皮重权限,并使用期限皮重洁净
+                                                                List<string> l = new List<string>();
+                                                                l.Add("create");
+                                                                //给一次数据匹配委托
+                                                                EntityBase<PreTrackScale> entityBase1 = new EntityBase<PreTrackScale>();
+                                                                mwaf = entityBase1.format<MeterWorkCarActualFirst>(rmScale.Data[0], mwaf);
+                                                                mwaf.isPreScale = "1";
+                                                                mwaf.weightType = "0";
+                                                                rt = saveMethod.doNetTermTare(rmScale.Data[0], mwaf);
+                                                                rt.resultInfo += ",期限皮结净";
+                                                                PbCache.ResultMessage = "计量成功,期限皮结净";
+                                                                PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                                            }
+                                                        }
+                                                    }
+                                                }
+                                            }
+                                        }
+                                        #endregion
 
                                     }
                                 }
@@ -534,7 +599,6 @@ namespace MeterSceneLibrary
                                                     meterBaseUnitInfo.forwardingUnitNo = scales.Data[0].forwardingUnitNo;
                                                     meterBaseUnitInfo.receivingUnitName = scales.Data[0].receivingUintName;
                                                     meterBaseUnitInfo.receivingUnitNo = scales.Data[0].receivingUintNo;
-                                                    meterBaseUnitInfo.caoNo = PbCache.lockCarNo;
                                                     meterBaseUnitInfo.matterNo = scales.Data[0].matterNo;
                                                     meterBaseUnitInfo.matterName = scales.Data[0].matterName;
                                                     meterBaseUnitInfo.allowedTareWeight = "1";
@@ -669,6 +733,83 @@ namespace MeterSceneLibrary
                                                     }
                                                 }
                                                 #endregion
+                                                #region 车号-物料
+                                                if (AppConfigCache.TareControlType == "1")
+                                                {
+                                                    // 判断收发货单位是否具有期限皮重权限
+                                                    MeterBaseUnitInfoService meterBaseUnitInfoService = new MeterBaseUnitInfoService();
+                                                    MeterBaseUnitInfo meterBaseUnitInfo = new MeterBaseUnitInfo();
+                                                    meterBaseUnitInfo.matterNo = scales.Data[0].matterNo;
+                                                    meterBaseUnitInfo.matterName = scales.Data[0].matterName;
+                                                    meterBaseUnitInfo.allowedTareWeight = "1";
+                                                    RESTfulResult<List<MeterBaseUnitInfo>> tareUnitResult = meterBaseUnitInfoService.doQueryWf(meterBaseUnitInfo);
+                                                    if (tareUnitResult.Succeed)
+                                                    {
+                                                        if (tareUnitResult.Data == null || tareUnitResult.Data.Count == 0)
+                                                        {
+                                                            mwaf.weightType = "0";
+                                                            rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
+                                                            rt.resultInfo = "之前存在一个未结净的毛重";
+                                                            PbCache.ResultMessage = "之前存在一个未结净的毛重";
+                                                            PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,之前存在一个未结净的毛重,请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                                            PbCache.monitorResultMessage = "之前存在一个未结净的毛重";
+                                                            rt.isWarn = true;
+                                                            rt.WarnContent = "validWgt";
+                                                        }
+                                                        else
+                                                        {
+                                                            if (tareUnitResult.Data[0].caoNo != "" && tareUnitResult.Data[0].caoNo != PbCache.lockCarNo)
+                                                            {
+                                                                mwaf.weightType = "0";
+                                                                rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
+                                                                rt.resultInfo = "之前存在一个未结净的毛重";
+                                                                PbCache.ResultMessage = "之前存在一个未结净的毛重";
+                                                                PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,之前存在一个未结净的毛重,请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                                                PbCache.monitorResultMessage = "之前存在一个未结净的毛重";
+                                                                rt.isWarn = true;
+                                                                rt.WarnContent = "validWgt";
+                                                            }
+                                                            else
+                                                            {
+                                                                MeterBaseTermTareDataService meterBaseTermTareDataService = new MeterBaseTermTareDataService();
+                                                                RESTfulResult<MeterBaseTermTareData> termTareData = meterBaseTermTareDataService.doQueryPageWf(new MeterBaseTermTareData { carNo = PbCache.lockCarNo, valueFlag = "0" });
+                                                                if (termTareData.Succeed)
+                                                                {
+                                                                    if (termTareData.Data == null)
+                                                                    {
+                                                                        mwaf.weightType = "0";
+                                                                        rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
+                                                                        rt.resultInfo = "期限皮过期并之前存在一个未结净的毛重";
+                                                                        PbCache.ResultMessage = "期限皮过期并之前存在一个未结净的毛重";
+                                                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,期限皮过期并之前存在一个未结净的毛重,请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                                                        PbCache.monitorResultMessage = "期限皮过期并之前存在一个未结净的毛重";
+                                                                        rt.isWarn = true;
+                                                                        rt.WarnContent = "validWgt";
+
+                                                                    }
+                                                                    else
+                                                                    {
+                                                                        // 存在使用期限皮重权限,并使用期限皮重洁净
+                                                                        List<string> l = new List<string>();
+                                                                        l.Add("create");
+                                                                        //给一次数据匹配委托
+                                                                        EntityBase<PreTrackScale> entityBase1 = new EntityBase<PreTrackScale>();
+                                                                        mwaf = entityBase1.format<MeterWorkCarActualFirst>(scales.Data[0], mwaf);
+                                                                        mwaf.isPreScale = "1";
+                                                                        mwaf.weightType = "0";
+
+                                                                        PbCache.ResultMessage = "计量成功,期限皮结净";
+                                                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+
+                                                                        rt = saveMethod.doNetTermTare(scales.Data[0], mwaf);
+                                                                        rt.resultInfo += ",期限皮结净";
+                                                                    }
+                                                                }
+                                                            }
+                                                        }
+                                                    }
+                                                }
+                                                #endregion
                                             }
                                             else
                                             {
@@ -741,7 +882,6 @@ namespace MeterSceneLibrary
                                                     meterBaseUnitInfo.receivingUnitNo = rmScale.Data[0].receivingUintNo;
                                                     meterBaseUnitInfo.matterNo = rmScale.Data[0].matterNo;
                                                     meterBaseUnitInfo.matterName = rmScale.Data[0].matterName;
-                                                    meterBaseUnitInfo.caoNo = PbCache.lockCarNo;
                                                     meterBaseUnitInfo.allowedTareWeight = "1";
                                                     RESTfulResult<List<MeterBaseUnitInfo>> tareUnitResult = meterBaseUnitInfoService.doQueryWf(meterBaseUnitInfo);
                                                     if (tareUnitResult.Succeed)
@@ -892,6 +1032,96 @@ namespace MeterSceneLibrary
                                                     }
                                                 }
                                                 #endregion
+                                                #region 车号-物料
+                                                if (AppConfigCache.TareControlType == "1")
+                                                {
+                                                    // 判断收发货单位是否具有期限皮重权限
+                                                    MeterBaseUnitInfoService meterBaseUnitInfoService = new MeterBaseUnitInfoService();
+                                                    MeterBaseUnitInfo meterBaseUnitInfo = new MeterBaseUnitInfo();
+                                                    meterBaseUnitInfo.matterNo = rmScale.Data[0].matterNo;
+                                                    meterBaseUnitInfo.matterName = rmScale.Data[0].matterName;
+                                                    meterBaseUnitInfo.allowedTareWeight = "1";
+                                                    RESTfulResult<List<MeterBaseUnitInfo>> tareUnitResult = meterBaseUnitInfoService.doQueryWf(meterBaseUnitInfo);
+                                                    if (tareUnitResult.Succeed)
+                                                    {
+                                                        if (tareUnitResult.Data == null || tareUnitResult.Data.Count == 0)
+                                                        {
+                                                            // 正常结净
+                                                            //给一次数据匹配委托
+                                                            EntityBase<PreTrackScale> entityBase3 = new EntityBase<PreTrackScale>();
+                                                            mwaf = entityBase3.format<MeterWorkCarActualFirst>(rmScale.Data[0], mwaf);
+                                                            mwaf.isPreScale = "1";
+                                                            mwaf.weightType = "0";
+
+                                                            rt = saveMethod.doNet(rmScale.Data[0], firstList[0], mwaf);
+                                                            PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmFirst.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                                        }
+                                                        else
+                                                        {
+                                                            if (tareUnitResult.Data[0].caoNo != "" && tareUnitResult.Data[0].caoNo != PbCache.lockCarNo)
+                                                            {
+                                                                // 正常结净
+                                                                //给一次数据匹配委托
+                                                                EntityBase<PreTrackScale> entityBase3 = new EntityBase<PreTrackScale>();
+                                                                mwaf = entityBase3.format<MeterWorkCarActualFirst>(rmScale.Data[0], mwaf);
+                                                                mwaf.isPreScale = "1";
+                                                                mwaf.weightType = "0";
+
+                                                                rt = saveMethod.doNet(rmScale.Data[0], firstList[0], mwaf);
+                                                                PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmFirst.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                                            }
+                                                            else
+                                                            {
+                                                                MeterBaseTermTareDataService meterBaseTermTareDataService = new MeterBaseTermTareDataService();
+                                                                RESTfulResult<MeterBaseTermTareData> termTareData = meterBaseTermTareDataService.doQueryPageWf(new MeterBaseTermTareData { carNo = PbCache.lockCarNo, valueFlag = "0" });
+                                                                if (termTareData.Succeed)
+                                                                {
+                                                                    // 正常结净
+                                                                    //给一次数据匹配委托
+                                                                    EntityBase<PreTrackScale> entityBase3 = new EntityBase<PreTrackScale>();
+                                                                    mwaf = entityBase3.format<MeterWorkCarActualFirst>(rmScale.Data[0], mwaf);
+                                                                    mwaf.isPreScale = "1";
+                                                                    mwaf.weightType = "0";
+
+                                                                    rt = saveMethod.doTermTareNet(rmScale.Data[0], mwaf, firstList[0]);
+                                                                    rt.resultInfo += ",留存期限皮成功";
+                                                                    PbCache.ResultMessage = "计量成功,留存期限皮成功";
+                                                                    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,留存期限皮成功", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                                                    //if (termTareData.Data == null)
+                                                                    //{
+                                                                    // 正常结净
+                                                                    //给一次数据匹配委托
+                                                                    //EntityBase<PreTrackScale> entityBase3 = new EntityBase<PreTrackScale>();
+                                                                    //mwaf = entityBase3.format<MeterWorkCarActualFirst>(rmScale.Data[0], mwaf);
+                                                                    //mwaf.isPreScale = "1";
+                                                                    //mwaf.weightType = "0";
+
+                                                                    //rt = saveMethod.doTermTareNet(rmScale.Data[0], mwaf, firstList[0]);
+                                                                    //rt.resultInfo += ",留存期限皮成功";
+                                                                    //PbCache.ResultMessage = "计量成功,留存期限皮成功";
+                                                                    //PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,留存期限皮成功", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                                                    //}
+                                                                    //else
+                                                                    //{
+                                                                    //    // 存在使用期限皮重权限,并使用期限皮重洁净
+                                                                    //    List<string> l = new List<string>();
+                                                                    //    l.Add("create");
+                                                                    //    //给一次数据匹配委托
+                                                                    //    EntityBase<PreTrackScale> entityBase1 = new EntityBase<PreTrackScale>();
+                                                                    //    mwaf = entityBase1.format<MeterWorkCarActualFirst>(rmScale.Data[0], mwaf);
+                                                                    //    mwaf.isPreScale = "1";
+                                                                    //    mwaf.weightType = "0";
+                                                                    //    rt = saveMethod.doNetTermTare(rmScale.Data[0], mwaf);
+                                                                    //    rt.resultInfo += ",期限皮结净";
+                                                                    //    PbCache.ResultMessage = "计量成功,期限皮结净";
+                                                                    //    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                                                    //}
+                                                                }
+                                                            }
+                                                        }
+                                                    }
+                                                }
+                                                #endregion
                                             }
                                         }
                                         // 重量类型为毛重,在皮重误差内
@@ -1074,7 +1304,6 @@ namespace MeterSceneLibrary
                                                 meterBaseUnitInfo.receivingUnitNo = scales.Data[0].receivingUintNo;
                                                 meterBaseUnitInfo.matterName = scales.Data[0].matterName;
                                                 meterBaseUnitInfo.matterNo = scales.Data[0].matterNo;
-                                                meterBaseUnitInfo.caoNo = PbCache.lockCarNo;
                                                 meterBaseUnitInfo.allowedTareWeight = "1";
                                                 RESTfulResult<List<MeterBaseUnitInfo>> tareUnitResult = meterBaseUnitInfoService.doQueryWf(meterBaseUnitInfo);
                                                 if (tareUnitResult.Succeed)
@@ -1226,6 +1455,98 @@ namespace MeterSceneLibrary
                                                 }
                                             }
                                             #endregion
+                                            #region 车号-物料
+                                            if (AppConfigCache.TareControlType == "1")
+                                            {
+                                                // 判断收发货单位是否具有期限皮重权限
+                                                MeterBaseUnitInfoService meterBaseUnitInfoService = new MeterBaseUnitInfoService();
+                                                MeterBaseUnitInfo meterBaseUnitInfo = new MeterBaseUnitInfo();
+                                                meterBaseUnitInfo.matterName = scales.Data[0].matterName;
+                                                meterBaseUnitInfo.matterNo = scales.Data[0].matterNo;
+                                                meterBaseUnitInfo.allowedTareWeight = "1";
+                                                RESTfulResult<List<MeterBaseUnitInfo>> tareUnitResult = meterBaseUnitInfoService.doQueryWf(meterBaseUnitInfo);
+                                                if (tareUnitResult.Succeed)
+                                                {
+                                                    if (tareUnitResult.Data == null || tareUnitResult.Data.Count == 0)
+                                                    {
+                                                        //匹配结净
+                                                        EntityBase<PreTrackScale> entityBase2 = new EntityBase<PreTrackScale>();
+                                                        mwaf = entityBase2.format<MeterWorkCarActualFirst>(scales.Data[0], mwaf);
+                                                        mwaf.isPreScale = "1";
+                                                        mwaf.weightType = "0";
+
+                                                        rt = saveMethod.doNet(scales.Data[0], firstList[0], mwaf);
+                                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmFirst.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                                    }
+                                                    else
+                                                    {
+                                                        if (tareUnitResult.Data[0].caoNo != "" && tareUnitResult.Data[0].caoNo != PbCache.lockCarNo)
+                                                        {
+                                                            //匹配结净
+                                                            EntityBase<PreTrackScale> entityBase2 = new EntityBase<PreTrackScale>();
+                                                            mwaf = entityBase2.format<MeterWorkCarActualFirst>(scales.Data[0], mwaf);
+                                                            mwaf.isPreScale = "1";
+                                                            mwaf.weightType = "0";
+
+                                                            rt = saveMethod.doNet(scales.Data[0], firstList[0], mwaf);
+                                                            PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmFirst.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                                        }
+                                                        else
+                                                        {
+                                                            MeterBaseTermTareDataService meterBaseTermTareDataService = new MeterBaseTermTareDataService();
+                                                            RESTfulResult<MeterBaseTermTareData> termTareData = meterBaseTermTareDataService.doQueryPageWf(new MeterBaseTermTareData { carNo = PbCache.lockCarNo, valueFlag = "0" });
+                                                            if (termTareData.Succeed)
+                                                            {
+
+                                                                // 正常结净
+                                                                //给一次数据匹配委托
+                                                                EntityBase<PreTrackScale> entityBase3 = new EntityBase<PreTrackScale>();
+                                                                mwaf = entityBase3.format<MeterWorkCarActualFirst>(scales.Data[0], mwaf);
+                                                                mwaf.isPreScale = "1";
+                                                                mwaf.weightType = "1";
+
+                                                                rt = saveMethod.doTermTareNet(scales.Data[0], mwaf, firstList[0]);
+                                                                rt.resultInfo += ",留存期限皮成功";
+                                                                PbCache.ResultMessage = "计量成功,期限皮不存在或者已过期,请留存期限皮";
+                                                                PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                                                //if (termTareData.Data == null)
+                                                                //{
+                                                                //    // 正常结净
+                                                                //    //给一次数据匹配委托
+                                                                //    EntityBase<PreTrackScale> entityBase3 = new EntityBase<PreTrackScale>();
+                                                                //    mwaf = entityBase3.format<MeterWorkCarActualFirst>(scales.Data[0], mwaf);
+                                                                //    mwaf.isPreScale = "1";
+                                                                //    mwaf.weightType = "1";
+
+                                                                //    rt = saveMethod.doTermTareNet(scales.Data[0], mwaf, firstList[0]);
+                                                                //    rt.resultInfo += ",留存期限皮成功";
+                                                                //    PbCache.ResultMessage = "计量成功,期限皮不存在或者已过期,请留存期限皮";
+                                                                //    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+
+                                                                //}
+                                                                //else
+                                                                //{
+                                                                //    // 存在使用期限皮重权限,并使用期限皮重洁净
+                                                                //    List<string> l = new List<string>();
+                                                                //    l.Add("create");
+                                                                //    //给一次数据匹配委托
+                                                                //    EntityBase<PreTrackScale> entityBase1 = new EntityBase<PreTrackScale>();
+                                                                //    mwaf = entityBase1.format<MeterWorkCarActualFirst>(scales.Data[0], mwaf);
+                                                                //    mwaf.isPreScale = "1";
+                                                                //    mwaf.weightType = "0";
+
+                                                                //    PbCache.ResultMessage = "计量成功,期限皮结净";
+                                                                //    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+
+                                                                //    rt = saveMethod.doNetTermTare(scales.Data[0], mwaf);
+                                                                //    rt.resultInfo += ",期限皮结净";
+                                                                //}
+                                                            }
+                                                        }
+                                                    }
+                                                }
+                                            }
+                                            #endregion
                                         }
                                         else
                                         {

+ 71 - 2
MeterSceneLibrary/JISCO/compare.cs

@@ -1,4 +1,5 @@
-using Common;
+using com.hnshituo.core.webapp.vo;
+using Common;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -11,9 +12,77 @@ namespace MeterSceneLibrary
     {
 
         private rtInfo rt = new rtInfo();
+
+        MeterWorkCompareSpotScaleService meterWorkCompareSpotScaleService = new MeterWorkCompareSpotScaleService();
+
+        MeterWorkCompareSpotService meterWorkCompareSpotService = new MeterWorkCompareSpotService();
+
+        private JISCO.SaveMethod saveMethod = new JISCO.SaveMethod();
         public rtInfo MeterMethod(PreTrackScale scale)
         {
-            //MeterWorkCompareSpot 
+            RESTfulResult<List<MeterWorkCompareSpotSacle>> reSacle = meterWorkCompareSpotScaleService.doQuery(new MeterWorkCompareSpotSacle { carNo = PbCache.lockCarNo });
+
+            if (reSacle.Succeed)
+            {
+                if (reSacle.Data == null || reSacle.Data.Count == 0)
+                {
+                    rt = saveMethod.doError("");
+                }
+                else
+                {
+                    RESTfulResult<List<MeterWorkCompareSpot>> reCompareSpot = meterWorkCompareSpotService.doQuery(new MeterWorkCompareSpot { carNo = PbCache.lockCarNo });
+
+                    if (reCompareSpot.Succeed)
+                    {
+                        if (reCompareSpot.Data == null || reCompareSpot.Data.Count == 0)
+                        {
+                            MeterWorkCompareSpot meterWorkCompareSpot = new MeterWorkCompareSpot();
+                            meterWorkCompareSpot.carNo = PbCache.lockCarNo;
+                            meterWorkCompareSpot.weightDate1 = DateTime.Now;
+                            meterWorkCompareSpot.weightNum1 = PbCache.lockWgt;
+                            meterWorkCompareSpot.baseSpotNo1 = PbCache.sportInfo.baseSpotNo;
+                            meterWorkCompareSpot.baseSpotName1 = PbCache.sportInfo.baseSpotName;
+                            meterWorkCompareSpot.compareType = "2";
+                            meterWorkCompareSpotService.doAdd(meterWorkCompareSpot);
+                        }
+                        else
+                        {
+                            MeterWorkCompareSpot meterWorkCompareSpot = reCompareSpot.Data[0];
+                            meterWorkCompareSpot.carNo = PbCache.lockCarNo;
+                            meterWorkCompareSpot.compareType = "2";
+                            if (meterWorkCompareSpot.weightDate2 == null)
+                            {
+                                meterWorkCompareSpot.weightDate2 = DateTime.Now;
+                                meterWorkCompareSpot.weightNum2 = PbCache.lockWgt;
+                                meterWorkCompareSpot.baseSpotNo2 = PbCache.sportInfo.baseSpotNo;
+                                meterWorkCompareSpot.baseSpotName2 = PbCache.sportInfo.baseSpotName;
+                            }
+                            else if (meterWorkCompareSpot.weightDate3 == null)
+                            {
+                                meterWorkCompareSpot.weightDate3 = DateTime.Now;
+                                meterWorkCompareSpot.weightNum3 = PbCache.lockWgt;
+                                meterWorkCompareSpot.baseSpotNo3 = PbCache.sportInfo.baseSpotNo;
+                                meterWorkCompareSpot.baseSpotName3 = PbCache.sportInfo.baseSpotName;
+                            }
+                            else if (meterWorkCompareSpot.weightDate4 == null)
+                            {
+                                meterWorkCompareSpot.weightDate4 = DateTime.Now;
+                                meterWorkCompareSpot.weightNum4 = PbCache.lockWgt;
+                                meterWorkCompareSpot.baseSpotNo4 = PbCache.sportInfo.baseSpotNo;
+                                meterWorkCompareSpot.baseSpotName4 = PbCache.sportInfo.baseSpotName;
+                            }
+                            else
+                            {
+                                meterWorkCompareSpot.weightDate5 = DateTime.Now;
+                                meterWorkCompareSpot.weightNum5 = PbCache.lockWgt;
+                                meterWorkCompareSpot.baseSpotNo5 = PbCache.sportInfo.baseSpotNo;
+                                meterWorkCompareSpot.baseSpotName5 = PbCache.sportInfo.baseSpotName;
+                            }
+                            meterWorkCompareSpotService.doMofity(meterWorkCompareSpot);
+                        }
+                    }
+                }
+            }
             return rt;
         }
     }

+ 48 - 5
TrainVideoDataDispose/ftpHelper.cs

@@ -19,7 +19,9 @@ namespace TrainVideoDataDispose
             try
             {
                 List<string> result = new List<string>();//如果要修改字符串而不创建新的对象,则可以使用 System.Text.StringBuilder 类。
-                List<string> result1 = new List<string>();//如果要修改字符串而不创建新的对象,则可以使用 System.Text.StringBuilder 类。
+                List<string> resultTxt = new List<string>();//如果要修改字符串而不创建新的对象,则可以使用 System.Text.StringBuilder 类。
+                List<string> resultJpg = new List<string>();//如果要修改字符串而不创建新的对象,则可以使用 System.Text.StringBuilder 类。
+                List<string> resultMp4 = new List<string>();//如果要修改字符串而不创建新的对象,则可以使用 System.Text.StringBuilder 类。
                 FtpWebRequest ftp;
                 ftp = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://10.111.16.113"));//"ftp://10.12.12.9";
                 ftp.Credentials = new NetworkCredential("300t", "300t");
@@ -37,12 +39,53 @@ namespace TrainVideoDataDispose
                 {
                     if (item.Contains(".txt"))
                     {
-                        result1.Add(item);
+                        resultTxt.Add(item);
                     }
                 }
-                string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "textFtp";
-                string fileName = result1[0].Substring(result1[0].Length - 23);
-                Download(path, fileName);
+                foreach (var item in result)
+                {
+                    if (item.Contains(".jpeg"))
+                    {
+                        resultJpg.Add(item);
+                    }
+                }
+                foreach (var item in result)
+                {
+                    if (item.Contains(".mp4"))
+                    {
+                        resultMp4.Add(item);
+                    }
+                }
+                string pathImg = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + DateTime.Now.ToString("yyyyMMdd") + "/img";
+                string pathTxt = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + DateTime.Now.ToString("yyyyMMdd") + "/txt";
+                string pathMp4 = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + DateTime.Now.ToString("yyyyMMdd") + "/movie";
+                if (!Directory.Exists(pathImg))
+                {
+                    Directory.CreateDirectory(pathImg);
+                }
+                if (!Directory.Exists(pathTxt))
+                {
+                    Directory.CreateDirectory(pathTxt);
+                }
+                if (!Directory.Exists(pathMp4))
+                {
+                    Directory.CreateDirectory(pathMp4);
+                }
+                foreach (var item in resultTxt)
+                {
+                    string fileName = item.Substring(item.Length - 23);
+                    Download(pathTxt, fileName);
+                }
+                //foreach (var item in resultMp4)
+                //{
+                //    string fileName = item.Substring(item.Length - 23);
+                //    Download(pathMp4, fileName);
+                //}
+                //foreach (var item in resultJpg)
+                //{
+                //    string fileName = item.Substring(item.Length - 26);
+                //    Download(pathImg, fileName);
+                //}
                 reader.Close();
                 response.Close();
                 return result.ToString().Split('\n');