| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @Override |
| | | public Result add(ActionRecordForm form) { |
| | | ActionRecord entity = ActionRecordForm.getEntityByForm(form, null); |
| | | baseMapper.insert(entity); |
| | | |
| | | AuthUser currentUser = UserContext.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return Result.ok(); |
| | | }else { |
| | | entity.setUserId(currentUser.getId()); |
| | | entity.setStartTime(LocalDateTime.now()); |
| | | baseMapper.insert(entity); |
| | | |
| | | } |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |