获取薪资比例(感谢 https://gitee.com/smr1987) @return 薪资比例:1/2/3
()
| 875 | * @return 薪资比例:1/2/3 |
| 876 | */ |
| 877 | public int getSalaryRate() { |
| 878 | // 元旦节 |
| 879 | if (month == 1 && day == 1) { |
| 880 | return 3; |
| 881 | } |
| 882 | // 劳动节 |
| 883 | if (month == 5 && day == 1) { |
| 884 | return 3; |
| 885 | } |
| 886 | // 国庆 |
| 887 | if (month == 10 && day >= 1 && day <= 3) { |
| 888 | return 3; |
| 889 | } |
| 890 | Lunar lunar = getLunar(); |
| 891 | // 春节 |
| 892 | if (lunar.getMonth() == 1 && lunar.getDay() >= 1 && lunar.getDay() <= 3) { |
| 893 | return 3; |
| 894 | } |
| 895 | // 端午 |
| 896 | if (lunar.getMonth() == 5 && lunar.getDay() == 5) { |
| 897 | return 3; |
| 898 | } |
| 899 | // 中秋 |
| 900 | if (lunar.getMonth() == 8 && lunar.getDay() == 15) { |
| 901 | return 3; |
| 902 | } |
| 903 | // 清明 |
| 904 | if ("清明".equals(lunar.getJieQi())) { |
| 905 | return 3; |
| 906 | } |
| 907 | Holiday holiday = HolidayUtil.getHoliday(year, month, day); |
| 908 | if (null != holiday) { |
| 909 | // 法定假日非上班 |
| 910 | if (!holiday.isWork()) { |
| 911 | return 2; |
| 912 | } |
| 913 | } else { |
| 914 | // 周末 |
| 915 | int week = getWeek(); |
| 916 | if (week == 6 || week == 0) { |
| 917 | return 2; |
| 918 | } |
| 919 | } |
| 920 | // 工作日 |
| 921 | return 1; |
| 922 | } |
| 923 | } |