|
@@ -4,13 +4,8 @@ import cn.hutool.core.date.DateUtil;
|
|
import com.github.pagehelper.util.StringUtil;
|
|
import com.github.pagehelper.util.StringUtil;
|
|
import com.jpsoft.smart.modules.base.dto.CompanyRecordReportDTO;
|
|
import com.jpsoft.smart.modules.base.dto.CompanyRecordReportDTO;
|
|
import com.jpsoft.smart.modules.base.entity.CompanyInfo;
|
|
import com.jpsoft.smart.modules.base.entity.CompanyInfo;
|
|
-import com.jpsoft.smart.modules.base.entity.PersonCompany;
|
|
|
|
-import com.jpsoft.smart.modules.base.entity.PersonDeviceFilterLog;
|
|
|
|
import com.jpsoft.smart.modules.base.entity.PersonInfo;
|
|
import com.jpsoft.smart.modules.base.entity.PersonInfo;
|
|
-import com.jpsoft.smart.modules.base.service.CompanyInfoService;
|
|
|
|
-import com.jpsoft.smart.modules.base.service.PersonCompanyService;
|
|
|
|
-import com.jpsoft.smart.modules.base.service.PersonDeviceFilterLogService;
|
|
|
|
-import com.jpsoft.smart.modules.base.service.PersonInfoService;
|
|
|
|
|
|
+import com.jpsoft.smart.modules.base.service.*;
|
|
import com.jpsoft.smart.modules.common.dto.MessageResult;
|
|
import com.jpsoft.smart.modules.common.dto.MessageResult;
|
|
import com.jpsoft.smart.modules.sys.entity.User;
|
|
import com.jpsoft.smart.modules.sys.entity.User;
|
|
import com.jpsoft.smart.modules.sys.service.UserService;
|
|
import com.jpsoft.smart.modules.sys.service.UserService;
|
|
@@ -21,7 +16,6 @@ import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -47,6 +41,9 @@ public class ReportController {
|
|
@Autowired
|
|
@Autowired
|
|
private PersonDeviceFilterLogService personDeviceFilterLogService;
|
|
private PersonDeviceFilterLogService personDeviceFilterLogService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private PersonDeviceLogService personDeviceLogService;
|
|
|
|
+
|
|
|
|
|
|
@ApiOperation(value = "获取每个单位的人数和打卡人数")
|
|
@ApiOperation(value = "获取每个单位的人数和打卡人数")
|
|
@PostMapping("getCompanyRecordReport")
|
|
@PostMapping("getCompanyRecordReport")
|
|
@@ -87,54 +84,39 @@ public class ReportController {
|
|
//结果集
|
|
//结果集
|
|
List<CompanyRecordReportDTO> companyRecordReportDTOS = new ArrayList<>();
|
|
List<CompanyRecordReportDTO> companyRecordReportDTOS = new ArrayList<>();
|
|
//所有公司人员总数初始化
|
|
//所有公司人员总数初始化
|
|
- Integer totalPersonNum = 0;
|
|
|
|
|
|
+ long totalPersonNum = 0;
|
|
//所有公司已测人数初始化
|
|
//所有公司已测人数初始化
|
|
- Integer checkTotalPersonNum = 0;
|
|
|
|
|
|
+ long checkTotalPersonNum = 0;
|
|
if (list.size()>0){
|
|
if (list.size()>0){
|
|
for (CompanyInfo companyInfo : list){
|
|
for (CompanyInfo companyInfo : list){
|
|
- // List<CompanyInfo> companyInfoList = new ArrayList<>();
|
|
|
|
- //对象封装成集合方便后续使用
|
|
|
|
- // companyInfoList.add(companyInfo);
|
|
|
|
//结果集对象初始化
|
|
//结果集对象初始化
|
|
CompanyRecordReportDTO companyRecordReportDTO = new CompanyRecordReportDTO();
|
|
CompanyRecordReportDTO companyRecordReportDTO = new CompanyRecordReportDTO();
|
|
- //查询公司的所有未删除对象
|
|
|
|
- List<PersonInfo> personInfoList = personInfoService.findByCompanyId(companyInfo.getId());
|
|
|
|
- Integer personTotalNum = personInfoList.size();
|
|
|
|
-
|
|
|
|
|
|
+ //查询公司的所有未删除员工数
|
|
|
|
+ long personTotalNum = personInfoService.countByCompanyId(companyInfo.getId());
|
|
//总人数
|
|
//总人数
|
|
- totalPersonNum = totalPersonNum+ personInfoList.size();
|
|
|
|
|
|
+ totalPersonNum = totalPersonNum + personTotalNum;
|
|
|
|
|
|
- //过滤记录表中时间区间内的非重复数据
|
|
|
|
- List<PersonDeviceFilterLog> personDeviceFilterLogs = personDeviceFilterLogService.getDayCheckedPersonByCompanyList(beginTime,endTime,companyInfo);
|
|
|
|
|
|
+ //记录表中时间区间内的非重复数据
|
|
|
|
+ long checkPersonNum = personDeviceLogService.countByAttendance(companyInfo.getCode(),beginTime,endTime);
|
|
//总已测人数
|
|
//总已测人数
|
|
- checkTotalPersonNum = checkTotalPersonNum + personDeviceFilterLogs.size();
|
|
|
|
-
|
|
|
|
- //查询出已测温对象
|
|
|
|
- List<PersonInfo> checkPersonList = new ArrayList<>();
|
|
|
|
- if (personDeviceFilterLogs.size()>0){
|
|
|
|
- for (PersonDeviceFilterLog personDeviceFilterLog : personDeviceFilterLogs){
|
|
|
|
- PersonInfo personInfo = personInfoService.findById(personDeviceFilterLog.getPersonId().longValue());
|
|
|
|
- if (personInfo != null){
|
|
|
|
- checkPersonList.add(personInfo);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ checkTotalPersonNum = checkTotalPersonNum + checkPersonNum;
|
|
|
|
+
|
|
//查询出未测温对象
|
|
//查询出未测温对象
|
|
- personInfoList.removeAll(checkPersonList);
|
|
|
|
|
|
+ List<PersonInfo> unmeasuredList = personDeviceLogService.queryUnAttendanceList(companyInfo.getCode(), beginTime, endTime);
|
|
//未测试人员姓名集合初始化
|
|
//未测试人员姓名集合初始化
|
|
String name = "";
|
|
String name = "";
|
|
- if (personInfoList.size()>0){
|
|
|
|
- for (PersonInfo personInfo : personInfoList){
|
|
|
|
|
|
+ if (unmeasuredList.size()>0){
|
|
|
|
+ for (PersonInfo personInfo : unmeasuredList){
|
|
name = name +","+ personInfo.getName();
|
|
name = name +","+ personInfo.getName();
|
|
|
|
|
|
}
|
|
}
|
|
name = name.substring(1);
|
|
name = name.substring(1);
|
|
}
|
|
}
|
|
|
|
|
|
- // Integer checkPersonTotal = personDeviceFilterLogService.getDayCheckedPersonNumByCompanyList(beginTime,endTime,companyInfoList,null);
|
|
|
|
|
|
+
|
|
companyRecordReportDTO.setCompanyName(companyInfo.getName());
|
|
companyRecordReportDTO.setCompanyName(companyInfo.getName());
|
|
companyRecordReportDTO.setPersonTotal(personTotalNum);
|
|
companyRecordReportDTO.setPersonTotal(personTotalNum);
|
|
- companyRecordReportDTO.setCheckPersonTotal(personDeviceFilterLogs.size());
|
|
|
|
|
|
+ companyRecordReportDTO.setCheckPersonTotal(checkPersonNum);
|
|
companyRecordReportDTO.setUnCheckPersonName(name);
|
|
companyRecordReportDTO.setUnCheckPersonName(name);
|
|
companyRecordReportDTOS.add(companyRecordReportDTO);
|
|
companyRecordReportDTOS.add(companyRecordReportDTO);
|
|
|
|
|