记得上下班打卡 | git大法好,push需谨慎

Commit 42850630 authored by jiangxiulong's avatar jiangxiulong

演出日历时间修改

parent dad8f08b
...@@ -448,7 +448,7 @@ public abstract class DateUtil { ...@@ -448,7 +448,7 @@ public abstract class DateUtil {
// 获取某月第一天 jiangxiulong // 获取某月第一天 jiangxiulong
public static String getMonthFirst(String month) { public static String getMonthFirst(String month) {
return month.concat("-01"); return month.concat("-01 00:00:00");
} }
// 获取当月最后一天 jiangxiulong // 获取当月最后一天 jiangxiulong
...@@ -465,11 +465,15 @@ public abstract class DateUtil { ...@@ -465,11 +465,15 @@ public abstract class DateUtil {
} }
// 获取某月最后一天 jiangxiulong // 获取某月最后一天 jiangxiulong
public static String getMonthLast(String month) throws ParseException { public static String getMonthLast(String month) {
// String 转 Date // String 转 Date
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date monthDate = simpleDateFormat.parse(month); Date monthDate = null;
try {
monthDate = simpleDateFormat.parse(month);
} catch (Exception e) {
return "";
}
//获取Calendar //获取Calendar
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(monthDate); calendar.setTime(monthDate);
......
...@@ -259,16 +259,10 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM ...@@ -259,16 +259,10 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
public List performanceCalendar(String yearMonth, String cityName) { public List performanceCalendar(String yearMonth, String cityName) {
List<KylinPerformanceVo> performancesList = dataUtils.getPerformancesListOfcityName(cityName); List<KylinPerformanceVo> performancesList = dataUtils.getPerformancesListOfcityName(cityName);
// 处理成正常格式
yearMonth = yearMonth.concat("-01 00:00:00");
// 获取此月开始结束时间 // 获取此月开始结束时间
String monthStart = DateUtil.getMonthFirst(yearMonth); String monthStart = DateUtil.getMonthFirst(yearMonth);
String monthEnd = ""; String monthEnd = "";
try { monthEnd = DateUtil.getMonthLast(monthStart);
monthEnd = DateUtil.getMonthLast(yearMonth);
} catch (Exception e) {
}
List date = new ArrayList(); List date = new ArrayList();
for (KylinPerformanceVo info : performancesList) { for (KylinPerformanceVo info : performancesList) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment