增加自动打开面试房间操作日志记录

This commit is contained in:
feng.li
2023-12-12 18:54:08 +08:00
parent af8727ff6e
commit 765f6574f0
4 changed files with 102 additions and 3 deletions

View File

@@ -0,0 +1,71 @@
package com.cool.store.service;
import cn.hutool.core.date.DateUtil;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.HyInterviewDAO;
import com.cool.store.dto.log.AutoOpenInterviewRoomDTO;
import com.cool.store.enums.OperateTypeEnum;
import com.cool.store.enums.RoomStatus;
import com.cool.store.enums.WorkflowStatusEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
import com.cool.store.mapper.HyPartnerLineInfoMapper;
import com.cool.store.request.GetTipsInfoReq;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import java.util.Arrays;
import java.util.List;
/**
* @author Fun Li 2023/12/12 18:07
* @version 1.0
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Slf4j
class HyPartnerInterviewTest extends AbstractJUnit4SpringContextTests {
@Autowired
private HyPartnerInterviewPlanService hyPartnerInterviewPlanService;
@Autowired
private HyPartnerLineInfoMapper hyPartnerLineInfoMapper;
@Autowired
private HyPartnerInterviewPlanMapper hyPartnerInterviewPlanMapper;
@Autowired
private HyInterviewDAO interviewDAO;
@Autowired
private LogService logService;
@Autowired
private CommonService commonService;
@Test
void testOpenInterviewRoom() throws ApiException {
//更新房间状态为开启
List<Long> lineIds = Arrays.asList(38711L);
hyPartnerInterviewPlanMapper.openInterviewRoom(lineIds, RoomStatus.OPEN.getCode());
interviewDAO.batchUpdateInterviewWorkflowStatus(lineIds,Integer.parseInt(WorkflowStatusEnum.INTERVIEW_3.getCode()));
//记录日志
LoginUserInfo user = CurrentUserHolder.getUser();
AutoOpenInterviewRoomDTO autoOpenInterviewRoomLog = AutoOpenInterviewRoomDTO.builder()
.operateTime(DateUtil.now()).build();
for (Long lineId : lineIds) {
logService.recordBizLog(user, lineId, OperateTypeEnum.AUTO_OPEN_INTERVIEW, autoOpenInterviewRoomLog);
}
GetTipsInfoReq getTipsInfoReq = new GetTipsInfoReq();
getTipsInfoReq.setPartnerLineId(lineIds.get(0).toString());
String tipsInfo = commonService.getTipsInfo(getTipsInfoReq);
log.info("tipsInfo:{}", tipsInfo);
}
}