Selaa lähdekoodia

Merge branch 'master' of https://git.steerinfo.com/caol/jisco_winform_wzjl.git

BourneCao 4 vuotta sitten
vanhempi
commit
e746ad2825

+ 11 - 10
CarMeterSystem/Form1.cs

@@ -175,7 +175,7 @@ namespace CarMeterSystem
                         collection.Start(PbCache.sportInfo.baseSpotNo, PbCache.sportInfo.baseSpotName);
                         collection.Start(PbCache.sportInfo.baseSpotNo, PbCache.sportInfo.baseSpotName);
 
 
                         imageCurlControl.Start(); //图片采集线程
                         imageCurlControl.Start(); //图片采集线程
-                        //sweepCodeClass.StartThreadSweep(); //扫码线程
+                        sweepCodeClass.StartThreadSweep(); //扫码线程
                         ////***********************暂时注释掉*****************************************************
                         ////***********************暂时注释掉*****************************************************
                         ////sweepCodeClass.StartThreadSweep();
                         ////sweepCodeClass.StartThreadSweep();
                         ////**************************************************************************************
                         ////**************************************************************************************
@@ -543,15 +543,16 @@ namespace CarMeterSystem
                         //e.RfidNos = "0003";
                         //e.RfidNos = "0003";
                         if (!string.IsNullOrEmpty(e.RfidNos))
                         if (!string.IsNullOrEmpty(e.RfidNos))
                         {
                         {
-                            if (PbCache.ltCarCard != null && PbCache.ltCarCard.Count > 0)
+                            string sqls = @"SELECT RFID_ID id,CAR_NO text FROM METER_BASE_RFID_INFO where RFID_CODE = '" + e.RfidNos + "'";
+
+                            PbModelDbService<List<PbModelDb>> pbp = new PbModelDbService<List<PbModelDb>>();
+                            RESTfulResult<List<PbModelDb>> rmT = pbp.executeSqlDataWf(sqls);
+                            if (rmT.Data == null || rmT.Data.Count == 0)
+                            {}
+                            else
                             {
                             {
-                                MeterBaseCarCard carCard = PbCache.ltCarCard.Where(s => s.cardNo == e.RfidNos).FirstOrDefault();
-                                if (carCard != null)
-                                {
-                                    mwUpdate.rfidCar = carCard.carNo;
-                                    sCarNo = carCard.carNo;
-                                    //PbCache.collect.carno = carCard.carNo;
-                                }
+                                mwUpdate.rfidCar = rmT.Data[0].text;
+                                sCarNo = rmT.Data[0].text;
                             }
                             }
                         }
                         }
 
 
@@ -695,7 +696,7 @@ namespace CarMeterSystem
                         {
                         {
                             if (PbCache.monitor == null || string.IsNullOrEmpty(PbCache.monitor.ledWriter))
                             if (PbCache.monitor == null || string.IsNullOrEmpty(PbCache.monitor.ledWriter))
                             {
                             {
-                                PbCache.ledInfo = "车号甘A12345,重量98.76吨,计量完成";
+                                PbCache.ledInfo = "车号甘A12345,重量98.76吨,之前存在一个未结净的毛重,请联系";
                             }
                             }
                             else
                             else
                             {
                             {

+ 10 - 10
CarMeterSystem/frmMain.cs

@@ -169,7 +169,7 @@ namespace CarMeterSystem
                         collection.EventDataCollectionArgs += new EventDataCollection(EventData);//数据采集及扫码信息
                         collection.EventDataCollectionArgs += new EventDataCollection(EventData);//数据采集及扫码信息
                         collection.Start(PbCache.sportInfo.baseSpotNo, PbCache.sportInfo.baseSpotName);
                         collection.Start(PbCache.sportInfo.baseSpotNo, PbCache.sportInfo.baseSpotName);
 
 
-                        //imageCurlControl.Start(); //图片上传线程
+                        imageCurlControl.Start(); //图片上传线程
                         sweepCodeClass.StartThreadSweep(); //扫码线程
                         sweepCodeClass.StartThreadSweep(); //扫码线程
                     }
                     }
                     else
                     else
@@ -580,16 +580,16 @@ namespace CarMeterSystem
 
 
                         if (!string.IsNullOrEmpty(e.RfidNos))
                         if (!string.IsNullOrEmpty(e.RfidNos))
                         {
                         {
-                            if (PbCache.ltCarCard != null && PbCache.ltCarCard.Count > 0)
+                            string sqls = @"SELECT RFID_ID id,CAR_NO text FROM METER_BASE_RFID_INFO where RFID_CODE = '" + e.RfidNos + "'";
+
+                            PbModelDbService<List<PbModelDb>> pbp = new PbModelDbService<List<PbModelDb>>();
+                            RESTfulResult<List<PbModelDb>> rmT = pbp.executeSqlDataWf(sqls);
+                            if (rmT.Data == null || rmT.Data.Count == 0)
+                            { }
+                            else
                             {
                             {
-                                MeterBaseCarCard carCard = PbCache.ltCarCard.Where(s => s.cardNo == e.RfidNos).FirstOrDefault();
-                                if (carCard != null && !string.IsNullOrEmpty(carCard.carNo))
-                                {
-                                    mwUpdate.rfidCar = carCard.carNo;
-                                    sCarNo = carCard.carNo;
-                                    flagCarMonit = true;
-                                    //PbCache.collect.carno = carCard.carNo;
-                                }
+                                mwUpdate.rfidCar = rmT.Data[0].text;
+                                sCarNo = rmT.Data[0].text;
                             }
                             }
                         }
                         }
                         #endregion
                         #endregion

+ 365 - 253
CarMeterSystem/frmOneYardToEnd.cs

@@ -34,10 +34,13 @@ namespace CarMeterSystem
         private MeterWorkCarActualFirstService workCarActualFirstService = new MeterWorkCarActualFirstService(); //一次计量数据
         private MeterWorkCarActualFirstService workCarActualFirstService = new MeterWorkCarActualFirstService(); //一次计量数据
         private PreTrackScaleService trackService = new PreTrackScaleService();//查询预报信息
         private PreTrackScaleService trackService = new PreTrackScaleService();//查询预报信息
         private MeterBaseMatterInfoService matterInfoService = new MeterBaseMatterInfoService(); //物料信息
         private MeterBaseMatterInfoService matterInfoService = new MeterBaseMatterInfoService(); //物料信息
-        private PreTrackScaleService PreTrackScaleService = new PreTrackScaleService(); 
+        private PreTrackScaleService PreTrackScaleService = new PreTrackScaleService();
+        private MeterWorkScheduledHelpService meterWorkScheduledHelpService = new MeterWorkScheduledHelpService();
+        MeterWorkCompareSpotScaleService meterWorkCompareSpotScaleService = new MeterWorkCompareSpotScaleService();
 
 
         private validTermTareCar termTareCar = new validTermTareCar();//验证是否可留期限皮
         private validTermTareCar termTareCar = new validTermTareCar();//验证是否可留期限皮
         private validRecoverInfo recoverInfo = new validRecoverInfo();//验证是否需要复磅以及是否满足复磅条件
         private validRecoverInfo recoverInfo = new validRecoverInfo();//验证是否需要复磅以及是否满足复磅条件
+        private validArea areaInfo = new validArea();//验证区域是否正确
         private validPrediction validPred = new validPrediction(); //验证预报信息
         private validPrediction validPred = new validPrediction(); //验证预报信息
         private validUnloadAutomatic unloadAutomatic = new validUnloadAutomatic(); //自动卸货
         private validUnloadAutomatic unloadAutomatic = new validUnloadAutomatic(); //自动卸货
         private validDataValidity dataValidity = new validDataValidity(); //验证采集的重量是否正常
         private validDataValidity dataValidity = new validDataValidity(); //验证采集的重量是否正常
@@ -106,7 +109,21 @@ namespace CarMeterSystem
         {
         {
             try
             try
             {
             {
-                    if (PbCache.collect == null) return;
+                bool isCompare = false;
+
+                RESTfulResult<List<MeterWorkCompareSpotSacle>> reSacle = meterWorkCompareSpotScaleService.doQuery(new MeterWorkCompareSpotSacle { carNo = PbCache.lockCarNo });
+                if (reSacle.Succeed)
+                {
+                    if (reSacle.Data == null || reSacle.Data.Count == 0)
+                    { }
+                    else
+                    {
+                        isCompare = true;
+                    }
+                }
+
+
+                if (PbCache.collect == null) return;
                 PbCache.isLockFrm = true;
                 PbCache.isLockFrm = true;
                 PbCache.lockCarNo = PbCache.collect.carno;
                 PbCache.lockCarNo = PbCache.collect.carno;
                 PbCache.lockWgt = PbCache.collect.weight;
                 PbCache.lockWgt = PbCache.collect.weight;
@@ -165,6 +182,15 @@ namespace CarMeterSystem
                     return;
                     return;
                 }
                 }
 
 
+                //判断区域是否正确
+                if (!areaInfo.ValidMethod(PbCache.sportInfo, txtCarNo.Text) && PbCache.monitor.validArea == "1" && !isCompare)
+                {
+                    PbCache.isLockFrm = false;
+                    btnSave.Enabled = true;
+                    setMsg("车辆两次称点区域不同");
+                    return;
+                }
+
                 //2021年6月22日 存在需要复磅的数据,不允许进行保存操作
                 //2021年6月22日 存在需要复磅的数据,不允许进行保存操作
                 recoverInfo.ValidAllowSave(PbCache.lockCarNo);
                 recoverInfo.ValidAllowSave(PbCache.lockCarNo);
                 if (PbCache.isAllowRecover)
                 if (PbCache.isAllowRecover)
@@ -269,201 +295,245 @@ namespace CarMeterSystem
                     //}
                     //}
 
 
                     #region 酒钢业务流程判断
                     #region 酒钢业务流程判断
-                    // 把车号加上-
-                    string tempCarNo = PbCache.lockCarNo;
-                    RESTfulResult<List<MeterBaseCar>> resCarList = carService.doQueryCarList(new MeterBaseCar { carNo = tempCarNo });
-                    RESTfulResult<rtInfo> strRm = new RESTfulResult<rtInfo>();
-                    if (resCarList.Succeed)
+                    if (isCompare)
                     {
                     {
-                        if (resCarList.Data != null && resCarList.Data.Count == 1)
+                        ExecuteMethod em = new ExecuteMethod();
+                        RESTfulResult<rtInfo> strRm = new RESTfulResult<rtInfo>();
+                        try
                         {
                         {
-                            MeterBaseCar car = resCarList.Data[0];
+                            btnSave.Enabled = false;
+                            strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "compare", "MeterMethod", new object[] { new PreTrackScale { } });
+                            setMsg(strRm.ResultMessage);
+                            strMsg = strRm.ResultMessage;
+                            if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                            {
+                                led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                            }
+                        }
+                        catch (Exception exp)
+                        {
+                            PbCache.ResultMessage = "获取计量场景信息失败,请点击语音求助";
+                            //这里是未找到方法的情况
+                            lg.WriteLog(3, "获取场景失败!" + strRm.ResultMessage);
+                            setMsg(PbCache.ResultMessage);
+                            if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                            {
+                                led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                            }
+                            //break;
+                            return;
+                        }
+                    }
+                    else
+                    {
+                        // 把车号加上-
+                        string tempCarNo = PbCache.lockCarNo;
+                        RESTfulResult<List<MeterBaseCar>> resCarList = carService.doQueryCarList(new MeterBaseCar { carNo = tempCarNo });
+                        RESTfulResult<rtInfo> strRm = new RESTfulResult<rtInfo>();
+                        if (resCarList.Succeed)
+                        {
+                            if (resCarList.Data != null && resCarList.Data.Count == 1)
+                            {
+                                MeterBaseCar car = resCarList.Data[0];
 
 
-                            ExecuteMethod em = new ExecuteMethod();
+                                ExecuteMethod em = new ExecuteMethod();
 
 
+                                //判断是否为外发试验性称量,预防超载或欠载(不算正常计量)(吉瑞、铁合金车辆)
+                                bool isjT = false;
 
 
-                            // 厂内车辆
-                            if (car.carTypeNo == "001004003")
-                            {
-                                try
+                                if (car.belongUnitTypeNo == "000000" || car.belongUnitTypeNo == "000001")
                                 {
                                 {
-                                    btnSave.Enabled = false;
-                                    strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "InnerCarJISCO", "MeterMethod", new object[] { new PreTrackScale { } });
-                                    if (PbCache.ResultMessage != "")
+                                    isjT = true;
+                                }
+                                // 厂内车辆
+                                if (car.carTypeNo == "001004003" || isjT)
+                                {
+                                    try
                                     {
                                     {
-
+                                        btnSave.Enabled = false;
+                                        if (isjT)
+                                        {
+                                            strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "InnerCarJISCO", "MeterMethod", new object[] { new PreTrackScale { carNo = PbCache.lockCarNo } });
+                                        }
+                                        else
+                                        {
+                                            strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "InnerCarJISCO", "MeterMethod", new object[] { new PreTrackScale { } });
+                                        }
+                                        setMsg(strRm.ResultMessage);
+                                        strMsg = strRm.ResultMessage;
+                                        if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                        {
+                                            led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        }
                                     }
                                     }
-                                    setMsg(strRm.ResultMessage);
-                                    if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                    catch (Exception exp)
                                     {
                                     {
-                                        led_controler.setStatic4LineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        PbCache.ResultMessage = "获取计量场景信息失败,请点击语音求助";
+                                        //这里是未找到方法的情况
+                                        lg.WriteLog(3, "获取场景失败!" + strRm.ResultMessage);
+                                        setMsg(PbCache.ResultMessage);
+                                        if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                        {
+                                            led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        }
+                                        //break;
+                                        return;
                                     }
                                     }
                                 }
                                 }
-                                catch (Exception exp)
+                                // 厂外车辆
+                                else if (car.carTypeNo == "001004002" && !isjT)
                                 {
                                 {
-                                    PbCache.ResultMessage = "获取计量场景信息失败,请点击语音求助";
-                                    //这里是未找到方法的情况
-                                    lg.WriteLog(3, "获取场景失败!" + strRm.ResultMessage);
-                                    setMsg(PbCache.ResultMessage);
-                                    if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                    try
                                     {
                                     {
-                                        led_controler.setStatic4LineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        btnSave.Enabled = false;
+                                        strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "OuterCarJISCO", "MeterMethod", new object[] { new PreTrackScale { } });
+                                        setMsg(strRm.ResultMessage);
+                                        strMsg = strRm.ResultMessage;
+                                        if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                        {
+                                            led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        }
                                     }
                                     }
-                                    //break;
-                                    return;
-                                }
-                            }
-                            // 厂外车辆
-                            else if (car.carTypeNo == "001004002")
-                            {
-                                try
-                                {
-                                    btnSave.Enabled = false;
-                                    strRm = em.GetAndExecuteMethod<rtInfo>("MeterSceneLibrary", "OuterCarJISCO", "MeterMethod", new object[] { new PreTrackScale { } });
-                                    setMsg(strRm.ResultMessage);
-                                    if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                    catch (Exception exp)
                                     {
                                     {
-                                        led_controler.setStatic4LineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        PbCache.ResultMessage = "获取计量场景信息失败,请点击语音求助";
+                                        //这里是未找到方法的情况
+                                        lg.WriteLog(3, "获取场景失败!" + strRm.ResultMessage);
+                                        setMsg(PbCache.ResultMessage);
+                                        if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                        {
+                                            led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        }
+                                        //break;
+                                        return;
                                     }
                                     }
                                 }
                                 }
-                                catch (Exception exp)
+
+                                if (strRm.Succeed)
                                 {
                                 {
-                                    PbCache.ResultMessage = "获取计量场景信息失败,请点击语音求助";
-                                    //这里是未找到方法的情况
-                                    lg.WriteLog(3, "获取场景失败!" + strRm.ResultMessage);
-                                    setMsg(PbCache.ResultMessage);
-                                    if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                    if (strRm.Data.isError)
                                     {
                                     {
-                                        led_controler.setStatic4LineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        //如果是报错则直接不执行,并写入信息到界面,同时调用语音播报
+                                        vicPlayClass.GetVoicePlay("计量数据保存失败", PbCache.collect.carno);
+                                        PbCache.ResultMessage = strRm.Data.resultInfo;
+                                        PbCache.monitorResultMessage = strRm.Data.resultInfo;
+                                        PbCache.isLockFrm = false;
+                                        btnSave.Enabled = true;
+                                        setMsg(PbCache.ResultMessage);
+                                        Monitor(strRm.Data);
+                                        if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                        {
+                                            led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        }
+                                        return;
                                     }
                                     }
-                                    //break;
-                                    return;
-                                }
-                            }
 
 
-                            if (strRm.Succeed)
-                            {
-                                if (strRm.Data.isError)
+                                    if (strRm.Data.result) //说明:标识当前跑了一个场景成功了;场景完成后则返回,不再进行下一个场景的执行操作;
+                                    {
+                                        PbCache.ResultMessage = strRm.Data.resultInfo; //语音提示文件
+                                        setMsg(PbCache.ResultMessage);
+                                        Monitor(strRm.Data);
+                                        if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                        {
+                                            led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        }
+                                        //return;
+                                    }
+                                    else
+                                    {
+                                        //说明:不满足场景的的要求,不能进行return,继续下一个场景,若所有的场景都失败,则提示“未找到计量场景配置信息” 
+                                        //ResultMessage = strRm.Data.resultInfo;
+                                        //return strRm.Data.result;  //2021-3-18 杨秀东注释;要处理一车联运(多场景)的数据;问题:提示信息会出现问题
+                                    }
+                                }
+                                else
                                 {
                                 {
-                                    //如果是报错则直接不执行,并写入信息到界面,同时调用语音播报
                                     vicPlayClass.GetVoicePlay("计量数据保存失败", PbCache.collect.carno);
                                     vicPlayClass.GetVoicePlay("计量数据保存失败", PbCache.collect.carno);
-                                    PbCache.ResultMessage = strRm.Data.resultInfo;
-                                    PbCache.monitorResultMessage = strRm.Data.resultInfo;
+                                    PbCache.ResultMessage = strRm.ResultMessage;
                                     PbCache.isLockFrm = false;
                                     PbCache.isLockFrm = false;
                                     btnSave.Enabled = true;
                                     btnSave.Enabled = true;
                                     setMsg(PbCache.ResultMessage);
                                     setMsg(PbCache.ResultMessage);
+
+                                    // todo:更新监控表,此秤点求助状态为求助中
+                                    if (PbCache.monitor.isHelp == "0")
+                                    {
+                                        RESTfulResult<string> rms = monitor.doUpdateWf(new MeterWorkMonitor { pointNo = PbCache.sportInfo.baseSpotNo, isHelp = "1" });
+                                        if (!rms.Succeed)
+                                        {
+                                            lg.WriteLog(3, PbCache.lockCarNo + "求助写入失败");
+                                        }
+                                    }
                                     Monitor(strRm.Data);
                                     Monitor(strRm.Data);
                                     if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
                                     if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
                                     {
                                     {
-                                        led_controler.setStatic4LineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                        led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
                                     }
                                     }
                                     return;
                                     return;
-                                }
 
 
-                                if (strRm.Data.result) //说明:标识当前跑了一个场景成功了;场景完成后则返回,不再进行下一个场景的执行操作;
+                                }
+                            }
+                            else
+                            {
+                                if (string.IsNullOrEmpty(tempCarNo))
                                 {
                                 {
-                                    PbCache.ResultMessage = strRm.Data.resultInfo; //语音提示文件
-                                    setMsg(PbCache.ResultMessage);
-                                    Monitor(strRm.Data);
-                                    if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
-                                    {
-                                        led_controler.setStatic4LineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
-                                    }
-                                    //return;
+                                    PbCache.ResultMessage += "车号为空,请联系处理";
+                                    PbCache.monitorResultMessage = "车号为空,请联系处理";
                                 }
                                 }
                                 else
                                 else
                                 {
                                 {
-                                    //说明:不满足场景的的要求,不能进行return,继续下一个场景,若所有的场景都失败,则提示“未找到计量场景配置信息” 
-                                    //ResultMessage = strRm.Data.resultInfo;
-                                    //return strRm.Data.result;  //2021-3-18 杨秀东注释;要处理一车联运(多场景)的数据;问题:提示信息会出现问题
+                                    PbCache.ResultMessage += "车号未注册,请联系处理";
+                                    PbCache.monitorResultMessage = "车号未注册,请联系处理";
                                 }
                                 }
-                            }
-                            else
-                            {
-                                vicPlayClass.GetVoicePlay("计量数据保存失败", PbCache.collect.carno);
-                                PbCache.ResultMessage = strRm.ResultMessage;
                                 PbCache.isLockFrm = false;
                                 PbCache.isLockFrm = false;
                                 btnSave.Enabled = true;
                                 btnSave.Enabled = true;
-                                setMsg(PbCache.ResultMessage);
 
 
-                                // todo:更新监控表,此秤点求助状态为求助中
-                                if (PbCache.monitor.isHelp == "0")
+                                setMsg(PbCache.ResultMessage);
+                                rtInfo rt = new rtInfo();
+                                rt.isWarn = true;
+                                rt.WarnContent = "carErr";
+                                Monitor(rt);
+                                if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
                                 {
                                 {
-                                    RESTfulResult<string> rms = monitor.doUpdateWf(new MeterWorkMonitor { pointNo = PbCache.sportInfo.baseSpotNo, isHelp = "1" });
-                                    if (!rms.Succeed)
-                                    {
-                                        lg.WriteLog(3, PbCache.lockCarNo + "求助写入失败");
-                                    }
+                                    led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
                                 }
                                 }
-                                Monitor(strRm.Data);
-                                if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                                if (!string.IsNullOrEmpty(tempCarNo))
                                 {
                                 {
-                                    led_controler.setStatic4LineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                    carService.addCar(new MeterBaseCar { carNo = tempCarNo, carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
                                 }
                                 }
                                 return;
                                 return;
-
-                            }
-                        }
-                        else
-                        {
-                            if (string.IsNullOrEmpty(tempCarNo))
-                            {
-                                PbCache.ResultMessage += "车号为空,请联系处理";
-                                PbCache.monitorResultMessage = "车号为空,请联系处理";
                             }
                             }
-                            else
-                            {
-                                PbCache.ResultMessage += "车号未注册,请联系处理";
-                                PbCache.monitorResultMessage = "车号未注册,请联系处理";
-                            }
-                            PbCache.isLockFrm = false;
-                            btnSave.Enabled = true;
-                            
-                            setMsg(PbCache.ResultMessage);
-                            rtInfo rt = new rtInfo();
-                            rt.isWarn = true;
-                            rt.WarnContent = "carErr";
-                            Monitor(rt);
-                            if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
-                            {
-                                led_controler.setStatic4LineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
-                            }
-                            if (!string.IsNullOrEmpty(tempCarNo))
-                            {
-                                carService.addCar(new MeterBaseCar { carNo = tempCarNo,carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
-                            }
-                            return;
                         }
                         }
+                        #endregion
                     }
                     }
-                    #endregion
+
 
 
                     #region 期限皮显示及保存
                     #region 期限皮显示及保存
 
 
-                    //留期限皮提醒
-                    string sql = @"select base_spot_no   baseSpotNo,
-                                       base_spot_name baseSpotName,
-                                       warn_time      warnTime,
-                                       end_time    endTime,
-                                       car_no         carNo
-                                  from Meter_Base_Term_Tare_Data
-                                  where car_no='" + PbCache.lockCarNo + "' and value_flag='0' order by METER_TIME desc ";
-                    PbModelDbService<List<MeterBaseTermTareData>> pbModelDbService = new PbModelDbService<List<MeterBaseTermTareData>>();
-                    RESTfulResult<List<MeterBaseTermTareData>> rES = pbModelDbService.executeSqlDataWf(sql);
-
-                    if (rES.Succeed)
-                    {
-                        if (rES.Data != null && rES.Data.Count > 0)
-                        {
-                            if (DateTime.Now.CompareTo(rES.Data[0].endTime) >= 0)
-                            {
-                                PbCache.ResultMessage += "\n\r提醒:期限皮重已过期,请及时留期限皮";
-                            }
-                            else if (DateTime.Now.CompareTo(rES.Data[0].warnTime) >= 0)
-                            {
-                                PbCache.ResultMessage += "\n\r提醒:期限皮重将要过期,请及时留期限皮";
-                            }
-                        }
-                    }
+                    ////留期限皮提醒
+                    //string sql = @"select base_spot_no   baseSpotNo,
+                    //                   base_spot_name baseSpotName,
+                    //                   warn_time      warnTime,
+                    //                   end_time    endTime,
+                    //                   car_no         carNo
+                    //              from Meter_Base_Term_Tare_Data
+                    //              where car_no='" + PbCache.lockCarNo + "' and value_flag='0' order by METER_TIME desc ";
+                    //PbModelDbService<List<MeterBaseTermTareData>> pbModelDbService = new PbModelDbService<List<MeterBaseTermTareData>>();
+                    //RESTfulResult<List<MeterBaseTermTareData>> rES = pbModelDbService.executeSqlDataWf(sql);
+
+                    //if (rES.Succeed)
+                    //{
+                    //    if (rES.Data != null && rES.Data.Count > 0)
+                    //    {
+                    //        if (DateTime.Now.CompareTo(rES.Data[0].endTime) >= 0)
+                    //        {
+                    //            PbCache.ResultMessage += "\n\r提醒:期限皮重已过期,请及时留期限皮";
+                    //        }
+                    //        else if (DateTime.Now.CompareTo(rES.Data[0].warnTime) >= 0)
+                    //        {
+                    //            PbCache.ResultMessage += "\n\r提醒:期限皮重将要过期,请及时留期限皮";
+                    //        }
+                    //    }
+                    //}
 
 
                     //语音提醒部分
                     //语音提醒部分
                     //flag =true表示称重成功
                     //flag =true表示称重成功
@@ -502,6 +572,21 @@ namespace CarMeterSystem
                     //
                     //
                     #endregion 期限皮显示及保存
                     #endregion 期限皮显示及保存
 
 
+                    #region 求助写入
+
+                    if (PbCache.monitorResultMessage != "")
+                    {
+                        MeterWorkScheduledHelp meterWorkScheduledHelp = new MeterWorkScheduledHelp();
+                        meterWorkScheduledHelp.baseSpotNo = PbCache.sportInfo.baseSpotNo;
+                        meterWorkScheduledHelp.baseSpotName = PbCache.sportInfo.baseSpotName;
+                        meterWorkScheduledHelp.carNo = PbCache.collect.carno;
+                        meterWorkScheduledHelp.helpContent = PbCache.monitorResultMessage;
+                        meterWorkScheduledHelp.warnType = "2";
+                        meterWorkScheduledHelp.warnTypeName = "智能终端报警";
+                        meterWorkScheduledHelpService.add(meterWorkScheduledHelp);
+                    }
+
+                    #endregion
 
 
                     #region LED写入
                     #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 : "");
@@ -656,6 +741,18 @@ namespace CarMeterSystem
                         this.Close();
                         this.Close();
                     }
                     }
 
 
+                    if (PbCache.collect.parkStatus == 3)
+                    {
+                        MeterWorkScheduledHelp meterWorkScheduledHelp = new MeterWorkScheduledHelp();
+                        meterWorkScheduledHelp.baseSpotNo = PbCache.sportInfo.baseSpotNo;
+                        meterWorkScheduledHelp.baseSpotName = PbCache.sportInfo.baseSpotName;
+                        meterWorkScheduledHelp.carNo = PbCache.collect.carno;
+                        meterWorkScheduledHelp.helpContent = "疑似跟车,请核查";
+                        meterWorkScheduledHelp.warnType = "3";
+                        meterWorkScheduledHelp.warnTypeName = "智能终端报警";
+                        meterWorkScheduledHelpService.add(meterWorkScheduledHelp);
+                    }
+
                     #region 0.接受远程修改过后的车号并显示
                     #region 0.接受远程修改过后的车号并显示
                     //if (PbCache.monitor != null && !string.IsNullOrEmpty(PbCache.monitor.editCar))
                     //if (PbCache.monitor != null && !string.IsNullOrEmpty(PbCache.monitor.editCar))
                     //{
                     //{
@@ -847,15 +944,15 @@ namespace CarMeterSystem
                 #endregion 红外对射及量程验证及停留超时验证
                 #endregion 红外对射及量程验证及停留超时验证
 
 
 
 
-                #region 查一次是否校秤,若未校秤则不能计量
+                    #region 查一次是否校秤,若未校秤则不能计量
 
 
-                //*
-                if (bRelation)
-                    {
-                        string msgInfo = "";
-                        isCalibration = vCalib.ValidMethod(new MeterWorkCalibrationMain { baseSpotNo = PbCache.sportInfo.baseSpotNo, valueFlag = "2" }, out msgInfo);
-                        bRelation = false;
-                    }
+                    //*
+                    if (bRelation)
+                        {
+                            string msgInfo = "";
+                            isCalibration = vCalib.ValidMethod(new MeterWorkCalibrationMain { baseSpotNo = PbCache.sportInfo.baseSpotNo, valueFlag = "2" }, out msgInfo);
+                            bRelation = false;
+                        }
 
 
                     if (!isCalibration)
                     if (!isCalibration)
                     {
                     {
@@ -891,145 +988,160 @@ namespace CarMeterSystem
                         isShowRecover = false;
                         isShowRecover = false;
                     }
                     }
 
 
+                #endregion 判断是否需要复磅
+
+                    #region 判断区域是否正确
+
+                    //if (PbCache.monitor.validArea == "1")
+                    //{
+                    //    if (areaInfo.ValidMethod(PbCache.sportInfo, txtCarNo.Text))
+                    //    {
+                    //        btnSave.Enabled = true;
+                    //    }
+                    //    else
+                    //    {
+                    //        btnSave.Enabled = false;
+                    //    }
+                    //}
                     #endregion 判断是否需要复磅
                     #endregion 判断是否需要复磅
 
 
                     #region 第一次查询,有车号,重量稳定,红外验证通过的情况只查一次
                     #region 第一次查询,有车号,重量稳定,红外验证通过的情况只查一次
 
 
                     //如果没有查过一次,且扫描到车号信息,且重量稳定
                     //如果没有查过一次,且扫描到车号信息,且重量稳定
                     if ((bRailwayActual || sPreCarNo != TrackCarNo || firstCode != PbCache.strCode) && PbCache.collect.weightStatus == 0 && PbCache.monitorResult.valid_park_status)
                     if ((bRailwayActual || sPreCarNo != TrackCarNo || firstCode != PbCache.strCode) && PbCache.collect.weightStatus == 0 && PbCache.monitorResult.valid_park_status)
-                    {
-                        firstWgt = 0;
-                        sPreCarNo = TrackCarNo;
-                        //判断车辆是厂内车还是厂外车
-                        RESTfulResult<List<MeterBaseCar>> resCarList = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.collect.carno });
-                        if (resCarList.Succeed)
                         {
                         {
-                            if (resCarList.Data != null && resCarList.Data.Count == 1)
+                            firstWgt = 0;
+                            sPreCarNo = TrackCarNo;
+                            //判断车辆是厂内车还是厂外车
+                            RESTfulResult<List<MeterBaseCar>> resCarList = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.collect.carno });
+                            if (resCarList.Succeed)
                             {
                             {
-                                MeterBaseCar car = resCarList.Data[0];
-                                //厂内车辆
-                                if (car.carTypeNo == "001004003")
+                                if (resCarList.Data != null && resCarList.Data.Count == 1)
                                 {
                                 {
-                                    RESTfulResult<List<PreTrackScale>> rmScale = PreTrackScaleService.doQueryByFlag(new PreTrackScale { carNo = PbCache.collect.carno, lineDesc = "1" });
-
-                                    if (rmScale.Succeed)
+                                    MeterBaseCar car = resCarList.Data[0];
+                                    //厂内车辆
+                                    if (car.carTypeNo == "001004003")
                                     {
                                     {
-                                        if (rmScale.Data != null && rmScale.Data.Count == 1)
+                                        RESTfulResult<List<PreTrackScale>> rmScale = PreTrackScaleService.doQueryByFlag(new PreTrackScale { carNo = PbCache.collect.carno, lineDesc = "1" });
+
+                                        if (rmScale.Succeed)
                                         {
                                         {
-                                            MeterWorkCarActualFirst actualFirst = new MeterWorkCarActualFirst();
+                                            if (rmScale.Data != null && rmScale.Data.Count == 1)
+                                            {
+                                                MeterWorkCarActualFirst actualFirst = new MeterWorkCarActualFirst();
 
 
-                                            firstWgt = rmScale.Data[0].meterWeight == null ? 0 : rmScale.Data[0].meterWeight.Value;
+                                                firstWgt = rmScale.Data[0].meterWeight == null ? 0 : rmScale.Data[0].meterWeight.Value;
 
 
-                                            EntityBase<PreTrackScale> entityBase1 = new EntityBase<PreTrackScale>();
-                                            actualFirst = entityBase1.format<MeterWorkCarActualFirst>(rmScale.Data[0], actualFirst);
+                                                EntityBase<PreTrackScale> entityBase1 = new EntityBase<PreTrackScale>();
+                                                actualFirst = entityBase1.format<MeterWorkCarActualFirst>(rmScale.Data[0], actualFirst);
 
 
-                                            actualFirst.predictionNo = actualFirst.predictionNo.Replace("_", "");
-                                            //给用户控件设置值
-                                            ucCarMeterInfoJisco1.setFormControlValue(actualFirst);
+                                                actualFirst.predictionNo = actualFirst.predictionNo.Replace("_", "");
+                                                //给用户控件设置值
+                                                ucCarMeterInfoJisco1.setFormControlValue(actualFirst);
+                                            }
                                         }
                                         }
+                                        bRailwayActual = false;
                                     }
                                     }
-                                    bRailwayActual = false;
-                                }
-                                //厂外车辆
-                                else if (car.carTypeNo == "001004002")
-                                {
-                                    #region 查询一次计量表中是否存在一条未结净的数据,非一车联运情况扫码两次,一车联运的话
-
-                                    RESTfulResult<List<MeterWorkCarActualFirst>> RESTfulResult = workCarActualFirstService.doQueryWf(new MeterWorkCarActualFirst { carNo = PbCache.collect.carno, valueFlag = "1" });
-                                    if (RESTfulResult.Succeed)
+                                    //厂外车辆
+                                    else if (car.carTypeNo == "001004002")
                                     {
                                     {
-                                        if (RESTfulResult.Data != null && RESTfulResult.Data.Count > 0)
+                                        #region 查询一次计量表中是否存在一条未结净的数据,非一车联运情况扫码两次,一车联运的话
+
+                                        RESTfulResult<List<MeterWorkCarActualFirst>> RESTfulResult = workCarActualFirstService.doQueryWf(new MeterWorkCarActualFirst { carNo = PbCache.collect.carno, valueFlag = "1" });
+                                        if (RESTfulResult.Succeed)
                                         {
                                         {
-                                            if (PbCache.sportInfo.baseSpotNo == lianDaPointNo)
+                                            if (RESTfulResult.Data != null && RESTfulResult.Data.Count > 0)
                                             {
                                             {
-                                                bool flag = false;
-                                                foreach (MeterWorkCarActualFirst fs in RESTfulResult.Data)
+                                                if (PbCache.sportInfo.baseSpotNo == lianDaPointNo)
                                                 {
                                                 {
-                                                    //联达磅过的联达物料
-                                                    if (fs.predictionNo.Contains("_"))
+                                                    bool flag = false;
+                                                    foreach (MeterWorkCarActualFirst fs in RESTfulResult.Data)
                                                     {
                                                     {
-                                                        firstWgt = fs.meterWeight.Value;
-                                                        firstDb = fs;
-                                                        firstDb.predictionNo = firstDb.predictionNo.Replace("_", "");
-                                                        //给用户控件设置值
-                                                        ucCarMeterInfoJisco1.setFormControlValue(firstDb);
-                                                        flag = true;
-                                                        break;
+                                                        //联达磅过的联达物料
+                                                        if (fs.predictionNo.Contains("_"))
+                                                        {
+                                                            firstWgt = fs.meterWeight.Value;
+                                                            firstDb = fs;
+                                                            firstDb.predictionNo = firstDb.predictionNo.Replace("_", "");
+                                                            //给用户控件设置值
+                                                            ucCarMeterInfoJisco1.setFormControlValue(firstDb);
+                                                            flag = true;
+                                                            break;
+                                                        }
                                                     }
                                                     }
-                                                }
-                                                if (!flag)
-                                                {
-                                                    firstWgt = RESTfulResult.Data[0].meterWeight.Value;
-                                                    firstDb = RESTfulResult.Data[0];
-                                                    firstDb.predictionNo = firstDb.predictionNo.Replace("_", "");
-                                                    //给用户控件设置值
-                                                    ucCarMeterInfoJisco1.setFormControlValue(firstDb);
-                                                }
-                                            }
-                                            else
-                                            {
-                                                foreach (MeterWorkCarActualFirst fs in RESTfulResult.Data)
-                                                {
-                                                    if (fs.predictionNo != null && !fs.predictionNo.Contains("_"))
+                                                    if (!flag)
                                                     {
                                                     {
                                                         firstWgt = RESTfulResult.Data[0].meterWeight.Value;
                                                         firstWgt = RESTfulResult.Data[0].meterWeight.Value;
                                                         firstDb = RESTfulResult.Data[0];
                                                         firstDb = RESTfulResult.Data[0];
                                                         firstDb.predictionNo = firstDb.predictionNo.Replace("_", "");
                                                         firstDb.predictionNo = firstDb.predictionNo.Replace("_", "");
                                                         //给用户控件设置值
                                                         //给用户控件设置值
                                                         ucCarMeterInfoJisco1.setFormControlValue(firstDb);
                                                         ucCarMeterInfoJisco1.setFormControlValue(firstDb);
-                                                        break;
+                                                    }
+                                                }
+                                                else
+                                                {
+                                                    foreach (MeterWorkCarActualFirst fs in RESTfulResult.Data)
+                                                    {
+                                                        if (fs.predictionNo != null && !fs.predictionNo.Contains("_"))
+                                                        {
+                                                            firstWgt = RESTfulResult.Data[0].meterWeight.Value;
+                                                            firstDb = RESTfulResult.Data[0];
+                                                            firstDb.predictionNo = firstDb.predictionNo.Replace("_", "");
+                                                            //给用户控件设置值
+                                                            ucCarMeterInfoJisco1.setFormControlValue(firstDb);
+                                                            break;
+                                                        }
                                                     }
                                                     }
                                                 }
                                                 }
                                             }
                                             }
                                         }
                                         }
+                                        #endregion
+                                        bRailwayActual = false;
                                     }
                                     }
-                                    #endregion
-                                    bRailwayActual = false;
-                                }
-                            }
-                            else
-                            {
-                                if (string.IsNullOrEmpty(PbCache.collect.carno))
-                                {
-                                    txtMsgInfo.Text  = "车号为空,请联系处理";
-                                    PbCache.monitorResultMessage = "车号为空,请联系处理";
                                 }
                                 }
                                 else
                                 else
                                 {
                                 {
-                                    txtMsgInfo.Text  = "车号未注册,请联系处理";
-                                    PbCache.monitorResultMessage = "车号未注册,请联系处理";
-                                }
-                                PbCache.isLockFrm = false;
-                                btnSave.Enabled = true;
+                                    if (string.IsNullOrEmpty(PbCache.collect.carno))
+                                    {
+                                        txtMsgInfo.Text  = "车号为空,请联系处理";
+                                        PbCache.monitorResultMessage = "车号为空,请联系处理";
+                                    }
+                                    else
+                                    {
+                                        txtMsgInfo.Text  = "车号未注册,请联系处理";
+                                        PbCache.monitorResultMessage = "车号未注册,请联系处理";
+                                    }
+                                    PbCache.isLockFrm = false;
+                                    btnSave.Enabled = true;
                                 
                                 
-                                rtInfo rt = new rtInfo();
-                                rt.isWarn = true;
-                                rt.WarnContent = "carErr";
-                                Monitor(rt);
+                                    rtInfo rt = new rtInfo();
+                                    rt.isWarn = true;
+                                    rt.WarnContent = "carErr";
+                                    Monitor(rt);
 
 
-                                if (!string.IsNullOrEmpty(PbCache.collect.carno))
-                                {
-                                    carService.addCar(new MeterBaseCar { carNo = PbCache.collect.carno, carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
+                                    if (!string.IsNullOrEmpty(PbCache.collect.carno))
+                                    {
+                                        carService.addCar(new MeterBaseCar { carNo = PbCache.collect.carno, carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
+                                    }
+                                    return;
                                 }
                                 }
-                                return;
                             }
                             }
-                        }
-                        #region 查一次是否可留期限皮,可以则显示按钮
+                            #region 查一次是否可留期限皮,可以则显示按钮
 
 
-                        PbCache.lockWgt = PbCache.collect.weight;
+                            PbCache.lockWgt = PbCache.collect.weight;
 
 
-                        //2021年3月15日 期限皮重显示按钮的显示方法修改 isShowBtnTare   ValidMethod
-                        if (termTareCar.isShowBtnTare(TrackCarNo))
-                        {
-                            lg.WriteLog(3, string.Format("9车辆[{0}进入期限皮重显示按钮的显示判断", TrackCarNo));
-                            btnTare.Visible = true;
-                        }
-                        //
+                            //2021年3月15日 期限皮重显示按钮的显示方法修改 isShowBtnTare   ValidMethod
+                            if (termTareCar.isShowBtnTare(TrackCarNo))
+                            {
+                                lg.WriteLog(3, string.Format("9车辆[{0}进入期限皮重显示按钮的显示判断", TrackCarNo));
+                                btnTare.Visible = true;
+                            }
+                            //
 
 
-                        #endregion 查一次是否可留期限皮,可以则显示按钮
-                    }
+                            #endregion 查一次是否可留期限皮,可以则显示按钮
+                        }
 
 
-                    #endregion 第一次查询,有车号,重量稳定,红外验证通过的情况只查一次
+                        #endregion 第一次查询,有车号,重量稳定,红外验证通过的情况只查一次
 
 
 
 
                     #region 毛皮净赋值;存在一次重量firstWgt的情况下才赋值毛皮净重
                     #region 毛皮净赋值;存在一次重量firstWgt的情况下才赋值毛皮净重
@@ -1072,14 +1184,14 @@ namespace CarMeterSystem
                                 isVoiceDownCar = true;
                                 isVoiceDownCar = true;
                                 vicPlayClass.GetVoicePlay("车上人员请下车", PbCache.collect.carno);
                                 vicPlayClass.GetVoicePlay("车上人员请下车", PbCache.collect.carno);
                                 //txtMsgInfo.Text = "请核对车号后,扫描您手机中的二维码";
                                 //txtMsgInfo.Text = "请核对车号后,扫描您手机中的二维码";
-                                }
+                             }
                             // 如果计量点配置中,设置了秤点计量类型为智能计量(下秤),验证扫码信息是否与识别车号一致。
                             // 如果计量点配置中,设置了秤点计量类型为智能计量(下秤),验证扫码信息是否与识别车号一致。
                             // 如果为是,自动保存
                             // 如果为是,自动保存
                             //3秒后自动执行保存方法
                             //3秒后自动执行保存方法
-                            Thread.Sleep(3000);
-                            this.btnSave.PerformClick();
+                            //Thread.Sleep(3000);
+                            //this.btnSave.PerformClick();
 
 
-                        }
+                         }
                         else if (PbCache.monitor.validMatClick == "0")
                         else if (PbCache.monitor.validMatClick == "0")
                         {
                         {
                             //已锁定 && !PbCache.isLockFrm 
                             //已锁定 && !PbCache.isLockFrm 

+ 6 - 0
Common/Common.csproj

@@ -96,12 +96,15 @@
     <Compile Include="DbOption\base\MeterBaseUnitInfoService.cs" />
     <Compile Include="DbOption\base\MeterBaseUnitInfoService.cs" />
     <Compile Include="DbOption\scale\PreBeltScalePreService.cs" />
     <Compile Include="DbOption\scale\PreBeltScalePreService.cs" />
     <Compile Include="DbOption\scale\PreTrackNoticeService.cs" />
     <Compile Include="DbOption\scale\PreTrackNoticeService.cs" />
+    <Compile Include="DbOption\work\MeterWorkCompareSpotScaleService.cs" />
+    <Compile Include="DbOption\work\MeterWorkCompareSpotService.cs" />
     <Compile Include="DbOption\work\MeterWorkBeltActualService.cs" />
     <Compile Include="DbOption\work\MeterWorkBeltActualService.cs" />
     <Compile Include="DbOption\work\MeterWorkBeltXiaopiService.cs" />
     <Compile Include="DbOption\work\MeterWorkBeltXiaopiService.cs" />
     <Compile Include="DbOption\work\MeterWorkBeltTimingService.cs" />
     <Compile Include="DbOption\work\MeterWorkBeltTimingService.cs" />
     <Compile Include="DbOption\work\MeterWorkPreWgttypeService.cs" />
     <Compile Include="DbOption\work\MeterWorkPreWgttypeService.cs" />
     <Compile Include="DbOption\work\MeterWorkRailwayMotorialReceivedService.cs" />
     <Compile Include="DbOption\work\MeterWorkRailwayMotorialReceivedService.cs" />
     <Compile Include="DbOption\work\MeterWorkRailwayRecMainService.cs" />
     <Compile Include="DbOption\work\MeterWorkRailwayRecMainService.cs" />
+    <Compile Include="DbOption\work\MeterWorkScheduledHelpService.cs" />
     <Compile Include="DbOption\work\MeterWorkStorageCalibrationService.cs" />
     <Compile Include="DbOption\work\MeterWorkStorageCalibrationService.cs" />
     <Compile Include="DbOption\scale\PreStorageScalePreService.cs" />
     <Compile Include="DbOption\scale\PreStorageScalePreService.cs" />
     <Compile Include="DbOption\scale\PreTrackTemEntrustService.cs" />
     <Compile Include="DbOption\scale\PreTrackTemEntrustService.cs" />
@@ -126,11 +129,14 @@
     <Compile Include="vo\pb\CraneScaleCollectModel.cs" />
     <Compile Include="vo\pb\CraneScaleCollectModel.cs" />
     <Compile Include="vo\scale\PreBeltScaleForecast.cs" />
     <Compile Include="vo\scale\PreBeltScaleForecast.cs" />
     <Compile Include="vo\scale\PreTrackNotice.cs" />
     <Compile Include="vo\scale\PreTrackNotice.cs" />
+    <Compile Include="vo\work\MeterWorkCompareSpot.cs" />
+    <Compile Include="vo\work\MeterWorkCompareSpotSacle.cs" />
     <Compile Include="vo\work\MeterWorkBeltActual.cs" />
     <Compile Include="vo\work\MeterWorkBeltActual.cs" />
     <Compile Include="vo\work\MeterWorkBeltXiaopi.cs" />
     <Compile Include="vo\work\MeterWorkBeltXiaopi.cs" />
     <Compile Include="vo\work\MeterWorkBeltTiminginfo.cs" />
     <Compile Include="vo\work\MeterWorkBeltTiminginfo.cs" />
     <Compile Include="vo\work\MeterWorkCraneActual.cs" />
     <Compile Include="vo\work\MeterWorkCraneActual.cs" />
     <Compile Include="vo\work\MeterWorkPreWgttype.cs" />
     <Compile Include="vo\work\MeterWorkPreWgttype.cs" />
+    <Compile Include="vo\work\MeterWorkScheduledHelp.cs" />
     <Compile Include="vo\work\MeterWorkStorageCalibration.cs" />
     <Compile Include="vo\work\MeterWorkStorageCalibration.cs" />
     <Compile Include="vo\work\MeterWorkStorageSingleWgt.cs" />
     <Compile Include="vo\work\MeterWorkStorageSingleWgt.cs" />
     <Compile Include="vo\base\MeterBaseCarModify.cs" />
     <Compile Include="vo\base\MeterBaseCarModify.cs" />

+ 1 - 1
Common/DbOption/work/MeterWorkCarActualService.cs

@@ -250,7 +250,7 @@ namespace Common
         }
         }
 
 
         /// <summary>
         /// <summary>
-        /// 双委托逻辑
+        /// 期限皮逻辑
         /// </summary>
         /// </summary>
         /// <param name="scale">List<PreTrackScale></param>
         /// <param name="scale">List<PreTrackScale></param>
         /// <param name="actualFirst">一次计量数据</param>
         /// <param name="actualFirst">一次计量数据</param>

+ 35 - 0
Common/DbOption/work/MeterWorkCompareSpotScaleService.cs

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

+ 81 - 0
Common/DbOption/work/MeterWorkCompareSpotService.cs

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

+ 19 - 0
Common/DbOption/work/MeterWorkScheduledHelpService.cs

@@ -0,0 +1,19 @@
+using com.hnshituo.core.webapp.vo;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Common
+{
+    public class MeterWorkScheduledHelpService
+    {
+        public RESTfulResult<List<MeterWorkScheduledHelp>> add(MeterWorkScheduledHelp info)
+        {
+            DbHelper db = new DbHelper();
+            RESTfulResult<List<MeterWorkScheduledHelp>> rm = db.doOption<List<MeterWorkScheduledHelp>>("meterworkscheduledhelps", "/", new object[] { info }, 1);
+            return rm;
+        }
+    }
+}

+ 10 - 0
Common/vo/base/MeterBaseCar.cs

@@ -100,5 +100,15 @@ namespace Common
 		/// <summary>
 		/// <summary>
 		public DateTime? updateTime { get; set; }
 		public DateTime? updateTime { get; set; }
 
 
+		/// <summary>
+		/// 归属单位类型编码
+		/// <summary>
+		public string belongUnitTypeNo { get; set; }
+
+		/// <summary>
+		/// 归属单位类型名称
+		/// <summary>
+		public string belongUnitTypeName { get; set; }
+
 	}
 	}
 }
 }

+ 15 - 0
Common/vo/base/MeterBaseUnitInfo.cs

@@ -34,6 +34,21 @@ namespace Common
 		/// <summary>
 		/// <summary>
 		public string receivingUnitName { get; set; }
 		public string receivingUnitName { get; set; }
 
 
+		/// <summary>
+		/// 物料编号
+		/// <summary>
+		public string matterNo { get; set; }
+
+		/// <summary>
+		/// 物料名称
+		/// <summary>
+		public string matterName { get; set; }
+
+		/// <summary>
+		/// 车号
+		/// <summary>
+		public string caoNo { get; set; }
+
 		/// <summary>
 		/// <summary>
 		/// 是否允许使用期限皮重(0不可,1可以)
 		/// 是否允许使用期限皮重(0不可,1可以)
 		/// <summary>
 		/// <summary>

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

@@ -0,0 +1,161 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Common
+{
+    public class MeterWorkCompareSpot
+    {
+		/// <summary>
+		/// 主键
+		/// <summary>
+		public string CompareSpotId { get; set; }
+
+		/// <summary>
+		/// 数据状态(0:作废,1:未使用, 2:已使用)
+		/// <summary>
+		public string valueFlag { get; set; }
+
+		/// <summary>
+		/// 创建人姓名
+		/// <summary>
+		public string createManName { get; set; }
+
+		/// <summary>
+		/// 创建人手机
+		/// <summary>
+		public string createManPhone { get; set; }
+
+		/// <summary>
+		/// 创建时间
+		/// <summary>
+		public DateTime? createTime { get; set; }
+
+		/// <summary>
+		/// 修改人姓名
+		/// <summary>
+		public string updateManName { get; set; }
+
+		/// <summary>
+		/// 修改人手机
+		/// <summary>
+		public string updateManPhone { get; set; }
+
+		/// <summary>
+		/// 创建时间
+		/// <summary>
+		public DateTime? updateTime { get; set; }
+
+		/// <summary>
+		/// 车号
+		/// <summary>
+		public string carNo { get; set; }
+
+		/// <summary>
+		/// 重量1
+		/// <summary>
+		public double weightNum1 { get; set; }
+
+		/// <summary>
+		/// 时间1
+		/// <summary>
+		public DateTime? weightDate1 { get; set; }
+
+		/// <summary>
+		/// 重量2
+		/// <summary>
+		public double weightNum2 { get; set; }
+
+		/// <summary>
+		/// 时间2
+		/// <summary>
+		public DateTime? weightDate2 { get; set; }
+
+		/// <summary>
+		/// 重量3
+		/// <summary>
+		public double weightNum3 { get; set; }
+
+		/// <summary>
+		/// 时间3
+		/// <summary>
+		public DateTime? weightDate3 { get; set; }
+
+		/// <summary>
+		/// 重量4
+		/// <summary>
+		public double weightNum4 { get; set; }
+
+		/// <summary>
+		/// 时间4
+		/// <summary>
+		public DateTime? weightDate4 { get; set; }
+
+		/// <summary>
+		/// 重量5
+		/// <summary>
+		public double weightNum5 { get; set; }
+
+		/// <summary>
+		/// 时间5
+		/// <summary>
+		public DateTime? weightDate5 { get; set; }
+
+		/// <summary>
+		/// 计量点编号1
+		/// <summary>
+		public string baseSpotNo1 { get; set; }
+
+		/// <summary>
+		/// 计量点名称1
+		/// <summary>
+		public string baseSpotName1 { get; set; }
+
+		/// <summary>
+		/// 计量点编号2
+		/// <summary>
+		public string baseSpotNo2 { get; set; }
+
+		/// <summary>
+		/// 计量点名称2
+		/// <summary>
+		public string baseSpotName2 { get; set; }
+
+		/// <summary>
+		/// 计量点编号3
+		/// <summary>
+		public string baseSpotNo3 { get; set; }
+
+		/// <summary>
+		/// 计量点名称3
+		/// <summary>
+		public string baseSpotName3 { get; set; }
+
+		/// <summary>
+		/// 计量点编号4
+		/// <summary>
+		public string baseSpotNo4 { get; set; }
+
+		/// <summary>
+		/// 计量点名称4
+		/// <summary>
+		public string baseSpotName4 { get; set; }
+
+		/// <summary>
+		/// 计量点编号5
+		/// <summary>
+		public string baseSpotNo5 { get; set; }
+
+		/// <summary>
+		/// 计量点名称5
+		/// <summary>
+		public string baseSpotName5 { get; set; }
+
+		/// <summary>
+		/// 较称类型(1:断差;2:较称)
+		/// <summary>
+		public string compareType { get; set; }
+	}
+}

+ 61 - 0
Common/vo/work/MeterWorkCompareSpotSacle.cs

@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Common
+{
+    public class MeterWorkCompareSpotSacle
+    {
+		/// <summary>
+		/// 主键
+		/// <summary>
+		public string CompareSpotSacleId { get; set; }
+
+		/// <summary>
+		/// 数据状态(0:作废,1:未使用, 2:已使用)
+		/// <summary>
+		public string valueFlag { get; set; }
+
+		/// <summary>
+		/// 车号
+		/// <summary>
+		public string carNo { get; set; }
+
+		/// <summary>
+		/// 数量
+		/// <summary>
+		public string num { get; set; }
+
+		/// <summary>
+		/// 创建人姓名
+		/// <summary>
+		public string createManName { get; set; }
+
+		/// <summary>
+		/// 创建人手机
+		/// <summary>
+		public string createManPhone { get; set; }
+
+		/// <summary>
+		/// 创建时间
+		/// <summary>
+		public DateTime? createTime { get; set; }
+
+		/// <summary>
+		/// 修改人姓名
+		/// <summary>
+		public string updateManName { get; set; }
+
+		/// <summary>
+		/// 修改人手机
+		/// <summary>
+		public string updateManPhone { get; set; }
+
+		/// <summary>
+		/// 创建时间
+		/// <summary>
+		public DateTime? updateTime { get; set; }
+	}
+}

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

@@ -60,6 +60,11 @@ namespace Common
 		/// <summary>
 		/// <summary>
 		public string validPredictionDiff { get; set; }
 		public string validPredictionDiff { get; set; }
 
 
+		/// <summary>
+		/// 验证区域  0不验证  1验证
+		/// <summary>
+		public string validArea { get; set; }
+
 		/// <summary>
 		/// <summary>
 		/// 是否有效 1有效 0无效
 		/// 是否有效 1有效 0无效
 		/// <summary>
 		/// <summary>

+ 6 - 0
Common/vo/work/MeterWorkPreWgttype.cs

@@ -84,5 +84,11 @@ namespace Common
 		/// 预报编号
 		/// 预报编号
 		/// <summary>
 		/// <summary>
 		public string preTrackScaleNo { get; set; }
 		public string preTrackScaleNo { get; set; }
+
+		/// <summary>
+		/// 是否确认
+		/// <summary>
+		public string submitFlag { get; set; }
+		
 	}
 	}
 }
 }

+ 95 - 0
Common/vo/work/MeterWorkScheduledHelp.cs

@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Common
+{
+    public class MeterWorkScheduledHelp
+    {
+        /// <summary>
+        /// 主键
+        /// <summary>
+        //[AttributeID("pointNo")]
+        public string helpId { get; set; }
+
+        /// <summary>
+        /// 车号
+        /// <summary>
+        //[AttributeID("pointNo")]
+        public string carNo { get; set; }
+
+        /// <summary>
+        /// 报警内容
+        /// <summary>
+        //[AttributeID("pointNo")]
+        public string helpContent { get; set; }
+
+        /// <summary>
+        /// 报警时间
+        /// <summary>
+        //[AttributeID("pointNo")]
+        public string createTime { get; set; }
+
+        /// <summary>
+        /// 结束时间
+        /// <summary>
+        //[AttributeID("pointNo")]
+        public string endTime { get; set; }
+
+        /// <summary>
+        /// 处理人编号
+        /// <summary>
+        //[AttributeID("pointNo")]
+        public string createNo { get; set; }
+
+        /// <summary>
+        /// 处理人
+        /// <summary>
+        //[AttributeID("pointNo")]
+        public string createName { get; set; }
+
+        /// <summary>
+        /// 处理结果
+        /// <summary>
+        //[AttributeID("pointNo")]
+        public string result { get; set; }
+
+        /// <summary>
+        /// 是否处理(0:未处理,1:已处理)
+        /// <summary>
+        //[AttributeID("pointNo")]
+        public string valueFlag { get; set; }
+
+        /// <summary>
+        /// 计量站点编号
+        /// <summary>
+        //[AttributeID("pointNo")]
+        public string baseSpotNo { get; set; }
+
+        /// <summary>
+        /// 计量站点名称
+        /// <summary>
+        //[AttributeID("pointNo")]
+        public string baseSpotName { get; set; }
+
+        /// <summary>
+        /// 是否上传智能料场
+        /// <summary>
+        //[AttributeID("pointNo")]
+        public string measureTaskNum { get; set; }
+
+        /// <summary>
+        /// 报警类型
+        /// <summary>
+        //[AttributeID("pointNo")]
+        public string warnType { get; set; }
+
+        /// <summary>
+        /// 报警类型名称
+        /// <summary>
+        //[AttributeID("pointNo")]
+        public string warnTypeName { get; set; }
+    }
+}

+ 1 - 0
MeterConditionLibrary/MeterConditionLibrary.csproj

@@ -47,6 +47,7 @@
     <Reference Include="System.Xml" />
     <Reference Include="System.Xml" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
+    <Compile Include="validArea.cs" />
     <Compile Include="validMeterArea.cs" />
     <Compile Include="validMeterArea.cs" />
     <Compile Include="validShipWeight.cs" />
     <Compile Include="validShipWeight.cs" />
     <Compile Include="validWeightType.cs" />
     <Compile Include="validWeightType.cs" />

+ 53 - 0
MeterConditionLibrary/validArea.cs

@@ -0,0 +1,53 @@
+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 MeterConditionLibrary
+{
+    public class validArea
+    {
+        MeterWorkCarActualFirstService meterWorkCarActualFirstService = new MeterWorkCarActualFirstService();
+
+        MeterBaseSpotInfoService meterBaseSpotInfoService = new MeterBaseSpotInfoService();
+        public bool ValidMethod(MeterBaseSpotInfo spot,string carNo)
+        {
+            //查询该车号一次数据
+            RESTfulResult<List<MeterWorkCarActualFirst>> rmFirst = meterWorkCarActualFirstService.doQueryByFlag(new MeterWorkCarActualFirst { carNo = carNo });
+            if (rmFirst.Succeed)
+            {
+                if (rmFirst.Data == null || rmFirst.Data.Count == 0)
+                {
+                    return true;
+                }
+                else
+                {
+                    //查询称点信息
+                    RESTfulResult<List<MeterBaseSpotInfo>> rmSpot = meterBaseSpotInfoService.doQueryWf(new MeterBaseSpotInfo { baseSpotNo = rmFirst.Data[0].baseSpotNo });
+                    if (rmSpot.Succeed)
+                    {
+                        if (rmSpot.Data == null || rmSpot.Data.Count == 0)
+                        {
+                            return true;
+                        }
+                        else
+                        {
+                            if (rmSpot.Data[0].spotAreaNo == spot.spotAreaNo)
+                            {
+                                return true;
+                            }
+                            else
+                            {
+                                return false;
+                            }
+                        }
+                    }
+                }
+            }
+            return true;
+        }
+    }
+}

+ 17 - 15
MeterPlugInLibrary/LED/LED_Control.cs

@@ -291,7 +291,7 @@ namespace MeterPlugInLibrary
             string[] list = ledInfo.Split(',');
             string[] list = ledInfo.Split(',');
 
 
 
 
-            for(int i=0; i<list.Length; i++)
+            for (int i = 0; i < list.Length; i++)
             {
             {
                 if (i == 0) info1 = list[0];
                 if (i == 0) info1 = list[0];
                 if (i == 1) info2 = list[1];
                 if (i == 1) info2 = list[1];
@@ -322,7 +322,15 @@ namespace MeterPlugInLibrary
             }
             }
             LedDll.AREARECT AreaRect = new LedDll.AREARECT();//区域坐标属性结构体变量
             LedDll.AREARECT AreaRect = new LedDll.AREARECT();//区域坐标属性结构体变量
 
 
+            AreaRect.left = 0;
+            AreaRect.top = 0;
+            AreaRect.width = 192;
+            AreaRect.height = 16;
+            //nResult = LedDll.LV_QuickAddSingleLineTextArea(hProgram, 1, 2, ref AreaRect, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 4);//快速通过字符添加一个单行文本区域,函数见函数声明注示
+
+
             LedDll.FONTPROP FontProp = new LedDll.FONTPROP();//文字属性
             LedDll.FONTPROP FontProp = new LedDll.FONTPROP();//文字属性
+
             FontProp.FontName = "宋体";
             FontProp.FontName = "宋体";
             FontProp.FontSize = 10;
             FontProp.FontSize = 10;
             FontProp.FontColor = LedDll.COLOR_RED;
             FontProp.FontColor = LedDll.COLOR_RED;
@@ -331,33 +339,27 @@ namespace MeterPlugInLibrary
 
 
             nResult = LedDll.LV_AddImageTextArea(hProgram, 1, 2, ref AreaRect, 0);
             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);//快速通过字符添加一个单行文本区域,函数见函数声明注示
-            AreaRect.left = 0;
-            AreaRect.top = 0;
-            AreaRect.width = 192;
-            AreaRect.height = 15;
-
-            nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, info1, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
-
+            nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
 
 
             AreaRect.left = 0;
             AreaRect.left = 0;
-            AreaRect.top = 15;
+            AreaRect.top = 16;
             AreaRect.width = 192;
             AreaRect.width = 192;
-            AreaRect.height = 15;
+            AreaRect.height = 16;
+
 
 
             nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, info2, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
             nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, info2, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
 
 
             AreaRect.left = 0;
             AreaRect.left = 0;
-            AreaRect.top = 30;
+            AreaRect.top = 32;
             AreaRect.width = 192;
             AreaRect.width = 192;
-            AreaRect.height = 15;
+            AreaRect.height = 16;
 
 
             nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, info3, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
             nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, info3, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
 
 
             AreaRect.left = 0;
             AreaRect.left = 0;
-            AreaRect.top = 45;
+            AreaRect.top = 48;
             AreaRect.width = 192;
             AreaRect.width = 192;
-            AreaRect.height = 15;
+            AreaRect.height = 16;
 
 
             nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, info4, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
             nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, info4, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
 
 

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 820 - 309
MeterSceneLibrary/JISCO/InnerCarJISCO.cs


+ 70 - 14
MeterSceneLibrary/JISCO/OuterCarJISCO.cs

@@ -71,6 +71,8 @@ namespace MeterSceneLibrary
             PbCache.isActual = false;
             PbCache.isActual = false;
             PbCache.isInnerCar = false;
             PbCache.isInnerCar = false;
             PbCache.ResultMessage = "";
             PbCache.ResultMessage = "";
+            PbCache.monitorResultMessage = "";
+            PbCache.LEDResultMessage = "";
 
 
             // VALUE_FLAG 状态(0=作废,1=有效(已匹配),2=结净,3=未匹配)
             // VALUE_FLAG 状态(0=作废,1=有效(已匹配),2=结净,3=未匹配)
             // 根据车号查询最近的一次计量数据
             // 根据车号查询最近的一次计量数据
@@ -374,6 +376,32 @@ namespace MeterSceneLibrary
                             */
                             */
                             PreTrackScale pre = null;
                             PreTrackScale pre = null;
                             string res = "";
                             string res = "";
+                            string matter = "";
+                            string forwarding = "";
+                            string receiving = "";
+                            bool flag = true;
+                            foreach (var item in listPreScale)
+                            {
+                                if (matter == "" && forwarding == "" && receiving == "")
+                                {
+                                    matter = item.matterNo;
+                                    forwarding = item.forwardingUnitNo;
+                                    receiving = item.receivingUintNo;
+                                }
+                                else
+                                {
+                                    if (matter == item.matterNo && forwarding == item.forwardingUnitNo && receiving == item.receivingUintNo)
+                                    {}
+                                    else
+                                    {
+                                        flag = false;
+                                    }
+                                }
+                            }
+                            if (flag)
+                            {
+                                pre = listPreScale[0];
+                            }
                             if (listPreScale.Count == 2 &&  listPreScale[0].valueFlag == "1" && listPreScale[1].valueFlag == "1" && listPreScale[0].predictionType == "6" && listPreScale[1].predictionType == "6")
                             if (listPreScale.Count == 2 &&  listPreScale[0].valueFlag == "1" && listPreScale[1].valueFlag == "1" && listPreScale[0].predictionType == "6" && listPreScale[1].predictionType == "6")
                             {
                             {
                                 pre = listPreScale[0];
                                 pre = listPreScale[0];
@@ -390,17 +418,19 @@ namespace MeterSceneLibrary
                             {
                             {
                                 // 正常洁净并生成两条净重数据
                                 // 正常洁净并生成两条净重数据
                                 pre = listPreScale[0];
                                 pre = listPreScale[0];
-                                res = ",双委托业务";
+                                res = ",双委托业务"; 
+                                PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,双委托业务", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                             }
                             }
+                            
                             if (pre == null)
                             if (pre == null)
                             {
                             {
                                 res = ",存在多个委托,无法自动匹配";
                                 res = ",存在多个委托,无法自动匹配";
+                                PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,多委托无法自动匹配请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                PbCache.monitorResultMessage = string.Format("计量完成,车号{0}存在{1}个委托,无法自动匹配", PbCache.lockCarNo, listPreScale.Count);
                             }
                             }
                             PbCache.isActual = true;
                             PbCache.isActual = true;
                             PbCache.isInnerCar = true;
                             PbCache.isInnerCar = true;
                             rt = saveMethod.doAddFirst(pre, mwaf);
                             rt = saveMethod.doAddFirst(pre, mwaf);
-                            PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,多委托无法自动匹配请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
-                            PbCache.monitorResultMessage = string.Format("计量完成,车号{0}存在{1}个委托,无法自动匹配", PbCache.lockCarNo, listPreScale.Count);
                             if (res != "")
                             if (res != "")
                             {
                             {
                                 rt.resultInfo += res;
                                 rt.resultInfo += res;
@@ -518,7 +548,7 @@ namespace MeterSceneLibrary
                                         mwaf = entityBase1.format<MeterWorkCarActualFirst>(listPreScale[0], mwaf);
                                         mwaf = entityBase1.format<MeterWorkCarActualFirst>(listPreScale[0], mwaf);
                                         mwaf.isPreScale = "1";
                                         mwaf.isPreScale = "1";
 
 
-                                        rt = saveMethod.doNet(listPreScale[0], mwca, mwaf);
+                                        rt = saveMethod.doNetHZHX(listPreScale[0], mwca, mwaf);
                                         PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                         PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     }
                                     }
                                     // 不满足以上逻辑
                                     // 不满足以上逻辑
@@ -577,13 +607,42 @@ namespace MeterSceneLibrary
                                     //    rt = saveMethod.doNet(scale, rmX.Data[0], mwaf);
                                     //    rt = saveMethod.doNet(scale, rmX.Data[0], mwaf);
                                     //    rt = saveMethod.doError("称重完成,当前所存计量数据未匹配委托,请联系计量大厅进行处理");
                                     //    rt = saveMethod.doError("称重完成,当前所存计量数据未匹配委托,请联系计量大厅进行处理");
                                     //}
                                     //}
-                                    
-                                    rt = saveMethod.doNet(null, rmX.Data[0], mwaf);
+                                    PreTrackScale pre = null;
+                                    string matter = "";
+                                    string forwarding = "";
+                                    string receiving = "";
+                                    bool flag = true;
+                                    foreach (var item in listPreScale)
+                                    {
+                                        if (matter == "" && forwarding == "" && receiving == "")
+                                        {
+                                            matter = item.matterNo;
+                                            forwarding = item.forwardingUnitNo;
+                                            receiving = item.receivingUintNo;
+                                        }
+                                        else
+                                        {
+                                            if (matter == item.matterNo && forwarding == item.forwardingUnitNo && receiving == item.receivingUintNo)
+                                            { }
+                                            else
+                                            {
+                                                flag = false;
+                                            }
+                                        }
+                                    }
+                                    if (flag)
+                                    {
+                                        pre = listPreScale[0];
+                                    }
+                                    rt = saveMethod.doNet(pre, rmX.Data[0], mwaf);
                                     rt.isWarn = true;
                                     rt.isWarn = true;
                                     rt.WarnContent = "validIsPre";
                                     rt.WarnContent = "validIsPre";
-                                    rt.resultInfo += ",存在多个委托,无法自动匹配";
-                                    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,多委托无法自动匹配请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
-                                    PbCache.monitorResultMessage = string.Format("计量完成,车号{0}存在{1}个委托,无法自动匹配", PbCache.lockCarNo, listPreScale.Count);
+                                    if (pre == null)
+                                    {
+                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,多委托无法自动匹配请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                        PbCache.monitorResultMessage = string.Format("计量完成,车号{0}存在{1}个委托,无法自动匹配", PbCache.lockCarNo, listPreScale.Count);
+                                        rt.resultInfo += ",存在多个委托,无法自动匹配";
+                                    }
                                 }
                                 }
                             }
                             }
                             // 存在的一次计量数据已匹配委托
                             // 存在的一次计量数据已匹配委托
@@ -637,10 +696,7 @@ namespace MeterSceneLibrary
                                         rt = saveMethod.doNetAddTwo(listPreScale, rmX.Data[0], mwaf);
                                         rt = saveMethod.doNetAddTwo(listPreScale, rmX.Data[0], mwaf);
                                     }
                                     }
                                     /*
                                     /*
-                                     * 委托关系满足一车多卸逻辑
-                                     * 分两种情况:
-                                     * 1、委托数据中没有委托类型标识,则根据签发时间排序,如果两条数据发货单位一致,收货单位不一致,且签发时间在10分钟内,则可判定为一车多卸业务,根据时间顺序选择第一条委托产生净重数据,然后使用第二条委托产生一个毛重数据。
-                                     * 2、委托数据中存在委托类型标识,且类型都为一车多卸。
+                                     * 委托关系满足混装混卸逻辑
                                      */
                                      */
                                     else if (listPreScale[0].predictionType == "6" && listPreScale[1].predictionType == "6" || listPreScale[0].predictionType == "7" && listPreScale[1].predictionType == "7")
                                     else if (listPreScale[0].predictionType == "6" && listPreScale[1].predictionType == "6" || listPreScale[0].predictionType == "7" && listPreScale[1].predictionType == "7")
                                     {
                                     {
@@ -669,7 +725,7 @@ namespace MeterSceneLibrary
                                         mwaf = entityBase1.format<MeterWorkCarActualFirst>(pts, mwaf);
                                         mwaf = entityBase1.format<MeterWorkCarActualFirst>(pts, mwaf);
                                         mwaf.isPreScale = "1";
                                         mwaf.isPreScale = "1";
 
 
-                                        rt = saveMethod.doNet(listPreScale[0], mwca, mwaf);
+                                        rt = saveMethod.doNetHZHX(listPreScale[0], mwca, mwaf);
                                         PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                         PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     }
                                     }
                                     // 不满足以上逻辑
                                     // 不满足以上逻辑

+ 89 - 0
MeterSceneLibrary/JISCO/compare.cs

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

+ 0 - 1
MeterSceneLibrary/JISCO/private/SaveMethod.cs

@@ -243,7 +243,6 @@ namespace MeterSceneLibrary.JISCO
                 netDb = entityBase3.format<MeterWorkCarActual>(scale, netDb);
                 netDb = entityBase3.format<MeterWorkCarActual>(scale, netDb);
                 netDb.isPreScale = "1";
                 netDb.isPreScale = "1";
             }
             }
-
             
             
 
 
             netDb.carNo = actualFirst.carNo;
             netDb.carNo = actualFirst.carNo;

+ 1 - 0
MeterSceneLibrary/MeterSceneLibrary.csproj

@@ -65,6 +65,7 @@
     <Compile Include="FirstTareSecondlyGross.cs" />
     <Compile Include="FirstTareSecondlyGross.cs" />
     <Compile Include="FirstTaresSecondlyGrossesLock.cs" />
     <Compile Include="FirstTaresSecondlyGrossesLock.cs" />
     <Compile Include="FirstTaresSecondlyGrossesUnLock.cs" />
     <Compile Include="FirstTaresSecondlyGrossesUnLock.cs" />
+    <Compile Include="JISCO\compare.cs" />
     <Compile Include="JISCO\InnerCarJISCO.cs" />
     <Compile Include="JISCO\InnerCarJISCO.cs" />
     <Compile Include="InnerMeter.cs" />
     <Compile Include="InnerMeter.cs" />
     <Compile Include="InnerRemoteMeter.cs" />
     <Compile Include="InnerRemoteMeter.cs" />

+ 61 - 0
TrainVideoDataDispose/Form2.Designer.cs

@@ -0,0 +1,61 @@
+
+namespace TrainVideoDataDispose
+{
+    partial class Form2
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.button1 = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(75, 51);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(75, 23);
+            this.button1.TabIndex = 0;
+            this.button1.Text = "button1";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // Form2
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(800, 450);
+            this.Controls.Add(this.button1);
+            this.Name = "Form2";
+            this.Text = "Form2";
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button button1;
+    }
+}

+ 26 - 0
TrainVideoDataDispose/Form2.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace TrainVideoDataDispose
+{
+    public partial class Form2 : Form
+    {
+        public Form2()
+        {
+            InitializeComponent();
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            //ftpHelper.GetFilesDirList();
+            string[] s = ftpHelper.GetFilesDirList();
+        }
+    }
+}

+ 120 - 0
TrainVideoDataDispose/Form2.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 1 - 1
TrainVideoDataDispose/Program.cs

@@ -15,7 +15,7 @@ namespace TrainVideoDataDispose
         {
         {
             Application.EnableVisualStyles();
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
             Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new text());
+            Application.Run(new Form2());
         }
         }
     }
     }
 }
 }

+ 10 - 0
TrainVideoDataDispose/TrainVideoDataDispose.csproj

@@ -116,6 +116,13 @@
     <Compile Include="Form1.Designer.cs">
     <Compile Include="Form1.Designer.cs">
       <DependentUpon>Form1.cs</DependentUpon>
       <DependentUpon>Form1.cs</DependentUpon>
     </Compile>
     </Compile>
+    <Compile Include="Form2.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form2.Designer.cs">
+      <DependentUpon>Form2.cs</DependentUpon>
+    </Compile>
+    <Compile Include="ftpHelper.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="text.cs">
     <Compile Include="text.cs">
@@ -127,6 +134,9 @@
     <EmbeddedResource Include="Form1.resx">
     <EmbeddedResource Include="Form1.resx">
       <DependentUpon>Form1.cs</DependentUpon>
       <DependentUpon>Form1.cs</DependentUpon>
     </EmbeddedResource>
     </EmbeddedResource>
+    <EmbeddedResource Include="Form2.resx">
+      <DependentUpon>Form2.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Properties\Resources.resx">
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>

+ 135 - 0
TrainVideoDataDispose/ftpHelper.cs

@@ -0,0 +1,135 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace TrainVideoDataDispose
+{
+    public class ftpHelper
+    {
+        /// <summary>
+        /// 获取当前目录下文件夹
+        /// </summary>
+        /// <returns></returns>
+        public static string[] GetFilesDirList()
+        {
+            try
+            {
+                List<string> result = new List<string>();//如果要修改字符串而不创建新的对象,则可以使用 System.Text.StringBuilder 类。
+                List<string> resultTxt = new List<string>();//如果要修改字符串而不创建新的对象,则可以使用 System.Text.StringBuilder 类。
+                List<string> resultJpg = new List<string>();//如果要修改字符串而不创建新的对象,则可以使用 System.Text.StringBuilder 类。
+                List<string> resultMp4 = new List<string>();//如果要修改字符串而不创建新的对象,则可以使用 System.Text.StringBuilder 类。
+                FtpWebRequest ftp;
+                ftp = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://10.111.16.113"));//"ftp://10.12.12.9";
+                ftp.Credentials = new NetworkCredential("300t", "300t");
+                ftp.Method = WebRequestMethods.Ftp.ListDirectoryDetails;//目录
+                WebResponse response = ftp.GetResponse();//response为一个ftp的WebResponse
+                StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.Default);//读入responses所创建的数据流
+                string line = reader.ReadLine();//输入流中的下一行;如果到达了输入流的末尾,则为空引用
+                while (line != null)
+                {
+                    result.Add(line);//)Append 方法可用来将文本或对象的字符串表示形式添加到由当前 StringBuilder 对象表示的字符串的结尾处。
+                    line = reader.ReadLine();
+                    //Download();
+                }
+                foreach (var item in result)
+                {
+                    if (item.Contains(".txt"))
+                    {
+                        resultTxt.Add(item);
+                    }
+                }
+                foreach (var item in result)
+                {
+                    if (item.Contains(".jpeg"))
+                    {
+                        resultJpg.Add(item);
+                    }
+                }
+                foreach (var item in result)
+                {
+                    if (item.Contains(".mp4"))
+                    {
+                        resultMp4.Add(item);
+                    }
+                }
+                string pathImg = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + DateTime.Now.ToString("yyyyMMdd") + "/img";
+                string pathTxt = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + DateTime.Now.ToString("yyyyMMdd") + "/txt";
+                string pathMp4 = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + DateTime.Now.ToString("yyyyMMdd") + "/movie";
+                if (!Directory.Exists(pathImg))
+                {
+                    Directory.CreateDirectory(pathImg);
+                }
+                if (!Directory.Exists(pathTxt))
+                {
+                    Directory.CreateDirectory(pathTxt);
+                }
+                if (!Directory.Exists(pathMp4))
+                {
+                    Directory.CreateDirectory(pathMp4);
+                }
+                foreach (var item in resultTxt)
+                {
+                    string fileName = item.Substring(item.Length - 23);
+                    Download(pathTxt, fileName);
+                }
+                //foreach (var item in resultMp4)
+                //{
+                //    string fileName = item.Substring(item.Length - 23);
+                //    Download(pathMp4, fileName);
+                //}
+                //foreach (var item in resultJpg)
+                //{
+                //    string fileName = item.Substring(item.Length - 26);
+                //    Download(pathImg, fileName);
+                //}
+                reader.Close();
+                response.Close();
+                return result.ToString().Split('\n');
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+        }
+
+        /// <summary>  
+        /// 下载  filePath是下载到本机的地址fileName是需要下载的文件的名字
+        /// </summary>
+        public static void Download(string filePath, string fileName)
+        {
+            try
+            {
+                string path = filePath + "\\" + fileName;
+                FileStream outputStream = new FileStream(path, FileMode.Create);
+                FtpWebRequest reqFTP;
+                reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://10.111.16.113/" + fileName));
+                reqFTP.Credentials = new NetworkCredential("300t", "300t");
+                reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;
+                reqFTP.UseBinary = true;
+                FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
+                Stream ftpStream = response.GetResponseStream();
+                long cl = response.ContentLength;
+                int bufferSize = 2048;
+                int readCount;
+                byte[] buffer = new byte[bufferSize];
+                readCount = ftpStream.Read(buffer, 0, bufferSize);
+                while (readCount > 0)
+                {
+                    outputStream.Write(buffer, 0, readCount);
+                    readCount = ftpStream.Read(buffer, 0, bufferSize);
+                }
+                ftpStream.Close();
+                outputStream.Close();
+                response.Close();
+            }
+            catch (Exception ex)
+            {
+                throw new Exception(ex.Message);
+            }
+        }
+    }
+}

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä