在接口方法中加同步关键字
@Transactional
public synchronized void attendanceFace(String workerUuid, String type){
Date date = new Date();
Worker worker = workerService.getWorkerByUuid(workerUuid);
Check.notNull(worker, "未找到该用户,workerUuid=" + workerUuid);
AttDetail attDetail = new AttDetail();
attDetail.setEmpName(worker.getWorkName());
attDetail.setEmpUuid(worker.getWorkUuid());
Map map = workerService.getGroupByWorkerUuid(workerUuid);
Check.notNull(worker, "未找到该员工班组信息,workerUuid=" + workerUuid);
attDetail.setAttDate(new Date());
attDetail.setTeamName(map.get("groupName").toString());
attDetail.setTeamUuid(map.get("groupUuid").toString());
attDetail.setDeviceType(DeviceType.ST_FACE.getCode());
attDetail.setAttTime(date);
attDetail.setSynStatus(SynStatus.unSyn.getCode());
attDetail.setInOut(Short.valueOf(type));
attDetailService.save(attDetail);
Integer info = attInfoService.saveAttInfo(attDetail);
attInfoService.saveAttInfoCount(attDetail);
logger.info("attInfo save success");
// com.gonghui.attendance.dto.AttendanceWorkerDto workerDto = attInfoService.getAttendanceWorkerDto(attDetail);
if ("ON".equals(LEDSwitch)) {
asyncExecutor(attDetail);
}
//液晶显示屏展示
if ("ON".equals(LCDSwitch)) {
lcdConfigService.sendLcdConfigData(workerUuid,false);
}
}