| | |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.ycl.jxkg.context.WebContext; |
| | | import com.ycl.jxkg.domain.entity.Classes; |
| | | import com.ycl.jxkg.domain.vo.StudentSimpleVO; |
| | | import com.ycl.jxkg.domain.vo.StudentVO; |
| | | import com.ycl.jxkg.enums.general.ClassesStatusEnum; |
| | | import com.ycl.jxkg.mapper.ClassesMapper; |
| | | import com.ycl.jxkg.service.ClassesService; |
| | |
| | | @Override |
| | | public Result add(ClassesForm form) { |
| | | Classes entity = ClassesForm.getEntityByForm(form, null); |
| | | entity.setStatus(ClassesStatusEnum.NORMAL); |
| | | entity.setCreateUser(webContext.getCurrentUser().getId()); |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | |
| | | @Override |
| | | public Result page(ClassesQuery query) { |
| | | IPage<ClassesVO> page = PageUtil.getPage(query, ClassesVO.class); |
| | | query.setUserId(webContext.getCurrentUser().getId()); |
| | | baseMapper.getPage(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | |
| | | .list(); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | @Override |
| | | public Result recover(Integer id) { |
| | | new LambdaUpdateChainWrapper<>(baseMapper) |
| | | .eq(Classes::getId, id) |
| | | .set(Classes::getStatus, ClassesStatusEnum.NORMAL) |
| | | .update(); |
| | | return Result.ok("班级已经恢复正常"); |
| | | } |
| | | } |