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