diff --git a/.githooks/commit-msg b/.githooks/commit-msg new file mode 100644 index 00000000..cc47bcff --- /dev/null +++ b/.githooks/commit-msg @@ -0,0 +1,43 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +USER_EMAIL=$(git log -1 --format=format:%ae HEAD) +USER_NAME=$(git log -1 --format=format:%an HEAD) +COMMIT_MESSAGE=$(cat $1) + +if [[ $COMMIT_MESSAGE == "#"* ]]; +then + ACTIVITY_ID=$(echo $COMMIT_MESSAGE | awk '{print $1;}') + ACTIVITY_ID=$(echo $ACTIVITY_ID | tr -d : | tr -d "#") + + echo "Riconosciuta attivita: " $ACTIVITY_ID + curl -X POST "http://192.168.2.215:8080/ems-api/activity/createFromCommit?profileDb=INTEGRY&committerEmail=$USER_EMAIL" \ + -d "commitMessage=$COMMIT_MESSAGE" + +fi + + +#echo "TESTO: " $COMMIT_MESSAGE + + +#test "" = "$(grep '^Signed-off-by: ' "$1" | +# sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { +# echo >&2 Duplicate Signed-off-by lines. +# exit 1 +#} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/REST/watcher/ServerStatusChecker.java b/app/src/main/java/it/integry/integrywmsnative/core/REST/watcher/ServerStatusChecker.java index b974b8c6..29a812be 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/REST/watcher/ServerStatusChecker.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/REST/watcher/ServerStatusChecker.java @@ -40,7 +40,6 @@ public class ServerStatusChecker { public void addCallback(RunnableArgs callback){ this.mCallback.add(callback); - } public void removeCallback(RunnableArgs callback){ diff --git a/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityBarcode.java b/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityBarcode.java index 471b81fb..d451690a 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityBarcode.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityBarcode.java @@ -54,11 +54,7 @@ public class UtilityBarcode { if(!UtilityString.isNullOrEmpty(barcode)) { barcode = barcode.trim(); - if(barcode.length() <= 7){ - return Integer.parseInt(barcode.substring(3)); - } else - return null; - + return Integer.parseInt(barcode.substring(3)); } else return null; } diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/main/MainFragment.java b/app/src/main/java/it/integry/integrywmsnative/gest/main/MainFragment.java index 2353a371..d433b2b8 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/main/MainFragment.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/main/MainFragment.java @@ -145,7 +145,13 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab cyclicRecover(sessionsIterator, onComplete, onFailed); }, ex -> { - onFailed.run(ex); + + if(ex.getMessage().contains("Dati collo non corretti")) { + ColliDataRecover.closeSession(recoveredMtbColtID); + } else { + onFailed.run(ex); + } + cyclicRecover(sessionsIterator, onComplete, onFailed); }); } else { diff --git a/pointmobilescannerlibrary/src/main/java/it/integry/pointmobilescannerlibrary/PointMobileBarcodeReader.java b/pointmobilescannerlibrary/src/main/java/it/integry/pointmobilescannerlibrary/PointMobileBarcodeReader.java index 0e21237a..89525723 100644 --- a/pointmobilescannerlibrary/src/main/java/it/integry/pointmobilescannerlibrary/PointMobileBarcodeReader.java +++ b/pointmobilescannerlibrary/src/main/java/it/integry/pointmobilescannerlibrary/PointMobileBarcodeReader.java @@ -27,9 +27,6 @@ public class PointMobileBarcodeReader implements BarcodeReaderInterface { private static String TAG = PointMobileBarcodeReader.class.getName(); - - private int mBackupResultType = ScanConst.ResultType.DCD_RESULT_COPYPASTE; - public PointMobileBarcodeReader(Context context) { this.mContext = context; @@ -51,8 +48,7 @@ public class PointMobileBarcodeReader implements BarcodeReaderInterface { public void init() throws BarcodeAdapterNotFoundException { if(isRightAdapter()){ try{ - - mBackupResultType = mScanManager.aDecodeGetResultType(); + mScanManager.aDecodeSetTerminator(ScanConst.Terminator.DCD_TERMINATOR_NONE); mScanManager.aDecodeSetResultType(ScanConst.ResultType.DCD_RESULT_USERMSG); } catch (Exception ex) { throw new BarcodeAdapterNotFoundException(getAdapterName());