|
@@ -87,42 +87,48 @@ public class PersonDeviceFilterLogController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value="体温记录(个人列表)")
|
|
|
- @RequestMapping(value = "list",method = RequestMethod.POST)
|
|
|
+ @RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name="token",value = "令牌",required = true,paramType = "form"),
|
|
|
@ApiImplicitParam(name="subject",value = "目标(不传)",paramType = "form"),
|
|
|
- @ApiImplicitParam(name = "recordDate",value = "查询日期(yyyy-MM-dd)", required = true, paramType = "form",dataType = "String")
|
|
|
+ @ApiImplicitParam(name="fever",value = "是否异常",required = false,paramType = "form",dataType = "Boolean")
|
|
|
+// @ApiImplicitParam(name = "recordDate",value = "查询日期(yyyy-MM-dd)", required = false, paramType = "form",dataType = "String")
|
|
|
})
|
|
|
- public MessageResult<List<PersonDeviceFilterLogDTO>> list(@RequestParam(value="recordDate",defaultValue="") String recordDate,
|
|
|
- @RequestAttribute String subject,
|
|
|
- String token){
|
|
|
- MessageResult<List<PersonDeviceFilterLogDTO>> msgResult = new MessageResult<>();
|
|
|
+ public MessageResult<Map> pageList(//@RequestParam(value="recordDate",defaultValue="") String recordDate,
|
|
|
+ @RequestParam(value="fever",defaultValue="") Boolean fever,
|
|
|
+ @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
+ @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
+ @RequestAttribute String subject,
|
|
|
+ String token){
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
- calendar.setTime(sdf.parse(recordDate));
|
|
|
- Date beginTime = calendar.getTime();
|
|
|
- calendar.add(Calendar.DATE, 1);
|
|
|
- calendar.add(Calendar.SECOND, -1);
|
|
|
- Date endTime = calendar.getTime();
|
|
|
-
|
|
|
- List<PersonDeviceFilterLogDTO> listPersonDeviceFilterLogDTO = new ArrayList<>();
|
|
|
-
|
|
|
- Map<String,Object> searchParams = new HashMap<>();
|
|
|
- searchParams.put("personId",subject);
|
|
|
- searchParams.put("beginTime",beginTime);
|
|
|
- searchParams.put("endTime",endTime);
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("a.id_","asc"));
|
|
|
|
|
|
- Page<PersonDeviceFilterLog> page = personDeviceFilterLogService.pageSearch(searchParams,1,1000,false, sortList);
|
|
|
- for(PersonDeviceFilterLog personDeviceFilterLog : page.getResult()){
|
|
|
- PersonDeviceFilterLogDTO personDeviceFilterLogDTO = new PersonDeviceFilterLogDTO();
|
|
|
- PojoUtils.map(personDeviceFilterLog, personDeviceFilterLogDTO);
|
|
|
-
|
|
|
- DeviceInfo deviceInfo = deviceInfoService.getByDeviceNo(personDeviceFilterLog.getDeviceNo());
|
|
|
- PersonInfo personInfo = personInfoService.get(Long.valueOf(personDeviceFilterLog.getPersonId()));
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+ searchParams.put("personId",subject);
|
|
|
+ if(fever != null){
|
|
|
+ searchParams.put("fever", fever);
|
|
|
+ }
|
|
|
+// if(StringUtils.isNotEmpty(recordDate)) {
|
|
|
+// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+// Calendar calendar = Calendar.getInstance();
|
|
|
+// calendar.setTime(sdf.parse(recordDate));
|
|
|
+// Date beginTime = calendar.getTime();
|
|
|
+// calendar.add(Calendar.DATE, 1);
|
|
|
+// calendar.add(Calendar.SECOND, -1);
|
|
|
+// Date endTime = calendar.getTime();
|
|
|
+//
|
|
|
+// searchParams.put("beginTime", beginTime);
|
|
|
+// searchParams.put("endTime", endTime);
|
|
|
+// }
|
|
|
+
|
|
|
+ Page<PersonDeviceFilterLog> page = personDeviceFilterLogService.pageSearch(searchParams,pageIndex,pageSize,true, sortList);
|
|
|
+ Page<PersonDeviceFilterLogDTO> pageDTO = PojoUtils.convertPage(page, PersonDeviceFilterLogDTO.class);
|
|
|
+ for(PersonDeviceFilterLogDTO personDeviceFilterLogDTO : pageDTO.getResult()){
|
|
|
+ DeviceInfo deviceInfo = deviceInfoService.getByDeviceNo(personDeviceFilterLogDTO.getDeviceNo());
|
|
|
+ PersonInfo personInfo = personInfoService.get(Long.valueOf(personDeviceFilterLogDTO.getPersonId()));
|
|
|
|
|
|
if(deviceInfo != null) {
|
|
|
personDeviceFilterLogDTO.setDeviceName(deviceInfo.getAliasName());
|
|
@@ -130,17 +136,15 @@ public class PersonDeviceFilterLogController {
|
|
|
if(personInfo != null) {
|
|
|
personDeviceFilterLogDTO.setPersonName(personInfo.getName());
|
|
|
}
|
|
|
- if(personDeviceFilterLog.getTemperature().compareTo(new BigDecimal("37")) == 1){//|| personDeviceFilterLog.getTemperature().compareTo(new BigDecimal("37")) == 0
|
|
|
+ if(personDeviceFilterLogDTO.getTemperature().compareTo(new BigDecimal("37")) == 1){//|| personDeviceFilterLog.getTemperature().compareTo(new BigDecimal("37")) == 0
|
|
|
personDeviceFilterLogDTO.setFever(true);
|
|
|
}else {
|
|
|
personDeviceFilterLogDTO.setFever(false);
|
|
|
}
|
|
|
-
|
|
|
- listPersonDeviceFilterLogDTO.add(personDeviceFilterLogDTO);
|
|
|
}
|
|
|
|
|
|
msgResult.setResult(true);
|
|
|
- msgResult.setData(listPersonDeviceFilterLogDTO);
|
|
|
+ msgResult.setData(PojoUtils.pageWrapper(pageDTO));
|
|
|
}
|
|
|
catch(Exception ex){
|
|
|
logger.error(ex.getMessage(),ex);
|