Demo entry 6869106

播客单元一

   

Submitted by top on Aug 20, 2019 at 09:46
Language: Java. Code size: 4.3 kB.

public IActionResult enterNaming(ActionForm actionForm)throws Exception{
        try {
            MappedActionForm mappedActionForm = (MappedActionForm) actionForm;
            String teachId = mappedActionForm.getParameter("teachId");
            String _type = mappedActionForm.getParameter("type");
            if (StringUtils.isNotBlank(teachId)&&StringUtils.isNotBlank(_type)){
                CommonDaoSupport commonDaoSupport = this.getDaoSupport();
                ClassRoomTeach classRoomTeach = (ClassRoomTeach)commonDaoSupport.findBeanByProperty(ClassRoomTeach.class, "id", Long.valueOf(teachId));
                if (classRoomTeach!=null){
                    Integer type = Integer.valueOf(_type);
                    if (ClassRoomTeachConstant.NAMING_TYPE_NAMING == type) {
                        type=ClassRoomTeachConstant.CLASSROOMTEACH_ACTIVITY_TYPE_NAMING;
                    } else if (ClassRoomTeachConstant.NAMING_TYPE_RESPONDER == type) {
                        type=ClassRoomTeachConstant.CLASSROOMTEACH_ACTIVITY_TYPE_RESPONDER;
                    }
                    ClassRoomActivity classRoomActivity = classRoomActivityDao.getActivityByteachIdAndType(classRoomTeach.getId(), type);
                    Map map=new HashMap();
                    map.put("teachId",classRoomTeach.getId());
                    map.put("type",_type);
                    List<ClassRoomStudent> stuLists=classRoomStudentDao.getStusListByteachId(Long.valueOf(teachId),50);
                    if (stuLists != null && stuLists.size() > 0) {
                        List stuList = new ArrayList();
                        Map mapParams = null;
                        for (ClassRoomStudent classRoomStudent : stuLists) {
                            BizUser student = classRoomStudent.getStudent();
                            if (student != null) {
                                mapParams = new HashMap();
                                mapParams.put("userId", student.getId());
                                mapParams.put("realname", student.getRealname());
                                stuList.add(mapParams);
                                mapParams = null;
                            }
                        }
                        map.put("stuList", stuList);
                    }
                    if (classRoomActivity!=null) {
                        if (classRoomActivity.getOpenStatus() == ClassRoomTeachConstant.IS_PUBLICSTATUS) {
                            map.put("activityId", classRoomActivity.getId());
                            if (ClassRoomTeachConstant.CLASSROOMTEACH_ACTIVITY_TYPE_RESPONDER==type) {
                                ClassRoomNaming classRoomNaming = (ClassRoomNaming) commonDaoSupport.findBeanByProperty(ClassRoomNaming.class, "id", classRoomActivity.getObjectId());
                                if (classRoomNaming != null) {
                                    List<ClassRoomStuNaming> classRoomStuNamings = classRoomStuNamingDao.getClassRoomStuNamingByNamingAndType(classRoomActivity.getClassRoomId(), classRoomActivity.getObjectId(), Integer.valueOf(_type), classRoomNaming.getNum());
                                    if (classRoomStuNamings != null && classRoomStuNamings.size() > 0) {
                                        int i = 1;
                                        for (ClassRoomStuNaming classRoomStuNaming : classRoomStuNamings) {
                                            classRoomStuNaming.setSeq(i++);
                                        }
                                        classRoomNaming.setStuNamingList(classRoomStuNamings);
                                    }
                                    map.put("namingDetail", classRoomNaming);
                                }
                            }
                        }
                    }
                    return new ActionResult(map);
                }else {
                    return new ActionResult(0,"随堂不存在");
                }
            }else {
                return new ActionResult(0,"参数异常");
            }
        }catch (Exception e){
            throw new BasicException("未知异常");
        }

    }

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).