|
|
|
@ -8,12 +8,14 @@ import com.sztzjy.fund_investment.mapper.FlowMapper;
|
|
|
|
|
import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper;
|
|
|
|
|
import com.sztzjy.fund_investment.mapper.TopicsMapper;
|
|
|
|
|
import com.sztzjy.fund_investment.mapper.UserMapper;
|
|
|
|
|
import com.sztzjy.fund_investment.service.PerformanceScoreService;
|
|
|
|
|
import com.sztzjy.fund_investment.service.TopicService;
|
|
|
|
|
import com.sztzjy.fund_investment.util.ResultEntity;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
@ -37,6 +39,8 @@ public class TopicController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private PerformanceScoreMapper performanceScoreMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private PerformanceScoreService performanceScoreService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserMapper userMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private FlowMapper flowMapper;
|
|
|
|
@ -62,8 +66,9 @@ public class TopicController {
|
|
|
|
|
@GetMapping("getRandomTopic")
|
|
|
|
|
@ApiOperation("知识测评,项目估值,项目尽调,答题页面返回随机6条数据")
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
public ResultEntity<List<TopicsWithBLOBs>> getRandomTopic(@ApiParam("题目来源模块:知识测评题库,项目尽调题库,项目估值题库") @RequestParam String module) {
|
|
|
|
|
return new ResultEntity<List<TopicsWithBLOBs>>(topicService.getRandomTopic(module));
|
|
|
|
|
public ResultEntity<List<TopicsWithBLOBs>> getRandomTopic(@ApiParam("题目来源模块:知识测评题库,项目尽调题库,项目估值题库") @RequestParam String module,
|
|
|
|
|
@RequestParam String flowId) {
|
|
|
|
|
return new ResultEntity<List<TopicsWithBLOBs>>(topicService.getRandomTopic(module, flowId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -71,11 +76,11 @@ public class TopicController {
|
|
|
|
|
* @author xcj
|
|
|
|
|
* @Date 2023/11/21
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("getIPOTopicTwo")
|
|
|
|
|
@PostMapping("getIPOTopicTwo")
|
|
|
|
|
@ApiOperation("IPO页面弹窗2使用返回随机6条数据")
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
public ResultEntity<List<TopicsWithBLOBs>> getIPOTopicTwo() {
|
|
|
|
|
return new ResultEntity<List<TopicsWithBLOBs>>(topicService.getIPOTopicTwo());
|
|
|
|
|
public ResultEntity<List<TopicsWithBLOBs>> getIPOTopicTwo(@RequestParam String flowId) {
|
|
|
|
|
return new ResultEntity<List<TopicsWithBLOBs>>(topicService.getIPOTopicTwo(flowId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -86,8 +91,8 @@ public class TopicController {
|
|
|
|
|
@PostMapping("getRightScore/{flowId}")
|
|
|
|
|
@ApiOperation("知识测评,项目估值,项目尽调,IPO申请,判断答案对错算分")
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
public ResultEntity<List<String>> getRightScore(@ApiParam("需要ID和用户填写的答案") @PathVariable("flowId") String flowId,
|
|
|
|
|
@RequestBody List<TopicsWithBLOBs> topics) {
|
|
|
|
|
public ResultEntity<List<String>> getRightScore(@PathVariable("flowId") String flowId,
|
|
|
|
|
@ApiParam("需要ID和用户填写的答案、和module") @RequestBody List<TopicsWithBLOBs> topics) {
|
|
|
|
|
return topicService.getRightScore(topics, flowId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -99,8 +104,9 @@ public class TopicController {
|
|
|
|
|
@PostMapping("getTopicRecord")
|
|
|
|
|
@ApiOperation("知识测评、项目估值、项目尽调,IPO申请,回显答题记录")
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
public ResultEntity<List<TopicRecord>> getTopicRecord(@ApiParam("getRightScore返回的ID集合") @RequestBody List<String> ids) {
|
|
|
|
|
return new ResultEntity<List<TopicRecord>>(topicService.getTopicRecord(ids));
|
|
|
|
|
public ResultEntity<List<TopicRecord>> getTopicRecord(@ApiParam("参考导入接口") @RequestParam String module,
|
|
|
|
|
@RequestParam String flowId) {
|
|
|
|
|
return new ResultEntity<List<TopicRecord>>(topicService.getTopicRecord(flowId, module));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -134,9 +140,13 @@ public class TopicController {
|
|
|
|
|
@RequestParam String flowId,
|
|
|
|
|
@RequestParam String schoolId) {
|
|
|
|
|
|
|
|
|
|
//不允许重复提交
|
|
|
|
|
PerformanceScore byFlowId = performanceScoreService.getByFlowId(flowId);
|
|
|
|
|
if (byFlowId != null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//系统的第一个流程,新增一个得分对象
|
|
|
|
|
PerformanceScore performanceScore = new PerformanceScore();
|
|
|
|
|
|
|
|
|
|
//观看2分钟以上得满分5分,否则不得分
|
|
|
|
|
BigDecimal score;
|
|
|
|
|
if (time >= 120) {
|
|
|
|
@ -155,7 +165,7 @@ public class TopicController {
|
|
|
|
|
User userTable = userMapper.selectByPrimaryKey(flow.getUserid());
|
|
|
|
|
performanceScore.setClassId(userTable.getClassId());
|
|
|
|
|
performanceScore.setPracticalCognitionTime(new Date());
|
|
|
|
|
|
|
|
|
|
performanceScore.setTotalScore(BigDecimal.ZERO);
|
|
|
|
|
//防止后面算分有问题,在第一个步骤初始化成0
|
|
|
|
|
// performanceScore.setKnowledgeAssessmentScore(BigDecimal.ZERO);
|
|
|
|
|
// performanceScore.setFundraisingScore(BigDecimal.ZERO);
|
|
|
|
|