|
|
|
@ -64,6 +64,7 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
|
stuScoreCenter.setLearningProjects(string);
|
|
|
|
|
stuScoreCenter.setUserId(userId);
|
|
|
|
|
stuScoreCenter.setScoreWeight(tchModuleWeith.getCaseStudyWeith());
|
|
|
|
|
stuScoreCenter.setTrainingTotalScore(BigDecimal.valueOf(100));
|
|
|
|
|
stuScoreCenters.add(stuScoreCenter);
|
|
|
|
|
return stuScoreCenters;
|
|
|
|
|
}else if(module.equals(Constant.SCORE_OVERVIEW) || module.isEmpty()){
|
|
|
|
@ -105,6 +106,7 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
|
if(key.equals(Constant.COMPREHENSIVE_CASE_SCORE)){ //综合案例排名
|
|
|
|
|
stuScoreCenter.setClassRanking(stuUser.getComprehensiveCaseRank());
|
|
|
|
|
}
|
|
|
|
|
stuScoreCenter.setTrainingTotalScore(BigDecimal.valueOf(100));
|
|
|
|
|
list.add(stuScoreCenter);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -145,6 +147,7 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
|
}
|
|
|
|
|
stuScoreCenter.setTrainingDuration(duration);
|
|
|
|
|
stuScoreCenter.setTrainingScore(score);
|
|
|
|
|
stuScoreCenter.setTrainingTotalScore(BigDecimal.valueOf(100));
|
|
|
|
|
|
|
|
|
|
//总成绩排名
|
|
|
|
|
stuScoreCenter.setClassRanking(stuUser.getTotalRank());
|
|
|
|
@ -174,7 +177,7 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
|
|
|
|
|
|
//查询对应模块所属成绩详情
|
|
|
|
|
StuScoreDetailsExample scoreDetailsExample=new StuScoreDetailsExample();
|
|
|
|
|
scoreDetailsExample.createCriteria().andAscriptionEqualTo(stuScoreCenters.get(0).getAscription());
|
|
|
|
|
scoreDetailsExample.createCriteria().andAscriptionEqualTo(stuScoreCenters.get(0).getAscription()).andUserIdEqualTo(userId);
|
|
|
|
|
List<StuScoreDetails> stuScoreDetails = stuScoreDetailsMapper.selectByExample(scoreDetailsExample);
|
|
|
|
|
|
|
|
|
|
//同步权重信息
|
|
|
|
@ -183,28 +186,36 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
|
List<StuUser> stuUsers = stuUserMapper.selectByExample(stuUserExample);
|
|
|
|
|
String schoolId = stuUsers.get(0).getSchoolId();
|
|
|
|
|
|
|
|
|
|
//更新权重信息
|
|
|
|
|
List<StuScoreDetails> scoreDetails=new ArrayList<>();
|
|
|
|
|
for (int i = 0; i < stuScoreDetails.size(); i++) {
|
|
|
|
|
TchPublicResourceWeightExample weightExample = new TchPublicResourceWeightExample();
|
|
|
|
|
weightExample.createCriteria().andSchoolIdEqualTo(schoolId).andModuleEqualTo(stuScoreDetails.get(0).getModule());
|
|
|
|
|
weightExample.createCriteria().andSchoolIdEqualTo(schoolId)
|
|
|
|
|
.andModuleEqualTo(stuScoreDetails.get(i).getModule())
|
|
|
|
|
.andAscriptionEqualTo(stuScoreDetails.get(i).getAscription());
|
|
|
|
|
List<TchPublicResourceWeight> tchConceptualTechnologyWeights = tchPublicResourceWeightMapper.selectByExample(weightExample);
|
|
|
|
|
|
|
|
|
|
if(tchConceptualTechnologyWeights.isEmpty()){
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < stuScoreDetails.size(); i++) {
|
|
|
|
|
TchPublicResourceWeight tchConceptualTechnologyWeight=new TchPublicResourceWeight(schoolId,stuScoreDetails.get(0).getModule(),stuScoreDetails.get(0).getAscription());
|
|
|
|
|
TchPublicResourceWeight tchConceptualTechnologyWeight=new TchPublicResourceWeight(schoolId,stuScoreDetails.get(i).getModule(),stuScoreDetails.get(i).getAscription());
|
|
|
|
|
tchPublicResourceWeightMapper.insert(tchConceptualTechnologyWeight);
|
|
|
|
|
tchConceptualTechnologyWeights.add(tchConceptualTechnologyWeight);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TchPublicResourceWeight tchPublicResourceWeight = tchConceptualTechnologyWeights.get(0);
|
|
|
|
|
|
|
|
|
|
List<StuScoreDetails> scoreDetails=new ArrayList<>();
|
|
|
|
|
for (StuScoreDetails stuScoreDetail : stuScoreDetails) {
|
|
|
|
|
StuScoreDetails details = new StuScoreDetails(stuScoreDetail, tchPublicResourceWeight);
|
|
|
|
|
|
|
|
|
|
StuScoreDetails details = new StuScoreDetails(stuScoreDetails.get(i), tchPublicResourceWeight);
|
|
|
|
|
scoreDetails.add(details);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//取出分数累加以及完成情况赋值到成绩中心
|
|
|
|
|
for (int i = 0; i < stuScoreCenters.size(); i++) {
|
|
|
|
|
BigDecimal total=BigDecimal.valueOf(0);
|
|
|
|
@ -212,7 +223,12 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
|
for (int j = 0; j < scoreDetails.size(); j++) {
|
|
|
|
|
if(stuScoreCenters.get(i).getModule().equals(scoreDetails.get(j).getModule())){
|
|
|
|
|
//计算该模块总分
|
|
|
|
|
total=bigDecimalUtils.add(total.toString(),scoreDetails.get(j).getTotalScore().toString());
|
|
|
|
|
if(scoreDetails.get(j).getLearningProjects().equals("实训报告")){
|
|
|
|
|
scoreDetails.get(j).setScoreProject(0.0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BigDecimal mul = bigDecimalUtils.mul(scoreDetails.get(j).getScoreProject().toString(), scoreDetails.get(j).getScoreWeight().toString());
|
|
|
|
|
total=bigDecimalUtils.add(total.toString(),mul.toString());
|
|
|
|
|
a++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -234,6 +250,7 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
|
|
|
|
|
|
stuScoreCenter.setLearningProjects(string);
|
|
|
|
|
stuScoreCenter.setUserId(userId);
|
|
|
|
|
stuScoreCenter.setTrainingTotalScore(BigDecimal.valueOf(100));
|
|
|
|
|
|
|
|
|
|
stuScoreCenters.add(stuScoreCenter);
|
|
|
|
|
|
|
|
|
@ -252,6 +269,11 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
|
StuScoreCenterExample example=new StuScoreCenterExample();
|
|
|
|
|
example.createCriteria().andUserIdEqualTo(userId).andModuleEqualTo(module).andAscriptionEqualTo(ascription);
|
|
|
|
|
List<StuScoreCenter> stuScoreCenters = stuScoreCenterMapper.selectByExample(example);
|
|
|
|
|
|
|
|
|
|
//秒转分钟计算分数
|
|
|
|
|
double i = (double) viewingTime/ 60;
|
|
|
|
|
int floor = (int) Math.floor(i);
|
|
|
|
|
|
|
|
|
|
if(stuScoreCenters.isEmpty()){
|
|
|
|
|
StuScoreCenter stuScoreCenter=new StuScoreCenter();
|
|
|
|
|
Integer uuid = UUID.randomUUID().toString().replaceAll("-", "").hashCode();
|
|
|
|
@ -262,7 +284,7 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
|
stuScoreCenter.setModule(module);
|
|
|
|
|
stuScoreCenter.setAscription(ascription);
|
|
|
|
|
stuScoreCenter.setCompletionStatus("未完成");
|
|
|
|
|
stuScoreCenter.setTrainingDuration(viewingTime);
|
|
|
|
|
stuScoreCenter.setTrainingDuration(floor);
|
|
|
|
|
stuScoreCenter.setTrainingTotalScore(BigDecimal.valueOf(100));
|
|
|
|
|
stuScoreCenter.setTrainingScoreOne(BigDecimal.valueOf(0));
|
|
|
|
|
stuScoreCenter.setTrainingScoreTwo(BigDecimal.valueOf(0));
|
|
|
|
@ -272,7 +294,7 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
|
stuScoreCenterMapper.insert(stuScoreCenter);
|
|
|
|
|
}else {
|
|
|
|
|
StuScoreCenter stuScoreCenter = stuScoreCenters.get(0);
|
|
|
|
|
BigDecimal add = bigDecimalUtils.add(String.valueOf(viewingTime), String.valueOf(stuScoreCenter.getTrainingDuration()));
|
|
|
|
|
BigDecimal add = bigDecimalUtils.add(String.valueOf(floor), String.valueOf(stuScoreCenter.getTrainingDuration()));
|
|
|
|
|
stuScoreCenter.setTrainingDuration(Integer.valueOf(String.valueOf(add)));
|
|
|
|
|
|
|
|
|
|
stuScoreCenterMapper.updateByPrimaryKey(stuScoreCenter);
|
|
|
|
@ -356,12 +378,17 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
|
private void commonMethods(String userId, List<StuScoreCenter> creditPortraits, String[] creditPortrait,String ascription,TchModuleWeith tchModuleWeith) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!creditPortraits.isEmpty()){
|
|
|
|
|
for (String s : creditPortrait) {
|
|
|
|
|
for (int j = 0; j < creditPortraits.size(); j++) {
|
|
|
|
|
if (s.equals(creditPortraits.get(j).getModule())) {
|
|
|
|
|
int a=0;
|
|
|
|
|
for (StuScoreCenter portrait : creditPortraits) {
|
|
|
|
|
if (s.equals(portrait.getModule())) {
|
|
|
|
|
a++;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(a==0){
|
|
|
|
|
StuScoreCenter stuScoreCenter = new StuScoreCenter(s,tchModuleWeith,userId,ascription);
|
|
|
|
|
creditPortraits.add(stuScoreCenter);
|
|
|
|
|
}
|
|
|
|
|