Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
Ecsite
Project
Project
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
shoei.kanno
Ecsite
Commits
5f73c2ba
Commit
5f73c2ba
authored
Oct 21, 2020
by
keita.onoguchi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'カート編集' into 'master'
カート編集 See merge request
!65
parents
f7a017cb
5981258d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
13 deletions
+18
-13
EcsiteRestController.java
src/main/java/com/example/api/EcsiteRestController.java
+5
-0
EcsiteController.java
src/main/java/com/example/web/EcsiteController.java
+7
-7
cart.html
src/main/resources/templates/cart.html
+1
-1
log.html
src/main/resources/templates/log.html
+4
-4
logDetails.html
src/main/resources/templates/logDetails.html
+1
-1
No files found.
src/main/java/com/example/api/EcsiteRestController.java
View file @
5f73c2ba
...
...
@@ -129,6 +129,11 @@ public class EcsiteRestController {
}
else
{
cart
.
put
(
id
,
itemsService
.
findOne
(
data
.
getShoesId
(),
data
.
getQuantity
()));
}
if
(
cart
.
size
()
==
0
)
{
session
.
removeAttribute
(
"cart"
);
session
.
removeAttribute
(
"cartValue"
);
return
cart
;
}
session
.
setAttribute
(
"cart"
,
cart
);
return
cart
;
}
...
...
src/main/java/com/example/web/EcsiteController.java
View file @
5f73c2ba
...
...
@@ -131,13 +131,13 @@ public class EcsiteController {
public
String
history
(
@PathVariable
Integer
id
,
Model
model
,
SalesLog
salesLog
,
@AuthenticationPrincipal
LoginUser
userDetails
)
{
User
user
=
userDetails
.
getUser
();
model
.
addAttribute
(
"user"
,
user
);
List
<
SalesLog
>
list
=
salesLogService
.
history
(
id
);
model
.
addAttribute
(
"log"
,
list
);
if
(
session
.
getAttribute
(
"cartValue"
)
==
null
)
{
model
.
addAttribute
(
"cartValue"
,
0
);
}
else
{
model
.
addAttribute
(
"cartValue"
,
session
.
getAttribute
(
"cartValue"
));
}
List
<
SalesLog
>
list
=
salesLogService
.
history
(
id
);
model
.
addAttribute
(
"log"
,
list
);
return
"log"
;
}
...
...
@@ -146,16 +146,16 @@ public class EcsiteController {
public
String
historyDetails
(
@PathVariable
Date
created
,
Model
model
,
@AuthenticationPrincipal
LoginUser
userDetails
)
{
User
user
=
userDetails
.
getUser
();
model
.
addAttribute
(
"user"
,
user
);
if
(
salesLogService
.
historyDetails
(
created
,
user
.
getId
())
==
null
){
return
"logDetails"
;
}
List
<
SalesLog
>
list
=
salesLogService
.
historyDetails
(
created
,
user
.
getId
());
model
.
addAttribute
(
"logDetails"
,
list
);
if
(
session
.
getAttribute
(
"cartValue"
)
==
null
)
{
model
.
addAttribute
(
"cartValue"
,
0
);
}
else
{
model
.
addAttribute
(
"cartValue"
,
session
.
getAttribute
(
"cartValue"
));
}
if
(
salesLogService
.
historyDetails
(
created
,
user
.
getId
())
==
null
){
return
"logDetails"
;
}
List
<
SalesLog
>
list
=
salesLogService
.
historyDetails
(
created
,
user
.
getId
());
model
.
addAttribute
(
"logDetails"
,
list
);
return
"logDetails"
;
}
...
...
src/main/resources/templates/cart.html
View file @
5f73c2ba
...
...
@@ -115,7 +115,7 @@
<td
class=
"tdCart"
><p
th:text=
"${cart.shoesName}"
class=
"textP"
>
Convers All Star
</p></td>
<td
class=
"tdCart"
><input
type=
"number"
min=
"0"
th:value=
"${cart.quantity}"
class=
"textP itemCount"
></input></td>
<td
class=
"tdCart"
><p
th:text=
"${cart.price}"
class=
"textP"
>
¥
10000
</p></td>
<td
class=
"tdCart"
><button
type=
"button"
class=
"itemCountChange"
>
数変更確定
</button></td>
<td
class=
"tdCart"
><button
type=
"button"
class=
"itemCountChange"
>
Change
</button></td>
</tr>
</div>
</tbody>
...
...
src/main/resources/templates/log.html
View file @
5f73c2ba
<!doctype html>
<html
class=
"no-js"
lang=
"
en
"
xmlns:th=
"http://www.thymeleaf.org"
>
<html
class=
"no-js"
lang=
"
ja
"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
/>
...
...
@@ -70,8 +70,8 @@
</ul>
<ul
class=
"nav navbar-nav navbar-right cart-menu"
>
<li><a
class=
"search-btn"
><i
class=
"fa fa-search"
aria-hidden=
"true"
></i></a></li>
<li><a
th:href=
"@{/limited/cart}"
><span>
Cart
</span>
<span
class=
"shoping-cart"
th:text=
"${cartValue}"
>
0
</span></a></li>
</ul>
<li><a
th:href=
"@{/limited/cart}"
><span>
Cart
</span>
<span
class=
"shoping-cart"
id=
"shoping-cart-span"
th:text=
"${cartValue}"
>
0
</span></a></li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
...
...
@@ -79,7 +79,7 @@
<!-- ログインフォーム -->
<div
class=
"container"
>
<p
id=
"log-p-text"
><span
id=
"log-text"
>
Purchase History
</span></p>
<p
id=
"log-p-text"
><span
id=
"log-text"
>
Purchase History
</span></p>
<!--<form id="login-form" method="post" th:action="@{/login}">
<div id="email-form">
<label for="login-email">Email</label>
...
...
src/main/resources/templates/logDetails.html
View file @
5f73c2ba
...
...
@@ -70,7 +70,7 @@
</ul>
<ul
class=
"nav navbar-nav navbar-right cart-menu"
>
<li><a
class=
"search-btn"
><i
class=
"fa fa-search"
aria-hidden=
"true"
></i></a></li>
<li><a
th:href=
"@{/limited/cart}"
><span>
Cart
</span>
<span
class=
"shoping-cart"
th:text=
"${cartValue}"
>
0
</span></a></li>
<li
class=
"active"
><a
th:href=
"@{/limited/cart}"
><span>
Cart
</span>
<span
class=
"shoping-cart"
th:text=
"${cartValue}"
>
0
</span></a></li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
...
...
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