|
@@ -102,8 +102,16 @@ public class LogHistoryServiceImpl extends BaseServiceImpl<LogHistoryMapper, Log
|
|
|
|
|
|
@Override
|
|
|
public boolean logSubmit(LogHistoryInfoDTO dto) {
|
|
|
+ if (ObjectUtil.isEmpty(SecureUtil.getUserId())) {
|
|
|
+ throw new ServiceException("获取当前用户信息失败,请联系管理员");
|
|
|
+ }
|
|
|
+ dto.setUserId(SecureUtil.getUserId());
|
|
|
this.saveOrUpdate(dto);
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(dto.getTaskIds())){
|
|
|
+ //新增日志与任务关系信息 TODO
|
|
|
+ }
|
|
|
+
|
|
|
if (ObjectUtil.isNotEmpty(dto.getExpenseReimbursementAmount())) {
|
|
|
//报销金额不为空,在财务报销里面新增一条草稿箱内容 TODO
|
|
|
}
|
|
@@ -130,14 +138,46 @@ public class LogHistoryServiceImpl extends BaseServiceImpl<LogHistoryMapper, Log
|
|
|
Long row = jdbcTemplate.queryForObject("select count(1) from c_log_history_read_record where log_id = " + vo.getId() + " and user_id = " + SecureUtil.getUserId(), Long.class);
|
|
|
if (row == null || row == 0L) {
|
|
|
jdbcTemplate.execute("insert into c_log_history_read_record(id,log_id,user_id) values (" + SnowFlakeUtil.getId() + "," + vo.getId() + "," + SecureUtil.getUserId() + ")");
|
|
|
+ vo.setIsRead(1);
|
|
|
}
|
|
|
|
|
|
//处理当前日志taskList任务列表 TODO
|
|
|
|
|
|
+ //处理所有已读人信息
|
|
|
+ List<LogHistoryInfoReadVO> readUsersInfo = jdbcTemplate.query("select * from c_log_history_read_record where log_id = " + vo.getId(), new BeanPropertyRowMapper<>(LogHistoryInfoReadVO.class));
|
|
|
+ List<Long> userIds = readUsersInfo.stream().map(LogHistoryInfoReadVO::getUserId).distinct().collect(Collectors.toList());
|
|
|
+ if (userIds.size() > 0) {
|
|
|
+ List<User> readUserInfoList = iUserClient.userInfoByIds(userIds);
|
|
|
+ List<LogHistoryInfoVO.ReadUser> readUsers = new ArrayList<>();
|
|
|
+ for (User userRead : readUserInfoList) {
|
|
|
+ readUsers.add(new LogHistoryInfoVO.ReadUser(userRead.getAvatar(), userRead.getRealName()));
|
|
|
+ }
|
|
|
+ vo.setReadUsers(readUsers);
|
|
|
+ }
|
|
|
|
|
|
return vo;
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean logTaskComplete(Long logId, Long taskId) {
|
|
|
+ if (ObjectUtil.isEmpty(logId)) {
|
|
|
+ throw new ServiceException("请先提交日志后,再变更任务");
|
|
|
+ }
|
|
|
+ //修改计划任务的状态为已完成,推送到对应的当前部门负责人审批(此处修改的任务状态为计划任务,新增推送的任务为审批任务) TODO
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Object logTaskList(Long logId) {
|
|
|
+ if (ObjectUtil.isEmpty(SecureUtil.getUserId())) {
|
|
|
+ throw new ServiceException("获取当前用户信息失败,请联系管理员");
|
|
|
+ }
|
|
|
+ //获取当前用户当天的所有任务信息 TODO
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|