Przeglądaj źródła

新增无打卡数据的判断

anderx 1 miesiąc temu
rodzic
commit
c30fdfbc56

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ProjectTaskController.java

@@ -549,6 +549,9 @@ public class ProjectTaskController extends BaseController {
     @GetMapping("/getCompanyClock")
     public AjaxResult getCompanyClock(@RequestParam String usci,Integer year,Integer month){
         SysDept sysDept = sysDeptService.selectByusci(usci);
+        if (sysDept==null){
+            return AjaxResult.error("公司不存在");
+        }
         Long deptId = sysDept.getDeptId();
         pushRdDataBo res = projectStaffRecordService.getCompanyClock(deptId,year,month);
         res.setUsci(usci);

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffRecordServiceImpl.java

@@ -1193,6 +1193,9 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
         lastDay=lastDay+" 23:59:59";
         List<PushRdDataListBo> rdList =projectStaffRecordMapper.getCompanyClock(Math.toIntExact(deptId),
                 firsDay, lastDay);
+        if (rdList==null||rdList.size()==0){
+            throw new ServiceException("没有打卡数据");
+        }
         res.setRdList(rdList);
         return res;
     }