修改bug

master
bynt 6 months ago
parent 4a5f635be0
commit cc8efaa7d6

@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpStatus;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.baiye.constant.DefaultNumberConstants;
import com.baiye.constant.WeChatRequestConstants;
import com.baiye.domain.PageParam;
import com.baiye.domain.PageResult;
@ -45,18 +46,22 @@ public class LoginEquipmentServiceImpl extends ExtendServiceImpl<LoginEquipmentM
qo.setUserId(SecurityUtils.getCurrentUserId());
PageResult<WeChatAccountVO> queryPage = baseMapper.queryPage(pageParam, qo);
queryPage.getRecords().forEach(accountVO -> {
// 默认离线状态
accountVO.setStatus(DefaultNumberConstants.ZERO_NUMBER);
map.put("robotId", accountVO.getRobotId());
String robotResult = HttpUtil.get
(weChatProperties.getGatewayHost().concat(WeChatRequestConstants.GET_ROBOT_TYPE)
.concat(weChatProperties.getAppKey()), map);
if (JSONUtil.isTypeJSON(robotResult)) {
WeChatResponse weChatResponse = JSONUtil.toBean(robotResult, WeChatResponse.class);
if (weChatResponse.getStatus() == HttpStatus.HTTP_OK) {
WeChatAccountDTO dto = BeanUtil.toBean(weChatResponse.getData(), WeChatAccountDTO.class);
if (ObjectUtil.isNotNull(dto)) {
if (ObjectUtil.isNotNull(dto) && dto.getPit().equals(accountVO.getPit())) {
accountVO.setCityInfo(dto.getProvince());
accountVO.setStatus(dto.getStatus());
}
}
}
});
return queryPage;
}

@ -285,7 +285,6 @@ public class WeChatServiceImpl extends ExtendServiceImpl<WeChatAccountMapper, We
List<String> onlineList = Lists.newArrayList();
AccountStatisticsVO vo = new AccountStatisticsVO();
List<WeChatAccountVO> weChatAccounts = loginEquipmentService.queryByUserId(currentUserId);
Long friendNum = wechatFriendService.queryByUserId(currentUserId);
Integer abnormalNum = DefaultNumberConstants.ZERO_NUMBER;
int onlineNum = DefaultNumberConstants.ZERO_NUMBER;
@ -295,6 +294,7 @@ public class WeChatServiceImpl extends ExtendServiceImpl<WeChatAccountMapper, We
String robotResult = HttpUtil.get
(weChatProperties.getGatewayHost().concat(WeChatRequestConstants.GET_ROBOT_TYPE)
.concat(weChatProperties.getAppKey()), map);
if (JSONUtil.isTypeJSON(robotResult)) {
WeChatResponse weChatResponse = JSONUtil.toBean(robotResult, WeChatResponse.class);
if (weChatResponse.getStatus() == HttpStatus.HTTP_OK) {
WeChatAccountDTO dto = BeanUtil.toBean(weChatResponse.getData(), WeChatAccountDTO.class);
@ -306,6 +306,7 @@ public class WeChatServiceImpl extends ExtendServiceImpl<WeChatAccountMapper, We
}
}
}
}
vo.setFriendNum(friendNum);
vo.setOnlineNum(onlineNum);
vo.setAbnormalNum(abnormalNum);

@ -67,6 +67,10 @@ public class WeChatAccountVO {
@Schema(title = "备注")
private String remark;
@Schema(title = "pit")
private String pit;
@Schema(title = "微信号")
private String weChatNo;

@ -36,4 +36,4 @@ alipay:
wechat:
gatewayHost: https://fission-server.scrm-ai.com
appKey: Dn4emsLhVFaZ4aw2sQSmWoh2oz0n1taa
appKey: uNE5DXdjwQa1iE8cBVZJbuvGfr5t9R73

@ -16,6 +16,7 @@
wa.update_time,
wa.user_id,
le.id,
le.pit,
le.robot_id,
le.device_number,
le.expiration_time

Loading…
Cancel
Save