diff --git a/Controller/SCP_DC_UNI_CONTROLLER.cs b/Controller/SCP_DC_UNI_CONTROLLER.cs index 8c9a182..61292f2 100644 --- a/Controller/SCP_DC_UNI_CONTROLLER.cs +++ b/Controller/SCP_DC_UNI_CONTROLLER.cs @@ -904,7 +904,7 @@ namespace CK.SCP.Controller scpRcvDetail.Qty = detail.ReceiveQuantity; } // var _str=JsonHelper.GetJson>(scpRcveDetailList); - scpdb.TB_RECEIVE_DETAIL.AddOrUpdate(scpRcveDetailList.ToArray()); + scpdb.TB_RECEIVE_DETAIL_QAD.AddOrUpdate(scpRcveDetailList.ToArray()); _ret.State = ReturnStatus.Succeed; _ret.MessageList.Add(string.Format("QAD收货单更新{0}任务编号{1}", _reciveDetailList.Count().ToString(), p_entity.TaskID)); _ret.Result = true; @@ -929,11 +929,12 @@ namespace CK.SCP.Controller try { var _reciveList = db.TED_RECEIPT_MSTR.Where(p => p.TaskID == p_entity.TaskID && !string.IsNullOrEmpty(p.ReceiveNbr)).ToList(); - var _scpPoDetailList = new List(); + var _scpPoDetailList = new List(); foreach (var detail in _reciveList) { - var scpRcv = scpdb.TB_ARRIVE.SingleOrDefault(p => p.ArrvBillNum != null && p.ArrvBillNum == detail.ReceiveNbr && p.Site == detail.Domain && p.SubSite == detail.Site); - var scpRcvList = new List(); + + var scpRcv = scpdb.TB_RECEIVE.SingleOrDefault(p => p.RecvBillNum != null && p.RecvBillNum == detail.ReceiveNbr && p.Site == detail.Domain && p.SubSite == detail.Site); + var scpRcvList = new List(); bool isRerviceOk = false; if (!string.IsNullOrEmpty(detail.Site) && !string.IsNullOrEmpty(detail.Domain)) { @@ -963,9 +964,9 @@ namespace CK.SCP.Controller { istate = (int)FormState.开放; } - scpRcv = new TB_ARRIVE + scpRcv = new TB_RECEIVE { - ArrvBillNum = detail.ReceiveNbr,//收货单号 + RecvBillNum = detail.ReceiveNbr,//收货单号 State = istate, Remark = "", CreateTime = detail.CreateTime == null ? DateTime.Now : (DateTime)detail.CreateTime,//创建日期 @@ -991,17 +992,17 @@ namespace CK.SCP.Controller scpRcv.VendId = detail.Supplier;//供货商名称 scpRcv.ShipTime = detail.ReceiptDate;//收货日期 scpRcv.SubSite = detail.Site; - scpdb.TB_ARRIVE.AddOrUpdate(scpRcvList.ToArray()); + scpdb.TB_RECEIVE.AddOrUpdate(scpRcvList.ToArray()); } - var scpRcveDetailList = new List(); + var scpRcveDetailList = new List(); var _reciveDetailList = db.TED_RECEIPT_DET.Where(p => p.TaskID == p_entity.TaskID && !string.IsNullOrEmpty(p.ReceiveNbr)).ToList(); foreach (var detail in _reciveDetailList) { var poLineNum = Convert.ToInt32(detail.Line); var scpRcvDetail = - scpdb.TB_ARRIVE_DETAIL.SingleOrDefault( - p => p.ArrvBillNum == detail.ReceiveNbr && + scpdb.TB_RECEIVE_DETAIL.SingleOrDefault( + p => p.RecvBillNum == detail.ReceiveNbr && p.PoBillNum == detail.PurchaseOrder && p.PoLine == detail.Line && p.PartCode == detail.PartCode && @@ -1020,8 +1021,8 @@ namespace CK.SCP.Controller //{ // istate = (int)FormState.开放; //} - scpRcvDetail = new TB_ARRIVE_DETAIL(); - scpRcvDetail.ArrvBillNum = detail.ReceiveNbr;//收货单号 + scpRcvDetail = new TB_RECEIVE_DETAIL(); + scpRcvDetail.RecvBillNum = detail.ReceiveNbr;//收货单号 scpRcvDetail.PoBillNum = detail.PurchaseOrder;//采购单 scpRcvDetail.PoLine = detail.Line;//订单行 scpRcvDetail.PartCode = detail.PartCode;//零件号 @@ -1042,8 +1043,8 @@ namespace CK.SCP.Controller scpRcveDetailList.Add(scpRcvDetail); } } - var _str = JsonHelper.GetJson>(scpRcveDetailList); - scpdb.TB_ARRIVE_DETAIL.AddOrUpdate(scpRcveDetailList.ToArray()); + var _str = JsonHelper.GetJson>(scpRcveDetailList); + scpdb.TB_RECEIVE_DETAIL.AddOrUpdate(scpRcveDetailList.ToArray()); _ret.State = ReturnStatus.Succeed; _ret.MessageList.Add(string.Format("到货单更新{0}任务编号{1}", _reciveDetailList.Count().ToString(), p_entity.TaskID)); _ret.Result = true; @@ -1089,7 +1090,7 @@ namespace CK.SCP.Controller ResultObject _ret = new ResultObject(); List _mstList = new List(); List _detList = new List(); - // List _addList = new List(); + //List _addList = new List(); try { if (p_invoiceList.FirstOrDefault() != null) @@ -1111,7 +1112,7 @@ namespace CK.SCP.Controller _invMast.InvoiceHoldAmountTC = _vinvoice.Amount.Value; _invMast.InvoiceVoucher = 0; _invMast.InvoiceRegistrationNbr = 1000; - _invMast.PostingDate = _vinvoice.PostingDate==null?DateTime.Now:_vinvoice.PostingDate.Value; + _invMast.PostingDate = DateTime.Now; _invMast.Currency = "CNY"; _invMast.InvoiceDate = _vinvoice.UpdateTime == null ? DateTime.Now : _vinvoice.UpdateTime.Value; @@ -1121,7 +1122,7 @@ namespace CK.SCP.Controller _invMast.PaymentCondCode = "90"; _invMast.InvoiceDueDate = _invMast.InvoiceDate.AddDays(int.Parse(_invMast.PaymentCondCode)); _invMast.InvoiceIsStatusFinal = true; - _invMast.InvoicePostingYear = _vinvoice.PostingDate==null?DateTime.Now.Year: _vinvoice.PostingDate.Value.Year; + _invMast.InvoicePostingYear = DateTime.Now.Year; _invMast.APMatchingIsStatusFinal = true; _invMast.InvoiceRemark = _vinvoice.InvcBillNum;//发票编号 _invMast.CreateWithAmountIsTax = true; @@ -1135,11 +1136,11 @@ namespace CK.SCP.Controller _invMast.DataID = Guid.NewGuid(); _invMast.Domain = _vinvoice.Site; _invMast.Site = _vinvoice.SubSite; - _invMast.CInvoiceCostCenterCode = _vinvoice.CInvoiceCostCenterCode; + // _invMast.CInvoiceCostCenterCode = _vinvoice.CInvoiceCostCenterCode; _invMast.CInvoiceReference = _vinvoice.InvoiceNum; - _invMast.CInvoiceDescription = _vinvoice.CInvoiceDescription; - _invMast.CInvoiceType = _vinvoice.CInvoiceType; - _invMast.CInvoiceDivisionCode = _vinvoice.CInvoiceDivisionCode; + // _invMast.CInvoiceDescription = _vinvoice.CInvoiceDescription; + // _invMast.CInvoiceType = _vinvoice.CInvoiceType; + // _invMast.CInvoiceDivisionCode = _vinvoice.CInvoiceDivisionCode; _mstList.Add(_invMast); #endregion @@ -1234,11 +1235,11 @@ namespace CK.SCP.Controller try { var _reciveList = db.TED_RETURN_MSTR.Where(p => p.TaskID == p_entity.TaskID && !string.IsNullOrEmpty(p.ReturnNbr)).ToList(); - var _scpPoDetailList = new List(); + var _scpPoDetailList = new List(); foreach (var detail in _reciveList) { - var scpRcv = scpdb.TB_ARRIVE.SingleOrDefault(p => p.ArrvBillNum != null && p.ArrvBillNum == detail.ReturnNbr && p.Site == detail.Domain && p.SubSite == detail.Site); - var scpRcvList = new List(); + var scpRcv = scpdb.TB_RECEIVE.SingleOrDefault(p => p.RecvBillNum != null && p.RecvBillNum == detail.ReturnNbr && p.Site == detail.Domain && p.SubSite == detail.Site); + var scpRcvList = new List(); bool isRerviceOk = false; if (!string.IsNullOrEmpty(detail.Site) && !string.IsNullOrEmpty(detail.Domain)) { @@ -1268,9 +1269,9 @@ namespace CK.SCP.Controller { istate = (int)FormState.开放; } - scpRcv = new TB_ARRIVE + scpRcv = new TB_RECEIVE { - ArrvBillNum = detail.ReturnNbr,//收货单号 + RecvBillNum = detail.ReturnNbr,//收货单号 State = istate, Remark = "", CreateTime = detail.CreateTime == null ? DateTime.Now : (DateTime)detail.CreateTime,//创建日期 @@ -1296,10 +1297,10 @@ namespace CK.SCP.Controller scpRcv.VendId = detail.Supplier;//供货商名称 scpRcv.ShipTime = detail.ReturnDate;//收货日期 scpRcv.SubSite = detail.Site; - scpdb.TB_ARRIVE.AddOrUpdate(scpRcvList.ToArray()); + scpdb.TB_RECEIVE.AddOrUpdate(scpRcvList.ToArray()); } - var scpRcveDetailList = new List(); + var scpRcveDetailList = new List(); var _reciveDetailList = db.TED_RETURN_DET.Where(p => p.TaskID == p_entity.TaskID ).ToList(); var _recive = db.TED_RETURN_MSTR.Where(p => p.TaskID == p_entity.TaskID && !string.IsNullOrEmpty(p.ReturnNbr)).FirstOrDefault(); if (_recive != null) @@ -1309,8 +1310,8 @@ namespace CK.SCP.Controller detail.ReturnNbr = _recive.ReturnNbr; var poLineNum = Convert.ToInt32(detail.Line); var scpRcvDetail = - scpdb.TB_ARRIVE_DETAIL.SingleOrDefault( - p => p.ArrvBillNum == detail.ReturnNbr && + scpdb.TB_RECEIVE_DETAIL.SingleOrDefault( + p => p.RecvBillNum == detail.ReturnNbr && p.PoBillNum == detail.PurchaseOrder && p.PoLine == detail.Line && p.PartCode == detail.PartCode && @@ -1329,8 +1330,8 @@ namespace CK.SCP.Controller //{ // istate = (int)FormState.开放; //} - scpRcvDetail = new TB_ARRIVE_DETAIL(); - scpRcvDetail.ArrvBillNum = detail.ReturnNbr;//收货单号 + scpRcvDetail = new TB_RECEIVE_DETAIL(); + scpRcvDetail.RecvBillNum = detail.ReturnNbr;//收货单号 scpRcvDetail.PoBillNum = detail.PurchaseOrder;//采购单 scpRcvDetail.PoLine = detail.Line;//订单行 scpRcvDetail.PartCode = detail.PartCode;//零件号 @@ -1352,8 +1353,8 @@ namespace CK.SCP.Controller scpRcveDetailList.Add(scpRcvDetail); } } - var _str = JsonHelper.GetJson>(scpRcveDetailList); - scpdb.TB_ARRIVE_DETAIL.AddOrUpdate(scpRcveDetailList.ToArray()); + var _str = JsonHelper.GetJson>(scpRcveDetailList); + scpdb.TB_RECEIVE_DETAIL.AddOrUpdate(scpRcveDetailList.ToArray()); } _ret.State = ReturnStatus.Succeed; _ret.MessageList.Add(string.Format("退货单更新{0}任务编号{1}", _reciveDetailList.Count().ToString(), p_entity.TaskID)); diff --git a/Models/CK.SCP.Models.csproj b/Models/CK.SCP.Models.csproj index 35c9344..9485ea2 100644 --- a/Models/CK.SCP.Models.csproj +++ b/Models/CK.SCP.Models.csproj @@ -410,7 +410,6 @@ - diff --git a/Models/ScpEntity/TB_RECEIVE_DETAIL.cs b/Models/ScpEntity/TB_RECEIVE_DETAIL.cs index 3937d45..eeb8391 100644 --- a/Models/ScpEntity/TB_RECEIVE_DETAIL.cs +++ b/Models/ScpEntity/TB_RECEIVE_DETAIL.cs @@ -45,5 +45,8 @@ namespace CK.SCP.Models.ScpEntity public string SubSite { get; set; } + public string Site { get; set; } + + } } diff --git a/Models/ScpEntity/V_TB_ASK.cs b/Models/ScpEntity/V_TB_ASK.cs index 5118c78..4295bab 100644 --- a/Models/ScpEntity/V_TB_ASK.cs +++ b/Models/ScpEntity/V_TB_ASK.cs @@ -52,6 +52,11 @@ namespace CK.SCP.Models.ScpEntity public DateTime? BeginTime { get; set; } public DateTime? EndTime { get; set; } + public string Extend1 { get; set; } + public string Extend2 { get; set; } + public string Extend3 { get; set; } + + public string SubSite { get; set; } #region 条件 [NotMapped] public string Batch { get; set; } diff --git a/Models/ScpEntity/V_TB_ASK_DETAIL.cs b/Models/ScpEntity/V_TB_ASK_DETAIL.cs index c0e7340..ff16455 100644 --- a/Models/ScpEntity/V_TB_ASK_DETAIL.cs +++ b/Models/ScpEntity/V_TB_ASK_DETAIL.cs @@ -87,6 +87,14 @@ namespace CK.SCP.Models.ScpEntity public int ValidityDays { get; set; } + + public string Extend1 { get; set; } + public string Extend2 { get; set; } + public string Extend3 { get; set; } + + public string SubSite { get; set; } + + [NotMapped] [Column(TypeName = "money")] public decimal? TempQty { get; set; } diff --git a/Models/ScpEntity/V_TB_ASN_DETAIL.cs b/Models/ScpEntity/V_TB_ASN_DETAIL.cs index 5407ca8..972bcb8 100644 --- a/Models/ScpEntity/V_TB_ASN_DETAIL.cs +++ b/Models/ScpEntity/V_TB_ASN_DETAIL.cs @@ -90,5 +90,10 @@ namespace CK.SCP.Models.ScpEntity [NotMapped] public string SQE_EndTime { get; set; } public String VendPartCode { get; set; } + public string Extend1 { get; set; } + public string Extend2 { get; set; } + public string Extend3 { get; set; } + + public string SubSite { get; set; } } } diff --git a/Models/ScpEntity/V_TB_FORECAST.cs b/Models/ScpEntity/V_TB_FORECAST.cs deleted file mode 100644 index 2619dcf..0000000 --- a/Models/ScpEntity/V_TB_FORECAST.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace CK.SCP.Models.ScpEntity -{ - public class V_TB_FORECAST : RecordEntity - { - [Key] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public long UID { get; set; } - [StringLength(50)] - public string PartCode { get; set; } - [StringLength(50)] - public string VendId { get; set; } - public int? State { get; set; } - public decimal MonthQty1 { get; set; } - public decimal MonthQty2 { get; set; } - public decimal MonthQty3 { get; set; } - public string Month { get; set; } - [StringLength(50)] - public string State_DESC { get; set; } - [StringLength(50)] - public string Site { get; set; } - - } -} diff --git a/Models/ScpEntity/V_TB_INVOICE.cs b/Models/ScpEntity/V_TB_INVOICE.cs index 3003ebd..ae4f005 100644 --- a/Models/ScpEntity/V_TB_INVOICE.cs +++ b/Models/ScpEntity/V_TB_INVOICE.cs @@ -75,7 +75,7 @@ namespace CK.SCP.Models.ScpEntity /// public decimal? StdCost { get; set; } - + public string SubSite { get; set; } [NotMapped] diff --git a/Models/ScpEntity/V_TB_INVOICE_DETAIL.cs b/Models/ScpEntity/V_TB_INVOICE_DETAIL.cs index 1594329..4f84664 100644 --- a/Models/ScpEntity/V_TB_INVOICE_DETAIL.cs +++ b/Models/ScpEntity/V_TB_INVOICE_DETAIL.cs @@ -81,5 +81,8 @@ namespace CK.SCP.Models.ScpEntity public decimal? NEWTAX { get; set; } public decimal? DISTAX { get; set; } + + public string SubSite { get; set; } + } } diff --git a/Models/ScpEntity/V_TB_PO.cs b/Models/ScpEntity/V_TB_PO.cs index 3d1ad8f..ff3a585 100644 --- a/Models/ScpEntity/V_TB_PO.cs +++ b/Models/ScpEntity/V_TB_PO.cs @@ -52,6 +52,11 @@ namespace CK.SCP.Models.ScpEntity public string ReceivedPort { get; set; } [NotMapped] public string PartCode { get; set; } + public string Extend1 { get; set; } + public string Extend2 { get; set; } + public string Extend3 { get; set; } + + public string SubSite { get; set; } diff --git a/Models/ScpEntity/V_TB_PO_DETAIL.cs b/Models/ScpEntity/V_TB_PO_DETAIL.cs index 1a4cebc..6c8d7b4 100644 --- a/Models/ScpEntity/V_TB_PO_DETAIL.cs +++ b/Models/ScpEntity/V_TB_PO_DETAIL.cs @@ -62,5 +62,10 @@ namespace CK.SCP.Models.ScpEntity public decimal? ContractPrice { get; set; } [NotMapped] public decimal? BlancePrice { get; set; } + public string Extend1 { get; set; } + public string Extend2 { get; set; } + public string Extend3 { get; set; } + + public string SubSite { get; set; } } } diff --git a/Models/ScpEntity/V_TB_RECEIVE.cs b/Models/ScpEntity/V_TB_RECEIVE.cs index 1be70c8..5bc01ce 100644 --- a/Models/ScpEntity/V_TB_RECEIVE.cs +++ b/Models/ScpEntity/V_TB_RECEIVE.cs @@ -59,6 +59,10 @@ namespace CK.SCP.Models.ScpEntity public string ErpRecvBillNum { get; set; } + public string Extend1 { get; set; } + public string Extend2 { get; set; } + public string Extend3 { get; set; } + public string SubSite { get; set; } } } diff --git a/Models/ScpEntity/V_TB_RECEIVE_DETAIL.cs b/Models/ScpEntity/V_TB_RECEIVE_DETAIL.cs index eb1fdd4..8af2910 100644 --- a/Models/ScpEntity/V_TB_RECEIVE_DETAIL.cs +++ b/Models/ScpEntity/V_TB_RECEIVE_DETAIL.cs @@ -70,5 +70,13 @@ namespace CK.SCP.Models.ScpEntity public string Tax { set; get; } [NotMapped] public string ProjectId { set; get; } + + + + public string Extend1 { get; set; } + public string Extend2 { get; set; } + public string Extend3 { get; set; } + + public string SubSite { get; set; } } }