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 MeterConditionLibrary
{
///
/// 验证提单量:001006002 外销出厂-复磅(码头);001006011 外销出厂计量
/// 若二次资源物料的提单量为空,则不允许进行计量
/// 若提单量超出,则不允许进行计量操作
///
public class validShipWeight
{
validMatterName validMName = new validMatterName();
public bool ValidMethod(PreTrackScale scale)
{
try
{
//若计量员记录则不验证,则为true
if (PbCache.isNotValid)
{
return true;
}
//001006002 外销出厂-复磅(码头);001006011 外销出厂计量
if ("001006002".Equals(scale.meterTypeNo) || "001006011".Equals(scale.meterTypeNo))
{
//二次资源物料
if (validMName.ValidSecondResourcesMatter(scale))
{
//if (scale.shipmentNetWeight==null || scale.shipmentNetWeight==0)
//{
// PbCache.ResultMessage = "【" + scale.meterTypeName + "】业务,二次资源物料【"+ scale.matterName + "】提单量为空,不允许进行计量操作!";
// return false;
//}
PreTrackNoticeService noticeService = new PreTrackNoticeService();
RESTfulResult rmR = noticeService.doCalculateWeight(scale);
if (rmR.Succeed)
{
if (string.IsNullOrEmpty(rmR.Data) || !rmR.Data.ToString().Contains("禁止"))
{
return true;
}
else
{
PbCache.ResultMessage = rmR.Data;
return false;
}
}
else
{
PbCache.ResultMessage = "【" + scale.meterTypeName + "】业务,计算已运输的运单量失败,请点【语音求助】,联系司秤工处理!";
return false;
}
}
}
return true;
}
catch (Exception ex)
{
PbCache.ResultMessage = "【" + scale.meterTypeName + "】业务,计算已运输的运单量失败,请点【语音求助】,联系司秤工处理!"+ ex.Message;
return false;
}
}
}
}