renkang
2025-01-06 e0b7b9effa5b69fbcc71362abd9cf500b2b99f45
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package com.doumee.api;
 
import com.alibaba.fastjson.JSONObject;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.HttpsUtil;
import com.doumee.core.utils.redis.RedisUtil;
import com.doumee.core.wx.WXConstant;
import com.doumee.dao.business.model.YwContract;
import com.doumee.dao.business.model.YwOutinbound;
import com.doumee.service.business.*;
import com.doumee.service.business.impl.YwOutinboundServiceImpl;
import com.doumee.service.system.SystemDictDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/11/28 10:58
 */
@Api(tags = "阜宁运维系统定时器接口")
@RestController
@RequestMapping("/timer/yw")
public class YwTimerController  extends BaseController {
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
 
    @Autowired
    private SystemDictDataService systemDictDataService;
 
    @Autowired
    private YwContractBillService ywContractBillService;
 
    @Autowired
    private YwContractService ywContractService;
 
    @Autowired
    private YwPatrolSchemeService ywPatrolSchemeService;
 
    @Autowired
    private YwOutinboundService ywOutinboundService;
 
    @Autowired
    private RedisTemplate<String, Object> redisTemplate;
 
 
    @ApiOperation("定时处理合同账单编码")
    @GetMapping("/ywDealContractBillCodeTimer")
    public ApiResponse ywDealContractBillCodeTimer() {
        ywContractBillService.dealDayBillCode();
        return ApiResponse.success("定时处理合同账单编码");
    }
 
 
    @ApiOperation("定时处理合同过期与执行中")
    @GetMapping("/ywDealContractTimeOutTimer")
    public ApiResponse ywDealContractTimeOutTimer() {
        ywContractService.dealTimeOut();
        return ApiResponse.success("定时处理合同过期与执行中");
    }
 
    public static void main(String[] args) {
        String url = WXConstant.GET_ACCESS_TOKEN_URL.replace("APPID","wx95ac1efb67f0330d")
                .replace("APPSECRET","f228b9e3b49a37b881b51431a483c939");
        String response = HttpsUtil.get(url,false);
        JSONObject json = JSONObject.parseObject(response);
    }
 
 
    @ApiOperation("定时生成今日巡检任务任务")
    @GetMapping("/ywPatrolSchemeTaskTimer")
    public ApiResponse ywPatrolSchemeTaskTimer() {
        ywPatrolSchemeService.timerAuto();
        return ApiResponse.success("定时生成今日巡检任务任务执行中");
    }
 
 
    @ApiOperation("定时更新redis数据")
    @GetMapping("/ywUpdRedisDataTimer")
    public ApiResponse ywUpdRedisDataTimer() {
        //加入redis缓存,入库单总数量
        RedisUtil.addObject(redisTemplate, Constants.RedisKeys.COM_OUTBOUND_IN_KEY,0);
        //加入redis缓存,出库单总数量
        RedisUtil.addObject(redisTemplate,Constants.RedisKeys.COM_OUTBOUND_OUT_KEY,0);
        //加入redis缓存,盘点单总数量
        RedisUtil.addObject(redisTemplate,Constants.RedisKeys.COM_OUTBOUND_TAKING_KEY,0);
        return ApiResponse.success("定时更新redis数据");
    }
 
 
}