|
|
|
@ -7613,20 +7613,21 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
|
|
|
|
|
result.SetErrorInfo("请维护用户基础信息中的电话和邮箱");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CtnCanSend(CarrierEDICode, ctns, ref result);
|
|
|
|
|
//foreach (var ctn in ctns) {
|
|
|
|
|
// if (string.IsNullOrWhiteSpace( ctn.CTNALL)) result.SetErrorInfo("必须选择箱型");
|
|
|
|
|
// if (ctn.CTNNUM <= 0) result.SetErrorInfo("箱量不能为零");
|
|
|
|
|
// if (string.IsNullOrWhiteSpace(ctn.CNTRNO)) result.SetErrorInfo("箱号不能为空");
|
|
|
|
|
// if (string.IsNullOrWhiteSpace(ctn.SEALNO)) result.SetErrorInfo("封号不能为空");
|
|
|
|
|
// if (ctn.KGS <= 0) result.SetErrorInfo("毛重不能为零");
|
|
|
|
|
// if (ctn.TAREWEIGHT <= 0) result.SetErrorInfo("皮重不能为零");
|
|
|
|
|
// if (ctn.WEIGHKGS <= 0) result.SetErrorInfo("称重重量不能为零");
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
foreach (var ctn in ctns) {
|
|
|
|
|
if (string.IsNullOrWhiteSpace( ctn.CTNALL)) result.SetErrorInfo("必须选择箱型");
|
|
|
|
|
if (ctn.CTNNUM <= 0) result.SetErrorInfo("箱量不能为零");
|
|
|
|
|
if (string.IsNullOrWhiteSpace(ctn.CNTRNO)) result.SetErrorInfo("箱号不能为空");
|
|
|
|
|
if (string.IsNullOrWhiteSpace(ctn.SEALNO)) result.SetErrorInfo("封号不能为空");
|
|
|
|
|
if (ctn.KGS <= 0) result.SetErrorInfo("毛重不能为零");
|
|
|
|
|
if (ctn.TAREWEIGHT <= 0) result.SetErrorInfo("皮重不能为零");
|
|
|
|
|
if (ctn.WEIGHKGS <= 0) result.SetErrorInfo("称重重量不能为零");
|
|
|
|
|
}
|
|
|
|
|
if (userbaseinfo == null || string.IsNullOrWhiteSpace(userbaseinfo.Tel) || string.IsNullOrWhiteSpace(userbaseinfo.Email))
|
|
|
|
|
{
|
|
|
|
|
result.SetErrorInfo("请维护用户基础信息中的电话和邮箱");
|
|
|
|
|
}
|
|
|
|
|
//if (userbaseinfo == null || string.IsNullOrWhiteSpace(userbaseinfo.Tel) || string.IsNullOrWhiteSpace(userbaseinfo.Email))
|
|
|
|
|
//{
|
|
|
|
|
// result.SetErrorInfo("请维护用户基础信息中的电话和邮箱");
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
if (!result.Success) return result;
|
|
|
|
|
|
|
|
|
@ -7709,5 +7710,109 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 判断箱信息必填
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="CarrierEDICode"></param>
|
|
|
|
|
/// <param name="ctns"></param>
|
|
|
|
|
/// <param name="result"></param>
|
|
|
|
|
public static void CtnCanSend(string CarrierEDICode, List<MsOpSeaeDetail>ctns,ref DBResult result) {
|
|
|
|
|
|
|
|
|
|
//http://txxp.myshipping.net/vgm/infoadd 是djypublic项目中的公开接口
|
|
|
|
|
//接口内要求如下:
|
|
|
|
|
/*
|
|
|
|
|
//1必须有箱型箱号
|
|
|
|
|
//2不能有重复的箱号
|
|
|
|
|
//3不能有不同的称重方式
|
|
|
|
|
//4 sm2称重方式,总重需要等于皮重加毛重
|
|
|
|
|
if (item.BoxType.IsNull() || item.Code.IsNull())
|
|
|
|
|
{
|
|
|
|
|
rs.Not($"{Dto.SendOrderCode}箱型、箱号不能为空第{item.Index}条");
|
|
|
|
|
return rs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (newboxlist.Where(w => w.Code == item.Code).Count() > 1)
|
|
|
|
|
{
|
|
|
|
|
rs.Not($"{Dto.SendOrderCode}箱号重复第{item.Index}条");
|
|
|
|
|
return rs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.WeigthType != __WeigthType)
|
|
|
|
|
{
|
|
|
|
|
rs.Not($"{Dto.SendOrderCode}称重方式不可混编,第{item.Index}条");
|
|
|
|
|
return rs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (item.WeigthType == "SM2" && (Math.Round(item.WeigthTotal, 4) != Math.Round((item.Weigth + item.WeigthTare), 4)))
|
|
|
|
|
{
|
|
|
|
|
rs.Not($"{Dto.SendOrderCode}VGM要等于毛重和皮重合计,第{item.Index}条");
|
|
|
|
|
//if (item.WeigthType == "SM2")
|
|
|
|
|
//{
|
|
|
|
|
// var w = item.WeigthType;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
//if (item.WeigthTotal != (item.Weigth + item.WeigthTare))
|
|
|
|
|
//{
|
|
|
|
|
// var total = item.Weigth + item.WeigthTare;
|
|
|
|
|
|
|
|
|
|
// var to = item.WeigthTotal - (item.Weigth + item.WeigthTare);
|
|
|
|
|
//}
|
|
|
|
|
return rs;
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if (CarrierEDICode.ToUpper() == "ESL")
|
|
|
|
|
{
|
|
|
|
|
//船公司ESL只需要指定 提单号 箱号 毛重kgs ,
|
|
|
|
|
|
|
|
|
|
//故做如下限制
|
|
|
|
|
foreach (var ctn in ctns)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrWhiteSpace(ctn.CTNALL)) result.SetErrorInfo("必须选择箱型");
|
|
|
|
|
if (ctn.CTNNUM <= 0) result.SetErrorInfo("箱量不能为零");
|
|
|
|
|
if (string.IsNullOrWhiteSpace(ctn.CNTRNO)) result.SetErrorInfo("箱号不能为空");
|
|
|
|
|
if (ctn.KGS <= 0) result.SetErrorInfo("毛重不能为零");
|
|
|
|
|
|
|
|
|
|
//if (string.IsNullOrWhiteSpace(ctn.SEALNO)) result.SetErrorInfo("封号不能为空");
|
|
|
|
|
//if (ctn.TAREWEIGHT <= 0) result.SetErrorInfo("皮重不能为零");
|
|
|
|
|
//if (ctn.WEIGHKGS <= 0) result.SetErrorInfo("称重重量不能为零");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (CarrierEDICode.ToUpper() == "ONE")
|
|
|
|
|
{
|
|
|
|
|
//船公司ONE只需要指定 提单号 箱号 毛重kgs ,
|
|
|
|
|
|
|
|
|
|
//故做如下限制
|
|
|
|
|
foreach (var ctn in ctns)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrWhiteSpace(ctn.CTNALL)) result.SetErrorInfo("必须选择箱型");
|
|
|
|
|
if (ctn.CTNNUM <= 0) result.SetErrorInfo("箱量不能为零");
|
|
|
|
|
if (string.IsNullOrWhiteSpace(ctn.CNTRNO)) result.SetErrorInfo("箱号不能为空");
|
|
|
|
|
if (ctn.KGS <= 0) result.SetErrorInfo("毛重不能为零");
|
|
|
|
|
|
|
|
|
|
//if (string.IsNullOrWhiteSpace(ctn.SEALNO)) result.SetErrorInfo("封号不能为空");
|
|
|
|
|
//if (ctn.TAREWEIGHT <= 0) result.SetErrorInfo("皮重不能为零");
|
|
|
|
|
//if (ctn.WEIGHKGS <= 0) result.SetErrorInfo("称重重量不能为零");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//对所有未指定的其他船公司而言:
|
|
|
|
|
foreach (var ctn in ctns)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrWhiteSpace(ctn.CTNALL)) result.SetErrorInfo("必须选择箱型");
|
|
|
|
|
if (ctn.CTNNUM <= 0) result.SetErrorInfo("箱量不能为零");
|
|
|
|
|
if (string.IsNullOrWhiteSpace(ctn.CNTRNO)) result.SetErrorInfo("箱号不能为空");
|
|
|
|
|
if (string.IsNullOrWhiteSpace(ctn.SEALNO)) result.SetErrorInfo("封号不能为空");
|
|
|
|
|
if (ctn.KGS <= 0) result.SetErrorInfo("毛重不能为零");
|
|
|
|
|
if (ctn.TAREWEIGHT <= 0) result.SetErrorInfo("皮重不能为零");
|
|
|
|
|
if (ctn.WEIGHKGS <= 0) result.SetErrorInfo("称重重量不能为零");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|