Commit eb0edb98 by 高鹏

Merge branch 'feat-lihao' into 'master'

merge:获取10人以上有效群

See merge request rays/pcloud-book!39
parents 1511139c daa4de6a
......@@ -69,6 +69,10 @@ public interface WeixinQrcodeService {
@GetMapping("listAvailableGroupByPage")
ResponseEntity<ResponseDto<List<BookWxQrcodeDTO>>> listAvailableGroupByPage(@RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage);
@ApiOperation("分页获取人数超过10人的可用微信群")
@GetMapping("listOver10AvailableGroupByPage")
ResponseEntity<ResponseDto<List<BookWxQrcodeDTO>>> listOver10AvailableGroupByPage(@RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage);
@ApiOperation("所有群邀请新的机器人小号(有接收消息机器人存在好友关系)")
@GetMapping("inviteNewRobot")
void inviteNewRobot(@RequestParam("wxUserId") String wxUserId);
......
......@@ -115,6 +115,14 @@ public interface WeixinQrcodeBiz {
List<BookWxQrcodeDTO> listAvailableGroupByPage(Integer currentPage, Integer numPerPage);
/**
* 分页获取人数超过10人的可用微信群
* @param currentPage
* @param numPerPage
* @return
*/
List<BookWxQrcodeDTO> listOver10AvailableGroupByPage(Integer currentPage, Integer numPerPage);
/**
* 所有群邀请新的机器人小号
* @param wxUserId 用户微信ID
*/
......
......@@ -318,6 +318,15 @@ public class WeixinQrcodeBizImpl implements WeixinQrcodeBiz {
}
@Override
@ParamLog("分页获取人数超过10人的可用微信群")
public List<BookWxQrcodeDTO> listOver10AvailableGroupByPage(Integer currentPage, Integer numPerPage) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("currentPage", currentPage);
paramMap.put("numPerPage", numPerPage);
return weixinQrcodeDao.listOver10AvailableGroupByPage(paramMap);
}
@Override
@ParamLog("所有群邀请新的机器人小号")
public void inviteNewRobot(String wxUserId) {
for(int i = 0; true ; i++) {
......
......@@ -139,9 +139,16 @@ public interface WeixinQrcodeDao extends BaseDao<WeixinQrcode> {
WeixinQrcode getByGroupId(String wechatGroupId);
/**
*
* 分页获取可用微信群
* @param paramMap 参数map
* @return
*/
List<BookWxQrcodeDTO> listAvailableGroupByPage(Map<String, Object> paramMap);
/**
* 分页获取人数超过10人的可用微信群
* @param paramMap
* @return
*/
List<BookWxQrcodeDTO> listOver10AvailableGroupByPage(Map<String, Object> paramMap);
}
......@@ -137,4 +137,9 @@ public class WeixinQrcodeDaoImpl extends BaseDaoImpl<WeixinQrcode> implements We
public List<BookWxQrcodeDTO> listAvailableGroupByPage(Map<String, Object> paramMap) {
return this.getSqlSession().selectList(this.getStatement("listAvailableGroupByPage"), paramMap);
}
@Override
public List<BookWxQrcodeDTO> listOver10AvailableGroupByPage(Map<String, Object> paramMap) {
return this.getSqlSession().selectList(this.getStatement("listOver10AvailableGroupByPage"), paramMap);
}
}
......@@ -97,6 +97,13 @@ public class WeixinQrcodeServiceImpl implements WeixinQrcodeService {
}
@Override
@GetMapping("listOver10AvailableGroupByPage")
public ResponseEntity<ResponseDto<List<BookWxQrcodeDTO>>> listOver10AvailableGroupByPage(@RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage) {
return ResponseHandleUtil.toResponse(weixinQrcodeBiz.listOver10AvailableGroupByPage(currentPage, numPerPage));
}
@Override
@GetMapping("inviteNewRobot")
public void inviteNewRobot(@RequestParam("wxUserId") String wxUserId) {
weixinQrcodeBiz.inviteNewRobot(wxUserId);
......
......@@ -238,5 +238,19 @@
LIMIT #{currentPage}, #{numPerPage}
</select>
<select id="listOver10AvailableGroupByPage" parameterType="map" resultType="bookWxQrcodeDTO">
SELECT
q.weixin_group_id AS weixinGroupId,
q.robot_wx_id AS robotWxId
FROM
`weixin_qrcode` q
LEFT JOIN book_group_qrcode bq ON q.weixin_group_id = bq.weixin_group_id
WHERE
q.use_state = 1
AND bq.user_number <![CDATA[ > ]]> 10
GROUP BY
q.weixin_group_id
LIMIT #{currentPage}, #{numPerPage}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment