add
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: UserRoleEnum
|
||||
* @Description: 用户职位
|
||||
* @date 2024-03-22 16:37
|
||||
*/
|
||||
public enum UserRoleEnum {
|
||||
|
||||
INVESTMENT_MANAGER(1, "招商经理"),
|
||||
SELECT_SITE_MANAGER(2, "选址人员"),
|
||||
REGION_MANAGER(3, "大区经理"),
|
||||
THEATER_MANAGER(4, "战区经理"),
|
||||
;
|
||||
|
||||
private Integer code;
|
||||
private String desc;
|
||||
|
||||
UserRoleEnum(Integer code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -60,4 +60,8 @@ public class LineInterviewDAO {
|
||||
return lineInterviewMapper.selectByPrimaryKey(interviewId);
|
||||
}
|
||||
|
||||
public LineInterviewDO getInterviewInfoByRoomId(String roomId){
|
||||
return lineInterviewMapper.getInterviewInfoByRoomId(roomId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,4 +23,11 @@ public interface LineInterviewMapper extends Mapper<LineInterviewDO> {
|
||||
* @return
|
||||
*/
|
||||
Page<LineInterviewPageDTO> getInterviewerPage(LineInterviewPageRequest request);
|
||||
|
||||
/**
|
||||
* 根据房间号获取面试信息
|
||||
* @param roomId
|
||||
* @return
|
||||
*/
|
||||
LineInterviewDO getInterviewInfoByRoomId(@Param("roomId") String roomId);
|
||||
}
|
||||
@@ -76,4 +76,8 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getInterviewInfoByRoomId" resultMap="BaseResultMap">
|
||||
select * from xfsg_line_interview where room_id = #{roomId} and deleted = '0'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.vo.interview;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.LineInterviewDO;
|
||||
import com.cool.store.vo.LineAuditInfoVO;
|
||||
@@ -8,6 +9,7 @@ import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class InterviewDetailVO {
|
||||
@@ -67,7 +69,7 @@ public class InterviewDetailVO {
|
||||
private Integer interviewType;
|
||||
|
||||
@ApiModelProperty("视频链接")
|
||||
private String videoUrl;
|
||||
private List<String> videoUrl;
|
||||
|
||||
@ApiModelProperty("审核信息")
|
||||
private LineAuditInfoVO auditInfo;
|
||||
@@ -91,7 +93,7 @@ public class InterviewDetailVO {
|
||||
result.setRoomStatus(interviewInfo.getRoomStatus());
|
||||
result.setInterviewStatus(interviewInfo.getInterviewStatus());
|
||||
result.setInterviewType(interviewInfo.getInterviewType());
|
||||
result.setVideoUrl(interviewInfo.getVideoUrl());
|
||||
result.setVideoUrl(JSONObject.parseArray(interviewInfo.getVideoUrl(), String.class));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,4 +82,12 @@ public interface LineInterviewService {
|
||||
* @return
|
||||
*/
|
||||
InterviewDetailVO getInterviewDetail(Long lineId, Integer interviewType);
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
* @param interviewId
|
||||
* @param videoUrlList
|
||||
* @return
|
||||
*/
|
||||
Boolean uploadVideo(Long interviewId, List<String> videoUrlList);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.interview.LineInterviewPageDTO;
|
||||
@@ -30,10 +31,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -254,6 +252,21 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean uploadVideo(Long interviewId, List<String> videoUrlList) {
|
||||
LineInterviewDO interviewInfo = lineInterviewDAO.getInterviewInfoById(interviewId);
|
||||
if(Objects.isNull(interviewInfo)){
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_NOT_EXIST);
|
||||
}
|
||||
List<String> videoList = JSONObject.parseArray(interviewInfo.getVideoUrl(), String.class);
|
||||
if(videoList == null){
|
||||
videoList = new ArrayList<>();
|
||||
}
|
||||
videoList.addAll(videoUrlList);
|
||||
interviewInfo.setVideoUrl(JSONObject.toJSONString(videoList.stream().distinct().collect(Collectors.toList())));
|
||||
return lineInterviewDAO.updateInterviewInfo(interviewInfo) > 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Boolean initStage(Long auditId, LineInfoDO lineInfo) {
|
||||
|
||||
@@ -1,26 +1,41 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dao.LineInterviewDAO;
|
||||
import com.cool.store.dto.trtc.callback.VideoCallBackDTO;
|
||||
import com.cool.store.entity.LineInterviewDO;
|
||||
import com.cool.store.service.TRTCVideoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Service
|
||||
public class TRTCVideoServiceImpl implements TRTCVideoService {
|
||||
|
||||
/*@Autowired
|
||||
private HyPartnerInterviewMapper interviewMapper;*/
|
||||
@Resource
|
||||
private LineInterviewDAO lineInterviewDAO;
|
||||
|
||||
@Override
|
||||
public void handleVideoCallBack(VideoCallBackDTO videoCallBackDTO) {
|
||||
//防重
|
||||
/*Boolean hasVideoUrl = interviewMapper.hasVideoUrls(videoCallBackDTO.getEventInfo().getPayload().getTencentVod().getVideoUrl());
|
||||
if (hasVideoUrl) {
|
||||
return;
|
||||
}*/
|
||||
//将视频播放地址拼接到对应的面试信息字段中
|
||||
String videoUrl = videoCallBackDTO.getEventInfo().getPayload().getTencentVod().getVideoUrl();
|
||||
String roomId = videoCallBackDTO.getEventInfo().getRoomId();
|
||||
//interviewMapper.addVideoUrl(roomId, videoUrl);
|
||||
LineInterviewDO interviewInfo = lineInterviewDAO.getInterviewInfoByRoomId(roomId);
|
||||
if(Objects.isNull(interviewInfo)){
|
||||
return;
|
||||
}
|
||||
String[] split = videoUrl.split(",");
|
||||
List<String> videoList = JSONObject.parseArray(interviewInfo.getVideoUrl(), String.class);
|
||||
if(Objects.isNull(videoList)){
|
||||
videoList = new ArrayList<>();
|
||||
}
|
||||
videoList.addAll(Stream.of(split).collect(Collectors.toList()));
|
||||
interviewInfo.setVideoUrl(JSONObject.toJSONString(videoList.stream().distinct().collect(Collectors.toList())));
|
||||
lineInterviewDAO.updateInterviewInfo(interviewInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -66,11 +67,18 @@ public class PCLineInterviewController {
|
||||
return ResponseResult.success(lineInterviewService.enterInterviewRoom(interviewId, userId, InterviewUserTypeEnum.INTERVIEWER));
|
||||
}
|
||||
|
||||
@GetMapping("/finish")
|
||||
@ApiOperation("结束面试")
|
||||
@GetMapping("/finish")
|
||||
public ResponseResult finishInterview(@RequestParam("interviewId")Long interviewId) throws ApiException {
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
lineInterviewService.finishInterview(interviewId, userId);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("上传文件")
|
||||
@GetMapping("/upload/video")
|
||||
public ResponseResult uploadVideo(@RequestParam("interviewId")Long interviewId, @RequestParam("videoUrlList") List<String> videoUrlList) throws ApiException {
|
||||
lineInterviewService.uploadVideo(interviewId, videoUrlList);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user