This commit is contained in:
cool 2024-01-21 10:57:45 +08:00
parent 7112e96f54
commit df540acb09

View File

@ -1,7 +1,7 @@
import { Inject, Provide } from '@midwayjs/decorator'; import { Inject, Provide } from '@midwayjs/decorator';
import { BaseService, CoolCommException } from '@cool-midway/core'; import { BaseService, CoolCommException } from '@cool-midway/core';
import { InjectEntityModel } from '@midwayjs/typeorm'; import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm'; import { In, Repository } from 'typeorm';
import { BaseSysUserEntity } from '../../entity/sys/user'; import { BaseSysUserEntity } from '../../entity/sys/user';
import { BaseSysPermsService } from './perms'; import { BaseSysPermsService } from './perms';
import * as _ from 'lodash'; import * as _ from 'lodash';
@ -90,12 +90,7 @@ export class BaseSysUserService extends BaseService {
* @param userIds * @param userIds
*/ */
async move(departmentId, userIds) { async move(departmentId, userIds) {
await this.baseSysUserEntity await this.baseSysUserEntity.update({ id: In(userIds) }, { departmentId });
.createQueryBuilder('a')
.update()
.set({ departmentId })
.where('a.id in (:...userIds)', { userIds })
.execute();
} }
/** /**