排队取号时间格式修改

This commit is contained in:
2024-09-18 11:09:32 +08:00
parent 116ced92cb
commit e9fa13fdd8
2 changed files with 20 additions and 12 deletions

View File

@@ -1,11 +1,13 @@
package cn.ysk.cashier.mybatis.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.time.Instant;
import java.util.Date;
@Getter
@Setter
@@ -38,23 +40,29 @@ public class TbCallQueue {
@Column(name = "state")
private Byte state;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Column(name = "create_time")
private Instant createTime;
private Date createTime;
@Column(name = "call_time")
private Instant callTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date callTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Column(name = "call_count")
private Integer callCount;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Column(name = "pass_time")
private Instant passTime;
private Date passTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Column(name = "cancel_time")
private Instant cancelTime;
private Date cancelTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Column(name = "confirm_time")
private Instant confirmTime;
private Date confirmTime;
@Size(max = 255)
@Column(name = "note")

View File

@@ -178,7 +178,7 @@ public class TbCallServiceImpl implements TbCallService {
callQueue.setCreateDay(DateUtil.today());
callQueue.setCallNum(getCallNumber(takeNumberDTO.getShopId(), callTable));
callQueue.setCreateTime(DateUtil.date().toInstant());
callQueue.setCreateTime(DateUtil.date());
callQueue.setShopId(shopInfo.getId());
callQueue.setShopName(shopInfo.getShopName());
@@ -209,7 +209,7 @@ public class TbCallServiceImpl implements TbCallService {
callQueue.setState((byte) 1);
callQueue.setCallCount(callQueue.getCallCount() + 1);
callQueue.setCallTime(DateUtil.date().toInstant());
callQueue.setCallTime(DateUtil.date());
// 发送模板消息通知用户
@@ -270,7 +270,7 @@ public class TbCallServiceImpl implements TbCallService {
switch (updateCallQueueDTO.getState()) {
case -1:
callQueue.setCancelTime(DateUtil.date().toInstant());
callQueue.setCancelTime(DateUtil.date());
break;
case 0:
callQueue.setState((byte) 0);
@@ -281,13 +281,13 @@ public class TbCallServiceImpl implements TbCallService {
}
callQueue.setState((byte) 1);
callQueue.setCallCount(callQueue.getCallCount() + 1);
callQueue.setCallTime(DateUtil.date().toInstant());
callQueue.setCallTime(DateUtil.date());
break;
case 2:
callQueue.setConfirmTime(DateUtil.date().toInstant());
callQueue.setConfirmTime(DateUtil.date());
break;
case 3:
callQueue.setPassTime(DateUtil.date().toInstant());
callQueue.setPassTime(DateUtil.date());
break;
default:
throw new BadRequestException("错误类型");