loading登录,以及获取用户成绩

pull/1/head
unclekh 5 years ago
parent 4de1e30a99
commit 73d71eb491
  1. 2
      blockchain-common/blockchain-common-base/src/main/java/com/blockchain/common/base/util/YyyfUserDtoUtils.java
  2. 10
      blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/controller/TeachingGradeController.java
  3. 5
      blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/service/impl/AssessUserServiceImpl.java
  4. 4
      spring-cloud/spring-cloud-config/src/main/resources/properties/dbconf-dev.yml

@ -23,10 +23,12 @@ public class YyyfUserDtoUtils {
public static YyyfUserDto getYyyfUserDto(HttpServletRequest request, RedisTemplate redisTemplate) {
YyyfUserDto yyyfUserDto = null;
String yyyfTtoken = request.getHeader(BaseConstant.YYYF_TOKEN_HEADER);
if(yyyfTtoken!=null) {
//如果有token,拿到用户信息,与以渔有方进行绑定
if (redisTemplate.hasKey(yyyfTtoken)) {
yyyfUserDto = (YyyfUserDto) redisTemplate.opsForValue().get(yyyfTtoken);
}
}
return yyyfUserDto;
}
}

@ -76,12 +76,9 @@ public class TeachingGradeController {
@GetMapping(value = "/getGradeData",produces = {"application/text;charset=UTF-8"})
@ResponseBody
@SuppressWarnings("all")
public void getGradeData(HttpServletRequest request, HttpServletResponse response) {
public void getGradeData( String issueId,Integer totalNum, String caseId, HttpServletResponse response) {
String issueId = request.getParameter("issueId");
String totalNumStr = request.getParameter("totalNum");
String projectId = request.getParameter("caseId");//项目id
Integer totalNum = Integer.valueOf(totalNumStr);
JSONObject json = new JSONObject();
try {
@ -89,7 +86,7 @@ public class TeachingGradeController {
int answerCount= assessUserService.selectCountByByIssueId(issueId);
//获取案例信息
HashOperations<String, String, ExamPaperDto> examPaperOpsForHash = redisTemplate.opsForHash();
ExamPaperDto examPaperDto = examPaperOpsForHash.get(YyyfConstant.EXAM_PAPER_KEY, projectId);
ExamPaperDto examPaperDto = examPaperOpsForHash.get(YyyfConstant.EXAM_PAPER_KEY, caseId);
List<TrainCaseTargetDto> trainCaseTargeList = examPaperDto.getTrainCaseTargeList();
Map<String, Object> wrongStatistics = null;//错误信息
@ -221,6 +218,7 @@ public class TeachingGradeController {
minErrorRateInfo.put("errorRate", errorRate);
}
}
i++;
}
wrongStatistics.put("maxErrorRateInfo", maxErrorRateInfo);
wrongStatistics.put("minErrorRateInfo", minErrorRateInfo);

@ -1,11 +1,9 @@
package com.blockchain.server.yyyf.service.impl;
import com.blockchain.common.base.constant.YyyfConstant;
import com.blockchain.server.train.dto.ExamPaperDto;
import com.blockchain.server.train.dto.TrainCaseTargetDto;
import com.blockchain.server.yyyf.dto.AssessUserDto;
import com.blockchain.server.yyyf.dto.ExamDto;
import com.blockchain.server.yyyf.dto.PractiseProDto;
import com.blockchain.server.yyyf.dto.YyyfStudentAnswerDto;
import com.blockchain.server.yyyf.entity.AssessUser;
import com.blockchain.server.yyyf.entity.AssessUserTarget;
@ -13,10 +11,8 @@ import com.blockchain.server.yyyf.enums.UserEnums;
import com.blockchain.server.yyyf.exceprion.UserException;
import com.blockchain.server.yyyf.mapper.AssessUserMapper;
import com.blockchain.server.yyyf.mapper.AssessUserTargetMapper;
import com.blockchain.server.yyyf.mapper.AssessUserTaskMapper;
import com.blockchain.server.yyyf.service.AssessUserService;
import com.blockchain.server.yyyf.utils.HttpClientUtil;
import io.swagger.models.auth.In;
import lombok.SneakyThrows;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -29,7 +25,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;

@ -1,8 +1,8 @@
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/zhixinlian?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: zhixinlian
password: zhixinlian123coin!678
username: root
password: 123456
driver-class-name: com.mysql.jdbc.Driver
druid:
initial-size: 1

Loading…
Cancel
Save