Browse Source

Revert "调整收料人信息"

This reverts commit b8cd7b6801.
master
lilili 1 year ago
parent
commit
6607e57bae
  1. 53
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs
  2. 2
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs

53
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs

@ -200,46 +200,37 @@ namespace ICSSoft.DataProject
/// <param name="Quantity"></param>
/// <param name="WorkPoint"></param>
/// <param name="cmd"></param>
public static void MOApply(string TransCode, string TransSequence, string Quantity, string WorkPoint,string userCode, SqlCommand cmd, Dictionary<string, string> language)
public static void MOApply(string TransCode, string TransSequence, string Quantity, string WorkPoint, SqlCommand cmd, Dictionary<string, string> language)
{
try
{
//string sql = @"DECLARE @Status VARCHAR(10)
// SELECT @Status=a.Status FROM ICSMOApply a
// WHERE a.ApplyCode='{0}' AND a.Sequence='{3}' AND a.WorkPoint='{1}'
// IF (@Status IS NULL)
// BEGIN
// RAISERROR('" + language.GetNameByCode("WMSAPIInfo128") + @"',16,1);
// RETURN
// END
// ELSE IF (@Status!='2')
// BEGIN
// RAISERROR('" + language.GetNameByCode("WMSAPIInfo129") + @"',16,1);
// RETURN
// END
// UPDATE a SET IssueQuantity=ISNULL(IssueQuantity,0)+'{2}'
// FROM ICSMOApply a
// WHERE a.ApplyCode='{0}' AND a.Sequence='{3}' AND a.WorkPoint='{1}'
// IF EXISTS(SELECT a.ID FROM ICSMOApply a
// WHERE a.ApplyCode='{0}' AND a.Sequence='{3}' and a.WorkPoint='{1}' AND a.Quantity<a.IssueQuantity)
// BEGIN
// RAISERROR('" + language.GetNameByCode("WMSAPIInfo091") + @"',16,1);
// RETURN
// END";
string sql = @"DECLARE @Status VARCHAR(10)
SELECT @Status=a.Status FROM ICSMOApply a
WHERE a.ApplyCode='{0}' AND a.Sequence='{3}' AND a.WorkPoint='{1}'
//sql = string.Format(sql, TransCode, WorkPoint, Quantity, TransSequence,userCode);
IF (@Status IS NULL)
BEGIN
RAISERROR('" + language.GetNameByCode("WMSAPIInfo128") + @"',16,1);
RETURN
END
ELSE IF (@Status!='2')
BEGIN
RAISERROR('" + language.GetNameByCode("WMSAPIInfo129") + @"',16,1);
RETURN
END
UPDATE a SET IssueQuantity=ISNULL(IssueQuantity,0)+'{2}'
FROM ICSMOApply a
WHERE a.ApplyCode='{0}' AND a.Sequence='{3}' AND a.WorkPoint='{1}'
string sql = $@"UPDATE ICSMOApply SET IssueQuantity=ISNULL(IssueQuantity,0)+'{Quantity}',ReceiverNumber='{userCode}',ReceiverName=(SELECT top 1 F_RealName FROM Sys_SRM_User WHERE F_Account='{userCode}' )
WHERE ApplyCode='{TransCode}' AND Sequence='{TransSequence}' AND WorkPoint='{WorkPoint}';
IF EXISTS(SELECT a.ID FROM ICSMOApply a
WHERE a.ApplyCode='{TransCode}' AND a.Sequence='{TransSequence}' and a.WorkPoint='{WorkPoint}' AND a.Quantity<a.IssueQuantity)
WHERE a.ApplyCode='{0}' AND a.Sequence='{3}' and a.WorkPoint='{1}' AND a.Quantity<a.IssueQuantity)
BEGIN
RAISERROR('{language.GetNameByCode("WMSAPIInfo091")}',16,1);
RAISERROR('" + language.GetNameByCode("WMSAPIInfo091") + @"',16,1);
RETURN
END";
sql = string.Format(sql, TransCode, WorkPoint, Quantity, TransSequence);
if (!DBHelper.ExecuteNonQuery(sql, cmd))
{
throw new Exception(language.GetNameByCode("WMSAPIInfo130"));//"领料申请单更新失败!");

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

@ -3191,7 +3191,7 @@ namespace ICSSoft.DataProject
{
BusinessCode = TransTypeEnum.MOApply.GetDescription<DBValue>();
//更新源头单据数量
ICSManufactureService.MOApply(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint,item.User, cmd, language);
ICSManufactureService.MOApply(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language);
foreach (var itemInfo in item.detail)
{

Loading…
Cancel
Save