Quellcode durchsuchen

研发打卡修改

anderx vor 2 Jahren
Ursprung
Commit
86b4ca3387

+ 6 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ProjectTaskController.java

@@ -243,9 +243,14 @@ public class ProjectTaskController extends BaseController {
         }
         return error("上传图片异常,请联系管理员");
     }
+
+    /**
+     * 查询剩余时间
+     * @param id
+     * @return
+     */
     @GetMapping("/myDuration")
     public AjaxResult myDuration(Long id){
-
         return projectStaffRecordService.myDuration(id);
     }
 }

+ 7 - 1
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffRecordServiceImpl.java

@@ -258,7 +258,13 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
         String maxDurationProjectFlag = configService.selectConfigByKey("maxDurationProject");
         AtomicReference<Double> myDuration = new AtomicReference<>(0d);
         Boolean flag = Boolean.parseBoolean(maxDurationProjectFlag);
-        if (!flag)id=null;
+        if (flag){
+            if (id==null){
+                return AjaxResult.error("项目不能为空");
+            }
+        }else {
+            id=null;
+        }
         List<ProjectStaffRecord> projectStaffRecords = projectStaffRecordMapper.selectByPidAndAid(id,user.getUserId());
         projectStaffRecords.stream().forEach(e ->{
             String eDate= DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, e.getRecordTime());