|
|
@@ -112,6 +112,33 @@ namespace MeterSceneLibrary
|
|
|
// 存在一条预处理数据
|
|
|
else if (list == null || list.Count == 1)
|
|
|
{
|
|
|
+ // 历史皮重验证
|
|
|
+ rt = saveMethod.validHisTare(list[0].weightTypeNo);
|
|
|
+ if (list[0].weightTypeNo == "001033002" && PbCache.monitorResult.valid_wgt == false && listMonitor.Data[0].validWgt == "1")
|
|
|
+ {
|
|
|
+ if (PbCache.ResultMessage == "")
|
|
|
+ {
|
|
|
+ PbCache.ResultMessage = "重量类型为皮重且不在皮重误差内";
|
|
|
+ }
|
|
|
+ PbCache.voiceType = 13;
|
|
|
+ rt = saveMethod.doError(PbCache.ResultMessage);
|
|
|
+ rt.isWarn = true;
|
|
|
+ rt.WarnContent = "validWgt";
|
|
|
+ return rt;
|
|
|
+ }
|
|
|
+ if (list[0].weightTypeNo == "001033001" && PbCache.monitorResult.valid_wgt == true && listMonitor.Data[0].validWgt == "1")
|
|
|
+ {
|
|
|
+ if (PbCache.ResultMessage == "")
|
|
|
+ {
|
|
|
+ PbCache.ResultMessage = "重量类型为毛重,在皮重误差内";
|
|
|
+ }
|
|
|
+ PbCache.voiceType = 23;
|
|
|
+ rt = saveMethod.doError(PbCache.ResultMessage);
|
|
|
+ rt.isWarn = true;
|
|
|
+ rt.WarnContent = "validWgt";
|
|
|
+ return rt;
|
|
|
+ }
|
|
|
+
|
|
|
//拿到车辆
|
|
|
RESTfulResult<List<MeterBaseCar>> resCarList = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.lockCarNo });
|
|
|
RESTfulResult<List<MeterBaseSpecialUnit>> sunitList = meterBaseSpecialUnitService.doQueryCarList(new MeterBaseSpecialUnit { unitNo = resCarList.Data[0].usetDepartmentNo });
|
|
|
@@ -326,88 +353,105 @@ namespace MeterSceneLibrary
|
|
|
}
|
|
|
if (firstList[0].weightType == "0" && list[0].weightTypeNo == "001033001")
|
|
|
{
|
|
|
- //判断称点是否允许期限皮重
|
|
|
- if (PbCache.sportInfo.allowedTareWeight == "1")
|
|
|
+ // 历史皮重验证
|
|
|
+ rt = saveMethod.validHisTare(list[0].weightTypeNo);
|
|
|
+ if (PbCache.monitorResult.valid_wgt == true && listMonitor.Data[0].validWgt == "1")
|
|
|
{
|
|
|
- if (AppConfigCache.TareControlType == "3")
|
|
|
+ //判断称点是否允许期限皮重
|
|
|
+ if (PbCache.sportInfo.allowedTareWeight == "1")
|
|
|
{
|
|
|
- // 判断收发货单位是否具有期限皮重权限
|
|
|
- MeterBaseUnitInfoService meterBaseUnitInfoService = new MeterBaseUnitInfoService();
|
|
|
- MeterBaseUnitInfo meterBaseUnitInfo = new MeterBaseUnitInfo();
|
|
|
- meterBaseUnitInfo.matterNo = rmScale.Data[0].matterNo;
|
|
|
- meterBaseUnitInfo.matterName = rmScale.Data[0].matterName;
|
|
|
- meterBaseUnitInfo.forwardingUnitNo = rmScale.Data[0].forwardingUnitNo;
|
|
|
- meterBaseUnitInfo.forwardingUnitName = rmScale.Data[0].forwardingUnitName;
|
|
|
- meterBaseUnitInfo.receivingUnitNo = rmScale.Data[0].receivingUintNo;
|
|
|
- meterBaseUnitInfo.receivingUnitName = rmScale.Data[0].receivingUintName;
|
|
|
- meterBaseUnitInfo.carNo = PbCache.lockCarNo;
|
|
|
- RESTfulResult<List<MeterBaseUnitInfo>> tareUnitResult = meterBaseUnitInfoService.doQueryWf(meterBaseUnitInfo);
|
|
|
- if (tareUnitResult.Succeed)
|
|
|
+ if (AppConfigCache.TareControlType == "3")
|
|
|
{
|
|
|
- if (tareUnitResult.Data == null || tareUnitResult.Data.Count == 0)
|
|
|
- {
|
|
|
- mwaf.weightType = "0";
|
|
|
- rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
|
|
|
- rt.resultInfo = "存在未结净毛重";
|
|
|
- PbCache.voiceType = 11;
|
|
|
- PbCache.ResultMessage = "存在未结净毛重";
|
|
|
- PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,存在未结净毛重,请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
|
|
|
- PbCache.monitorResultMessage = "存在未结净毛重";
|
|
|
- rt.isWarn = true;
|
|
|
- rt.WarnContent = "validWgt";
|
|
|
- }
|
|
|
- else
|
|
|
+ // 判断收发货单位是否具有期限皮重权限
|
|
|
+ MeterBaseUnitInfoService meterBaseUnitInfoService = new MeterBaseUnitInfoService();
|
|
|
+ MeterBaseUnitInfo meterBaseUnitInfo = new MeterBaseUnitInfo();
|
|
|
+ meterBaseUnitInfo.matterNo = rmScale.Data[0].matterNo;
|
|
|
+ meterBaseUnitInfo.matterName = rmScale.Data[0].matterName;
|
|
|
+ meterBaseUnitInfo.forwardingUnitNo = rmScale.Data[0].forwardingUnitNo;
|
|
|
+ meterBaseUnitInfo.forwardingUnitName = rmScale.Data[0].forwardingUnitName;
|
|
|
+ meterBaseUnitInfo.receivingUnitNo = rmScale.Data[0].receivingUintNo;
|
|
|
+ meterBaseUnitInfo.receivingUnitName = rmScale.Data[0].receivingUintName;
|
|
|
+ meterBaseUnitInfo.carNo = PbCache.lockCarNo;
|
|
|
+ RESTfulResult<List<MeterBaseUnitInfo>> tareUnitResult = meterBaseUnitInfoService.doQueryWf(meterBaseUnitInfo);
|
|
|
+ if (tareUnitResult.Succeed)
|
|
|
{
|
|
|
- MeterBaseTermTareDataService meterBaseTermTareDataService = new MeterBaseTermTareDataService();
|
|
|
- RESTfulResult<MeterBaseTermTareData> termTareData = meterBaseTermTareDataService.doQueryPageWf(new MeterBaseTermTareData { carNo = PbCache.lockCarNo, valueFlag = "0" });
|
|
|
- if (termTareData.Succeed)
|
|
|
+ if (tareUnitResult.Data == null || tareUnitResult.Data.Count == 0)
|
|
|
{
|
|
|
- if (termTareData.Data == null)
|
|
|
- {
|
|
|
- mwaf.weightType = "0";
|
|
|
- rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
|
|
|
- rt.resultInfo = "期限皮过期,存在未结净毛重";
|
|
|
- PbCache.voiceType = 17;
|
|
|
- PbCache.ResultMessage = "期限皮过期,存在未结净毛重";
|
|
|
- PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,期限皮过期,存在未结净毛重", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
|
|
|
- PbCache.monitorResultMessage = "期限皮过期,存在未结净毛重";
|
|
|
- rt.isWarn = true;
|
|
|
- rt.WarnContent = "validWgt";
|
|
|
- }
|
|
|
- else
|
|
|
+ mwaf.weightType = "0";
|
|
|
+ rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
|
|
|
+ rt.resultInfo = "存在未结净毛重";
|
|
|
+ PbCache.voiceType = 11;
|
|
|
+ PbCache.ResultMessage = "存在未结净毛重";
|
|
|
+ PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,存在未结净毛重,请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
|
|
|
+ PbCache.monitorResultMessage = "存在未结净毛重";
|
|
|
+ rt.isWarn = true;
|
|
|
+ rt.WarnContent = "validWgt";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ MeterBaseTermTareDataService meterBaseTermTareDataService = new MeterBaseTermTareDataService();
|
|
|
+ RESTfulResult<MeterBaseTermTareData> termTareData = meterBaseTermTareDataService.doQueryPageWf(new MeterBaseTermTareData { carNo = PbCache.lockCarNo, valueFlag = "0" });
|
|
|
+ if (termTareData.Succeed)
|
|
|
{
|
|
|
- // 存在使用期限皮重权限,并使用期限皮重结净
|
|
|
- List<string> l = new List<string>();
|
|
|
- l.Add("create");
|
|
|
- //给一次数据匹配委托
|
|
|
- EntityBase<PreTrackScale> entityBase1 = new EntityBase<PreTrackScale>();
|
|
|
- mwaf = entityBase1.format<MeterWorkCarActualFirst>(rmScale.Data[0], mwaf);
|
|
|
- mwaf.isPreScale = "1";
|
|
|
- mwaf.weightType = "0";
|
|
|
- PbCache.voiceType = 16;
|
|
|
- PbCache.ResultMessage = "计量完成,期限皮结净";
|
|
|
- PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,净重{2}吨,期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(PbCache.lockWgt - termTareData.Data.meterWeight.Value) / 1000), 2));
|
|
|
- rt = saveMethod.doNetTermTare(rmScale.Data[0], mwaf);
|
|
|
- rt.resultInfo += ",期限皮结净";
|
|
|
+ if (termTareData.Data == null)
|
|
|
+ {
|
|
|
+ mwaf.weightType = "0";
|
|
|
+ rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
|
|
|
+ rt.resultInfo = "期限皮过期,存在未结净毛重";
|
|
|
+ PbCache.voiceType = 17;
|
|
|
+ PbCache.ResultMessage = "期限皮过期,存在未结净毛重";
|
|
|
+ PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,期限皮过期,存在未结净毛重", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
|
|
|
+ PbCache.monitorResultMessage = "期限皮过期,存在未结净毛重";
|
|
|
+ rt.isWarn = true;
|
|
|
+ rt.WarnContent = "validWgt";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // 存在使用期限皮重权限,并使用期限皮重结净
|
|
|
+ List<string> l = new List<string>();
|
|
|
+ l.Add("create");
|
|
|
+ //给一次数据匹配委托
|
|
|
+ EntityBase<PreTrackScale> entityBase1 = new EntityBase<PreTrackScale>();
|
|
|
+ mwaf = entityBase1.format<MeterWorkCarActualFirst>(rmScale.Data[0], mwaf);
|
|
|
+ mwaf.isPreScale = "1";
|
|
|
+ mwaf.weightType = "0";
|
|
|
+ PbCache.voiceType = 16;
|
|
|
+ PbCache.ResultMessage = "计量完成,期限皮结净";
|
|
|
+ PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,净重{2}吨,期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(PbCache.lockWgt - termTareData.Data.meterWeight.Value) / 1000), 2));
|
|
|
+ rt = saveMethod.doNetTermTare(rmScale.Data[0], mwaf);
|
|
|
+ rt.resultInfo += ",期限皮结净";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mwaf.weightType = "0";
|
|
|
+ rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
|
|
|
+ rt.resultInfo = "存在未结净毛重";
|
|
|
+ PbCache.voiceType = 11;
|
|
|
+ PbCache.ResultMessage = "存在未结净毛重";
|
|
|
+ PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,存在未结净毛重,请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
|
|
|
+ PbCache.monitorResultMessage = "存在未结净毛重";
|
|
|
+ rt.isWarn = true;
|
|
|
+ rt.WarnContent = "validWgt";
|
|
|
+ }
|
|
|
+ return rt;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- mwaf.weightType = "0";
|
|
|
- rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
|
|
|
- rt.resultInfo = "存在未结净毛重";
|
|
|
- PbCache.voiceType = 11;
|
|
|
- PbCache.ResultMessage = "存在未结净毛重";
|
|
|
- PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,存在未结净毛重,请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
|
|
|
- PbCache.monitorResultMessage = "存在未结净毛重";
|
|
|
+ if (PbCache.ResultMessage == "")
|
|
|
+ {
|
|
|
+ PbCache.ResultMessage = "重量类型为毛重,在皮重误差内";
|
|
|
+ }
|
|
|
+ PbCache.voiceType = 23;
|
|
|
+ rt = saveMethod.doError(PbCache.ResultMessage);
|
|
|
rt.isWarn = true;
|
|
|
rt.WarnContent = "validWgt";
|
|
|
+ return rt;
|
|
|
}
|
|
|
- return rt;
|
|
|
}
|
|
|
// 当次重量和上次重量满足结净最小值条件
|
|
|
if (Math.Abs(rmFirst.Data[0].meterWeight.Value - PbCache.lockWgt) > diffrentWgt || listMonitor.Data[0].validPredictionDiff == "0")
|
|
|
@@ -622,28 +666,58 @@ namespace MeterSceneLibrary
|
|
|
// 存在多条有效的一次计量数据
|
|
|
else if (firstList == null || firstList.Count > 1)
|
|
|
{
|
|
|
+ // 历史皮重验证
|
|
|
+ rt = saveMethod.validHisTare(list[0].weightTypeNo);
|
|
|
+
|
|
|
/* a. 程序报警a
|
|
|
* b. 自动进行语音求助
|
|
|
*/
|
|
|
//多条一次记录下判断是否全为毛重,是全部结净
|
|
|
if (firstList[firstList.Count - 1].weightType == "0" && list[0].weightTypeNo == "001033002")
|
|
|
{
|
|
|
- mwaf.weightType = "1";
|
|
|
- rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
|
|
|
- PbCache.voiceType = 1;
|
|
|
- PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
|
|
|
+ if (PbCache.monitorResult.valid_wgt == false && listMonitor.Data[0].validWgt == "1")
|
|
|
+ {
|
|
|
+ mwaf.weightType = "1";
|
|
|
+ rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
|
|
|
+ PbCache.voiceType = 1;
|
|
|
+ PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (PbCache.ResultMessage == "")
|
|
|
+ {
|
|
|
+ PbCache.ResultMessage = "重量类型为皮重且不在皮重误差内";
|
|
|
+ }
|
|
|
+ PbCache.voiceType = 13;
|
|
|
+ rt = saveMethod.doError(PbCache.ResultMessage);
|
|
|
+ return rt;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
else if (firstList[firstList.Count - 1].weightType == "0" && list[0].weightTypeNo == "001033001")
|
|
|
{
|
|
|
- mwaf.weightType = "0";
|
|
|
- rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
|
|
|
- PbCache.voiceType = 11;
|
|
|
- rt.resultInfo = string.Format("存在未结净毛重", firstList.Count);
|
|
|
- PbCache.ResultMessage = string.Format("存在未结净毛重", firstList.Count);
|
|
|
- PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,存在未结净毛重,请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), firstList.Count);
|
|
|
- PbCache.monitorResultMessage = string.Format("存在未结净毛重", firstList.Count);
|
|
|
- rt.isWarn = true;
|
|
|
- rt.WarnContent = "validWgt";
|
|
|
+ if (PbCache.monitorResult.valid_wgt == false && listMonitor.Data[0].validWgt == "1")
|
|
|
+ {
|
|
|
+ mwaf.weightType = "0";
|
|
|
+ rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
|
|
|
+ PbCache.voiceType = 11;
|
|
|
+ rt.resultInfo = string.Format("存在未结净毛重", firstList.Count);
|
|
|
+ PbCache.ResultMessage = string.Format("存在未结净毛重", firstList.Count);
|
|
|
+ PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,存在未结净毛重,请联系", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), firstList.Count);
|
|
|
+ PbCache.monitorResultMessage = string.Format("存在未结净毛重", firstList.Count);
|
|
|
+ rt.isWarn = true;
|
|
|
+ rt.WarnContent = "validWgt";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (PbCache.ResultMessage == "")
|
|
|
+ {
|
|
|
+ PbCache.ResultMessage = "毛重接近历史皮重,请联系处理";
|
|
|
+ }
|
|
|
+ PbCache.voiceType = 23;
|
|
|
+ rt = saveMethod.doError(PbCache.ResultMessage);
|
|
|
+ return rt;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -677,13 +751,13 @@ namespace MeterSceneLibrary
|
|
|
// 重量类型为皮重
|
|
|
if (list[0].weightTypeNo == "001033002")
|
|
|
{
|
|
|
- if (PbCache.lockWgt > 25000)
|
|
|
- {
|
|
|
- rt = saveMethod.doError(string.Format("当前重量:{0},请确认是否,误选为皮重上秤", PbCache.lockWgt));
|
|
|
- PbCache.voiceType = 26;
|
|
|
- PbCache.LEDResultMessage = string.Format("当前重量:{0},请确认是否,误选为皮重上秤", PbCache.lockWgt);
|
|
|
- return rt;
|
|
|
- }
|
|
|
+ //if (PbCache.lockWgt > 25000)
|
|
|
+ //{
|
|
|
+ // rt = saveMethod.doError(string.Format("当前重量:{0},请确认是否,误选为皮重上秤", PbCache.lockWgt));
|
|
|
+ // PbCache.voiceType = 26;
|
|
|
+ // PbCache.LEDResultMessage = string.Format("当前重量:{0},请确认是否,误选为皮重上秤", PbCache.lockWgt);
|
|
|
+ // return rt;
|
|
|
+ //}
|
|
|
|
|
|
// 历史皮重验证
|
|
|
rt = saveMethod.validHisTare(list[0].weightTypeNo);
|
|
|
@@ -826,83 +900,98 @@ namespace MeterSceneLibrary
|
|
|
//rt.resultInfo = "之前存在多个未结净的毛重";
|
|
|
//PbCache.ResultMessage = "之前存在多个未结净的毛重";
|
|
|
//PbCache.monitorResultMessage = "之前存在多个未结净的毛重";
|
|
|
-
|
|
|
- int countTerm = 0;
|
|
|
- List<MeterWorkCarActualFirst> meterWorkCarActualFirsts = new List<MeterWorkCarActualFirst>();
|
|
|
-
|
|
|
- foreach (var item in firstList)
|
|
|
+ rt = saveMethod.validHisTare(list[0].weightTypeNo);
|
|
|
+ if (PbCache.monitorResult.valid_wgt == true || listMonitor.Data[0].validWgt == "0")
|
|
|
{
|
|
|
- RESTfulResult<List<PreTrackScale>> scales = preTrackScaleService.doQueryWf(new PreTrackScale { predictionNo = item.predictionNo });
|
|
|
- if (PbCache.sportInfo.allowedTareWeight == "1")
|
|
|
+ int countTerm = 0;
|
|
|
+ List<MeterWorkCarActualFirst> meterWorkCarActualFirsts = new List<MeterWorkCarActualFirst>();
|
|
|
+
|
|
|
+ foreach (var item in firstList)
|
|
|
{
|
|
|
- if (AppConfigCache.TareControlType == "3")
|
|
|
+ RESTfulResult<List<PreTrackScale>> scales = preTrackScaleService.doQueryWf(new PreTrackScale { predictionNo = item.predictionNo });
|
|
|
+ if (PbCache.sportInfo.allowedTareWeight == "1")
|
|
|
{
|
|
|
- /// 判断是否具有期限皮重权限
|
|
|
- MeterBaseUnitInfoService meterBaseUnitInfoService = new MeterBaseUnitInfoService();
|
|
|
- MeterBaseUnitInfo meterBaseUnitInfo = new MeterBaseUnitInfo();
|
|
|
- meterBaseUnitInfo.matterNo = scales.Data[0].matterNo;
|
|
|
- meterBaseUnitInfo.matterName = scales.Data[0].matterName;
|
|
|
- meterBaseUnitInfo.forwardingUnitNo = scales.Data[0].forwardingUnitNo;
|
|
|
- meterBaseUnitInfo.forwardingUnitName = scales.Data[0].forwardingUnitName;
|
|
|
- meterBaseUnitInfo.receivingUnitNo = scales.Data[0].receivingUintNo;
|
|
|
- meterBaseUnitInfo.receivingUnitName = scales.Data[0].receivingUintName;
|
|
|
- meterBaseUnitInfo.carNo = PbCache.lockCarNo;
|
|
|
- RESTfulResult<List<MeterBaseUnitInfo>> tareUnitResult = meterBaseUnitInfoService.doQueryWf(meterBaseUnitInfo);
|
|
|
- if (tareUnitResult.Succeed)
|
|
|
+ if (AppConfigCache.TareControlType == "3")
|
|
|
{
|
|
|
- if (tareUnitResult.Data == null || tareUnitResult.Data.Count == 0)
|
|
|
- {
|
|
|
- countTerm++;
|
|
|
- }
|
|
|
- else
|
|
|
+ /// 判断是否具有期限皮重权限
|
|
|
+ MeterBaseUnitInfoService meterBaseUnitInfoService = new MeterBaseUnitInfoService();
|
|
|
+ MeterBaseUnitInfo meterBaseUnitInfo = new MeterBaseUnitInfo();
|
|
|
+ meterBaseUnitInfo.matterNo = scales.Data[0].matterNo;
|
|
|
+ meterBaseUnitInfo.matterName = scales.Data[0].matterName;
|
|
|
+ meterBaseUnitInfo.forwardingUnitNo = scales.Data[0].forwardingUnitNo;
|
|
|
+ meterBaseUnitInfo.forwardingUnitName = scales.Data[0].forwardingUnitName;
|
|
|
+ meterBaseUnitInfo.receivingUnitNo = scales.Data[0].receivingUintNo;
|
|
|
+ meterBaseUnitInfo.receivingUnitName = scales.Data[0].receivingUintName;
|
|
|
+ meterBaseUnitInfo.carNo = PbCache.lockCarNo;
|
|
|
+ RESTfulResult<List<MeterBaseUnitInfo>> tareUnitResult = meterBaseUnitInfoService.doQueryWf(meterBaseUnitInfo);
|
|
|
+ if (tareUnitResult.Succeed)
|
|
|
{
|
|
|
- MeterBaseTermTareDataService meterBaseTermTareDataService = new MeterBaseTermTareDataService();
|
|
|
- RESTfulResult<MeterBaseTermTareData> termTareData = meterBaseTermTareDataService.doQueryPageWf(new MeterBaseTermTareData { carNo = PbCache.lockCarNo, valueFlag = "0" });
|
|
|
- if (termTareData.Succeed)
|
|
|
+ if (tareUnitResult.Data == null || tareUnitResult.Data.Count == 0)
|
|
|
+ {
|
|
|
+ countTerm++;
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- meterWorkCarActualFirsts.Add(item);
|
|
|
+ MeterBaseTermTareDataService meterBaseTermTareDataService = new MeterBaseTermTareDataService();
|
|
|
+ RESTfulResult<MeterBaseTermTareData> termTareData = meterBaseTermTareDataService.doQueryPageWf(new MeterBaseTermTareData { carNo = PbCache.lockCarNo, valueFlag = "0" });
|
|
|
+ if (termTareData.Succeed)
|
|
|
+ {
|
|
|
+ meterWorkCarActualFirsts.Add(item);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ countTerm++;
|
|
|
+ }
|
|
|
}
|
|
|
- else
|
|
|
+
|
|
|
+ if (countTerm == 0)
|
|
|
{
|
|
|
- countTerm++;
|
|
|
+ rt = saveMethod.doNetAddMuchGross(meterWorkCarActualFirsts,mwaf);
|
|
|
+ rt.resultInfo = "计量完成,留存期限皮成功";
|
|
|
+ PbCache.voiceType = 9;
|
|
|
+ PbCache.ResultMessage = "计量成功,留存期限皮成功";
|
|
|
+ PbCache.monitorResultMessage = string.Format("计量成功,留存期限皮成功");
|
|
|
+ PbCache.LEDResultMessage = string.Format("车号{0},皮重{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- if (countTerm == 0)
|
|
|
- {
|
|
|
- rt = saveMethod.doNetAddMuchGross(meterWorkCarActualFirsts,mwaf);
|
|
|
- rt.resultInfo = "计量完成,留存期限皮成功";
|
|
|
- PbCache.voiceType = 9;
|
|
|
- PbCache.ResultMessage = "计量成功,留存期限皮成功";
|
|
|
- PbCache.monitorResultMessage = string.Format("计量成功,留存期限皮成功");
|
|
|
- PbCache.LEDResultMessage = string.Format("车号{0},皮重{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
|
|
|
- }
|
|
|
- else if (countTerm == firstList.Count)
|
|
|
- {
|
|
|
- RESTfulResult<List<PreTrackScale>> scales = preTrackScaleService.doQueryWf(new PreTrackScale { predictionNo = firstList[0].predictionNo });
|
|
|
+ else if (countTerm == firstList.Count)
|
|
|
+ {
|
|
|
+ RESTfulResult<List<PreTrackScale>> scales = preTrackScaleService.doQueryWf(new PreTrackScale { predictionNo = firstList[0].predictionNo });
|
|
|
|
|
|
- //匹配结净
|
|
|
- EntityBase<PreTrackScale> entityBase2 = new EntityBase<PreTrackScale>();
|
|
|
- mwaf = entityBase2.format<MeterWorkCarActualFirst>(scales.Data[0], mwaf);
|
|
|
- mwaf.isPreScale = "1";
|
|
|
- mwaf.weightType = "0";
|
|
|
- PbCache.voiceType = 1;
|
|
|
- rt = saveMethod.doNet(scales.Data[0], firstList[0], mwaf);
|
|
|
- PbCache.LEDResultMessage = string.Format("车号{0},皮重{1}吨,净重{2}吨,存在未结净毛重", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(firstList[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
|
|
|
- PbCache.monitorResultMessage = string.Format("车号{0}有{1}条未结净的毛重;", PbCache.lockCarNo,firstList.Count-1);
|
|
|
+ //匹配结净
|
|
|
+ EntityBase<PreTrackScale> entityBase2 = new EntityBase<PreTrackScale>();
|
|
|
+ mwaf = entityBase2.format<MeterWorkCarActualFirst>(scales.Data[0], mwaf);
|
|
|
+ mwaf.isPreScale = "1";
|
|
|
+ mwaf.weightType = "0";
|
|
|
+ PbCache.voiceType = 1;
|
|
|
+ rt = saveMethod.doNet(scales.Data[0], firstList[0], mwaf);
|
|
|
+ PbCache.LEDResultMessage = string.Format("车号{0},皮重{1}吨,净重{2}吨,存在未结净毛重", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(firstList[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
|
|
|
+ PbCache.monitorResultMessage = string.Format("车号{0}有{1}条未结净的毛重;", PbCache.lockCarNo,firstList.Count-1);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ rt = saveMethod.doNetAddMuchGross(meterWorkCarActualFirsts, mwaf);
|
|
|
+ PbCache.voiceType = 11;
|
|
|
+ rt.resultInfo += ",存在未结净毛重";
|
|
|
+ PbCache.ResultMessage = "计量成功,存在未结净毛重";
|
|
|
+ PbCache.LEDResultMessage = string.Format("车号{0},皮重{1}吨,计量完成,存在未结净毛重", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
|
|
|
+ PbCache.monitorResultMessage = string.Format("车号{0}使用期限皮同时结净{1}条毛重数据,还有{2}条未结净的毛重;", PbCache.lockCarNo, firstList.Count - countTerm,countTerm);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- rt = saveMethod.doNetAddMuchGross(meterWorkCarActualFirsts, mwaf);
|
|
|
- PbCache.voiceType = 11;
|
|
|
- rt.resultInfo += ",存在未结净毛重";
|
|
|
- PbCache.ResultMessage = "计量成功,存在未结净毛重";
|
|
|
- PbCache.LEDResultMessage = string.Format("车号{0},皮重{1}吨,计量完成,存在未结净毛重", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
|
|
|
- PbCache.monitorResultMessage = string.Format("车号{0}使用期限皮同时结净{1}条毛重数据,还有{2}条未结净的毛重;", PbCache.lockCarNo, firstList.Count - countTerm,countTerm);
|
|
|
+ if (PbCache.ResultMessage == "")
|
|
|
+ {
|
|
|
+ PbCache.ResultMessage = "重量类型为皮重且不在皮重误差内";
|
|
|
+ }
|
|
|
+ PbCache.voiceType = 13;
|
|
|
+ rt = saveMethod.doError(PbCache.ResultMessage);
|
|
|
+ rt.isWarn = true;
|
|
|
+ rt.WarnContent = "validWgt";
|
|
|
+ return rt;
|
|
|
}
|
|
|
}
|
|
|
}
|