|
|
|
@ -62,15 +62,6 @@ public class IndustryDemandAnalysisController {
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public ResultEntity uploadExcel(@RequestBody StuIndustryAnalysisDTO analysisDTO) {
|
|
|
|
public ResultEntity uploadExcel(@RequestBody StuIndustryAnalysisDTO analysisDTO) {
|
|
|
|
|
|
|
|
|
|
|
|
//查询数据
|
|
|
|
|
|
|
|
HyxqfxStuAnswerExample example = new HyxqfxStuAnswerExample();
|
|
|
|
|
|
|
|
example.createCriteria().andUserIdEqualTo(analysisDTO.getUserId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<HyxqfxStuAnswer> hyxqfxStuAnswerList = hyxqfxStuAnswerMapper.selectByExample(example);
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(hyxqfxStuAnswerList)) {
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//读取文件内容 批量导入excel中 以文件名区分
|
|
|
|
//读取文件内容 批量导入excel中 以文件名区分
|
|
|
|
Map<String, Double> yearMap = new HashMap<>();
|
|
|
|
Map<String, Double> yearMap = new HashMap<>();
|
|
|
|
yearMap.put("2018年",0.28);
|
|
|
|
yearMap.put("2018年",0.28);
|
|
|
|
@ -116,7 +107,23 @@ public class IndustryDemandAnalysisController {
|
|
|
|
count ++;
|
|
|
|
count ++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BigDecimal subtract = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
//查询数据
|
|
|
|
|
|
|
|
HyxqfxStuAnswerExample example = new HyxqfxStuAnswerExample();
|
|
|
|
|
|
|
|
example.createCriteria().andUserIdEqualTo(analysisDTO.getUserId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<HyxqfxStuAnswer> hyxqfxStuAnswerList = hyxqfxStuAnswerMapper.selectByExample(example);
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(hyxqfxStuAnswerList)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HyxqfxStuAnswer hyxqfxStuAnswer = hyxqfxStuAnswerList.get(0);
|
|
|
|
|
|
|
|
hyxqfxStuAnswer.setErrorNumber(count);
|
|
|
|
|
|
|
|
String jsonString = JSONObject.toJSONString(analysisDTO);
|
|
|
|
|
|
|
|
hyxqfxStuAnswer.setAnswer(jsonString);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hyxqfxStuAnswerMapper.updateByPrimaryKeyWithBLOBs(hyxqfxStuAnswer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
//学生答案
|
|
|
|
//学生答案
|
|
|
|
String jsonString = JSONObject.toJSONString(analysisDTO);
|
|
|
|
String jsonString = JSONObject.toJSONString(analysisDTO);
|
|
|
|
HyxqfxStuAnswer hyxqfxStuAnswer = new HyxqfxStuAnswer();
|
|
|
|
HyxqfxStuAnswer hyxqfxStuAnswer = new HyxqfxStuAnswer();
|
|
|
|
@ -126,27 +133,18 @@ public class IndustryDemandAnalysisController {
|
|
|
|
hyxqfxStuAnswer.setErrorNumber(count);
|
|
|
|
hyxqfxStuAnswer.setErrorNumber(count);
|
|
|
|
|
|
|
|
|
|
|
|
hyxqfxStuAnswerMapper.insertSelective(hyxqfxStuAnswer);
|
|
|
|
hyxqfxStuAnswerMapper.insertSelective(hyxqfxStuAnswer);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BigDecimal subtract = BigDecimal.valueOf(100).subtract(Convert.toBigDecimal(count));
|
|
|
|
subtract = BigDecimal.valueOf(100).subtract(Convert.toBigDecimal(count));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scoreService.selectByUserId(analysisDTO.getUserId(), Constant.PRO_SCXQWJ,Constant.MODULE_HYXQFX,subtract,analysisDTO.getContext());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// StuGrade stuGrade = new StuGrade(Constant.PRO_SCXQWJ,
|
|
|
|
|
|
|
|
// Constant.MODULE_HYXQFX,
|
|
|
|
|
|
|
|
// Convert.toBigDecimal(subtract),
|
|
|
|
|
|
|
|
// analysisDTO.getSchoolId(),
|
|
|
|
|
|
|
|
// analysisDTO.getUserId(),
|
|
|
|
|
|
|
|
// analysisDTO.getName(),
|
|
|
|
|
|
|
|
// analysisDTO.getClassId(),
|
|
|
|
|
|
|
|
// analysisDTO.getClassName(),
|
|
|
|
|
|
|
|
// analysisDTO.getContext());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Boolean aBoolean = scoreService.insertScore(analysisDTO.getUserId(), Constant.PRO_SCXQWJ,Constant.MODULE_HYXQFX,subtract,analysisDTO.getContext());
|
|
|
|
|
|
|
|
// scoreService.insertScore(userId, Constant.PRO_GYQDGL, Constant.MODULE_CGXQYC, BigDecimal.valueOf(100 - errorCount), null);
|
|
|
|
|
|
|
|
if(aBoolean){
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "提交成功");
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "提交失败");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "上传成功");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -170,15 +168,17 @@ public class IndustryDemandAnalysisController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void jiaoYanCodeSize(String code){
|
|
|
|
@ApiOperation("重新实训")
|
|
|
|
String[] strings = code.split(",");
|
|
|
|
@GetMapping("/restartExperment")
|
|
|
|
if (strings.length>=20)
|
|
|
|
@AnonymousAccess
|
|
|
|
{
|
|
|
|
public ResultEntity restartExperment(@ApiParam("用户ID") String userId) {
|
|
|
|
//计分规则
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
//查询学生答题数据,删除成绩
|
|
|
|
|
|
|
|
HyxqfxStuAnswerExample example = new HyxqfxStuAnswerExample();
|
|
|
|
|
|
|
|
example.createCriteria().andUserIdEqualTo(userId);
|
|
|
|
|
|
|
|
hyxqfxStuAnswerMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|