LinkedList<String> result = new LinkedList<String>();
result.clear();
/**********************/
JDBControl ctrl = new JDBControl(getHostID(), getSessionID());
int SeqNumber = 0;
String SSCCPrefix = "";
String SSCCSequence = "1";
String SSCC = "";
int firstSSCC = 0;
int lastSSCC = 0;
if (ctrl.getProperties("SSCC PREFIX") == true) {
SSCCPrefix = ctrl.getKeyValue();
if (ctrl.lockRecord("SSCC SEQUENCE") == true) {
if (ctrl.getProperties("SSCC SEQUENCE") == true) {
//Get Next SSCC Sequence Number //
SSCCSequence = ctrl.getKeyValue();
SeqNumber = Integer.parseInt(SSCCSequence);
firstSSCC = SeqNumber;
//Add number of pallets required to Sequence//
SeqNumber=SeqNumber+requiredQuantity;
lastSSCC = firstSSCC + requiredQuantity-1;
//Write back amended sequence to Control Table//
ctrl.setKeyValue(String.valueOf(SeqNumber));
if (ctrl.update()) {
for (int x=firstSSCC;x<=lastSSCC;x++)
{
SSCCSequence=String.valueOf(x);
SSCCSequence = com.commander4j.util.JUtility.padString(SSCCSequence, false, 18 - SSCCPrefix.length() - 1, "0");
SSCC = SSCCPrefix + SSCCSequence;
SSCC = SSCC + calcCheckdigit(SSCC);
result.add(SSCC);
}
}
}
else {
logger.error(ctrl.getErrorMessage());
setErrorMessage(ctrl.getErrorMessage());
}
}
else {
logger.error(ctrl.getErrorMessage());
setErrorMessage(ctrl.getErrorMessage());
}
}
/**********************/