yangys
2024-10-08 ba9557b5edf7f31ab8bce0ae57aaaaefd6459bb4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.qianwen.mdc.collect.controller;
import java.time.LocalDate;
 
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
 
import com.google.common.collect.Sets;
import com.qianwen.core.tool.utils.Func;
import com.qianwen.mdc.collect.cache.TimeSliceCache;
import com.qianwen.mdc.collect.dto.CacheBuildDTO;
 
@RestController
public class JobTestController {
    private final Logger log = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private TimeSliceCache timeSliceCache;
    
    
    @GetMapping("/timecache")
    public Object stateagg(Long workstationId) {
        
        LocalDate targetDate = LocalDate.now();//.plusDays(1L);
        CacheBuildDTO cacheBuildDTO = CacheBuildDTO.builder().tenantIds(Sets.newHashSet(new String[]{"000000"})).targetDate(targetDate).build();
        if (Func.isNotEmpty(cacheBuildDTO)) {
            timeSliceCache.build(cacheBuildDTO);
        } else {
            log.error("[生产日历切片缓存构建失败...],构建时间{},构建租户:{}", targetDate, "000000");
        }
        
        return "1";
    }
    
}