All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.ipokerface.weixin.model.card.CashCoupon Maven / Gradle / Ivy

There is a newer version: 1.5.0
Show newest version
package cn.ipokerface.weixin.model.card;

import cn.ipokerface.weixin.utils.DateUtils;
import com.alibaba.fastjson.annotation.JSONField;

/**
 * Created by       PokerFace
 * Create Date      2019-12-28.
 * Email:           [email protected]
 * Version          1.0.0
 * 

* Description: */ public class CashCoupon extends CardCoupon { /** * 起用金额(单位为分),如果无起用门槛则填0 */ @JSONField(name = "least_cost") private int leastCost; /** * 减免金额(单位为分) */ @JSONField(name = "reduce_cost") private final int reduceCost; /** * 构造代金券 * * @param couponBaseInfo * 基础信息 * @param reduceCost * 减免金额 单位元 */ public CashCoupon(CouponBase couponBaseInfo, double reduceCost) { super(couponBaseInfo); this.reduceCost = DateUtils.formatYuan2Fen(reduceCost); } public int getLeastCost() { return leastCost; } /** * 调用接口获取单位为分,get方法转换为元方便使用 * * @return 元单位 */ @JSONField(serialize = false) public double getFormatLeastCost() { return leastCost / 100d; } public void setLeastCost(double leastCost) { this.leastCost = DateUtils.formatYuan2Fen(reduceCost); } public int getReduceCost() { return reduceCost; } /** * 调用接口获取单位为分,get方法转换为元方便使用 * * @return 元单位 */ @JSONField(serialize = false) public double getFormatReduceCost() { return reduceCost / 100d; } @JSONField(serialize = false) @Override public CardType getCardType() { return CardType.CASH; } @Override public String toString() { return "CashCoupon [leastCost=" + leastCost + ", reduceCost=" + reduceCost + ", " + super.toString() + "]"; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy