diff --git a/ICSSoft.FromERP/ICSSoft.FromERP/ICSWareHouseLotInfoDoc.cs b/ICSSoft.FromERP/ICSSoft.FromERP/ICSWareHouseLotInfoDoc.cs index 4458478..58bba90 100644 --- a/ICSSoft.FromERP/ICSSoft.FromERP/ICSWareHouseLotInfoDoc.cs +++ b/ICSSoft.FromERP/ICSSoft.FromERP/ICSWareHouseLotInfoDoc.cs @@ -68,7 +68,23 @@ namespace ICSSoft.FromERP var warehouse = db.ICSWarehouse.SingleOrDefault(e=>e.WarehouseCode==data.WHCode); string location = db.ICSLocation.Where(e=>e.WHID== warehouse.ID&&e.WorkPoint==workPoint).FirstOrDefault()?.LocationCode; string sql = $@"EXEC Addins_GetSerialCode '{workPoint}','ICSInventoryLot','LotNO','KCP{rcvCode}{sequence}',5;"; - string lotNo = ICSHelper.ExecuteScalar(CommandType.Text, sql).ToString(); + string lotNo; + if (data.IsSerialNumber == "ZS01") + { + var extention = db.ICSExtension.Where(e => e.ID==data.ExtensionID)?.SingleOrDefault(); + if (extention!=null) + { + lotNo = extention.BatchCode; + } + else + { + lotNo = ICSHelper.ExecuteScalar(CommandType.Text, sql).ToString(); + } + } + else + { + lotNo = ICSHelper.ExecuteScalar(CommandType.Text, sql).ToString(); + } //条码 var inventoryLot = new ICSInventoryLot() {