销售发货单
This commit is contained in:
@@ -64,6 +64,7 @@
|
||||
<Compile Include="Request\Arrival.cs" />
|
||||
<Compile Include="Request\Bin.cs" />
|
||||
<Compile Include="Request\Customer.cs" />
|
||||
<Compile Include="Request\Dispatch.cs" />
|
||||
<Compile Include="Request\Materiel.cs" />
|
||||
<Compile Include="Request\MaterielType.cs" />
|
||||
<Compile Include="Request\OtherStoreIn.cs" />
|
||||
|
||||
12
NX.ERP.Model/Request/Dispatch.cs
Normal file
12
NX.ERP.Model/Request/Dispatch.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NX.ERP.Model.Request
|
||||
{
|
||||
public class Dispatch
|
||||
{
|
||||
public string SalesOrderNo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,16 +7,16 @@ namespace NX.ERP.Model.Sale
|
||||
{
|
||||
public class DispatchList
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string Code { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public int SalesOrderId { get; set; }
|
||||
public string SalesOrderNo { get; set; }
|
||||
public string CustomerCode { get; set; }
|
||||
|
||||
public string CoCode { get; set; }
|
||||
|
||||
public string CusCode { get; set; }
|
||||
public DateTime SalesOrderDate { get; set; }
|
||||
|
||||
|
||||
public ICollection<DispatchListDetail> Details { get; set; } = new List<DispatchListDetail>();
|
||||
public ICollection<DispatchListDetail> SalesOrderDtlLst { get; set; } = new List<DispatchListDetail>();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,20 @@ namespace NX.ERP.Model.Sale
|
||||
{
|
||||
public class DispatchListDetail
|
||||
{
|
||||
private int id;
|
||||
private int sales_order_dtl_id;
|
||||
private string invCode;
|
||||
private double quantity;
|
||||
private string invName;
|
||||
|
||||
public int Id { get => id; set => id = value; }
|
||||
public string InvCode { get => invCode; set => invCode = value; }
|
||||
public double Quantity { get => quantity; set => quantity = value; }
|
||||
public int SalesOrderDtlId { get => sales_order_dtl_id; set => sales_order_dtl_id = value; }
|
||||
public string MaterialCode { get => invCode; set => invCode = value; }
|
||||
public double Qty { get => quantity; set => quantity = value; }
|
||||
public string InvName { get => invName; set => invName = value; }
|
||||
|
||||
public string UnitCode { get; set; }
|
||||
|
||||
public int SalesOrderId { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace NX.ERP.U8.Sale
|
||||
{
|
||||
public IEnumerable<Model.Sale.DispatchList> GetList(string strWhere = "", object Params = null)
|
||||
{
|
||||
var strSql = @"select a.DLID as id ,a.cDLCode as Code ,A.cCusCode AS CusCode,b.AutoID as id ,b.cInvCode as InvCode ,b.cInvName as InvName,b.iQuantity AS Quantity
|
||||
var strSql = @"select a.DLID as SalesOrderId ,a.dDate as SalesOrderDate,a.cDLCode as SalesOrderNo ,A.cCusCode AS CustomerCode,b.DLID as id,b.AutoID as SalesOrderDtlId,b.DLID as SalesOrderId ,b.cInvCode as MaterialCode ,b.cInvName as InvName,b.iQuantity AS Qty
|
||||
from DispatchList as a
|
||||
left join DispatchLists as b on a.DLID = b.DLID";
|
||||
|
||||
@@ -25,16 +25,16 @@ namespace NX.ERP.U8.Sale
|
||||
// return conn.Query<Model.Purchase.Arrival>(strSQL,null);
|
||||
var list = conn.Query<NX.ERP.Model.Sale.DispatchList, NX.ERP.Model.Sale.DispatchListDetail, NX.ERP.Model.Sale.DispatchList>(strSql, (Dispatch, DispatchDetail) =>
|
||||
{
|
||||
if (!lookup.TryGetValue(Dispatch.ID, out var _Dispatch))
|
||||
if (!lookup.TryGetValue(Dispatch.SalesOrderId, out var _Dispatch))
|
||||
{
|
||||
lookup.Add(Dispatch.ID, Dispatch);
|
||||
lookup.Add(Dispatch.SalesOrderId, Dispatch);
|
||||
}
|
||||
else
|
||||
{
|
||||
Dispatch = _Dispatch;
|
||||
}
|
||||
|
||||
Dispatch.Details.Add(DispatchDetail);
|
||||
Dispatch.SalesOrderDtlLst.Add(DispatchDetail);
|
||||
return Dispatch;
|
||||
}, Params, null, true, "id", 10, System.Data.CommandType.Text);
|
||||
return lookup.Values;
|
||||
@@ -52,6 +52,16 @@ namespace NX.ERP.U8.Sale
|
||||
}
|
||||
|
||||
|
||||
public IEnumerable<Model.Sale.DispatchList> GetList(Model.Request.Dispatch dispatch)
|
||||
{
|
||||
string where = "";
|
||||
if (!string.IsNullOrEmpty(dispatch.SalesOrderNo))
|
||||
{
|
||||
where = "a.cDLCode like @SalesOrderNo";
|
||||
}
|
||||
return this.GetList(where, new { SalesOrderNo = $"%{dispatch.SalesOrderNo}%" });
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
@@ -51,12 +51,12 @@ namespace NX.ERP.U8.Store
|
||||
{
|
||||
var dispatch = new Sale.DispatchListDAL().GetModel(storeOut.SourceCode);
|
||||
headXml.setAttribute("cbuscode", storeOut.SourceCode);
|
||||
headXml.setAttribute("cdlcode", dispatch.ID);
|
||||
headXml.setAttribute("cdlcode", dispatch.SalesOrderId);
|
||||
headXml.setAttribute("iarriveid", storeOut.SourceCode);
|
||||
headXml.setAttribute("iflowid", "");
|
||||
headXml.setAttribute("cbustype", "普通销售");
|
||||
headXml.setAttribute("cstcode", "");
|
||||
headXml.setAttribute("ccuscode", dispatch.CusCode);
|
||||
headXml.setAttribute("ccuscode", dispatch.SalesOrderId);
|
||||
headXml.setAttribute("cmemo", "");
|
||||
IXMLDOMElement bodyXml;
|
||||
for (var n = 0; n < storeOut.Details.Count; n++)
|
||||
|
||||
@@ -42,6 +42,14 @@ namespace NX.ERP.WebAPi.Controllers.Sale
|
||||
var customerDAL = new DispatchListDAL();
|
||||
return customerDAL.GetListByLastID(id);
|
||||
}
|
||||
|
||||
[Route("api/Dispatch/Query")]
|
||||
[HttpPost]
|
||||
public IEnumerable<Model.Sale.DispatchList> Query(NX.ERP.Model.Request.Dispatch dispatch)
|
||||
{
|
||||
var customerDAL = new DispatchListDAL();
|
||||
return customerDAL.GetList(dispatch);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user