duyong 3 anni fa
parent
commit
c8d9834a3e

+ 2 - 2
CarMeterMonitor/App.config

@@ -6,10 +6,10 @@
   <appSettings>
     <!--<add key="ServiceUrl" value="http://127.0.0.1:9004/v1" />-->
     <!--<add key="ServiceUrl" value="http://10.104.4.105:9004/v1" />-->
-    <add key="ServiceUrl" value="http://10.104.0.1:9004/v1" />
+    <!--<add key="ServiceUrl" value="http://10.104.0.1:9004/v1" />-->
     <!--<add key="ServiceUrl" value="http://192.168.107.60:8888/icore.icp.winform/pass/jlcar"/>-->
     <!--<add key="ServiceUrl" value="http://192.168.185.29/icore.icp.winform/pass/jlcar"/>-->
-    <!--<add key="ServiceUrl" value="http://jgwzjl.jiugang.com/icore.icp.web/pass/systemBase/v1"/>-->
+    <add key="ServiceUrl" value="http://jgwzjl.jiugang.com/icore.icp.web/pass/systemBase/v1"/>
     <!--实时库地址-->
     <add key="icoredbTcp" value="tarantool://guest@10.99.200.86:2101" />
     <!--SFTP或者vsftp服务端连接及地址-->

+ 13 - 0
CarMeterMonitor/fromContect.cs

@@ -42,6 +42,8 @@ namespace CarMeterMonitor
         //零点报警表
         private meterworkzeroalarmservice zeroAlarmService = new meterworkzeroalarmservice();
 
+        private MeterWorkScheduledHelpService meterWorkScheduledHelpService = new MeterWorkScheduledHelpService();
+
         //车号修正
         private CarNoModfiy modfiy = new CarNoModfiy();
 
@@ -455,8 +457,19 @@ namespace CarMeterMonitor
                         startWeight = 2;
                         TimeSpan secondSpan = new TimeSpan(endTime.Ticks - startTime.Ticks);
                         WriteText(1, "开始时间:" + startTime.ToString("yyyy-MM-dd HH:mm:ss:fff") + ",结束时间:" + endTime.ToString("yyyy-MM-dd HH:mm:ss:fff") + ",时间差:" + secondSpan.TotalSeconds + "秒" + ",重量:" + e.weight);
+
+                        MeterWorkScheduledHelp meterWorkScheduledHelp1 = new MeterWorkScheduledHelp();
+                        meterWorkScheduledHelp1.baseSpotNo = PbCache.sportInfo.baseSpotNo;
+                        meterWorkScheduledHelp1.baseSpotName = PbCache.sportInfo.baseSpotName;
+                        meterWorkScheduledHelp1.carNo = e.vdioCarNos;
+                        meterWorkScheduledHelp1.helpContent = "开始时间:" + startTime.ToString("yyyy-MM-dd HH:mm:ss:fff") + ",结束时间:" + endTime.ToString("yyyy-MM-dd HH:mm:ss:fff") + ",时间差:" + secondSpan.TotalSeconds + "秒" + ",重量:" + e.weight + ",车号:" + e.vdioCarNos;
+                        meterWorkScheduledHelp1.warmType = "6";
+                        meterWorkScheduledHelp1.warmTypeName = "车号重量采集";
+                        meterWorkScheduledHelpService.add(meterWorkScheduledHelp1);
                     }
 
+
+
                     if (PbCache.dtStartTime == null)
                         PbCache.dtStartTime = DateTime.Now;
                     isLedWrite = true;

+ 4 - 3
CarMeterSystem/App.config

@@ -5,11 +5,12 @@
 	</startup>
 	<appSettings>
 		<!--<add key="ServiceUrl" value="http://127.0.0.1:9004/v1" />-->
-    <add key="ServiceUrl" value="http://10.104.4.105:9004/v1" />
-    <!--<add key="ServiceUrl" value="http://10.104.0.1:9004/v1" />-->
+    <!--<add key="ServiceUrl" value="http://10.104.4.105:9004/v1" />-->
+    <!--<add key="ServiceUrl" value="http://192.168.216.143:9004/v1" />-->
+    <add key="ServiceUrl" value="http://10.104.0.1:9004/v1" />
 		<!--<add key="ServiceUrl" value="http://192.168.107.60:8888/icore.icp.winform/pass/jlcar"/>-->
     <!--<add key="ServiceUrl" value="http://192.168.185.29/icore.icp.winform/pass/jlcar"/>-->
-    <!--<add key="ServiceUrl" value="http://jgwzjl.jiugang.com/icore.icp.web/pass/systemBase/v1"/>-->
+    <!--<add key="ServiceUrl" value="http://jgwzjl.jiugang.com/icore.icp.web/pass/winform/systemBase/v1"/>-->
     <!--实时库地址-->
 		<add key="icoredbTcp" value="tarantool://guest@10.99.200.86:2101" />
 		<!--SFTP或者vsftp服务端连接及地址-->

+ 2 - 2
CarMeterSystem/Form1.cs

@@ -326,9 +326,9 @@ namespace CarMeterSystem
                 l.WriteLog(12,sweepCodeClass.ToString());
                 if (string.IsNullOrEmpty(sweepCodeClass.StrCode))
                 {
-                    codeFlag = false;
                     if (string.IsNullOrEmpty(PbCache.strCode))
                     {
+                        codeFlag = false;
                         firstCode = "";
                         PbCache.strCode = "";
                         l.WriteLog(12, "主线程扫码值为空时清空;sweepCodeClass.StrCode值为" + sweepCodeClass.StrCode + " ;PbCache.strCode值为:" + PbCache.strCode);
@@ -349,7 +349,7 @@ namespace CarMeterSystem
                     //}
                     l.WriteLog(12, "测试扫码值"+PbCache.strCode);
                     PbCache.collect.carno = sweepCodeClass.StrCode;
-                    
+                    PbCache.strCode = sweepCodeClass.StrCode;
                     codeFlag = true;
                 }
                 #endregion

+ 37 - 35
CarMeterSystem/frmMain.cs

@@ -205,6 +205,7 @@ namespace CarMeterSystem
         {
             if (!isOpened && PbCache.collect?.weight > 500)
             {
+                l.WriteLog(31, "frmOneYardToEnd页面打开(timer1_Tick:frmMain),车号:" + PbCache.resultCarNo + "||" + (PbCache.collect == null ? "" : PbCache.collect.carno));
                 isOpened = true;
                 PbCache.bussinessTypeName = "";
                 PbCache.bussinessTypeCode = "";
@@ -329,6 +330,8 @@ namespace CarMeterSystem
         private int iCountPark = 0;
         private string editCarNo = "";
 
+        private bool isResFlag = true;
+
         private int num = 0;
 
         /// <summary>
@@ -338,31 +341,34 @@ namespace CarMeterSystem
         /// <param name="e"></param>
         private void EventData(object o, DataCollectionArgs e)
         {
+            if (!timer1.Enabled)
+            {
+                timer1.Enabled = true;
+                l.WriteLog(32, "定时器重启(timer1_Tick:frmMain),车号:" + PbCache.resultCarNo + "||" + (PbCache.collect == null ? "" : PbCache.collect.carno));
+            }
             //num++;
 
+            //e.carno = "湘G88888";
+
             //if (num < 20)
             //{
-            //    e.carno = "陕AAB221";
             //    e.weight = 23580;
             //    e.weightStatus = 1;
             //}
             //else if (num < 26)
             //{
-            //    e.carno = "陕AAB221";
             //    e.weight = 23580;
             //    e.weightStatus = 0;
             //}
             //else if (num < 39)
             //{
-            //    e.carno = "陕AAB221";
             //    e.weight = 23580;
             //    e.weightStatus = 0;
             //}
-            //else if (num < 74)
+            //else if (num < 45)
             //{
-            //    e.carno = "陕AAB221";
-            //    e.weight = 23580;
-            //    e.weightStatus = 0;
+            //    e.weight = 15000;
+            //    e.weightStatus = 1;
             //}
             //else
             //{
@@ -384,9 +390,9 @@ namespace CarMeterSystem
 
                 if (string.IsNullOrEmpty(sweepCodeClass.StrCode))
                 {
-                    codeFlag = false;
                     if (string.IsNullOrEmpty(PbCache.strCode))
                     {
+                        codeFlag = false;
                         firstCode = "";
                         PbCache.strCode = "";
                         l.WriteLog(12, "主线程扫码值为空时清空;sweepCodeClass.StrCode值为" + sweepCodeClass.StrCode + " ;PbCache.strCode值为:" + PbCache.strCode);
@@ -408,6 +414,7 @@ namespace CarMeterSystem
                     //}
                     l.WriteLog(12, "测试扫码值" + PbCache.strCode);
                     PbCache.collect.carno = sweepCodeClass.StrCode;
+                    PbCache.strCode = sweepCodeClass.StrCode;
                     codeFlag = true;
                 }
 
@@ -466,16 +473,22 @@ namespace CarMeterSystem
                     PbCache.collect.parkStatus = e.parkStatus;
                     PbCache.collect.datetime = e.datetime;
                     PbCache.collect.licType = e.licType;
-                    if (PbCache.collect.weightStatus == 0)
+                }
+
+                if (PbCache.collect != null && PbCache.collect.weightStatus == 0)
+                {
+                    if (string.IsNullOrEmpty(PbCache.resultWgt))
                     {
-                        if (string.IsNullOrEmpty(PbCache.resultWgt) || !PbCache.resultWgt.Contains(e.weight + ""))
-                        {
-                            PbCache.resultWgt += e.weight + "||";
-                        }
-                        if (!string.IsNullOrEmpty(e.carno))
-                        {
-                            PbCache.resultCarNo = e.carno + "";
-                        }
+                        PbCache.resultWgt = e.weight + "";
+                    }
+                    if (!string.IsNullOrEmpty(PbCache.resultWgt) && e.weight > Convert.ToInt32(PbCache.resultWgt))
+                    {
+                        PbCache.resultWgt = e.weight + "";
+                    }
+                    if (!string.IsNullOrEmpty(e.carno) && PbCache.resultCarNo != e.carno)
+                    {
+                        PbCache.resultCarNo = e.carno + "";
+                        l.WriteLog(28, "车号賦值跟蹤:PbCache.resultCarNo" + PbCache.resultCarNo + "||e.carno" + e.carno);
                     }
                 }
                 //*/
@@ -486,21 +499,7 @@ namespace CarMeterSystem
                 //重量大于500的情况下
                 if (e.weight > 500)
                 {
-                    #region 记录从上秤到下秤的所有的提示信息
-                    if (!string.IsNullOrEmpty(PbCache.resultMsgAll) && !PbCache.resultMsgAll.Contains(PbCache.ResultMessage))
-                    {
-                        PbCache.resultMsgAll = PbCache.resultMsgAll + " || " + PbCache.ResultMessage;
-                    }
-                    else if (string.IsNullOrEmpty(PbCache.resultMsgAll))
-                    {
-                        PbCache.resultMsgAll = PbCache.ResultMessage;
-                    }
-                    else
-                    {
-                        //提示信息重复,不做处理
-                    }
-                    #endregion 记录从上秤到下秤的所有的提示信息
-
+                    isResFlag = true;
 
                     if (PbCache.dtStartTime == null)
                         PbCache.dtStartTime = DateTime.Now;
@@ -790,17 +789,18 @@ namespace CarMeterSystem
                     preWgt = 0;
 
                     //不等于空的时候说明写过一次日志了
-                    if (!string.IsNullOrEmpty(PbCache.resultMsgAll))
+                    if (isResFlag)
                     {
-                        l.WriteLog(28, "车号:" + (string.IsNullOrEmpty(PbCache.resultCarNo) ? "未识别" : PbCache.resultCarNo) + ";重量:" + (PbCache.lockWgt == 0 ? PbCache.resultWgt : PbCache.lockWgt + "") + ";提示信息:" + PbCache.resultMsgAll);
+                        isResFlag = false;
                         MeterWorkScheduledHelp meterWorkScheduledHelp1 = new MeterWorkScheduledHelp();
                         meterWorkScheduledHelp1.baseSpotNo = PbCache.sportInfo.baseSpotNo;
                         meterWorkScheduledHelp1.baseSpotName = PbCache.sportInfo.baseSpotName;
                         meterWorkScheduledHelp1.carNo = string.IsNullOrEmpty(PbCache.collect.carno) ? PbCache.resultCarNo : PbCache.collect.carno;
-                        meterWorkScheduledHelp1.helpContent = "车号:" + (string.IsNullOrEmpty(PbCache.resultCarNo) ? "未识别" : PbCache.resultCarNo) + ";重量:" + (PbCache.lockWgt == 0 ? PbCache.resultWgt : PbCache.lockWgt + "") + ";提示信息:" + PbCache.resultMsgAll;
+                        meterWorkScheduledHelp1.helpContent = "车号:" + (string.IsNullOrEmpty(PbCache.collect.carno) ? (string.IsNullOrEmpty(PbCache.resultCarNo) ? "未识别" : PbCache.resultCarNo) : PbCache.collect.carno) + ";重量:" + (PbCache.lockWgt == 0 ? PbCache.resultWgt : PbCache.lockWgt + "") + ";提示信息:" + PbCache.resultMsgAll;
                         meterWorkScheduledHelp1.warmType = "5";
                         meterWorkScheduledHelp1.warmTypeName = "计量提示跟踪";
                         meterWorkScheduledHelpService.add(meterWorkScheduledHelp1);
+                        l.WriteLog(28, "车号:" + (string.IsNullOrEmpty(PbCache.collect.carno) ? (string.IsNullOrEmpty(PbCache.resultCarNo) ? "未识别" : PbCache.resultCarNo) : PbCache.collect.carno) + ";重量:" + (PbCache.lockWgt == 0 ? PbCache.resultWgt : PbCache.lockWgt + "") + ";提示信息:" + PbCache.resultMsgAll);
                     }
 
 
@@ -808,6 +808,8 @@ namespace CarMeterSystem
                     PbCache.strCode = "";
                     PbCache.ResultMessage = "";
                     PbCache.resultMsgAll = "";
+                    PbCache.resultCarNo = "";
+                    PbCache.resultWgt = "";
                     bEditCar = false;
                     isVoiceDownCar = false;
                     flagCarMonit = false;

+ 1 - 1
CarMeterSystem/frmOneYardToEnd.Designer.cs

@@ -207,7 +207,7 @@
             this.lbPointName.Name = "lbPointName";
             this.lbPointName.Size = new System.Drawing.Size(207, 76);
             this.lbPointName.TabIndex = 4;
-            this.lbPointName.Text = "5号磅";
+            this.lbPointName.Text = "";
             // 
             // timer1
             // 

+ 174 - 63
CarMeterSystem/frmOneYardToEnd.cs

@@ -85,6 +85,7 @@ namespace CarMeterSystem
         {
             try
             {
+                lg.WriteLog(31, "frmOneYardToEnd_Load页面打开(Load:frmOneYardToEnd_Load),车号:" + PbCache.resultCarNo + "||" + (PbCache.collect == null ? "" : PbCache.collect.carno));
                 wgt = 0;
                 temporaryResult = "";
                 temporaryCarNo = "";
@@ -126,19 +127,22 @@ namespace CarMeterSystem
             {
                 bool isCompare = false;
 
-                //RESTfulResult<List<MeterWorkCompareSpotSacle>> reSacle = meterWorkCompareSpotScaleService.doQuery(new MeterWorkCompareSpotSacle { carNo = PbCache.lockCarNo,valueFlag = "1" });
-                //if (reSacle.Succeed)
-                //{
-                //    if (reSacle.Data == null || reSacle.Data.Count == 0)
-                //    { }
-                //    else
-                //    {
-                //        isCompare = true;
-                //    }
-                //}
+                RESTfulResult<List<MeterWorkCompareSpotSacle>> reSacle = meterWorkCompareSpotScaleService.doQuery(new MeterWorkCompareSpotSacle { carNo = PbCache.collect.carno, valueFlag = "1" });
+                if (reSacle.Succeed)
+                {
+                    if (reSacle.Data == null || reSacle.Data.Count == 0)
+                    { }
+                    else
+                    {
+                        isCompare = true;
+                    }
+                }
 
+                if (PbCache.collect != null &&  PbCache.collect.weightStatus != 0)
+                {
+                    return;
+                }
                 
-
                 if (PbCache.collect == null) return;
                 PbCache.isLockFrm = true;
                 PbCache.lockCarNo = PbCache.collect.carno;
@@ -249,6 +253,16 @@ namespace CarMeterSystem
                     return;
                 }
 
+                if (string.IsNullOrEmpty(PbCache.lockCarNo))
+                {
+                    PbCache.isLockFrm = false;
+                    btnSave.Enabled = true;
+                    setMsg("车号未识别,请联系处理" + "");
+                    vicPlayClass.GetVoicePlay("车号未识别,请联系处理", PbCache.lockCarNo);
+                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未识别,请联系处理");
+                    return;
+                }
+
                 RESTfulResult<List<MeterBaseCar>> resCarList1 = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.lockCarNo, validFlag = "0" });
                 if (!resCarList1.Succeed || resCarList1.Data == null || resCarList1.Data.Count != 1)
                 {
@@ -379,24 +393,74 @@ namespace CarMeterSystem
                             //break;
                             return;
                         }
+                        if (strRm.Succeed)
+                        {
+                            if (strRm.Data.isError)
+                            {
+                                //如果是报错则直接不执行,并写入信息到界面,同时调用语音播报
+                                readVoicd();
+                                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.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                }
+                                isStop = false;
+                                return;
+                            }
+
+                            if (strRm.Data.result) //说明:标识当前跑了一个场景成功了;场景完成后则返回,不再进行下一个场景的执行操作;
+                            {
+                                PbCache.ResultMessage = strRm.Data.resultInfo;
+                                setMsg(PbCache.ResultMessage);
+                                Monitor(strRm.Data);
+                                if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                {
+                                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                }
+                                isStop = false;
+                                //return;
+                            }
+                            else
+                            {
+                                //说明:不满足场景的的要求,不能进行return,继续下一个场景,若所有的场景都失败,则提示“未找到计量场景配置信息” 
+                                //ResultMessage = strRm.Data.resultInfo;
+                                //return strRm.Data.result;  //2021-3-18 杨秀东注释;要处理一车联运(多场景)的数据;问题:提示信息会出现问题
+                            }
+                        }
+                        else
+                        {
+                            readVoicd();
+                            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.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                            }
+                            isStop = false;
+                            return;
+
+                        }
                     }
                     else
                     {
-                        ////拿到车辆
-                        //RESTfulResult<List<MeterBaseCar>> resCarLists = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.lockCarNo,carTypeNo = "001004003" });
-                        //if (resCarLists.Data == null || resCarLists.Data.Count == 0)
-                        //{ }
-                        //else
-                        //{
-                        //    RESTfulResult<List<MeterBaseSpecialUnit>> sunitList = meterBaseSpecialUnitService.doQueryCarList(new MeterBaseSpecialUnit { unitNo = resCarLists.Data[0].usetDepartmentNo });
-
-                        //    if (sunitList.Data == null || sunitList.Data.Count != 1)
-                        //    { }
-                        //    else
-                        //    {
-                        //        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "请通过APP确认本次重量,重量为" + Math.Round((PbCache.lockWgt / 1000), 2) + "T");
-                        //    }
-                        //}
                         // 把车号加上-
                         string tempCarNo = PbCache.lockCarNo;
                         RESTfulResult<List<MeterBaseCar>> resCarList = carService.doQueryCarList(new MeterBaseCar { carNo = tempCarNo, validFlag = "0" });
@@ -570,37 +634,48 @@ namespace CarMeterSystem
                             }
                             //else
                             //{
-                            //    if (string.IsNullOrEmpty(tempCarNo))
-                            //    {
-                            //        PbCache.ResultMessage += "车号未识别,请联系处理";
-                            //        PbCache.monitorResultMessage = "车号未识别,请联系处理";
-                            //        vicPlayClass.GetVoicePlay("车号为空,请联系处理", PbCache.lockCarNo);
-                            //        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未注册,请联系处理");
-                            //    }
-                            //    else
-                            //    {
-                            //        PbCache.ResultMessage += "车号未注册,请联系处理";
-                            //        PbCache.monitorResultMessage = "车号未注册,请联系处理";
-                            //        vicPlayClass.GetVoicePlay("车号未注册,请联系处理", PbCache.lockCarNo);
-                            //        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未注册,请联系处理");
-                            //    }
-                            //    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.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
-                            //    }
-                            //    if (!string.IsNullOrEmpty(tempCarNo))
-                            //    {
-                            //        carService.addCar(new MeterBaseCar { carNo = tempCarNo, carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
-                            //    }
-                            //    return;
+                                //ExecuteMethod em = new ExecuteMethod();
+                                //try
+                                //{
+                                //    btnSave.Enabled = false;
+                                //    strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "OuterCarJISCO", "MeterMethod", new object[] { new PreTrackScale { } });
+                                //    if (!string.IsNullOrEmpty(strRm.ResultMessage))
+                                //    {
+                                //        setMsg(strRm.ResultMessage);
+                                //        strMsg = strRm.ResultMessage;
+                                //        PbCache.ResultMessage = strRm.ResultMessage;
+                                //    }
+                                //    else
+                                //    {
+                                //        setMsg(strRm.Data.resultInfo);
+                                //        strMsg = strRm.Data.resultInfo;
+                                //        PbCache.ResultMessage = strRm.Data.resultInfo;
+                                //    }
+                                //    if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                //    {
+                                //        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                //    }
+                                //    RESTfulResult<string> rms = monitor.doUpdateWf(new MeterWorkMonitor { pointNo = PbCache.sportInfo.baseSpotNo, ferroalloyResult = "1" });
+                                //    if (!rms.Succeed)
+                                //    {
+                                //        lg.WriteLog(3, PbCache.lockCarNo + "求助写入失败");
+                                //    }
+                                //    isStop = false;
+                                //}
+                                //catch (Exception exp)
+                                //{
+                                //    PbCache.ResultMessage = "获取计量场景信息失败,请点击语音求助";
+                                //    //这里是未找到方法的情况
+                                //    lg.WriteLog(3, "获取场景失败!" + strRm.ResultMessage);
+                                //    setMsg(PbCache.ResultMessage);
+                                //    if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                //    {
+                                //        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                //    }
+                                //    //break;
+                                //    isStop = false;
+                                //    return;
+                                //}
                             //}
                         }
                     }
@@ -835,12 +910,18 @@ namespace CarMeterSystem
 
         private bool registerCar = false;
 
+        private bool isWriteLog = false;
 
         private void timer1_Tick(object sender, EventArgs e)
         {
 
             if (!isStop)
             {
+                if (!isWriteLog)
+                {
+                    isWriteLog = true;
+                    lg.WriteLog(31, "frmOneYardToEnd_Load页面打开(timer1_Tick:frmOneYardToEnd_Load),车号:" + PbCache.resultCarNo + "||" + (PbCache.collect == null ? "" : PbCache.collect.carno));
+                }
                 try
                 {
                     if (isMeasureSuccess)
@@ -1372,9 +1453,9 @@ namespace CarMeterSystem
                             // 如果为是,自动保存
                             //3秒后自动执行保存方法
                             lg.WriteLog(25, PbCache.lockCarNo + "Sleep前点击保存按钮");
-                            Thread.Sleep(3000);
+                            //Thread.Sleep(3000);
                             lg.WriteLog(25, PbCache.lockCarNo + "Sleep后点击保存按钮");
-                            this.btnSave.PerformClick();
+                            //this.btnSave.PerformClick();
                             lg.WriteLog(25, PbCache.lockCarNo + "PerformClick后保存按钮");
                         }
                         else if (PbCache.monitor.validMatClick == "0")
@@ -1497,10 +1578,24 @@ namespace CarMeterSystem
             {
                 lg.WriteLog(9, "[" + PbCache.collect.carno + "||" + PbCache.lockCarNo + "]" + lblog);
             }
+            #region 记录从上秤到下秤的所有的提示信息
+            if (!string.IsNullOrEmpty(PbCache.resultMsgAll) && !PbCache.resultMsgAll.Contains(PbCache.ResultMessage) && !string.IsNullOrEmpty(PbCache.ResultMessage))
+            {
+                PbCache.resultMsgAll = PbCache.resultMsgAll + " || " + PbCache.ResultMessage;
+            }
+            else if (string.IsNullOrEmpty(PbCache.resultMsgAll) && !string.IsNullOrEmpty(PbCache.ResultMessage))
+            {
+                PbCache.resultMsgAll = PbCache.ResultMessage;
+            }
+            else
+            {
+                //提示信息重复,不做处理
+            }
+            #endregion 记录从上秤到下秤的所有的提示信息
         }
 
         #endregion 信息提示框
-            
+
 
         #region 打印
 
@@ -2081,6 +2176,22 @@ namespace CarMeterSystem
             {
                 lg.WriteLog(9, "[" + PbCache.collect.carno + "||"+PbCache.lockCarNo+"]" + ResultMessage);
             }
+
+            #region 记录从上秤到下秤的所有的提示信息
+            if (!string.IsNullOrEmpty(PbCache.resultMsgAll) && !PbCache.resultMsgAll.Contains(PbCache.ResultMessage) && !string.IsNullOrEmpty(PbCache.ResultMessage))
+            {
+                PbCache.resultMsgAll = PbCache.resultMsgAll + " || " + PbCache.ResultMessage;
+            }
+            else if (string.IsNullOrEmpty(PbCache.resultMsgAll) && !string.IsNullOrEmpty(PbCache.ResultMessage))
+            {
+                PbCache.resultMsgAll = PbCache.ResultMessage;
+            }
+            else
+            {
+                //提示信息重复,不做处理
+            }
+            #endregion 记录从上秤到下秤的所有的提示信息
+
         }
 
         #endregion 信息提示框
@@ -2104,12 +2215,12 @@ namespace CarMeterSystem
         {
             try
             {
-                lg.WriteLog(27, ("车号:" + (string.IsNullOrEmpty(temporaryCarNo) ? "未识别" : temporaryCarNo)) + ";重量:" + wgt + ";提示信息:" + temporaryResult);
+                lg.WriteLog(27, ("车号:" + (string.IsNullOrEmpty(temporaryCarNo) ? "未识别" : temporaryCarNo)) + ";重量:" + PbCache.resultWgt + ";提示信息:" + PbCache.resultMsgAll);
                 MeterWorkScheduledHelp meterWorkScheduledHelp1 = new MeterWorkScheduledHelp();
                 meterWorkScheduledHelp1.baseSpotNo = PbCache.sportInfo.baseSpotNo;
                 meterWorkScheduledHelp1.baseSpotName = PbCache.sportInfo.baseSpotName;
                 meterWorkScheduledHelp1.carNo = string.IsNullOrEmpty(PbCache.collect.carno) ? temporaryCarNo : PbCache.collect.carno;
-                meterWorkScheduledHelp1.helpContent = "车号:" + (string.IsNullOrEmpty(temporaryCarNo) ? "未识别" : temporaryCarNo) +";重量:" + wgt + ";提示信息:" + temporaryResult;
+                meterWorkScheduledHelp1.helpContent = "车号:" + (string.IsNullOrEmpty(temporaryCarNo) ? "未识别" : temporaryCarNo) +";重量:" + PbCache.resultWgt + ";提示信息:" + PbCache.resultMsgAll;
                 meterWorkScheduledHelp1.warmType = "4";
                 meterWorkScheduledHelp1.warmTypeName = "计量数据统计";
                 meterWorkScheduledHelpService.add(meterWorkScheduledHelp1);
@@ -2132,7 +2243,7 @@ namespace CarMeterSystem
 
                 //RESTfulResult<string> rms = monitor.doUpdateWf(new MeterWorkMonitor { pointNo = PbCache.sportInfo.baseSpotNo, isOverWgt = "" });
 
-                led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "");
+                led_controler.setStaticLineMsgOut(PbCache.sportInfo.ledIp, "关闭远光灯,上秤计量");
 
                 RESTfulResult<string> rms = monitor.doUpdateWf(new MeterWorkMonitor
                 {

+ 7 - 6
Common/DbOption/work/MeterWorkCompareSpotService.cs

@@ -1,5 +1,6 @@
 using com.hnshituo.core.webapp.vo;
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -17,7 +18,7 @@ namespace Common
         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<PageList<List<MeterWorkCompareSpot>>> rm = db.doOption<PageList<List<MeterWorkCompareSpot>>>("meterworkcomparespots", "/like/", new object[] { info }, 0);
 
             RESTfulResult<List<MeterWorkCompareSpot>> result = new RESTfulResult<List<MeterWorkCompareSpot>>();
             result.Succeed = rm.Succeed;
@@ -25,7 +26,8 @@ namespace Common
             result.Message = rm.Message;
             result.ResultMessage = rm.ResultMessage;
             result.Code = rm.Code;
-            if (rm.Succeed && rm.Data != null && rm.Data.list.Count > 0)
+
+            if (rm.Succeed && rm.Data != null && rm.Data.list != null && rm.Data.list.Count > 0)
             {
                 result.Data = rm.Data.list;
             }
@@ -37,10 +39,10 @@ namespace Common
         /// </summary>
         /// <param name="info"></param>
         /// <returns></returns>
-        public RESTfulResult<string> doAdd(MeterWorkCompareSpot info)
+        public RESTfulResult<string> doAdd(Hashtable info)
         {
             DbHelper db = new DbHelper();
-            RESTfulResult<string> rm = db.doOption<string>("meterworkcomparespots", "/", new object[] { info }, 1);
+            RESTfulResult<string> rm = db.doOptionPut<string>("meterworkcomparespotscales", "/submitScaleResult", new object[] { info });
 
             
             return rm;
@@ -54,9 +56,8 @@ namespace Common
         public RESTfulResult<string> doMofity(MeterWorkCompareSpot info)
         {
             DbHelper db = new DbHelper();
-            RESTfulResult<string> rm = db.doOption<string>("meterworkcomparespots", "/", new object[] { info }, 1);
+            RESTfulResult<string> rm = db.doOption<string>("meterworkcomparespots", "/updateModel", new object[] { info },1);
 
-            
             return rm;
         }
     }

+ 2 - 2
Common/database/DbHelper.cs

@@ -72,12 +72,12 @@ namespace Common
                 {
                     if (rm.ResultMessage == null && !string.IsNullOrEmpty(rm.Message))
                     {
-                        MessageBox.Show(rm.Message);
+                        //MessageBox.Show(rm.Message);
                         //System.Environment.Exit(0);
                     }
                     if (rm.ResultMessage != null && rm.ResultMessage.Contains("授权"))
                     {
-                        MessageBox.Show(rm.ResultMessage);
+                        //MessageBox.Show(rm.ResultMessage);
                         //System.Environment.Exit(0);
                     }
                     lg.WriteLog(16, string.Format("服务[{0}],接口[{1}],错误信息:{2}", strServiceName, strMethodName, 

+ 6 - 0
Common/log/Log.cs

@@ -137,6 +137,12 @@ namespace Common
                     case 30:
                         strLogName = "车号注册接口_";
                         break;
+                    case 31:
+                        strLogName = "frmOneYard_打开跟踪日志_";
+                        break;
+                    case 32:
+                        strLogName = "frmMain定时器重启日志_";
+                        break;
                     default: 
                         strLogName = "计量终端_"; 
                         break;

+ 11 - 5
Common/vo/work/MeterWorkCompareSpot.cs

@@ -56,7 +56,7 @@ namespace Common
 		/// <summary>
 		/// 重量1
 		/// <summary>
-		public double weightNum1 { get; set; }
+		public double? weightNum1 { get; set; }
 
 		/// <summary>
 		/// 时间1
@@ -66,7 +66,7 @@ namespace Common
 		/// <summary>
 		/// 重量2
 		/// <summary>
-		public double weightNum2 { get; set; }
+		public double? weightNum2 { get; set; }
 
 		/// <summary>
 		/// 时间2
@@ -76,7 +76,7 @@ namespace Common
 		/// <summary>
 		/// 重量3
 		/// <summary>
-		public double weightNum3 { get; set; }
+		public double? weightNum3 { get; set; }
 
 		/// <summary>
 		/// 时间3
@@ -86,7 +86,7 @@ namespace Common
 		/// <summary>
 		/// 重量4
 		/// <summary>
-		public double weightNum4 { get; set; }
+		public double? weightNum4 { get; set; }
 
 		/// <summary>
 		/// 时间4
@@ -96,7 +96,7 @@ namespace Common
 		/// <summary>
 		/// 重量5
 		/// <summary>
-		public double weightNum5 { get; set; }
+		public double? weightNum5 { get; set; }
 
 		/// <summary>
 		/// 时间5
@@ -157,5 +157,11 @@ namespace Common
 		/// 较称类型(1:断差;2:较称)
 		/// <summary>
 		public string compareType { get; set; }
+
+		/// <summary>
+		/// 较称类型(1:断差;2:较称)
+		/// <summary>
+		public string scaleNo { get; set; }
+
 	}
 }

+ 2 - 2
Common/vo/work/MeterWorkCompareSpotSacle.cs

@@ -11,7 +11,7 @@ namespace Common
 		/// <summary>
 		/// 主键
 		/// <summary>
-		public string CompareSpotSacleId { get; set; }
+		public string CompareSpotScaleId { get; set; }
 
 		/// <summary>
 		/// 数据状态(0:作废,1:未使用, 2:已使用)
@@ -26,7 +26,7 @@ namespace Common
 		/// <summary>
 		/// 数量
 		/// <summary>
-		public string num { get; set; }
+		public int? num { get; set; }
 
 		/// <summary>
 		/// 创建人姓名

+ 78 - 0
MeterPlugInLibrary/LED/LED_Control.cs

@@ -304,6 +304,84 @@ namespace MeterPlugInLibrary
             }
         }
 
+        public void setStaticLineMsgOut(string Ip, string ledInfo)
+        {
+            try
+            {
+
+                if (ledInfo == null) return;
+                ledInfo = ledInfo.Replace(",", "\r\n");
+
+                if (PbCache.OldLedInfo == ledInfo) return;
+
+                lg.WriteLog(26, "led推送信息开始时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"));
+
+                PbCache.OldLedInfo = ledInfo;
+
+                lg.WriteLog(26, PbCache.lockCarNo + "led推送信息:" + ledInfo);
+
+                int nResult;
+                LedDll.COMMUNICATIONINFO CommunicationInfo = new LedDll.COMMUNICATIONINFO();//定义一通讯参数结构体变量用于对设定的LED通讯,具体对此结构体元素赋值说明见COMMUNICATIONINFO结构体定义部份注示
+
+                CommunicationInfo.SendType = 0;//设为固定IP通讯模式,即TCP通讯
+                CommunicationInfo.IpStr = Ip;//给IpStr赋值LED控制卡的IP
+                CommunicationInfo.LedNumber = 1;//LED屏号为1,注意socket通讯和248通讯不识别屏号,默认赋1就行了,485必需根据屏的实际屏号进行赋值
+
+                nResult = LedDll.LV_SetBasicInfo(ref CommunicationInfo, 2, 96, 64);//设置屏参,屏的颜色为2即为双基色,64为屏宽点数,32为屏高点数,具体函数参数说明见函数声明注示
+
+
+                int hProgram;//节目句柄
+                hProgram = LedDll.LV_CreateProgram(96, 64, 2);//根据传的参数创建节目句柄,128是屏宽点数,48是屏高点数,2是屏的颜色,注意此处屏宽高及颜色参数必需与设置屏参的屏宽高及颜色一致,否则发送时会提示错误
+                                                              //此处可自行判断有未创建成功,hProgram返回NULL失败,非NULL成功,一般不会失败
+
+                nResult = LedDll.LV_AddProgram(hProgram, 1, 0, 1);//添加一个节目,参数说明见函数声明注示
+                if (nResult != 0)
+                {
+                    string ErrStr;
+                    ErrStr = LedDll.LS_GetError(nResult);
+                    return;
+                }
+                LedDll.AREARECT AreaRect = new LedDll.AREARECT();//区域坐标属性结构体变量
+
+
+                AreaRect.left = 0;
+                AreaRect.top = 0;
+                AreaRect.width = 96;
+                AreaRect.height = 64;
+
+                LedDll.FONTPROP FontProp = new LedDll.FONTPROP();//文字属性
+                FontProp.FontName = "宋体";
+                FontProp.FontSize = 13;
+                FontProp.FontColor = LedDll.COLOR_RED;
+                FontProp.FontBold = 0;
+                //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
+
+                nResult = LedDll.LV_AddImageTextArea(hProgram, 1, 2, ref AreaRect, 0);
+                //nResult = LedDll.LV_QuickAddSingleLineTextArea(hProgram, 1, 2, ref AreaRect, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 4);//快速通过字符添加一个单行文本区域,函数见函数声明注示
+                nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
+
+
+                nResult = LedDll.LV_Send(ref CommunicationInfo, hProgram);//发送,见函数声明注示
+                LedDll.LV_DeleteProgram(hProgram);//删除节目内存对象,详见函数声明注示
+                if (nResult != 0)//如果失败则可以调用LV_GetError获取中文错误信息
+                {
+                    string ErrStr;
+                    ErrStr = LedDll.LS_GetError(nResult);
+                }
+                else
+                {
+                    //"发送成功";
+                }
+
+                lg.WriteLog(26, "led推送信息结束时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"));
+            }
+            catch (Exception ex)
+            {
+                lg.WriteLog(25, PbCache.lockCarNo + "led_trycatch事件异常:" + ex.Message);
+            }
+        }
+
+
         public void setStatic4LineMsg(string Ip, string ledInfo)
         {
             string info1 = "";

+ 6 - 2
MeterPlugInLibrary/图片处理/ImageCurlControl.cs

@@ -226,15 +226,19 @@ namespace MeterPlugInLibrary
             }
 
             string fullfilename = ftpdir + "/" + filename;
-            if(fullfilename.Substring(0,8) == "https://")
+            if (fullfilename.Substring(0, 8) == "https://")
             {
                 fullfilename = fullfilename.Substring(0, 8) + fullfilename.Substring(8).Replace("//", "/").Replace("//", "/");
             }
+            else if (fullfilename.Substring(0, 7) == "http://")
+            {
+                fullfilename = fullfilename.Substring(0, 7) + fullfilename.Substring(7).Replace("//", "/").Replace("//", "/");
+            }
             else
             {
                 fullfilename = fullfilename.Replace("//", "/").Replace("//", "/");
             }
-            
+
             PropertyInfo pi = null;
             try
             {

+ 2 - 1
MeterPlugInLibrary/扫码枪/SweepCode.cs

@@ -51,7 +51,7 @@ namespace MeterPlugInLibrary
                         if (strState.Equals("0"))
                         {
                             sCode = GetSweepCodeInfo(15, 11, "9600,N,8,1");//扫码信息;九江用COM7
-                            WriteLog("扫码返回:" + sCode);
+                            WriteLog("扫码返回:" + sCode + "是否错误:" + isError);
                             if (!string.IsNullOrEmpty(sCode) && !isError) 
                             {
                                 strCode = sCode;
@@ -60,6 +60,7 @@ namespace MeterPlugInLibrary
                             }
                             else
                             {
+                                WriteLog("扫码信息报错,:" + strCode);
                                 strCode = "";
                             }
                             //Thread.Sleep(20 * 1000);//15秒执行一次

+ 8 - 8
MeterSceneLibrary/JISCO/InnerCarJISCO.cs

@@ -317,11 +317,11 @@ namespace MeterSceneLibrary
                                                                     mwaf.weightType = "0";
                                                                     // 只保存一次计量数据
                                                                     rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
-                                                                    rt.resultInfo += ",期限皮无效,请留存期限皮";
+                                                                    rt.resultInfo += ",期限皮过期,请留存期限皮";
                                                                     PbCache.voiceType = 15;
-                                                                    PbCache.ResultMessage = "计量成功,期限皮无效,请留存期限皮";
-                                                                    PbCache.monitorResultMessage = "计量成功,期限皮无效,请留存期限皮";
-                                                                    PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,计量完成,期限皮无效", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                                                    PbCache.ResultMessage = "计量成功,期限皮过期,请留存期限皮";
+                                                                    PbCache.monitorResultMessage = "计量成功,期限皮过期,请留存期限皮";
+                                                                    PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,计量完成,期限皮过期", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                                                                 }
                                                                 else
                                                                 {
@@ -441,10 +441,10 @@ namespace MeterSceneLibrary
                                                                     // 只保存一次计量数据
                                                                     rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
                                                                     PbCache.voiceType = 15;
-                                                                    rt.resultInfo += ",计量成功,期限皮无效,请留存期限皮";
-                                                                    PbCache.ResultMessage = "计量成功,期限皮无效,请留存期限皮";
-                                                                    PbCache.monitorResultMessage = "计量成功,期限皮无效,请留存期限皮";
-                                                                    PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,计量完成,期限皮无效", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                                                    rt.resultInfo += ",计量成功,期限皮过期,请留存期限皮";
+                                                                    PbCache.ResultMessage = "计量成功,期限皮过期,请留存期限皮";
+                                                                    PbCache.monitorResultMessage = "计量成功,期限皮过期,请留存期限皮";
+                                                                    PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,计量完成,期限皮过期", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                                                                 }
                                                                 else
                                                                 {

+ 1 - 1
MeterSceneLibrary/JISCO/OuterCarJISCO.cs

@@ -665,7 +665,7 @@ namespace MeterSceneLibrary
                                     }
                                 }
                                 // 存在多条未使用的委托数据
-                                else if (listPreScale.Count > 2 && (listPreScale[0].valueFlag == "0" || listPreScale[0].valueFlag == "1"))
+                                else if (listPreScale.Count > 2)
                                 {
                                     ///* 委托关系满足多委托逻辑
                                     // * 多委托判定逻辑:

+ 23 - 52
MeterSceneLibrary/JISCO/compare.cs

@@ -1,6 +1,7 @@
 using com.hnshituo.core.webapp.vo;
 using Common;
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -18,6 +19,7 @@ namespace MeterSceneLibrary
         MeterWorkCompareSpotService meterWorkCompareSpotService = new MeterWorkCompareSpotService();
 
         private JISCO.SaveMethod saveMethod = new JISCO.SaveMethod();
+
         public rtInfo MeterMethod(PreTrackScale scale)
         {
             RESTfulResult<List<MeterWorkCompareSpotSacle>> reSacle = meterWorkCompareSpotScaleService.doQuery(new MeterWorkCompareSpotSacle { carNo = PbCache.lockCarNo,valueFlag = "1" });
@@ -29,64 +31,33 @@ namespace MeterSceneLibrary
                     rt = saveMethod.doError("未查询到较称预约");
                     rt.resultInfo = "未查询到较称预约";
                     PbCache.LEDResultMessage = "未查询到较称预约";
+                    PbCache.voiceType = 25;
                     PbCache.monitorResultMessage = "车号"+PbCache.lockCarNo+ "未查询到较称预约";
                 }
                 else
                 {
-                    RESTfulResult<List<MeterWorkCompareSpot>> reCompareSpot = meterWorkCompareSpotService.doQuery(new MeterWorkCompareSpot { carNo = PbCache.lockCarNo,valueFlag = "2" });
-
-                    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";
-                            rt = saveMethod.doCompare(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;
-                            }
-                            rt = saveMethod.doCompareModify(meterWorkCompareSpot);
-                        }
-                    }
+                    Hashtable hashtable = new Hashtable();
+                    hashtable.Add("carNo", PbCache.lockCarNo);
+                    hashtable.Add("weight", int.Parse(PbCache.lockWgt.ToString()));
+                    hashtable.Add("spotName", PbCache.sportInfo.baseSpotName);
+                    hashtable.Add("spotNo", PbCache.sportInfo.baseSpotNo);
+                    hashtable.Add("scaleNo", reSacle.Data[0].CompareSpotScaleId);
+                    hashtable.Add("name", "admin");
+                    hashtable.Add("compareType", "2");
+                    rt = saveMethod.doCompare(hashtable);
+                    PbCache.voiceType = 16;
+                    PbCache.LEDResultMessage = string.Format("车号{0},较秤完成,重量{1}吨", PbCache.lockWgt, Math.Round((PbCache.lockWgt / 1000), 2));
                 }
             }
-            return rt;
+            // 后台失败处理
+            if (!rt.result)
+            {
+                rt.resultInfo = "称重数据保存失败";
+                PbCache.voiceType = 25;
+                PbCache.LEDResultMessage = "计量失败,请联系计量大厅";
+                PbCache.monitorResultMessage = "";
+            }
+             return rt;
         }
     }
 }

+ 4 - 3
MeterSceneLibrary/JISCO/private/SaveMethod.cs

@@ -2,6 +2,7 @@
 using Common;
 using OtherInterface;
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
@@ -1101,12 +1102,12 @@ namespace MeterSceneLibrary.JISCO
         /// <param name="actualFirst"></param>
         /// <param name="actualFirst1"></param>
         /// <returns></returns>
-        public rtInfo doCompare(MeterWorkCompareSpot meterWorkCompareSpot)
+        public rtInfo doCompare(Hashtable meterWorkCompareSpot)
         {
 
             //期限皮重数据保存
             MeterWorkCompareSpotService actualService = new MeterWorkCompareSpotService();
-            RESTfulResult<string> rmI = actualService.doMofity(meterWorkCompareSpot);
+            RESTfulResult<string> rmI = actualService.doAdd(meterWorkCompareSpot);
 
             if (rmI.Succeed)
             {
@@ -1137,7 +1138,7 @@ namespace MeterSceneLibrary.JISCO
 
             //期限皮重数据保存
             MeterWorkCompareSpotService actualService = new MeterWorkCompareSpotService();
-            RESTfulResult<string> rmI = actualService.doAdd(meterWorkCompareSpot);
+            RESTfulResult<string> rmI = actualService.doMofity(meterWorkCompareSpot);
 
             if (rmI.Succeed)
             {

+ 6 - 8
TrainVideoDataDispose/Form1.cs

@@ -41,11 +41,9 @@ namespace TrainVideoDataDispose
             try
             {
                 //doc:编辑TrainOrigData.txt时要用UTF-8格式保存
-                if (System.IO.File.Exists(m_szRunPath + "\\TrainOrigData.txt"))
-                {
-                    string str = System.IO.File.ReadAllText(m_szRunPath + "\\TrainOrigData.txt", Encoding.Default);
-                    m_szOrigDataPath = str.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
-                }
+                DateTime dateTime = DateTime.Now;
+                //string str = System.IO.File.ReadAllText(m_szRunPath + "\\TrainOrigData.txt", Encoding.Default);
+                m_szOrigDataPath = new string[] { string.Format("D:\\JISCO\\Project code\\JISCO-WINFROM\\jisco_winform_wzjl\\TrainVideoDataDispose\\bin\\Debug\\{0}\\{1}\\{2}\\txt", dateTime.ToString("yyyy"), dateTime.ToString("MM"), dateTime.ToString("dd")) };
             }
             catch (System.Exception error)
             {
@@ -177,13 +175,13 @@ namespace TrainVideoDataDispose
 
                         foreach (FileInfo fi in fis)
                         {
-                            //读文件
-                            FileContent = System.IO.File.ReadAllText(fi.FullName, Encoding.Default);
+                             //读文件
+                             FileContent = System.IO.File.ReadAllText(fi.FullName, Encoding.Default);
 
                             string strSequenceNumber = System.DateTime.Now.ToString("yyyyMMddHHmmss");
 
                             if (HandleOrigData(strSequenceNumber, FileContent, fi.FullName) == true)
-                            {
+                           {
                                 if (System.IO.Directory.Exists(strPath + "\\history") == false)
                                 {
                                     System.IO.Directory.CreateDirectory(strPath + "\\history");

+ 0 - 86
TrainVideoDataDispose/text.cs

@@ -50,92 +50,6 @@ namespace TrainVideoDataDispose
 
         private void button1_Click(object sender, EventArgs e)
         {
-            #region 海康
-            //bool m_bInitSDK = CHCNetSDK.NET_DVR_Init();
-            //string DVRIPAddress = '10.111.67.23'; //设备IP地址或者域名 Device IP
-            //Int16 DVRPortNumber = Int16.Parse('8000');//设备服务端口号 Device Port
-            //string DVRUserName = 'admin';//设备登录用户名 User name to login
-            //string DVRPassword = 'Admin12345';//设备登录密码 Password to login
-
-            ////设备IP地址或者域名
-            //byte[] byIP = System.Text.Encoding.Default.GetBytes(DVRIPAddress);
-            //pLoginInfo.sDeviceAddress = new byte[129];
-            //byIP.CopyTo(pLoginInfo.sDeviceAddress, 0);
-
-            ////设备用户名
-            //byte[] byUserName = System.Text.Encoding.Default.GetBytes(DVRUserName);
-            //pLoginInfo.sUserName = new byte[64];
-            //byUserName.CopyTo(pLoginInfo.sUserName, 0);
-
-            ////设备密码
-            //byte[] byPassword = System.Text.Encoding.Default.GetBytes(DVRPassword);
-            //pLoginInfo.sPassword = new byte[64];
-            //byPassword.CopyTo(pLoginInfo.sPassword, 0);
-
-            //pLoginInfo.wPort = 8000;
-
-            //if (LoginCallBack == null)
-            //{
-            //    LoginCallBack = new CHCNetSDK.LOGINRESULTCALLBACK(cbLoginCallBack);//注册回调函数                    
-            //}
-            //pLoginInfo.cbLoginResult = LoginCallBack;
-            //pLoginInfo.bUseAsynLogin = true;
-
-            ////登录设备 Login the device
-            ////m_lUserID = CHCNetSDK.NET_DVR_Login_V40(ref pLoginInfo, ref tDeviceInfo);
-            //m_lUserID = CHCNetSDK.NET_DVR_Login_V40(ref pLoginInfo, ref tDeviceInfo);
-            //if (m_lUserID < 0)
-            //{
-            //    uint iLastErr = CHCNetSDK.NET_DVR_GetLastError();
-            //    string str = 'NET_DVR_Login_V30 failed, error code= ' + iLastErr; //登录失败,输出错误号 Failed to login and output the error code
-            //    textinfo.Text = str;
-            //    return;
-            //}
-            //else
-            //{
-            //    //登录成功
-            //    //停止远程配置
-            //    if (m_lGetFaceParamCfgHandle != -1)
-            //    {
-            //        CHCNetSDK.NET_DVR_StopRemoteConfig(m_lGetFaceParamCfgHandle);
-            //    }
-
-            //    //清除表格信息
-            //    //listViewFaceConfig.Items.Clear();
-            //    //LpArr.Clear();
-
-            //    //定义查询信息对象
-            //    CHCNetSDK.NET_DVR_TRAFFIC_DATA_QUERY_COND struCond = new CHCNetSDK.NET_DVR_TRAFFIC_DATA_QUERY_COND();
-            //    struCond.dwSize = (uint)Marshal.SizeOf(struCond);
-            //    //保留
-            //    byte[] byRes = System.Text.Encoding.Default.GetBytes('0');
-            //    struCond.byRes = new byte[254];
-            //    byRes.CopyTo(struCond.byRes, 0);
-            //    //struCond.dwQueryCond
-
-            //    if (remoteConfigCallback == null)
-            //    {
-            //        remoteConfigCallback = new CHCNetSDK.RemoteConfigCallback(cbStateCallback);//注册回调函数                    
-            //    }
-
-            //    int dwSize = Marshal.SizeOf(struCond);
-            //    IntPtr ptrStruCond = Marshal.AllocHGlobal(dwSize);
-            //    Marshal.StructureToPtr(struCond, ptrStruCond, true);
-            //    m_lGetFaceParamCfgHandle = CHCNetSDK.NET_DVR_StartRemoteConfig(m_lUserID, CHCNetSDK.NET_DVR_GET_TRAFFIC_DATA, ptrStruCond, dwSize, remoteConfigCallback, IntPtr.Zero);
-            //    if (m_lGetFaceParamCfgHandle < 0)
-            //    {
-            //        uint iLastErr = CHCNetSDK.NET_DVR_GetLastError();
-            //        string str = 'NET_DVR_StartRemoteConfig failed, error code= ' + iLastErr; //登录失败,输出错误号 Failed to login and output the error code
-            //        textinfo.Text = str;
-            //        return;
-            //    }
-            //    else
-            //    {
-            //        Marshal.FreeHGlobal(ptrStruCond);
-            //    }
-            //}
-            #endregion
-
             try
             {
                 //string strUrl = "http://10.111.67.23/ISAPI/System/deviceInfo";