|
|
@@ -11,6 +11,7 @@ import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.xjrsoft.common.constant.GlobalConstant;
|
|
|
import com.xjrsoft.common.enums.RoleEnum;
|
|
|
import com.xjrsoft.common.utils.RedisUtil;
|
|
|
+import com.xjrsoft.config.CommonPropertiesConfig;
|
|
|
import com.xjrsoft.module.organization.entity.User;
|
|
|
import com.xjrsoft.module.organization.entity.UserDeptRelation;
|
|
|
import com.xjrsoft.module.organization.entity.UserRoleRelation;
|
|
|
@@ -72,18 +73,15 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
private final RedisUtil redisUtil;
|
|
|
private final UserDeptRelationMapper userDeptRelationMapper;
|
|
|
private final IUserService userService;
|
|
|
+ private final CommonPropertiesConfig propertiesConfig;
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean add(AddXjrUserDto dto) {
|
|
|
|
|
|
XjrUser xjrUser = BeanUtil.toBean(dto, XjrUser.class);
|
|
|
|
|
|
- // 用户身份证后6位作为默认密码
|
|
|
- if (xjrUser.getCredentialNumber() != null && xjrUser.getCredentialNumber().length() > 6) {
|
|
|
- String str = xjrUser.getCredentialNumber();
|
|
|
- String lastSix = str.substring(str.length() - 6);
|
|
|
- xjrUser.setPassword(BCrypt.hashpw(lastSix, BCrypt.gensalt()));
|
|
|
- }
|
|
|
+ // 使用系统配置的默认密码
|
|
|
+ xjrUser.setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
|
|
|
teacherbaseManagerXjrUserMapper.insert(xjrUser);
|
|
|
for (BaseTeacher baseTeacher : xjrUser.getBaseTeacherList()) {
|
|
|
baseTeacher.setUserId(xjrUser.getId());
|