| | |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IUserDeptService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springblade.modules.system.service.MyAsyncService; |
| | | import org.springblade.modules.training.entity.TrainingRegistration; |
| | | import org.springblade.modules.training.excel.TrainingRegistrationExcel; |
| | | import org.springblade.modules.training.mapper.TrainingRegistrationMapper; |
| | |
| | | private final AbsentRecordsService absentRecordsService; |
| | | |
| | | private final ExamScoreService examScoreService; |
| | | @Autowired |
| | | private MyAsyncService myAsyncService; |
| | | |
| | | @Autowired |
| | | private ExamAnswerRecordService examAnswerRecordService; |
| | |
| | | + "," + "'" + trainingRegistration.getIsExam() + "'" |
| | | + "," +"'" + trainingRegistration.getAuditStatus() + "'" + ");" + |
| | | "update blade_user set is_train = " + user1.getIsTrain() + " " +"where id = " + "'" + user1.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | //FtpUtil.sqlFileUpload(s); |
| | | myAsyncService.dataSync(s); |
| | | } |
| | | |
| | | |
| | |
| | | this.updateById(trainingRegistration1); |
| | | //修改保安报名状态 |
| | | User user = userService.getById(trainingRegistration1.getUserId()); |
| | | //考试结束 |
| | | user.setIsTrain(3); |
| | | userService.updateById(user); |
| | | //生成缺考记录 |
| | | AbsentRecords absentRecords = new AbsentRecords(); |
| | | absentRecords.setUserId(user.getId()); |
| | | absentRecords.setApplyId(trainingRegistration1.getId()); |
| | | absentRecords.setExamId(Long.parseLong(trainingRegistration1.getTrainExamId())); |
| | | absentRecords.setCandidateNo(trainingRegistration1.getCandidateNo()); |
| | | absentRecords.setCreateTime(new Date()); |
| | | //新增 |
| | | absentRecordsService.save(absentRecords); |
| | | if (null != user) { |
| | | //考试结束 |
| | | user.setIsTrain(3); |
| | | userService.updateById(user); |
| | | //生成缺考记录 |
| | | AbsentRecords absentRecords = new AbsentRecords(); |
| | | absentRecords.setUserId(user.getId()); |
| | | absentRecords.setApplyId(trainingRegistration1.getId()); |
| | | absentRecords.setExamId(Long.parseLong(trainingRegistration1.getTrainExamId())); |
| | | absentRecords.setCandidateNo(trainingRegistration1.getCandidateNo()); |
| | | absentRecords.setCreateTime(new Date()); |
| | | //新增 |
| | | absentRecordsService.save(absentRecords); |
| | | |
| | | //新增成绩,成绩为0 |
| | | ExamScore examScore = new ExamScore(); |
| | | examScore.setCandidateNo(trainingRegistration1.getCandidateNo()); |
| | | examScore.setTheoryGrade(0); |
| | | examScore.setAllGrade(0); |
| | | examScore.setQualified(3); |
| | | examScore.setUserId(user.getId().toString()); |
| | | examScore.setApplyId(trainingRegistration1.getId()); |
| | | examScore.setExamId(trainingRegistration1.getTrainExamId()); |
| | | //新增 |
| | | examScoreService.save(examScore); |
| | | //新增成绩,成绩为0 |
| | | ExamScore examScore = new ExamScore(); |
| | | examScore.setCandidateNo(trainingRegistration1.getCandidateNo()); |
| | | examScore.setTheoryGrade(0); |
| | | examScore.setAllGrade(0); |
| | | examScore.setQualified(3); |
| | | examScore.setUserId(user.getId().toString()); |
| | | examScore.setApplyId(trainingRegistration1.getId()); |
| | | examScore.setExamId(trainingRegistration1.getTrainExamId()); |
| | | //新增 |
| | | examScoreService.save(examScore); |
| | | |
| | | //内网同步 |
| | | String s = |
| | | "update sys_training_registration set cancel = " + trainingRegistration1.getCancel() + |
| | | ",is_exam = " + "'" + trainingRegistration1.getIsExam() + "'" + |
| | | " " + "where id = " + "'" + trainingRegistration1.getId() + "';" + |
| | | "update blade_user set is_train = " + user.getIsTrain() + " " + "where id = " + "'" + user.getId() + "';" + |
| | | "insert into sys_absent_records(id,user_id,create_time,exam_id,apply_id,candidate_no) " + |
| | | "values(" + "'" + absentRecords.getId() + "'" + "," |
| | | + "'" + absentRecords.getUserId() + "'" + "," |
| | | + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(absentRecords.getCreateTime()) + "'" + "," |
| | | + "'" + absentRecords.getExamId() + "'" + "," |
| | | + "'" + absentRecords.getApplyId() + "'" + "," |
| | | + "'" + absentRecords.getCandidateNo() + "'" + ");" + |
| | | "insert into exam_score(id,candidate_no,theory_grade,all_grade,qualified,user_id,apply_id,exam_id) " + |
| | | "values(" + "'" + examScore.getId() + "'" + "," |
| | | + "'" + examScore.getCandidateNo() + "'" + "," |
| | | + "'" + examScore.getTheoryGrade() + "'" + "," |
| | | + "'" + examScore.getAllGrade() + "'" + "," |
| | | + "'" + examScore.getQualified() + "'" + "," |
| | | + "'" + examScore.getUserId() + "'" + "," |
| | | + "'" + examScore.getApplyId() + "'" + "," |
| | | + "'" + examScore.getExamId() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | //内网同步 |
| | | String s = |
| | | "update sys_training_registration set cancel = " + trainingRegistration1.getCancel() + |
| | | ",is_exam = " + "'" + trainingRegistration1.getIsExam() + "'" + |
| | | " " + "where id = " + "'" + trainingRegistration1.getId() + "';" + |
| | | "update blade_user set is_train = " + user.getIsTrain() + " " + "where id = " + "'" + user.getId() + "';" + |
| | | "insert into sys_absent_records(id,user_id,create_time,exam_id,apply_id,candidate_no) " + |
| | | "values(" + "'" + absentRecords.getId() + "'" + "," |
| | | + "'" + absentRecords.getUserId() + "'" + "," |
| | | + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(absentRecords.getCreateTime()) + "'" + "," |
| | | + "'" + absentRecords.getExamId() + "'" + "," |
| | | + "'" + absentRecords.getApplyId() + "'" + "," |
| | | + "'" + absentRecords.getCandidateNo() + "'" + ");" + |
| | | "insert into exam_score(id,candidate_no,theory_grade,all_grade,qualified,user_id,apply_id,exam_id) " + |
| | | "values(" + "'" + examScore.getId() + "'" + "," |
| | | + "'" + examScore.getCandidateNo() + "'" + "," |
| | | + "'" + examScore.getTheoryGrade() + "'" + "," |
| | | + "'" + examScore.getAllGrade() + "'" + "," |
| | | + "'" + examScore.getQualified() + "'" + "," |
| | | + "'" + examScore.getUserId() + "'" + "," |
| | | + "'" + examScore.getApplyId() + "'" + "," |
| | | + "'" + examScore.getExamId() + "'" + ")"; |
| | | //FtpUtil.sqlFileUpload(s); |
| | | myAsyncService.dataSync(s); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | |
| | | "update exam_score set theory_grade = " + examScore1.getTheoryGrade() + |
| | | ",qualified = " + "'" + examScore1.getQualified() + "'" + |
| | | " " + "where id = " + "'" + examScore1.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | //FtpUtil.sqlFileUpload(s); |
| | | myAsyncService.dataSync(s); |
| | | }); |
| | | }else { |
| | | //数据同步 |
| | | String s = |
| | | "update sys_training_registration set is_exam = " + trainingRegistration1.getIsExam() + |
| | | " " + "where id = " + "'" + trainingRegistration1.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | //FtpUtil.sqlFileUpload(s); |
| | | myAsyncService.dataSync(s); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查看报名集合信息 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TrainingRegistration> getList(TrainingRegistrationVo trainingRegistration) { |
| | | return baseMapper.getList(trainingRegistration); |
| | | } |
| | | } |