瀏覽代碼

update

tags/Baseline_30082024_BACKEND_UAT
MSI\derek 1 年之前
父節點
當前提交
0f4fdaf433
共有 1 個文件被更改,包括 11 次插入10 次删除
  1. +11
    -10
      src/main/java/com/ffii/tsms/modules/data/service/TeamService.kt

+ 11
- 10
src/main/java/com/ffii/tsms/modules/data/service/TeamService.kt 查看文件

@@ -41,15 +41,15 @@ open class TeamService(
val ids = req.addStaffIds!!
// println(ids)
val teamLead = staffRepository.findById(ids[0]).orElseThrow()
val teamName = "Team " + teamLead.name
val initials = teamLead.name.split(" ").map { it.first() }
val teamCode = initials.joinToString("")
// val teamName = "Team " + teamLead.name
//
// val initials = teamLead.name.split(" ").map { it.first() }
// val teamCode = initials.joinToString("")

val team = Team().apply {
this.staff = teamLead
name = teamName
code = teamCode
name = req.name
code = req.code
description = req.description
}
teamRepository.saveAndFlush(team)
@@ -73,11 +73,12 @@ open class TeamService(

if (addIds.isNotEmpty()) {
val leader = staffRepository.findById(addIds[0].toLong()).orElseThrow()
teamName = "Team " + leader.name
// teamName = "Team " + leader.name
teamName = req.name
teamLead = leader;
val initials = leader.name.split(" ").map { it.first() }
teamCode = initials.joinToString("")
// val initials = leader.name.split(" ").map { it.first() }
// teamCode = initials.joinToString("")
teamCode = req.code
} else {
teamLead = team.staff
teamName = team.name


Loading…
取消
儲存