|
@@ -46,15 +46,15 @@ public class PersonDeviceLogApiController {
|
|
@Autowired
|
|
@Autowired
|
|
private CompanyInfoService companyInfoService;
|
|
private CompanyInfoService companyInfoService;
|
|
|
|
|
|
- @PostMapping("queryTemperatureRecordListByEnt")
|
|
|
|
- @ApiOperation(value="企业管理员查看温度记录(需要传令牌)")
|
|
|
|
|
|
+ @PostMapping("queryTemperatureRawRecordList")
|
|
|
|
+ @ApiOperation(value="根据实时数据查看企业人员温度数据")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParam(name="queryDate",value = "查询日期",required = true,paramType = "form"),
|
|
@ApiImplicitParam(name="queryDate",value = "查询日期",required = true,paramType = "form"),
|
|
@ApiImplicitParam(name="companyId",value = "单位编号",paramType = "form"),
|
|
@ApiImplicitParam(name="companyId",value = "单位编号",paramType = "form"),
|
|
@ApiImplicitParam(name="token",value = "令牌",required = true,paramType = "form"),
|
|
@ApiImplicitParam(name="token",value = "令牌",required = true,paramType = "form"),
|
|
@ApiImplicitParam(name="subject",value = "目标(不传)",paramType = "form")
|
|
@ApiImplicitParam(name="subject",value = "目标(不传)",paramType = "form")
|
|
})
|
|
})
|
|
- public MessageResult<Map> queryTemperatureRecordListByEnt(
|
|
|
|
|
|
+ public MessageResult<Map> queryTemperatureRawRecordList(
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate,
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate,
|
|
String companyId,
|
|
String companyId,
|
|
String token,
|
|
String token,
|
|
@@ -189,6 +189,106 @@ public class PersonDeviceLogApiController {
|
|
return messageResult;
|
|
return messageResult;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @PostMapping("queryTemperatureRecordListByEnt")
|
|
|
|
+ @ApiOperation(value="根据过滤后考勤记录统计单位员工温度数据")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name="queryDate",value = "查询日期",required = true,paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name="companyId",value = "单位编号",paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name="filter",value = "是否过滤(1-显示异常数据,0-显示全部)",paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name="token",value = "令牌",required = true,paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name="subject",value = "目标(不传)",paramType = "form")
|
|
|
|
+ })
|
|
|
|
+ public MessageResult<Map> queryTemperatureRecordListByEnt(
|
|
|
|
+ @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate,
|
|
|
|
+ String companyId,
|
|
|
|
+ String token,
|
|
|
|
+ String filter,
|
|
|
|
+ @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
|
+ @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
|
+ @RequestAttribute String subject){
|
|
|
|
+ Page<Map> recordPageList = new Page<>();
|
|
|
|
+
|
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ PersonInfo admin = personInfoService.get(Long.valueOf(subject));
|
|
|
|
+
|
|
|
|
+ Map<String, Object> personSearchParam = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isNotEmpty(companyId) && companyInfoService.exist(companyId)) {
|
|
|
|
+ personSearchParam.put("companyId", companyId);
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ personSearchParam.put("companyId", admin.getCompanyId());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isNotEmpty(filter) && "1".equals(filter)){
|
|
|
|
+ personSearchParam.put("abnormalDate",queryDate);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<Sort> sortList1 = new ArrayList<>();
|
|
|
|
+ sortList1.add(new Sort("id_","asc"));
|
|
|
|
+
|
|
|
|
+ Page<PersonInfo> personPageList = personInfoService.pageSearch(personSearchParam,pageIndex,pageSize,true,sortList1);
|
|
|
|
+
|
|
|
|
+ DateTime startTime = new DateTime(queryDate);
|
|
|
|
+
|
|
|
|
+ for (PersonInfo person : personPageList) {
|
|
|
|
+ Map<String, Object> recordMap = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ recordMap.put("name", person.getName());
|
|
|
|
+ recordMap.put("faceImageUrl", person.getFaceImageUrl());
|
|
|
|
+
|
|
|
|
+ Map<String, Object> searchParams = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ searchParams.put("personId", person.getId());
|
|
|
|
+ searchParams.put("beginTime", startTime.toDate());
|
|
|
|
+ searchParams.put("endTime", startTime.plusDays(1).toDate());
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isNotEmpty(filter) && "1".equals(filter)){
|
|
|
|
+ searchParams.put("abnormalFilter","1");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
|
+ sortList.add(new Sort("record_time", "asc"));
|
|
|
|
+
|
|
|
|
+ Page<PersonDeviceFilterLog> page = personDeviceFilterLogService.pageSearch(searchParams,1,24,false,sortList);
|
|
|
|
+
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
|
|
|
|
+
|
|
|
|
+ List<Map> personDeviceLogs = page.stream()
|
|
|
|
+ .filter((log)->log.getTemperature().compareTo(BigDecimal.ZERO)>0)
|
|
|
|
+ .map((log)->{
|
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
+ map.put("temperature",log.getTemperature());
|
|
|
|
+ map.put("recordTime",sdf.format(log.getRecordTime()));
|
|
|
|
+
|
|
|
|
+ return map;
|
|
|
|
+ })
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ recordMap.put("list", personDeviceLogs);
|
|
|
|
+
|
|
|
|
+ recordPageList.add(recordMap);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ recordPageList.setTotal(personPageList.getTotal());
|
|
|
|
+ recordPageList.setPages(personPageList.getPages());
|
|
|
|
+ recordPageList.setPageNum(personPageList.getPageNum());
|
|
|
|
+ recordPageList.setPageSize(personPageList.getPageSize());
|
|
|
|
+
|
|
|
|
+ messageResult.setResult(true);
|
|
|
|
+ messageResult.setData(PojoUtils.pageWrapper(recordPageList));
|
|
|
|
+ }
|
|
|
|
+ catch (Exception ex){
|
|
|
|
+ messageResult.setResult(false);
|
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return messageResult;
|
|
|
|
+ }
|
|
|
|
+
|
|
@PostMapping("queryCompanyList")
|
|
@PostMapping("queryCompanyList")
|
|
@ApiOperation(value="查询企业列表")
|
|
@ApiOperation(value="查询企业列表")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@@ -366,16 +466,15 @@ public class PersonDeviceLogApiController {
|
|
try{
|
|
try{
|
|
List<PersonDeviceFilterLog> personDeviceFilterLogList = personDeviceFilterLogService.list();
|
|
List<PersonDeviceFilterLog> personDeviceFilterLogList = personDeviceFilterLogService.list();
|
|
Map map = new HashMap();
|
|
Map map = new HashMap();
|
|
- map.put("已检测",personDeviceFilterLogList.size());
|
|
|
|
|
|
+ map.put("detected",personDeviceFilterLogList.size());
|
|
List<CompanyInfo> companyList = companyInfoService.list();
|
|
List<CompanyInfo> companyList = companyInfoService.list();
|
|
- listMap.add(map);
|
|
|
|
- Map map1 = new HashMap();
|
|
|
|
- map1.put("企业数量",companyList.size());
|
|
|
|
- listMap.add(map1);
|
|
|
|
|
|
+
|
|
|
|
+ map.put("companyCount",companyList.size());
|
|
|
|
+
|
|
List<PersonInfo> personInfo = personInfoService.list();
|
|
List<PersonInfo> personInfo = personInfoService.list();
|
|
- Map map2 = new HashMap();
|
|
|
|
- map2.put("监管人数",personInfo.size());
|
|
|
|
- listMap.add(map2);
|
|
|
|
|
|
+
|
|
|
|
+ map.put("personCount",personInfo.size());
|
|
|
|
+ listMap.add(map);
|
|
|
|
|
|
msgResult.setResult(true);
|
|
msgResult.setResult(true);
|
|
msgResult.setData(listMap);
|
|
msgResult.setData(listMap);
|
|
@@ -398,12 +497,12 @@ public class PersonDeviceLogApiController {
|
|
@ApiImplicitParam(name="token",value = "令牌",required = true,paramType = "form"),
|
|
@ApiImplicitParam(name="token",value = "令牌",required = true,paramType = "form"),
|
|
@ApiImplicitParam(name="subject",value = "目标(不传)",paramType = "form")
|
|
@ApiImplicitParam(name="subject",value = "目标(不传)",paramType = "form")
|
|
})
|
|
})
|
|
- public MessageResult< List<Map<String, Object>>> unusualStatistics(
|
|
|
|
|
|
+ public MessageResult<Map<String, Object>> unusualStatistics(
|
|
String startTime,String endTime,
|
|
String startTime,String endTime,
|
|
String token, @RequestAttribute String subject) {
|
|
String token, @RequestAttribute String subject) {
|
|
- MessageResult<List<Map<String, Object>>> msgResult = new MessageResult<>();
|
|
|
|
|
|
+ MessageResult<Map<String, Object>> msgResult = new MessageResult<>();
|
|
|
|
|
|
- List<Map<String, Object>> list = new ArrayList<>();
|
|
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
try{
|
|
try{
|
|
String startDate = "";
|
|
String startDate = "";
|
|
@@ -434,16 +533,31 @@ public class PersonDeviceLogApiController {
|
|
}
|
|
}
|
|
|
|
|
|
List<Map<String, Object>> mapList = personDeviceFilterLogService.unusualStatistics(bd,startDate,endDate);
|
|
List<Map<String, Object>> mapList = personDeviceFilterLogService.unusualStatistics(bd,startDate,endDate);
|
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ int companyTotalCount = 0;
|
|
|
|
+ int personTotalCount = 0;
|
|
|
|
+
|
|
|
|
+ for (Map<String, Object> curMap:mapList) {
|
|
|
|
+ if(curMap.get("name")!=null){
|
|
|
|
+ list.add(curMap);
|
|
|
|
+ companyTotalCount++;
|
|
|
|
+ if(curMap.get("personCount")!=null){
|
|
|
|
+ String personCountStr = curMap.get("personCount").toString();
|
|
|
|
+ if(StringUtil.isNotEmpty(personCountStr)){
|
|
|
|
+ personTotalCount = personTotalCount + Integer.parseInt(personCountStr);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
|
- for (Map<String, Object> map:mapList) {
|
|
|
|
- if(map.get("name")!=null&&StringUtil.isNotEmpty(map.get("name").toString())){
|
|
|
|
- list.add(map);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ map.put("companyTotalCount",companyTotalCount);
|
|
|
|
+ map.put("personTotalCount",personTotalCount);
|
|
|
|
+ map.put("list",list);
|
|
|
|
+
|
|
msgResult.setResult(true);
|
|
msgResult.setResult(true);
|
|
- msgResult.setData(list);
|
|
|
|
|
|
+ msgResult.setData(map);
|
|
}
|
|
}
|
|
catch (Exception ex){
|
|
catch (Exception ex){
|
|
msgResult.setMessage(ex.getMessage());
|
|
msgResult.setMessage(ex.getMessage());
|