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
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
118 additions
and
74 deletions
+118
-74
Constants.java
app/src/main/java/w/soulofpluto/stockauditean/Constants.java
+2
-3
HomeActivity.java
...c/main/java/w/soulofpluto/stockauditean/HomeActivity.java
+8
-9
MainActivity.java
...c/main/java/w/soulofpluto/stockauditean/MainActivity.java
+34
-33
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
+42
-18
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{
...
@@ -31,17 +31,16 @@ public class Constants{
//public static String BASE_URL = "http://182.18.167.139/";
//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://192.168.34.16/";
public
static
String
BASE_URL
=
"http://posapi.plutokm.com/"
;
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
MenuBar
=
Constants
.
BASE_URL
+
"/Users/generateUserMenuBarLinksForAndroidApp"
;
public
static
String
Logout
=
Constants
.
BASE_URL
+
"/login/doLogout/"
;
public
static
String
Logout
=
Constants
.
BASE_URL
+
"/login/doLogout/"
;
public
static
String
Login
=
Constants
.
BASE_URL
+
"/login/doLogin"
;
public
static
String
Login
=
Constants
.
BASE_URL
+
"/login/doLogin"
;
public
static
String
StoreId
=
Constants
.
BASE_URL
+
"login/getStoresMappedToUser/"
;
public
static
String
StoreId
=
Constants
.
BASE_URL
+
"login/getStoresMappedToUser/"
;
public
static
String
Dashboard
=
Constants
.
BASE_URL
+
"/stockaudit/listOfStockAuditsOfLoginStore"
;
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
BarcodeDelete
=
Constants
.
BASE_URL
+
"/stockaudit/deleteBarcodeAndQuantityFromStockAudit"
;
public
static
String
BarcodeComplete
=
Constants
.
BASE_URL
+
"/stockaudit/batchScanningCompleted"
;
public
static
String
BarcodeComplete
=
Constants
.
BASE_URL
+
"/stockaudit/batchScanningCompleted"
;
public
static
String
RackWiseQty
=
Constants
.
BASE_URL
+
"/stockaudit/stockAuditPlanBarcodesScannedInformation"
;
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
GenerateSlip
=
Constants
.
BASE_URL
+
"/Sales/generateDeliverySlip"
;
public
static
String
Type
=
"Content-Type"
;
public
static
String
Type
=
"Content-Type"
;
public
static
String
App_json
=
"application/json"
;
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;
...
@@ -54,7 +54,7 @@ import static w.soulofpluto.stockauditean.Constants.Logout;
recyclerView
=
findViewById
(
R
.
id
.
menu_list
);
recyclerView
=
findViewById
(
R
.
id
.
menu_list
);
preferenceManager
=
new
PreferenceManager
(
this
);
preferenceManager
=
new
PreferenceManager
(
this
);
setSupportActionBar
(
home_toolbar
);
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
));
version
.
setText
(
Html
.
fromHtml
(
Constants
.
Ver_Text
+
Constants
.
VERSION
));
if
(
Constants
.
isNetworkAvailable
(
HomeActivity
.
this
))
{
if
(
Constants
.
isNetworkAvailable
(
HomeActivity
.
this
))
{
setUI
();
setUI
();
...
@@ -102,7 +102,6 @@ import static w.soulofpluto.stockauditean.Constants.Logout;
...
@@ -102,7 +102,6 @@ import static w.soulofpluto.stockauditean.Constants.Logout;
.
addHeader
(
getResources
().
getString
(
R
.
string
.
accesstoken
),
preferenceManager
.
getCustToken
())
.
addHeader
(
getResources
().
getString
(
R
.
string
.
accesstoken
),
preferenceManager
.
getCustToken
())
.
addHeader
(
getResources
().
getString
(
R
.
string
.
storeidtoken
),
preferenceManager
.
getStoreId
())
.
addHeader
(
getResources
().
getString
(
R
.
string
.
storeidtoken
),
preferenceManager
.
getStoreId
())
.
build
();
.
build
();
client
.
newCall
(
request
).
enqueue
(
new
Callback
(){
client
.
newCall
(
request
).
enqueue
(
new
Callback
(){
@Override
@Override
public
void
onFailure
(
Request
request
,
final
IOException
e
){
public
void
onFailure
(
Request
request
,
final
IOException
e
){
...
@@ -117,15 +116,15 @@ import static w.soulofpluto.stockauditean.Constants.Logout;
...
@@ -117,15 +116,15 @@ import static w.soulofpluto.stockauditean.Constants.Logout;
Constants
.
ProgressDialogDismiss
();
Constants
.
ProgressDialogDismiss
();
arrayList
=
new
ArrayList
<>();
arrayList
=
new
ArrayList
<>();
final
String
Response
=
response
.
body
().
string
();
final
String
Response
=
response
.
body
().
string
();
Log
.
e
(
"MenuBar Response "
,
Response
);
//
Log.e("MenuBar Response " , Response);
if
(
response
.
code
()
==
200
)
{
if
(
response
.
code
()
==
200
)
{
final
JSONObject
object
=
new
JSONObject
(
Response
);
final
JSONObject
object
=
new
JSONObject
(
Response
);
if
(
object
.
getInt
(
"success"
)
==
1
)
{
if
(
object
.
getInt
(
"success"
)
==
1
)
{
JSONArray
jsonArray
=
object
.
getJSONArray
(
"data"
);
JSONArray
jsonArray
=
object
.
getJSONArray
(
"data"
);
for
(
int
i
=
0
;
i
<
jsonArray
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
jsonArray
.
length
();
i
++)
{
if
(
jsonArray
.
get
(
i
).
equals
(
"Stock Audit"
))
{
if
(
jsonArray
.
get
(
i
).
equals
(
"Stock Audit"
))
{
arrayList
.
add
(
jsonArray
.
get
(
i
).
toString
());
arrayList
.
add
(
jsonArray
.
get
(
i
).
toString
());
}
}
}
}
Handler
handler
=
new
Handler
(
Looper
.
getMainLooper
());
Handler
handler
=
new
Handler
(
Looper
.
getMainLooper
());
handler
.
post
(()
->
{
handler
.
post
(()
->
{
...
@@ -133,11 +132,11 @@ import static w.soulofpluto.stockauditean.Constants.Logout;
...
@@ -133,11 +132,11 @@ import static w.soulofpluto.stockauditean.Constants.Logout;
MenuAdapter
menuAdapter
=
new
MenuAdapter
(
HomeActivity
.
this
,
arrayList
);
MenuAdapter
menuAdapter
=
new
MenuAdapter
(
HomeActivity
.
this
,
arrayList
);
recyclerView
.
setAdapter
(
menuAdapter
);
recyclerView
.
setAdapter
(
menuAdapter
);
});
});
Log
.
e
(
"Size"
,
String
.
valueOf
(
arrayList
.
size
()));
//
Log.e("Size", String.valueOf(arrayList.size()));
}
else
if
(
object
.
getInt
(
"success"
)
==
3
)
{
}
else
if
(
object
.
getInt
(
"success"
)
==
3
)
{
runOnUiThread
(()
->
{
runOnUiThread
(()
->
{
try
{
try
{
Log
.
e
(
"session"
,
object
.
getString
(
"msg"
));
//
Log.e("session", object.getString("msg"));
Constants
.
getToast
(
HomeActivity
.
this
,
object
.
getString
(
"msg"
));
Constants
.
getToast
(
HomeActivity
.
this
,
object
.
getString
(
"msg"
));
Login
.
Logout
(
HomeActivity
.
this
);
Login
.
Logout
(
HomeActivity
.
this
);
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
...
@@ -145,7 +144,7 @@ import static w.soulofpluto.stockauditean.Constants.Logout;
...
@@ -145,7 +144,7 @@ import static w.soulofpluto.stockauditean.Constants.Logout;
}
}
});
});
}
}
}
else
{
}
else
{
runOnUiThread
(()
->
Constants
.
getToast
(
HomeActivity
.
this
,
Response
));
runOnUiThread
(()
->
Constants
.
getToast
(
HomeActivity
.
this
,
Response
));
}
}
}
catch
(
NullPointerException
|
JSONException
io
){
}
catch
(
NullPointerException
|
JSONException
io
){
...
...
app/src/main/java/w/soulofpluto/stockauditean/MainActivity.java
View file @
e542492b
...
@@ -27,6 +27,7 @@ import java.io.IOException;
...
@@ -27,6 +27,7 @@ import java.io.IOException;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Objects
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
static
w
.
soulofpluto
.
stockauditean
.
Constants
.
JSON
;
import
static
w
.
soulofpluto
.
stockauditean
.
Constants
.
JSON
;
...
@@ -54,11 +55,11 @@ public class MainActivity extends AppCompatActivity {
...
@@ -54,11 +55,11 @@ public class MainActivity extends AppCompatActivity {
@Override
@Override
protected
void
onStart
()
{
protected
void
onStart
()
{
if
(
Constants
.
isNetworkAvailable
(
MainActivity
.
this
))
{
if
(
Constants
.
isNetworkAvailable
(
MainActivity
.
this
))
{
AppUtils
.
deleteCache
(
MainActivity
.
this
);
AppUtils
.
deleteCache
(
MainActivity
.
this
);
FetchData
(
Constants
.
Dashboard
);
FetchData
(
Constants
.
Dashboard
);
Constants
.
ProgressDialogShow
(
MainActivity
.
this
);
Constants
.
ProgressDialogShow
(
MainActivity
.
this
);
}
else
{
}
else
{
Constants
.
getToast
(
MainActivity
.
this
,
getResources
().
getString
(
R
.
string
.
connection
));
Constants
.
getToast
(
MainActivity
.
this
,
getResources
().
getString
(
R
.
string
.
connection
));
}
}
super
.
onStart
();
super
.
onStart
();
}
}
...
@@ -94,11 +95,11 @@ public class MainActivity extends AppCompatActivity {
...
@@ -94,11 +95,11 @@ public class MainActivity extends AppCompatActivity {
Login
.
Logout
(
MainActivity
.
this
);
Login
.
Logout
(
MainActivity
.
this
);
}
else
{
}
else
{
runOnUiThread
(()
->
{
runOnUiThread
(()
->
{
try
{
try
{
Constants
.
getToast
(
MainActivity
.
this
,
jsonObject
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
Constants
.
getToast
(
MainActivity
.
this
,
jsonObject
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
});
});
}
}
}
}
...
@@ -144,10 +145,8 @@ public class MainActivity extends AppCompatActivity {
...
@@ -144,10 +145,8 @@ public class MainActivity extends AppCompatActivity {
Date
todayDate
=
new
Date
();
Date
todayDate
=
new
Date
();
Date
from
=
getDateWithOffset
(-
Constants
.
Value
,
new
Date
());
Date
from
=
getDateWithOffset
(-
Constants
.
Value
,
new
Date
());
String
fromDate
=
currentDate
.
format
(
from
);
String
fromDate
=
currentDate
.
format
(
from
);
Log
.
e
(
"From Date"
,
fromDate
);
String
thisDate
=
currentDate
.
format
(
todayDate
);
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
.
fromdate
),
fromDate
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
todate
),
thisDate
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
todate
),
thisDate
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
android_version
),
Constants
.
VERSION
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
android_version
),
Constants
.
VERSION
);
...
@@ -191,29 +190,31 @@ public class MainActivity extends AppCompatActivity {
...
@@ -191,29 +190,31 @@ public class MainActivity extends AppCompatActivity {
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
data
)))
{
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
data
)))
{
plansArrayList
.
clear
();
plansArrayList
.
clear
();
JSONArray
jsonArray
=
object1
.
getJSONArray
(
getResources
().
getString
(
R
.
string
.
data
));
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
++)
{
for
(
int
i
=
0
;
i
<
jsonArray
.
length
();
i
++)
{
JSONObject
jsonObject
=
jsonArray
.
getJSONObject
(
i
);
JSONObject
jsonObject
=
jsonArray
.
getJSONObject
(
i
);
Plans
plans
=
new
Plans
();
Log
.
e
(
"Object Data "
,
jsonObject
.
toString
());
plans
.
setPlanId
(
String
.
valueOf
(
jsonObject
.
getInt
(
"id"
)));
if
(
jsonObject
.
getString
(
"is_ean_stock_audit"
).
equals
(
"Y"
))
{
plans
.
setName
(
jsonObject
.
getString
(
"stock_audit_name"
));
Plans
plans
=
new
Plans
();
plans
.
setDivision
(
Constants
.
convertString
(
jsonObject
.
getString
(
"item_divisions"
)));
plans
.
setPlanId
(
String
.
valueOf
(
jsonObject
.
getInt
(
"id"
)));
plans
.
setSection
(
Constants
.
convertString
(
jsonObject
.
getString
(
"item_sections"
)));
plans
.
setName
(
jsonObject
.
getString
(
"stock_audit_name"
));
plansArrayList
.
add
(
plans
);
plans
.
setDivision
(
Constants
.
convertString
(
jsonObject
.
getString
(
"item_divisions"
)));
plans
.
setSection
(
Constants
.
convertString
(
jsonObject
.
getString
(
"item_sections"
)));
plansArrayList
.
add
(
plans
);
}
}
}
CustomAdapter
customAdapter
=
new
CustomAdapter
(
MainActivity
.
this
,
plansArrayList
);
CustomAdapter
customAdapter
=
new
CustomAdapter
(
MainActivity
.
this
,
plansArrayList
);
plans_list
.
setLayoutManager
(
new
LinearLayoutManager
(
MainActivity
.
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
plans_list
.
setLayoutManager
(
new
LinearLayoutManager
(
MainActivity
.
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
plans_list
.
setAdapter
(
customAdapter
);
plans_list
.
setAdapter
(
customAdapter
);
}
else
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
msg
)))
{
}
else
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
msg
)))
{
runOnUiThread
(()
->
{
runOnUiThread
(()
->
{
try
{
try
{
Constants
.
getToast
(
MainActivity
.
this
,
object1
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
Constants
.
getToast
(
MainActivity
.
this
,
object1
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
});
});
}
}
}
else
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
msg
)))
{
}
else
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
msg
)))
{
runOnUiThread
(()
->
{
runOnUiThread
(()
->
{
try
{
try
{
...
@@ -225,11 +226,11 @@ public class MainActivity extends AppCompatActivity {
...
@@ -225,11 +226,11 @@ public class MainActivity extends AppCompatActivity {
}
}
}
else
if
(
object1
.
getInt
(
getResources
().
getString
(
R
.
string
.
success
))
==
3
)
{
}
else
if
(
object1
.
getInt
(
getResources
().
getString
(
R
.
string
.
success
))
==
3
)
{
runOnUiThread
(()
->
{
runOnUiThread
(()
->
{
try
{
try
{
Constants
.
getToast
(
MainActivity
.
this
,
object1
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
Constants
.
getToast
(
MainActivity
.
this
,
object1
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
});
});
preferenceManager
.
setUserId
(
""
);
preferenceManager
.
setUserId
(
""
);
preferenceManager
.
setLogged
(
false
);
preferenceManager
.
setLogged
(
false
);
...
...
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 {
...
@@ -16,6 +16,7 @@ public class Plans implements Parcelable {
String
division
;
String
division
;
String
Barcode
;
String
Barcode
;
String
Qty
;
String
Qty
;
String
OurBarcode
;
int
ColumnId
;
int
ColumnId
;
public
int
getColumnId
()
{
public
int
getColumnId
()
{
...
@@ -26,6 +27,22 @@ public class Plans implements Parcelable {
...
@@ -26,6 +27,22 @@ public class Plans implements Parcelable {
ColumnId
=
columnId
;
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
)
{
protected
Plans
(
Parcel
in
)
{
PlanId
=
in
.
readString
();
PlanId
=
in
.
readString
();
Name
=
in
.
readString
();
Name
=
in
.
readString
();
...
@@ -34,6 +51,7 @@ public class Plans implements Parcelable {
...
@@ -34,6 +51,7 @@ public class Plans implements Parcelable {
Barcode
=
in
.
readString
();
Barcode
=
in
.
readString
();
Qty
=
in
.
readString
();
Qty
=
in
.
readString
();
ColumnId
=
in
.
readInt
();
ColumnId
=
in
.
readInt
();
OurBarcode
=
in
.
readString
();
}
}
public
static
final
Creator
<
Plans
>
CREATOR
=
new
Creator
<
Plans
>()
{
public
static
final
Creator
<
Plans
>
CREATOR
=
new
Creator
<
Plans
>()
{
...
@@ -94,6 +112,7 @@ public class Plans implements Parcelable {
...
@@ -94,6 +112,7 @@ public class Plans implements Parcelable {
return
Qty
;
return
Qty
;
}
}
public
void
setQty
(
String
qty
)
{
public
void
setQty
(
String
qty
)
{
Qty
=
qty
;
Qty
=
qty
;
}
}
...
...
app/src/main/java/w/soulofpluto/stockauditean/SearchByBarcode.java
View file @
e542492b
package
w
.
soulofpluto
.
stockauditean
;
package
w
.
soulofpluto
.
stockauditean
;
import
android.annotation.SuppressLint
;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
...
@@ -84,8 +85,10 @@ import static w.soulofpluto.stockauditean.Constants.getDateWithOffset;
...
@@ -84,8 +85,10 @@ import static w.soulofpluto.stockauditean.Constants.getDateWithOffset;
try
{
try
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
){
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
){
object
.
put
(
getResources
().
getString
(
R
.
string
.
plan_id
),
planId
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
plan_id
),
planId
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
barcode_upload
),
Barcode
);
object
.
put
(
"search_barcode"
,
Barcode
);
object
.
put
(
getResources
().
getString
(
R
.
string
.
android_version
),
Constants
.
VERSION
);
//object.put(getResources().getString(R.string.android_version),Constants.VERSION);
}
}
}
catch
(
JSONException
e
){
}
catch
(
JSONException
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -99,7 +102,7 @@ import static w.soulofpluto.stockauditean.Constants.getDateWithOffset;
...
@@ -99,7 +102,7 @@ import static w.soulofpluto.stockauditean.Constants.getDateWithOffset;
Request
request
=
new
Request
.
Builder
()
Request
request
=
new
Request
.
Builder
()
.
url
(
Constants
.
BarcodeSearch
)
.
url
(
Constants
.
BarcodeSearch
)
.
post
(
body
)
.
post
(
body
)
.
addHeader
(
Constants
.
Type
,
Constants
.
App_json
)
.
addHeader
(
Constants
.
Type
,
Constants
.
App_json
)
.
addHeader
(
getResources
().
getString
(
R
.
string
.
accesstoken
),
preferenceManager
.
getCustToken
())
.
addHeader
(
getResources
().
getString
(
R
.
string
.
accesstoken
),
preferenceManager
.
getCustToken
())
.
addHeader
(
getResources
().
getString
(
R
.
string
.
storeidtoken
),
preferenceManager
.
getStoreId
())
.
addHeader
(
getResources
().
getString
(
R
.
string
.
storeidtoken
),
preferenceManager
.
getStoreId
())
.
build
();
.
build
();
...
@@ -111,6 +114,7 @@ import static w.soulofpluto.stockauditean.Constants.getDateWithOffset;
...
@@ -111,6 +114,7 @@ import static w.soulofpluto.stockauditean.Constants.getDateWithOffset;
Constants
.
ProgressDialogDismiss
();
Constants
.
ProgressDialogDismiss
();
});
});
}
}
@SuppressLint
(
"SetTextI18n"
)
@Override
@Override
public
void
onResponse
(
final
com
.
squareup
.
okhttp
.
Response
response
)
throws
IOException
{
public
void
onResponse
(
final
com
.
squareup
.
okhttp
.
Response
response
)
throws
IOException
{
try
{
try
{
...
@@ -127,17 +131,37 @@ import static w.soulofpluto.stockauditean.Constants.getDateWithOffset;
...
@@ -127,17 +131,37 @@ import static w.soulofpluto.stockauditean.Constants.getDateWithOffset;
Log
.
e
(
"Length"
,
String
.
valueOf
(
getResources
().
getString
(
R
.
string
.
data
).
length
()));
Log
.
e
(
"Length"
,
String
.
valueOf
(
getResources
().
getString
(
R
.
string
.
data
).
length
()));
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
data
))){
if
(
object1
.
has
(
getResources
().
getString
(
R
.
string
.
data
))){
if
(
object1
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)).
equalsIgnoreCase
(
"no data found"
)){
if
(
object1
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)).
equalsIgnoreCase
(
"no data found"
)){
searchBy_barcode
.
setText
(
""
);
searchBy_barcode
.
setText
(
""
);
searchByBarcode_rack
.
setText
(
object1
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
searchByBarcode_rack
.
setText
(
object1
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
//Constants.getToast(SearchByBarcode.this, object.getString(getResources().getString(R.string.msg)));
//Constants.getToast(SearchByBarcode.this, object.getString(getResources().getString(R.string.msg)));
}
else
{
}
else
{
searchBy_barcode
.
setText
(
""
);
searchBy_barcode
.
setText
(
""
);
try
{
try
{
JSONObject
jsonObject
=
object1
.
getJSONObject
(
getResources
().
getString
(
R
.
string
.
data
));
JSONObject
jsonObject
=
object1
.
getJSONObject
(
getResources
().
getString
(
R
.
string
.
data
));
searchByBarcode_rack
.
setText
(
Html
.
fromHtml
(
Constants
.
Id
)
+
jsonObject
.
getString
(
"rack_id"
)
+
"\n"
if
(
jsonObject
.
has
(
"rack_info"
))
{
+
(
Html
.
fromHtml
(
Constants
.
Barcode
)
+
jsonObject
.
getString
(
"barcode"
))
+
"\n"
JSONArray
rackInfoArray
=
jsonObject
.
getJSONArray
(
"rack_info"
);
+
(
Html
.
fromHtml
(
Constants
.
From
)
+
jsonObject
.
getString
(
"scanning_start_at"
))
+
"\n"
if
(
rackInfoArray
.
length
()
>
0
)
{
+
(
Html
.
fromHtml
(
Constants
.
To
)
+
jsonObject
.
getString
(
"scanning_end_at"
)));
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
){
}
catch
(
JSONException
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -152,13 +176,13 @@ import static w.soulofpluto.stockauditean.Constants.getDateWithOffset;
...
@@ -152,13 +176,13 @@ import static w.soulofpluto.stockauditean.Constants.getDateWithOffset;
}
}
});
});
}
else
{
}
else
{
runOnUiThread
(()
->
{
runOnUiThread
(()
->
{
try
{
try
{
Constants
.
getToast
(
SearchByBarcode
.
this
,
object1
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
Constants
.
getToast
(
SearchByBarcode
.
this
,
object1
.
getString
(
getResources
().
getString
(
R
.
string
.
msg
)));
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
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 @@
...
@@ -29,7 +29,7 @@
android:id=
"@+id/plandetails_id"
android:id=
"@+id/plandetails_id"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"
3
dp"
android:layout_margin=
"
5
dp"
android:textColor=
"@android:color/black"
android:textColor=
"@android:color/black"
style=
"@style/textfont"
style=
"@style/textfont"
/>
/>
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
android:id=
"@+id/plandetails_name"
android:id=
"@+id/plandetails_name"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"
3
dp"
android:layout_margin=
"
5
dp"
android:textColor=
"@android:color/black"
android:textColor=
"@android:color/black"
style=
"@style/textfont"
style=
"@style/textfont"
/>
/>
...
@@ -71,7 +71,8 @@
...
@@ -71,7 +71,8 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
android:weightSum=
"1"
>
android:weightSum=
"1"
android:layout_margin=
"5dp"
>
<androidx.appcompat.widget.AppCompatRadioButton
<androidx.appcompat.widget.AppCompatRadioButton
android:id=
"@+id/pieces"
android:id=
"@+id/pieces"
...
@@ -167,7 +168,8 @@
...
@@ -167,7 +168,8 @@
android:hint=
"TG21489489"
android:hint=
"TG21489489"
android:layout_alignParentLeft=
"true"
android:layout_alignParentLeft=
"true"
android:maxLines=
"2"
android:maxLines=
"2"
android:layout_marginTop=
"5dp"
android:layout_margin=
"5dp"
android:inputType=
"number"
style=
"@style/textfont"
/>
style=
"@style/textfont"
/>
<LinearLayout
<LinearLayout
...
@@ -175,13 +177,13 @@
...
@@ -175,13 +177,13 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
android:weightSum=
"1"
android:weightSum=
"1"
android:layout_margin=
"
3
dp"
>
android:layout_margin=
"
5
dp"
>
<androidx.appcompat.widget.AppCompatTextView
<androidx.appcompat.widget.AppCompatTextView
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/barcode"
android:text=
"@string/barcode"
android:layout_weight=
"0.
33
"
android:layout_weight=
"0.
40
"
android:textColor=
"@android:color/black"
android:textColor=
"@android:color/black"
style=
"@style/headerfont"
/>
style=
"@style/headerfont"
/>
...
@@ -189,14 +191,14 @@
...
@@ -189,14 +191,14 @@
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/qty"
android:text=
"@string/qty"
android:layout_weight=
"0.3
3
"
android:layout_weight=
"0.3
0
"
android:textColor=
"@android:color/black"
android:textColor=
"@android:color/black"
style=
"@style/headerfont"
/>
style=
"@style/headerfont"
/>
<androidx.appcompat.widget.AppCompatTextView
<androidx.appcompat.widget.AppCompatTextView
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3
3
"
android:layout_weight=
"0.3
0
"
android:textColor=
"@android:color/black"
/>
android:textColor=
"@android:color/black"
/>
</LinearLayout>
</LinearLayout>
...
...
app/src/main/res/layout/plansdetails_item.xml
View file @
e542492b
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
android:id=
"@+id/plandetails_barcode"
android:id=
"@+id/plandetails_barcode"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.
33
"
android:layout_weight=
"0.
40
"
android:textColor=
"@android:color/black"
android:textColor=
"@android:color/black"
style=
"@style/textfont"
style=
"@style/textfont"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
android:id=
"@+id/plandetails_qty"
android:id=
"@+id/plandetails_qty"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3
3
"
android:layout_weight=
"0.3
0
"
android:textColor=
"@android:color/black"
android:textColor=
"@android:color/black"
style=
"@style/textfont"
style=
"@style/textfont"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<RelativeLayout
<RelativeLayout
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3
3
"
android:layout_weight=
"0.3
0
"
android:gravity=
"center"
>
android:gravity=
"center"
>
<ImageView
<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