boweniac 1 vecka sedan
förälder
incheckning
da8b206d69

+ 1 - 1
src/main/java/com/jubotech/business/web/dao/WxAccountDao.java

@@ -36,7 +36,7 @@ public interface WxAccountDao  extends Mapper<WxAccountInfo>, MySqlMapper<WxAcco
 	
 	List<WxAccountInfo> findWeChatAccountInfo(@Param("cid")Integer cid ,@Param("accountid")Integer accountid);
 	
-	List<WxAccountInfo> findAllWeChatAccountInfo(@Param("isonline")Integer isonline);
+	List<WxAccountInfo> findAllWeChatAccountInfo();
 	
 	void update(WxAccountInfo info);
 	   

+ 2 - 2
src/main/java/com/jubotech/business/web/service/WxAccountService.java

@@ -174,8 +174,8 @@ public class WxAccountService {
 		return weChatAccountDao.findWeChatAccountInfo(cid, accountid);
 	}
 
-	public List<WxAccountInfo> findAllWeChatAccountInfo(Integer isonline) {
-		return weChatAccountDao.findAllWeChatAccountInfo(isonline);
+	public List<WxAccountInfo> findAllWeChatAccountInfo() {
+		return weChatAccountDao.findAllWeChatAccountInfo();
 	}
 
 	public List<WxAccountInfo> findWeChatAccountInfoByWeChatIdNotEqualsDeviceid(String wechatid, String deviceid) {

+ 22 - 12
src/main/java/com/jubotech/framework/netty/handler/websocket/GetWeChatsReqWebsocketHandler.java

@@ -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();

+ 0 - 1
src/main/resources/config/mapper/WxAccountDao.xml

@@ -104,7 +104,6 @@
 	<select id="findAllWeChatAccountInfo" resultType="com.jubotech.business.web.domain.WxAccountInfo">
          select  * 
          from tbl_wx_accountinfo
-         where  isonline = #{isonline}
 	</select>
 	 
 	<update id="update">