塔吊-人员考勤

This commit is contained in:
guo 2024-03-11 09:33:45 +08:00
parent 78b34e41a4
commit 7b0fa14af4

View File

@ -12,18 +12,13 @@ import com.zhgd.xmgl.modules.bigdevice.entity.Tower;
import com.zhgd.xmgl.modules.bigdevice.entity.TowerWorkerAttendance;
import com.zhgd.xmgl.modules.bigdevice.mapper.TowerMapper;
import com.zhgd.xmgl.modules.bigdevice.mapper.TowerWorkerAttendanceMapper;
import com.zhgd.xmgl.modules.environment.entity.DustNoiseData;
import com.zhgd.xmgl.modules.environment.mapper.DustNoiseDataMapper;
import com.zhgd.xmgl.modules.project.entity.Project;
import com.zhgd.xmgl.modules.project.mapper.ProjectMapper;
import com.zhgd.xmgl.task.dto.EnvironmentDustDataDto;
import com.zhgd.xmgl.task.dto.TowerWorkerAttendanceDataDto;
import com.zhgd.xmgl.util.WindDirectionUtils;
import com.zhgd.xmgl.util.XiwonUtil;
import lombok.extern.slf4j.Slf4j;
import net.javacrumbs.shedlock.core.SchedulerLock;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.scheduling.annotation.Scheduled;
@ -33,7 +28,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
/**
@ -98,7 +96,7 @@ public class TowerWorkerAttendanceTask {
JSONObject realTimeData = xiwonUtil.postForm("/tower/attendance", project.getXiwonAppId(), project.getXiwonAppSecret(), map, JSONObject.class, (() -> {
map.put("deviceSn", devSn);
if (newestData != null && newestData.getSystemTime() != null) {
map.put("startTime", DateUtil.formatDateTime(newestData.getSystemTime()));
map.put("startTime", DateUtil.formatDateTime(DateUtil.offsetSecond(newestData.getSystemTime(), 1)));
}
map.put("endTime", DateUtil.formatDateTime(new Date()));
return map;