Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-257
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-257
2022-257
Commits
4507c24f
Commit
4507c24f
authored
Nov 14, 2022
by
it19048642@my.sllit.lk
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'IT19023410' of
http://gitlab.sliit.lk/2022-257/2022-257
into IT19048642
parents
43b8b723
1078167d
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
741 additions
and
17 deletions
+741
-17
Backend/src/controller/pharmacy.controller.js
Backend/src/controller/pharmacy.controller.js
+2
-2
bussifinder/src/App.js
bussifinder/src/App.js
+2
-0
bussifinder/src/components/MultipleResult.js
bussifinder/src/components/MultipleResult.js
+4
-0
bussifinder/src/components/PharmacyInputs/InputDetails.js
bussifinder/src/components/PharmacyInputs/InputDetails.js
+25
-13
bussifinder/src/components/PharmacyInputs/MultupleResultsP.js
...ifinder/src/components/PharmacyInputs/MultupleResultsP.js
+551
-0
bussifinder/src/components/Results.js
bussifinder/src/components/Results.js
+157
-2
No files found.
Backend/src/controller/pharmacy.controller.js
View file @
4507c24f
...
...
@@ -68,13 +68,13 @@ const getDistanceToBusStation = async (req, res) => {
var
config
=
{
method
:
'
get
'
,
url
:
`https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=bus station&location=
${
latitude
}
,
${
longitude
}
&radius=
10
000&type=bus station&keyword=&key=
${
process
.
env
.
API_KEY_SECRET
}
`
,
url
:
`https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=bus station&location=
${
latitude
}
,
${
longitude
}
&radius=
6
000&type=bus station&keyword=&key=
${
process
.
env
.
API_KEY_SECRET
}
`
,
headers
:
{
}
};
axios
(
config
)
.
then
(
function
(
response
)
{
console
.
log
(
"
23232xcc
"
,
response
.
data
.
results
)
//
console.log("23232xcc",response.data.results)
let
newlongitude
=
response
.
data
.
results
[
0
].
geometry
.
location
.
lat
;
let
newlatitude
=
response
.
data
.
results
[
0
].
geometry
.
location
.
lng
;
console
.
log
(
"
Nearest Bus station latitude:
"
,
newlatitude
);
...
...
bussifinder/src/App.js
View file @
4507c24f
...
...
@@ -27,6 +27,7 @@ import InputGroceryDetails from './components/InputGroceryDetails';
import
MultipleResult
from
'
./components/MultipleResult
'
;
import
ResultsWOTypes
from
'
./components/ResultsWOTypes
'
;
import
LocationBasedPredict
from
'
./components/LocationBasedPredict
'
;
import
MultipleResultP
from
'
./components/PharmacyInputs/MultupleResultsP
'
;
import
MultipleResultG
from
'
./components/Grocery Input/MultipleResultG
'
import
FactorDetails
from
'
./components/FactorDetails
'
;
import
AdminDashboard
from
'
./components/Admin/AdminDashboard
'
;
...
...
@@ -65,6 +66,7 @@ function App() {
<
Route
path
=
"
/resultWOTypes
"
element
=
{
<
ResultsWOTypes
/>
}
/
>
<
Route
path
=
"
/Service
"
element
=
{
<
BusinessTypePage
/>
}
/
>
<
Route
path
=
"
/locationBasedPredict
"
element
=
{
<
LocationBasedPredict
/>
}
/
>
<
Route
path
=
"
/pmultipleResult
"
element
=
{
<
MultipleResultP
/>
}
/
>
<
Route
path
=
"
/multipleResultG
"
element
=
{
<
MultipleResultG
/>
}
/
>
<
Route
path
=
"
/Factor%20Details
"
element
=
{
<
FactorDetails
/>
}
/
>
<
Route
path
=
"
/AdminDashboard
"
element
=
{
<
AdminDashboard
/>
}
/
>
...
...
bussifinder/src/components/MultipleResult.js
View file @
4507c24f
...
...
@@ -184,6 +184,9 @@ const MultipleResult = () => {
}
else
if
(
businessDetails
.
value
[
businessDetails
.
value
.
length
-
1
].
type
==
'
restaurant
'
)
{
dispatch
(
addBusiness
({
'
type
'
:
'
restaurant
'
}))
navigate
(
'
/inputHotel
'
);
}
else
if
(
businessDetails
.
value
[
businessDetails
.
value
.
length
-
1
].
type
==
'
pharmacy
'
)
{
dispatch
(
addBusiness
({
'
type
'
:
'
pharmacy
'
}))
navigate
(
'
/inputPharmacy
'
);
}
else
if
(
businessDetails
.
value
[
businessDetails
.
value
.
length
-
1
].
type
==
'
grocery
'
)
{
dispatch
(
addBusiness
({
'
type
'
:
'
grocery
'
}))
...
...
@@ -192,6 +195,7 @@ const MultipleResult = () => {
}
return
(
<
Box
...
...
bussifinder/src/components/PharmacyInputs/InputDetails.js
View file @
4507c24f
...
...
@@ -92,15 +92,16 @@ export default function InputDetails() {
API
.
post
(
'
pharmacy/distanceToBStation
'
,
body
).
then
((
distanceToBusStationResult
)
=>
{
console
.
log
(
"
inside distance to bus
"
)
// let busStationDistance = "0";
let
busStationDistance
=
distanceToBusStationResult
.
data
.
distance
;
if
(
distanceToBusStationResult
.
data
.
distance
===
"
undefined
"
){
busStationDistance
=
"
200
"
;
}
else
{
busStationDistance
=
distanceToBusStationResult
.
data
.
distance
;
}
// if((busStationDistance === "0") || (busStationDistance === " ")
){
//
busStationDistance = "200";
//
}else{
//
busStationDistance = distanceToBusStationResult.data.distance;
//
}
//
console.log("bus distance",busStationDistance);
console
.
log
(
"
bus distance
"
,
busStationDistance
);
let
pharmacyObj
=
{
"
medicalPlaces
"
:
medicalPlacesCount
,
...
...
@@ -113,19 +114,30 @@ export default function InputDetails() {
"
cardPay
"
:
businessDetails
.
value
[
0
].
serviceDetails
.
card
?
1
:
0
,
}
let
pharmacyL
ocationFeatures
=
{
let
l
ocationFeatures
=
{
medicalPlacesCount
:
medicalPlacesCount
,
busStationDistance
:
busStationDistance
busStationDistance
:
busStationDistance
,
OpenHours
:
businessDetails
.
value
[
0
].
serviceDetails
.
open
?
"
Available
"
:
"
Unavailable
"
,
deliver
:
businessDetails
.
value
[
0
].
serviceDetails
.
deliver
?
"
Available
"
:
"
Unavailable
"
,
WhlChairEntrance
:
businessDetails
.
value
[
0
].
serviceDetails
.
whlentrence
?
"
Available
"
:
"
Unavailable
"
,
WhlChairPark
:
businessDetails
.
value
[
0
].
serviceDetails
.
whlpark
?
"
Available
"
:
"
Unavailable
"
,
cashPay
:
businessDetails
.
value
[
0
].
serviceDetails
.
cash
?
"
Available
"
:
"
Unavailable
"
,
cardPay
:
businessDetails
.
value
[
0
].
serviceDetails
.
card
?
"
Available
"
:
"
Unavailable
"
,
}
axios
.
post
(
'
http://127.0.0.1:5000/pharmacy
'
,
pharmacyObj
)
.
then
(
function
(
ML_
Result
)
{
console
.
log
(
"
R
esult Ml part
"
,
ML_Result
);
.
then
(
function
(
Pharmacy
Result
)
{
console
.
log
(
"
R
Prediction
"
,
PharmacyResult
.
data
);
dispatch
(
addBusiness
({
...
businessDetails
.
value
[
0
],
pharmacyLocationFeatures
:
pharmacyLocationFeatures
,
ml_result
:
ML_
Result
.
data
.
data
...
businessDetails
.
value
[
0
],
locationFeatures
:
locationFeatures
,
ml_result
:
Pharmacy
Result
.
data
.
data
}))
navigate
(
`/result`
)
//handleClose()
if
(
businessDetails
.
value
.
length
>
1
)
{
navigate
(
`/pmultipleResult`
)
}
else
{
navigate
(
`/result`
)}
handleClose
()
}).
catch
(
function
(
error
)
{
return
error
;
});
...
...
bussifinder/src/components/PharmacyInputs/MultupleResultsP.js
0 → 100644
View file @
4507c24f
This diff is collapsed.
Click to expand it.
bussifinder/src/components/Results.js
View file @
4507c24f
This diff is collapsed.
Click to expand it.
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