From 7fd0771bbebafa36bc007ceb581cdaab4d290c82 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期四, 06 六月 2024 09:18:41 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/main/java/com/ycl/jxkg/service/impl/UserServiceImpl.java | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ycl/jxkg/service/impl/UserServiceImpl.java b/src/main/java/com/ycl/jxkg/service/impl/UserServiceImpl.java index 66d0389..77ae849 100644 --- a/src/main/java/com/ycl/jxkg/service/impl/UserServiceImpl.java +++ b/src/main/java/com/ycl/jxkg/service/impl/UserServiceImpl.java @@ -1,10 +1,13 @@ package com.ycl.jxkg.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ycl.jxkg.domain.entity.UserEventLog; import com.ycl.jxkg.domain.enums.RoleEnum; import com.ycl.jxkg.domain.enums.UserStatusEnum; import com.ycl.jxkg.domain.form.RegisterForm; import com.ycl.jxkg.domain.other.KeyValue; +import com.ycl.jxkg.domain.vo.StudentVO; +import com.ycl.jxkg.event.UserEvent; import com.ycl.jxkg.exception.BusinessException; import com.ycl.jxkg.domain.entity.User; import com.ycl.jxkg.event.OnRegistrationCompleteEvent; @@ -29,7 +32,6 @@ private final UserMapper userMapper; private final ApplicationEventPublisher eventPublisher; - private final AuthenticationService authenticationService; public List<User> getUsers() { @@ -144,12 +146,15 @@ User teacher = new User(); BeanUtils.copyProperties(form, teacher); teacher.setRole(RoleEnum.ADMIN.getCode()); - teacher.setPassword(authenticationService.pwdEncode(form.getPassword())); teacher.setUserUuid(UUID.randomUUID().toString()); teacher.setLastActiveTime(new Date()); teacher.setStatus(UserStatusEnum.Enable.getCode()); teacher.setDeleted(0); this.insertUser(teacher); + // 鍙戝竷娉ㄥ唽浜嬩欢锛屼繚瀛樻敞鍐屾棩蹇� + UserEventLog userEventLog = new UserEventLog(teacher.getId(), teacher.getUserName(), teacher.getRealName(), new Date()); + userEventLog.setContent("娆㈣繋 " + teacher.getUserName() + " 娉ㄥ唽鏉ュ埌姹熻タ绌虹闊宠棰戝煿璁郴缁�"); + eventPublisher.publishEvent(new UserEvent(userEventLog)); } @Override @@ -157,11 +162,19 @@ User student = new User(); BeanUtils.copyProperties(form, student); student.setRole(RoleEnum.ADMIN.getCode()); - student.setPassword(authenticationService.pwdEncode(form.getPassword())); student.setUserUuid(UUID.randomUUID().toString()); student.setLastActiveTime(new Date()); student.setStatus(UserStatusEnum.Enable.getCode()); student.setDeleted(0); this.insertUser(student); + // 鍙戝竷娉ㄥ唽浜嬩欢锛屼繚瀛樻敞鍐屾棩蹇� + UserEventLog userEventLog = new UserEventLog(student.getId(), student.getUserName(), student.getRealName(), new Date()); + userEventLog.setContent("娆㈣繋 " + student.getUserName() + " 娉ㄥ唽鏉ュ埌姹熻タ绌虹闊宠棰戝煿璁郴缁�"); + eventPublisher.publishEvent(new UserEvent(userEventLog)); + } + + @Override + public List<StudentVO> classesStudent(Integer classesId) { + return userMapper.classesStudent(classesId); } } -- Gitblit v1.8.0