This commit is contained in:
杰 朱
2021-05-26 08:50:46 +08:00
10 changed files with 66 additions and 36 deletions

View File

@@ -11,7 +11,7 @@ namespace NX.ERP.Model.Request
public string DeptName { get; set; } public string DeptName { get; set; }
public string supplierCode { get; set; } public string supplierCode { get; set; }
public string Amount { get; set; } public decimal Amount { get; set; }
public string Digest { get; set; } public string Digest { get; set; }

View File

@@ -5,15 +5,19 @@ using System.Text;
namespace NX.ERP.Model.Request namespace NX.ERP.Model.Request
{ {
public class Unit:BaseModel public class Unit : BaseModel
{ {
private string unitCode; private string unitCode;
private string unitName; private string unitName;
public string UnitCode { get => unitCode; set => unitCode = value; } public string UnitCode { get => unitCode; set => unitCode = value; }
public string UnitName { get => unitName; set => unitName = value; } public string UnitName { get => unitName; set => unitName = value; }
public long? Pubufts { get; set; }
} }
} }

View File

@@ -20,7 +20,7 @@ namespace NX.ERP.Model
private int maxStock; private int maxStock;
private int minStock; private int minStock;
private int aql; private int aql;
private int invccode;
public string MaterialCode { get => _code; set => _code = value; } public string MaterialCode { get => _code; set => _code = value; }
public string MaterialName { get => _name; set => _name = value; } public string MaterialName { get => _name; set => _name = value; }
@@ -31,44 +31,53 @@ namespace NX.ERP.Model
public string UnitCode { get => unitCode; set => unitCode = value; } public string UnitCode { get => unitCode; set => unitCode = value; }
[Newtonsoft.Json.JsonIgnore]
public int MinPackageQty { get; set; } public int MinPackageQty { get; set; }
[Newtonsoft.Json.JsonIgnore]
public int TaxRate { get; set; } public int TaxRate { get; set; }
[Newtonsoft.Json.JsonIgnore]
public decimal Length { get => length; set => length = value; } public decimal Length { get => length; set => length = value; }
[Newtonsoft.Json.JsonIgnore]
public decimal Wide { get => wide; set => wide = value; } public decimal Wide { get => wide; set => wide = value; }
[Newtonsoft.Json.JsonIgnore]
public decimal Height { get => height; set => height = value; } public decimal Height { get => height; set => height = value; }
[Newtonsoft.Json.JsonIgnore]
public int Volume { get => volume; set => volume = value; } public int Volume { get => volume; set => volume = value; }
[Newtonsoft.Json.JsonIgnore]
public int Weight { get => weight; set => weight = value; } public int Weight { get => weight; set => weight = value; }
[Newtonsoft.Json.JsonIgnore]
public double UnitPrice { get => unitPrice; set => unitPrice = value; } public double UnitPrice { get => unitPrice; set => unitPrice = value; }
[Newtonsoft.Json.JsonIgnore]
public int MaxStock { get => maxStock; set => maxStock = value; } public int MaxStock { get => maxStock; set => maxStock = value; }
[Newtonsoft.Json.JsonIgnore]
public int MinStock { get => minStock; set => minStock = value; } public int MinStock { get => minStock; set => minStock = value; }
[Newtonsoft.Json.JsonIgnore]
public int SafeStock { get; set; } public int SafeStock { get; set; }
[Newtonsoft.Json.JsonIgnore]
public int Aql { get => aql; set => aql = value; } public int Aql { get => aql; set => aql = value; }
[Newtonsoft.Json.JsonIgnore]
public double InvNCost { get; set; } public double InvNCost { get; set; }
/// <summary> /// <summary>
/// 参考成本 /// 参考成本
/// </summary> /// </summary>
[Newtonsoft.Json.JsonIgnore]
public double InvSPrice { get; set; } public double InvSPrice { get; set; }
/// <summary> /// <summary>
/// 计划单价 /// 计划单价
/// </summary> /// </summary>
[Newtonsoft.Json.JsonIgnore]
public double InvRCost { get; set; } public double InvRCost { get; set; }
[Newtonsoft.Json.JsonIgnore]
public double ImpTaxRate { get; set; } public double ImpTaxRate { get; set; }
/// <summary> /// <summary>

View File

@@ -19,5 +19,10 @@ namespace NX.ERP.Model
public string GroupCode { get => groupCode; set => groupCode = value; } public string GroupCode { get => groupCode; set => groupCode = value; }
public decimal Changerate { get; set; } public decimal Changerate { get; set; }
public long Pubufts { get; set; }
} }
} }

View File

@@ -219,11 +219,11 @@ namespace NX.ERP.U8.AP
headXml.setAttribute("VT_ID", 8056); headXml.setAttribute("VT_ID", 8056);
headXml.setAttribute("bd_c", false); headXml.setAttribute("bd_c", false);
headXml.setAttribute("bStartFlag", false); headXml.setAttribute("bStartFlag", false);
headXml.setAttribute("cVouchID", ""); headXml.setAttribute("cVouchID", "664");
headXml.setAttribute("cFlag", "AP"); headXml.setAttribute("cFlag", "AP");
headXml.setAttribute("cDeptCode", ApVouch.DeptCode); headXml.setAttribute("cDeptCode", ApVouch.DeptCode);
headXml.setAttribute("cDigest", ApVouch.Digest); headXml.setAttribute("cDigest", ApVouch.Digest);
headXml.setAttribute("cLink", ""); headXml.setAttribute("cLink", "664");
IXMLDOMElement bodyXml; IXMLDOMElement bodyXml;
//for (var n = 0; n < storeIn.details.Count(); n++) //for (var n = 0; n < storeIn.details.Count(); n++)
@@ -238,7 +238,7 @@ namespace NX.ERP.U8.AP
bodyXml.setAttribute("iAmount", ApVouch.Amount); bodyXml.setAttribute("iAmount", ApVouch.Amount);
bodyXml.setAttribute("iAmount_f", ApVouch.Amount); bodyXml.setAttribute("iAmount_f", ApVouch.Amount);
bodyXml.setAttribute("iAmt_s", 0); bodyXml.setAttribute("iAmt_s", 0);
bodyXml.setAttribute("cLink", ""); bodyXml.setAttribute("cLink", "664");
headXml.setAttribute("cDwCode", ApVouch.supplierCode); headXml.setAttribute("cDwCode", ApVouch.supplierCode);
bodyXml.setAttribute("bd_c", true); bodyXml.setAttribute("bd_c", true);

View File

@@ -16,7 +16,7 @@ namespace NX.ERP.U8
{ {
var sql = @"select var sql = @"select
cComunitCode AS UnitCode, cComunitCode AS UnitCode,
cComUnitName AS UnitName,bMainUnit as MainUnit, cGroupCode as GroupCode from ComputationUnit "; cComUnitName AS UnitName,bMainUnit as MainUnit,CONVERT(BIGINT,pubufts) AS pubufts, cGroupCode as GroupCode from ComputationUnit ";
if (!string.IsNullOrEmpty(strWhere)) if (!string.IsNullOrEmpty(strWhere))
{ {
sql += $" where {strWhere}"; sql += $" where {strWhere}";
@@ -40,10 +40,21 @@ namespace NX.ERP.U8
where.Add(" cComUnitName like @UnitName "); where.Add(" cComUnitName like @UnitName ");
} }
if (Params.Pubufts != null)
{
where.Add("CONVERT(BIGINT,pubufts) >=@Pubufts ");
}
return this.GetList(string.Join(" and ", where.ToArray()), new return this.GetList(string.Join(" and ", where.ToArray()), new
{ {
UnitCode = $"%{Params.UnitCode}%", UnitCode = $"%{Params.UnitCode}%",
UnitName = $"%{Params.UnitName}%" UnitName = $"%{Params.UnitName}%",
Pubufts=Params.Pubufts
}); });

View File

@@ -30,10 +30,10 @@ namespace NX.ERP.U8.Mom
left join mom_orderdetail as b on a.MoId=b.MoId left join mom_orderdetail as b on a.MoId=b.MoId
left join mom_morder as d on b.MoDId=d.MoDId left join mom_morder as d on b.MoDId=d.MoDId
left join mom_SNDetail as e on b.MoDId=e.iVouchsID left join mom_SNDetail as e on b.MoDId=e.iVouchsID
left join mom_moallocate as c on b.MoDId=c.MoDId "; left join mom_moallocate as c on b.MoDId=c.MoDId where b.Status<>4";
if (!string.IsNullOrEmpty(strWhere)) if (!string.IsNullOrEmpty(strWhere))
{ {
strSQL += $" where {strWhere} "; strSQL += $" and {strWhere} ";
} }
var lookupDetail = new Dictionary<int, Model.MOM.MomDetail>(); var lookupDetail = new Dictionary<int, Model.MOM.MomDetail>();
var lookupOrder = new Dictionary<int, Model.MOM.MomOrder>(); var lookupOrder = new Dictionary<int, Model.MOM.MomOrder>();
@@ -59,7 +59,10 @@ namespace NX.ERP.U8.Mom
{ {
OrderDetail = momDetail; OrderDetail = momDetail;
} }
OrderDetail.SN.Add(SN); if (SN != null)
{
OrderDetail.SN.Add(SN);
}
Order.Allocates.Add(MoAllocate); Order.Allocates.Add(MoAllocate);
OrderDetail.ProductAllocateOrderLst.Add(MoAllocate); OrderDetail.ProductAllocateOrderLst.Add(MoAllocate);
MoAllocate.momDetail = OrderDetail; MoAllocate.momDetail = OrderDetail;
@@ -162,9 +165,7 @@ namespace NX.ERP.U8.Mom
a.MoId as id ,a.MoDId as ProductOrderDtlId,a.MoId as ProductOrderId,a.MoCode as ProductOrderNo,a.MakeDate as ProductOrderDate,a.InvCode as ProductCode,a.Qty as Qty a.MoId as id ,a.MoDId as ProductOrderDtlId,a.MoId as ProductOrderId,a.MoCode as ProductOrderNo,a.MakeDate as ProductOrderDate,a.InvCode as ProductCode,a.Qty as Qty
FROM v_st_mom_orderdetail a with (nolock) Where ( (1>0) AND (1>0) ) FROM v_st_mom_orderdetail a with (nolock) Where ( (1>0) AND (1>0) )
AND ( 1>0 ) and (case when ISNULL(SfcFlag,0)=1 then iquantity+QualifiedInQty else 1 end)<>0 AND ( 1>0 ) and (case when ISNULL(SfcFlag,0)=1 then iquantity+QualifiedInQty else 1 end)<>0
and ISNULL(QCFLAG,0)=0 and ISNULL(Status,0) = 3 and (ISNULL(iQuantity,0))>0 and isnull(MrpQty,0)<>0 and 1=1 and ISNULL(QCFLAG,0)=0 and ISNULL(Status,0) = 3 and (ISNULL(iQuantity,0))>0 and isnull(MrpQty,0)<>0 and 1=1";
";
if (!string.IsNullOrEmpty(strWhere)) if (!string.IsNullOrEmpty(strWhere))
{ {
strSQL += $" and {strWhere} "; strSQL += $" and {strWhere} ";

View File

@@ -123,9 +123,6 @@ FROM MaterialAppVouch a
public IEnumerable<Model.Response.Store.MaterialAppDetail> GetDetailByMoCode(string MoCode, int MoDetailId) public IEnumerable<Model.Response.Store.MaterialAppDetail> GetDetailByMoCode(string MoCode, int MoDetailId)
{ {
var models = this.GetListByMoCode(MoCode, MoDetailId); var models = this.GetListByMoCode(MoCode, MoDetailId);
var reslut = new List<Model.Response.Store.MaterialAppDetail>(); var reslut = new List<Model.Response.Store.MaterialAppDetail>();
foreach (var items in models) foreach (var items in models)
{ {
@@ -138,7 +135,7 @@ FROM MaterialAppVouch a
public void Provide(NX.ERP.Model.Request.MaterialAppProvide provide) public bool Provide(NX.ERP.Model.Request.MaterialAppProvide provide)
{ {
using (var conn = U8LoginContext.Instance.Connection) using (var conn = U8LoginContext.Instance.Connection)
@@ -159,7 +156,7 @@ FROM MaterialAppVouch a
throw new Exception("未找到"); throw new Exception("未找到");
} }
} }
return false;
} }
else //整单发出 else //整单发出
{ {
@@ -169,7 +166,7 @@ FROM MaterialAppVouch a
)"; )";
conn.Execute(strSql, new var info = conn.Execute(strSql, new
{ {
DueDate = provide.DueDate, DueDate = provide.DueDate,
SN = "", SN = "",
@@ -177,8 +174,11 @@ FROM MaterialAppVouch a
MoCode = provide.OrderCode, MoCode = provide.OrderCode,
OrderDetailId = provide.OrderDetailId OrderDetailId = provide.OrderDetailId
}); });
if (info == 0)
{
throw new Exception("未找到相应的物料");
}
return true;
} }
} }

View File

@@ -24,7 +24,7 @@ namespace NX.ERP.WebAPi.Controllers.Store
/// <returns></returns> /// <returns></returns>
[Route("api/MaterialApp/PendingList")] [Route("api/MaterialApp/PendingList")]
[HttpPost] [HttpPost]
public IEnumerable<Model.Response.Store.MaterialApp> GetPendingList() public IEnumerable<Model.Response.Store.MaterialApp> GetPendingList()
{ {
var dal = new NX.ERP.U8.Store.MaterialAppDAL(); var dal = new NX.ERP.U8.Store.MaterialAppDAL();
@@ -68,11 +68,11 @@ namespace NX.ERP.WebAPi.Controllers.Store
[Route("api/MaterialApp/Plan")] [Route("api/MaterialApp/Plan")]
[HttpPost] [HttpPost]
public bool Provide([FromBody]NX.ERP.Model.Request.MaterialAppProvide provide) public bool Provide([FromBody] NX.ERP.Model.Request.MaterialAppProvide provide)
{ {
var dal = new NX.ERP.U8.Store.MaterialAppDAL(); var dal = new NX.ERP.U8.Store.MaterialAppDAL();
dal.Provide(provide); return dal.Provide(provide);
return true;
} }

View File

@@ -9,7 +9,7 @@ namespace NX.ERP.WebAPi.Controllers.Store
public class ProductStoreInController : ApiController public class ProductStoreInController : ApiController
{ {
[Obsolete]
[Route("api/ProductStoreIn/Add")] [Route("api/ProductStoreIn/Add")]
[HttpPost] [HttpPost]
public object AddVoucher([FromBody] Model.Request.ProductStoreIn storeIn) public object AddVoucher([FromBody] Model.Request.ProductStoreIn storeIn)