Browse Source

调整形态转换接口

master
lilili 1 year ago
parent
commit
c446782128
  1. 42
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
  2. 20
      ICSSoft.WMS.WebAPI/ICSSoft.Entity/ICSMTDocModel.cs

42
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs

@ -7400,7 +7400,8 @@ WHERE WorkPoint='{0}' AND Quantity>ISNULL(TransferQuantity, 0) order by Transfer
LEFT JOIN ICSWarehouse wh ON a.WHCode=wh.WarehouseCode AND a.WorkPoint=wh.WorkPoint
LEFT JOIN ICSInventoryBatchEnable invBat ON a.INVCode=invBat.InvCode AND a.WHCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint
WHERE a.MTDOCCode= '{JsonData.TransCode}'
AND a.WorkPoint= '{JsonData.WorkPoint}' ";
AND a.WorkPoint= '{JsonData.WorkPoint}'
AND a.MTDOCType='1' ";
#endregion
DataTable table = DBHelper.SQlReturnData(sql, cmd);
@ -7683,6 +7684,29 @@ WHERE WorkPoint='{0}' AND Quantity>ISNULL(TransferQuantity, 0) order by Transfer
StringBuilder sql = new StringBuilder();
foreach (var item in JsonData)
{
string doc = $@"SELECT ExtensionID,INVCode,MTDOCType FROM ICSMTDOC a WHERE a.MTDOCCode= '{item.TransCode}' AND a.Sequence= '{item.TransSequence}' AND a.WorkPoint= '{item.WorkPoint}'";
DataTable dataTable = DBHelper.SQlReturnData(doc, cmd);
string afterInvCode = String.Empty;
string afterExtensionID = String.Empty;
string beforInvCode = String.Empty;
string beforExtensionID = String.Empty;
if (dataTable != null && dataTable.Rows.Count > 0)
{
if (dataTable.Rows[0]["MTDOCType"].ToString() == "1")
{
beforInvCode = dataTable.Rows[0]["INVCode"].ToString();
beforExtensionID = dataTable.Rows[0]["ExtensionID"].ToString();
afterInvCode = dataTable.Rows[1]["INVCode"].ToString();
afterExtensionID = dataTable.Rows[1]["ExtensionID"].ToString();
}
else
{
beforInvCode = dataTable.Rows[1]["INVCode"].ToString();
beforExtensionID = dataTable.Rows[1]["ExtensionID"].ToString();
afterInvCode = dataTable.Rows[0]["INVCode"].ToString();
afterExtensionID = dataTable.Rows[0]["ExtensionID"].ToString();
}
}
foreach (var data in item.DetailModels)
{
//修改源头单据
@ -7692,23 +7716,23 @@ WHERE WorkPoint='{0}' AND Quantity>ISNULL(TransferQuantity, 0) order by Transfer
if (TransType == "13")
{
//形态转换
sql.Append($@"UPDATE ICSWareHouseLotInfo SET InvCode='{item.AfterInvCode}' WHERE LotNo='{data.LotNo}' AND WorkPoint='{item.WorkPoint}' AND InvCode='{item.BeforInvCode}' AND WarehouseCode='{item.WHCode}';
UPDATE ICSWareHouseLotInfoLog SET InvCode='' WHERE LotNo='{data.LotNo}' AND WorkPoint='{item.WorkPoint}' AND InvCode='{item.BeforInvCode}' ;
UPDATE ICSInventoryLot SET InvCode='{item.AfterInvCode}' WHERE LotNo='{data.LotNo}' AND InvCode='{item.BeforInvCode}' AND WorkPoint='{item.WorkPoint}' AND ExtensionID='{item.BeforExtensionID}';");
sql.Append($@"UPDATE ICSWareHouseLotInfo SET InvCode='{afterInvCode}' WHERE LotNo='{data.LotNo}' AND WorkPoint='{item.WorkPoint}' AND InvCode='{beforInvCode}' AND WarehouseCode='{item.WHCode}';
UPDATE ICSWareHouseLotInfoLog SET InvCode='' WHERE LotNo='{data.LotNo}' AND WorkPoint='{item.WorkPoint}' AND InvCode='{beforInvCode}' ;
UPDATE ICSInventoryLot SET InvCode='{afterInvCode}' WHERE LotNo='{data.LotNo}' AND InvCode='{beforInvCode}' AND WorkPoint='{item.WorkPoint}' AND ExtensionID='{beforExtensionID}';");
sql.Append($@"INSERT INTO [dbo].[ICSWareHouseLotInfoLog] ([ID], [Identification], [TransCode], [TransSequence], [LotNo], [InvCode], [FromWarehouseCode], [FromLocationCode], [ToWarehouseCode], [ToLocationCode], [Quantity], [Memo], [Lock], [TransType], [BusinessCode], [ERPUpload], [ERPID], [ERPDetailID], [ERPCode], [ERPSequence], [LogID], [MergeID], [MUSER], [MUSERName], [MTIME], [WorkPoint], [EATTRIBUTE1], [EATTRIBUTE2], [EATTRIBUTE3])
SELECT NEWID(), NEWID(), '{item.TransCode}', '{item.TransSequence}', '{data.LotNo}', '{item.BeforInvCode}', {item.WHCode}, NULL, NULL, NULL, {data.Quantity}, NULL, '0', N'10', N'35', '0', NULL, NULL, NULL, NULL, NULL, NULL,f.F_Account ,f.F_RealName , SYSDATETIME(), '{item.WorkPoint}', NULL, NULL, '{item.BeforExtensionID}' FROM Sys_SRM_User f WHERE f.F_Account='{item.User}' ;");
SELECT NEWID(), NEWID(), '{item.TransCode}', '{item.TransSequence}', '{data.LotNo}', '{beforInvCode}', {item.WHCode}, NULL, NULL, NULL, {data.Quantity}, NULL, '0', N'10', N'35', '0', NULL, NULL, NULL, NULL, NULL, NULL,f.F_Account ,f.F_RealName , SYSDATETIME(), '{item.WorkPoint}', NULL, NULL, '{beforExtensionID}' FROM Sys_SRM_User f WHERE f.F_Account='{item.User}' ;");
sql.Append($@"INSERT INTO [dbo].[ICSWareHouseLotInfoLog] ([ID], [Identification], [TransCode], [TransSequence], [LotNo], [InvCode], [FromWarehouseCode], [FromLocationCode], [ToWarehouseCode], [ToLocationCode], [Quantity], [Memo], [Lock], [TransType], [BusinessCode], [ERPUpload], [ERPID], [ERPDetailID], [ERPCode], [ERPSequence], [LogID], [MergeID], [MUSER], [MUSERName], [MTIME], [WorkPoint], [EATTRIBUTE1], [EATTRIBUTE2], [EATTRIBUTE3])
SELECT NEWID(), NEWID(), '{item.TransCode}', '{item.TransSequence}', '{data.LotNo}', '{item.AfterInvCode}', {item.WHCode}, NULL, NULL, NULL, {data.Quantity}, NULL, '0', N'10', N'36', '0', NULL, NULL, NULL, NULL, NULL, NULL,f.F_Account ,f.F_RealName , SYSDATETIME(), '{item.WorkPoint}', NULL, NULL, '{item.BeforExtensionID}' FROM Sys_SRM_User f WHERE f.F_Account='{item.User}' ;");
SELECT NEWID(), NEWID(), '{item.TransCode}', '{item.TransSequence}', '{data.LotNo}', '{afterInvCode}', {item.WHCode}, NULL, NULL, NULL, {data.Quantity}, NULL, '0', N'10', N'36', '0', NULL, NULL, NULL, NULL, NULL, NULL,f.F_Account ,f.F_RealName , SYSDATETIME(), '{item.WorkPoint}', NULL, NULL, '{beforExtensionID}' FROM Sys_SRM_User f WHERE f.F_Account='{item.User}' ;");
}
else if (TransType == "12")
{
sql.Append($@"UPDATE ICSInventoryLot SET ExtensionID='{item.AfterExtensionID}' WHERE LotNo='{data.LotNo}' AND InvCode='{item.BeforInvCode}' AND WorkPoint='{item.WorkPoint}' AND ExtensionID='{item.BeforExtensionID}';");
sql.Append($@"UPDATE ICSInventoryLot SET ExtensionID='{afterExtensionID}' WHERE LotNo='{data.LotNo}' AND InvCode='{beforInvCode}' AND WorkPoint='{item.WorkPoint}' AND ExtensionID='{beforExtensionID}';");
sql.Append($@"INSERT INTO [dbo].[ICSWareHouseLotInfoLog] ([ID], [Identification], [TransCode], [TransSequence], [LotNo], [InvCode], [FromWarehouseCode], [FromLocationCode], [ToWarehouseCode], [ToLocationCode], [Quantity], [Memo], [Lock], [TransType], [BusinessCode], [ERPUpload], [ERPID], [ERPDetailID], [ERPCode], [ERPSequence], [LogID], [MergeID], [MUSER], [MUSERName], [MTIME], [WorkPoint], [EATTRIBUTE1], [EATTRIBUTE2], [EATTRIBUTE3])
SELECT NEWID(), NEWID(), '{item.TransCode}', '{item.TransSequence}', '{data.LotNo}', '{item.BeforInvCode}', {item.WHCode}, NULL, NULL, NULL, {data.Quantity}, NULL, '0', N'10', N'35', '0', NULL, NULL, NULL, NULL, NULL, NULL,f.F_Account ,f.F_RealName , SYSDATETIME(), '{item.WorkPoint}', NULL, NULL, '{item.BeforExtensionID}' FROM Sys_SRM_User f WHERE f.F_Account='{item.User}' ;");
SELECT NEWID(), NEWID(), '{item.TransCode}', '{item.TransSequence}', '{data.LotNo}', '{beforInvCode}', {item.WHCode}, NULL, NULL, NULL, {data.Quantity}, NULL, '0', N'10', N'35', '0', NULL, NULL, NULL, NULL, NULL, NULL,f.F_Account ,f.F_RealName , SYSDATETIME(), '{item.WorkPoint}', NULL, NULL, '{beforExtensionID}' FROM Sys_SRM_User f WHERE f.F_Account='{item.User}' ;");
sql.Append($@"INSERT INTO [dbo].[ICSWareHouseLotInfoLog] ([ID], [Identification], [TransCode], [TransSequence], [LotNo], [InvCode], [FromWarehouseCode], [FromLocationCode], [ToWarehouseCode], [ToLocationCode], [Quantity], [Memo], [Lock], [TransType], [BusinessCode], [ERPUpload], [ERPID], [ERPDetailID], [ERPCode], [ERPSequence], [LogID], [MergeID], [MUSER], [MUSERName], [MTIME], [WorkPoint], [EATTRIBUTE1], [EATTRIBUTE2], [EATTRIBUTE3])
SELECT NEWID(), NEWID(), '{item.TransCode}', '{item.TransSequence}', '{data.LotNo}', '{item.BeforInvCode}', {item.WHCode}, NULL, NULL, NULL, {data.Quantity}, NULL, '0', N'10', N'36', '0', NULL, NULL, NULL, NULL, NULL, NULL,f.F_Account ,f.F_RealName , SYSDATETIME(), '{item.WorkPoint}', NULL, NULL, '{item.AfterExtensionID}' FROM Sys_SRM_User f WHERE f.F_Account='{item.User}' ;");
SELECT NEWID(), NEWID(), '{item.TransCode}', '{item.TransSequence}', '{data.LotNo}', '{beforInvCode}', {item.WHCode}, NULL, NULL, NULL, {data.Quantity}, NULL, '0', N'10', N'36', '0', NULL, NULL, NULL, NULL, NULL, NULL,f.F_Account ,f.F_RealName , SYSDATETIME(), '{item.WorkPoint}', NULL, NULL, '{afterExtensionID}' FROM Sys_SRM_User f WHERE f.F_Account='{item.User}' ;");
}
else

20
ICSSoft.WMS.WebAPI/ICSSoft.Entity/ICSMTDocModel.cs

@ -40,26 +40,6 @@ namespace ICSSoft.Entity
/// 操作人
/// </summary>
public string User { get; set; }
/// <summary>
/// 转换前物料编码
/// </summary>
public string BeforInvCode { get; set; }
/// <summary>
/// 转换后物料编码
/// </summary>
public string AfterInvCode { get; set; }
/// <summary>
/// 转换前自由项ID
/// </summary>
public string BeforExtensionID { get; set; }
/// <summary>
///转换后自由项ID
/// </summary>
public string AfterExtensionID { get; set; }
/// <summary>
/// 条码详情信息
/// </summary>

Loading…
Cancel
Save