Commit fd276dab authored by 刘凡's avatar 刘凡

*)修改分页接口

parent 7cc26ee3
......@@ -149,8 +149,10 @@ public class JyjcInspectionApplicationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/selectOneForBigScreenEqu/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<Map<String, Object>> selectOneForBigScreenEqu(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jyjcInspectionApplicationServiceImpl.selectOneForBigScreenEqu(sequenceNbr, getSelectedOrgInfo().getCompany().getCompanyType()));
public ResponseModel<Page> selectOneForBigScreenEqu(@PathVariable Long sequenceNbr,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
return ResponseHelper.buildResponse(jyjcInspectionApplicationServiceImpl.selectOneForBigScreenEqu(current, size, sequenceNbr, getSelectedOrgInfo().getCompany().getCompanyType()));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -625,12 +625,15 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
resultMap.put("keyParams", jsonData);
return resultMap;
}
public Map<String, Object> selectOneForBigScreenEqu(Long sequenceNbr, String companyType) {
public Page selectOneForBigScreenEqu(int current, int size, Long sequenceNbr, String companyType) {
// 设备
List<Map<String, Object>> arrayList = getEquipInfoList(sequenceNbr);
Map<String,Object> resultMap = new HashMap<>();
resultMap.put("records", arrayList);
return resultMap;
Page<Map<String, Object>> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
page.setTotal(arrayList.size());
page.setRecords(arrayList.subList((current - 1) * size, arrayList.size() > current * size ? current * size : arrayList.size()));
return page;
}
private List<FormValue> getJsonData(Resource resource) {
......
......@@ -23,8 +23,7 @@
"apiPath":"/jyjc/jyjc-inspection-application/selectOneForBigScreenEqu/{sequenceNbr}",
"params": {
"current": 1,
"size": 10,
"sequenceNbr": "{sequenceNbr}"
"size": 10
}
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment