Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
StockAuditEAN
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ramesh Babu Puvvadi
StockAuditEAN
Commits
e542492b
Commit
e542492b
authored
Jul 26, 2024
by
Ramesh Babu Puvvadi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrated new apis
parent
ae31de10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
80 additions
and
36 deletions
+80
-36
Constants.java
app/src/main/java/w/soulofpluto/stockauditean/Constants.java
+2
-3
HomeActivity.java
...c/main/java/w/soulofpluto/stockauditean/HomeActivity.java
+5
-6
MainActivity.java
...c/main/java/w/soulofpluto/stockauditean/MainActivity.java
+11
-10
PlanDetails.java
...rc/main/java/w/soulofpluto/stockauditean/PlanDetails.java
+0
-0
Plans.java
app/src/main/java/w/soulofpluto/stockauditean/Plans.java
+19
-0
SearchByBarcode.java
...ain/java/w/soulofpluto/stockauditean/SearchByBarcode.java
+30
-6
icon1.png
app/src/main/res/drawable-xxhdpi/icon1.png
+0
-0
activity_plandetials.xml
app/src/main/res/layout/activity_plandetials.xml
+10
-8
plansdetails_item.xml
app/src/main/res/layout/plansdetails_item.xml
+3
-3
No files found.
app/src/main/java/w/soulofpluto/stockauditean/Constants.java
View file @
e542492b
...
...
@@ -31,17 +31,16 @@ public class Constants{
//public static String BASE_URL = "http://182.18.167.139/";
//public static String BASE_URL = "http://192.168.34.16/";
public
static
String
BASE_URL
=
"http://posapi.plutokm.com/"
;
//public static String BASE_URL = "http://192.168.34.16/";
public
static
String
MenuBar
=
Constants
.
BASE_URL
+
"/Users/generateUserMenuBarLinksForAndroidApp"
;
public
static
String
Logout
=
Constants
.
BASE_URL
+
"/login/doLogout/"
;
public
static
String
Login
=
Constants
.
BASE_URL
+
"/login/doLogin"
;
public
static
String
StoreId
=
Constants
.
BASE_URL
+
"login/getStoresMappedToUser/"
;
public
static
String
Dashboard
=
Constants
.
BASE_URL
+
"/stockaudit/listOfStockAuditsOfLoginStore"
;
public
static
String
BarcodeUpload
=
Constants
.
BASE_URL
+
"/stockaudit/validateStockAuditBarcode"
;
public
static
String
BarcodeUpload
=
Constants
.
BASE_URL
+
"/stockaudit/validateStockAudit
Ean
Barcode"
;
public
static
String
BarcodeDelete
=
Constants
.
BASE_URL
+
"/stockaudit/deleteBarcodeAndQuantityFromStockAudit"
;
public
static
String
BarcodeComplete
=
Constants
.
BASE_URL
+
"/stockaudit/batchScanningCompleted"
;
public
static
String
RackWiseQty
=
Constants
.
BASE_URL
+
"/stockaudit/stockAuditPlanBarcodesScannedInformation"
;
public
static
String
BarcodeSearch
=
Constants
.
BASE_URL
+
"/stockaudit/stockAudit
BarcodeRackInformation
"
;
public
static
String
BarcodeSearch
=
Constants
.
BASE_URL
+
"/stockaudit/stockAudit
PlanBarcodesScannedInformationWithBarcode
"
;
public
static
String
GenerateSlip
=
Constants
.
BASE_URL
+
"/Sales/generateDeliverySlip"
;
public
static
String
Type
=
"Content-Type"
;
public
static
String
App_json
=
"application/json"
;
...
...
app/src/main/java/w/soulofpluto/stockauditean/HomeActivity.java
View file @
e542492b
...
...
@@ -54,7 +54,7 @@ import static w.soulofpluto.stockauditean.Constants.Logout;
recyclerView
=
findViewById
(
R
.
id
.
menu_list
);
preferenceManager
=
new
PreferenceManager
(
this
);
setSupportActionBar
(
home_toolbar
);
Objects
.
requireNonNull
(
getSupportActionBar
()).
setTitle
(
Html
.
fromHtml
(
" "
+
getResources
().
getString
(
R
.
string
.
home
)));
Objects
.
requireNonNull
(
getSupportActionBar
()).
setTitle
(
Html
.
fromHtml
(
" "
+
getResources
().
getString
(
R
.
string
.
home
)));
version
.
setText
(
Html
.
fromHtml
(
Constants
.
Ver_Text
+
Constants
.
VERSION
));
if
(
Constants
.
isNetworkAvailable
(
HomeActivity
.
this
))
{
setUI
();
...
...
@@ -102,7 +102,6 @@ import static w.soulofpluto.stockauditean.Constants.Logout;
.
addHeader
(
getResources
().
getString
(
R
.
string
.
accesstoken
),
preferenceManager
.
getCustToken
())
.
addHeader
(
getResources
().
getString
(
R
.
string
.
storeidtoken
),
preferenceManager
.
getStoreId
())
.
build
();
client
.
newCall
(
request
).
enqueue
(
new
Callback
(){
@Override
public
void
onFailure
(
Request
request
,
final
IOException
e
){
...
...
@@ -117,7 +116,7 @@ import static w.soulofpluto.stockauditean.Constants.Logout;
Constants
.
ProgressDialogDismiss
();
arrayList
=
new
ArrayList
<>();
final
String
Response
=
response
.
body
().
string
();
Log
.
e
(
"MenuBar Response "
,
Response
);
//
Log.e("MenuBar Response " , Response);
if
(
response
.
code
()
==
200
)
{
final
JSONObject
object
=
new
JSONObject
(
Response
);
if
(
object
.
getInt
(
"success"
)
==
1
)
{
...
...
@@ -133,11 +132,11 @@ import static w.soulofpluto.stockauditean.Constants.Logout;
MenuAdapter
menuAdapter
=
new
MenuAdapter
(
HomeActivity
.
this
,
arrayList
);
recyclerView
.
setAdapter
(
menuAdapter
);
});
Log
.
e
(
"Size"
,
String
.
valueOf
(
arrayList
.
size
()));
//
Log.e("Size", String.valueOf(arrayList.size()));
}
else
if
(
object
.
getInt
(
"success"
)
==
3
)
{
runOnUiThread
(()
->
{
try
{
Log
.
e
(
"session"
,
object
.
getString
(
"msg"
));
//
Log.e("session", object.getString("msg"));
Constants
.
getToast
(
HomeActivity
.
this
,
object
.
getString
(
"msg"
));
Login
.
Logout
(
HomeActivity
.
this
);
}
catch
(
JSONException
e
)
{
...
...
@@ -145,7 +144,7 @@ import static w.soulofpluto.stockauditean.Constants.Logout;
}
});
}
}
else
{
}
else
{
runOnUiThread
(()
->
Constants
.
getToast
(
HomeActivity
.
this
,
Response
));
}
}
catch
(
NullPointerException
|
JSONException
io
){
...
...
app/src/main/java/w/soulofpluto/stockauditean/MainActivity.java
View file @
e542492b
...
...
@@ -27,6 +27,7 @@ import java.io.IOException;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Objects
;
import
java.util.concurrent.TimeUnit
;
import
static
w
.
soulofpluto
.
stockauditean
.
Constants
.
JSON
;
...
...
@@ -94,9 +95,9 @@ public class MainActivity extends AppCompatActivity {
Login
.
Logout
(
MainActivity
.
this
);
}
else
{
runOnUiThread
(()
->
{
try
{
try
{
Constants
.
getToast
(
MainActivity
.
this
,
jsonObject
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
});
...
...
@@ -144,10 +145,8 @@ public class MainActivity extends AppCompatActivity {
Date
todayDate
=
new
Date
();
Date
from
=
getDateWithOffset
(-
Constants
.
Value
,
new
Date
());
String
fromDate
=
currentDate
.
format
(
from
);
Log
.
e
(
"From Date"
,
fromDate
);
String
thisDate
=
currentDate
.
format
(
todayDate
);
Log
.
e
(
"Today Date"
,
thisDate
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
auditstatus
),
"In Progress"
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
auditstatus
),
"In Progress"
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
fromdate
),
fromDate
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
todate
),
thisDate
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
android_version
),
Constants
.
VERSION
);
...
...
@@ -191,9 +190,11 @@ public class MainActivity extends AppCompatActivity {
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
data
)))
{
plansArrayList
.
clear
();
JSONArray
jsonArray
=
object1
.
getJSONArray
(
getResources
().
getString
(
R
.
string
.
data
));
if
(
jsonArray
.
length
()>
0
)
{
if
(
jsonArray
.
length
()>
0
)
{
for
(
int
i
=
0
;
i
<
jsonArray
.
length
();
i
++)
{
JSONObject
jsonObject
=
jsonArray
.
getJSONObject
(
i
);
Log
.
e
(
"Object Data "
,
jsonObject
.
toString
());
if
(
jsonObject
.
getString
(
"is_ean_stock_audit"
).
equals
(
"Y"
))
{
Plans
plans
=
new
Plans
();
plans
.
setPlanId
(
String
.
valueOf
(
jsonObject
.
getInt
(
"id"
)));
plans
.
setName
(
jsonObject
.
getString
(
"stock_audit_name"
));
...
...
@@ -201,10 +202,11 @@ public class MainActivity extends AppCompatActivity {
plans
.
setSection
(
Constants
.
convertString
(
jsonObject
.
getString
(
"item_sections"
)));
plansArrayList
.
add
(
plans
);
}
}
CustomAdapter
customAdapter
=
new
CustomAdapter
(
MainActivity
.
this
,
plansArrayList
);
plans_list
.
setLayoutManager
(
new
LinearLayoutManager
(
MainActivity
.
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
plans_list
.
setAdapter
(
customAdapter
);
}
else
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
msg
)))
{
}
else
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
msg
)))
{
runOnUiThread
(()
->
{
try
{
Constants
.
getToast
(
MainActivity
.
this
,
object1
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
...
...
@@ -213,7 +215,6 @@ public class MainActivity extends AppCompatActivity {
}
});
}
}
else
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
msg
)))
{
runOnUiThread
(()
->
{
try
{
...
...
@@ -225,9 +226,9 @@ public class MainActivity extends AppCompatActivity {
}
}
else
if
(
object1
.
getInt
(
getResources
().
getString
(
R
.
string
.
success
))
==
3
)
{
runOnUiThread
(()
->
{
try
{
try
{
Constants
.
getToast
(
MainActivity
.
this
,
object1
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
});
...
...
app/src/main/java/w/soulofpluto/stockauditean/PlanDetails.java
View file @
e542492b
This diff is collapsed.
Click to expand it.
app/src/main/java/w/soulofpluto/stockauditean/Plans.java
View file @
e542492b
...
...
@@ -16,6 +16,7 @@ public class Plans implements Parcelable {
String
division
;
String
Barcode
;
String
Qty
;
String
OurBarcode
;
int
ColumnId
;
public
int
getColumnId
()
{
...
...
@@ -26,6 +27,22 @@ public class Plans implements Parcelable {
ColumnId
=
columnId
;
}
public
String
getOurBarcode
()
{
return
OurBarcode
;
}
public
void
setOurBarcode
(
String
ourBarcode
)
{
OurBarcode
=
ourBarcode
;
}
public
static
Comparator
<
Plans
>
getSortById
()
{
return
sortById
;
}
public
static
void
setSortById
(
Comparator
<
Plans
>
sortById
)
{
Plans
.
sortById
=
sortById
;
}
protected
Plans
(
Parcel
in
)
{
PlanId
=
in
.
readString
();
Name
=
in
.
readString
();
...
...
@@ -34,6 +51,7 @@ public class Plans implements Parcelable {
Barcode
=
in
.
readString
();
Qty
=
in
.
readString
();
ColumnId
=
in
.
readInt
();
OurBarcode
=
in
.
readString
();
}
public
static
final
Creator
<
Plans
>
CREATOR
=
new
Creator
<
Plans
>()
{
...
...
@@ -94,6 +112,7 @@ public class Plans implements Parcelable {
return
Qty
;
}
public
void
setQty
(
String
qty
)
{
Qty
=
qty
;
}
...
...
app/src/main/java/w/soulofpluto/stockauditean/SearchByBarcode.java
View file @
e542492b
package
w
.
soulofpluto
.
stockauditean
;
import
android.annotation.SuppressLint
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Handler
;
...
...
@@ -84,8 +85,10 @@ import static w.soulofpluto.stockauditean.Constants.getDateWithOffset;
try
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
){
object
.
put
(
getResources
().
getString
(
R
.
string
.
plan_id
),
planId
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
barcode_upload
),
Barcode
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
android_version
),
Constants
.
VERSION
);
object
.
put
(
"search_barcode"
,
Barcode
);
//object.put(getResources().getString(R.string.android_version),Constants.VERSION);
}
}
catch
(
JSONException
e
){
e
.
printStackTrace
();
...
...
@@ -111,6 +114,7 @@ import static w.soulofpluto.stockauditean.Constants.getDateWithOffset;
Constants
.
ProgressDialogDismiss
();
});
}
@SuppressLint
(
"SetTextI18n"
)
@Override
public
void
onResponse
(
final
com
.
squareup
.
okhttp
.
Response
response
)
throws
IOException
{
try
{
...
...
@@ -134,10 +138,30 @@ import static w.soulofpluto.stockauditean.Constants.getDateWithOffset;
searchBy_barcode
.
setText
(
""
);
try
{
JSONObject
jsonObject
=
object1
.
getJSONObject
(
getResources
().
getString
(
R
.
string
.
data
));
searchByBarcode_rack
.
setText
(
Html
.
fromHtml
(
Constants
.
Id
)
+
jsonObject
.
getString
(
"rack_id"
)
+
"\n"
+
(
Html
.
fromHtml
(
Constants
.
Barcode
)
+
jsonObject
.
getString
(
"barcode"
))
+
"\n"
+
(
Html
.
fromHtml
(
Constants
.
From
)
+
jsonObject
.
getString
(
"scanning_start_at"
))
+
"\n"
+
(
Html
.
fromHtml
(
Constants
.
To
)
+
jsonObject
.
getString
(
"scanning_end_at"
)));
if
(
jsonObject
.
has
(
"rack_info"
))
{
JSONArray
rackInfoArray
=
jsonObject
.
getJSONArray
(
"rack_info"
);
if
(
rackInfoArray
.
length
()
>
0
)
{
StringBuilder
rackInfoBuilder
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
rackInfoArray
.
length
();
i
++)
{
JSONObject
rackObject
=
rackInfoArray
.
getJSONObject
(
i
);
if
(
rackObject
.
has
(
"barcode"
))
{
rackInfoBuilder
.
append
(
Html
.
fromHtml
(
Constants
.
Id
))
.
append
(
rackObject
.
getString
(
"rack_id"
))
.
append
(
"\n"
)
.
append
(
Html
.
fromHtml
(
Constants
.
Barcode
))
.
append
(
rackObject
.
getString
(
"barcode"
))
.
append
(
"\n"
)
.
append
(
Html
.
fromHtml
(
Constants
.
From
))
.
append
(
rackObject
.
getString
(
"scanning_start_at"
))
.
append
(
"\n"
)
.
append
(
Html
.
fromHtml
(
Constants
.
To
))
.
append
(
rackObject
.
getString
(
"scanning_end_at"
))
.
append
(
"\n\n"
);
// Add extra new line for separation between entries
}
}
searchByBarcode_rack
.
setText
(
rackInfoBuilder
.
toString
());
}
}
}
catch
(
JSONException
e
){
e
.
printStackTrace
();
}
...
...
app/src/main/res/drawable-xxhdpi/icon1.png
deleted
100644 → 0
View file @
ae31de10
21.9 KB
app/src/main/res/layout/activity_plandetials.xml
View file @
e542492b
...
...
@@ -29,7 +29,7 @@
android:id=
"@+id/plandetails_id"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"
3
dp"
android:layout_margin=
"
5
dp"
android:textColor=
"@android:color/black"
style=
"@style/textfont"
/>
...
...
@@ -38,7 +38,7 @@
android:id=
"@+id/plandetails_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"
3
dp"
android:layout_margin=
"
5
dp"
android:textColor=
"@android:color/black"
style=
"@style/textfont"
/>
...
...
@@ -71,7 +71,8 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:weightSum=
"1"
>
android:weightSum=
"1"
android:layout_margin=
"5dp"
>
<androidx.appcompat.widget.AppCompatRadioButton
android:id=
"@+id/pieces"
...
...
@@ -167,7 +168,8 @@
android:hint=
"TG21489489"
android:layout_alignParentLeft=
"true"
android:maxLines=
"2"
android:layout_marginTop=
"5dp"
android:layout_margin=
"5dp"
android:inputType=
"number"
style=
"@style/textfont"
/>
<LinearLayout
...
...
@@ -175,13 +177,13 @@
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:weightSum=
"1"
android:layout_margin=
"
3
dp"
>
android:layout_margin=
"
5
dp"
>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:text=
"@string/barcode"
android:layout_weight=
"0.
33
"
android:layout_weight=
"0.
40
"
android:textColor=
"@android:color/black"
style=
"@style/headerfont"
/>
...
...
@@ -189,14 +191,14 @@
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:text=
"@string/qty"
android:layout_weight=
"0.3
3
"
android:layout_weight=
"0.3
0
"
android:textColor=
"@android:color/black"
style=
"@style/headerfont"
/>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3
3
"
android:layout_weight=
"0.3
0
"
android:textColor=
"@android:color/black"
/>
</LinearLayout>
...
...
app/src/main/res/layout/plansdetails_item.xml
View file @
e542492b
...
...
@@ -19,7 +19,7 @@
android:id=
"@+id/plandetails_barcode"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.
33
"
android:layout_weight=
"0.
40
"
android:textColor=
"@android:color/black"
style=
"@style/textfont"
android:layout_gravity=
"center"
...
...
@@ -29,7 +29,7 @@
android:id=
"@+id/plandetails_qty"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3
3
"
android:layout_weight=
"0.3
0
"
android:textColor=
"@android:color/black"
style=
"@style/textfont"
android:layout_gravity=
"center"
...
...
@@ -37,7 +37,7 @@
<RelativeLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3
3
"
android:layout_weight=
"0.3
0
"
android:gravity=
"center"
>
<ImageView
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment