260306_01_ENH: DTO 아키텍처 조정 및 ListHeader RU 구현
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
package com.kri.contact.server.common.consts;
|
package com.kri.contact.server.common.consts;
|
||||||
|
|
||||||
public final class ContactConstant {
|
public final class ContactConstant {
|
||||||
|
public static final int INSERT_CHUNK_SIZE = 1_000;
|
||||||
public static final String DEFAULT_COMPANY_NAME = "KRI";
|
public static final String DEFAULT_COMPANY_NAME = "KRI";
|
||||||
public static final String DEFAULT_USER_TEAM = "S101";
|
public static final String DEFAULT_USER_TEAM = "S101";
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public enum ChannelType implements CodeEnum<Short> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
for (ChannelType s : values()) {
|
for (ChannelType s : values()) {
|
||||||
if (s.code == code) {
|
if (s.code.equals(code)) {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.kri.contact.server.common.enums;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import com.kri.common.enums.CodeEnum;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Getter(onMethod_ = @JsonValue)
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public enum ListHeaderGrade implements CodeEnum<Short> {
|
||||||
|
|
||||||
|
IMMUTABLE((short) 0), // 불변 헤더 (옵션 변경 불가)
|
||||||
|
RESERVED((short) 1), // Default 헤더 (옵션 변경 가능)
|
||||||
|
COMMON((short) 10); // 일반 헤더 (옵션 변경 가능)
|
||||||
|
|
||||||
|
private final Short code;
|
||||||
|
|
||||||
|
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||||
|
public static ListHeaderGrade fromCode(Short code) {
|
||||||
|
if (code == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (ListHeaderGrade s : values()) {
|
||||||
|
if (s.code.equals(code)) {
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Unknown ListHeaderGrade code: " + code);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.kri.contact.server.common.enums;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import com.kri.common.enums.CodeEnum;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Getter(onMethod_ = @JsonValue)
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public enum ListHeaderType implements CodeEnum<Short> {
|
||||||
|
|
||||||
|
SID((short) 11), //11 : SID
|
||||||
|
IS_USE((short) 12), //12 : 사용여부
|
||||||
|
MEMO((short) 19), //19 : 메모
|
||||||
|
TEL_NUM((short) 21), //21 : 전화번호
|
||||||
|
EMAIL((short) 31), //31 : 이메일
|
||||||
|
FILE((short) 81), //81 : 파일업로드
|
||||||
|
TEXT((short) 91); //91 : 텍스트
|
||||||
|
|
||||||
|
private final Short code;
|
||||||
|
|
||||||
|
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||||
|
public static ListHeaderType fromCode(Short code) {
|
||||||
|
if (code == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (ListHeaderType s : values()) {
|
||||||
|
if (s.code.equals(code)) {
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Unknown ListHeaderType code: " + code);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ public enum ProjectStatus implements CodeEnum<Short> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
for (ProjectStatus s : values()) {
|
for (ProjectStatus s : values()) {
|
||||||
if (s.code == code) {
|
if (s.code.equals(code)) {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public enum ResultCodeType implements CodeEnum<Short> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
for (ResultCodeType s : values()) {
|
for (ResultCodeType s : values()) {
|
||||||
if (s.code == code) {
|
if (s.code.equals(code)) {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public enum SurveyType implements CodeEnum<Short> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
for (SurveyType s : values()) {
|
for (SurveyType s : values()) {
|
||||||
if (s.code == code) {
|
if (s.code.equals(code)) {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ public enum SystemEventType implements CodeEnum<Short> {
|
|||||||
UPDATE_ROLE((short) 412), // 권한 수정
|
UPDATE_ROLE((short) 412), // 권한 수정
|
||||||
DELETE_ROLE((short) 413), // 권한 삭제
|
DELETE_ROLE((short) 413), // 권한 삭제
|
||||||
|
|
||||||
|
UPSERT_LIST_HEADER((short) 1011),
|
||||||
|
|
||||||
DUMMY((short) 9999);
|
DUMMY((short) 9999);
|
||||||
|
|
||||||
private final Short code;
|
private final Short code;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
|||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.kri.common.http.ExternalApiClient;
|
import com.kri.common.http.ExternalApiClient;
|
||||||
import com.kri.common.http.ExternalApiResponse;
|
import com.kri.common.http.ExternalApiResponse;
|
||||||
import com.kri.contact.server.dto.LoginRequestDto;
|
import com.kri.contact.server.dto.auth.LoginRequestDto;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.kri.contact.server.common.util;
|
package com.kri.contact.server.common.util;
|
||||||
|
|
||||||
import com.kri.common.excel.ExcelMapper;
|
import com.kri.common.excel.ExcelMapper;
|
||||||
import com.kri.contact.server.dto.ExcelUploadResponseDto;
|
import com.kri.contact.server.dto.excel.ExcelUploadResponseDto;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package com.kri.contact.server.controller;
|
|||||||
|
|
||||||
import com.kri.common.datetime.DateTimeUtil;
|
import com.kri.common.datetime.DateTimeUtil;
|
||||||
import com.kri.common.webmvc.RequestUserContext;
|
import com.kri.common.webmvc.RequestUserContext;
|
||||||
import com.kri.contact.server.dto.LoginRequestDto;
|
import com.kri.contact.server.dto.auth.LoginRequestDto;
|
||||||
import com.kri.contact.server.dto.LoginResponseDto;
|
import com.kri.contact.server.dto.auth.LoginResponseDto;
|
||||||
import com.kri.contact.server.service.AuthService;
|
import com.kri.contact.server.service.AuthService;
|
||||||
import com.kri.contact.server.service.SystemEventLogService;
|
import com.kri.contact.server.service.SystemEventLogService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.kri.contact.server.controller;
|
||||||
|
|
||||||
|
import com.kri.common.webmvc.RequestUserContext;
|
||||||
|
import com.kri.contact.server.dto.list.ListHeaderDto;
|
||||||
|
import com.kri.contact.server.service.ListHeaderService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PatchMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/v1/list-header")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Tag(name = "ListHeader", description = "리스트 헤더 API")
|
||||||
|
public class ListHeaderController {
|
||||||
|
|
||||||
|
ListHeaderService listHeaderService;
|
||||||
|
|
||||||
|
@Operation(summary = "리스트 헤더 조회")
|
||||||
|
@GetMapping("/{prjctIdx}")
|
||||||
|
public List<ListHeaderDto> getListHeader (@PathVariable Long prjctIdx) {
|
||||||
|
return listHeaderService.getHeader(prjctIdx);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "리스트 헤더 수정")
|
||||||
|
@PatchMapping("/{prjctIdx}")
|
||||||
|
public void updateListHeader (
|
||||||
|
@PathVariable Long prjctIdx,
|
||||||
|
@Valid @RequestBody List<ListHeaderDto> headerList,
|
||||||
|
RequestUserContext ctx
|
||||||
|
) {
|
||||||
|
listHeaderService.upsertHeader(prjctIdx, headerList, ctx.getUserId());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,12 +4,12 @@ import com.kri.common.datetime.DateTimeUtil;
|
|||||||
import com.kri.common.webmvc.RequestUserContext;
|
import com.kri.common.webmvc.RequestUserContext;
|
||||||
import com.kri.common.webmvc.page.PageResponseDto;
|
import com.kri.common.webmvc.page.PageResponseDto;
|
||||||
import com.kri.contact.server.common.enums.ChannelType;
|
import com.kri.contact.server.common.enums.ChannelType;
|
||||||
import com.kri.contact.server.dto.ProjectCreateRequestDto;
|
import com.kri.contact.server.dto.project.ProjectCreateRequestDto;
|
||||||
import com.kri.contact.server.dto.ProjectInfoDto;
|
import com.kri.contact.server.dto.project.ProjectInfoDto;
|
||||||
import com.kri.contact.server.dto.ProjectMainTemplateUpdateRequestDto;
|
import com.kri.contact.server.dto.project.ProjectMainTemplateUpdateRequestDto;
|
||||||
import com.kri.contact.server.dto.ProjectOwnerResponseDto;
|
import com.kri.contact.server.dto.project.ProjectOwnerResponseDto;
|
||||||
import com.kri.contact.server.dto.ProjectSearchRequestDto;
|
import com.kri.contact.server.dto.project.ProjectSearchRequestDto;
|
||||||
import com.kri.contact.server.dto.ProjectUpdateRequestDto;
|
import com.kri.contact.server.dto.project.ProjectUpdateRequestDto;
|
||||||
import com.kri.contact.server.service.FileService;
|
import com.kri.contact.server.service.FileService;
|
||||||
import com.kri.contact.server.service.ProjectService;
|
import com.kri.contact.server.service.ProjectService;
|
||||||
import com.kri.contact.server.service.SystemEventLogService;
|
import com.kri.contact.server.service.SystemEventLogService;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.kri.contact.server.controller;
|
package com.kri.contact.server.controller;
|
||||||
|
|
||||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||||
import com.kri.contact.server.dto.ResultCodeDto;
|
import com.kri.contact.server.dto.project.ResultCodeDto;
|
||||||
import com.kri.contact.server.service.ResultCodeService;
|
import com.kri.contact.server.service.ResultCodeService;
|
||||||
import com.kri.contact.server.service.SystemEventLogService;
|
import com.kri.contact.server.service.SystemEventLogService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.kri.contact.server.controller;
|
package com.kri.contact.server.controller;
|
||||||
|
|
||||||
import com.kri.common.webmvc.RequestUserContext;
|
import com.kri.common.webmvc.RequestUserContext;
|
||||||
import com.kri.contact.server.dto.RoleInfoDto;
|
import com.kri.contact.server.dto.user.RoleInfoDto;
|
||||||
import com.kri.contact.server.service.RoleService;
|
import com.kri.contact.server.service.RoleService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ package com.kri.contact.server.controller;
|
|||||||
import com.kri.common.datetime.DateTimeUtil;
|
import com.kri.common.datetime.DateTimeUtil;
|
||||||
import com.kri.common.webmvc.RequestUserContext;
|
import com.kri.common.webmvc.RequestUserContext;
|
||||||
import com.kri.contact.server.common.consts.ContactConstant;
|
import com.kri.contact.server.common.consts.ContactConstant;
|
||||||
import com.kri.contact.server.dto.DataVerificationDto;
|
import com.kri.contact.server.dto.common.DataVerificationDto;
|
||||||
import com.kri.contact.server.dto.ExcelUploadResponseDto;
|
import com.kri.contact.server.dto.excel.ExcelUploadResponseDto;
|
||||||
import com.kri.contact.server.dto.UserInfoDto;
|
import com.kri.contact.server.dto.user.UserInfoDto;
|
||||||
import com.kri.contact.server.dto.systemlog.UploadUserContentDto;
|
import com.kri.contact.server.dto.systemlog.UploadUserContentDto;
|
||||||
import com.kri.contact.server.service.SystemEventLogService;
|
import com.kri.contact.server.service.SystemEventLogService;
|
||||||
import com.kri.contact.server.service.UserService;
|
import com.kri.contact.server.service.UserService;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.kri.contact.server.dto;
|
package com.kri.contact.server.dto.auth;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.kri.contact.server.dto;
|
package com.kri.contact.server.dto.auth;
|
||||||
|
|
||||||
|
|
||||||
import com.kri.common.auth.dto.JwtUserClaimsDto;
|
import com.kri.common.auth.dto.JwtUserClaimsDto;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.kri.contact.server.dto;
|
package com.kri.contact.server.dto.common;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.kri.contact.server.dto;
|
package com.kri.contact.server.dto.excel;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
package com.kri.contact.server.dto.list;
|
||||||
|
|
||||||
|
import com.kri.contact.server.common.enums.ListHeaderGrade;
|
||||||
|
import com.kri.contact.server.common.enums.ListHeaderType;
|
||||||
|
import com.kri.contact.server.persistence.entity.TListHeaderEntity;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.NotNull.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Schema(description = "리스트 헤더")
|
||||||
|
public class ListHeaderDto {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Schema(description = "프로젝트 기본키")
|
||||||
|
private Long prjctIdx;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Schema(description = "리스트 헤더 기본키")
|
||||||
|
private Integer listHderId;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Schema(description = "리스트 헤더 순서")
|
||||||
|
private Short listHderOrder;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Schema(description = "헤더 등급")
|
||||||
|
private ListHeaderGrade listHderGrad;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Schema(description = "헤더 명")
|
||||||
|
private String listHderNm;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Schema(description = "헤더 타입")
|
||||||
|
private ListHeaderType listHderTy;
|
||||||
|
|
||||||
|
@Schema(description = "|로 이어 붙은 필터 값")
|
||||||
|
private String filterValue;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Schema(description = "필터 사용 여부")
|
||||||
|
private Boolean useFilter = false;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Schema(description = "리스트 노출 여부")
|
||||||
|
private Boolean useColView = false;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Schema(description = "면접원 노출 여부")
|
||||||
|
private Boolean useIntrvwerView = false;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Schema(description = "면접원 수정가능 여부")
|
||||||
|
private Boolean useIntrvwerEdit = false;
|
||||||
|
|
||||||
|
public static ListHeaderDto fromEntity(TListHeaderEntity entity) {
|
||||||
|
return ListHeaderDto.builder()
|
||||||
|
.prjctIdx(entity.getPrjctIdx())
|
||||||
|
.listHderId(entity.getListHderId())
|
||||||
|
.listHderOrder(entity.getListHderOrder())
|
||||||
|
.listHderGrad(ListHeaderGrade.fromCode(entity.getListHderGrad()))
|
||||||
|
.listHderNm(entity.getListHderNm())
|
||||||
|
.listHderTy(ListHeaderType.fromCode(entity.getListHderTy()))
|
||||||
|
.filterValue(entity.getFilterValue())
|
||||||
|
.useFilter(entity.getUseFilter())
|
||||||
|
.useColView(entity.getUseColView())
|
||||||
|
.useIntrvwerView(entity.getUseIntrvwerView())
|
||||||
|
.useIntrvwerEdit(entity.getUseIntrvwerEdit())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEqualHard(ListHeaderDto dto) {
|
||||||
|
return Objects.equals(listHderId, dto.listHderId) &&
|
||||||
|
Objects.equals(listHderOrder, dto.listHderOrder) &&
|
||||||
|
Objects.equals(listHderGrad, dto.listHderGrad) &&
|
||||||
|
Objects.equals(listHderNm, dto.listHderNm) &&
|
||||||
|
Objects.equals(listHderTy, dto.listHderTy);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEqualSimple(ListHeaderDto dto) {
|
||||||
|
return Objects.equals(listHderId, dto.listHderId) &&
|
||||||
|
Objects.equals(listHderGrad, dto.listHderGrad) &&
|
||||||
|
Objects.equals(listHderNm, dto.listHderNm);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.kri.contact.server.dto;
|
package com.kri.contact.server.dto.project;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.kri.contact.server.dto;
|
package com.kri.contact.server.dto.project;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.kri.contact.server.common.enums.ProjectStatus;
|
import com.kri.contact.server.common.enums.ProjectStatus;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.kri.contact.server.dto;
|
package com.kri.contact.server.dto.project;
|
||||||
|
|
||||||
import com.kri.contact.server.common.enums.ChannelType;
|
import com.kri.contact.server.common.enums.ChannelType;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.kri.contact.server.dto;
|
package com.kri.contact.server.dto.project;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.kri.contact.server.dto;
|
package com.kri.contact.server.dto.project;
|
||||||
|
|
||||||
import com.kri.common.webmvc.page.PageRequestDto;
|
import com.kri.common.webmvc.page.PageRequestDto;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.kri.contact.server.dto;
|
package com.kri.contact.server.dto.project;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.kri.contact.server.dto;
|
package com.kri.contact.server.dto.project;
|
||||||
|
|
||||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||||
import com.kri.contact.server.persistence.entity.TResultCodeEntity;
|
import com.kri.contact.server.persistence.entity.TResultCodeEntity;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.kri.contact.server.dto;
|
package com.kri.contact.server.dto.user;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.kri.contact.server.persistence.entity.TRoleEntity;
|
import com.kri.contact.server.persistence.entity.TRoleEntity;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.kri.contact.server.dto;
|
package com.kri.contact.server.dto.user;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.kri.common.datetime.DateTimeUtil;
|
import com.kri.common.datetime.DateTimeUtil;
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package com.kri.contact.server.persistence.entity;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import java.time.Instant;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@Table(name = "t_list_call_hist")
|
||||||
|
public class TListCallHistEntity {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "list_tel_hist_idx", nullable = false)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||||
|
private Long prjctIdx;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "sid", nullable = false)
|
||||||
|
private Integer sid;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "list_hder_id", nullable = false)
|
||||||
|
private Integer listHderId;
|
||||||
|
|
||||||
|
@Size(max = 64)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "dest_num", nullable = false, length = 64)
|
||||||
|
private String destNum;
|
||||||
|
|
||||||
|
@Size(max = 64)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "agent_num", nullable = false, length = 64)
|
||||||
|
private String agentNum;
|
||||||
|
|
||||||
|
@Size(max = 64)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "ani_num", nullable = false, length = 64)
|
||||||
|
private String aniNum;
|
||||||
|
|
||||||
|
@Size(max = 64)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "agent_session_id", nullable = false, length = 64)
|
||||||
|
private String agentSessionId;
|
||||||
|
|
||||||
|
@Size(max = 64)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "dest_session_id", nullable = false, length = 64)
|
||||||
|
private String destSessionId;
|
||||||
|
|
||||||
|
@Size(max = 64)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "call_ty", nullable = false, length = 64)
|
||||||
|
private String callTy;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "start_dt", nullable = false)
|
||||||
|
private Instant startDt;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "total_time", nullable = false)
|
||||||
|
private Integer totalTime;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "talk_time", nullable = false)
|
||||||
|
private Integer talkTime;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "media_server_id", nullable = false)
|
||||||
|
private Integer mediaServerId;
|
||||||
|
|
||||||
|
@Size(max = 64)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "media_server_name", nullable = false, length = 64)
|
||||||
|
private String mediaServerName;
|
||||||
|
|
||||||
|
@Size(max = 256)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "record_file_name", nullable = false, length = 256)
|
||||||
|
private String recordFileName;
|
||||||
|
|
||||||
|
@Size(max = 32)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "reg_user", nullable = false, length = 32)
|
||||||
|
private String regUser;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||||
|
@Column(name = "reg_dt", nullable = false)
|
||||||
|
private Instant regDt;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,7 +15,9 @@ import org.hibernate.Hibernate;
|
|||||||
public class TListEntityId implements Serializable {
|
public class TListEntityId implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7012247084434778447L;
|
private static final long serialVersionUID = 7012247084434778447L;
|
||||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "prjct_idx", nullable = false, columnDefinition = "int UNSIGNED not null")
|
||||||
private Long prjctIdx;
|
private Long prjctIdx;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -1,25 +1,37 @@
|
|||||||
package com.kri.contact.server.persistence.entity;
|
package com.kri.contact.server.persistence.entity;
|
||||||
|
|
||||||
|
import com.kri.contact.server.dto.list.ListHeaderDto;
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.EmbeddedId;
|
import jakarta.persistence.EmbeddedId;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.Lob;
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
|
||||||
|
@Builder
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Entity
|
@Entity
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
@Table(name = "t_list_header")
|
@Table(name = "t_list_header")
|
||||||
public class TListHeaderEntity {
|
public class TListHeaderEntity {
|
||||||
|
|
||||||
@EmbeddedId
|
@EmbeddedId
|
||||||
private TListHeaderEntityId id;
|
private TListHeaderEntityId id;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "list_hder_order", nullable = false)
|
||||||
|
private Short listHderOrder;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "list_hder_grad", nullable = false)
|
@Column(name = "list_hder_grad", nullable = false)
|
||||||
private Short listHderGrad;
|
private Short listHderGrad;
|
||||||
@@ -33,21 +45,29 @@ public class TListHeaderEntity {
|
|||||||
@Column(name = "list_hder_ty", nullable = false)
|
@Column(name = "list_hder_ty", nullable = false)
|
||||||
private Short listHderTy;
|
private Short listHderTy;
|
||||||
|
|
||||||
|
@Lob
|
||||||
|
@Column(name = "filter_value", columnDefinition = "TEXT")
|
||||||
|
private String filterValue; // |로 이어 붙은 값들
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@ColumnDefault("0")
|
||||||
@Column(name = "use_filter", nullable = false)
|
@Column(name = "use_filter", nullable = false)
|
||||||
private Boolean useFilter = false;
|
private Boolean useFilter;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "use_view", nullable = false)
|
@ColumnDefault("0")
|
||||||
private Boolean useView = false;
|
@Column(name = "use_col_view", nullable = false)
|
||||||
|
private Boolean useColView;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@ColumnDefault("0")
|
||||||
@Column(name = "use_intrvwer_view", nullable = false)
|
@Column(name = "use_intrvwer_view", nullable = false)
|
||||||
private Boolean useIntrvwerView = false;
|
private Boolean useIntrvwerView;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@ColumnDefault("0")
|
||||||
@Column(name = "use_intrvwer_edit", nullable = false)
|
@Column(name = "use_intrvwer_edit", nullable = false)
|
||||||
private Boolean useIntrvwerEdit = false;
|
private Boolean useIntrvwerEdit;
|
||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -73,4 +93,45 @@ public class TListHeaderEntity {
|
|||||||
public Integer getListHderId() {
|
public Integer getListHderId() {
|
||||||
return id.getListHderId();
|
return id.getListHderId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TListHeaderEntity copyFromDefault(
|
||||||
|
TListHeaderEntity src,
|
||||||
|
Long prjctIdx,
|
||||||
|
String regUser,
|
||||||
|
LocalDateTime regDt
|
||||||
|
) {
|
||||||
|
return TListHeaderEntity.builder()
|
||||||
|
.id(TListHeaderEntityId.create(prjctIdx, src.getListHderId()))
|
||||||
|
.listHderOrder(src.getListHderOrder())
|
||||||
|
.listHderGrad(src.getListHderGrad())
|
||||||
|
.listHderNm(src.getListHderNm())
|
||||||
|
.listHderTy(src.getListHderTy())
|
||||||
|
.filterValue(src.getFilterValue())
|
||||||
|
.useFilter(src.getUseFilter())
|
||||||
|
.useColView(src.getUseColView())
|
||||||
|
.useIntrvwerView(src.getUseIntrvwerView())
|
||||||
|
.useIntrvwerEdit(src.getUseIntrvwerEdit())
|
||||||
|
.regUser(regUser)
|
||||||
|
.regDt(regDt)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TListHeaderEntity fromDto(ListHeaderDto dto, String regUser, LocalDateTime regDt) {
|
||||||
|
return TListHeaderEntity.builder()
|
||||||
|
.id(TListHeaderEntityId.create(dto.getPrjctIdx(), dto.getListHderId()))
|
||||||
|
.listHderOrder(dto.getListHderOrder())
|
||||||
|
.listHderGrad(dto.getListHderGrad().getCode())
|
||||||
|
.listHderNm(dto.getListHderNm())
|
||||||
|
.listHderTy(dto.getListHderTy().getCode())
|
||||||
|
.filterValue(dto.getFilterValue())
|
||||||
|
.useFilter(dto.getUseFilter())
|
||||||
|
.useColView(dto.getUseColView())
|
||||||
|
.useIntrvwerView(dto.getUseIntrvwerView())
|
||||||
|
.useIntrvwerEdit(dto.getUseIntrvwerEdit())
|
||||||
|
.regUser(regUser)
|
||||||
|
.regDt(regDt)
|
||||||
|
.modUser(regUser)
|
||||||
|
.modDt(regDt)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,22 @@ import org.hibernate.Hibernate;
|
|||||||
public class TListHeaderEntityId implements Serializable {
|
public class TListHeaderEntityId implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -1296812261527497087L;
|
private static final long serialVersionUID = -1296812261527497087L;
|
||||||
@Column(name = "prjct_idx", insertable = false, updatable = false, columnDefinition = "int UNSIGNED not null")
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "prjct_idx", nullable = false, columnDefinition = "int UNSIGNED not null")
|
||||||
private Long prjctIdx;
|
private Long prjctIdx;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "list_hder_id", nullable = false)
|
@Column(name = "list_hder_id", nullable = false)
|
||||||
private Integer listHderId;
|
private Integer listHderId;
|
||||||
|
|
||||||
|
public static TListHeaderEntityId create(Long prjctIdx, Integer listHderId) {
|
||||||
|
TListHeaderEntityId id = new TListHeaderEntityId();
|
||||||
|
id.setPrjctIdx(prjctIdx);
|
||||||
|
id.setListHderId(listHderId);
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ import org.hibernate.Hibernate;
|
|||||||
public class TListItemEntityId implements Serializable {
|
public class TListItemEntityId implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3478285652359764540L;
|
private static final long serialVersionUID = -3478285652359764540L;
|
||||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "prjct_idx", nullable = false, columnDefinition = "int UNSIGNED not null")
|
||||||
private Long prjctIdx;
|
private Long prjctIdx;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ import org.hibernate.Hibernate;
|
|||||||
public class TListItemUploadEntityId implements Serializable {
|
public class TListItemUploadEntityId implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -8073832649114843758L;
|
private static final long serialVersionUID = -8073832649114843758L;
|
||||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "prjct_idx", nullable = false, columnDefinition = "int UNSIGNED not null")
|
||||||
private Long prjctIdx;
|
private Long prjctIdx;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ import org.hibernate.Hibernate;
|
|||||||
public class TPrjctAssignEntityId implements Serializable {
|
public class TPrjctAssignEntityId implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -263674621497298216L;
|
private static final long serialVersionUID = -263674621497298216L;
|
||||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "prjct_idx", nullable = false, columnDefinition = "int UNSIGNED not null")
|
||||||
private Long prjctIdx;
|
private Long prjctIdx;
|
||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package com.kri.contact.server.persistence.entity;
|
|||||||
import com.kri.common.datetime.DateTimeUtil;
|
import com.kri.common.datetime.DateTimeUtil;
|
||||||
import com.kri.contact.server.common.enums.ProjectStatus;
|
import com.kri.contact.server.common.enums.ProjectStatus;
|
||||||
import com.kri.contact.server.common.enums.SurveyType;
|
import com.kri.contact.server.common.enums.SurveyType;
|
||||||
import com.kri.contact.server.dto.ProjectCreateRequestDto;
|
import com.kri.contact.server.dto.project.ProjectCreateRequestDto;
|
||||||
import com.kri.contact.server.dto.ProjectInfoDto;
|
import com.kri.contact.server.dto.project.ProjectInfoDto;
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import jakarta.persistence.GeneratedValue;
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.kri.contact.server.persistence.entity;
|
package com.kri.contact.server.persistence.entity;
|
||||||
|
|
||||||
import com.kri.contact.server.dto.ProjectMainTemplateUpdateRequestDto;
|
import com.kri.contact.server.dto.project.ProjectMainTemplateUpdateRequestDto;
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.EmbeddedId;
|
import jakarta.persistence.EmbeddedId;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.kri.contact.server.persistence.entity;
|
|||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.Embeddable;
|
import jakarta.persistence.Embeddable;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -21,7 +22,8 @@ public class TPrjctMainTmplatEntityId implements Serializable {
|
|||||||
|
|
||||||
private static final long serialVersionUID = -263674621497298216L;
|
private static final long serialVersionUID = -263674621497298216L;
|
||||||
|
|
||||||
@Column(name = "prjct_idx", nullable = false, columnDefinition = "INT UNSIGNED")
|
@NotNull
|
||||||
|
@Column(name = "prjct_idx", nullable = false, columnDefinition = "int UNSIGNED not null")
|
||||||
private Long prjctIdx;
|
private Long prjctIdx;
|
||||||
|
|
||||||
@Column(name = "chnnl_ty", nullable = false)
|
@Column(name = "chnnl_ty", nullable = false)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.kri.contact.server.persistence.entity;
|
package com.kri.contact.server.persistence.entity;
|
||||||
|
|
||||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||||
import com.kri.contact.server.dto.ResultCodeDto;
|
import com.kri.contact.server.dto.project.ResultCodeDto;
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.EmbeddedId;
|
import jakarta.persistence.EmbeddedId;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
|
|||||||
@@ -24,7 +24,9 @@ import org.hibernate.Hibernate;
|
|||||||
public class TResultCodeEntityId implements Serializable {
|
public class TResultCodeEntityId implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -1984612223940078355L;
|
private static final long serialVersionUID = -1984612223940078355L;
|
||||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "prjct_idx", nullable = false, columnDefinition = "int UNSIGNED not null")
|
||||||
private Long prjctIdx;
|
private Long prjctIdx;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.hibernate.Hibernate;
|
|||||||
public class TRoleFuncMapEntityId implements Serializable {
|
public class TRoleFuncMapEntityId implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 5430666726716009453L;
|
private static final long serialVersionUID = 5430666726716009453L;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "role_cd", nullable = false)
|
@Column(name = "role_cd", nullable = false)
|
||||||
private Integer roleCd;
|
private Integer roleCd;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.kri.contact.server.persistence.entity;
|
package com.kri.contact.server.persistence.entity;
|
||||||
|
|
||||||
import com.kri.contact.server.common.consts.ContactConstant;
|
import com.kri.contact.server.common.consts.ContactConstant;
|
||||||
import com.kri.contact.server.dto.UserInfoDto;
|
import com.kri.contact.server.dto.user.UserInfoDto;
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import jakarta.persistence.GeneratedValue;
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.kri.contact.server.persistence.repository;
|
||||||
|
|
||||||
|
import com.kri.contact.server.common.enums.ListHeaderGrade;
|
||||||
|
import com.kri.contact.server.persistence.entity.TListHeaderEntity;
|
||||||
|
import com.kri.contact.server.persistence.entity.TListHeaderEntityId;
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface ListHeaderRepository extends JpaRepository<TListHeaderEntity, TListHeaderEntityId> {
|
||||||
|
|
||||||
|
List<TListHeaderEntity> findAllByIdPrjctIdx(Long prjctIdx);
|
||||||
|
|
||||||
|
List<TListHeaderEntity> findAllByIdPrjctIdxAndListHderGradNot(Long prjctIdx, Short listHderGrad);
|
||||||
|
|
||||||
|
default List<TListHeaderEntity> findDefaultHeader(){
|
||||||
|
return findAllByIdPrjctIdxAndListHderGradNot(0L, ListHeaderGrade.COMMON.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
long deleteAllByIdPrjctIdx(Long prjctIdx);
|
||||||
|
|
||||||
|
long deleteAllByIdPrjctIdxAndIdListHderIdNotIn(Long prjctIdx, List<Integer> listHderId);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.kri.contact.server.persistence.repository;
|
||||||
|
|
||||||
|
import com.kri.contact.server.persistence.entity.TListItemEntity;
|
||||||
|
import com.kri.contact.server.persistence.entity.TListItemEntityId;
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface ListItemRepository extends JpaRepository<TListItemEntity, TListItemEntityId> {
|
||||||
|
|
||||||
|
long deleteAllByIdPrjctIdxAndIdListHderIdNotIn(Long prjctIdx, List<Integer> listHderId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.kri.contact.server.persistence.repository;
|
||||||
|
|
||||||
|
import com.kri.contact.server.persistence.entity.TListEntity;
|
||||||
|
import com.kri.contact.server.persistence.entity.TListEntityId;
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
|
||||||
|
public interface ListRepository extends JpaRepository<TListEntity, TListEntityId>,
|
||||||
|
JpaSpecificationExecutor<TListEntity> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,13 +4,10 @@ import com.kri.contact.server.persistence.entity.TPrjctAssignEntity;
|
|||||||
import com.kri.contact.server.persistence.entity.TPrjctAssignEntityId;
|
import com.kri.contact.server.persistence.entity.TPrjctAssignEntityId;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
||||||
import org.springframework.data.jpa.repository.Modifying;
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
|
||||||
public interface ProjectAssignRepository extends
|
public interface ProjectAssignRepository extends JpaRepository<TPrjctAssignEntity, TPrjctAssignEntityId> {
|
||||||
JpaRepository<TPrjctAssignEntity, TPrjctAssignEntityId>,
|
|
||||||
JpaSpecificationExecutor<TPrjctAssignEntity> {
|
|
||||||
|
|
||||||
@Query("""
|
@Query("""
|
||||||
select a.id.userId
|
select a.id.userId
|
||||||
|
|||||||
@@ -4,11 +4,8 @@ import com.kri.contact.server.persistence.entity.TPrjctMainTmplatEntity;
|
|||||||
import com.kri.contact.server.persistence.entity.TPrjctMainTmplatEntityId;
|
import com.kri.contact.server.persistence.entity.TPrjctMainTmplatEntityId;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
||||||
|
|
||||||
public interface ProjectMainTemplateRepository extends
|
public interface ProjectMainTemplateRepository extends JpaRepository<TPrjctMainTmplatEntity, TPrjctMainTmplatEntityId> {
|
||||||
JpaRepository<TPrjctMainTmplatEntity, TPrjctMainTmplatEntityId>,
|
|
||||||
JpaSpecificationExecutor<TPrjctMainTmplatEntity> {
|
|
||||||
|
|
||||||
Optional<TPrjctMainTmplatEntity> findByIdPrjctIdxAndIdChnnlTy(Long prjctIdx, Short chnnlTy);
|
Optional<TPrjctMainTmplatEntity> findByIdPrjctIdxAndIdChnnlTy(Long prjctIdx, Short chnnlTy);
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|||||||
import org.springframework.data.jpa.repository.Modifying;
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
|
||||||
|
//JpaSpecificationExecutor Specification<T> spec, Pageable pageable 사용시 필요
|
||||||
public interface ProjectRepository extends JpaRepository<TPrjctEntity, Long>,
|
public interface ProjectRepository extends JpaRepository<TPrjctEntity, Long>,
|
||||||
JpaSpecificationExecutor<TPrjctEntity> {
|
JpaSpecificationExecutor<TPrjctEntity> {
|
||||||
|
|
||||||
|
|||||||
@@ -6,11 +6,9 @@ import com.kri.contact.server.persistence.entity.TResultCodeEntity;
|
|||||||
import com.kri.contact.server.persistence.entity.TResultCodeEntityId;
|
import com.kri.contact.server.persistence.entity.TResultCodeEntityId;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
|
||||||
public interface ResultCodeRepository extends JpaRepository<TResultCodeEntity, TResultCodeEntityId>,
|
public interface ResultCodeRepository extends JpaRepository<TResultCodeEntity, TResultCodeEntityId> {
|
||||||
JpaSpecificationExecutor<TResultCodeEntity> {
|
|
||||||
|
|
||||||
@Query("""
|
@Query("""
|
||||||
select r
|
select r
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ package com.kri.contact.server.persistence.repository;
|
|||||||
import com.kri.contact.server.persistence.entity.TRoleEntity;
|
import com.kri.contact.server.persistence.entity.TRoleEntity;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
||||||
|
|
||||||
public interface RoleRepository extends JpaRepository<TRoleEntity, Integer>,
|
public interface RoleRepository extends JpaRepository<TRoleEntity, Integer> {
|
||||||
JpaSpecificationExecutor<TRoleEntity> {
|
|
||||||
|
|
||||||
List<TRoleEntity> findByRoleCdGreaterThanEqual(Integer roleCd);
|
List<TRoleEntity> findByRoleCdGreaterThanEqual(Integer roleCd);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,7 @@ package com.kri.contact.server.persistence.repository;
|
|||||||
|
|
||||||
import com.kri.contact.server.persistence.entity.TSysEventLogEntity;
|
import com.kri.contact.server.persistence.entity.TSysEventLogEntity;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
||||||
|
|
||||||
public interface SystemEventLogRepository extends JpaRepository<TSysEventLogEntity, Long>,
|
public interface SystemEventLogRepository extends JpaRepository<TSysEventLogEntity, Long> {
|
||||||
JpaSpecificationExecutor<TSysEventLogEntity> {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,12 +5,10 @@ import java.time.LocalDateTime;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
||||||
import org.springframework.data.jpa.repository.Modifying;
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
|
||||||
public interface UserRepository extends JpaRepository<TUserEntity, Long>,
|
public interface UserRepository extends JpaRepository<TUserEntity, Long> {
|
||||||
JpaSpecificationExecutor<TUserEntity> {
|
|
||||||
|
|
||||||
Optional<TUserEntity> findByUserIdAndUserPwAndDelFalse(String userId, String userPw);
|
Optional<TUserEntity> findByUserIdAndUserPwAndDelFalse(String userId, String userPw);
|
||||||
|
|
||||||
@@ -20,8 +18,7 @@ public interface UserRepository extends JpaRepository<TUserEntity, Long>,
|
|||||||
|
|
||||||
List<TUserEntity> findByUserRoleGreaterThanEqualAndDelFalse(Integer userRoleCd);
|
List<TUserEntity> findByUserRoleGreaterThanEqualAndDelFalse(Integer userRoleCd);
|
||||||
|
|
||||||
List<TUserEntity> findByUserCmpnAndUserRoleGreaterThanEqualAndDelFalse(String userCmpn,
|
List<TUserEntity> findByUserCmpnAndUserRoleGreaterThanEqualAndDelFalse(String userCmpn, Integer userRoleCd);
|
||||||
Integer userRoleCd);
|
|
||||||
|
|
||||||
@Query("""
|
@Query("""
|
||||||
select u
|
select u
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import com.kri.common.auth.dto.JwtUserClaimsDto;
|
|||||||
import com.kri.common.auth.jwt.JwtService;
|
import com.kri.common.auth.jwt.JwtService;
|
||||||
import com.kri.contact.server.common.external.intranet.IntranetExtensionApiClient;
|
import com.kri.contact.server.common.external.intranet.IntranetExtensionApiClient;
|
||||||
import com.kri.contact.server.common.external.intranet.SearchLoginInfoResponseDto;
|
import com.kri.contact.server.common.external.intranet.SearchLoginInfoResponseDto;
|
||||||
import com.kri.contact.server.dto.LoginRequestDto;
|
import com.kri.contact.server.dto.auth.LoginRequestDto;
|
||||||
import com.kri.contact.server.dto.LoginResponseDto;
|
import com.kri.contact.server.dto.auth.LoginResponseDto;
|
||||||
import com.kri.contact.server.persistence.entity.TUserEntity;
|
import com.kri.contact.server.persistence.entity.TUserEntity;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package com.kri.contact.server.service;
|
||||||
|
|
||||||
|
import com.kri.common.datetime.DateTimeUtil;
|
||||||
|
import com.kri.common.web.BusinessException;
|
||||||
|
import com.kri.contact.server.common.enums.ListHeaderGrade;
|
||||||
|
import com.kri.contact.server.dto.list.ListHeaderDto;
|
||||||
|
import com.kri.contact.server.persistence.entity.TListHeaderEntity;
|
||||||
|
import com.kri.contact.server.persistence.repository.ListHeaderRepository;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ListHeaderService {
|
||||||
|
|
||||||
|
private final ListHeaderRepository listHeaderRepository;
|
||||||
|
private final ListItemService listItemService;
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void copyDefaultHeader(Long prjctIdx, String regUser, LocalDateTime regDt) {
|
||||||
|
|
||||||
|
listHeaderRepository.deleteAllByIdPrjctIdx(prjctIdx);
|
||||||
|
|
||||||
|
List<TListHeaderEntity> defaultHeaderList = listHeaderRepository.findDefaultHeader()
|
||||||
|
.stream()
|
||||||
|
.map(src -> TListHeaderEntity.copyFromDefault(src, prjctIdx, regUser, regDt))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
listHeaderRepository.saveAll(defaultHeaderList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ListHeaderDto> getHeader(Long prjctIdx) {
|
||||||
|
List<TListHeaderEntity> headerEntityList = listHeaderRepository.findAllByIdPrjctIdx(prjctIdx);
|
||||||
|
|
||||||
|
return headerEntityList.stream()
|
||||||
|
.map(ListHeaderDto::fromEntity)
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void upsertHeader(Long prjctIdx, List<ListHeaderDto> headerList, String regUser) {
|
||||||
|
LocalDateTime regDt = DateTimeUtil.nowKstLocalDateTime();
|
||||||
|
|
||||||
|
//headerList에 ListHeaderGrade.IMMUTABLE, ListHeaderGrade.DEFAULT 헤더가 있는지 확인
|
||||||
|
List<ListHeaderDto> defaultHeaderList = listHeaderRepository.findDefaultHeader()
|
||||||
|
.stream().map(ListHeaderDto::fromEntity).toList();
|
||||||
|
|
||||||
|
List<ListHeaderDto> extractDefault = headerList.stream()
|
||||||
|
.filter(h -> !Objects.equals(h.getListHderGrad(), ListHeaderGrade.COMMON))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
if(!isEqualHeader(defaultHeaderList, extractDefault, true)){
|
||||||
|
throw BusinessException.badRequest("WRONG_DEFAULT","기본 헤더가 잘못 됐습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
//headerList에 없는 헤더는 삭제
|
||||||
|
List<Integer> headerIdList = headerList.stream().map(ListHeaderDto::getListHderId).toList();
|
||||||
|
listHeaderRepository.deleteAllByIdPrjctIdxAndIdListHderIdNotIn(prjctIdx, headerIdList);
|
||||||
|
|
||||||
|
//없는 정보에 대해서 리스트 아이템 삭제
|
||||||
|
listItemService.deleteHderIdNotIn(prjctIdx, headerIdList);
|
||||||
|
|
||||||
|
//ListHeaderGrade.IMMUTABLE 헤더를 제외한 헤더 저장
|
||||||
|
List<TListHeaderEntity> headerEntityList = headerList.stream()
|
||||||
|
.filter(h -> !Objects.equals(h.getListHderGrad(), ListHeaderGrade.IMMUTABLE))
|
||||||
|
.map((ListHeaderDto dto) -> TListHeaderEntity.fromDto(dto, regUser, regDt))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
listHeaderRepository.saveAll(headerEntityList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEqualHeader(List<ListHeaderDto> origin, List<ListHeaderDto> target, boolean simpleMode){
|
||||||
|
|
||||||
|
if(origin.size() != target.size()){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Function<ListHeaderDto, Predicate<ListHeaderDto>> predFunc =
|
||||||
|
simpleMode
|
||||||
|
? o -> t -> t.isEqualSimple(o)
|
||||||
|
: o -> t -> t.isEqualHard(o);
|
||||||
|
|
||||||
|
for(ListHeaderDto o : origin){
|
||||||
|
if (target.stream().noneMatch(predFunc.apply(o))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.kri.contact.server.service;
|
||||||
|
|
||||||
|
import com.kri.contact.server.persistence.repository.ListItemRepository;
|
||||||
|
import java.util.List;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ListItemService {
|
||||||
|
|
||||||
|
private final ListItemRepository listItemRepository;
|
||||||
|
|
||||||
|
public long deleteHderIdNotIn(Long prjctIdx, List<Integer> listHderId){
|
||||||
|
return listItemRepository.deleteAllByIdPrjctIdxAndIdListHderIdNotIn(prjctIdx, listHderId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.kri.contact.server.service;
|
||||||
|
|
||||||
|
import com.kri.contact.server.persistence.repository.ListRepository;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ListService {
|
||||||
|
|
||||||
|
private final ListRepository listRepository;
|
||||||
|
private final ListItemService listItemService;
|
||||||
|
private final ListHeaderService listHeaderService;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,12 +5,12 @@ import com.kri.common.webmvc.page.PageRequestDto;
|
|||||||
import com.kri.common.webmvc.page.PageResponseDto;
|
import com.kri.common.webmvc.page.PageResponseDto;
|
||||||
import com.kri.common.webmvc.page.Pageables;
|
import com.kri.common.webmvc.page.Pageables;
|
||||||
import com.kri.contact.server.common.consts.ContactConstant;
|
import com.kri.contact.server.common.consts.ContactConstant;
|
||||||
import com.kri.contact.server.dto.ProjectCreateRequestDto;
|
import com.kri.contact.server.dto.project.ProjectCreateRequestDto;
|
||||||
import com.kri.contact.server.dto.ProjectInfoDto;
|
import com.kri.contact.server.dto.project.ProjectInfoDto;
|
||||||
import com.kri.contact.server.dto.ProjectMainTemplateUpdateRequestDto;
|
import com.kri.contact.server.dto.project.ProjectMainTemplateUpdateRequestDto;
|
||||||
import com.kri.contact.server.dto.ProjectOwnerResponseDto;
|
import com.kri.contact.server.dto.project.ProjectOwnerResponseDto;
|
||||||
import com.kri.contact.server.dto.ProjectSearchRequestDto;
|
import com.kri.contact.server.dto.project.ProjectSearchRequestDto;
|
||||||
import com.kri.contact.server.dto.ProjectUpdateRequestDto;
|
import com.kri.contact.server.dto.project.ProjectUpdateRequestDto;
|
||||||
import com.kri.contact.server.persistence.entity.TPrjctEntity;
|
import com.kri.contact.server.persistence.entity.TPrjctEntity;
|
||||||
import com.kri.contact.server.persistence.entity.TPrjctMainTmplatEntity;
|
import com.kri.contact.server.persistence.entity.TPrjctMainTmplatEntity;
|
||||||
import com.kri.contact.server.persistence.query.ProjectSpecs;
|
import com.kri.contact.server.persistence.query.ProjectSpecs;
|
||||||
@@ -39,12 +39,16 @@ public class ProjectService {
|
|||||||
private static final List<Short> STATUS_1 = List.of((short) 1);
|
private static final List<Short> STATUS_1 = List.of((short) 1);
|
||||||
private final AssignService assignService;
|
private final AssignService assignService;
|
||||||
private final ResultCodeService resultCodeService;
|
private final ResultCodeService resultCodeService;
|
||||||
|
private final ListHeaderService listHeaderService;
|
||||||
private final ProjectRepository projectRepository;
|
private final ProjectRepository projectRepository;
|
||||||
private final ProjectMainTemplateRepository projectMainTemplateRepository;
|
private final ProjectMainTemplateRepository projectMainTemplateRepository;
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public ProjectInfoDto createProject(ProjectCreateRequestDto req, String regUser,
|
public ProjectInfoDto createProject(
|
||||||
LocalDateTime regDt) {
|
ProjectCreateRequestDto req,
|
||||||
|
String regUser,
|
||||||
|
LocalDateTime regDt
|
||||||
|
) {
|
||||||
String itrnt = req.getItrntPrjctCd();
|
String itrnt = req.getItrntPrjctCd();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -54,6 +58,8 @@ public class ProjectService {
|
|||||||
ProjectInfoDto savedProject = ProjectInfoDto.from(projectRepository.save(entity));
|
ProjectInfoDto savedProject = ProjectInfoDto.from(projectRepository.save(entity));
|
||||||
resultCodeService.copyResultCodeFromDefault(savedProject.getPrjctIdx(), regUser, regDt);
|
resultCodeService.copyResultCodeFromDefault(savedProject.getPrjctIdx(), regUser, regDt);
|
||||||
|
|
||||||
|
listHeaderService.copyDefaultHeader(savedProject.getPrjctIdx(), regUser, regDt);
|
||||||
|
|
||||||
return savedProject;
|
return savedProject;
|
||||||
} catch (DataIntegrityViolationException e) {
|
} catch (DataIntegrityViolationException e) {
|
||||||
throw BusinessException.conflict(
|
throw BusinessException.conflict(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.kri.contact.server.service;
|
package com.kri.contact.server.service;
|
||||||
|
|
||||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||||
import com.kri.contact.server.dto.ResultCodeDto;
|
import com.kri.contact.server.dto.project.ResultCodeDto;
|
||||||
import com.kri.contact.server.persistence.entity.TResultCodeEntity;
|
import com.kri.contact.server.persistence.entity.TResultCodeEntity;
|
||||||
import com.kri.contact.server.persistence.repository.ResultCodeRepository;
|
import com.kri.contact.server.persistence.repository.ResultCodeRepository;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.kri.contact.server.service;
|
package com.kri.contact.server.service;
|
||||||
|
|
||||||
import com.kri.contact.server.common.consts.ContactConstant;
|
import com.kri.contact.server.common.consts.ContactConstant;
|
||||||
import com.kri.contact.server.dto.RoleInfoDto;
|
import com.kri.contact.server.dto.user.RoleInfoDto;
|
||||||
import com.kri.contact.server.persistence.repository.RoleRepository;
|
import com.kri.contact.server.persistence.repository.RoleRepository;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|||||||
@@ -4,10 +4,11 @@ import static com.kri.common.json.JsonUtil.toMap;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.kri.contact.server.common.enums.SystemEventType;
|
import com.kri.contact.server.common.enums.SystemEventType;
|
||||||
import com.kri.contact.server.dto.ProjectCreateRequestDto;
|
import com.kri.contact.server.dto.list.ListHeaderDto;
|
||||||
import com.kri.contact.server.dto.ProjectMainTemplateUpdateRequestDto;
|
import com.kri.contact.server.dto.project.ProjectCreateRequestDto;
|
||||||
import com.kri.contact.server.dto.ProjectUpdateRequestDto;
|
import com.kri.contact.server.dto.project.ProjectMainTemplateUpdateRequestDto;
|
||||||
import com.kri.contact.server.dto.UserInfoDto;
|
import com.kri.contact.server.dto.project.ProjectUpdateRequestDto;
|
||||||
|
import com.kri.contact.server.dto.user.UserInfoDto;
|
||||||
import com.kri.contact.server.dto.systemlog.UploadUserContentDto;
|
import com.kri.contact.server.dto.systemlog.UploadUserContentDto;
|
||||||
import com.kri.contact.server.persistence.entity.TSysEventLogEntity;
|
import com.kri.contact.server.persistence.entity.TSysEventLogEntity;
|
||||||
import com.kri.contact.server.persistence.repository.SystemEventLogRepository;
|
import com.kri.contact.server.persistence.repository.SystemEventLogRepository;
|
||||||
@@ -128,6 +129,20 @@ public class SystemEventLogService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void writeUpsertListHeader(String regId, LocalDateTime regDt, String clientIp,
|
||||||
|
Long prjctIdx, List<ListHeaderDto> headerList) {
|
||||||
|
writeSystemLog(
|
||||||
|
SystemEventType.UPSERT_LIST_HEADER,
|
||||||
|
"Upsert List Header",
|
||||||
|
prjctIdx,
|
||||||
|
regId,
|
||||||
|
regDt,
|
||||||
|
clientIp,
|
||||||
|
"listHeader",
|
||||||
|
headerList
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
protected <T> void writeSystemLog(
|
protected <T> void writeSystemLog(
|
||||||
SystemEventType eventType,
|
SystemEventType eventType,
|
||||||
String title,
|
String title,
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import com.kri.common.web.BusinessException;
|
|||||||
import com.kri.contact.server.common.consts.ContactConstant;
|
import com.kri.contact.server.common.consts.ContactConstant;
|
||||||
import com.kri.contact.server.common.external.intranet.IntranetExtensionApiClient;
|
import com.kri.contact.server.common.external.intranet.IntranetExtensionApiClient;
|
||||||
import com.kri.contact.server.common.util.ExcelUploadResultUtil;
|
import com.kri.contact.server.common.util.ExcelUploadResultUtil;
|
||||||
import com.kri.contact.server.dto.DataVerificationDto;
|
import com.kri.contact.server.dto.common.DataVerificationDto;
|
||||||
import com.kri.contact.server.dto.ExcelUploadResponseDto;
|
import com.kri.contact.server.dto.excel.ExcelUploadResponseDto;
|
||||||
import com.kri.contact.server.dto.RoleInfoDto;
|
import com.kri.contact.server.dto.user.RoleInfoDto;
|
||||||
import com.kri.contact.server.dto.UserInfoDto;
|
import com.kri.contact.server.dto.user.UserInfoDto;
|
||||||
import com.kri.contact.server.dto.excel.UserUploadDto;
|
import com.kri.contact.server.dto.excel.UserUploadDto;
|
||||||
import com.kri.contact.server.dto.excel.UserUploadErrorDto;
|
import com.kri.contact.server.dto.excel.UserUploadErrorDto;
|
||||||
import com.kri.contact.server.persistence.entity.TUserEntity;
|
import com.kri.contact.server.persistence.entity.TUserEntity;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ kri:
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
#private 도메인
|
#private 도메인
|
||||||
url: jdbc:mysql://db-md87m-kr.vpc-pub-cdb.ntruss.com:3306/test_kri_contact?characterEncoding=UTF-8
|
url: jdbc:mysql://db-md87m-kr.vpc-pub-cdb.ntruss.com:3306/test_kri_contact?characterEncoding=UTF-8&rewriteBatchedStatements=true
|
||||||
username: kri_contact
|
username: kri_contact
|
||||||
password: contact#51304
|
password: contact#51304
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
@@ -6,7 +6,7 @@ kri:
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
#public 도메인
|
#public 도메인
|
||||||
url: jdbc:mysql://db-md87m-kr.vpc-pub-cdb.ntruss.com:3306/test_kri_contact?characterEncoding=UTF-8
|
url: jdbc:mysql://db-md87m-kr.vpc-pub-cdb.ntruss.com:3306/test_kri_contact?characterEncoding=UTF-8&rewriteBatchedStatements=true
|
||||||
username: kri_contact
|
username: kri_contact
|
||||||
password: contact#51304
|
password: contact#51304
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ kri:
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
#private 도메인
|
#private 도메인
|
||||||
url: jdbc:mysql://db-md87m-kr.vpc-pub-cdb.ntruss.com:3306/test_kri_contact?characterEncoding=UTF-8
|
url: jdbc:mysql://db-md87m-kr.vpc-pub-cdb.ntruss.com:3306/test_kri_contact?characterEncoding=UTF-8&rewriteBatchedStatements=true
|
||||||
username: kri_contact
|
username: kri_contact
|
||||||
password: contact#51304
|
password: contact#51304
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
@@ -5,6 +5,13 @@ server:
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: contact-server
|
name: contact-server
|
||||||
|
jpa:
|
||||||
|
properties:
|
||||||
|
hibernate:
|
||||||
|
jdbc:
|
||||||
|
batch_size: 1000
|
||||||
|
order_inserts: true
|
||||||
|
order_updates: true
|
||||||
|
|
||||||
profiles:
|
profiles:
|
||||||
# 아무 설정 없을 때 기본으로 쓸 프로파일
|
# 아무 설정 없을 때 기본으로 쓸 프로파일
|
||||||
|
|||||||
Reference in New Issue
Block a user