Min 1 год назад
Родитель
Сommit
af0de0e166

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

@@ -29,6 +29,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.util.StringUtils;
 import org.springframework.web.client.DefaultResponseErrorHandler;
 import org.springframework.web.client.RestTemplate;
+import sun.rmi.runtime.Log;
 
 import javax.annotation.Resource;
 import java.io.File;
@@ -45,6 +46,7 @@ import java.util.*;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
+import java.util.logging.Logger;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 
@@ -141,21 +143,21 @@ public class TimingTask {
         return allList.stream().filter(all->all.getDepartmentId().intValue() == id).findFirst().get();
     }
 
-    public static void main(String[] args) {
-        int passwordLength = 30;
-        List<String> stringList=new ArrayList<>();
-        new SecureRandom().ints(passwordLength, 0, VALID_TOKEN_CHARS.size())
-                .map(VALID_TOKEN_CHARS::get).forEach(v->stringList.add(String.valueOf((char) v)));
-        String token="";
-        for (String s : stringList) {
-            token+=s;
-        }
-        System.out.println(token);
-        LocalDate now=LocalDate.now().minusMonths(1);
-        LocalDate end=now.with(TemporalAdjusters.lastDayOfMonth());
-        LocalDate start=now.with(TemporalAdjusters.firstDayOfMonth());
-        System.out.println(start+"----"+end);
-    }
+//    public static void main(String[] args) {
+//        int passwordLength = 30;
+//        List<String> stringList=new ArrayList<>();
+//        new SecureRandom().ints(passwordLength, 0, VALID_TOKEN_CHARS.size())
+//                .map(VALID_TOKEN_CHARS::get).forEach(v->stringList.add(String.valueOf((char) v)));
+//        String token="";
+//        for (String s : stringList) {
+//            token+=s;
+//        }
+//        System.out.println(token);
+//        LocalDate now=LocalDate.now().minusMonths(1);
+//        LocalDate end=now.with(TemporalAdjusters.lastDayOfMonth());
+//        LocalDate start=now.with(TemporalAdjusters.firstDayOfMonth());
+//        System.out.println(start+"----"+end);
+//    }
     //每分钟校验是否有需要提醒的填报
     @Scheduled(fixedRate = 60 * 1000)
     private void process() {
@@ -183,8 +185,14 @@ public class TimingTask {
             }
             TimeType timeType = timeTypeMapper.selectById(company.getId());
             String alertTime = timeType.getAlertTime();
+            if(StringUtils.isEmpty(alertTime)){
+                alertTime="09:00";
+            }
             LocalTime time = LocalTime.parse(alertTime, dt);
-            if(!time.equals(LocalTime.now())){
+            LocalTime localTime = LocalTime.now();
+            String format = dt.format(localTime);
+            LocalTime time1 = LocalTime.parse(format, dt);
+            if(!time.equals(time1)){
                 continue;
             }
             List<Map<String, Object>> userList = userMapper.getPushUserList(wxCorpInfo.getCompanyId(), date);