|
|
@@ -34,10 +34,13 @@ namespace CarMeterSystem
|
|
|
private MeterWorkCarActualFirstService workCarActualFirstService = new MeterWorkCarActualFirstService(); //一次计量数据
|
|
|
private PreTrackScaleService trackService = new PreTrackScaleService();//查询预报信息
|
|
|
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 validRecoverInfo recoverInfo = new validRecoverInfo();//验证是否需要复磅以及是否满足复磅条件
|
|
|
+ private validArea areaInfo = new validArea();//验证区域是否正确
|
|
|
private validPrediction validPred = new validPrediction(); //验证预报信息
|
|
|
private validUnloadAutomatic unloadAutomatic = new validUnloadAutomatic(); //自动卸货
|
|
|
private validDataValidity dataValidity = new validDataValidity(); //验证采集的重量是否正常
|
|
|
@@ -106,7 +109,21 @@ namespace CarMeterSystem
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- if (PbCache.collect == null) return;
|
|
|
+ bool isCompare = false;
|
|
|
+
|
|
|
+ RESTfulResult<List<MeterWorkCompareSpotSacle>> reSacle = meterWorkCompareSpotScaleService.doQuery(new MeterWorkCompareSpotSacle { carNo = PbCache.lockCarNo });
|
|
|
+ if (reSacle.Succeed)
|
|
|
+ {
|
|
|
+ if (reSacle.Data == null || reSacle.Data.Count == 0)
|
|
|
+ { }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ isCompare = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (PbCache.collect == null) return;
|
|
|
PbCache.isLockFrm = true;
|
|
|
PbCache.lockCarNo = PbCache.collect.carno;
|
|
|
PbCache.lockWgt = PbCache.collect.weight;
|
|
|
@@ -165,6 +182,15 @@ namespace CarMeterSystem
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ //判断区域是否正确
|
|
|
+ if (!areaInfo.ValidMethod(PbCache.sportInfo, txtCarNo.Text) && PbCache.monitor.validArea == "1" && !isCompare)
|
|
|
+ {
|
|
|
+ PbCache.isLockFrm = false;
|
|
|
+ btnSave.Enabled = true;
|
|
|
+ setMsg("车辆两次称点区域不同");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
//2021年6月22日 存在需要复磅的数据,不允许进行保存操作
|
|
|
recoverInfo.ValidAllowSave(PbCache.lockCarNo);
|
|
|
if (PbCache.isAllowRecover)
|
|
|
@@ -269,201 +295,245 @@ namespace CarMeterSystem
|
|
|
//}
|
|
|
|
|
|
#region 酒钢业务流程判断
|
|
|
- // 把车号加上-
|
|
|
- string tempCarNo = PbCache.lockCarNo;
|
|
|
- RESTfulResult<List<MeterBaseCar>> resCarList = carService.doQueryCarList(new MeterBaseCar { carNo = tempCarNo });
|
|
|
- RESTfulResult<rtInfo> strRm = new RESTfulResult<rtInfo>();
|
|
|
- if (resCarList.Succeed)
|
|
|
+ if (isCompare)
|
|
|
{
|
|
|
- if (resCarList.Data != null && resCarList.Data.Count == 1)
|
|
|
+ ExecuteMethod em = new ExecuteMethod();
|
|
|
+ RESTfulResult<rtInfo> strRm = new RESTfulResult<rtInfo>();
|
|
|
+ try
|
|
|
{
|
|
|
- MeterBaseCar car = resCarList.Data[0];
|
|
|
+ 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);
|
|
|
- PbCache.ResultMessage = strRm.Data.resultInfo;
|
|
|
- PbCache.monitorResultMessage = strRm.Data.resultInfo;
|
|
|
+ PbCache.ResultMessage = strRm.ResultMessage;
|
|
|
PbCache.isLockFrm = false;
|
|
|
btnSave.Enabled = true;
|
|
|
setMsg(PbCache.ResultMessage);
|
|
|
+
|
|
|
+ // todo:更新监控表,此秤点求助状态为求助中
|
|
|
+ if (PbCache.monitor.isHelp == "0")
|
|
|
+ {
|
|
|
+ RESTfulResult<string> rms = monitor.doUpdateWf(new MeterWorkMonitor { pointNo = PbCache.sportInfo.baseSpotNo, isHelp = "1" });
|
|
|
+ if (!rms.Succeed)
|
|
|
+ {
|
|
|
+ lg.WriteLog(3, PbCache.lockCarNo + "求助写入失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
Monitor(strRm.Data);
|
|
|
if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
|
|
|
{
|
|
|
- led_controler.setStatic4LineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
|
|
|
+ led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
|
|
|
}
|
|
|
return;
|
|
|
- }
|
|
|
|
|
|
- if (strRm.Data.result) //说明:标识当前跑了一个场景成功了;场景完成后则返回,不再进行下一个场景的执行操作;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(tempCarNo))
|
|
|
{
|
|
|
- PbCache.ResultMessage = strRm.Data.resultInfo; //语音提示文件
|
|
|
- setMsg(PbCache.ResultMessage);
|
|
|
- Monitor(strRm.Data);
|
|
|
- if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
|
|
|
- {
|
|
|
- led_controler.setStatic4LineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
|
|
|
- }
|
|
|
- //return;
|
|
|
+ PbCache.ResultMessage += "车号为空,请联系处理";
|
|
|
+ PbCache.monitorResultMessage = "车号为空,请联系处理";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- //说明:不满足场景的的要求,不能进行return,继续下一个场景,若所有的场景都失败,则提示“未找到计量场景配置信息”
|
|
|
- //ResultMessage = strRm.Data.resultInfo;
|
|
|
- //return strRm.Data.result; //2021-3-18 杨秀东注释;要处理一车联运(多场景)的数据;问题:提示信息会出现问题
|
|
|
+ PbCache.ResultMessage += "车号未注册,请联系处理";
|
|
|
+ PbCache.monitorResultMessage = "车号未注册,请联系处理";
|
|
|
}
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- vicPlayClass.GetVoicePlay("计量数据保存失败", PbCache.collect.carno);
|
|
|
- PbCache.ResultMessage = strRm.ResultMessage;
|
|
|
PbCache.isLockFrm = false;
|
|
|
btnSave.Enabled = true;
|
|
|
- setMsg(PbCache.ResultMessage);
|
|
|
|
|
|
- // todo:更新监控表,此秤点求助状态为求助中
|
|
|
- if (PbCache.monitor.isHelp == "0")
|
|
|
+ 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;
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- 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 期限皮显示及保存
|
|
|
|
|
|
- //留期限皮提醒
|
|
|
- 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表示称重成功
|
|
|
@@ -502,6 +572,21 @@ namespace CarMeterSystem
|
|
|
//
|
|
|
#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写入
|
|
|
PbCache.ledInfo = string.Format("计量完成,车号:{0},车重:{1},物资:{2}", PbCache.lockCarNo, PbCache.lockWgt, preTrack != null ? preTrack.matterName : "");
|
|
|
@@ -656,6 +741,18 @@ namespace CarMeterSystem
|
|
|
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.接受远程修改过后的车号并显示
|
|
|
//if (PbCache.monitor != null && !string.IsNullOrEmpty(PbCache.monitor.editCar))
|
|
|
//{
|
|
|
@@ -847,15 +944,15 @@ namespace CarMeterSystem
|
|
|
#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)
|
|
|
{
|
|
|
@@ -891,145 +988,160 @@ namespace CarMeterSystem
|
|
|
isShowRecover = false;
|
|
|
}
|
|
|
|
|
|
+ #endregion 判断是否需要复磅
|
|
|
+
|
|
|
+ #region 判断区域是否正确
|
|
|
+
|
|
|
+ //if (PbCache.monitor.validArea == "1")
|
|
|
+ //{
|
|
|
+ // if (areaInfo.ValidMethod(PbCache.sportInfo, txtCarNo.Text))
|
|
|
+ // {
|
|
|
+ // btnSave.Enabled = true;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // btnSave.Enabled = false;
|
|
|
+ // }
|
|
|
+ //}
|
|
|
#endregion 判断是否需要复磅
|
|
|
|
|
|
#region 第一次查询,有车号,重量稳定,红外验证通过的情况只查一次
|
|
|
|
|
|
//如果没有查过一次,且扫描到车号信息,且重量稳定
|
|
|
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;
|
|
|
firstDb = RESTfulResult.Data[0];
|
|
|
firstDb.predictionNo = firstDb.predictionNo.Replace("_", "");
|
|
|
//给用户控件设置值
|
|
|
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
|
|
|
{
|
|
|
- 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的情况下才赋值毛皮净重
|
|
|
@@ -1072,14 +1184,14 @@ namespace CarMeterSystem
|
|
|
isVoiceDownCar = true;
|
|
|
vicPlayClass.GetVoicePlay("车上人员请下车", PbCache.collect.carno);
|
|
|
//txtMsgInfo.Text = "请核对车号后,扫描您手机中的二维码";
|
|
|
- }
|
|
|
+ }
|
|
|
// 如果计量点配置中,设置了秤点计量类型为智能计量(下秤),验证扫码信息是否与识别车号一致。
|
|
|
// 如果为是,自动保存
|
|
|
//3秒后自动执行保存方法
|
|
|
- Thread.Sleep(3000);
|
|
|
- this.btnSave.PerformClick();
|
|
|
+ //Thread.Sleep(3000);
|
|
|
+ //this.btnSave.PerformClick();
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
else if (PbCache.monitor.validMatClick == "0")
|
|
|
{
|
|
|
//已锁定 && !PbCache.isLockFrm
|