전문레이아웃 매핑 선연결 제외
This commit is contained in:
+330
-418
@@ -12,11 +12,13 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@@ -31,455 +33,365 @@ import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
||||
import com.eactive.eai.rms.common.login.SessionManager;
|
||||
import com.eactive.eai.rms.common.spring.BaseController;
|
||||
import com.eactive.eai.rms.common.spring.LocaleMessage;
|
||||
import com.eactive.eai.rms.common.util.CamelCaseUtil;
|
||||
import com.eactive.eai.rms.common.util.CommonUtil;
|
||||
import com.eactive.eai.rms.common.util.IpUtil;
|
||||
import com.eactive.eai.rms.common.vo.JsonPageVo;
|
||||
import com.eactive.eai.rms.common.vo.GridResponse;
|
||||
import com.eactive.eai.rms.common.vo.SimpleResponse;
|
||||
import com.eactive.eai.rms.onl.common.exception.BizException;
|
||||
import com.eactive.eai.rms.onl.common.exception.EMSRuntimeException;
|
||||
import com.eactive.eai.rms.onl.loader.service.HistoryService;
|
||||
import com.eactive.eai.rms.onl.loader.service.TransactionLoaderService;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import com.eactive.eai.rms.onl.manage.rule.layout.LayoutManService;
|
||||
import com.eactive.eai.rms.onl.manage.rule.layout.ui.LayoutItemUI;
|
||||
import com.eactive.eai.rms.onl.manage.rule.layout.ui.LayoutUI;
|
||||
import com.eactive.eai.rms.onl.manage.rule.layout.ui.LayoutUISearch;
|
||||
import com.eactive.eai.rms.onl.manage.rule.transform2.Transform2Service;
|
||||
import com.eactive.eai.rms.onl.manage.rule.transform2.ui.TransformSourceResultUI;
|
||||
import com.eactive.eai.rms.onl.manage.rule.transform2.ui.TransformUI;
|
||||
|
||||
@Controller
|
||||
public class TransformController extends BaseController {
|
||||
private static final Logger logger = Logger.getLogger(TransformController.class);
|
||||
|
||||
@Autowired
|
||||
@Qualifier("localeMessage")
|
||||
|
||||
@Autowired
|
||||
private LocaleMessage localeMessage;
|
||||
|
||||
@Autowired
|
||||
private TransformManService service;
|
||||
|
||||
@Autowired
|
||||
private ComboService comboService;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("historyService")
|
||||
private HistoryService historyService;
|
||||
|
||||
@Autowired
|
||||
private TransactionLoaderService loaderService;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("monitoringContext")
|
||||
|
||||
@Autowired
|
||||
private Transform2Service service;
|
||||
|
||||
@Autowired
|
||||
private ComboService comboService;
|
||||
|
||||
@Autowired
|
||||
private HistoryService historyService;
|
||||
|
||||
@Autowired
|
||||
private TransactionLoaderService loaderService;
|
||||
|
||||
@Autowired
|
||||
private MonitoringContext monitoringContext;
|
||||
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.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= "/onl/admin/rule/transformMan.json",params = "cmd=LIST_INIT_COMBO")
|
||||
public ModelAndView initCombo( HttpServletRequest request,
|
||||
HttpServletResponse response,String eaiSvcName) throws Exception {
|
||||
|
||||
//admin 권한
|
||||
String roleId = SessionManager.getRoleIdString(request);
|
||||
String isAdmin = "N";
|
||||
if(roleId.indexOf("admin") > -1){ //admin 일경우
|
||||
isAdmin = "Y";
|
||||
}
|
||||
|
||||
List<ComboVo> listFunction = comboService.getFromFunction();
|
||||
|
||||
List listTransform = service.selectTransformForEaiSvcNameCombo(eaiSvcName);
|
||||
List<ComboVo> listCnvsnType = comboService.getFromCode("CNVSN_TYPE");
|
||||
List<ComboVo> listSvrDstcd = comboService.getFromCode("INOUT_TYPE");
|
||||
List<ComboVo> listUseYn = comboService.getFromCode("USE_YN");// 사용여부
|
||||
Map resultMap = new HashMap();
|
||||
resultMap.put("functionRows" , listFunction);
|
||||
resultMap.put("transformRows" , listTransform);
|
||||
resultMap.put("cnvsnType" , listCnvsnType);
|
||||
resultMap.put("svrDstcd" , listSvrDstcd);
|
||||
resultMap.put("isAdmin" , isAdmin);
|
||||
resultMap.put("useYnRows" , listUseYn);
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView",resultMap);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=LIST_EAISVCNAME_COMBO")
|
||||
public ModelAndView eaiSvcNameCombo( HttpServletRequest request,
|
||||
HttpServletResponse response) throws Exception {
|
||||
|
||||
// String eaiBizCode = RecordAuthUtil.getRecordAuthQuery(request);
|
||||
List listCnvsnType = comboService.getFromCode("CNVSN_TYPE");
|
||||
|
||||
List<ComboVo> listInoutTypeCd = comboService.getFromCode("INOUT_TYPE");//EAI서버구분코드
|
||||
List<ComboVo> listUseYn = comboService.getFromCode("USE_YN");
|
||||
|
||||
|
||||
Map resultMap = new HashMap();
|
||||
resultMap.put("cnvsnTypeRows" , listCnvsnType);
|
||||
resultMap.put("inoutTypeRows" , listInoutTypeCd);
|
||||
resultMap.put("useYnRows" , listUseYn);
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView",resultMap);
|
||||
return modelAndView;
|
||||
}
|
||||
// @RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=LIST_LAYOUT_COMBO")
|
||||
// public ModelAndView layoutCombo( HttpServletRequest request,
|
||||
// HttpServletResponse response) throws Exception {
|
||||
//
|
||||
// String eaiBizCode = RecordAuthUtil.getRecordAuthQuery(request);
|
||||
// List list = service.selectLayoutCombo(eaiBizCode);
|
||||
//
|
||||
// Map resultMap = new HashMap();
|
||||
// resultMap.put("rows" , list);
|
||||
//
|
||||
// ModelAndView modelAndView = new ModelAndView("jsonView",resultMap);
|
||||
// return modelAndView;
|
||||
// }
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=LIST_FUNCTION_COMBO")
|
||||
public ModelAndView functionCombo( HttpServletRequest request,
|
||||
HttpServletResponse response) throws Exception {
|
||||
|
||||
List list = service.selectFunctionCombo();
|
||||
|
||||
Map resultMap = new HashMap();
|
||||
resultMap.put("rows" , list);
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView",resultMap);
|
||||
return modelAndView;
|
||||
}
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=LIST_TRANSFORM4EAISVCNAME_COMBO")
|
||||
public ModelAndView transformForEaiSvcNameCombo( HttpServletRequest request,
|
||||
HttpServletResponse response, String eaiSvcName) throws Exception {
|
||||
|
||||
List list = service.selectTransformForEaiSvcNameCombo(eaiSvcName);
|
||||
|
||||
Map resultMap = new HashMap();
|
||||
resultMap.put("rows" , list);
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView",resultMap);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=LIST_LAYOUT_ITEM")
|
||||
public ModelAndView listLayoutItem(HttpServletRequest request, HttpServletResponse response,String loutName) throws Exception {
|
||||
List list = service.selectLayoutItems(loutName);
|
||||
HashMap map = new HashMap();
|
||||
map.put("rows", list);
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView",map);
|
||||
return modelAndView;
|
||||
}
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=LIST")
|
||||
public ModelAndView list( HttpServletRequest request,
|
||||
HttpServletResponse response,JsonPageVo pageVo,
|
||||
String searchBizCode, String searchCnvsnName,String searchCnvsnDesc) throws Exception {
|
||||
|
||||
//String eaiBizCode = RecordAuthUtil.getRecordAuthQuery(request);
|
||||
|
||||
HashMap map = service.selectList(pageVo.getStartNum(), pageVo.getEndNum(),searchBizCode, searchCnvsnName,searchCnvsnDesc);
|
||||
|
||||
pageVo.setTotalCount((Integer)map.get("totalCount"));
|
||||
|
||||
Map resultMap = new HashMap();
|
||||
resultMap.put("total" , pageVo.getTotal()); //전체 페이지수
|
||||
resultMap.put("page" , pageVo.getPage()); //현재 페이지수
|
||||
resultMap.put("records", pageVo.getTotalCount());//전체 레코드건수
|
||||
resultMap.put("rows" , map.get("list"));
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView",resultMap);
|
||||
return modelAndView;
|
||||
}
|
||||
// @RequestMapping(value= "/onl/admin/common/codeMan.json",params = "cmd=DETAIL")
|
||||
// private ModelAndView detail(HttpServletRequest request,
|
||||
// HttpServletResponse response,String msg) throws Exception {
|
||||
//
|
||||
// HashMap map = transformManService.selectDetail(msg);
|
||||
//
|
||||
// ModelAndView modelAndView = new ModelAndView("jsonView",map);
|
||||
//
|
||||
// return modelAndView;
|
||||
// }
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=INSERT")
|
||||
private String insert(HttpServletRequest request,
|
||||
HttpServletResponse response, @RequestParam HashMap param) throws Exception {
|
||||
|
||||
service.insert(param);
|
||||
|
||||
String cnvsnName = (String)param.get("cnvsnName");
|
||||
CommonCommand command = new CommonCommand("com.eactive.eai.agent.transformer.ReloadTransformCommand",cnvsnName);
|
||||
agentUtilService.broadcast(command);
|
||||
String eaiSvcName = (String)param.get("eaiSvcName");
|
||||
if(eaiSvcName != null && !"".equals(eaiSvcName)){
|
||||
command = new CommonCommand("com.eactive.eai.agent.eaimessage.ReloadEAIMessageCommand",eaiSvcName);
|
||||
agentUtilService.broadcast(command);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=DELETE")
|
||||
private String delete(HttpServletRequest request,
|
||||
HttpServletResponse response, String cnvsnName,String eaiSvcName,String cnvsnType ) throws Exception {
|
||||
|
||||
service.delete(cnvsnName,eaiSvcName,cnvsnType);
|
||||
CommonCommand command = new CommonCommand("com.eactive.eai.agent.transformer.RemoveTransformCommand",cnvsnName);
|
||||
agentUtilService.broadcast(command);
|
||||
if(eaiSvcName != null && !"".equals(eaiSvcName)){
|
||||
command = new CommonCommand("com.eactive.eai.agent.eaimessage.ReloadEAIMessageCommand",eaiSvcName);
|
||||
agentUtilService.broadcast(command);
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=DELETE_LIST")
|
||||
private ModelAndView deleteMulti(HttpServletRequest request,
|
||||
HttpServletResponse response, @RequestParam HashMap<String,Object> map ) throws Exception {
|
||||
String message = "";
|
||||
|
||||
String[] cnvsnNameArr = ((String) map.get("cnvsnNames")).split(",");
|
||||
String eaiSvcNamesString = (String) map.get("eaiSvcNames") + ",";
|
||||
String cnvsnTypesString = (String) map.get("cnvsnTypes") + ",";
|
||||
String[] eaiSvcNameArr = StringUtils.splitPreserveAllTokens(eaiSvcNamesString, ",");
|
||||
String[] cnvsnTypeArr = StringUtils.splitPreserveAllTokens(cnvsnTypesString, ",");
|
||||
|
||||
int idx = 0;
|
||||
for(String cnvsnName : cnvsnNameArr){
|
||||
service.delete(cnvsnName,eaiSvcNameArr[idx],cnvsnTypeArr[idx]);
|
||||
CommonCommand command = new CommonCommand("com.eactive.eai.agent.transformer.RemoveTransformCommand",cnvsnName);
|
||||
agentUtilService.broadcast(command);
|
||||
if(eaiSvcNameArr[idx] != null && !"".equals(eaiSvcNameArr[idx])){
|
||||
command = new CommonCommand("com.eactive.eai.agent.eaimessage.ReloadEAIMessageCommand",eaiSvcNameArr[idx]);
|
||||
agentUtilService.broadcast(command);
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
|
||||
message = "총"+idx+"건을 삭제하였습니다";
|
||||
|
||||
Map resultMap = new HashMap();
|
||||
resultMap.put("message" , message);
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView",resultMap);
|
||||
return modelAndView;
|
||||
|
||||
|
||||
}
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=LIST_TRANSFORM_SOURCE_RESULT")
|
||||
public ModelAndView transformSourceResult( HttpServletRequest request,
|
||||
HttpServletResponse response,String cnvsnName) throws Exception {
|
||||
|
||||
List list = service.selectTransformSourceResult(cnvsnName );
|
||||
|
||||
|
||||
HashMap map = new HashMap();
|
||||
map.put("rows", list);
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView",map);
|
||||
return modelAndView;
|
||||
}
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=LIST_TRANSFORM_ITEM")
|
||||
public ModelAndView transformItem( HttpServletRequest request,
|
||||
HttpServletResponse response,String cnvsnName,String loutName) throws Exception {
|
||||
|
||||
// String eaiBizCode = RecordAuthUtil.getRecordAuthQuery(request);
|
||||
|
||||
List list = service.selectTransformItems(cnvsnName ,loutName );
|
||||
|
||||
|
||||
HashMap map = new HashMap();
|
||||
map.put("rows", list);
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView",map);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=UPDATE")
|
||||
public ModelAndView update( HttpServletRequest request,
|
||||
HttpServletResponse response, @RequestParam HashMap<String,Object> paramMap ) throws Exception {
|
||||
String gridData = (String)paramMap.get("gridData");
|
||||
Gson gson = new Gson();
|
||||
HashMap[] list = gson.fromJson(gridData, HashMap[].class);
|
||||
paramMap.put("list", list);
|
||||
service.transaction(paramMap);
|
||||
String cnvsnName = (String)paramMap.get("cnvsnName");
|
||||
String eaiSvcName = (String)paramMap.get("eaiSvcName");
|
||||
|
||||
CommonCommand command = new CommonCommand("com.eactive.eai.agent.transformer.ReloadTransformCommand",cnvsnName);
|
||||
agentUtilService.broadcast(command);
|
||||
if(eaiSvcName != null && !"".equals(eaiSvcName)){
|
||||
command = new CommonCommand("com.eactive.eai.agent.eaimessage.ReloadEAIMessageCommand",eaiSvcName);
|
||||
agentUtilService.broadcast(command);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=INITIALIZES")
|
||||
public ModelAndView initializes(HttpServletRequest request,
|
||||
HttpServletResponse response) throws Exception {
|
||||
CommonCommand command = new CommonCommand("com.eactive.eai.agent.transformer.ReloadTransformCommand","ALL");
|
||||
HashMap returnMap = agentUtilService.broadcast(command);
|
||||
|
||||
HashMap map = new HashMap();
|
||||
map.put("message", CommonUtil.getMapString(returnMap, true));
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView", map);
|
||||
return modelAndView;
|
||||
@Autowired
|
||||
private LayoutManService layoutManService;
|
||||
|
||||
@GetMapping(value = "/onl/admin/rule/transformMan.view")
|
||||
public String view() {
|
||||
return "/onl/admin/rule/transformMan";
|
||||
}
|
||||
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=INITIALIZE")
|
||||
public ModelAndView initialize(HttpServletRequest request,
|
||||
HttpServletResponse response, String cnvsnName) throws Exception {
|
||||
CommonCommand command = new CommonCommand("com.eactive.eai.agent.transformer.ReloadTransformCommand",cnvsnName);
|
||||
HashMap returnMap = agentUtilService.broadcast(command);
|
||||
@GetMapping(value = "/onl/admin/rule/transformMan.view", params = "cmd=DETAIL")
|
||||
public String detailView() {
|
||||
return "/onl/admin/rule/transformManDetail";
|
||||
}
|
||||
|
||||
HashMap map = new HashMap();
|
||||
map.put("message", CommonUtil.getMapString(returnMap, true));
|
||||
@GetMapping(value = "/onl/admin/rule/transformMan.view", params = "cmd=DETAIL*POPUP")
|
||||
public String detailPopupView() {
|
||||
return "/onl/admin/rule/transformManDetailPopup";
|
||||
}
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView", map);
|
||||
return modelAndView;
|
||||
}
|
||||
@GetMapping(value = "/onl/admin/rule/transformMan.view", params = "cmd=LAYOUT")
|
||||
public String layoutView() {
|
||||
return "/onl/admin/rule/transformManLayout";
|
||||
}
|
||||
|
||||
@GetMapping(value = "/onl/admin/rule/transformMan.view", params = "cmd=NEW")
|
||||
public String newView() {
|
||||
return "/onl/admin/rule/transformManNew";
|
||||
}
|
||||
|
||||
@GetMapping(value = "/onl/admin/rule/transformMan.view", params = "cmd=POPUP CALENDAR")
|
||||
public String popupCalendarView() {
|
||||
return "/onl/admin/rule/transformManPopupCalendar";
|
||||
}
|
||||
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=LIST_INITIALIZE")
|
||||
public ModelAndView listInitialize(HttpServletRequest request,
|
||||
HttpServletResponse response, @RequestParam HashMap<String,Object> paramMap) throws Exception {
|
||||
|
||||
String[] chkItemsArr = ((String) paramMap.get("chkItems")).split(",");
|
||||
Vector vec = new Vector<>();
|
||||
for(String chkItem : chkItemsArr){
|
||||
@GetMapping(value = "/onl/admin/rule/transformMan.view", params = "cmd=API_POPUP")
|
||||
public String apiPopupView() {
|
||||
return "/onl/admin/rule/transformManApiPopup";
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=LIST_INIT_COMBO")
|
||||
public ResponseEntity<Map<String, Object>> initCombo(HttpServletRequest request, String eaiSvcName, String cnvsnName) {
|
||||
|
||||
String roleId = SessionManager.getRoleIdString(request);
|
||||
String isAdmin = "N";
|
||||
if (roleId.indexOf("admin") > -1) {
|
||||
// admin 일경우
|
||||
isAdmin = "Y";
|
||||
}
|
||||
|
||||
List<ComboVo> listFunction = comboService.getFromFunction();
|
||||
|
||||
List<ComboVo> listTransform = comboService.getFromTransform(eaiSvcName, cnvsnName);
|
||||
|
||||
List<ComboVo> listCnvsnType = comboService.getFromCode("CNVSN_TYPE");
|
||||
List<ComboVo> listSvrDstcd = comboService.getFromCode("INOUT_TYPE");
|
||||
List<ComboVo> listUseYn = comboService.getFromCode("USE_YN");
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("functionRows", listFunction);
|
||||
resultMap.put("transformRows", listTransform);
|
||||
resultMap.put("cnvsnType", listCnvsnType);
|
||||
resultMap.put("svrDstcd", listSvrDstcd);
|
||||
resultMap.put("isAdmin", isAdmin);
|
||||
resultMap.put("useYnRows", listUseYn);
|
||||
|
||||
return ResponseEntity.ok(resultMap);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=LIST_EAISVCNAME_COMBO")
|
||||
public ResponseEntity<Map<String, Object>> eaiSvcNameCombo(HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
|
||||
List<ComboVo> listCnvsnType = comboService.getFromCode("CNVSN_TYPE");
|
||||
List<ComboVo> listInoutTypeCd = comboService.getFromCode("INOUT_TYPE");
|
||||
List<ComboVo> listUseYn = comboService.getFromCode("USE_YN");
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("cnvsnTypeRows", listCnvsnType);
|
||||
resultMap.put("inoutTypeRows", listInoutTypeCd);
|
||||
resultMap.put("useYnRows", listUseYn);
|
||||
|
||||
return ResponseEntity.ok(resultMap);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=LIST_LAYOUT_ITEM")
|
||||
public ResponseEntity<GridResponse<LayoutItemUI>> listLayoutItem(String loutName) {
|
||||
List<LayoutItemUI> list = service.selectLayoutItems(loutName);
|
||||
return ResponseEntity.ok(new GridResponse<>(list));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=LIST")
|
||||
public ResponseEntity<GridResponse<TransformUI>> list(Pageable pageable, String searchCnvsnName,
|
||||
String searchCnvsnDesc, String searchBizCode, String searchIfSvcCd) {
|
||||
|
||||
Page<TransformUI> page = service
|
||||
.selectList(pageable, searchCnvsnName, searchCnvsnDesc, searchBizCode, searchIfSvcCd);
|
||||
return ResponseEntity.ok(new GridResponse<>(page));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=INSERT")
|
||||
public ResponseEntity<Void> insert(TransformUI transformUI) {
|
||||
|
||||
service.insert(transformUI);
|
||||
CommonCommand
|
||||
.builder()
|
||||
.name(CommonCommand.RELOAD_TRANSFORM_COMMAND)
|
||||
.args(transformUI.getCnvsnName())
|
||||
.build()
|
||||
.broadcast(agentUtilService);
|
||||
|
||||
String eaiSvcName = transformUI.getEaiSvcName();
|
||||
if (eaiSvcName != null && !"".equals(eaiSvcName)) {
|
||||
CommonCommand
|
||||
.builder()
|
||||
.name(CommonCommand.RELOAD_EAI_MESSAGE_COMMAND)
|
||||
.args(eaiSvcName)
|
||||
.build()
|
||||
.broadcast(agentUtilService);
|
||||
}
|
||||
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=DELETE")
|
||||
public ResponseEntity<Void> delete(String cnvsnName, String eaiSvcName, String cnvsnType) {
|
||||
|
||||
service.delete(cnvsnName, eaiSvcName, cnvsnType);
|
||||
CommonCommand
|
||||
.builder()
|
||||
.name(CommonCommand.REMOVE_TRANSFORM_COMMAND)
|
||||
.args(cnvsnName)
|
||||
.build()
|
||||
.broadcast(agentUtilService);
|
||||
|
||||
if (eaiSvcName != null && !"".equals(eaiSvcName)) {
|
||||
|
||||
CommonCommand
|
||||
.builder()
|
||||
.name(CommonCommand.RELOAD_EAI_MESSAGE_COMMAND)
|
||||
.args(eaiSvcName)
|
||||
.build()
|
||||
.broadcast(agentUtilService);
|
||||
|
||||
}
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=DELETE_LIST")
|
||||
public ResponseEntity<SimpleResponse> deleteMulti(String[] cnvsnNames, String[] eaiSvcNames, String[] cnvsnTypes) {
|
||||
String message = "";
|
||||
|
||||
int idx = 0;
|
||||
for (String cnvsnName : cnvsnNames) {
|
||||
if(StringUtils.isBlank(eaiSvcNames[idx])){
|
||||
service.delete(cnvsnName, "", cnvsnTypes[idx]);
|
||||
} else {
|
||||
service.delete(cnvsnName, eaiSvcNames[idx], cnvsnTypes[idx]);
|
||||
}
|
||||
|
||||
CommonCommand
|
||||
.builder()
|
||||
.name(CommonCommand.REMOVE_TRANSFORM_COMMAND)
|
||||
.args(cnvsnName)
|
||||
.build()
|
||||
.broadcast(agentUtilService);
|
||||
if (eaiSvcNames[idx] != null && !"".equals(eaiSvcNames[idx])) {
|
||||
CommonCommand
|
||||
.builder()
|
||||
.name(CommonCommand.RELOAD_EAI_MESSAGE_COMMAND)
|
||||
.args(eaiSvcNames[idx])
|
||||
.build()
|
||||
.broadcast(agentUtilService);
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
|
||||
message = "총" + idx + "건을 삭제하였습니다";
|
||||
return ResponseEntity.ok(SimpleResponse.of(message));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=LIST_TRANSFORM_SOURCE_RESULT")
|
||||
public ResponseEntity<GridResponse<TransformSourceResultUI>> transformSourceResult(String cnvsnName) {
|
||||
List<TransformSourceResultUI> list = service.selectTransformSourceResult(cnvsnName);
|
||||
return ResponseEntity.ok(new GridResponse<>(list));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=LIST_TRANSFORM_ITEM")
|
||||
public ResponseEntity<GridResponse<LayoutItemUI>> transformItem(String cnvsnName, String loutName,
|
||||
String srcLayoutName) {
|
||||
List<LayoutItemUI> list = service.selectTransformItems(cnvsnName, loutName, srcLayoutName);
|
||||
return ResponseEntity.ok(new GridResponse<>(list));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=UPDATE")
|
||||
public ResponseEntity<Void> update(TransformUI transformUI) {
|
||||
service.transaction(transformUI);
|
||||
|
||||
CommonCommand
|
||||
.builder()
|
||||
.name(CommonCommand.RELOAD_TRANSFORM_COMMAND)
|
||||
.args(transformUI.getCnvsnName())
|
||||
.build()
|
||||
.broadcast(agentUtilService);
|
||||
if (StringUtils.isNotBlank(transformUI.getEaiSvcName())) {
|
||||
CommonCommand
|
||||
.builder()
|
||||
.name(CommonCommand.RELOAD_EAI_MESSAGE_COMMAND)
|
||||
.args(transformUI.getEaiSvcName())
|
||||
.build()
|
||||
.broadcast(agentUtilService);
|
||||
}
|
||||
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=INITIALIZES")
|
||||
public ResponseEntity<SimpleResponse> initializes() {
|
||||
String message = CommonCommand
|
||||
.builder()
|
||||
.name(CommonCommand.RELOAD_TRANSFORM_COMMAND)
|
||||
.args("ALL")
|
||||
.build()
|
||||
.broadcast(agentUtilService)
|
||||
.getMessage(true);
|
||||
|
||||
return ResponseEntity.ok(SimpleResponse.of(message));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=INITIALIZE")
|
||||
public ResponseEntity<SimpleResponse> initialize(String cnvsnName) {
|
||||
String message = CommonCommand
|
||||
.builder()
|
||||
.name(CommonCommand.RELOAD_TRANSFORM_COMMAND)
|
||||
.args(cnvsnName)
|
||||
.build()
|
||||
.broadcast(agentUtilService)
|
||||
.getMessage(true);
|
||||
|
||||
return ResponseEntity.ok(SimpleResponse.of(message));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=LIST_INITIALIZE")
|
||||
public ResponseEntity<SimpleResponse> listInitialize(String[] chkItems) {
|
||||
|
||||
Vector<String> vec = new Vector<>();
|
||||
for (String chkItem : chkItems) {
|
||||
vec.add(chkItem);
|
||||
}
|
||||
CommonCommand command = new CommonCommand("com.eactive.eai.agent.transformer.ReloadTransformListCommand",vec);
|
||||
HashMap returnMap = agentUtilService.broadcast(command);
|
||||
|
||||
HashMap map = new HashMap();
|
||||
map.put("message", CommonUtil.getMapString(returnMap, true));
|
||||
String message = CommonCommand
|
||||
.builder()
|
||||
.name(CommonCommand.RELOAD_TRANSFORM_LIST_COMMAND)
|
||||
.args(vec)
|
||||
.build()
|
||||
.broadcast(agentUtilService)
|
||||
.getMessage(true);
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView", map);
|
||||
return modelAndView;
|
||||
return ResponseEntity.ok(SimpleResponse.of(message));
|
||||
}
|
||||
@RequestMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=LIST_LAYOUT")
|
||||
private ModelAndView selectLoutList(HttpServletRequest request,
|
||||
JsonPageVo pageVo , @RequestParam HashMap<String,Object> paramMap ) throws Exception {
|
||||
|
||||
HashMap map = service.selectLayoutList( pageVo.getStartNum(), pageVo.getEndNum(), paramMap);
|
||||
|
||||
pageVo.setTotalCount((Integer)map.get("totalCount"));
|
||||
|
||||
Map resultMap = new HashMap();
|
||||
resultMap.put("total" , pageVo.getTotal()); //전체 페이지수
|
||||
resultMap.put("page" , pageVo.getPage()); //현재 페이지수
|
||||
resultMap.put("records", pageVo.getTotalCount());//전체 레코드건수
|
||||
resultMap.put("rows" , map.get("list"));
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView",resultMap);
|
||||
return modelAndView;
|
||||
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=LIST_LAYOUT")
|
||||
public ResponseEntity<GridResponse<LayoutUI>> selectLoutList(Pageable pageable, LayoutUISearch layoutUISearch) {
|
||||
Page<LayoutUI> page = layoutManService.selectList(pageable, layoutUISearch);
|
||||
return ResponseEntity.ok(new GridResponse<>(page));
|
||||
}
|
||||
|
||||
@RequestMapping(value="/onl/admin/rule/transformMan.json", params="cmd=CHANGE_EXPORT")
|
||||
public ModelAndView exportData(HttpServletRequest request, @RequestParam HashMap<String,Object> paramMap) throws Exception {
|
||||
HashMap<String, Object> resultMap = new HashMap<String, Object>();
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=CHANGE_EXPORT")
|
||||
public ModelAndView exportData(HttpServletRequest request, @RequestParam HashMap<String, Object> paramMap)
|
||||
throws Exception {
|
||||
HashMap<String, Object> resultMap = new HashMap<>();
|
||||
String userId = SessionManager.getUserId(request);
|
||||
if (!SystemUtil.isDevServer()){
|
||||
throw new Exception("only support dev server ");
|
||||
}
|
||||
try {
|
||||
String cnvsnNames = (String)paramMap.get("cnvsnNames");
|
||||
//취약점소스 수정 2020.08.25
|
||||
String[] arrCnvsnNames = null;
|
||||
if(cnvsnNames != null){
|
||||
arrCnvsnNames = cnvsnNames.split("\\,");
|
||||
paramMap.put("userId", userId);
|
||||
paramMap.put("arrCnvsnNames", arrCnvsnNames);
|
||||
|
||||
service.exportData(paramMap);
|
||||
}
|
||||
|
||||
if (!SystemUtil.isDevServer()) {
|
||||
throw new EMSRuntimeException("only support dev server ");
|
||||
}
|
||||
try {
|
||||
String cnvsnNames = (String) paramMap.get("cnvsnNames");
|
||||
// 취약점소스 수정 2020.08.25
|
||||
String[] arrCnvsnNames = null;
|
||||
if (cnvsnNames != null) {
|
||||
arrCnvsnNames = cnvsnNames.split("\\,");
|
||||
paramMap.put("userId", userId);
|
||||
paramMap.put("arrCnvsnNames", arrCnvsnNames);
|
||||
|
||||
service.exportData(paramMap);
|
||||
}
|
||||
|
||||
resultMap.put("message", "전송이 성공적으로 완료되었습니다");
|
||||
} catch (BizException be) {
|
||||
} catch (BizException be) {
|
||||
throw new Exception(be.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
throw new Exception(localeMessage.getString("errors.checklog"));
|
||||
}
|
||||
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView", resultMap);
|
||||
return modelAndView;
|
||||
}
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.excel",params = "cmd=LIST_GRID_TO_EXCEL")
|
||||
public ModelAndView listGridToExcel(HttpServletRequest request, HttpServletResponse response, @RequestParam HashMap<String,Object> paramMap) throws Exception {
|
||||
HashMap<String,Object> resultMap = new HashMap<String,Object>();
|
||||
|
||||
|
||||
HashMap<String, String>[] list2 ;
|
||||
Gson gson = new Gson();
|
||||
if(paramMap.get("gridData")==null){
|
||||
|
||||
String headersStr = (String) paramMap.get("headersStr");
|
||||
headersStr = headersStr.substring(0, headersStr.length()-1);
|
||||
paramMap.put("headersStr", headersStr);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
HashMap<String, Object> list = service.selectListToExcel(request,paramMap);
|
||||
|
||||
String jsonStr = gson.toJson(list.get("list"));
|
||||
list2 = gson.fromJson(jsonStr, HashMap[].class);
|
||||
|
||||
}else{
|
||||
list2=gson.fromJson((String) paramMap.get("gridData"), HashMap[].class);
|
||||
}
|
||||
|
||||
String[] headers = gson.fromJson((String) paramMap.get("header"), String[].class);
|
||||
String[] headerTitles = gson.fromJson((String)paramMap.get("headerTitle"), String[].class);
|
||||
|
||||
HashMap<String, Object>[] lmerge = null;
|
||||
String merge = (String)paramMap.get("merge");
|
||||
if (merge !=null){
|
||||
lmerge = gson.fromJson(merge, HashMap[].class);
|
||||
}
|
||||
|
||||
resultMap.put("headers", headers);
|
||||
resultMap.put("headerTitles", headerTitles);
|
||||
resultMap.put("datas", list2);
|
||||
resultMap.put("fileName", (String)paramMap.get("fileName"));
|
||||
resultMap.put("merge", lmerge);
|
||||
ModelAndView modelAndView = new ModelAndView("excelView",resultMap);
|
||||
return modelAndView;
|
||||
}
|
||||
@RequestMapping(value= "/onl/admin/rule/transformMan.json",params = "cmd=DETAIL_POP")
|
||||
public ModelAndView selectCnvsnDetailPop( HttpServletRequest request, HttpServletResponse response, String cnvsnName,String tgt_layout,String src_layout) throws Exception {
|
||||
|
||||
List list = service.selectCnvsnDetailPop(cnvsnName ,tgt_layout,src_layout);
|
||||
|
||||
HashMap map = new HashMap();
|
||||
map.put("rows", list);
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView",map);
|
||||
return modelAndView;
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=CLONETOPROD")
|
||||
private ModelAndView cloneToProd(HttpServletRequest request, @RequestParam HashMap<String, Object> paramMap)
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.excel", params = "cmd=LIST_GRID_TO_EXCEL")
|
||||
public ModelAndView listGridToExcel(String searchCnvsnName, String searchCnvsnDesc, String searchBizCode,
|
||||
String searchIfSvcCd) throws Exception {
|
||||
HashMap<String, Object> resultMap = new HashMap<>();
|
||||
List<Map<String, Object>> datas = service
|
||||
.selectListToExcel(searchCnvsnName, searchCnvsnDesc, searchBizCode, searchIfSvcCd);
|
||||
resultMap.put("datas", datas);
|
||||
|
||||
return new ModelAndView("excelView", resultMap);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/transformMan.json", params = "cmd=CLONETOPROD")
|
||||
public ModelAndView cloneToProd(HttpServletRequest request, @RequestParam HashMap<String, Object> paramMap)
|
||||
throws Exception {
|
||||
if (SystemUtil.isProdServer()) {
|
||||
throw new Exception("only support dev, stage server");
|
||||
throw new EMSRuntimeException("only support dev, stage server");
|
||||
}
|
||||
|
||||
HashMap<String, Object> resultMap = new HashMap<String, Object>();
|
||||
HashMap<String, Object> resultMap = new HashMap<>();
|
||||
String userId = SessionManager.getUserId(request);
|
||||
String serviceKey = SessionManager.getServiceTypeKey(request);
|
||||
String cmTitle = MapUtils.getString(paramMap, "CmTitle", "Deploy Layout");
|
||||
String cmTitle = MapUtils.getString(paramMap, "CmTitle", "Deploy Layout Mapping");
|
||||
String cmDate = StringUtil.getNullStr(paramMap.get("CmDate"));
|
||||
String cmTime = StringUtil.getNullStr(paramMap.get("CmTime"));
|
||||
String ListTransformName = StringUtil.getNullStr(paramMap.get("ListTransformName"));
|
||||
String[] eaiCnvsnNames = ListTransformName.split("\\,");
|
||||
String listTransformName = StringUtil.getNullStr(paramMap.get("ListTransformName"));
|
||||
String[] transformNames = listTransformName.split("\\,");
|
||||
String downloadPath = monitoringContext.getStringProperty(MonitoringContext.IOMAP_DOWNLOAD_PATH);
|
||||
downloadPath = StringUtils.removeEnd(downloadPath, File.separator) + File.separator + serviceKey
|
||||
+ File.separator;
|
||||
@@ -496,7 +408,7 @@ public class TransformController extends BaseController {
|
||||
logger.info("serviceKey=" + serviceKey);
|
||||
logger.info("cmDate=" + cmDate);
|
||||
logger.info("cmTime=" + cmTime);
|
||||
logger.info("ListTransformName=" + ListTransformName);
|
||||
logger.info("listTransformName=" + listTransformName);
|
||||
logger.info("downloadPath=" + downloadPath);
|
||||
logger.info("targetName=" + targetName); // 스테이징, 운영서버
|
||||
logger.info("targetUrl=" + targetUrl); // http://127.0.0.1:20100
|
||||
@@ -507,8 +419,8 @@ public class TransformController extends BaseController {
|
||||
String items = "";
|
||||
|
||||
// 0. 서브 배포 목록 확보
|
||||
HashMap<String, ArrayList<HashMap<String, String>>> listMap = historyService.userHistoryListByTransform(dt,
|
||||
eaiCnvsnNames);
|
||||
HashMap<String, ArrayList<HashMap<String, String>>> listMap = historyService
|
||||
.userHistoryListByTransform(dt, transformNames);
|
||||
|
||||
if (listMap != null && listMap.size() > 0) {
|
||||
// 1. 파일 생성
|
||||
@@ -516,20 +428,20 @@ public class TransformController extends BaseController {
|
||||
loaderService.makeDataFiles(dt, downloadPath, listMap);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
throw new Exception("Make Datafile error:" + e.getMessage());
|
||||
throw new EMSRuntimeException("Make Datafile error:" + e.getMessage());
|
||||
}
|
||||
|
||||
// 2. 파일 배포
|
||||
try {
|
||||
if (StringUtils.isBlank(targetUrl)) {
|
||||
throw new Exception("Set EMS property:" + MonitoringContext.IOMAP_DEPLOY_TARGET_URL);
|
||||
throw new EMSRuntimeException("Set EMS property:" + MonitoringContext.IOMAP_DEPLOY_TARGET_URL);
|
||||
}
|
||||
|
||||
String url = targetUrl + "/monitoring/loader.do";
|
||||
loaderService.deployDataToTargetSystem(url, downloadPath, listMap, serviceKey);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
throw new Exception("Deploy to target System(" + targetName + ") error:" + e.getMessage());
|
||||
throw new EMSRuntimeException("Deploy to target System(" + targetName + ") error:" + e.getMessage());
|
||||
}
|
||||
|
||||
items += historyService.parseSimple(serviceKey, "", listMap);
|
||||
@@ -541,7 +453,7 @@ public class TransformController extends BaseController {
|
||||
loaderService.scheduleDeployDataApply(url, userId, userIp, serviceKey, cmTitle, cmDate, cmTime, items);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
throw new Exception("Apply DeployData or Apply Schedule error:" + e.getMessage());
|
||||
throw new EMSRuntimeException("Apply DeployData or Apply Schedule error:" + e.getMessage());
|
||||
}
|
||||
|
||||
resultMap.put("message", localeMessage.getMessage("ruleDeploy.msg4"));
|
||||
|
||||
Reference in New Issue
Block a user