|
@@ -310,8 +310,10 @@ 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> queryCompanyList(String token,@RequestAttribute String subject){
|
|
|
|
- MessageResult<List> messageResult = new MessageResult<>();
|
|
|
|
|
|
+ public MessageResult<Map> queryCompanyList(String token,@RequestAttribute String subject){
|
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
|
+
|
|
|
|
+ Map<String,Object> dataMap = new HashMap<>();
|
|
|
|
|
|
try {
|
|
try {
|
|
PersonInfo personInfo = personInfoService.get(Long.valueOf(subject));
|
|
PersonInfo personInfo = personInfoService.get(Long.valueOf(subject));
|
|
@@ -320,7 +322,44 @@ public class PersonDeviceLogApiController {
|
|
|
|
|
|
List<CompanyInfo> companyList = companyInfoService.findByCompanyCode(companyInfo.getCode() + "%",personInfo.getId());
|
|
List<CompanyInfo> companyList = companyInfoService.findByCompanyCode(companyInfo.getCode() + "%",personInfo.getId());
|
|
|
|
|
|
- messageResult.setData(companyList);
|
|
|
|
|
|
+ List<Map> mapList = companyList.stream().map((company)->{
|
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ map.put("id",company.getId());
|
|
|
|
+ map.put("code",company.getCode());
|
|
|
|
+ map.put("name", company.getName());
|
|
|
|
+
|
|
|
|
+ return map;
|
|
|
|
+
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ DateTime beginTime =DateTime.now().withTimeAtStartOfDay();
|
|
|
|
+ DateTime endTime = beginTime.plusDays(1);
|
|
|
|
+ long sumPersonNum = 0;
|
|
|
|
+ long sumDetectedNum = 0;
|
|
|
|
+
|
|
|
|
+ for (Map map : mapList) {
|
|
|
|
+ String companyId = (String)map.get("id");
|
|
|
|
+ String companyCode = (String)map.get("code");
|
|
|
|
+
|
|
|
|
+ //单位
|
|
|
|
+ long personNum = personInfoService.countByCompanyId(companyId);
|
|
|
|
+ sumPersonNum += personNum;
|
|
|
|
+
|
|
|
|
+ //当日已测人数
|
|
|
|
+ long detectedNum = personDeviceLogService.countByAttendance(companyCode,beginTime.toDate(),endTime.toDate());
|
|
|
|
+ sumDetectedNum += sumDetectedNum;
|
|
|
|
+
|
|
|
|
+ map.put("personNum",personNum);
|
|
|
|
+ map.put("detectedNum",detectedNum);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //增加汇总
|
|
|
|
+ dataMap.put("list",mapList);
|
|
|
|
+ dataMap.put("sumPersonNum",sumPersonNum);
|
|
|
|
+ dataMap.put("sumDetectedNum",sumDetectedNum);
|
|
|
|
+
|
|
|
|
+ messageResult.setData(dataMap);
|
|
messageResult.setResult(true);
|
|
messageResult.setResult(true);
|
|
}
|
|
}
|
|
catch (Exception ex){
|
|
catch (Exception ex){
|