감사로그 및 삭제 프로세스 개선:
- 감사 사유 입력 기능 추가 및 UI 수정 - 사용/법인 삭제 시 '완전삭제' 여부 확인 및 로직 적용 - 감사로그에 사유(message) 저장 필드 추가
This commit is contained in:
+3
-1
@@ -41,10 +41,12 @@ public class AuditLogInterceptor implements HandlerInterceptor {
|
||||
|
||||
if (isAuditableUsecase.isAuditable(userId, command, logType, systemCode)) {
|
||||
String parameters = getParametersAsString(request);
|
||||
String message = request.getParameter("auditReason");
|
||||
log
|
||||
.debug("audit log save : logType={}, cmd={}, user={}, parameters={}", logType, command,
|
||||
userId, parameters);
|
||||
saveAuditLogUseCase.log(systemCode, logType, command, remoteAddress, userId, parameters);
|
||||
saveAuditLogUseCase
|
||||
.log(systemCode, logType, command, remoteAddress, userId, parameters, message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ public class AuditLog {
|
||||
|
||||
private String logTypeText;
|
||||
|
||||
private String message;
|
||||
|
||||
private String parameters;
|
||||
|
||||
private LocalDateTime lastModifiedDate;
|
||||
|
||||
@@ -3,6 +3,6 @@ package com.eactive.eai.rms.common.acl.audit.port.in;
|
||||
public interface SaveAuditLogUseCase {
|
||||
|
||||
public void log(String systemCode, String logType, String command, String remoteAddress, String userId,
|
||||
String parameters);
|
||||
String parameters, String message);
|
||||
|
||||
}
|
||||
|
||||
@@ -59,15 +59,16 @@ class AuditLogService
|
||||
|
||||
@Override
|
||||
public void log(String systemCode, String logType, String command, String remoteAddress, String userId,
|
||||
String parameters) {
|
||||
String parameters, String message) {
|
||||
|
||||
AuditLog auditLog = new AuditLog(systemCode, logType, command, userId, remoteAddress);
|
||||
String auditPointKey = AuditPoint.generateKey(logType, systemCode, command);
|
||||
AuditPoint auditPoint = auditPoints.get(auditPointKey);
|
||||
|
||||
|
||||
auditLog.setLogTypeText(auditPoint.getLogTypeText());
|
||||
auditLog.setLastModifiedDate(LocalDateTime.now());
|
||||
auditLog.setParameters(parameters);
|
||||
auditLog.setMessage(message);
|
||||
|
||||
saveAuditLogPort.save(auditLog);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.springframework.data.web.SortDefault;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -37,8 +38,8 @@ public class PortalOrgManController extends BaseAnnotationController {
|
||||
private final ComboService comboService;
|
||||
|
||||
@GetMapping(value = "/onl/apim/portalorg/portalOrgMan.view")
|
||||
public void view() {
|
||||
// view
|
||||
public void view(Model model) {
|
||||
model.addAttribute("hardDeleteEnabled", portalOrgManService.isHardDeleteEnabled());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/onl/apim/portalorg/portalOrgMan.view", params = "cmd=DETAIL")
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.eactive.eai.rms.onl.apim.masking.MaskingUtils;
|
||||
import com.eactive.eai.rms.onl.apim.portaluser.PortalUserCorpManagerUI;
|
||||
import com.eactive.eai.rms.onl.apim.portaluser.PortalUserCorpManagerUIMapper;
|
||||
import com.eactive.eai.rms.onl.common.exception.BizException;
|
||||
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -44,15 +45,27 @@ import java.util.Optional;
|
||||
@Slf4j
|
||||
public class PortalOrgManService extends BaseService {
|
||||
|
||||
/** PortalProperty 그룹명 */
|
||||
private static final String PORTAL_PROPERTY_GROUP = "Portal";
|
||||
/** 법인 완전삭제(hard delete) 허용 프로퍼티 키 (true:허용, 기본 false) */
|
||||
private static final String HARD_DELETE_FLAG_KEY = "org.hard-delete.enabled";
|
||||
|
||||
private final PortalOrgService portalOrgService;
|
||||
private final PortalOrgUIMapper portalOrgUIMapper;
|
||||
private final PortalUserService portalUserService;
|
||||
private final PortalUserCorpManagerUIMapper portalUserCorpManagerUIMapper;
|
||||
private final FileService fileService;
|
||||
private final PortalPropertyService portalPropertyService;
|
||||
|
||||
@PersistenceContext(unitName = "entityManagerFactoryForEMS")
|
||||
private EntityManager entityManager;
|
||||
|
||||
/** 법인 목록 '선택 삭제'(완전삭제) 버튼 노출 여부 */
|
||||
public boolean isHardDeleteEnabled() {
|
||||
Map<String, String> properties = portalPropertyService.getPortalPropertiesAsMap(PORTAL_PROPERTY_GROUP);
|
||||
return Boolean.parseBoolean(properties.getOrDefault(HARD_DELETE_FLAG_KEY, "false"));
|
||||
}
|
||||
|
||||
public Page<PortalOrgUI> selectList(Pageable pageable, PortalOrgUISearch portalOrgUISearch) {
|
||||
Page<PortalOrg> portalOrg = portalOrgService.findAll(pageable, portalOrgUISearch);
|
||||
return portalOrg.map(entity -> convertToUIWithMaskOption(entity, true));
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.web.SortDefault;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
@@ -32,8 +33,8 @@ public class PortalUserManController extends BaseAnnotationController {
|
||||
private final ComboService comboService;
|
||||
|
||||
@GetMapping(value = "/onl/apim/portaluser/portalUserMan.view")
|
||||
public void view() {
|
||||
// view
|
||||
public void view(Model model) {
|
||||
model.addAttribute("hardDeleteEnabled", portalUserManService.isHardDeleteEnabled());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/onl/apim/portaluser/portalUserMan.view", params = "cmd=DETAIL")
|
||||
|
||||
@@ -46,6 +46,8 @@ public class PortalUserManService extends BaseService {
|
||||
private static final String PORTAL_PROPERTY_GROUP = "Portal";
|
||||
/** 사용자 별 휴대폰 번호 중복 허용 프로퍼티 키 (true:허용, false:허용안함, 기본 false) */
|
||||
private static final String PROP_MOBILE_DUPLICATE_ALLOW = "user.mobile.duplicate.allow";
|
||||
/** 가입자 완전삭제(hard delete) 허용 프로퍼티 키 (true:허용, 기본 false) */
|
||||
private static final String HARD_DELETE_FLAG_KEY = "user.hard-delete.enabled";
|
||||
|
||||
private final PortalUserService portalUserService;
|
||||
private final PortalUserUIMapper portalUserUIMapper;
|
||||
@@ -60,6 +62,11 @@ public class PortalUserManService extends BaseService {
|
||||
private final PortalInquiryService portalInquiryService;
|
||||
private final PortalPropertyService portalPropertyService;
|
||||
|
||||
/** 가입자 목록 '선택 삭제'(완전삭제) 버튼 노출 여부 */
|
||||
public boolean isHardDeleteEnabled() {
|
||||
Map<String, String> properties = portalPropertyService.getPortalPropertiesAsMap(PORTAL_PROPERTY_GROUP);
|
||||
return Boolean.parseBoolean(properties.getOrDefault(HARD_DELETE_FLAG_KEY, "false"));
|
||||
}
|
||||
|
||||
public Page<PortalUserUI> selectList(Pageable pageable, PortalUserUISearch portalUserUISearch) {
|
||||
Page<PortalUser> portalUser = portalUserService.findAll(pageable, portalUserUISearch);
|
||||
|
||||
@@ -2490,6 +2490,7 @@ deployResourceSearchMan.deleteBtn=delete
|
||||
|
||||
auditLogMan.command = Command
|
||||
auditLogMan.logMsg = Message
|
||||
auditLogMan.message = Reason
|
||||
auditLogMan.logSeqNo = Number
|
||||
auditLogMan.logSubMsg = Sub Message
|
||||
auditLogMan.logType.access = ACCESS
|
||||
|
||||
@@ -202,6 +202,7 @@ apiScpMan.title = API-SCOPE \uB9F5\uD551
|
||||
|
||||
auditLogMan.command = Command
|
||||
auditLogMan.logMsg = \uBA54\uC2DC\uC9C0
|
||||
auditLogMan.message = \uC0AC\uC720
|
||||
auditLogMan.logSeqNo = \uBC88\uD638
|
||||
auditLogMan.logSubMsg = \uC11C\uBE0C \uBA54\uC2DC\uC9C0
|
||||
auditLogMan.logType.access = \uC811\uC18D
|
||||
|
||||
Reference in New Issue
Block a user