|
@@ -3,6 +3,7 @@ package com.usky.fire.service.impl;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.usky.agbox.RemotePatrolAgBoxService;
|
|
@@ -28,10 +29,7 @@ import com.usky.system.RemoteDeptService;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -94,6 +92,14 @@ public class PatrolInspectionAttendanceServiceImpl extends AbstractCrudService<P
|
|
|
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
|
|
|
|
|
+ List<Long> userIdList = new ArrayList<>();
|
|
|
+
|
|
|
+ for (PatrolInspectionAttendance attendance : attendancePage.getRecords()) {
|
|
|
+ userIdList.add(attendance.getOperatorId());
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<PatrolInspectionPersonnel> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper1.in(PatrolInspectionPersonnel::getUserId,userIdList);
|
|
|
+ List<PatrolInspectionPersonnel> personnelList = patrolInspectionPersonnelService.list(queryWrapper1);
|
|
|
for (PatrolInspectionAttendance attendance : attendancePage.getRecords()) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("id", attendance.getId());
|
|
@@ -112,6 +118,15 @@ public class PatrolInspectionAttendanceServiceImpl extends AbstractCrudService<P
|
|
|
map.put("latitude", attendance.getLatitude());
|
|
|
map.put("remarks", attendance.getRemarks());
|
|
|
map.put("identificationNumber", attendance.getIdentificationNumber());
|
|
|
+ Integer attendanceIn = attendance.getOperatorId().intValue();
|
|
|
+ if (CollectionUtils.isNotEmpty(personnelList)){
|
|
|
+ for (PatrolInspectionPersonnel personnel : personnelList) {
|
|
|
+ if (attendanceIn.equals(personnel.getUserId())){
|
|
|
+ map.put("dispatchCompany", personnel.getDispatchCompany());
|
|
|
+ map.put("securityCompany", personnel.getSecurityCompany());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
resultList.add(map);
|
|
|
}
|
|
|
IPage<Map<String, Object>> resultPage = new Page<>();
|