|
|
|
@ -39,6 +39,7 @@ import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.BigInteger;
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
|
import java.nio.file.Files;
|
|
|
|
|
import java.util.*;
|
|
|
|
@ -302,6 +303,9 @@ public class StuConceptBlockServiceImpl implements StuConceptBlockService {
|
|
|
|
|
throw new RuntimeException("老师已评分,请勿再次提交报告");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//多次上传 更新 上限就六个
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StuPracticalTrainingReport report = stuPracticalTrainingReports.get(0);
|
|
|
|
|
//更新操作
|
|
|
|
|
String upload = fileUtil.upload(file);
|
|
|
|
@ -310,6 +314,8 @@ public class StuConceptBlockServiceImpl implements StuConceptBlockService {
|
|
|
|
|
report.setSize((int) file.getSize());
|
|
|
|
|
report.setReportName(file.getOriginalFilename());
|
|
|
|
|
stuPracticalTrainingReportMapper.updateByPrimaryKey(report);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return report;
|
|
|
|
|
} else {
|
|
|
|
|
//第一次上传
|
|
|
|
@ -325,6 +331,44 @@ public class StuConceptBlockServiceImpl implements StuConceptBlockService {
|
|
|
|
|
report.setSchoolId(stuBlockProductWithBLOBs.getSchoolId());
|
|
|
|
|
report.setReportName(file.getOriginalFilename());
|
|
|
|
|
stuPracticalTrainingReportMapper.insertSelective(report);
|
|
|
|
|
|
|
|
|
|
//写入成绩表 进度
|
|
|
|
|
StuScoreDetailsExample example = new StuScoreDetailsExample();
|
|
|
|
|
example.createCriteria().andUserIdEqualTo(stuBlockProductWithBLOBs.getUserId()).andLearningProjectsEqualTo("实验报告");
|
|
|
|
|
List<StuScoreDetails> stuScoreDetailList = stuScoreDetailsMapper.selectByExample(example);
|
|
|
|
|
if (stuScoreDetailList.isEmpty()) {
|
|
|
|
|
//第一次插入
|
|
|
|
|
StuScoreDetails stuScoreDetails = new StuScoreDetails();
|
|
|
|
|
stuScoreDetails.setId(IdUtil.simpleUUID());
|
|
|
|
|
stuScoreDetails.setLearningProjects("实验报告");
|
|
|
|
|
stuScoreDetails.setSerialNumber(5);
|
|
|
|
|
stuScoreDetails.setScoreWeight(0.2);
|
|
|
|
|
stuScoreDetails.setSchedule(17.0);
|
|
|
|
|
stuScoreDetails.setUserId(stuBlockProductWithBLOBs.getUserId());
|
|
|
|
|
stuScoreDetailsMapper.insertSelective(stuScoreDetails);
|
|
|
|
|
} else {
|
|
|
|
|
StuScoreDetails stuScoreDetails = stuScoreDetailList.get(0);
|
|
|
|
|
|
|
|
|
|
StuPracticalTrainingReportExample trainingReportExample = new StuPracticalTrainingReportExample();
|
|
|
|
|
stuPracticalTrainingReportExample.createCriteria().andUseridEqualTo(stuBlockProductWithBLOBs.getUserId());
|
|
|
|
|
List<StuPracticalTrainingReport> stuPracticalTrainingReportList = stuPracticalTrainingReportMapper.selectByExample(trainingReportExample);
|
|
|
|
|
if (stuPracticalTrainingReportList.size() == 6) {
|
|
|
|
|
stuScoreDetails.setCompletionStatus("1");
|
|
|
|
|
}
|
|
|
|
|
int size = stuPracticalTrainingReportList.size();
|
|
|
|
|
BigDecimal bigDecimalSize = BigDecimal.valueOf(size);
|
|
|
|
|
BigDecimal bigDecimalValue = BigDecimal.valueOf(6);
|
|
|
|
|
BigDecimal info = bigDecimalSize.divide(bigDecimalValue,2,BigDecimal.ROUND_UP).multiply(BigDecimal.valueOf(100));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// System.out.println(info);
|
|
|
|
|
stuScoreDetails.setSchedule(info.doubleValue());
|
|
|
|
|
stuScoreDetails.setUserId(stuBlockProductWithBLOBs.getUserId());
|
|
|
|
|
stuScoreDetailsMapper.updateByPrimaryKeySelective(stuScoreDetails);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return report;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -332,6 +376,7 @@ public class StuConceptBlockServiceImpl implements StuConceptBlockService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* @author whb
|
|
|
|
|
* @Date 2023/10/11
|
|
|
|
|