diff --git a/src/main/java/com/sztzjy/digital_credit/entity/StuModuleDetails.java b/src/main/java/com/sztzjy/digital_credit/entity/StuModuleDetails.java index 621ffc0..1ce93df 100644 --- a/src/main/java/com/sztzjy/digital_credit/entity/StuModuleDetails.java +++ b/src/main/java/com/sztzjy/digital_credit/entity/StuModuleDetails.java @@ -33,19 +33,19 @@ public class StuModuleDetails { int[] numbers={3,2,4,7,3,4,6,4,5}; for (int i = 0; i < modules.length; i++) { if(module.equals(modules[i])){ - if(ascription.equals(Constant.PERSONAL_CREDIT)){ + if(ascription.equals(Constant.CORPORATE_CREDIT)){ Integer uuid = UUID.randomUUID().toString().replaceAll("-", "").hashCode(); uuid = uuid < 0 ? -uuid : uuid;//String.hashCode() 值会为空 this.id=uuid; this.module=modules[i]; - this.taskNumber=numbers[i]; + this.taskNumber=numbers[i+3]; this.ascription=ascription; }else { Integer uuid = UUID.randomUUID().toString().replaceAll("-", "").hashCode(); uuid = uuid < 0 ? -uuid : uuid;//String.hashCode() 值会为空 this.id=uuid; this.module=modules[i]; - this.taskNumber=numbers[i+3]; + this.taskNumber=numbers[i]; this.ascription=ascription; } } diff --git a/src/main/java/com/sztzjy/digital_credit/service/impl/StuDigitalCreditServiceImpl.java b/src/main/java/com/sztzjy/digital_credit/service/impl/StuDigitalCreditServiceImpl.java index d600af2..736ada5 100644 --- a/src/main/java/com/sztzjy/digital_credit/service/impl/StuDigitalCreditServiceImpl.java +++ b/src/main/java/com/sztzjy/digital_credit/service/impl/StuDigitalCreditServiceImpl.java @@ -615,7 +615,7 @@ public class StuDigitalCreditServiceImpl implements StuDigitalCreditService { //查询是否已有提交 StuTrainingTaskSubmissionDetailsExample stuTrainingTaskSubmissionDetailsExample=new StuTrainingTaskSubmissionDetailsExample(); stuTrainingTaskSubmissionDetailsExample.createCriteria().andUserIdEqualTo(userId).andModuleEqualTo(module) - .andTaskNameEqualTo(taskName); + .andTaskNameEqualTo(taskName).andAscriptionEqualTo(ascription); List stuTrainingTaskSubmissionDetailsList = stuTrainingTaskSubmissionDetailsMapper.selectByExample(stuTrainingTaskSubmissionDetailsExample); if(stuTrainingTaskSubmissionDetailsList.isEmpty()){ StuTrainingTaskSubmissionDetails stuTrainingTaskSubmissionDetails=new StuTrainingTaskSubmissionDetails(); @@ -627,6 +627,7 @@ public class StuDigitalCreditServiceImpl implements StuDigitalCreditService { stuTrainingTaskSubmissionDetails.setUserId(userId); stuTrainingTaskSubmissionDetails.setNumberOfErrors(numberOfErrors); stuTrainingTaskSubmissionDetails.setSubmissionTime(new Date()); + stuTrainingTaskSubmissionDetails.setAscription(ascription); stuTrainingTaskSubmissionDetailsMapper.insert(stuTrainingTaskSubmissionDetails); //判断该模块的实训任务是否已全部提交 全部提交则计算该模块的实训任务分数 @@ -641,7 +642,7 @@ public class StuDigitalCreditServiceImpl implements StuDigitalCreditService { StuModuleDetails stuModuleDetails = stuModuleDetailsList.get(0); //查询该用户提交实训任务的次数 StuTrainingTaskSubmissionDetailsExample stuTrainingTaskSubmissionDetailsExample1=new StuTrainingTaskSubmissionDetailsExample(); - stuTrainingTaskSubmissionDetailsExample1.createCriteria().andUserIdEqualTo(userId).andModuleEqualTo(module); + stuTrainingTaskSubmissionDetailsExample1.createCriteria().andUserIdEqualTo(userId).andModuleEqualTo(module).andAscriptionEqualTo(ascription); List stuTrainingTaskSubmissionDetails1 = stuTrainingTaskSubmissionDetailsMapper.selectByExample(stuTrainingTaskSubmissionDetailsExample1); int count=0; if(stuTrainingTaskSubmissionDetails1.size()==stuModuleDetails.getTaskNumber()){ @@ -711,7 +712,6 @@ public class StuDigitalCreditServiceImpl implements StuDigitalCreditService { } //将分数统计到学生表中 this.personalScoreEntry(userId,module,ascription); - } /**