|
@@ -12,20 +12,19 @@ import com.jpsoft.smart.modules.base.service.PersonInfoService;
|
|
import com.jpsoft.smart.modules.common.dto.MessageResult;
|
|
import com.jpsoft.smart.modules.common.dto.MessageResult;
|
|
import com.jpsoft.smart.modules.common.dto.Sort;
|
|
import com.jpsoft.smart.modules.common.dto.Sort;
|
|
import com.jpsoft.smart.modules.common.utils.PojoUtils;
|
|
import com.jpsoft.smart.modules.common.utils.PojoUtils;
|
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.joda.time.DateTime;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/mobile/PersonDeviceFilterLog")
|
|
@RequestMapping("/mobile/PersonDeviceFilterLog")
|
|
@@ -39,7 +38,7 @@ public class PersonDeviceFilterLogController {
|
|
@Autowired
|
|
@Autowired
|
|
private PersonInfoService personInfoService;
|
|
private PersonInfoService personInfoService;
|
|
|
|
|
|
- @ApiOperation(value="获取信息")
|
|
|
|
|
|
+ @ApiOperation(value="体温记录(正常、异常)")
|
|
@GetMapping("edit/{id}")
|
|
@GetMapping("edit/{id}")
|
|
public MessageResult<PersonDeviceFilterLogDTO> edit(@PathVariable("id") Long id){
|
|
public MessageResult<PersonDeviceFilterLogDTO> edit(@PathVariable("id") Long id){
|
|
MessageResult<PersonDeviceFilterLogDTO> msgResult = new MessageResult<>();
|
|
MessageResult<PersonDeviceFilterLogDTO> msgResult = new MessageResult<>();
|
|
@@ -78,4 +77,64 @@ public class PersonDeviceFilterLogController {
|
|
|
|
|
|
return msgResult;
|
|
return msgResult;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value="体温记录(个人列表)")
|
|
|
|
+ @RequestMapping(value = "list",method = RequestMethod.POST)
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "personId",value = "人员编号", required = false, paramType = "form",dataType = "Long"),
|
|
|
|
+ @ApiImplicitParam(name = "recordDate",value = "查询日期(yyyy-MM-dd)", required = false, paramType = "form",dataType = "String")
|
|
|
|
+ })
|
|
|
|
+ public MessageResult<List<PersonDeviceFilterLogDTO>> list(@RequestParam(value="personId",defaultValue="") Long personId,
|
|
|
|
+ @RequestParam(value="recordDate",defaultValue="") String recordDate){
|
|
|
|
+ MessageResult<List<PersonDeviceFilterLogDTO>> 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",personId);
|
|
|
|
+ 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.get(personDeviceFilterLog.getDeviceNo());
|
|
|
|
+ PersonInfo personInfo = personInfoService.get(Long.valueOf(personDeviceFilterLog.getPersonId()));
|
|
|
|
+
|
|
|
|
+ personDeviceFilterLogDTO.setDeviceName(deviceInfo.getAliasName());
|
|
|
|
+ personDeviceFilterLogDTO.setPersonName(personInfo.getName());
|
|
|
|
+ if(personDeviceFilterLog.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);
|
|
|
|
+ }
|
|
|
|
+ catch(Exception ex){
|
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
|
+
|
|
|
|
+ msgResult.setResult(false);
|
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return msgResult;
|
|
|
|
+ }
|
|
}
|
|
}
|