bug修复

This commit is contained in:
guo 2024-04-12 11:38:20 +08:00
parent 89db063ade
commit b85aa415ee
4 changed files with 44 additions and 11 deletions

View File

@ -144,12 +144,19 @@ public class HikvisionCall {
log.error("请先上传对应设备信息idCard:{},devSN:{}", idCard, srcIndex); log.error("请先上传对应设备信息idCard:{},devSN:{}", idCard, srcIndex);
return Result.error("请先上传对应设备信息idCard:" + idCard + ",extEventCardNo:" + extEventCardNo); return Result.error("请先上传对应设备信息idCard:" + idCard + ",extEventCardNo:" + extEventCardNo);
} }
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("passTime", DateUtil.formatDateTime(DateUtil.parse(happenTime))); String time = DateUtil.formatDateTime(DateUtil.parse(happenTime));
map.put("passTime", time);
map.put("idCard", idCard); map.put("idCard", idCard);
Integer count = workerAttendanceMapper.selectCount(new LambdaQueryWrapper<WorkerAttendance>()
.eq(WorkerAttendance::getPersonSn, workerInfo.getPersonSn())
.eq(WorkerAttendance::getCreateTime, time)
);
if (count != 0) {
continue;
}
map.put("attendanceNumber", workerInfo.getAttendanceNumber()); map.put("attendanceNumber", workerInfo.getAttendanceNumber());
int passType = workerAttendanceServiceImpl.getPassType(ufaceDev, DateUtil.formatDateTime(DateUtil.parse(happenTime))); int passType = workerAttendanceServiceImpl.getPassType(ufaceDev, time);
map.put("direction", passType); map.put("direction", passType);
map.put("passType", 2); map.put("passType", 2);
map.put("projectCode", workerInfo.getProjectSn()); map.put("projectCode", workerInfo.getProjectSn());
@ -212,6 +219,13 @@ public class HikvisionCall {
entity.setCarNumber(plateNo); entity.setCarNumber(plateNo);
entity.setType(getPassType(carCamera.getPassType())); entity.setType(getPassType(carCamera.getPassType()));
entity.setPassTime(time); entity.setPassTime(time);
Integer count = carPassRecordMapper.selectCount(new LambdaQueryWrapper<CarPassRecord>()
.eq(CarPassRecord::getCarNumber, plateNo)
.eq(CarPassRecord::getPassTime, time)
);
if (count != 0) {
continue;
}
try { try {
//车牌 //车牌

View File

@ -319,6 +319,8 @@ public class Project implements Serializable {
@JsonIgnore @JsonIgnore
@ApiModelProperty(value = "海康appSecret") @ApiModelProperty(value = "海康appSecret")
private String artemisConfigAppSecret; private String artemisConfigAppSecret;
@ApiModelProperty(value = "是否开启劳务在场零点清空功能")
private Integer enableWorkerAttendanceZero;
/** /**

View File

@ -1986,9 +1986,9 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
String folder = basePath + "/" + IdUtil.simpleUUID(); String folder = basePath + "/" + IdUtil.simpleUUID();
new File(folder).mkdirs(); new File(folder).mkdirs();
String zipPath = folder + "/" + IdUtil.simpleUUID() + ".zip"; String zipPath = folder + "/" + IdUtil.simpleUUID() + ".zip";
String unzipPath = folder + "/" + IdUtil.simpleUUID(); String unzipFolder = folder + "/" + IdUtil.simpleUUID();
file.transferTo(new File(zipPath)); file.transferTo(new File(zipPath));
File file1 = ZipUtil.unzip(zipPath, unzipPath); File file1 = ZipUtil.unzip(zipPath, unzipFolder);
} }

View File

@ -1,5 +1,6 @@
package com.zhgd.xmgl.task; package com.zhgd.xmgl.task;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhgd.jeecg.common.mybatis.EntityMap; import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.async.AsyncCommon; import com.zhgd.xmgl.async.AsyncCommon;
@ -16,17 +17,17 @@ import com.zhgd.xmgl.modules.project.service.IProjectDevStatisticsService;
import com.zhgd.xmgl.modules.standard.entity.StandardSampleNotice; import com.zhgd.xmgl.modules.standard.entity.StandardSampleNotice;
import com.zhgd.xmgl.modules.standard.mapper.StandardSampleNoticeMapper; import com.zhgd.xmgl.modules.standard.mapper.StandardSampleNoticeMapper;
import com.zhgd.xmgl.modules.standard.mapper.StandardSampleRecordMapper; import com.zhgd.xmgl.modules.standard.mapper.StandardSampleRecordMapper;
import com.zhgd.xmgl.modules.worker.entity.WorkerAttendancePresence;
import com.zhgd.xmgl.modules.worker.mapper.WorkerAttendancePresenceMapper; import com.zhgd.xmgl.modules.worker.mapper.WorkerAttendancePresenceMapper;
import com.zhgd.xmgl.modules.worker.service.IWorkerAttendancePresenceService;
import com.zhgd.xmgl.modules.worker.service.IWorkerMonthAttendanceStatisticsService; import com.zhgd.xmgl.modules.worker.service.IWorkerMonthAttendanceStatisticsService;
import com.zhgd.xmgl.util.AqiUtil; import com.zhgd.xmgl.util.AqiUtil;
import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.javacrumbs.shedlock.core.SchedulerLock; import net.javacrumbs.shedlock.core.SchedulerLock;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.time.DateUtils; import org.apache.commons.lang.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -68,6 +69,8 @@ public class ProjectTask {
AsyncCommon asyncCommon; AsyncCommon asyncCommon;
public static Map<String, Integer> sendcodecount = new HashMap<>(); public static Map<String, Integer> sendcodecount = new HashMap<>();
@Autowired
private IWorkerAttendancePresenceService workerAttendancePresenceService;
/** /**
* 定时清除无效的校验码 * 定时清除无效的校验码
@ -264,10 +267,6 @@ public class ProjectTask {
} }
/** /**
* @param
* @return void 返回类型
* @throws
* @Title: deleteAttendancePresence
* @Description: 清除无效在场数据 * @Description: 清除无效在场数据
*/ */
/*@Scheduled(cron = "0 0 2 * * ?")*/ /*@Scheduled(cron = "0 0 2 * * ?")*/
@ -277,4 +276,22 @@ public class ProjectTask {
workerAttendancePresenceMapper.deleteAttendancePresence(); workerAttendancePresenceMapper.deleteAttendancePresence();
} }
/**
* 劳务在场零点清空功能
*/
@Scheduled(cron = "0 20 0 * * ?")
@SchedulerLock(name = "updateWorkerAttendanceZero", lockAtMostFor = 1000 * 60 * 30, lockAtLeastFor = 1000 * 60 * 3)
@RequestMapping("updateWorkerAttendanceZero")
public void updateWorkerAttendanceZero() {
List<Project> projects = projectMapper.selectList(new LambdaQueryWrapper<Project>()
.eq(Project::getEnableWorkerAttendanceZero, 1));
for (Project project : projects) {
String projectSn = project.getProjectSn();
workerAttendancePresenceMapper.delete(new LambdaQueryWrapper<WorkerAttendancePresence>()
.eq(WorkerAttendancePresence::getProjectSn, projectSn));
workerAttendancePresenceService.addNowAllWorkerAttendancePresence(projectSn);
}
}
} }