update 会员钱包明细

This commit is contained in:
Lemon
2023-07-22 15:23:31 +08:00
parent 42f2b18b99
commit a17412968c
11 changed files with 175 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
package com.jsowell.common.util;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -20,11 +21,7 @@ import java.time.LocalTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.*;
/**
* 时间工具类
@@ -938,4 +935,42 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
return true;
}
}
/**
* 根据年月获取月初第一天日期
* @param year
* @param month
* @return
*/
public static String getFirstDay(int year,int month,String format) {
Calendar cale = Calendar.getInstance();
cale.set(Calendar.YEAR, year); //赋值年份
cale.set(Calendar.MONTH, month - 1);//赋值月份
int lastDay = cale.getActualMinimum(Calendar.DAY_OF_MONTH);//获取月最大天数
cale.set(Calendar.DAY_OF_MONTH, lastDay);//设置日历中月份的最大天数
SimpleDateFormat sdf = new SimpleDateFormat(format);//格式化日期yyyy-MM-dd
String lastDayOfMonth = sdf.format(cale.getTime());
return lastDayOfMonth;
}
/**
* 根据年月获取月末最后一天日期
* @param year
* @param month
* @return
*/
public static String getLastDay(int year,int month,String format) {
Calendar cale = Calendar.getInstance();
cale.set(Calendar.YEAR, year);//赋值年份
cale.set(Calendar.MONTH, month - 1);//赋值月份
int lastDay = cale.getActualMaximum(Calendar.DAY_OF_MONTH);//获取月最大天数
cale.set(Calendar.DAY_OF_MONTH, lastDay);//设置日历中月份的最大天数
SimpleDateFormat sdf = new SimpleDateFormat(format); //格式化日期yyyy-MM-dd
String lastDayOfMonth = sdf.format(cale.getTime());
return lastDayOfMonth;
}
}