Browse Source

调整销售发货的接口

master
lilili 2 years ago
parent
commit
46c2c7224e
  1. 10
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSalesService.cs
  2. 41
      WMS-BS/NFine.Application/WMS/PickMaterialApp.cs

10
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSalesService.cs

@ -43,11 +43,11 @@ namespace ICSSoft.DataProject
RAISERROR('" + language.GetNameByCode("WMSAPIInfo139") + @"',16,1);
RETURN
END
ELSE IF (@Status!='2')
BEGIN
RAISERROR('" + language.GetNameByCode("WMSAPIInfo140") + @"',16,1);
RETURN
END
--ELSE IF (@Status!='2')
--BEGIN
--RAISERROR('" + language.GetNameByCode("WMSAPIInfo140") + @"',16,1);
--RETURN
--END
UPDATE a SET SDNQuantity=ISNULL(SDNQuantity,0)+'{2}'
FROM ICSSDN a
WHERE a.SDNCode='{0}' AND a.Sequence='{3}' AND a.WorkPoint='{1}' AND a.Type='1'

41
WMS-BS/NFine.Application/WMS/PickMaterialApp.cs

@ -460,7 +460,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
DataTable dt = new DataTable();
var queryParam = queryJson.ToJObject();
List<DbParameter> parameter = new List<DbParameter>();
string sql = "";
StringBuilder sqlString = new StringBuilder();
#region [SQL]
// sql = @"select a.ID,a.SDNCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseName,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
//case when e.SourceID is null then '未合并' else '已合并' end as IsNew,a.Quantity
@ -469,37 +469,32 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
//left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
//left join ICSMOPickMerge e on a.ID=e.SourceID and a.WorkPoint=e.WorkPoint";
// sql += " WHERE 1=1 and a.Type='1' and e.ID is null";
sql = @"select a.SDNCode as Code, a.CreateDateTime as MTIME,a.CreatePerson as MUSER,
case when max(e.SourceID) is null then '' else '' end as IsNew
,f.Colspan ,f.ProjectCode ,f.BatchCode ,f.Version ,f.Brand ,f.cFree1 ,f.cFree2 ,f.cFree3 ,f.cFree4
,f.cFree5 ,f.cFree6 ,f.cFree7 ,f.cFree8 ,f.cFree9 ,f.cFree10
from ICSSDN a
left join ICSMOPickMerge e on a.ID=e.SourceID and a.WorkPoint=e.WorkPoint
left join ICSExtension f on a.ExtensionID=f.ID and a.WorkPoint=f.WorkPoint
where a.WorkPoint='{0}'
group by a.SDNCode,a.CreateDateTime,a.CreatePerson,f.Colspan ,f.ProjectCode ,f.BatchCode ,f.Version ,f.Brand ,f.cFree1 ,f.cFree2 ,f.cFree3 ,f.cFree4
,f.cFree5 ,f.cFree6 ,f.cFree7 ,f.cFree8 ,f.cFree9 ,f.cFree10";
sql = string.Format(sql, WorkPoint);
sql = string.Format(sql, DbHelper.GetErpIp(), DbHelper.GetErpName());
#endregion
sqlString.Append($@"SELECT a.SDNCode AS CODE,
a.CreateDateTime AS MTIME,
a.CreatePerson AS MUSER,
(CASE WHEN max(e.SourceID) IS NULL THEN '' ELSE '' END) AS IsNew,
f.Colspan, f.ProjectCode, f.BatchCode, f.Version, f.Brand,
f.cFree1, f.cFree2, f.cFree3, f.cFree4, f.cFree5, f.cFree6, f.cFree7, f.cFree8, f.cFree9, f.cFree10
FROM ICSSDN a
LEFT JOIN ICSMOPickMerge e ON a.ID = e.SourceID AND a.WorkPoint = e.WorkPoint
LEFT JOIN ICSExtension f ON a.ExtensionID = f.ID AND a.WorkPoint = f.WorkPoint
WHERE a.WorkPoint = '{WorkPoint}' ");
if (!string.IsNullOrWhiteSpace(queryJson))
{
if (!string.IsNullOrWhiteSpace(queryParam["POCode"].ToString()))
{
sql += " and a.SDNCode like '%" + queryParam["POCode"].ToString() + "%' ";
sqlString.Append($" and a.SDNCode like '%{queryParam["POCode"]}%' ");
}
if (!string.IsNullOrWhiteSpace(queryParam["InvCode"].ToString()))
{
sql += " and a.InvCode like '%" + queryParam["InvCode"].ToString() + "%' ";
sqlString.Append($" and a.InvCode like '%{queryParam["InvCode"]}%' ");
}
}
if (NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode != "admin")
{
sql += " and a.WorkPoint='" + NFine.Code.OperatorProvider.Provider.GetCurrent().Location + "'";
}
return Repository().FindTablePageBySql(sql.ToString(), parameter.ToArray(), ref jqgridparam);
sqlString.Append(@"GROUP BY a.SDNCode, a.CreateDateTime, a.CreatePerson, f.Colspan, f.ProjectCode, f.BatchCode, f.Version, f.Brand,
f.cFree1, f.cFree2, f.cFree3, f.cFree4, f.cFree5, f.cFree6, f.cFree7, f.cFree8, f.cFree9, f.cFree10");
#endregion
string test=sqlString.ToString();
return Repository().FindTablePageBySql(sqlString.ToString(), parameter.ToArray(), ref jqgridparam);
}
//销售发货(销售发货)子表查询

Loading…
Cancel
Save