Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
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
徐少华
midjourney-proxy
Commits
344f7d3b
Commit
344f7d3b
authored
Aug 21, 2019
by
杨涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加接口给客户端
parent
6b90f1e2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
107 additions
and
9 deletions
+107
-9
WeixinClockBiz.java
.../java/com/pcloud/book/weixinclock/biz/WeixinClockBiz.java
+8
-1
WeixinClockBizImpl.java
.../pcloud/book/weixinclock/biz/impl/WeixinClockBizImpl.java
+23
-2
WeixinClockMemberDao.java
...com/pcloud/book/weixinclock/dao/WeixinClockMemberDao.java
+8
-0
WeixinClockMemberDaoImpl.java
...d/book/weixinclock/dao/impl/WeixinClockMemberDaoImpl.java
+13
-0
WeixinClockFacade.java
...com/pcloud/book/weixinclock/facade/WeixinClockFacade.java
+17
-2
WeixinClockFacadeImpl.java
...d/book/weixinclock/facade/impl/WeixinClockFacadeImpl.java
+21
-2
WeixinClockMember.Mapper.xml
...resources/mapper/weixinclock/WeixinClockMember.Mapper.xml
+17
-2
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/biz/WeixinClockBiz.java
View file @
344f7d3b
...
...
@@ -79,5 +79,12 @@ public interface WeixinClockBiz {
* @param wxGroupId
* @return
*/
List
<
RankDto
>
listWeixinClockRank
(
String
wxGroupId
,
String
wxUserId
);
PageBeanNew
<
RankDto
>
listWeixinClockRank
(
String
wxGroupId
,
String
wxUserId
,
Integer
currentPage
,
Integer
numPerPage
);
/**
* 获取某个群内某个用户的信息
* @param wxGroupId
* @return
*/
RankDto
getClockWechatUserRank
(
String
wxGroupId
,
String
wxUserId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/biz/impl/WeixinClockBizImpl.java
View file @
344f7d3b
...
...
@@ -511,8 +511,29 @@ public class WeixinClockBizImpl implements WeixinClockBiz {
*/
@Override
@ParamLog
(
"获取某个群内的打卡排行榜"
)
public
List
<
RankDto
>
listWeixinClockRank
(
String
wxGroupId
,
String
wxUserId
)
{
return
weixinClockMemberDao
.
listWeixinClockRank
(
wxGroupId
,
wxUserId
);
public
PageBeanNew
<
RankDto
>
listWeixinClockRank
(
String
wxGroupId
,
String
wxUserId
,
Integer
currentPage
,
Integer
numPerPage
)
{
PageParam
pageParam
=
new
PageParam
(
currentPage
,
numPerPage
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wxGroupId"
,
wxGroupId
);
map
.
put
(
"wxUserId"
,
wxUserId
);
PageBeanNew
<
RankDto
>
rankDtos
=
weixinClockMemberDao
.
listPageNew
(
pageParam
,
map
,
"listWeixinClockRank"
);
if
(
null
==
rankDtos
||
ListUtils
.
isEmpty
(
rankDtos
.
getRecordList
()))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
}
return
rankDtos
;
}
/**
* 获取某个群内某个用户的信息
* @param wxGroupId
* @param wxUserId
* @return
*/
@Override
@ParamLog
(
"获取某个群内某个用户的信息"
)
public
RankDto
getClockWechatUserRank
(
String
wxGroupId
,
String
wxUserId
)
{
RankDto
rankDto
=
weixinClockMemberDao
.
getClockWechatUserRank
(
wxGroupId
,
wxUserId
);
return
null
==
rankDto
?
new
RankDto
()
:
rankDto
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/WeixinClockMemberDao.java
View file @
344f7d3b
...
...
@@ -41,4 +41,12 @@ public interface WeixinClockMemberDao extends BaseDao<WeixinClockMember> {
* @return
*/
Integer
getMyNewOrder
(
String
wechatGroupId
,
String
userWxId
);
/**
* 获取某个群内某个用户的信息
* @param wxGroupId
* @param wxUserId
* @return
*/
RankDto
getClockWechatUserRank
(
String
wxGroupId
,
String
wxUserId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/impl/WeixinClockMemberDaoImpl.java
View file @
344f7d3b
...
...
@@ -70,4 +70,17 @@ public class WeixinClockMemberDaoImpl extends BaseDaoImpl<WeixinClockMember> imp
map
.
put
(
"userWxId"
,
userWxId
);
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getMyNewOrder"
),
map
);
}
/**
* 获取某个群内某个用户的信息
* @param wxGroupId
* @return
*/
@Override
public
RankDto
getClockWechatUserRank
(
String
wxGroupId
,
String
wxUserId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wxGroupId"
,
wxGroupId
);
map
.
put
(
"wxUserId"
,
wxUserId
);
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getClockWechatUserRank"
),
map
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/facade/WeixinClockFacade.java
View file @
344f7d3b
...
...
@@ -95,11 +95,26 @@ public interface WeixinClockFacade {
@ApiOperation
(
"获取某个群内的打卡排行榜"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userInfo"
,
value
=
"Cookie"
,
dataType
=
"string"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"wxGroupId"
,
value
=
"wxGroupId"
,
dataType
=
"string"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"wxUserId"
,
value
=
"wxUserId"
,
dataType
=
"string"
,
paramType
=
"query"
)})
@ApiImplicitParam
(
name
=
"wxUserId"
,
value
=
"wxUserId"
,
dataType
=
"string"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"currentPage"
,
value
=
"当前页"
,
dataType
=
"Integer"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"numPerPage"
,
value
=
"每页大小"
,
dataType
=
"Integer"
,
paramType
=
"query"
)})
@RequestMapping
(
value
=
"listWeixinClockRank"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
listWeixinClockRank
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"wxGroupId"
,
required
=
false
)
String
wxGroupId
,
@RequestParam
(
value
=
"wxUserId"
,
required
=
false
)
String
wxUserId
)
@RequestParam
(
value
=
"wxUserId"
,
required
=
false
)
String
wxUserId
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
false
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"获取某个群内某个用户的信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userInfo"
,
value
=
"Cookie"
,
dataType
=
"string"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"wxGroupId"
,
value
=
"wxGroupId"
,
dataType
=
"string"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"wxUserId"
,
value
=
"wxUserId"
,
dataType
=
"string"
,
paramType
=
"query"
)
})
@RequestMapping
(
value
=
"getClockWechatUserRank"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
getClockWechatUserRank
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"wxGroupId"
,
required
=
false
)
String
wxGroupId
,
@RequestParam
(
value
=
"wxUserId"
,
required
=
false
)
String
wxUserId
)
throws
BizException
,
PermissionException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/facade/impl/WeixinClockFacadeImpl.java
View file @
344f7d3b
...
...
@@ -179,10 +179,29 @@ public class WeixinClockFacadeImpl implements WeixinClockFacade {
@RequestMapping
(
value
=
"listWeixinClockRank"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
listWeixinClockRank
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"wxGroupId"
,
required
=
false
)
String
wxGroupId
,
@RequestParam
(
value
=
"wxUserId"
,
required
=
false
)
String
wxUserId
)
@RequestParam
(
value
=
"wxUserId"
,
required
=
false
)
String
wxUserId
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
false
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
weixinClockBiz
.
listWeixinClockRank
(
wxGroupId
,
wxUserId
));
return
new
ResponseDto
<>(
weixinClockBiz
.
listWeixinClockRank
(
wxGroupId
,
wxUserId
,
currentPage
,
numPerPage
));
}
/**
* 获取某个群内某个用户的信息
* @param userInfo
* @return
* @throws BizException
* @throws PermissionException
*/
@Override
@RequestMapping
(
value
=
"getClockWechatUserRank"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getClockWechatUserRank
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"wxGroupId"
,
required
=
false
)
String
wxGroupId
,
@RequestParam
(
value
=
"wxUserId"
,
required
=
false
)
String
wxUserId
)
throws
BizException
,
PermissionException
{
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
weixinClockBiz
.
getClockWechatUserRank
(
wxGroupId
,
wxUserId
));
}
}
pcloud-service-book/src/main/resources/mapper/weixinclock/WeixinClockMember.Mapper.xml
View file @
344f7d3b
...
...
@@ -38,7 +38,7 @@
(SELECT @i := 0) i
WHERE
w.wx_group_id = #{wxGroupId, jdbcType=VARCHAR}
AND (w.all_clock_day > 0 or w.wx_user_id = #{wxUserId, jdbcType=VARCHAR})
AND (w.all_clock_day
<![CDATA[ >]]
>
0 or w.wx_user_id = #{wxUserId, jdbcType=VARCHAR})
ORDER BY w.all_clock_day DESC
</select>
...
...
@@ -66,10 +66,24 @@
<select
id=
"getMyNewOrder"
parameterType=
"map"
resultType=
"java.lang.Integer"
>
select cm.rowNo from (
select wx_user_id, (@rowNum:=@rowNum+1) AS rowNo from (
select wx_user_id, @rowNum:=0 from weixin_clock_member where wx_group_id = #{wechatGroupId}
select wx_user_id, @rowNum:=0 from weixin_clock_member
where wx_group_id = #{wechatGroupId}
AND (all_clock_day
<![CDATA[ >]]>
0 or wx_user_id = #{userWxId, jdbcType=VARCHAR})
order by all_clock_day desc, update_time asc
) a
) cm where cm.wx_user_id = #{userWxId}
</select>
<select
id=
"getClockWechatUserRank"
parameterType=
"map"
resultType=
"com.pcloud.book.weixinclock.dto.RankDto"
>
select cm.rankNum rankNum, cm.clockNum clockNum, cm.nickname nickname, cm.headPic headPic from (
select wx_user_id, (@rowNum:=@rowNum+1) AS rankNum, all_clock_day clockNum, nickname nickname, head_pic headPic from (
select wx_user_id, all_clock_day, nickname, head_pic, @rowNum:=0 from weixin_clock_member
where wx_group_id = #{wechatGroupId}
AND (all_clock_day
<![CDATA[ >]]>
0 or wx_user_id = #{userWxId, jdbcType=VARCHAR})
order by all_clock_day desc, update_time asc
) a
) cm where cm.wx_user_id = #{userWxId}
LIMIT 1
</select>
</mapper>
\ No newline at end of file
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