init
This commit is contained in:
+54
@@ -0,0 +1,54 @@
|
||||
package com.eactive.eai.rms.onl.loader.controller;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
||||
import com.eactive.eai.rms.common.interceptor.InterceptorSkipController;
|
||||
import com.eactive.eai.rms.common.spring.BaseController;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployResourceDownloadServiceFactory;
|
||||
import com.eactive.eai.rms.onl.loader.service.enm.ResourceType;
|
||||
import com.eactive.eai.rms.onl.loader.vo.RuleFileResource;
|
||||
|
||||
@Controller
|
||||
@RequestMapping({ "/deployresource" })
|
||||
public class DeployResourceDownloadController extends BaseController implements InterceptorSkipController {
|
||||
|
||||
@Autowired
|
||||
private DeployResourceDownloadServiceFactory serviceFactory;
|
||||
|
||||
@RequestMapping({ "/{serviceType}/{resourceType}/{resourceName}/download.do" })
|
||||
public ResponseEntity<String> download(@PathVariable String serviceType, @PathVariable String resourceType,
|
||||
@PathVariable String resourceName) {
|
||||
|
||||
/** Invalid serviceType Error **/
|
||||
if (!DataSourceTypeManager.getDataSourceTypeNames().contains(serviceType.toUpperCase()))
|
||||
return ResponseEntity.internalServerError()
|
||||
.contentType(new MediaType("text", "plain", StandardCharsets.UTF_8))
|
||||
.body("Invalid ServiceType:" + serviceType);
|
||||
|
||||
try {
|
||||
|
||||
RuleFileResource resource = serviceFactory.create(serviceType).getResource(serviceType,
|
||||
ResourceType.valueOf(resourceType.toUpperCase()), resourceName);
|
||||
|
||||
return ResponseEntity.ok().header("Content-Disposition", "attachment; filename=" + resource.getFileName())
|
||||
.contentType(new MediaType("text", "plain", StandardCharsets.UTF_8))
|
||||
.body(resource.getFileContent());
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
logger.error(e);
|
||||
return ResponseEntity.internalServerError()
|
||||
.contentType(new MediaType("text", "plain", StandardCharsets.UTF_8)).body(e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
package com.eactive.eai.rms.onl.loader.controller;
|
||||
|
||||
import com.eactive.eai.rms.bap.loader.service.SearchBAPService;
|
||||
import com.eactive.eai.rms.bat.loader.service.BatSearchService;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceContextHolder;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
||||
import com.eactive.eai.rms.common.util.CamelCaseUtil;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployResourceDownloadBapService;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployResourceDownloadBatService;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployResourceDownloadOnlineService;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployResourceDownloadServiceFactory;
|
||||
import com.eactive.eai.rms.onl.loader.service.SearchService;
|
||||
import com.google.gson.Gson;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
public class DeployResourceSearchController {
|
||||
|
||||
private final Logger logger = Logger.getLogger(getClass());
|
||||
|
||||
@Autowired
|
||||
@Qualifier("searchService")
|
||||
private SearchService onlineSearchService;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("batSearchService")
|
||||
private BatSearchService batSearchService;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("searchBAPService")
|
||||
private SearchBAPService bapSearchService;
|
||||
|
||||
@Autowired
|
||||
private DeployResourceDownloadServiceFactory serviceFactory;
|
||||
|
||||
@RequestMapping(value = "/common/acl/deploy/deployResourceSearchMan.view")
|
||||
private String viewList(HttpServletRequest request, @RequestParam(value = "cmd", required = false) String cmd)
|
||||
throws Exception {
|
||||
if (cmd == null || "LIST".equals(cmd.toUpperCase())) {
|
||||
cmd = "";
|
||||
} else {
|
||||
cmd = CamelCaseUtil.converCamelCase(cmd);
|
||||
}
|
||||
String path = request.getServletPath();
|
||||
return path.split("[.]")[0] + cmd;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/common/acl/deploy/deployResourceSearchMan.json", params = "cmd=LIST")
|
||||
public ModelAndView search(HttpServletRequest request, @RequestParam HashMap<String, Object> paramMap,
|
||||
String serviceType) throws Exception {
|
||||
|
||||
if (!DataSourceTypeManager.getDataSourceTypeNames().contains(serviceType.toUpperCase()))
|
||||
throw new Exception("Invalid ServiceType:" + serviceType);
|
||||
|
||||
HashMap map = null;
|
||||
if (DataSourceTypeManager.getDataSourceType(serviceType).isOnline()) {
|
||||
map = onlineSearchService.selectList(request, 1, 999, paramMap);
|
||||
} else if (DataSourceTypeManager.getDataSourceType(serviceType).getName().equals(DataSourceTypeManager.BAT)) {
|
||||
map = batSearchService.selectList(request, 0, 0, paramMap);
|
||||
} else if (DataSourceTypeManager.getDataSourceType(serviceType).getName().equals(DataSourceTypeManager.BAP)) {
|
||||
map = bapSearchService.selectBAPList(request, 0, 0, paramMap);
|
||||
}
|
||||
|
||||
Map resultMap = new HashMap();
|
||||
resultMap.put("rows", map.get("list"));
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView", resultMap);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@PostMapping(value = "/common/acl/deploy/deployResourceSearchMan.json", params = "cmd=DOWNLOAD_RESOURCES_ZIP")
|
||||
public ResponseEntity<Object> downloadZip(String serviceType, String gridData) {
|
||||
|
||||
DataSourceContextHolder.setDataSourceType(DataSourceTypeManager.getDataSourceType(serviceType));
|
||||
|
||||
Gson gson = new Gson();
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, String>[] list = gson.fromJson(gridData, HashMap[].class);
|
||||
try {
|
||||
|
||||
byte[] resourcesZip = serviceFactory.create(serviceType).getResourcesZip(list);
|
||||
|
||||
return ResponseEntity.ok()
|
||||
.header("Content-Disposition", "attachment; filename=" + serviceType + "deployResources.zip")
|
||||
.body(resourcesZip);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
return ResponseEntity.internalServerError().body(e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.eactive.eai.rms.onl.loader.controller;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.eactive.eai.rms.common.context.MonitoringContext;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceContextHolder;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
||||
import com.eactive.eai.rms.common.interceptor.InterceptorSkipController;
|
||||
import com.eactive.eai.rms.common.util.CommonConstants;
|
||||
import com.eactive.eai.rms.onl.loader.service.HistoryService;
|
||||
|
||||
@Controller
|
||||
public class HistoryController implements InterceptorSkipController {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(HistoryController.class);
|
||||
|
||||
|
||||
@Autowired
|
||||
private MonitoringContext monitoringContext;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("historyService")
|
||||
private HistoryService historyService;
|
||||
|
||||
|
||||
/**
|
||||
* 형상관리에서 userId 별로 처리 대상 조회 -> file down -> filePath 송신
|
||||
* delemeter : \t
|
||||
* id.csv
|
||||
*
|
||||
* id : userId
|
||||
* serviceType : EAI/FEP
|
||||
*
|
||||
* *
|
||||
* @param request
|
||||
* @param response
|
||||
* @param schema
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/historyList.do")
|
||||
public ModelAndView historyList(HttpServletRequest request, HttpServletResponse response , String id, String serviceType ) throws Exception {
|
||||
String view ="common/jsp/loadResult";
|
||||
String folder = "LIST";
|
||||
FileOutputStream os = null;
|
||||
BufferedOutputStream bos = null;
|
||||
|
||||
try{
|
||||
// if (!(DataSourceTypeManager.EAI.equals(serviceType)
|
||||
// || DataSourceTypeManager.FEP.equals(serviceType))){
|
||||
// throw new Exception("정의 되지 않은 서비스 타입입니다(EAI|FEP) 받은 서비스 타입="+ serviceType);
|
||||
// }
|
||||
// if (!(DataSourceTypeManager.EAI.equals(serviceType))){
|
||||
// throw new Exception("정의 되지 않은 서비스 타입입니다(EAI) 받은 서비스 타입="+ serviceType);
|
||||
// }
|
||||
if (StringUtils.isEmpty(id)){
|
||||
throw new Exception("id는 필수 값입니다.");
|
||||
}
|
||||
|
||||
HashMap<String, ArrayList<HashMap<String, String>>> list = new HashMap<String, ArrayList<HashMap<String, String>>>();
|
||||
if (serviceType != null) {
|
||||
request.getSession().setAttribute(CommonConstants.SERVICE_TYPE_KEY, serviceType);
|
||||
DataSourceType dt = DataSourceTypeManager.getDataSourceType(serviceType);
|
||||
if(dt != null){//취약점소스 수정 2020.08.27
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
list = historyService.userHistoryList(dt, id );
|
||||
}
|
||||
}
|
||||
|
||||
if( list.isEmpty() ) {
|
||||
throw new Exception("no data!!!");
|
||||
}
|
||||
String iomapPath = monitoringContext.getStringProperty(MonitoringContext.IOMAP_DOWNLOAD_PATH);
|
||||
String path = iomapPath + serviceType + File.separator + folder + File.separator ;
|
||||
|
||||
String buffer = historyService.parse(serviceType, iomapPath, id, list);
|
||||
|
||||
File directory = new File(path);
|
||||
if (!directory.exists()){
|
||||
if (!directory.mkdirs()){
|
||||
throw new Exception("디렉토리 생성 오류입니다."+path);
|
||||
}
|
||||
}
|
||||
|
||||
path = path +id+".csv";
|
||||
File file = new File(path);
|
||||
os = new FileOutputStream(file);
|
||||
bos = new BufferedOutputStream(os);
|
||||
|
||||
bos.write(buffer.getBytes());
|
||||
bos.flush();
|
||||
|
||||
file.setWritable(true,false);
|
||||
file.setReadable(true,false);
|
||||
file.setExecutable(true,true);
|
||||
|
||||
|
||||
logger.info("download success file [" + path +"]");
|
||||
HashMap<String,String> result = new HashMap<String,String>();
|
||||
result.put("result", "Y");
|
||||
result.put("file", path);
|
||||
return new ModelAndView(view, "result", result);
|
||||
}catch(Exception e){
|
||||
HashMap<String,String> result = new HashMap<String,String>();
|
||||
logger.error("HistoryController - " + e.getMessage());
|
||||
result.put("result", "N");
|
||||
result.put("errMsg", e.getMessage());
|
||||
return new ModelAndView(view, "result", result);
|
||||
}
|
||||
finally {
|
||||
try { if(bos != null) bos.close(); } catch(Exception e) {}
|
||||
try { if(os != null) os.close(); } catch(Exception e) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,81 @@
|
||||
package com.eactive.eai.rms.onl.loader.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceContextHolder;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
||||
import com.eactive.eai.rms.common.interceptor.InterceptorSkipController;
|
||||
import com.eactive.eai.rms.common.util.CommonConstants;
|
||||
import com.eactive.eai.rms.onl.loader.service.SearchService;
|
||||
|
||||
@Controller
|
||||
public class SearchController implements InterceptorSkipController {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(SearchController.class);
|
||||
|
||||
@Autowired
|
||||
@Qualifier("searchService")
|
||||
private SearchService searchService;
|
||||
|
||||
/**
|
||||
* 형상관리에서 자원정보를 조회한다.
|
||||
* *
|
||||
* @param request
|
||||
* @param response
|
||||
* @param schema
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/search.json",params="cmd=LIST")
|
||||
public ModelAndView search(HttpServletRequest request, HttpServletResponse response
|
||||
, String serviceType , @RequestParam HashMap<String,Object> paramMap ) throws Exception {
|
||||
|
||||
if (!DataSourceTypeManager.isOnlineForName(serviceType)){
|
||||
HashMap<String,String> result = new HashMap<String,String>();
|
||||
result.put("status", "error");
|
||||
result.put("message", "정의 되지 않은 서비스 타입입니다. 받은 서비스 타입="+ serviceType);
|
||||
return new ModelAndView("jsonView",result);
|
||||
}
|
||||
//serviceType 설정
|
||||
if (serviceType != null) {
|
||||
request.getSession().setAttribute(CommonConstants.SERVICE_TYPE_KEY, serviceType);
|
||||
DataSourceType dt = DataSourceTypeManager.getDataSourceType(serviceType);
|
||||
if(dt != null){
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HashMap map = searchService.selectList( request,0, 0, paramMap);
|
||||
|
||||
|
||||
Map resultMap = new HashMap();
|
||||
//resultMap.put("records", pageVo.getTotalCount());//전체 레코드건수
|
||||
resultMap.put("rows" , map.get("list"));
|
||||
|
||||
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView",resultMap);
|
||||
return modelAndView;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.eactive.eai.rms.onl.loader.dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
|
||||
/**
|
||||
* The Class LayoutDao.
|
||||
* <ul>
|
||||
* <li>1. Function :</li>
|
||||
* <li>2. Summary :</li>
|
||||
* <li>3. Notification :</li>
|
||||
* </ul>
|
||||
*/
|
||||
public interface HistoryDao {
|
||||
|
||||
public ArrayList getEaiMessageList(DataSourceType dt,String userId) ;
|
||||
public ArrayList getLayoutList(DataSourceType dt,String userId) ;
|
||||
public ArrayList getTransformList(DataSourceType dt,String userId) ;
|
||||
|
||||
public ArrayList getMessageListByInterface(DataSourceType dt, String interfaceId) ;
|
||||
public ArrayList getLayoutListByInterface(DataSourceType dt, String interfaceId) ;
|
||||
public ArrayList getTransformListByInterface(DataSourceType dt, String interfaceId) ;
|
||||
|
||||
public ArrayList getLayoutListByLyoutNames(DataSourceType dt, String[] eaiLoutNames);
|
||||
public ArrayList getTranstormListByTransformNames(DataSourceType dt, String[] cnvsnNames);
|
||||
public ArrayList getAdapterListByAdapterNames(DataSourceType dt, String[] adapterNames);
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.eactive.eai.rms.onl.loader.dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.eactive.eai.rms.common.base.SqlMapClientTemplateDao;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceContextHolder;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
|
||||
/**
|
||||
* The Class LayoutDao.
|
||||
* <ul>
|
||||
* <li>1. Function :</li>
|
||||
* <li>2. Summary :</li>
|
||||
* <li>3. Notification :</li>
|
||||
* </ul>
|
||||
*/
|
||||
@Repository("historyDao")
|
||||
@SuppressWarnings("unchecked")
|
||||
public class HistoryDaoImpl extends SqlMapClientTemplateDao implements HistoryDao {
|
||||
|
||||
public ArrayList getEaiMessageList(DataSourceType dt, String userId) {
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
HashMap hm = new HashMap();
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
hm.put("userId", userId);
|
||||
return (ArrayList) this.template.queryForList("History.getEaiMessageList", hm);
|
||||
}
|
||||
|
||||
public ArrayList getLayoutList(DataSourceType dt, String userId) {
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
HashMap hm = new HashMap();
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
hm.put("userId", userId);
|
||||
return (ArrayList) this.template.queryForList("History.getLayoutList", hm);
|
||||
}
|
||||
|
||||
public ArrayList getTransformList(DataSourceType dt, String userId) {
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
HashMap hm = new HashMap();
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
hm.put("userId", userId);
|
||||
return (ArrayList) this.template.queryForList("History.getTransformList", hm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getMessageListByInterface(DataSourceType dt, String interfaceId) {
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
HashMap hm = new HashMap();
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
hm.put("interfaceId", interfaceId);
|
||||
return (ArrayList) this.template.queryForList("History.getMessageListByInterface", hm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getLayoutListByInterface(DataSourceType dt, String interfaceId) {
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
HashMap hm = new HashMap();
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
hm.put("interfaceId", interfaceId);
|
||||
return (ArrayList) this.template.queryForList("History.getLayoutListByInterface", hm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getTransformListByInterface(DataSourceType dt, String interfaceId) {
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
HashMap hm = new HashMap();
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
hm.put("interfaceId", interfaceId);
|
||||
return (ArrayList) this.template.queryForList("History.getTransformListByInterface", hm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getLayoutListByLyoutNames(DataSourceType dt, String[] eaiLoutNames) {
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
HashMap hm = new HashMap();
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
hm.put("loutNames", eaiLoutNames);
|
||||
return (ArrayList) this.template.queryForList("History.getLayoutListByLyoutNames", hm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getTranstormListByTransformNames(DataSourceType dt, String[] cnvsnNames) {
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
HashMap hm = new HashMap();
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
hm.put("cnvsnNames", cnvsnNames);
|
||||
return (ArrayList) this.template.queryForList("History.getTransformtListByCnvsnNames", hm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getAdapterListByAdapterNames(DataSourceType dt, String[] adapterNames) {
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
HashMap hm = new HashMap();
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
hm.put("adapterNames", adapterNames);
|
||||
return (ArrayList) this.template.queryForList("History.getAdapterListByAdapterNames", hm);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.eactive.eai.rms.onl.loader.dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
|
||||
/**
|
||||
* The Class LayoutDao.
|
||||
* <ul>
|
||||
* <li>1. Function :</li>
|
||||
* <li>2. Summary :</li>
|
||||
* <li>3. Notification :</li>
|
||||
* </ul>
|
||||
*/
|
||||
public interface LoaderDao {
|
||||
|
||||
public int load(DataSourceType dt,String table, ArrayList list) ;
|
||||
|
||||
public int adapterLoadSync(DataSourceType dt,String table, ArrayList list) ;
|
||||
|
||||
public int delete(DataSourceType dt,String table, HashMap hm) ;
|
||||
|
||||
public int updateNode(DataSourceType dt,String instName) ;
|
||||
|
||||
public int updateInst(DataSourceType dt,String type, String value) ;
|
||||
|
||||
|
||||
public List<LinkedHashMap> selectTable(DataSourceType dt,String tableName ,String key, String value) ;
|
||||
|
||||
public int insertTable(DataSourceType dt,final String table, ArrayList list) ;
|
||||
|
||||
public List<LinkedHashMap> selectTableData( DataSourceType dataSourceType, String tableName, String key1, String param1 ) ;
|
||||
|
||||
public List<LinkedHashMap> selectTableDataLike( DataSourceType dataSourceType, String tableName, String key1, String param1 );
|
||||
|
||||
public List<LinkedHashMap> selectDataForTableName( DataSourceType dataSourceType, String tableName, String key1, String param1 ) ;
|
||||
|
||||
public List<LinkedHashMap> selectTableDataForListValue( DataSourceType dataSourceType, String tableName, String key1, List<String> param1 ) ;
|
||||
|
||||
public List<LinkedHashMap> selectSnaAdpApList( DataSourceType dataSourceType, String param1 ) ;
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
package com.eactive.eai.rms.onl.loader.dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.eactive.eai.rms.common.base.SqlMapClientTemplateDao;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
|
||||
/**
|
||||
* The Class LayoutDao.
|
||||
* <ul>
|
||||
* <li>1. Function :</li>
|
||||
* <li>2. Summary :</li>
|
||||
* <li>3. Notification :</li>
|
||||
* </ul>
|
||||
*/
|
||||
@Repository("loaderDao")
|
||||
@SuppressWarnings("unchecked")
|
||||
public class LoaderDaoImpl extends SqlMapClientTemplateDao implements LoaderDao {
|
||||
|
||||
public int load(DataSourceType dt,final String table, ArrayList list) {
|
||||
// DataSourceContextHolder.setDataSourceType(dt);
|
||||
int count = 0;
|
||||
HashMap hm = (HashMap)list.get(0);
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
this.template.update("Loader.delete"+table, hm);
|
||||
|
||||
for (int i=0;i<list.size();i++){
|
||||
hm = (HashMap)list.get(i);
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
count = count + this.template.update("Loader.insert"+table, hm);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
// Adapter Loading Sync
|
||||
public int adapterLoadSync(DataSourceType dt,final String table, ArrayList list) {
|
||||
// DataSourceContextHolder.setDataSourceType(dt);
|
||||
int count = 0;
|
||||
HashMap hm = (HashMap)list.get(0);
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
|
||||
if(hm.containsKey("ADPTRUSEYN") && !"0".equals(hm.get("ADPTRUSEYN")))
|
||||
hm.put("ADPTRUSEYN", "0");
|
||||
|
||||
this.template.update("Loader.delete"+table, hm);
|
||||
|
||||
for (int i=0;i<list.size();i++){
|
||||
hm = (HashMap)list.get(i);
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
count = count + this.template.update("Loader.insert"+table, hm);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public int delete(DataSourceType dt,final String table, HashMap hm) {
|
||||
// DataSourceContextHolder.setDataSourceType(dt);
|
||||
//int count = 0;
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
return this.template.update("Loader.delete"+table, hm);
|
||||
}
|
||||
|
||||
|
||||
public int updateNode(DataSourceType dt,String instName) {
|
||||
//int count = 0;
|
||||
// DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
HashMap hm = new HashMap();
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
hm.put("instName", instName);
|
||||
return this.template.update("Loader.updateNode", hm);
|
||||
}
|
||||
|
||||
public int updateInst(DataSourceType dt,String type, String value) {
|
||||
//int count = 0;
|
||||
// DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
HashMap hm = new HashMap();
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
hm.put("type", type);
|
||||
hm.put("value", value);
|
||||
return this.template.update("Loader.updateInst", hm);
|
||||
}
|
||||
public List<LinkedHashMap> selectTable(DataSourceType dt,String tableName ,String key, String value) {
|
||||
//int count = 0;
|
||||
// DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
HashMap hm = new HashMap();
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
hm.put("tableName", tableName);
|
||||
hm.put("key", key);
|
||||
hm.put("value", value);
|
||||
return this.template.queryForList("Loader.selectTable", hm);
|
||||
}
|
||||
public int insertTable(DataSourceType dt,final String tableName, ArrayList list) {
|
||||
// DataSourceContextHolder.setDataSourceType(dt);
|
||||
int count = 0;
|
||||
HashMap hm = new HashMap();
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
hm.put("tableName", tableName);
|
||||
this.template.update("Loader.deleteTable", hm);
|
||||
|
||||
LinkedHashMap column = (LinkedHashMap)((LinkedHashMap)list.get(0)).clone();
|
||||
ArrayList columnList = new ArrayList();
|
||||
for (Object o:column.keySet()){
|
||||
String key = (String)o;
|
||||
columnList.add(key);
|
||||
}
|
||||
|
||||
LinkedHashMap<String,Object> value = new LinkedHashMap<String,Object>();
|
||||
for (int i=0;i<list.size();i++){
|
||||
value = (LinkedHashMap)list.get(i);
|
||||
|
||||
ArrayList valueList = new ArrayList();
|
||||
for (Object o:value.keySet()){
|
||||
String key = (String)o;
|
||||
valueList.add(value.get(key));
|
||||
}
|
||||
hm.put("schemaId", dt.getSchema());
|
||||
hm.put("tableName", tableName);
|
||||
hm.put("columnList", columnList);
|
||||
hm.put("valueList", valueList);
|
||||
count = count + this.template.update("Loader.insertTable", hm);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public List<LinkedHashMap> selectTableData( DataSourceType dataSourceType, String tableName, String key1, String param1 ) {
|
||||
final HashMap param = new HashMap();
|
||||
param.put("tableName", tableName);
|
||||
param.put("key1", key1);
|
||||
param.put("param1", param1);
|
||||
|
||||
return template.queryForList("Loader.selectTableData", param);
|
||||
|
||||
// return new SpecifiedDataSourceExecutor<List<LinkedHashMap>>(
|
||||
// dataSourceType) {
|
||||
// protected List<LinkedHashMap> doExecute() throws Exception {
|
||||
// return template.queryForList("Loader.selectTableData", param);
|
||||
// }
|
||||
// }.execute();
|
||||
}
|
||||
public List<LinkedHashMap> selectTableDataLike( DataSourceType dataSourceType, String tableName, String key1, String param1 ) {
|
||||
final HashMap param = new HashMap();
|
||||
|
||||
param.put("tableName", tableName);
|
||||
param.put("key1", key1);
|
||||
param.put("param1", param1);
|
||||
|
||||
return template.queryForList("Loader.selectTableDataLike", param);
|
||||
|
||||
// return new SpecifiedDataSourceExecutor<List<LinkedHashMap>>(
|
||||
// dataSourceType) {
|
||||
// protected List<LinkedHashMap> doExecute() throws Exception {
|
||||
// return template.queryForList("Loader.selectTableDataLike", param);
|
||||
// }
|
||||
// }.execute();
|
||||
}
|
||||
public List<LinkedHashMap> selectDataForTableName( DataSourceType dataSourceType, String tableName, String key1, String param1 ) {
|
||||
final HashMap param = new HashMap();
|
||||
param.put("key1", key1);
|
||||
param.put("param1", param1);
|
||||
|
||||
return template.queryForList("Loader.selectDataFor"+tableName, param);
|
||||
|
||||
// return new SpecifiedDataSourceExecutor<List<LinkedHashMap>>(
|
||||
// dataSourceType) {
|
||||
// protected List<LinkedHashMap> doExecute() throws Exception {
|
||||
// return template.queryForList("Loader.selectDataFor"+tableName, param);
|
||||
// }
|
||||
// }.execute();
|
||||
}
|
||||
public List<LinkedHashMap> selectTableDataForListValue( DataSourceType dataSourceType, String tableName, String key1, List<String> param1 ) {
|
||||
final HashMap param = new HashMap();
|
||||
param.put("tableName", tableName);
|
||||
param.put("key1", key1);
|
||||
param.put("param1", param1);
|
||||
|
||||
return template.queryForList("Loader.selectTableDataForListValue", param);
|
||||
|
||||
// return new SpecifiedDataSourceExecutor<List<LinkedHashMap>>(
|
||||
// dataSourceType) {
|
||||
// protected List<LinkedHashMap> doExecute() throws Exception {
|
||||
// return template.queryForList("Loader.selectTableDataForListValue", param);
|
||||
// }
|
||||
// }.execute();
|
||||
}
|
||||
public List<LinkedHashMap> selectSnaAdpApList( DataSourceType dataSourceType, String param1 ) {
|
||||
final HashMap param = new HashMap();
|
||||
param.put("param1", param1);
|
||||
|
||||
return template.queryForList("Loader.selectSnaAdpApList", param);
|
||||
|
||||
// return new SpecifiedDataSourceExecutor<List<LinkedHashMap>>(
|
||||
// dataSourceType) {
|
||||
// protected List<LinkedHashMap> doExecute() throws Exception {
|
||||
// return template.queryForList("Loader.selectSnaAdpApList", param);
|
||||
// }
|
||||
// }.execute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.eactive.eai.rms.onl.loader.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.eactive.eai.rms.onl.loader.vo.RuleDeployJobItemVo;
|
||||
import com.eactive.eai.rms.onl.loader.vo.RuleDeployJobVo;
|
||||
|
||||
public interface RuleDeployJobDao {
|
||||
|
||||
public void insert(RuleDeployJobVo jobVo) throws Exception;
|
||||
|
||||
public void insertItem(RuleDeployJobItemVo itemVo) throws Exception;
|
||||
|
||||
public void update(RuleDeployJobVo jobVo) throws Exception;
|
||||
|
||||
public RuleDeployJobVo selectOne(String jobId) throws Exception;
|
||||
|
||||
public List<RuleDeployJobItemVo> selectItems(String jobId) throws Exception;
|
||||
|
||||
public List<RuleDeployJobVo> selectJobAll(RuleDeployJobVo searchJobVo, int startIdx, int endIdx) throws Exception;
|
||||
|
||||
public void deleteHistory(String dateTime) throws Exception;
|
||||
|
||||
public void deleteItemHistory(String dateTime) throws Exception;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public int selectListCount(HashMap paramMap) throws Exception;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public List selectList(HashMap paramMap) throws Exception;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public HashMap selectJobDetail(HashMap<String, Object> paramMap) throws Exception;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public List<HashMap> selectJobItems(HashMap<String, Object> paramMap) throws Exception;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void delete(HashMap paramMap) throws Exception;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void deleteJobItems(HashMap paramMap) throws Exception;
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.eactive.eai.rms.onl.loader.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.eactive.eai.rms.common.base.SqlMapClientForMonitoringTemplateDao;
|
||||
import com.eactive.eai.rms.onl.loader.vo.RuleDeployJobItemVo;
|
||||
import com.eactive.eai.rms.onl.loader.vo.RuleDeployJobVo;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Repository("ruleDeployJobDao")
|
||||
public class RuleDeployJobDaoImpl extends SqlMapClientForMonitoringTemplateDao implements RuleDeployJobDao {
|
||||
|
||||
@Override
|
||||
public void insert(RuleDeployJobVo jobVo) throws Exception {
|
||||
this.template.insert("RuleDeployJob.insert", jobVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertItem(RuleDeployJobItemVo itemVo) throws Exception {
|
||||
this.template.insert("RuleDeployJob.insertItem", itemVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(RuleDeployJobVo jobVo) throws Exception {
|
||||
this.template.insert("RuleDeployJob.update", jobVo);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public RuleDeployJobVo selectOne(String jobId) throws Exception {
|
||||
HashMap paramMap = new HashMap();
|
||||
paramMap.put("jobId", jobId);
|
||||
return (RuleDeployJobVo) template.queryForObject("RuleDeployJob.selectDetail", paramMap);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public List<RuleDeployJobItemVo> selectItems(String jobId) throws Exception {
|
||||
HashMap paramMap = new HashMap();
|
||||
paramMap.put("jobId", jobId);
|
||||
return (List<RuleDeployJobItemVo>) template.queryForList("RuleDeployJob.selectItems", paramMap);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public List<RuleDeployJobVo> selectJobAll(RuleDeployJobVo searchJobVo, int startIdx, int endIdx) throws Exception {
|
||||
HashMap paramMap = new HashMap();
|
||||
paramMap.put("jobId", StringUtils.defaultString(searchJobVo.getJobId()));
|
||||
paramMap.put("jobTitle", StringUtils.defaultString(searchJobVo.getJobTitle()));
|
||||
paramMap.put("serviceType", StringUtils.defaultString(searchJobVo.getServiceType()));
|
||||
paramMap.put("status", StringUtils.defaultString(searchJobVo.getStatus()));
|
||||
paramMap.put("scheduledDateTime", StringUtils.defaultString(searchJobVo.getScheduledDateTime()));
|
||||
paramMap.put("startNum", startIdx);
|
||||
paramMap.put("endNum", endIdx);
|
||||
return (List<RuleDeployJobVo>) template.queryForList("RuleDeployJob.selectJobAll", paramMap);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void deleteHistory(String dateTime) throws Exception {
|
||||
HashMap paramMap = new HashMap();
|
||||
paramMap.put("jobId", dateTime);
|
||||
this.template.delete("RuleDeployJob.deleteHistory", paramMap);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void deleteItemHistory(String dateTime) throws Exception {
|
||||
HashMap paramMap = new HashMap();
|
||||
paramMap.put("jobId", dateTime);
|
||||
this.template.delete("RuleDeployJob.deleteItemHistory", paramMap);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public int selectListCount(HashMap paramMap) throws Exception {
|
||||
return (Integer) template.queryForObject("RuleDeployJob.selectListCount", paramMap);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public List selectList(HashMap paramMap) throws Exception {
|
||||
return template.queryForList("RuleDeployJob.selectList", paramMap);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public HashMap selectJobDetail(HashMap<String, Object> paramMap) throws Exception {
|
||||
return (HashMap) template.queryForObject("RuleDeployJob.selectJobDetail", paramMap);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public List<HashMap> selectJobItems(HashMap<String, Object> paramMap) throws Exception {
|
||||
return template.queryForList("RuleDeployJob.selectListJobItems", paramMap);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes" })
|
||||
@Override
|
||||
public void delete(HashMap paramMap) throws Exception {
|
||||
this.template.delete("RuleDeployJob.delete", paramMap);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes" })
|
||||
@Override
|
||||
public void deleteJobItems(HashMap paramMap) throws Exception {
|
||||
this.template.delete("RuleDeployJob.deleteJobItems", paramMap);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.eactive.eai.rms.onl.loader.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.eactive.eai.rms.common.base.SqlMapClientTemplateDao;
|
||||
|
||||
/**
|
||||
* ÀÚ¿ø Á¶È¸
|
||||
* <ul>
|
||||
* <li>1. Function :</li>
|
||||
* <li>2. Summary :</li>
|
||||
* <li>3. Notification :</li>
|
||||
* </ul>
|
||||
*/
|
||||
@Repository("searchDao")
|
||||
@SuppressWarnings("unchecked")
|
||||
public class SearchDao extends SqlMapClientTemplateDao {
|
||||
|
||||
public List<LinkedHashMap> selectList(HashMap<String,Object> param) {
|
||||
return this.template.queryForList("Search.selectList", param);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf;
|
||||
|
||||
import com.eactive.eai.rms.data.entity.onl.b2bextract.B2bExtractService;
|
||||
import com.eactive.eai.rms.data.entity.onl.bizkey.BizKeyService;
|
||||
import com.eactive.eai.rms.data.entity.onl.eaimsg.EAIMessageService;
|
||||
import com.eactive.eai.rms.data.entity.onl.stdmessage.StandardMessageInfoService;
|
||||
import com.eactive.eai.rms.data.entity.onl.submessage.SubMessageInfoService;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.EAIMessageDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.ServiceMessageDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.intf.mapper.*;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service("OnlInterfaceDeployService")
|
||||
@Transactional
|
||||
@RequiredArgsConstructor
|
||||
public class InterfaceDeployService extends DeployService {
|
||||
|
||||
private final EAIMessageService eaiMessageService;
|
||||
private final EAIMessageDeployMapper eaiMessageDeployMapper;
|
||||
|
||||
private final BizKeyService bizKeyService;
|
||||
private final BizKeyDeployMapper bizKeyDeployMapper;
|
||||
|
||||
private final B2bExtractService b2bExtractService;
|
||||
private final B2BExtractDeployMapper b2BExtractDeployMapper;
|
||||
|
||||
private final StandardMessageInfoService standardMessageInfoService;
|
||||
private final StandardMessageInfoDeployMapper standardMessageInfoDeployMapper;
|
||||
|
||||
private final SubMessageInfoService subMessageInfoService;
|
||||
private final SubMessageInfoDeployMapper subMessageInfoDeployMapper;
|
||||
|
||||
public EAIMessageDeploy selectDeploy(String eaisvcname) {
|
||||
return eaiMessageService.findById(eaisvcname).map(eaiMessageDeployMapper::toVo).orElse(null);
|
||||
}
|
||||
|
||||
public void saveDeploy(EAIMessageDeploy eaiMessageDeploy) {
|
||||
deleteAndSave(eaiMessageDeploy, eaiMessageDeployMapper, eaiMessageService);
|
||||
|
||||
deleteExistsAndSaveAll(eaiMessageDeploy.getBizKeyDeploys(), bizKeyDeployMapper, bizKeyService);
|
||||
deleteExistsAndSaveAll(eaiMessageDeploy.getStandardMessageInfoDeploys(), standardMessageInfoDeployMapper, standardMessageInfoService);
|
||||
deleteExistsAndSaveAll(eaiMessageDeploy.getSubMessageInfoDeploys(), subMessageInfoDeployMapper, subMessageInfoService);
|
||||
deleteExistsAndSaveAll(
|
||||
eaiMessageDeploy.getServiceMessages().stream().map(ServiceMessageDeploy::getB2BExtractDeploy).filter(Objects::nonNull).collect(Collectors.toList()),
|
||||
b2BExtractDeployMapper, b2bExtractService);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.deploy;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.b2bextractor.B2BExtract;
|
||||
import com.eactive.eai.data.entity.onl.b2bextractor.B2BExtractId;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployResource;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import edu.emory.mathcs.backport.java.util.Arrays;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class B2BExtractDeploy extends DeployResource<B2BExtract> {
|
||||
|
||||
@Override
|
||||
public B2BExtract probeForExample() {
|
||||
B2BExtractId id = new B2BExtractId();
|
||||
id.setEaisvcname(this.eaisvcname);
|
||||
B2BExtract probe = new B2BExtract();
|
||||
probe.setId(id);
|
||||
return probe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> exactMatchFields() {
|
||||
return Arrays.asList(new String[]{
|
||||
"id.eaisvcname"
|
||||
});
|
||||
}
|
||||
|
||||
@JsonProperty("InterfaceServiceCode")
|
||||
private String eaisvcname;
|
||||
|
||||
@JsonProperty("Sequence")
|
||||
private Integer svcprcssno;
|
||||
|
||||
/*어댑터라우팅클래스명*/
|
||||
@JsonProperty("AdapterRoutingClass")
|
||||
private String adptrroutclsname;
|
||||
|
||||
/*서비스라우팅클래스명*/
|
||||
@JsonProperty("ServiceRoutingClass")
|
||||
private String svcroutclsname;
|
||||
|
||||
/*최종수정일시*/
|
||||
@JsonProperty("LastDateTime")
|
||||
private LocalDateTime eailastamndyms;
|
||||
|
||||
/*EAI서버구분코드*/
|
||||
@JsonProperty("ServerType")
|
||||
private String eaisevrdstcd;
|
||||
|
||||
/*변경관리상태구분코드*/
|
||||
@JsonProperty("StatusCode")
|
||||
private String modfimgtstusdstcd;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.deploy;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.bizkey.BizKey;
|
||||
import com.eactive.eai.data.entity.onl.bizkey.BizKeyId;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployResource;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import edu.emory.mathcs.backport.java.util.Arrays;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BizKeyDeploy extends DeployResource<BizKey> {
|
||||
|
||||
@Override
|
||||
public BizKey probeForExample() {
|
||||
BizKeyId id = new BizKeyId();
|
||||
id.setEaisvcname(this.eaisvcname);
|
||||
BizKey probe = new BizKey();
|
||||
probe.setId(id);
|
||||
return probe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> exactMatchFields() {
|
||||
return Arrays.asList(new String[]{
|
||||
"id.eaisvcname"
|
||||
});
|
||||
}
|
||||
|
||||
@JsonProperty("InterfaceServiceCode")
|
||||
private String eaisvcname;
|
||||
|
||||
/*추출구분*/
|
||||
@JsonProperty("ExtractorCode")
|
||||
private String etractdstcd;
|
||||
|
||||
/*순번*/
|
||||
@JsonProperty("Sequence")
|
||||
private Integer fldprcssno;
|
||||
|
||||
/*업무필드명*/
|
||||
@JsonProperty("FieldName")
|
||||
private String bzwkfldname;
|
||||
|
||||
/*eai최종수정일시*/
|
||||
@JsonProperty("LastDateTime")
|
||||
@JsonFormat(pattern = "yyyyMMddHHmmssSSS")
|
||||
private LocalDateTime eailastamndyms;
|
||||
|
||||
/*EAI서버구분코드*/
|
||||
@JsonProperty("ServerType")
|
||||
private String eaisevrdstcd;
|
||||
|
||||
/*변경관리상태구분코드*/
|
||||
@JsonProperty("StatusCode")
|
||||
private String modfimgtstusdstcd;
|
||||
|
||||
/*메시지유형*/
|
||||
@JsonProperty("MessageType")
|
||||
private String msgdstcd;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.deploy;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CondPerRtgInfoDeploy {
|
||||
|
||||
@JsonProperty("InterfaceServcieCode")
|
||||
private String eaisvcname;
|
||||
|
||||
@JsonProperty("Sequence")
|
||||
private Integer svcprcssno;
|
||||
|
||||
/*규칙번호*/
|
||||
@JsonProperty("RuleSequence")
|
||||
private Integer ruleserno;
|
||||
|
||||
/*비교값*/
|
||||
@JsonProperty("Compare")
|
||||
private String cmprctnt;
|
||||
|
||||
/*결과처리번호*/
|
||||
@JsonProperty("ResultSequence")
|
||||
private Integer rsultprcssno;
|
||||
|
||||
/*규칙필드그룹명*/
|
||||
@JsonProperty("RuleFieldGroup")
|
||||
private String rulefldgroupname;
|
||||
|
||||
/*규칙필드명*/
|
||||
@JsonProperty("RuleField")
|
||||
private String rulefldname;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.deploy;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.message.EAIMessageEntity;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployResource;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import edu.emory.mathcs.backport.java.util.Arrays;
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.Comment;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class EAIMessageDeploy extends DeployResource<EAIMessageEntity> {
|
||||
|
||||
@Override
|
||||
public EAIMessageEntity probeForExample() {
|
||||
EAIMessageEntity probe = new EAIMessageEntity();
|
||||
probe.setEaisvcname(this.eaisvcname);
|
||||
return probe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> exactMatchFields() {
|
||||
return Arrays.asList(new String[]{
|
||||
"eaisvcname"
|
||||
});
|
||||
}
|
||||
/*EAI서비스코드*/
|
||||
@JsonProperty("InterfaceServiceCode")
|
||||
private String eaisvcname;
|
||||
|
||||
@JsonProperty("Author")
|
||||
private String author;
|
||||
|
||||
/*오류요청변환ID명*/
|
||||
@JsonProperty("ErrorRequestTransform")
|
||||
private String dmnderrchngidname;
|
||||
|
||||
/*오류요청에러필드명*/
|
||||
@JsonProperty("ErrorRequestField")
|
||||
private String dmnderrfldname;
|
||||
|
||||
@JsonProperty("BisinessCode")
|
||||
private String eaibzwkdstcd;
|
||||
|
||||
/*EAI그룹회사코드*/
|
||||
@JsonProperty("GroupCode")
|
||||
private String eaigroupcocd;
|
||||
|
||||
@JsonProperty("LastDateTime")
|
||||
@JsonFormat(pattern = "yyyyMMddHHmmssSSS")
|
||||
private LocalDateTime eailastamndyms;
|
||||
|
||||
/*서버구분코드*/
|
||||
@JsonProperty("ServerType")
|
||||
private String eaisevrdstcd;
|
||||
|
||||
@JsonProperty("InterfaceServiceDescription")
|
||||
private String eaisvcdesc;
|
||||
|
||||
/*오류EAI서비스코드명*/
|
||||
@JsonProperty("ErrorInterfaceServiceCode")
|
||||
private String erreaisvcname;
|
||||
|
||||
/*대외업무구분*/
|
||||
@JsonProperty("ExternalBusinessCode")
|
||||
private String extbizcd;
|
||||
|
||||
/*FlowControl 라우팅명*/
|
||||
@JsonProperty("FlowControl")
|
||||
private String flowctrlroutname;
|
||||
|
||||
/*기동시스템어댑터업무그룹명*/
|
||||
@JsonProperty("SourceAdapter")
|
||||
private String gstatsysadptrbzwkgroupname;
|
||||
|
||||
/*내외부(서버)구분코드*/
|
||||
@JsonProperty("InternalExternalCode")
|
||||
private String internalexternaldvcd;
|
||||
|
||||
/*거래유형(ONLINE/BATCH/FTP)*/
|
||||
@JsonProperty("PatternType")
|
||||
private String intgradsticname;
|
||||
|
||||
@JsonProperty("StatusCode")
|
||||
private String modfimgtstusdstcd;
|
||||
|
||||
/*참조키*/
|
||||
@JsonProperty("ReferenceKey")
|
||||
private String refkey;
|
||||
|
||||
/*오류응답변환ID명*/
|
||||
@JsonProperty("ErrorResponseTransform")
|
||||
private String rspnserrchngidname;
|
||||
|
||||
/*오류응답변환ID명*/
|
||||
@JsonProperty("ErrorResponseField")
|
||||
private String rspnserrfldname;
|
||||
|
||||
/*서버 로그 레벨(WARNING[0]/INFO[1]/DEBUG[2])*/
|
||||
@JsonProperty("LogLevel")
|
||||
private Integer sevrloglvelno;
|
||||
|
||||
/*보조 로그 사용여부 현재는 안씀임 예전에 4000byte로 끊을때 쓰던거임*/
|
||||
@JsonProperty("AddLogUseYn")
|
||||
private String svcbfclmnlogyn;
|
||||
|
||||
/*업무운영 시간여부*/
|
||||
@JsonProperty("ServiceTimeYn")
|
||||
private String svchmseonot;
|
||||
|
||||
/*서비스 로그 레벨(로그off[0]/에러로그만[1]/동기100,400,비동기200,400[2]/전체로그[3]/업무데이터제외[4])*/
|
||||
@JsonProperty("ServiceLogLevel")
|
||||
private Integer svcloglvelno;
|
||||
|
||||
/*인터페이스 사용유형(SYNC/ASYN/ACKO)*/
|
||||
@JsonProperty("SyncAsyncType")
|
||||
private String svcmotivusedstcd;
|
||||
|
||||
/*서비스처리유형(SINGLE/COMPLEX/PCOMPLEX/TIMER)*/
|
||||
@JsonProperty("ServiceProcessType")
|
||||
private String svcprcesdsticname;
|
||||
|
||||
/*거래유형(R:일반거래/S:중단거래/T:시뮬레이션거래)*/
|
||||
@JsonProperty("SimulationType")
|
||||
private String trantype;
|
||||
|
||||
/*거래ID*/
|
||||
@JsonProperty("ServiceId")
|
||||
private String txid;
|
||||
|
||||
@JsonProperty("UseYn")
|
||||
private String useyn;
|
||||
|
||||
@JsonProperty("VersionInfo")
|
||||
private String verinfo;
|
||||
|
||||
@JsonProperty("AuthType")
|
||||
private String authtype;
|
||||
|
||||
@JsonProperty("services")
|
||||
private List<ServiceMessageDeploy> serviceMessages = new ArrayList<>();
|
||||
|
||||
@JsonProperty("bizKeys")
|
||||
private List<BizKeyDeploy> bizKeyDeploys = new ArrayList<>();
|
||||
|
||||
@JsonProperty("standardMessages")
|
||||
private List<StandardMessageInfoDeploy> standardMessageInfoDeploys = new ArrayList<>();
|
||||
|
||||
@JsonProperty("subMessages")
|
||||
private List<SubMessageInfoDeploy> subMessageInfoDeploys = new ArrayList<>();
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.deploy;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class EAIReferenceMessageDeploy {
|
||||
|
||||
@JsonProperty("InterfaceServcieCode")
|
||||
private String eaisvcname;
|
||||
|
||||
@JsonProperty("Sequence")
|
||||
private Integer svcprcssno;
|
||||
|
||||
/*참조메세지번호명*/
|
||||
@JsonProperty("ReferenceMessageSequence")
|
||||
private Integer refmsgidno;
|
||||
|
||||
/*참조메시지ID명*/
|
||||
@JsonProperty("ReferenceMessageName")
|
||||
private String refmsgidname;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.deploy;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ServiceMessageDeploy {
|
||||
|
||||
@JsonProperty("InterfaceServcieCode")
|
||||
private String eaisvcname;
|
||||
|
||||
@JsonProperty("Sequence")
|
||||
private Integer svcprcssno;
|
||||
|
||||
/*수동인터페이스유형 (SYNC/ASYN)*/
|
||||
@JsonProperty("SyncAsyncType")
|
||||
private String psvintfacdsticname;
|
||||
|
||||
/*수동업무시스템명*/
|
||||
@JsonProperty("BusinessCode")
|
||||
private String psvsysbzwkdstcd;
|
||||
|
||||
/*수동시스템ID*/
|
||||
@JsonProperty("TargetSystem")
|
||||
private String psvsysidname;
|
||||
|
||||
/*수동시스템서비스구분명*/
|
||||
@JsonProperty("TargetSystemName")
|
||||
private String psvsyssvcdsticname;
|
||||
|
||||
/*수동시스템어댑터업무그룹명*/
|
||||
@JsonProperty("TargetAdapter")
|
||||
private String psvsysadptrbzwkgroupname;
|
||||
|
||||
/*FailOver여부*/
|
||||
@JsonProperty("FailOverYn")
|
||||
private String flovryn;
|
||||
|
||||
/*변환유무*/
|
||||
@JsonProperty("TransformYn")
|
||||
private String chngeonot;
|
||||
|
||||
/*변환메시지ID*/
|
||||
@JsonProperty("Transform")
|
||||
private String chngmsgidname;
|
||||
|
||||
/*기본응답메시지비교값*/
|
||||
@JsonProperty("ResponseMessageContent")
|
||||
private String bascrspnsmsgcmprctnt;
|
||||
|
||||
/*기본응답변환유무*/
|
||||
@JsonProperty("ResponseTransformYn")
|
||||
private String bascrspnschngeonot;
|
||||
|
||||
/*기본응답변환메시지ID*/
|
||||
@JsonProperty("ResponseTransform")
|
||||
private String bascrspnschngmsgidname;
|
||||
|
||||
/*오류응답메시지비교값*/
|
||||
@JsonProperty("ErrorMessageContent")
|
||||
private String errrspnsmsgcmprctnt;
|
||||
|
||||
/*오류응답변환유무*/
|
||||
@JsonProperty("ErrorTransformYn")
|
||||
private String errrspnschngeonot;
|
||||
|
||||
/*오류응답변환메시지ID*/
|
||||
@JsonProperty("ErrorTransform")
|
||||
private String errrspnschngmsgidname;
|
||||
|
||||
/*다음서비스처리번호*/
|
||||
@JsonProperty("NextSequence")
|
||||
private Integer nextsvcprcssno;
|
||||
|
||||
/*Outbound라우팅명*/
|
||||
@JsonProperty("Outbound")
|
||||
private String outbndroutname;
|
||||
|
||||
/*타임아웃값*/
|
||||
@JsonProperty("TimeoutValue")
|
||||
private Long toutval;
|
||||
|
||||
/*보상서비스처리코드*/
|
||||
@JsonProperty("RecoverServiceName")
|
||||
private String cmpensvcprcssdsticname;
|
||||
|
||||
/*추가삭제여부*/
|
||||
@JsonProperty("AddDelProcessYn")
|
||||
private String suppldelyn;
|
||||
|
||||
/*헤더제어구분코드*/
|
||||
@JsonProperty("HeaderControlCode")
|
||||
private String hdrctrldstcd;
|
||||
|
||||
/*참고클래스명*/
|
||||
@JsonProperty("HeaderReferenceClass")
|
||||
private String hdrrefclsname;
|
||||
|
||||
/*REST 옵션*/
|
||||
@JsonProperty("RestOption")
|
||||
private String restoption;
|
||||
|
||||
/*타임아웃 코드*/
|
||||
@JsonProperty("TimeoutCode")
|
||||
private String timeoutcode;
|
||||
|
||||
|
||||
@JsonProperty("referenceMessages")
|
||||
private List<EAIReferenceMessageDeploy> eaiReferenceMessageDeploys = new ArrayList<>();
|
||||
|
||||
@JsonProperty("conditionRoutings")
|
||||
private List<CondPerRtgInfoDeploy> condPerRtgInfoDeploys = new ArrayList<>();
|
||||
|
||||
@JsonProperty("b2b")
|
||||
private B2BExtractDeploy b2BExtractDeploy;
|
||||
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.deploy;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.stdmessage.StandardMessageInfo;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployResource;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import edu.emory.mathcs.backport.java.util.Arrays;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class StandardMessageInfoDeploy extends DeployResource<StandardMessageInfo> {
|
||||
|
||||
@Override
|
||||
public StandardMessageInfo probeForExample() {
|
||||
StandardMessageInfo probe = new StandardMessageInfo();
|
||||
probe.setEaisvcname(this.eaisvcname);
|
||||
return probe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> exactMatchFields() {
|
||||
return Arrays.asList(new String[]{
|
||||
"eaisvcname"
|
||||
});
|
||||
}
|
||||
/*비표준메시지 서비스키*/
|
||||
@JsonProperty("BusinessServiceKey")
|
||||
private String bzwksvckeyname;
|
||||
|
||||
@JsonProperty("InterfaceServiceCode")
|
||||
private String eaisvcname;
|
||||
|
||||
/*EAI거래코드*/
|
||||
@JsonProperty("InterfaceCode")
|
||||
private String eaitranname;
|
||||
|
||||
/*송수신구분코드*/
|
||||
@JsonProperty("SendRecvCode")
|
||||
private String eaisendrecv;
|
||||
|
||||
/*내외부구분코드*/
|
||||
@JsonProperty("InternalExternalCode")
|
||||
private String eaidirection;
|
||||
|
||||
/*EAI서버기능구분코드*/
|
||||
@JsonProperty("ServerType")
|
||||
private String eaisevrdstcd;
|
||||
|
||||
/*수정상태구분코드*/
|
||||
@JsonProperty("StatusCode")
|
||||
private String modfimgtstusdstcd;
|
||||
|
||||
/*최종수정시간*/
|
||||
@JsonProperty("LastDateTime")
|
||||
@JsonFormat(pattern = "yyyyMMddHHmmssSSS")
|
||||
private LocalDateTime eailastamndyms;
|
||||
|
||||
@JsonProperty("standardMessageItems")
|
||||
private List<StandardMessageItemDeploy> standardMessageItemDeploys;
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.deploy;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StandardMessageItemDeploy {
|
||||
|
||||
@JsonProperty("BisinessServiceKey")
|
||||
private String bzwksvckeyname;
|
||||
|
||||
@JsonProperty("ColumnName")
|
||||
private String columnname;
|
||||
|
||||
@JsonProperty("ColumnValue")
|
||||
private String columnvalue;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.deploy;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.submessage.SubMessageInfo;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployResource;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import edu.emory.mathcs.backport.java.util.Arrays;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SubMessageInfoDeploy extends DeployResource<SubMessageInfo> {
|
||||
|
||||
@Override
|
||||
public SubMessageInfo probeForExample() {
|
||||
SubMessageInfo probe = new SubMessageInfo();
|
||||
probe.setBzwksvckeyname(this.bzwksvckeyname);
|
||||
return probe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> exactMatchFields() {
|
||||
return Arrays.asList(new String[]{
|
||||
"bzwksvckeyname"
|
||||
});
|
||||
}
|
||||
|
||||
@JsonProperty("BusinessServiceKey")
|
||||
private String bzwksvckeyname;
|
||||
|
||||
/*수정상태구분코드*/
|
||||
@JsonProperty("StatusCode")
|
||||
private String modfimgtstusdstcd;
|
||||
|
||||
/*최종수정시간*/
|
||||
@JsonProperty("LastDateTime")
|
||||
@JsonFormat(pattern = "yyyyMMddHHmmssSSS")
|
||||
private LocalDateTime eailastamndyms;
|
||||
|
||||
@JsonProperty("subMessageItems")
|
||||
private List<SubMessageItemDeploy> subMessageItemDeploys;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.deploy;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SubMessageItemDeploy {
|
||||
|
||||
@JsonProperty("BZWKSVCKEYNAME")
|
||||
private String bzwksvckeyname;
|
||||
|
||||
@JsonProperty("COLUMNNAME")
|
||||
private String columnname;
|
||||
|
||||
@JsonProperty("COLUMNVALUE")
|
||||
private String columnvalue;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.mapper;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.b2bextractor.B2BExtract;
|
||||
import com.eactive.eai.data.entity.onl.bizkey.BizKey;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.B2BExtractDeploy;
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class)
|
||||
public interface B2BExtractDeployMapper extends GenericMapper<B2BExtractDeploy, B2BExtract> {
|
||||
|
||||
@Mapping(source = "id.eaisvcname", target = "eaisvcname")
|
||||
@Mapping(source = "id.svcprcssno", target = "svcprcssno")
|
||||
B2BExtractDeploy toVo(B2BExtract b2BExtract);
|
||||
|
||||
@InheritInverseConfiguration
|
||||
B2BExtract toEntity(B2BExtractDeploy b2BExtractDeploy);
|
||||
|
||||
List<B2BExtract> map(List<B2BExtractDeploy> vos);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.mapper;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.bizkey.BizKey;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.BizKeyDeploy;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class)
|
||||
public interface BizKeyDeployMapper extends GenericMapper<BizKeyDeploy, BizKey> {
|
||||
|
||||
@Mapping(source = "id.eaisvcname", target = "eaisvcname")
|
||||
@Mapping(source = "id.etractdstcd", target = "etractdstcd")
|
||||
@Mapping(source = "id.fldprcssno", target = "fldprcssno")
|
||||
BizKeyDeploy toVo(BizKey bizKey);
|
||||
|
||||
@InheritInverseConfiguration
|
||||
BizKey toEntity(BizKeyDeploy bizKeyDeploy);
|
||||
|
||||
List<BizKey> map(List<BizKeyDeploy> vos);
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.mapper;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.message.CondPerRtgInfoEntity;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.CondPerRtgInfoDeploy;
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
import javax.persistence.Column;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class)
|
||||
public interface CondPerRtgInfoDeployMapper extends GenericMapper<CondPerRtgInfoDeploy, CondPerRtgInfoEntity> {
|
||||
|
||||
@Mapping(source = "id.eaisvcname", target = "eaisvcname")
|
||||
@Mapping(source = "id.svcprcssno", target = "svcprcssno")
|
||||
@Mapping(source = "id.ruleserno", target = "ruleserno")
|
||||
CondPerRtgInfoDeploy toVo(CondPerRtgInfoEntity condPerRtgInfoEntity);
|
||||
|
||||
@InheritInverseConfiguration
|
||||
CondPerRtgInfoEntity toEntity(CondPerRtgInfoDeploy condPerRtgInfoDeploy);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.mapper;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.message.EAIMessageEntity;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.data.entity.onl.bizkey.BizKeyService;
|
||||
import com.eactive.eai.rms.data.entity.onl.stdmessage.StandardMessageInfoService;
|
||||
import com.eactive.eai.rms.data.entity.onl.submessage.SubMessageInfoService;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.BizKeyDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.EAIMessageDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.StandardMessageInfoDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.SubMessageInfoDeploy;
|
||||
import org.mapstruct.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class, uses = ServiceMessageDeployMapper.class)
|
||||
public abstract class EAIMessageDeployMapper implements GenericMapper<EAIMessageDeploy, EAIMessageEntity> {
|
||||
|
||||
@Autowired private BizKeyService bizKeyService;
|
||||
@Autowired private BizKeyDeployMapper bizKeyDeployMapper;
|
||||
@Autowired private StandardMessageInfoService standardMessageInfoService;
|
||||
@Autowired private StandardMessageInfoDeployMapper standardMessageInfoDeployMapper;
|
||||
@Autowired private SubMessageInfoService subMessageInfoService;
|
||||
@Autowired private SubMessageInfoDeployMapper subMessageInfoDeployMapper;
|
||||
|
||||
@Mapping(source = "serviceMessages", target = "serviceMessages")
|
||||
public abstract EAIMessageDeploy toVo(EAIMessageEntity eaiMessageEntity);
|
||||
|
||||
@InheritInverseConfiguration
|
||||
public abstract EAIMessageEntity toEntity(EAIMessageDeploy eaiMessageDeploy);
|
||||
|
||||
@AfterMapping
|
||||
public void mapAfterToVo(EAIMessageEntity entity, @MappingTarget EAIMessageDeploy vo) {
|
||||
ArrayList<BizKeyDeploy> bizKeyDeploys = new ArrayList<>();
|
||||
bizKeyService.findByIdEaiSvcName(entity.getId()).forEach(bizEntity -> bizKeyDeploys.add(bizKeyDeployMapper.toVo(bizEntity)));
|
||||
vo.getBizKeyDeploys().addAll(bizKeyDeploys);
|
||||
|
||||
ArrayList<StandardMessageInfoDeploy> standardMessageDeploys = new ArrayList<>();
|
||||
standardMessageInfoService.findByEaiSvcCode(entity.getId()).forEach(stdMsgEntity -> standardMessageDeploys.add(standardMessageInfoDeployMapper.toVo(stdMsgEntity)));
|
||||
vo.getStandardMessageInfoDeploys().addAll(standardMessageDeploys);
|
||||
|
||||
ArrayList<SubMessageInfoDeploy> subMessageDeploys = new ArrayList<>();
|
||||
subMessageInfoService.findAll(entity.getId()).forEach(subMessageInfo -> subMessageDeploys.add(subMessageInfoDeployMapper.toVo(subMessageInfo)));
|
||||
vo.getSubMessageInfoDeploys().addAll(subMessageDeploys);
|
||||
}
|
||||
|
||||
@AfterMapping
|
||||
public void mapAfterToEntity(EAIMessageDeploy eaiMessageDeploy, @MappingTarget EAIMessageEntity eaiMessageEntity) {
|
||||
eaiMessageEntity.getServiceMessages().forEach(serviceMessageEntity -> serviceMessageEntity.setEaimessage(eaiMessageEntity));
|
||||
}
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.mapper;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.message.EAIReferenceMessage;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.EAIReferenceMessageDeploy;
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
import javax.persistence.Column;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class)
|
||||
public interface EAIReferenceMessageDeployMapper extends GenericMapper<EAIReferenceMessageDeploy, EAIReferenceMessage> {
|
||||
|
||||
@Mapping(source = "id.eaisvcname", target = "eaisvcname")
|
||||
@Mapping(source = "id.svcprcssno", target = "svcprcssno")
|
||||
@Mapping(source = "id.refmsgidno", target = "refmsgidno")
|
||||
EAIReferenceMessageDeploy toVo(EAIReferenceMessage eaiReferenceMessage);
|
||||
|
||||
@InheritInverseConfiguration
|
||||
EAIReferenceMessage toEntity(EAIReferenceMessageDeploy eaiReferenceMessageDeploy);
|
||||
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.mapper;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.b2bextractor.B2BExtractId;
|
||||
import com.eactive.eai.data.entity.onl.message.ServiceMessageEntity;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.data.entity.onl.b2bextract.B2bExtractService;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.ServiceMessageDeploy;
|
||||
import org.mapstruct.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class, uses = { EAIReferenceMessageDeployMapper.class, CondPerRtgInfoDeployMapper.class })
|
||||
@Transactional
|
||||
public abstract class ServiceMessageDeployMapper implements GenericMapper<ServiceMessageDeploy, ServiceMessageEntity> {
|
||||
|
||||
@Autowired private B2bExtractService b2bExtractService;
|
||||
@Autowired private B2BExtractDeployMapper b2BExtractDeployMapper;
|
||||
|
||||
@Mapping(source = "id.eaisvcname", target = "eaisvcname")
|
||||
@Mapping(source = "id.svcprcssno", target = "svcprcssno")
|
||||
@Mapping(source = "condPerRtgInfos", target = "condPerRtgInfoDeploys")
|
||||
@Mapping(source = "eaiReferenceMessages", target = "eaiReferenceMessageDeploys")
|
||||
public abstract ServiceMessageDeploy toVo(ServiceMessageEntity serviceMessageEntity);
|
||||
|
||||
@InheritInverseConfiguration
|
||||
public abstract ServiceMessageEntity toEntity(ServiceMessageDeploy serviceMessageDeploy);
|
||||
|
||||
@AfterMapping
|
||||
public void mapAfterToVo(ServiceMessageEntity entity, @MappingTarget ServiceMessageDeploy vo) {
|
||||
b2bExtractService
|
||||
.findById(new B2BExtractId(entity.getId().getEaisvcname(), entity.getId().getSvcprcssno()))
|
||||
.map(b2BExtractDeployMapper::toVo)
|
||||
.ifPresent(vo::setB2BExtractDeploy);
|
||||
}
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.mapper;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.stdmessage.StandardMessageInfo;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.StandardMessageInfoDeploy;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class, uses = {StandardMessageItemDeployMapper.class})
|
||||
public interface StandardMessageInfoDeployMapper extends GenericMapper<StandardMessageInfoDeploy, StandardMessageInfo> {
|
||||
|
||||
@Mapping(source = "standardMessageItems", target = "standardMessageItemDeploys")
|
||||
StandardMessageInfoDeploy toVo(StandardMessageInfo standardMessageInfo);
|
||||
|
||||
@InheritInverseConfiguration
|
||||
StandardMessageInfo toEntity(StandardMessageInfoDeploy standardMessageInfoDeploy);
|
||||
|
||||
List<StandardMessageInfo> map(List<StandardMessageInfoDeploy> vos);
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.mapper;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.stdmessage.StandardMessageItem;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.StandardMessageItemDeploy;
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
import javax.persistence.Column;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class)
|
||||
public interface StandardMessageItemDeployMapper extends GenericMapper<StandardMessageItemDeploy, StandardMessageItem> {
|
||||
|
||||
@Mapping(source = "id.bzwksvckeyname", target = "bzwksvckeyname")
|
||||
@Mapping(source = "id.columnname", target = "columnname")
|
||||
StandardMessageItemDeploy toVo(StandardMessageItem standardMessageItem);
|
||||
|
||||
@InheritInverseConfiguration
|
||||
StandardMessageItem toEntity(StandardMessageItemDeploy standardMessageItemDeploy);
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.mapper;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.submessage.SubMessageInfo;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.SubMessageInfoDeploy;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class, uses = { SubMessageItemDeployMapper.class })
|
||||
public interface SubMessageInfoDeployMapper extends GenericMapper<SubMessageInfoDeploy, SubMessageInfo> {
|
||||
|
||||
@Mapping(source = "subMessageItems", target = "subMessageItemDeploys")
|
||||
SubMessageInfoDeploy toVo(SubMessageInfo subMessageInfo);
|
||||
|
||||
@InheritInverseConfiguration
|
||||
SubMessageInfo toEntity(SubMessageInfoDeploy subMessageInfoDeploy);
|
||||
|
||||
List<SubMessageInfo> map(List<SubMessageInfoDeploy> vos);
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.eactive.eai.rms.onl.loader.intf.mapper;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.submessage.SubMessageItem;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.SubMessageItemDeploy;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class)
|
||||
public interface SubMessageItemDeployMapper extends GenericMapper<SubMessageItemDeploy, SubMessageItem> {
|
||||
|
||||
@Mapping(source = "id.bzwksvckeyname", target = "bzwksvckeyname")
|
||||
@Mapping(source = "id.columnname", target = "columnname")
|
||||
SubMessageItemDeploy toVo(SubMessageItem subMessageItem);
|
||||
|
||||
@InheritInverseConfiguration
|
||||
SubMessageItem toEntity(SubMessageItemDeploy subMessageItemDeploy);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.eactive.eai.rms.onl.loader.layout;
|
||||
|
||||
import com.eactive.eai.rms.data.entity.onl.layout.LayoutService;
|
||||
import com.eactive.eai.rms.onl.loader.layout.deploy.LayoutDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.layout.mapper.LayoutDeployMapper;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service("layoutDeployService")
|
||||
@Transactional
|
||||
public class LayoutDeployService extends DeployService {
|
||||
|
||||
@Autowired
|
||||
private LayoutService layoutService;
|
||||
|
||||
@Autowired
|
||||
private LayoutDeployMapper layoutDeployMapper;
|
||||
|
||||
public LayoutDeploy selectDeploy(String loutName) {
|
||||
return layoutService.findById(loutName).map(layoutDeployMapper::toVo).orElse(null);
|
||||
}
|
||||
|
||||
public void saveDeploy(LayoutDeploy layoutDeploy) {
|
||||
deleteAndSave(layoutDeploy, layoutDeployMapper, layoutService);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.eactive.eai.rms.onl.loader.layout.deploy;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.transformer.layout.LayoutEntity;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployResource;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import edu.emory.mathcs.backport.java.util.Arrays;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class LayoutDeploy extends DeployResource<LayoutEntity> {
|
||||
|
||||
@Override
|
||||
public LayoutEntity probeForExample() {
|
||||
LayoutEntity probe = new LayoutEntity();
|
||||
probe.setLoutname(this.loutname);
|
||||
return probe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> exactMatchFields() {
|
||||
return Arrays.asList(new String[]{
|
||||
"loutname"
|
||||
});
|
||||
}
|
||||
|
||||
/** 레이아웃 명 */
|
||||
@JsonProperty("Layout")
|
||||
private String loutname;
|
||||
|
||||
/** 레이아웃 유형 명 */
|
||||
@JsonProperty("LayoutPattern")
|
||||
private String loutptrnname;
|
||||
|
||||
/** 레이아웃 설명 */
|
||||
@JsonProperty("LayoutDescription")
|
||||
private String loutdesc;
|
||||
|
||||
/** 최종 수정 시각 */
|
||||
@JsonProperty("LastDateTime")
|
||||
@JsonFormat(pattern = "yyyyMMddHHmmssSS")
|
||||
private LocalDateTime lastamndhms;
|
||||
|
||||
/** 업무구분명(코드) */
|
||||
@JsonProperty("BusinessCode")
|
||||
private String eaibzwkdstcd;
|
||||
|
||||
/** 어플리케이션명 */
|
||||
@JsonProperty("ApplicationName")
|
||||
private String uapplname;
|
||||
|
||||
/** 시스템인터페이스명 */
|
||||
@JsonProperty("InterfaceName")
|
||||
private String sysintfacname;
|
||||
|
||||
/** 작성자 */
|
||||
@JsonProperty("author")
|
||||
private String author;
|
||||
|
||||
/** EAI서버구분코드 */
|
||||
@JsonProperty("ServerType")
|
||||
private String eaisevrdstcd;
|
||||
|
||||
/** 변경관리상태구분코드 */
|
||||
@JsonProperty("StatusCode")
|
||||
private String modfimgtstusdstcd;
|
||||
|
||||
/** 사용여부 */
|
||||
@JsonProperty("UseYn")
|
||||
private String useyn;
|
||||
|
||||
/** 버전정보 */
|
||||
@JsonProperty("VersionInfo")
|
||||
private String verinfo;
|
||||
|
||||
@JsonProperty("Items")
|
||||
private List<LayoutItemDeploy> layoutItems;
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.eactive.eai.rms.onl.loader.layout.deploy;
|
||||
|
||||
import com.eactive.eai.rms.common.vo.AbstractTree;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
//@EqualsAndHashCode(callSuper = true)
|
||||
public class LayoutItemDeploy {
|
||||
|
||||
@JsonProperty("LayoutName")
|
||||
private String loutname;
|
||||
|
||||
@JsonProperty("ItemName")
|
||||
private String loutitemname;
|
||||
|
||||
@JsonProperty("ItemSequence")
|
||||
private Integer loutitemserno;
|
||||
|
||||
@JsonProperty("ItemNo")
|
||||
private Integer loutitemidname;
|
||||
|
||||
@JsonProperty("ParentItemNo")
|
||||
private Integer parntloutitemidname;
|
||||
|
||||
@JsonProperty("ItemDescription")
|
||||
private String loutitemdesc;
|
||||
|
||||
@JsonProperty("ItemNodeType")
|
||||
private Integer loutitemnodeptrnidname;
|
||||
|
||||
@JsonProperty("ItemType")
|
||||
private Integer loutitemptrnidname;
|
||||
|
||||
@JsonProperty("Path")
|
||||
private String loutitempathname;
|
||||
|
||||
@JsonProperty("Length")
|
||||
private Integer loutitemlencnt;
|
||||
|
||||
@JsonProperty("Reference")
|
||||
private String loutitemrefinfo;
|
||||
|
||||
@JsonProperty("Reference2")
|
||||
private String loutitemrefinfo2;
|
||||
|
||||
@JsonProperty("OccurPattern")
|
||||
private String loutitemoccurptrndstcd;
|
||||
|
||||
@JsonProperty("Max")
|
||||
private Integer loutitemmaxoccurnoitm;
|
||||
|
||||
@JsonProperty("Min")
|
||||
private Integer loutitemminoccurnoitm;
|
||||
|
||||
@JsonProperty("Default")
|
||||
private String loutitembascval;
|
||||
|
||||
@JsonProperty("MaskYn")
|
||||
private String loutitemmskyn;
|
||||
|
||||
@JsonProperty("Depth")
|
||||
private Integer loutdptcnt;
|
||||
|
||||
@JsonProperty("DecimalLength")
|
||||
private Integer decptlencnt;
|
||||
|
||||
@JsonProperty("ItemTypeValue")
|
||||
private String loutitemrefptrnidname;
|
||||
|
||||
@JsonProperty("MaskLength")
|
||||
private Integer loutitemmasklength;
|
||||
|
||||
@JsonProperty("MaskOffset")
|
||||
private Integer loutitemmaskoffset;
|
||||
|
||||
@JsonProperty("MultiLang")
|
||||
private String multilang;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.eactive.eai.rms.onl.loader.layout.mapper;
|
||||
|
||||
import org.mapstruct.BeanMapping;
|
||||
import org.mapstruct.InheritConfiguration;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.MappingTarget;
|
||||
import org.mapstruct.NullValuePropertyMappingStrategy;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.transformer.layout.LayoutEntity;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.onl.loader.layout.deploy.LayoutDeploy;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class, uses = { LayoutItemDeployMapper.class })
|
||||
public interface LayoutDeployMapper extends GenericMapper<LayoutDeploy, LayoutEntity> {
|
||||
|
||||
@Mapping(source = "lastamndhms", target = "lastamndhms", dateFormat = "yyyyMMddHHmmssSS")
|
||||
@Mapping(source = "layoutItemEntities", target = "layoutItems")
|
||||
LayoutDeploy toVo(LayoutEntity entity);
|
||||
|
||||
@InheritInverseConfiguration(name = "toVo")
|
||||
LayoutEntity toEntity(LayoutDeploy vo);
|
||||
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.eactive.eai.rms.onl.loader.layout.mapper;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.transformer.layout.LayoutItemEntity;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.onl.loader.layout.deploy.LayoutItemDeploy;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class)
|
||||
public interface LayoutItemDeployMapper extends GenericMapper<LayoutItemDeploy, LayoutItemEntity> {
|
||||
|
||||
@Mapping(source = "id.loutname", target = "loutname")
|
||||
@Mapping(source = "id.loutitemserno", target = "loutitemserno")
|
||||
@Mapping(source = "id.loutitemname", target = "loutitemname")
|
||||
LayoutItemDeploy toVo(LayoutItemEntity entity);
|
||||
|
||||
@InheritInverseConfiguration(name = "toVo")
|
||||
LayoutItemEntity toEntity(LayoutItemDeploy vo);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import org.springframework.data.domain.Example;
|
||||
import org.springframework.data.domain.ExampleMatcher;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class DeployResource<Probe> {
|
||||
|
||||
/**
|
||||
* 배포시 삭제 대상 기준 Column을 포함한 쿼리를 생성하는 Example을 생성합니다.
|
||||
* ex) BizKey(FR03,필드추출키정보) 배포시 BizKey의 ID가 아니라 eaisvcname을 기준으로 deleteAll하기 위함
|
||||
*/
|
||||
public Example<Probe> exampleForRemove() {
|
||||
ExampleMatcher matcher = ExampleMatcher.matching()
|
||||
.withIgnoreNullValues();
|
||||
for (String field : exactMatchFields()) {
|
||||
matcher = matcher.withMatcher(field, ExampleMatcher.GenericPropertyMatchers.exact());
|
||||
}
|
||||
return Example.of(probeForExample(), matcher);
|
||||
}
|
||||
|
||||
public abstract Probe probeForExample();
|
||||
|
||||
public abstract List<String> exactMatchFields();
|
||||
|
||||
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import com.eactive.eai.common.util.UUIDGenerator;
|
||||
import com.eactive.eai.rms.common.context.MonitoringContext;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceContextHolder;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
||||
import com.eactive.eai.rms.onl.common.util.FileWriteUtil;
|
||||
import com.eactive.eai.rms.onl.loader.dao.LoaderDao;
|
||||
import com.eactive.eai.rms.onl.loader.service.enm.ResourceType;
|
||||
import com.eactive.eai.rms.onl.loader.vo.RuleFileResource;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class DeployResourceDownloadBapService extends DeployResourceDownloadService {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("loaderDao")
|
||||
private LoaderDao dao;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("monitoringContext")
|
||||
private MonitoringContext monitoringContext;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("loaderService")
|
||||
private TransactionLoaderService loaderService;
|
||||
|
||||
@Override
|
||||
public boolean supportsType(String serviceType) {
|
||||
return DataSourceTypeManager.BAP.equals(serviceType);
|
||||
}
|
||||
|
||||
public RuleFileResource getResource(String serviceType, ResourceType resourceType, String resourceName)
|
||||
throws Exception {
|
||||
|
||||
DataSourceType dt = DataSourceTypeManager.getDataSourceType(serviceType.toUpperCase());
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
switch (resourceType) {
|
||||
case INTERFACE:
|
||||
return getInterfaceResource(dt, resourceName);
|
||||
default:
|
||||
throw new IllegalArgumentException("Unexpected value: " + resourceType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public byte[] getResourcesZip(Map<String, String>[] paramGridRows) throws Exception {
|
||||
|
||||
final String tempFilePath = monitoringContext.getStringProperty(MonitoringContext.IOMAP_DOWNLOAD_PATH);
|
||||
|
||||
Path tempFileUuidDirectory = Paths
|
||||
.get(tempFilePath + File.separator + UUIDGenerator.getUUID() + File.separator);
|
||||
Files.createDirectories(tempFileUuidDirectory);
|
||||
|
||||
try {
|
||||
|
||||
for (Map<String, String> row : paramGridRows) {
|
||||
|
||||
String resourceType = row.get("resourceType");
|
||||
String resourceName = row.get("resourceName").substring(0, row.get("resourceName").lastIndexOf("."));
|
||||
String resourceApp = row.get("resourceApp");
|
||||
|
||||
RuleFileResource fileContent = getInterfaceResource(DataSourceContextHolder.getDataSourceType(),
|
||||
resourceName);
|
||||
|
||||
Files.createDirectories(Paths.get(tempFileUuidDirectory + File.separator + resourceApp + File.separator
|
||||
+ resourceType + File.separator));
|
||||
Files.write(Paths.get(tempFileUuidDirectory + File.separator + resourceApp + File.separator
|
||||
+ resourceType + File.separator + fileContent.getFileName()),
|
||||
fileContent.getFileContent().getBytes());
|
||||
|
||||
}
|
||||
|
||||
byte[] pathToZipFile = pathToZipFile(tempFileUuidDirectory);
|
||||
|
||||
return pathToZipFile;
|
||||
|
||||
} finally {
|
||||
deleteDirectoryRecursively(tempFileUuidDirectory);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private RuleFileResource getInterfaceResource(DataSourceType dt, String eaiSvcName) throws Exception {
|
||||
|
||||
List<LinkedHashMap> listBJ01 = dao.selectTableData(dt, "TSEAIBJ01", "INFID", eaiSvcName);
|
||||
if (listBJ01 == null || listBJ01.size() == 0) {
|
||||
throw new Exception("fileInfo data is empty fileName =[" + eaiSvcName + "]");
|
||||
}
|
||||
|
||||
LinkedHashMap<String, List> tables = new LinkedHashMap<String, List>();
|
||||
tables.put("TSEAIBJ01", listBJ01);
|
||||
|
||||
return new RuleFileResource(eaiSvcName + ".txt", FileWriteUtil.StringWrite(tables));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import com.eactive.eai.common.util.UUIDGenerator;
|
||||
import com.eactive.eai.rms.bat.loader.intf.InterfaceDeployService;
|
||||
import com.eactive.eai.rms.bat.loader.intf.deploy.InterfaceDeploy;
|
||||
import com.eactive.eai.rms.common.context.MonitoringContext;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceContextHolder;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
||||
import com.eactive.eai.rms.onl.loader.service.enm.ResourceType;
|
||||
import com.eactive.eai.rms.onl.loader.vo.RuleFileResource;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class DeployResourceDownloadBatService extends DeployResourceDownloadService {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("monitoringContext")
|
||||
private MonitoringContext monitoringContext;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("BatInterfaceDeployService")
|
||||
private InterfaceDeployService interfaceDeployService;
|
||||
|
||||
@Override
|
||||
public boolean supportsType(String serviceType) {
|
||||
return DataSourceTypeManager.BAT.equals(serviceType);
|
||||
}
|
||||
|
||||
public RuleFileResource getResource(String serviceType, ResourceType resourceType, String resourceName)
|
||||
throws Exception {
|
||||
|
||||
DataSourceType dt = DataSourceTypeManager.getDataSourceType(serviceType.toUpperCase());
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
return getInterfaceResource(dt, resourceName);
|
||||
}
|
||||
|
||||
public byte[] getResourcesZip(Map<String, String>[] paramGridRows) throws Exception {
|
||||
|
||||
final String tempFilePath = monitoringContext.getStringProperty(MonitoringContext.IOMAP_DOWNLOAD_PATH);
|
||||
|
||||
Path tempFileUuidDirectory = Paths
|
||||
.get(tempFilePath + File.separator + UUIDGenerator.getUUID() + File.separator);
|
||||
Files.createDirectories(tempFileUuidDirectory);
|
||||
|
||||
try {
|
||||
|
||||
for (Map<String, String> row : paramGridRows) {
|
||||
|
||||
String resourceType = row.get("resourceType");
|
||||
String resourceName = row.get("resourceName").substring(0, row.get("resourceName").lastIndexOf("."));
|
||||
String resourceApp = row.get("resourceApp");
|
||||
|
||||
RuleFileResource fileContent = getInterfaceResource(DataSourceContextHolder.getDataSourceType(),
|
||||
resourceName);
|
||||
|
||||
Files.createDirectories(Paths.get(tempFileUuidDirectory + File.separator + resourceApp + File.separator
|
||||
+ resourceType + File.separator));
|
||||
Files.write(Paths.get(tempFileUuidDirectory + File.separator + resourceApp + File.separator
|
||||
+ resourceType + File.separator + fileContent.getFileName()),
|
||||
fileContent.getFileContent().getBytes());
|
||||
|
||||
}
|
||||
|
||||
byte[] pathToZipFile = pathToZipFile(tempFileUuidDirectory);
|
||||
|
||||
return pathToZipFile;
|
||||
|
||||
} finally {
|
||||
deleteDirectoryRecursively(tempFileUuidDirectory);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public RuleFileResource getInterfaceResource(DataSourceType dt, String eaiSvcName) throws Exception {
|
||||
InterfaceDeploy interfaceDeploy = interfaceDeployService.selectDeploy(eaiSvcName);
|
||||
String json = mapper.writeValueAsString(interfaceDeploy);
|
||||
return new RuleFileResource(eaiSvcName + ".txt", json);
|
||||
}
|
||||
|
||||
}
|
||||
+250
@@ -0,0 +1,250 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import com.eactive.eai.common.util.UUIDGenerator;
|
||||
import com.eactive.eai.rms.common.context.MonitoringContext;
|
||||
import com.eactive.eai.rms.common.converter.ElinkObjectMapper;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceContextHolder;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
||||
import com.eactive.eai.rms.onl.common.util.FileWriteUtil;
|
||||
import com.eactive.eai.rms.onl.loader.dao.LoaderDao;
|
||||
import com.eactive.eai.rms.onl.loader.intf.InterfaceDeployService;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.EAIMessageDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.layout.LayoutDeployService;
|
||||
import com.eactive.eai.rms.onl.loader.layout.deploy.LayoutDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.service.enm.ResourceType;
|
||||
import com.eactive.eai.rms.onl.loader.transform.TransformDeployService;
|
||||
import com.eactive.eai.rms.onl.loader.transform.deploy.TransformDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.vo.RuleFileResource;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class DeployResourceDownloadOnlineService extends DeployResourceDownloadService {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("loaderDao")
|
||||
private LoaderDao dao;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("monitoringContext")
|
||||
private MonitoringContext monitoringContext;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("deployJsonServiceOnline")
|
||||
private TransactionDeployJsonService loaderService;
|
||||
|
||||
@Autowired
|
||||
private InterfaceDeployService interfaceDeployService;
|
||||
|
||||
@Autowired
|
||||
private LayoutDeployService layoutDeployService;
|
||||
|
||||
@Autowired
|
||||
private TransformDeployService transformDeployService;
|
||||
|
||||
private ElinkObjectMapper mapper;
|
||||
|
||||
@PostConstruct
|
||||
public void startup() {
|
||||
mapper = new ElinkObjectMapper();
|
||||
mapper.enable(SerializationFeature.WRITE_SELF_REFERENCES_AS_NULL);
|
||||
mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
|
||||
mapper.enable(SerializationFeature.INDENT_OUTPUT);
|
||||
mapper.enable(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS);
|
||||
mapper.writerWithDefaultPrettyPrinter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsType(String serviceType) {
|
||||
return Objects.requireNonNull(DataSourceTypeManager.getDataSourceType(serviceType)).isOnline();
|
||||
}
|
||||
|
||||
public RuleFileResource getResource(String serviceType, ResourceType resourceType, String resourceName)
|
||||
throws Exception {
|
||||
|
||||
DataSourceType dt = DataSourceTypeManager.getDataSourceType(serviceType.toUpperCase());
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
switch (resourceType) {
|
||||
case INTERFACE:
|
||||
return getInterfaceResource(dt, resourceName);
|
||||
case LAYOUT:
|
||||
return getLayoutResource(dt, resourceName);
|
||||
case TRANSFORM:
|
||||
return getTransformResource(dt, resourceName);
|
||||
default:
|
||||
throw new IllegalArgumentException("Unexpected value: " + resourceType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public byte[] getResourcesZip(Map<String, String>[] paramGridRows) throws Exception {
|
||||
|
||||
final String tempFilePath = monitoringContext.getStringProperty(MonitoringContext.IOMAP_DOWNLOAD_PATH);
|
||||
|
||||
Path tempFileUuidDirectory = Paths
|
||||
.get(tempFilePath + File.separator + UUIDGenerator.getUUID() + File.separator);
|
||||
Files.createDirectories(tempFileUuidDirectory);
|
||||
|
||||
try {
|
||||
|
||||
for (Map<String, String> row : paramGridRows) {
|
||||
|
||||
ResourceType resourceTypeEnum = ResourceType.valueOf(row.get("resourceType").toUpperCase());
|
||||
String resourceType = row.get("resourceType");
|
||||
String resourceName = row.get("resourceName").substring(0, row.get("resourceName").lastIndexOf("."));
|
||||
String resourceApp = row.get("resourceApp");
|
||||
|
||||
RuleFileResource fileContent = null;
|
||||
|
||||
switch (resourceTypeEnum) {
|
||||
case INTERFACE:
|
||||
fileContent = getInterfaceResource(DataSourceContextHolder.getDataSourceType(), resourceName);
|
||||
break;
|
||||
case LAYOUT:
|
||||
fileContent = getLayoutResource(DataSourceContextHolder.getDataSourceType(), resourceName);
|
||||
break;
|
||||
case TRANSFORM:
|
||||
fileContent = getTransformResource(DataSourceContextHolder.getDataSourceType(), resourceName);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unexpected value: " + resourceType);
|
||||
}
|
||||
|
||||
Files.createDirectories(Paths.get(tempFileUuidDirectory + File.separator + resourceApp + File.separator
|
||||
+ resourceType + File.separator));
|
||||
Files.write(Paths.get(tempFileUuidDirectory + File.separator + resourceApp + File.separator
|
||||
+ resourceType + File.separator + fileContent.getFileName()),
|
||||
fileContent.getFileContent().getBytes());
|
||||
|
||||
}
|
||||
|
||||
byte[] pathToZipFile = pathToZipFile(tempFileUuidDirectory);
|
||||
|
||||
return pathToZipFile;
|
||||
|
||||
} finally {
|
||||
deleteDirectoryRecursively(tempFileUuidDirectory);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private RuleFileResource getInterfaceResource(DataSourceType dt, String eaiSvcName) throws Exception {
|
||||
EAIMessageDeploy eaiMessageDeploy = interfaceDeployService.selectDeploy(eaiSvcName);
|
||||
String json = mapper.writeValueAsString(eaiMessageDeploy);
|
||||
return new RuleFileResource(eaiSvcName + ".txt", json);
|
||||
}
|
||||
|
||||
private RuleFileResource getLayoutResource(DataSourceType dt, String loutName) throws Exception {
|
||||
LayoutDeploy layoutDeploy = layoutDeployService.selectDeploy(loutName);
|
||||
String json = mapper.writeValueAsString(layoutDeploy);
|
||||
return new RuleFileResource(loutName + ".txt", json);
|
||||
}
|
||||
|
||||
private RuleFileResource getTransformResource(DataSourceType dt, String cnvsnName) throws Exception {
|
||||
TransformDeploy transformDeploy = transformDeployService.selectDeploy(cnvsnName);
|
||||
String json = mapper.writeValueAsString(transformDeploy);
|
||||
return new RuleFileResource(cnvsnName + ".txt", json);
|
||||
}
|
||||
|
||||
// public byte[] generateZipWithFileSystem(String serviceType) throws IOException {
|
||||
//
|
||||
// DataSourceType dt = DataSourceTypeManager.getDataSourceType(serviceType.toUpperCase());
|
||||
// DataSourceContextHolder.setDataSourceType(dt);
|
||||
//
|
||||
// final String localFilePath = monitoringContext.getStringProperty(MonitoringContext.IOMAP_DOWNLOAD_PATH);
|
||||
//
|
||||
// List<String> errorResourcesAlert = new ArrayList<>();
|
||||
//
|
||||
// try {
|
||||
// generateAllInterfaceInLocalFilePath(dt, serviceType, localFilePath, errorResourcesAlert);
|
||||
// generateAllLayoutInLocalFilePath(dt, serviceType, localFilePath, errorResourcesAlert);
|
||||
// generateAllTransformInLocalFilePath(dt, serviceType, localFilePath, errorResourcesAlert);
|
||||
// } catch (Exception e) {
|
||||
// logger.error(String.valueOf(e));
|
||||
// throw e;
|
||||
// }
|
||||
//
|
||||
// if (errorResourcesAlert.size() > 0) {
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// sb.append("Resource Validation Error:").append(System.lineSeparator());
|
||||
// errorResourcesAlert.forEach(msg -> sb.append(msg).append(System.lineSeparator()));
|
||||
// throw new RuntimeException(sb.toString());
|
||||
// }
|
||||
//
|
||||
// Path folderPath = Paths.get(localFilePath + File.separator + serviceType);
|
||||
//
|
||||
// byte[] file = pathToZipFile(folderPath);
|
||||
//
|
||||
// deleteDirectoryRecursively(folderPath);
|
||||
//
|
||||
// return file;
|
||||
// }
|
||||
//
|
||||
// private void generateAllInterfaceInLocalFilePath(DataSourceType dt, String serviceType, String iomapPath,
|
||||
// List<String> errorResourcesAlert) {
|
||||
// List<LinkedHashMap> list = dao.selectTableDataLike(dt, "TSEAIHE01", "EAISvcName", "%");
|
||||
// for (int i = 0; i < list.size(); i++) {
|
||||
// LinkedHashMap lm = list.get(i);
|
||||
// try {
|
||||
// String eaiSvcName = (String) lm.get("EAISVCNAME");
|
||||
// String bzwkDstcd = ((String) lm.get("EAIBZWKDSTCD")).trim();
|
||||
// String path = iomapPath + serviceType + File.separator + bzwkDstcd + File.separator
|
||||
// + FileWriteUtil.INTERFACE + File.separator;
|
||||
// loaderService.interfaceDownLoading(path, eaiSvcName);
|
||||
// } catch (Exception e) {
|
||||
// logger.warn(String.valueOf(lm), e);
|
||||
// errorResourcesAlert.add(e.getMessage() + " [RESOURCE]:" + lm.toString());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void generateAllLayoutInLocalFilePath(DataSourceType dt, String serviceType, String iomapPath,
|
||||
// List<String> errorResourcesAlert) {
|
||||
// List<LinkedHashMap> list = dao.selectTableDataLike(dt, "TSEAITR07", "LoutName", "%");
|
||||
// for (int i = 0; i < list.size(); i++) {
|
||||
// LinkedHashMap lm = list.get(i);
|
||||
// try {
|
||||
// String loutName = (String) lm.get("LOUTNAME");
|
||||
// String bzwkDstcd = ((String) lm.get("EAIBZWKDSTCD")).trim();
|
||||
// String path = iomapPath + serviceType + File.separator + bzwkDstcd + File.separator
|
||||
// + FileWriteUtil.LAYOUT + File.separator;
|
||||
// loaderService.layoutDownLoading(path, loutName);
|
||||
// } catch (Exception e) {
|
||||
// logger.warn(String.valueOf(lm), e);
|
||||
// errorResourcesAlert.add(e.getMessage() + " [RESOURCE]:" + lm.toString());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void generateAllTransformInLocalFilePath(DataSourceType dt, String serviceType, String iomapPath, List<String> errorResourcesAlert) {
|
||||
// List<LinkedHashMap> list = dao.selectTableDataLike(dt, "TSEAITR01", "CnvsnName", "%");
|
||||
// for (int i = 0; i < list.size(); i++) {
|
||||
// LinkedHashMap lm = list.get(i);
|
||||
// try {
|
||||
// String cnvsnName = (String) lm.get("CNVSNNAME");
|
||||
// String bzwkDstcd = cnvsnName.substring(10, 13);
|
||||
// String path = iomapPath + serviceType + File.separator + bzwkDstcd + File.separator
|
||||
// + FileWriteUtil.TRANSFORM + File.separator;
|
||||
// loaderService.transformDownLoading(path, cnvsnName);
|
||||
// } catch (Exception e) {
|
||||
// logger.warn(String.valueOf(lm), e);
|
||||
// errorResourcesAlert.add(e.getMessage() + " [RESOURCE]:" + lm.toString());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import com.eactive.eai.rms.common.converter.ElinkObjectMapper;
|
||||
import com.eactive.eai.rms.onl.loader.service.enm.ResourceType;
|
||||
import com.eactive.eai.rms.onl.loader.vo.RuleFileResource;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.SimpleFileVisitor;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.util.Map;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
public abstract class DeployResourceDownloadService {
|
||||
|
||||
protected final Logger logger = Logger.getLogger(getClass());
|
||||
|
||||
public abstract boolean supportsType(String serviceType);
|
||||
|
||||
public abstract RuleFileResource getResource(String serviceType, ResourceType resourceType, String resourceName) throws Exception;
|
||||
|
||||
public abstract byte[] getResourcesZip(Map<String, String>[] paramGridRows) throws Exception;
|
||||
|
||||
// public abstract byte[] generateZipWithFileSystem(String serviceType) throws IOException;
|
||||
|
||||
protected final ElinkObjectMapper mapper;
|
||||
|
||||
DeployResourceDownloadService() {
|
||||
mapper = new ElinkObjectMapper();
|
||||
mapper.enable(SerializationFeature.WRITE_SELF_REFERENCES_AS_NULL);
|
||||
mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
|
||||
mapper.enable(SerializationFeature.INDENT_OUTPUT);
|
||||
mapper.enable(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS);
|
||||
mapper.writerWithDefaultPrettyPrinter();
|
||||
}
|
||||
|
||||
protected byte[] pathToZipFile(Path folderPath) throws IOException {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
try (ZipOutputStream zos = new ZipOutputStream(baos)) {
|
||||
Files.walk(folderPath).filter(path -> !Files.isDirectory(path)).forEach(path -> {
|
||||
ZipEntry zipEntry = new ZipEntry(folderPath.relativize(path).toString());
|
||||
try {
|
||||
zos.putNextEntry(zipEntry);
|
||||
Files.copy(path, zos);
|
||||
zos.closeEntry();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Error packaging file: " + path, e);
|
||||
}
|
||||
});
|
||||
}
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
protected void deleteDirectoryRecursively(Path path) throws IOException {
|
||||
Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
|
||||
@Override
|
||||
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
|
||||
Files.delete(file);
|
||||
return FileVisitResult.CONTINUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
|
||||
Files.delete(dir);
|
||||
return FileVisitResult.CONTINUE;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class DeployResourceDownloadServiceFactory {
|
||||
|
||||
private final List<DeployResourceDownloadService> serviceList;
|
||||
|
||||
public DeployResourceDownloadService create(String serviceType) {
|
||||
return serviceList.stream()
|
||||
.filter(service -> service.supportsType(serviceType)).findFirst()
|
||||
.orElseThrow(() -> new RuntimeException("No Matched Service With ServiceType: " + serviceType));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import com.eactive.eai.data.DataService;
|
||||
import com.eactive.eai.data.entity.AbstractEntity;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public abstract class DeployService {
|
||||
|
||||
@Transactional
|
||||
public <V extends DeployResource<E>, E extends AbstractEntity<I>, I> void deleteExistsAndSaveAll(List<V> voList, GenericMapper<V, E> mapper, DataService<E, I> dataService) {
|
||||
List<E> saveTargetList = voList.stream().map(mapper::toEntity).collect(Collectors.toList());
|
||||
|
||||
/* DeleteAll By RemoveFields */
|
||||
voList.stream().map(DeployResource::exampleForRemove).map(dataService::findAll).forEach(dataService::deleteAll);
|
||||
|
||||
/* SaveAll */
|
||||
dataService.saveAll(saveTargetList);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public <V extends DeployResource<E>, E extends AbstractEntity<I>, I> void deleteAndSave(V vo, GenericMapper<V, E> mapper, DataService<E, I> dataService) {
|
||||
E saveTarget = mapper.toEntity(vo);
|
||||
|
||||
/* Delete By RemoveFields */
|
||||
dataService.deleteAll(dataService.findAll(vo.exampleForRemove()));
|
||||
|
||||
/* Save */
|
||||
dataService.save(saveTarget);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
|
||||
public interface HistoryService{
|
||||
|
||||
/**
|
||||
* layout loading
|
||||
*/
|
||||
public HashMap<String, ArrayList<HashMap<String, String>>> userHistoryList(DataSourceType dt, String userId) throws Exception ;
|
||||
public HashMap<String, ArrayList<HashMap<String, String>>> userHistoryListByInterface(DataSourceType dt, String interfaceId) throws Exception ;
|
||||
public String parse(String serviceType, String iomapPath, String userId, HashMap<String, ArrayList<HashMap<String, String>>> list) throws Exception ;
|
||||
public String parseSimple(String serviceType, String iomapPath, HashMap<String, ArrayList<HashMap<String, String>>> list) throws Exception ;
|
||||
public HashMap<String, ArrayList<HashMap<String, String>>> userHistoryListByLayout(DataSourceType dt,
|
||||
String[] eaiLoutNames) throws Exception;
|
||||
public HashMap<String, ArrayList<HashMap<String, String>>> userHistoryListByTransform(DataSourceType dt,
|
||||
String[] transformNames) throws Exception;
|
||||
public HashMap<String, ArrayList<HashMap<String, String>>> userHistoryListByAdapter(DataSourceType dt,
|
||||
String[] adapterNames) throws Exception;
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.eactive.eai.common.util.NullControl;
|
||||
import com.eactive.eai.rms.common.base.BaseService;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
import com.eactive.eai.rms.onl.common.util.FileWriteUtil;
|
||||
import com.eactive.eai.rms.onl.loader.dao.HistoryDao;
|
||||
|
||||
@Service("historyService")
|
||||
public class HistoryServiceImpl extends BaseService implements HistoryService {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("historyDao")
|
||||
private HistoryDao historyDao;
|
||||
|
||||
|
||||
public HistoryServiceImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* layout loading
|
||||
*/
|
||||
public HashMap<String, ArrayList<HashMap<String, String>>> userHistoryList(DataSourceType dt, String userId)
|
||||
throws Exception {
|
||||
HashMap<String, ArrayList<HashMap<String, String>>> list = new HashMap<String, ArrayList<HashMap<String, String>>>();
|
||||
ArrayList<HashMap<String, String>> iList = historyDao.getEaiMessageList(dt, userId);
|
||||
if( !iList.isEmpty() ) list.put(FileWriteUtil.INTERFACE, iList);
|
||||
ArrayList<HashMap<String, String>> lList = historyDao.getLayoutList(dt, userId);
|
||||
if( !lList.isEmpty() ) list.put(FileWriteUtil.LAYOUT, lList);
|
||||
ArrayList<HashMap<String, String>> tList = historyDao.getTransformList(dt, userId);
|
||||
if( !tList.isEmpty() ) list.put(FileWriteUtil.TRANSFORM, tList);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* layout loading
|
||||
*/
|
||||
public HashMap<String, ArrayList<HashMap<String, String>>> userHistoryListByInterface(DataSourceType dt, String interfaceId)
|
||||
throws Exception {
|
||||
HashMap<String, ArrayList<HashMap<String, String>>> list = new HashMap<String, ArrayList<HashMap<String, String>>>();
|
||||
ArrayList<HashMap<String, String>> iList = historyDao.getMessageListByInterface(dt, interfaceId);
|
||||
if( !iList.isEmpty() ) list.put(FileWriteUtil.INTERFACE, iList);
|
||||
ArrayList<HashMap<String, String>> lList = historyDao.getLayoutListByInterface(dt, interfaceId);
|
||||
if( !lList.isEmpty() ) list.put(FileWriteUtil.LAYOUT, lList);
|
||||
ArrayList<HashMap<String, String>> tList = historyDao.getTransformListByInterface(dt, interfaceId);
|
||||
if( !tList.isEmpty() ) list.put(FileWriteUtil.TRANSFORM, tList);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
업무코드 10
|
||||
작성자사번 10
|
||||
프로그램명 200
|
||||
프로그램설명 1000
|
||||
디렉토리 500
|
||||
프로그램종류 100
|
||||
언어 100
|
||||
관리자서번 10
|
||||
*/
|
||||
public String parse(String serviceType, String iomapPath, String userId, HashMap<String, ArrayList<HashMap<String, String>>> list) throws Exception {
|
||||
String delimeter = "\t";
|
||||
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
|
||||
if( list.get(FileWriteUtil.INTERFACE) != null && list.get(FileWriteUtil.INTERFACE).size() > 0 ) {
|
||||
for(HashMap<String, String> data : list.get(FileWriteUtil.INTERFACE)) {
|
||||
buffer.append(data.get("bizCode").trim()).append(delimeter);
|
||||
buffer.append(data.get("UpdateBy")).append(delimeter);
|
||||
buffer.append(data.get("programNm")).append(delimeter);
|
||||
buffer.append(NullControl.trimSpace(data.get("programDesc"))).append(delimeter);
|
||||
buffer.append(iomapPath).append(serviceType).append("/").append(data.get("bizCode").trim()).append("/").append(FileWriteUtil.INTERFACE).append(delimeter);
|
||||
buffer.append(serviceType).append("-인터페이스").append(delimeter);
|
||||
buffer.append("전문").append(delimeter);
|
||||
buffer.append("").append(delimeter);
|
||||
buffer.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
if( list.get(FileWriteUtil.LAYOUT) != null && list.get(FileWriteUtil.LAYOUT).size() > 0 ) {
|
||||
for(HashMap<String, String> data : list.get(FileWriteUtil.LAYOUT)) {
|
||||
buffer.append(data.get("bizCode")).append(delimeter);
|
||||
buffer.append(data.get("UpdateBy")).append(delimeter);
|
||||
buffer.append(data.get("programNm")).append(delimeter);
|
||||
buffer.append(NullControl.trimSpace(data.get("programDesc"))).append(delimeter);
|
||||
buffer.append(iomapPath).append(serviceType).append("/").append(data.get("bizCode")).append("/").append(FileWriteUtil.LAYOUT).append(delimeter);
|
||||
buffer.append(serviceType).append("-레이아웃로드").append(delimeter);
|
||||
buffer.append("전문").append(delimeter);
|
||||
buffer.append("").append(delimeter);
|
||||
buffer.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
if( list.get(FileWriteUtil.TRANSFORM) != null && list.get(FileWriteUtil.TRANSFORM).size() > 0 ) {
|
||||
for(HashMap<String, String> data : list.get(FileWriteUtil.TRANSFORM)) {
|
||||
buffer.append(data.get("bizCode")).append(delimeter);
|
||||
buffer.append(data.get("UpdateBy")).append(delimeter);
|
||||
buffer.append(data.get("programNm")).append(delimeter);
|
||||
buffer.append(NullControl.trimSpace(data.get("programDesc"))).append(delimeter);
|
||||
buffer.append(iomapPath).append(serviceType).append("/").append(data.get("bizCode")).append("/").append(FileWriteUtil.TRANSFORM).append(delimeter);
|
||||
buffer.append(serviceType).append("-변환로드").append(delimeter);
|
||||
buffer.append("전문").append(delimeter);
|
||||
buffer.append("").append(delimeter);
|
||||
buffer.append("\n");
|
||||
}
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
public String parseSimple(String serviceType, String iomapPath, HashMap<String, ArrayList<HashMap<String, String>>> list) throws Exception {
|
||||
String delimeter = "|";
|
||||
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
|
||||
if( list.get(FileWriteUtil.INTERFACE) != null && list.get(FileWriteUtil.INTERFACE).size() > 0 ) {
|
||||
for(HashMap<String, String> data : list.get(FileWriteUtil.INTERFACE)) {
|
||||
buffer.append(data.get("bizCode").trim()).append(delimeter);
|
||||
buffer.append(data.get("UpdateBy")).append(delimeter);
|
||||
buffer.append(data.get("programNm")).append(delimeter);
|
||||
buffer.append(iomapPath).append(serviceType).append("/").append(data.get("bizCode").trim()).append("/").append(FileWriteUtil.INTERFACE).append(delimeter);
|
||||
buffer.append(FileWriteUtil.INTERFACE).append(delimeter);
|
||||
buffer.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
if( list.get(FileWriteUtil.LAYOUT) != null && list.get(FileWriteUtil.LAYOUT).size() > 0 ) {
|
||||
for(HashMap<String, String> data : list.get(FileWriteUtil.LAYOUT)) {
|
||||
buffer.append(data.get("bizCode")).append(delimeter);
|
||||
buffer.append(data.get("UpdateBy")).append(delimeter);
|
||||
buffer.append(data.get("programNm")).append(delimeter);
|
||||
buffer.append(iomapPath).append(serviceType).append("/").append(data.get("bizCode")).append("/").append(FileWriteUtil.LAYOUT).append(delimeter);
|
||||
buffer.append(FileWriteUtil.LAYOUT).append(delimeter);
|
||||
buffer.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
if( list.get(FileWriteUtil.TRANSFORM) != null && list.get(FileWriteUtil.TRANSFORM).size() > 0 ) {
|
||||
for(HashMap<String, String> data : list.get(FileWriteUtil.TRANSFORM)) {
|
||||
buffer.append(data.get("bizCode")).append(delimeter);
|
||||
buffer.append(data.get("UpdateBy")).append(delimeter);
|
||||
buffer.append(data.get("programNm")).append(delimeter);
|
||||
buffer.append(iomapPath).append(serviceType).append("/").append(data.get("bizCode")).append("/").append(FileWriteUtil.TRANSFORM).append(delimeter);
|
||||
buffer.append(FileWriteUtil.TRANSFORM).append(delimeter);
|
||||
buffer.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
if( list.get(FileWriteUtil.ADAPTER) != null && list.get(FileWriteUtil.ADAPTER).size() > 0 ) {
|
||||
for(HashMap<String, String> data : list.get(FileWriteUtil.ADAPTER)) {
|
||||
buffer.append(data.get("bizCode")).append(delimeter);
|
||||
buffer.append(data.get("UpdateBy")).append(delimeter);
|
||||
buffer.append(data.get("programNm")).append(delimeter);
|
||||
buffer.append(iomapPath).append(serviceType).append("/").append(data.get("bizCode")).append("/").append(FileWriteUtil.TRANSFORM).append(delimeter);
|
||||
buffer.append(FileWriteUtil.ADAPTER).append(delimeter);
|
||||
buffer.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, ArrayList<HashMap<String, String>>> userHistoryListByLayout(DataSourceType dt,
|
||||
String[] eaiLoutNames) throws Exception {
|
||||
HashMap<String, ArrayList<HashMap<String, String>>> list = new HashMap<String, ArrayList<HashMap<String, String>>>();
|
||||
ArrayList<HashMap<String, String>> lList = historyDao.getLayoutListByLyoutNames(dt, eaiLoutNames);
|
||||
if (!lList.isEmpty()) {
|
||||
list.put(FileWriteUtil.LAYOUT, lList);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, ArrayList<HashMap<String, String>>> userHistoryListByTransform(DataSourceType dt,
|
||||
String[] cnvsnNames) throws Exception {
|
||||
HashMap<String, ArrayList<HashMap<String, String>>> list = new HashMap<String, ArrayList<HashMap<String, String>>>();
|
||||
ArrayList<HashMap<String, String>> lList = historyDao.getTranstormListByTransformNames(dt, cnvsnNames);
|
||||
if (!lList.isEmpty()) {
|
||||
list.put(FileWriteUtil.TRANSFORM, lList);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, ArrayList<HashMap<String, String>>> userHistoryListByAdapter(DataSourceType dt,
|
||||
String[] adapterNames) throws Exception {
|
||||
HashMap<String, ArrayList<HashMap<String, String>>> list = new HashMap<String, ArrayList<HashMap<String, String>>>();
|
||||
ArrayList<HashMap<String, String>> lList = historyDao.getAdapterListByAdapterNames(dt, adapterNames);
|
||||
if (!lList.isEmpty()) {
|
||||
list.put(FileWriteUtil.ADAPTER, lList);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
|
||||
@AllArgsConstructor
|
||||
|
||||
public class HistoryVo {
|
||||
|
||||
private String bizCode;
|
||||
private String updateBy;
|
||||
private String programNm;
|
||||
|
||||
private String programDesc;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.quartz.SchedulerException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
import com.eactive.eai.common.util.DatetimeUtil;
|
||||
import com.eactive.eai.rms.bat.loader.service.TransactionLoaderServiceImpl;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
||||
import com.eactive.eai.rms.onl.common.util.DateUtil;
|
||||
import com.eactive.eai.rms.onl.loader.vo.RuleDeployJobVo;
|
||||
|
||||
public class RuleDeployJob implements Job {
|
||||
private static final Log logger = LogFactory.getLog(RuleDeployJob.class);
|
||||
|
||||
private static final int FAILED_MAX_CNT = 10;
|
||||
private static final int DEFAULT_DELETE_HISTORY_DAYS = 365;
|
||||
private static final int MINIMUM_DELETE_HISTORY_DAYS = 90;
|
||||
|
||||
private RuleDeployJobService ruleDeployJobService;
|
||||
private TransactionLoaderService loaderService;
|
||||
private TransactionLoaderServiceImpl batLoaderService;
|
||||
|
||||
/**
|
||||
* DJ01 테이블에서 현재시간보다 이전인 데이터 작업 대상이다.<br>
|
||||
* 목록조회후 status working으로 업데이트하고 작업 수행한다.(다른 스레드 중복작업 방지)<br>
|
||||
* 실패하면 failedCnt ++ 한다.<br>
|
||||
* failCnt가 특정 횟수 넘어가면 status를 failed로 처리한다.(더이상 수행 안함)<br>
|
||||
*/
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
logger.info("START RULE_DEPLOY_JOB...");
|
||||
|
||||
ApplicationContext appContext = null;
|
||||
try {
|
||||
appContext = (ApplicationContext) context.getScheduler().getContext().get("applicationContext");
|
||||
} catch (SchedulerException e) {
|
||||
logger.error("applicationContext get module error", e);
|
||||
return;
|
||||
}
|
||||
|
||||
ruleDeployJobService = (RuleDeployJobService) appContext.getBean("ruleDeployJobService");
|
||||
|
||||
try {
|
||||
// 1. Job 목록 확보(최대 100개)
|
||||
RuleDeployJobVo searchJobVo = new RuleDeployJobVo();
|
||||
searchJobVo.setStatus("standby");
|
||||
searchJobVo.setScheduledDateTime(DatetimeUtil.getCurrentDateTime());
|
||||
List<RuleDeployJobVo> jobList = ruleDeployJobService.selectJobAll(searchJobVo, 1, 100);
|
||||
if (jobList == null || jobList.size() == 0) {
|
||||
logger.info("...NO HAVE RULE_DEPLOY_JOB...");
|
||||
logger.info("...RULE_DEPLOY_JOB END");
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 작업 수행
|
||||
batLoaderService = (TransactionLoaderServiceImpl) appContext.getBean("batLoaderService");
|
||||
loaderService = (TransactionLoaderService) appContext.getBean("loaderService");
|
||||
int failedJobCnt = 0;
|
||||
for (RuleDeployJobVo ruleDeployJobVo : jobList) {
|
||||
if (!doRun(ruleDeployJobVo)) {
|
||||
failedJobCnt++;
|
||||
}
|
||||
}
|
||||
|
||||
if (failedJobCnt > 0) {
|
||||
throw new Exception(failedJobCnt + "times failed");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
logger.info("...RULE_DEPLOY_JOB END");
|
||||
throw new JobExecutionException(e);
|
||||
}
|
||||
|
||||
// 오래된 히스토리 삭제
|
||||
cleansingHistoryData(context);
|
||||
logger.info("...RULE_DEPLOY_JOB END");
|
||||
}
|
||||
|
||||
private boolean doRun(RuleDeployJobVo ruleDeployJobVo) {
|
||||
logger.info(ruleDeployJobVo.getJobId() + ": Start");
|
||||
|
||||
try {
|
||||
// 다른 쓰레드에 의한 중복작업 방지를 위해 다시 체크
|
||||
RuleDeployJobVo jobVo = ruleDeployJobService.selectOne(ruleDeployJobVo.getJobId());
|
||||
if (!StringUtils.equals(jobVo.getStatus(), "standby")) {
|
||||
logger.info(jobVo.getJobId() + ": Other Thread run..");
|
||||
return true;
|
||||
}
|
||||
|
||||
// 다른 쓰레드에 의한 중복작업 방지를 위해 상태 업데이트
|
||||
jobVo.setStatus("working");
|
||||
jobVo.setLastJobTime(DatetimeUtil.getCurrentDateTime());
|
||||
ruleDeployJobService.update(jobVo);
|
||||
|
||||
if (StringUtils.equals(jobVo.getServiceType(), DataSourceTypeManager.BAT)) {
|
||||
if (!batLoaderService.ruleDataSaveAndLoading(jobVo)) {
|
||||
throw new Exception();
|
||||
}
|
||||
} else {
|
||||
if (!loaderService.ruleDataSaveAndLoading(jobVo)) {
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
jobVo.setStatus("finished");
|
||||
jobVo.setFailedMsg("");
|
||||
ruleDeployJobService.update(jobVo);
|
||||
|
||||
logger.info(jobVo.getJobId() + ": Finished");
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
processFailJob(ruleDeployJobVo, StringUtils.left(e.getMessage(), 500));
|
||||
|
||||
logger.error(e.getMessage());
|
||||
logger.info(ruleDeployJobVo.getJobId() + ": Failed");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void processFailJob(RuleDeployJobVo jobVo, String failedMsg) {
|
||||
try {
|
||||
jobVo.setLastJobTime(DatetimeUtil.getCurrentDateTime());
|
||||
jobVo.setFailedCnt(jobVo.getFailedCnt() + 1);
|
||||
if (jobVo.getFailedCnt() < FAILED_MAX_CNT) {
|
||||
jobVo.setStatus("standby");
|
||||
} else {
|
||||
jobVo.setStatus("failed");
|
||||
}
|
||||
jobVo.setFailedMsg(String.format("%s: %s", DatetimeUtil.getTimeStampString(), failedMsg));
|
||||
ruleDeployJobService.update(jobVo);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void cleansingHistoryData(JobExecutionContext context) {
|
||||
try {
|
||||
int beforeDays = DEFAULT_DELETE_HISTORY_DAYS; // 1년
|
||||
try {
|
||||
beforeDays = Integer
|
||||
.parseInt(context.getJobDetail().getJobDataMap().getString("delete.history.before.days"));
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
if (beforeDays < MINIMUM_DELETE_HISTORY_DAYS) {
|
||||
beforeDays = MINIMUM_DELETE_HISTORY_DAYS;
|
||||
}
|
||||
|
||||
ruleDeployJobService.deleteHistory(DateUtil.getDateTime("yyyyMMddhhmmssSS", -beforeDays));
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.eactive.eai.rms.onl.loader.vo.RuleDeployJobVo;
|
||||
|
||||
public interface RuleDeployJobService {
|
||||
|
||||
public void insert(RuleDeployJobVo jobVo) throws Exception;
|
||||
|
||||
public void update(RuleDeployJobVo jobVo) throws Exception;
|
||||
|
||||
public RuleDeployJobVo selectOne(String jobId) throws Exception;
|
||||
|
||||
public List<RuleDeployJobVo> selectJobAll(RuleDeployJobVo searchJobVo, int startIdx, int endIdx) throws Exception;
|
||||
|
||||
public void deleteHistory(String dateTime) throws Exception;
|
||||
|
||||
public HashMap<String, Object> selectList(int startNum, int endNum, String searchJobTitle, String searchStatus,
|
||||
String sortName, String sortOrder) throws Exception;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public HashMap selectJobDetail(String jobId) throws Exception;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void delete(HashMap paramMap) throws Exception;
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.eactive.eai.rms.common.base.BaseService;
|
||||
import com.eactive.eai.rms.onl.loader.dao.RuleDeployJobDao;
|
||||
import com.eactive.eai.rms.onl.loader.vo.RuleDeployJobItemVo;
|
||||
import com.eactive.eai.rms.onl.loader.vo.RuleDeployJobVo;
|
||||
|
||||
@Service("ruleDeployJobService")
|
||||
public class RuleDeployJobServiceImpl extends BaseService implements RuleDeployJobService {
|
||||
@Autowired
|
||||
private RuleDeployJobDao ruleDeployJobDao;
|
||||
|
||||
@Override
|
||||
public void insert(RuleDeployJobVo jobVo) throws Exception {
|
||||
ruleDeployJobDao.insert(jobVo);
|
||||
|
||||
List<RuleDeployJobItemVo> jobItemList = jobVo.getItemList();
|
||||
if (jobItemList == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (RuleDeployJobItemVo itemVo : jobItemList) {
|
||||
ruleDeployJobDao.insertItem(itemVo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(RuleDeployJobVo jobVo) throws Exception {
|
||||
ruleDeployJobDao.update(jobVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RuleDeployJobVo selectOne(String jobId) throws Exception {
|
||||
RuleDeployJobVo jobVo = ruleDeployJobDao.selectOne(jobId);
|
||||
List<RuleDeployJobItemVo> itemList = ruleDeployJobDao.selectItems(jobId);
|
||||
jobVo.setItemList(itemList);
|
||||
return jobVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RuleDeployJobVo> selectJobAll(RuleDeployJobVo searchJobVo, int startIdx, int endIdx) throws Exception {
|
||||
return ruleDeployJobDao.selectJobAll(searchJobVo, startIdx, endIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteHistory(String dateTime) throws Exception {
|
||||
ruleDeployJobDao.deleteItemHistory(dateTime);
|
||||
ruleDeployJobDao.deleteHistory(dateTime);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public HashMap<String, Object> selectList(int startNum, int endNum, String searchJobTitle, String searchStatus,
|
||||
String sortName, String sortOrder) throws Exception {
|
||||
HashMap paramMap = new HashMap();
|
||||
// 검색 조건
|
||||
paramMap.put("searchJobTitle", searchJobTitle);
|
||||
paramMap.put("searchStatus", searchStatus);
|
||||
paramMap.put("sortName", sortName);
|
||||
paramMap.put("sortOrder", sortOrder);
|
||||
|
||||
// 전체 목록수 얻기
|
||||
int totalCount = ruleDeployJobDao.selectListCount(paramMap);
|
||||
|
||||
paramMap.put("startNum", startNum);// 시작 record
|
||||
paramMap.put("endNum", endNum);// 끝 record
|
||||
|
||||
List list = ruleDeployJobDao.selectList(paramMap);
|
||||
|
||||
HashMap map = new HashMap();
|
||||
map.put("totalCount", totalCount);
|
||||
map.put("list", list);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public HashMap selectJobDetail(String jobId) throws Exception {
|
||||
HashMap<String, Object> paramMap = new HashMap<String, Object>();
|
||||
paramMap.put("jobId", jobId);
|
||||
|
||||
HashMap job = ruleDeployJobDao.selectJobDetail(paramMap);
|
||||
List<HashMap> jobItems = ruleDeployJobDao.selectJobItems(paramMap);
|
||||
|
||||
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("detail", job);
|
||||
map.put("rows", jobItems);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void delete(HashMap paramMap) throws Exception {
|
||||
ruleDeployJobDao.deleteJobItems(paramMap);
|
||||
ruleDeployJobDao.delete(paramMap);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.eactive.eai.rms.common.base.BaseService;
|
||||
import com.eactive.eai.rms.onl.loader.dao.SearchDao;
|
||||
|
||||
@Service("searchService")
|
||||
public class SearchService extends BaseService {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("searchDao")
|
||||
private SearchDao dao;
|
||||
|
||||
public SearchService() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* resource 조회
|
||||
*/
|
||||
public HashMap selectList(HttpServletRequest request, int startNum,int endNum, HashMap<String,Object> paramMap) throws Exception {
|
||||
paramMap.put("startNum" , startNum);// 시작 record
|
||||
paramMap.put("endNum" , endNum);// 끝 record
|
||||
|
||||
List list = dao.selectList(paramMap);
|
||||
|
||||
HashMap map = new HashMap();
|
||||
|
||||
//map.put("totalCount", totalCount);
|
||||
|
||||
map.put("list", list);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import com.eactive.eai.rms.common.base.BaseService;
|
||||
import com.eactive.eai.rms.common.converter.ElinkObjectMapper;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
public class TransactionDeployJsonEmptyService extends BaseService implements TransactionDeployJsonService {
|
||||
|
||||
protected final ElinkObjectMapper mapper = new ElinkObjectMapper();;
|
||||
|
||||
public TransactionDeployJsonEmptyService() {
|
||||
mapper.enable(SerializationFeature.WRITE_SELF_REFERENCES_AS_NULL);
|
||||
mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
|
||||
mapper.enable(SerializationFeature.INDENT_OUTPUT);
|
||||
mapper.enable(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS);
|
||||
mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
|
||||
mapper.writerWithDefaultPrettyPrinter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertLayoutLoading(String path, String fileName) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertTransformLoading(String path, String fileName) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertInterfaceLoading(String path, String fileName) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInterface(String serviceName) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLayout(String layoutName) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTransform(String transformName) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void interfaceDownLoading(String path, String serviceName) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void layoutDownLoading(String path, String layoutName) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transformDownLoading(String path, String transformName) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
protected String load(String filePath, String encoding) {
|
||||
File file = new File(filePath);
|
||||
byte[] data = null;
|
||||
try (ByteArrayOutputStream outStream = new ByteArrayOutputStream();
|
||||
FileInputStream fis = new FileInputStream(file))
|
||||
{
|
||||
int c = -1;
|
||||
byte[] bytes = new byte[1024];
|
||||
|
||||
while ((c = fis.read(bytes, 0, bytes.length)) != -1) {
|
||||
outStream.write(bytes, 0, c);
|
||||
}
|
||||
data = new byte[outStream.toByteArray().length];
|
||||
data = outStream.toByteArray();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
try {
|
||||
return new String(data, encoding);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return new String(data);
|
||||
}
|
||||
}
|
||||
|
||||
protected String load(String filePath) throws Exception {
|
||||
return load(filePath, Charset.defaultCharset().name());
|
||||
}
|
||||
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
public interface TransactionDeployJsonService{
|
||||
|
||||
/**
|
||||
* layout loading
|
||||
*/
|
||||
public void insertLayoutLoading(String path, String fileName) throws Exception;
|
||||
/**
|
||||
* transform loading
|
||||
*/
|
||||
public void insertTransformLoading(String path, String fileName) throws Exception;
|
||||
/**
|
||||
* interface loading
|
||||
*/
|
||||
public void insertInterfaceLoading(String path, String fileName) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* interface downloading
|
||||
*/
|
||||
public String getInterface(String serviceName) throws Exception;
|
||||
/**
|
||||
* layout downloading
|
||||
*/
|
||||
public String getLayout(String layoutName) throws Exception ;
|
||||
/**
|
||||
* transform downloading
|
||||
*/
|
||||
public String getTransform(String transformName) throws Exception ;
|
||||
|
||||
/**
|
||||
* interface downloading
|
||||
*/
|
||||
public void interfaceDownLoading(String path, String serviceName) throws Exception;
|
||||
/**
|
||||
* layout downloading
|
||||
*/
|
||||
public void layoutDownLoading(String path,String layoutName) throws Exception ;
|
||||
/**
|
||||
* transform downloading
|
||||
*/
|
||||
public void transformDownLoading(String path,String transformName) throws Exception ;
|
||||
}
|
||||
+329
@@ -0,0 +1,329 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.adapter.Adapter;
|
||||
import com.eactive.eai.data.entity.onl.stdmessage.StandardMessageInfo;
|
||||
import com.eactive.eai.rms.common.context.MonitoringContext;
|
||||
import com.eactive.eai.rms.data.entity.onl.adapter.AdapterGroupService;
|
||||
import com.eactive.eai.rms.data.entity.onl.adapter.AdapterService;
|
||||
import com.eactive.eai.rms.data.entity.onl.stdmessage.StandardMessageInfoService;
|
||||
import com.eactive.eai.rms.onl.common.util.FileWriteUtil;
|
||||
import com.eactive.eai.rms.onl.loader.intf.InterfaceDeployService;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.EAIMessageDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.StandardMessageInfoDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.layout.LayoutDeployService;
|
||||
import com.eactive.eai.rms.onl.loader.layout.deploy.LayoutDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.transform.TransformDeployService;
|
||||
import com.eactive.eai.rms.onl.loader.transform.deploy.TransformDeploy;
|
||||
|
||||
@Service("deployJsonServiceOnline")
|
||||
public class TransactionDeployJsonServiceOnline extends TransactionDeployJsonEmptyService {
|
||||
|
||||
/** The monitoring context. */
|
||||
@Autowired
|
||||
@Qualifier("monitoringContext")
|
||||
private transient MonitoringContext monitoringContext;
|
||||
|
||||
@Autowired @Qualifier("OnlInterfaceDeployService")
|
||||
private InterfaceDeployService interfaceDeployService;
|
||||
|
||||
@Autowired
|
||||
private LayoutDeployService layoutDeployService;
|
||||
|
||||
@Autowired
|
||||
private TransformDeployService transformDeployService;
|
||||
|
||||
@Autowired
|
||||
private AdapterGroupService adapterGroupService;
|
||||
|
||||
@Autowired
|
||||
private AdapterService adapterService;
|
||||
|
||||
@Autowired
|
||||
private StandardMessageInfoService standardMessageInfoService;
|
||||
|
||||
|
||||
@Transactional
|
||||
public void insertLayoutLoading(String path, String fileName)
|
||||
throws Exception {
|
||||
String json = load(path + fileName, "UTF-8");
|
||||
LayoutDeploy deploy = mapper.readValue(json, LayoutDeploy.class);
|
||||
layoutDeployService.saveDeploy(deploy);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void insertTransformLoading(String path, String fileName)
|
||||
throws Exception {
|
||||
String json = load(path + fileName, "UTF-8");
|
||||
TransformDeploy transformDeploy = mapper.readValue(json, TransformDeploy.class);
|
||||
transformDeployService.saveDeploy(transformDeploy);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void insertInterfaceLoading(String path, String fileName)
|
||||
throws Exception {
|
||||
String json = load(path + fileName, "UTF-8");
|
||||
EAIMessageDeploy eaiMessageDeploy = mapper.readValue(json, EAIMessageDeploy.class);
|
||||
checkAdapter(eaiMessageDeploy);
|
||||
checkAdapterInstance(eaiMessageDeploy);
|
||||
checkInnerStandardDuplication(eaiMessageDeploy);
|
||||
interfaceDeployService.saveDeploy(eaiMessageDeploy);
|
||||
}
|
||||
|
||||
private void checkAdapter(EAIMessageDeploy deploy) throws Exception {
|
||||
String eaiSvcName = deploy.getEaisvcname(); //인터페이스명
|
||||
|
||||
//1.src adapter 추출
|
||||
String srcAdapter = deploy.getGstatsysadptrbzwkgroupname();
|
||||
String srcType = deploy.getSvcmotivusedstcd();
|
||||
if (StringUtils.isBlank(srcAdapter)) {
|
||||
throw new Exception("소스 어댑터명이 비었습니다. interface["+ deploy.getEaisvcname() +"]");
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
if (!adapterGroupService.findById(srcAdapter).isPresent()) {
|
||||
throw new Exception("소스어댑터("+srcAdapter+")가 DB에 존재하지 않습니다.");
|
||||
}
|
||||
if (deploy.getServiceMessages() == null || deploy.getServiceMessages().size() ==0 ) {
|
||||
throw new Exception("인터페이스("+eaiSvcName+") 서비스처리정보가 없습니다.");
|
||||
}
|
||||
String sndRecvType = eaiSvcName.substring(eaiSvcName.length()-2, eaiSvcName.length()-1); //인터페이스 송수신구분
|
||||
|
||||
//2.tgt adapter 추출
|
||||
String tgtAdapter = deploy.getServiceMessages().get(0).getPsvsysadptrbzwkgroupname();
|
||||
String tgtType = deploy.getServiceMessages().get(0).getPsvintfacdsticname();
|
||||
|
||||
//S-A 응답일때 빼고 수동어댑터 체크
|
||||
if ("SYNC".equals(srcType) && "ASYN".equals(tgtType) && "R".equals(sndRecvType) ) {
|
||||
;
|
||||
}else {
|
||||
if (StringUtils.isBlank(tgtAdapter)) {
|
||||
throw new Exception("타겟 어댑터명이 비었습니다.. interface["+ deploy.getEaisvcname() +"]");
|
||||
}
|
||||
if (!adapterGroupService.findById(tgtAdapter).isPresent()) {
|
||||
throw new Exception("타겟 어댑터("+tgtAdapter+")가 DB에 존재하지 않습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
// A-S > HE01의 인터페이스유형 ASYN이고 HE02의 첫번째 수동인터페이스가 SYNC일 때 -> 수동인터페이스 2개
|
||||
if(srcType.equals("ASYN") && tgtType.equals("SYNC")){
|
||||
if(deploy.getServiceMessages().size()==1){
|
||||
throw new Exception("sync-async 응답 서비스가 존재 하지 않습니다.");
|
||||
}
|
||||
|
||||
String resAdapter = deploy.getServiceMessages().get(1).getPsvsysadptrbzwkgroupname();
|
||||
if(StringUtils.isBlank(resAdapter)){
|
||||
throw new Exception("sync-async 응답 어댑터명이 비었습니다. interface["+ deploy.getEaisvcname() +"]");
|
||||
}
|
||||
if (!adapterGroupService.findById(resAdapter).isPresent()) {
|
||||
throw new Exception("sync-async 응답 어댑터("+resAdapter+")가 존재하지 않습니다.");
|
||||
}
|
||||
}
|
||||
}
|
||||
private void checkAdapterInstance(EAIMessageDeploy deploy) throws Exception {
|
||||
boolean ret = true;
|
||||
if (deploy == null || StringUtils.isBlank(deploy.getEaisvcname())){
|
||||
ret = false;
|
||||
throw new Exception("인터페이스가 존재하지 않습니다.");
|
||||
}
|
||||
String eaiSvcName = deploy.getEaisvcname();
|
||||
String srcType = deploy.getSvcmotivusedstcd();
|
||||
String srcAdapter = deploy.getGstatsysadptrbzwkgroupname(); //기동어댑터명
|
||||
|
||||
if (deploy.getServiceMessages() == null || deploy.getServiceMessages().size() ==0 ) {
|
||||
throw new Exception("인터페이스("+eaiSvcName+") 서비스처리정보가 없습니다.");
|
||||
}
|
||||
|
||||
String tgtAdapter = deploy.getServiceMessages().get(0).getPsvsysadptrbzwkgroupname(); //수동어댑터명
|
||||
String tgtType = deploy.getServiceMessages().get(0).getPsvintfacdsticname();
|
||||
|
||||
String sndRecvType = eaiSvcName.substring(eaiSvcName.length()-2, eaiSvcName.length()-1); //인터페이스 송수신구분
|
||||
|
||||
//ad02
|
||||
Iterable<Adapter> ouAdapterInst = adapterService.findByIdAdptrbzwkgroupname(tgtAdapter);
|
||||
//outBound 어댑터 정보가 없고 그룹명만 있을 때 ____ 비교 X
|
||||
int count =0;
|
||||
for(Adapter a : ouAdapterInst) {
|
||||
count++;
|
||||
}
|
||||
if(count==0){
|
||||
return ;
|
||||
}
|
||||
|
||||
//기동어댑터와 관계없이 수동어댑터 바인딩된 인스턴스가 ALL일때 우선적으로 PASS (A_S 패턴 포함 - 처리순서1인 어댑터로 비교)
|
||||
for(Adapter a : ouAdapterInst) {
|
||||
if ("ALL".equals(a.getEaisevrinstncname())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Iterable<Adapter> inAdapterInst = adapterService.findByIdAdptrbzwkgroupname(srcAdapter);
|
||||
//inBound 어댑터 정보가 없고 그룹명만 있을 때 ____ 비교 X
|
||||
count =0;
|
||||
for(Adapter a : inAdapterInst) {
|
||||
count++;
|
||||
}
|
||||
if(count==0){
|
||||
return ;
|
||||
}
|
||||
|
||||
Iterable<Adapter> ouAdptInst2 = null;
|
||||
|
||||
//S_A 패턴 응답 ___ 비교 X
|
||||
if(srcType.equals("SYNC") && tgtType.equals("ASYN") && sndRecvType.equals("R")){
|
||||
return ;
|
||||
}
|
||||
|
||||
//A_S 패턴
|
||||
if(srcType.equals("ASYN") && tgtType.equals("SYNC")){
|
||||
if(deploy.getServiceMessages().size()==1){
|
||||
throw new Exception("sync-async 응답 서비스가 존재 하지 않습니다.");
|
||||
}
|
||||
String resAdapter = deploy.getServiceMessages().get(1).getPsvsysadptrbzwkgroupname();
|
||||
|
||||
ouAdptInst2 = adapterService.findByIdAdptrbzwkgroupname(resAdapter);
|
||||
}
|
||||
/**
|
||||
* SNA 체크임 SNA안쓰는곳에서는 필요없음-시작
|
||||
*/
|
||||
/*
|
||||
//IN 어댑터 List의 ADPTRCD는 다 같음.
|
||||
String adptrGrpName = (String)inAdptInstList.get(0).get("ADPTRBZWKGROUPNAME");
|
||||
//IN 어댑터가 SNA일때
|
||||
boolean flag = false;
|
||||
if(adptrGrpName.indexOf("SNA")>=0){
|
||||
inAdptInstList.clear();
|
||||
List<LinkedHashMap> snaApList = inboundErrorInfoDao.selectSnaAdpApList(dataSourceType, adptrGrpName);
|
||||
String svcApCd = eaiSvcName.substring(0,3); //서비스코드 앞 3자리
|
||||
for(LinkedHashMap m : snaApList){
|
||||
String apList = (String)m.get("PRPTY2VAL");
|
||||
int chk = apList.indexOf(svcApCd);
|
||||
if(chk>=0){
|
||||
inAdptInstList.add(m);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
if(!flag){
|
||||
ret = false;
|
||||
throw new Exception("[EAI서비스코드 : "+eaiSvcName+"] AP코드("+svcApCd+")가 SNA어댑터["+adptrGrpName+"]에 존재하지 않습니다");
|
||||
}
|
||||
}
|
||||
//in out 불일치
|
||||
int cnt = inAdptInstList.size();
|
||||
String srcAdptName = "";
|
||||
String tgtAdptName = "";
|
||||
for(HashMap om : ouAdptInstList){
|
||||
String ouInst = (String)om.get("EAISEVRINSTNCNAME");
|
||||
tgtAdptName = (String)om.get("ADPTRBZWKGROUPNAME");
|
||||
if("ALL".equals(ouInst)){
|
||||
cnt=0;
|
||||
break;
|
||||
}
|
||||
for(HashMap im : inAdptInstList){
|
||||
String inInst =(String)im.get("EAISEVRINSTNCNAME");
|
||||
srcAdptName = (String)im.get("ADPTRBZWKGROUPNAME");
|
||||
if(ouInst.equals(inInst)){
|
||||
cnt--;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cnt>0){
|
||||
ret = false;
|
||||
throw new Exception("[EAI서비스코드 : "+eaiSvcName+"] 기동어댑터와 수동어댑터의 인스턴스가 일치하지 않습니다 [기동 : "+srcAdptName+" / 수동 : "+tgtAdptName+"]");
|
||||
}
|
||||
if(ouAdptInstList2.size()>0){ //A-S 패턴 수동인터페이스 어댑터2 번째꺼
|
||||
int cnt2 = inAdptInstList.size();
|
||||
for(HashMap om : ouAdptInstList2){
|
||||
String ouInst = (String)om.get("EAISEVRINSTNCNAME");
|
||||
tgtAdptName = (String)om.get("ADPTRBZWKGROUPNAME");
|
||||
if("ALL".equals(ouInst)){
|
||||
cnt2=0;
|
||||
break;
|
||||
}
|
||||
for(HashMap im : inAdptInstList){
|
||||
String inInst =(String)im.get("EAISEVRINSTNCNAME");
|
||||
srcAdptName = (String)im.get("ADPTRBZWKGROUPNAME");
|
||||
if(ouInst.equals(inInst)){
|
||||
cnt2--;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cnt2>0){
|
||||
ret = false;
|
||||
throw new Exception("[EAI서비스코드 : "+eaiSvcName+"] 기동어댑터와 수동어댑터의 인스턴스가 일치하지 않습니다 [기동 : "+srcAdptName+" / 수동 : "+tgtAdptName+"]");
|
||||
}
|
||||
}
|
||||
*/
|
||||
/**
|
||||
* SNA 체크임 SNA안쓰는곳에서는 필요없음-종료
|
||||
*/
|
||||
|
||||
}
|
||||
private void checkInnerStandardDuplication(EAIMessageDeploy deploy) throws Exception {
|
||||
List<StandardMessageInfoDeploy> standardInfo = deploy.getStandardMessageInfoDeploys();
|
||||
if (standardInfo.size()> 0 ) {
|
||||
for(StandardMessageInfoDeploy s : standardInfo) {
|
||||
//db정보가져옴
|
||||
Optional<StandardMessageInfo> optional = standardMessageInfoService.findById(s.getBzwksvckeyname());
|
||||
if (optional.isPresent()) {
|
||||
StandardMessageInfo info = optional.get();
|
||||
if (!deploy.getEaisvcname().equals(info.getEaisvcname())){// 설정정보가 다른경우
|
||||
throw new Exception("저장 하려는 내부표준전문 key("+s.getBzwksvckeyname()+") 의 interface("+deploy.getEaisvcname()+")값과 DB의 interface("+info.getEaisvcname()+")값이 다르다");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@Transactional
|
||||
public String getLayout(String layoutName) throws Exception {
|
||||
LayoutDeploy layoutDeploy = layoutDeployService.selectDeploy(layoutName);
|
||||
if (layoutDeploy == null) {
|
||||
throw new Exception ("layout data is empty layoutName =["+layoutName+"]") ;
|
||||
}
|
||||
|
||||
|
||||
return mapper.writeValueAsString(layoutDeploy);
|
||||
}
|
||||
@Transactional
|
||||
public String getTransform(String transformName) throws Exception {
|
||||
TransformDeploy transformDeploy = transformDeployService.selectDeploy(transformName);
|
||||
if (transformDeploy == null) {
|
||||
throw new Exception ("transform data is empty transformName =["+transformName+"]") ;
|
||||
}
|
||||
|
||||
return mapper.writeValueAsString(transformDeploy);
|
||||
}
|
||||
@Transactional
|
||||
public String getInterface(String eaiSvcName) throws Exception {
|
||||
EAIMessageDeploy interfaceDeploy = interfaceDeployService.selectDeploy(eaiSvcName);
|
||||
if (interfaceDeploy == null) {
|
||||
throw new Exception ("interface data is empty interfaceName =["+eaiSvcName+"]") ;
|
||||
}
|
||||
|
||||
return mapper.writeValueAsString(interfaceDeploy);
|
||||
}
|
||||
public void layoutDownLoading(String path,String layoutName) throws Exception {
|
||||
String json = getLayout(layoutName);
|
||||
FileWriteUtil.FileWrite(path , layoutName+".txt", json, "UTF-8");
|
||||
}
|
||||
public void transformDownLoading(String path,String transformName) throws Exception {
|
||||
String json = getTransform(transformName);
|
||||
FileWriteUtil.FileWrite(path , transformName+".txt", json, "UTF-8");
|
||||
}
|
||||
public void interfaceDownLoading(String path,String eaiSvcName) throws Exception {
|
||||
String json = getInterface(eaiSvcName);
|
||||
FileWriteUtil.FileWrite(path , eaiSvcName+".txt", json, "UTF-8");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package com.eactive.eai.rms.onl.loader.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
import com.eactive.eai.rms.onl.loader.vo.RuleDeployJobVo;
|
||||
|
||||
public interface TransactionLoaderService{
|
||||
|
||||
/**
|
||||
* layout loading
|
||||
*/
|
||||
public void insertLayoutLoading(DataSourceType dt, String path,String fileName) throws Exception ;
|
||||
/**
|
||||
* transform loading
|
||||
*/
|
||||
public void insertTransformLoading(DataSourceType dt, String path,String fileName) throws Exception ;
|
||||
/**
|
||||
* interface loading
|
||||
*/
|
||||
public void insertInterfaceLoading(DataSourceType dt, String path,String fileName) throws Exception ;
|
||||
/**
|
||||
* b2b loading
|
||||
*/
|
||||
public void insertB2BLoading(DataSourceType dt, String path,String fileName) throws Exception ;
|
||||
/**
|
||||
* C2R loading
|
||||
*/
|
||||
public void insertC2RLoading(DataSourceType dt, String path,String fileName) throws Exception ;
|
||||
/**
|
||||
* B2B Ext loading
|
||||
*/
|
||||
public void insertB2BExtLoading(DataSourceType dt, String path, String fileName) throws Exception;
|
||||
/**
|
||||
* adapter loading
|
||||
*/
|
||||
public void insertAdapterLoading(DataSourceType dt, String path,String fileName) throws Exception ;
|
||||
|
||||
/**
|
||||
* adapter loading Sync
|
||||
*/
|
||||
public void insertAdapterLoadingSync(DataSourceType dt, String path,String fileName) throws Exception ;
|
||||
|
||||
/**
|
||||
* adapter loading
|
||||
*/
|
||||
public void insertAdapterLoadingAll(DataSourceType dt, String path) throws Exception ;
|
||||
|
||||
/**
|
||||
* table loading
|
||||
*/
|
||||
public void insertTableLoading(DataSourceType dt, String path, String fileName) throws Exception ;
|
||||
|
||||
/**
|
||||
* adapter loading
|
||||
*/
|
||||
public void insertMessageKeyLoading(DataSourceType dt, String path,String fileName) throws Exception ;
|
||||
|
||||
/**
|
||||
* layout downloading
|
||||
*/
|
||||
public void layoutDownLoading(DataSourceType dt, String path,String serviceName) throws Exception ;
|
||||
/**
|
||||
* transform downloading
|
||||
*/
|
||||
public void transformDownLoading(DataSourceType dt, String path,String serviceName) throws Exception ;
|
||||
/**
|
||||
* transform downloading
|
||||
*/
|
||||
public LinkedHashMap<String,List> transformDownLoadingForData(DataSourceType dt, String path,String serviceName) throws Exception ;
|
||||
/**
|
||||
* interface downloading
|
||||
*/
|
||||
public void interfaceDownLoading(DataSourceType dt, String path,String serviceName) throws Exception ;
|
||||
/**
|
||||
* b2b downloading
|
||||
*/
|
||||
public void b2bDownLoading(DataSourceType dt, String path,String serviceName) throws Exception ;
|
||||
/**
|
||||
* c2r downloading
|
||||
*/
|
||||
public void c2rDownLoading(DataSourceType dt, String path, String serviceName) throws Exception;
|
||||
/**
|
||||
* b2b ext downloading
|
||||
*/
|
||||
public void b2bExtDownLoading(DataSourceType dt, String path, String serviceName) throws Exception;
|
||||
/**
|
||||
* adapter downloading
|
||||
*/
|
||||
public void adapterDownLoading(DataSourceType dt, String path,String serviceName) throws Exception ;
|
||||
/**
|
||||
* 어댑터의 인스턴스명을 바꿔주기 위해서 prefix 추가
|
||||
*/
|
||||
public void adapterDownLoading(DataSourceType dt, String path,String serviceName, String prefix) throws Exception ;
|
||||
|
||||
/**
|
||||
* adapter downloadingAll
|
||||
*/
|
||||
public void adapterDownLoadingAll(DataSourceType dt, String path, String like) throws Exception ;
|
||||
|
||||
/**
|
||||
* layout downloadingAll
|
||||
*/
|
||||
public void layoutDownLoadingAll(DataSourceType dt, String serviceName) throws Exception ;
|
||||
/**
|
||||
* transform downloadingAll
|
||||
*/
|
||||
public void transformDownLoadingAll(DataSourceType dt, String serviceName) throws Exception ;
|
||||
/**
|
||||
* interface downloadingAll
|
||||
*/
|
||||
public void interfaceDownLoadingAll(DataSourceType dt, String serviceName) throws Exception ;
|
||||
|
||||
/**
|
||||
* table downloading
|
||||
*/
|
||||
public void tableDownLoading(DataSourceType dt, String path, String tableName) throws Exception ;
|
||||
|
||||
/**
|
||||
* messageKey downloading
|
||||
*/
|
||||
public void messageKeyDownLoading(DataSourceType dt, String path,String serviceName) throws Exception ;
|
||||
|
||||
/**
|
||||
* tran block
|
||||
*/
|
||||
public void tranBlock(DataSourceType dt, String cmd, String type, String value) throws Exception ;
|
||||
|
||||
public HashMap parse(String filePath) throws Exception ;
|
||||
|
||||
public HashSet<String> getFileInterfaceAdapterList(HashMap map) throws Exception;
|
||||
|
||||
public List<LinkedHashMap> selectTableDataForListValue(DataSourceType dataSourceType, String tableName, String key1, List<String> param1) throws Exception;
|
||||
|
||||
public void adptInstValid(DataSourceType dataSourceType, HashMap map) throws Exception ;
|
||||
|
||||
public void adapterGroupValid(DataSourceType dt, HashMap map, String table) throws Exception ;
|
||||
|
||||
public void makeDataFiles(DataSourceType dt, String downloadPath,
|
||||
HashMap<String, ArrayList<HashMap<String, String>>> listMap) throws Exception;
|
||||
|
||||
public void deployDataToTargetSystem(String url, String downloadPath,
|
||||
HashMap<String, ArrayList<HashMap<String, String>>> listMap, String serviceType) throws Exception;
|
||||
|
||||
public void uploadDeployFile(String url, String localFile, String cmd, String serviceType, String bzwkDstcd)
|
||||
throws Exception;
|
||||
|
||||
public void scheduleDeployDataApply(String url, String userId, String userIp, String serviceKey, String cmTitle,
|
||||
String cmDate, String cmTime, String items) throws Exception;
|
||||
|
||||
public boolean ruleDataSaveAndLoading(RuleDeployJobVo jobVo) throws Exception;
|
||||
|
||||
public HashMap syncResult(Command command ,String fileName ) throws Exception;
|
||||
|
||||
public void appendToListfile(String bizCode, String interfaceId) throws Exception ;
|
||||
}
|
||||
+1486
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
||||
package com.eactive.eai.rms.onl.loader.service.enm;
|
||||
|
||||
public enum ResourceType {
|
||||
INTERFACE, LAYOUT, TRANSFORM
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.eactive.eai.rms.onl.loader.transform;
|
||||
|
||||
import com.eactive.eai.data.DataService;
|
||||
import com.eactive.eai.data.entity.AbstractEntity;
|
||||
import com.eactive.eai.data.entity.onl.transformer.transform.TransformEntity;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.data.entity.onl.transform.TransformService;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployService;
|
||||
import com.eactive.eai.rms.onl.loader.transform.deploy.TransformDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.transform.mapper.TransformDeployMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service("transformDeployService")
|
||||
@Transactional
|
||||
public class TransformDeployService extends DeployService {
|
||||
|
||||
@Autowired
|
||||
private TransformService transformService;
|
||||
|
||||
@Autowired
|
||||
private TransformDeployMapper transformDeployMapper;
|
||||
|
||||
public TransformDeploy selectDeploy(String cnvsnName) {
|
||||
return transformService.findById(cnvsnName).map(transformDeployMapper::toVo).orElse(null);
|
||||
}
|
||||
|
||||
public void saveDeploy(TransformDeploy transformDeploy) {
|
||||
deleteAndSave(transformDeploy, transformDeployMapper, transformService);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.eactive.eai.rms.onl.loader.transform.deploy;
|
||||
|
||||
import com.eactive.eai.data.converter.LocalDateTimeFormatters;
|
||||
import com.eactive.eai.data.entity.onl.transformer.transform.TransformEntity;
|
||||
import com.eactive.eai.rms.onl.loader.service.DeployResource;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import edu.emory.mathcs.backport.java.util.Arrays;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TransformDeploy extends DeployResource<TransformEntity> {
|
||||
|
||||
@Override
|
||||
public TransformEntity probeForExample() {
|
||||
TransformEntity probe = new TransformEntity();
|
||||
probe.setCnvsnname(this.cnvsnname);
|
||||
return probe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> exactMatchFields() {
|
||||
return Arrays.asList(new String[]{
|
||||
"cnvsnname"
|
||||
});
|
||||
}
|
||||
|
||||
/** 변환명 */
|
||||
@JsonProperty("TransformName")
|
||||
private String cnvsnname;
|
||||
|
||||
/** 변환설명 */
|
||||
@JsonProperty("TransformDescription")
|
||||
private String cnvsndesc;
|
||||
|
||||
/** 최종수정시각 */
|
||||
@JsonProperty("LastDateTime")
|
||||
@JsonFormat(pattern = LocalDateTimeFormatters.FORMAT_YYYY_MM_DD_HH_MM_SS_19)
|
||||
private LocalDateTime lastamndhms;
|
||||
|
||||
/** 담당자 */
|
||||
@JsonProperty("Author")
|
||||
private String author;
|
||||
|
||||
/** EAI 서버 구분 코드 */
|
||||
@JsonProperty("ServerType")
|
||||
private String eaisevrdstcd;
|
||||
|
||||
/** 변경관리상태구분코드 */
|
||||
@JsonProperty("StatusCode")
|
||||
private String modfimgtstusdstcd;
|
||||
|
||||
/** EAI 서비스명 */
|
||||
@JsonProperty("IfServiceCode")
|
||||
private String eaisvcname;
|
||||
|
||||
/** 사용 여부 */
|
||||
@JsonProperty("UseYn")
|
||||
private String useyn;
|
||||
|
||||
/** 버전 정보 */
|
||||
@JsonProperty("VersionInfo")
|
||||
private String verinfo;
|
||||
|
||||
@JsonProperty("TransformTypes")
|
||||
private List<TransformTypeDeploy> transformTypes;
|
||||
|
||||
@JsonProperty("TransformItems")
|
||||
private List<TransformItemDeploy> transformItems;
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.eactive.eai.rms.onl.loader.transform.deploy;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TransformItemDeploy {
|
||||
|
||||
@JsonProperty("TransformName")
|
||||
private String cnvsnname;
|
||||
|
||||
@JsonProperty("ResultPath")
|
||||
private String cnvsnrsultitempathname;
|
||||
|
||||
@JsonProperty("Command")
|
||||
private String cnvsncmdname;
|
||||
|
||||
@JsonProperty("Default")
|
||||
private String cnvsnitembascval;
|
||||
|
||||
@JsonProperty("TransformSequence")
|
||||
private Integer cnvsnitemserno;
|
||||
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.eactive.eai.rms.onl.loader.transform.deploy;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TransformTypeDeploy {
|
||||
|
||||
/** 변환명 */
|
||||
@JsonProperty("TransformName")
|
||||
private String cnvsnname;
|
||||
|
||||
/** 레이아웃명 */
|
||||
@JsonProperty("LayoutName")
|
||||
private String loutname;
|
||||
|
||||
/** 소스결과구분코드 */
|
||||
@JsonProperty("SourceTargetType")
|
||||
private String sourcrsultdstcd;
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.eactive.eai.rms.onl.loader.transform.mapper;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.transformer.transform.TransformEntity;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.onl.loader.transform.deploy.TransformDeploy;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class, uses = { TransformTypeDeployMapper.class, TransformItemDeployMapper.class })
|
||||
public interface TransformDeployMapper extends GenericMapper<TransformDeploy, TransformEntity> {
|
||||
|
||||
@Mapping(source = "transformTypeEntities", target = "transformTypes")
|
||||
@Mapping(source = "transformItemEntities", target = "transformItems")
|
||||
TransformDeploy toVo(TransformEntity entity);
|
||||
|
||||
@InheritInverseConfiguration(name = "toVo")
|
||||
TransformEntity toEntity(TransformDeploy vo);
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.eactive.eai.rms.onl.loader.transform.mapper;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.transformer.transform.TransformItemEntity;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.onl.loader.transform.deploy.TransformItemDeploy;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class)
|
||||
public interface TransformItemDeployMapper extends GenericMapper<TransformItemDeploy, TransformItemEntity> {
|
||||
|
||||
@Mapping(source = "id.cnvsnname", target = "cnvsnname")
|
||||
@Mapping(source = "id.cnvsnrsultitempathname", target = "cnvsnrsultitempathname")
|
||||
TransformItemDeploy toVo(TransformItemEntity entity);
|
||||
|
||||
@InheritInverseConfiguration
|
||||
TransformItemEntity toEntity(TransformItemDeploy vo);
|
||||
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.eactive.eai.rms.onl.loader.transform.mapper;
|
||||
|
||||
import com.eactive.eai.data.entity.onl.transformer.transform.TransformTypeEntity;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.onl.loader.transform.deploy.TransformTypeDeploy;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class)
|
||||
public interface TransformTypeDeployMapper extends GenericMapper<TransformTypeDeploy, TransformTypeEntity> {
|
||||
|
||||
@Mapping(source = "id.cnvsnname", target = "cnvsnname")
|
||||
@Mapping(source = "id.loutname", target = "loutname")
|
||||
@Mapping(source = "id.sourcrsultdstcd", target = "sourcrsultdstcd")
|
||||
TransformTypeDeploy toVo(TransformTypeEntity transformTypeEntity);
|
||||
|
||||
@InheritInverseConfiguration
|
||||
TransformTypeEntity toEntity(TransformTypeDeploy transformTypeDeploy);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.eactive.eai.rms.onl.loader.vo;
|
||||
|
||||
import com.eactive.eai.rms.onl.loader.intf.deploy.EAIMessageDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.layout.deploy.LayoutDeploy;
|
||||
import com.eactive.eai.rms.onl.loader.transform.deploy.TransformDeploy;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class InterfaceDeployPack {
|
||||
private EAIMessageDeploy eaiMessageDeploy;
|
||||
|
||||
private List<LayoutDeploy> layoutDeployList = new ArrayList<>();
|
||||
|
||||
private List<TransformDeploy> transformDeployList = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.eactive.eai.rms.onl.loader.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
||||
import com.eactive.eai.rms.onl.vo.PersistentVo;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class RuleDeployJobItemVo implements Serializable, PersistentVo {
|
||||
private String jobId;
|
||||
private String fileName;
|
||||
private String bizCode;
|
||||
private String ruleType;
|
||||
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
}
|
||||
|
||||
public void setJobId(String jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getBizCode() {
|
||||
return bizCode;
|
||||
}
|
||||
|
||||
public void setBizCode(String bizCode) {
|
||||
this.bizCode = bizCode;
|
||||
}
|
||||
|
||||
public String getRuleType() {
|
||||
return ruleType;
|
||||
}
|
||||
|
||||
public void setRuleType(String ruleType) {
|
||||
this.ruleType = ruleType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RuleDeployJobItemVo [jobId=" + jobId + ", fileName=" + fileName + ", bizCode=" + bizCode + ", ruleType="
|
||||
+ ruleType + "]";
|
||||
}
|
||||
|
||||
// @Override
|
||||
public String getSchemaId() {
|
||||
// return DataSourceContextHolder.getDataSourceType().getSchema();
|
||||
return DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.MONITORING).getSchema();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.eactive.eai.rms.onl.loader.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
||||
import com.eactive.eai.rms.onl.vo.PersistentVo;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class RuleDeployJobVo implements Serializable, PersistentVo {
|
||||
private String jobId;
|
||||
private String serviceType;
|
||||
private String jobTitle;
|
||||
private String scheduledDateTime;
|
||||
private String lastJobTime;
|
||||
private String userId;
|
||||
private String userIp;
|
||||
private String status;
|
||||
private int failedCnt;
|
||||
private String failedMsg;
|
||||
List<RuleDeployJobItemVo> itemList;
|
||||
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
}
|
||||
|
||||
public void setJobId(String jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
public String getServiceType() {
|
||||
return serviceType;
|
||||
}
|
||||
|
||||
public void setServiceType(String serviceType) {
|
||||
this.serviceType = serviceType;
|
||||
}
|
||||
|
||||
public String getJobTitle() {
|
||||
return jobTitle;
|
||||
}
|
||||
|
||||
public void setJobTitle(String jobTitle) {
|
||||
this.jobTitle = jobTitle;
|
||||
}
|
||||
|
||||
public String getScheduledDateTime() {
|
||||
return scheduledDateTime;
|
||||
}
|
||||
|
||||
public void setScheduledDateTime(String scheduledDateTime) {
|
||||
this.scheduledDateTime = scheduledDateTime;
|
||||
}
|
||||
|
||||
public String getLastJobTime() {
|
||||
return lastJobTime;
|
||||
}
|
||||
|
||||
public void setLastJobTime(String lastJobTime) {
|
||||
this.lastJobTime = lastJobTime;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserIp() {
|
||||
return userIp;
|
||||
}
|
||||
|
||||
public void setUserIp(String userIp) {
|
||||
this.userIp = userIp;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public int getFailedCnt() {
|
||||
return failedCnt;
|
||||
}
|
||||
|
||||
public void setFailedCnt(int failedCnt) {
|
||||
this.failedCnt = failedCnt;
|
||||
}
|
||||
|
||||
public String getFailedMsg() {
|
||||
return failedMsg;
|
||||
}
|
||||
|
||||
public void setFailedMsg(String failedMsg) {
|
||||
this.failedMsg = failedMsg;
|
||||
}
|
||||
|
||||
public List<RuleDeployJobItemVo> getItemList() {
|
||||
return itemList;
|
||||
}
|
||||
|
||||
public void setItemList(List<RuleDeployJobItemVo> itemList) {
|
||||
this.itemList = itemList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RuleDeployJobVo [jobId=" + jobId + ", serviceType=" + serviceType + ", jobTitle=" + jobTitle
|
||||
+ ", scheduledDateTime=" + scheduledDateTime + ", lastJobTime=" + lastJobTime + ", userId=" + userId
|
||||
+ ", userIp=" + userIp + ", status=" + status + ", failedCnt=" + failedCnt + ", itemList=" + itemList
|
||||
+ "]";
|
||||
}
|
||||
|
||||
// @Override
|
||||
public String getSchemaId() {
|
||||
// return DataSourceContextHolder.getDataSourceType().getSchema();
|
||||
return DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.MONITORING).getSchema();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.eactive.eai.rms.onl.loader.vo;
|
||||
|
||||
public class RuleFileResource {
|
||||
|
||||
private final String fileName;
|
||||
private final String fileContent;
|
||||
|
||||
public RuleFileResource(String fileName, String fileContent) {
|
||||
this.fileName = fileName;
|
||||
this.fileContent = fileContent;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public String getFileContent() {
|
||||
return fileContent;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user