New file |
| | |
| | | package com.qxueyou.scc.admin.schoolRoll; |
| | | |
| | | import com.qxueyou.scc.teach.student.model.StuStudent; |
| | | import io.swagger.models.auth.In; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ISchoolRollService { |
| | | List<StuStudent> findSchoolRollList(Integer limit,Integer pageNum,String keyword,String status); |
| | | |
| | | int findSchoolRollListCount(String keyword,String status); |
| | | } |
New file |
| | |
| | | package com.qxueyou.scc.admin.schoolRoll.impl; |
| | | |
| | | import com.qxueyou.scc.admin.schoolRoll.ISchoolRollService; |
| | | import com.qxueyou.scc.base.model.Pager; |
| | | import com.qxueyou.scc.base.service.impl.CommonAppService; |
| | | import com.qxueyou.scc.base.util.ClientUtils; |
| | | import com.qxueyou.scc.base.util.CollectionUtils; |
| | | import com.qxueyou.scc.teach.student.model.StuStudent; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class SchoolRollServiceImpl extends CommonAppService implements ISchoolRollService { |
| | | |
| | | |
| | | @Autowired |
| | | CommonAppService commonAppService; |
| | | @Override |
| | | public List<StuStudent> findSchoolRollList(Integer limit, Integer pageNum, String keyword, String status) { |
| | | StringBuffer hql=new StringBuffer("from StuStudent where name like ? and status=? and deleteFlag is false"); |
| | | |
| | | List<Object> args = CollectionUtils.newList(keyword + "%", status); |
| | | |
| | | hql.append(" order by createTime desc"); |
| | | |
| | | List<StuStudent> list = findList(hql.toString(), new Pager(limit, pageNum), args, StuStudent.class); |
| | | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public int findSchoolRollListCount(String keyword, String status) { |
| | | StringBuffer hql=new StringBuffer("from StuStudent where name like ? and status=? and deleteFlag is false"); |
| | | |
| | | List<Object> args = CollectionUtils.newList(keyword + "%", status); |
| | | |
| | | return findCount(hql.toString(),args); |
| | | } |
| | | } |
| | |
| | | public Result list(@RequestParam(defaultValue = "") String keyword, |
| | | @RequestParam(defaultValue = "10") Integer limit, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "1")Integer pageType) { |
| | | |
| | | // System.out.println(ClientUtils.getUserId()); |
| | | // System.out.println(ClientUtils.isAdmin()); |
| | | String teacherId = ClientUtils.isAdmin() ? null : teacherService.getTeacherIdByUserId(ClientUtils.getUserId()); |
| | | // System.out.println("aaa"+teacherId); |
| | | // 获取数据 |
| | | List<ClsClass> clsLst = classService.getClassLst(keyword, teacherId, limit, pageNum, pageType); |
| | | // System.out.println(clsLst); |
| | | // 获取班级总数 |
| | | int count = classService.getClassLstCount(keyword, teacherId, pageType); |
| | | // System.out.println(count); |
| | | // 转成前端所需字段和结构 |
| | | List<Map<String, Object>> lstResult = QBeanUtils.listBean2ListMap(clsLst, |
| | | CollectionUtils.newStringMap("name", "className", "classId", "classId", "classNumber", "classNumber","classTypes","classTypes", |
New file |
| | |
| | | package com.qxueyou.scc.controller; |
| | | |
| | | import com.qxueyou.scc.admin.schoolRoll.ISchoolRollService; |
| | | import com.qxueyou.scc.base.model.Pager; |
| | | import com.qxueyou.scc.base.model.Result; |
| | | import com.qxueyou.scc.base.service.impl.CommonAppService; |
| | | import com.qxueyou.scc.base.util.CollectionUtils; |
| | | import com.qxueyou.scc.base.util.QBeanUtils; |
| | | import com.qxueyou.scc.teach.student.model.StuStudent; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 学籍管理控制器 |
| | | * |
| | | * @author hurenrong |
| | | */ |
| | | @Api(tags="学籍管理接口") |
| | | @RestController |
| | | @RequestMapping("/admin/schoolRoller") |
| | | public class SchoolRollController { |
| | | |
| | | @Autowired |
| | | private ISchoolRollService iSchoolRollService; |
| | | |
| | | /** |
| | | * 获取正常学员列表 |
| | | * |
| | | * @param keyword |
| | | * @param limit |
| | | * @param pageNum |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取正常班级列表", notes = "") |
| | | @GetMapping(value = "/schoolList") |
| | | public Result schoolList(@RequestParam(defaultValue = "10") Integer limit, @RequestParam(defaultValue = "1") Integer pageNum,String keyword,String status) { |
| | | |
| | | List<StuStudent> schoolRollList = iSchoolRollService.findSchoolRollList(limit, pageNum, keyword, status); |
| | | |
| | | int count = iSchoolRollService.findSchoolRollListCount(keyword, status); |
| | | |
| | | return new Result(true,"success", CollectionUtils.newObjectMap("schoolRollList", |
| | | QBeanUtils.listBean2ListMap(schoolRollList, |
| | | CollectionUtils.newStringMap("name", "studentName", "studentNo", "studentNo","sex","sex", "status", |
| | | "status", "createTime", "createTime")), |
| | | "schoolrollCount", count)); |
| | | } |
| | | } |
| | |
| | | |
| | | return new Result(true, "success", CollectionUtils.newStringMap("studentId", student.getStudentId(), "password", user.getPassword())); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Result insertStudent(String classId, String name, String studentNo, boolean sex, String phoneNo, String orgId,String comName) { |
| | | |