日期格式化
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.czg.market.entity;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
@@ -105,17 +106,21 @@ public class MkShopCouponRecord implements Serializable {
|
||||
* 领取时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 使用时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime useTime;
|
||||
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime useEndTime;
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime useStartTime;
|
||||
/**
|
||||
* 有效期类型:fixed(固定时间),custom(自定义时间)
|
||||
@@ -134,6 +139,7 @@ public class MkShopCouponRecord implements Serializable {
|
||||
private Integer daysToTakeEffect;
|
||||
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
private String couponJson;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.czg.market.entity;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
@@ -87,11 +88,13 @@ public class ShopCoupon implements Serializable {
|
||||
/**
|
||||
* 有效期开始时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime validStartTime;
|
||||
|
||||
/**
|
||||
* 有效期结束时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime validEndTime;
|
||||
|
||||
/**
|
||||
|
||||
@@ -201,6 +201,9 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
|
||||
@Override
|
||||
public void addCoupon(ShopCouponDTO param) {
|
||||
ShopCoupon coupon = BeanUtil.toBean(param, ShopCoupon.class);
|
||||
if (coupon.getValidEndTime() != null) {
|
||||
coupon.setValidEndTime(coupon.getValidEndTime().with(LocalTime.MAX));
|
||||
}
|
||||
save(coupon);
|
||||
param.setId(coupon.getId());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user