|
|
@ -101,6 +101,7 @@ public class ClockingInService implements IClockingInService { |
|
|
|
CClockingInVo.ClockRecord filterRecord = new CClockingInVo.ClockRecord(); |
|
|
|
filterRecord.setMemberId(clockRecord.getMemberId()); |
|
|
|
filterRecord.setMemberName(clockRecord.getMemberName()); |
|
|
|
filterRecord.setMemberUserId(clockRecord.getMemberUserId()); |
|
|
|
if (filterRecord.getMemberUserId().equals(userId)) { |
|
|
|
filterRecord.setIsMine((byte)1); |
|
|
|
} |
|
|
@ -113,7 +114,7 @@ public class ClockingInService implements IClockingInService { |
|
|
|
List<CClockingInVo.ClockRecord> clockRecords = clockingInDao.queryByMemberId(memberIdList); |
|
|
|
for (CClockingInVo.ClockingInInfo clockingInInfo2 : list) { |
|
|
|
for (CClockingInVo.ClockRecord record : clockRecords) { |
|
|
|
if (format.format(new Date(record.getMorning())).equals(clockingInInfo2.getDateTime())) { |
|
|
|
if (format.format(new Date(record.getMorning())).equals(clockingInInfo2.getDateTime()) || format.format(new Date(record.getNight())).equals(clockingInInfo2.getDateTime())) { |
|
|
|
for (CClockingInVo.ClockRecord clockRecord : clockingInInfo2.getRecordList()) { |
|
|
|
if (clockRecord.getMemberId().equals(record.getMemberId())) { |
|
|
|
|
|
|
@ -152,9 +153,10 @@ public class ClockingInService implements IClockingInService { |
|
|
|
throw new BaseException(CommonCodeError.DATE_ERROR); |
|
|
|
} |
|
|
|
//判断是否有打卡记录
|
|
|
|
if(ObjectUtil.isNotNull(params.getId())){ |
|
|
|
ProClockingIn proClockingIn = clockingInDao.queryHaveData(params.getMemberId(),System.currentTimeMillis()); |
|
|
|
if(ObjectUtil.isNotNull(proClockingIn)){ |
|
|
|
//如果有记录则查找记录并修改
|
|
|
|
ProClockingIn proClockingIn = clockingInDao.selectByPrimaryKey(params.getId()); |
|
|
|
// ProClockingIn proClockingIn = clockingInDao.selectByPrimaryKey(params.getId());
|
|
|
|
if(params.getClockType() == 0 && proClockingIn.getMorningStatus() == 0){ |
|
|
|
proClockingIn.setMorning(System.currentTimeMillis()); |
|
|
|
proClockingIn.setMorningStatus((byte) 1); |
|
|
@ -166,18 +168,18 @@ public class ClockingInService implements IClockingInService { |
|
|
|
clockingInDao.updateByPrimaryKeySelective(proClockingIn); |
|
|
|
}else { |
|
|
|
//如果没有记录,则添加一条新的记录
|
|
|
|
ProClockingIn proClockingIn = new ProClockingIn(); |
|
|
|
proClockingIn.setId(snowflake.nextId()); |
|
|
|
proClockingIn.setMemberId(params.getMemberId()); |
|
|
|
proClockingIn.setCheckerId(params.getCheckerId()); |
|
|
|
ProClockingIn newClockingIn = new ProClockingIn(); |
|
|
|
newClockingIn.setId(snowflake.nextId()); |
|
|
|
newClockingIn.setMemberId(params.getMemberId()); |
|
|
|
newClockingIn.setCheckerId(params.getCheckerId()); |
|
|
|
if(params.getClockType() == 0){ |
|
|
|
proClockingIn.setMorning(System.currentTimeMillis()); |
|
|
|
proClockingIn.setMorningStatus((byte) 1); |
|
|
|
newClockingIn.setMorning(System.currentTimeMillis()); |
|
|
|
newClockingIn.setMorningStatus((byte) 1); |
|
|
|
}else if(params.getClockType() == 1){ |
|
|
|
proClockingIn.setNight(System.currentTimeMillis()); |
|
|
|
proClockingIn.setNightStatus((byte) 1); |
|
|
|
newClockingIn.setNight(System.currentTimeMillis()); |
|
|
|
newClockingIn.setNightStatus((byte) 1); |
|
|
|
} |
|
|
|
clockingInDao.insertSelective(proClockingIn); |
|
|
|
clockingInDao.insertSelective(newClockingIn); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|