소스 검색

rename

master
cyril.tsui 2 일 전
부모
커밋
91fff4fddd
7개의 변경된 파일38개의 추가작업 그리고 27개의 파일을 삭제
  1. +2
    -2
      src/main/java/com/ffii/fpsms/modules/stock/entity/EscalationLog.kt
  2. +10
    -10
      src/main/java/com/ffii/fpsms/modules/stock/entity/EscalationLogInfo.kt
  3. +2
    -2
      src/main/java/com/ffii/fpsms/modules/stock/entity/EscalationLogRepository.kt
  4. +8
    -8
      src/main/java/com/ffii/fpsms/modules/stock/service/EscalationLogService.kt
  5. +1
    -1
      src/main/java/com/ffii/fpsms/modules/stock/web/model/SaveEscalationLogRequest.kt
  6. +4
    -4
      src/main/java/com/ffii/fpsms/modules/stock/web/model/SaveEscalationLogResponse.kt
  7. +11
    -0
      src/main/resources/db/changelog/changes/20250825_01_cyril/01_update_escalation_log.sql

+ 2
- 2
src/main/java/com/ffii/fpsms/modules/stock/entity/EscalationLog.kt 파일 보기

@@ -14,8 +14,8 @@ import java.time.LocalDateTime
open class EscalationLog : BaseEntity<Long>() {
@NotNull
@ManyToOne
@JoinColumn(name = "personInCharge", nullable = false, referencedColumnName = "id")
open var personInCharge: User? = null
@JoinColumn(name = "handlerId", nullable = false, referencedColumnName = "id")
open var handler: User? = null

@Size(max = 100)
@Column(name = "type", nullable = false, length = 100)


+ 10
- 10
src/main/java/com/ffii/fpsms/modules/stock/entity/EscalationLogInfo.kt 파일 보기

@@ -52,16 +52,16 @@ interface EscalationLogInfo {
@get:Value("#{target.stockInLine?.item?.itemUoms.^[stockUnit == true && deleted == false]?.uom.udfudesc}")
val stockUomDesc: String?

@get:Value("#{target.personInCharge?.id}")
val personInChargeId: Long?
@get:Value("#{target.personInCharge?.department} - #{target.personInCharge?.title} - #{target.personInCharge?.name}")
val personInCharge: String?
@get:Value("#{target.personInCharge?.name}")
val personInChargeName: String?
@get:Value("#{target.personInCharge?.title}")
val personInChargeTitle: String?
@get:Value("#{target.personInCharge?.department}")
val personInChargeDepartment: String?
@get:Value("#{target.handler?.id}")
val handlerId: Long?
@get:Value("#{target.handler?.department} - #{target.handler?.title} - #{target.handler?.name}")
val handler: String?
@get:Value("#{target.handler?.name}")
val handlerName: String?
@get:Value("#{target.handler?.title}")
val handlerTitle: String?
@get:Value("#{target.handler?.department}")
val handlerDepartment: String?

// @get:Value("#{target.type}")
// val escalationLevel: String


+ 2
- 2
src/main/java/com/ffii/fpsms/modules/stock/entity/EscalationLogRepository.kt 파일 보기

@@ -6,10 +6,10 @@ import java.io.Serializable

@Repository
interface EscalationLogRepository: AbstractRepository<EscalationLog, Long> {
// fun findAllByPersonInCharge(personInCharge: Long): List<SupervisionApprovalLog>
// fun findAllByHandler(handler: Long): List<SupervisionApprovalLog>
fun findAllInfoByDeletedFalse(): List<EscalationLogInfo>

fun findAllInfoByDeletedFalseAndStockInLineIdIn(stockInLineIds: List<Serializable>): List<EscalationLogInfo>

fun findAllInfoByDeletedFalseAndPersonInChargeIdIs(personInChargeId: Serializable): List<EscalationLogInfo>
fun findAllInfoByDeletedFalseAndHandlerIdIs(handlerId: Serializable): List<EscalationLogInfo>
}

+ 8
- 8
src/main/java/com/ffii/fpsms/modules/stock/service/EscalationLogService.kt 파일 보기

@@ -37,14 +37,14 @@ open class EscalationLogService(

open fun getLogsByUser(): List<EscalationLogInfo> {
val user = SecurityUtils.getUser().orElseThrow()
val logs = user.id?.let { escalationLogRepository.findAllInfoByDeletedFalseAndPersonInChargeIdIs(it) } ?: listOf()
val logs = user.id?.let { escalationLogRepository.findAllInfoByDeletedFalseAndHandlerIdIs(it) } ?: listOf()
return logs
}

open fun saveEscalationLog(request: SaveEscalationLogRequest): SaveEscalationLogResponse{
val escalationLog = request.id?.let { escalationLogRepository.findById(it).getOrNull() } ?: EscalationLog()
val personInCharge = request.personInChargeId.let { userService.getUserById(it) }
if (personInCharge == null && escalationLog.personInCharge == null) {
val handler = request.handlerId.let { userService.getUserById(it) }
if (handler == null && escalationLog.handler == null) {
throw NoSuchElementException("Person In Charge is null.");
}

@@ -57,7 +57,7 @@ open class EscalationLogService(
val status = request.status.let { status -> EscalationLogStatus.entries.find{ it.value == status} }

escalationLog.apply {
this.personInCharge = personInCharge
this.handler = handler
type = request.type
this.stockInLine = stockInLine
this.stockOutLine = stockOutLine
@@ -73,10 +73,10 @@ open class EscalationLogService(
id = it.id,
stockInLineId = it.stockInLine?.id,
stockOutLineId = it.stockOutLine?.id,
personInChargeId = it.personInCharge?.id,
personInChargeName = it.personInCharge?.name,
personInChargeTitle = it.personInCharge?.title,
personInChargeDepartment = it.personInCharge?.department,
handlerId = it.handler?.id,
handlerName = it.handler?.name,
handlerTitle = it.handler?.title,
handlerDepartment = it.handler?.department,
recordDate = it.recordDate,
status = it.status?.value,
reason = it.reason,


+ 1
- 1
src/main/java/com/ffii/fpsms/modules/stock/web/model/SaveEscalationLogRequest.kt 파일 보기

@@ -7,7 +7,7 @@ import java.time.LocalDateTime
data class SaveEscalationLogRequest(
val id: Long?,
@field:NotNull(message = "Person In Charge cannot be empty")
val personInChargeId: Long,
val handlerId: Long,
val type: String?,
val stockInLineId: Long?,
val stockOutLineId: Long?,


+ 4
- 4
src/main/java/com/ffii/fpsms/modules/stock/web/model/SaveEscalationLogResponse.kt 파일 보기

@@ -6,10 +6,10 @@ data class SaveEscalationLogResponse(
val id: Long?,
val stockInLineId: Long?,
val stockOutLineId: Long?,
val personInChargeId: Long?,
val personInChargeName: String?,
val personInChargeTitle: String?,
val personInChargeDepartment: String?,
val handlerId: Long?,
val handlerName: String?,
val handlerTitle: String?,
val handlerDepartment: String?,
val recordDate: LocalDateTime?,
val status: String?,
val reason: String?,


+ 11
- 0
src/main/resources/db/changelog/changes/20250825_01_cyril/01_update_escalation_log.sql 파일 보기

@@ -0,0 +1,11 @@
-- liquibase formatted sql
-- changeset cyril:rename_escalation_log

ALTER TABLE `escalation_log`
DROP FOREIGN KEY `FK_SUPERVISION_APPROVAL_LOG_ON_PERSONINCHARGE`;
ALTER TABLE `escalation_log`
CHANGE COLUMN `personInCharge` `handlerId` INT NOT NULL ;
ALTER TABLE `escalation_log`
ADD CONSTRAINT `FK_SUPERVISION_APPROVAL_LOG_ON_PERSONINCHARGE`
FOREIGN KEY (`handlerId`)
REFERENCES `user` (`id`);

불러오는 중...
취소
저장