initialize
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
namespace com.itac.mes.simm
|
||||
{
|
||||
/// <summary>
|
||||
/// possible values for the configuration settings
|
||||
/// </summary>
|
||||
public enum ConfigCode
|
||||
|
||||
{
|
||||
OFF = 0,
|
||||
MES = 1,
|
||||
SIMM = 2
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Asm.As.Oib.Client;
|
||||
using com.itac.mes.imsapi.client.dotnet;
|
||||
using com.itac.mes.tools;
|
||||
using com.itac.mes.imsapi.domain.container;
|
||||
using KeyValue = com.itac.mes.imsapi.domain.container.KeyValue;
|
||||
using www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data;
|
||||
using com.itac.mes.imsapi;
|
||||
|
||||
namespace com.itac.mes
|
||||
{
|
||||
|
||||
|
||||
class ContainerCheckThread
|
||||
{
|
||||
|
||||
private static string attributeName = "SIMM-ManualSetToZero";
|
||||
public static int MIN_INTERVAL_SECONDS = 10;
|
||||
|
||||
private TimeSpan interval;
|
||||
private Thread thread;
|
||||
private IIMSApiDotNet imsapi;
|
||||
private SetupCenterNotificationClient setupCenterNotificationClient;
|
||||
private string stationNumber;
|
||||
private IMSApiSessionContextStruct sessionContext;
|
||||
private KeyValue[] materialBinFilters = new KeyValue[] { new KeyValue("MATERIAL_BIN_NUMBER", "*") };
|
||||
private AttributeInfo[] attributes = new AttributeInfo[] { new AttributeInfo(attributeName, "1") };
|
||||
private string[] materialBinResultKeys = new string[] { "MATERIAL_BIN_NUMBER" };
|
||||
|
||||
|
||||
|
||||
public ContainerCheckThread(TimeSpan interval, IIMSApiDotNet imsapi, IMSApiSessionContextStruct sessionContext, SetupCenterNotificationClient setupCenterNotificationClient, String stationNumber)
|
||||
{
|
||||
// none of those values must be null
|
||||
this.interval = interval;
|
||||
this.imsapi = imsapi;
|
||||
this.setupCenterNotificationClient = setupCenterNotificationClient;
|
||||
this.stationNumber = stationNumber;
|
||||
this.sessionContext = sessionContext;
|
||||
if (interval.TotalSeconds >= MIN_INTERVAL_SECONDS)
|
||||
{
|
||||
thread = new Thread(CheckContainers);
|
||||
}
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
if (thread != null)
|
||||
{
|
||||
thread.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public void CheckContainers()
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "start checking empty containers in MES (having attribute " + attributeName + "==1)");
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
string[] resultValues;
|
||||
int objectType = 2;
|
||||
string attributeValue = "1";
|
||||
int maxRows = 100;
|
||||
KeyValue[] attributeFilters = new KeyValue[0];
|
||||
// getContainers with attribute
|
||||
int returnCode = imsapi.attribGetObjectsForAttributeValues(sessionContext, stationNumber, objectType, attributeName, attributeValue, maxRows, attributeFilters, materialBinResultKeys, out resultValues);
|
||||
if (returnCode == 0 || returnCode == 3)
|
||||
{
|
||||
// for every container:
|
||||
// send this info to setupCenter and close them within SC
|
||||
// if OK remove the attribute from the container, otherwise set appropriate attribute value
|
||||
foreach (String containerId in resultValues)
|
||||
{
|
||||
consumePackagingUnitInSetupCenter(containerId);
|
||||
}
|
||||
}
|
||||
else if (returnCode == -932 || returnCode > 0)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "no empty containers found");
|
||||
}
|
||||
else if (returnCode < 0)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "failed to retrieve empty containers from MES, apiRet Code=" + returnCode);
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Critical, "processing empty containers failed", exception);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DateTime nextRun = DateTime.Now + interval;
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "next run for checking empty containers (having attribute " + attributeName + "==1) in " + interval + " at " + nextRun.ToLongTimeString());
|
||||
Thread.Sleep(interval);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void consumePackagingUnitInSetupCenter(string containerId)
|
||||
{
|
||||
// create an ASM packaging unit; for delete it is sufficient to have an UID only
|
||||
PackagingUnit packagingUnit = new PackagingUnit();
|
||||
packagingUnit.UID = containerId;
|
||||
PackagingUnitConsumedReport packUnitConsumedReport = new PackagingUnitConsumedReport();
|
||||
packUnitConsumedReport.PackagingUnits = new PackagingUnit[] { packagingUnit };
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "raise delete packagingUnit " + containerId + " in SetupCenter");
|
||||
try
|
||||
{
|
||||
setupCenterNotificationClient.RaisePackagingUnitConsumed(packUnitConsumedReport);
|
||||
// delete Packaging unite succeeded
|
||||
// remove attribute from container
|
||||
/* example call:
|
||||
attribRemoveAttributeValue()
|
||||
stationNumber= 01010010
|
||||
objectType= 2
|
||||
objectNumber= 000197630005
|
||||
objectDetail= -1
|
||||
attributeCode= SIMM - ManualSetToZero
|
||||
attributeValueKey= 1
|
||||
------------------------------------------------------------------
|
||||
Result_attribRemoveAttributeValue
|
||||
.return_value= 0 ''
|
||||
*/
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "remove attribute " + attributeName + " from container " + containerId);
|
||||
int objectType = 2;
|
||||
string objectDetail = "-1";
|
||||
string attributeValueKey = "1";
|
||||
int retValue = imsapi.attribRemoveAttributeValue(sessionContext, stationNumber, objectType, containerId, objectDetail, attributeName, attributeValueKey);
|
||||
if (retValue != 0)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "removing attribute " + attributeName + " from container " + containerId + " failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "removing attribute " + attributeName + " from container " + containerId + " succeded");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "raise consumed event for packagingUnit " + containerId + " failed", e);
|
||||
// modify attribute value
|
||||
|
||||
/* example call
|
||||
attribAppendAttributeValues()
|
||||
stationNumber= 01010010
|
||||
objectType= 2
|
||||
objectNumber= 000197630005
|
||||
objectDetail= -1
|
||||
bookDate= -1
|
||||
allowOverWrite= 1
|
||||
attributeUploadKeys.length= 3
|
||||
attributeUploadKeys[0]= ATTRIBUTE_CODE
|
||||
attributeUploadKeys[1]= ATTRIBUTE_VALUE
|
||||
attributeUploadKeys[2]= ERROR_CODE
|
||||
attributeUploadValues.length= 3
|
||||
attributeUploadValues[0]= SIMM - ManualSetToZero
|
||||
attributeUploadValues[1]= 3
|
||||
attributeUploadValues[2]= 0
|
||||
------------------------------------------------------------------
|
||||
Result_attribAppendAttributeValues
|
||||
.return_value= 0 ''
|
||||
.attributeResultValues[] empty
|
||||
*/
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "update attribute " + attributeName + " from container " + containerId + " to value 2");
|
||||
int objectType = 2;
|
||||
string objectDetail = "-1";
|
||||
long bookDate = -1;
|
||||
int allowOverwrite = 1;
|
||||
string[] attributeUploadKeys = new string[] { "ATTRIBUTE_CODE", "ATTRIBUTE_VALUE", "ERROR_CODE" };
|
||||
string[] attributeUploadValues = new string[] { attributeName, "2", "0" };
|
||||
string[] attributeResultValues = null;
|
||||
int retValue = imsapi.attribAppendAttributeValues(sessionContext, stationNumber, objectType, containerId, objectDetail,
|
||||
bookDate, allowOverwrite, attributeUploadKeys, attributeUploadValues, out attributeResultValues);
|
||||
if (retValue != 0)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "setting attribute " + attributeName + " from container " + containerId + " to value 2 failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using com.itac.mes.imsapi;
|
||||
|
||||
namespace com.itac.mes.imsapi.data
|
||||
{
|
||||
public class MaterialBinBooking
|
||||
{
|
||||
public static string[] MAXIMAL_INFORMATION = new string[] { "ERROR_CODE", "MATERIAL_BIN_NUMBER", "MATERIAL_BIN_QTY_ACTUAL", "QUANTITY", "TRANSACTION_CODE" };
|
||||
|
||||
[ImsApiKey(Key = "MATERIAL_BIN_NUMBER")]
|
||||
public string materialBinNumber;
|
||||
|
||||
[ImsApiKey(Key = "MATERIAL_BIN_QTY_ACTUAL")]
|
||||
public int materialBinQuantityActual = 0;
|
||||
|
||||
[ImsApiKey(Key = "QUANTITY")]
|
||||
public int quantity = 0;
|
||||
|
||||
[ImsApiKey(Key = "TRANSACTION_CODE")]
|
||||
public string transactionCode;
|
||||
|
||||
[ImsApiKey(Key = "ERROR_CODE")]
|
||||
public int errorCode = 0;
|
||||
|
||||
|
||||
|
||||
public int CompareTo(MaterialBinBooking obj)
|
||||
{
|
||||
if (materialBinNumber == null) return -1;
|
||||
if (obj == null) return 1;
|
||||
return materialBinNumber.CompareTo(obj.materialBinNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
namespace com.itac.mes.proxy
|
||||
{
|
||||
public class MslLevel
|
||||
{
|
||||
/// <summary>
|
||||
/// SetupCenter has it's own values for the MSL Levels. These are defined as constants
|
||||
/// This function returns the value from MsdLevel as a String (lower case);
|
||||
/// </summary>
|
||||
/// <param name="mslLevel"></param>
|
||||
/// <returns></returns>
|
||||
public static string toString(int msdLevel)
|
||||
{
|
||||
switch (msdLevel)
|
||||
{
|
||||
case 1: return "1";
|
||||
case 2: return "2";
|
||||
case 3: return "2a";
|
||||
case 4: return "3";
|
||||
case 5: return "4";
|
||||
case 6: return "5";
|
||||
case 7: return "5a";
|
||||
case 8: return "6";
|
||||
default: return "1";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// convert a level as it is used in iTAC.MES.Suite to a value used in SetupCenter
|
||||
/// </summary>
|
||||
/// <param name="itacLevel"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public static int toCode(string itacLevel)
|
||||
{
|
||||
switch (itacLevel)
|
||||
{
|
||||
case "1": return 1;
|
||||
case "2": return 2;
|
||||
case "2a": case "2A": return 3;
|
||||
case "3": return 4;
|
||||
case "4": return 5;
|
||||
case "5": return 6;
|
||||
case "5a": case "5A": return 7;
|
||||
case "6": return 8;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,584 @@
|
||||
#region Namespace
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.ServiceModel;
|
||||
using com.itac.mes.proxy;
|
||||
using www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data;
|
||||
using www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Service;
|
||||
using OibClient = Asm.As.Oib.Client;
|
||||
using com.itac.mes.imsapi.domain.container;
|
||||
using System.Collections.Generic;
|
||||
using com.itac.mes.imsapi;
|
||||
using KeyValue = com.itac.mes.imsapi.domain.container.KeyValue;
|
||||
using com.itac.mes.imsapi.data;
|
||||
using System.Configuration;
|
||||
using com.itac.mes.simm;
|
||||
using com.itac.mes.tools;
|
||||
using com.itac.mes.imsapi.client.dotnet;
|
||||
#endregion
|
||||
|
||||
|
||||
namespace Itac.Oib.Simm
|
||||
{
|
||||
|
||||
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
|
||||
public class SetupCenterExternalControlReceiver : ISiplaceSetupCenterExternalControl, IDisposable, IReceiver
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private readonly OibClient.OibSetupCenterExternalControlEvents _oibSetupCenterExternalControlEvents;
|
||||
|
||||
private IIMSApiDotNet imsapi;
|
||||
private IMSApiSessionContextStruct sessionContext;
|
||||
private ItacXmlSerializer serializer;
|
||||
|
||||
private long firstASMTime = new DateTime(1900, 1, 1, 0, 0, 0, DateTimeKind.Utc).Ticks;
|
||||
private long msdOpenTime = DateTime.MinValue.Ticks;
|
||||
private long lastItacTimeTicks = new DateTime(3000, 12, 31, 23, 59, 59, DateTimeKind.Utc).Ticks;
|
||||
private long firstItacTimeTicks = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).Ticks;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// the station Number is configured, must not be empty and MUST exist and valid!!!
|
||||
/// if the stationNumber is not valid (licensed etc) all requests are rejected!!
|
||||
/// </summary>
|
||||
private string stationNumber;
|
||||
private int transactionCode;
|
||||
|
||||
// some optional values, default false
|
||||
private bool mslLevelCheck;
|
||||
private ConfigCode expirationMaster;
|
||||
private ConfigCode mslMaster;
|
||||
private ConfigCode quantityMaster;
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
public SetupCenterExternalControlReceiver(OibClient.OibSetupCenterExternalControlEvents oibSetupCenterExternalControlEvents, IIMSApiDotNet imsapi, IMSApiSessionContextStruct newSessionContext,
|
||||
String stationNumber, int transactionCode,
|
||||
ConfigCode quantityMaster, ConfigCode mslMaster, ConfigCode expirationMaster)
|
||||
{
|
||||
_oibSetupCenterExternalControlEvents = oibSetupCenterExternalControlEvents;
|
||||
if (oibSetupCenterExternalControlEvents != null)
|
||||
{
|
||||
oibSetupCenterExternalControlEvents.Ping = Ping;
|
||||
oibSetupCenterExternalControlEvents.GetNewPackagingUnitData = GetNewPackagingUnitData;
|
||||
oibSetupCenterExternalControlEvents.GetPackagingUnitControlStatus = GetPackagingUnitControlStatus;
|
||||
}
|
||||
this.imsapi = imsapi;
|
||||
this.sessionContext = newSessionContext;
|
||||
this.stationNumber = stationNumber;
|
||||
this.transactionCode = transactionCode;
|
||||
this.quantityMaster = quantityMaster;
|
||||
this.mslMaster = mslMaster;
|
||||
this.expirationMaster = expirationMaster;
|
||||
serializer = new ItacXmlSerializer();
|
||||
|
||||
// evaluate some optional parameters from appConfig file
|
||||
if (!String.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings["mslLevelCheck"]))
|
||||
{
|
||||
mslLevelCheck = bool.Parse(ConfigurationManager.AppSettings["mslLevelCheck"].ToString());
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "optional parameter 'mslLevelCheck' set '" + mslLevelCheck.ToString() + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_oibSetupCenterExternalControlEvents != null)
|
||||
_oibSetupCenterExternalControlEvents.Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Start/Stop
|
||||
|
||||
public void StartReceiver()
|
||||
{
|
||||
_oibSetupCenterExternalControlEvents.Start();
|
||||
}
|
||||
|
||||
public void StopReceiver()
|
||||
{
|
||||
_oibSetupCenterExternalControlEvents.Stop();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region toolFunctions
|
||||
|
||||
// muss noch weiter getestet werden...
|
||||
public void DeepCopy(object sourceObject, object destObject)
|
||||
{
|
||||
Type sourceType = sourceObject.GetType();
|
||||
Type destType = destObject.GetType();
|
||||
MemberInfo[] sourceMbrInfoArray = sourceType.GetMembers();
|
||||
MemberInfo[] destMbrInfoArray = destType.GetMembers();
|
||||
|
||||
foreach (MemberInfo sourceMbrInfo in sourceMbrInfoArray)
|
||||
{
|
||||
if (sourceMbrInfo.MemberType == MemberTypes.Property)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "" + sourceMbrInfo + " is a " + sourceMbrInfo.MemberType);
|
||||
// alle einfachen TypeNameConverter direkt prüfen (int, String, bool)
|
||||
// komplexe Typen ???
|
||||
|
||||
PropertyInfo sourcePropInfo = sourceType.GetProperty(sourceMbrInfo.Name);
|
||||
|
||||
// gibt es das Property auch im Zielobjekt
|
||||
foreach (MemberInfo destMbrInfo in destMbrInfoArray)
|
||||
{
|
||||
// identischer Name, identischerr Typ
|
||||
if (destMbrInfo.MemberType == sourceMbrInfo.MemberType && destMbrInfo.Name == sourceMbrInfo.Name)
|
||||
{
|
||||
PropertyInfo destPropInfo = destType.GetProperty(destMbrInfo.Name);
|
||||
object sourceValue = sourcePropInfo.GetValue(sourceObject, null);
|
||||
object destValue = destPropInfo.GetValue(destObject, null);
|
||||
if (sourcePropInfo.PropertyType == typeof(String) || sourcePropInfo.PropertyType == typeof(int)
|
||||
|| sourcePropInfo.PropertyType == typeof(Int32) || sourcePropInfo.PropertyType == typeof(Int64)
|
||||
|| sourcePropInfo.PropertyType == typeof(long) || sourcePropInfo.PropertyType == typeof(bool)
|
||||
|| sourcePropInfo.PropertyType == typeof(Boolean))
|
||||
{
|
||||
if (sourceValue != destValue)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "primitive type copy value");
|
||||
destPropInfo.SetValue(destObject, sourceValue, null);
|
||||
}
|
||||
}
|
||||
else if (!sourceType.IsArray)
|
||||
{
|
||||
// komplexer Typ, kein Array
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, sourceMbrInfo.Name + " is complex type ");
|
||||
if (sourceValue != null)
|
||||
{
|
||||
DeepCopy(sourceValue, destValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, sourceMbrInfo.Name + " is complex type, sourceValue is null");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void applyToPackagingUnit(SmtContainer container, ref PackagingUnit p)
|
||||
{
|
||||
p.BatchId = container.supplierChargeNumber;
|
||||
// p.BatchPackagingUnit=
|
||||
p.BrightnessClass = container.classification; ;
|
||||
// p.Comment="";
|
||||
p.ComponentBarcode = "";
|
||||
p.ComponentName = container.materialBinPartNumber;
|
||||
// p.ConsumptionDate = getDateValue(resultValues[indexMap[""]]);
|
||||
|
||||
// special case: itac 31.12.3000 is unexpired, in ASM 31.12.9999
|
||||
if (container.expirationDate >= new DateTime(2037, 12, 31))
|
||||
{
|
||||
p.ExpiryDate = DateTime.MaxValue.ToUniversalTime();
|
||||
}
|
||||
else
|
||||
{
|
||||
p.ExpiryDate = container.expirationDate; // getDateValue(resultValues[indexMap["EXPIRATION_DATE"]]);
|
||||
}
|
||||
// p.Extra1="";
|
||||
// p.Extra2="";
|
||||
// p.Extra3="";
|
||||
// p.GreyZone=
|
||||
if (p.LastProductionDate <= new DateTime(1901, 01, 01, 00, 00, 00, DateTimeKind.Utc))
|
||||
{
|
||||
p.LastProductionDate = DateTime.MinValue.ToUniversalTime();
|
||||
}
|
||||
// p.ManufactureLocation
|
||||
// p.ManufacturePartNumber
|
||||
p.Manufacturer = container.supplierName;
|
||||
p.ManufacturerDate = container.dateCreated;
|
||||
p.MsdLevel = MslLevel.toCode(container.mslLevel);
|
||||
|
||||
string mslState = container.mslState;
|
||||
if ("C".Equals(mslState))
|
||||
{
|
||||
p.MsdOpenDate = DateTime.MinValue.ToUniversalTime();
|
||||
}
|
||||
else
|
||||
{
|
||||
// take open date from MES
|
||||
p.MsdOpenDate = container.mslOpenDate;
|
||||
// correction of MSD open Date when unopened
|
||||
if (p.MsdOpenDate <= new DateTime(1901, 01, 01, 00, 00, 00, DateTimeKind.Utc))
|
||||
{
|
||||
p.MsdOpenDate = DateTime.MinValue.ToUniversalTime();
|
||||
}
|
||||
}
|
||||
|
||||
// p.OrderingCode = ;
|
||||
p.OriginalQuantity = container.quantity;// Convert.ToInt32(double.Parse(resultValues[indexMap["MATERIAL_BIN_QTY_TOTAL"]]));
|
||||
p.PurchaseOrderNumber = container.huNumber;
|
||||
p.Quantity = container.materialBinQuantityActual; // Convert.ToInt32(Double.Parse(resultValues[indexMap["MATERIAL_BIN_QTY_ACTUAL"]]));
|
||||
// p.RevisionLevel;
|
||||
// p.RoHS
|
||||
// p.Serial
|
||||
// p.ShippingNoteNumber
|
||||
// p.SplicedPackagingUnit
|
||||
p.Supplier = container.supplierName;
|
||||
// p.SupplierData
|
||||
// p.UID;
|
||||
}
|
||||
|
||||
|
||||
public void mapValues(PackagingUnit pu, string[] materialBinUploadKeys, ref string[] result, int index)
|
||||
{
|
||||
foreach (string s in materialBinUploadKeys)
|
||||
{
|
||||
switch (s)
|
||||
{
|
||||
case "ERROR_CODE": result[index++] = "0"; break;
|
||||
case "MATERIAL_BIN_NUMBER": result[index++] = pu.UID; break;
|
||||
default: result[index++] = "0"; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void deepAddUnit(PackagingUnit packUnit, ref Dictionary<string, PackagingUnit> packagingUnitMap)
|
||||
{
|
||||
packagingUnitMap.Add(packUnit.UID, packUnit);
|
||||
if (packUnit.SplicedPackagingUnit != null)
|
||||
{
|
||||
deepAddUnit(packUnit.SplicedPackagingUnit, ref packagingUnitMap);
|
||||
}
|
||||
}
|
||||
#endregion toolFunctions
|
||||
|
||||
#region ISiplaceSetupCenterExternalControl Members
|
||||
|
||||
/// <summary>
|
||||
/// Check for the client if this service is available.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool Ping()
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "SetupCenterExternalControl.Ping");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the packaging unit control status.
|
||||
/// </summary>
|
||||
/// <param name="packagingUnitLocations">The packaging unit locations.</param>
|
||||
/// <returns>List of ExternalControlResults for reading the data</returns>
|
||||
/// ResultState UNKNOWN=0;OK = 1;NOT_OK=2;
|
||||
public ExternalControlResult[] GetNewPackagingUnitData(PackagingUnitLocation[] packagingUnitLocations)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "SetupCenterExternalControl.GetNewPackagingUnit()\n"
|
||||
+ serializer.serialize(packagingUnitLocations).ToString());
|
||||
|
||||
KeyValue[] matBinfilters = new KeyValue[] { new KeyValue("MATERIAL_BIN_NUMBER", "") };
|
||||
AttributeInfo[] attributes = new AttributeInfo[0];
|
||||
string[] resultValues;
|
||||
|
||||
try
|
||||
{
|
||||
ExternalControlResult[] result = new ExternalControlResult[packagingUnitLocations.Length];
|
||||
for (int i = 0; i < packagingUnitLocations.Length; i++)
|
||||
{
|
||||
result[i] = new ExternalControlResult();
|
||||
result[i].PackagingUnit = packagingUnitLocations[i].PackagingUnit;
|
||||
|
||||
matBinfilters[0].value = packagingUnitLocations[i].PackagingUnit.UID;
|
||||
int imsapiResult = imsapi.mlGetMaterialBinData(sessionContext, stationNumber, matBinfilters, attributes, SmtContainer.MAXIMAL_INFORMATION, out resultValues);
|
||||
// return all relevant PackagingUnit infos known in iTAC.MES.Suite
|
||||
if (imsapiResult < 0 || imsapiResult == 1) // 1 = no data found
|
||||
{
|
||||
result[i].ResultState = 2;
|
||||
result[i].Messages = new ExternalControlResultMessage[] { new ExternalControlResultMessage() };
|
||||
result[i].Messages[0].Message = "UID " + packagingUnitLocations[i].PackagingUnit.UID + " unknown in iTAC.MES.Suite";
|
||||
}
|
||||
else
|
||||
{
|
||||
// OK, Info gathered
|
||||
result[i].ResultState = 1;
|
||||
result[i].Messages = new ExternalControlResultMessage[] { };
|
||||
PackagingUnit p = result[i].PackagingUnit;
|
||||
try
|
||||
{
|
||||
SmtContainer knownContainer = new ImsApiMapTool<SmtContainer>().getStruct(typeof(SmtContainer), SmtContainer.MAXIMAL_INFORMATION, resultValues);
|
||||
applyToPackagingUnit(knownContainer, ref p);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
result[i].ResultState = 2;
|
||||
result[i].Messages = new ExternalControlResultMessage[] { new ExternalControlResultMessage() };
|
||||
result[i].Messages[0].Message = e.Message.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, serializer.serialize(result).ToString());
|
||||
return result;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Fehler, keine weitere info vorhanden, da die Applikation nicht läuft
|
||||
return new ExternalControlResult[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the packaging unit control status.
|
||||
/// </summary>
|
||||
/// <param name="packagingUnitLocations">The packaging unit locations.</param>
|
||||
/// <returns>List of ExternalControlResults for reading the data</returns>
|
||||
public ExternalControlResult[] GetPackagingUnitControlStatus(PackagingUnitLocation[] packagingUnitLocations)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "SetupCenterExternalControl.GetPackagingUnitControlStatus:\n"
|
||||
+ serializer.serialize(packagingUnitLocations).ToString());
|
||||
if (!mslLevelCheck)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "mslLevel check switched off by confguration");
|
||||
}
|
||||
|
||||
KeyValue[] matBinfilters = new KeyValue[] { new KeyValue("MATERIAL_BIN_NUMBER", "") };
|
||||
AttributeInfo[] attributes = new AttributeInfo[0];
|
||||
|
||||
// flag wether to update any qty or not.
|
||||
LinkedList<MaterialBinBooking> updateQtyList = new LinkedList<MaterialBinBooking>();
|
||||
try
|
||||
{
|
||||
ExternalControlResult[] result = new ExternalControlResult[packagingUnitLocations.Length];
|
||||
for (int resultIndex = 0; resultIndex < packagingUnitLocations.Length; resultIndex++)
|
||||
{
|
||||
result[resultIndex] = new ExternalControlResult();
|
||||
result[resultIndex].PackagingUnit = packagingUnitLocations[resultIndex].PackagingUnit;
|
||||
PackagingUnit packagingUnit = packagingUnitLocations[resultIndex].PackagingUnit;
|
||||
// ResultState UNKNOWN = 0; OK = 1; NOT_OK = 2;
|
||||
result[resultIndex].ResultState = 1;
|
||||
result[resultIndex].Messages = new ExternalControlResultMessage[] { };
|
||||
|
||||
string[] resultValues;
|
||||
|
||||
matBinfilters[0].value = packagingUnitLocations[resultIndex].PackagingUnit.UID;
|
||||
int imsapiResult = imsapi.mlGetMaterialBinData(sessionContext, stationNumber, matBinfilters, attributes, SmtContainer.MINIMAL_INFORMATION, out resultValues);
|
||||
|
||||
if (imsapiResult < 0 || imsapiResult == 1) // 1 = no data found
|
||||
{
|
||||
// Packaging Units unknown in MES.Suite must be rejected
|
||||
// Error, Packaging Unit not found in mes.suite
|
||||
result[resultIndex].ResultState = 2;
|
||||
ExternalControlResultMessage message = new ExternalControlResultMessage();
|
||||
message.Message = "PackagingUnit '" + packagingUnitLocations[resultIndex].PackagingUnit.UID + "' unknown in iTAC.MES.Suite";
|
||||
result[resultIndex].Messages = new ExternalControlResultMessage[] { message };
|
||||
}
|
||||
else
|
||||
{
|
||||
// find any differences in quantities and update the values in MES.Suite
|
||||
SmtContainer knownContainer = new ImsApiMapTool<SmtContainer>().getStruct(typeof(SmtContainer), SmtContainer.MINIMAL_INFORMATION, resultValues);
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, serializer.serialize(knownContainer).ToString());
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "quantityMaster=" + quantityMaster);
|
||||
adjustQuantity(quantityMaster, ref knownContainer, ref packagingUnit, ref updateQtyList);
|
||||
|
||||
// any differences in mslLevel?
|
||||
if (mslLevelCheck)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "mslLevelCheck=true");
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, String.Format("UID: {0} MsdLevel(ASM): {1}, MslLevel(iTAC): {2}", packagingUnit.UID, packagingUnit.MsdLevel, knownContainer.mslLevel));
|
||||
|
||||
if (!knownContainer.mslLevel.ToLower().Equals(MslLevel.toString(packagingUnit.MsdLevel)))
|
||||
{
|
||||
// failure, wrong MslLevel
|
||||
result[resultIndex].ResultState = 2;
|
||||
ExternalControlResultMessage message = new ExternalControlResultMessage();
|
||||
message.Message = String.Format("PackagingUnit {0} has MsdLevel {1} in SetupCenter, but Level {2} in iTAC.MES.Suite",
|
||||
packagingUnit.UID, MslLevel.toString(packagingUnit.MsdLevel), knownContainer.mslLevel);
|
||||
result[resultIndex].Messages = new ExternalControlResultMessage[] { message };
|
||||
}
|
||||
// continue with next container
|
||||
continue;
|
||||
}
|
||||
|
||||
// any differences in msl state?
|
||||
if (mslMaster == ConfigCode.SIMM)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "mslMaster=" + mslMaster.ToString());
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, String.Format("UID: {0} MsdOpen(ASM): {1}, MslState(iTAC): {2}", packagingUnit.UID, isMsdOpen(packagingUnit.MsdOpenDate), knownContainer.mslState));
|
||||
|
||||
// iTAC states : C = geschützt / verschweißt(Closed) O = ungeschützt / offen(Open) B = in der Rücktrocknung (Baking)
|
||||
// ASM closed: MsdOpenDate = 2.1.1900
|
||||
KeyValue[] mslEventParams = new KeyValue[] { new KeyValue("BOOK_DATE", getImsApiDateString(packagingUnit.MsdOpenDate)) };
|
||||
KeyValue[] mslStopEventParams = new KeyValue[] { new KeyValue("BOOK_DATE", "-1") };
|
||||
string[] mslObjectKeys = new String[] { "ERROR_CODE", "MATERIAL_BIN_NUMBER" };
|
||||
string[] mslObjectValues = new String[] { "0", packagingUnit.UID };
|
||||
string[] mslResultValues = new String[] { };
|
||||
|
||||
if (knownContainer.mslState.Equals("C") && isMsdOpen(packagingUnit.MsdOpenDate))
|
||||
{
|
||||
// closed in iTAC, open in ASM--> required to open in iTAC!!!
|
||||
int mslStartExpirationCode = imsapi.mslStartObjectExpiration(sessionContext, stationNumber, mslEventParams, mslObjectKeys, mslObjectValues, out mslResultValues);
|
||||
if (mslStartExpirationCode < 0)
|
||||
{
|
||||
result[resultIndex].ResultState = 2;
|
||||
ExternalControlResultMessage message = new ExternalControlResultMessage();
|
||||
message.Message = String.Format("PackagingUnit {0} not opened in iTAC.MES.Suite", packagingUnit.UID);
|
||||
result[resultIndex].Messages = new ExternalControlResultMessage[] { message };
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (knownContainer.mslState.Equals("O") && !isMsdOpen(packagingUnit.MsdOpenDate) && packagingUnit.MsdOpenDate.Ticks > DateTime.MinValue.Ticks)
|
||||
{
|
||||
// open in iTAC, closed in ASM--> required to close in iTAC!!!
|
||||
int mslStopExpirationCode = imsapi.mslStopObjectExpiration(sessionContext, stationNumber, mslStopEventParams, mslObjectKeys, mslObjectValues, out mslResultValues);
|
||||
if (mslStopExpirationCode < 0)
|
||||
{
|
||||
result[resultIndex].ResultState = 2;
|
||||
ExternalControlResultMessage message = new ExternalControlResultMessage();
|
||||
message.Message = String.Format("PackagingUnit {0} not closed in iTAC.MES.Suite", packagingUnit.UID);
|
||||
result[resultIndex].Messages = new ExternalControlResultMessage[] { message };
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (mslMaster == ConfigCode.MES)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Warning, "this mode is currently not supported!");
|
||||
}
|
||||
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "expirationMaster=" + expirationMaster.ToString());
|
||||
if (!adjustExpiration(expirationMaster, ref knownContainer, ref packagingUnit, ref imsapi, ref result[resultIndex]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// SiMM-Corrections
|
||||
if (packagingUnit.MsdOpenDate <= new DateTime(1900, 01, 01)) { packagingUnit.MsdOpenDate = DateTime.MinValue.ToUniversalTime(); }
|
||||
if (packagingUnit.ConsumptionDate <= new DateTime(1900, 01, 01)) { packagingUnit.ConsumptionDate = DateTime.MinValue.ToUniversalTime(); }
|
||||
if (packagingUnit.ExpiryDate <= new DateTime(1900, 01, 01)) { packagingUnit.ExpiryDate = DateTime.MinValue.ToUniversalTime(); }
|
||||
if (packagingUnit.LastProductionDate <= new DateTime(1900, 01, 01)) { packagingUnit.LastProductionDate = DateTime.MinValue.ToUniversalTime(); }
|
||||
if (packagingUnit.ManufacturerDate <= new DateTime(1900, 01, 01)) { packagingUnit.ManufacturerDate = DateTime.MinValue.ToUniversalTime(); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (quantityMaster == ConfigCode.SIMM && updateQtyList.Count > 0)
|
||||
{
|
||||
MaterialBinBooking[] matBinBookingArray = new MaterialBinBooking[updateQtyList.Count];
|
||||
updateQtyList.CopyTo(matBinBookingArray, 0);
|
||||
string[] materialBinBookingUploadValues = new ImsApiMapTool<MaterialBinBooking>().getValueArray(matBinBookingArray, MaterialBinBooking.MAXIMAL_INFORMATION); ;
|
||||
string[] materialBinBookingsResultValues = null;
|
||||
int retUpdateQty = imsapi.mlUploadMaterialBinBooking(sessionContext, stationNumber, MaterialBinBooking.MAXIMAL_INFORMATION, materialBinBookingUploadValues, out materialBinBookingsResultValues);
|
||||
}
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, serializer.serialize(result).ToString());
|
||||
return result;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Fehler, keine weitere info vorhanden, da die Applikation nicht läuft
|
||||
return new ExternalControlResult[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void adjustQuantity(ConfigCode quantityMaster, ref SmtContainer knownContainer, ref PackagingUnit packagingUnit, ref LinkedList<MaterialBinBooking> updateQtyList)
|
||||
{
|
||||
if (quantityMaster == ConfigCode.SIMM)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, String.Format("UID: {0} Qty(ASM): {1}, Qty(iTAC): {2}", packagingUnit.UID, packagingUnit.Quantity, knownContainer.materialBinQuantityActual));
|
||||
if (packagingUnit.Quantity != knownContainer.materialBinQuantityActual)
|
||||
{
|
||||
// udpate the MES with the quantity from ASM
|
||||
MaterialBinBooking matBinBooking = new MaterialBinBooking();
|
||||
matBinBooking.materialBinNumber = packagingUnit.UID;
|
||||
matBinBooking.transactionCode = transactionCode.ToString();
|
||||
matBinBooking.materialBinQuantityActual = packagingUnit.Quantity;
|
||||
updateQtyList.AddLast(matBinBooking);
|
||||
}
|
||||
}
|
||||
else if (quantityMaster == ConfigCode.MES)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, String.Format("UID: {0} Qty(ASM): {1}, Qty(iTAC): {2}", packagingUnit.UID, packagingUnit.Quantity, knownContainer.materialBinQuantityActual));
|
||||
if (packagingUnit.Quantity != knownContainer.materialBinQuantityActual)
|
||||
{
|
||||
packagingUnit.Quantity = knownContainer.materialBinQuantityActual;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public bool adjustExpiration(ConfigCode expirationMaster, ref SmtContainer knownContainer, ref PackagingUnit packagingUnit, ref IIMSApiDotNet imsapi, ref ExternalControlResult result)
|
||||
{
|
||||
if (expirationMaster == ConfigCode.SIMM)
|
||||
{
|
||||
if (packagingUnit.ExpiryDate == DateTime.MinValue)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, String.Format("UID: {0} no expiration set", packagingUnit.UID));
|
||||
return true;
|
||||
}
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, String.Format("UID: {0} expiryDate(ASM): {1}, expirationDate(iTAC): {2}", packagingUnit.UID, packagingUnit.ExpiryDate, knownContainer.expirationDate));
|
||||
if (expirationDateDifferent(packagingUnit.ExpiryDate, knownContainer.expirationDate))
|
||||
{
|
||||
// update expirationDate in iTAC
|
||||
KeyValue[] keyValueArray = new KeyValue[1];
|
||||
keyValueArray[0] = new KeyValue("EXPIRATION_DATE_FINAL", getImsApiDateString(packagingUnit.ExpiryDate));
|
||||
int changeBinResult = imsapi.mlChangeMaterialBinData(sessionContext, stationNumber, packagingUnit.UID, keyValueArray);
|
||||
if (changeBinResult < 0)
|
||||
{
|
||||
// reject container
|
||||
result.ResultState = 2;
|
||||
ExternalControlResultMessage message = new ExternalControlResultMessage();
|
||||
message.Message = String.Format("PackagingUnit {0} expiration date final not updated in iTAC.MES.Suite", packagingUnit.UID);
|
||||
result.Messages = new ExternalControlResultMessage[] { message };
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (expirationMaster == ConfigCode.MES)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Warning, "this mode is currently not supported!");
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public string getImsApiDateString(DateTime expiryDate)
|
||||
{
|
||||
if (expiryDate.Ticks >= lastItacTimeTicks)
|
||||
{
|
||||
return "32535212399000";
|
||||
}
|
||||
if (expiryDate.Ticks <= firstItacTimeTicks)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
|
||||
return expiryDate.ToUniversalTime().Subtract(
|
||||
new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)
|
||||
).TotalMilliseconds.ToString();
|
||||
}
|
||||
|
||||
public bool expirationDateDifferent(DateTime expiryDate, DateTime expirationDate)
|
||||
{
|
||||
// both values after 30.12.3000 00:00:00 --> same...
|
||||
if (expiryDate.Day >= 30 && expiryDate.Month >= 12 && expiryDate.Year >= 3000 &&
|
||||
expirationDate.Day >= 30 && expirationDate.Month >= 12 && expirationDate.Year >= 3000) { return false; }
|
||||
return expiryDate.Ticks != expirationDate.Ticks;
|
||||
}
|
||||
|
||||
public bool isMsdOpen(DateTime msdOpenDate)
|
||||
{
|
||||
return (msdOpenDate.Ticks > msdOpenTime);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using com.itac.mes.imsapi;
|
||||
|
||||
namespace com.itac.mes.imsapi.data
|
||||
{
|
||||
public class SmtContainer
|
||||
{
|
||||
|
||||
public static string[] MAXIMAL_INFORMATION = new string[] { "MATERIAL_BIN_NUMBER", "EXPIRATION_DATE", "MATERIAL_BIN_DATE_CODE",
|
||||
"MATERIAL_BIN_PART_NUMBER", "MATERIAL_BIN_STATE", "SUPPLIER_CHARGE_NUMBER", "DATE_CREATED",
|
||||
"PART_COST", "PART_COST_BASE", "STORAGE_DESC", "STORAGE_NUMBER", "RECEIVING_NUMBER", "SUPPLIER_NAME", "SUPPLIER_NUMBER",
|
||||
"CLASSIFICATION", "MSL_STATE", "MSL_LEVEL", "MSL_DRY_END_DATE", "MSL_OPEN_DATE", "HU_NUMBER",
|
||||
"MATERIAL_BIN_QTY_ACTUAL", "MATERIAL_BIN_QTY_TOTAL"};
|
||||
|
||||
public static string[] MINIMAL_INFORMATION = new string[] { "MATERIAL_BIN_NUMBER", "EXPIRATION_DATE", "MATERIAL_BIN_STATE",
|
||||
"MSL_STATE", "MSL_LEVEL", "MSL_DRY_END_DATE", "MSL_OPEN_DATE", "MATERIAL_BIN_QTY_ACTUAL" };
|
||||
|
||||
[ImsApiKey(Key = "MATERIAL_BIN_NUMBER")]
|
||||
public string materialBinNumber { get; set; }
|
||||
[ImsApiKey(Key = "MATERIAL_BIN_QTY_ACTUAL")]
|
||||
public int materialBinQuantityActual = 0;
|
||||
[ImsApiKey(Key = "MATERIAL_BIN_QTY_TOTAL")]
|
||||
public int quantity = 0;
|
||||
[ImsApiKey(Key = "ERROR_CODE")]
|
||||
public int errorCode = 0;
|
||||
[ImsApiKey(Key = "EXPIRATION_DATE")]
|
||||
public DateTime expirationDate;
|
||||
[ImsApiKey(Key = "DATE_CREATED")]
|
||||
public DateTime dateCreated;
|
||||
[ImsApiKey(Key = "MSL_DRY_END_DATE")]
|
||||
public DateTime mslDryEndDate;
|
||||
[ImsApiKey(Key = "MSL_OPEN_DATE")]
|
||||
public DateTime mslOpenDate;
|
||||
[ImsApiKey(Key = "MATERIAL_BIN_DATE_CODE")]
|
||||
public string materialBinDateCode;
|
||||
[ImsApiKey(Key = "MATERIAL_BIN_PART_NUMBER")]
|
||||
public string materialBinPartNumber;
|
||||
[ImsApiKey(Key = "MATERIAL_BIN_STATE")]
|
||||
public string materialBinState;
|
||||
[ImsApiKey(Key = "SUPPLIER_CHARGE_NUMBER")]
|
||||
public string supplierChargeNumber;
|
||||
[ImsApiKey(Key = "PART_COST")]
|
||||
public string partCost;
|
||||
[ImsApiKey(Key = "PART_COST_BASE")]
|
||||
public string partCostBase;
|
||||
[ImsApiKey(Key = "STORAGE_DESC")]
|
||||
public string storageDesc;
|
||||
[ImsApiKey(Key = "STORAGE_NUMBER")]
|
||||
public string storageNumber;
|
||||
[ImsApiKey(Key = "RECEIVING_NUMBER")]
|
||||
public string receivingNumber;
|
||||
[ImsApiKey(Key = "SUPPLIER_NAME")]
|
||||
public string supplierName;
|
||||
[ImsApiKey(Key = "SUPPLIER_NUMBER")]
|
||||
public string supplierNumber;
|
||||
[ImsApiKey(Key = "CLASSIFICATION")]
|
||||
public string classification;
|
||||
[ImsApiKey(Key = "MSL_STATE")]
|
||||
public string mslState;
|
||||
[ImsApiKey(Key = "MSL_LEVEL")]
|
||||
public string mslLevel;
|
||||
[ImsApiKey(Key = "HU_NUMBER")]
|
||||
public string huNumber;
|
||||
|
||||
public int CompareTo(MaterialBinBooking obj)
|
||||
{
|
||||
if (materialBinNumber == null) return -1;
|
||||
if (obj == null) return 1;
|
||||
return materialBinNumber.CompareTo(obj.materialBinNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user