Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
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
quanku
qk_backend
Commits
e6c90db4
Commit
e6c90db4
authored
Aug 16, 2023
by
muhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 小程序首页和发布
parent
a6203e26
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
18 deletions
+23
-18
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FootPrintServiceImpl.java
...c/main/java/com/wwdz/ch/wx/impl/FootPrintServiceImpl.java
+10
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
+7
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxFootprintController.java
...c/main/java/com/wwdz/ch/wx/web/WxFootprintController.java
+0
-10
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxItemController.java
...pi/src/main/java/com/wwdz/ch/wx/web/WxItemController.java
+6
-6
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FootPrintServiceImpl.java
View file @
e6c90db4
package
com.wwdz.ch.wx.impl
;
package
com.wwdz.ch.wx.impl
;
import
com.wwdz.ch.core.consts.CommonEnum
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dao.FavoritesItemsRelationDao
;
import
com.wwdz.ch.db.dao.FavoritesItemsRelationDao
;
import
com.wwdz.ch.db.dao.FootPrintDao
;
import
com.wwdz.ch.db.dao.FootPrintDao
;
import
com.wwdz.ch.db.dao.ItemDao
;
import
com.wwdz.ch.db.dao.ItemDao
;
import
com.wwdz.ch.db.dao.UserItemsRelationDao
;
import
com.wwdz.ch.db.domain.Footprint
;
import
com.wwdz.ch.db.domain.Footprint
;
import
com.wwdz.ch.db.domain.Item
;
import
com.wwdz.ch.db.domain.Item
;
import
com.wwdz.ch.wx.entity.request.FootPrintRequestDto
;
import
com.wwdz.ch.wx.entity.request.FootPrintRequestDto
;
...
@@ -31,6 +33,8 @@ public class FootPrintServiceImpl implements FootPrintService {
...
@@ -31,6 +33,8 @@ public class FootPrintServiceImpl implements FootPrintService {
private
ItemDao
itemDao
;
private
ItemDao
itemDao
;
@Autowired
@Autowired
private
FavoritesItemsRelationDao
favoritesItemsRelationDao
;
private
FavoritesItemsRelationDao
favoritesItemsRelationDao
;
@Autowired
private
UserItemsRelationDao
userItemsRelationDao
;
@Override
@Override
public
Result
listAll
(
FootPrintRequestDto
dto
)
{
public
Result
listAll
(
FootPrintRequestDto
dto
)
{
...
@@ -160,7 +164,12 @@ public class FootPrintServiceImpl implements FootPrintService {
...
@@ -160,7 +164,12 @@ public class FootPrintServiceImpl implements FootPrintService {
itemResponseVo
.
setDetail
(
item
.
getDetail
());
itemResponseVo
.
setDetail
(
item
.
getDetail
());
itemResponseVo
.
setPrice
(
String
.
valueOf
(
item
.
getPrice
()
/
100
));
itemResponseVo
.
setPrice
(
String
.
valueOf
(
item
.
getPrice
()
/
100
));
itemResponseVo
.
setIsCollected
(
favoritesItemsRelationDao
.
isCollected
(
dto
.
getUserId
(),
footprint
.
getItemId
())
?
1
:
0
);
itemResponseVo
.
setIsCollected
(
favoritesItemsRelationDao
.
isCollected
(
dto
.
getUserId
(),
footprint
.
getItemId
())
?
1
:
0
);
itemResponseVo
.
setCollectCount
(
favoritesItemsRelationDao
.
countByItemId
(
footprint
.
getItemId
()));
itemResponseVo
.
setIsMine
(
userItemsRelationDao
.
isExisted
(
dto
.
getUserId
(),
item
.
getId
())
?
1
:
0
);
long
count
=
favoritesItemsRelationDao
.
countByItemId
(
item
.
getId
());
if
(
item
.
getSourceType
().
equals
(
CommonEnum
.
SourceTypeEnum
.
USER_UPLOAD
.
getCode
()))
{
count
--;
}
itemResponseVo
.
setCollectCount
(
count
);
if
(
footprint
.
getAddTime
().
compareTo
(
today
)
>=
0
)
{
if
(
footprint
.
getAddTime
().
compareTo
(
today
)
>=
0
)
{
todayList
.
add
(
itemResponseVo
);
todayList
.
add
(
itemResponseVo
);
}
}
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
View file @
e6c90db4
...
@@ -93,9 +93,10 @@ public class ItemServiceImpl implements ItemService {
...
@@ -93,9 +93,10 @@ public class ItemServiceImpl implements ItemService {
ItemResponseVo
vo
=
new
ItemResponseVo
();
ItemResponseVo
vo
=
new
ItemResponseVo
();
vo
.
setId
(
item
.
getId
());
vo
.
setId
(
item
.
getId
());
vo
.
setName
(
item
.
getName
());
vo
.
setName
(
item
.
getName
());
vo
.
setPrice
(
String
.
valueOf
(
item
.
getPrice
()
*
100
));
vo
.
setPrice
(
String
.
valueOf
(
item
.
getPrice
()
/
100
));
vo
.
setDetail
(
item
.
getDetail
());
vo
.
setDetail
(
item
.
getDetail
());
vo
.
setIsCollected
(
0
);
vo
.
setIsCollected
(
0
);
vo
.
setIsMine
(
0
);
vo
.
setImages
(
item
.
getImages
());
vo
.
setImages
(
item
.
getImages
());
Map
<
String
,
Object
>
homePageMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
homePageMap
=
new
HashMap
<>();
if
(
StringUtils
.
isNotBlank
(
item
.
getVedios
()))
{
if
(
StringUtils
.
isNotBlank
(
item
.
getVedios
()))
{
...
@@ -112,6 +113,11 @@ public class ItemServiceImpl implements ItemService {
...
@@ -112,6 +113,11 @@ public class ItemServiceImpl implements ItemService {
homePageMap
=
getImageMap
(
image
[
0
]);
homePageMap
=
getImageMap
(
image
[
0
]);
homePageMap
.
put
(
"url"
,
image
[
0
]);
homePageMap
.
put
(
"url"
,
image
[
0
]);
homePageMap
.
put
(
"type"
,
2
);
homePageMap
.
put
(
"type"
,
2
);
}
else
{
homePageMap
.
put
(
"type"
,
2
);
homePageMap
.
put
(
"url"
,
image
[
0
]);
homePageMap
.
put
(
"width"
,
"0"
);
homePageMap
.
put
(
"height"
,
"0"
);
}
}
}
}
vo
.
setHomePageImage
(
homePageMap
);
vo
.
setHomePageImage
(
homePageMap
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxFootprintController.java
View file @
e6c90db4
...
@@ -145,16 +145,6 @@ public class WxFootprintController {
...
@@ -145,16 +145,6 @@ public class WxFootprintController {
return
Result
.
failed
(
"页面大小不能为空"
);
return
Result
.
failed
(
"页面大小不能为空"
);
}
}
if
(
StringUtils
.
isBlank
(
userId
))
{
return
Result
.
failed
(
"用户id不能为空"
);
}
if
(
StringUtils
.
isBlank
(
page
))
{
return
Result
.
failed
(
"当前页不能为空"
);
}
if
(
StringUtils
.
isBlank
(
size
))
{
return
Result
.
failed
(
"页面大小不能为空"
);
}
FootPrintRequestDto
dto
=
new
FootPrintRequestDto
();
FootPrintRequestDto
dto
=
new
FootPrintRequestDto
();
dto
.
setUserId
(
Long
.
parseLong
(
userId
));
dto
.
setUserId
(
Long
.
parseLong
(
userId
));
dto
.
setPage
(
Integer
.
parseInt
(
page
));
dto
.
setPage
(
Integer
.
parseInt
(
page
));
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxItemController.java
View file @
e6c90db4
...
@@ -100,9 +100,6 @@ public class WxItemController {
...
@@ -100,9 +100,6 @@ public class WxItemController {
if
(
StringUtils
.
isBlank
(
name
))
{
if
(
StringUtils
.
isBlank
(
name
))
{
return
Result
.
failed
(
"标题不能为空"
);
return
Result
.
failed
(
"标题不能为空"
);
}
}
if
(
StringUtils
.
isBlank
(
price
))
{
return
Result
.
failed
(
"价格不能为空"
);
}
if
(
StringUtils
.
isBlank
(
images
))
{
if
(
StringUtils
.
isBlank
(
images
))
{
return
Result
.
failed
(
"图片不能为空"
);
return
Result
.
failed
(
"图片不能为空"
);
}
}
...
@@ -118,6 +115,9 @@ public class WxItemController {
...
@@ -118,6 +115,9 @@ public class WxItemController {
dto
.
setFavoritesId
(
Long
.
parseLong
(
favoritesId
));
dto
.
setFavoritesId
(
Long
.
parseLong
(
favoritesId
));
dto
.
setImages
(
images
);
dto
.
setImages
(
images
);
dto
.
setVideos
(
videos
);
dto
.
setVideos
(
videos
);
if
(
StringUtils
.
isBlank
(
price
))
{
price
=
"0"
;
}
dto
.
setPrice
(
price
);
dto
.
setPrice
(
price
);
return
itemService
.
add
(
dto
);
return
itemService
.
add
(
dto
);
}
}
...
@@ -148,9 +148,6 @@ public class WxItemController {
...
@@ -148,9 +148,6 @@ public class WxItemController {
if
(
StringUtils
.
isBlank
(
name
))
{
if
(
StringUtils
.
isBlank
(
name
))
{
return
Result
.
failed
(
"标题不能为空"
);
return
Result
.
failed
(
"标题不能为空"
);
}
}
if
(
StringUtils
.
isBlank
(
price
))
{
return
Result
.
failed
(
"价格不能为空"
);
}
if
(
StringUtils
.
isBlank
(
images
))
{
if
(
StringUtils
.
isBlank
(
images
))
{
return
Result
.
failed
(
"图片不能为空"
);
return
Result
.
failed
(
"图片不能为空"
);
}
}
...
@@ -167,6 +164,9 @@ public class WxItemController {
...
@@ -167,6 +164,9 @@ public class WxItemController {
dto
.
setFavoritesId
(
Long
.
parseLong
(
favoritesId
));
dto
.
setFavoritesId
(
Long
.
parseLong
(
favoritesId
));
dto
.
setImages
(
images
);
dto
.
setImages
(
images
);
dto
.
setVideos
(
videos
);
dto
.
setVideos
(
videos
);
if
(
StringUtils
.
isBlank
(
price
))
{
price
=
"0"
;
}
dto
.
setPrice
(
price
);
dto
.
setPrice
(
price
);
return
itemService
.
update
(
dto
);
return
itemService
.
update
(
dto
);
}
}
...
...
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