|
@@ -8,6 +8,7 @@ import com.jpsoft.smart.modules.base.service.PersonDeviceLogService;
|
|
|
import com.jpsoft.smart.modules.base.service.PersonInfoService;
|
|
|
import com.jpsoft.smart.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.smart.modules.common.dto.Sort;
|
|
|
+import com.jpsoft.smart.modules.common.utils.PojoUtils;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -39,15 +40,15 @@ public class PersonDeviceLogApiController {
|
|
|
@ApiImplicitParam(name="token",value = "令牌",required = true,paramType = "form"),
|
|
|
@ApiImplicitParam(name="subject",value = "目标(不传)",paramType = "form")
|
|
|
})
|
|
|
- public MessageResult<List> queryTemperatureRecordListByEnt(
|
|
|
+ public MessageResult<Map> queryTemperatureRecordListByEnt(
|
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate,
|
|
|
String token,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
@RequestAttribute String subject){
|
|
|
- List<Map> recordList = new ArrayList<>();
|
|
|
+ Page<Map> recordPageList = new Page<>();
|
|
|
|
|
|
- MessageResult<List> messageResult = new MessageResult<>();
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
PersonInfo admin = personInfoService.get(Long.valueOf(subject));
|
|
@@ -58,11 +59,11 @@ public class PersonDeviceLogApiController {
|
|
|
List<Sort> sortList1 = new ArrayList<>();
|
|
|
sortList1.add(new Sort("id_","asc"));
|
|
|
|
|
|
- Page<PersonInfo> personList = personInfoService.pageSearch(personSearchParam,pageIndex,pageSize,true,sortList1);
|
|
|
+ Page<PersonInfo> personPageList = personInfoService.pageSearch(personSearchParam,pageIndex,pageSize,true,sortList1);
|
|
|
|
|
|
DateTime startTime = new DateTime(queryDate);
|
|
|
|
|
|
- for (PersonInfo person : personList) {
|
|
|
+ for (PersonInfo person : personPageList) {
|
|
|
Map<String, Object> recordMap = new HashMap<>();
|
|
|
|
|
|
recordMap.put("name", person.getName());
|
|
@@ -147,11 +148,16 @@ public class PersonDeviceLogApiController {
|
|
|
|
|
|
recordMap.put("list", personDeviceLogs);
|
|
|
|
|
|
- recordList.add(recordMap);
|
|
|
+ recordPageList.add(recordMap);
|
|
|
}
|
|
|
|
|
|
+ recordPageList.setTotal(personPageList.getTotal());
|
|
|
+ recordPageList.setPages(personPageList.getPages());
|
|
|
+ recordPageList.setPageNum(personPageList.getPageNum());
|
|
|
+ recordPageList.setPageSize(personPageList.getPageSize());
|
|
|
+
|
|
|
messageResult.setResult(true);
|
|
|
- messageResult.setData(recordList);
|
|
|
+ messageResult.setData(PojoUtils.pageWrapper(recordPageList));
|
|
|
}
|
|
|
catch (Exception ex){
|
|
|
messageResult.setResult(false);
|