Merge branch 'master' of http://36.153.118.214:10080/nx.wms/u8-import
This commit is contained in:
@@ -76,6 +76,7 @@
|
|||||||
<Compile Include="Request\MaterialAppVouch.cs" />
|
<Compile Include="Request\MaterialAppVouch.cs" />
|
||||||
<Compile Include="Request\MomOrderRequest.cs" />
|
<Compile Include="Request\MomOrderRequest.cs" />
|
||||||
<Compile Include="Request\MomRequest.cs" />
|
<Compile Include="Request\MomRequest.cs" />
|
||||||
|
<Compile Include="Request\ProductOrderReportSn.cs" />
|
||||||
<Compile Include="Request\PurchasesumRequest.cs" />
|
<Compile Include="Request\PurchasesumRequest.cs" />
|
||||||
<Compile Include="Request\PoOrderRequest.cs" />
|
<Compile Include="Request\PoOrderRequest.cs" />
|
||||||
<Compile Include="Request\VouchererrorRequest.cs" />
|
<Compile Include="Request\VouchererrorRequest.cs" />
|
||||||
|
|||||||
34
NX.ERP.Model/Request/ProductOrderReportSn.cs
Normal file
34
NX.ERP.Model/Request/ProductOrderReportSn.cs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace NX.ERP.Model.Request
|
||||||
|
{
|
||||||
|
public class ProductOrderReportSn
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 生产单号
|
||||||
|
/// </summary>
|
||||||
|
public string ProductOrder { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 明细
|
||||||
|
/// </summary>
|
||||||
|
public List<OrderDetail> OrderDetails { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class OrderDetail
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 明细行ID
|
||||||
|
/// </summary>
|
||||||
|
public string OrderLineId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 序列号列表
|
||||||
|
/// </summary>
|
||||||
|
public List<string> SnList { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
52
NX.ERP.U8/MES/BaseLogic.cs
Normal file
52
NX.ERP.U8/MES/BaseLogic.cs
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace NX.ERP.U8.MES
|
||||||
|
{
|
||||||
|
public class BaseLogic: IDisposable
|
||||||
|
{
|
||||||
|
public static IDbHelper MesDb
|
||||||
|
{
|
||||||
|
get { return new MsSqlHelper("MES_SUBMIT"); }
|
||||||
|
}
|
||||||
|
|
||||||
|
#region IDisposable Support
|
||||||
|
private bool disposedValue = false; // 要检测冗余调用
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected virtual void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (!disposedValue)
|
||||||
|
{
|
||||||
|
if (disposing)
|
||||||
|
{
|
||||||
|
// TODO: 释放托管状态(托管对象)。
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: 释放未托管的资源(未托管的对象)并在以下内容中替代终结器。
|
||||||
|
// TODO: 将大型字段设置为 null。
|
||||||
|
|
||||||
|
disposedValue = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: 仅当以上 Dispose(bool disposing) 拥有用于释放未托管资源的代码时才替代终结器。
|
||||||
|
// ~BaseLogic() {
|
||||||
|
// // 请勿更改此代码。将清理代码放入以上 Dispose(bool disposing) 中。
|
||||||
|
// Dispose(false);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 添加此代码以正确实现可处置模式。
|
||||||
|
void IDisposable.Dispose()
|
||||||
|
{
|
||||||
|
// 请勿更改此代码。将清理代码放入以上 Dispose(bool disposing) 中。
|
||||||
|
Dispose(true);
|
||||||
|
// TODO: 如果在以上内容中替代了终结器,则取消注释以下行。
|
||||||
|
// GC.SuppressFinalize(this);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
49
NX.ERP.U8/MES/MesLogic.cs
Normal file
49
NX.ERP.U8/MES/MesLogic.cs
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace NX.ERP.U8.MES
|
||||||
|
{
|
||||||
|
public class MesLogic:BaseLogic
|
||||||
|
{
|
||||||
|
public bool ReportSnList(Model.Request.ProductOrderReportSn info)
|
||||||
|
{
|
||||||
|
var instertSql = "INSERT INTO [dbo].[MES_PRODUCT_SN_LIST] ([PRODUCT_ORDER_NO], [ORDER_LINE_ID], [SN]) VALUES (@PRODUCT_ORDER_NO, @ORDER_LINE_ID, @SN);";
|
||||||
|
using (var conn = MesDb.GetSqlConnection())
|
||||||
|
{
|
||||||
|
conn.Open();
|
||||||
|
var tran = conn.BeginTransaction();
|
||||||
|
var cmd = conn.CreateCommand();
|
||||||
|
cmd.Transaction = tran;
|
||||||
|
|
||||||
|
cmd.CommandText = $"DELETE FROM MES_PRODUCT_SN_LIST WHERE PRODUCT_ORDER_NO = '{info.ProductOrder}'";
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
|
||||||
|
foreach (var detail in info.OrderDetails)
|
||||||
|
{
|
||||||
|
foreach (var sn in detail.SnList)
|
||||||
|
{
|
||||||
|
cmd.Parameters.Clear();
|
||||||
|
|
||||||
|
cmd.CommandText = instertSql;
|
||||||
|
cmd.Parameters.Clear();
|
||||||
|
cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PRODUCT_ORDER_NO", info.ProductOrder));
|
||||||
|
cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ORDER_LINE_ID", detail.OrderLineId));
|
||||||
|
cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SN", sn));
|
||||||
|
var val = cmd.ExecuteNonQuery();
|
||||||
|
if (val <= 0)
|
||||||
|
{
|
||||||
|
tran.Rollback();
|
||||||
|
throw new Exception("保存失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tran.Commit();
|
||||||
|
cmd.Dispose();
|
||||||
|
conn.Close();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -101,7 +101,7 @@ namespace NX.ERP.U8.Mom
|
|||||||
{
|
{
|
||||||
where.Add(" b.InvCode like @ProductCode");
|
where.Add(" b.InvCode like @ProductCode");
|
||||||
}
|
}
|
||||||
if (Params.ProductOrderNo!=null)
|
if (Params.ProductOrderNo != null)
|
||||||
{
|
{
|
||||||
where.Add(" a.moCode in @ProductOrderNo ");
|
where.Add(" a.moCode in @ProductOrderNo ");
|
||||||
}
|
}
|
||||||
@@ -132,7 +132,7 @@ namespace NX.ERP.U8.Mom
|
|||||||
return this.GetList(string.Join(" and ", where.ToArray()), new
|
return this.GetList(string.Join(" and ", where.ToArray()), new
|
||||||
{
|
{
|
||||||
ProductCode = $"%{Params.ProductCode}%",
|
ProductCode = $"%{Params.ProductCode}%",
|
||||||
ProductOrderNo =Params.ProductOrderNo,
|
ProductOrderNo = Params.ProductOrderNo,
|
||||||
Params.ProductOrderendID,
|
Params.ProductOrderendID,
|
||||||
Params.ModifyDate,
|
Params.ModifyDate,
|
||||||
Params.Pubufts,
|
Params.Pubufts,
|
||||||
@@ -160,7 +160,7 @@ namespace NX.ERP.U8.Mom
|
|||||||
{
|
{
|
||||||
where.Add(" a.InvCode like @ProductCode");
|
where.Add(" a.InvCode like @ProductCode");
|
||||||
}
|
}
|
||||||
if (Params.ProductOrderNo!=null)
|
if (Params.ProductOrderNo != null)
|
||||||
{
|
{
|
||||||
where.Add(" a.moCode in @ProductOrderNo ");
|
where.Add(" a.moCode in @ProductOrderNo ");
|
||||||
}
|
}
|
||||||
@@ -234,7 +234,7 @@ namespace NX.ERP.U8.Mom
|
|||||||
{
|
{
|
||||||
where.Add(" b.InvCode like @ProductCode");
|
where.Add(" b.InvCode like @ProductCode");
|
||||||
}
|
}
|
||||||
if (Params.ProductOrderNo!=null)
|
if (Params.ProductOrderNo != null)
|
||||||
{
|
{
|
||||||
where.Add(" b.moCode in @ProductOrderNo ");
|
where.Add(" b.moCode in @ProductOrderNo ");
|
||||||
}
|
}
|
||||||
@@ -245,7 +245,7 @@ namespace NX.ERP.U8.Mom
|
|||||||
return this.GetDetails(string.Join(" and ", where.ToArray()), new
|
return this.GetDetails(string.Join(" and ", where.ToArray()), new
|
||||||
{
|
{
|
||||||
ProductCode = $"%{Params.ProductCode}%",
|
ProductCode = $"%{Params.ProductCode}%",
|
||||||
ProductOrderNo =Params.ProductOrderNo,
|
ProductOrderNo = Params.ProductOrderNo,
|
||||||
ProductOrderendID = $"{Params.ProductOrderendID}"
|
ProductOrderendID = $"{Params.ProductOrderendID}"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
1069
NX.ERP.U8/MsSqlHelper.cs
Normal file
1069
NX.ERP.U8/MsSqlHelper.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -46,8 +46,11 @@
|
|||||||
<Compile Include="Base\MaterielTypeDAL.cs" />
|
<Compile Include="Base\MaterielTypeDAL.cs" />
|
||||||
<Compile Include="FileHelp.cs" />
|
<Compile Include="FileHelp.cs" />
|
||||||
<Compile Include="FormatHelp.cs" />
|
<Compile Include="FormatHelp.cs" />
|
||||||
|
<Compile Include="MES\BaseLogic.cs" />
|
||||||
|
<Compile Include="MES\MesLogic.cs" />
|
||||||
<Compile Include="Mom\BomDAL.cs" />
|
<Compile Include="Mom\BomDAL.cs" />
|
||||||
<Compile Include="Mom\MomOrderDAL.cs" />
|
<Compile Include="Mom\MomOrderDAL.cs" />
|
||||||
|
<Compile Include="MsSqlHelper.cs" />
|
||||||
<Compile Include="Pmc\WarehouseQuery.cs" />
|
<Compile Include="Pmc\WarehouseQuery.cs" />
|
||||||
<Compile Include="Pmc\FinanceQuery.cs" />
|
<Compile Include="Pmc\FinanceQuery.cs" />
|
||||||
<Compile Include="Pmc\PmcQuery.cs" />
|
<Compile Include="Pmc\PmcQuery.cs" />
|
||||||
|
|||||||
@@ -106,13 +106,7 @@ left join (
|
|||||||
from PO_Pomain a WITH (nolock), PO_Podetails b WITH (nolock) where a.poid=b.poid)
|
from PO_Pomain a WITH (nolock), PO_Podetails b WITH (nolock) where a.poid=b.poid)
|
||||||
as c where c.rownumber=1) a left join (
|
as c where c.rownumber=1) a left join (
|
||||||
select cPsn_Num, cPsn_Name from hr_v_HR31_show WITH (nolock) where cDepCode ='52' and rEmployState ='在职') b on a.cMaker =b.cPsn_Name
|
select cPsn_Num, cPsn_Name from hr_v_HR31_show WITH (nolock) where cDepCode ='52' and rEmployState ='在职') b on a.cMaker =b.cPsn_Name
|
||||||
) cma on c.cInvCode = cma.cInvCode
|
) cma on c.cInvCode = cma.cInvCode ";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
";
|
|
||||||
|
|
||||||
List<string> where = new List<string>();
|
List<string> where = new List<string>();
|
||||||
|
|
||||||
|
|||||||
21
NX.ERP.WebAPi/Controllers/MES/MESController.cs
Normal file
21
NX.ERP.WebAPi/Controllers/MES/MESController.cs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Web.Http;
|
||||||
|
|
||||||
|
namespace NX.ERP.WebAPi.Controllers.MES
|
||||||
|
{
|
||||||
|
[RoutePrefix("api/MES")]
|
||||||
|
public class MESController : ApiController
|
||||||
|
{
|
||||||
|
[Route("ReportSnList")]
|
||||||
|
[HttpPost]
|
||||||
|
public bool ReportSnList(Model.Request.ProductOrderReportSn info)
|
||||||
|
{
|
||||||
|
var logic = new NX.ERP.U8.MES.MesLogic();
|
||||||
|
return logic.ReportSnList(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -62,8 +62,5 @@ namespace NX.ERP.WebAPi.Controllers.MOM
|
|||||||
var customerDAL = new NX.ERP.U8.Mom.MomOrderDAL();
|
var customerDAL = new NX.ERP.U8.Mom.MomOrderDAL();
|
||||||
return customerDAL.QueryDetails(momOrder);
|
return customerDAL.QueryDetails(momOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,9 +18,5 @@ namespace NX.ERP.WebAPi.Controllers
|
|||||||
var FinanceQuery = new NX.ERP.U8.Finance.WarehouseQuery();
|
var FinanceQuery = new NX.ERP.U8.Finance.WarehouseQuery();
|
||||||
return FinanceQuery.ArrivalGet(info);
|
return FinanceQuery.ArrivalGet(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -158,6 +158,7 @@
|
|||||||
<Compile Include="App_Start\SwaggerConfig.cs" />
|
<Compile Include="App_Start\SwaggerConfig.cs" />
|
||||||
<Compile Include="App_Start\WebApiConfig.cs" />
|
<Compile Include="App_Start\WebApiConfig.cs" />
|
||||||
<Compile Include="Controllers\AP\ApVouchController.cs" />
|
<Compile Include="Controllers\AP\ApVouchController.cs" />
|
||||||
|
<Compile Include="Controllers\MES\MESController.cs" />
|
||||||
<Compile Include="Controllers\MOM\BomController.cs" />
|
<Compile Include="Controllers\MOM\BomController.cs" />
|
||||||
<Compile Include="Controllers\MOM\MomOrderController.cs" />
|
<Compile Include="Controllers\MOM\MomOrderController.cs" />
|
||||||
<Compile Include="Controllers\Pmc\WhreportController.cs" />
|
<Compile Include="Controllers\Pmc\WhreportController.cs" />
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
https://go.microsoft.com/fwlink/?LinkId=301879
|
https://go.microsoft.com/fwlink/?LinkId=301879
|
||||||
-->
|
-->
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<connectionStrings>
|
||||||
|
<add name="MES_SUBMIT" connectionString="server=10.0.0.12;uid=sa;pwd=1qaz@WSX;database=MES_SUBMIT"/>
|
||||||
|
</connectionStrings>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
<add key="server" value="10.0.0.12" />
|
<add key="server" value="10.0.0.12" />
|
||||||
<add key="AccId" value="u8-2@001" />
|
<add key="AccId" value="u8-2@001" />
|
||||||
|
|||||||
Reference in New Issue
Block a user