|
|
|
@ -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;
|
|
|
|
|