修改用户登录前端有时无法获取orgId,
考试调整
This commit is contained in:
parent
382d28ca31
commit
9f8b47147d
@ -4,7 +4,7 @@ ALTER TABLE `rts_paper_user_question`
|
|||||||
|
|
||||||
|
|
||||||
ALTER TABLE `rts_paper_user_question`
|
ALTER TABLE `rts_paper_user_question`
|
||||||
ADD COLUMN `sub_type` bigint not NULL COMMENT '规则类型:理论题(1-单选题,2-多选题,3-判断题);实训题(4-单操实训,5-场景实训)' AFTER `type`;
|
ADD COLUMN `sub_type` int not NULL COMMENT '规则类型:理论题(1-单选题,2-多选题,3-判断题);实训题(4-单操实训,5-场景实训)' AFTER `type`;
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE `rts_paper_user_question` MODIFY COLUMN tmp_answer longtext;
|
ALTER TABLE `rts_paper_user_question` MODIFY COLUMN tmp_answer longtext;
|
||||||
|
@ -87,6 +87,7 @@ public class LoginController {
|
|||||||
@GetMapping(path = "/getUserInfo")
|
@GetMapping(path = "/getUserInfo")
|
||||||
public AccountVO getUserInfo(String token) {
|
public AccountVO getUserInfo(String token) {
|
||||||
LoginUserInfoVO loginUserInfoVO = this.iAuthenticateService.getLoginUserInfoByToken(token);
|
LoginUserInfoVO loginUserInfoVO = this.iAuthenticateService.getLoginUserInfoByToken(token);
|
||||||
|
System.out.println(String.format("%s ====%s =========== from getUserInfo",loginUserInfoVO,loginUserInfoVO.getAccountVO().getCompanyId()));
|
||||||
return loginUserInfoVO.getAccountVO();
|
return loginUserInfoVO.getAccountVO();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@ import java.util.Map;
|
|||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static club.joylink.rtss.controller.advice.AuthenticateInterceptor.LOGIN_INFO_KEY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组织-项目关系管理接口
|
* 组织-项目关系管理接口
|
||||||
*/
|
*/
|
||||||
@ -44,7 +46,7 @@ public class OrgProjectController {
|
|||||||
* 选择登入组织(目前先查询顶级组织)
|
* 选择登入组织(目前先查询顶级组织)
|
||||||
*/
|
*/
|
||||||
@PutMapping("signIn/{orgId}")
|
@PutMapping("signIn/{orgId}")
|
||||||
public void signInOrg(@PathVariable Long orgId, @RequestAttribute LoginUserInfoVO loginInfo) {
|
public void signInOrg(@PathVariable Long orgId, @RequestAttribute(name = LOGIN_INFO_KEY) LoginUserInfoVO loginInfo) {
|
||||||
orgProjectService.signInOrg(orgId, loginInfo);
|
orgProjectService.signInOrg(orgId, loginInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import club.joylink.rtss.dao.OrgDAO;
|
|||||||
import club.joylink.rtss.dao.OrgProjectDAO;
|
import club.joylink.rtss.dao.OrgProjectDAO;
|
||||||
import club.joylink.rtss.dao.OrgUserDAO;
|
import club.joylink.rtss.dao.OrgUserDAO;
|
||||||
import club.joylink.rtss.entity.*;
|
import club.joylink.rtss.entity.*;
|
||||||
|
import club.joylink.rtss.services.LoginSessionManager;
|
||||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
||||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
|
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
|
||||||
import club.joylink.rtss.vo.AccountVO;
|
import club.joylink.rtss.vo.AccountVO;
|
||||||
@ -76,12 +77,15 @@ public class OrgProjectService implements IOrgProjectService {
|
|||||||
List<Org> orgList = queryOrgInfoList(orgIdList);
|
List<Org> orgList = queryOrgInfoList(orgIdList);
|
||||||
return orgList.stream().map(OrgProjectVO::new).collect(Collectors.toList());
|
return orgList.stream().map(OrgProjectVO::new).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
@Autowired
|
||||||
|
private LoginSessionManager loginSessionManager;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void signInOrg(Long orgId, LoginUserInfoVO loginInfo) {
|
public void signInOrg(Long orgId, LoginUserInfoVO loginInfo) {
|
||||||
OrgVO orgVO = iOrgService.getTopOrg(orgId);
|
OrgVO orgVO = iOrgService.getTopOrg(orgId);
|
||||||
boolean orgAdmin = iOrgUserService.userIsTheRoleInThisOrg(loginInfo.getAccountVO().getId(), orgId, BusinessConsts.OrgRole.Admin);
|
boolean orgAdmin = iOrgUserService.userIsTheRoleInThisOrg(loginInfo.getAccountVO().getId(), orgId, BusinessConsts.OrgRole.Admin);
|
||||||
loginInfo.setOrgProjectVO(orgVO, orgAdmin);
|
loginInfo.setOrgProjectVO(orgVO, orgAdmin);
|
||||||
|
loginSessionManager.addLoginUserInfo(loginInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -18,6 +18,7 @@ import club.joylink.rtss.vo.paper.convertor.PaperCompositionConvertor;
|
|||||||
import club.joylink.rtss.vo.paper.convertor.PaperUserConvertor;
|
import club.joylink.rtss.vo.paper.convertor.PaperUserConvertor;
|
||||||
import club.joylink.rtss.vo.paper.convertor.PaperUserQuestionConvertor;
|
import club.joylink.rtss.vo.paper.convertor.PaperUserQuestionConvertor;
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
|
import com.google.common.base.Strings;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -221,7 +222,7 @@ public class PaperUserService {
|
|||||||
if(Objects.equals(puq.getSubType(), PaperQType.SubType.Single.getValue()) && PaperQuestionState.Right.equals(PaperQuestionState.getItem(puq.getState()))){
|
if(Objects.equals(puq.getSubType(), PaperQType.SubType.Single.getValue()) && PaperQuestionState.Right.equals(PaperQuestionState.getItem(puq.getState()))){
|
||||||
return rule.getScore();
|
return rule.getScore();
|
||||||
}else if(Objects.equals(puq.getSubType(), PaperQType.SubType.Scene.getValue())){
|
}else if(Objects.equals(puq.getSubType(), PaperQType.SubType.Scene.getValue())){
|
||||||
if(!StringUtils.hasText(puq.getTmpAnswer())){
|
if(Strings.isNullOrEmpty(puq.getTmpAnswer())){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
PaperSubmitAnswerReqVo.AnswerDetail answerDetail = JsonUtils.read(puq.getTmpAnswer(),PaperSubmitAnswerReqVo.AnswerDetail.class);
|
PaperSubmitAnswerReqVo.AnswerDetail answerDetail = JsonUtils.read(puq.getTmpAnswer(),PaperSubmitAnswerReqVo.AnswerDetail.class);
|
||||||
|
@ -117,13 +117,12 @@ public class PaperUserSubmitAnswerService {
|
|||||||
|
|
||||||
private TrainAnswerVO submitTrainingAnswer(PaperSubmitAnswerReqVo reqVo,PaperUserQuestion puq){
|
private TrainAnswerVO submitTrainingAnswer(PaperSubmitAnswerReqVo reqVo,PaperUserQuestion puq){
|
||||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotTrue(Strings.isNullOrEmpty(reqVo.getTrainAnswerDetail().getCosplayMemberId()),"实训考试没有对应的角色");
|
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotTrue(Strings.isNullOrEmpty(reqVo.getTrainAnswerDetail().getCosplayMemberId()),"实训考试没有对应的角色");
|
||||||
|
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotTrue(CollectionUtils.isEmpty(reqVo.getTrainAnswerDetail().getTrainDetail()),"实训考试没有对应的操作");
|
||||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotTrue(reqVo.getTrainAnswerDetail().getTrainDetail().stream().anyMatch(d->Objects.isNull(d.getStepId())),"实训步骤id不能为空");
|
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotTrue(reqVo.getTrainAnswerDetail().getTrainDetail().stream().anyMatch(d->Objects.isNull(d.getStepId())),"实训步骤id不能为空");
|
||||||
|
|
||||||
PublishedTraining2DetailRspVo detailVO = this.training2PublishService.findTrainingAllInfoById(reqVo.getPqId());
|
PublishedTraining2DetailRspVo detailVO = this.training2PublishService.findTrainingAllInfoById(reqVo.getPqId());
|
||||||
log.debug("查找对应的实训数据 type:[{}],id[{}]",reqVo.getSubType(),reqVo.getPqId());
|
log.debug("查找对应的实训数据 type:[{}],id[{}]",reqVo.getSubType(),reqVo.getPqId());
|
||||||
if(CollectionUtils.isEmpty(reqVo.getTrainAnswerDetail().getTrainDetail())){
|
|
||||||
return new TrainAnswerVO(PaperQuestionState.Wrong, null);
|
|
||||||
}
|
|
||||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(detailVO),String.format("未找到对应的实训数据[%s]",reqVo.getPqId()));
|
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(detailVO),String.format("未找到对应的实训数据[%s]",reqVo.getPqId()));
|
||||||
|
|
||||||
List<Step2VO> stepList = JsonUtils.readCollection(detailVO.getStepJson(),ArrayList.class, Step2VO.class);
|
List<Step2VO> stepList = JsonUtils.readCollection(detailVO.getStepJson(),ArrayList.class, Step2VO.class);
|
||||||
@ -136,7 +135,6 @@ public class PaperUserSubmitAnswerService {
|
|||||||
return new TrainAnswerVO(PaperQuestionState.Wrong, null);
|
return new TrainAnswerVO(PaperQuestionState.Wrong, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理实训题答案
|
* 处理实训题答案
|
||||||
* @param req
|
* @param req
|
||||||
@ -156,10 +154,11 @@ public class PaperUserSubmitAnswerService {
|
|||||||
|
|
||||||
private TrainAnswerVO submitTrainingAnswerForScene(PublishedTraining2DetailRspVo trainVO,PaperSubmitAnswerReqVo req,PaperUserQuestion puq){
|
private TrainAnswerVO submitTrainingAnswerForScene(PublishedTraining2DetailRspVo trainVO,PaperSubmitAnswerReqVo req,PaperUserQuestion puq){
|
||||||
BusinessExceptionAssertEnum.DATA_ERROR.assertTrue(StringUtils.hasText(trainVO.getScoringRuleJson()),"场景实训没有对应的评分规则");
|
BusinessExceptionAssertEnum.DATA_ERROR.assertTrue(StringUtils.hasText(trainVO.getScoringRuleJson()),"场景实训没有对应的评分规则");
|
||||||
|
|
||||||
List<ScoringRuleVO> scoreList = JsonUtils.readCollection(trainVO.getScoringRuleJson(),ArrayList.class, ScoringRuleVO.class);
|
List<ScoringRuleVO> scoreList = JsonUtils.readCollection(trainVO.getScoringRuleJson(),ArrayList.class, ScoringRuleVO.class);
|
||||||
BusinessExceptionAssertEnum.DATA_ERROR.assertTrue(!CollectionUtils.isEmpty(scoreList),String.format("场景实训[%s]没有评分规则",req.getPqId()));
|
BusinessExceptionAssertEnum.DATA_ERROR.assertTrue(!CollectionUtils.isEmpty(scoreList),String.format("场景实训[%s]没有评分规则",req.getPqId()));
|
||||||
|
|
||||||
List<ScoringRuleVO.DetailVO> allDetailVOList = scoreList.stream().filter(d->Objects.equals(d.getMemberId(),req.getTrainAnswerDetail().getCosplayMemberId())).flatMap(d->d.getDetails().stream()).collect(Collectors.toList());
|
List<ScoringRuleVO.DetailVO> allDetailVOList = scoreList.stream().filter(d->Objects.equals(d.getMemberId(),req.getTrainAnswerDetail().getCosplayMemberId())).flatMap(d->d.getDetails().stream()).collect(Collectors.toList());
|
||||||
|
|
||||||
List<PaperTrainAnswerDetail> answerDetailList = req.getTrainAnswerDetail().getTrainDetail();
|
List<PaperTrainAnswerDetail> answerDetailList = req.getTrainAnswerDetail().getTrainDetail();
|
||||||
answerDetailList = Objects.isNull(answerDetailList) ? Collections.emptyList() : answerDetailList;
|
answerDetailList = Objects.isNull(answerDetailList) ? Collections.emptyList() : answerDetailList;
|
||||||
// BusinessExceptionAssertEnum.DATA_ERROR.assertTrue(allDetailVOList.size() == answerDetailList.size(),String.format("场景实训[%s] 评分规则与提交的答案数量不陪配",puq.getQuestionId()));
|
// BusinessExceptionAssertEnum.DATA_ERROR.assertTrue(allDetailVOList.size() == answerDetailList.size(),String.format("场景实训[%s] 评分规则与提交的答案数量不陪配",puq.getQuestionId()));
|
||||||
@ -181,12 +180,6 @@ public class PaperUserSubmitAnswerService {
|
|||||||
}
|
}
|
||||||
resultAnswerDetailList.add(answerDetail);
|
resultAnswerDetailList.add(answerDetail);
|
||||||
}
|
}
|
||||||
/* answerDetailList = answerDetailList.stream().peek(d->{
|
|
||||||
if(Objects.isNull(d.getScore())){
|
|
||||||
d.setScore(0F);
|
|
||||||
d.setNotExistAppend(true);
|
|
||||||
}
|
|
||||||
}).collect(Collectors.toList());*/
|
|
||||||
req.getTrainAnswerDetail().setTrainDetail(resultAnswerDetailList);
|
req.getTrainAnswerDetail().setTrainDetail(resultAnswerDetailList);
|
||||||
return new TrainAnswerVO(PaperQuestionState.SECEN_CUL,req.getTrainAnswerDetail());
|
return new TrainAnswerVO(PaperQuestionState.SECEN_CUL,req.getTrainAnswerDetail());
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ public class StompTest {
|
|||||||
// List<TrainPosition> list = lt.readSource("d:\\t.txt");
|
// List<TrainPosition> list = lt.readSource("d:\\t.txt");
|
||||||
// runToLeft(stompSession,"001");
|
// runToLeft(stompSession,"001");
|
||||||
// runToRight(stompSession,"002");
|
// runToRight(stompSession,"002");
|
||||||
list = lt.query(list,"004", Section.SectionRoadType.LEFT);
|
// list = lt.query(list,"004", Section.SectionRoadType.LEFT);
|
||||||
// list = lt.query(list, Lists.newArrayList("015","037"), Section.SectionRoadType.RIGHT);
|
// list = lt.query(list, Lists.newArrayList("015","037"), Section.SectionRoadType.RIGHT);
|
||||||
send(stompSession,list);
|
send(stompSession,list);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user