diff --git a/src/main/java/cn/com/tenlion/systemcard/util/PayUtil.java b/src/main/java/cn/com/tenlion/systemcard/util/PayUtil.java new file mode 100644 index 0000000..72f7812 --- /dev/null +++ b/src/main/java/cn/com/tenlion/systemcard/util/PayUtil.java @@ -0,0 +1,30 @@ +package cn.com.tenlion.systemcard.util; + +import cn.com.tenlion.projectconfig.util.ProjectConfigUtil; +import ink.wgink.interfaces.consts.ISystemConstant; +import org.joda.time.DateTime; +import org.joda.time.Days; +import org.joda.time.format.DateTimeFormat; + +public class PayUtil { + + /** + * 将double的价格转为int + * @param d + * @return + */ + public static Integer buiderMoney(Double d) { + return (int)(d * 100); + } + + public static void main(String[] args) { + String registerTime = "2021-08-31 08:09:09"; + DateTime registerDateTime = DateTime.parse(registerTime, DateTimeFormat.forPattern(ISystemConstant.DATE_FORMATTER_YYYY_MM_DD_HH_MM_SS)); + // DateTime withdrawDateTime = registerDateTime.plusDays(3); + int lastDay = Days.daysBetween(registerDateTime , DateTime.now()).getDays(); + System.out.println(lastDay); + if(lastDay > 0) { + // 可以提现 + } + } +}