Commit 30ce9c1f041a1ac14473048ca921709d34454b7c

Authored by guzijian
1 parent f97c33d3

fix: 更新签到逻辑

ruoyi-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
@@ -168,7 +168,7 @@ public class SignInServiceImpl implements ISignInService { @@ -168,7 +168,7 @@ public class SignInServiceImpl implements ISignInService {
168 public AjaxResult addSignIn(SignIn signIn) throws IOException { 168 public AjaxResult addSignIn(SignIn signIn) throws IOException {
169 // 查询员工信息 169 // 查询员工信息
170 Driver driver = driverMapper.getDriverInfoByJobCode(signIn.getJobCode()); 170 Driver driver = driverMapper.getDriverInfoByJobCode(signIn.getJobCode());
171 - if (Objects.isNull(driver)) return AjaxResult.error("这个工号的员工不存在!"); 171 + if (Objects.isNull(driver)) return AjaxResult.warn("这个工号的员工不存在!");
172 // 查询地址 172 // 查询地址
173 Equipment equipment = equipmentMapper.selectEquipmentByDeviceId(signIn.getDeviceId()); 173 Equipment equipment = equipmentMapper.selectEquipmentByDeviceId(signIn.getDeviceId());
174 SignInResponseVo vo = getSignInResponseVo(signIn, equipment); 174 SignInResponseVo vo = getSignInResponseVo(signIn, equipment);
@@ -232,7 +232,7 @@ public class SignInServiceImpl implements ISignInService { @@ -232,7 +232,7 @@ public class SignInServiceImpl implements ISignInService {
232 result = checkWorkDay(signIn, driver.getPosts()); 232 result = checkWorkDay(signIn, driver.getPosts());
233 233
234 // 酒精测试校验 确定 且员工工种是驾驶员 234 // 酒精测试校验 确定 且员工工种是驾驶员
235 - if (ALCOHOL_FLAG_YES.equals(signIn.getAlcoholFlag()) && PERSONNEL_POSTS_DRIVER.equals(driver.getPosts())) { 235 + if (ALCOHOL_FLAG_YES.equals(signIn.getAlcoholFlag()) && PERSONNEL_POSTS_DRIVER.equals(driver.getPosts()) && result) {
236 if (new BigDecimal(20).compareTo(signIn.getAlcoholIntake()) > 0) { 236 if (new BigDecimal(20).compareTo(signIn.getAlcoholIntake()) > 0) {
237 result = true; 237 result = true;
238 } else { 238 } else {
@@ -317,6 +317,7 @@ public class SignInServiceImpl implements ISignInService { @@ -317,6 +317,7 @@ public class SignInServiceImpl implements ISignInService {
317 // 获取文件上传路径 317 // 获取文件上传路径
318 String pathFileName = getPathFileName(filePath, fileName); 318 String pathFileName = getPathFileName(filePath, fileName);
319 signIn.setImage(pathFileName); 319 signIn.setImage(pathFileName);
  320 + log.info("开始上传签到图片");
320 // 异步上传文件 321 // 异步上传文件
321 threadJobConfig.asyncStartUploadBase64Image(absPath, base64); 322 threadJobConfig.asyncStartUploadBase64Image(absPath, base64);
322 } 323 }
ruoyi-admin/src/main/java/com/ruoyi/service/ThreadJobService.java
@@ -74,7 +74,7 @@ public class ThreadJobService { @@ -74,7 +74,7 @@ public class ThreadJobService {
74 outputStream = new FileOutputStream(url); 74 outputStream = new FileOutputStream(url);
75 outputStream.write(photoBase64); 75 outputStream.write(photoBase64);
76 outputStream.flush(); 76 outputStream.flush();
77 - log.info("文件上传完毕"); 77 + log.info("异步文件上传完毕");
78 } catch (Exception e) { 78 } catch (Exception e) {
79 log.error("文件上传异常:{}", e.getMessage()); 79 log.error("文件上传异常:{}", e.getMessage());
80 } finally { 80 } finally {