|
|
@ -116,14 +116,14 @@ public class ClockingInService implements IClockingInService { |
|
|
|
public void punchTheClock(CClockingInDto.PunchTheClock params, Long userId) { |
|
|
|
//判断选择打卡的成员和当前用户是否匹配
|
|
|
|
ProMember proMember = memberDao.selectByPrimaryKey(params.getMemberId()); |
|
|
|
if(ObjectUtil.isNull(proMember) || proMember.getUserId().equals(userId)){ |
|
|
|
if(ObjectUtil.isNull(proMember) || !proMember.getUserId().equals(userId)){ |
|
|
|
throw new BaseException(CommonCodeError.MEMBER_NOT_MINE); |
|
|
|
} |
|
|
|
//验证打卡日期是否是今天
|
|
|
|
DateFormat df = new SimpleDateFormat("yy-MM-dd"); |
|
|
|
DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
String format = df.format(new Date()); |
|
|
|
log.info("获取今天的日期:{}",format); |
|
|
|
if(!format.equalsIgnoreCase(params.getDateTime().toString())){ |
|
|
|
if(!format.equalsIgnoreCase(df.format(new Date(params.getDateTime())))){ |
|
|
|
throw new BaseException(CommonCodeError.DATE_ERROR); |
|
|
|
} |
|
|
|
//判断是否有打卡记录
|
|
|
|