业务编写

pull/1/head
陈沅 2 years ago
parent 3ddcc92cc1
commit 3a4406255a

@ -111,7 +111,8 @@ public class TrainingController {
public ResultEntity<PageInfo<Training>> findByConditions(@ApiParam("页码") Integer index,
@ApiParam("页量") Integer size) {
//TODO 待确认需过滤参数
return new ResultEntity<PageInfo<Training>>(HttpStatus.OK, trainingService.pagedListTraining(index, size));
JwtUser currentUser = TokenProvider.getJWTUser(request);
return new ResultEntity<PageInfo<Training>>(HttpStatus.OK, trainingService.pagedListTraining(currentUser.getSchoolId(),index, size));
}
@Permission(codes = PermissionType.TRAINING_MANAGEMENT_SEARCH)

@ -144,6 +144,6 @@ public class ReportService {
public void download(String id, HttpServletResponse response){
Report report = reportsMapper.selectByPrimaryKey(id);
Assert.isTrue(report!=null&&report.getFilePath()!=null,"报告不存在");
fileUtil.download(response,report.getFilePath(),report.getFileName());
fileUtil.download(response,report.getFileName(),report.getFilePath());
}
}

@ -95,9 +95,11 @@ public class TrainingService {
return training.size() > 0;
}
public PageInfo<Training> pagedListTraining(int pageNo, int pageSize) {
public PageInfo<Training> pagedListTraining(Integer schoolId,int pageNo, int pageSize) {
//TODO 待确定过滤参数
TrainingExample example = new TrainingExample();
TrainingExample.Criteria criteria = example.createCriteria();
criteria.andSchoolIdEqualTo(schoolId);
PageHelper.startPage(pageNo, pageSize);
return new PageInfo<>(trainingMapper.selectByExample(example));
}

Loading…
Cancel
Save