Browse Source

分批合批 生成新条码号重复

master
Juj 1 year ago
parent
commit
424a9f436d
  1. 4
      WMS-BS/NFine.Application/WMS/DeciliterApp.cs

4
WMS-BS/NFine.Application/WMS/DeciliterApp.cs

@ -31,7 +31,9 @@ namespace NFine.Application.WMS
DataTable dt = new DataTable(); DataTable dt = new DataTable();
List<DbParameter> parameter = new List<DbParameter>(); List<DbParameter> parameter = new List<DbParameter>();
string sql = @"select max(LotNo) as NewLotNo from ICSInventoryLot where EATTRIBUTE1='{0}' ";
string sql = @"
SELECT TOP 1 LotNO as NewLotNo FROM ICSInventoryLot WHERE EATTRIBUTE1='{0}'
ORDER BY CAST(SUBSTRING(LotNO, (LEN(LotNO)-CHARINDEX('-',REVERSE(LotNO))+1)+1,CHARINDEX('-',REVERSE(LotNO))-1) AS INT) DESC";
sql = string.Format(sql, LotNO); sql = string.Format(sql, LotNO);
dt = Repository().FindTableBySql(sql.ToString()); dt = Repository().FindTableBySql(sql.ToString());
if (dt == null || dt.Rows.Count == 0 || dt.Rows[0]["NewLotNo"].ToString() == "") if (dt == null || dt.Rows.Count == 0 || dt.Rows[0]["NewLotNo"].ToString() == "")

Loading…
Cancel
Save