|
|
|
@@ -67,6 +67,7 @@ open class TeamService( |
|
|
|
open fun updateTeam(req: NewTeamRequest, team: Team): Team { |
|
|
|
val addIds = req.addStaffIds ?: listOf<Int>() |
|
|
|
|
|
|
|
val oldTeamLead = team.staff.id |
|
|
|
val teamLead: Staff |
|
|
|
// val teamName: String |
|
|
|
// val teamCode: String |
|
|
|
@@ -106,6 +107,18 @@ open class TeamService( |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
val newTeamLead = teamLead?.id |
|
|
|
// if ((oldTeamLead != null && oldTeamLead > 0) && (newTeamLead != null && newTeamLead > 0)) { |
|
|
|
if (oldTeamLead != newTeamLead) { |
|
|
|
val sql = StringBuilder("update project" |
|
|
|
+ " set teamlead = :newTeamLead where teamlead = :oldTeamLead" |
|
|
|
) |
|
|
|
|
|
|
|
val args = mapOf("newTeamLead" to teamLead?.id, "oldTeamLead" to newTeamLead) |
|
|
|
|
|
|
|
jdbcDao.executeUpdate(sql.toString(), args) |
|
|
|
} |
|
|
|
|
|
|
|
return team |
|
|
|
} |
|
|
|
|
|
|
|
|