Implementata lettura barcode in Accettazione
This commit is contained in:
parent
57cc899dfa
commit
218a86cdb1
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@ -9,6 +9,7 @@
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/barcode_base_library" />
|
||||
<option value="$PROJECT_DIR$/pointmobilescannerlibrary" />
|
||||
<option value="$PROJECT_DIR$/waterfall_toolbar" />
|
||||
</set>
|
||||
|
||||
1
.idea/modules.xml
generated
1
.idea/modules.xml
generated
@ -4,6 +4,7 @@
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/IntegryWMSNative.iml" filepath="$PROJECT_DIR$/IntegryWMSNative.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/barcode_base_library/barcode_base_library.iml" filepath="$PROJECT_DIR$/barcode_base_library/barcode_base_library.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/pointmobilescannerlibrary/pointmobilescannerlibrary.iml" filepath="$PROJECT_DIR$/pointmobilescannerlibrary/pointmobilescannerlibrary.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/waterfall_toolbar/waterfall_toolbar.iml" filepath="$PROJECT_DIR$/waterfall_toolbar/waterfall_toolbar.iml" />
|
||||
</modules>
|
||||
|
||||
@ -33,7 +33,6 @@ dependencies {
|
||||
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation 'com.orhanobut:logger:2.2.0'
|
||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||
@ -48,7 +47,6 @@ dependencies {
|
||||
implementation 'org.parceler:parceler-api:1.1.10'
|
||||
annotationProcessor 'org.parceler:parceler:1.1.10'
|
||||
implementation 'com.annimon:stream:1.2.1'
|
||||
|
||||
//MVVM
|
||||
implementation 'android.arch.lifecycle:extensions:1.1.1'
|
||||
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
|
||||
@ -60,11 +58,9 @@ dependencies {
|
||||
implementation 'com.jakewharton:butterknife:8.8.1'
|
||||
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
|
||||
implementation 'br.com.zbra:android-linq:1.1.0'
|
||||
|
||||
//FAB
|
||||
//implementation 'com.getbase:floatingactionbutton:1.10.1'
|
||||
implementation 'com.github.clans:fab:1.6.4'
|
||||
|
||||
//CUSTOM VIEWS
|
||||
implementation 'de.hdodenhof:circleimageview:2.2.0'
|
||||
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
|
||||
@ -74,8 +70,9 @@ dependencies {
|
||||
implementation 'com.fxn769:stash:1.2'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
implementation project(':waterfall_toolbar')
|
||||
|
||||
implementation 'com.mikhaellopez:lazydatepicker:1.0.0'
|
||||
implementation project(':pointmobilescannerlibrary')
|
||||
implementation project(path: ':barcode_base_library')
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
|
||||
|
||||
<application
|
||||
android:name=".MainApplication"
|
||||
android:allowBackup="true"
|
||||
|
||||
@ -11,6 +11,7 @@ import android.support.v7.app.ActionBarDrawerToggle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.SearchView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.text.SpannableString;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
@ -22,6 +23,7 @@ import butterknife.ButterKnife;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISingleValueOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.watcher.ServerStatusChecker;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilitySettings;
|
||||
import it.integry.integrywmsnative.core.wifi.WiFiCheckerViewHolder;
|
||||
@ -32,6 +34,7 @@ import it.integry.integrywmsnative.gest.main.MainFragment;
|
||||
import it.integry.integrywmsnative.gest.settings.MainSettingsFragment;
|
||||
import it.integry.integrywmsnative.gest.settings.SettingsPreferenceFragment;
|
||||
import it.integry.integrywmsnative.gest.vendita.MainVenditaFragment;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||
|
||||
public class MainActivity extends AppCompatActivity
|
||||
implements NavigationView.OnNavigationItemSelectedListener {
|
||||
@ -195,6 +198,14 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
|
||||
private void init(){
|
||||
|
||||
if(BarcodeManager.getCurrentBarcodeInterface() != null) {
|
||||
// DialogSimpleMessageHelper.makeInfoDialog(this,
|
||||
// "Lettore barcode",
|
||||
// new SpannableString("Trovato adattatore " + BarcodeManager.getCurrentBarcodeInterface().getAdapterName() + " installato nel sistema"),
|
||||
// null, null).show();
|
||||
}
|
||||
|
||||
ServerStatusChecker.getIstance().addCallback(value -> {
|
||||
if(value && (!mIsOnline || firstCheckExecution)){
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ import com.orhanobut.logger.AndroidLogAdapter;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.watcher.ServerStatusChecker;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.settings.Stash;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
@ -30,6 +31,7 @@ public class MainApplication extends Application {
|
||||
|
||||
SettingsManager.init(this);
|
||||
ServerStatusChecker.init();
|
||||
BarcodeManager.init(this);
|
||||
|
||||
// UtilityExceptions.init(this);
|
||||
UtilityResources.init(this);
|
||||
@ -39,6 +41,8 @@ public class MainApplication extends Application {
|
||||
res = getResources();
|
||||
Context = this;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Called by the system when the device configuration changes while your component is running.
|
||||
|
||||
@ -16,6 +16,8 @@ public class CommonConst {
|
||||
|
||||
public static class Config {
|
||||
public static String COMMESSA_MAG = "MAG";
|
||||
|
||||
public static String DEFAULT_ANONYMOUS_UL_SERIE = "UL";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package it.integry.integrywmsnative.core.REST.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public static void getByBarcodeProd(String barcodeProd, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
articoloRESTConsumerService.getByBarcodeProd(barcodeProd).enqueue(new Callback<ServiceRESTResponse<MtbAart>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "getByBarcodeProd", (m) -> {
|
||||
onComplete.run(response.body().getEntityList());
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package it.integry.integrywmsnative.core.REST.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface ArticoloRESTConsumerService {
|
||||
|
||||
|
||||
@POST("SM2getArticoloByBarcode")
|
||||
Call<ServiceRESTResponse<MtbAart>> getByBarcodeProd(@Query("barcode") String barcodeProd);
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package it.integry.integrywmsnative.core.REST.consumers;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.REST.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class BarcodeRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public static void decodeEan128(BarcodeScanDTO barcodeObj, RunnableArgs<Ean128Model> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String ean128 = barcodeObj.getStringValue().replaceAll("" + ((char) 29), "|");
|
||||
|
||||
BarcodeRESTConsumerService barcodeRESTConsumerService = RESTBuilder.getService(BarcodeRESTConsumerService.class);
|
||||
barcodeRESTConsumerService.decodeEan128(ean128).enqueue(new Callback<ServiceRESTResponse<Ean128Model>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Ean128Model>> call, Response<ServiceRESTResponse<Ean128Model>> response) {
|
||||
analyzeAnswer(response, "DecodeEan128", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Ean128Model>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package it.integry.integrywmsnative.core.REST.consumers;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.model.DistribuzioneColloDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface BarcodeRESTConsumerService {
|
||||
|
||||
@GET("decodeEan128")
|
||||
Call<ServiceRESTResponse<Ean128Model>> decodeEan128(@Query("ean128") String ean128);
|
||||
|
||||
}
|
||||
@ -40,7 +40,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void distribuisciCollo(MtbColt mtbColtToDistribute, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
DistribuzioneColloDTO distribuzioneColloDTO = new DistribuzioneColloDTO()
|
||||
@ -55,7 +54,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
||||
.enqueue(new Callback<ServiceRESTResponse<JsonObject>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||
analyzeAnswer(response, "GetAvailablePrinters", obj -> onComplete.run(), onFailed);
|
||||
analyzeAnswer(response, "DistribuzioneCollo", obj -> onComplete.run(), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -66,6 +65,24 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
||||
|
||||
}
|
||||
|
||||
public static void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||
analyzeAnswer(response, "GetBySSCC", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static void deleteRiga(MtbColr mtbColrToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed){
|
||||
MtbColr newMtbColr = new MtbColr();
|
||||
|
||||
|
||||
@ -4,9 +4,12 @@ import com.google.gson.JsonObject;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.model.DistribuzioneColloDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface ColliMagazzinoRESTConsumerService {
|
||||
|
||||
@ -14,4 +17,7 @@ public interface ColliMagazzinoRESTConsumerService {
|
||||
@POST("SM2DistribuzioneRigheCollo")
|
||||
Call<ServiceRESTResponse<JsonObject>> distribuisciCollo(@Body DistribuzioneColloDTO distribuzioneCollo);
|
||||
|
||||
@POST("getColloByBarcode")
|
||||
Call<ServiceRESTResponse<MtbColt>> getColloByBarcode(@Query("codBarreCollo") String sscc, @Query("onlyResiduo") boolean onlyResiduo, @Query("throwExcIfNull") boolean throwExcIfNull);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,342 @@
|
||||
package it.integry.integrywmsnative.core.REST.model;
|
||||
|
||||
|
||||
public class Ean128Model {
|
||||
|
||||
///<summary>Numero sequenziale del collo </summary>
|
||||
public String Sscc;
|
||||
|
||||
///<summary>Codice EAN/UCC unità logistica </summary>
|
||||
public String Gtin;
|
||||
|
||||
///<summary>Codice EAN/UCC dei prodotti contenuti all'interno di unità log</summary>
|
||||
public String Content;
|
||||
|
||||
///<summary>Numero del lotto di fabbricazione</summary>
|
||||
public String BatchLot;
|
||||
|
||||
///<summary>Data di produzione (yymmdd) 0~50 (2000~2050) - 51~99 (1951~1999)</summary>
|
||||
public String ProdString;
|
||||
|
||||
///<summary>Data di scadenza pagamento fattura</summary>
|
||||
public String DueString;
|
||||
|
||||
///<summary>Data di confezionamento</summary>
|
||||
public String PackString;
|
||||
|
||||
///<summary>Data minima di validità</summary>
|
||||
public String BestBefore;
|
||||
|
||||
///<summary>Data massima di validità</summary>
|
||||
public String Expiry;
|
||||
|
||||
///<summary>Variante di prodotto - uso interno aziendale</summary>
|
||||
public String Variant;
|
||||
|
||||
///<summary>Numero di serie</summary>
|
||||
public String Serial;
|
||||
|
||||
///<summary>Dati supplementari per prodotti farmaceutici</summary>
|
||||
public String QtyStringBatch;
|
||||
|
||||
///<summary>Numedi di identificazione supplementare del prodotto</summary>
|
||||
public String AdditionalID;
|
||||
|
||||
///<summary>Codice prodotto interno del cliente</summary>
|
||||
public String CustPartNumber;
|
||||
|
||||
///<summary>Numero di serie secondario</summary>
|
||||
public String SecondarySerial;
|
||||
|
||||
///<summary>Entità di origine o marca auricolare</summary>
|
||||
public String RefToSource;
|
||||
|
||||
///<summary>Quantità variabile</summary>
|
||||
public String VarCount;
|
||||
|
||||
///<summary>Peso netto in Kg</summary>
|
||||
public Float NetWeightKg;
|
||||
|
||||
///<summary>Lunghezza o 1° dimensione, in mt, uso commerciale</summary>
|
||||
public Float LengthM;
|
||||
|
||||
///<summary>Larghezza, diametro o 2° dimensione, in mt, uso commerciale</summary>
|
||||
public Float WidthM;
|
||||
|
||||
///<summary>Profondità, spessore, altezza o 3° dimensione, in mt, uso commerciale</summary>
|
||||
public Float HeightM;
|
||||
|
||||
///<summary>Superficie, in metriquadri, uso commerciale</summary>
|
||||
public Float AreaM2;
|
||||
|
||||
///<summary>Volume, in litri, uso commerciale</summary>
|
||||
public Float NetVolumeL;
|
||||
|
||||
///<summary>Volume, in metricubi, uso commerciale</summary>
|
||||
public Float NetVolumeM3;
|
||||
|
||||
///<summary>Peso netto, in libbre, uso commerciale</summary>
|
||||
public Float NetWeightLb;
|
||||
|
||||
///<summary>Lunghezza o 1° dimensione, in pollici, uso commerciale</summary>
|
||||
public Float LengthI;
|
||||
|
||||
///<summary>Lunghezza o 1° dimensione, in piedi, uso commerciale</summary>
|
||||
public Float LengthF;
|
||||
|
||||
///<summary>Lunghezza o 1° dimensione, in yards, uso commerciale</summary>
|
||||
public Float LengthY;
|
||||
|
||||
///<summary>Larghezza, diametro o 2° dimensione, in pollici, uso commerciale</summary>
|
||||
public Float WidthI;
|
||||
|
||||
///<summary>Larghezza, diametro o 2° dimensione, in piedi, uso commerciale</summary>
|
||||
public Float WidthF;
|
||||
|
||||
///<summary>Larghezza, diametro o 2° dimensione, in yards, uso commerciale</summary>
|
||||
public Float WidthY;
|
||||
|
||||
///<summary>Profondità, spessore, altezza o 3° dimensione, in pollici, uso commerciale</summary>
|
||||
public Float HeightI;
|
||||
|
||||
///<summary>Profondità, spessore, altezza o 3° dimensione, in piedi, uso commerciale</summary>
|
||||
public Float HeightF;
|
||||
|
||||
///<summary>Profondità, spessore, altezza o 3° dimensione, in yards, uso commerciale</summary>
|
||||
public Float HeightY;
|
||||
|
||||
///<summary>Peso lordo, in Kg, uso logistico</summary>
|
||||
public Float CrossweightKgLog;
|
||||
|
||||
///<summary>Peso lordo, in libbre, uso logistico</summary>
|
||||
public Float CrossweightLbLog;
|
||||
|
||||
///<summary>Lunghezza o 1° dimensione, in metri, uso logistico</summary>
|
||||
public Float LengthMLog;
|
||||
|
||||
///<summary>Larghezza, diametro o 2° dimensione, in metri, uso logistico</summary>
|
||||
public Float WidthMLog;
|
||||
|
||||
///<summary>Profondità, spessore, altezza o 3° dimensione, in metri, uso logistico</summary>
|
||||
public Float HeigthMLog;
|
||||
|
||||
///<summary>Superficie, in metriquadri, uso logistico</summary>
|
||||
public Float AreaM2Log;
|
||||
|
||||
///<summary>Volume lordo, in litri, uso logistico</summary>
|
||||
public Float VolumeLLog;
|
||||
|
||||
///<summary>Volume lordo, in metricubi, uso logistico</summary>
|
||||
public Float VolumeM3Log;
|
||||
|
||||
///<summary>Lunghezza o 1° dimensione, in pollici, uso logistico</summary>
|
||||
public Float LengthILog;
|
||||
|
||||
///<summary>Lunghezza o 1° dimensione, in piedi, uso logistico</summary>
|
||||
public Float LengthFLog;
|
||||
|
||||
///<summary>Lunghezza o 1° dimensione, in yards, uso logistico</summary>
|
||||
public Float LengthYLog;
|
||||
|
||||
///<summary>Larghezza, diametro o 2° dimensione, in pollici, uso logistico</summary>
|
||||
public Float WidthILog;
|
||||
|
||||
///<summary>Larghezza, diametro o 2° dimensione, in piedi, uso logistico</summary>
|
||||
public Float WidthFLog;
|
||||
|
||||
///<summary>Larghezza, diametro o 2° dimensione, in yards, uso logistico</summary>
|
||||
public Float WidthYLog;
|
||||
|
||||
///<summary>Profondità, spessore, altezza o 3° dimensione, in pollici, uso logistico</summary>
|
||||
public Float HeigthILog;
|
||||
|
||||
///<summary>Profondità, spessore, altezza o 3° dimensione, in piedi, uso logistico</summary>
|
||||
public Float HeigthFLog;
|
||||
|
||||
///<summary>Profondità, spessore, altezza o 3° dimensione, in yards, uso logistico</summary>
|
||||
public Float HeigthYLog;
|
||||
|
||||
///<summary>Superficie, in pollici quadrati, uso commerciale</summary>
|
||||
public Float AreaI2;
|
||||
|
||||
///<summary>Superficie, in piedi quadrati, uso commerciale</summary>
|
||||
public Float AreaF2;
|
||||
|
||||
///<summary>Superficie, in yards quadrati, uso commerciale</summary>
|
||||
public Float AreaY2;
|
||||
|
||||
///<summary>Superficie, in pollici quadrati, uso logistico</summary>
|
||||
public Float AreaI2Log;
|
||||
|
||||
///<summary>Superficie, in piedi quadrati, uso logistico</summary>
|
||||
public Float AreaF2Log;
|
||||
|
||||
///<summary>Superficie, in yards quadrati, uso logistico</summary>
|
||||
public Float AreaY2Log;
|
||||
|
||||
///<summary>Peso netto, in once troy, uso commerciale</summary>
|
||||
public Float NetWeightT;
|
||||
|
||||
///<summary>Peso netto, in once (U.S.), uso commerciale</summary>
|
||||
public Float NetVolumeOz;
|
||||
|
||||
///<summary>Peso netto, in quarti di gallone, uso commerciale</summary>
|
||||
public Float NetVolumeLb;
|
||||
|
||||
///<summary>Peso netto, in galloni (U.S.), uso commerciale</summary>
|
||||
public Float NetVolumeG;
|
||||
|
||||
///<summary>Volume lordo, in quarti di gallone, uso logistico</summary>
|
||||
public Float VolumeQLog;
|
||||
|
||||
///<summary>Volume lordo, in galloni (U.S.), uso logistico</summary>
|
||||
public Float VolumeGLog;
|
||||
|
||||
///<summary>Volume netto, in pollici cubi, uso commerciale</summary>
|
||||
public Float NetVolumeI3;
|
||||
|
||||
///<summary>Volume netto, in piedi cubi, uso commerciale</summary>
|
||||
public Float NetVolumeF3;
|
||||
|
||||
///<summary>Volume netto, in yards cubi, uso commerciale</summary>
|
||||
public Float NetVolumeY3;
|
||||
|
||||
///<summary>Volume lordo, in pollici cubi, uso logistico</summary>
|
||||
public Float VolumeI3Log;
|
||||
|
||||
///<summary>Volume lordo, in piedi cubi, uso logistico</summary>
|
||||
public Float VolumeF3Log;
|
||||
|
||||
///<summary>Volume lordo, in yards cubi, uso logistico</summary>
|
||||
public Float VolumeY3Log;
|
||||
|
||||
///<summary>Quantità prodotti contenuti in un'unità logistica</summary>
|
||||
public Integer Count;
|
||||
|
||||
///<summary>Importo da pagare singola area monetaria</summary>
|
||||
public Float Amount;
|
||||
|
||||
///<summary>Importo da pagare singola unità monetaria (prodotti a peso variabile)</summary>
|
||||
public Float Price;
|
||||
|
||||
///<summary>Numero d'ordine d'acquisto cliente</summary>
|
||||
public String OrderNumber;
|
||||
|
||||
///<summary>Numero di consegna</summary>
|
||||
public String Consignment;
|
||||
|
||||
///<summary>Numero di spedizione</summary>
|
||||
public String ShipmentNo;
|
||||
|
||||
///<summary>Codice di smistamento pacchi</summary>
|
||||
public String Route;
|
||||
|
||||
///<summary>Codice di locazione EAN/UCC "Spedire a, Consegnare a"</summary>
|
||||
public String ShipToLoc;
|
||||
|
||||
///<summary>Codice di locazione EAN/UCC "Fatturare a"</summary>
|
||||
public String BillToLoc;
|
||||
|
||||
///<summary>Codice di locazione EAN/UCC "Acquistato da"</summary>
|
||||
public String PurchaseFromLoc;
|
||||
|
||||
///<summary>Codice di locazione EAN/UCC "Sperdire per, Consegnare per, Inoltrare a"</summary>
|
||||
public String ShipForLoc;
|
||||
|
||||
///<summary>Codice di locazione EAN/UCC: identificazione di una locazione fisica</summary>
|
||||
public String LocationNumber;
|
||||
|
||||
///<summary>Codice di locazione EAN/UCC di chi emette la fattura</summary>
|
||||
public String PayToLoc;
|
||||
|
||||
///<summary>Codice postale "Spedire a, Consegnare a" (nazionale)</summary>
|
||||
public String ShipToPost;
|
||||
|
||||
///<summary>Paese di origine del prodotto</summary>
|
||||
public String Origin;
|
||||
|
||||
///<summary>Paese di lavorazione con codice nazionale ISO</summary>
|
||||
public String CountryProcess;
|
||||
|
||||
///<summary>Paese di scomposizione con codice nazionale ISO</summary>
|
||||
public String CountryDisassembly;
|
||||
|
||||
///<summary>Paese di lavorazione completa con codice nazionale ISO</summary>
|
||||
public String CountryFullProcess;
|
||||
|
||||
///<summary>Numero di stock NATO</summary>
|
||||
public String NSN;
|
||||
|
||||
///<summary>Carcasse animali e classificazione dei tagli UN/ECE</summary>
|
||||
public String MeatCut;
|
||||
|
||||
///<summary>Prodotti in rotoli - larghezza, lunghezza, diametro interno, senso di svolgimento e giunte</summary>
|
||||
public String Dimensions;
|
||||
|
||||
///<summary>Numero sequenziale elettronico per applicazioni di telefonia cellulare</summary>
|
||||
public String CmtNo;
|
||||
|
||||
///<summary>Numero di identificazione per beni a rendere,</summary>
|
||||
public String Grai;
|
||||
|
||||
///<summary>Numero di identificazione globale per beni individuali</summary>
|
||||
public String Giai;
|
||||
|
||||
///<summary>Prezzo per unità di misura</summary>
|
||||
public String PricePerUnit;
|
||||
|
||||
///<summary>Identificazione dei componenti di un prodotto</summary>
|
||||
public String Gctin;
|
||||
|
||||
///<summary>Numero di contocorrente bancario internazionale</summary>
|
||||
public String Iban;
|
||||
|
||||
///<summary>Data e ora di produzione</summary>
|
||||
public String ProdTime;
|
||||
|
||||
///<summary>Numedo Globale di Relazione di Servizio</summary>
|
||||
public String Gsrn;
|
||||
|
||||
///<summary>Numero del bollettino di pagamento</summary>
|
||||
public String RefNo;
|
||||
|
||||
///<summary>Codice esteso per i coupons, UCC</summary>
|
||||
public String Coupon1;
|
||||
|
||||
///<summary>Codice esteso per i coupons, UCC</summary>
|
||||
public String Coupon2;
|
||||
|
||||
///<summary>Codice esteso per i coupons, UCC</summary>
|
||||
public String Coupon3;
|
||||
|
||||
///<summary>Informazioni concordate tra i partners commerciali</summary>
|
||||
public String InternalPart;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal1;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal2;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal3;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal4;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal5;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal6;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal7;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal8;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal9;
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package it.integry.integrywmsnative.core.REST.model;
|
||||
|
||||
public class Ean13PesoModel {
|
||||
|
||||
private String precode;
|
||||
private Float peso;
|
||||
|
||||
public String getPrecode() {
|
||||
return precode;
|
||||
}
|
||||
|
||||
public Ean13PesoModel setPrecode(String precode) {
|
||||
this.precode = precode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Float getPeso() {
|
||||
return peso;
|
||||
}
|
||||
|
||||
public Ean13PesoModel setPeso(Float peso) {
|
||||
this.peso = peso;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Ean128Model toEan128() {
|
||||
Ean128Model ean128Model = new Ean128Model();
|
||||
ean128Model.NetWeightKg = getPeso();
|
||||
|
||||
return ean128Model;
|
||||
}
|
||||
|
||||
public static Ean13PesoModel fromBarcode(String barcode) throws Exception {
|
||||
if(barcode == null || barcode.length() != 13) {
|
||||
throw new Exception("Errore durante il parse del barcode (" + barcode + ")");
|
||||
}
|
||||
|
||||
String precode = barcode.substring(1, 7);
|
||||
String pesoString = barcode.substring(7, barcode.length() - 1);
|
||||
|
||||
Float pesoFloat = Integer.parseInt(pesoString) / (float) 1000;
|
||||
|
||||
return new Ean13PesoModel()
|
||||
.setPrecode(precode)
|
||||
.setPeso(pesoFloat);
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package it.integry.integrywmsnative.core.barcode_reader;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||
|
||||
public class BarcodeCallbackDTO {
|
||||
|
||||
private int ID = -1;
|
||||
|
||||
private RunnableArgs<BarcodeScanDTO> onScanSuccessfull;
|
||||
private RunnableArgs<Exception> onScanFailed;
|
||||
|
||||
public int getID() {
|
||||
return ID;
|
||||
}
|
||||
|
||||
public BarcodeCallbackDTO setID(int ID) {
|
||||
this.ID = ID;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgs<BarcodeScanDTO> getOnScanSuccessfull() {
|
||||
return onScanSuccessfull;
|
||||
}
|
||||
|
||||
public BarcodeCallbackDTO setOnScanSuccessfull(RunnableArgs<BarcodeScanDTO> onScanSuccessfull) {
|
||||
this.onScanSuccessfull = onScanSuccessfull;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgs<Exception> getOnScanFailed() {
|
||||
return onScanFailed;
|
||||
}
|
||||
|
||||
public BarcodeCallbackDTO setOnScanFailed(RunnableArgs<Exception> onScanFailed) {
|
||||
this.onScanFailed = onScanFailed;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,137 @@
|
||||
package it.integry.integrywmsnative.core.barcode_reader;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.SpannableString;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||
import it.integry.plugins.barcode_base_library.exception.BarcodeAdapterNotFoundException;
|
||||
import it.integry.plugins.barcode_base_library.interfaces.BarcodeReaderInterface;
|
||||
import it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader;
|
||||
|
||||
public class BarcodeManager {
|
||||
|
||||
private static Context context;
|
||||
|
||||
private static BarcodeReaderInterface mCurrentBarcodeInterface;
|
||||
private static List<BarcodeCallbackDTO> mBarcodeCallbacksStacktrace = new ArrayList<>();
|
||||
|
||||
private static boolean mEnabled = true;
|
||||
|
||||
|
||||
private static Class<? extends BarcodeReaderInterface>[] registeredBarcodeReaderInterfaces = new Class[]{
|
||||
PointMobileBarcodeReader.class
|
||||
};
|
||||
|
||||
|
||||
public static void init(Context context) {
|
||||
BarcodeManager.context = context;
|
||||
|
||||
initBarcodeReader();
|
||||
}
|
||||
|
||||
private static void initBarcodeReader() {
|
||||
|
||||
for (Class<? extends BarcodeReaderInterface> readerInterface : registeredBarcodeReaderInterfaces){
|
||||
|
||||
Constructor<?> cons = null;
|
||||
try {
|
||||
cons = Class.forName(readerInterface.getName()).getConstructors()[0];
|
||||
BarcodeReaderInterface object = (BarcodeReaderInterface) cons.newInstance(context);
|
||||
|
||||
if(object.isRightAdapter()) {
|
||||
mCurrentBarcodeInterface = object;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
UtilityLogger.errorMe(e);
|
||||
}
|
||||
}
|
||||
|
||||
if(mCurrentBarcodeInterface != null) {
|
||||
|
||||
try {
|
||||
mCurrentBarcodeInterface.init();
|
||||
} catch (BarcodeAdapterNotFoundException ex) {
|
||||
UtilityExceptions.defaultException(context, ex);
|
||||
}
|
||||
|
||||
mCurrentBarcodeInterface.register(data -> {
|
||||
BarcodeCallbackDTO callback = getValidCallback();
|
||||
if(callback != null && mEnabled) {
|
||||
callback.getOnScanSuccessfull().run(data);
|
||||
}
|
||||
}, ex -> {
|
||||
BarcodeCallbackDTO callback = getValidCallback();
|
||||
if(callback != null && mEnabled) {
|
||||
callback.getOnScanFailed().run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static BarcodeCallbackDTO getValidCallback() {
|
||||
|
||||
if(mBarcodeCallbacksStacktrace.size() > 0) {
|
||||
return mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() -1);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static BarcodeReaderInterface getCurrentBarcodeInterface() {
|
||||
return mCurrentBarcodeInterface;
|
||||
}
|
||||
|
||||
public static int addCallback(BarcodeCallbackDTO barcodeCallbackDTO) {
|
||||
|
||||
int newID = -1;
|
||||
|
||||
if(mBarcodeCallbacksStacktrace.size() > 0) {
|
||||
newID = mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() -1).getID() + 1;
|
||||
} else {
|
||||
newID = 1;
|
||||
}
|
||||
|
||||
barcodeCallbackDTO.setID(newID);
|
||||
mBarcodeCallbacksStacktrace.add(barcodeCallbackDTO);
|
||||
|
||||
return newID;
|
||||
}
|
||||
|
||||
public static void removeCallback(int ID) {
|
||||
boolean callbackObjFound = false;
|
||||
|
||||
//Rimuovo la callback con l'ID trovato e tutte quelle con >ID in modo che rimuovo tutte le call aggiunte successivamente
|
||||
|
||||
for (int i = 0; i < mBarcodeCallbacksStacktrace.size(); i++) {
|
||||
if(mBarcodeCallbacksStacktrace.get(i).getID() == ID || callbackObjFound) {
|
||||
mBarcodeCallbacksStacktrace.remove(i);
|
||||
|
||||
callbackObjFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void disable() {
|
||||
mEnabled = false;
|
||||
}
|
||||
|
||||
public static void enable() {
|
||||
mEnabled = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -56,6 +56,8 @@ public class MtbColt extends EntityBase implements Parcelable {
|
||||
private BigDecimal larghezzaCm;
|
||||
private BigDecimal altezzaCm;
|
||||
|
||||
private Boolean disablePrint;
|
||||
|
||||
protected MtbColt(Parcel in) {
|
||||
type = "mtb_colt";
|
||||
gestione = in.readString();
|
||||
@ -632,7 +634,14 @@ public class MtbColt extends EntityBase implements Parcelable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getDisablePrint() {
|
||||
return disablePrint;
|
||||
}
|
||||
|
||||
public MtbColt setDisablePrint(Boolean disablePrint) {
|
||||
this.disablePrint = disablePrint;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
||||
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||
import it.integry.plugins.barcode_base_library.model.BarcodeType;
|
||||
|
||||
public class UtilityBarcode {
|
||||
|
||||
public static boolean isEtichettaAnonima(BarcodeScanDTO barcodeScanDTO){
|
||||
return barcodeScanDTO != null && barcodeScanDTO.getType() == BarcodeType.CODE128 && barcodeScanDTO.getStringValue().startsWith("U");
|
||||
}
|
||||
|
||||
public static boolean isEanPeso(BarcodeScanDTO barcodeScanDTO) {
|
||||
return barcodeScanDTO != null && barcodeScanDTO.getType() == BarcodeType.EAN13 && barcodeScanDTO.getStringValue().startsWith("2");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static Integer getNumColloFromULAnonima(BarcodeScanDTO barcodeScanDTO) {
|
||||
if(barcodeScanDTO != null && barcodeScanDTO.getType() == BarcodeType.CODE128){
|
||||
return Integer.parseInt(barcodeScanDTO.getStringValue().substring(3));
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static String convertITF14toEAN13(String barcodeITF14) {
|
||||
String barcodeEAN13 = null;
|
||||
|
||||
if(barcodeITF14.length() == 14) {
|
||||
barcodeEAN13 = barcodeEAN13.substring(1, barcodeEAN13.length() - 1);
|
||||
barcodeEAN13 += calculateCheckDigitEan13(barcodeEAN13);
|
||||
}
|
||||
|
||||
return barcodeEAN13;
|
||||
}
|
||||
|
||||
|
||||
public static int calculateCheckDigitEan13(String barcodeEan13) {
|
||||
String[] barcodeCharArray = barcodeEan13.split("");
|
||||
|
||||
int somma = 0;
|
||||
|
||||
for(int i = 0; i < barcodeCharArray.length; i++){
|
||||
if(i % 2 == 1){
|
||||
somma += Integer.parseInt(barcodeCharArray[i]) * 3;
|
||||
} else {
|
||||
somma += Integer.parseInt(barcodeCharArray[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 10 - (somma % 10);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
|
||||
public class UtilityProgress {
|
||||
|
||||
public static ProgressDialog createDefaultProgressDialog(Context mContext) {
|
||||
final ProgressDialog progress = ProgressDialog.show(mContext, mContext.getText(R.string.waiting),
|
||||
mContext.getText(R.string.loading) + " ...", true);
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
||||
}
|
||||
@ -44,6 +44,7 @@ public class OrdineAccettazioneDTO implements Parcelable {
|
||||
public MtbAart mtbAart;
|
||||
public PickingObjectDTO[] colliAssociati;
|
||||
public Boolean hidden = null;
|
||||
public Boolean tempHidden = null;
|
||||
public String partitaMag;
|
||||
public String codArtFor;
|
||||
public String descrizioneEstesa;
|
||||
@ -100,6 +101,10 @@ public class OrdineAccettazioneDTO implements Parcelable {
|
||||
return hidden;
|
||||
}
|
||||
|
||||
public Boolean isTempHidden() {
|
||||
return tempHidden;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
@ -187,6 +192,11 @@ public class OrdineAccettazioneDTO implements Parcelable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Riga setTempHidden(boolean hidden) {
|
||||
this.tempHidden = hidden;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Riga setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
return this;
|
||||
|
||||
@ -11,7 +11,10 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.databinding.ActivityAccettazioneOrdineInevasoBinding;
|
||||
import it.integry.integrywmsnative.databinding.FragmentArticoliInColloBottomSheetBinding;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||
@ -27,6 +30,8 @@ public class AccettazioneOrdineInevasoActivity extends AppCompatActivity {
|
||||
|
||||
private static final int PICK_UL_REQUEST = 1; // The request code
|
||||
|
||||
private int barcodeScannerIstanceID = -1;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@ -44,6 +49,10 @@ public class AccettazioneOrdineInevasoActivity extends AppCompatActivity {
|
||||
setTitle(orders);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessfull(mAccettazioneOrdineInevasoViewModel.onScanSuccessfull)
|
||||
.setOnScanFailed(ex -> UtilityExceptions.defaultException(this, ex)));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -58,7 +67,10 @@ public class AccettazioneOrdineInevasoActivity extends AppCompatActivity {
|
||||
mArticoliInColloBottomSheetViewModel.collapse();
|
||||
} else if(mAccettazioneOrdineInevasoViewModel.thereIsAnOpenedUL()) {
|
||||
mArticoliInColloBottomSheetViewModel.closeCurrentUL();
|
||||
} else super.onBackPressed();
|
||||
} else {
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -74,15 +74,14 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
if(mDataset.get(i).codJcom.equalsIgnoreCase(CommonConst.Config.COMMESSA_MAG)) mDataset.get(i).descrizioneCommessa = null;
|
||||
}
|
||||
|
||||
boolean anyNull = codArtForns.contains(null);
|
||||
|
||||
codArtForns = Stream.of(codArtForns)
|
||||
.withoutNulls()
|
||||
.sortBy(x -> x).toList();
|
||||
|
||||
// Collections.sort(codArtForns, (str1, str2) -> {
|
||||
// if(str1 != null && str2 != null) {
|
||||
// return str1.compareToIgnoreCase(str2);
|
||||
// }
|
||||
// return 0;
|
||||
// });
|
||||
if(anyNull) codArtForns.add(null);
|
||||
|
||||
|
||||
List<List<OrdineAccettazioneDTO.Riga>> groupedRighe = new ArrayList<>();
|
||||
for (String codArtForn : codArtForns) {
|
||||
@ -96,6 +95,9 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
//tmpList.remove(i);
|
||||
//i--;
|
||||
} else tmpList.get(i).setHidden(false);
|
||||
|
||||
|
||||
tmpList.get(i).setTempHidden(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,6 +135,9 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
//tmpList.remove(i);
|
||||
//i--;
|
||||
} else tmpList.get(i).setHidden(false);
|
||||
|
||||
|
||||
tmpList.get(i).setTempHidden(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,15 +201,13 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
//tmpList.remove(i);
|
||||
//i--;
|
||||
} else tmpList.get(i).setHidden(false);
|
||||
|
||||
tmpList.get(i).setTempHidden(false);
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(tmpList, (obj1, obj2) -> obj1.mtbAart.descrizioneEstesa.compareToIgnoreCase(obj2.mtbAart.descrizioneEstesa));
|
||||
|
||||
for(int i = 0; i < tmpList.size(); i++) {
|
||||
Logger.d(tmpList.get(i));
|
||||
}
|
||||
|
||||
if(tmpList.size() > 0){
|
||||
groupedRighe.add(tmpList);
|
||||
}
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.core;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||
|
||||
public interface IOnOrdineAccettazioneRowDispatchCallback {
|
||||
|
||||
void onOrdineRowDispatch(OrdineAccettazioneDTO.Riga item);
|
||||
void onOrdineRowDispatch(OrdineAccettazioneDTO.Riga item, Ean128Model ean128Model);
|
||||
|
||||
}
|
||||
|
||||
@ -144,7 +144,10 @@ public class MainListOrdineAccettazioneAdapter extends RecyclerView.Adapter<Main
|
||||
|
||||
final AccettazioneOrdineInevasoListViewModel.SubItem rowItem = subset.get(i);
|
||||
|
||||
if(!rowItem.getOriginalModel().isHidden()) {
|
||||
if(!rowItem.getOriginalModel().isHidden() &&
|
||||
(rowItem.getOriginalModel().isTempHidden() == null ||
|
||||
(rowItem.getOriginalModel().isTempHidden() != null && !rowItem.getOriginalModel().isTempHidden()))) {
|
||||
|
||||
visibleElementsCounter++;
|
||||
|
||||
View groupModelViewPool = (View) sPool.acquire();
|
||||
@ -199,7 +202,7 @@ public class MainListOrdineAccettazioneAdapter extends RecyclerView.Adapter<Main
|
||||
|
||||
groupModelView.setOnClickListener(view -> {
|
||||
if (mOrdineRowDispatch != null) {
|
||||
mOrdineRowDispatch.onOrdineRowDispatch(rowItem.getOriginalModel());
|
||||
mOrdineRowDispatch.onOrdineRowDispatch(rowItem.getOriginalModel(), null);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -18,7 +18,9 @@ public class AccettazioneOrdineInevasoListViewModel {
|
||||
|
||||
public boolean isHidden(){
|
||||
if(rows == null || rows.size() == 0) return true;
|
||||
return Stream.of(rows).filter(x -> x.originalModel.isHidden() != null && !x.originalModel.isHidden()).count() == 0;
|
||||
return Stream.of(rows).filter(
|
||||
x -> (x.originalModel.isHidden() != null && !x.originalModel.isHidden()) &&
|
||||
(x.originalModel.isTempHidden() != null && !x.originalModel.isTempHidden())).count() == 0;
|
||||
}
|
||||
|
||||
public static class SubItem {
|
||||
|
||||
@ -16,17 +16,29 @@ import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.GestSetupRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.REST.model.Ean13PesoModel;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.AccettazioneOrdineInevasoActivity;
|
||||
@ -42,6 +54,8 @@ import it.integry.integrywmsnative.view.bottomsheet.viewmodel.ArticoliInColloBot
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.QuantityDTO;
|
||||
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||
import it.integry.plugins.barcode_base_library.model.BarcodeType;
|
||||
|
||||
import static br.com.zbra.androidlinq.Linq.stream;
|
||||
|
||||
@ -49,7 +63,7 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
|
||||
public ObservableField<Boolean> isFabVisible = new ObservableField<>();
|
||||
|
||||
private final AccettazioneOrdineInevasoActivity mActivity;
|
||||
private AccettazioneOrdineInevasoActivity mActivity;
|
||||
private final ArticoliInColloBottomSheetViewModel mArticoliInColloBottomSheetViewModel;
|
||||
private final List<OrdineAccettazioneDTO> mOrders;
|
||||
|
||||
@ -135,6 +149,26 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
}
|
||||
}
|
||||
|
||||
public void applyFilter(String descriptionText) {
|
||||
|
||||
mActivity.bindings.filteredArtsInListExpandableLayout.expand(true);
|
||||
|
||||
mActivity.bindings.descriptionFilterText.setText(descriptionText);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void removeListFilter() {
|
||||
for(int i = 0; i < groupedOrdini.size(); i++) {
|
||||
groupedOrdini.get(i).setTempHidden(false);
|
||||
}
|
||||
|
||||
refreshOrderBy(false);
|
||||
mActivity.bindings.filteredArtsInListExpandableLayout.collapse(true);
|
||||
}
|
||||
|
||||
public void recoverUL(MtbColt recoveredMtbColt){
|
||||
|
||||
for(int i = 0; i < recoveredMtbColt.getMtbColr().size(); i++){
|
||||
@ -162,31 +196,190 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||
|
||||
ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
progressDialog.show();
|
||||
|
||||
BarcodeManager.disable();
|
||||
|
||||
if(UtilityBarcode.isEtichettaAnonima(data) && !thereIsAnOpenedUL()){
|
||||
this.executeEtichettaAnonima(data, progressDialog);
|
||||
} else if(data.getType() == BarcodeType.EAN128) {
|
||||
this.executeEtichettaEan128(data, progressDialog);
|
||||
} else if(UtilityBarcode.isEanPeso(data)){
|
||||
this.executeEtichettaEanPeso(data, progressDialog);
|
||||
} else {
|
||||
this.loadArticolo(data.getStringValue(), null, progressDialog);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
private void executeEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, ProgressDialog progressDialog) {
|
||||
ColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), false, false, mtbColt -> {
|
||||
|
||||
if(mtbColt == null) {
|
||||
this.createNewUL(UtilityBarcode.getNumColloFromULAnonima(barcodeScanDTO), CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE, progressDialog, true, null);
|
||||
BarcodeManager.enable();
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
BarcodeManager.enable();
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mActivity,
|
||||
new SpannableString(mActivity.getResources().getText(R.string.already_used_anonymous_barcode)),
|
||||
null, null).show();
|
||||
}
|
||||
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mActivity, ex, progressDialog);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, ProgressDialog progressDialog) {
|
||||
BarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
||||
|
||||
String barcodeProd = null;
|
||||
|
||||
if(ean128Model.Sscc != null) barcodeProd = ean128Model.Sscc;
|
||||
if(ean128Model.Gtin != null) barcodeProd = ean128Model.Gtin;
|
||||
if(ean128Model.Content != null) barcodeProd = ean128Model.Content;
|
||||
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||
if (barcodeProd.startsWith("0") || barcodeProd.startsWith("9")) {
|
||||
barcodeProd = barcodeProd.substring(1, barcodeProd.length());
|
||||
}
|
||||
this.loadArticolo(barcodeProd, ean128Model, progressDialog);
|
||||
} else {
|
||||
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
||||
progressDialog.dismiss();
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
}, ex-> {
|
||||
UtilityExceptions.defaultException(mActivity, ex, progressDialog);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
}
|
||||
|
||||
private void executeEtichettaEanPeso(BarcodeScanDTO barcodeScanDTO, ProgressDialog progressDialog) {
|
||||
|
||||
try {
|
||||
Ean13PesoModel ean13PesoModel = Ean13PesoModel.fromBarcode(barcodeScanDTO.getStringValue());
|
||||
|
||||
this.loadArticolo(ean13PesoModel.getPrecode(), ean13PesoModel.toEan128(), progressDialog);
|
||||
} catch (Exception ex) {
|
||||
UtilityExceptions.defaultException(mActivity, ex, progressDialog);
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void loadArticolo(String barcodeProd, Ean128Model ean128Model, ProgressDialog progressDialog) {
|
||||
if(barcodeProd.length() == 14) {
|
||||
barcodeProd = UtilityBarcode.convertITF14toEAN13(barcodeProd);
|
||||
}
|
||||
|
||||
ArticoloRESTConsumer.getByBarcodeProd(barcodeProd, mtbAartList -> {
|
||||
|
||||
if(mtbAartList != null && mtbAartList.size() > 0) {
|
||||
|
||||
if(!thereIsAnOpenedUL()){
|
||||
|
||||
this.createNewUL(null, null, progressDialog, false, () -> {
|
||||
BarcodeManager.enable();
|
||||
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
||||
});
|
||||
|
||||
} else {
|
||||
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
||||
|
||||
BarcodeManager.enable();
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
|
||||
} else {
|
||||
BarcodeManager.enable();
|
||||
progressDialog.dismiss();
|
||||
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mActivity,
|
||||
new SpannableString(mActivity.getResources().getText(R.string.no_result_from_barcode)),
|
||||
null, null, null)
|
||||
.show();
|
||||
}
|
||||
|
||||
|
||||
}, ex -> {
|
||||
BarcodeManager.enable();
|
||||
UtilityExceptions.defaultException(mActivity, ex, progressDialog);
|
||||
});
|
||||
}
|
||||
|
||||
private void searchArtInList(MtbAart mtbAart, Ean128Model ean128Model) {
|
||||
removeListFilter();
|
||||
|
||||
List<OrdineAccettazioneDTO.Riga> foundRowsList = Stream.of(groupedOrdini)
|
||||
.filter(x -> x.getMtbAart().getCodMart().equalsIgnoreCase(mtbAart.codMart) &&
|
||||
(x.isHidden() != null && !x.isHidden()) && (x.isTempHidden() != null && !x.isTempHidden()))
|
||||
.toList();
|
||||
|
||||
if(foundRowsList.size() == 0) {
|
||||
showNoArtFoundDialog();
|
||||
} else if(foundRowsList.size() == 1) {
|
||||
onOrdineRowDispatch(foundRowsList.get(0), ean128Model);
|
||||
} else {
|
||||
for(int i = 0; i < groupedOrdini.size(); i++) {
|
||||
if(!foundRowsList.contains(groupedOrdini.get(i))) {
|
||||
groupedOrdini.get(i).setTempHidden(true);
|
||||
}
|
||||
}
|
||||
|
||||
applyFilter("COD: " + mtbAart.getCodMart());
|
||||
refreshOrderBy(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void showNoArtFoundDialog() {
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mActivity,
|
||||
new SpannableString(mActivity.getResources().getText(R.string.no_result_from_barcode)),
|
||||
null, null).show();
|
||||
}
|
||||
|
||||
public void showOrderDialog() {
|
||||
|
||||
AlertDialog dialog = new AlertDialog.Builder(mActivity)
|
||||
.setTitle(mActivity.getText(R.string.action_orderBy))
|
||||
.setSingleChoiceItems(AccettazioneOrdineInevasoOrderBy.descriptions, currentOrderBy.getVal(), (dialog12, which) -> currentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.fromInt(which))
|
||||
.setPositiveButton("Ok", (dialog1, which) -> refreshOrderBy(true))
|
||||
.setPositiveButton("Ok", (dialog1, which) -> refreshOrderBy(false))
|
||||
.create();
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
|
||||
public void createNewUL() {
|
||||
this.createNewUL(null, null, null, false, null);
|
||||
}
|
||||
|
||||
public void createNewUL(Integer customNumCollo, String customSerCollo, ProgressDialog progress, boolean disablePrint, Runnable onComplete) {
|
||||
|
||||
mActivity.bindings.accettazioneOrdineInevasoFab.close(true);
|
||||
|
||||
final ProgressDialog progress = ProgressDialog.show(mActivity, mActivity.getText(R.string.waiting),
|
||||
mActivity.getText(R.string.loading) + " ...", true);
|
||||
if (progress == null){
|
||||
progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
}
|
||||
|
||||
ProgressDialog finalProgress = progress;
|
||||
NoteAggiuntiveNuovaULDialog.show(mActivity, new NoteAggiuntiveNuovaULDialog.Callback() {
|
||||
@Override
|
||||
public void onSuccess(String noteString) {
|
||||
|
||||
//Add loading dialog here
|
||||
progress.show();
|
||||
|
||||
finalProgress.show();
|
||||
|
||||
GestSetupRESTConsumer.getValue("PICKING", "SETUP", "DEFAULT_POSIZIONE_COLLI_ACCETTAZIONE", defaultPosAccettazioneDTO -> {
|
||||
|
||||
@ -201,8 +394,17 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
.setOraInizPrep(new Date())
|
||||
.setAnnotazioni(noteString)
|
||||
.setPosizione(defaultPosAccettazione)
|
||||
.setSerCollo("/")
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
if(customNumCollo != null) {
|
||||
mtbColt.setNumCollo(customNumCollo);
|
||||
}
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(customSerCollo)) {
|
||||
mtbColt.setSerCollo(customSerCollo);
|
||||
}
|
||||
|
||||
List<String> codAnags =
|
||||
stream(mOrders)
|
||||
.select(c -> c.codAnag)
|
||||
@ -246,11 +448,15 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
@Override
|
||||
public void onSuccess(MtbColt value) {
|
||||
|
||||
value.setMtbColr(new ObservableArrayList<>());
|
||||
value
|
||||
.setDisablePrint(disablePrint)
|
||||
.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
|
||||
|
||||
setULToCurrentContext(value);
|
||||
|
||||
progress.dismiss();
|
||||
finalProgress.dismiss();
|
||||
|
||||
new StatusBarAlert.Builder(mActivity)
|
||||
.autoHide(true)
|
||||
@ -260,14 +466,16 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
.withAlertColor(R.color.mainGreen)
|
||||
.build();
|
||||
|
||||
if(onComplete != null) onComplete.run();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||
UtilityExceptions.defaultException(mActivity, ex, finalProgress);
|
||||
}
|
||||
});
|
||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
|
||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, finalProgress));
|
||||
|
||||
|
||||
|
||||
@ -275,7 +483,7 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
|
||||
@Override
|
||||
public void onAbort() {
|
||||
progress.dismiss();
|
||||
finalProgress.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
@ -315,9 +523,7 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
public void onColloClosed() {
|
||||
if(thereIsAnOpenedUL()) {
|
||||
|
||||
final ProgressDialog progress = ProgressDialog.show(mActivity, mActivity.getText(R.string.waiting),
|
||||
mActivity.getText(R.string.loading) + " ...", true);
|
||||
|
||||
final ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
progress.show();
|
||||
|
||||
if(thereIsAnyRowInUL()) {
|
||||
@ -352,6 +558,13 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
}
|
||||
|
||||
private void printCollo(ProgressDialog progress) {
|
||||
MtbColt currentMtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||
|
||||
if(currentMtbColt.getDisablePrint() != null && currentMtbColt.getDisablePrint()){
|
||||
postCloseOperations();
|
||||
progress.dismiss();
|
||||
return;
|
||||
}
|
||||
|
||||
PrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().userSession.depo.getCodMdep(), new ISimpleOperationCallback<List<String>>() {
|
||||
@Override
|
||||
@ -359,7 +572,7 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
|
||||
if(value.size() > 0) {
|
||||
try{
|
||||
MtbColt currentMtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||
|
||||
|
||||
ReportManager.getRightReportNameByMtbColt(currentMtbColt, reportName -> {
|
||||
|
||||
@ -463,7 +676,7 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOrdineRowDispatch(final OrdineAccettazioneDTO.Riga item) {
|
||||
public void onOrdineRowDispatch(final OrdineAccettazioneDTO.Riga item, Ean128Model ean128Model) {
|
||||
if(mArticoliInColloBottomSheetViewModel.mtbColt.get() != null){
|
||||
|
||||
List<MtbColr> currentMtbColrs = mArticoliInColloBottomSheetViewModel.mtbColt.get().getMtbColr();
|
||||
@ -492,6 +705,44 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
.setQtaEvasa(new BigDecimal(qtaEvasa))
|
||||
.setCanPartitaMagBeChanged(true);
|
||||
|
||||
if(ean128Model != null){
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
||||
dto.setBatchLot(ean128Model.BatchLot);
|
||||
}
|
||||
|
||||
try {
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.BestBefore)){
|
||||
dto.setDataScad(UtilityDate.recognizeDate(ean128Model.BestBefore));
|
||||
} else if(!UtilityString.isNullOrEmpty(ean128Model.Expiry)) {
|
||||
dto.setDataScad(UtilityDate.recognizeDate(ean128Model.Expiry));
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
UtilityLogger.errorMe(e);
|
||||
}
|
||||
|
||||
|
||||
if(ean128Model.Count != null && ean128Model.Count > 0) {
|
||||
//if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
||||
dto.setNumCnf(ean128Model.Count);
|
||||
//} else {
|
||||
// dto.setQtaTot(new BigDecimal(ean128Model.Count));
|
||||
//}
|
||||
}
|
||||
|
||||
if (ean128Model.NetWeightKg != null && ean128Model.NetWeightKg > 0) {
|
||||
dto.setQtaTot(new BigDecimal(ean128Model.NetWeightKg));
|
||||
}
|
||||
|
||||
if(dto.getQtaTot() != null && dto.getQtaTot().floatValue() > 0 && dto.getNumCnf() != null && dto.getNumCnf() > 0) {
|
||||
dto.setQtaCnf(dto.getQtaTot().divide(new BigDecimal(dto.getNumCnf())));
|
||||
}
|
||||
|
||||
dto.setCanPartitaMagBeChanged(false);
|
||||
dto.setCanDataScadBeChanged(false);
|
||||
dto.setShouldAskDataScad(true);
|
||||
}
|
||||
|
||||
DialogInputQuantity.makeBase(mActivity, dto, true, value -> onOrdineRowDispatched(item, value)).show();
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,6 +21,7 @@ import android.widget.EditText;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
@ -34,16 +35,20 @@ import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||
public class DialogInputQuantity {
|
||||
|
||||
public static class DTO {
|
||||
public MtbAart mtbAart;
|
||||
public String batchLot;
|
||||
public BigDecimal qtaDaEvadere;
|
||||
public BigDecimal qtaOrd;
|
||||
public BigDecimal qtaTot;
|
||||
public BigDecimal qtaCnf;
|
||||
public BigDecimal qtaEvasa;
|
||||
public BigDecimal maxQta;
|
||||
public String codArtFor;
|
||||
public boolean canPartitaMagBeChanged;
|
||||
private MtbAart mtbAart;
|
||||
private String batchLot;
|
||||
private BigDecimal qtaDaEvadere;
|
||||
private BigDecimal qtaEvasa;
|
||||
private BigDecimal qtaOrd;
|
||||
private BigDecimal qtaTot;
|
||||
private BigDecimal qtaCnf;
|
||||
private Integer numCnf;
|
||||
private BigDecimal maxQta;
|
||||
private String codArtFor;
|
||||
private Date dataScad;
|
||||
private boolean canPartitaMagBeChanged;
|
||||
private Boolean canDataScadBeChanged;
|
||||
private Boolean shouldAskDataScad;
|
||||
|
||||
public MtbAart getMtbAart() {
|
||||
return mtbAart;
|
||||
@ -99,6 +104,15 @@ public class DialogInputQuantity {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumCnf() {
|
||||
return numCnf;
|
||||
}
|
||||
|
||||
public DTO setNumCnf(Integer numCnf) {
|
||||
this.numCnf = numCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaEvasa() {
|
||||
return qtaEvasa;
|
||||
}
|
||||
@ -126,6 +140,15 @@ public class DialogInputQuantity {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public DTO setDataScad(Date dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getCanPartitaMagBeChanged() {
|
||||
return canPartitaMagBeChanged;
|
||||
}
|
||||
@ -134,6 +157,24 @@ public class DialogInputQuantity {
|
||||
this.canPartitaMagBeChanged = canPartitaMagBeChanged;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean isCanDataScadBeChanged() {
|
||||
return canDataScadBeChanged;
|
||||
}
|
||||
|
||||
public DTO setCanDataScadBeChanged(boolean canDataScadBeChanged) {
|
||||
this.canDataScadBeChanged = canDataScadBeChanged;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getShouldAskDataScad() {
|
||||
return shouldAskDataScad;
|
||||
}
|
||||
|
||||
public DTO setShouldAskDataScad(Boolean shouldAskDataScad) {
|
||||
this.shouldAskDataScad = shouldAskDataScad;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
private static ColorStateList originalColorStateList = null;
|
||||
@ -232,14 +273,30 @@ public class DialogInputQuantity {
|
||||
quantityDTO.qtaTot.set(qtaDaEvadere);
|
||||
}
|
||||
|
||||
if(dto.getNumCnf() != null) {
|
||||
quantityDTO.numCnf.set(new BigDecimal(dto.getNumCnf()).floatValue());
|
||||
}
|
||||
|
||||
if(quantityDTO.numCnf.get(false) == null) {
|
||||
quantityDTO.numCnf.set(quantityDTO.qtaTot.get() / quantityDTO.qtaCnf.get());
|
||||
}
|
||||
|
||||
quantityDTO.canPartitaMagBeChanged.set(dto.getCanPartitaMagBeChanged());
|
||||
|
||||
if(dto.isCanDataScadBeChanged() != null){
|
||||
quantityDTO.canDataScadBeChanged.set(dto.isCanDataScadBeChanged());
|
||||
}
|
||||
|
||||
quantityDTO.shouldAskDataScad.set(dto.mtbAart.isFlagTracciabilita() && dto.mtbAart.getGgScadPartita() != null && dto.mtbAart.getGgScadPartita() > 0);
|
||||
|
||||
if(dto.getShouldAskDataScad() != null) {
|
||||
quantityDTO.shouldAskDataScad.set(dto.getShouldAskDataScad());
|
||||
}
|
||||
|
||||
if(dto.getDataScad() != null) {
|
||||
quantityDTO.expireDate = dto.getDataScad();
|
||||
}
|
||||
|
||||
if(quantityDTO.expireDate == null && dto.mtbAart.getGgScadPartita() != null && dto.mtbAart.getGgScadPartita() > 0) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.add(Calendar.DATE, dto.mtbAart.getGgScadPartita()); // number of days to add
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<layout>
|
||||
<layout xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" />
|
||||
@ -50,17 +50,74 @@
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/accettazione_ordine_main_list"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
android:paddingBottom="72dp"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
android:orientation="vertical"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<net.cachapa.expandablelayout.ExpandableLayout
|
||||
android:id="@+id/filtered_arts_in_list_expandable_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:el_duration="400"
|
||||
app:el_expanded="false">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toLeftOf="@+id/remove_art_filter_list"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/filtered_arts_in_list" />
|
||||
<TextView
|
||||
android:id="@+id/description_filter_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
tools:text="COD_ART_HERE"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.v7.widget.AppCompatButton
|
||||
android:id="@+id/remove_art_filter_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@color/red_600"
|
||||
android:textColor="@android:color/white"
|
||||
android:onClick="@{() -> viewmodel.removeListFilter()}"
|
||||
android:text="@string/remove_filter_button"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</net.cachapa.expandablelayout.ExpandableLayout>
|
||||
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/accettazione_ordine_main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
|
||||
@ -58,7 +58,6 @@
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
android:paddingBottom="72dp"
|
||||
android:clipToPadding="false" />
|
||||
|
||||
|
||||
|
||||
@ -196,6 +196,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="11 nov 2018"
|
||||
android:textSize="16sp"
|
||||
android:enabled="@{quantityViewModel.canDataScadBeChanged}"
|
||||
android:visibility="@{quantityViewModel.shouldAskDataScad.get() == false ? View.GONE : View.VISIBLE}"
|
||||
app:binding="@{quantityViewModel.expireDateString}"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_partita_data"
|
||||
|
||||
@ -121,4 +121,10 @@
|
||||
<string name="no_lu_already_registered_text">Nessuna UL registrata a magazzino</string>
|
||||
<string name="no_item_to_pick_text">Nessun articolo da prelevare</string>
|
||||
|
||||
<string name="already_used_anonymous_barcode"><![CDATA[L\'etichetta scansionata è stata già utilizzata]]></string>
|
||||
<string name="no_result_from_barcode">Il barcode scansionato non ha fornito alcun risultato</string>
|
||||
|
||||
<string name="filtered_arts_in_list">Filtro articoli applicato</string>
|
||||
<string name="remove_filter_button">Rimuovi filtro</string>
|
||||
|
||||
</resources>
|
||||
@ -44,7 +44,10 @@
|
||||
<color name="orange_800">#EF6C00</color>
|
||||
|
||||
|
||||
<color name="red_400">#EF5350</color>
|
||||
<color name="red_500">#F44336</color>
|
||||
<color name="red_600">#E53935</color>
|
||||
<color name="red_700">#D32F2F</color>
|
||||
|
||||
|
||||
<color name="yellow_600">#FDD835</color>
|
||||
|
||||
@ -129,4 +129,10 @@
|
||||
<string name="no_lu_already_registered_text">No LU already registered</string>
|
||||
<string name="no_item_to_pick_text">No items to pick</string>
|
||||
|
||||
<string name="already_used_anonymous_barcode">The scanned label has already been used</string>
|
||||
<string name="no_result_from_barcode">The scanned barcode did not produce any results</string>
|
||||
|
||||
<string name="filtered_arts_in_list">Item filter applied</string>
|
||||
<string name="remove_filter_button">Remove filter</string>
|
||||
|
||||
</resources>
|
||||
|
||||
1
barcode_base_library/.gitignore
vendored
Normal file
1
barcode_base_library/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
||||
8
barcode_base_library/build.gradle
Normal file
8
barcode_base_library/build.gradle
Normal file
@ -0,0 +1,8 @@
|
||||
apply plugin: 'java-library'
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
}
|
||||
|
||||
sourceCompatibility = "7"
|
||||
targetCompatibility = "7"
|
||||
@ -0,0 +1,9 @@
|
||||
package it.integry.plugins.barcode_base_library.exception;
|
||||
|
||||
public class BarcodeAdapterNotFoundException extends Exception {
|
||||
|
||||
public BarcodeAdapterNotFoundException(String adapterName) {
|
||||
super("L'adapter " + adapterName + " non è stato rilevato sul dispositivo corrente");
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package it.integry.plugins.barcode_base_library.extension;
|
||||
|
||||
public interface RunnableArgs<T> {
|
||||
|
||||
void run(T data);
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package it.integry.plugins.barcode_base_library.interfaces;
|
||||
|
||||
import it.integry.plugins.barcode_base_library.extension.RunnableArgs;
|
||||
import it.integry.plugins.barcode_base_library.exception.BarcodeAdapterNotFoundException;
|
||||
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||
|
||||
public interface BarcodeReaderInterface {
|
||||
|
||||
boolean isRightAdapter();
|
||||
|
||||
void init() throws BarcodeAdapterNotFoundException;
|
||||
|
||||
void register(RunnableArgs<BarcodeScanDTO> onScanSuccessfull, RunnableArgs<Exception> onScanFailed);
|
||||
|
||||
String getAdapterName();
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package it.integry.plugins.barcode_base_library.model;
|
||||
|
||||
public class BarcodeScanDTO {
|
||||
|
||||
private BarcodeType type;
|
||||
private String stringValue;
|
||||
private byte[] byteValue;
|
||||
private String name;
|
||||
private int decodingTime;
|
||||
|
||||
public BarcodeType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public BarcodeScanDTO setType(BarcodeType type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getStringValue() {
|
||||
return stringValue;
|
||||
}
|
||||
|
||||
public BarcodeScanDTO setStringValue(String stringValue) {
|
||||
this.stringValue = stringValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
public byte[] getByteValue() {
|
||||
return byteValue;
|
||||
}
|
||||
|
||||
public BarcodeScanDTO setByteValue(byte[] byteValue) {
|
||||
this.byteValue = byteValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public BarcodeScanDTO setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getDecodingTime() {
|
||||
return decodingTime;
|
||||
}
|
||||
|
||||
public BarcodeScanDTO setDecodingTime(int decodingTime) {
|
||||
this.decodingTime = decodingTime;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,91 @@
|
||||
package it.integry.plugins.barcode_base_library.model;
|
||||
|
||||
public enum BarcodeType {
|
||||
|
||||
NIL(0),
|
||||
AIRLINE_2OF5_13_DIGIT(1),
|
||||
AIRLINE_2OF5_15_DIGIT(2),
|
||||
AZTEC(3),
|
||||
AUSTRALIAN_POSTAL(4),
|
||||
BOOKLAND_EAN(5),
|
||||
BPO(6),
|
||||
CANPOST(7),
|
||||
CHINAPOST(8),
|
||||
CHINESE_2OF5(9),
|
||||
CODABAR(10),
|
||||
CODABLOCK(11),
|
||||
CODE11(12),
|
||||
CODE128(13),
|
||||
CODE16K(14),
|
||||
CODE32(15),
|
||||
CODE39(16),
|
||||
CODE49(17),
|
||||
CODE93(18),
|
||||
COMPOSITE(19),
|
||||
COUPON_CODE(20),
|
||||
DATAMATRIX(21),
|
||||
DISCRETE_2OF5(22),
|
||||
DUTCH_POSTAL(23),
|
||||
EAN128(24),
|
||||
EAN13(25),
|
||||
EAN8(26),
|
||||
GS1_DATABAR_14(27),
|
||||
GS1_DATABAR_EXPANDED(28),
|
||||
GS1_DATABAR_LIMITED(29),
|
||||
HONGKONG_2OF5(30),
|
||||
IATA_2OF5(31),
|
||||
IDTAG(32),
|
||||
INTERLEAVED_2OF5(33),
|
||||
ISBT128(34),
|
||||
JAPANESE_POSTAL(35),
|
||||
KOREAN_POSTAL(36),
|
||||
MATRIX_2OF5(37),
|
||||
MAXICODE(38),
|
||||
MESA(39),
|
||||
MICRO_PDF417(40),
|
||||
MICRO_QR(41),
|
||||
MSI(42),
|
||||
NEC_2OF5(43),
|
||||
OCR(44),
|
||||
PDF417(45),
|
||||
PLESSEY(46),
|
||||
POSICODE(47),
|
||||
POST_US4(48),
|
||||
QR(49),
|
||||
STRAIGHT_2OF5(50),
|
||||
STANDARD_2OF5(51),
|
||||
TELEPEN(52),
|
||||
TLCODE39(53),
|
||||
TRIOPTIC(54),
|
||||
UK_POSTAL(55),
|
||||
UPCA(56),
|
||||
UPCE(57),
|
||||
UPCE1(58),
|
||||
US_PLANET(59),
|
||||
US_POSTNET(60),
|
||||
USPS_4CB(61),
|
||||
RSS(62),
|
||||
LABEL(63),
|
||||
HANXIN(64),
|
||||
GRIDMATRIX(65),
|
||||
INFO_MAIL(66),
|
||||
INTELLIGENT_MAIL(67),
|
||||
SWEDENPOST(68),
|
||||
LAST(69);
|
||||
|
||||
private Integer text;
|
||||
BarcodeType(Integer text) {
|
||||
this.text = text;
|
||||
}
|
||||
public Integer getValue() {
|
||||
return this.text;
|
||||
}
|
||||
|
||||
public static BarcodeType fromInt(Integer text) {
|
||||
for (BarcodeType b : BarcodeType.values()) {
|
||||
if (b.text.equals(text)) return b;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -25,10 +25,10 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
implementation project(':barcode_base_library')
|
||||
}
|
||||
|
||||
BIN
pointmobilescannerlibrary/libs/device.sdk.jar
Normal file
BIN
pointmobilescannerlibrary/libs/device.sdk.jar
Normal file
Binary file not shown.
@ -1,2 +1,25 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="it.integry.pointmobilescannerlibrary" />
|
||||
package="it.integry.pointmobilescannerlibrary">
|
||||
|
||||
|
||||
<permission
|
||||
android:name="it.integry.pointmobilescannerlibrary.permission.SCANNER_RESULT_RECEIVER"
|
||||
android:protectionLevel="normal" />
|
||||
|
||||
<uses-permission android:name="it.integry.pointmobilescannerlibrary.permission.SCANNER_RESULT_RECEIVER" />
|
||||
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
|
||||
|
||||
<application>
|
||||
<receiver
|
||||
android:name="it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader$ScanResultReceiver"
|
||||
android:enabled="true"
|
||||
android:permission="it.integry.pointmobilescannerlibrary.permission.SCANNER_RESULT_RECEIVER"
|
||||
android:priority="0" >
|
||||
<intent-filter>
|
||||
<action android:name="device.common.USERMSG" />
|
||||
<action android:name="device.scanner.EVENT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
@ -0,0 +1,100 @@
|
||||
package it.integry.pointmobilescannerlibrary;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import device.common.DecodeResult;
|
||||
import device.common.ScanConst;
|
||||
import device.sdk.ScanManager;
|
||||
import it.integry.plugins.barcode_base_library.exception.BarcodeAdapterNotFoundException;
|
||||
import it.integry.plugins.barcode_base_library.interfaces.BarcodeReaderInterface;
|
||||
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||
import it.integry.plugins.barcode_base_library.extension.RunnableArgs;
|
||||
import it.integry.plugins.barcode_base_library.model.BarcodeType;
|
||||
|
||||
public class PointMobileBarcodeReader implements BarcodeReaderInterface {
|
||||
|
||||
private Context mContext;
|
||||
private static ScanManager mScanManager;
|
||||
private static DecodeResult mDecodeResult;
|
||||
|
||||
private static RunnableArgs<BarcodeScanDTO> mOnScanSuccessfull;
|
||||
private static RunnableArgs<Exception> mOnScanFailed;
|
||||
|
||||
private static String TAG = PointMobileBarcodeReader.class.getName();
|
||||
|
||||
|
||||
private int mBackupResultType = ScanConst.ResultType.DCD_RESULT_COPYPASTE;
|
||||
|
||||
public PointMobileBarcodeReader(Context context) {
|
||||
this.mContext = context;
|
||||
|
||||
mScanManager = new ScanManager();
|
||||
mDecodeResult = new DecodeResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRightAdapter() {
|
||||
return mScanManager != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() throws BarcodeAdapterNotFoundException {
|
||||
if(isRightAdapter()){
|
||||
mBackupResultType = mScanManager.aDecodeGetResultType();
|
||||
mScanManager.aDecodeSetResultType(ScanConst.ResultType.DCD_RESULT_USERMSG);
|
||||
} else {
|
||||
throw new BarcodeAdapterNotFoundException(getAdapterName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(RunnableArgs<BarcodeScanDTO> onScanSuccessfull, RunnableArgs<Exception> onScanFailed) {
|
||||
mOnScanSuccessfull = onScanSuccessfull;
|
||||
mOnScanFailed = onScanFailed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAdapterName() {
|
||||
return "PointMobile";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static class ScanResultReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (mScanManager != null) {
|
||||
if (ScanConst.INTENT_USERMSG.equals(intent.getAction())) {
|
||||
mScanManager.aDecodeGetResult(mDecodeResult.recycle());
|
||||
|
||||
if (mOnScanSuccessfull != null) {
|
||||
|
||||
try {
|
||||
|
||||
BarcodeScanDTO barcodeScanDTO = new BarcodeScanDTO()
|
||||
.setByteValue(mDecodeResult.decodeValue)
|
||||
.setStringValue(mDecodeResult.toString().replaceAll("\n", "").replaceAll("\r", "").trim())
|
||||
.setType(BarcodeType.fromInt(mDecodeResult.symType))
|
||||
.setName(mDecodeResult.symName)
|
||||
.setDecodingTime(mDecodeResult.decodeTimeMillisecond);
|
||||
|
||||
mOnScanSuccessfull.run(barcodeScanDTO);
|
||||
|
||||
} catch (Exception ex) {
|
||||
Log.e(TAG, ex.getMessage());
|
||||
|
||||
if(mOnScanFailed != null) mOnScanFailed.run(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1 +1 @@
|
||||
include ':app', ':pointmobilescannerlibrary', ':waterfall_toolbar'
|
||||
include ':app', ':pointmobilescannerlibrary', ':waterfall_toolbar', ':barcode_base_library'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user