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
53dec052
Commit
53dec052
authored
Aug 25, 2023
by
muhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 小程序足迹
parent
7b350b97
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
15 deletions
+62
-15
ch-dao/src/main/java/com/wwdz/ch/db/dao/FootPrintDao.java
ch-dao/src/main/java/com/wwdz/ch/db/dao/FootPrintDao.java
+2
-1
ch-dao/src/main/java/com/wwdz/ch/db/impl/FootPrintDaoImpl.java
...o/src/main/java/com/wwdz/ch/db/impl/FootPrintDaoImpl.java
+4
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/constant/CacheCodeConstants.java
...main/java/com/wwdz/ch/wx/constant/CacheCodeConstants.java
+6
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FootPrintServiceImpl.java
...c/main/java/com/wwdz/ch/wx/impl/FootPrintServiceImpl.java
+15
-12
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
+17
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/UserService.java
...api/src/main/java/com/wwdz/ch/wx/service/UserService.java
+8
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxUserController.java
...pi/src/main/java/com/wwdz/ch/wx/web/WxUserController.java
+10
-0
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/dao/FootPrintDao.java
View file @
53dec052
package
com.wwdz.ch.db.dao
;
import
com.github.pagehelper.PageInfo
;
import
com.wwdz.ch.db.domain.Footprint
;
import
java.util.List
;
...
...
@@ -21,7 +22,7 @@ public interface FootPrintDao {
* @param size
* @return
*/
List
<
Footprint
>
pageByUserId
(
Long
userId
,
Integer
page
,
Integer
size
);
PageInfo
<
Footprint
>
pageByUserId
(
Long
userId
,
Integer
page
,
Integer
size
);
/**
* 通过用户id统计记录数
...
...
ch-dao/src/main/java/com/wwdz/ch/db/impl/FootPrintDaoImpl.java
View file @
53dec052
package
com.wwdz.ch.db.impl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.wwdz.ch.db.dao.FootPrintDao
;
import
com.wwdz.ch.db.domain.Footprint
;
import
com.wwdz.ch.db.domain.FootprintExample
;
...
...
@@ -27,14 +28,15 @@ public class FootPrintDaoImpl implements FootPrintDao {
}
@Override
public
List
<
Footprint
>
pageByUserId
(
Long
userId
,
Integer
page
,
Integer
size
)
{
public
PageInfo
<
Footprint
>
pageByUserId
(
Long
userId
,
Integer
page
,
Integer
size
)
{
FootprintExample
example
=
new
FootprintExample
();
FootprintExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andDeletedEqualTo
(
false
);
example
.
orderBy
(
"update_time desc"
);
PageHelper
.
startPage
(
page
,
size
);
return
footprintMapper
.
selectByExample
(
example
);
List
<
Footprint
>
list
=
footprintMapper
.
selectByExample
(
example
);
return
new
PageInfo
<>(
list
);
}
@Override
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/constant/CacheCodeConstants.java
View file @
53dec052
...
...
@@ -21,6 +21,12 @@ public class CacheCodeConstants {
*/
public
static
final
String
USER_UPDATE_SMS_KEY
=
"cjxc:wx:user:sms:update:{0}"
;
/**
* 缓存用户信息
* <p>{0}:用户id</p>
*/
public
static
final
String
USER_INFO_KEY
=
"cjxc:wx:user:info:{0}"
;
/**
* 短信验证码类型枚举
*/
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FootPrintServiceImpl.java
View file @
53dec052
package
com.wwdz.ch.wx.impl
;
import
com.github.pagehelper.PageInfo
;
import
com.wwdz.ch.core.consts.CommonEnum
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dao.FavoritesItemsRelationDao
;
...
...
@@ -40,19 +41,21 @@ public class FootPrintServiceImpl implements FootPrintService {
@Override
public
Result
page
(
FootPrintRequestDto
dto
)
{
try
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"pageNum"
,
dto
.
getPage
());
map
.
put
(
"pageSize"
,
dto
.
getSize
());
map
.
put
(
"total"
,
0
);
map
.
put
(
"list"
,
new
ArrayList
<>());
PageInfo
<
AgentTranceResponseVo
>
result
=
new
PageInfo
<>();
result
.
setPageNum
(
dto
.
getPage
());
result
.
setPageSize
(
dto
.
getSize
());
result
.
setTotal
(
0L
);
result
.
setList
(
new
ArrayList
<>());
result
.
setHasNextPage
(
false
);
List
<
AgentTranceResponseVo
>
resultList
=
new
ArrayList
<>();
List
<
Footprint
>
list
=
footPrintDao
.
pageByUserId
(
dto
.
getUserId
(),
dto
.
getPage
(),
dto
.
getSize
());
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
Result
.
success
(
map
);
PageInfo
<
Footprint
>
page
=
footPrintDao
.
pageByUserId
(
dto
.
getUserId
(),
dto
.
getPage
(),
dto
.
getSize
());
if
(
CollectionUtils
.
isEmpty
(
page
.
getList
()))
{
return
Result
.
success
(
result
);
}
map
.
put
(
"total"
,
footPrintDao
.
countByUserId
(
dto
.
getUserId
()));
result
.
setTotal
(
page
.
getTotal
());
result
.
setHasNextPage
(
page
.
isHasNextPage
());
List
<
AgentTranceResponseVo
>
resultList
=
new
ArrayList
<>();
// 现在
Date
now
=
new
Date
();
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
...
...
@@ -72,7 +75,7 @@ public class FootPrintServiceImpl implements FootPrintService {
calendar
.
setTime
(
now
);
calendar
.
add
(
Calendar
.
MONTH
,
-
1
);
Date
month
=
calendar
.
getTime
();
for
(
Footprint
footprint
:
list
)
{
for
(
Footprint
footprint
:
page
.
getList
()
)
{
ItemResponseVo
itemResponseVo
=
new
ItemResponseVo
();
Item
item
=
itemDao
.
findDetails
(
footprint
.
getItemId
());
// 设置基本信息
...
...
@@ -112,7 +115,7 @@ public class FootPrintServiceImpl implements FootPrintService {
agentTranceResponseVo
.
setDetail
(
itemResponseVo
);
resultList
.
add
(
agentTranceResponseVo
);
}
result
.
setList
(
resultList
);
logger
.
info
(
"【请求结束】用户足迹分页查询成功"
);
return
Result
.
success
(
resultList
);
}
catch
(
Exception
e
)
{
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
View file @
53dec052
...
...
@@ -426,4 +426,21 @@ public class UserServiceImpl implements UserService {
return
Result
.
failed
(
"修改手机号失败"
);
}
}
@Override
public
Result
userInfo
(
UserRequestDto
dto
)
{
try
{
User
user
=
null
;
// String key = MessageFormat.format(CacheCodeConstants.USER_INFO_KEY, dto.getUserId().toString());
// if (redisUtil.hasKey(key)) {
// user = (User) redisUtil.get(key);
// } else {
user
=
userDao
.
queryById
(
dto
.
getUserId
());
// }
return
Result
.
success
(
user
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询用户信息失败"
,
e
);
return
Result
.
failed
(
"查询用户信息失败"
);
}
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/UserService.java
View file @
53dec052
...
...
@@ -71,4 +71,12 @@ public interface UserService {
* @return
*/
Result
updateMobile
(
UserRequestDto
dto
);
/**
* 查询用户信息
*
* @param dto
* @return
*/
Result
userInfo
(
UserRequestDto
dto
);
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxUserController.java
View file @
53dec052
...
...
@@ -155,4 +155,14 @@ public class WxUserController {
}
return
userService
.
updateMobile
(
dto
);
}
@ApiOperation
(
value
=
"用户信息"
)
@PostMapping
(
"/userInfo"
)
public
Result
userInfo
(
@RequestBody
UserRequestDto
dto
)
{
logger
.
info
(
"【请求开始】查询用户信息,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
Objects
.
isNull
(
dto
.
getUserId
())
||
dto
.
getUserId
().
equals
(
0L
))
{
return
Result
.
failed
(
"用户id不能为空"
);
}
return
userService
.
userInfo
(
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