duyong 3 lat temu
rodzic
commit
a4ba258274

+ 6 - 2
CarMeterSystem/App.config

@@ -32,7 +32,7 @@
 		<!--毛皮差值验证(单位kg)-->
 		<add key="differenceWgt" value="400" />
 		<!--进入测试界面还是正式界面 0测试,1正式,2一码到底测试,3判稳测试工具-->
-		<add key="productType" value="1" />
+		<add key="productType" value="0" />
 		<!--联达比较重量-->
 		<add key="lianDaWgt" value="200" />
 		<!--联达计量点编号-->
@@ -52,9 +52,13 @@
     <!--厂内外车配置:001004003(内部),001004002(外部)-->
     <add key="carAdd" value="1" />
 
+    <!--智能料场显示:1(显示),0(不显示)-->
     <add key="isSendZNLC" value="1" />
     <add key="isWriteRFID" value="1" />
-  
+
+    <!--语音播放次数-->
+    <add key="voiceNum" value="5" />
+    
 		<!--扫码枪参数-->
 		<!--工控机下秤二维码-->
     <add key="comPara" value="COM11,9600,None,8,1" />

+ 18 - 1
CarMeterSystem/frmMain.cs

@@ -836,8 +836,10 @@ namespace CarMeterSystem
                                     iCountPark++;
                                     if (iCountPark > 9)
                                     {
+                                        PbCache.ResultMessage = "车辆超出秤台,请调整车位"; //btnSave_Click
                                         //重量稳定,且对射验证不合格
-                                        vicPlayClass.GetVoicePlay("您的车辆未停到位", e.carno);
+                                        vicPlayClass.GetVoicePlay("车辆超出秤台,请调整车位", e.carno);
+                                        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车辆超出秤台,请调整车位");
                                         //return;
                                         iCountPark = 0; //2021年7月27日5s播一次,然后重新在播
                                     }
@@ -861,6 +863,17 @@ namespace CarMeterSystem
                         {
                             PbCache.collect.carno = sCarNo;
                         }
+
+                        if (codeFlag)
+                        {
+                            meterWorkScheduledHelp1.baseSpotNo = PbCache.sportInfo.baseSpotNo;
+                            meterWorkScheduledHelp1.baseSpotName = PbCache.sportInfo.baseSpotName;
+                            meterWorkScheduledHelp1.carNo = string.IsNullOrEmpty(PbCache.collect.carno) ? PbCache.resultCarNo : PbCache.collect.carno;
+                            meterWorkScheduledHelp1.helpContent = "车号:" + sCarNo + "扫码过秤";
+                            meterWorkScheduledHelp1.warmType = "2";
+                            meterWorkScheduledHelp1.warmTypeName = "智能终端报警";
+                            meterWorkScheduledHelpService.add(meterWorkScheduledHelp1);
+                        }
                     }
 
                     //写入LED信息
@@ -1120,20 +1133,24 @@ namespace CarMeterSystem
                             if (lv.Value.ToString() == "2")
                             {
                                 mwmdoLive.frontInfraredRayState = "0";
+                                PbCache.monitorResult.valid_frontInfraredRay_right_status = false;
                             }
                             else
                             {
                                 mwmdoLive.frontInfraredRayState = lv.Value.ToString();
+                                PbCache.monitorResult.valid_frontInfraredRay_right_status = true;
                             }
                             break;
                         case "InfraredRight":
                             if (lv.Value.ToString() == "2")
                             {
                                 mwmdoLive.rearInfraredRayState = "0";
+                                PbCache.monitorResult.valid_frontInfraredRay_left_status = false;
                             }
                             else
                             {
                                 mwmdoLive.rearInfraredRayState = lv.Value.ToString();
+                                PbCache.monitorResult.valid_frontInfraredRay_left_status = true;
                             }
                             break;
                         case "RfidState":

+ 242 - 182
CarMeterSystem/frmOneYardToEnd.cs

@@ -208,7 +208,7 @@ namespace CarMeterSystem
                 }
                 #endregion
 
-                #region 红外对射及量程验证
+                #region 红外对射及量程验证以及光栅
                 valid.ValidMethod();
                 if (PbCache.range != null && PbCache.range.upperRange < PbCache.collect.weight)
                 {
@@ -221,7 +221,7 @@ namespace CarMeterSystem
                     setMsg(PbCache.ResultMessage);
                     return;
                 }
-                else if (PbCache.collect.weightStatus == 0 && !PbCache.monitorResult.valid_park_status)
+                else if (PbCache.collect.weightStatus == 0 && !PbCache.monitorResult.valid_park_status && PbCache.monitor.validParkStatus == "1")
                 {
                     //重量稳定,且对射验证不合格
                     vicPlayClass.GetVoicePlay("车辆超出秤台,请调整车位", PbCache.collect.carno);
@@ -232,6 +232,28 @@ namespace CarMeterSystem
                     setMsg(PbCache.ResultMessage);
                     return;
                 }
+                else if (PbCache.collect.weightStatus == 0 && PbCache.monitorResult.valid_frontInfraredRay_right_status && PbCache.monitor.validParkStatus == "1")
+                {
+                    //重量稳定,且光栅不合格
+                    vicPlayClass.GetVoicePlay("车辆超出秤台,请调整车位", PbCache.collect.carno);
+                    PbCache.ResultMessage = "车辆超出秤台,请调整车位"; //btnSave_Click
+                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车辆超出秤台,请调整车位");
+                    PbCache.isLockFrm = false;
+                    btnSave.Enabled = true;
+                    setMsg(PbCache.ResultMessage);
+                    return;
+                }
+                else if (PbCache.collect.weightStatus == 0 && PbCache.monitorResult.valid_frontInfraredRay_left_status && PbCache.monitor.validParkStatus == "1")
+                {
+                    //重量稳定,且光栅不合格
+                    vicPlayClass.GetVoicePlay("车辆超出秤台,请调整车位", PbCache.collect.carno);
+                    PbCache.ResultMessage = "车辆超出秤台,请调整车位"; //btnSave_Click
+                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车辆超出秤台,请调整车位");
+                    PbCache.isLockFrm = false;
+                    btnSave.Enabled = true;
+                    setMsg(PbCache.ResultMessage);
+                    return;
+                }
                 #endregion 红外对射及量程验证
 
                 //仪表重量验证
@@ -299,23 +321,23 @@ namespace CarMeterSystem
                 {
                     PbCache.isLockFrm = false;
                     btnSave.Enabled = true;
-                    setMsg("车号未识别,请联系处理" + "");
-                    vicPlayClass.GetVoicePlay("车号未识别,请联系处理", PbCache.lockCarNo);
-                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未识别,请联系处理");
+                    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)
-                {
-                    PbCache.isLockFrm = false;
-                    btnSave.Enabled = true;
-                    setMsg("车号未注册,请联系处理" + "");
-                    vicPlayClass.GetVoicePlay("车号未注册,请联系处理", PbCache.lockCarNo);
-                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未注册,请联系处理");
-                    lg.WriteLog(29, "车号未注册,请联系处理,车号:" + PbCache.lockCarNo + ",数量:" + ((resCarList1.Succeed && resCarList1.Data != null) ? resCarList1.Data.Count + "" : "失败"));
-                    return;
-                }
+                //RESTfulResult<List<MeterBaseCar>> resCarList1 = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.lockCarNo, validFlag = "0" });
+                //if (!resCarList1.Succeed || resCarList1.Data == null || resCarList1.Data.Count != 1)
+                //{
+                //    PbCache.isLockFrm = false;
+                //    btnSave.Enabled = true;
+                //    setMsg("车号未注册,请联系处理" + "");
+                //    vicPlayClass.GetVoicePlay("车号未注册,请联系处理", PbCache.lockCarNo);
+                //    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未注册,请联系处理");
+                //    lg.WriteLog(29, "车号未注册,请联系处理,车号:" + PbCache.lockCarNo + ",数量:" + ((resCarList1.Succeed && resCarList1.Data != null) ? resCarList1.Data.Count + "" : "失败"));
+                //    return;
+                //}
                 //本次的提单量+历史已经运输的总量,若大于提单总量,则不允许继续计量了
                 //BourneCao暂时屏蔽
                 //if (!vShipWeight.ValidMethod(preTrack))
@@ -632,118 +654,116 @@ namespace CarMeterSystem
                                         return;
                                     }
                                 }
-
-                                if (strRm.Succeed)
+                            }
+                            else
+                            {
+                                ExecuteMethod em = new ExecuteMethod();
+                                try
                                 {
-                                    if (strRm.Data.isError)
+                                    btnSave.Enabled = false;
+                                    strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "OuterCarJISCO", "MeterMethod", new object[] { new PreTrackScale { } });
+                                    if (!string.IsNullOrEmpty(strRm.ResultMessage))
                                     {
-                                        //如果是报错则直接不执行,并写入信息到界面,同时调用语音播报
-                                        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;
+                                        setMsg(strRm.ResultMessage);
+                                        strMsg = strRm.ResultMessage;
+                                        PbCache.ResultMessage = strRm.ResultMessage;
                                     }
-
-                                    if (strRm.Data.result) //说明:标识当前跑了一个场景成功了;场景完成后则返回,不再进行下一个场景的执行操作;
+                                    else
                                     {
+                                        setMsg(strRm.Data.resultInfo);
+                                        strMsg = strRm.Data.resultInfo;
                                         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
+                                    if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
                                     {
-                                        //说明:不满足场景的的要求,不能进行return,继续下一个场景,若所有的场景都失败,则提示“未找到计量场景配置信息” 
-                                        //ResultMessage = strRm.Data.resultInfo;
-                                        //return strRm.Data.result;  //2021-3-18 杨秀东注释;要处理一车联运(多场景)的数据;问题:提示信息会出现问题
+                                        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;
                                 }
-                                else
+                                catch (Exception exp)
                                 {
-                                    readVoicd();
-                                    PbCache.ResultMessage = strRm.ResultMessage;
-                                    PbCache.isLockFrm = false;
-                                    btnSave.Enabled = true;
+                                    PbCache.ResultMessage = "获取计量场景信息失败,请点击语音求助";
+                                    //这里是未找到方法的情况
+                                    lg.WriteLog(3, "获取场景失败!" + strRm.ResultMessage);
                                     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);
                                     }
+                                    //break;
                                     isStop = false;
                                     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
-                            //{
-                            //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;
-                            //}
-                            //}
+                        }
+                        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;
                         }
                     }
                     #endregion
@@ -776,6 +796,8 @@ namespace CarMeterSystem
                     //    }
                     //}
 
+                    vicPlayClass.GetVoicePlay("计量完成,请确认重量", PbCache.lockCarNo);
+
                     isMeasureSuccess = true;
 
                     /*
@@ -857,8 +879,11 @@ namespace CarMeterSystem
                     #endregion LED写入
 
                     #region 智能料场LED显示
-                    saveMethod.sendToZnlc();
-                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                    if (AppConfigCache.isSendZNLC == "1")
+                    {
+                        saveMethod.sendToZnlc();
+                        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                    }
                     #endregion
 
                     //计量完成后,显示毛重或者皮重
@@ -1093,6 +1118,7 @@ namespace CarMeterSystem
         RESTfulResult<MeterBaseCar> resResgiterCarTimer = new RESTfulResult<MeterBaseCar>();
         MeterBaseCar resgiterCarTimer = new MeterBaseCar();
         frmMatMsgInfo frmMatMsgInfo = new frmMatMsgInfo();
+        int voiceNum = 0;
         private void timer1_Tick(object sender, EventArgs e)
         {
             DualWeight();//rxh modify
@@ -1129,10 +1155,16 @@ namespace CarMeterSystem
                     // 成功就只播语音,不再做任何处理
                     if (isMeasureSuccess)
                     {
-                        isStop = true;
-                        readVoicd();
-                        isStop = false;
-
+                        if (voiceNum < int.Parse(AppConfigCache.voiceNum))
+                        {
+                            if (PbCache.voiceOver)
+                            {
+                                voiceNum++;
+                            }
+                            isStop = true;
+                            readVoicd();
+                            isStop = false;
+                        }
                         return;
                     }
 
@@ -1224,7 +1256,8 @@ namespace CarMeterSystem
 
                             if (PbCache.monitor.isTakeOver == "2" || !string.IsNullOrEmpty(PbCache.monitor.isOverWgt))
                             {
-                                btnSave.Visible = false;
+                                //btnSave.Visible = false;
+                                setMsgInfo(btnSave, "false", "2");//rxh add
                                 bRelation = true;
                                 lg.WriteLog(14, "车号:" + PbCache.collect.carno + ";远程计量完成后,保存按钮隐藏!");
                                 if (!txtMsgInfo.Text.Contains("计量完成") && PbCache.monitor.isTakeOver == "2")
@@ -1291,7 +1324,8 @@ namespace CarMeterSystem
                                     setMsg(string.Format("预报车号【{0}】与摄像头识别车号【{1}】不一致,请点击语音求助", TrackCarNo, PbCache.collect.carno));
                                     lg.WriteLog(14, "车号:" + PbCache.collect.carno + ";预报车号" + TrackCarNo + "与摄像头识别车号" + PbCache.collect.carno + "不一致!");
                                 }
-                                btnSave.Visible = false;
+                                //btnSave.Visible = false;
+                                setMsgInfo(btnSave, "false", "2");//rxh add
                                 return;
                             }
                             else
@@ -1325,7 +1359,7 @@ namespace CarMeterSystem
                             return;
                         }
                     }
-                    if (PbCache.collect.weightStatus == 0 && !PbCache.monitorResult.valid_park_status)
+                    if (PbCache.collect.weightStatus == 0 && !PbCache.monitorResult.valid_park_status && PbCache.monitor.validParkStatus == "1")
                     {
                         //重量稳定,且对射验证不合格
                         if (!isPlayCalibVoice)
@@ -1339,6 +1373,28 @@ namespace CarMeterSystem
                             return;
                         }
                     }
+                    if (PbCache.collect.weightStatus == 0 && PbCache.monitorResult.valid_frontInfraredRay_right_status && PbCache.monitor.validParkStatus == "1")
+                    {
+                        //重量稳定,且光栅不合格
+                        vicPlayClass.GetVoicePlay("车辆超出秤台,请调整车位", PbCache.collect.carno);
+                        PbCache.ResultMessage = "车辆超出秤台,请调整车位"; //btnSave_Click
+                        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车辆超出秤台,请调整车位");
+                        PbCache.isLockFrm = false;
+                        btnSave.Enabled = true;
+                        setMsg(PbCache.ResultMessage);
+                        return;
+                    }
+                    if (PbCache.collect.weightStatus == 0 && PbCache.monitorResult.valid_frontInfraredRay_left_status && PbCache.monitor.validParkStatus == "1")
+                    {
+                        //重量稳定,且光栅不合格
+                        vicPlayClass.GetVoicePlay("车辆超出秤台,请调整车位", PbCache.collect.carno);
+                        PbCache.ResultMessage = "车辆超出秤台,请调整车位"; //btnSave_Click
+                        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车辆超出秤台,请调整车位");
+                        PbCache.isLockFrm = false;
+                        btnSave.Enabled = true;
+                        setMsg(PbCache.ResultMessage);
+                        return;
+                    }
                     if (PbCache.isOvertimeAlarm)
                     {
                         //停留超时提醒,不作为计量卡控的条件
@@ -1431,19 +1487,18 @@ namespace CarMeterSystem
                     //}
                     #endregion 判断是否需要复磅
 
-                    if (!string.IsNullOrEmpty(PbCache.collect.carno))
-                    {
-                        resCarListTimer = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.collect.carno, validFlag = "0" });
-                        if (resCarListTimer.Data == null || resCarListTimer.Data.Count == 0 || resCarListTimer.Data.Count != 1)
-                        {
-                            if (!registerCar)
-                            {
-                                carService.addCar(new MeterBaseCar { carNo = PbCache.collect.carno, carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
-                                registerCar = true;
-                            }
-
-                        }
-                    }
+                    //if (!string.IsNullOrEmpty(PbCache.collect.carno))
+                    //{
+                    //    resCarListTimer = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.collect.carno, validFlag = "0" });
+                    //    if (resCarListTimer.Data == null || resCarListTimer.Data.Count == 0 || resCarListTimer.Data.Count != 1)
+                    //    {
+                    //        if (!registerCar)
+                    //        {
+                    //            carService.addCar(new MeterBaseCar { carNo = PbCache.collect.carno, carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
+                    //            registerCar = true;
+                    //        }
+                    //    }
+                    //}
 
                     #region 第一次查询,有车号,重量稳定,红外验证通过的情况只查一次
 
@@ -1456,11 +1511,11 @@ namespace CarMeterSystem
                         if (string.IsNullOrEmpty(PbCache.collect.carno))
                         {
                             //txtMsgInfo.Text = "车号未识别,请联系处理";
-                            setMsg("车号未识别,请联系处理");
-                            PbCache.monitorResultMessage = "车号未识别,请联系处理";
-                            PbCache.ResultMessage = "车号未识别,请联系处理";
+                            setMsg("车号未识别,请扫码计量");
+                            PbCache.monitorResultMessage = "车号未识别,请扫码计量";
+                            PbCache.ResultMessage = "车号未识别,请扫码计量";
                             vicPlayClass.GetVoicePlay("车号为空,请联系处理", PbCache.collect.carno);
-                            led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未识别,请联系处理");
+                            led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未识别,请扫码计量");
                             return;
                         }
 
@@ -1558,54 +1613,58 @@ namespace CarMeterSystem
                             }
                             else
                             {
-                                string ledinfo = "";
-                                if (PbCache.lockCarNo == "")
-                                {
-                                    isStop = true;
-                                    if (string.IsNullOrEmpty(PbCache.collect.carno))
-                                    {
-                                        //txtMsgInfo.Text = "车号未识别,请联系处理";
-                                        setMsg("车号未识别,请联系处理");
-                                        PbCache.monitorResultMessage = "车号未识别,请联系处理";
-                                        PbCache.ResultMessage = "车号未识别,请联系处理";
-                                        ledinfo = "车号未识别,请联系处理";
-                                        vicPlayClass.GetVoicePlay("车号为空,请联系处理", PbCache.collect.carno);
-                                    }
-                                    else
-                                    {
-                                        //txtMsgInfo.Text = "车号未注册,请联系处理";
-                                        setMsg("车号未注册,请联系处理");
-                                        PbCache.monitorResultMessage = "车号未注册,请联系处理";
-                                        PbCache.ResultMessage = "车号未注册,请联系处理";
-                                        ledinfo = "车号未注册,请联系处理";
-                                        vicPlayClass.GetVoicePlay("车号未注册,请联系处理", PbCache.collect.carno);
-                                    }
-
-                                    PbCache.isLockFrm = false;
-                                    //btnSave.Enabled = true;//rxh add
-                                    setMsgInfo(btnSave, "true", "2");//rxh add
-
-                                    rtInfo rt = new rtInfo();
-                                    rt.isWarn = true;
-                                    rt.WarnContent = "carErr";
-                                    Monitor(rt);
-
-                                    if (!string.IsNullOrEmpty(PbCache.collect.carno))
-                                    {
-
-                                        resgiterCarTimer.carNo = PbCache.collect.carno;
-                                        resgiterCarTimer.carTypeNo = AppConfigCache.carTypeNo;
-                                        resgiterCarTimer.carTypeName = AppConfigCache.carTypeName;
-                                        lg.WriteLog(30, string.Format("车号注册参数-车号:{0},车辆类型编号:{1},车辆类型名称:{2}", PbCache.collect.carno, AppConfigCache.carTypeNo, AppConfigCache.carTypeName));
-                                        resResgiterCarTimer = carService.addCar(resgiterCarTimer);
-                                        lg.WriteLog(30, resResgiterCarTimer.Succeed ? "注册成功" : "注册失败,原因:" + resResgiterCarTimer.ResultMessage);
-                                    }
-                                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, ledinfo);
-                                    bRailwayActual = false;
-                                    isStop = false;
-                                    return;
-                                }
+                                bRailwayActual = false;
                             }
+                            //else
+                            //{
+                            //    string ledinfo = "";
+                            //    if (PbCache.lockCarNo == "")
+                            //    {
+                            //        isStop = true;
+                            //        if (string.IsNullOrEmpty(PbCache.collect.carno))
+                            //        {
+                            //            //txtMsgInfo.Text = "车号未识别,请联系处理";
+                            //            setMsg("车号未识别,请联系处理");
+                            //            PbCache.monitorResultMessage = "车号未识别,请联系处理";
+                            //            PbCache.ResultMessage = "车号未识别,请联系处理";
+                            //            ledinfo = "车号未识别,请联系处理";
+                            //            vicPlayClass.GetVoicePlay("车号为空,请联系处理", PbCache.collect.carno);
+                            //        }
+                            //        else
+                            //        {
+                            //            //txtMsgInfo.Text = "车号未注册,请联系处理";
+                            //            setMsg("车号未注册,请联系处理");
+                            //            PbCache.monitorResultMessage = "车号未注册,请联系处理";
+                            //            PbCache.ResultMessage = "车号未注册,请联系处理";
+                            //            ledinfo = "车号未注册,请联系处理";
+                            //            vicPlayClass.GetVoicePlay("车号未注册,请联系处理", PbCache.collect.carno);
+                            //        }
+
+                            //        PbCache.isLockFrm = false;
+                            //        //btnSave.Enabled = true;//rxh add
+                            //        setMsgInfo(btnSave, "true", "2");//rxh add
+
+                            //        rtInfo rt = new rtInfo();
+                            //        rt.isWarn = true;
+                            //        rt.WarnContent = "carErr";
+                            //        Monitor(rt);
+
+                            //        if (!string.IsNullOrEmpty(PbCache.collect.carno))
+                            //        {
+
+                            //            resgiterCarTimer.carNo = PbCache.collect.carno;
+                            //            resgiterCarTimer.carTypeNo = AppConfigCache.carTypeNo;
+                            //            resgiterCarTimer.carTypeName = AppConfigCache.carTypeName;
+                            //            lg.WriteLog(30, string.Format("车号注册参数-车号:{0},车辆类型编号:{1},车辆类型名称:{2}", PbCache.collect.carno, AppConfigCache.carTypeNo, AppConfigCache.carTypeName));
+                            //            resResgiterCarTimer = carService.addCar(resgiterCarTimer);
+                            //            lg.WriteLog(30, resResgiterCarTimer.Succeed ? "注册成功" : "注册失败,原因:" + resResgiterCarTimer.ResultMessage);
+                            //        }
+                            //        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, ledinfo);
+                            //        bRailwayActual = false;
+                            //        isStop = false;
+                            //        return;
+                            //    }
+                            //}
                         }
                         #region 查一次是否可留期限皮,可以则显示按钮
 
@@ -1657,7 +1716,7 @@ namespace CarMeterSystem
                     #endregion 毛皮净赋值;存在一次重量firstWgt的情况下才赋值毛皮净重
 
                     #region 界面未锁定的情况下,如果,有车号,重量稳定了,停车线验证通过,完成了扫码验证
-
+                    lg.WriteLog(37, string.Format("PbCache.monitor:{0},PbCache.monitor.isTakeOver:{1},bRailwayActual:{2},PbCache.collect.carno:{3},PbCache.collect.weightStatus:{4},ucWeightT1.isGreenWgt:{5},PbCache.isLockFrm:{6},isVoiceDownCar:{7},btnSave.Visible:{8}", PbCache.monitor, PbCache.monitor.isTakeOver, bRailwayActual, PbCache.collect.carno, PbCache.collect.weightStatus, ucWeightT1.isGreenWgt, PbCache.isLockFrm, isVoiceDownCar, btnSave.Visible));
                     //没有远程接管,且已查过一次数据,且界面未锁定的情况下,如果,有车号,重量稳定了,停车线验证通过,完成了扫码验证的情况下,则按钮可用
                     if (PbCache.monitor != null && PbCache.monitor.isTakeOver == "0" && !bRailwayActual && !string.IsNullOrEmpty(PbCache.collect.carno)
                         && PbCache.collect.weightStatus == 0 && ucWeightT1.isGreenWgt)
@@ -2543,6 +2602,7 @@ namespace CarMeterSystem
 
                 led_controler.setStaticLineMsgOut(PbCache.sportInfo.ledIp, "关闭远光灯,上秤计量");
 
+                voiceNum = 0;
 
                 RESTfulResult<string> rms = monitor.doUpdateWf(new MeterWorkMonitor
                 {

+ 10 - 0
Common/cacheCls/AppConfigCache.cs

@@ -77,6 +77,11 @@ namespace Common
         /// </summary>
         public static readonly string isWriteRFID = ConfigurationManager.AppSettings["isWriteRFID"].ToString().Trim();
 
+        /// <summary>
+        /// 0测试,1正式
+        /// </summary>
+        public static readonly string voiceNum = ConfigurationManager.AppSettings["voiceNum"].ToString().Trim();
+
         /// <summary>
         /// 0测试,1正式
         /// </summary>
@@ -102,5 +107,10 @@ namespace Common
         /// </summary>
         public static readonly string _comPara2 = ConfigurationManager.AppSettings["comPara2"].ToString().Trim();
 
+        /// <summary>
+        /// 0测试,1正式
+        /// </summary>
+        public static readonly string isSendZNLC = ConfigurationManager.AppSettings["isSendZNLC"].ToString().Trim();
+
     }
 }

+ 6 - 0
Common/log/Log.cs

@@ -158,6 +158,12 @@ namespace Common
                     case 99:
                         strLogName = "双扫码";
                         break;
+                    case 37:
+                        strLogName = "保存测试_";
+                        break;
+                    case 38:
+                        strLogName = "智能料场日志_";
+                        break;
                     default: 
                         strLogName = "计量终端_"; 
                         break;

+ 5 - 4
Common/vo/base/ZnlcInterface.cs

@@ -23,7 +23,7 @@ namespace OtherInterface
       WebClient webClient = new WebClient();
       webClient.Headers["Content-type"] = "application/json";
       webClient.Encoding = Encoding.UTF8;
-      string retStr = webClient.UploadString("http://10.121.16.36:8888/LimsService.svc/SendWeightResultBeta", "POST", data);
+      string retStr = webClient.UploadString("http://10.1.213.84:8080/LimsService.svc/SendWeightResultBeta", "POST", data);
       LimisResponse limisResponse = JsonConvert.DeserializeObject<LimisResponse>(retStr);
       return limisResponse;
     }
@@ -42,9 +42,10 @@ namespace OtherInterface
       w.TareWeight = null;
       w.NetWeight = null;
       w.MeteringPerson = meterWorkCarActualFirst.createManNo;
-      w.MeteringTime = meterWorkCarActualFirst.createTime.ToString();
-     
-        LimisResponse ls = sendDataToZn(w);
+        //DateTime dt =DateTime.Parse( meterWorkCarActualFirst.createTime.ToString());
+        //w.MeteringTime = dt.ToString("yyyy-MM-dd hh:mm:ss");
+        w.MeteringTime = meterWorkCarActualFirst.createTime.ToString();
+           LimisResponse ls = sendDataToZn(w);
         if (ls.Success)
         {
           strResult = ls.Msg;

+ 10 - 0
Common/vo/work/MeterWorkMonitorResult.cs

@@ -48,6 +48,16 @@ namespace Common
 		/// <summary>
 		public bool valid_park_status { get; set; }
 
+		/// <summary>
+		/// 验证右光栅(实时数据库停车位置)  
+		/// <summary>
+		public bool valid_frontInfraredRay_right_status { get; set; }
+
+		/// <summary>
+		/// 验证左光栅(实时数据库停车位置)  
+		/// <summary>
+		public bool valid_frontInfraredRay_left_status { get; set; }
+
 		/// <summary>
 		/// 验证预报超差  
 		/// <summary>

+ 40 - 34
MeterSceneLibrary/JISCO/OuterCarJISCO.cs

@@ -102,14 +102,18 @@ namespace MeterSceneLibrary
                             PbCache.isInnerCar = true;
                             rt = saveMethod.doAddFirst(null, mwaf);
                             PbCache.voiceType = 1;
-                            PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                            PbCache.LEDResultMessage = string.Format("车号{0},1次重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                         }
                         // 存在一条使用中的委托
                         else if (listPreScale.Count == 1 && listPreScale[0].valueFlag == "4")
                         {
-                            rt = saveMethod.doError("不存在一次计量数据却存在一条使用中的委托");
+                            PbCache.isActual = true;
+                            PbCache.isInnerCar = true;
+                            rt = saveMethod.doAddFirst(null, mwaf);
+                            rt.resultInfo += ",不存在一次计量数据,存在一条使用中的委托";
                             PbCache.voiceType = 18;
                             PbCache.LEDResultMessage = "不存在一次计量数据却存在一条使用中的委托";
+                            PbCache.monitorResultMessage = string.Format("车号:{0},不存在一次计量数据却存在一条使用中的委托",PbCache.lockCarNo);
                             return rt;
                         }
                         // 只存在一条未使用的委托
@@ -143,7 +147,7 @@ namespace MeterSceneLibrary
                                     PbCache.isInnerCar = true;
                                     PbCache.voiceType = 1;
                                     rt = saveMethod.doAddFirst(listPreScale[0], mwaf);
-                                    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                    PbCache.LEDResultMessage = string.Format("车号{0},1次重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                                 }
                                 else
                                 {
@@ -157,7 +161,7 @@ namespace MeterSceneLibrary
                                         PbCache.isInnerCar = true;
                                         PbCache.voiceType = 1;
                                         rt = saveMethod.doAddFirst(listPreScale[0], mwaf);
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},1次重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                                     }
                                     // 上次净重已匹配委托 
                                     else if (lastMeterWorkCarActual.isPreScale == "1")
@@ -358,7 +362,7 @@ namespace MeterSceneLibrary
                                                 rt.resultInfo += ",混装业务";
                                                 double? netWeight = PbCache.lockWgt - lastMeterWorkCarActual.grossWeight;
                                                 PbCache.voiceType = 1;
-                                                PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,混装业务", PbCache.lockCarNo, Math.Round(PbCache.lockWgt / 1000, 2), Math.Abs(Math.Round((double)netWeight / 1000, 2)));
+                                                PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,混装业务", PbCache.lockCarNo, Math.Round(PbCache.lockWgt / 1000, 2), Math.Abs(Math.Round((double)netWeight / 1000, 2)));
                                             }
                                             else
                                             {
@@ -378,7 +382,7 @@ namespace MeterSceneLibrary
                                             PbCache.isInnerCar = true;
                                             PbCache.voiceType = 1;
                                             rt = saveMethod.doAddFirst(listPreScale[0], mwaf);
-                                            PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                            PbCache.LEDResultMessage = string.Format("车号{0},1次重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                                         }
 
                                     }
@@ -397,7 +401,7 @@ namespace MeterSceneLibrary
                                         PbCache.isInnerCar = true;
                                         PbCache.voiceType = 1;
                                         rt = saveMethod.doAddFirst(listPreScale[0], mwaf);
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},1次重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                                     }
                                 }
 
@@ -412,7 +416,7 @@ namespace MeterSceneLibrary
                         {
                             rt = saveMethod.doAddFirst(null, mwaf);
                             PbCache.voiceType = 1;
-                            PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                            PbCache.LEDResultMessage = string.Format("车号{0},1次重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                         }
                         // 存在多条委托
                         else if (listPreScale.Count > 1)
@@ -474,7 +478,7 @@ namespace MeterSceneLibrary
                                 pre = listPreScale[0];
                                 PbCache.voiceType = 1;
                                 PbCache.monitorResultMessage = string.Format("计量完成,车号{0}多个完全相同委托自动匹配最新委托", PbCache.lockCarNo);
-                                PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                PbCache.LEDResultMessage = string.Format("车号{0},1次重量{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                             }
                             if (listPreScale.Count == 2 && listPreScale[0].valueFlag == "1" && listPreScale[1].valueFlag == "1" && listPreScale[0].predictionType == "6" && listPreScale[1].predictionType == "6")
                             {
@@ -490,20 +494,20 @@ namespace MeterSceneLibrary
                                 pre = listPreScale[1];
                                 res = ",双委托业务";
                                 PbCache.voiceType = 1;
-                                PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,双委托业务", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                PbCache.LEDResultMessage = string.Format("车号{0},1次重量{1}吨,计量完成,双委托业务", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                             }
                             if (listPreScale.Count == 2 && !string.IsNullOrEmpty(listPreScale[0].receiverRemark) && !string.IsNullOrEmpty(listPreScale[1].receiverRemark) && listPreScale[0].tempConveyance == listPreScale[1].tempConveyance && !string.IsNullOrEmpty(listPreScale[0].tempConveyance) && !string.IsNullOrEmpty(listPreScale[1].tempConveyance) && isHZ)
                             {
                                 pre = listPreScale[1]; 
                                 res = ",混装业务";
                                 PbCache.voiceType = 1;
-                                PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,混装业务", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                PbCache.LEDResultMessage = string.Format("车号{0},1次重量{1}吨,计量完成,混装业务", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                             }
                             if (pre == null)
                             {
                                 res = ",存在多个委托,无法自动匹配";
                                 PbCache.voiceType = 8;
-                                PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,多委托无法自动匹配请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                PbCache.LEDResultMessage = string.Format("车号{0},1次重量{1}吨,计量完成,多委托无法自动匹配请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                                 PbCache.monitorResultMessage = string.Format("计量完成,车号{0}存在{1}个委托,无法自动匹配", PbCache.lockCarNo, listPreScale.Count);
                             }
                             PbCache.isActual = true;
@@ -520,7 +524,7 @@ namespace MeterSceneLibrary
                             rt = saveMethod.doAddFirst(null, mwaf);
                             rt.resultInfo += ",存在多个委托,无法自动匹配";
                             PbCache.voiceType = 8;
-                            PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,多委托无法自动匹配请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                            PbCache.LEDResultMessage = string.Format("车号{0},1次重量{1}吨,计量完成,多委托无法自动匹配请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                             PbCache.monitorResultMessage = string.Format("计量完成,车号{0}存在{1}个委托,无法自动匹配", PbCache.lockCarNo, listPreScale.Count);
                             PbCache.isActual = true;
                             PbCache.isInnerCar = true;
@@ -555,7 +559,7 @@ namespace MeterSceneLibrary
                         if (rmPre.Succeed)
                         {
                             // 存在的一次计量数据未匹配委托
-                            if (rmX.Data[0].isPreScale == "0")
+                            if (string.IsNullOrEmpty(rmX.Data[0].isPreScale) || rmX.Data[0].isPreScale == "0")
                             {
                                 // 不存在委托数据
                                 if (listPreScale == null || listPreScale.Count == 0)
@@ -569,7 +573,7 @@ namespace MeterSceneLibrary
                                     rt.WarnContent = "validIsPre";
                                     rt.resultInfo += ",无委托结净";
                                     PbCache.voiceType = 1;
-                                    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,无委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                    PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,无委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     PbCache.monitorResultMessage = string.Format("计量完成,车号{0}无委托结净", PbCache.lockCarNo, listPreScale.Count);
 
                                 }
@@ -581,9 +585,11 @@ namespace MeterSceneLibrary
                                      * b. 提示司机存在一条使用中的委托,请联系计量大厅进行确认
                                      * c. 自动进行语音求助
                                      */
+                                    rt = saveMethod.doNet(null, rmX.Data[0], mwaf);
+                                    rt.resultInfo += ",存在一条使用中的委托,请联系计量大厅进行确认";
                                     PbCache.voiceType = 18;
-                                    rt = saveMethod.doError("存在一条使用中的委托,请联系计量大厅进行确认");
                                     PbCache.LEDResultMessage = "存在一条使用中的委托,请联系计量大厅进行确认";
+                                    PbCache.monitorResultMessage = string.Format("车号:{0},存在一条使用中的委托,请联系计量大厅进行确认", PbCache.lockCarNo);
                                     return rt;
                                 }
                                 // 只存在一条未使用的委托数据
@@ -598,7 +604,7 @@ namespace MeterSceneLibrary
                                     mwaf.isPreScale = "1";
                                     PbCache.voiceType = 1;
                                     rt = saveMethod.doNet(listPreScale[0], rmX.Data[0], mwaf);
-                                    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                    PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                 }
                                 // 如果存在两条未使用的委托
                                 else if (listPreScale.Count == 2 && listPreScale[0].valueFlag == "1" && listPreScale[1].valueFlag == "1")
@@ -613,14 +619,14 @@ namespace MeterSceneLibrary
                                         // 正常结净并生成两条净重数据
                                         rt = saveMethod.doNetAddTwo(listPreScale, rmX.Data[0], mwaf);
                                         PbCache.voiceType = 1;
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     }
                                     else if (listPreScale[0].matterNo == listPreScale[1].matterNo && (listPreScale[0].receivingUintNo == listPreScale[1].forwardingUnitNo || listPreScale[0].forwardingUnitNo == listPreScale[1].receivingUintNo))
                                     {
                                         // 正常结净并生成两条净重数据
                                         rt = saveMethod.doNetAddTwo(listPreScale, rmX.Data[0], mwaf);
                                         PbCache.voiceType = 1;
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     }
                                     /*
                                      * 委托关系满足混装逻辑
@@ -654,7 +660,7 @@ namespace MeterSceneLibrary
                                         
                                         PbCache.voiceType = 1;
                                         rt = saveMethod.doNetHZHX(ptss, mwca, mwaf);
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,混装业务", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,混装业务", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                         rt.resultInfo += ",混装业务";
                                     }
                                     // 不满足以上逻辑
@@ -671,7 +677,7 @@ namespace MeterSceneLibrary
                                         rt.WarnContent = "validIsPre";
                                         rt.resultInfo += ",存在多个委托,无法自动匹配";
                                         PbCache.voiceType = 8;
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,多委托请联系大厅", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,多委托请联系大厅", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                         PbCache.monitorResultMessage = string.Format("计量完成,车号{0}存在{1}个委托,无法自动匹配", PbCache.lockCarNo, listPreScale.Count);
                                     }
                                 }
@@ -746,7 +752,7 @@ namespace MeterSceneLibrary
                                         mwaf.isPreScale = "1";
 
                                         PbCache.monitorResultMessage = string.Format("计量完成,车号{0}多个完全相同委托自动匹配最新委托", PbCache.lockCarNo);
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     }
                                     PbCache.voiceType = 1;
                                     rt = saveMethod.doNet(pre, rmX.Data[0], mwaf);
@@ -755,7 +761,7 @@ namespace MeterSceneLibrary
                                     if (pre == null)
                                     {
                                         PbCache.voiceType = 8;
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,多委托请联系大厅", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,多委托请联系大厅", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                         PbCache.monitorResultMessage = string.Format("计量完成,车号{0}存在{1}个委托,无法自动匹配", PbCache.lockCarNo, listPreScale.Count);
                                         rt.resultInfo += ",存在多个委托,无法自动匹配";
                                     }
@@ -768,12 +774,12 @@ namespace MeterSceneLibrary
                                     rt.WarnContent = "validIsPre";
                                     PbCache.voiceType = 8;
                                     rt.resultInfo += ",存在多个委托,无法自动匹配";
-                                    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,多委托请联系大厅", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                    PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,多委托请联系大厅", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     PbCache.monitorResultMessage = string.Format("计量完成,车号{0}存在{1}个委托,无法自动匹配", PbCache.lockCarNo, listPreScale.Count);
                                 }
                             }
                             // 存在的一次计量数据已匹配委托
-                            else if (rmX.Data[0].isPreScale == "1")
+                            else if ((!string.IsNullOrEmpty(rmX.Data[0].isPreScale)) && rmX.Data[0].isPreScale == "1")
                             {
                                 // 只存在一条使用中的委托
                                 if (listPreScale.Count == 1 && listPreScale[0].valueFlag == "4")
@@ -799,7 +805,7 @@ namespace MeterSceneLibrary
                                     mwaf.isPreScale = "1";
                                     PbCache.voiceType = 1;
                                     rt = saveMethod.doNet(pts, oldCarActural, mwaf);
-                                    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                    PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
 
                                     rt.resultInfo = "计量完成";
                                 }
@@ -816,14 +822,14 @@ namespace MeterSceneLibrary
                                         // 正常结净并生成两条净重数据
                                         rt = saveMethod.doNetAddTwo(listPreScale, rmX.Data[0], mwaf);
                                         PbCache.voiceType = 1;
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     }
                                     else if (listPreScale[0].matterNo == listPreScale[1].matterNo && (listPreScale[0].receivingUintNo == listPreScale[1].forwardingUnitNo || listPreScale[0].forwardingUnitNo == listPreScale[1].receivingUintNo))
                                     {
                                         // 正常结净并生成两条净重数据
                                         rt = saveMethod.doNetAddTwo(listPreScale, rmX.Data[0], mwaf);
                                         PbCache.voiceType = 1;
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     }
                                     /*
                                      * 委托关系满足混装混卸逻辑
@@ -858,7 +864,7 @@ namespace MeterSceneLibrary
                                         rt = saveMethod.doNetHZHX(pts, mwca, mwaf);
                                         rt.resultInfo += ",混装业务";
                                         PbCache.voiceType = 1;
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,混装业务", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,混装业务", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     }
                                     // 不满足以上逻辑
                                     else
@@ -898,7 +904,7 @@ namespace MeterSceneLibrary
                                         mwaf.isPreScale = "1";
                                         PbCache.voiceType = 1;
                                         rt = saveMethod.doNet(pts, oldCarActural, mwaf);
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                         PbCache.monitorResultMessage = string.Format("计量完成,在结净时仍然存在{1}个委托)", PbCache.lockCarNo, listPreScale.Count-1);
 
                                         rt.resultInfo = "计量完成";
@@ -911,7 +917,7 @@ namespace MeterSceneLibrary
                                     rt.WarnContent = "validIsPre";
                                     PbCache.voiceType = 8;
                                     rt.resultInfo += ",存在多个委托,无法自动匹配";
-                                    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,多委托请联系大厅", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                    PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,多委托请联系大厅", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     PbCache.monitorResultMessage = string.Format("计量完成,车号{0}存在{1}个委托,无法自动匹配", PbCache.lockCarNo, listPreScale.Count);
                                 }
                                 // 存在多条未使用的委托数据
@@ -938,12 +944,12 @@ namespace MeterSceneLibrary
                                         rt.WarnContent = "validIsPre";
                                         PbCache.voiceType = 8;
                                         rt.resultInfo += ",存在多个委托,无法自动匹配";
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,多委托请联系大厅", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,多委托请联系大厅", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                         PbCache.monitorResultMessage = string.Format("计量完成,车号{0}存在{1}个委托,无法自动匹配", PbCache.lockCarNo, listPreScale.Count);
                                     }
                                     else
                                     {
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     }
                                 }
                                 else
@@ -969,7 +975,7 @@ namespace MeterSceneLibrary
                                         rt.WarnContent = "validIsPre";
                                         PbCache.voiceType = 8;
                                         rt.resultInfo += ",存在多个委托,无法自动匹配";
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,多委托请联系大厅", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},2次重量{1}吨,净重{2}吨,多委托请联系大厅", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                         PbCache.monitorResultMessage = string.Format("计量完成,车号{0}存在{1}个委托,无法自动匹配", PbCache.lockCarNo, listPreScale.Count);
                                     }
                                     else

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

@@ -828,7 +828,15 @@ namespace MeterSceneLibrary.JISCO
                 //{
                 //    PbCache.monitorResult.valid_wgt = true;
                 //}
-                PbCache.monitorResult.valid_wgt = true;
+                if (WeightType == "001033002")
+                {
+                    PbCache.monitorResult.valid_wgt = true;
+                }
+                // 毛重
+                else
+                {
+                    PbCache.monitorResult.valid_wgt = false;
+                }
                 //PbCache.ResultMessage = "0";
             }
 
@@ -1256,10 +1264,12 @@ namespace MeterSceneLibrary.JISCO
             return rt;
         }
 
+        private Log lg = Log.GetInstance(); //写日志
+
         public void sendToZnlc()
         {
             if (PbCache.sportInfo.baseSpotNo.Equals("JT0005") || PbCache.sportInfo.baseSpotNo.Equals("JT0006")
-              || PbCache.sportInfo.baseSpotNo.Equals("JT0034") || PbCache.sportInfo.baseSpotNo.Equals("JT0035"))
+              || PbCache.sportInfo.baseSpotNo.Equals("XJT0034") || PbCache.sportInfo.baseSpotNo.Equals("XJT0035"))
             {
                 if (PbCache.yardActual != null)
                 {
@@ -1268,13 +1278,14 @@ namespace MeterSceneLibrary.JISCO
                         if (PbCache.yardActual.businessGroup.Equals("PO2GM"))
                         {
                             string sendResult = ZnlcInterface.sendNet(PbCache.yardActual);
+                            lg.WriteLog(38, "结净发送料场,车号:"+ PbCache.yardActual.carNo + ",毛重:" + PbCache.yardActual.grossWeight + ",返回内容:" + sendResult);
                             if (sendResult.Contains("error"))
                             {
                                 //GlobalInstanceController.Instance.LastCallMessage = "向智能料场发送数据失败:" + sendResult;
                             }
                             else
                             {
-                                PbCache.LEDResultMessage = sendResult;
+                                //PbCache.LEDResultMessage = sendResult;
                             }
                         }
                     }
@@ -1286,6 +1297,7 @@ namespace MeterSceneLibrary.JISCO
                         if (PbCache.yardFirst.businessGroup.Equals("PO2GM"))
                         {
                             string sendResult = ZnlcInterface.sendFirst(PbCache.yardFirst);
+                            lg.WriteLog(38, "一次发送料场,车号:" + PbCache.yardFirst.carNo + ",重量:" + PbCache.yardFirst.meterWeight + ",返回内容:" + sendResult);
                             if (sendResult.Contains("error"))
                             {
                                 //GlobalInstanceController.Instance.LastCallMessage = "向智能料场发送数据失败:" + sendResult;