Merge remote-tracking branch 'origin/jenkins_with_weblogic' of C:/eactive/bundle/bundles/20260110/eapim-admin_incremental_2025-12-15.bundle into jenkins_with_weblogic

This commit is contained in:
daekuk
2026-01-10 17:08:11 +09:00
8 changed files with 641 additions and 28 deletions
@@ -8,12 +8,6 @@ import java.util.stream.Collectors;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;
import com.eactive.eai.data.entity.onl.logger.EAILog;
import com.eactive.eai.data.entity.onl.logger.EAILogId;
import com.eactive.eai.data.entity.onl.logger.QEAILog;
@@ -26,6 +20,12 @@ import com.querydsl.core.types.dsl.EntityPathBase;
import com.querydsl.jpa.impl.JPAQuery;
import com.querydsl.jpa.impl.JPAQueryFactory;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;
@Repository
public class EAILogRepositoryImpl implements EAILogRepository {
@@ -43,26 +43,43 @@ public class EAILogRepositoryImpl implements EAILogRepository {
EntityPathBase<?> entityPathBase = new EntityPathBase<>(clazz, qeaiLog.getMetadata().getName());
QEAIMessageEntity qeaiMessageEntity = QEAIMessageEntity.eAIMessageEntity;
// Count Query
JPAQuery<?> countQuery = new JPAQueryFactory(em)
.from(entityPathBase)
.leftJoin(qeaiMessageEntity)
.on(qeaiLog.eaisvcname.eq(qeaiMessageEntity.eaisvcname));
appendConditions(eaiLogSearch, qeaiLog, entityPathBase, qeaiMessageEntity, countQuery);
JPAQuery<?> query = new JPAQueryFactory(em).from(entityPathBase);
appendConditions(eaiLogSearch, qeaiLog, entityPathBase, query);
long totalCount = query.select(qeaiLog.id.msgdpstyms.count()).fetchOne();
long totalCount = countQuery.select(qeaiLog.id.msgdpstyms.count()).fetchOne();
if (totalCount == 0) {
return new PageImpl<>(new ArrayList<>(), pageable, 0);
}
// List Query 분리
JPAQuery<?> listQuery = new JPAQueryFactory(em)
.from(entityPathBase)
.leftJoin(qeaiMessageEntity)
.on(qeaiLog.eaisvcname.eq(qeaiMessageEntity.eaisvcname));
List<EAILogDto> list = query
List<EAILogDto> list = listQuery
// .select(Projections.constructor(EAILogDto.class, qeaiLog, qeaiMessageEntity.eaisvcdesc))
.select(Projections.constructor(EAILogDto.class,
qeaiLog.id, qeaiLog.trackasiskey1ctnt, qeaiLog.trackasiskey2ctnt, qeaiLog.keymgtmsgctnt,
qeaiLog.eaisvcname, qeaiLog.extbizcd, qeaiLog.refkey, qeaiLog.clientname,
qeaiLog.orgname, qeaiLog.msgprcssyms, qeaiLog.companycode, qeaiLog.eaierrctnt,
qeaiLog.id,
qeaiLog.trackasiskey1ctnt,
qeaiLog.trackasiskey2ctnt,
qeaiLog.keymgtmsgctnt,
qeaiLog.eaisvcname,
qeaiLog.extbizcd,
qeaiLog.refkey,
qeaiLog.clientname,
qeaiLog.orgname,
qeaiLog.msgprcssyms,
qeaiLog.companycode,
qeaiLog.eaierrctnt,
qeaiMessageEntity.eaisvcdesc))
.from(entityPathBase)
.leftJoin(qeaiMessageEntity)
.on(qeaiLog.eaisvcname.eq(qeaiMessageEntity.eaisvcname))
.orderBy(qeaiLog.id.msgdpstyms.desc(), qeaiLog.id.eaisvcserno.asc(), qeaiLog.id.logprcssserno.asc())
.limit(1000)
.fetch();
@@ -73,9 +90,15 @@ public class EAILogRepositoryImpl implements EAILogRepository {
public Map<String, Long> countDetailedTransactions(Class<? extends EAILog> clazz, EAILogSearch eaiLogSearch) {
QEAILog qeaiLog = QEAILog.eAILog;
EntityPathBase<?> entityPathBase = new EntityPathBase<>(clazz, qeaiLog.getMetadata().getName());
QEAIMessageEntity qeaiMessageEntity = QEAIMessageEntity.eAIMessageEntity;
JPAQuery<?> query = new JPAQueryFactory(em).from(entityPathBase);
appendConditions(eaiLogSearch, qeaiLog, entityPathBase, query);
JPAQuery<?> query = new JPAQueryFactory(em)
.from(entityPathBase)
.leftJoin(qeaiMessageEntity)
.on(qeaiLog.eaisvcname.eq(qeaiMessageEntity.eAIMessageEntity.eaisvcname));
appendConditions(eaiLogSearch, qeaiLog, entityPathBase, qeaiMessageEntity, query);
List<Tuple> results = query.select(
qeaiLog.id.logprcssserno, // 로그 처리 상태
@@ -91,8 +114,7 @@ public class EAILogRepositoryImpl implements EAILogRepository {
return reult;
}
private void appendConditions(EAILogSearch eaiLogSearch, QEAILog qeaiLog, EntityPathBase<?> entityPathBase, JPAQuery<?> query) {
private void appendConditions(EAILogSearch eaiLogSearch, QEAILog qeaiLog, EntityPathBase<?> entityPathBase, QEAIMessageEntity qeaiMessageEntity, JPAQuery<?> query) {
if (StringUtils.equalsIgnoreCase(eaiLogSearch.getAuthChk(), "Y")) {
QUserBusiness qUserBusiness = QUserBusiness.userBusiness;
JPAQuery<String> subQuery = new JPAQueryFactory(em)
@@ -127,6 +149,10 @@ public class EAILogRepositoryImpl implements EAILogRepository {
if (StringUtils.isNotBlank(eaiLogSearch.getSearchEaiSvcName())) {
query.where(qeaiLog.eaisvcname.containsIgnoreCase(eaiLogSearch.getSearchEaiSvcName()));
}
if (StringUtils.isNotBlank(eaiLogSearch.getSearchEaiSvcDesc())) {
query.where(qeaiMessageEntity.eaisvcdesc.containsIgnoreCase(eaiLogSearch.getSearchEaiSvcDesc()));
}
if (StringUtils.isNotBlank(eaiLogSearch.getSearchKeyMgtMsgCtnt())) {
query.where(qeaiLog.keymgtmsgctnt.contains(eaiLogSearch.getSearchKeyMgtMsgCtnt()));
@@ -15,6 +15,7 @@ public class EAILogSearch {
private String searchEaiBzwkDstcd;
private String searchEaiSvcSerno;
private String searchEaiSvcName;
private String searchEaiSvcDesc;
private String searchKeyMgtMsgCtnt;
private String searchTrackAsisKey1Ctnt;
private String searchTrackAsisKey2Ctnt;
@@ -0,0 +1,106 @@
package com.eactive.eai.rms.onl.manage.authoutbound;
import com.eactive.eai.agent.command.CommonCommand;
import com.eactive.eai.rms.common.base.OnlBaseAnnotationController;
import com.eactive.eai.rms.common.login.SessionManager;
import com.eactive.eai.rms.common.vo.GridResponse;
import com.eactive.eai.rms.onl.manage.comm.property.PropertyGroupUI;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
import java.util.stream.Collectors;
@Controller
public class OutboundFixedCredentialController extends OnlBaseAnnotationController {
enum CommandType { RELOAD, DELETE };
public static final Log logger = LogFactory.getLog(OutboundFixedCredentialController.class);
@Autowired
OutboundOAuthCredentialManService service ;
@GetMapping(value = "/onl/admin/authoutbound/outboundFixedCredentialMan.view")
public void view() {
}
@GetMapping(value = "/onl/admin/authoutbound/outboundFixedCredentialMan.view", params = "cmd=DETAIL")
public String viewDetail() {
return "/onl/admin/authoutbound/outboundFixedCredentialManDetail";
}
@PostMapping(value= "/onl/admin/authoutbound/outboundFixedCredentialMan.json", params = "cmd=LIST")
public ResponseEntity<GridResponse<OutboundOAuthCredentialUI>>selectList(String searchAdapterGroupName, Pageable pageable) {
Page<OutboundOAuthCredentialUI> page = service.selectList(pageable, searchAdapterGroupName);
Page<OutboundOAuthCredentialUI> filteredPage =
new PageImpl<>(
page.filter(i -> "fixed_token".equals(i.getGrantType()))
.stream()
.collect(Collectors.toList()),
pageable,
page.getTotalElements() // 또는 filtered.size()
);
return ResponseEntity.ok(new GridResponse<>(filteredPage));
}
@PostMapping(value = "/onl/admin/authoutbound/outboundFixedCredentialMan.json", params = "cmd=DETAIL")
public ResponseEntity<OutboundOAuthCredentialUI> selectDetail(String adapterGroupName) throws Exception {
OutboundOAuthCredentialUI outboundOAuthCredentialUI = service.selectDetail(adapterGroupName);
return ResponseEntity.ok(outboundOAuthCredentialUI);
}
@PostMapping(value= "/onl/admin/authoutbound/outboundFixedCredentialMan.json",params = "cmd=LIST_DETAIL_COMBO")
public ResponseEntity<Map<String, Object>> selectDetailCombo() throws Exception {
Map<String, Object> map = service.selectDetailCombo();
return ResponseEntity.ok(map);
}
@PostMapping(value = "/onl/admin/authoutbound/outboundFixedCredentialMan.json", params = "cmd=INSERT")
public ResponseEntity<Void> insert(OutboundOAuthCredentialUI outboundOAuthCredentialUI) throws Exception {
service.insert(outboundOAuthCredentialUI);
commandOAuthInfo(CommandType.RELOAD, outboundOAuthCredentialUI.getAdapterGroupName());
return ResponseEntity.ok().build();
}
@PostMapping(value = "/onl/admin/authoutbound/outboundFixedCredentialMan.json", params = "cmd=UPDATE")
public ResponseEntity<Void> update(OutboundOAuthCredentialUI outboundOAuthCredentialUI) throws Exception {
service.update(outboundOAuthCredentialUI);
commandOAuthInfo(CommandType.RELOAD, outboundOAuthCredentialUI.getAdapterGroupName());
return ResponseEntity.ok().build();
}
@PostMapping(value = "/onl/admin/authoutbound/outboundFixedCredentialMan.json", params = "cmd=DELETE")
public ResponseEntity<Void> delete(String adapterGroupName) throws Exception {
service.delete(adapterGroupName);
commandOAuthInfo(CommandType.DELETE, adapterGroupName);
return ResponseEntity.ok().build();
}
private boolean commandOAuthInfo(CommandType commandType, String adapterGroupName) {
String commandClass ;
if(CommandType.DELETE == commandType){
commandClass = "com.eactive.eai.agent.authoutbound.RemoveOutboundOAuthCredentialCommand";
}else{
commandClass = "com.eactive.eai.agent.authoutbound.ReloadOutboundOAuthCredentialCommand";
}
logger.warn("Command:" + commandType + ", Target: " + adapterGroupName);
CommonCommand command = new CommonCommand(commandClass, adapterGroupName);
try {
agentUtilService.broadcast(command);
} catch (Exception e) {
logger.warn("Command error", e);
return false;
}
return true;
}
}