| | |
| | | import cn.iocoder.yudao.module.system.service.oauth2.OAuth2TokenService; |
| | | import cn.iocoder.yudao.module.system.service.permission.PermissionService; |
| | | import cn.iocoder.yudao.module.system.service.tenant.TenantService; |
| | | import cn.iocoder.yudao.framework.operatelog.core.util.OperateLogUtils; |
| | | import com.google.common.annotations.VisibleForTesting; |
| | | import com.mzt.logapi.context.LogRecordContext; |
| | | import com.mzt.logapi.service.impl.DiffParseFunction; |
| | |
| | | /** |
| | | * 后台用户 Service 实现类 |
| | | * |
| | | * @author 芋道源码 |
| | | * @author 超级管理员 |
| | | */ |
| | | @Service("adminUserService") |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | @Override |
| | | @LogRecord(type = SYSTEM_USER_TYPE, subType = SYSTEM_USER_IMPORT_SUB_TYPE, bizNo = "0", |
| | | success = SYSTEM_USER_IMPORT_SUCCESS) |
| | | @Transactional(rollbackFor = Exception.class) // 添加事务,异常则回滚所有导入 |
| | | public UserImportRespVO importUserList(List<UserImportExcelVO> importUsers, boolean isUpdateSupport) { |
| | | // 1.1 参数校验 |
| | |
| | | userMapper.updateById(updateUser); |
| | | respVO.getUpdateUsernames().add(importUser.getUsername()); |
| | | }); |
| | | // 记录导入结果汇总,供 @LogRecord 的 success 文案引用 |
| | | OperateLogUtils.putImportSummary(respVO.getCreateUsernames(), respVO.getUpdateUsernames(), |
| | | respVO.getFailureUsernames()); |
| | | return respVO; |
| | | } |
| | | |