|
@@ -40,18 +40,28 @@ public class GetWeChatsReqWebsocketHandler implements JsonMessageHandler{
|
|
|
//1、校验用户信息
|
|
|
if(null != req){
|
|
|
Integer id = req.getId();
|
|
|
- AccountInfo account = accountService.findAccountInfoByid(id);
|
|
|
- if(null != account){
|
|
|
- List<WxAccountInfo> list = weChatAccountService.findWeChatAccountInfo(account.getCid(), account.getId());
|
|
|
-
|
|
|
- String json = null ;
|
|
|
- if(null != list && list.size()>0){
|
|
|
- json = JSON.toJSONString(list);
|
|
|
- }
|
|
|
- MessageUtil.sendCustomJsonMsg(ctx, "GetWeChatsResp", json);
|
|
|
- }else{
|
|
|
- MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam,Constant.ERROR_MSG_PARAMERROR);
|
|
|
- }
|
|
|
+ if(id == 0){
|
|
|
+ List<WxAccountInfo> list = weChatAccountService.findAllWeChatAccountInfo();
|
|
|
+
|
|
|
+ String json = null ;
|
|
|
+ if(null != list && list.size()>0){
|
|
|
+ json = JSON.toJSONString(list);
|
|
|
+ }
|
|
|
+ MessageUtil.sendCustomJsonMsg(ctx, "GetWeChatsResp", json);
|
|
|
+ } else {
|
|
|
+ AccountInfo account = accountService.findAccountInfoByid(id);
|
|
|
+ if(null != account){
|
|
|
+ List<WxAccountInfo> list = weChatAccountService.findWeChatAccountInfo(account.getCid(), account.getId());
|
|
|
+
|
|
|
+ String json = null ;
|
|
|
+ if(null != list && list.size()>0){
|
|
|
+ json = JSON.toJSONString(list);
|
|
|
+ }
|
|
|
+ MessageUtil.sendCustomJsonMsg(ctx, "GetWeChatsResp", json);
|
|
|
+ }else{
|
|
|
+ MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam,Constant.ERROR_MSG_PARAMERROR);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|