Browse Source

提交

master
学 赵 4 years ago
parent
commit
c3b2d263ed
  1. 69
      Controller/SCP_DC_UNI_CONTROLLER.cs
  2. 1
      Models/CK.SCP.Models.csproj
  3. 3
      Models/ScpEntity/TB_RECEIVE_DETAIL.cs
  4. 5
      Models/ScpEntity/V_TB_ASK.cs
  5. 8
      Models/ScpEntity/V_TB_ASK_DETAIL.cs
  6. 5
      Models/ScpEntity/V_TB_ASN_DETAIL.cs
  7. 31
      Models/ScpEntity/V_TB_FORECAST.cs
  8. 2
      Models/ScpEntity/V_TB_INVOICE.cs
  9. 3
      Models/ScpEntity/V_TB_INVOICE_DETAIL.cs
  10. 5
      Models/ScpEntity/V_TB_PO.cs
  11. 5
      Models/ScpEntity/V_TB_PO_DETAIL.cs
  12. 4
      Models/ScpEntity/V_TB_RECEIVE.cs
  13. 8
      Models/ScpEntity/V_TB_RECEIVE_DETAIL.cs

69
Controller/SCP_DC_UNI_CONTROLLER.cs

@ -904,7 +904,7 @@ namespace CK.SCP.Controller
scpRcvDetail.Qty = detail.ReceiveQuantity;
}
// var _str=JsonHelper.GetJson<List<TB_RECEIVE_DETAIL>>(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<TB_ARRIVE>();
var _scpPoDetailList = new List<TB_RECEIVE>();
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<TB_ARRIVE>();
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<TB_RECEIVE>();
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<TB_ARRIVE_DETAIL>();
var scpRcveDetailList = new List<TB_RECEIVE_DETAIL>();
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<List<TB_ARRIVE_DETAIL>>(scpRcveDetailList);
scpdb.TB_ARRIVE_DETAIL.AddOrUpdate(scpRcveDetailList.ToArray());
var _str = JsonHelper.GetJson<List<TB_RECEIVE_DETAIL>>(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<LogModel> _ret = new ResultObject<LogModel>();
List<TED_INVOICE_MSTR> _mstList = new List<TED_INVOICE_MSTR>();
List<TED_INVOICE_DET> _detList = new List<TED_INVOICE_DET>();
// List<TED_INVOICE_ADD> _addList = new List<TED_INVOICE_ADD>();
//List<TED_INVOICE_ADD> _addList = new List<TED_INVOICE_ADD>();
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<TB_ARRIVE>();
var _scpPoDetailList = new List<TB_RECEIVE>();
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<TB_ARRIVE>();
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<TB_RECEIVE>();
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<TB_ARRIVE_DETAIL>();
var scpRcveDetailList = new List<TB_RECEIVE_DETAIL>();
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<List<TB_ARRIVE_DETAIL>>(scpRcveDetailList);
scpdb.TB_ARRIVE_DETAIL.AddOrUpdate(scpRcveDetailList.ToArray());
var _str = JsonHelper.GetJson<List<TB_RECEIVE_DETAIL>>(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));

1
Models/CK.SCP.Models.csproj

@ -410,7 +410,6 @@
<Compile Include="ScpEntity\V_TB_ARRIVE_DETAIL.cs" />
<Compile Include="ScpEntity\V_TB_ASK.cs" />
<Compile Include="ScpEntity\V_TB_ASK_DETAIL_PACKAGE.cs" />
<Compile Include="ScpEntity\V_TB_FORECAST.cs" />
<Compile Include="ScpEntity\V_TB_INVOICE_ASK.cs" />
<Compile Include="ScpEntity\V_TB_PALLET.cs" />
<Compile Include="ScpEntity\V_TB_PALLET_DETAIL .cs" />

3
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; }
}
}

5
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; }

8
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; }

5
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; }
}
}

31
Models/ScpEntity/V_TB_FORECAST.cs

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

2
Models/ScpEntity/V_TB_INVOICE.cs

@ -75,7 +75,7 @@ namespace CK.SCP.Models.ScpEntity
/// </summary>
public decimal? StdCost { get; set; }
public string SubSite { get; set; }
[NotMapped]

3
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; }
}
}

5
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; }

5
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; }
}
}

4
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; }
}
}

8
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; }
}
}

Loading…
Cancel
Save