|
@@ -38,39 +38,8 @@ public class TaskService {
|
|
|
private ISceneCleanService sceneCleanService;
|
|
|
|
|
|
|
|
|
- //@Scheduled(cron = "${task.cron.del_qrCode:0 */10 * * * ?}")
|
|
|
- public void delLoginQrCode(){
|
|
|
- if("local".equals(NacosProperty.uploadType)){
|
|
|
- AuthLicenseUtil.checkAuthLicense();
|
|
|
- this.updateSceneViewCount();
|
|
|
- return;
|
|
|
- }
|
|
|
- try {
|
|
|
- long startTime = new Date().getTime();
|
|
|
- String qrCodePath = QrCodeFilePath.LOGIN_QR_CODE_PATH;
|
|
|
- String aliQrCodePath = QrCodeFilePath.ALI_QRCODE_FOLDER;
|
|
|
- String wxCodePath = QrCodeFilePath.WEIXIN_QRCODE_FOLDER;
|
|
|
- File file = new File(qrCodePath);
|
|
|
- File file2 = new File(wxCodePath);
|
|
|
- File file3 = new File(aliQrCodePath);
|
|
|
- File[] files = file.listFiles();
|
|
|
- File[] files1 = file2.listFiles();
|
|
|
- File[] files2 = file3.listFiles();
|
|
|
- delFile(files);
|
|
|
- delFile(files1);
|
|
|
- delFile(files2);
|
|
|
- log.info("delLoginQrCode:结束定时清理本地登录二维码:耗时{}秒",(new Date().getTime() - startTime)/1000 );
|
|
|
- this.updateSceneViewCount();
|
|
|
- }catch (Exception e){
|
|
|
- log.error("delLoginQrCode错误",e);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- private void updateSceneViewCount() {
|
|
|
+ @Scheduled(cron = "${task.cron.del_qrCode:0 */10 * * * ?}")
|
|
|
+ public void updateSceneViewCount() {
|
|
|
String redisKey = RedisKeyUtil.V4_SCENE_VISIT_CNT;
|
|
|
Map<String,String> hmget = redisUtil.hmget(redisKey);
|
|
|
for (String key : hmget.keySet()) {
|
|
@@ -79,75 +48,6 @@ public class TaskService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void delFile(File[] files){
|
|
|
- if(Objects.isNull(files) || files.length == 0){
|
|
|
- return;
|
|
|
- }
|
|
|
- for (File f : files) {
|
|
|
- if(files == null && files.length >0){
|
|
|
- return;
|
|
|
- }
|
|
|
- if(f==null || !f.getName().contains(".")){
|
|
|
- continue;
|
|
|
- }
|
|
|
- String name = f.getName().substring(0,f.getName().lastIndexOf("."));
|
|
|
- if(!redisUtil.hasKey(RedisKeyUtil.QRCODE + name)){
|
|
|
- log.info("删除文件:{}",f.getPath());
|
|
|
- FileUtils.delFile(f.getPath());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Autowired
|
|
|
- IUserIncrementService userIncrementService;
|
|
|
-
|
|
|
- //@Scheduled(cron = "${task.cron.increment_sendMsg:0 0 12 * * ?}")
|
|
|
- public void job11() {
|
|
|
- if("local".equals(NacosProperty.uploadType)){
|
|
|
- return;
|
|
|
- }
|
|
|
- log.info("每天12:00开始执行定时任务:短信提醒增值权益准备到期");
|
|
|
- try {
|
|
|
- userIncrementService.incrementExpireSendSms();
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- log.error(e.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //@Scheduled(cron = "${task.cron.update_order_status:0 0 0 * * ?}")
|
|
|
- public void checkIncrementExpire() {
|
|
|
- if("local".equals(NacosProperty.uploadType)){
|
|
|
- return;
|
|
|
- }
|
|
|
- log.info("每天00:00开始执行定时任务:增值权益到期检查");
|
|
|
- try {
|
|
|
- userIncrementService.incrementExpire();
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- log.error(e.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Autowired
|
|
|
- IOrderService orderService;
|
|
|
-
|
|
|
- //@Scheduled(cron = "${task.cron.update_order_status:0 0 1 * * ?}")
|
|
|
- public void updateOrderStatus() {
|
|
|
- if("local".equals(NacosProperty.uploadType)){
|
|
|
- return;
|
|
|
- }
|
|
|
- log.info("每天01:00开始执行定时任务:更新收货状态");
|
|
|
- try {
|
|
|
- //更新收货状态,发货后15天,默认用户已经收到货物
|
|
|
- orderService.autoUpdateOrderStatus();
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- log.error(e.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
@Autowired
|
|
|
ISceneStatisticsService sceneStatisticsService;
|