eCams 연동시 로그 저장
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
mtype: 'POST',
|
||||
url: url,
|
||||
postData: getSearchForJqgrid("cmd", "LIST"),
|
||||
colNames: ['No', 'Service Name', 'Command', '레이아웃명', '연동시간', '결과', '결과메세지'],
|
||||
colNames: ['No', '서비스명', 'Command', '연동구분명', '연동시간', '결과', '결과메세지'],
|
||||
colModel: [
|
||||
{name: 'seqno', align: 'center', width: 50, sortable: false},
|
||||
{name: 'serviceName', align: 'center', width: 100, sortable: false},
|
||||
@@ -123,7 +123,7 @@
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_search" level="R"><i class="material-icons">search</i> <%= localeMessage.getString("button.search") %></button>
|
||||
</div>
|
||||
<div class="title">전문레이아웃 연동 이력<span class="tooltip">IIM에서 연동한 인터페이스 및 전문 레이아웃 이력을 조회합니다.</span></div>
|
||||
<div class="title">연동 배포 이력<span class="tooltip">IIM 레이아웃 연동 이력과 eCams 인터페이스 배포 이력을 조회합니다.</span></div>
|
||||
<form id="ajaxForm" onsubmit="return false;">
|
||||
<table class="search_condition" cellspacing=0;>
|
||||
<colgroup>
|
||||
@@ -133,8 +133,6 @@
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>레이아웃명</th>
|
||||
<td><input type="text" name="searchLoutName" autocomplete="off" style="width:95%;"></td>
|
||||
<th>연동시간</th>
|
||||
<td>
|
||||
<input type="text" name="searchStartYYYYMMDD" id="startDatepicker" readonly="readonly" value="" size="10" style="width:100px; border:1px solid #ebebec;">
|
||||
@@ -143,6 +141,14 @@
|
||||
<input type="hidden" name="searchStartDate" value="">
|
||||
<input type="hidden" name="searchEndDate" value="">
|
||||
</th>
|
||||
<th>서비스명</th>
|
||||
<td><input type="text" name="searchServiceName" autocomplete="off" style="width:95%;"></td>
|
||||
<th>Command</th>
|
||||
<td><input type="text" name="searchCommand" autocomplete="off" style="width:95%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>연동구분명</th>
|
||||
<td><input type="text" name="searchLoutName" autocomplete="off" style="width:95%;"></td>
|
||||
<th>결과</th>
|
||||
<td>
|
||||
<div class="select-style" style="display:inline-block; margin-left:6px;">
|
||||
@@ -153,6 +159,8 @@
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
<th></th>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
+6
@@ -31,6 +31,12 @@ public class LayoutSyncHistoryService extends AbstractDataService<LayoutSyncHist
|
||||
if (StringUtils.isNotBlank(search.getSearchLoutName())) {
|
||||
query.where(q.loutname.containsIgnoreCase(search.getSearchLoutName()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(search.getSearchServiceName())) {
|
||||
query.where(q.servicename.containsIgnoreCase(search.getSearchServiceName()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(search.getSearchCommand())) {
|
||||
query.where(q.command.containsIgnoreCase(search.getSearchCommand()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(search.getSearchStartDate())) {
|
||||
query.where(q.recvamndhms.goe(parseYYYYMMDD(search.getSearchStartDate()).atStartOfDay()));
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.eactive.eai.rms.onl.loader.controller;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -1451,10 +1451,12 @@ public class LoaderController implements InterceptorSkipController {
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@RequestMapping( params ={"cmd=interface","control=downloadfull"})
|
||||
public ModelAndView interfaceDownLoadFully(String serviceType, String interfaceId) throws Exception {
|
||||
public ModelAndView interfaceDownLoadFully(String serviceType, String interfaceId) {
|
||||
DataSourceType dt = DataSourceTypeManager.getDataSourceType(serviceType);
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
String json = "";
|
||||
try {
|
||||
// 1. interface 데이터 다운로드
|
||||
InterfaceDeployPack interfaceDeployPack = new InterfaceDeployPack();
|
||||
|
||||
@@ -1514,14 +1516,27 @@ public class LoaderController implements InterceptorSkipController {
|
||||
|
||||
FileWriteUtil.makeDirWithGroupPermission(fileDir);
|
||||
File file = new File(fileFullPath);
|
||||
writer.writeValue(file, interfaceDeployPack);
|
||||
json = writer.writeValueAsString(interfaceDeployPack);
|
||||
FileUtils.writeStringToFile(file, json, StandardCharsets.UTF_8);
|
||||
|
||||
// TSEAITR10 배포 이력 저장 (SERVICENAME=eCams, COMMAND=downloadfull, LOUTNAME=interfaceId, RECVDATA=json)
|
||||
loaderService.insertDeploySyncLog(dt, "downloadfull", interfaceId, json);
|
||||
|
||||
Map<String,String> result = new HashMap<>();
|
||||
String status = "success";
|
||||
result.put("status", status);
|
||||
result.put("status", "success");
|
||||
result.put("message", fileFullPath+" write done.");
|
||||
|
||||
return new ModelAndView(resultView, "result", result);
|
||||
} catch (Exception e) {
|
||||
logger.error("interface downloadfull error - interfaceId=" + interfaceId, e);
|
||||
loaderService.insertDeployFailLog(dt, "downloadfull", interfaceId, json, e.toString());
|
||||
|
||||
Map<String,String> result = new HashMap<>();
|
||||
result.put("status", "fail");
|
||||
result.put("message", e.toString());
|
||||
|
||||
return new ModelAndView(resultView, "result", result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1533,10 +1548,13 @@ public class LoaderController implements InterceptorSkipController {
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping( params ={"cmd=interface","control=uploadfull"})
|
||||
public ModelAndView interfaceLoadFully(String serviceType, String filePath) throws Exception {
|
||||
public ModelAndView interfaceLoadFully(String serviceType, String filePath) {
|
||||
DataSourceType dt = DataSourceTypeManager.getDataSourceType(serviceType);
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
String json = "";
|
||||
String loutName = filePath;
|
||||
try {
|
||||
String ioMapPath = monitoringContext.getStringProperty(MonitoringContext.IOMAP_UPLOAD_PATH);
|
||||
String fileFullPath ;
|
||||
if(StringUtils.isBlank(ioMapPath)) {
|
||||
@@ -1546,13 +1564,14 @@ public class LoaderController implements InterceptorSkipController {
|
||||
}
|
||||
|
||||
File file = new File(fileFullPath);
|
||||
InputStream inputStream = new FileInputStream(file);
|
||||
json = FileUtils.readFileToString(file, StandardCharsets.UTF_8);
|
||||
// ObjectMapper 생성 및 설정
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.registerModule(new JavaTimeModule());
|
||||
InterfaceDeployPack interfaceDeployPack = objectMapper.readValue(inputStream, InterfaceDeployPack.class);
|
||||
InterfaceDeployPack interfaceDeployPack = objectMapper.readValue(json, InterfaceDeployPack.class);
|
||||
|
||||
EAIMessageDeploy eaiMessageDeploy = interfaceDeployPack.getEaiMessageDeploy();
|
||||
loutName = eaiMessageDeploy.getEaisvcname();
|
||||
|
||||
interfaceDeployService.saveDeploy(eaiMessageDeploy);
|
||||
agentUtilService.broadcast(new CommonCommand("com.ext.eai.agent.stdmessage.ReloadSTDMessageCommand", "ALL"));
|
||||
@@ -1578,12 +1597,24 @@ public class LoaderController implements InterceptorSkipController {
|
||||
}
|
||||
}
|
||||
|
||||
// TSEAITR10 배포 이력 저장 (SERVICENAME=eCams, COMMAND=uploadfull, LOUTNAME=eaisvcname, RECVDATA=json)
|
||||
loaderService.insertDeploySyncLog(dt, "uploadfull", loutName, json);
|
||||
|
||||
Map<String,String> result = new HashMap<String,String>();
|
||||
String status = "success";
|
||||
result.put("status", status);
|
||||
result.put("status", "success");
|
||||
result.put("message", fileFullPath+" deploy done.");
|
||||
|
||||
return new ModelAndView(resultView, "result", result);
|
||||
} catch (Exception e) {
|
||||
logger.error("interface uploadfull error - filePath=" + filePath, e);
|
||||
loaderService.insertDeployFailLog(dt, "uploadfull", loutName, json, e.toString());
|
||||
|
||||
Map<String,String> result = new HashMap<String,String>();
|
||||
result.put("status", "fail");
|
||||
result.put("message", e.toString());
|
||||
|
||||
return new ModelAndView(resultView, "result", result);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -41,4 +41,9 @@ public interface LoaderDao {
|
||||
public List<LinkedHashMap> selectTableDataForListValue( DataSourceType dataSourceType, String tableName, String key1, List<String> param1 ) ;
|
||||
|
||||
public List<LinkedHashMap> selectSnaAdpApList( DataSourceType dataSourceType, String param1 ) ;
|
||||
|
||||
/**
|
||||
* TSEAITR10(배포/동기화 이력)에 로그 1건을 저장한다.
|
||||
*/
|
||||
public int insertSyncLog( DataSourceType dt, HashMap<String, String> param ) ;
|
||||
}
|
||||
|
||||
@@ -189,6 +189,11 @@ public class LoaderDaoImpl extends SqlMapClientTemplateDao implements LoaderDao
|
||||
// }
|
||||
// }.execute();
|
||||
}
|
||||
public int insertSyncLog( DataSourceType dt, HashMap<String, String> param ) {
|
||||
param.put("schemaId", dt.getSchema());
|
||||
return this.template.update("Layout.insertLayoutSyncLog", param);
|
||||
}
|
||||
|
||||
public List<LinkedHashMap> selectSnaAdpApList( DataSourceType dataSourceType, String param1 ) {
|
||||
final HashMap param = new HashMap();
|
||||
param.put("param1", param1);
|
||||
|
||||
@@ -158,4 +158,14 @@ public interface TransactionLoaderService{
|
||||
public HashMap syncResult(Command command ,String fileName ) throws Exception;
|
||||
|
||||
public void appendToListfile(String bizCode, String interfaceId) throws Exception ;
|
||||
|
||||
/**
|
||||
* downloadfull / uploadfull 성공 시 TSEAITR10 에 배포 이력을 저장한다. (PRCSSRSLT=S)
|
||||
*/
|
||||
public void insertDeploySyncLog(DataSourceType dt, String command, String interfaceId, String recvData) ;
|
||||
|
||||
/**
|
||||
* downloadfull / uploadfull 실패 시 TSEAITR10 에 실패 이력을 저장한다. (PRCSSRSLT=F, PRCSSRSLTCMNT=errMsg)
|
||||
*/
|
||||
public void insertDeployFailLog(DataSourceType dt, String command, String interfaceId, String recvData, String errMsg) ;
|
||||
}
|
||||
+30
@@ -2,6 +2,7 @@ package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommonCommand;
|
||||
import com.eactive.eai.common.util.UUIDGenerator;
|
||||
import com.eactive.eai.rms.common.base.BaseService;
|
||||
import com.eactive.eai.rms.common.context.MonitoringContext;
|
||||
import com.eactive.eai.rms.common.converter.ElinkObjectMapper;
|
||||
@@ -1483,4 +1484,33 @@ public class TransactionLoaderServiceImpl extends BaseService implements Transac
|
||||
String targetLine = bizCode+"|"+interfaceId+System.lineSeparator();
|
||||
org.apache.commons.io.FileUtils.writeStringToFile(listFile, targetLine, Charset.defaultCharset(), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertDeploySyncLog(DataSourceType dt, String command, String interfaceId, String recvData) {
|
||||
insertDeployLog(dt, command, interfaceId, recvData, "S", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertDeployFailLog(DataSourceType dt, String command, String interfaceId, String recvData, String errMsg) {
|
||||
insertDeployLog(dt, command, interfaceId, recvData, "F", errMsg);
|
||||
}
|
||||
|
||||
private void insertDeployLog(DataSourceType dt, String command, String interfaceId, String recvData,
|
||||
String prcssRslt, String prcssRsltCmnt) {
|
||||
try {
|
||||
HashMap<String, String> param = new HashMap<String, String>();
|
||||
param.put("logPrcssSeqno", UUIDGenerator.getUUID());
|
||||
param.put("serviceName", "InterfaceDeploy");
|
||||
param.put("command", command);
|
||||
param.put("loutName", interfaceId);
|
||||
param.put("recvData", recvData == null ? "" : recvData);
|
||||
param.put("recvAmndHMS", DateUtil.getDateTime("yyyyMMddHHmmssSS").substring(0, 16));
|
||||
param.put("prcssRslt", prcssRslt);
|
||||
param.put("prcssRsltCmnt", StringUtils.left(prcssRsltCmnt, 4000)); // PRCSSRSLTCMNT 길이 보호
|
||||
dao.insertSyncLog(dt, param);
|
||||
} catch (Exception e) {
|
||||
// 이력 저장 실패가 download/upload 본기능을 중단시키지 않도록 한다.
|
||||
logger.error("insertDeployLog error (command=" + command + ", interfaceId=" + interfaceId + ")", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -7,6 +7,12 @@ public class LayoutSyncHistoryUISearch {
|
||||
|
||||
private String searchLoutName;
|
||||
|
||||
/* 서비스명 (부분일치) */
|
||||
private String searchServiceName;
|
||||
|
||||
/* 커맨드 (부분일치) */
|
||||
private String searchCommand;
|
||||
|
||||
/* 연동시간 기간 검색 (yyyyMMdd, 8자리) */
|
||||
private String searchStartDate;
|
||||
private String searchEndDate;
|
||||
|
||||
Reference in New Issue
Block a user