数字征信--第一轮测试提交

master
@t2652009480 9 months ago
parent 81d5586ae8
commit e1357c0ed7

@ -30,7 +30,7 @@ public class Constant {
public static final String ZYXX_TCHMODULE = "资源学习";
public static final String XXCP_TCHMODULE = "学习测评";
public static final String SYSX_TCHMODULE = "实验实训";
public static final String SYBG_TCHMODULE = "实报告";
public static final String SYBG_TCHMODULE = "实报告";

@ -64,6 +64,8 @@ public class StuScoreCenter {
public StuScoreCenter(String module,TchModuleWeith tchModuleWeith,String userId,String ascription){
this.learningProjects=module;
this.trainingTotalScore=BigDecimal.valueOf(100);
this.trainingDuration=0;
this.trainingScore=BigDecimal.valueOf(0);
this.module=module;
this.userId=userId;
this.ascription=ascription;

@ -49,25 +49,35 @@ public class StuScoreDetails {
}
public StuScoreDetails(StuScoreDetails stuScoreDetails,TchPublicResourceWeight tchPublicResourceWeight){
this.learningProjects=stuScoreDetails.getLearningProjects();
this.assessmentItems=stuScoreDetails.getAssessmentItems();
if(stuScoreDetails.getLearningProjects().equals(Constant.ZSGY_TCHMODULE)){
stuScoreDetails.setScoringCriteria(tchPublicResourceWeight.getSummaryOfKnowledgeScore().toString());
stuScoreDetails.setScoreWeight(Double.parseDouble(tchPublicResourceWeight.getSummaryOfKnowledgeWeight().toString()));
this.scoringCriteria=tchPublicResourceWeight.getSummaryOfKnowledgeScore().toString();
this.scoreWeight=Double.parseDouble(tchPublicResourceWeight.getSummaryOfKnowledgeWeight().toString());
}
if(stuScoreDetails.getLearningProjects().equals(Constant.ZYXX_TCHMODULE)){
stuScoreDetails.setScoringCriteria(tchPublicResourceWeight.getResourceLearningScore().toString());
stuScoreDetails.setScoreWeight(Double.parseDouble(tchPublicResourceWeight.getResourceLearningWeight().toString()));
this.scoringCriteria=tchPublicResourceWeight.getResourceLearningScore().toString();
this.scoreWeight=Double.parseDouble(tchPublicResourceWeight.getResourceLearningWeight().toString());
}
if(stuScoreDetails.getLearningProjects().equals(Constant.XXCP_TCHMODULE)){
stuScoreDetails.setScoringCriteria(tchPublicResourceWeight.getLearningAssessmentScore().toString());
stuScoreDetails.setScoreWeight(Double.parseDouble(tchPublicResourceWeight.getLearningAssessmentWeight().toString()));
this.scoringCriteria=tchPublicResourceWeight.getLearningAssessmentScore().toString();
this.scoreWeight=Double.parseDouble(tchPublicResourceWeight.getLearningAssessmentWeight().toString());
}
if(stuScoreDetails.getLearningProjects().equals(Constant.SYSX_TCHMODULE)){
stuScoreDetails.setScoringCriteria(tchPublicResourceWeight.getExperimentalTrainingScore().toString());
stuScoreDetails.setScoreWeight(Double.parseDouble(tchPublicResourceWeight.getExperimentalTrainingWeight().toString()));
this.scoringCriteria=tchPublicResourceWeight.getExperimentalTrainingScore().toString();
this.scoreWeight=Double.parseDouble(tchPublicResourceWeight.getExperimentalTrainingWeight().toString());
}
if(stuScoreDetails.getLearningProjects().equals(Constant.SYBG_TCHMODULE)){
stuScoreDetails.setScoreWeight(Double.parseDouble(tchPublicResourceWeight.getReportWeight().toString()));
}
this.scoreWeight=Double.parseDouble(tchPublicResourceWeight.getReportWeight().toString());
}
this.completionStatus=stuScoreDetails.getCompletionStatus();
this.scoreProject=stuScoreDetails.getScoreProject();
this.module=stuScoreDetails.getModule();
this.userId=stuScoreDetails.getUserId();
this.totalScore=stuScoreDetails.getTotalScore();
this.serialNumber=stuScoreDetails.getSerialNumber();
this.ascription=stuScoreDetails.getAscription();
}
public String getId() {
return id;

@ -466,7 +466,7 @@ public class StuDigitalCreditServiceImpl implements StuDigitalCreditService {
String schoolId = stuUsers.get(0).getSchoolId();
TchPublicResourceWeightExample example = new TchPublicResourceWeightExample();
example.createCriteria().andSchoolIdEqualTo(userId).andModuleEqualTo(module);
example.createCriteria().andSchoolIdEqualTo(schoolId).andModuleEqualTo(module).andAscriptionEqualTo(ascription);
List<TchPublicResourceWeight> tchConceptualTechnologyWeights = tchConceptualTechnologyWeightMapper.selectByExample(example);
if(tchConceptualTechnologyWeights.isEmpty()){
TchPublicResourceWeight tchConceptualTechnologyWeight=new TchPublicResourceWeight(schoolId,module,ascription);
@ -709,7 +709,7 @@ public class StuDigitalCreditServiceImpl implements StuDigitalCreditService {
StuUser stuUser = stuUsers.get(0);
TchPublicResourceWeightExample example = new TchPublicResourceWeightExample();
example.createCriteria().andSchoolIdEqualTo(userId).andModuleEqualTo(module);
example.createCriteria().andSchoolIdEqualTo(stuUser.getSchoolId()).andModuleEqualTo(module).andAscriptionEqualTo(ascription);
List<TchPublicResourceWeight> tchConceptualTechnologyWeights = tchConceptualTechnologyWeightMapper.selectByExample(example);
if(tchConceptualTechnologyWeights.isEmpty()){
TchPublicResourceWeight tchConceptualTechnologyWeight=new TchPublicResourceWeight(stuUser.getSchoolId(),module,ascription);
@ -756,7 +756,7 @@ public class StuDigitalCreditServiceImpl implements StuDigitalCreditService {
String schoolId = stuUsers.get(0).getSchoolId();
TchPublicResourceWeightExample example = new TchPublicResourceWeightExample();
example.createCriteria().andSchoolIdEqualTo(userId).andModuleEqualTo(module);
example.createCriteria().andSchoolIdEqualTo(schoolId).andModuleEqualTo(module).andAscriptionEqualTo(ascription);
List<TchPublicResourceWeight> tchConceptualTechnologyWeights = tchConceptualTechnologyWeightMapper.selectByExample(example);
if(tchConceptualTechnologyWeights.isEmpty()){
TchPublicResourceWeight tchConceptualTechnologyWeight=new TchPublicResourceWeight(schoolId,module,ascription);

@ -444,7 +444,7 @@ public class StuPersonalCreditServiceImpl implements StuPersonalCreditService {
public void scoreEntry(String userId, String module, BigDecimal score) {
// TODO: 2024/4/24 判断用户第几次实训 重新实训次数0第一次 1第二次 2第三次
StuScoreCenterExample scoreCenterExample = new StuScoreCenterExample();
scoreCenterExample.createCriteria().andUserIdEqualTo(userId);
scoreCenterExample.createCriteria().andUserIdEqualTo(userId).andModuleEqualTo(module);
List<StuScoreCenter> stuScoreCenters = stuScoreCenterMapper.selectByExample(scoreCenterExample);

@ -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);
}

Loading…
Cancel
Save