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 168 public AjaxResult addSignIn(SignIn signIn) throws IOException {
169 169 // 查询员工信息
170 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 173 Equipment equipment = equipmentMapper.selectEquipmentByDeviceId(signIn.getDeviceId());
174 174 SignInResponseVo vo = getSignInResponseVo(signIn, equipment);
... ... @@ -232,7 +232,7 @@ public class SignInServiceImpl implements ISignInService {
232 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 236 if (new BigDecimal(20).compareTo(signIn.getAlcoholIntake()) > 0) {
237 237 result = true;
238 238 } else {
... ... @@ -317,6 +317,7 @@ public class SignInServiceImpl implements ISignInService {
317 317 // 获取文件上传路径
318 318 String pathFileName = getPathFileName(filePath, fileName);
319 319 signIn.setImage(pathFileName);
  320 + log.info("开始上传签到图片");
320 321 // 异步上传文件
321 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 74 outputStream = new FileOutputStream(url);
75 75 outputStream.write(photoBase64);
76 76 outputStream.flush();
77   - log.info("文件上传完毕");
  77 + log.info("异步文件上传完毕");
78 78 } catch (Exception e) {
79 79 log.error("文件上传异常:{}", e.getMessage());
80 80 } finally {
... ...