Преглед изворни кода

解决北森同步请假问题

QuYueTing пре 1 месец
родитељ
комит
ed8b8f4dec

+ 12 - 18
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserWithBeisenServiceImpl.java

@@ -71,12 +71,9 @@ public class UserWithBeisenServiceImpl extends ServiceImpl<UserWithBeisenMapper,
         DateTimeFormatter df2=DateTimeFormatter.ofPattern("HH:mm");
         DateTimeFormatter df3=DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
         DateTimeFormatter df4=DateTimeFormatter.ofPattern("HH:mm:ss");
-        TimeType timeType = timeTypeMapper.selectById(companyId);
         List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getCompanyId, companyId));
         List<UserWithBeisen> userWithBeisenList = userWithBeisenService.list(new LambdaQueryWrapper<UserWithBeisen>().eq(UserWithBeisen::getCompanyId, companyId));
         BeisenConfig beisenConfig = beisenConfigMapper.selectById(companyId);
-        //获取特殊节假日设置
-        List<HolidaySetting> holidaySettings = holidaySettingService.list(new LambdaQueryWrapper<HolidaySetting>().eq(HolidaySetting::getCompanyId, companyId));
         if(beisenConfig==null){
             msg.setError("北森基础数据配置未完成,请联系服务商完成配置");
             return msg;
@@ -89,6 +86,18 @@ public class UserWithBeisenServiceImpl extends ServiceImpl<UserWithBeisenMapper,
         JSONArray allVacationList=new JSONArray();
         JSONArray allDailyReportList=new JSONArray();
         List<LeaveSheet> leaveSheetList=new ArrayList<>();
+
+        List<UserFvTime> userFvTimeList=new ArrayList<>();
+        for (LocalDate localDate : workDaysListInRange) {
+            JSONArray statisticList = BeiSenUtils.getAttendanceStatistics(df.format(localDate), df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(), 1, 100);
+            JSONArray overTimeList = BeiSenUtils.getOverTimeList(df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(), 1, 100);
+            JSONArray vacationList = BeiSenUtils.getVacationList(df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(),1,100);
+            JSONArray dailyReportList = BeiSenUtils.getDailyReportList(df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(), 1, 100);
+            allOverTimeList.addAll(overTimeList);
+            attendanceStatistics.addAll(statisticList);
+            allVacationList.addAll(vacationList);
+            allDailyReportList.addAll(dailyReportList);
+        }
         //同步休假数据到工时管家
         for (int i = 0; i < allVacationList.size(); i++) {
             JSONObject jsonObject = allVacationList.getJSONObject(i);
@@ -140,22 +149,7 @@ public class UserWithBeisenServiceImpl extends ServiceImpl<UserWithBeisenMapper,
         if(leaveSheetList.size()>0){
             leaveSheetService.saveOrUpdateBatch(leaveSheetList);
         }
-        List<UserFvTime> userFvTimeList=new ArrayList<>();
-        for (LocalDate localDate : workDaysListInRange) {
-            JSONArray statisticList = BeiSenUtils.getAttendanceStatistics(df.format(localDate), df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(), 1, 100);
-            JSONArray overTimeList = BeiSenUtils.getOverTimeList(df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(), 1, 100);
-            JSONArray vacationList = BeiSenUtils.getVacationList(df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(),1,100);
-            JSONArray dailyReportList = BeiSenUtils.getDailyReportList(df.format(localDate), beisenConfig.getAppKey(), beisenConfig.getAppSecret(), 1, 100);
-            allOverTimeList.addAll(overTimeList);
-            attendanceStatistics.addAll(statisticList);
-            allVacationList.addAll(vacationList);
-            allDailyReportList.addAll(dailyReportList);
-        }
         //打印数据
-        System.out.println("allOverTimeList:"+allOverTimeList);
-        System.out.println("attendanceStatistics:"+attendanceStatistics);
-        System.out.println("allVacationList:"+allVacationList);
-        System.out.println("allDailyReportList:"+allDailyReportList);
         for (LocalDate localDate : workDaysListInRange) {
             Stream<JSONObject> swipingCardsStream = attendanceStatistics.stream().map(item -> (JSONObject) item);
             //todo: 获取当天的考勤数据

+ 1 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/task/TimingTask.java

@@ -588,7 +588,7 @@ public class TimingTask {
             return;
         }
         DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
-        LocalDate start=LocalDate.now().minusDays(7);
+        LocalDate start=LocalDate.now().minusDays(10);
         LocalDate end=LocalDate.now();
         JSONArray jsonArrayFilter = new JSONArray();
         JSONObject filter1 = new JSONObject();