浏览代码

1.更新日工时统计

WoNiu 4 年之前
父节点
当前提交
aa71d58483

+ 3 - 4
src/main/java/com/galaxis/manatee/dao/ChuanyunWorkHourDao.java

@@ -30,16 +30,15 @@ public interface ChuanyunWorkHourDao extends GalaxisRepository<ChuanyunWorkHourD
             "chuanyun_day_log.day_log_date " +
             "FROM chuanyun_day_log "+
             "LEFT JOIN chuanyun_log ON chuanyun_day_log.parent_object_id = chuanyun_log.object_id " +
-            " WHERE chuanyun_log.user_id = ?" +
-            "and status!=3" +
-//            "AND chuanyun_log.log_date>='2020-08-12'" +
+            " WHERE chuanyun_log.user_id = ? " +
+            " AND status!='3' " +
             " GROUP BY chuanyun_day_log.project_id," +
             "chuanyun_log.user_id," +
             "chuanyun_day_log.project_type," +
             "chuanyun_log.status," +
             "chuanyun_day_log.day_log_date",
             nativeQuery = true)
-    List<ChuanyunWorkHourDO> getSelfWorkHour(String userId);
+    List<ChuanyunWorkHourDO> getSelfWorkHour(@Param("userId") String userId);
 
 
     /**

+ 10 - 1
src/main/java/com/galaxis/manatee/task/WorkHourStatistics.java

@@ -64,7 +64,7 @@ public class WorkHourStatistics {
 
     @Scheduled(fixedDelay = 432000000L)
     public void updateHour() {
-//        standardWorkHour();
+        standardWorkHour();
         standardWeeklyWorkHour();
         standardMonthlyWorkHour();
         projectMemberHour();
@@ -301,6 +301,12 @@ public class WorkHourStatistics {
                         ChuanyunSelfWorkHourDTO chuanyunSelfWorkHourDTO = new ChuanyunSelfWorkHourDTO();
                         BeanUtils.copyProperties(chuanyunSelfWorkHourDO,chuanyunSelfWorkHourDTO);
                         chuanyunSelfWorkHourDTO.setDepartmentId(departmentId);
+                        ChuanyunUserCompanyDO chuanyunUserCompanyDO =chuanyunUserCompanyDao.findByUserId(chuanyunSelfWorkHourDTO.getUserId());
+                        if (chuanyunUserCompanyDO!=null){
+                            chuanyunSelfWorkHourDTO.setUserName(chuanyunUserCompanyDO.getUserName());
+                        }else{
+                            chuanyunSelfWorkHourDTO.setUserName(chuanyunSelfWorkHourDTO.getUserId());
+                        }
                         List<String> matchers = new ArrayList<>();
                         matchers.add("F0000001_2,"+chuanyunSelfWorkHourDO.getProjectId());
                         matchers.add("F0000002_2,"+chuanyunSelfWorkHourDO.getUserId());
@@ -742,6 +748,9 @@ public class WorkHourStatistics {
          */
         @JsonProperty("F0000007")
         private String departmentId;
+
+        @JsonProperty("F0000008")
+        private String userName;
     }
 
     @Data