|
@@ -2,10 +2,8 @@ package com.jpsoft.smart.modules.mobile.controller;
|
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.jpsoft.smart.modules.base.dto.PersonDeviceFilterLogDTO;
|
|
|
-import com.jpsoft.smart.modules.base.entity.CompanyPosition;
|
|
|
-import com.jpsoft.smart.modules.base.entity.DeviceInfo;
|
|
|
-import com.jpsoft.smart.modules.base.entity.PersonDeviceFilterLog;
|
|
|
-import com.jpsoft.smart.modules.base.entity.PersonInfo;
|
|
|
+import com.jpsoft.smart.modules.base.entity.*;
|
|
|
+import com.jpsoft.smart.modules.base.service.AlarmConfigService;
|
|
|
import com.jpsoft.smart.modules.base.service.DeviceInfoService;
|
|
|
import com.jpsoft.smart.modules.base.service.PersonDeviceFilterLogService;
|
|
|
import com.jpsoft.smart.modules.base.service.PersonInfoService;
|
|
@@ -20,6 +18,7 @@ import org.joda.time.DateTime;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.format.annotation.DateTimeFormat;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
@@ -33,11 +32,16 @@ public class PersonDeviceFilterLogController {
|
|
|
|
|
|
@Autowired
|
|
|
private PersonDeviceFilterLogService personDeviceFilterLogService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private DeviceInfoService deviceInfoService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private PersonInfoService personInfoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AlarmConfigService alarmConfigService;
|
|
|
+
|
|
|
@ApiOperation(value="体温记录(正常、异常)")
|
|
|
@RequestMapping(value = "detail",method = RequestMethod.POST)
|
|
|
@ApiImplicitParams({
|
|
@@ -153,6 +157,55 @@ public class PersonDeviceFilterLogController {
|
|
|
msgResult.setMessage(ex.getMessage());
|
|
|
}
|
|
|
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+ @ApiOperation(value="未测量体温人员列表")
|
|
|
+ @RequestMapping(value = "queryUnmeasureGroupList",method = RequestMethod.POST)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "queryDate",value = "查询日期(yyyy-MM-dd)", paramType = "form",dataType = "String"),
|
|
|
+ @ApiImplicitParam(name="token",value = "令牌",required = true,paramType = "form"),
|
|
|
+ @ApiImplicitParam(name="subject",value = "目标(不传)",paramType = "form")
|
|
|
+ })
|
|
|
+ public MessageResult<List> queryUnmeasureGroupList(
|
|
|
+ @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate,
|
|
|
+ @RequestAttribute String subject,
|
|
|
+ String token){
|
|
|
+ MessageResult<List> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try{
|
|
|
+ PersonInfo personInfo = personInfoService.get(Long.valueOf(subject));
|
|
|
+
|
|
|
+ List<AlarmConfig> configList = alarmConfigService.findByCompanyId(personInfo.getCompanyId());
|
|
|
+
|
|
|
+ String dateStr = new DateTime(queryDate).toString("yyyy-MM-dd");
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
+
|
|
|
+ List<Map> mapList = new ArrayList<>();
|
|
|
+
|
|
|
+ for (AlarmConfig alarmConfig: configList) {
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ DateTime startTime = new DateTime(sdf.parse(dateStr + " " + alarmConfig.getStartTime()));
|
|
|
+ DateTime endTime = new DateTime(sdf.parse(dateStr + " " + alarmConfig.getEndTime()));
|
|
|
+
|
|
|
+ List<PersonInfo> unmeasuredList = personDeviceFilterLogService.queryUnmeasuredList(personInfo.getCompanyId(),startTime.toDate(),endTime.toDate());
|
|
|
+
|
|
|
+ map.put("startTime",alarmConfig.getStartTime());
|
|
|
+ map.put("endTime",alarmConfig.getEndTime());
|
|
|
+ map.put("list",unmeasuredList);
|
|
|
+
|
|
|
+ mapList.add(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ msgResult.setData(mapList);
|
|
|
+ msgResult.setResult(true);
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
return msgResult;
|
|
|
}
|
|
|
}
|