From 95c2f7cee1877a0d5ef736aab82bcfdb3e46089f Mon Sep 17 00:00:00 2001 From: yjieliang Date: Thu, 25 Jan 2024 11:04:22 +0800 Subject: [PATCH] =?UTF-8?q?bug=EF=BC=9A=20=E7=94=A8=E6=88=B7=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E6=9E=B6=E6=9E=84=E6=96=B0=E5=A2=9E=E7=BA=BF=E4=B8=80?= =?UTF-8?q?=E7=BA=A7=E5=88=AB=E7=BB=84=E7=BB=87=E5=B1=82=E7=BA=A7=EF=BC=8C?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E8=8E=B7=E5=8F=96=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E6=9C=AA=E6=9B=B4=E6=96=B0=E5=AF=BC=E8=87=B4=E9=83=A8?= =?UTF-8?q?=E5=88=86=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=A0=A1=E9=AA=8C=E5=A4=B1=E8=B4=A5=20#9967?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/tencent/devops/project/dao/UserDao.kt | 37 ++++++++----------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/dao/UserDao.kt b/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/dao/UserDao.kt index 7a3a049fc14..ba610fea4c8 100644 --- a/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/dao/UserDao.kt +++ b/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/dao/UserDao.kt @@ -29,9 +29,10 @@ package com.tencent.devops.project.dao import com.tencent.devops.model.project.tables.TUser import com.tencent.devops.model.project.tables.records.TUserRecord +import com.tencent.devops.project.pojo.user.UserDeptDetail +import java.time.LocalDateTime import org.jooq.DSLContext import org.springframework.stereotype.Repository -import java.time.LocalDateTime @Suppress("ALL") @Repository @@ -93,30 +94,22 @@ class UserDao { fun update( dslContext: DSLContext, - userId: String, - name: String, - bgId: Int, - bgName: String, - deptId: Int, - deptName: String, - centerId: Int, - centerName: String, - groupId: Int, - groupName: String + userDeptDetail: UserDeptDetail ) { with(TUser.T_USER) { - dslContext.update(this) - .set(NAME, name) - .set(BG_ID, bgId) - .set(BG_NAME, bgName) - .set(DEPT_ID, deptId) - .set(DEPT_NAME, deptName) - .set(CENTER_ID, centerId) - .set(CENTER_NAME, centerName) - .set(GROYP_ID, groupId) - .set(GROUP_NAME, groupName) + val baseStep = dslContext.update(this) + .set(NAME, userDeptDetail.name) + .set(BG_ID, userDeptDetail.bgId.toInt()) + .set(BG_NAME, userDeptDetail.bgName) + .set(DEPT_ID, userDeptDetail.deptId.toInt()) + .set(DEPT_NAME, userDeptDetail.deptName) + .set(CENTER_ID, userDeptDetail.centerId.toInt()) + .set(CENTER_NAME, userDeptDetail.centerName) + .set(GROYP_ID, userDeptDetail.groupId.toInt()) + .set(GROUP_NAME, userDeptDetail.groupName) .set(UPDATE_TIME, LocalDateTime.now()) - .where(USER_ID.eq(userId)) + userDeptDetail.businessLineId?.let { baseStep.set(BUSINESS_LINE_ID, it.toLong()) } + baseStep.where(USER_ID.eq(userDeptDetail.userId)) .execute() } }