Commit fd276dab authored by 刘凡's avatar 刘凡

*)修改分页接口

parent 7cc26ee3
...@@ -149,8 +149,10 @@ public class JyjcInspectionApplicationController extends BaseController { ...@@ -149,8 +149,10 @@ public class JyjcInspectionApplicationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/selectOneForBigScreenEqu/{sequenceNbr}") @GetMapping(value = "/selectOneForBigScreenEqu/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个") @ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<Map<String, Object>> selectOneForBigScreenEqu(@PathVariable Long sequenceNbr) { public ResponseModel<Page> selectOneForBigScreenEqu(@PathVariable Long sequenceNbr,
return ResponseHelper.buildResponse(jyjcInspectionApplicationServiceImpl.selectOneForBigScreenEqu(sequenceNbr, getSelectedOrgInfo().getCompany().getCompanyType())); @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) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -625,12 +625,15 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -625,12 +625,15 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
resultMap.put("keyParams", jsonData); resultMap.put("keyParams", jsonData);
return resultMap; 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); List<Map<String, Object>> arrayList = getEquipInfoList(sequenceNbr);
Map<String,Object> resultMap = new HashMap<>(); Page<Map<String, Object>> page = new Page<>();
resultMap.put("records", arrayList); page.setCurrent(current);
return resultMap; 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) { private List<FormValue> getJsonData(Resource resource) {
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
"apiPath":"/jyjc/jyjc-inspection-application/selectOneForBigScreenEqu/{sequenceNbr}", "apiPath":"/jyjc/jyjc-inspection-application/selectOneForBigScreenEqu/{sequenceNbr}",
"params": { "params": {
"current": 1, "current": 1,
"size": 10, "size": 10
"sequenceNbr": "{sequenceNbr}"
} }
} }
}, },
......
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