| | |
| | | |
| | | |
| | | /** |
| | | * 练习 实现service |
| | | * 练习 实现service |
| | | * @author |
| | | * |
| | | */ |
| | |
| | | // IScoreChangeService scoreChangeService; |
| | | |
| | | /** |
| | | * app接口调用插入数据 |
| | | * app接口调用插入数据 |
| | | * @param groupId |
| | | * @param groupName |
| | | * @param exerciseNum |
| | |
| | | * @return |
| | | */ |
| | | public Result insertExerciseCorrection(String groupId,String groupName,String exerciseNum,String exerciseId,String correctids,String content){ |
| | | //赋值 |
| | | //赋值 |
| | | ExerciseCorrection exerCorrection=new ExerciseCorrection(); |
| | | exerCorrection.setDeleteFlag(false); |
| | | TraceUtils.setCreateTrace(exerCorrection); |
| | | exerCorrection.setExerciseGroupId(groupId); |
| | | exerCorrection.setExerciseGroupName(groupName); |
| | | |
| | | // 修改为从数据库取,如果数据库中有值 |
| | | // 修改为从数据库取,如果数据库中有值 |
| | | String hql = " from ExerciseGroupItemRe r where r.exerciseGroupId = ? and r.exerciseItemId = ? and r.deleteFlag is false "; |
| | | ExerciseGroupItemRe re = this.findUnique(hql, CollectionUtils.newList(groupId,exerciseId), ExerciseGroupItemRe.class); |
| | | if(null != re && re.getItemOrder() != null ){ |
| | |
| | | |
| | | exerCorrection.setExerciseItemId(exerciseId); |
| | | exerCorrection.setRemark(content); |
| | | //字典字段的赋值 |
| | | //字典字段的赋值 |
| | | initDicForExerciseCorrection(correctids,exerCorrection); |
| | | |
| | | //提交人,提交人id 以及其他信息赋值通过查找ClientUtils |
| | | //提交人,提交人id 以及其他信息赋值通过查找ClientUtils |
| | | String classId = ClientUtils.getClassId(); |
| | | exerCorrection.setClassId(classId); |
| | | exerCorrection.setSubmitUserId(ClientUtils.getUserId()); |
| | |
| | | |
| | | this.save(exerCorrection); |
| | | |
| | | //纠错增加积分 |
| | | //纠错增加积分 |
| | | // scoreChangeService.doExerCor(ClientUtils.getUserId(), exerciseId); |
| | | |
| | | return new Result(true); |
| | | } |
| | | |
| | | /** |
| | | * 字典字段赋值 |
| | | * 字典字段赋值 |
| | | * @param correctids |
| | | * @param exerCorrection |
| | | */ |
| | |
| | | errorTypeId = errorTypeId.concat(sysDic.getDictionaryId()).concat(","); |
| | | errorTypeName = errorTypeName.concat(sysDic.getValue()).concat(","); |
| | | } |
| | | //去掉多余"," |
| | | //去掉多余"," |
| | | if(StringUtils.isNotBlank(errorTypeId) && errorTypeId.indexOf(',') != -1){ |
| | | errorTypeId = errorTypeId.substring(0, errorTypeId.length()-1); |
| | | errorTypeName = errorTypeName.substring(0, errorTypeName.length()-1); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 更新练习 |
| | | * 更新练习 |
| | | * @param item |
| | | * @param lstOptions |
| | | * @param analysis |
| | |
| | | |
| | | if(correctionType==ExerciseCorrection.DEAL_STATUS_DONE){ |
| | | |
| | | //待推送用户id列表 |
| | | //待推送用户id列表 |
| | | List<String> submitorIdsLst = querySubmitorIdsByExerItemId(item.getExerciseId()); |
| | | |
| | | String hql = "update ExerciseCorrection set dealStatus = " + ExerciseCorrection.DEAL_STATUS_DONE + " where exerciseItemId = ? " ; |
| | | |
| | | bulkUpdateInLoop(hql, new String[]{item.getExerciseId()}); |
| | | |
| | | //推送消息给习题纠错学员 |
| | | //推送消息给习题纠错学员 |
| | | pushNotification(item,submitorIdsLst); |
| | | |
| | | //纠错被处理增加积分 |
| | | //纠错被处理增加积分 |
| | | // scoreChangeService.doExerCorDeal(null, item.getExerciseId()); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 推送通知给用户 |
| | | * 推送通知给用户 |
| | | * @param item |
| | | */ |
| | | private void pushNotification(ExerciseItem item,List<String> submitorIdsLst) { |
| | |
| | | extras.put("senderId", "sys_msg"); |
| | | extras.put("type", "SYS_MSG"); |
| | | |
| | | //jpushService.doJpushByUserIds(submitorIdsLst, extras, "习题纠错", "纠错已处理:"+item.getTitle(), "纠错已处理:"+item.getTitle()); |
| | | //pushService.pushToAccountList("exerciseCorrect", "习题纠错", "纠错已处理:"+item.getTitle(), submitorIdsLst,"sys_msg","SYS_MSG"); |
| | | //jpushService.doJpushByUserIds(submitorIdsLst, extras, "习题纠错", "纠错已处理:"+item.getTitle(), "纠错已处理:"+item.getTitle()); |
| | | //pushService.pushToAccountList("exerciseCorrect", "习题纠错", "纠错已处理:"+item.getTitle(), submitorIdsLst,"sys_msg","SYS_MSG"); |
| | | } |
| | | |
| | | /* |