Browse Source

调整生产退料上架接口

master
lilili 1 year ago
parent
commit
78272927c7
  1. 14
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
  2. 6
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs

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

@ -2561,6 +2561,7 @@ namespace ICSSoft.DataProject
{ {
string TransType = string.Empty; string TransType = string.Empty;
string Identification = Guid.NewGuid().ToString(); string Identification = Guid.NewGuid().ToString();
DateTime createDate = DateTime.Now;
foreach (var item in JsonData) foreach (var item in JsonData)
{ {
TransType = item.TransType; TransType = item.TransType;
@ -2594,7 +2595,7 @@ namespace ICSSoft.DataProject
BusinessCode = TransTypeEnum.SalesReturnBack.GetDescription<DBValue>(); BusinessCode = TransTypeEnum.SalesReturnBack.GetDescription<DBValue>();
//入库 //入库
ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity, ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity,
item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode);
item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode,createDate.ToString());
////更新日志表源头单据信息 ////更新日志表源头单据信息
//string sql = @"UPDATE ICSWareHouseLotInfoLog SET TransCode='{3}',TransSequence='{4}' //string sql = @"UPDATE ICSWareHouseLotInfoLog SET TransCode='{3}',TransSequence='{4}'
@ -2682,6 +2683,13 @@ namespace ICSSoft.DataProject
//更新源头单据数量 //更新源头单据数量
ICSManufactureService.MOIssueDocNegative(TransType, itemInfo.LogID, itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd, language); ICSManufactureService.MOIssueDocNegative(TransType, itemInfo.LogID, itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd, language);
BusinessCode = TransTypeEnum.MOIssueDocNegative.GetDescription<DBValue>(); BusinessCode = TransTypeEnum.MOIssueDocNegative.GetDescription<DBValue>();
var getDate = $@"SELECT top 1 MTIME FROM ICSWareHouseLotInfo WHERE InvCode='{itemInfo.InvCode}' AND Quantity>0 ORDER BY MTIME ";
var date=DBHelper.ExecuteScalar(getDate, cmd);
if (date!=null||date.ToString()!="")
{
createDate = Convert.ToDateTime(date).AddDays(-1);
}
} }
#endregion #endregion
#region 生产入库 #region 生产入库
@ -2738,7 +2746,7 @@ namespace ICSSoft.DataProject
} }
//入库 //入库
ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity, ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity,
item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode);
item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode,createDate.ToString());
} }
//上传ERP //上传ERP
@ -2886,7 +2894,7 @@ namespace ICSSoft.DataProject
} }
//入库 //入库
ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity, ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity,
itemInfo.User, JsonData.DATA.Head[0].WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode);
itemInfo.User, JsonData.DATA.Head[0].WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode,DateTime.Now.ToString());
} }
//上传ERP //上传ERP
if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UploadERP"])) if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UploadERP"]))

6
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs

@ -53,7 +53,7 @@ namespace ICSSoft.DataProject
/// <param name="cmd"></param> /// <param name="cmd"></param>
/// <param name="jointLotNo"></param> /// <param name="jointLotNo"></param>
public static void WareHouseLotInfoUp(string Identification, string LocationCode, string LotNo, string Quantity, string User, public static void WareHouseLotInfoUp(string Identification, string LocationCode, string LotNo, string Quantity, string User,
string WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary<string, string> language, string LogID, string jointLotNo)
string WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary<string, string> language, string LogID, string jointLotNo,string createDate)
{ {
try try
{ {
@ -130,7 +130,7 @@ namespace ICSSoft.DataProject
END END
END END
INSERT INTO ICSWareHouseLotInfo(ID,LotNO,WarehouseCode,LocationCode,InvCode,Quantity,InDate,LockQuantity,MUSER,MUSERName,MTIME,WorkPoint,EATTRIBUTE1) INSERT INTO ICSWareHouseLotInfo(ID,LotNO,WarehouseCode,LocationCode,InvCode,Quantity,InDate,LockQuantity,MUSER,MUSERName,MTIME,WorkPoint,EATTRIBUTE1)
SELECT NEWID(),a.LotNo ,e.WarehouseCode,d.LocationCode,a.InvCode ,'{3}',SYSDATETIME(),'0',f.F_Account ,f.F_RealName ,SYSDATETIME() ,a.WorkPoint ,''
SELECT NEWID(),a.LotNo ,e.WarehouseCode,d.LocationCode,a.InvCode ,'{3}','{5}','0',f.F_Account ,f.F_RealName ,'{5}' ,a.WorkPoint ,''
FROM ICSInventoryLot a FROM ICSInventoryLot a
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
--INNER JOIN ICSOApplyNegDetail c ON b.TransCode=c.OApplyNegCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint --INNER JOIN ICSOApplyNegDetail c ON b.TransCode=c.OApplyNegCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
@ -139,7 +139,7 @@ namespace ICSSoft.DataProject
INNER JOIN Sys_SRM_User f ON f.F_Account='{2}' AND a.WorkPoint=f.F_Location INNER JOIN Sys_SRM_User f ON f.F_Account='{2}' AND a.WorkPoint=f.F_Location
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' WHERE a.LotNo='{0}' AND a.WorkPoint='{1}'
END"; END";
sql = string.Format(sql, LotNo, WorkPoint, User, Quantity, LocationCode);
sql = string.Format(sql, LotNo, WorkPoint, User, Quantity, LocationCode,createDate);
if (!DBHelper.ExecuteNonQuery(sql, cmd)) if (!DBHelper.ExecuteNonQuery(sql, cmd))
{ {

Loading…
Cancel
Save