فهرست منبع

winfrom提交

duyong 4 سال پیش
والد
کامیت
677bc6c6b1

+ 8 - 8
CarMeterMonitor/fromContect.cs

@@ -705,14 +705,14 @@ namespace CarMeterMonitor
                     }
 
                     //写入LED信息
-                    if (PbCache.sportInfo != null && PbCache.ledInfo != PbCache.OldLedInfo)
-                    {
-                        PbCache.OldLedInfo = PbCache.ledInfo;
-                        if (PbCache.monitor != null && PbCache.monitor.ledKeep == "0")
-                        {
-                            //led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
-                        }
-                    }
+                    //if (PbCache.sportInfo != null && PbCache.ledInfo != PbCache.OldLedInfo)
+                    //{
+                    //    PbCache.OldLedInfo = PbCache.ledInfo;
+                    //    if (PbCache.monitor != null && PbCache.monitor.ledKeep == "0")
+                    //    {
+                    //        //led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
+                    //    }
+                    //}
                 }
                 else
                 {

+ 3 - 3
CarMeterSystem/App.config

@@ -5,8 +5,8 @@
 	</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://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"/>-->
@@ -18,7 +18,7 @@
 		<add key="fuid" value="jgjlftp" />
 		<add key="fpwd" value="xxzx2021" />
 		<!-- /jldate/ftppicture/ -->
-		<add key="fpath" value="https://jgwzjl.jiugang.com/icore.icp.web/pass/file/upload/" />
+		<add key="fpath" value="http://jgwzjl.jiugang.com/icore.icp.web/pass/file/upload/" />
 		<!--0使用sftp,1使用vsftp-->
 		<add key="ftpType" value="1" />
 		<!--图片压缩-->

+ 25 - 22
CarMeterSystem/Form1.cs

@@ -110,10 +110,10 @@ namespace CarMeterSystem
 
                 if (lg.LoginIn())
                 {
-                    if (SystemUpdate(false))
-                    {
-                        return;
-                    }
+                    //if (SystemUpdate(false))
+                    //{
+                    //    return;
+                    //}
                     // 加载并验证基本配置
                     if (bd.setBaseDb() && bd.getBaseDb())
                     {
@@ -668,15 +668,15 @@ namespace CarMeterSystem
                         }
                     }
 
-                    //写入LED信息
-                    if (PbCache.sportInfo != null && PbCache.ledInfo != PbCache.OldLedInfo)
-                    {
-                        PbCache.OldLedInfo = PbCache.ledInfo;
-                        if (PbCache.monitor != null && PbCache.monitor.ledKeep == "0")
-                        {
-                            //led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
-                        }
-                    }
+                    ////写入LED信息
+                    //if (PbCache.sportInfo != null && PbCache.ledInfo != PbCache.OldLedInfo)
+                    //{
+                    //    PbCache.OldLedInfo = PbCache.ledInfo;
+                    //    if (PbCache.monitor != null && PbCache.monitor.ledKeep == "0")
+                    //    {
+                    //        //led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
+                    //    }
+                    //}
                 }
                 else
                 {
@@ -713,17 +713,17 @@ namespace CarMeterSystem
                         //LED写入
                         if (isLedWrite)
                         {
-                            if (PbCache.monitor == null || string.IsNullOrEmpty(PbCache.monitor.ledWriter))
-                            {
-                                PbCache.ledInfo = "车号甘A12345\n\r重量98.76吨\n\r之前存在一个未结净的毛重\n\r请联系";
-                            }
-                            else
-                            {
-                                PbCache.ledInfo = PbCache.monitor == null ? "" : PbCache.monitor.ledWriter;
-                            }
+                            //if (PbCache.monitor == null || string.IsNullOrEmpty(PbCache.monitor.ledWriter))
+                            //{
+                            //    PbCache.ledInfo = "车号甘A12345\n\r重量98.76吨\n\r之前存在一个未结净的毛重\n\r请联系";
+                            //}
+                            //else
+                            //{
+                            //    PbCache.ledInfo = PbCache.monitor == null ? "" : PbCache.monitor.ledWriter;
+                            //}
 
                             //led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
-                            led_controler.setStatic4LineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
+                            //led_controler.setStatic4LineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
 
                             isLedWrite = false;
 
@@ -1256,6 +1256,9 @@ namespace CarMeterSystem
                                 mwm.rearInfraredRayState = lv.Value.ToString();
                             }
                             break;
+                        case "ZeroWeightStatus":
+                            mwm.zeroState = lv.Value.ToString();
+                            break;
                         case "RfidState":
                             mwm.rfidState = lv.Value.ToString();
                             break;

+ 110 - 18
CarMeterSystem/frmMain.cs

@@ -63,6 +63,8 @@ namespace CarMeterSystem
         //监控表操作
         private MeterMonitorWeightService monitorWeightService = new MeterMonitorWeightService();
 
+        private MeterWorkScheduledHelpService meterWorkScheduledHelpService = new MeterWorkScheduledHelpService();
+
         //历史皮操作
         private MeterBaseHisTareDataService hisTareDataService = new MeterBaseHisTareDataService();
 
@@ -327,6 +329,8 @@ namespace CarMeterSystem
         private int iCountPark = 0;
         private string editCarNo = "";
 
+        private int num = 0;
+
         /// <summary>
         /// 数据采集
         /// </summary>
@@ -334,9 +338,47 @@ namespace CarMeterSystem
         /// <param name="e"></param>
         private void EventData(object o, DataCollectionArgs e)
         {
+            //num++;
+
+            //if (num < 20)
+            //{
+            //    e.carno = "";
+            //    e.weight = 15100;
+            //    e.weightStatus = 1;
+            //}
+            //else if (num < 26)
+            //{
+            //    e.carno = "";
+            //    e.weight = 15100;
+            //    e.weightStatus = 0;
+            //}
+            //else if (num < 39)
+            //{
+            //    e.carno = "蒙L65156";
+            //    e.weight = 15100;
+            //    e.weightStatus = 1;
+            //}
+            //else if (num < 74)
+            //{
+            //    e.carno = "蒙L65156";
+            //    e.weight = 25100;
+            //    e.weightStatus = 0;
+            //}
+            //else
+            //{
+            //    e.weight = 400;
+            //}
+
+            
+
             //这里每隔0.5秒执行一次
             try
             {
+                if (e.carno == "nown")
+                {
+                    e.carno = "";
+                }
+
                 #region 扫码信息
                 sweepCodeClass.StrState = e.weightStatus + ""; //重量状态信息;当StrState= 0时,获取扫码信息,StrState= 2时将扫码信息置位“”空;其他状态不处理
 
@@ -424,6 +466,11 @@ namespace CarMeterSystem
                     PbCache.collect.parkStatus = e.parkStatus;
                     PbCache.collect.datetime = e.datetime;
                     PbCache.collect.licType = e.licType;
+                    if (PbCache.collect.weightStatus == 0)
+                    {
+                        PbCache.resultWgt = e.weight + "";
+                        PbCache.resultCarNo = e.carno + "";
+                    }
                 }
                 //*/
 
@@ -433,6 +480,22 @@ 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 记录从上秤到下秤的所有的提示信息
+
+
                     if (PbCache.dtStartTime == null)
                         PbCache.dtStartTime = DateTime.Now;
                     isLedWrite = true;
@@ -635,7 +698,7 @@ namespace CarMeterSystem
                         RESTfulResult<string> rms = meterWorkMonitor.doUpdateWf(mwUpdate);
                         if (!rms.Succeed)
                         {
-                            l.WriteLog(0, "frmMain.EventData异常583:写入信息异常");
+                            l.WriteLog(0, "frmMain.EventData异常583:写入信息异常" + mwUpdate);
                         }
                         #endregion
 
@@ -685,14 +748,14 @@ namespace CarMeterSystem
                     }
 
                     //写入LED信息
-                    if (PbCache.sportInfo != null && PbCache.ledInfo != PbCache.OldLedInfo)
-                    {
-                        PbCache.OldLedInfo = PbCache.ledInfo;
-                        if (PbCache.monitor != null && PbCache.monitor.ledKeep == "0")
-                        {
-                            //led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
-                        }
-                    }
+                    //if (PbCache.sportInfo != null && PbCache.ledInfo != PbCache.OldLedInfo)
+                    //{
+                    //    PbCache.OldLedInfo = PbCache.ledInfo;
+                    //    if (PbCache.monitor != null && PbCache.monitor.ledKeep == "0")
+                    //    {
+                    //        //led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
+                    //    }
+                    //}
                 }
                 else
                 {
@@ -720,9 +783,25 @@ namespace CarMeterSystem
                     sPreNo = "";
                     preWgt = 0;
 
+                    //不等于空的时候说明写过一次日志了
+                    if (!string.IsNullOrEmpty(PbCache.resultMsgAll))
+                    {
+                        l.WriteLog(28, "车号:" + (string.IsNullOrEmpty(PbCache.resultCarNo) ? "未识别" : PbCache.resultCarNo) + ";重量:" + (PbCache.lockWgt == 0 ? PbCache.resultWgt : PbCache.lockWgt + "") + ";提示信息:" + PbCache.resultMsgAll);
+                        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.warmType = "5";
+                        meterWorkScheduledHelp1.warmTypeName = "计量提示跟踪";
+                        meterWorkScheduledHelpService.add(meterWorkScheduledHelp1);
+                    }
+
+
                     PbCache.isOvertimeAlarm = false; //是否超时报警
                     PbCache.strCode = "";
                     PbCache.ResultMessage = "";
+                    PbCache.resultMsgAll = "";
                     bEditCar = false;
                     isVoiceDownCar = false;
                     flagCarMonit = false;
@@ -748,14 +827,14 @@ namespace CarMeterSystem
                     //LED写入
                     if (isLedWrite)
                     {
-                        if (PbCache.monitor == null || string.IsNullOrEmpty(PbCache.monitor.ledWriter))
-                        {
-                            PbCache.ledInfo = "欢迎使用九钢汽车衡智能计量系统";
-                        }
-                        else
-                        {
-                            PbCache.ledInfo = PbCache.monitor == null ? "" : PbCache.monitor.ledWriter;
-                        }
+                        //if (PbCache.monitor == null || string.IsNullOrEmpty(PbCache.monitor.ledWriter))
+                        //{
+                        //    PbCache.ledInfo = "欢迎使用酒钢汽车衡智能计量系统";
+                        //}
+                        //else
+                        //{
+                        //    PbCache.ledInfo = PbCache.monitor == null ? "" : PbCache.monitor.ledWriter;
+                        //}
 
                         //led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
 
@@ -781,6 +860,7 @@ namespace CarMeterSystem
                             photoCar = "",
                             scanCar = "",
                             editCar = "",
+                            zeroState = "0",
                             carErr = "0",
                             ferroalloyResult = "0",
                             wgtErr = "0",
@@ -824,6 +904,10 @@ namespace CarMeterSystem
             {
                 foreach (LiveData lv in ll)
                 {
+                    if (lv.Tagname == "ZeroWeightStatus")
+                    {
+                        lv.Value = "1";
+                    }
                     switch (lv.Tagname.Replace(PbCache.collect_no, ""))
                     {
                         case "StaticStatus"://车辆检测	"0、东西方向激光均无报警;否则报警
@@ -841,7 +925,8 @@ namespace CarMeterSystem
                                 doInsertZeroAlarm();
                                 PbCache.isZeroAlarm = true;
                             }
-                            else {
+                            else 
+                            {
                                 PbCache.isZeroAlarm = false;
                             }
                             break;
@@ -868,6 +953,10 @@ namespace CarMeterSystem
             {
                 foreach (LiveData lv in ll)
                 {
+                    if (lv.Tagname == "ZeroWeightStatus")
+                    {
+                        lv.Value = "1";
+                    }
                     switch (lv.Tagname.Replace(PbCache.collect_no, ""))
                     {
                         case "PowerStatus":
@@ -928,6 +1017,9 @@ namespace CarMeterSystem
                         case "RfidState":
                             mwm.rfidState = lv.Value.ToString();
                             break;
+                        case "ZeroWeightStatus":
+                            mwm.zeroState = lv.Value.ToString();
+                            break;
                     }
                 }
             }

+ 162 - 85
CarMeterSystem/frmOneYardToEnd.cs

@@ -4,6 +4,7 @@ using Common;
 using MeterConditionLibrary;
 using MeterPlugInLibrary;
 using MeterSceneLibrary;
+using MeterSceneLibrary.JISCO;
 using System;
 using System.Collections.Generic;
 using System.Configuration;
@@ -59,7 +60,10 @@ namespace CarMeterSystem
         private string TrackCarNo = "";//预报车号
         private string sPreCarNo = "";//摄像头识别车号
         private string limsMsg = "";
-        
+        private double wgt = 0;
+        private string temporaryResult = "";
+        private string temporaryCarNo = "";
+        private SaveMethod saveMethod = new SaveMethod();
 
         private LED_Control led_controler;
 
@@ -79,6 +83,9 @@ namespace CarMeterSystem
         {
             try
             {
+                wgt = 0;
+                temporaryResult = "";
+                temporaryCarNo = "";
                 if (!string.IsNullOrEmpty(PbCache.sportInfo.ledIp))
                 {
                     led_controler = new LED_Control(PbCache.sportInfo.ledIp);
@@ -117,16 +124,16 @@ 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.lockCarNo,valueFlag = "1" });
+                //if (reSacle.Succeed)
+                //{
+                //    if (reSacle.Data == null || reSacle.Data.Count == 0)
+                //    { }
+                //    else
+                //    {
+                //        isCompare = true;
+                //    }
+                //}
 
                 if (PbCache.collect == null) return;
                 PbCache.isLockFrm = true;
@@ -153,9 +160,9 @@ namespace CarMeterSystem
                 else if (PbCache.collect.weightStatus == 0 && !PbCache.monitorResult.valid_park_status)
                 {
                     //重量稳定,且对射验证不合格
-                    vicPlayClass.GetVoicePlay("您的车辆未停到位", PbCache.collect.carno);
-                    PbCache.ResultMessage = "您的车辆未停到位,请调整车辆位置,不要遮挡激光检测设备,不允许进行自助计量操作!"; //btnSave_Click
-                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "您的车辆未停到位,请调整车辆位置,不要遮挡激光检测设备,不允许进行自助计量操作!");
+                    vicPlayClass.GetVoicePlay("车辆超出秤台,请调整车位", PbCache.collect.carno);
+                    PbCache.ResultMessage = "车辆超出秤台,请调整车位"; //btnSave_Click
+                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车辆超出秤台,请调整车位");
                     PbCache.isLockFrm = false;
                     btnSave.Enabled = true;
                     setMsg(PbCache.ResultMessage);
@@ -216,10 +223,24 @@ namespace CarMeterSystem
                 {
                     PbCache.isLockFrm = false;
                     btnSave.Enabled = true;
-                    setMsg("秤体存在零点,禁止进行计量操作!请点[语音求助],联系计量大厅处理!");
+                    setMsg("仪表未归零,无法计量,请联系大厅");
+                    vicPlayClass.GetVoicePlay("仪表未归零,无法计量,请联系大厅", PbCache.collect.carno);
+                    PbCache.ResultMessage = "仪表未归零,无法计量,请联系大厅"; //btnSave_Click
+                    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;
+                }
                 //本次的提单量+历史已经运输的总量,若大于提单总量,则不允许继续计量了
                 //BourneCao暂时屏蔽
                 //if (!vShipWeight.ValidMethod(preTrack))
@@ -230,7 +251,8 @@ namespace CarMeterSystem
                 //    return;
                 //}
 
-                txtMsgInfo.Text = "称重保存中......";
+                //txtMsgInfo.Text = "称重保存中......";
+                setMsg("称重保存中......");
                 //FrmMessage frmMessage = FrmMess("是否确认保存当前计量数据!", "继续保存");
 
 
@@ -341,21 +363,21 @@ namespace CarMeterSystem
                     }
                     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");
-                            }
-                        }
+                        ////拿到车辆
+                        //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" });
@@ -597,6 +619,10 @@ namespace CarMeterSystem
                     //flag =true表示称重成功
                     readVoicd();
 
+                    wgt = PbCache.lockWgt;
+                    temporaryResult = PbCache.ResultMessage;
+                    temporaryCarNo = PbCache.collect.carno;
+
                     isMeasureSuccess = true;
                     //提示信息,
                     //txtMsgInfo.Text = PbCache.ResultMessage;
@@ -633,26 +659,20 @@ namespace CarMeterSystem
                         meterWorkScheduledHelp.baseSpotName = PbCache.sportInfo.baseSpotName;
                         meterWorkScheduledHelp.carNo = PbCache.collect.carno;
                         meterWorkScheduledHelp.helpContent = PbCache.monitorResultMessage;
-                        meterWorkScheduledHelp.warnType = "2";
-                        meterWorkScheduledHelp.warnTypeName = "智能终端报警";
+                        meterWorkScheduledHelp.warmType = "2";
+                        meterWorkScheduledHelp.warmTypeName = "智能终端报警";
                         meterWorkScheduledHelpService.add(meterWorkScheduledHelp);
                     }
 
                     #endregion
 
                     #region LED写入
-                    PbCache.ledInfo = string.Format("计量完成,车号:{0},车重:{1},物资:{2}", PbCache.lockCarNo, PbCache.lockWgt, preTrack != null ? preTrack.matterName : "");
+                    //PbCache.ledInfo = string.Format("计量完成,车号:{0},车重:{1},物资:{2}", PbCache.lockCarNo, PbCache.lockWgt, preTrack != null ? preTrack.matterName : "");
                     #endregion LED写入
 
                     #region 智能料场LED显示
-                    if (PbCache.sportInfo.baseSpotNo == "")
-                    {
-                        LimisResponse ls = myTest.sendDataToZn(PbCache.weightInfoBeta);
-                        if (ls.Success)
-                        {
-                            led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, ls.Msg);
-                        }
-                    }
+                    saveMethod.sendToZnlc();
+                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
                     #endregion
 
                     //计量完成后,显示毛重或者皮重
@@ -794,6 +814,8 @@ namespace CarMeterSystem
         //计量完成标识
         private bool isMeasureSuccess = false;
 
+        private bool registerCar = false;
+
 
         private void timer1_Tick(object sender, EventArgs e)
         {
@@ -824,8 +846,8 @@ namespace CarMeterSystem
                         meterWorkScheduledHelp.baseSpotName = PbCache.sportInfo.baseSpotName;
                         meterWorkScheduledHelp.carNo = PbCache.collect.carno;
                         meterWorkScheduledHelp.helpContent = "疑似跟车,请核查";
-                        meterWorkScheduledHelp.warnType = "3";
-                        meterWorkScheduledHelp.warnTypeName = "智能终端报警";
+                        meterWorkScheduledHelp.warmType = "3";
+                        meterWorkScheduledHelp.warmTypeName = "智能终端报警";
                         meterWorkScheduledHelpService.add(meterWorkScheduledHelp);
                     }
 
@@ -891,7 +913,8 @@ namespace CarMeterSystem
                             if (!string.IsNullOrEmpty(PbCache.monitor.isOverWgt) && PbCache.monitor.isTakeOver == "2" && !isOverSound) //&& !PbCache.isLockFrm)
                             {
                                 ucWeightCarTJXJG1.setWgtBackColor(true);//称重完成后,显示颜色;
-                                txtMsgInfo.Text = "计量完成";
+                                //txtMsgInfo.Text = "计量完成";
+                                setMsg("计量完成");
                                 vicPlayClass.GetVoicePlay("计量完成,请离开秤台", PbCache.collect.carno);
                                 isOverSound = true;
                                 Print1(PbCache.monitor.isOverWgt);
@@ -905,11 +928,13 @@ namespace CarMeterSystem
                                 lg.WriteLog(14, "车号:" + PbCache.collect.carno + ";远程计量完成后,保存按钮隐藏!");
                                 if (!txtMsgInfo.Text.Contains("计量完成") && PbCache.monitor.isTakeOver == "2")
                                 {
-                                    txtMsgInfo.Text = "正在远程计量,请等待处理!!";
+                                    //txtMsgInfo.Text = "正在远程计量,请等待处理!!";
+                                    setMsg("正在远程计量,请等待处理!!");
                                 }
                                 if (!txtMsgInfo.Text.Contains("计量完成") && !string.IsNullOrEmpty(PbCache.monitor.isOverWgt))
                                 {
-                                    txtMsgInfo.Text = "本次计量称重已经完成,车辆请下秤!!";
+                                    //txtMsgInfo.Text = "本次计量称重已经完成,车辆请下秤!!";
+                                    setMsg("本次计量称重已经完成,车辆请下秤!!");
                                 }
                                 return;
                             }
@@ -948,12 +973,14 @@ namespace CarMeterSystem
                                 // 2021年5月11日 未识别到车牌号,进行提示,避免出现重新扫码点保存的情况
                                 if (string.IsNullOrEmpty(PbCache.collect.carno))
                                 {
-                                    txtMsgInfo.Text = string.Format("摄像头未识别到车牌号,不允许进行【保存】操作,请点击语音求助!");
+                                    //txtMsgInfo.Text = string.Format("摄像头未识别到车牌号,不允许进行【保存】操作,请点击语音求助!");
+                                    setMsg(string.Format("摄像头未识别到车牌号,不允许进行【保存】操作,请点击语音求助!"));
                                     lg.WriteLog(14, "摄像头未识别到车牌号,不允许进行【保存】操作,请点击语音求助!");
                                 }
                                 else
                                 {
-                                    txtMsgInfo.Text = string.Format("预报车号【{0}】与摄像头识别车号【{1}】不一致,请点击语音求助", TrackCarNo, PbCache.collect.carno);
+                                    //txtMsgInfo.Text = string.Format("预报车号【{0}】与摄像头识别车号【{1}】不一致,请点击语音求助", TrackCarNo, PbCache.collect.carno);
+                                    setMsg(string.Format("预报车号【{0}】与摄像头识别车号【{1}】不一致,请点击语音求助", TrackCarNo, PbCache.collect.carno));
                                     lg.WriteLog(14, "车号:" + PbCache.collect.carno + ";预报车号" + TrackCarNo + "与摄像头识别车号" + PbCache.collect.carno + "不一致!");
                                 }
                                 btnSave.Visible = false;
@@ -964,6 +991,7 @@ namespace CarMeterSystem
                                 if (txtMsgInfo.Text.Contains("摄像头"))
                                 {
                                     txtMsgInfo.Text = ""; //将原来的不允许计量的提示给去掉
+                                    setMsg("");
                                 }
                                 PbCache.collect.carno = TrackCarNo;
 
@@ -983,7 +1011,8 @@ namespace CarMeterSystem
                         if (!isPlayRangeVoice)
                         {
                             vicPlayClass.GetVoicePlay("已超量程", PbCache.collect.carno);
-                            txtMsgInfo.Text = "当前重量已超量程,秤体量程为【" + PbCache.range.upperRange / 1000 + "】T,不允许进行自助计量操作!";
+                            //txtMsgInfo.Text = "当前重量已超量程,秤体量程为【" + PbCache.range.upperRange / 1000 + "】T,不允许进行自助计量操作!";
+                            setMsg("当前重量已超量程,秤体量程为【" + PbCache.range.upperRange / 1000 + "】T,不允许进行自助计量操作!");
                             isPlayRangeVoice = true;
                         }
                     }
@@ -992,22 +1021,26 @@ namespace CarMeterSystem
                         //重量稳定,且对射验证不合格
                         if (!isPlayCalibVoice)
                         {
-                            vicPlayClass.GetVoicePlay("您的车辆未停到位", PbCache.collect.carno);
-                            txtMsgInfo.Text = "您的车辆未停到位,请调整车辆位置,不要遮挡激光检测设备,不允许进行自助计量操作!";//timer1_Tick
+                            vicPlayClass.GetVoicePlay("车辆超出秤台,请调整车位", PbCache.collect.carno);
+                            //txtMsgInfo.Text = "车辆超出秤台,请调整车位";//timer1_Tick
+                            setMsg("车辆超出秤台,请调整车位");
+                            PbCache.ResultMessage = "车辆超出秤台,请调整车位"; //btnSave_Click
+                            led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车辆超出秤台,请调整车位");
                             isPlayCalibVoice = true;
                         }
                     }
                     if (PbCache.isOvertimeAlarm)
                     {
                         //停留超时提醒,不作为计量卡控的条件
-                        if (!isPlayOvertimeVoice && !PbCache.isLockFrm)
-                        {
-                            vicPlayClass.GetVoicePlay("停留超时", PbCache.collect.carno);
-                            led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "停留超时");
-                            //txtMsgInfo.Text = "您的车辆已停留超过三分钟,遇到操作问题请点击【语音求助】联系司秤工处理或继续进行自助计量!";
-                            isPlayOvertimeVoice = true;
-                            return;
-                        }
+                        //if (!isPlayOvertimeVoice && !PbCache.isLockFrm)
+                        //{
+                        //    vicPlayClass.GetVoicePlay("停留超时", PbCache.collect.carno);
+                        //    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "停留超时");
+                        //    txtMsgInfo.Text = "停留超时";
+                        //    PbCache.ResultMessage = "停留超时";
+                        //    isPlayOvertimeVoice = true;
+                        //    return;
+                        //}
                     }
 
                     #region 模拟APP
@@ -1046,7 +1079,8 @@ namespace CarMeterSystem
                                 vicPlayClass.GetVoicePlay("未校秤", "");
                                 bXCStart = true;
                             }
-                            txtMsgInfo.Text = "未校秤无法计量";
+                            //txtMsgInfo.Text = "未校秤无法计量";
+                            setMsg("未校秤无法计量");
                             return;
                         }
                     }
@@ -1087,6 +1121,20 @@ namespace CarMeterSystem
                     //}
                     #endregion 判断是否需要复磅
 
+                    if (!string.IsNullOrEmpty(PbCache.collect.carno))
+                    {
+                        RESTfulResult<List<MeterBaseCar>> resCarList = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.collect.carno, validFlag = "0" });
+                        if (resCarList.Data == null || resCarList.Data.Count == 0 || resCarList.Data.Count != 1)
+                        {
+                            if (!registerCar)
+                            {
+                                RESTfulResult<MeterBaseCar> res = carService.addCar(new MeterBaseCar { carNo = PbCache.collect.carno, carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
+                                registerCar = true;
+                            }
+                            
+                        }
+                    }
+
                     #region 第一次查询,有车号,重量稳定,红外验证通过的情况只查一次
 
                     //如果没有查过一次,且扫描到车号信息,且重量稳定
@@ -1095,7 +1143,18 @@ namespace CarMeterSystem
                         firstWgt = 0;
                         sPreCarNo = TrackCarNo;
                         //判断车辆是厂内车还是厂外车
-                        RESTfulResult<List<MeterBaseCar>> resCarList = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.collect.carno, validFlag = "0" });
+                        if (string.IsNullOrEmpty(PbCache.collect.carno))
+                        {
+                            lg.WriteLog(28, "sss2" + "" + PbCache.collect.carno);
+                            //txtMsgInfo.Text = "车号未识别,请联系处理";
+                            setMsg("车号未识别,请联系处理");
+                            PbCache.monitorResultMessage = "车号未识别,请联系处理";
+                            PbCache.ResultMessage = "车号未识别,请联系处理";
+                            vicPlayClass.GetVoicePlay("车号为空,请联系处理", PbCache.collect.carno);
+                            led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未识别,请联系处理");
+                            return;
+                        }
+                        RESTfulResult<List<MeterBaseCar>> resCarList = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.collect.carno, validFlag = "0" }); 
                         if (resCarList.Succeed)
                         {
                             if (resCarList.Data != null && resCarList.Data.Count == 1)
@@ -1193,7 +1252,8 @@ namespace CarMeterSystem
                                     isStop = true;
                                     if (string.IsNullOrEmpty(PbCache.collect.carno))
                                     {
-                                        txtMsgInfo.Text = "车号未识别,请联系处理";
+                                        //txtMsgInfo.Text = "车号未识别,请联系处理";
+                                        setMsg("车号未识别,请联系处理");
                                         PbCache.monitorResultMessage = "车号未识别,请联系处理";
                                         PbCache.ResultMessage = "车号未识别,请联系处理";
                                         ledinfo = "车号未识别,请联系处理";
@@ -1201,7 +1261,8 @@ namespace CarMeterSystem
                                     }
                                     else
                                     {
-                                        txtMsgInfo.Text = "车号未注册,请联系处理";
+                                        //txtMsgInfo.Text = "车号未注册,请联系处理";
+                                        setMsg("车号未注册,请联系处理");
                                         PbCache.monitorResultMessage = "车号未注册,请联系处理";
                                         PbCache.ResultMessage = "车号未注册,请联系处理";
                                         ledinfo = "车号未注册,请联系处理";
@@ -1218,14 +1279,15 @@ namespace CarMeterSystem
 
                                     if (!string.IsNullOrEmpty(PbCache.collect.carno))
                                     {
-                                        carService.addCar(new MeterBaseCar { carNo = PbCache.collect.carno, carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
+                                        lg.WriteLog(30, string.Format("车号注册参数-车号:{0},车辆类型编号:{1},车辆类型名称:{2}", PbCache.collect.carno, AppConfigCache.carTypeNo, AppConfigCache.carTypeName));
+                                        RESTfulResult<MeterBaseCar> res = carService.addCar(new MeterBaseCar { carNo = PbCache.collect.carno, carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
+                                        lg.WriteLog(30, res.Succeed ? "注册成功" : "注册失败,原因:" + res.ResultMessage);
                                     }
                                     led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, ledinfo);
                                     bRailwayActual = false;
                                     isStop = false;
                                     return;
                                 }
-
                             }
                         }
                         #region 查一次是否可留期限皮,可以则显示按钮
@@ -1284,14 +1346,18 @@ namespace CarMeterSystem
                             if (!isVoiceDownCar)
                             {
                                 isVoiceDownCar = true;
+                                lg.WriteLog(25, PbCache.lockCarNo + "GetVoicePlay前");
                                 vicPlayClass.GetVoicePlay("车上人员请下车", PbCache.collect.carno);
                                 //txtMsgInfo.Text = "请核对车号后,扫描您手机中的二维码";
                             }
                             // 如果计量点配置中,设置了秤点计量类型为智能计量(下秤),验证扫码信息是否与识别车号一致。
                             // 如果为是,自动保存
                             //3秒后自动执行保存方法
+                            lg.WriteLog(25, PbCache.lockCarNo + "Sleep前点击保存按钮");
                             Thread.Sleep(3000);
+                            lg.WriteLog(25, PbCache.lockCarNo + "Sleep后点击保存按钮");
                             this.btnSave.PerformClick();
+                            lg.WriteLog(25, PbCache.lockCarNo + "PerformClick后保存按钮");
                         }
                         else if (PbCache.monitor.validMatClick == "0")
                         {
@@ -1403,11 +1469,15 @@ namespace CarMeterSystem
             else
             {
                 txtMsgInfo.Text = _lbLog;
+                if (!string.IsNullOrEmpty(PbCache.ResultMessage) && _lbLog != PbCache.ResultMessage)
+                {
+                    PbCache.ResultMessage = _lbLog;
+                }
             }
             //2021年3月13日;不管是哪一种方式调用界面控件的值,均记录现场日志
             if (!string.IsNullOrEmpty(lblog) && PbCache.collect != null)
             {
-                lg.WriteLog(9, "[" + PbCache.collect.carno + "]" + lblog);
+                lg.WriteLog(9, "[" + PbCache.collect.carno + "||" + PbCache.lockCarNo + "]" + lblog);
             }
         }
 
@@ -1913,7 +1983,8 @@ namespace CarMeterSystem
                 //仪表重量验证
                 if (!dataValidity.ValidMethod(PbCache.lockWgt))
                 {
-                    txtMsgInfo.Text = PbCache.ResultMessage;
+                    //txtMsgInfo.Text = PbCache.ResultMessage;
+                    setMsg(PbCache.ResultMessage);
                     return;
                 }
 
@@ -1928,13 +1999,15 @@ namespace CarMeterSystem
                     return;
                 }
 
-                txtMsgInfo.Text = "复磅保存中......";
+                //txtMsgInfo.Text = "复磅保存中......";
+                setMsg("复磅保存中......");
                 FrmMessage frmMessage = FrmMess("是否确认保存当前复磅重量数据!", "继续保存");
                 if (frmMessage.ShowDialog(this) == DialogResult.Cancel)
                 {
                     PbCache.isLockFrm = false;
                     btnRecover.Enabled = true;
-                    txtMsgInfo.Text = "";
+                    //txtMsgInfo.Text = "";
+                    setMsg("");
                     lg.WriteLog(15, PbCache.lockCarNo + "【复磅】按钮选择否");
                     return;
                 }
@@ -1981,10 +2054,14 @@ namespace CarMeterSystem
             else
             {
                 txtMsgInfo.Text = ResultMessage;
+                if (!string.IsNullOrEmpty(PbCache.ResultMessage) && ResultMessage != PbCache.ResultMessage)
+                {
+                    PbCache.ResultMessage = ResultMessage;
+                }
             }
             if (!string.IsNullOrEmpty(ResultMessage) && PbCache.collect != null)
             {
-                lg.WriteLog(9, "[" + PbCache.collect.carno + "]" + ResultMessage);
+                lg.WriteLog(9, "[" + PbCache.collect.carno + "||"+PbCache.lockCarNo+"]" + ResultMessage);
             }
         }
 
@@ -2009,6 +2086,15 @@ namespace CarMeterSystem
         {
             try
             {
+                lg.WriteLog(27, ("车号:" + (string.IsNullOrEmpty(temporaryCarNo) ? "未识别" : temporaryCarNo)) + ";重量:" + wgt + ";提示信息:" + temporaryResult);
+                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.warmType = "4";
+                meterWorkScheduledHelp1.warmTypeName = "计量数据统计";
+                meterWorkScheduledHelpService.add(meterWorkScheduledHelp1);
                 //初始化一些线程及数据,并关闭该界面
                 if (PbCache.collect != null && !string.IsNullOrEmpty(PbCache.collect.carno))
                 {
@@ -2024,19 +2110,6 @@ namespace CarMeterSystem
                 timer1.Stop();
                 timer1.Dispose();
 
-                //
-                if (!isMeasureSuccess)
-                {
-                    MeterWorkScheduledHelp meterWorkScheduledHelp = new MeterWorkScheduledHelp();
-                    meterWorkScheduledHelp.baseSpotNo = PbCache.sportInfo.baseSpotNo;
-                    meterWorkScheduledHelp.baseSpotName = PbCache.sportInfo.baseSpotName;
-                    meterWorkScheduledHelp.carNo = PbCache.collect.carno;
-                    meterWorkScheduledHelp.helpContent = string.Format("车辆未保存重量,重量为{0}t", Math.Round((PbCache.lockWgt / 1000), 2));
-                    meterWorkScheduledHelp.warnType = "2";
-                    meterWorkScheduledHelp.warnTypeName = "智能终端报警";
-                    meterWorkScheduledHelpService.add(meterWorkScheduledHelp);
-                }
-
                 #region 清理一次监控表的几个数值,防止上车速度过快导致提示称重完成
 
                 //RESTfulResult<string> rms = monitor.doUpdateWf(new MeterWorkMonitor { pointNo = PbCache.sportInfo.baseSpotNo, isOverWgt = "" });
@@ -2062,6 +2135,7 @@ namespace CarMeterSystem
                     photoCar = "",
                     scanCar = "",
                     editCar = "",
+                    zeroState = "0",
                     carErr = "0",
                     wgtErr = "0",
                     stopOverTime = "0",
@@ -2197,7 +2271,10 @@ namespace CarMeterSystem
                     voiceContent = "车辆在黑名单中";//未选择称重类型,请选择后开始计量
                     break;
                 case 23:
-                    voiceContent = "毛重接近历史皮重";//未选择称重类型,请选择后开始计量
+                    voiceContent = "毛重接近历史皮重";//未选择称重类型,请选择后开始计量计量成功,存在多条未结净一次数据,请联系计量大厅
+                    break;
+                case 24:
+                    voiceContent = "计量成功,存在多条未结净一次数据,请联系计量大厅";//计量成功,存在多条未结净一次数据,请联系计量大厅
                     break;
             }
 

+ 8 - 8
CarMeterSystem/fromContect.cs

@@ -704,14 +704,14 @@ namespace CarMeterSystem
                     }
 
                     //写入LED信息
-                    if (PbCache.sportInfo != null && PbCache.ledInfo != PbCache.OldLedInfo)
-                    {
-                        PbCache.OldLedInfo = PbCache.ledInfo;
-                        if (PbCache.monitor != null && PbCache.monitor.ledKeep == "0")
-                        {
-                            //led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
-                        }
-                    }
+                    //if (PbCache.sportInfo != null && PbCache.ledInfo != PbCache.OldLedInfo)
+                    //{
+                    //    PbCache.OldLedInfo = PbCache.ledInfo;
+                    //    if (PbCache.monitor != null && PbCache.monitor.ledKeep == "0")
+                    //    {
+                    //        //led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
+                    //    }
+                    //}
                 }
                 else
                 {

+ 2 - 0
Common/Common.csproj

@@ -66,6 +66,7 @@
     <Reference Include="System.Configuration" />
     <Reference Include="System.Core" />
     <Reference Include="System.Drawing" />
+    <Reference Include="System.Runtime.Serialization" />
     <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
@@ -133,6 +134,7 @@
     <Compile Include="vo\base\MeterBasemeterMaterialpm.cs" />
     <Compile Include="vo\base\MeterBaseUnitInfo.cs" />
     <Compile Include="vo\base\MetetBaseRailwayAiweight.cs" />
+    <Compile Include="vo\base\ZnlcInterface.cs" />
     <Compile Include="vo\pb\CraneScaleCollectModel.cs" />
     <Compile Include="vo\scale\PreBeltScaleForecast.cs" />
     <Compile Include="vo\scale\PreTrackNotice.cs" />

+ 21 - 0
Common/cacheCls/PbCache.cs

@@ -17,6 +17,24 @@ namespace Common
         /// </summary>
         public static string bussinessTypeName { get; set; }
         public static string bussinessTypeCode { get; set; }
+        
+        public static string ledMessage { get; set; }
+
+        /// <summary>
+        /// 全部提示信息
+        /// </summary>
+        public static string resultMsgAll { get; set; }
+
+        /// <summary>
+        /// 第一次稳定重量
+        /// </summary>
+        public static string resultWgt { get; set; }
+
+        /// <summary>
+        /// 第一次稳定车号
+        /// </summary>
+        public static string resultCarNo { get; set; }
+        
 
         /// <summary>
         /// 是否显示保存按钮
@@ -93,6 +111,9 @@ namespace Common
         public static int voiceType { get; set; }
         public static MeterWorkCarActualFirst mwPreFirst { get; set; }
 
+        public static MeterWorkCarActualFirst yardFirst { get; set; }
+        public static MeterWorkCarActual yardActual { get; set; }
+
         /// <summary>
         /// 附加重量
         /// </summary>

+ 18 - 0
Common/log/Log.cs

@@ -119,6 +119,24 @@ namespace Common
                     case 24:
                         strLogName = "检化验接口日志_";
                         break;
+                    case 25:
+                        strLogName = "保存按钮延迟点击日志_";
+                        break;
+                    case 26:
+                        strLogName = "led推送日志_";
+                        break;
+                    case 27:
+                        strLogName = "frmOneYard_close日志_";
+                        break;
+                    case 28:
+                        strLogName = "上秤到下秤全语音跟踪";
+                        break;
+                    case 29:
+                        strLogName = "车号未注册_";
+                        break;
+                    case 30:
+                        strLogName = "车号注册接口_";
+                        break;
                     default: 
                         strLogName = "计量终端_"; 
                         break;

+ 116 - 0
Common/vo/base/ZnlcInterface.cs

@@ -0,0 +1,116 @@
+using Common;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Runtime.Serialization.Json;
+using System.Text;
+
+namespace OtherInterface
+{
+  public static class ZnlcInterface
+  {
+    private static LimisResponse sendDataToZn(WeightInfoBeta model)
+    {
+      DataContractJsonSerializer objseria = new DataContractJsonSerializer(typeof(WeightInfoBeta));
+      MemoryStream mem = new MemoryStream();
+      objseria.WriteObject(mem, model);
+      string data = Encoding.UTF8.GetString(mem.ToArray(), 0, (int)mem.Length);
+      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);
+      LimisResponse limisResponse = JsonConvert.DeserializeObject<LimisResponse>(retStr);
+      return limisResponse;
+    }
+    public static string sendFirst(MeterWorkCarActualFirst meterWorkCarActualFirst)
+    {
+      string strResult = "";
+      try
+      {
+        WeightInfoBeta w = new WeightInfoBeta();
+      w.DeviceNo = meterWorkCarActualFirst.baseSpotNo;//计量站点
+      w.ConveyanceNo = meterWorkCarActualFirst.carNo;//车号
+      w.WeightVoucherNo = meterWorkCarActualFirst.predictionNo;//委托编号
+      //double t =double.Parse( meterWorkCarActualFirst.meterWeight.Value.ToString());
+      //w.GrossWeight =double.Parse( MyStringUtils.div1000(t.ToString()));
+      w.GrossWeight = meterWorkCarActualFirst.meterWeight / 1000;
+      w.TareWeight = 0;
+      w.NetWeight = 0;
+      w.MeteringPerson = meterWorkCarActualFirst.createManNo;
+      w.MeteringTime = meterWorkCarActualFirst.createTime.ToString();
+     
+        LimisResponse ls = sendDataToZn(w);
+        if (ls.Success)
+        {
+          strResult = ls.Msg;
+        }
+        else
+        {
+          if (ls.Code.Equals("401") || ls.Code.Equals("402") || ls.Code.Equals("404"))
+          {
+          }
+        }
+      }
+      catch (Exception eee)
+      {
+        strResult = "error:"+eee.Message;
+      }
+      return strResult;
+    }
+    public static string sendNet(MeterWorkCarActual meterWorkCarActual)
+    {
+      string strResult = "";
+      try
+      {
+        WeightInfoBeta w = new WeightInfoBeta();
+      w.DeviceNo = meterWorkCarActual.baseSpot2No;//计量站点
+      w.ConveyanceNo = meterWorkCarActual.carNo;//车号
+      w.WeightVoucherNo = meterWorkCarActual.predictionNo;//委托编号
+      w.GrossWeight = meterWorkCarActual.grossWeight / 1000;
+      w.TareWeight = meterWorkCarActual.tareWeight / 1000;
+      w.NetWeight = meterWorkCarActual.netWeight / 1000;
+      w.MeteringPerson = meterWorkCarActual.createManNo;
+      w.MeteringTime = meterWorkCarActual.createTime.ToString();
+     
+        LimisResponse ls = sendDataToZn(w);
+        if (ls.Success)
+        {
+          strResult = ls.Msg;
+        }
+        else
+        {
+          if (ls.Code.Equals("401") || ls.Code.Equals("402") || ls.Code.Equals("404"))
+          {
+          }
+        }
+      }
+      catch (Exception eee)
+      {
+        strResult = "error:" + eee.Message;
+      }
+      return strResult;
+    }
+  }
+  public class LimisResponse
+  {
+    public bool Success { get; set; }
+    public string Msg { get; set; }
+    public string Code { get; set; }
+  }
+  public class WeightInfoBeta
+  {
+    public string ConveyanceNo { get; set; }
+    public string DeviceNo { get; set; }
+    public double? GrossWeight { get; set; }
+    public string MeteringPerson { get; set; }
+    public string MeteringTime { get; set; }
+    public double? NetWeight { get; set; }
+    public double? TareWeight { get; set; }
+    public string WeightVoucherNo { get; set; }
+  }
+}

+ 5 - 0
Common/vo/work/MeterWorkCarActual.cs

@@ -524,6 +524,11 @@ namespace Common
 
 		public string note { get; set; }
 
+		/// <summary>
+		/// 修改人编号
+		/// <summary>
+		public string createManNo { get; set; }
+
 		/// <summary>
 		/// 创建人姓名
 		/// <summary>

+ 4 - 0
Common/vo/work/MeterWorkMonitor.cs

@@ -301,5 +301,9 @@ namespace Common
         /// </summary>
         public string ferroalloyConfirm { get; set; }
 
+        /// <summary>
+        /// 零点报警
+        /// </summary>
+        public string zeroState { get; set; }
     }
 }

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

@@ -84,12 +84,12 @@ namespace Common
         /// 报警类型
         /// <summary>
         //[AttributeID("pointNo")]
-        public string warnType { get; set; }
+        public string warmType { get; set; }
 
         /// <summary>
         /// 报警类型名称
         /// <summary>
         //[AttributeID("pointNo")]
-        public string warnTypeName { get; set; }
+        public string warmTypeName { get; set; }
     }
 }

+ 20 - 5
FrmStandAloneMetering/App.config

@@ -7,8 +7,8 @@
 		<add key="ClientSettingsProvider.ServiceUri" value="" />
 		<!--服务端链接-->
 		<!--<add key="ServiceUrl" value="http://172.22.4.6:9004/v1" />-->
-    <!--<add key="ServiceUrl" value="https://jgwzjl.jiugang.com/icore.icp.web/pass/systemBase/v1" />-->
-		<add key="ServiceUrl" value="http://10.104.0.1:9004/v1" />
+    <add key="ServiceUrl" value="http://jgwzjl.jiugang.com/icore.icp.web/pass/systemBase/v1" />
+		<!--<add key="ServiceUrl" value="http://10.104.0.1:9004/v1" />-->
 		<!--COM口-->
 		<add key="ComPara" value="COM3,9600,Odd,7,1" />
 		<!--<add key="ComPara" value="COM3,9600,None,8,1" />-->
@@ -30,9 +30,24 @@
 		<add key="StableDiff" value="25" />
 		<!--稳定次数-->
 		<add key="StableCount" value="8" />
-		
-		
-		<!--以下均用于common,单机计量无用-->
+    <!--期限皮使用方式配置:车号-物料-路线(1),车号-物料-称点(2),车号-物料(3)-->
+    <add key="TareControlType" value="3" />
+
+    <!--厂内外车配置:001004003(内部),001004002(外部)-->
+    <add key="carTypeNo" value="001004002" />
+
+    <!--厂内外车配置:001004003(内部),001004002(外部)-->
+    <add key="carTypeName" value="外部" />
+
+    <add key="ClientSettingsProvider.ServiceUri" value="" />
+
+    <!--厂内外车配置:001004003(内部),001004002(外部)-->
+    <add key="carAdd" value="1" />
+
+    <add key="isSendZNLC" value="1" />
+
+    <add key="spotNo" value="00007" />
+    <!--以下均用于common,单机计量无用-->
 		<!--实时库地址-->
 		<add key="icoredbTcp" value="tarantool://guest@172.22.42.2:2101" />
 		<!--SFTP或者vsftp服务端连接及地址-->

+ 66 - 0
FrmStandAloneMetering/FrmStandAloneMetering.cs

@@ -4,6 +4,7 @@ using System;
 using System.Collections.Generic;
 using System.Configuration;
 using System.Data;
+using System.Drawing;
 using System.IO;
 using System.IO.Ports;
 using System.Linq;
@@ -57,6 +58,8 @@ namespace FrmStandAloneMetering
         private double tmpWeight; //临时重量,用于判断是否稳定状态
         private int weightStabCount; //波动次数
 
+        private BaseDbCls bd = new BaseDbCls();
+
         private SerialPort serialPort1; //数据采集串口
         private bool blThreadFlag;//数据采集线程开关
         private StringBuilder weightLog = new StringBuilder(); //重量日志的文件
@@ -196,6 +199,31 @@ namespace FrmStandAloneMetering
 
             // 重新保存CSV文件
             saveSpotInfo(rmx3);
+
+
+            //物料下拉框赋值
+            DataTable dtMatterInfo = selectMatterInfo();
+            this.cbMatterName.DataSource = dtMatterInfo;
+            this.cbMatterName.DisplayMember = "name";
+            this.cbMatterName.ValueMember = "value";
+
+            //发货单位下拉框赋值
+            DataTable dtForwardingUnit = selectCustomerInfo();
+            this.cbForwardingUnitName.DataSource = dtForwardingUnit;
+            this.cbForwardingUnitName.DisplayMember = "name";
+            this.cbForwardingUnitName.ValueMember = "value";
+
+            //收货单位下拉框赋值
+            DataTable dtReceivingUint = selectCustomerInfo();
+            this.cbReceivingUintName.DataSource = dtReceivingUint;
+            this.cbReceivingUintName.DisplayMember = "name";
+            this.cbReceivingUintName.ValueMember = "value";
+
+            //计量点下拉框赋值
+            DataTable dtSpotInfo = selectSpotInfo();
+            this.cbBaseSpot.DataSource = dtSpotInfo;
+            this.cbBaseSpot.DisplayMember = "name";
+            this.cbBaseSpot.ValueMember = "value";
         }
 
         /// <summary>
@@ -489,6 +517,11 @@ namespace FrmStandAloneMetering
             actualFirstLog.Append(actualFirst.weightType.ToString() + ",");
             actualFirstLog.Append(actualFirst.meterWeight.ToString());
             logCsv.WriteDataLog("actualFirst", actualFirstLog.ToString());
+
+            bd.setBaseDb();
+            bd.getBaseDb();
+
+            shotImage(actualFirst.actualFirstNo.ToString());
         }
 
         /// <summary>
@@ -886,5 +919,38 @@ namespace FrmStandAloneMetering
                 return null;
             }
         }
+        /// <summary>
+        /// 终端截图
+        /// </summary>
+        public void shotImage(string actualFirstNo)
+        {
+            try
+            {
+                string spotNo = ConfigurationManager.AppSettings["spotNo"].ToString().Trim();
+                #region 截取图片信息
+                //截取屏幕信息
+                Point screenPoint = this.PointToScreen(new Point());
+                Rectangle rect = new Rectangle(screenPoint, this.Size);
+                Image img = new Bitmap(rect.Width, rect.Height);
+                Graphics g = Graphics.FromImage(img);
+                g.CopyFromScreen(rect.X - 1, rect.Y - 1, 0, 0, rect.Size);//"D://file/1.jpg"
+                img.Save(string.Format("{0}baseData\\imgShort\\formalImg\\{1}_{2}_{3}.jpg",
+                    AppDomain.CurrentDomain.SetupInformation.ApplicationBase,
+                    spotNo, actualFirstNo, 7), System.Drawing.Imaging.ImageFormat.Jpeg);
+                //(PbCache.videoChild.Count + 1)), System.Drawing.Imaging.ImageFormat.Jpeg);
+
+                //*
+                //最后进行截图操作
+                CameraShotCls cameraShot = new CameraShotCls();
+                cameraShot.CapMethod(actualFirstNo);
+                //*/
+
+                #endregion 截取图片信息
+            }
+            catch (Exception ex)
+            {
+                
+            }
+        }
     }
 }

+ 8 - 0
FrmStandAloneMetering/FrmStandAloneMetering.csproj

@@ -78,6 +78,10 @@
     <Compile Include="FrmStandAloneMetering.Designer.cs">
       <DependentUpon>FrmStandAloneMetering.cs</DependentUpon>
     </Compile>
+    <Compile Include="OptionCls\BaseDbCls.cs" />
+    <Compile Include="OptionCls\CameraShotCls.cs" />
+    <Compile Include="OptionCls\CarCache.cs" />
+    <Compile Include="OptionCls\LoginCls.cs" />
     <Compile Include="Utils\FileUtil.cs" />
     <Compile Include="Utils\logCsv.cs" />
     <Compile Include="vo\MeterWorkCarActFirAlon.cs" />
@@ -118,6 +122,10 @@
       <Project>{24b72a4a-3a4a-486b-9bcf-4a4b965c0ec6}</Project>
       <Name>Common</Name>
     </ProjectReference>
+    <ProjectReference Include="..\MeterPlugInLibrary\MeterPlugInLibrary.csproj">
+      <Project>{A90F4F23-9077-46CA-BA60-EB21DF346B27}</Project>
+      <Name>MeterPlugInLibrary</Name>
+    </ProjectReference>
   </ItemGroup>
   <ItemGroup>
     <Folder Include="backup\" />

+ 356 - 0
FrmStandAloneMetering/OptionCls/BaseDbCls.cs

@@ -0,0 +1,356 @@
+using Common;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+using MeterPlugInLibrary;
+using System.IO;
+using com.hnshituo.core.webapp.vo;
+using System.Configuration;
+
+namespace FrmStandAloneMetering
+{
+    /// <summary>
+    /// 基础数据获取
+    /// </summary>
+    public class BaseDbCls
+    {
+        Log lg = Log.GetInstance();
+
+        string spotNo = ConfigurationManager.AppSettings["spotNo"].ToString().Trim();
+
+        public bool getBaseDb() 
+        {
+            PbCache.isEndHour = 9999;
+
+            #region 获取计量类型
+            //string sql = @"SELECT base_code baseCode,base_name baseName,memo FROM Com_Base_Info where p_base_code='001006' and valid_Flag='1'";
+            //杨秀东修改为仅包含秤点信息的才让缓存出来
+            //string sql = @"SELECT base_code baseCode,base_name baseName,memo FROM Com_Base_Info where p_base_code='001006' and valid_Flag='1' and  instr(memo1,'"+ PbCache.sportInfo.baseSpotNo + "') > 0" +
+            /**
+             * BourneCao注释:酒钢不存在计量类型选择
+             */
+            string sql = @"SELECT base_code baseCode,base_name baseName,memo FROM Com_Base_Info where p_base_code='001006' and valid_Flag='1'" +
+                "order by create_time desc, base_code desc";
+            PbModelDbService<List<ComBaseInfo>> pb = new PbModelDbService<List<ComBaseInfo>>();
+            RESTfulResult<List<ComBaseInfo>> rmType = pb.executeSqlDataWf(sql);
+            if (rmType.Succeed && rmType.Data != null && rmType.Data.Count > 0)
+            {
+                PbCache.businessType = rmType.Data;
+            }
+            else
+            {
+                lg.WriteLog(1, "未找到计量类型基础信息");
+                return false;
+            }
+            //*/
+            #endregion
+
+            #region 获取一次计量数据过期时间
+            sql = @"SELECT base_code baseCode,base_name baseName,memo FROM Com_Base_Info where p_base_code='001031' and valid_Flag='1'";
+            PbModelDbService<List<ComBaseInfo>> pb1 = new PbModelDbService<List<ComBaseInfo>>();
+            RESTfulResult<List<ComBaseInfo>> rmType1 = pb.executeSqlDataWf(sql);
+            if (rmType1.Succeed && rmType1.Data != null && rmType1.Data.Count > 0)
+            {
+                try
+                {
+                    PbCache.isEndHour = Convert.ToDouble(rmType.Data[0].baseName);
+                }
+                catch 
+                {
+                    PbCache.isEndHour = 9999;
+                }
+            }
+            #endregion
+
+            #region 读取音频文件名称
+            List<string> ls = new List<string>();
+            DirectoryInfo folder = new DirectoryInfo(PbCache.path + "\\Sound");
+
+            foreach (FileInfo file in folder.GetFiles("*.wav"))
+            {
+                ls.Add(file.Name.Replace(".wav", ""));
+            }
+            PbCache.voiceInfo = ls;
+            #endregion
+
+            #region 摄像头配置信息
+            MeterBaseVideoinfoService mbvs = new MeterBaseVideoinfoService();
+            RESTfulResult<List<MeterBaseVideoinfo>> rm = mbvs.doQueryWf(new MeterBaseVideoinfo { pointid = spotNo }); //db.doOption<MeterBaseVideoinfo>("meterbasevideoinfos", "doQueryWf", new object[] { PbCache.sportInfo }, 0);
+            if (rm.Succeed && rm.Data != null && rm.Data.Count > 0)
+            {
+                PbCache.videoInfo = rm.Data[0];
+                List<MeterBaseVideoChild> videoChild = new List<MeterBaseVideoChild>();
+
+                Type postType = PbCache.videoInfo.GetType(); //rm.Data.GetType();
+                PropertyInfo[] postTypeInfos = postType.GetProperties(); //返回为当前 Type 的所有公共属性,PropertyInfo[] PropertyInfo 的所有公共属性的 Type 对象数组
+                foreach (PropertyInfo p in postTypeInfos)
+                {
+                    if (p.Name.Contains("videoip")) //2021年3月16日 杨秀东:原来从摄像头截图使用position;现在从硬盘录像机截图,使用videoip
+                    {
+                        string str = (string)p.GetValue(PbCache.videoInfo, null);
+                        if (str != "" && str != null)
+                        {
+                            videoChild.Add(
+                                new MeterBaseVideoChild
+                                {
+                                    pointid = PbCache.videoInfo.pointid,
+                                    p_ip = str,
+                                    p_rate = "0",//************解码率直接给定了,这里没取配置值*************
+                                    vdo_port = PbCache.videoInfo.vdoPort,
+                                    vdo_pwd = PbCache.videoInfo.vdoPwd,
+                                    vdo_user = PbCache.videoInfo.vdoUser
+                                }
+                            );
+                        }
+                    }
+                }
+
+                PbCache.videoChild = videoChild;
+                if (videoChild.Count == 0)
+                {
+                    return false;
+                }
+                else
+                {
+                    //将摄像头操作类存储再缓存中
+                    List<DhCameraShot> list = new List<DhCameraShot>();
+
+                    #region 由从摄像头截图改为从硬盘录像机截图
+                    /*
+                    DhCameraShot cameraShot = new DhCameraShot();
+                    cameraShot.ip = PbCache.videoInfo.videoip;
+                    cameraShot.port = PbCache.videoInfo.vdoPort;
+                    cameraShot.uid = PbCache.videoInfo.vdoUser;
+                    cameraShot.pwd = PbCache.videoInfo.vdoPwd;
+                    list.Add(cameraShot);
+                    //*/
+
+                    //*
+                    foreach (MeterBaseVideoChild child in PbCache.videoChild)
+                    {
+                        DhCameraShot cameraShot = new DhCameraShot();
+                        cameraShot.ip = child.p_ip;
+                        cameraShot.port = child.vdo_port;
+                        cameraShot.uid = child.vdo_user;
+                        cameraShot.pwd = child.vdo_pwd;
+                        list.Add(cameraShot);
+                    }
+                    //*/
+                    #endregion
+                    CarCache.cameraShots = list;
+                }
+            }
+            else
+            {
+                //lg.WriteLog(1, "未找到摄像头配置信息MeterBaseVideoinfo");
+                //return false;
+            }
+            #endregion
+
+            #region 秤体量程配置 
+            MeterBaseScaleRangeService rangeService = new MeterBaseScaleRangeService();
+            RESTfulResult<List<MeterBaseScaleRange>> rmR = rangeService.doQueryWf(new MeterBaseScaleRange { baseSpotNo = spotNo });
+            if (rmR.Succeed && rmR.Data != null && rmR.Data.Count > 0)
+            {
+                PbCache.range = rmR.Data[0];
+            }
+            else
+            {
+                //lg.WriteLog(1, "未找到秤体量程配置信息MeterBaseScaleRange");
+                //return false;
+            }
+            #endregion
+
+            #region 获取计量场景信息
+            MeterWorkSceneRegisterService sceneRegisterService = new MeterWorkSceneRegisterService();
+            RESTfulResult<List<MeterWorkSceneRegister>> rmSceneRegister = sceneRegisterService.doQueryWf(new MeterWorkSceneRegister { valueFlag = "0" });
+            if (rmSceneRegister.Succeed)
+            {
+                PbCache.ltSceneRegister = rmSceneRegister.Data;
+            }
+            else
+            {
+                lg.WriteLog(1, "未找到计量场景信息配置信息sceneRegisterService");
+                return false;
+            }
+            #endregion
+
+            return true;
+        }
+
+        /// <summary>
+        /// 将基础数据全部载入缓存中
+        /// </summary>
+        /// <returns></returns>
+        public bool setBaseDb()
+        {
+            string sql = "";
+            #region 初始化一次缓存类
+            PbCache.monitor = new MeterWorkMonitor();
+            PbCache.Load();
+            #endregion
+
+            #region 历史皮重计算配置表
+            MeterBaseHisTareCountService service = new MeterBaseHisTareCountService();
+            RESTfulResult<List<MeterBaseHisTareCount>> rmH = service.doQueryWf(new MeterBaseHisTareCount { valueFlag = "0" , typeNo = "001033001" }); //0有效 1无效 //db.doOption<List<MeterBaseHisTareCount>>("MeterBaseHisTareCountService", "doQueryWf", new object[] { mbhtc }, 0);
+            if (rmH.Succeed && rmH.Data != null && rmH.Data.Count > 0)
+            {
+                PbCache.tareCount = rmH.Data[0];
+            }
+            else 
+            {
+                //lg.WriteLog(1, "未找到历史皮重配置信息MeterBaseHisTareCount");
+                //return false;
+            }
+            #endregion
+
+            #region 期限皮重计算配置表
+            MeterBaseTermTareCountService termTareCountService = new MeterBaseTermTareCountService();
+            RESTfulResult<List<MeterBaseTermTareCount>> rmTe = termTareCountService.doQueryWf(new MeterBaseTermTareCount { valueFlag = "0", typeNo = "001033001" }); //0有效 1无效 //db.doOption<List<MeterBaseHisTareCount>>("MeterBaseHisTareCountService", "doQueryWf", new object[] { mbhtc }, 0);
+            if (rmTe.Succeed && rmTe.Data != null && rmTe.Data.Count > 0)
+            {
+                PbCache.termTareCount = rmTe.Data[0];
+            }
+            else
+            {
+                //lg.WriteLog(1, "未找到期限皮重配置信息MeterBaseHisTareCount");
+                //return false;
+            }
+            #endregion
+
+            #region 危化品限载配置
+            MeterBaseLimitChemicalService limitService = new MeterBaseLimitChemicalService();
+            RESTfulResult<List<MeterBaseLimitChemical>> rmL = limitService.doQueryWf(new MeterBaseLimitChemical { valueFlag = "0" });
+            if (rmL.Succeed)
+            {
+                PbCache.limit = rmL.Data;
+            }
+            else 
+            {
+                lg.WriteLog(1, "未找到危化品限载配置信息MeterBaseLimitChemical");
+                return false;
+            }
+            #endregion
+
+            #region 两次计量时间间隔配置
+            MeterBaseTimeSpaceService spaceService = new MeterBaseTimeSpaceService();
+            RESTfulResult<List<MeterBaseTimeSpace>> rmS = spaceService.doQueryWf(new MeterBaseTimeSpace { spotTypeNo = "001002001" });//汽车衡
+            if (rmS.Succeed)
+            {
+                PbCache.timeSpace = rmS.Data;
+            }
+            else 
+            {
+                lg.WriteLog(1, "未找到两次计量时间间隔配置信息MeterBaseTimeSpace");
+                return false;
+            }
+            #endregion
+
+            #region 期限皮重时间配置
+            MeterBaseTermTareTimeService tareTime = new MeterBaseTermTareTimeService();
+            RESTfulResult<List<MeterBaseTermTareTime>> rmT = tareTime.doQueryWf(new MeterBaseTermTareTime { valueFlag = "0" });//0:有效;1:无效
+            if (rmS.Succeed)
+            {
+                PbCache.tareTime = rmT.Data;
+            }
+            else
+            {
+                lg.WriteLog(1, "未找到期限皮重时间配置信息MeterBaseTermTareTime");
+                return false;
+            }
+            #endregion
+
+            #region 校秤基础数据
+            PbModelDbService<List<MeterBaseCalibraRelation>> pbRelation = new PbModelDbService<List<MeterBaseCalibraRelation>>();
+            sql = @"select *
+                      from (select t2.base_Spot_No baseSpotNo,
+                                   t2.base_Spot_Name baseSpotName,
+                                   t2.calibration_Time_Unit calibrationTimeUnit,
+                                   to_char(t2.start_time, 'HH24:mi:ss') startTime,
+                                   to_char(t2.end_time, 'HH24:mi:ss') endTime,
+                                   t2.day_Num dayNum
+                              from METER_BASE_CALIBRA_RELATION t2
+                             where t2.base_Spot_No = '" + spotNo + @"'
+                             order by t2.end_time desc)
+                     where rownum = 1";
+            RESTfulResult<List<MeterBaseCalibraRelation>> rmRelation = pbRelation.executeSqlDataWf(sql);
+            if (rmRelation.Succeed)
+            {
+                PbCache.relations = rmRelation.Data;
+            }
+            else 
+            {
+                lg.WriteLog(1, "未找到校秤基础数据MeterBaseCalibraRelation");
+                return false;
+            }
+            #endregion
+
+            #region 停留超时时间holdTime
+            MeterBaseCarHoldTimeService holdService = new MeterBaseCarHoldTimeService();
+            RESTfulResult<List<MeterBaseCarHoldTime>> rmHT = holdService.doQueryWf(new MeterBaseCarHoldTime { baseSpotNo = spotNo });//汽车衡
+            if (rmS.Succeed)
+            {
+                PbCache.holdTime = rmHT.Data;
+            }
+            else
+            {
+                lg.WriteLog(1, "停留超时时间holdTime");
+                return false;
+            }
+            #endregion
+
+            #region 计量卸货时间
+            MeterBaseUnloadTimeService unloadTimeService = new MeterBaseUnloadTimeService();
+            RESTfulResult<List<MeterBaseUnloadTime>> rmU = unloadTimeService.doQueryWf(new MeterBaseUnloadTime { });
+            if (rmU.Succeed)
+            {
+                PbCache.unloadTimes = rmU.Data;
+            }
+            else
+            {
+                //lg.WriteLog(1, "未找到计量卸货时间间隔配置信息MeterBaseUnloadTime");
+                //return false;
+            }
+            #endregion
+
+            #region 计量车卡信息
+            MeterBaseCarCardService carCardService = new MeterBaseCarCardService();
+            RESTfulResult<List<MeterBaseCarCard>> rmCar = carCardService.doQueryWf(new MeterBaseCarCard { valueFlag = "1" });
+            if (rmCar.Succeed)
+            {
+                PbCache.ltCarCard = rmCar.Data;
+            }
+            else
+            {
+                lg.WriteLog(1, "未找到计量卡车辆配置信息MeterBaseCarCard");
+                return false;
+            }
+            #endregion
+
+            #region 校秤计量关联,用于获取是否限制
+            sql = @"select base_spot_no baseSpotNo, 
+                           base_spot_name baseSpotName, 
+                           up_weight upWeight, 
+                           is_meter isMeter
+                      from METER_BASE_CALIBRA_NUM_REL 
+                     group by base_spot_no, base_spot_name, UP_WEIGHT, is_meter";
+            PbModelDbService<List<MeterBaseCalibraNumRel>> pbNumRel = new PbModelDbService<List<MeterBaseCalibraNumRel>>();
+            RESTfulResult<List<MeterBaseCalibraNumRel>> rmNumRel = pbNumRel.executeSqlDataWf(sql);
+            if (rmNumRel.Succeed && rmNumRel.Data != null && rmNumRel.Data.Count > 0)
+            {
+                PbCache.ltBaseCalibraNumRel = rmNumRel.Data;
+            }
+            else
+            {
+                //lg.WriteLog(1, "未找到秤点关联表METER_BASE_CALIBRA_NUM_REL信息");
+                ////return false;
+            }
+            #endregion
+
+            return true;
+        }
+    }
+}

+ 82 - 0
FrmStandAloneMetering/OptionCls/CameraShotCls.cs

@@ -0,0 +1,82 @@
+using Common;
+using MeterPlugInLibrary;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FrmStandAloneMetering
+{
+    /// <summary>
+    /// 截图调用类
+    /// </summary>
+    public class CameraShotCls
+    {
+        string spotNo = ConfigurationManager.AppSettings["spotNo"].ToString().Trim();
+        string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
+        public void Connection()
+        {
+            foreach (DhCameraShot shot in CarCache.cameraShots)
+            {
+                shot.Connection();
+            }
+        }
+
+        public void Close()
+        {
+            foreach (DhCameraShot shot in CarCache.cameraShots)
+            {
+                shot.Close();
+            }
+        }
+
+        /// <summary>
+        /// 截图
+        /// </summary>
+        /// <param name="actualFirstNo">作业编号</param>
+        public void CapPic(string actualFirstNo)
+        {
+            int iCnt = 1; //抓拍摄像头配置顺序必须是前面2个
+            foreach (DhCameraShot shot in CarCache.cameraShots)
+            {
+                //放在tempImg文件夹下面就进行图片的压缩操作,否则不进行图片压缩
+                //shot.CapPic(iCnt < 3 ? 0 : 1, PbCache.path + string.Format("\\imgShort\\tempImg\\{0}_{1}_{2}.jpg", PbCache.sportInfo.baseSpotNo, "C" + actualFirstNo, iCnt));
+                shot.CapPic(iCnt < 3 ? 0 : 1, path + string.Format("baseData\\imgShort\\formalImg\\{0}_{1}_{2}.jpg", spotNo,actualFirstNo, iCnt));
+
+                iCnt++;
+            }
+        }
+
+
+
+
+        /// <summary>
+        /// 从硬盘录像机 进行截图
+        /// </summary>
+        /// <param name="actualFirstNo"></param>
+        public void CapPicFromVideo(string actualFirstNo)
+        {
+            foreach (DhCameraShot shot in CarCache.cameraShots)
+            {
+                //放在tempImg文件夹下面就进行图片的压缩操作,否则不进行图片压缩
+                //shot.CapPic(iCnt < 3 ? 0 : 1, PbCache.path + string.Format("\\imgShort\\tempImg\\{0}_{1}_{2}.jpg", PbCache.sportInfo.baseSpotNo, "C" + actualFirstNo, iCnt));
+                shot.CapPicFromVedio(path + string.Format("baseData\\imgShort\\formalImg\\{0}_{1}_", spotNo, actualFirstNo));
+            }
+
+        }
+
+        /// <summary>
+        /// 连接视频截图并关闭
+        /// </summary>
+        /// <param name="actualFirstNo">作业编号</param>
+        public void CapMethod(string actualFirstNo)
+        {
+            Connection();
+            //CapPic(actualFirstNo);
+            CapPicFromVideo(actualFirstNo);
+            Close();
+        }
+    }
+}

+ 17 - 0
FrmStandAloneMetering/OptionCls/CarCache.cs

@@ -0,0 +1,17 @@
+using MeterPlugInLibrary;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FrmStandAloneMetering
+{
+    public class CarCache
+    {
+        /// <summary>
+        /// 摄像头的开关类集合
+        /// </summary>
+        public static List<DhCameraShot> cameraShots { get; set; }
+    }
+}

+ 45 - 0
FrmStandAloneMetering/OptionCls/LoginCls.cs

@@ -0,0 +1,45 @@
+using Common;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using com.hnshituo.core.webapp.vo;
+
+namespace FrmStandAloneMetering
+{
+    public class LoginCls
+    {
+        public bool LoginIn()
+        {
+            MeterBaseSpotInfoService service = new MeterBaseSpotInfoService();
+            if (AppConfigCache.productType == "2" || AppConfigCache.productType == "0")
+            {
+                RESTfulResult<List<MeterBaseSpotInfo>> rm = service.doQueryWf(new MeterBaseSpotInfo { flatComputerIp = IpAddress.getIp, validFlag = "1" });
+                if (rm.Succeed && rm.Data != null && rm.Data.Count > 0)
+                {
+                    PbCache.sportInfo = rm.Data[0];
+                    return true;
+                }
+                else
+                {
+                    return false;
+                }
+            }
+            else
+            {
+                RESTfulResult<List<MeterBaseSpotInfo>> rm = service.doQueryWf(new MeterBaseSpotInfo { flatComputerIp = IpAddress.getIp, validFlag = "1" });
+                if (rm.Succeed && rm.Data != null && rm.Data.Count > 0)
+                {
+                    PbCache.sportInfo = rm.Data[0];
+                    return true;
+                }
+                else
+                {
+                    return false;
+                }
+            }
+           
+        }
+    }
+}

+ 58 - 40
MeterPlugInLibrary/LED/LED_Control.cs

@@ -1,4 +1,5 @@
-using System;
+using Common;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,6 +9,8 @@ namespace MeterPlugInLibrary
 {
     public class LED_Control
     {
+        private Log lg = Log.GetInstance(); //写日志
+
         public LED_Control(string Ip) 
         {
             int nResult;
@@ -226,58 +229,73 @@ namespace MeterPlugInLibrary
 
         public void setStaticLineMsg(string Ip, string ledInfo)
         {
-            ledInfo =  ledInfo.Replace(",", "\r\n");
-            int nResult;
-            LedDll.COMMUNICATIONINFO CommunicationInfo = new LedDll.COMMUNICATIONINFO();//定义一通讯参数结构体变量用于对设定的LED通讯,具体对此结构体元素赋值说明见COMMUNICATIONINFO结构体定义部份注示
+            try
+            {
+                if (ledInfo == null) return;
+                ledInfo = ledInfo.Replace(",", "\r\n");
 
-            CommunicationInfo.SendType = 0;//设为固定IP通讯模式,即TCP通讯
-            CommunicationInfo.IpStr = Ip;//给IpStr赋值LED控制卡的IP
-            CommunicationInfo.LedNumber = 1;//LED屏号为1,注意socket通讯和248通讯不识别屏号,默认赋1就行了,485必需根据屏的实际屏号进行赋值
+                if (PbCache.OldLedInfo == ledInfo) return;
 
-            nResult = LedDll.LV_SetBasicInfo(ref CommunicationInfo, 2, 96, 64);//设置屏参,屏的颜色为2即为双基色,64为屏宽点数,32为屏高点数,具体函数参数说明见函数声明注示
+                PbCache.OldLedInfo = ledInfo;
 
+                lg.WriteLog(26, PbCache.lockCarNo + "led推送信息:" + ledInfo);
 
-            int hProgram;//节目句柄
-            hProgram = LedDll.LV_CreateProgram(96, 64, 2);//根据传的参数创建节目句柄,128是屏宽点数,48是屏高点数,2是屏的颜色,注意此处屏宽高及颜色参数必需与设置屏参的屏宽高及颜色一致,否则发送时会提示错误
-            //此处可自行判断有未创建成功,hProgram返回NULL失败,非NULL成功,一般不会失败
+                int nResult;
+                LedDll.COMMUNICATIONINFO CommunicationInfo = new LedDll.COMMUNICATIONINFO();//定义一通讯参数结构体变量用于对设定的LED通讯,具体对此结构体元素赋值说明见COMMUNICATIONINFO结构体定义部份注示
 
-            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();//区域坐标属性结构体变量
+                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为屏高点数,具体函数参数说明见函数声明注示
 
-            AreaRect.left = 0;
-            AreaRect.top = 0;
-            AreaRect.width = 96;
-            AreaRect.height = 64;
 
-            LedDll.FONTPROP FontProp = new LedDll.FONTPROP();//文字属性
-            FontProp.FontName = "宋体";
-            FontProp.FontSize = 10;
-            FontProp.FontColor = LedDll.COLOR_RED;
-            FontProp.FontBold = 0;
-            //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
+                int hProgram;//节目句柄
+                hProgram = LedDll.LV_CreateProgram(96, 64, 2);//根据传的参数创建节目句柄,128是屏宽点数,48是屏高点数,2是屏的颜色,注意此处屏宽高及颜色参数必需与设置屏参的屏宽高及颜色一致,否则发送时会提示错误
+                                                              //此处可自行判断有未创建成功,hProgram返回NULL失败,非NULL成功,一般不会失败
 
-            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_AddProgram(hProgram, 1, 0, 1);//添加一个节目,参数说明见函数声明注示
+                if (nResult != 0)
+                {
+                    string ErrStr;
+                    ErrStr = LedDll.LS_GetError(nResult);
+                    return;
+                }
+                LedDll.AREARECT AreaRect = new LedDll.AREARECT();//区域坐标属性结构体变量
 
 
-            nResult = LedDll.LV_Send(ref CommunicationInfo, hProgram);//发送,见函数声明注示
-            LedDll.LV_DeleteProgram(hProgram);//删除节目内存对象,详见函数声明注示
-            if (nResult != 0)//如果失败则可以调用LV_GetError获取中文错误信息
-            {
-                string ErrStr;
-                ErrStr = LedDll.LS_GetError(nResult);
+                AreaRect.left = 0;
+                AreaRect.top = 0;
+                AreaRect.width = 96;
+                AreaRect.height = 64;
+
+                LedDll.FONTPROP FontProp = new LedDll.FONTPROP();//文字属性
+                FontProp.FontName = "宋体";
+                FontProp.FontSize = 10;
+                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
+                {
+                    //"发送成功";
+                }
             }
-            else
+            catch (Exception ex)
             {
-                //"发送成功";
+                lg.WriteLog(25, PbCache.lockCarNo + "led_trycatch事件异常:" + ex.Message);
             }
         }
 

+ 14 - 9
MeterSceneLibrary/JISCO/InnerCarJISCO.cs

@@ -115,20 +115,25 @@ namespace MeterSceneLibrary
                     RESTfulResult<List<MeterBaseCar>> resCarList = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.lockCarNo });
                     RESTfulResult<List<MeterBaseSpecialUnit>> sunitList = meterBaseSpecialUnitService.doQueryCarList(new MeterBaseSpecialUnit { unitNo = resCarList.Data[0].usetDepartmentNo });
 
-                    if (sunitList.Data == null || sunitList.Data.Count != 1)
+                    if (resCarList.Data[0].usetDepartmentNo == "888888")
                     {}
                     else
                     {
-                        bool isGorss = rmX.Data[0].submitFlag == "1" && rmX.Data[0].weightTypeNo == "001033001";
-                        if (isGorss || rmX.Data[0].weightTypeNo == "001033002")
-                        {}
+                        if (sunitList.Data == null || sunitList.Data.Count != 1)
+                        { }
                         else
                         {
-                            rt = saveMethod.doError("");
-                            rt.resultInfo = string.Format("车号{0},当前毛重{1}吨,请确认重量", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
-                            PbCache.LEDResultMessage = string.Format("车号{0},当前毛重{1}吨,请确认重量", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
-                            PbCache.voiceType = 12;
-                            return rt;
+                            bool isGorss = rmX.Data[0].submitFlag == "1" && rmX.Data[0].weightTypeNo == "001033001";
+                            if (isGorss || rmX.Data[0].weightTypeNo == "001033002")
+                            { }
+                            else
+                            {
+                                rt = saveMethod.doError("");
+                                rt.resultInfo = string.Format("车号{0},当前毛重{1}吨,请确认重量", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                PbCache.LEDResultMessage = string.Format("车号{0},当前毛重{1}吨,请确认重量", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                PbCache.voiceType = 12;
+                                return rt;
+                            }
                         }
                     }
 

+ 67 - 18
MeterSceneLibrary/JISCO/OuterCarJISCO.cs

@@ -329,15 +329,44 @@ namespace MeterSceneLibrary
                                             EntityBase<PreTrackScale> entityBase1 = new EntityBase<PreTrackScale>();
                                             mwaf = entityBase1.format<MeterWorkCarActualFirst>(listPreScale[0], mwaf);
 
-                                            // 将当次一次计量数据重量类型改为毛重
-                                            mwaf.weightType = "0"; // 毛重
-                                            mwaf.isPreScale = "1";
-                                            // 混装逻辑,并结净匹配委托
-                                            rt = saveMethod.doAddNetNewHZHX(listPreScale[0], newActualFirst, mwaf);
-                                            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.Round((double)netWeight / 1000, 2));
+                                            // 读结净最小值配置
+                                            ComBaseInfoService cbis = new ComBaseInfoService();
+                                            RESTfulResult<List<ComBaseInfo>> res = cbis.doQueryBaseList(new ComBaseInfo { baseCode = "001031001" });
+                                            if (res.Succeed)
+                                            {
+                                                if (res.Data != null && res.Data.Count == 1)
+                                                {
+                                                    try
+                                                    {
+                                                        diffrentWgt = Double.Parse(res.Data[0].baseName);
+                                                    }
+                                                    finally
+                                                    {
+
+                                                    }
+                                                }
+                                            }
+
+                                            if (Math.Abs(newActualFirst.meterWeight.Value - PbCache.lockWgt) > diffrentWgt || listMonitor.Data[0].validPredictionDiff == "0")
+                                            {
+                                                // 将当次一次计量数据重量类型改为毛重
+                                                mwaf.weightType = "0"; // 毛重
+                                                mwaf.isPreScale = "1";
+                                                // 混装逻辑,并结净匹配委托
+                                                rt = saveMethod.doAddNetNewHZHX(listPreScale[0], newActualFirst, mwaf);
+                                                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.Round((double)netWeight / 1000, 2));
+                                            }
+                                            else
+                                            {
+                                                rt = saveMethod.doError("第一次计量重量【" + newActualFirst.meterWeight.Value / 1000 + "T】和第二次计量重量【" + PbCache.lockWgt / 1000 + "T】接近,小于结净最小值【" + diffrentWgt / 1000 + " T】");
+                                                rt.isWarn = true;
+                                                rt.WarnContent = "validWgt";
+                                                PbCache.voiceType = 4;
+                                                PbCache.LEDResultMessage = "计量失败,小于结净最小值,请联系计量大厅";
+                                            }
                                         }
                                         else
                                         {
@@ -385,6 +414,29 @@ namespace MeterSceneLibrary
                         // 存在多条委托
                         else if (listPreScale.Count > 1)
                         {
+                            bool isHZ = false;
+                            MeterWorkCarActualService meterWorkCarActualService = new MeterWorkCarActualService();
+                            //计量实绩
+                            MeterWorkCarActual mwca = new MeterWorkCarActual();
+                            mwca.carNo = PbCache.lockCarNo;
+
+                            RESTfulResult<List<MeterWorkCarActual>> rm = meterWorkCarActualService.doQueryActaulWf(mwca);
+
+                            if (rm.Succeed) 
+                            {
+                                if (rm.Data == null || rm.Data.Count == 0)
+                                {
+                                    isHZ = true;
+                                }
+                                else
+                                {
+                                    if (rm.Data[0].isPreScale == "1")
+                                    {
+                                        isHZ = true;
+                                    }
+                                }
+                            }
+
                             /*
                             * a. 正常保存重量(重量类型为空)
                             * b. 提示称重完成
@@ -425,10 +477,6 @@ namespace MeterSceneLibrary
                             {
                                 pre = listPreScale[0];
                             }
-                            if (listPreScale.Count == 2 && listPreScale[0].valueFlag == "1" && listPreScale[1].valueFlag == "1" && listPreScale[0].predictionType == "7" && listPreScale[1].predictionType == "7")
-                            {
-                                pre = listPreScale[0];
-                            }
                             if (listPreScale.Count == 2 && listPreScale[0].valueFlag == "1" && listPreScale[1].valueFlag == "1" && listPreScale[0].predictionType == "5" && listPreScale[1].predictionType == "5")
                             {
                                 pre = listPreScale[0];
@@ -441,9 +489,9 @@ namespace MeterSceneLibrary
                                 PbCache.voiceType = 1;
                                 PbCache.LEDResultMessage = string.Format("车号{0},重量{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))
+                            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];
+                                pre = listPreScale[1]; 
                                 res = ",混装业务";
                                 PbCache.voiceType = 1;
                                 PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,混装业务", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
@@ -881,9 +929,10 @@ namespace MeterSceneLibrary
                     PbCache.isActual = true;
                     PbCache.isInnerCar = true;
                     rt = saveMethod.doAddFirst(null, mwaf);
-                    rt.resultInfo = "存在多条一次计量数据";
-                    PbCache.voiceType = 3;
-                    PbCache.LEDResultMessage = "存在多条一次计量数据";
+                    rt.resultInfo += ",存在"+ list.Count + "条一次数据";
+                    PbCache.voiceType = 24;
+                    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,存在{2}条一次数据,请联系大厅", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2),list.Count);
+                    PbCache.monitorResultMessage = string.Format("车号{0},重量{1}吨,存在{2}条一次数据,请联系大厅", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), list.Count);
                     rt.isWarn = true;
                     rt.WarnContent = "validWgt";
                 }

+ 48 - 22
MeterSceneLibrary/JISCO/private/SaveMethod.cs

@@ -1,5 +1,6 @@
 using com.hnshituo.core.webapp.vo;
 using Common;
+using OtherInterface;
 using System;
 using System.Collections.Generic;
 using System.Text;
@@ -53,15 +54,8 @@ namespace MeterSceneLibrary.JISCO
 
             RESTfulResult<string> rmI = mwcfs.doAdd(pbSomeModel);
 
-            if (PbCache.sportInfo.baseSpotNo == "")
-            {
-                PbCache.weightInfoBeta.DeviceNo = model.baseSpotNo;//计量站点
-                PbCache.weightInfoBeta.ConveyanceNo = model.carNo;//车号
-                PbCache.weightInfoBeta.WeightVoucherNo = model.predictionNo;//委托编号
-                PbCache.weightInfoBeta.GrossWeight = model.meterWeight;
-                PbCache.weightInfoBeta.MeteringPerson = "admin";
-                PbCache.weightInfoBeta.MeteringTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
-            }
+            PbCache.yardFirst = model;
+
             if (rmI.Succeed)
             {
                 rt.result = true;
@@ -190,6 +184,7 @@ namespace MeterSceneLibrary.JISCO
             netDb.updateManNo = "admin";
             netDb.updateTime = DateTime.Now;
 
+            PbCache.yardActual = netDb;
 
             //操作日志
             MeterMonitorNote monitorNote = new MeterMonitorNote();
@@ -202,19 +197,6 @@ namespace MeterSceneLibrary.JISCO
 
             // 保存结净记录,后续改成统一提交模式  BourneCao
 
-            //特殊称点智能料场
-            if (PbCache.sportInfo.baseSpotNo == "")
-            {
-                PbCache.weightInfoBeta.DeviceNo = actualFirst2.baseSpotNo;//计量站点
-                PbCache.weightInfoBeta.ConveyanceNo = netDb.carNo;//车号
-                PbCache.weightInfoBeta.WeightVoucherNo = netDb.predictionNo;//委托编号
-                PbCache.weightInfoBeta.GrossWeight = netDb.grossWeight;
-                PbCache.weightInfoBeta.TareWeight = netDb.tareWeight;
-                PbCache.weightInfoBeta.NetWeight = netDb.netWeight;
-                PbCache.weightInfoBeta.MeteringPerson = "admin";
-                PbCache.weightInfoBeta.MeteringTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
-            }
-
             MeterWorkCarActualService actualService = new MeterWorkCarActualService();
             RESTfulResult<string> rmI = actualService.doAddNet(actualFirst, actualFirst2, netDb, monitorNote, "1");
             if (rmI.Succeed)
@@ -1184,6 +1166,50 @@ namespace MeterSceneLibrary.JISCO
             
             return rt;
         }
+
+        public void sendToZnlc()
+        {
+            if (PbCache.sportInfo.baseSpotNo.Equals("JT0005") || PbCache.sportInfo.baseSpotNo.Equals("JT0006")
+              || PbCache.sportInfo.baseSpotNo.Equals("JT0034") || PbCache.sportInfo.baseSpotNo.Equals("JT0035"))
+            {
+                if (PbCache.yardActual != null)
+                {
+                    if (!string.IsNullOrEmpty(PbCache.yardActual.predictionNo))
+                    {
+                        if (PbCache.yardActual.businessGroup.Equals("PO2GM"))
+                        {
+                            string sendResult = ZnlcInterface.sendNet(PbCache.yardActual);
+                            if (sendResult.Contains("error"))
+                            {
+                                //GlobalInstanceController.Instance.LastCallMessage = "向智能料场发送数据失败:" + sendResult;
+                            }
+                            else
+                            {
+                                PbCache.LEDResultMessage = sendResult;
+                            }
+                        }
+                    }
+                }
+                else if (PbCache.mwPreFirst != null)
+                {
+                    if (!string.IsNullOrEmpty(PbCache.yardFirst.predictionNo))
+                    {
+                        if (PbCache.yardFirst.businessGroup.Equals("PO2GM"))
+                        {
+                            string sendResult = ZnlcInterface.sendFirst(PbCache.yardFirst);
+                            if (sendResult.Contains("error"))
+                            {
+                                //GlobalInstanceController.Instance.LastCallMessage = "向智能料场发送数据失败:" + sendResult;
+                            }
+                            else
+                            {
+                                PbCache.LEDResultMessage = sendResult;
+                            }
+                        }
+                    }
+                }
+            }
+        }
         #endregion
     }
 }