From b15eab0860ab180108eb9a954e862fee6b0d8bab Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期三, 19 七月 2023 17:42:28 +0800 Subject: [PATCH] 更新预约场地部分接口 --- cloud-server-other/src/main/java/com/dsh/OtherApplication.java | 2 ++ cloud-server-other/src/main/resources/mapper/SiteMapper.xml | 2 +- cloud-server-other/src/main/java/com/dsh/other/model/QueryMySiteVo.java | 2 +- cloud-server-other/src/main/java/com/dsh/other/util/TaskUtil.java | 25 +++++++++++++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/cloud-server-other/src/main/java/com/dsh/OtherApplication.java b/cloud-server-other/src/main/java/com/dsh/OtherApplication.java index 7439d4b..4ace9f9 100644 --- a/cloud-server-other/src/main/java/com/dsh/OtherApplication.java +++ b/cloud-server-other/src/main/java/com/dsh/OtherApplication.java @@ -11,6 +11,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; +import org.springframework.scheduling.annotation.EnableScheduling; import springfox.documentation.swagger2.annotations.EnableSwagger2; import javax.annotation.PostConstruct; @@ -20,6 +21,7 @@ * @author jason */ @EnableSwagger2 +@EnableScheduling @EnableFeignClients @MBCloudApplication @Import({WebConfig.class}) diff --git a/cloud-server-other/src/main/java/com/dsh/other/model/QueryMySiteVo.java b/cloud-server-other/src/main/java/com/dsh/other/model/QueryMySiteVo.java index ef7ea19..1251527 100644 --- a/cloud-server-other/src/main/java/com/dsh/other/model/QueryMySiteVo.java +++ b/cloud-server-other/src/main/java/com/dsh/other/model/QueryMySiteVo.java @@ -32,5 +32,5 @@ @ApiModelProperty("状态(0=待支付,1=待核销,2=已到店,3=已完成,4=已过期,5=已取消)") private Integer status; @ApiModelProperty("创建时间") - private String insertTime; + private Long insertTime; } diff --git a/cloud-server-other/src/main/java/com/dsh/other/util/TaskUtil.java b/cloud-server-other/src/main/java/com/dsh/other/util/TaskUtil.java new file mode 100644 index 0000000..ca148cc --- /dev/null +++ b/cloud-server-other/src/main/java/com/dsh/other/util/TaskUtil.java @@ -0,0 +1,25 @@ +package com.dsh.other.util; + +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +/** + * @author zhibing.pu + * @Date 2023/7/19 14:19 + */ +@Component +public class TaskUtil { + + + /** + * 每隔一分钟去处理的定时任务 + */ + @Scheduled(fixedRate = 60000) + public void taskMinute(){ + try { + //定时修改赛事状态 + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/cloud-server-other/src/main/resources/mapper/SiteMapper.xml b/cloud-server-other/src/main/resources/mapper/SiteMapper.xml index d9c0015..3b6aa00 100644 --- a/cloud-server-other/src/main/resources/mapper/SiteMapper.xml +++ b/cloud-server-other/src/main/resources/mapper/SiteMapper.xml @@ -50,7 +50,7 @@ a.payMoney as payMoney, CONCAT(DATE_FORMAT(a.startTime, '%Y-%m-%d %H:%i'), '-', DATE_FORMAT(a.endTime, '%H:%i')) as appointment, a.`status`, - DATE_FORMAT(a.insertTime, '%Y-%m-%d %H:%i:%s') as insertTime + UNIX_TIMESTAMP(a.insertTime) * 1000 as insertTime from t_site_booking a left join t_site b on (a.siteId = b.id) left join t_store c on (b.storeId = c.id) -- Gitblit v1.7.1