251222_01_FIX : 변수명 변경 및 Entity 생성 모두 빌더 타입으로 교체
This commit is contained in:
@@ -38,7 +38,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "com.kri.common:starter:beta.1.0.53"
|
implementation "com.kri.common:starter:beta.1.0.54"
|
||||||
|
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||||
@@ -50,6 +50,9 @@ dependencies {
|
|||||||
|
|
||||||
//JPA
|
//JPA
|
||||||
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
|
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
|
||||||
|
//Entity Json <-> Class 파싱용
|
||||||
|
implementation "io.hypersistence:hypersistence-utils-hibernate-62:3.9.4"
|
||||||
|
|
||||||
//MySQL
|
//MySQL
|
||||||
runtimeOnly "com.mysql:mysql-connector-j"
|
runtimeOnly "com.mysql:mysql-connector-j"
|
||||||
// QueryDSL JPA
|
// QueryDSL JPA
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.kri.contact.server.common.consts;
|
package com.kri.contact.server.common.consts;
|
||||||
|
|
||||||
public final class AppConstant {
|
public final class ContactConstant {
|
||||||
private AppConstant(){}
|
private ContactConstant(){}
|
||||||
|
|
||||||
public static final String DEFAULT_COMPANY_NAME = "KRI";
|
public static final String DEFAULT_COMPANY_NAME = "KRI";
|
||||||
|
|
||||||
@@ -3,23 +3,17 @@ package com.kri.contact.server.common.enums;
|
|||||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
import com.kri.common.enums.CodeEnum;
|
import com.kri.common.enums.CodeEnum;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Getter(onMethod_ = @JsonValue) // Lombok이 생성하는 getCode()에 @JsonValue 부착
|
||||||
|
@RequiredArgsConstructor
|
||||||
public enum ProjectStatus implements CodeEnum<Short> {
|
public enum ProjectStatus implements CodeEnum<Short> {
|
||||||
STANDBY((short) 0), // 대기
|
STANDBY((short) 0), // 대기
|
||||||
PROGRESS((short) 1), // 진행
|
PROGRESS((short) 1), // 진행
|
||||||
COMPELETE((short) 10); // 완료
|
COMPELETE((short) 10); // 완료
|
||||||
|
|
||||||
private final short code;
|
private final Short code;
|
||||||
|
|
||||||
ProjectStatus(short code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@JsonValue
|
|
||||||
public Short getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||||
public static ProjectStatus fromCode(Short code) {
|
public static ProjectStatus fromCode(Short code) {
|
||||||
|
|||||||
@@ -3,24 +3,18 @@ package com.kri.contact.server.common.enums;
|
|||||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
import com.kri.common.enums.CodeEnum;
|
import com.kri.common.enums.CodeEnum;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Getter(onMethod_ = @JsonValue)
|
||||||
|
@RequiredArgsConstructor
|
||||||
public enum ResultCodeType implements CodeEnum<Short> {
|
public enum ResultCodeType implements CodeEnum<Short> {
|
||||||
|
|
||||||
CONTACT((short) 0), // 컨택 결과코드
|
CONTACT((short) 0), // 컨택 결과코드
|
||||||
INTERVIEW((short) 1), // 면접 결과코드
|
INTERVIEW((short) 1), // 면접 결과코드
|
||||||
SURVEY((short) 2); // 설문 결과코드
|
SURVEY((short) 2); // 설문 결과코드
|
||||||
|
|
||||||
private final short code;
|
private final Short code;
|
||||||
|
|
||||||
ResultCodeType(short code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@JsonValue
|
|
||||||
public Short getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||||
public static ResultCodeType fromCode(Short code) {
|
public static ResultCodeType fromCode(Short code) {
|
||||||
|
|||||||
@@ -3,24 +3,18 @@ package com.kri.contact.server.common.enums;
|
|||||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
import com.kri.common.enums.CodeEnum;
|
import com.kri.common.enums.CodeEnum;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Getter(onMethod_ = @JsonValue)
|
||||||
|
@RequiredArgsConstructor
|
||||||
public enum SurveyType implements CodeEnum<Short> {
|
public enum SurveyType implements CodeEnum<Short> {
|
||||||
NONE((short) 0), // 없음
|
NONE((short) 0), // 없음
|
||||||
KON((short) 1), // KON
|
KON((short) 1), // KON
|
||||||
KIWI((short) 2), // KIWI
|
KIWI((short) 2), // KIWI
|
||||||
EXTERNAL((short) 99); // 외부
|
EXTERNAL((short) 99); // 외부
|
||||||
|
|
||||||
private final short code;
|
private final Short code;
|
||||||
|
|
||||||
SurveyType(short code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@JsonValue
|
|
||||||
public Short getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||||
public static SurveyType fromCode(Short code) {
|
public static SurveyType fromCode(Short code) {
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
package com.kri.contact.server.common.enums;
|
package com.kri.contact.server.common.enums;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
import com.kri.common.enums.CodeEnum;
|
import com.kri.common.enums.CodeEnum;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@RequiredArgsConstructor
|
||||||
public enum SystemEventType implements CodeEnum<Short> {
|
public enum SystemEventType implements CodeEnum<Short> {
|
||||||
LOGIN((short) 11), // 로그인
|
LOGIN((short) 11), // 로그인
|
||||||
LOGOUT((short) 11), // 로그 아웃
|
LOGOUT((short) 11), // 로그 아웃
|
||||||
@@ -20,14 +25,5 @@ public enum SystemEventType implements CodeEnum<Short> {
|
|||||||
UPDATE_ROLE((short) 42), // 권한 수정
|
UPDATE_ROLE((short) 42), // 권한 수정
|
||||||
DELETE_ROLE((short) 43); // 권한 삭제
|
DELETE_ROLE((short) 43); // 권한 삭제
|
||||||
|
|
||||||
private final short code;
|
private final Short code;
|
||||||
|
|
||||||
SystemEventType(short code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Short getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.common.consts.AppConstant;
|
import com.kri.contact.server.common.consts.ContactConstant;
|
||||||
import com.kri.contact.server.dto.DataVerificationDto;
|
import com.kri.contact.server.dto.DataVerificationDto;
|
||||||
import com.kri.contact.server.dto.ExcelUploadResponseDto;
|
import com.kri.contact.server.dto.ExcelUploadResponseDto;
|
||||||
import com.kri.contact.server.dto.UserInfoDto;
|
import com.kri.contact.server.dto.UserInfoDto;
|
||||||
@@ -40,7 +40,7 @@ public class UserController {
|
|||||||
@GetMapping()
|
@GetMapping()
|
||||||
public List<UserInfoDto> getUserList(RequestUserContext ctx){
|
public List<UserInfoDto> getUserList(RequestUserContext ctx){
|
||||||
String searchCmpn = ctx.getUserCmpn();
|
String searchCmpn = ctx.getUserCmpn();
|
||||||
if(ctx.getUserRole() < AppConstant.OUTSOURCE_USER_ROLE){
|
if(ctx.getUserRole() < ContactConstant.OUTSOURCE_USER_ROLE){
|
||||||
return userService.getUserList();
|
return userService.getUserList();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -51,7 +51,7 @@ public class UserController {
|
|||||||
@GetMapping("fieldwork")
|
@GetMapping("fieldwork")
|
||||||
public List<UserInfoDto> getFiledoworkUserList(RequestUserContext ctx){
|
public List<UserInfoDto> getFiledoworkUserList(RequestUserContext ctx){
|
||||||
String searchCmpn = ctx.getUserCmpn();
|
String searchCmpn = ctx.getUserCmpn();
|
||||||
if(ctx.getUserRole() < AppConstant.OUTSOURCE_USER_ROLE){
|
if(ctx.getUserRole() < ContactConstant.OUTSOURCE_USER_ROLE){
|
||||||
searchCmpn = "";
|
searchCmpn = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ public class UserController {
|
|||||||
|
|
||||||
@GetMapping("cmpn")
|
@GetMapping("cmpn")
|
||||||
public List<String> getUserCmpnList(RequestUserContext ctx){
|
public List<String> getUserCmpnList(RequestUserContext ctx){
|
||||||
if(ctx.getUserRole() < AppConstant.OUTSOURCE_USER_ROLE){
|
if(ctx.getUserRole() < ContactConstant.OUTSOURCE_USER_ROLE){
|
||||||
return userService.getUserCmpnList();
|
return userService.getUserCmpnList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ public class UserController {
|
|||||||
String regId = ctx.getUserId();
|
String regId = ctx.getUserId();
|
||||||
String clientIp = ctx.getClientIp();
|
String clientIp = ctx.getClientIp();
|
||||||
//외주사급이 업로드로 계정을 생성하는 경우 자신의 회사명으로 고정
|
//외주사급이 업로드로 계정을 생성하는 경우 자신의 회사명으로 고정
|
||||||
String forceCmpn = ctx.getUserRole() < AppConstant.OUTSOURCE_USER_ROLE? "" : ctx.getUserCmpn();
|
String forceCmpn = ctx.getUserRole() < ContactConstant.OUTSOURCE_USER_ROLE? "" : ctx.getUserCmpn();
|
||||||
|
|
||||||
ExcelUploadResponseDto result = userService.createUsersFromExcel(file, regId, forceCmpn);
|
ExcelUploadResponseDto result = userService.createUsersFromExcel(file, regId, forceCmpn);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ package com.kri.contact.server.dto.excel;
|
|||||||
import com.kri.common.excel.ExcelColumn;
|
import com.kri.common.excel.ExcelColumn;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@SuperBuilder
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class ExcelErrorDto {
|
public class ExcelErrorDto {
|
||||||
@@ -18,10 +20,10 @@ public class ExcelErrorDto {
|
|||||||
private String errorMessage;
|
private String errorMessage;
|
||||||
|
|
||||||
public static ExcelErrorDto of(int rowNumber, String fieldName, String errorMessage) {
|
public static ExcelErrorDto of(int rowNumber, String fieldName, String errorMessage) {
|
||||||
ExcelErrorDto dto = new ExcelErrorDto();
|
return ExcelErrorDto.builder()
|
||||||
dto.setRowNumber(rowNumber);
|
.rowNumber(rowNumber)
|
||||||
dto.setFieldName(fieldName);
|
.fieldName(fieldName)
|
||||||
dto.setErrorMessage(errorMessage);
|
.errorMessage(errorMessage)
|
||||||
return dto;
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
package com.kri.contact.server.dto.excel;
|
package com.kri.contact.server.dto.excel;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@SuperBuilder
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
|
||||||
public class UserUploadErrorDto extends ExcelErrorDto {
|
public class UserUploadErrorDto extends ExcelErrorDto {
|
||||||
|
|
||||||
public static UserUploadErrorDto of(int rowNumber, String fieldName, String errorMessage) {
|
public static UserUploadErrorDto of(int rowNumber, String fieldName, String errorMessage) {
|
||||||
UserUploadErrorDto dto = new UserUploadErrorDto();
|
return UserUploadErrorDto.builder()
|
||||||
dto.setRowNumber(rowNumber);
|
.rowNumber(rowNumber)
|
||||||
dto.setFieldName(fieldName);
|
.fieldName(fieldName)
|
||||||
dto.setErrorMessage(errorMessage);
|
.errorMessage(errorMessage)
|
||||||
return dto;
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,21 +30,19 @@ public class TListEntity {
|
|||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "reg_user", nullable = false, length = 32)
|
@Column(name = "reg_user", nullable = false, length = 32, updatable = false)
|
||||||
private String regUser;
|
private String regUser;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||||
@Column(name = "reg_dt", nullable = false)
|
@Column(name = "reg_dt", nullable = false, updatable = false)
|
||||||
private LocalDateTime regDt;
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
@NotNull
|
@Column(name = "mod_user", length = 32, insertable = false)
|
||||||
@Column(name = "mod_user", nullable = false, length = 32)
|
|
||||||
private String modUser;
|
private String modUser;
|
||||||
|
|
||||||
@NotNull
|
@Column(name = "mod_dt", insertable = false)
|
||||||
@Column(name = "mod_dt", nullable = false)
|
|
||||||
private LocalDateTime modDt;
|
private LocalDateTime modDt;
|
||||||
|
|
||||||
public Long getPrjctIdx(){
|
public Long getPrjctIdx(){
|
||||||
|
|||||||
@@ -51,21 +51,19 @@ public class TListHeaderEntity {
|
|||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "reg_user", nullable = false, length = 32)
|
@Column(name = "reg_user", nullable = false, length = 32, updatable = false)
|
||||||
private String regUser;
|
private String regUser;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||||
@Column(name = "reg_dt", nullable = false)
|
@Column(name = "reg_dt", nullable = false, updatable = false)
|
||||||
private LocalDateTime regDt;
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
@NotNull
|
@Column(name = "mod_user", length = 32, insertable = false)
|
||||||
@Column(name = "mod_user", nullable = false, length = 32)
|
|
||||||
private String modUser;
|
private String modUser;
|
||||||
|
|
||||||
@NotNull
|
@Column(name = "mod_dt", insertable = false)
|
||||||
@Column(name = "mod_dt", nullable = false)
|
|
||||||
private LocalDateTime modDt;
|
private LocalDateTime modDt;
|
||||||
|
|
||||||
public Long getPrjctIdx(){
|
public Long getPrjctIdx(){
|
||||||
|
|||||||
@@ -24,21 +24,19 @@ public class TListItemEntity {
|
|||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "reg_user", nullable = false, length = 32)
|
@Column(name = "reg_user", nullable = false, length = 32, updatable = false)
|
||||||
private String regUser;
|
private String regUser;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||||
@Column(name = "reg_dt", nullable = false)
|
@Column(name = "reg_dt", nullable = false, updatable = false)
|
||||||
private LocalDateTime regDt;
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
@NotNull
|
@Column(name = "mod_user", length = 32, insertable = false)
|
||||||
@Column(name = "mod_user", nullable = false, length = 32)
|
|
||||||
private String modUser;
|
private String modUser;
|
||||||
|
|
||||||
@NotNull
|
@Column(name = "mod_dt", insertable = false)
|
||||||
@Column(name = "mod_dt", nullable = false)
|
|
||||||
private LocalDateTime modDt;
|
private LocalDateTime modDt;
|
||||||
|
|
||||||
public Long getPrjctIdx(){
|
public Long getPrjctIdx(){
|
||||||
|
|||||||
@@ -33,21 +33,19 @@ public class TListItemUploadEntity {
|
|||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "reg_user", nullable = false, length = 32)
|
@Column(name = "reg_user", nullable = false, length = 32, updatable = false)
|
||||||
private String regUser;
|
private String regUser;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||||
@Column(name = "reg_dt", nullable = false)
|
@Column(name = "reg_dt", nullable = false, updatable = false)
|
||||||
private LocalDateTime regDt;
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
@NotNull
|
@Column(name = "mod_user", length = 32, insertable = false)
|
||||||
@Column(name = "mod_user", nullable = false, length = 32)
|
|
||||||
private String modUser;
|
private String modUser;
|
||||||
|
|
||||||
@NotNull
|
@Column(name = "mod_dt", insertable = false)
|
||||||
@Column(name = "mod_dt", nullable = false)
|
|
||||||
private LocalDateTime modDt;
|
private LocalDateTime modDt;
|
||||||
|
|
||||||
public Long getPrjctIdx(){
|
public Long getPrjctIdx(){
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.kri.contact.server.persistence.entity;
|
package com.kri.contact.server.persistence.entity;
|
||||||
|
|
||||||
|
import io.hypersistence.utils.hibernate.type.json.JsonType;
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
import org.hibernate.annotations.JdbcTypeCode;
|
import org.hibernate.annotations.Type;
|
||||||
import org.hibernate.type.SqlTypes;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -34,8 +34,8 @@ public class TListResetLogEntity {
|
|||||||
private Integer listCnt;
|
private Integer listCnt;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Type(JsonType.class)
|
||||||
@Column(name = "sid", nullable = false)
|
@Column(name = "sid", nullable = false)
|
||||||
@JdbcTypeCode(SqlTypes.JSON)
|
|
||||||
private Map<String, Object> sid;
|
private Map<String, Object> sid;
|
||||||
|
|
||||||
@Size(max = 128)
|
@Size(max = 128)
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ import jakarta.persistence.Entity;
|
|||||||
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 lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Builder
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Entity
|
@Entity
|
||||||
@@ -31,11 +33,11 @@ public class TPrjctAssignEntity {
|
|||||||
private LocalDateTime regDt;
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
public static TPrjctAssignEntity create(Long prjctIdx, String userId, String regUser, LocalDateTime regDt) {
|
public static TPrjctAssignEntity create(Long prjctIdx, String userId, String regUser, LocalDateTime regDt) {
|
||||||
TPrjctAssignEntity e = new TPrjctAssignEntity();
|
return TPrjctAssignEntity.builder()
|
||||||
e.setId(TPrjctAssignEntityId.create(prjctIdx, userId));
|
.id(TPrjctAssignEntityId.create(prjctIdx, userId))
|
||||||
e.setRegUser(regUser);
|
.regUser(regUser)
|
||||||
e.setRegDt(regDt);
|
.regDt(regDt)
|
||||||
return e;
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getPrjctIdx(){
|
public Long getPrjctIdx(){
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import jakarta.persistence.Column;
|
|||||||
import jakarta.persistence.Embeddable;
|
import jakarta.persistence.Embeddable;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
@@ -11,6 +12,7 @@ import org.hibernate.Hibernate;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Builder
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Embeddable
|
@Embeddable
|
||||||
@@ -39,9 +41,9 @@ public class TPrjctAssignEntityId implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static TPrjctAssignEntityId create(Long prjctIdx, String userId) {
|
public static TPrjctAssignEntityId create(Long prjctIdx, String userId) {
|
||||||
TPrjctAssignEntityId id = new TPrjctAssignEntityId();
|
return TPrjctAssignEntityId.builder()
|
||||||
id.setPrjctIdx(prjctIdx);
|
.prjctIdx(prjctIdx)
|
||||||
id.setUserId(userId);
|
.userId(userId)
|
||||||
return id;
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,12 +8,14 @@ import com.kri.contact.server.dto.ProjectInfoDto;
|
|||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Builder
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Entity
|
@Entity
|
||||||
@@ -83,19 +85,19 @@ public class TPrjctEntity {
|
|||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "reg_user", nullable = false, length = 32)
|
@Column(name = "reg_user", nullable = false, length = 32, updatable = false)
|
||||||
private String regUser;
|
private String regUser;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||||
@Column(name = "reg_dt", nullable = false)
|
@Column(name = "reg_dt", nullable = false, updatable = false)
|
||||||
private LocalDateTime regDt;
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
@Column(name = "mod_user", length = 32)
|
@Column(name = "mod_user", length = 32, insertable = false)
|
||||||
private String modUser;
|
private String modUser;
|
||||||
|
|
||||||
@Column(name = "mod_dt")
|
@Column(name = "mod_dt", insertable = false)
|
||||||
private LocalDateTime modDt;
|
private LocalDateTime modDt;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -111,36 +113,34 @@ public class TPrjctEntity {
|
|||||||
private LocalDateTime delDt;
|
private LocalDateTime delDt;
|
||||||
|
|
||||||
public static TPrjctEntity fromDto(ProjectInfoDto dto){
|
public static TPrjctEntity fromDto(ProjectInfoDto dto){
|
||||||
TPrjctEntity entity = new TPrjctEntity();
|
return TPrjctEntity.builder()
|
||||||
entity.setPrjctCd(dto.getPrjctCd());
|
.prjctCd(dto.getPrjctCd())
|
||||||
entity.setPrjctStatus(dto.getPrjctStatus().getCode());
|
.prjctStatus(dto.getPrjctStatus().getCode())
|
||||||
entity.setPrjctNm(dto.getPrjctName());
|
.prjctNm(dto.getPrjctName())
|
||||||
entity.setItrntPrjctCd(dto.getItrntPrjctCd());
|
.itrntPrjctCd(dto.getItrntPrjctCd())
|
||||||
entity.setOwnerDept(dto.getOwnerDept());
|
.ownerDept(dto.getOwnerDept())
|
||||||
entity.setOwnerFw(dto.getOwnerFw());
|
.ownerFw(dto.getOwnerFw())
|
||||||
entity.setSurveyTy(dto.getSurveyTy().getCode());
|
.surveyTy(dto.getSurveyTy().getCode())
|
||||||
entity.setSurveyPrjctCd(dto.getSurveyPrjctCd());
|
.surveyPrjctCd(dto.getSurveyPrjctCd())
|
||||||
entity.setSurveyUrl(dto.getSurveyUrl());
|
.surveyUrl(dto.getSurveyUrl())
|
||||||
entity.setFf(dto.getFf());
|
.ff(dto.getFf())
|
||||||
entity.setUseContactSenario(dto.getUseContactSenario());
|
.useContactSenario(dto.getUseContactSenario())
|
||||||
entity.setContactSenario(dto.getContactSenario());
|
.contactSenario(dto.getContactSenario())
|
||||||
entity.setRegUser(dto.getRegUser());
|
.regUser(dto.getRegUser())
|
||||||
entity.setRegDt(DateTimeUtil.nowKstLocalDateTime());
|
.regDt(DateTimeUtil.nowKstLocalDateTime())
|
||||||
|
.build();
|
||||||
return entity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TPrjctEntity create(ProjectCreateRequestDto req, String prjctCd, String regUser){
|
public static TPrjctEntity create(ProjectCreateRequestDto req, String prjctCd, String regUser){
|
||||||
TPrjctEntity entity = new TPrjctEntity();
|
return TPrjctEntity.builder()
|
||||||
entity.setPrjctCd(prjctCd);
|
.prjctCd(prjctCd)
|
||||||
entity.setPrjctNm(req.getPrjctName());
|
.prjctNm(req.getPrjctName())
|
||||||
entity.setItrntPrjctCd(req.getItrntPrjctCd());
|
.itrntPrjctCd(req.getItrntPrjctCd())
|
||||||
entity.setOwnerDept(req.getOwnerDept());
|
.ownerDept(req.getOwnerDept())
|
||||||
entity.setOwnerFw(req.getOwnerFw());
|
.ownerFw(req.getOwnerFw())
|
||||||
entity.setRegUser(regUser);
|
.regUser(regUser)
|
||||||
entity.setRegDt(DateTimeUtil.nowKstLocalDateTime());
|
.regDt(DateTimeUtil.nowKstLocalDateTime())
|
||||||
|
.build();
|
||||||
return entity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateFrom(ProjectInfoDto dto, String modUser) {
|
public void updateFrom(ProjectInfoDto dto, String modUser) {
|
||||||
|
|||||||
@@ -9,12 +9,14 @@ import jakarta.persistence.Entity;
|
|||||||
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 lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Builder
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Entity
|
@Entity
|
||||||
@@ -55,35 +57,21 @@ public class TResultCodeEntity {
|
|||||||
Long prjctIdx,
|
Long prjctIdx,
|
||||||
String regUser
|
String regUser
|
||||||
) {
|
) {
|
||||||
TResultCodeEntity e = new TResultCodeEntity();
|
return TResultCodeEntity.builder()
|
||||||
|
.id(TResultCodeEntityId.create(prjctIdx, src.getResultCdTy(), src.getResultCd()))
|
||||||
TResultCodeEntityId newId = new TResultCodeEntityId();
|
.resultCdLbl(src.getResultCdLbl())
|
||||||
newId.setPrjctIdx(prjctIdx);
|
.regUser(regUser)
|
||||||
newId.setResultCdTy(src.getResultCdTy());
|
.regDt(DateTimeUtil.nowKstLocalDateTime())
|
||||||
newId.setResultCd(src.getResultCd());
|
.build();
|
||||||
|
|
||||||
e.setId(newId);
|
|
||||||
e.setResultCdLbl(src.getResultCdLbl());
|
|
||||||
e.setRegUser(regUser);
|
|
||||||
e.setRegDt(DateTimeUtil.nowKstLocalDateTime());
|
|
||||||
|
|
||||||
return e;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResultCodeEntity fromDto(Long prjctIdx, ResultCodeType resultCdTy,ResultCodeDto req, String regUser) {
|
public static TResultCodeEntity fromDto(Long prjctIdx, ResultCodeType resultCdTy, ResultCodeDto req, String regUser) {
|
||||||
TResultCodeEntity entity = new TResultCodeEntity();
|
return TResultCodeEntity.builder()
|
||||||
|
.id(TResultCodeEntityId.create(prjctIdx, resultCdTy, req.getResultCd()))
|
||||||
|
.resultCdLbl(req.getResultCdLbl())
|
||||||
|
.regUser(regUser)
|
||||||
|
.regDt(DateTimeUtil.nowKstLocalDateTime())
|
||||||
|
.build();
|
||||||
|
|
||||||
TResultCodeEntityId id = new TResultCodeEntityId();
|
|
||||||
id.setPrjctIdx(prjctIdx);
|
|
||||||
id.setResultCdTy(resultCdTy);
|
|
||||||
id.setResultCd(req.getResultCd());
|
|
||||||
entity.setId(id);
|
|
||||||
|
|
||||||
entity.setResultCdLbl(req.getResultCdLbl());
|
|
||||||
|
|
||||||
entity.setRegUser(regUser);
|
|
||||||
entity.setRegDt(DateTimeUtil.nowKstLocalDateTime());
|
|
||||||
|
|
||||||
return entity;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,16 +6,18 @@ import jakarta.persistence.Column;
|
|||||||
import jakarta.persistence.Convert;
|
import jakarta.persistence.Convert;
|
||||||
import jakarta.persistence.Embeddable;
|
import jakarta.persistence.Embeddable;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Getter;
|
import lombok.*;
|
||||||
import lombok.Setter;
|
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Builder
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Embeddable
|
@Embeddable
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
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")
|
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||||
@@ -45,4 +47,11 @@ public class TResultCodeEntityId implements Serializable {
|
|||||||
return Objects.hash(prjctIdx, resultCdTy, resultCd);
|
return Objects.hash(prjctIdx, resultCdTy, resultCd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TResultCodeEntityId create(Long prjctIdx, ResultCodeType resultCdTy, Short resultCd) {
|
||||||
|
return TResultCodeEntityId.builder()
|
||||||
|
.prjctIdx(prjctIdx)
|
||||||
|
.resultCdTy(resultCdTy)
|
||||||
|
.resultCd(resultCd)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -30,21 +30,19 @@ public class TRoleEntity {
|
|||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "reg_user", nullable = false, length = 32)
|
@Column(name = "reg_user", nullable = false, length = 32, updatable = false)
|
||||||
private String regUser;
|
private String regUser;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||||
@Column(name = "reg_dt", nullable = false)
|
@Column(name = "reg_dt", nullable = false, updatable = false)
|
||||||
private LocalDateTime regDt;
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
@NotNull
|
@Column(name = "mod_user", length = 32, insertable = false)
|
||||||
@Column(name = "mod_user", length = 32)
|
|
||||||
private String modUser;
|
private String modUser;
|
||||||
|
|
||||||
@NotNull
|
@Column(name = "mod_dt", insertable = false)
|
||||||
@Column(name = "mod_dt")
|
|
||||||
private LocalDateTime modDt;
|
private LocalDateTime modDt;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,24 @@
|
|||||||
package com.kri.contact.server.persistence.entity;
|
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.SystemEventType;
|
||||||
|
import io.hypersistence.utils.hibernate.type.json.JsonType;
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
import org.hibernate.annotations.JdbcTypeCode;
|
import org.hibernate.annotations.Type;
|
||||||
import org.hibernate.type.SqlTypes;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Builder
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Entity
|
@Entity
|
||||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||||
|
@AllArgsConstructor
|
||||||
@Table(name = "t_sys_event_log")
|
@Table(name = "t_sys_event_log")
|
||||||
public class TSysEventLogEntity {
|
public class TSysEventLogEntity {
|
||||||
@Id
|
@Id
|
||||||
@@ -33,8 +36,8 @@ public class TSysEventLogEntity {
|
|||||||
private String logTitle;
|
private String logTitle;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Type(JsonType.class)
|
||||||
@Column(name = "log_content", nullable = false)
|
@Column(name = "log_content", nullable = false)
|
||||||
@JdbcTypeCode(SqlTypes.JSON)
|
|
||||||
private Map<String, Object> logContent;
|
private Map<String, Object> logContent;
|
||||||
|
|
||||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED")
|
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED")
|
||||||
@@ -55,21 +58,22 @@ public class TSysEventLogEntity {
|
|||||||
@Column(name = "reg_dt", nullable = false)
|
@Column(name = "reg_dt", nullable = false)
|
||||||
private LocalDateTime regDt;
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
@Builder
|
public static TSysEventLogEntity of(
|
||||||
private TSysEventLogEntity(
|
SystemEventType eventTy,
|
||||||
Short eventTy,
|
|
||||||
String logTitle,
|
String logTitle,
|
||||||
Map<String, Object> logContent,
|
Map<String, Object> logContent,
|
||||||
Long prjctIdx,
|
Long prjctIdx,
|
||||||
String ip,
|
String ip,
|
||||||
String regUser
|
String regUser
|
||||||
) {
|
) {
|
||||||
this.eventTy = eventTy;
|
return TSysEventLogEntity.builder()
|
||||||
this.logTitle = logTitle;
|
.eventTy(eventTy.getCode())
|
||||||
this.logContent = logContent;
|
.logTitle(logTitle)
|
||||||
this.prjctIdx = prjctIdx;
|
.logContent(logContent)
|
||||||
this.ip = ip;
|
.prjctIdx(prjctIdx)
|
||||||
this.regUser = regUser;
|
.ip(ip)
|
||||||
this.regDt = DateTimeUtil.nowKstLocalDateTime();
|
.regUser(regUser)
|
||||||
|
.regDt(DateTimeUtil.nowKstLocalDateTime())
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,9 +10,12 @@ import org.hibernate.annotations.ColumnDefault;
|
|||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Builder
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Entity
|
@Entity
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
@Table(name = "t_user")
|
@Table(name = "t_user")
|
||||||
public class TUserEntity {
|
public class TUserEntity {
|
||||||
@Id
|
@Id
|
||||||
@@ -86,23 +89,21 @@ public class TUserEntity {
|
|||||||
private LocalDateTime delDt;
|
private LocalDateTime delDt;
|
||||||
|
|
||||||
public static TUserEntity fromDto(UserInfoDto dto, String regUser) {
|
public static TUserEntity fromDto(UserInfoDto dto, String regUser) {
|
||||||
TUserEntity entity = new TUserEntity();
|
return TUserEntity.builder()
|
||||||
|
.userId(dto.getUserId())
|
||||||
entity.setUserId(dto.getUserId());
|
.userPw(dto.getUserPw())
|
||||||
entity.setUserPw(dto.getUserPw());
|
.userNm(dto.getUserName())
|
||||||
entity.setUserNm(dto.getUserName());
|
.userCmpn(dto.getUserCmpn())
|
||||||
entity.setUserCmpn(dto.getUserCmpn());
|
.userTeam(
|
||||||
entity.setUserTeam(
|
|
||||||
dto.getUserTeam() != null && !dto.getUserTeam().isBlank()
|
dto.getUserTeam() != null && !dto.getUserTeam().isBlank()
|
||||||
? dto.getUserTeam()
|
? dto.getUserTeam()
|
||||||
: "S101"// DB 기본값과 맞춰서 디폴트 세팅
|
: "S101" // DB 기본값과 맞춰서 디폴트 세팅
|
||||||
);
|
)
|
||||||
entity.setUserRole(dto.getUserRole());
|
.userRole(dto.getUserRole())
|
||||||
entity.setMemo(dto.getMemo() != null ? dto.getMemo() : "");
|
.memo(dto.getMemo() != null ? dto.getMemo() : "")
|
||||||
entity.setRegUser(regUser);
|
.regUser(regUser)
|
||||||
entity.setRegDt(DateTimeUtil.nowKstLocalDateTime());
|
.regDt(DateTimeUtil.nowKstLocalDateTime())
|
||||||
|
.build();
|
||||||
return entity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateFromDto(UserInfoDto dto, String modUser) {
|
public void updateFromDto(UserInfoDto dto, String modUser) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.kri.contact.server.service;
|
package com.kri.contact.server.service;
|
||||||
|
|
||||||
import com.kri.common.datetime.DateTimeUtil;
|
import com.kri.common.datetime.DateTimeUtil;
|
||||||
import com.kri.contact.server.common.consts.AppConstant;
|
import com.kri.contact.server.common.consts.ContactConstant;
|
||||||
import com.kri.contact.server.persistence.entity.TPrjctAssignEntity;
|
import com.kri.contact.server.persistence.entity.TPrjctAssignEntity;
|
||||||
import com.kri.contact.server.persistence.repository.ProjectAssignRepository;
|
import com.kri.contact.server.persistence.repository.ProjectAssignRepository;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -20,16 +20,16 @@ public class AssignService {
|
|||||||
public List<String> getPrjctOutsourceAssign(Long prjctIdx){
|
public List<String> getPrjctOutsourceAssign(Long prjctIdx){
|
||||||
return projectAssignRepository.findAssignUserIdByPrjctIdxAndRoleRange(
|
return projectAssignRepository.findAssignUserIdByPrjctIdxAndRoleRange(
|
||||||
prjctIdx,
|
prjctIdx,
|
||||||
AppConstant.OUTSOURCE_USER_ROLE,
|
ContactConstant.OUTSOURCE_USER_ROLE,
|
||||||
AppConstant.OUTSOURCE_USER_ROLE + 1000
|
ContactConstant.OUTSOURCE_USER_ROLE + 1000
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getPrjctFieldworkAssign(Long prjctIdx){
|
public List<String> getPrjctFieldworkAssign(Long prjctIdx){
|
||||||
return projectAssignRepository.findAssignUserIdByPrjctIdxAndRoleRange(
|
return projectAssignRepository.findAssignUserIdByPrjctIdxAndRoleRange(
|
||||||
prjctIdx,
|
prjctIdx,
|
||||||
AppConstant.FIELDWORK_USER_ROLE,
|
ContactConstant.FIELDWORK_USER_ROLE,
|
||||||
AppConstant.FIELDWORK_USER_ROLE + 1000
|
ContactConstant.FIELDWORK_USER_ROLE + 1000
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,8 +37,8 @@ public class AssignService {
|
|||||||
public void upsertPrjctOutsourceAssign(Long prjctIdx, List<String> assignUserIdList, String regUser){
|
public void upsertPrjctOutsourceAssign(Long prjctIdx, List<String> assignUserIdList, String regUser){
|
||||||
projectAssignRepository.deleteAssignByPrjctIdxAndRoleRange(
|
projectAssignRepository.deleteAssignByPrjctIdxAndRoleRange(
|
||||||
prjctIdx,
|
prjctIdx,
|
||||||
AppConstant.OUTSOURCE_USER_ROLE,
|
ContactConstant.OUTSOURCE_USER_ROLE,
|
||||||
AppConstant.OUTSOURCE_USER_ROLE + 1000
|
ContactConstant.OUTSOURCE_USER_ROLE + 1000
|
||||||
);
|
);
|
||||||
|
|
||||||
insertPrjctAssign(prjctIdx, assignUserIdList, regUser);
|
insertPrjctAssign(prjctIdx, assignUserIdList, regUser);
|
||||||
@@ -48,8 +48,8 @@ public class AssignService {
|
|||||||
public void upsertPrjctFieldworkAssign(Long prjctIdx, List<String> assignUserIdList, String regUser){
|
public void upsertPrjctFieldworkAssign(Long prjctIdx, List<String> assignUserIdList, String regUser){
|
||||||
projectAssignRepository.deleteAssignByPrjctIdxAndRoleRange(
|
projectAssignRepository.deleteAssignByPrjctIdxAndRoleRange(
|
||||||
prjctIdx,
|
prjctIdx,
|
||||||
AppConstant.FIELDWORK_USER_ROLE,
|
ContactConstant.FIELDWORK_USER_ROLE,
|
||||||
AppConstant.FIELDWORK_USER_ROLE + 1000
|
ContactConstant.FIELDWORK_USER_ROLE + 1000
|
||||||
);
|
);
|
||||||
|
|
||||||
insertPrjctAssign(prjctIdx, assignUserIdList, regUser);
|
insertPrjctAssign(prjctIdx, assignUserIdList, regUser);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.kri.contact.server.service;
|
|||||||
|
|
||||||
import com.kri.common.datetime.DateTimeUtil;
|
import com.kri.common.datetime.DateTimeUtil;
|
||||||
import com.kri.common.web.BusinessException;
|
import com.kri.common.web.BusinessException;
|
||||||
import com.kri.contact.server.common.consts.AppConstant;
|
import com.kri.contact.server.common.consts.ContactConstant;
|
||||||
import com.kri.contact.server.dto.*;
|
import com.kri.contact.server.dto.*;
|
||||||
import com.kri.contact.server.dto.common.PageResponseDto;
|
import com.kri.contact.server.dto.common.PageResponseDto;
|
||||||
import com.kri.contact.server.persistence.entity.TPrjctEntity;
|
import com.kri.contact.server.persistence.entity.TPrjctEntity;
|
||||||
@@ -57,8 +57,8 @@ public class ProjectService {
|
|||||||
ProjectSpecs.keywordLike(keyword)
|
ProjectSpecs.keywordLike(keyword)
|
||||||
.and(ProjectSpecs.isDelFalse());
|
.and(ProjectSpecs.isDelFalse());
|
||||||
|
|
||||||
if (userRole >= AppConstant.OUTSOURCE_USER_ROLE) {
|
if (userRole >= ContactConstant.OUTSOURCE_USER_ROLE) {
|
||||||
if (userRole >= AppConstant.FIELDWORK_USER_ROLE) {
|
if (userRole >= ContactConstant.FIELDWORK_USER_ROLE) {
|
||||||
spec = spec.and(ProjectSpecs.statusIn(STATUS_1));
|
spec = spec.and(ProjectSpecs.statusIn(STATUS_1));
|
||||||
} else {
|
} else {
|
||||||
spec = spec.and(ProjectSpecs.statusIn(STATUS_0_1));
|
spec = spec.and(ProjectSpecs.statusIn(STATUS_0_1));
|
||||||
@@ -83,8 +83,8 @@ public class ProjectService {
|
|||||||
.and(ProjectSpecs.ownerDeptIn(req.getOwnerDeptList()))
|
.and(ProjectSpecs.ownerDeptIn(req.getOwnerDeptList()))
|
||||||
.and(ProjectSpecs.ownerFwIn(req.getOwnerFwList()));
|
.and(ProjectSpecs.ownerFwIn(req.getOwnerFwList()));
|
||||||
|
|
||||||
if (userRole >= AppConstant.OUTSOURCE_USER_ROLE) {
|
if (userRole >= ContactConstant.OUTSOURCE_USER_ROLE) {
|
||||||
if (userRole >= AppConstant.FIELDWORK_USER_ROLE) {
|
if (userRole >= ContactConstant.FIELDWORK_USER_ROLE) {
|
||||||
spec = spec.and(ProjectSpecs.statusIn(STATUS_1));
|
spec = spec.and(ProjectSpecs.statusIn(STATUS_1));
|
||||||
} else {
|
} else {
|
||||||
spec = spec.and(ProjectSpecs.statusIn(STATUS_0_1));
|
spec = spec.and(ProjectSpecs.statusIn(STATUS_0_1));
|
||||||
@@ -115,8 +115,8 @@ public class ProjectService {
|
|||||||
|
|
||||||
public List<String> getOwnerDeptList(Integer userRole) {
|
public List<String> getOwnerDeptList(Integer userRole) {
|
||||||
final List<Short> statusList =
|
final List<Short> statusList =
|
||||||
(userRole < AppConstant.OUTSOURCE_USER_ROLE) ? null :
|
(userRole < ContactConstant.OUTSOURCE_USER_ROLE) ? null :
|
||||||
(userRole < AppConstant.FIELDWORK_USER_ROLE) ? STATUS_0_1 :
|
(userRole < ContactConstant.FIELDWORK_USER_ROLE) ? STATUS_0_1 :
|
||||||
STATUS_1;
|
STATUS_1;
|
||||||
|
|
||||||
return projectRepository.findDistinctOwnerDept(statusList);
|
return projectRepository.findDistinctOwnerDept(statusList);
|
||||||
@@ -124,8 +124,8 @@ public class ProjectService {
|
|||||||
|
|
||||||
public List<String> getOwnerFwList(Integer userRole) {
|
public List<String> getOwnerFwList(Integer userRole) {
|
||||||
final List<Short> statusList =
|
final List<Short> statusList =
|
||||||
(userRole < AppConstant.OUTSOURCE_USER_ROLE) ? null :
|
(userRole < ContactConstant.OUTSOURCE_USER_ROLE) ? null :
|
||||||
(userRole < AppConstant.FIELDWORK_USER_ROLE) ? STATUS_0_1 :
|
(userRole < ContactConstant.FIELDWORK_USER_ROLE) ? STATUS_0_1 :
|
||||||
STATUS_1;
|
STATUS_1;
|
||||||
|
|
||||||
return projectRepository.findDistinctOwnerFw(statusList);
|
return projectRepository.findDistinctOwnerFw(statusList);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.kri.contact.server.service;
|
package com.kri.contact.server.service;
|
||||||
|
|
||||||
import com.kri.contact.server.common.consts.AppConstant;
|
import com.kri.contact.server.common.consts.ContactConstant;
|
||||||
import com.kri.contact.server.dto.RoleInfoDto;
|
import com.kri.contact.server.dto.RoleInfoDto;
|
||||||
import com.kri.contact.server.persistence.repository.RoleRepository;
|
import com.kri.contact.server.persistence.repository.RoleRepository;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -21,9 +21,9 @@ public class RoleService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<RoleInfoDto> getRoleList(Integer roleCd){
|
public List<RoleInfoDto> getRoleList(Integer roleCd){
|
||||||
Integer searchRoleCd = roleCd < AppConstant.OUTSOURCE_USER_ROLE ?
|
Integer searchRoleCd = roleCd < ContactConstant.OUTSOURCE_USER_ROLE ?
|
||||||
AppConstant.OUTSOURCE_USER_ROLE :
|
ContactConstant.OUTSOURCE_USER_ROLE :
|
||||||
AppConstant.FIELDWORK_USER_ROLE;
|
ContactConstant.FIELDWORK_USER_ROLE;
|
||||||
|
|
||||||
return roleRepository.findByRoleCdGreaterThanEqual(searchRoleCd).stream()
|
return roleRepository.findByRoleCdGreaterThanEqual(searchRoleCd).stream()
|
||||||
.map(RoleInfoDto::from)
|
.map(RoleInfoDto::from)
|
||||||
|
|||||||
@@ -134,14 +134,14 @@ public class SystemEventLogService {
|
|||||||
String clientIp,
|
String clientIp,
|
||||||
Map<String, Object> contentMap
|
Map<String, Object> contentMap
|
||||||
){
|
){
|
||||||
TSysEventLogEntity log = TSysEventLogEntity.builder()
|
TSysEventLogEntity log = TSysEventLogEntity.of(
|
||||||
.eventTy(eventType.getCode())
|
eventType,
|
||||||
.logTitle(title)
|
title,
|
||||||
.logContent(contentMap)
|
contentMap,
|
||||||
.prjctIdx(prjctIdx)
|
prjctIdx,
|
||||||
.ip(clientIp)
|
clientIp,
|
||||||
.regUser(regId)
|
regId
|
||||||
.build();
|
);
|
||||||
|
|
||||||
systemEventLogRepository.save(log);
|
systemEventLogRepository.save(log);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.kri.contact.server.service;
|
|||||||
import com.kri.common.datetime.DateTimeUtil;
|
import com.kri.common.datetime.DateTimeUtil;
|
||||||
import com.kri.common.excel.ExcelMapper;
|
import com.kri.common.excel.ExcelMapper;
|
||||||
import com.kri.common.web.BusinessException;
|
import com.kri.common.web.BusinessException;
|
||||||
import com.kri.contact.server.common.consts.AppConstant;
|
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.DataVerificationDto;
|
||||||
@@ -164,10 +164,10 @@ public class UserService {
|
|||||||
public List<UserInfoDto> getFieldworkUserListWithCmpn(String searchCmpn){
|
public List<UserInfoDto> getFieldworkUserListWithCmpn(String searchCmpn){
|
||||||
List<TUserEntity> userList;
|
List<TUserEntity> userList;
|
||||||
if(searchCmpn == null || searchCmpn.isBlank()){
|
if(searchCmpn == null || searchCmpn.isBlank()){
|
||||||
userList = userRepository.findByUserRoleGreaterThanEqualAndDelFalse(AppConstant.FIELDWORK_USER_ROLE);
|
userList = userRepository.findByUserRoleGreaterThanEqualAndDelFalse(ContactConstant.FIELDWORK_USER_ROLE);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
userList = userRepository.findByUserCmpnAndUserRoleGreaterThanEqualAndDelFalse(searchCmpn, AppConstant.FIELDWORK_USER_ROLE);
|
userList = userRepository.findByUserCmpnAndUserRoleGreaterThanEqualAndDelFalse(searchCmpn, ContactConstant.FIELDWORK_USER_ROLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return userList.stream()
|
return userList.stream()
|
||||||
@@ -177,8 +177,8 @@ public class UserService {
|
|||||||
|
|
||||||
public List<UserInfoDto> getOutsourceList(){
|
public List<UserInfoDto> getOutsourceList(){
|
||||||
List<TUserEntity> userList = userRepository.findByRoleRangeAndDelFalse(
|
List<TUserEntity> userList = userRepository.findByRoleRangeAndDelFalse(
|
||||||
AppConstant.OUTSOURCE_USER_ROLE,
|
ContactConstant.OUTSOURCE_USER_ROLE,
|
||||||
AppConstant.OUTSOURCE_USER_ROLE + 1000
|
ContactConstant.OUTSOURCE_USER_ROLE + 1000
|
||||||
);
|
);
|
||||||
|
|
||||||
return userList.stream()
|
return userList.stream()
|
||||||
|
|||||||
Reference in New Issue
Block a user