diff --git a/ruoyi-admin/src/main/java/com/ruoyi/api/labour/controller/LabourApiController.java b/ruoyi-admin/src/main/java/com/ruoyi/api/labour/controller/LabourApiController.java index 8ef24031..1db63852 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/api/labour/controller/LabourApiController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/api/labour/controller/LabourApiController.java @@ -481,9 +481,11 @@ public class LabourApiController extends BaseController { if(req.getDataSign(sysApplyConfig.getPrivateKey())){ try { SurProjectAttendanceData surProjectAttendanceData = JSONObject.parseObject(req.getData(), SurProjectAttendanceData.class); + String cacheKey = CACHEKEY + surProjectAttendanceData.getWorkerId(); + Boolean cacheValue = Convert.toBool(redisCache.getCacheObject(cacheKey),true); //30秒内未重复请求 - if(Convert.toBool(redisCache.getCacheObject(CACHEKEY+surProjectAttendanceData.getWorkerId()),true)){ - redisCache.setCacheObject(CACHEKEY+surProjectAttendanceData.getWorkerId(),false,60, TimeUnit.SECONDS); + if(cacheValue){ + redisCache.setCacheObject(cacheKey,false,60, TimeUnit.SECONDS); //判断base64图片 if(StringUtils.isNotEmpty(surProjectAttendanceData.getScanPhotoBase64())){ String filePath = FileUploadUtils.uploadImages(RuoYiConfig.getUploadPath(), MultipartFileUtils.base64ToMultipartFile(surProjectAttendanceData.getScanPhotoBase64())); @@ -578,6 +580,7 @@ public class LabourApiController extends BaseController { throw new Exception(messages); } }else{ + log.info("短时间重复打卡请求,本次已忽略...{}SUCCESS",cacheKey); return success("短时间重复打卡请求,本次已忽略...{}SUCCESS"); } }catch (Exception e){ @@ -638,8 +641,11 @@ public class LabourApiController extends BaseController { } for(SurProjectAttendanceData surProjectAttendanceData:surProjectAttendanceDataList){ //30秒内未重复请求 - if(Convert.toBool(redisCache.getCacheObject(CACHEKEY+surProjectAttendanceData.getWorkerId()),true)){ - redisCache.setCacheObject(CACHEKEY+surProjectAttendanceData.getWorkerId(),false,60, TimeUnit.SECONDS); + String cacheKey = CACHEKEY + surProjectAttendanceData.getWorkerId(); + Boolean cacheValue = Convert.toBool(redisCache.getCacheObject(cacheKey),true); + //30秒内未重复请求 + if(cacheValue){ + redisCache.setCacheObject(cacheKey,false,60, TimeUnit.SECONDS); //判断base64图片 if(StringUtils.isNotEmpty(surProjectAttendanceData.getScanPhotoBase64())){ String filePath = FileUploadUtils.uploadImages(RuoYiConfig.getUploadPath(), MultipartFileUtils.base64ToMultipartFile(surProjectAttendanceData.getScanPhotoBase64())); @@ -716,6 +722,8 @@ public class LabourApiController extends BaseController { surProjectAttendanceData.setCreateTime(new Date()); saveList.add(surProjectAttendanceData); } + }else{ + log.info("短时间重复打卡请求,本次已忽略...{}SUCCESS",cacheKey); } } if(StringUtils.isNotEmpty(saveList)){ diff --git a/ruoyi-ui/src/views/flow/flowLabourInfo/index.vue b/ruoyi-ui/src/views/flow/flowLabourInfo/index.vue index 0a36cff3..fd66c8d9 100644 --- a/ruoyi-ui/src/views/flow/flowLabourInfo/index.vue +++ b/ruoyi-ui/src/views/flow/flowLabourInfo/index.vue @@ -171,7 +171,7 @@ - + diff --git a/ruoyi-ui/src/views/project/checkDetection/checkDetectionDrawer.vue b/ruoyi-ui/src/views/project/checkDetection/checkDetectionDrawer.vue index 9fc71de2..3c588c3f 100644 --- a/ruoyi-ui/src/views/project/checkDetection/checkDetectionDrawer.vue +++ b/ruoyi-ui/src/views/project/checkDetection/checkDetectionDrawer.vue @@ -49,7 +49,7 @@ - + - + + + + - - + + - + + + - + - + - + - + --> - + @@ -99,6 +99,11 @@ - + + + + + + + + + - + @@ -78,7 +78,7 @@ /> --> - + @@ -95,6 +95,11 @@
{{ scope.row.superviseUser }}
+ + +