Merge remote-tracking branch 'origin/main' into main

main
rong.liu 11 months ago
commit a03076c89c
  1. 8
      common/pom.xml
  2. 4
      common/src/main/java/com/huoran/common/utils/AliyunOssUtil.java
  3. 10
      nakadai/pom.xml
  4. 25
      nakadai/src/main/java/com/huoran/nakadai/controller/CommentController.java
  5. 67
      nakadai/src/main/java/com/huoran/nakadai/controller/MessageController.java
  6. 1
      nakadai/src/main/java/com/huoran/nakadai/entity/UserInfo.java
  7. 35
      nakadai/src/main/java/com/huoran/nakadai/service/impl/OSSFileServiceImpl.java
  8. 32
      occupationlab/src/main/java/com/huoran/occupationlab/service/impl/OSSFileServiceImpl.java
  9. 10
      pom.xml
  10. 6
      users/src/main/java/com/huoran/users/mapper/xml/HrUserAccountMapper.xml
  11. 9
      users/src/main/java/com/huoran/users/service/impl/HrUserAccountServiceImpl.java

@ -91,10 +91,10 @@
<artifactId>aliyun-java-sdk-core</artifactId>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-sdk-vod-upload</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.aliyun</groupId>-->
<!-- <artifactId>aliyun-sdk-vod-upload</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.aliyun</groupId>

@ -7,9 +7,7 @@ import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.OSSException;
import com.aliyun.oss.model.*;
import com.aliyun.vod.upload.impl.UploadVideoImpl;
import com.aliyun.vod.upload.req.UploadStreamRequest;
import com.aliyun.vod.upload.resp.UploadStreamResponse;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.vod.model.v20170321.DeleteVideoRequest;
import com.aliyuncs.vod.model.v20170321.DeleteVideoResponse;

@ -22,11 +22,11 @@
<dependencies>
<dependency>
<groupId>com.huoran.parent</groupId>
<artifactId>websocket</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.huoran.parent</groupId>-->
<!-- <artifactId>websocket</artifactId>-->
<!-- <version>1.0-SNAPSHOT</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>

@ -12,8 +12,7 @@ import com.huoran.nakadai.entity.Notify;
import com.huoran.nakadai.entity.res.CommentRes;
import com.huoran.nakadai.service.CommentService;
import com.huoran.nakadai.service.NotifyService;
import com.huoran.websocket.model.dto.WebsocketMsgDTO;
import com.huoran.websocket.service.WebsocketService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -42,8 +41,8 @@ public class CommentController {
@Autowired
private NotifyService notifyService;
@Autowired
private WebsocketService webSocketService;
// @Autowired
// private WebsocketService webSocketService;
@Autowired
private UserClient userClient;
@ -95,15 +94,15 @@ public class CommentController {
}
// 发送webSocket消息
if (comment.getReplyAccountId()!=null){
WebsocketMsgDTO websocketMsgDTO = new WebsocketMsgDTO();
websocketMsgDTO.setForm(accountId);
websocketMsgDTO.setUsername(accountId);
websocketMsgDTO.setTo(comment.getReplyAccountId().toString());
websocketMsgDTO.setContent(comment.getContent());
websocketMsgDTO.setExtras(null);
webSocketService.send(websocketMsgDTO);
}
// if (comment.getReplyAccountId()!=null){
// WebsocketMsgDTO websocketMsgDTO = new WebsocketMsgDTO();
// websocketMsgDTO.setForm(accountId);
// websocketMsgDTO.setUsername(accountId);
// websocketMsgDTO.setTo(comment.getReplyAccountId().toString());
// websocketMsgDTO.setContent(comment.getContent());
// websocketMsgDTO.setExtras(null);
// webSocketService.send(websocketMsgDTO);
// }
return save ? R.ok() : R.error();
}

@ -3,9 +3,6 @@ package com.huoran.nakadai.controller;
import com.huoran.common.response.R;
import com.huoran.common.utils.TokenUtils;
import com.huoran.nakadai.service.MessageService;
import com.huoran.websocket.model.dto.WebsocketMsgDTO;
import com.huoran.websocket.model.vo.SendMsgVO;
import com.huoran.websocket.service.WebsocketService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -28,38 +25,38 @@ public class MessageController {
@Autowired
private MessageService messageService;
@Autowired
private WebsocketService webSocketService;
@ApiOperation(value = "所有在线用户接收消息通知",response = SendMsgVO.class)
@PostMapping("/refreshPageNotification")
public void refreshPageNotification(
@ApiParam(name = "username", value = "发送者名称", required = false)
@RequestParam(required = false) String username,
@ApiParam(name = "to", value = "发给谁(默认发送给所有在线用户)", required = false)
@RequestParam(required = false) String to,
@ApiParam(name = "content", value = "消息通知", required = false)
@RequestParam(required = false) String content) {
WebsocketMsgDTO websocketMsgDTO = new WebsocketMsgDTO();
websocketMsgDTO.setForm("系统消息");
if (StringUtils.isEmpty(username)){
websocketMsgDTO.setUsername("系统通知机器人");
}else {
websocketMsgDTO.setUsername(username);
}
if (StringUtils.isEmpty(to)){
websocketMsgDTO.setTo("all");
}else {
websocketMsgDTO.setTo(to);
}
if (StringUtils.isEmpty(content)){
websocketMsgDTO.setContent("refresh");
}else {
websocketMsgDTO.setContent(content);
}
websocketMsgDTO.setExtras(null);
webSocketService.send(websocketMsgDTO);
}
// @Autowired
// private WebsocketService webSocketService;
// @ApiOperation(value = "所有在线用户接收消息通知",response = SendMsgVO.class)
// @PostMapping("/refreshPageNotification")
// public void refreshPageNotification(
// @ApiParam(name = "username", value = "发送者名称", required = false)
// @RequestParam(required = false) String username,
// @ApiParam(name = "to", value = "发给谁(默认发送给所有在线用户)", required = false)
// @RequestParam(required = false) String to,
// @ApiParam(name = "content", value = "消息通知", required = false)
// @RequestParam(required = false) String content) {
// WebsocketMsgDTO websocketMsgDTO = new WebsocketMsgDTO();
// websocketMsgDTO.setForm("系统消息");
// if (StringUtils.isEmpty(username)){
// websocketMsgDTO.setUsername("系统通知机器人");
// }else {
// websocketMsgDTO.setUsername(username);
// }
// if (StringUtils.isEmpty(to)){
// websocketMsgDTO.setTo("all");
// }else {
// websocketMsgDTO.setTo(to);
// }
// if (StringUtils.isEmpty(content)){
// websocketMsgDTO.setContent("refresh");
// }else {
// websocketMsgDTO.setContent(content);
// }
// websocketMsgDTO.setExtras(null);
// webSocketService.send(websocketMsgDTO);
// }
/**
* 发送指定的用户队列

@ -76,6 +76,7 @@ public class UserInfo implements Serializable {
private Integer isDel;
@ApiModelProperty(value = "最后登陆时间")
@TableField(fill = FieldFill.INSERT)
private Date lastLoginTime;
@ApiModelProperty(value = "绑定多个角色id")

@ -1,9 +1,6 @@
package com.huoran.nakadai.service.impl;
import com.aliyun.oss.ClientException;
import com.aliyun.vod.upload.impl.UploadVideoImpl;
import com.aliyun.vod.upload.req.UploadStreamRequest;
import com.aliyun.vod.upload.resp.UploadStreamResponse;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.vod.model.v20170321.DeleteVideoRequest;
import com.aliyuncs.vod.model.v20170321.DeleteVideoResponse;
@ -70,8 +67,8 @@ public class OSSFileServiceImpl implements OSSFileService {
filesResult.setFileSize(fileSize);
//上传流请求
UploadStreamRequest request = new UploadStreamRequest(ConstantPropertiesUtil.ACCESS_KEY_ID,
ConstantPropertiesUtil.ACCESS_KEY_SECRET, title, originalFilename, inputStream);
// UploadStreamRequest request = new UploadStreamRequest(ConstantPropertiesUtil.ACCESS_KEY_ID,
// ConstantPropertiesUtil.ACCESS_KEY_SECRET, title, originalFilename, inputStream);
/* 是否使用默认水印(可选),指定模板组ID时,根据模板组配置确定是否使用默认水印*/
//request.setShowWaterMark(true);
@ -104,20 +101,20 @@ public class OSSFileServiceImpl implements OSSFileService {
/* ECS部署区域*/
// request.setEcsRegionId("cn-shanghai");
UploadVideoImpl uploader = new UploadVideoImpl();
UploadStreamResponse response = uploader.uploadStream(request);
//如果设置回调URL无效,不影响视频上传,可以返回VideoId同时会返回错误码。
// 其他情况上传失败时,VideoId为空,此时需要根据返回错误码分析具体错误原因
String videoId = response.getVideoId();
if (!response.isSuccess()) {
String errorMessage = "阿里云视频上传错误:" + "code:" + response.getCode() + ", message:" + response.getMessage();
log.error(errorMessage);
if (StringUtils.isEmpty(videoId)) {
throw new CustomException(ExceptionEnum.UNKNOWN_EXCEPTION);
}
}
filesResult.setFileId(videoId);
// UploadVideoImpl uploader = new UploadVideoImpl();
// UploadStreamResponse response = uploader.uploadStream(request);
//
// //如果设置回调URL无效,不影响视频上传,可以返回VideoId同时会返回错误码。
// // 其他情况上传失败时,VideoId为空,此时需要根据返回错误码分析具体错误原因
// String videoId = response.getVideoId();
// if (!response.isSuccess()) {
// String errorMessage = "阿里云视频上传错误:" + "code:" + response.getCode() + ", message:" + response.getMessage();
// log.error(errorMessage);
// if (StringUtils.isEmpty(videoId)) {
// throw new CustomException(ExceptionEnum.UNKNOWN_EXCEPTION);
// }
// }
// filesResult.setFileId(videoId);
return filesResult;
}

@ -1,8 +1,6 @@
package com.huoran.occupationlab.service.impl;
import com.aliyun.vod.upload.impl.UploadVideoImpl;
import com.aliyun.vod.upload.req.UploadStreamRequest;
import com.aliyun.vod.upload.resp.UploadStreamResponse;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.vod.model.v20170321.DeleteVideoRequest;
@ -91,23 +89,23 @@ public class OSSFileServiceImpl implements OSSFileService {
filesResult.setFileType(fileType);
//上传流请求
UploadStreamRequest request = new UploadStreamRequest(ConstantPropertiesUtil.ACCESS_KEY_ID, ConstantPropertiesUtil.ACCESS_KEY_SECRET, title, originalFilename, inputStream);
UploadVideoImpl uploader = new UploadVideoImpl();
UploadStreamResponse response = uploader.uploadStream(request);
// UploadStreamRequest request = new UploadStreamRequest(ConstantPropertiesUtil.ACCESS_KEY_ID, ConstantPropertiesUtil.ACCESS_KEY_SECRET, title, originalFilename, inputStream);
//
//
// UploadVideoImpl uploader = new UploadVideoImpl();
// UploadStreamResponse response = uploader.uploadStream(request);
//如果设置回调URL无效,不影响视频上传,可以返回VideoId同时会返回错误码。
// 其他情况上传失败时,VideoId为空,此时需要根据返回错误码分析具体错误原因
String videoId = response.getVideoId();
if (!response.isSuccess()) {
String errorMessage = "阿里云视频上传错误:" + "code:" + response.getCode() + ", message:" + response.getMessage();
log.error(errorMessage);
if (StringUtils.isEmpty(videoId)) {
throw new CustomException(201, errorMessage);
}
}
filesResult.setFileId(videoId);
// String videoId = response.getVideoId();
// if (!response.isSuccess()) {
// String errorMessage = "阿里云视频上传错误:" + "code:" + response.getCode() + ", message:" + response.getMessage();
// log.error(errorMessage);
// if (StringUtils.isEmpty(videoId)) {
// throw new CustomException(201, errorMessage);
// }
// }
// filesResult.setFileId(videoId);
return filesResult;
}

@ -200,11 +200,11 @@
<version>${aliyun-java-sdk-vod.version}</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-sdk-vod-upload</artifactId>
<version>${aliyun-sdk-vod-upload.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.aliyun</groupId>-->
<!-- <artifactId>aliyun-sdk-vod-upload</artifactId>-->
<!-- <version>${aliyun-sdk-vod-upload.version}</version>-->
<!-- </dependency>-->
<!-- Easy poi-->
<!-- excle导入导出依赖包 start -->

@ -843,10 +843,10 @@
u.login_number,
CASE
WHEN count(ai.id) > 0 THEN ai.real_name
ELSE u.user_name
ELSE GROUP_CONCAT(u.user_name)
END as user_name,
a.work_number,
s.platform_name,
GROUP_CONCAT(s.platform_name) as platformName,
CASE
WHEN count(ai.id) > 0 THEN '已认证'
ELSE '未认证'
@ -881,7 +881,7 @@
AND ( a.phone LIKE CONCAT('%',#{userInfoReq.searchContent},'%')
OR u.user_name LIKE CONCAT('%',#{userInfoReq.searchContent},'%'))
</if>
GROUP BY a.id
GROUP BY a.app_open_id
ORDER BY
create_time DESC
</select>

@ -443,8 +443,15 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H
//查询账号详情List
List<HrUserAccount> userAccountList = hrUserAccountMapper.selectList(new QueryWrapper<HrUserAccount>()
.eq("app_open_id", openId));
//查询个人端用户信息
Integer userId = null;
for (HrUserAccount hrUserAccount : userAccountList) {
if (hrUserAccount.getPlatformId().equals("7")){
userId = hrUserAccount.getUserId();
}
}
//查询用户信息
HrUserInfo hrUserInfo = hrUserInfoMapper.selectByUserId(userAccountList.get(0).getUserId());
HrUserInfo hrUserInfo = hrUserInfoMapper.selectByUserId(userId);
if (StringUtils.isNotBlank(url)){
hrUserInfo.setUserAvatars(url);
}

Loading…
Cancel
Save