瀏覽代碼

新增获取项目打卡月份数据表

anderx 1 年之前
父節點
當前提交
55724902cb

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

@@ -832,12 +832,7 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
                                 }
                                 break;
                             }
-                            if (date==1){
-                                System.out.println("name="+name);
-                                System.out.println("map="+map2);
-                            }
                         }
-
                     }
                 }
                 if (!flag){
@@ -866,7 +861,8 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
     @Override
     public Object getAllProjectMonth() {
         SysUser user = SecurityUtils.getLoginUser().getUser();
-        Long companyId = user.getDept().getCompanyId();
+        Long companyId= 0L;
+        companyId = user.getDept().getCompanyId();
         return projectTaskMapper.getAllProjectMonth(companyId);
     }
 

+ 4 - 2
ruoyi-system/src/main/resources/mapper/project/ProjectTaskMapper.xml

@@ -311,8 +311,10 @@
         from (select a.id,a.name ,date_format(b.record_time,'%Y-%m')recordTime
               from project_task a left join project_staff_record b on a.id =b.pid
               left join sys_user c on b.aid=c.user_id left join sys_dept d on c.dept_id=d.dept_id
-              where d.company_id= #{companyId}
-              )x group by x.id,x.name,x.recordTime
+              <if test="companyId !=null">
+                  where d.company_id= #{companyId}
+              </if>
+              )x where x.recordTime is not null group by x.id,x.name,x.recordTime
     </select>