关贸云业务解析集装箱信息

DS7_JingHan
ddlucky 2 years ago
parent 994df165c2
commit b59289cdb9

@ -61,7 +61,7 @@ namespace DSWeb.Areas.CommMng.DAL
var _count = BasicDataRefDAL.GetExist("OP_APPLY", " BSNO='" + bsno + "' ");
var delDetailList = new List<MsOpApplyDetail>();
var delCtnList = new List<MsOpCtn>();
if (_count == 0)
{
@ -113,20 +113,50 @@ namespace DSWeb.Areas.CommMng.DAL
OpapplyCtnList = getCtnListInfo(head);
//同时将后台已有而此次没有的明细加入删除列表
var currDetailList= MsOpApplyDAL.GetBodyList(" BsNo='" + bsno + "'");
if (currDetailList.Count > 0) {
foreach (var item in currDetailList) {
if (OpapplyGoodsDetailList.Exists(x => x.BsNo == bsno && x.SerialNo == item.SerialNo))
{
}
else {
delDetailList.Add(item);
}
}
}
//var currDetailList= MsOpApplyDAL.GetBodyList(" BsNo='" + bsno + "'");
//if (currDetailList.Count > 0) {
// foreach (var item in currDetailList) {
// //如果存在 则update
// if (OpapplyGoodsDetailList.Exists(x => x.BsNo == bsno && x.SerialNo == item.SerialNo))
// {
// var updrec = OpapplyGoodsDetailList.First(x => x.BsNo == bsno && x.SerialNo == item.SerialNo);
// OpapplyGoodsDetailList.Remove(updrec);
// updrec.DbOperationType = DbOperationType.DbotUpd;
// updrec.BsNo=
// OpapplyGoodsDetailList.Add(updrec) ;
// }
// else {
// delDetailList.Add(item);
// }
// }
//}
//20230111 改为删除所有明细
BasicDataRefDAL.ExecSql($"delete from op_apply_detail where BSNO ='{bsno}'");
BasicDataRefDAL.ExecSql($"delete from op_ctn where BSNO ='{bsno}'");
//var currctnList = MsOpApplyDAL.GetCtnBodyList(" BsNo='" + bsno + "'");
//if (currctnList.Count > 0)
//{
// foreach (var item in currctnList)
// {
// if (OpapplyCtnList.Exists(x => x.BSNO == bsno && x.CNTRNO == item.CNTRNO))
// {
// var updrec = OpapplyCtnList.First(x => x.BSNO == bsno && x.CNTRNO == item.CNTRNO);
// OpapplyCtnList.Remove(updrec);
// updrec.DbOperationType = DbOperationType.DbotUpd;
// updrec.CTN_ID= item.CTN_ID;
// updrec.GID = item.GID;
// OpapplyCtnList.Add(updrec);
// }
// else
// {
// delCtnList.Add(item);
// }
// }
//}
}
@ -138,6 +168,8 @@ namespace DSWeb.Areas.CommMng.DAL
DBResult _r = modb.Save(OpapplyHead
, ModelObjectConvert<MsOpApplyDetail>.ToModelObjectList(OpapplyGoodsDetailList)
, ModelObjectConvert<MsOpApplyDetail>.ToModelObjectList(delDetailList)
, ModelObjectConvert<MsOpCtn>.ToModelObjectList(OpapplyCtnList)
, ModelObjectConvert<MsOpCtn>.ToModelObjectList(delCtnList)
);
result = new JsonResponse { Success = _r.Success, Message = _r.Message,Data=_r.Data };
@ -414,7 +446,7 @@ namespace DSWeb.Areas.CommMng.DAL
newrec.Pkgs = BasicDataRefDAL.String2Decimal(goodinfo.PACKEGES);
newrec.GOODSNUM = BasicDataRefDAL.String2Decimal(goodinfo.PACKEGES);
newrec.KGS = goodinfo.QTY;
//newrec. = goodinfo.QTY;
newrec.Price = BasicDataRefDAL.String2Decimal(goodinfo.PRICE);
newrec.Total = BasicDataRefDAL.String2Decimal(goodinfo.AMOUNT);
newrec.Currency = goodinfo.CURRENCY;
@ -432,18 +464,34 @@ namespace DSWeb.Areas.CommMng.DAL
{
var result = new List<MsOpCtn>();
var BSNO = head.BUSINESS_ORDER_INFO.WORK_NO;
var BSNO = head.GetBSNO();
//if (head.DECL_TRN_CONTAINER_LIST.Count > 0)
//{
// foreach (var good in head.GOODS_LIST)
// {
// var newrec = new MsOpCtn();
if (head.CONTA_LIST!=null && head.CONTA_LIST.Count > 0)
{
foreach (var ctn in head.CONTA_LIST)
{
var _ctn = ctn.DECL_CONTA;
var _ctnid = Guid.NewGuid().ToString();
decimal = string.IsNullOrWhiteSpace(_ctn.CONTA_GROSS_WEIGHT) ? 0 : Convert.ToDecimal(_ctn.CONTA_GROSS_WEIGHT);
decimal = string.IsNullOrWhiteSpace(_ctn.GOODS_CONTA_WT) ? 0 : Convert.ToDecimal(_ctn.GOODS_CONTA_WT);
decimal kgs = - ;
var newrec = new MsOpCtn
{
CTN_ID= _ctnid,
GID = _ctnid,
BSNO = BSNO,
CTNNUM=1,
CNTRNO= _ctn.CONTA_NO,
CTNALL= _ctn.CONTA_SIZE+_ctn.CONTA_TYPE,
TAREWEIGHT = ,
KGS= kgs,
};
// result.Add(newrec);
// }
//}
result.Add(newrec);
}
}
return result;

@ -1326,6 +1326,50 @@ namespace DSWeb.Areas.CommMng.Models
public DECL_GOODS DECL_GOODS { get; set; }
}
public class CONTA_LIST
{
/// <summary>
///
/// </summary>
public DECL_CONTA DECL_CONTA { get; set; }
}
public class DECL_CONTA
{
/// <summary>
/// 集装箱编号
/// </summary>
public string CONTA_NO { get; set; }
/// <summary>
/// 集装箱规格
/// </summary>
public string CONTA_SIZE { get; set; }
/// <summary>
/// 集装箱类型
/// </summary>
public string CONTA_TYPE { get; set; }
/// <summary>
/// 集装箱自重
/// </summary>
public string CONTA_GROSS_WEIGHT { get; set; }
/// <summary>
/// 集装箱规格
/// </summary>
public string CUS_CONTA_TYPE { get; set; }
/// <summary>
/// 拼箱标识
/// </summary>
public string LCL_FLAG { get; set; }
/// <summary>
/// 商品项号关系
/// </summary>
public string GOODS_NO { get; set; }
/// <summary>
/// 箱货重量
/// </summary>
public string GOODS_CONTA_WT { get; set; }
}
public class DECL_DOC
{
/// <summary>
@ -1420,6 +1464,8 @@ namespace DSWeb.Areas.CommMng.Models
///
/// </summary>
public List<GOODS_LIST> GOODS_LIST { get; set; }
public List<CONTA_LIST> CONTA_LIST { get; set; }
/// <summary>
///
/// </summary>

@ -155,6 +155,9 @@ namespace DSWeb.MvcShipping.Models.MsOpApply
#endregion
//public override string GetBillNoFieldName() {
// return "BsNo";
//}
public MsOpApplyDetail()
{
TableName = "op_apply_detail";
@ -868,6 +871,11 @@ namespace DSWeb.MvcShipping.Models.MsOpApply
{
TableName = "op_ctn";
}
//public override string GetBillNoFieldName()
//{
// return "BSNO";
//}
}
#region 参照部分

Loading…
Cancel
Save