@Component public class LaborDateHelper extends Object
修飾子とタイプ | クラスと説明 |
---|---|
static class |
LaborDateHelper.WeeklyInfo
週単位期間情報.
|
修飾子とタイプ | フィールドと説明 |
---|---|
DateHelper |
dateHelper
DateHelper.
|
static int |
EIGHT
8文字目(文字列切り出し用).
|
static int |
HALFYEAR_MONTH_CNT
半期月数:6か月.
|
static int |
NEXT_MONTH
基準月:翌月が基準月.
|
static int |
ONE_DAY
1日.
|
static int |
ONE_MONTH
1月.
|
static int |
QUARTER_MONTH_CNT
四半期月数:3か月.
|
static int |
SECOND
2文字目(文字列切り出し用).
|
static int |
SIX
6文字目(文字列切り出し用).
|
static int |
THIRD
3文字目(文字列切り出し用).
|
static int |
YEAR_MONTH_CNT
年期月数:12か月.
|
コンストラクタと説明 |
---|
LaborDateHelper() |
修飾子とタイプ | メソッドと説明 |
---|---|
Calendar[] |
getCyclePeriod(Calendar criteriaDate,
String criteriaMd,
int interval)
基準月日から加算する月数の期間の開始日-終了日を返却.
|
Calendar[] |
getCyclePeriodOfHalfyear(Calendar criteriaDate,
String yearStartMd)
起算日を基に検索日の締め期間を返却(半期).
|
Date[] |
getCyclePeriodOfHalfyear(Date criteriaDate,
String yearStartMd)
起算日を基に検索日の締め期間を返却(半期).
|
Calendar[] |
getCyclePeriodOfMonth(Calendar criteriaDate,
int startDayOfMonth)
起算日を基に検索日の締め期間を返却(月次).
|
Date[] |
getCyclePeriodOfMonth(Date criteriaDate,
int startDayOfMonth)
起算日を基に検索日の締め期間を返却(月次).
|
Calendar[] |
getCyclePeriodOfQuarter(Calendar criteriaDate,
String yearStartMd)
年度開始月日を基に検索日の締め期間を返却(四半期).
|
Date[] |
getCyclePeriodOfQuarter(Date criteriaDate,
String yearStartMd)
年度開始月日を基に検索日の締め期間を返却(四半期).
|
Calendar[] |
getCyclePeriodOfWeek(Calendar criteriaDate,
int weekDay)
起算日を基に検索日の締め期間を返却(週次).
|
Date[] |
getCyclePeriodOfWeek(Date criteriaDate,
int weekDay)
起算日を基に検索日の締め期間を返却(週次).
|
Calendar[] |
getCyclePeriodOfYear(Calendar criteriaDate,
String yearStartMd)
起算日を基に検索日の締め期間を返却(年次).
|
Date[] |
getCyclePeriodOfYear(Date criteriaDate,
String yearStartMd)
起算日を基に検索日の締め期間を返却(年次).
|
Timestamp[] |
getSubstitutionWorkAndHolidayExpired(Timestamp targetDate,
PeriodCloseCycle cycle,
int startDayOfMonth,
int startWeekDay,
jp.co.slcs.kaiden.v2.product_labormgr.foundation.model.xml_schema.product_labormgr_settings.ProductLabormgrSettings.SubstitutionWorkAndHolidayExpired expired)
振替出勤・振替休日/休日出勤・代休の有効期限を返却.
|
List<LaborDateHelper.WeeklyInfo> |
getWeeklyInfoList(Date criteriaStart,
Date criteriaEnd,
int weekStartCd)
基準開始日~基準終了日の期間内の週情報(週ごとの開始-終了日)を取得します.
|
String |
getWorkDataTargetMonth(String startDayOfMonth,
int defaultMonth,
Date targetDate)
対象日付に応じた作業実績の対象年月の取得.
|
String |
getWorkDataTargetMonthSimple(String startDayOfMonth,
int defaultMonth,
Date targetDate)
対象日付に応じた作業実績の対象年月の取得.
|
List<Timestamp> |
getWorkDataTerm(String startDayOfMonth,
String targetMonth,
int defaultMonth)
作業実績の対象年月に応じた開始日・終了日の取得.
|
Timestamp[] |
getWorkDataTermArray(String startDayOfMonth,
String targetMonth,
int defaultMonth)
作業実績の対象年月に応じた開始日・終了日の取得.
|
public static final int QUARTER_MONTH_CNT
public static final int HALFYEAR_MONTH_CNT
public static final int YEAR_MONTH_CNT
public static final int NEXT_MONTH
public static final int ONE_DAY
public static final int ONE_MONTH
public static final int SECOND
public static final int THIRD
public static final int SIX
public static final int EIGHT
@Autowired public DateHelper dateHelper
public Date[] getCyclePeriodOfMonth(Date criteriaDate, int startDayOfMonth)
起算日が28以上の場合は、各月の月末を起算日として扱います。
例:起算日が20日、検索日が5/25の場合、5/20 - 6/19が返却されます。
criteriaDate
- 検索日startDayOfMonth
- 起算日public Calendar[] getCyclePeriodOfMonth(Calendar criteriaDate, int startDayOfMonth)
起算日が28以上の場合は、各月の月末を起算日として扱います。
例:起算日が20日、検索日が5/25の場合、5/20 - 6/19が返却されます。
criteriaDate
- 検索日startDayOfMonth
- 起算日public Date[] getCyclePeriodOfWeek(Date criteriaDate, int weekDay)
起算曜日が水曜の場合、水曜 - 翌火曜日の日付を返却。
criteriaDate
- 検索日weekDay
- 起算曜日(Calendar.SUNDAY
などの曜日を指定してください)public Calendar[] getCyclePeriodOfWeek(Calendar criteriaDate, int weekDay)
起算曜日が水曜の場合、水曜 - 翌火曜日の日付を返却。
criteriaDate
- 検索日weekDay
- 起算曜日(Calendar.SUNDAY
などの曜日を指定してください)public Date[] getCyclePeriodOfQuarter(Date criteriaDate, String yearStartMd)
年度開日が28以上の場合は、各月の月末を起算日として扱います。
例:起算月が4月、起算日が20日、検索日が5/25の場合、4/20 - 7/19が返却されます。
criteriaDate
- 基準日付yearStartMd
- 年度開始月日(MM/dd形式)public Calendar[] getCyclePeriodOfQuarter(Calendar criteriaDate, String yearStartMd)
年度開日が28以上の場合は、各月の月末を起算日として扱います。
例:起算月が4月、起算日が20日、検索日が5/25の場合、4/20 - 7/19が返却されます。
criteriaDate
- 基準日付yearStartMd
- 年度開始月日(MM/dd形式)public Date[] getCyclePeriodOfHalfyear(Date criteriaDate, String yearStartMd)
起算日が28以上の場合は、各月の月末を起算日として扱います。
例:起算月が4月、起算日が20日、検索日が2013/10/25の場合、2013/10/20 - 2014/4/19が返却されます。
criteriaDate
- 基準日付yearStartMd
- 年度開始月日(MM/dd形式)public Calendar[] getCyclePeriodOfHalfyear(Calendar criteriaDate, String yearStartMd)
起算日が28以上の場合は、各月の月末を起算日として扱います。
例:起算月が4月、起算日が20日、検索日が2013/10/25の場合、2013/10/20 - 2014/4/19が返却されます。
criteriaDate
- 基準日付yearStartMd
- 年度開始月日(MM/dd形式)public Date[] getCyclePeriodOfYear(Date criteriaDate, String yearStartMd)
起算日が28以上の場合は、各月の月末を起算日として扱います。
例:起算月が4月、起算日が20日、検索日が2013/4/25の場合、2013/4/20 - 2014/4/19が返却されます。
criteriaDate
- 基準日付yearStartMd
- 年度開始月日(MM/dd形式)public Calendar[] getCyclePeriodOfYear(Calendar criteriaDate, String yearStartMd)
起算日が28以上の場合は、各月の月末を起算日として扱います。
例:起算月が4月、起算日が20日、検索日が2013/4/25の場合、2013/4/20 - 2014/4/19が返却されます。
criteriaDate
- 基準日付yearStartMd
- 年度開始月日(MM/dd形式)public Calendar[] getCyclePeriod(Calendar criteriaDate, String criteriaMd, int interval)
基準月日に加算する月数を加算した期間を算出し、基準日付が含まれている場合は、そのまま返却します。 含まれていない場合は、次の期間を算出し、含まれているかを判定します。 基準日付が含まれている期間が算出されるまで、上記処理を再帰的に繰り返して行います。 基準月日の日が28以上の場合は、各月の月末を基準日として扱います。
criteriaDate
- 基準日付criteriaMd
- 基準月日(MM/dd形式)interval
- 加算する月数public List<LaborDateHelper.WeeklyInfo> getWeeklyInfoList(Date criteriaStart, Date criteriaEnd, int weekStartCd)
Example 1 Args is [criteriaStart = 2013/04/01, criteriaEnd = 2013/04/30, weekStartCd = 1] Return value is [{2013/04/01, 2013/04/06, 1, 6}, {2013/04/07, 2013/04/13, 1, 7}, {2013/04/14, 2013/04/20, 1, 7}, {2013/04/21, 2013/04/27, 1, 7}, {2013/04/28, 2013/04/30, 1, 3}] Example 2 Args is [criteriaStart = 2013/04/01, criteriaEnd = 2013/04/01, weekStartCd = 1] Return value is [{2013/04/01, 2013/04/01, 1, 1}] Example 3 Args is [criteriaStart = 2013/04/05, criteriaEnd = 2013/04/07, weekStartCd = 1] Return value is [{2013/04/05, 2013/04/06, 1, 2}, {2013/04/07, 2013/04/07, 1, 1}]
criteriaStart
- 基準開始日criteriaEnd
- 基準終了日weekStartCd
- 曜日開始コードLaborDateHelper.WeeklyInfo
public Timestamp[] getSubstitutionWorkAndHolidayExpired(Timestamp targetDate, PeriodCloseCycle cycle, int startDayOfMonth, int startWeekDay, jp.co.slcs.kaiden.v2.product_labormgr.foundation.model.xml_schema.product_labormgr_settings.ProductLabormgrSettings.SubstitutionWorkAndHolidayExpired expired)
targetDate
- 対象日cycle
- 締め期間単位startDayOfMonth
- 年度開始日startWeekDay
- 週開始日expired
- 振替出勤・振替休日設定public List<Timestamp> getWorkDataTerm(String startDayOfMonth, String targetMonth, int defaultMonth)
startDayOfMonth
- 作業実績/年度開始月日(MM/DD)targetMonth
- 対象年月(YYYY/MM)defaultMonth
- 作業実績/基準月public Timestamp[] getWorkDataTermArray(String startDayOfMonth, String targetMonth, int defaultMonth)
startDayOfMonth
- 作業実績/年度開始月日(MM/DD)targetMonth
- 対象年月(YYYY/MM)defaultMonth
- 作業実績/基準月public String getWorkDataTargetMonth(String startDayOfMonth, int defaultMonth, Date targetDate)
「yyyy/MM」形式にフォーマットして返却します。
startDayOfMonth
- 作業実績/年度開始月日(MM/dd)defaultMonth
- 作業実績/基準月targetDate
- 対象日付Copyright © 2024 Sumitomo Life Information Systems Co., Ltd. All Rights Reserved.