|
@@ -1,13 +1,16 @@
|
|
|
package cn.com.taiji.duty.service.impl;
|
|
|
|
|
|
import cn.com.taiji.duty.model.DutyAccount;
|
|
|
+import cn.com.taiji.duty.model.DutyOperLog;
|
|
|
import cn.com.taiji.duty.model.DutySignInRecord;
|
|
|
import cn.com.taiji.duty.mapper.DutySignInRecordMapper;
|
|
|
import cn.com.taiji.duty.model.DutySignInRecordVo;
|
|
|
import cn.com.taiji.duty.service.IDutyAccountService;
|
|
|
import cn.com.taiji.duty.service.IDutyConfigService;
|
|
|
+import cn.com.taiji.duty.service.IDutyOperLogService;
|
|
|
import cn.com.taiji.duty.service.IDutySignInRecordService;
|
|
|
import cn.com.taiji.duty.utils.JwtUtils;
|
|
|
+import cn.com.taiji.duty.utils.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -51,6 +54,9 @@ public class DutySignInRecordServiceImpl extends ServiceImpl<DutySignInRecordMap
|
|
|
@Autowired
|
|
|
private IDutyAccountService accountService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IDutyOperLogService operLogService;
|
|
|
+
|
|
|
@Override
|
|
|
public DutySignInRecord search(Long deptId) {
|
|
|
return signInRecordMapper.search(deptId);
|
|
@@ -124,7 +130,6 @@ public class DutySignInRecordServiceImpl extends ServiceImpl<DutySignInRecordMap
|
|
|
}
|
|
|
if (signOut != null) {
|
|
|
signInRecord.setId(signOut.getId());
|
|
|
- return this.updateById(signInRecord);
|
|
|
}
|
|
|
} else {
|
|
|
DutySignInRecord sign = signInRecordMapper.queryByAccountId(signInRecord.getDeptId(),1,new Date());
|
|
@@ -147,7 +152,6 @@ public class DutySignInRecordServiceImpl extends ServiceImpl<DutySignInRecordMap
|
|
|
signInRecord.setStatus("2");
|
|
|
}
|
|
|
signInRecord.setId(sign.getId());
|
|
|
- return this.updateById(signInRecord);
|
|
|
} else {
|
|
|
DutySignInRecord signOut = signInRecordMapper.queryByAccountId(signInRecord.getDeptId(), 2, new Date());
|
|
|
signInRecord.setType("2");
|
|
@@ -161,13 +165,23 @@ public class DutySignInRecordServiceImpl extends ServiceImpl<DutySignInRecordMap
|
|
|
}
|
|
|
if (signOut != null) {
|
|
|
signInRecord.setId(signOut.getId());
|
|
|
- return this.updateById(signInRecord);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return this.save(signInRecord);
|
|
|
+ DutyOperLog operLog = new DutyOperLog();
|
|
|
+ operLog.setOperModule("2");
|
|
|
+ if ("1".equals(signInRecord.getType())) {
|
|
|
+ operLog.setOperType("6");
|
|
|
+ } else {
|
|
|
+ operLog.setOperType("7");
|
|
|
+ }
|
|
|
+ operLogService.saveOperLog(operLog);
|
|
|
+ if (StringUtils.isNull(signInRecord.getId())) {
|
|
|
+ return this.save(signInRecord);
|
|
|
+ }
|
|
|
+ return this.updateById(signInRecord);
|
|
|
}
|
|
|
|
|
|
@Override
|