|
|
@ -11,10 +11,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @author tz
|
|
|
|
* @author tz
|
|
|
@ -33,14 +30,20 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<StuScoreCenter> getScore(String userId, String module) {
|
|
|
|
public List<StuScoreCenter> getScore(String userId, String module) {
|
|
|
|
Map<String, List<StuScoreCenter>> totalScoreCalculation = this.getTotalScoreCalculation(userId);
|
|
|
|
Map<String, List<StuScoreCenter>> totalScoreCalculation = this.getTotalScoreCalculation(userId);
|
|
|
|
if(!module.equals(Constant.SCORE_OVERVIEW)){
|
|
|
|
if(module.equals(Constant.COMPREHENSIVE_CASE_SCORE)){
|
|
|
|
//取到对应值
|
|
|
|
//取到对应值
|
|
|
|
List<StuScoreCenter> stuScoreCenters = totalScoreCalculation.get(module);
|
|
|
|
List<StuScoreCenter> stuScoreCenters = totalScoreCalculation.get(module);
|
|
|
|
// TODO: 2024/4/24 计算总成绩
|
|
|
|
// TODO: 2024/4/24 计算总成绩
|
|
|
|
StuScoreCenter stuScoreCenter = this.calculateTotalScore(stuScoreCenters, module);
|
|
|
|
|
|
|
|
|
|
|
|
//学习项目(在成绩前面加个总)
|
|
|
|
|
|
|
|
StringBuilder stringBuilder=new StringBuilder(module);
|
|
|
|
|
|
|
|
String string = stringBuilder.insert(4, "总").toString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StuScoreCenter stuScoreCenter = this.calculateTotalScore(stuScoreCenters, string);
|
|
|
|
stuScoreCenters.add(stuScoreCenter);
|
|
|
|
stuScoreCenters.add(stuScoreCenter);
|
|
|
|
return stuScoreCenters;
|
|
|
|
return stuScoreCenters;
|
|
|
|
}else {
|
|
|
|
}else if(module.equals(Constant.SCORE_OVERVIEW) || module.isEmpty()){
|
|
|
|
|
|
|
|
module="成绩总览";
|
|
|
|
//查询用户信息,插入模块排名
|
|
|
|
//查询用户信息,插入模块排名
|
|
|
|
StuUser stuUser = stuUserMapper.selectByPrimaryKey(userId);
|
|
|
|
StuUser stuUser = stuUserMapper.selectByPrimaryKey(userId);
|
|
|
|
|
|
|
|
|
|
|
@ -48,23 +51,37 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
for(Map.Entry<String,List<StuScoreCenter>> stringListEntry:totalScoreCalculation.entrySet()){
|
|
|
|
for(Map.Entry<String,List<StuScoreCenter>> stringListEntry:totalScoreCalculation.entrySet()){
|
|
|
|
|
|
|
|
|
|
|
|
List<StuScoreCenter> value = stringListEntry.getValue();
|
|
|
|
List<StuScoreCenter> value = stringListEntry.getValue();
|
|
|
|
StuScoreCenter stuScoreCenter = this.calculateTotalScore(value, module);
|
|
|
|
|
|
|
|
//遍历键,根据键取到成绩排名
|
|
|
|
//遍历键,根据键取到成绩排名
|
|
|
|
String key = stringListEntry.getKey();
|
|
|
|
String key = stringListEntry.getKey();
|
|
|
|
if(key.equals(Constant.CREDIT_PORTRAIT)){ //征信画像排名
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(value.isEmpty()){
|
|
|
|
|
|
|
|
StuScoreCenter stuScoreCenter=new StuScoreCenter();
|
|
|
|
|
|
|
|
String substring = key.substring(0, 4);
|
|
|
|
|
|
|
|
stuScoreCenter.setLearningProjects(substring);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
list.add(stuScoreCenter);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
String substring = key.substring(0, 4);
|
|
|
|
|
|
|
|
StuScoreCenter stuScoreCenter = this.calculateTotalScore(value, substring);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(key.equals(Constant.CREDIT_PORTRAIT_SCORE)){ //征信画像排名
|
|
|
|
stuScoreCenter.setClassRanking(stuUser.getCreditPortraitRank());
|
|
|
|
stuScoreCenter.setClassRanking(stuUser.getCreditPortraitRank());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(key.equals(Constant.PERSONAL_CREDIT)){ //个人征信排名
|
|
|
|
if(key.equals(Constant.PERSONAL_CREDIT_SCORE)){ //个人征信排名
|
|
|
|
stuScoreCenter.setClassRanking(stuUser.getPersonalCreditRank());
|
|
|
|
stuScoreCenter.setClassRanking(stuUser.getPersonalCreditRank());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(key.equals(Constant.CORPORATE_CREDIT)){ //企业征信排名
|
|
|
|
if(key.equals(Constant.CORPORATE_CREDIT_SCORE)){ //企业征信排名
|
|
|
|
stuScoreCenter.setClassRanking(stuUser.getCorporateCreditRank());
|
|
|
|
stuScoreCenter.setClassRanking(stuUser.getCorporateCreditRank());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(key.equals(Constant.COMPREHENSIVE_CASE)){ //综合案例排名
|
|
|
|
if(key.equals(Constant.COMPREHENSIVE_CASE_SCORE)){ //综合案例排名
|
|
|
|
stuScoreCenter.setClassRanking(stuUser.getComprehensiveCaseRank());
|
|
|
|
stuScoreCenter.setClassRanking(stuUser.getComprehensiveCaseRank());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
list.add(stuScoreCenter);
|
|
|
|
list.add(stuScoreCenter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StuScoreCenter stuScoreCenter=new StuScoreCenter();
|
|
|
|
StuScoreCenter stuScoreCenter=new StuScoreCenter();
|
|
|
|
//计算总成绩
|
|
|
|
//计算总成绩
|
|
|
@ -77,13 +94,21 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
BigDecimal score=new BigDecimal(0);
|
|
|
|
BigDecimal score=new BigDecimal(0);
|
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
|
//实训时长
|
|
|
|
//实训时长
|
|
|
|
|
|
|
|
if(list.get(i).getTrainingDuration()==null){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
Integer trainingDuration = list.get(i).getTrainingDuration();
|
|
|
|
Integer trainingDuration = list.get(i).getTrainingDuration();
|
|
|
|
duration=duration+trainingDuration;
|
|
|
|
duration=duration+trainingDuration;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//实训得分
|
|
|
|
//实训得分
|
|
|
|
|
|
|
|
if(list.get(i).getTrainingScore()==null){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
BigDecimal trainingScore = list.get(i).getTrainingScore();
|
|
|
|
BigDecimal trainingScore = list.get(i).getTrainingScore();
|
|
|
|
score=bigDecimalUtils.add(score.toString(),trainingScore.toString());
|
|
|
|
score=bigDecimalUtils.add(score.toString(),trainingScore.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
stuScoreCenter.setTrainingDuration(duration);
|
|
|
|
stuScoreCenter.setTrainingDuration(duration);
|
|
|
|
stuScoreCenter.setTrainingScore(score);
|
|
|
|
stuScoreCenter.setTrainingScore(score);
|
|
|
|
|
|
|
|
|
|
|
@ -93,6 +118,47 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
list.add(stuScoreCenter);
|
|
|
|
list.add(stuScoreCenter);
|
|
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
// TODO: 2024/4/28 如果是征信画像、个人征信、企业征信
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 实训时长统计
|
|
|
|
|
|
|
|
* @param userId 用户ID
|
|
|
|
|
|
|
|
* @param module 模块
|
|
|
|
|
|
|
|
* @param viewingTime 观看时间
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void trainingDurationStatistics(String userId, String module, Integer viewingTime,String ascription) {
|
|
|
|
|
|
|
|
StuScoreCenterExample example=new StuScoreCenterExample();
|
|
|
|
|
|
|
|
example.createCriteria().andUserIdEqualTo(userId).andModuleEqualTo(module).andAscriptionEqualTo(ascription);
|
|
|
|
|
|
|
|
List<StuScoreCenter> stuScoreCenters = stuScoreCenterMapper.selectByExample(example);
|
|
|
|
|
|
|
|
if(stuScoreCenters.isEmpty()){
|
|
|
|
|
|
|
|
StuScoreCenter stuScoreCenter=new StuScoreCenter();
|
|
|
|
|
|
|
|
Integer uuid = UUID.randomUUID().toString().replaceAll("-", "").hashCode();
|
|
|
|
|
|
|
|
uuid = uuid < 0 ? -uuid : uuid;//String.hashCode() 值会为空
|
|
|
|
|
|
|
|
stuScoreCenter.setId(uuid);
|
|
|
|
|
|
|
|
stuScoreCenter.setUserId(userId);
|
|
|
|
|
|
|
|
stuScoreCenter.setLearningProjects(module);
|
|
|
|
|
|
|
|
stuScoreCenter.setModule(module);
|
|
|
|
|
|
|
|
stuScoreCenter.setAscription(ascription);
|
|
|
|
|
|
|
|
stuScoreCenter.setCompletionStatus("未完成");
|
|
|
|
|
|
|
|
stuScoreCenter.setTrainingDuration(viewingTime);
|
|
|
|
|
|
|
|
stuScoreCenter.setTrainingTotalScore(BigDecimal.valueOf(100));
|
|
|
|
|
|
|
|
stuScoreCenter.setTrainingScoreOne(BigDecimal.valueOf(0));
|
|
|
|
|
|
|
|
stuScoreCenter.setTrainingScoreTwo(BigDecimal.valueOf(0));
|
|
|
|
|
|
|
|
stuScoreCenter.setTrainingScoreThree(BigDecimal.valueOf(0));
|
|
|
|
|
|
|
|
stuScoreCenter.setNumberOfTraining(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stuScoreCenterMapper.insert(stuScoreCenter);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
StuScoreCenter stuScoreCenter = stuScoreCenters.get(0);
|
|
|
|
|
|
|
|
BigDecimal add = bigDecimalUtils.add(String.valueOf(viewingTime), String.valueOf(stuScoreCenter.getTrainingDuration()));
|
|
|
|
|
|
|
|
stuScoreCenter.setTrainingDuration(Integer.valueOf(String.valueOf(add)));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stuScoreCenterMapper.updateByPrimaryKey(stuScoreCenter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -108,44 +174,99 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
List<StuScoreCenter> stuScoreCenters = stuScoreCenterMapper.selectByExample(scoreCenterExample);
|
|
|
|
List<StuScoreCenter> stuScoreCenters = stuScoreCenterMapper.selectByExample(scoreCenterExample);
|
|
|
|
|
|
|
|
|
|
|
|
//征信画像总成绩
|
|
|
|
//征信画像总成绩
|
|
|
|
List<StuScoreCenter> creditPortrait=new ArrayList<>();
|
|
|
|
List<StuScoreCenter> creditPortraits=new ArrayList<>();
|
|
|
|
//个人征信总成绩
|
|
|
|
//个人征信总成绩
|
|
|
|
List<StuScoreCenter> personalCredit =new ArrayList<>();
|
|
|
|
List<StuScoreCenter> personalCredits =new ArrayList<>();
|
|
|
|
//企业征信总成绩
|
|
|
|
//企业征信总成绩
|
|
|
|
List<StuScoreCenter> corporateCredit=new ArrayList<>();
|
|
|
|
List<StuScoreCenter> corporateCredits=new ArrayList<>();
|
|
|
|
//综合案例总成绩
|
|
|
|
//综合案例总成绩
|
|
|
|
List<StuScoreCenter> comprehensiveCase=new ArrayList<>();
|
|
|
|
List<StuScoreCenter> comprehensiveCases=new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,List<StuScoreCenter>> map=new HashMap<>();
|
|
|
|
Map<String,List<StuScoreCenter>> map=new HashMap<>();
|
|
|
|
|
|
|
|
// int a=0;int b=0;int c=0;
|
|
|
|
for (int i = 0; i < stuScoreCenters.size(); i++) {
|
|
|
|
for (int i = 0; i < stuScoreCenters.size(); i++) {
|
|
|
|
StuScoreCenter scoreCenter = stuScoreCenters.get(i);
|
|
|
|
StuScoreCenter scoreCenter = stuScoreCenters.get(i);
|
|
|
|
|
|
|
|
|
|
|
|
if(scoreCenter.getAscription().equals(Constant.CREDIT_PORTRAIT)){
|
|
|
|
if(scoreCenter.getAscription().equals(Constant.CREDIT_PORTRAIT)){
|
|
|
|
creditPortrait.add(scoreCenter);
|
|
|
|
creditPortraits.add(scoreCenter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(scoreCenter.getAscription().equals(Constant.PERSONAL_CREDIT)){
|
|
|
|
if(scoreCenter.getAscription().equals(Constant.PERSONAL_CREDIT)){
|
|
|
|
personalCredit.add(scoreCenter);
|
|
|
|
personalCredits.add(scoreCenter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(scoreCenter.getAscription().equals(Constant.CORPORATE_CREDIT)){
|
|
|
|
if(scoreCenter.getAscription().equals(Constant.CORPORATE_CREDIT)){
|
|
|
|
corporateCredit.add(scoreCenter);
|
|
|
|
corporateCredits.add(scoreCenter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(scoreCenter.getAscription().equals(Constant.COMPREHENSIVE_CASE)){
|
|
|
|
if(scoreCenter.getAscription().equals(Constant.COMPREHENSIVE_CASE)){
|
|
|
|
comprehensiveCase.add(scoreCenter);
|
|
|
|
comprehensiveCases.add(scoreCenter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
String[] creditPortrait={"贷款案例","个人信息与违约","还款行为与违约"};
|
|
|
|
|
|
|
|
String[] personalCredit={"影响因素分析","征信优化分析","征信评级模型"};
|
|
|
|
|
|
|
|
String[] corporateCredit={"影响因素分析","征信优化分析","征信评级模型"};
|
|
|
|
|
|
|
|
String[] comprehensiveCase={"用户画像","个人征信","企业征信"};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
commonMethods(userId, creditPortraits, creditPortrait,"征信画像"); //征信画像
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
commonMethods(userId, personalCredits, personalCredit,"个人征信"); //个人征信
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
commonMethods(userId, corporateCredits, corporateCredit,"企业征信"); //企业征信
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
commonMethods(userId,comprehensiveCases,comprehensiveCase,"综合案例"); //综合案例
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//封装到map
|
|
|
|
//封装到map
|
|
|
|
map.put(Constant.CREDIT_PORTRAIT_SCORE,creditPortrait);
|
|
|
|
map.put(Constant.CREDIT_PORTRAIT_SCORE,creditPortraits);
|
|
|
|
map.put(Constant.PERSONAL_CREDIT_SCORE,personalCredit);
|
|
|
|
map.put(Constant.PERSONAL_CREDIT_SCORE,personalCredits);
|
|
|
|
map.put(Constant.CORPORATE_CREDIT_SCORE,corporateCredit);
|
|
|
|
map.put(Constant.CORPORATE_CREDIT_SCORE,corporateCredits);
|
|
|
|
map.put(Constant.COMPREHENSIVE_CASE_SCORE,comprehensiveCase);
|
|
|
|
map.put(Constant.COMPREHENSIVE_CASE_SCORE,comprehensiveCases);
|
|
|
|
|
|
|
|
|
|
|
|
return map;
|
|
|
|
return map;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 统一返回形式
|
|
|
|
|
|
|
|
* @param userId 用户ID
|
|
|
|
|
|
|
|
* @param creditPortraits 对应模块成绩中心数据
|
|
|
|
|
|
|
|
* @param creditPortrait 模块数字
|
|
|
|
|
|
|
|
* @param ascription 归属大模块
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private void commonMethods(String userId, List<StuScoreCenter> creditPortraits, String[] creditPortrait,String ascription) {
|
|
|
|
|
|
|
|
if(!creditPortraits.isEmpty()){
|
|
|
|
|
|
|
|
for (String s : creditPortrait) {
|
|
|
|
|
|
|
|
for (int j = 0; j < creditPortraits.size(); j++) {
|
|
|
|
|
|
|
|
if (s.equals(creditPortraits.get(j).getModule())) {
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
StuScoreCenter stuScoreCenter = new StuScoreCenter();
|
|
|
|
|
|
|
|
stuScoreCenter.setLearningProjects(s);
|
|
|
|
|
|
|
|
stuScoreCenter.setTrainingTotalScore(BigDecimal.valueOf(100));
|
|
|
|
|
|
|
|
stuScoreCenter.setModule(s);
|
|
|
|
|
|
|
|
stuScoreCenter.setUserId(userId);
|
|
|
|
|
|
|
|
stuScoreCenter.setAscription(ascription);
|
|
|
|
|
|
|
|
stuScoreCenter.setCompletionStatus("未完成");
|
|
|
|
|
|
|
|
creditPortraits.add(stuScoreCenter);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
for (String s : creditPortrait) {
|
|
|
|
|
|
|
|
StuScoreCenter stuScoreCenter = new StuScoreCenter();
|
|
|
|
|
|
|
|
stuScoreCenter.setLearningProjects(s);
|
|
|
|
|
|
|
|
stuScoreCenter.setTrainingTotalScore(BigDecimal.valueOf(100));
|
|
|
|
|
|
|
|
stuScoreCenter.setModule(s);
|
|
|
|
|
|
|
|
stuScoreCenter.setUserId(userId);
|
|
|
|
|
|
|
|
stuScoreCenter.setAscription(ascription);
|
|
|
|
|
|
|
|
stuScoreCenter.setCompletionStatus("未完成");
|
|
|
|
|
|
|
|
creditPortraits.add(stuScoreCenter);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 更新权重信息
|
|
|
|
* 更新权重信息
|
|
|
|
* @param stuScoreCenters
|
|
|
|
* @param stuScoreCenters
|
|
|
@ -221,10 +342,8 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
public StuScoreCenter calculateTotalScore(List<StuScoreCenter> stuScoreCenters,String module){
|
|
|
|
public StuScoreCenter calculateTotalScore(List<StuScoreCenter> stuScoreCenters,String module){
|
|
|
|
StuScoreCenter stuScoreCenter=new StuScoreCenter();
|
|
|
|
StuScoreCenter stuScoreCenter=new StuScoreCenter();
|
|
|
|
|
|
|
|
|
|
|
|
//学习项目(在成绩前面加个总)
|
|
|
|
|
|
|
|
StringBuilder stringBuilder=new StringBuilder(module);
|
|
|
|
stuScoreCenter.setLearningProjects(module);
|
|
|
|
String string = stringBuilder.insert(4, "总").toString();
|
|
|
|
|
|
|
|
stuScoreCenter.setLearningProjects(string);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//实训时长(累加)
|
|
|
|
//实训时长(累加)
|
|
|
|
|
|
|
|
|
|
|
@ -235,25 +354,42 @@ public class StuScoreCenterServiceImpl implements StuScoreCenterService {
|
|
|
|
BigDecimal score=new BigDecimal(0);
|
|
|
|
BigDecimal score=new BigDecimal(0);
|
|
|
|
for (int i = 0; i < stuScoreCenters.size(); i++) {
|
|
|
|
for (int i = 0; i < stuScoreCenters.size(); i++) {
|
|
|
|
//取出实训时长累加
|
|
|
|
//取出实训时长累加
|
|
|
|
|
|
|
|
if(stuScoreCenters.get(i).getTrainingDuration()==null){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
Integer trainingDuration = stuScoreCenters.get(i).getTrainingDuration();
|
|
|
|
Integer trainingDuration = stuScoreCenters.get(i).getTrainingDuration();
|
|
|
|
duration=duration+trainingDuration;
|
|
|
|
duration=duration+trainingDuration;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//取出实训得分,并乘权重再累加
|
|
|
|
//取出实训得分,并乘权重再累加
|
|
|
|
|
|
|
|
if(stuScoreCenters.get(i).getTrainingScore()==null){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
BigDecimal trainingScore = stuScoreCenters.get(i).getTrainingScore();
|
|
|
|
BigDecimal trainingScore = stuScoreCenters.get(i).getTrainingScore();
|
|
|
|
BigDecimal scoreWeight = stuScoreCenters.get(i).getScoreWeight();
|
|
|
|
BigDecimal scoreWeight = stuScoreCenters.get(i).getScoreWeight();
|
|
|
|
|
|
|
|
|
|
|
|
String mul = bigDecimalUtils.mul(trainingScore.toString(), scoreWeight.toString(), 2);
|
|
|
|
String mul = bigDecimalUtils.mul(trainingScore.toString(), scoreWeight.toString(), 2);
|
|
|
|
score=bigDecimalUtils.add(score.toString(),mul);
|
|
|
|
score=bigDecimalUtils.add(score.toString(),mul);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
stuScoreCenter.setTrainingDuration(duration);
|
|
|
|
stuScoreCenter.setTrainingDuration(duration);
|
|
|
|
|
|
|
|
|
|
|
|
//完成情况
|
|
|
|
//完成情况
|
|
|
|
if(stuScoreCenters.size()==3){
|
|
|
|
int a=0;
|
|
|
|
|
|
|
|
for (int i = 0; i < stuScoreCenters.size(); i++) {
|
|
|
|
|
|
|
|
StuScoreCenter stuScoreCenter1 = stuScoreCenters.get(i);
|
|
|
|
|
|
|
|
if(stuScoreCenter1.getCompletionStatus().equals("已完成")){
|
|
|
|
|
|
|
|
a++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(a==3){
|
|
|
|
stuScoreCenter.setCompletionStatus("已完成");
|
|
|
|
stuScoreCenter.setCompletionStatus("已完成");
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
stuScoreCenter.setCompletionStatus("未完成");
|
|
|
|
stuScoreCenter.setCompletionStatus("未完成");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//实训得分
|
|
|
|
//实训得分
|
|
|
|
stuScoreCenter.setTrainingScore(score);
|
|
|
|
stuScoreCenter.setTrainingScore(score);
|
|
|
|
|
|
|
|
|
|
|
|