销售发货单

This commit is contained in:
admin
2021-01-21 16:20:31 +08:00
parent 9b672067cb
commit 37c919001f
7 changed files with 52 additions and 15 deletions

View File

@@ -64,6 +64,7 @@
<Compile Include="Request\Arrival.cs" /> <Compile Include="Request\Arrival.cs" />
<Compile Include="Request\Bin.cs" /> <Compile Include="Request\Bin.cs" />
<Compile Include="Request\Customer.cs" /> <Compile Include="Request\Customer.cs" />
<Compile Include="Request\Dispatch.cs" />
<Compile Include="Request\Materiel.cs" /> <Compile Include="Request\Materiel.cs" />
<Compile Include="Request\MaterielType.cs" /> <Compile Include="Request\MaterielType.cs" />
<Compile Include="Request\OtherStoreIn.cs" /> <Compile Include="Request\OtherStoreIn.cs" />

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

View File

@@ -7,16 +7,16 @@ namespace NX.ERP.Model.Sale
{ {
public class DispatchList public class DispatchList
{ {
public int ID { get; set; } public int SalesOrderId { get; set; }
public string Code { get; set; } public string SalesOrderNo { get; set; }
public DateTime Date { get; set; } public string CustomerCode { get; set; }
public string CoCode { 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>();
} }
} }

View File

@@ -7,14 +7,20 @@ namespace NX.ERP.Model.Sale
{ {
public class DispatchListDetail public class DispatchListDetail
{ {
private int id; private int sales_order_dtl_id;
private string invCode; private string invCode;
private double quantity; private double quantity;
private string invName; private string invName;
public int Id { get => id; set => id = value; } public int SalesOrderDtlId { get => sales_order_dtl_id; set => sales_order_dtl_id = value; }
public string InvCode { get => invCode; set => invCode = value; } public string MaterialCode { get => invCode; set => invCode = value; }
public double Quantity { get => quantity; set => quantity = value; } public double Qty { get => quantity; set => quantity = value; }
public string InvName { get => invName; set => invName = value; } public string InvName { get => invName; set => invName = value; }
public string UnitCode { get; set; }
public int SalesOrderId { get; set; }
} }
} }

View File

@@ -10,7 +10,7 @@ namespace NX.ERP.U8.Sale
{ {
public IEnumerable<Model.Sale.DispatchList> GetList(string strWhere = "", object Params = null) 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 from DispatchList as a
left join DispatchLists as b on a.DLID = b.DLID"; 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); // 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) => 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 else
{ {
Dispatch = _Dispatch; Dispatch = _Dispatch;
} }
Dispatch.Details.Add(DispatchDetail); Dispatch.SalesOrderDtlLst.Add(DispatchDetail);
return Dispatch; return Dispatch;
}, Params, null, true, "id", 10, System.Data.CommandType.Text); }, Params, null, true, "id", 10, System.Data.CommandType.Text);
return lookup.Values; 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> /// <summary>
/// ///

View File

@@ -51,12 +51,12 @@ namespace NX.ERP.U8.Store
{ {
var dispatch = new Sale.DispatchListDAL().GetModel(storeOut.SourceCode); var dispatch = new Sale.DispatchListDAL().GetModel(storeOut.SourceCode);
headXml.setAttribute("cbuscode", storeOut.SourceCode); headXml.setAttribute("cbuscode", storeOut.SourceCode);
headXml.setAttribute("cdlcode", dispatch.ID); headXml.setAttribute("cdlcode", dispatch.SalesOrderId);
headXml.setAttribute("iarriveid", storeOut.SourceCode); headXml.setAttribute("iarriveid", storeOut.SourceCode);
headXml.setAttribute("iflowid", ""); headXml.setAttribute("iflowid", "");
headXml.setAttribute("cbustype", "普通销售"); headXml.setAttribute("cbustype", "普通销售");
headXml.setAttribute("cstcode", ""); headXml.setAttribute("cstcode", "");
headXml.setAttribute("ccuscode", dispatch.CusCode); headXml.setAttribute("ccuscode", dispatch.SalesOrderId);
headXml.setAttribute("cmemo", ""); headXml.setAttribute("cmemo", "");
IXMLDOMElement bodyXml; IXMLDOMElement bodyXml;
for (var n = 0; n < storeOut.Details.Count; n++) for (var n = 0; n < storeOut.Details.Count; n++)

View File

@@ -43,5 +43,13 @@ namespace NX.ERP.WebAPi.Controllers.Sale
return customerDAL.GetListByLastID(id); 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);
}
} }
} }