Commit 1d636b2c authored by fangxinjiang's avatar fangxinjiang

代码优化-fxj

parent c5d3b0b6
......@@ -1719,10 +1719,16 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
private boolean isWorkDay(LocalDate date) {
TEmployeeInsuranceWorkDayVo workDayVo = new TEmployeeInsuranceWorkDayVo();
workDayVo.setRegistDate(LocalDateTimeUtils.convertLDToDate(date));
// 使用THolidayInfoService的checkIsWorkDay方法判断是否为假期
// 使用 THolidayInfoService 的 checkIsWorkDay 方法判断是否为假期
// 如果是假期则不是工作日,否则是工作日
R<Boolean> res = socialDaprUtils.checkIsWorkDay(workDayVo);
// 添加空值检查,避免 NPE,并提高代码可读性
if (res == null || res.getData() == null) {
log.warn("checkIsWorkDay 返回结果为空,默认视为非工作日");
return false;
}
// res.getData() 为 true 表示是假期(非工作日),为 false 表示是工作日
return !res.getData();
}
......
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