diff --git a/ga-core/src/main/java/com/ga/core/mapper/org/AgentMapper.java b/ga-core/src/main/java/com/ga/core/mapper/org/AgentMapper.java index 000f340..6067eea 100644 --- a/ga-core/src/main/java/com/ga/core/mapper/org/AgentMapper.java +++ b/ga-core/src/main/java/com/ga/core/mapper/org/AgentMapper.java @@ -1,6 +1,7 @@ package com.ga.core.mapper.org; import com.ga.core.vo.org.AgentExcelVO; +import com.ga.core.vo.org.AgentOrgHistoryResp; import com.ga.core.vo.org.AgentOrgHistoryVO; import com.ga.core.vo.org.AgentResp; import com.ga.core.vo.org.AgentSearchParam; @@ -28,5 +29,6 @@ public interface AgentMapper { /** 이력 */ List selectHistory(@Param("agentId") Long agentId); + List selectHistoryResp(@Param("agentId") Long agentId); int insertHistory(AgentOrgHistoryVO vo); } diff --git a/ga-core/src/main/java/com/ga/core/mapstruct/ContractMapStruct.java b/ga-core/src/main/java/com/ga/core/mapstruct/ContractMapStruct.java new file mode 100644 index 0000000..2c0dc90 --- /dev/null +++ b/ga-core/src/main/java/com/ga/core/mapstruct/ContractMapStruct.java @@ -0,0 +1,27 @@ +package com.ga.core.mapstruct; + +import com.ga.core.vo.product.ContractSaveReq; +import com.ga.core.vo.product.ContractVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.MappingTarget; + +@Mapper(componentModel = "spring") +public interface ContractMapStruct { + + @Mapping(target = "contractId", ignore = true) + @Mapping(target = "status", ignore = true) + @Mapping(target = "lapseDate", ignore = true) + @Mapping(target = "revivalDate", ignore = true) + @Mapping(target = "createdAt", ignore = true) + @Mapping(target = "updatedAt", ignore = true) + ContractVO toVO(ContractSaveReq req); + + @Mapping(target = "contractId", ignore = true) + @Mapping(target = "status", ignore = true) + @Mapping(target = "lapseDate", ignore = true) + @Mapping(target = "revivalDate", ignore = true) + @Mapping(target = "createdAt", ignore = true) + @Mapping(target = "updatedAt", ignore = true) + void updateVO(ContractSaveReq req, @MappingTarget ContractVO vo); +} diff --git a/ga-core/src/main/java/com/ga/core/mapstruct/ExceptionLedgerMapStruct.java b/ga-core/src/main/java/com/ga/core/mapstruct/ExceptionLedgerMapStruct.java new file mode 100644 index 0000000..fc21d14 --- /dev/null +++ b/ga-core/src/main/java/com/ga/core/mapstruct/ExceptionLedgerMapStruct.java @@ -0,0 +1,24 @@ +package com.ga.core.mapstruct; + +import com.ga.core.vo.ledger.ExceptionLedgerSaveReq; +import com.ga.core.vo.ledger.ExceptionLedgerVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; + +@Mapper(componentModel = "spring") +public interface ExceptionLedgerMapStruct { + + @Mapping(target = "ledgerId", ignore = true) + @Mapping(target = "contractId", ignore = true) + @Mapping(target = "commissionYear", ignore = true) + @Mapping(target = "taxAmount", ignore = true) + @Mapping(target = "approveStatus", ignore = true) + @Mapping(target = "approverId", ignore = true) + @Mapping(target = "approveDate", ignore = true) + @Mapping(target = "recurringLeft", ignore = true) + @Mapping(target = "status", ignore = true) + @Mapping(target = "version", ignore = true) + @Mapping(target = "createdAt", ignore = true) + @Mapping(target = "updatedAt", ignore = true) + ExceptionLedgerVO toVO(ExceptionLedgerSaveReq req); +} diff --git a/ga-core/src/main/java/com/ga/core/mapstruct/UserMapStruct.java b/ga-core/src/main/java/com/ga/core/mapstruct/UserMapStruct.java new file mode 100644 index 0000000..9a07877 --- /dev/null +++ b/ga-core/src/main/java/com/ga/core/mapstruct/UserMapStruct.java @@ -0,0 +1,34 @@ +package com.ga.core.mapstruct; + +import com.ga.core.vo.user.UserSaveReq; +import com.ga.core.vo.user.UserVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.MappingTarget; + +@Mapper(componentModel = "spring") +public interface UserMapStruct { + + @Mapping(target = "userId", ignore = true) + @Mapping(target = "password", ignore = true) + @Mapping(target = "failCount", ignore = true) + @Mapping(target = "lastLoginAt", ignore = true) + @Mapping(target = "pwdChangedAt", ignore = true) + @Mapping(target = "createdAt", ignore = true) + @Mapping(target = "createdBy", ignore = true) + @Mapping(target = "updatedAt", ignore = true) + @Mapping(target = "updatedBy", ignore = true) + UserVO toVO(UserSaveReq req); + + @Mapping(target = "userId", ignore = true) + @Mapping(target = "loginId", ignore = true) + @Mapping(target = "password", ignore = true) + @Mapping(target = "failCount", ignore = true) + @Mapping(target = "lastLoginAt", ignore = true) + @Mapping(target = "pwdChangedAt", ignore = true) + @Mapping(target = "createdAt", ignore = true) + @Mapping(target = "createdBy", ignore = true) + @Mapping(target = "updatedAt", ignore = true) + @Mapping(target = "updatedBy", ignore = true) + void updateVO(UserSaveReq req, @MappingTarget UserVO vo); +} diff --git a/ga-core/src/main/java/com/ga/core/vo/org/AgentOrgHistoryResp.java b/ga-core/src/main/java/com/ga/core/vo/org/AgentOrgHistoryResp.java new file mode 100644 index 0000000..69a18b1 --- /dev/null +++ b/ga-core/src/main/java/com/ga/core/vo/org/AgentOrgHistoryResp.java @@ -0,0 +1,27 @@ +package com.ga.core.vo.org; + +import lombok.Data; + +import java.time.LocalDate; + +@Data +public class AgentOrgHistoryResp { + private Long historyId; + private Long agentId; + private String agentName; + + private Long fromOrgId; + private String fromOrgName; + private Long toOrgId; + private String toOrgName; + + private Long fromGradeId; + private String fromGradeName; + private Long toGradeId; + private String toGradeName; + + private String changeType; // TRANSFER / PROMOTE / DEMOTE / JOIN / LEAVE + private String changeTypeName; + private LocalDate changeDate; + private String changeReason; +} diff --git a/ga-core/src/main/resources/mapper/org/AgentMapper.xml b/ga-core/src/main/resources/mapper/org/AgentMapper.xml index 7104b9b..19ecd5a 100644 --- a/ga-core/src/main/resources/mapper/org/AgentMapper.xml +++ b/ga-core/src/main/resources/mapper/org/AgentMapper.xml @@ -143,10 +143,57 @@ WHERE agent_id = #{agentId} + + + + + + + + + + + + + + + + + + + + + INSERT INTO agent_org_history (agent_id, from_org_id, to_org_id, from_grade_id, to_grade_id, change_type, change_date, change_reason, created_at, created_by)