Explorar o código

打卡提示修改

anderx %!s(int64=2) %!d(string=hai) anos
pai
achega
4298dcfdcd

+ 4 - 2
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffRecordServiceImpl.java

@@ -277,8 +277,10 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
             long endTime = DateUtils.getNowDate().getTime();
             long startTime = projectTask.getStartTime().getTime();
             if (endTime>projectTask.getEndTime().getTime())endTime=projectTask.getEndTime().getTime();
-            if (in.getRecordTime().getTime()>endTime||in.getRecordTime().getTime()<startTime){
-                ajaxResult=AjaxResult.error("不在研发时间内,不可打卡");
+            if (in.getRecordTime().getTime()<startTime){
+                ajaxResult=AjaxResult.error(String.format("项目研发时间未开始[%s],不可打卡",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,projectTask.getStartTime())));
+            }else if (in.getRecordTime().getTime()>endTime){
+                ajaxResult=AjaxResult.error(String.format("项目研发时间已结束[%s],不可打卡",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,projectTask.getEndTime())));
             }
         }
         return ajaxResult;