2 Commits

Author SHA1 Message Date
eastargh 142d402bad 레이아웃관리 - Array 아이템유형 추가
eapim-admin CI / build (push) Has been cancelled
2026-07-06 11:25:16 +09:00
eastargh f23cb02b1c 웹훅 발송 내역 2026-07-03 17:15:57 +09:00
14 changed files with 133 additions and 59 deletions
@@ -71,7 +71,7 @@
$('#grid').children().remove();
const itemTypes = ['Field', 'Grid', 'Group', 'Attr'];
const itemTypes = ['Field', 'Grid', 'Group', 'Attr', 'Array'];
columns = [ // for columnData prop
{ title: '<%= localeMessage.getString("layoutMan.itmeEn") %>', name: 'loutItemName', type: 'text', width:280, resize:true, minWidth:120 },
@@ -54,6 +54,7 @@
const LAYOUT_ITEM_TYPE_GROUP = "Group";
const LAYOUT_ITEM_TYPE_GRID = "Grid";
const LAYOUT_ITEM_TYPE_FIELD = "Field";
const LAYOUT_ITEM_TYPE_ARRAY = "Array";
var isDetail = false;
@@ -550,6 +551,14 @@
return data;
}
// 항목 자신이 Array인 경우, 경로/변환명령 끝에 반복 표시 [*]를 추가
function addArrayTag(loutItemType, data) {
if (loutItemType == LAYOUT_ITEM_TYPE_ARRAY && !data.endsWith("[*]")) {
data = data + "[*]";
}
return data;
}
//변환명에 있는 서비스코드와 if서비스 코드 매칭
function validation(){
if ($('input[name=cnvsnName]').val() == '') {
@@ -889,10 +898,10 @@
let selectValue = "";
let targetValue = "";
for ( var i = 0; i < sourceData.length; i++) {
if (sourceData[i]['loutItemType'] != "Field" && sourceData[i]['loutItemType'] != "Attr") continue;
if (sourceData[i]['loutItemType'] != "Field" && sourceData[i]['loutItemType'] != "Attr" && sourceData[i]['loutItemType'] != "Array") continue;
selectValue = (sourceData[i]['LOUTITEMPATH']).substr(sourceData[i]['loutName'].length+1);
for (var j = 0; j <targetData.length; j++) {
if (targetData[j]['loutItemType'] != "Field" && targetData[j]['loutItemType'] != "Attr") continue;
if (targetData[j]['loutItemType'] != "Field" && targetData[j]['loutItemType'] != "Attr" && targetData[j]['loutItemType'] != "Array") continue;
targetValue = (targetData[j]['LOUTITEMPATH']).substr(targetData[j]['loutName'].length+1);
if (targetValue == selectValue ) {
var data = sourceData[i]['LOUTITEMPATH'];
@@ -916,8 +925,8 @@
//field, ATTR 여부 판단
var sourceRow = sourceGrid.getRowData( srcRowId );
var targetRow = targetGrid.getRowData( tgtRowId );
if ( (sourceRow["loutItemType"] == 'Field' || sourceRow["loutItemType"] == 'Attr') &&
(targetRow["loutItemType"] == 'Field' || targetRow["loutItemType"] == 'Attr') ){
if ( (sourceRow["loutItemType"] == 'Field' || sourceRow["loutItemType"] == 'Attr' || sourceRow["loutItemType"] == 'Array') &&
(targetRow["loutItemType"] == 'Field' || targetRow["loutItemType"] == 'Attr' || targetRow["loutItemType"] == 'Array') ){
;
}else{
alert('<%=localeMessage.getString("transformManDetail.alert3")%>');
@@ -936,15 +945,15 @@
var targetValue = "";
var j=tgtIndex-1-1;
for ( var i = srcIndex-1; i < sourceData.length; i++) {
if (sourceData[i]['loutItemType'] != LAYOUT_ITEM_TYPE_FIELD) continue;
if (sourceData[i]['loutItemType'] != LAYOUT_ITEM_TYPE_FIELD && sourceData[i]['loutItemType'] != LAYOUT_ITEM_TYPE_ARRAY) continue;
j++;
while (targetData.length -1 >= j &&targetData[j]["loutItemType"] != LAYOUT_ITEM_TYPE_FIELD){
while (targetData.length -1 >= j && targetData[j]["loutItemType"] != LAYOUT_ITEM_TYPE_FIELD && targetData[j]["loutItemType"] != LAYOUT_ITEM_TYPE_ARRAY){
j++;
}
if (targetData.length -1 < j) break;
var targetRowId = targetData[j]['id'];
targetGrid.jqGrid('setCell',targetRowId,'CNVSNCMDNAME',addGroupTag(srcGroup,sourceData[i]['LOUTITEMPATH']));
targetGrid.jqGrid('setCell',targetRowId,'CNVSNRSULTITEMPATHNAME',addGroupTag(tgtGroup,targetData[j]['LOUTITEMPATH']));
targetGrid.jqGrid('setCell',targetRowId,'CNVSNCMDNAME',addArrayTag(sourceData[i]['loutItemType'], addGroupTag(srcGroup,sourceData[i]['LOUTITEMPATH'])));
targetGrid.jqGrid('setCell',targetRowId,'CNVSNRSULTITEMPATHNAME',addArrayTag(targetData[j]['loutItemType'], addGroupTag(tgtGroup,targetData[j]['LOUTITEMPATH'])));
targetGrid.jqGrid('setCell',targetRowId,'CNVSNITEMSERNO',targetData[j]['loutItemSerno']);
const sourceEndpointElementId = sourceGrid.getEndpointElementId(sourceData[i]['id']);
@@ -1015,7 +1024,7 @@
var targetData = targetGrid.getRowData();
var gridData = new Array();
for (var i = 0; i <targetData.length; i++) {
if ((targetData[i]['loutItemType'] != "Field") && (targetData[i]['loutItemType'] != "Attr")) {
if ((targetData[i]['loutItemType'] != "Field") && (targetData[i]['loutItemType'] != "Attr") && (targetData[i]['loutItemType'] != "Array")) {
continue;
}
if (targetData[i]['CNVSNCMDNAME']==null
@@ -1158,7 +1167,7 @@
function srcformatterFunction(cellvalue,options,rowObject){
var rowId = options["rowId"];
var loutItemType = rowObject["loutItemType"];
if (loutItemType == 'Field' || loutItemType == 'Attr'){
if (loutItemType == 'Field' || loutItemType == 'Attr' || loutItemType == 'Array'){
return "<div id='div_src_"+rowId+"' name='src_"+rowId+"' style='width:28px;height:17px;background-color: #D12F35; border-color: #ab1717; border-style: solid; border-width: 1px; border-radius: 3px;' />";
}else{
return "<div id='div_srcgroup_"+rowId+"' name='srcgroup_"+rowId+"' style='width:28px;height:17px;' />";
@@ -1170,7 +1179,7 @@
function tgtformatterFunction(cellvalue,options,rowObject){
var rowId = options["rowId"];
var loutItemType = rowObject["loutItemType"];
if (loutItemType == 'Field' || loutItemType == 'Attr'){
if (loutItemType == 'Field' || loutItemType == 'Attr' || loutItemType == 'Array'){
return "<div id='div_tgt_"+rowId+"_base' name='div_tgt_"+rowId+"_base' style='width:30px;height:20px; background-color:gray;' >"
+ "<div id='div_tgt_"+rowId+"' name='tgt_"+rowId+"' style='width:28px;height:17px; background-color: #3E7E9C; border-color: #217ca7; border-style: solid; border-width: 1px; border-radius: 3px;' onclick='jqGridOnTargetGridEndpointClick(this)'>"
+ "</div></div>";
@@ -1669,8 +1678,8 @@
return;
}
if ((sourceRow["loutItemType"] != 'Field' && sourceRow["loutItemType"] != 'Attr')
|| (targetRow["loutItemType"] != 'Field' && targetRow["loutItemType"] != 'Attr')) {
if ((sourceRow["loutItemType"] != 'Field' && sourceRow["loutItemType"] != 'Attr' && sourceRow["loutItemType"] != 'Array')
|| (targetRow["loutItemType"] != 'Field' && targetRow["loutItemType"] != 'Attr' && targetRow["loutItemType"] != 'Array')) {
alert('<%=localeMessage.getString("transformManDetail.alert3")%>');
return ;
}
@@ -1684,7 +1693,7 @@
if (targetRow['CNVSNCMDNAME'] == '') {
// 변환 명령 값이 한번 설정 되면 변경 되지 않게 함.
var cnvsnCmdName = addGroupTag(srcGroup,sourceRow["LOUTITEMPATH"]);
var cnvsnCmdName = addArrayTag(sourceRow["loutItemType"], addGroupTag(srcGroup,sourceRow["LOUTITEMPATH"]));
// function까지 처리되도록 수정했으나, parameter가 하나인 경우에만 정상처리됨
if($('#functionCombo').val() != "") {
cnvsnCmdName = $('#functionCombo').val() + "(" + cnvsnCmdName + ")";
@@ -1693,7 +1702,7 @@
targetGrid.jqGrid('setCell',tgtRowId,'CNVSNCMDNAME', cnvsnCmdName);
}
targetGrid.jqGrid('setCell',tgtRowId,'CNVSNRSULTITEMPATHNAME',addGroupTag(tgtGroup,targetRow["LOUTITEMPATH"]));
targetGrid.jqGrid('setCell',tgtRowId,'CNVSNRSULTITEMPATHNAME',addArrayTag(targetRow["loutItemType"], addGroupTag(tgtGroup,targetRow["LOUTITEMPATH"])));
targetGrid.jqGrid('setCell',tgtRowId,'CNVSNITEMSERNO',targetRow['loutItemSerno']);
targetGrid.jqGrid('setCell',tgtRowId,'CNVSNSRCITEMS', cnvsnSrcItems);
targetGrid.jqGrid('setCell',tgtRowId,'ISVALIDMAPPING', true);
@@ -1885,8 +1894,8 @@
if (loutItemType == LAYOUT_ITEM_TYPE_GRID || loutItemType == LAYOUT_ITEM_TYPE_GROUP) {
// group 인 경우
items = createGridGroupContextMenuItems(grid, rowId);
} else if(loutItemType == LAYOUT_ITEM_TYPE_FIELD) {
// field 인 경우
} else if(loutItemType == LAYOUT_ITEM_TYPE_FIELD || loutItemType == LAYOUT_ITEM_TYPE_ARRAY) {
// field, array 인 경우
items = createFieldContextMenuItems(grid, positionElement.attr('id'));
} else {
return false;
@@ -1989,7 +1998,7 @@
break;
}
if (loutItemType == LAYOUT_ITEM_TYPE_FIELD) {
if (loutItemType == LAYOUT_ITEM_TYPE_FIELD || loutItemType == LAYOUT_ITEM_TYPE_ARRAY) {
loutItemPath = loutItemPath.replace(new RegExp("^" + prefix), "");
console.debug(grid.getId() + " : loutItemPath : " + loutItemPath);
rowData['GROUP_LOUTITEMPATH'] = loutItemPath;
@@ -11,7 +11,7 @@
response.setHeader("Expires", "0");
MonitoringContext monitoringContext = (MonitoringContext)CommonUtil.getBean(request, "monitoringContext");
String reverseProxyUrl = monitoringContext.getStringProperty("djb.reverse_proxy.url", "");
String reverseProxyUrl = monitoringContext.getStringProperty(MonitoringContext.RMS_WEBHOOK_REVERSE_PROXY_URL, "");
%>
<%!
public String getRequiredLabel(String label) {
@@ -89,16 +89,17 @@
mtype: 'POST',
url: url,
postData: getSearchForJqgrid("cmd", "LIST"),
colNames: ['id', 'No.', '기관명', '이벤트유형', 'Target URL', 'Status', '성공여부', '등록일시', '발송일시'],
colNames: ['id', 'No.', '기관명', '이벤트유형', 'Target URL', 'Proxy URL', 'Status', '성공여부', '발송서버', '발송일시'],
colModel: [
{name: 'id', align: 'center', key: true, hidden: true},
{name: 'rowNum', align: 'center', width: 45, sortable: false},
{name: 'orgName', align: 'left', width: 140},
{name: 'eventType', align: 'center', width: 120, formatter: formatEventType},
{name: 'targetUrl', align: 'left', width: 300, formatter: formatTargetUrl},
{name: 'proxyUrl', align: 'left', width: 300, formatter: formatTargetUrl},
{name: 'statusCode', align: 'center', width: 60},
{name: 'success', align: 'center', width: 70, formatter: formatSuccess},
{name: 'createdAt', align: 'center', width: 140},
{name: 'sendBy', align: 'center', width: 100},
{name: 'sentAt', align: 'center', width: 140}
],
jsonReader: {repeatitems: false},
@@ -118,6 +119,7 @@
url2 += '&returnUrl=' + getReturnUrl();
url2 += '&menuId=' + '${param.menuId}';
url2 += '&id=' + id;
url2 += '&' + getSearchUrl();
goNav(url2);
},
loadComplete: function () {
@@ -218,7 +220,7 @@
<tr>
<th>Target URL</th>
<td><input type="text" name="searchTargetUrl" autocomplete="off" style="width:95%;"></td>
<th>등록기간</th>
<th>발송기간</th>
<td>
<input type="text" name="searchStartYYYYMMDD" id="startDatepicker" readonly="readonly" value="" size="10" style="width:40%; border:1px solid #ebebec;">
~
@@ -37,9 +37,10 @@
$('#eventType').text(data.eventTypeName || data.eventType || '')
.attr('title', data.eventType || '');
$('#targetUrl').text(data.targetUrl || '');
$('#proxyUrl').text(data.proxyUrl || '');
$('#statusCode').text(data.statusCode != null ? data.statusCode : '');
$('#retryCount').text(data.retryCount != null ? data.retryCount : '');
$('#createdAt').text(data.createdAt || '');
$('#sendBy').text(data.sendBy || '');
$('#sentAt').text(data.sentAt || '');
$('#signature').text(data.signature || '');
$('#errorMessage').text(data.errorMessage || '');
@@ -97,7 +98,9 @@
</tr>
<tr>
<th>Target URL</th>
<td colspan="3"><span id="targetUrl"></span></td>
<td><span id="targetUrl"></span></td>
<th>Proxy URL</th>
<td><span id="proxyUrl"></span></td>
</tr>
<tr>
<th>성공여부</th>
@@ -106,8 +109,8 @@
<td><span id="retryCount"></span></td>
</tr>
<tr>
<th>등록일시</th>
<td><span id="createdAt"></span></td>
<th>발송서버</th>
<td><span id="sendBy"></span></td>
<th>발송일시</th>
<td><span id="sentAt"></span></td>
</tr>
@@ -26,9 +26,12 @@ public class WebhookSendLog {
)
private Long id;
@Column(name = "TARGET_URL", nullable = false, length = 500)
@Column(name = "TARGET_URL", length = 500)
private String targetUrl;
@Column(name = "PROXY_URL", length = 500)
private String proxyUrl;
@Column(name = "EVENT_TYPE", length = 100)
private String eventType;
@@ -66,6 +69,9 @@ public class WebhookSendLog {
@Column(name = "SENT_AT")
private LocalDateTime sentAt;
@Column(name = "SEND_BY", length = 100)
private String sendBy;
/* Boolean 편의 메서드 */
public void setSuccess(Boolean success) {
this.success = (success != null && success) ? "Y" : "N";
@@ -20,6 +20,7 @@ public class WebhookSendLogUI {
/** 모니터링 공통코드(EVENT_TYPE) 코드명. 상세 조회에서만 채워진다(목록은 화면에서 콤보로 변환). */
private String eventTypeName;
private String targetUrl;
private String proxyUrl;
private String payload;
private String signature;
@@ -28,6 +29,7 @@ public class WebhookSendLogUI {
private String responseBody;
private Boolean success;
private String sendBy;
private String errorMessage;
private Integer retryCount;
@@ -17,7 +17,7 @@ public class WebhookSendLogUISearch {
/* 성공여부 (Y/N, 공백=전체) */
private String searchSuccess;
/* 등록일시 기간 검색 (yyyyMMdd, 8자리 — userLoginHistoryMan.jsp 기간검색 스타일) */
/* 발송일시 기간 검색 (yyyyMMdd, 8자리 — userLoginHistoryMan.jsp 기간검색 스타일) */
private String searchStartDate;
private String searchEndDate;
}
@@ -8,6 +8,7 @@ import lombok.Setter;
public class WebhookSendRequest {
private String orgId;
private String targetUrl;
private String proxyUrl;
private String eventType;
private String secret;
private String reverseProxyPath;
@@ -80,10 +80,10 @@ public class WebhookSendLogManService extends BaseService {
predicate.and(log.success.eq(search.getSearchSuccess()));
}
if (StringUtils.isNotBlank(search.getSearchStartDate())) {
predicate.and(log.createdAt.goe(parseYYYYMMDD(search.getSearchStartDate()).atStartOfDay()));
predicate.and(log.sentAt.goe(parseYYYYMMDD(search.getSearchStartDate()).atStartOfDay()));
}
if (StringUtils.isNotBlank(search.getSearchEndDate())) {
predicate.and(log.createdAt.loe(parseYYYYMMDD(search.getSearchEndDate()).atTime(23, 59, 59)));
predicate.and(log.sentAt.loe(parseYYYYMMDD(search.getSearchEndDate()).atTime(23, 59, 59)));
}
Page<WebhookSendLog> page = webhookSendLogRepository.findAll(predicate, pageable);
@@ -154,11 +154,13 @@ public class WebhookSendLogManService extends BaseService {
ui.setEventType(e.getEventType());
ui.setEventTypeName(eventTypeName);
ui.setTargetUrl(e.getTargetUrl());
ui.setProxyUrl(e.getProxyUrl());
ui.setPayload(e.getPayload());
ui.setSignature(e.getSignature());
ui.setStatusCode(e.getStatusCode());
ui.setResponseBody(e.getResponseBody());
ui.setSuccess(e.getSuccess());
ui.setSendBy(e.getSendBy());
ui.setErrorMessage(e.getErrorMessage());
ui.setRetryCount(e.getRetryCount());
ui.setCreatedAt(fmt(e.getCreatedAt(), FMT_DATETIME));
@@ -24,6 +24,7 @@ import org.springframework.web.client.RestTemplate;
import com.eactive.apim.portal.portalorg.entity.QPortalOrg;
import com.eactive.eai.rms.common.context.MonitoringContext;
import com.eactive.eai.rms.common.util.ContainerUtil;
import com.eactive.eai.rms.data.entity.onl.djb.webhook.QWebhookReq;
import com.eactive.eai.rms.data.entity.onl.djb.webhook.QWebhookReqApi;
import com.eactive.eai.rms.data.entity.onl.djb.webhook.QWebhookReqEvent;
@@ -82,7 +83,8 @@ public class WebhookService {
resultMap.computeIfAbsent(key, k -> {
WebhookSendRequest wr = new WebhookSendRequest();
wr.setOrgId(t.get(req.orgId));
wr.setTargetUrl(this.convertTargetUrl(reverseProxyUrl, t.get(org.reverseProxyPath), t.get(req.targetUrl)));
wr.setTargetUrl(t.get(req.targetUrl));
wr.setProxyUrl(this.getProxyUrl(reverseProxyUrl, t.get(org.reverseProxyPath), t.get(req.targetUrl)));
wr.setSecret(t.get(req.secret));
wr.setEventType(event);
wr.setData(new ArrayList<String>());
@@ -95,7 +97,7 @@ public class WebhookService {
}
//reverse proxy 서버로 발송하기 위한 url 만든다
private String convertTargetUrl(String proxyUrl, String path, String targetUrl) {
private String getProxyUrl(String proxyUrl, String path, String targetUrl) {
String base = stripTrailingSlash(proxyUrl);
String normalizedPath = stripSlashes(path);
// scheme://host[:port] 부분만 제거하고 이후 path/query/fragment는 그대로 유지
@@ -141,6 +143,7 @@ public class WebhookService {
public void send(WebhookSendRequest req) {
String targetUrl = req.getTargetUrl();
String proxyUrl = req.getProxyUrl();
String secret = req.getSecret();
String eventType = req.getEventType();
Object data = req.getData();
@@ -148,7 +151,9 @@ public class WebhookService {
WebhookSendLog sendLog = new WebhookSendLog();
sendLog.setOrgId(req.getOrgId());
sendLog.setTargetUrl(targetUrl);
sendLog.setProxyUrl(proxyUrl);
sendLog.setEventType(eventType);
sendLog.setSendBy(ContainerUtil.getInstanceName());
try {
// 1. Payload 생성
@@ -172,7 +177,7 @@ public class WebhookService {
int retryTime = monitoringContext.getIntProperty(MonitoringContext.RMS_WEBHOOK_RETRY_TIME, DEFAULT_RETRY_TIME);
sendLog.setSentAt(LocalDateTime.now());
HttpEntity<String> httpRequest = new HttpEntity<>(payloadJson, headers);
ResponseEntity<String> response = sendWithRetry(targetUrl, httpRequest, sendLog, retryCount, retryTime);
ResponseEntity<String> response = sendWithRetry(proxyUrl, httpRequest, sendLog, retryCount, retryTime);
// 5. 성공 로그
sendLog.setStatusCode(response.getStatusCode().value());
@@ -180,7 +185,7 @@ public class WebhookService {
sendLog.setSuccess(response.getStatusCode().is2xxSuccessful());
log.info("[Webhook] 발송 성공 - eventType: {}, url: {}, status: {}, retryCount: {}",
eventType, targetUrl, response.getStatusCode(), sendLog.getRetryCount());
eventType, proxyUrl, response.getStatusCode(), sendLog.getRetryCount());
} catch (HttpClientErrorException | HttpServerErrorException e) {
sendLog.setStatusCode(e.getStatusCode().value());
@@ -188,13 +193,13 @@ public class WebhookService {
sendLog.setSuccess(false);
sendLog.setErrorMessage(e.getMessage());
log.error("[Webhook] HTTP 오류 - eventType: {}, url: {}, status: {}",
eventType, targetUrl, e.getStatusCode());
eventType, proxyUrl, e.getStatusCode());
} catch (Exception e) {
sendLog.setSuccess(false);
sendLog.setErrorMessage(e.getMessage());
log.error("[Webhook] 발송 실패 - eventType: {}, url: {}, error: {}",
eventType, targetUrl, e.getMessage());
eventType, proxyUrl, e.getMessage());
}
sendLogRepository.save(sendLog);
@@ -206,24 +211,25 @@ public class WebhookService {
/**
* 재시도 포함 HTTP 발송
* - 4xx: 클라이언트 오류이므로 즉시 throw (재시도 불필요)
* - 5xx / 네트워크 오류: 최대 RETRY_COUNT회까지 exponential backoff 재시도 (1s → 2s → 4s)
* - 5xx / 네트워크 오류: 최대 RETRY_COUNT회까지 선형 증가 backoff 재시도 (1s → 2s → 3s → 4s → 5s)
*/
private ResponseEntity<String> sendWithRetry(String targetUrl, HttpEntity<String> request, WebhookSendLog sendLog, int retryCount, int retryTime) throws Exception {
private ResponseEntity<String> sendWithRetry(String proxyUrl, HttpEntity<String> request, WebhookSendLog sendLog, int retryCount, int retryTime) throws Exception {
Exception lastException = null;
for (int attempt = 0; attempt <= retryCount; attempt++) {
try {
if (attempt > 0) {
long delayMs = retryTime * (1L << (attempt - 1));
log.info("[Webhook] 재시도 {}/{} - url: {}, delay: {}ms", attempt, retryCount, targetUrl, delayMs);
Thread.sleep(delayMs);
long delayMs = (long) retryTime * attempt;
log.info("[Webhook] 재시도 {}/{} - url: {}, delay: {}ms", attempt, retryCount, proxyUrl, delayMs);
sendLog.setRetryCount(attempt);
Thread.sleep(delayMs);
}
return restTemplate.postForEntity(targetUrl, request, String.class);
return restTemplate.postForEntity(proxyUrl, request, String.class);
} catch (HttpClientErrorException e) {
throw e; // 4xx는 재시도 불필요
//throw e; // 4xx는 재시도 불필요
lastException = e; //TODO: 재시도 테스트
} catch (Exception e) {
lastException = e;
log.warn("[Webhook] 발송 실패 (attempt {}/{}) - url: {}, error: {}", attempt, retryCount, targetUrl, e.getMessage());
log.warn("[Webhook] 발송 실패 (attempt {}/{}) - url: {}, error: {}", attempt, retryCount, proxyUrl, e.getMessage());
}
}
throw lastException;
@@ -352,7 +352,7 @@ public class LayoutManService extends OnlBaseService {
}
if (max == 0 && min == 0) {
if ("GRID".equalsIgnoreCase(loutItemType)) {
if ("GRID".equalsIgnoreCase(loutItemType) || "ARRAY".equalsIgnoreCase(loutItemType)) {
min = 1;
max = -1;
} else {
@@ -371,7 +371,8 @@ public class LayoutManService extends OnlBaseService {
}
private String determineOccurNoItem(LayoutItemUI layoutItemUI, String loutItemType) {
if ("GRID".equalsIgnoreCase(loutItemType) && NumberUtils.toInt(layoutItemUI.getLoutItemOccCnt()) == 0) {
if (("GRID".equalsIgnoreCase(loutItemType) || "ARRAY".equalsIgnoreCase(loutItemType))
&& NumberUtils.toInt(layoutItemUI.getLoutItemOccCnt()) == 0) {
return "*";
}
return String.valueOf(layoutItemUI.getLoutItemOccCnt());
@@ -385,6 +386,8 @@ public class LayoutManService extends OnlBaseService {
node = Item.NODE_GROUP;
} else if ("ATTR".equalsIgnoreCase(el.getLoutItemType())) {
node = Item.NODE_ATTR;
} else if ("ARRAY".equalsIgnoreCase(el.getLoutItemType())) {
node = Item.NODE_FIELD;
} else {
node = Item.NODE_FIELD;
}
@@ -71,13 +71,33 @@ public interface LayoutItemUIMapper extends GenericMapper<LayoutItemUI, LayoutIt
itemType = isGridCondition ? "GRID" : "GROUP";
// isGridCondition이 참이고, 참조 정보2가 비어 있는 경우, itemLoopCount 설정
if (isGridCondition && StringUtils.isBlank(item.getLoutitemrefinfo2())
&& NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd())
&& Integer.parseInt(item.getLoutitemoccurptrndstcd()) > -1 ) {
itemLoopCount = item.getLoutitemoccurptrndstcd();
if (isGridCondition && StringUtils.isBlank(item.getLoutitemrefinfo2())) {
if ("*".equals(item.getLoutitemoccurptrndstcd())) {
// 반복횟수로 '*'(무제한)이 저장된 경우, 화면 그리드에도 '*'을 그대로 표시
itemLoopCount = "*";
} else if (NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd())
&& Integer.parseInt(item.getLoutitemoccurptrndstcd()) > -1) {
itemLoopCount = item.getLoutitemoccurptrndstcd();
}
}
} else if (ItemNodeType.FIELD.getNumber() == item.getLoutitemnodeptrnidname()) {
// 아이템 발생 포인터 명이 '*'이거나 숫자로 생성 가능한 경우
boolean isArrayCondition = "*".equals(item.getLoutitemoccurptrndstcd()) || NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd());
// itemType을 ARRAY 또는 FIELD 로 설정
itemType = isArrayCondition ? "ARRAY" : "FIELD";
// isArrayCondition이 참이고, 참조 정보2가 비어 있는 경우, itemLoopCount 설정
if (isArrayCondition && StringUtils.isBlank(item.getLoutitemrefinfo2())) {
if ("*".equals(item.getLoutitemoccurptrndstcd())) {
// 반복횟수로 '*'(무제한)이 저장된 경우, 화면 그리드에도 '*'을 그대로 표시
itemLoopCount = "*";
} else if (NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd())
&& Integer.parseInt(item.getLoutitemoccurptrndstcd()) > -1) {
itemLoopCount = item.getLoutitemoccurptrndstcd();
}
}
} else {
// 아이템 노드 타입이 GROUP 아닌 경우, 해당 노드 타입으로 itemType 설정
// 아이템 노드 타입이 GROUP/FIELD가 아닌 경우, 해당 노드 타입으로 itemType 설정
itemType = ItemNodeType.fromNumber(item.getLoutitemnodeptrnidname()).toString();
}
@@ -85,7 +105,7 @@ public interface LayoutItemUIMapper extends GenericMapper<LayoutItemUI, LayoutIt
itemUi.setLoutItemType(itemType);
if(NumberUtils.toInt(itemLoopCount) == 0){
if (!"*".equals(itemLoopCount) && NumberUtils.toInt(itemLoopCount) == 0) {
itemLoopCount = "";
}
itemUi.setLoutItemOccCnt(itemLoopCount);
@@ -71,10 +71,30 @@ public interface LayoutPopupUIMapper extends GenericMapper<LayoutPopupUI, Layout
itemType = isGridCondition ? "GRID" : "GROUP";
// isGridCondition이 참이고, 참조 정보2가 비어 있는 경우, itemLoopCount 설정
if (isGridCondition && StringUtils.isBlank(item.getLoutitemrefinfo2())
&& NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd())
&& Integer.parseInt(item.getLoutitemoccurptrndstcd()) > -1 ) {
itemLoopCount = item.getLoutitemoccurptrndstcd();
if (isGridCondition && StringUtils.isBlank(item.getLoutitemrefinfo2())) {
if ("*".equals(item.getLoutitemoccurptrndstcd())) {
// 반복횟수로 '*'(무제한)이 저장된 경우, 화면 그리드에도 '*'을 그대로 표시
itemLoopCount = "*";
} else if (NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd())
&& Integer.parseInt(item.getLoutitemoccurptrndstcd()) > -1) {
itemLoopCount = item.getLoutitemoccurptrndstcd();
}
}
} else if (ItemNodeType.FIELD.getNumber() == item.getLoutitemnodeptrnidname()) {
// 아이템 발생 포인터 명이 '*'이거나 숫자로 생성 가능한 경우
boolean isArrayCondition = "*".equals(item.getLoutitemoccurptrndstcd()) || NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd());
// itemType을 ARRAY 또는 FIELD 로 설정
itemType = isArrayCondition ? "ARRAY" : "FIELD";
// isArrayCondition이 참이고, 참조 정보2가 비어 있는 경우, itemLoopCount 설정
if (isArrayCondition && StringUtils.isBlank(item.getLoutitemrefinfo2())) {
if ("*".equals(item.getLoutitemoccurptrndstcd())) {
// 반복횟수로 '*'(무제한)이 저장된 경우, 화면 그리드에도 '*'을 그대로 표시
itemLoopCount = "*";
} else if (NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd())
&& Integer.parseInt(item.getLoutitemoccurptrndstcd()) > -1) {
itemLoopCount = item.getLoutitemoccurptrndstcd();
}
}
} else {
// 아이템 노드 타입이 GROUP이 아닌 경우, 해당 노드 타입으로 itemType 설정
@@ -85,7 +105,7 @@ public interface LayoutPopupUIMapper extends GenericMapper<LayoutPopupUI, Layout
popupUI.setLoutItemType(itemType);
if(NumberUtils.toInt(itemLoopCount) == 0){
if (!"*".equals(itemLoopCount) && NumberUtils.toInt(itemLoopCount) == 0) {
itemLoopCount = "";
}
popupUI.setLoutItemOccCnt(itemLoopCount);