修改websocket信息

master
bynt 3 years ago
parent 5398dc03d8
commit 90a2f5e21d

@ -63,6 +63,6 @@ public class TaskController {
JSONObject jsonData = new JSONObject();
jsonData.putOpt("data",map);
String message = JSONUtil.toJsonStr(jsonData);
webSocketServer.sendMessage(message, userId.toString());
webSocketServer.sendMessage(message, userId);
}
}
}

@ -48,7 +48,6 @@ public class CompanyServiceImpl implements CompanyService {
@Override
@SneakyThrows
@Transactional(rollbackFor = Exception.class)
@CacheEvict(cacheNames = "companyCache", key = "#companyId")
public CompanyDto userUpdateCompany(CompanyDto companyDto, Long companyId) {
@ -66,7 +65,6 @@ public class CompanyServiceImpl implements CompanyService {
BeanUtil.copyProperties(companyDto, byUserId);
byUserId.setApplicationTime(DateUtil.date());
userRepository.updateStatusById(Boolean.FALSE, SecurityUtils.getCurrentUserId());
// onlineUserService.kickOutForUsername(SecurityUtils.getCurrentUsername());
return companyMapper.toDto(companyRepository.save(byUserId));
}

@ -279,7 +279,7 @@ public class UserServiceImpl implements UserService {
}
//查询是否已经分配到组
List<OrganizeUser> organizeUserList = organizeUserRepository.findByUserIdIn(ids);
if (organizeUserList != null || organizeUserList.size() > 0){
if (CollUtil.isNotEmpty(organizeUserList)){
throw new BadRequestException("用户已经分配到组,无法删除");
}
userRepository.deleteAllByIdIn(ids);

@ -196,10 +196,10 @@ public class WebSocketServer {
* @param sessionId
* @throws IOException
*/
public void sendMessage(String message, String sessionId){
public void sendMessage(String message, Long sessionId) {
log.info("发送web信息 {}", message);
Session session = null;
if (SESSIONS.get(sessionId) != null) {
if (SESSIONS.containsKey(sessionId)) {
session = SESSIONS.get(sessionId);
}
if (session != null) {

Loading…
Cancel
Save