AQL chart implementation
parent
a0b3bcce24
commit
79d7f16c67
|
@ -0,0 +1 @@
|
|||
QualityChecker
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
Binary file not shown.
|
@ -40,7 +40,7 @@
|
|||
android:name=".ui.activities.MainActivity"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
android:windowSoftInputMode="stateHidden|adjustPan">
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.activities.HomeActivity"
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.utopiaindustries.qualitychecker.models.InspectionCheckPoint;
|
|||
import com.utopiaindustries.qualitychecker.models.InspectionCheckpointSku;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionDefect;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionDimension;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionLabelResponse;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionReport;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionReportItem;
|
||||
import com.utopiaindustries.qualitychecker.models.ItemUnit;
|
||||
|
@ -92,4 +93,7 @@ public interface ApiService {
|
|||
|
||||
@GET( "rest/uic/inspection-report/inspection-sku-checkpoints" )
|
||||
Call<List<InspectionCheckpointSku>> fetchSkuCheckpoints( );
|
||||
|
||||
@GET("rest/uic/inspection-report/get-inspection-label")
|
||||
Call<InspectionLabelResponse> fetchAllInspectionLabels();
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ import retrofit2.Retrofit;
|
|||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public class RetrofitClient {
|
||||
private final static String BASE_URL = "https://portal.utopiaindustries.pk/uind/";
|
||||
// private final static String BASE_URL = "http://192.168.90.27:8080/uind/";//"http://192.168.91.16:8080/uind/";
|
||||
//private final static String BASE_URL = "https://portal.utopiaindustries.pk/uind/";
|
||||
private final static String BASE_URL = "http://192.168.91.44:8081/uind/";//"http://192.168.91.44:8081/uind/";//"http://192.168.90.27:8080/uind/";//"http://192.168.91.16:8080/uind/";
|
||||
|
||||
private static Retrofit retrofit;
|
||||
|
||||
|
|
|
@ -27,6 +27,21 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||
public static final String PRODUCT_COLUMN_CATEGORY = "category";
|
||||
public static final String PRODUCT_COLUMN_FNSKU = "fnsku";
|
||||
|
||||
//Table and Column for Inspection Label
|
||||
public static final String INSPECTION_LABEL_TABLE_NAME = "inspection_label";
|
||||
public static final String INSPECTION_LABEL_COLUMN_ID = "id";
|
||||
public static final String INSPECTION_LABEL_COLUMN_MIN_LOT_SIZE = "minLotSize";
|
||||
public static final String INSPECTION_LABEL_COLUMN_MAX_LOT_SIZE = "maxLotSize";
|
||||
public static final String INSPECTION_LABEL_COLUMN_INSPECTION_LEVEL = "inspectionLevel";
|
||||
public static final String INSPECTION_LABEL_COLUMN_SAMPLE_CODE = "sampleCode";
|
||||
|
||||
//Table and Column for Quality Label
|
||||
public static final String QUALITY_LABEL_TABLE_NAME = "quality_label";
|
||||
public static final String QUALITY_LABEL_COLUMN_ID = "id";
|
||||
public static final String QUALITY_LABEL_COLUMN_SAMPLE_CODE = "sampleCode";
|
||||
public static final String QUALITY_LABEL_COLUMN_SAMPLE_SIZE = "sampleSize";
|
||||
public static final String QUALITY_LABEL_COLUMN_QUALITY_LEVEL = "qualityLevel";
|
||||
public static final String QUALITY_LABEL_COLUMN_NO_ACCEPTED_DEFECTS = "noOfAcceptedDefects";
|
||||
|
||||
/*
|
||||
* dimension table
|
||||
|
@ -153,6 +168,22 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||
CHECKPOINT_SKU_STANDARD + " TEXT," +
|
||||
"PRIMARY KEY (" + CHECKPOINT_SKU_SKU + ", " + CHECKPOINT_SKU_MARKETPLACE + ", " + CHECKPOINT_SKU_CHECKPOINT_ID + "))";
|
||||
|
||||
String CREATE_INSPECTION_LABEL_TABLE = "CREATE TABLE " + INSPECTION_LABEL_TABLE_NAME + " (" +
|
||||
INSPECTION_LABEL_COLUMN_ID + " INTEGER NOT NULL," +
|
||||
INSPECTION_LABEL_COLUMN_MIN_LOT_SIZE + " INTEGER NOT NULL," +
|
||||
INSPECTION_LABEL_COLUMN_MAX_LOT_SIZE + " INTEGER NOT NULL," +
|
||||
INSPECTION_LABEL_COLUMN_INSPECTION_LEVEL + " INTEGER NOT NULL," +
|
||||
INSPECTION_LABEL_COLUMN_SAMPLE_CODE + " TEXT NOT NULL )";
|
||||
|
||||
String CREATE_QUALITY_LABEL_TABLE = "CREATE TABLE " + QUALITY_LABEL_TABLE_NAME + " (" +
|
||||
QUALITY_LABEL_COLUMN_ID + " INTEGER NOT NULL," +
|
||||
QUALITY_LABEL_COLUMN_SAMPLE_CODE + " TEXT NOT NULL," +
|
||||
QUALITY_LABEL_COLUMN_SAMPLE_SIZE + " INTEGER NOT NULL," +
|
||||
QUALITY_LABEL_COLUMN_QUALITY_LEVEL + " REAL NOT NULL," +
|
||||
QUALITY_LABEL_COLUMN_NO_ACCEPTED_DEFECTS + " INTEGER NOT NULL )";
|
||||
|
||||
|
||||
|
||||
db.execSQL( CREATE_PRODUCT_TABLE );
|
||||
db.execSQL( CREATE_INSPECTION_DIMENSION_TABLE );
|
||||
db.execSQL( CREATE_CHECKPOINT_TABLE );
|
||||
|
@ -161,6 +192,8 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||
db.execSQL( CREATE_REPORT_TABLE );
|
||||
db.execSQL( CREATE_DRAFT_REPORT_TABLE);
|
||||
db.execSQL( CREATE_SKU_CHECKPOINT_TABLE );
|
||||
db.execSQL( CREATE_INSPECTION_LABEL_TABLE );
|
||||
db.execSQL( CREATE_QUALITY_LABEL_TABLE );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -173,6 +206,8 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||
db.execSQL( "DROP TABLE IF EXISTS " + REPORT_TABLE_NAME );
|
||||
db.execSQL( "DROP TABLE IF EXISTS " + DRAFT_REPORT_TABLE_NAME );
|
||||
db.execSQL( "DROP TABLE IF EXISTS " + CHECKPOINT_SKU_TABLE_NAME );
|
||||
db.execSQL( "DROP TABLE IF EXISTS " + INSPECTION_LABEL_TABLE_NAME );
|
||||
db.execSQL( "DROP TABLE IF EXISTS " + QUALITY_LABEL_TABLE_NAME );
|
||||
onCreate(db);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,128 @@
|
|||
package com.utopiaindustries.qualitychecker.db;
|
||||
|
||||
import static com.utopiaindustries.qualitychecker.db.DatabaseHelper.INSPECTION_LABEL_COLUMN_ID;
|
||||
import static com.utopiaindustries.qualitychecker.db.DatabaseHelper.PRODUCT_COLUMN_ASIN;
|
||||
import static com.utopiaindustries.qualitychecker.db.DatabaseHelper.QUALITY_LABEL_COLUMN_ID;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionLabel;
|
||||
import com.utopiaindustries.qualitychecker.models.Product;
|
||||
import com.utopiaindustries.qualitychecker.models.QualityLabel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class InspectionLabelRepository {
|
||||
private final DatabaseHelper dbHelper;
|
||||
private final SQLiteDatabase database;
|
||||
private final ExecutorService executorService;
|
||||
|
||||
|
||||
public InspectionLabelRepository(Context context) {
|
||||
dbHelper = new DatabaseHelper(context);
|
||||
database = dbHelper.getWritableDatabase();
|
||||
executorService = Executors.newSingleThreadExecutor();
|
||||
}
|
||||
|
||||
/*
|
||||
* Insert list of inspection labels in batch
|
||||
* */
|
||||
public void insertInspectionLabels( List<InspectionLabel> inspectionLabels, List<QualityLabel> qualityLabels) {
|
||||
executorService.execute(() -> {
|
||||
database.beginTransaction();
|
||||
try {
|
||||
//Inspection Label
|
||||
for (InspectionLabel inspectionLabel : inspectionLabels) {
|
||||
ContentValues ivalues = new ContentValues();
|
||||
ivalues.put(INSPECTION_LABEL_COLUMN_ID, inspectionLabel.getId());
|
||||
ivalues.put(DatabaseHelper.INSPECTION_LABEL_COLUMN_MIN_LOT_SIZE, inspectionLabel.getMinLotSize());
|
||||
ivalues.put(DatabaseHelper.INSPECTION_LABEL_COLUMN_MAX_LOT_SIZE, inspectionLabel.getMaxLotSize());
|
||||
ivalues.put(DatabaseHelper.INSPECTION_LABEL_COLUMN_INSPECTION_LEVEL, inspectionLabel.getInspectionLevel());
|
||||
ivalues.put(DatabaseHelper.INSPECTION_LABEL_COLUMN_SAMPLE_CODE, inspectionLabel.getSampleCode());
|
||||
|
||||
database.insertWithOnConflict(DatabaseHelper.INSPECTION_LABEL_TABLE_NAME, null, ivalues, SQLiteDatabase.CONFLICT_REPLACE);
|
||||
}
|
||||
|
||||
//Quality Label
|
||||
for (QualityLabel qualityLabel : qualityLabels) {
|
||||
ContentValues qvalues = new ContentValues();
|
||||
qvalues.put(QUALITY_LABEL_COLUMN_ID, qualityLabel.getId());
|
||||
qvalues.put(DatabaseHelper.QUALITY_LABEL_COLUMN_SAMPLE_CODE, qualityLabel.getSampleCode());
|
||||
qvalues.put(DatabaseHelper.QUALITY_LABEL_COLUMN_SAMPLE_SIZE, qualityLabel.getSampleSize());
|
||||
qvalues.put(DatabaseHelper.QUALITY_LABEL_COLUMN_QUALITY_LEVEL, qualityLabel.getQualityLevel());
|
||||
qvalues.put(DatabaseHelper.QUALITY_LABEL_COLUMN_NO_ACCEPTED_DEFECTS, qualityLabel.getNoOfAcceptedDefects());
|
||||
|
||||
database.insertWithOnConflict(DatabaseHelper.QUALITY_LABEL_TABLE_NAME, null, qvalues, SQLiteDatabase.CONFLICT_REPLACE);
|
||||
}
|
||||
|
||||
database.setTransactionSuccessful();
|
||||
} finally {
|
||||
database.endTransaction();
|
||||
close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get list of inspection labels from database
|
||||
* */
|
||||
public List<InspectionLabel> getInspectionLabels() {
|
||||
List<InspectionLabel> inspectionLabels = new ArrayList<>();
|
||||
Cursor cursor = database.query(DatabaseHelper.INSPECTION_LABEL_TABLE_NAME, new String[]{INSPECTION_LABEL_COLUMN_ID,
|
||||
DatabaseHelper.INSPECTION_LABEL_COLUMN_MIN_LOT_SIZE, DatabaseHelper.INSPECTION_LABEL_COLUMN_MAX_LOT_SIZE,
|
||||
DatabaseHelper.INSPECTION_LABEL_COLUMN_INSPECTION_LEVEL, DatabaseHelper.INSPECTION_LABEL_COLUMN_SAMPLE_CODE},
|
||||
null, null, null, null, null);
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
do {
|
||||
InspectionLabel inspectionLabel = new InspectionLabel();
|
||||
inspectionLabel.setId(cursor.getInt(0));
|
||||
inspectionLabel.setMinLotSize(cursor.getInt(1));
|
||||
inspectionLabel.setMaxLotSize(cursor.getInt(2));
|
||||
inspectionLabel.setInspectionLevel(cursor.getInt(3));
|
||||
inspectionLabel.setSampleCode(cursor.getString(4));
|
||||
inspectionLabels.add(inspectionLabel);
|
||||
} while (cursor.moveToNext());
|
||||
cursor.close();
|
||||
}
|
||||
return inspectionLabels;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get list of quality labels from database
|
||||
* */
|
||||
public List<QualityLabel> getQualityLabels() {
|
||||
List<QualityLabel> qualityLabels = new ArrayList<>();
|
||||
Cursor cursor = database.query(DatabaseHelper.QUALITY_LABEL_TABLE_NAME, new String[]{QUALITY_LABEL_COLUMN_ID,
|
||||
DatabaseHelper.QUALITY_LABEL_COLUMN_SAMPLE_CODE, DatabaseHelper.QUALITY_LABEL_COLUMN_SAMPLE_SIZE,
|
||||
DatabaseHelper.QUALITY_LABEL_COLUMN_QUALITY_LEVEL, DatabaseHelper.QUALITY_LABEL_COLUMN_NO_ACCEPTED_DEFECTS},
|
||||
null, null, null, null, null);
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
do {
|
||||
QualityLabel qualityLabel = new QualityLabel();
|
||||
qualityLabel.setId(cursor.getInt(0));
|
||||
qualityLabel.setSampleCode(cursor.getString(1));
|
||||
qualityLabel.setSampleSize(cursor.getInt(2));
|
||||
qualityLabel.setQualityLevel(cursor.getDouble(3));
|
||||
qualityLabel.setNoOfAcceptedDefects(cursor.getInt(4));
|
||||
qualityLabels.add(qualityLabel);
|
||||
} while (cursor.moveToNext());
|
||||
cursor.close();
|
||||
}
|
||||
return qualityLabels;
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the database
|
||||
*/
|
||||
public void close() {
|
||||
dbHelper.close();
|
||||
executorService.shutdown();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
|
||||
package com.utopiaindustries.qualitychecker.models;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class InspectionLabel {
|
||||
|
||||
@SerializedName("id")
|
||||
@Expose
|
||||
private Integer id;
|
||||
@SerializedName("minLotSize")
|
||||
@Expose
|
||||
private Integer minLotSize;
|
||||
@SerializedName("maxLotSize")
|
||||
@Expose
|
||||
private Integer maxLotSize;
|
||||
@SerializedName("inspectionLevel")
|
||||
@Expose
|
||||
private Integer inspectionLevel;
|
||||
@SerializedName("sampleCode")
|
||||
@Expose
|
||||
private String sampleCode;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getMinLotSize() {
|
||||
return minLotSize;
|
||||
}
|
||||
|
||||
public void setMinLotSize(Integer minLotSize) {
|
||||
this.minLotSize = minLotSize;
|
||||
}
|
||||
|
||||
public Integer getMaxLotSize() {
|
||||
return maxLotSize;
|
||||
}
|
||||
|
||||
public void setMaxLotSize(Integer maxLotSize) {
|
||||
this.maxLotSize = maxLotSize;
|
||||
}
|
||||
|
||||
public Integer getInspectionLevel() {
|
||||
return inspectionLevel;
|
||||
}
|
||||
|
||||
public void setInspectionLevel(Integer inspectionLevel) {
|
||||
this.inspectionLevel = inspectionLevel;
|
||||
}
|
||||
|
||||
public String getSampleCode() {
|
||||
return sampleCode;
|
||||
}
|
||||
|
||||
public void setSampleCode(String sampleCode) {
|
||||
this.sampleCode = sampleCode;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
package com.utopiaindustries.qualitychecker.models;
|
||||
|
||||
import java.util.List;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class InspectionLabelResponse {
|
||||
|
||||
@SerializedName("qualityLabel")
|
||||
@Expose
|
||||
private List<QualityLabel> qualityLabel;
|
||||
@SerializedName("inspectionLabel")
|
||||
@Expose
|
||||
private List<InspectionLabel> inspectionLabel;
|
||||
|
||||
public List<QualityLabel> getQualityLabel() {
|
||||
return qualityLabel;
|
||||
}
|
||||
|
||||
public void setQualityLabel(List<QualityLabel> qualityLabel) {
|
||||
this.qualityLabel = qualityLabel;
|
||||
}
|
||||
|
||||
public List<InspectionLabel> getInspectionLabel() {
|
||||
return inspectionLabel;
|
||||
}
|
||||
|
||||
public void setInspectionLabel(List<InspectionLabel> inspectionLabel) {
|
||||
this.inspectionLabel = inspectionLabel;
|
||||
}
|
||||
|
||||
}
|
|
@ -31,12 +31,27 @@ public class InspectionReportItem implements Serializable {
|
|||
private float packsSelected;
|
||||
private float piecesSelected;
|
||||
|
||||
private float checkedCartonsSelected;
|
||||
private float checkedPacksSelected;
|
||||
private float checkedPiecesSelected;
|
||||
private float cartonWeight;
|
||||
private float cartonLength;
|
||||
private float cartonHeight;
|
||||
private float cartonWidth;
|
||||
private float packWeight;
|
||||
private float packWidth;
|
||||
private float packLength;
|
||||
private float packHeight;
|
||||
private long sampleSize;
|
||||
private long inspectionLevel;
|
||||
private long minorQualityLevel;
|
||||
private long majorQualityLevel;
|
||||
|
||||
private int aqlSampleSize;
|
||||
|
||||
private int checkedCartonsSelected;
|
||||
private int checkedPacksSelected;
|
||||
private int checkedPiecesSelected;
|
||||
|
||||
private String packingDetails;
|
||||
private String sampleSize;
|
||||
//private String sampleSize;
|
||||
private String dateAdded;
|
||||
// wrapper
|
||||
private List<InspectionItemCheckPoint> checkPoints;
|
||||
|
@ -236,11 +251,11 @@ public class InspectionReportItem implements Serializable {
|
|||
this.piecesSelected = piecesSelected;
|
||||
}
|
||||
|
||||
public String getSampleSize() {
|
||||
public long getSampleSize() {
|
||||
return sampleSize;
|
||||
}
|
||||
|
||||
public void setSampleSize(String sampleSize) {
|
||||
public void setSampleSize(long sampleSize) {
|
||||
this.sampleSize = sampleSize;
|
||||
}
|
||||
|
||||
|
@ -260,34 +275,129 @@ public class InspectionReportItem implements Serializable {
|
|||
this.fnsku = fnsku;
|
||||
}
|
||||
|
||||
public float getCheckedCartonsSelected() {
|
||||
public int getCheckedCartonsSelected() {
|
||||
return checkedCartonsSelected;
|
||||
}
|
||||
|
||||
public void setCheckedCartonsSelected(float checkedCartonsSelected) {
|
||||
public void setCheckedCartonsSelected(int checkedCartonsSelected) {
|
||||
this.checkedCartonsSelected = checkedCartonsSelected;
|
||||
}
|
||||
|
||||
public float getCheckedPacksSelected() {
|
||||
public int getCheckedPacksSelected() {
|
||||
return checkedPacksSelected;
|
||||
}
|
||||
|
||||
public void setCheckedPacksSelected(float checkedPacksSelected) {
|
||||
public void setCheckedPacksSelected(int checkedPacksSelected) {
|
||||
this.checkedPacksSelected = checkedPacksSelected;
|
||||
}
|
||||
|
||||
public float getCheckedPiecesSelected() {
|
||||
public int getCheckedPiecesSelected() {
|
||||
return checkedPiecesSelected;
|
||||
}
|
||||
|
||||
public void setCheckedPiecesSelected(float checkedPiecesSelected) {
|
||||
public void setCheckedPiecesSelected(int checkedPiecesSelected) {
|
||||
this.checkedPiecesSelected = checkedPiecesSelected;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public long getMajorQualityLevel() {
|
||||
return majorQualityLevel;
|
||||
}
|
||||
|
||||
public void setMajorQualityLevel(long majorQualityLevel) {
|
||||
this.majorQualityLevel = majorQualityLevel;
|
||||
}
|
||||
|
||||
public long getMinorQualityLevel() {
|
||||
return minorQualityLevel;
|
||||
}
|
||||
|
||||
public void setMinorQualityLevel(long minorQualityLevel) {
|
||||
this.minorQualityLevel = minorQualityLevel;
|
||||
}
|
||||
|
||||
public long getInspectionLevel() {
|
||||
return inspectionLevel;
|
||||
}
|
||||
|
||||
public void setInspectionLevel(long inspectionLevel) {
|
||||
this.inspectionLevel = inspectionLevel;
|
||||
}
|
||||
|
||||
public float getPackHeight() {
|
||||
return packHeight;
|
||||
}
|
||||
|
||||
public void setPackHeight(float packHeight) {
|
||||
this.packHeight = packHeight;
|
||||
}
|
||||
|
||||
public float getPackLength() {
|
||||
return packLength;
|
||||
}
|
||||
|
||||
public void setPackLength(float packLength) {
|
||||
this.packLength = packLength;
|
||||
}
|
||||
|
||||
public float getPackWidth() {
|
||||
return packWidth;
|
||||
}
|
||||
|
||||
public void setPackWidth(float packWidth) {
|
||||
this.packWidth = packWidth;
|
||||
}
|
||||
|
||||
public float getPackWeight() {
|
||||
return packWeight;
|
||||
}
|
||||
|
||||
public void setPackWeight(float packWeight) {
|
||||
this.packWeight = packWeight;
|
||||
}
|
||||
|
||||
public float getCartonWidth() {
|
||||
return cartonWidth;
|
||||
}
|
||||
|
||||
public void setCartonWidth(float cartonWidth) {
|
||||
this.cartonWidth = cartonWidth;
|
||||
}
|
||||
|
||||
public float getCartonHeight() {
|
||||
return cartonHeight;
|
||||
}
|
||||
|
||||
public void setCartonHeight(float cartonHeight) {
|
||||
this.cartonHeight = cartonHeight;
|
||||
}
|
||||
|
||||
public float getCartonLength() {
|
||||
return cartonLength;
|
||||
}
|
||||
|
||||
public void setCartonLength(float cartonLength) {
|
||||
this.cartonLength = cartonLength;
|
||||
}
|
||||
|
||||
public float getCartonWeight() {
|
||||
return cartonWeight;
|
||||
}
|
||||
|
||||
public void setCartonWeight(float cartonWeight) {
|
||||
this.cartonWeight = cartonWeight;
|
||||
}
|
||||
|
||||
public int getAqlSampleSize() {
|
||||
return aqlSampleSize;
|
||||
}
|
||||
|
||||
public void setAqlSampleSize(int aqlSampleSize) {
|
||||
this.aqlSampleSize = aqlSampleSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "InspectionAuditReportItem{" +
|
||||
return "InspectionReportItem{" +
|
||||
"id=" + id +
|
||||
", reportId=" + reportId +
|
||||
", asin='" + asin + '\'' +
|
||||
|
@ -301,8 +411,35 @@ public class InspectionReportItem implements Serializable {
|
|||
", smColor='" + smColor + '\'' +
|
||||
", smSize='" + smSize + '\'' +
|
||||
", smItemName='" + smItemName + '\'' +
|
||||
", orderNumber='" + orderNumber + '\'' +
|
||||
", article='" + article + '\'' +
|
||||
", totalPresentPieces=" + totalPresentPieces +
|
||||
", totalPresentPacks=" + totalPresentPacks +
|
||||
", totalPresentCartons=" + totalPresentCartons +
|
||||
", cartonsSelected=" + cartonsSelected +
|
||||
", packsSelected=" + packsSelected +
|
||||
", piecesSelected=" + piecesSelected +
|
||||
", cartonWeight=" + cartonWeight +
|
||||
", cartonLength=" + cartonLength +
|
||||
", cartonHeight=" + cartonHeight +
|
||||
", cartonWidth=" + cartonWidth +
|
||||
", packWeight=" + packWeight +
|
||||
", packWidth=" + packWidth +
|
||||
", packLength=" + packLength +
|
||||
", packHeight=" + packHeight +
|
||||
", sampleSize=" + sampleSize +
|
||||
", inspectionLevel=" + inspectionLevel +
|
||||
", minorQualityLevel=" + minorQualityLevel +
|
||||
", majorQualityLevel=" + majorQualityLevel +
|
||||
", aqlSampleSize=" + aqlSampleSize +
|
||||
", checkedCartonsSelected=" + checkedCartonsSelected +
|
||||
", checkedPacksSelected=" + checkedPacksSelected +
|
||||
", checkedPiecesSelected=" + checkedPiecesSelected +
|
||||
", packingDetails='" + packingDetails + '\'' +
|
||||
", dateAdded='" + dateAdded + '\'' +
|
||||
", checkPoints=" + checkPoints +
|
||||
", dimensions=" + dimensions +
|
||||
", fnsku='" + fnsku + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
|
||||
package com.utopiaindustries.qualitychecker.models;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class QualityLabel {
|
||||
|
||||
@SerializedName("id")
|
||||
@Expose
|
||||
private Integer id;
|
||||
@SerializedName("sampleCode")
|
||||
@Expose
|
||||
private String sampleCode;
|
||||
@SerializedName("sampleSize")
|
||||
@Expose
|
||||
private Integer sampleSize;
|
||||
@SerializedName("qualityLevel")
|
||||
@Expose
|
||||
private Double qualityLevel;
|
||||
@SerializedName("noOfAcceptedDefects")
|
||||
@Expose
|
||||
private Integer noOfAcceptedDefects;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSampleCode() {
|
||||
return sampleCode;
|
||||
}
|
||||
|
||||
public void setSampleCode(String sampleCode) {
|
||||
this.sampleCode = sampleCode;
|
||||
}
|
||||
|
||||
public Integer getSampleSize() {
|
||||
return sampleSize;
|
||||
}
|
||||
|
||||
public void setSampleSize(Integer sampleSize) {
|
||||
this.sampleSize = sampleSize;
|
||||
}
|
||||
|
||||
public Double getQualityLevel() {
|
||||
return qualityLevel;
|
||||
}
|
||||
|
||||
public void setQualityLevel(Double qualityLevel) {
|
||||
this.qualityLevel = qualityLevel;
|
||||
}
|
||||
|
||||
public Integer getNoOfAcceptedDefects() {
|
||||
return noOfAcceptedDefects;
|
||||
}
|
||||
|
||||
public void setNoOfAcceptedDefects(Integer noOfAcceptedDefects) {
|
||||
this.noOfAcceptedDefects = noOfAcceptedDefects;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.utopiaindustries.qualitychecker.models.callback;
|
||||
|
||||
public interface SaveInspectionLabelCallBack extends SaveCallback {
|
||||
|
||||
}
|
|
@ -12,6 +12,7 @@ import com.utopiaindustries.qualitychecker.db.CheckpointRepository;
|
|||
import com.utopiaindustries.qualitychecker.db.DefectRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.DimensionRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.InspectionCheckpointSkuRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.InspectionLabelRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.ItemRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.ProductRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.ReportRepository;
|
||||
|
@ -21,6 +22,7 @@ import com.utopiaindustries.qualitychecker.models.InspectionDefect;
|
|||
import com.utopiaindustries.qualitychecker.models.InspectionDimension;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionItemCheckPoint;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionItemDefect;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionLabelResponse;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionReport;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionReportWrapper;
|
||||
import com.utopiaindustries.qualitychecker.models.ItemUnit;
|
||||
|
@ -29,6 +31,7 @@ import com.utopiaindustries.qualitychecker.models.callback.SaveCheckpointCallbac
|
|||
import com.utopiaindustries.qualitychecker.models.callback.SaveDefectCallback;
|
||||
import com.utopiaindustries.qualitychecker.models.callback.SaveDimensionCallback;
|
||||
import com.utopiaindustries.qualitychecker.models.callback.SaveDraftReportCallback;
|
||||
import com.utopiaindustries.qualitychecker.models.callback.SaveInspectionLabelCallBack;
|
||||
import com.utopiaindustries.qualitychecker.models.callback.SaveItemCallback;
|
||||
import com.utopiaindustries.qualitychecker.models.callback.SaveProductCallBack;
|
||||
import com.utopiaindustries.qualitychecker.models.callback.SaveReportCallback;
|
||||
|
@ -275,6 +278,13 @@ public class InspectionReportService {
|
|||
}).start();
|
||||
}
|
||||
|
||||
public void fetchAndPopulateInspectionLabel( SaveInspectionLabelCallBack callback,
|
||||
InspectionLabelRepository repository){
|
||||
new Thread(() -> {
|
||||
populateInspectionLabels( callback, repository );
|
||||
}).start();
|
||||
}
|
||||
|
||||
public void fetchAndPopulateDimensions( SaveDimensionCallback callback,
|
||||
DimensionRepository repository ){
|
||||
new Thread(() -> {
|
||||
|
@ -338,6 +348,36 @@ public class InspectionReportService {
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
private void populateInspectionLabels( SaveInspectionLabelCallBack callback,
|
||||
InspectionLabelRepository repository ){
|
||||
apiService.fetchAllInspectionLabels().enqueue(
|
||||
new Callback<InspectionLabelResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<InspectionLabelResponse> call,
|
||||
Response<InspectionLabelResponse> response) {
|
||||
if (response.isSuccessful()) {
|
||||
try {
|
||||
System.out.println( response.body() );
|
||||
callback.onSuccess();
|
||||
assert response.body() != null;
|
||||
repository.insertInspectionLabels( response.body().getInspectionLabel(), response.body().getQualityLabel() );
|
||||
} catch ( Exception ex ){
|
||||
callback.onFailure(new Exception( ex.getMessage() ) );
|
||||
}
|
||||
} else {
|
||||
callback.onFailure(new Exception("API call failed with status code: " + response.code()));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Call<InspectionLabelResponse> call, Throwable t) {
|
||||
System.out.println(t);
|
||||
callback.onFailure(t);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private void populateDimensions( SaveDimensionCallback callback,
|
||||
DimensionRepository repository ){
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ import com.utopiaindustries.qualitychecker.db.CheckpointRepository;
|
|||
import com.utopiaindustries.qualitychecker.db.DefectRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.DimensionRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.InspectionCheckpointSkuRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.InspectionLabelRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.ItemRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.ProductRepository;
|
||||
import com.utopiaindustries.qualitychecker.models.EmployeePhoto;
|
||||
|
@ -41,6 +42,7 @@ import com.utopiaindustries.qualitychecker.models.InspectionReport;
|
|||
import com.utopiaindustries.qualitychecker.models.callback.SaveCheckpointCallback;
|
||||
import com.utopiaindustries.qualitychecker.models.callback.SaveDefectCallback;
|
||||
import com.utopiaindustries.qualitychecker.models.callback.SaveDimensionCallback;
|
||||
import com.utopiaindustries.qualitychecker.models.callback.SaveInspectionLabelCallBack;
|
||||
import com.utopiaindustries.qualitychecker.models.callback.SaveItemCallback;
|
||||
import com.utopiaindustries.qualitychecker.models.callback.SaveProductCallBack;
|
||||
import com.utopiaindustries.qualitychecker.notification.NotificationHelper;
|
||||
|
@ -195,6 +197,7 @@ public class HomeActivity extends AppCompatActivity implements View.OnClickListe
|
|||
fetchAndPopulateDefectsData();
|
||||
fetchAndPopulateUnitsData();
|
||||
fetchAndPopulateSkuCheckpointsData();
|
||||
fetchAndPopulateInspectionLevelData();
|
||||
} else {
|
||||
Toast.makeText( this, "network not available", Toast.LENGTH_LONG ).show();
|
||||
}
|
||||
|
@ -267,6 +270,36 @@ public class HomeActivity extends AppCompatActivity implements View.OnClickListe
|
|||
}, new ProductRepository( this ) );
|
||||
}
|
||||
|
||||
/*
|
||||
* fetch and update inspection label
|
||||
* */
|
||||
private void fetchAndPopulateInspectionLevelData() {
|
||||
|
||||
NotificationHelper.showProductNotification(
|
||||
this,
|
||||
"Utopia QA App",
|
||||
"Fetching Inspection Label.");
|
||||
inspectionReportService.fetchAndPopulateInspectionLabel( new SaveInspectionLabelCallBack() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Toast.makeText( HomeActivity.this, "Inspection Labels successfully synced", Toast.LENGTH_LONG ).show();
|
||||
NotificationHelper.showProductNotification(
|
||||
HomeActivity.this,
|
||||
"Utopia QA App",
|
||||
"Inspection Labels successfully synced");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable throwable) {
|
||||
Toast.makeText( HomeActivity.this, "Error in Inspection Labels syncing " + throwable.getMessage(), Toast.LENGTH_LONG ).show();
|
||||
NotificationHelper.showProductNotification(
|
||||
HomeActivity.this,
|
||||
"Utopia QA App",
|
||||
"Error in Inspection Labels syncing" );
|
||||
}
|
||||
}, new InspectionLabelRepository( this ) );
|
||||
}
|
||||
|
||||
private void fetchAndPopulateDimensionsData(){
|
||||
|
||||
NotificationHelper.showProductNotification( this,
|
||||
|
|
|
@ -69,6 +69,8 @@ public class ReportAdapter extends
|
|||
// Format the date in 12-hour format
|
||||
String formattedDateTime = displayDateFormat.format( date );
|
||||
dateTv.setText( formattedDateTime );
|
||||
|
||||
if (report.getReportResult() != null && !report.getReportResult().isEmpty()) {
|
||||
if( report.getReportResult().equalsIgnoreCase("FAILED") ){
|
||||
status.setBackgroundResource( R.drawable.failed_bg );
|
||||
}
|
||||
|
@ -80,5 +82,7 @@ public class ReportAdapter extends
|
|||
}
|
||||
status.setText( report.getReportResult() );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.os.Handler;
|
|||
import android.os.Looper;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -37,14 +38,17 @@ import com.utopiaindustries.qualitychecker.apiservice.ApiService;
|
|||
import com.utopiaindustries.qualitychecker.apiservice.ApiServiceFactory;
|
||||
import com.utopiaindustries.qualitychecker.db.DimensionRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.InspectionCheckpointSkuRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.InspectionLabelRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.ProductRepository;
|
||||
import com.utopiaindustries.qualitychecker.db.ReportRepository;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionCheckpointSku;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionDimension;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionLabel;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionReport;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionReportItem;
|
||||
import com.utopiaindustries.qualitychecker.models.InspectionReportWrapper;
|
||||
import com.utopiaindustries.qualitychecker.models.Product;
|
||||
import com.utopiaindustries.qualitychecker.models.QualityLabel;
|
||||
import com.utopiaindustries.qualitychecker.models.callback.SaveDraftReportCallback;
|
||||
import com.utopiaindustries.qualitychecker.notification.NotificationHelper;
|
||||
import com.utopiaindustries.qualitychecker.service.InspectionReportService;
|
||||
|
@ -71,7 +75,7 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
private NavController navController;
|
||||
private Button leftFab, rightFab, showHistoryBtn, btnDraft;
|
||||
private EditText sku, boxCarton, itemPerBox, pieces, packagingDetails, boxCartonSelected, itemPerBoxSelected, piecesSelected, checkedBoxCartonSelected, checkedItemPerBoxSelected, checkedPiecesSelected;
|
||||
private Spinner markerplace,modelNumber,title,color,size;
|
||||
private Spinner markerplace, modelNumber, title, color, size, sp_inspectionLevel, sp_qLevelMajor, sp_qLevelMinor;
|
||||
private CheckBox fri, refri;
|
||||
private ImageButton searchSku, scanBtn;
|
||||
private TextView profileName;
|
||||
|
@ -79,6 +83,9 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
private ApiService apiService;
|
||||
private Store store;
|
||||
private InspectionReportService inspectionReportService;
|
||||
private EditText aqlSampleSize, cartonWeight, cartonLength, cartonWidth, cartonHeight;
|
||||
private EditText packWeight, packLength, packWidth, packHeight;
|
||||
TextView txtTesting;
|
||||
|
||||
List<String> sizes = Collections.singletonList("[Size]");
|
||||
List<String> colors = Collections.singletonList("[Color]");
|
||||
|
@ -86,6 +93,10 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
List<String> modelNumbers = Collections.singletonList("[Model Number]");
|
||||
List<String> marketplaces = Collections.singletonList("[ Marketplace ]");
|
||||
|
||||
String inspectionLevel, qualityLevelMajor, qualityLevelMinor;
|
||||
List<InspectionLabel> inspectionLabelList = new ArrayList<>();
|
||||
List<QualityLabel> qualityLabelList = new ArrayList<>();
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
|
@ -182,6 +193,73 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
}
|
||||
});
|
||||
|
||||
//Inspection Level
|
||||
sp_inspectionLevel.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
if (parent.getItemAtPosition(position) != null) {
|
||||
inspectionLevel = parent.getItemAtPosition(position).toString();
|
||||
|
||||
store.getReport().getItems().get(0).setInspectionLevel((long) Double.parseDouble(inspectionLevel));
|
||||
|
||||
checkedBoxCartonSelected.setText("");
|
||||
checkedItemPerBoxSelected.setText("");
|
||||
checkedPiecesSelected.setText("");
|
||||
aqlSampleSize.setText("");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
store.getReport().getItems().get(0).setInspectionLevel(0);
|
||||
}
|
||||
});
|
||||
|
||||
//Quality Level Major
|
||||
sp_qLevelMajor.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
if (parent.getItemAtPosition(position) != null) {
|
||||
qualityLevelMajor = parent.getItemAtPosition(position).toString();
|
||||
|
||||
store.getReport().getItems().get(0).setMajorQualityLevel((long) Double.parseDouble(qualityLevelMajor));
|
||||
|
||||
checkedBoxCartonSelected.setText("");
|
||||
checkedItemPerBoxSelected.setText("");
|
||||
checkedPiecesSelected.setText("");
|
||||
aqlSampleSize.setText("");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
store.getReport().getItems().get(0).setMajorQualityLevel(0);
|
||||
}
|
||||
});
|
||||
|
||||
//Quality Level Minor
|
||||
sp_qLevelMinor.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
if (parent.getItemAtPosition(position) != null) {
|
||||
qualityLevelMinor = parent.getItemAtPosition(position).toString();
|
||||
|
||||
store.getReport().getItems().get(0).setMinorQualityLevel((long) Double.parseDouble(qualityLevelMinor));
|
||||
|
||||
checkedBoxCartonSelected.setText("");
|
||||
checkedItemPerBoxSelected.setText("");
|
||||
checkedPiecesSelected.setText("");
|
||||
aqlSampleSize.setText("");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
store.getReport().getItems().get(0).setMinorQualityLevel(0);
|
||||
}
|
||||
});
|
||||
|
||||
// title
|
||||
title.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
|
@ -261,8 +339,7 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
int boxCount = Integer.parseInt(s.toString());
|
||||
if (itemPerBox.getText().toString().isEmpty() || pieces.getText().toString().isEmpty()) {
|
||||
Toast.makeText(getContext(), "Enter Item/Pieces Per box", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
packsCount = (int) store.getProducts().get(0).getItemPerPack();
|
||||
piecesCount = (int) store.getProducts().get(0).getItemPerBox();
|
||||
|
||||
|
@ -299,8 +376,7 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
int boxCount = Integer.parseInt(s.toString());
|
||||
if (itemPerBox.getText().toString().isEmpty() || pieces.getText().toString().isEmpty()) {
|
||||
Toast.makeText(getContext(), "Enter Item/Pieces Per box", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
packsCount = (int) store.getProducts().get(0).getItemPerPack();
|
||||
piecesCount = (int) store.getProducts().get(0).getItemPerBox();
|
||||
|
||||
|
@ -311,7 +387,7 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
checkedPiecesSelected.setText(String.valueOf(totalPieces));
|
||||
}
|
||||
|
||||
store.getReport().getItems().get(0).setCheckedCartonsSelected( Long.parseLong( s.toString() ) );
|
||||
store.getReport().getItems().get(0).setCheckedCartonsSelected(Integer.parseInt(s.toString()));
|
||||
} catch (Exception e) {
|
||||
store.getReport().getItems().get(0).setCheckedCartonsSelected(0);
|
||||
}
|
||||
|
@ -354,7 +430,7 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
try {
|
||||
store.getReport().getItems().get(0).setCheckedPacksSelected( Long.parseLong( s.toString() ) );
|
||||
store.getReport().getItems().get(0).setCheckedPacksSelected(Integer.parseInt(s.toString()));
|
||||
} catch (Exception e) {
|
||||
store.getReport().getItems().get(0).setCheckedPacksSelected(0);
|
||||
}
|
||||
|
@ -397,10 +473,45 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
try {
|
||||
store.getReport().getItems().get(0).setCheckedPiecesSelected( Long.parseLong( s.toString() ) );
|
||||
store.getReport().getItems().get(0).setCheckedPiecesSelected(Integer.parseInt(s.toString()));
|
||||
} catch (Exception e) {
|
||||
store.getReport().getItems().get(0).setCheckedPiecesSelected(0);
|
||||
}
|
||||
|
||||
try {
|
||||
//calculate aql sample size
|
||||
//Log.e("ItemPresentedDetails-pieces: ", "" + s.toString());
|
||||
//Log.e("ItemPresentedDetails-inspectionLevel: ", "" + inspectionLevel);
|
||||
if (!s.toString().isEmpty()) {
|
||||
trackSampleCode(Integer.parseInt(s.toString()), (int) Double.parseDouble(inspectionLevel), Double.parseDouble(qualityLevelMajor), Double.parseDouble(qualityLevelMinor));
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//Carton Weight
|
||||
cartonWeight.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
try {
|
||||
store.getReport().getItems().get(0).setCartonWeight(Float.parseFloat(s.toString()));
|
||||
} catch (Exception e) {
|
||||
store.getReport().getItems().get(0).setCartonWeight(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -409,6 +520,181 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
}
|
||||
});
|
||||
|
||||
//Carton Length
|
||||
cartonLength.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
try {
|
||||
store.getReport().getItems().get(0).setCartonLength(Float.parseFloat(s.toString()));
|
||||
} catch (Exception e) {
|
||||
store.getReport().getItems().get(0).setCartonLength(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//Carton Width
|
||||
cartonWidth.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
try {
|
||||
store.getReport().getItems().get(0).setCartonWidth(Float.parseFloat(s.toString()));
|
||||
} catch (Exception e) {
|
||||
store.getReport().getItems().get(0).setCartonWidth(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//Carton Height
|
||||
cartonHeight.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
try {
|
||||
store.getReport().getItems().get(0).setCartonHeight(Float.parseFloat(s.toString()));
|
||||
} catch (Exception e) {
|
||||
store.getReport().getItems().get(0).setCartonHeight(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//Pack Weight
|
||||
packWeight.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
try {
|
||||
store.getReport().getItems().get(0).setPackWeight(Float.parseFloat(s.toString()));
|
||||
} catch (Exception e) {
|
||||
store.getReport().getItems().get(0).setPackWeight(0);
|
||||
}}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//Pack Length
|
||||
packLength.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
try {
|
||||
store.getReport().getItems().get(0).setPackLength(Float.parseFloat(s.toString()));
|
||||
} catch (Exception e) {
|
||||
store.getReport().getItems().get(0).setPackLength(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//Pack Width
|
||||
packWidth.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
try {
|
||||
store.getReport().getItems().get(0).setPackWidth(Float.parseFloat(s.toString()));
|
||||
} catch (Exception e) {
|
||||
store.getReport().getItems().get(0).setPackWidth(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//Pack Height
|
||||
packHeight.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
try {
|
||||
store.getReport().getItems().get(0).setPackHeight(Float.parseFloat(s.toString()));
|
||||
} catch (Exception e) {
|
||||
store.getReport().getItems().get(0).setPackHeight(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
aqlSampleSize.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
try {
|
||||
store.getReport().getItems().get(0).setSampleSize(Long.parseLong(s.toString()));
|
||||
} catch (Exception e) {
|
||||
store.getReport().getItems().get(0).setSampleSize(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// generalRemarks.addTextChangedListener(new TextWatcher() {
|
||||
// @Override
|
||||
// public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
@ -489,8 +775,7 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Toast.makeText(getContext(), "Please enter or scan sku details", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
//---
|
||||
|
@ -504,8 +789,7 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
if (v.getId() == R.id.button_right_frag_1) {
|
||||
if (!sku.getText().toString().isEmpty() && !store.getReport().getItems().get(0).getMarketplace().equalsIgnoreCase("[ Marketplace ]")) {
|
||||
navController.navigate(R.id.action_firstStepFragment_to_secondStepFragment);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Toast.makeText(getContext(), "Please enter or scan sku details", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
@ -559,6 +843,7 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void prePopulateData(List<Product> products) {
|
||||
System.out.println("prePopulateData: " + store.getReport().getItems().get(0).getFnsku());
|
||||
fri.setChecked(store.getReport().getFri());
|
||||
|
@ -619,6 +904,17 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
checkedItemPerBoxSelected.setText(String.valueOf(store.getReport().getItems().get(0).getCheckedPacksSelected()));
|
||||
checkedPiecesSelected.setText(String.valueOf(store.getReport().getItems().get(0).getCheckedPiecesSelected()));
|
||||
|
||||
cartonWeight.setText(String.valueOf(store.getReport().getItems().get(0).getCartonWeight()));
|
||||
cartonLength.setText(String.valueOf(store.getReport().getItems().get(0).getCartonLength()));
|
||||
cartonWidth.setText(String.valueOf(store.getReport().getItems().get(0).getCartonWidth()));
|
||||
cartonHeight.setText(String.valueOf(store.getReport().getItems().get(0).getCartonHeight()));
|
||||
|
||||
packWeight.setText(String.valueOf(store.getReport().getItems().get(0).getPackWeight()));
|
||||
packLength.setText(String.valueOf(store.getReport().getItems().get(0).getPackLength()));
|
||||
packWidth.setText(String.valueOf(store.getReport().getItems().get(0).getPackWidth()));
|
||||
packHeight.setText(String.valueOf(store.getReport().getItems().get(0).getPackHeight()));
|
||||
|
||||
aqlSampleSize.setText(String.valueOf(store.getReport().getItems().get(0).getSampleSize()));
|
||||
|
||||
// generalRemarks.setText( store.getReport().getItems().get(0).getSampleSize() );
|
||||
|
||||
|
@ -707,6 +1003,17 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
String marketplaceOption = (String) markerplace.getSelectedItem();
|
||||
store.getReport().getItems().get(0).setMarketplace(marketplaceOption);
|
||||
}
|
||||
|
||||
String[] inspectionLevelArray = {"1", "2", "3"};
|
||||
String[] inspectionLevelQuality = {"1.0", "1.5", "2.5", "4.0"};
|
||||
ArrayAdapter<String> adapterInspectionLevel = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_dropdown_item, inspectionLevelArray);
|
||||
sp_inspectionLevel.setAdapter(adapterInspectionLevel);
|
||||
|
||||
ArrayAdapter<String> adapterLevelMajor = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_dropdown_item, inspectionLevelQuality);
|
||||
sp_qLevelMajor.setAdapter(adapterLevelMajor);
|
||||
|
||||
ArrayAdapter<String> adapterLevelMinor = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_dropdown_item, inspectionLevelQuality);
|
||||
sp_qLevelMinor.setAdapter(adapterLevelMinor);
|
||||
}
|
||||
|
||||
|
||||
|
@ -718,6 +1025,9 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
rightFab = view.findViewById(R.id.button_right_frag_1);
|
||||
btnDraft = view.findViewById(R.id.button_draft_first);
|
||||
markerplace = view.findViewById(R.id.marketplace);
|
||||
sp_inspectionLevel = view.findViewById(R.id.sp_inspectionLevel);
|
||||
sp_qLevelMajor = view.findViewById(R.id.sp_qLevelMajor);
|
||||
sp_qLevelMinor = view.findViewById(R.id.sp_qLevelMinor);
|
||||
sku = view.findViewById(R.id.sku);
|
||||
modelNumber = view.findViewById(R.id.model_number);
|
||||
title = view.findViewById(R.id.title);
|
||||
|
@ -731,6 +1041,20 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
itemPerBoxSelected = view.findViewById(R.id.item_per_box_selected);
|
||||
piecesSelected = view.findViewById(R.id.pieces_selected);
|
||||
|
||||
txtTesting = view.findViewById(R.id.txtTesting);
|
||||
|
||||
aqlSampleSize = view.findViewById(R.id.et_aql_sample_size);
|
||||
|
||||
cartonWeight = view.findViewById(R.id.et_carton_weight);
|
||||
cartonLength = view.findViewById(R.id.et_carton_length);
|
||||
cartonWidth = view.findViewById(R.id.et_carton_width);
|
||||
cartonHeight = view.findViewById(R.id.et_carton_height);
|
||||
|
||||
packWeight = view.findViewById(R.id.et_pack_weight);
|
||||
packLength = view.findViewById(R.id.et_pack_length);
|
||||
packWidth = view.findViewById(R.id.et_pack_width);
|
||||
packHeight = view.findViewById(R.id.et_pack_height);
|
||||
|
||||
checkedBoxCartonSelected = view.findViewById(R.id.checked_box_carton_selected);
|
||||
checkedItemPerBoxSelected = view.findViewById(R.id.checked_item_per_box_selected);
|
||||
checkedPiecesSelected = view.findViewById(R.id.checked_pieces_selected);
|
||||
|
@ -833,4 +1157,69 @@ public class FirstStepFragment extends Fragment implements View.OnClickListener
|
|||
|
||||
return report;
|
||||
}
|
||||
|
||||
private void trackSampleCode(int itemPresentedPieces, int inspectionLevel, double selectedLevelMajor, double selectedLevelMinor) {
|
||||
try {
|
||||
String sampleCode = "";
|
||||
double levelMajor = 0.0, levelMinor = 0.0;
|
||||
int sampleSizeMajor = 0;
|
||||
int sampleSizeMinor = 0;
|
||||
List<InspectionLabel> inspectionGeneralLabels = new InspectionLabelRepository(getContext()).getInspectionLabels();
|
||||
List<QualityLabel> inspectionAcceptableQualities = new InspectionLabelRepository(getContext()).getQualityLabels();
|
||||
|
||||
//for sample code
|
||||
for (InspectionLabel label : inspectionGeneralLabels) {
|
||||
if (label.getInspectionLevel() == inspectionLevel &&
|
||||
label.getMinLotSize() <= itemPresentedPieces &&
|
||||
label.getMaxLotSize() >= itemPresentedPieces) {
|
||||
sampleCode = label.getSampleCode();
|
||||
//Log.e("sampleCode: ",""+sampleCode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//For level major
|
||||
for (QualityLabel quality : inspectionAcceptableQualities) {
|
||||
if (quality.getQualityLevel() == selectedLevelMajor && Objects.equals(quality.getSampleCode(), sampleCode)) {
|
||||
levelMajor = quality.getNoOfAcceptedDefects();
|
||||
sampleSizeMajor = quality.getSampleSize();
|
||||
}
|
||||
|
||||
//For Level Minor
|
||||
if (quality.getQualityLevel() == selectedLevelMinor &&
|
||||
Objects.equals(quality.getSampleCode(), sampleCode)) {
|
||||
levelMinor = quality.getNoOfAcceptedDefects();
|
||||
sampleSizeMinor = quality.getSampleSize();
|
||||
}
|
||||
}
|
||||
|
||||
String testDetails = "Item Presented Pieces: " + itemPresentedPieces
|
||||
+ "\nInspection Level: " + inspectionLevel
|
||||
+ "\nSelected Level Major: " + selectedLevelMajor
|
||||
+ "\nSelected Level Minor: " + selectedLevelMinor
|
||||
+ "\nSample Code: " + sampleCode
|
||||
+ "\nLevel Major Defects: " + levelMajor
|
||||
+ "\nLevel Minor Defects: " + levelMinor
|
||||
+ "\nSampleSizeMajor: " + sampleSizeMajor
|
||||
+ "\nSampleSizeMinor: " + sampleSizeMinor;
|
||||
|
||||
txtTesting.setText(testDetails);
|
||||
Log.e("SampleSizeMajor: ",""+sampleSizeMajor);
|
||||
aqlSampleSize.setText(String.valueOf(sampleSizeMajor));
|
||||
|
||||
store.getReport().getItems().get(0).setSampleSize(sampleSizeMajor);
|
||||
store.getReport().getItems().get(0).setMajorQualityLevel((long) levelMajor);
|
||||
store.getReport().getItems().get(0).setMinorQualityLevel((long) levelMinor);
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
/*if (minorInspectionAcceptableQuality != null && majorInspectionAcceptableQuality != null) {
|
||||
minorAcceptedCriteriaFromAqlMap.put(item.getId(), minorInspectionAcceptableQuality.getNoOfAcceptedDefects());
|
||||
majorAcceptedCriteriaFromAqlMap.put(item.getId(), majorInspectionAcceptableQuality.getNoOfAcceptedDefects());
|
||||
}*/
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.os.Handler;
|
|||
import android.os.Looper;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -65,11 +66,11 @@ public class ThirdStepFragment extends Fragment implements View.OnClickListener
|
|||
private InspectionReportService inspectionReportService;
|
||||
private RecyclerView vocRecyclerView,itemDimensionsRecyclerView;
|
||||
private Store store;
|
||||
private Spinner resultSpinner;
|
||||
//private Spinner resultSpinner;
|
||||
private ApiService apiService;
|
||||
private EditText generalRemarks, etQualityAuditor, etProdRepresentative, etQcRepresentative;
|
||||
|
||||
private TextView minorCountTv,majorCountTv,criticalCountTv;
|
||||
private TextView minorCountTv,majorCountTv,criticalCountTv, resultStatus;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
|
@ -268,6 +269,7 @@ public class ThirdStepFragment extends Fragment implements View.OnClickListener
|
|||
Handler handler = new Handler(Looper.getMainLooper());
|
||||
handler.post(() -> {
|
||||
|
||||
Log.e("Report-ToString: ",""+store.getReport().toString());
|
||||
SharedPreferences sharedPreferences = getContext().getSharedPreferences("login_prefs", Context.MODE_PRIVATE);
|
||||
long draftReportId = Long.parseLong(sharedPreferences.getString("draftReportId", null));
|
||||
|
||||
|
@ -360,12 +362,12 @@ public class ThirdStepFragment extends Fragment implements View.OnClickListener
|
|||
etProdRepresentative.setText(store.getReport().getProductionRepresentative());
|
||||
etQcRepresentative.setText(store.getReport().getQcRepresentative());
|
||||
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>( getContext(),
|
||||
/*ArrayAdapter<String> adapter = new ArrayAdapter<>( getContext(),
|
||||
android.R.layout.simple_spinner_item,
|
||||
inspectionReportService.getReportResult() );
|
||||
resultSpinner.setAdapter( adapter );
|
||||
resultSpinner.setAdapter( adapter );*/
|
||||
|
||||
String defaultSelection = store.getReport().getReportResult();
|
||||
/*String defaultSelection = store.getReport().getReportResult();
|
||||
int defaultIndexResultIndex = inspectionReportService.getReportResult().indexOf( defaultSelection );
|
||||
resultSpinner.setSelection( defaultIndexResultIndex );
|
||||
|
||||
|
@ -380,7 +382,7 @@ public class ThirdStepFragment extends Fragment implements View.OnClickListener
|
|||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
minorCountTv.setText( String.valueOf(0) );
|
||||
majorCountTv.setText( String.valueOf(0) ) ;
|
||||
|
@ -413,6 +415,19 @@ public class ThirdStepFragment extends Fragment implements View.OnClickListener
|
|||
minorCountTv.setText( String.format("Minor : %d", minor ) );
|
||||
majorCountTv.setText( String.format("Major : %d", major ) ) ;
|
||||
criticalCountTv.setText( String.format("Critical : %d", crirical ) );
|
||||
|
||||
long minorInspection = store.getReport().getItems().get(0).getMinorQualityLevel();
|
||||
long majorInspection = store.getReport().getItems().get(0).getMinorQualityLevel();
|
||||
if((long) minor <= minorInspection
|
||||
&& (long) major <= majorInspection
|
||||
&& (long) crirical == 0) {
|
||||
resultStatus.setText("Passed");
|
||||
store.getReport().setReportResult( "Passed" );
|
||||
}
|
||||
else{
|
||||
resultStatus.setText("Failed");
|
||||
store.getReport().setReportResult( "Failed" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -476,7 +491,8 @@ public class ThirdStepFragment extends Fragment implements View.OnClickListener
|
|||
profileImage = view.findViewById( R.id.third_step_profile_image );
|
||||
profileName = view.findViewById( R.id.third_profile_name );
|
||||
vocRecyclerView = view.findViewById( R.id.voc_recyclerview );
|
||||
resultSpinner = view.findViewById( R.id.result_spinner );
|
||||
// resultSpinner = view.findViewById( R.id.result_spinner );
|
||||
resultStatus = view.findViewById( R.id.result_status);
|
||||
generalRemarks = view.findViewById( R.id.general_remarks );
|
||||
itemDimensionsRecyclerView = view.findViewById( R.id.item_dimensions_recyclerview );
|
||||
minorCountTv = view.findViewById( R.id.minor_count );
|
||||
|
|
|
@ -1,82 +1,70 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/scrollLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
android:scrollbarFadeDuration="0"
|
||||
android:fadeScrollbars="false"
|
||||
android:fillViewport="true"
|
||||
android:scrollbarFadeDuration="0"
|
||||
android:scrollbarThumbVertical="@android:color/darker_gray"
|
||||
android:fillViewport="true">
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:scrollbars="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="2dp"
|
||||
tools:context=".ui.activities.LoginActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="806dp"
|
||||
android:layout_height="1150dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/relativeLayout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.333"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0">
|
||||
android:orientation="vertical">
|
||||
<!-- Your layout content here -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/firstLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="15dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_margin="20dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:text="@string/screen_title"
|
||||
android:textColor="#000000"
|
||||
android:textSize="35sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.054"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.032" />
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/first_step_profile_image"
|
||||
android:layout_width="93dp"
|
||||
android:layout_height="86dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.367"
|
||||
app:layout_constraintStart_toEndOf="@+id/textView3"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.014"
|
||||
android:layout_toLeftOf="@+id/first_step_name"
|
||||
tools:srcCompat="@tools:sample/avatars" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/first_step_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="Saif Ul haq"
|
||||
android:textColor="#000000"
|
||||
android:textStyle="bold|italic"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.325"
|
||||
app:layout_constraintStart_toEndOf="@+id/first_step_profile_image"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.022" />
|
||||
|
||||
android:textStyle="bold|italic" />
|
||||
</RelativeLayout>
|
||||
|
||||
<!--Buttons for Step-1, Step-2, Step-3-->
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="750dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.119">
|
||||
android:layout_below="@+id/firstLayout"
|
||||
android:layout_margin="15dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
|
@ -102,19 +90,11 @@
|
|||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="800dp"
|
||||
android:layout_height="950dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0">
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/lv3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/linearLayout"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -139,13 +119,7 @@
|
|||
android:id="@+id/textView7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/guide_line_text"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.067"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/guide_lne"
|
||||
app:layout_constraintVertical_bias="0.008" />
|
||||
android:text="@string/guide_line_text" />
|
||||
</LinearLayout>
|
||||
<!-- inspection checkboxes-->
|
||||
<LinearLayout
|
||||
|
@ -205,6 +179,7 @@
|
|||
android:layout_width="400dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="SKU"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="text" />
|
||||
|
||||
<ImageButton
|
||||
|
@ -262,6 +237,80 @@
|
|||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/box_border"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:weightSum="3"
|
||||
android:layout_margin="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_margin="16dp"
|
||||
android:text="Inspection Level"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_margin="16dp"
|
||||
android:text="Quality Level Major"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_margin="16dp"
|
||||
android:text="Quality Level Minor"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:weightSum="3"
|
||||
android:layout_margin="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/sp_inspectionLevel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="16dp"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/sp_qLevelMajor"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="5dp"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/sp_qLevelMinor"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="5dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -287,6 +336,7 @@
|
|||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Box / Carton "
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<EditText
|
||||
|
@ -294,6 +344,7 @@
|
|||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Packs (Item / box)"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<EditText
|
||||
|
@ -301,6 +352,7 @@
|
|||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Pieces"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -309,6 +361,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:imeOptions="actionNext"
|
||||
android:hint="Packaging Details"
|
||||
android:inputType="text" />
|
||||
</LinearLayout>
|
||||
|
@ -340,6 +393,7 @@
|
|||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Box / Carton "
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<EditText
|
||||
|
@ -347,6 +401,7 @@
|
|||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Packs (Item / box)"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<EditText
|
||||
|
@ -354,15 +409,26 @@
|
|||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Pieces"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<!--Item checked details-->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp"
|
||||
android:weightSum="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:layout_weight="0.8"
|
||||
android:background="@drawable/box_border"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
@ -385,12 +451,14 @@
|
|||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Box / Carton "
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/item_per_box_selected"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:imeOptions="actionNext"
|
||||
android:hint="Packs (Item / box)"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
|
@ -399,48 +467,183 @@
|
|||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Pieces"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="General Remarks"-->
|
||||
<!-- android:textColor="@color/black"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- android:layout_margin="16dp" />-->
|
||||
<!-- <EditText-->
|
||||
<!-- android:id="@+id/general_remarks"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:hint="General Remarks"-->
|
||||
<!-- android:layout_marginHorizontal="10dp"-->
|
||||
<!-- android:layout_marginVertical="10dp"-->
|
||||
<!-- android:inputType="text"/>-->
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_weight="0.2"
|
||||
android:background="@drawable/box_border"
|
||||
android:gravity="left"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:text="AQL Sample Size"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_aql_sample_size"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:hint="AQL Sample Size"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtTesting"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dp"
|
||||
android:layout_margin="5dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/box_border"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:text="Carton Weight"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_carton_weight"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Carton Weight"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_carton_length"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Length"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_carton_width"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="width"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_carton_height"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="height"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/box_border"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:text="Pack Weight"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_pack_weight"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Pack Weight"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_pack_length"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Length"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_pack_width"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="width"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="numberDecimal" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_pack_height"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="height"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="numberDecimal" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/relativeLayout"
|
||||
android:layout_width="805dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0">
|
||||
android:layout_below="@+id/lv3">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_right_frag_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:backgroundTint="@color/light_blue"
|
||||
|
@ -450,10 +653,10 @@
|
|||
android:id="@+id/button_draft_first"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toStartOf="@id/button_right_frag_1"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_toStartOf="@id/button_right_frag_1"
|
||||
android:text="Draft" />
|
||||
|
||||
<Button
|
||||
|
@ -474,5 +677,6 @@
|
|||
android:layout_toStartOf="@id/button_left_frag_1"
|
||||
android:text="History" />
|
||||
</RelativeLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
|
@ -331,13 +331,19 @@
|
|||
android:padding="10dp"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<Spinner
|
||||
|
||||
<TextView
|
||||
android:id="@+id/result_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Result Status"
|
||||
android:layout_weight="1"/>
|
||||
<!--<Spinner
|
||||
android:id="@+id/result_spinner"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:prompt="@string/spinner_title"
|
||||
/>
|
||||
android:prompt="@string/spinner_title" />-->
|
||||
<TextView
|
||||
android:id="@+id/minor_count"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<domain-config cleartextTrafficPermitted="true">
|
||||
<!--<domain includeSubdomains="true">192.168.91.16</domain>-->
|
||||
<domain includeSubdomains="true">192.168.90.27</domain>
|
||||
<domain includeSubdomains="true">192.168.91.44</domain>
|
||||
<domain includeSubdomains="true">portal.utopiaindustries.pk</domain>
|
||||
<domain includeSubdomains="true">utopiaindustries.pk</domain>
|
||||
</domain-config>
|
||||
|
|
Loading…
Reference in New Issue