|
@@ -1,5 +1,6 @@
|
|
|
package cn.com.qmth.examcloud.core.oe.admin.api.controller;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.api.commons.exchange.PageInfo;
|
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.User;
|
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
import cn.com.qmth.examcloud.commons.helpers.poi.ExcelWriter;
|
|
@@ -73,7 +74,7 @@ public class IllegallyTypeController extends ControllerSupport {
|
|
|
*/
|
|
|
@ApiOperation(value = "分页查询违纪类型")
|
|
|
@GetMapping("illegallyTypePage/{curPage}/{pageSize}")
|
|
|
- public Page<IllegallyTypeEntity> illegallyTypePage(@PathVariable Integer curPage,
|
|
|
+ public PageInfo<IllegallyTypeDomain> illegallyTypePage(@PathVariable Integer curPage,
|
|
|
@PathVariable Integer pageSize,
|
|
|
@RequestParam(required = false) String name,
|
|
|
@RequestParam(required = false) String code,
|
|
@@ -95,14 +96,39 @@ public class IllegallyTypeController extends ControllerSupport {
|
|
|
predicates.add(cb.equal(root.get("enable"), enable));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
|
};
|
|
|
|
|
|
PageRequest pageRequest = PageRequest.of(curPage, pageSize,
|
|
|
new Sort(Direction.DESC, "updateTime", "id"));
|
|
|
|
|
|
+
|
|
|
Page<IllegallyTypeEntity> page = illegallyTypeRepo.findAll(specification, pageRequest);
|
|
|
- return page;
|
|
|
+
|
|
|
+ List<IllegallyTypeEntity> entityList = page.getContent();
|
|
|
+
|
|
|
+ List<IllegallyTypeDomain> domainList = new ArrayList<>();
|
|
|
+
|
|
|
+ for (IllegallyTypeEntity entity : entityList) {
|
|
|
+ IllegallyTypeDomain domain = new IllegallyTypeDomain();
|
|
|
+ domain.setRootOrgId(entity.getRootOrgId());
|
|
|
+ domain.setCode(entity.getCode());
|
|
|
+ domain.setEnable(entity.getEnable());
|
|
|
+ domain.setId(entity.getId());
|
|
|
+ domain.setName(entity.getName());
|
|
|
+ domain.setEnable(entity.getEnable());
|
|
|
+ domain.setSortNo(entity.getSortNo());
|
|
|
+ domain.setDataCategory(entity.getDataCategory()==null? DataCategory.CUSTOM.name() :entity.getDataCategory().name());
|
|
|
+
|
|
|
+ domainList.add(domain);
|
|
|
+ }
|
|
|
+
|
|
|
+ PageInfo<IllegallyTypeDomain> pageInfo=new PageInfo<>();
|
|
|
+ pageInfo.setList(domainList);
|
|
|
+ pageInfo.setTotal(page.getTotalElements());
|
|
|
+
|
|
|
+ return pageInfo;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询违纪类型")
|