This commit is contained in:
Rinjae
2025-09-05 17:16:26 +09:00
commit c54ef1903f
4947 changed files with 817291 additions and 0 deletions
@@ -0,0 +1,108 @@
package com.eactive.eai.rms.onl.admin.common;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
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.acl.user.BizService;
import com.eactive.eai.rms.common.base.BaseAnnotationController;
import com.eactive.eai.rms.common.util.CamelCaseUtil;
import com.eactive.eai.rms.common.vo.JsonPageVo;
import com.google.gson.Gson;
@Controller
public class BizController extends BaseAnnotationController {
@Autowired
@Qualifier("bizService")
private BizService service;
@RequestMapping(value= "/onl/admin/common/bizMan.view")
public 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;
}
/**
* @param request
* @param response
* @throws Exception
*/
@RequestMapping(value= "/onl/admin/common/bizMan.json", params = "cmd=LIST")
public ModelAndView selectList(HttpServletRequest request,
JsonPageVo pageVo ,String searchBzwkDstcd) throws Exception {
HashMap<String, Object> map = new HashMap<String, Object>();
if (searchBzwkDstcd != null) {
map = service.selectList( pageVo.getStartNum(), pageVo.getEndNum(), searchBzwkDstcd);
}
pageVo.setTotalCount((Integer)map.get("totalCount"));
Map<String, Object> resultMap = new HashMap<String, Object>();
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/bizMan.json",params = "cmd=DETAIL")
public ModelAndView selectDetail(HttpServletRequest request,
HttpServletResponse response,String bzwkDstcd) throws Exception {
HashMap<String, Object> map = service.selectDetail(bzwkDstcd);
ModelAndView modelAndView = new ModelAndView("jsonView",map);
return modelAndView;
}
@RequestMapping(value= "/onl/admin/common/bizMan.json",params = "cmd=INSERT")
public String insert(HttpServletRequest request,
HttpServletResponse response,@RequestParam HashMap<String,Object> map, String gridData ) throws Exception {
Gson gson = new Gson();
@SuppressWarnings("unchecked")
HashMap<String, Object>[] list = gson.fromJson(gridData, HashMap[].class);
service.insert(map,list);
return null;
}
@RequestMapping(value= "/onl/admin/common/bizMan.json",params = "cmd=UPDATE")
public String update(HttpServletRequest request,
HttpServletResponse response,@RequestParam HashMap<String,Object> map, String gridData ) throws Exception {
Gson gson = new Gson();
@SuppressWarnings("unchecked")
HashMap<String, Object>[] list = gson.fromJson(gridData, HashMap[].class);
service.update(map,list);
return null;
}
@RequestMapping(value= "/onl/admin/common/bizMan.json",params = "cmd=DELETE")
public String delete(HttpServletRequest request,
HttpServletResponse response, String bzwkDstcd ) throws Exception {
HashMap<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("bzwkDstcd", bzwkDstcd);
service.delete(paramMap);
return null;
}
}
@@ -0,0 +1,54 @@
package com.eactive.eai.rms.onl.admin.session;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
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.util.CamelCaseUtil;
import com.eactive.eai.rms.common.vo.JsonPageVo;
@Controller
public class SessionHistoryController {
@Autowired
private SessionHistoryService sessionHistoryService;
@RequestMapping(value = "/onl/admin/session/sessionHistory.view")
public 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/session/sessionHistory.json", params = "cmd=LIST")
public ModelAndView selectList(HttpServletRequest request, JsonPageVo pageVo, @RequestParam HashMap paramMap) throws Exception {
HashMap<String, Object> map = sessionHistoryService.selectList(pageVo.getStartNum(), pageVo.getEndNum(), paramMap);
pageVo.setTotalCount((Integer) map.get("totalCount"));
Map<String, Object> resultMap = new HashMap<String, Object>();
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;
}
}
@@ -0,0 +1,22 @@
package com.eactive.eai.rms.onl.admin.session;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.eactive.eai.rms.common.base.SqlMapClientTemplateDao;
@Repository
public class SessionHistoryDao extends SqlMapClientTemplateDao {
public Integer selectListCount(HashMap paramMap) {
return (Integer) template.queryForObject("SessionHistory.selectListCount", paramMap);
}
public List<Map<String, Object>> selectList(HashMap paramMap) {
return template.queryForList("SessionHistory.selectList", paramMap);
}
}
@@ -0,0 +1,31 @@
package com.eactive.eai.rms.onl.admin.session;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class SessionHistoryService {
@Autowired
private SessionHistoryDao sessionHistoryDao;
public HashMap<String, Object> selectList(int startNum, int endNum, HashMap paramMap) throws Exception {
int totalCount = sessionHistoryDao.selectListCount(paramMap);
paramMap.put("startNum", startNum);// ½ÃÀÛ record
paramMap.put("endNum", endNum);// ³¡ record
List<Map<String, Object>> list = sessionHistoryDao.selectList(paramMap);
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("totalCount", totalCount);
map.put("list", list);
return map;
}
}
@@ -0,0 +1,22 @@
package com.eactive.eai.rms.onl.admin.terminal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.eactive.eai.rms.common.base.SqlMapClientTemplateDao;
@Repository
public class AutomaticTerminalDao extends SqlMapClientTemplateDao {
public int selectListCount(HashMap paramMap) {
return (int) template.queryForObject("AutomaticTerminalStatus.selectListCount", paramMap);
}
public List<Map<String, Object>> selectList(HashMap paramMap) {
return template.queryForList("AutomaticTerminalStatus.selectList", paramMap);
}
}
@@ -0,0 +1,54 @@
package com.eactive.eai.rms.onl.admin.terminal;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
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.util.CamelCaseUtil;
import com.eactive.eai.rms.common.vo.JsonPageVo;
@Controller
public class AutomaticTerminalStatusController {
@Autowired
private AutomaticTerminalStatusService autoTerminalService;
@RequestMapping(value = "/onl/admin/adapter/autoTerminalStatusInfo.view")
public 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/adapter/autoTerminalStatusInfo.json", params = "cmd=LIST")
public ModelAndView selectList(HttpServletRequest request, JsonPageVo pageVo, @RequestParam HashMap paramMap)
throws Exception {
HashMap<String, Object> map = autoTerminalService.selectList(pageVo.getStartNum(), pageVo.getEndNum(), paramMap);
pageVo.setTotalCount((Integer) map.get("totalCount"));
Map<String, Object> resultMap = new HashMap<String, Object>();
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;
}
}
@@ -0,0 +1,33 @@
package com.eactive.eai.rms.onl.admin.terminal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class AutomaticTerminalStatusService {
@Autowired
private AutomaticTerminalDao autoTerminalDao;
public HashMap<String, Object> selectList(int startNum, int endNum, HashMap paramMap) throws Exception {
// 전체 목록수 얻기
int totalCount = autoTerminalDao.selectListCount(paramMap);
paramMap.put("startNum", startNum);// 시작 record
paramMap.put("endNum", endNum);// 끝 record
List<Map<String, Object>> list = autoTerminalDao.selectList(paramMap);
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("totalCount", totalCount);
map.put("list", list);
return map;
}
}
@@ -0,0 +1,55 @@
package com.eactive.eai.rms.onl.admin.terminal;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
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.util.CamelCaseUtil;
import com.eactive.eai.rms.common.vo.JsonPageVo;
@Controller
public class TerminalStatusController {
@Autowired
private TerminalStatusService terminalService;
@RequestMapping(value = "/onl/admin/adapter/terminalStatusInfo.view")
public 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/adapter/terminalStatusInfo.json", params = "cmd=LIST")
public ModelAndView selectList(HttpServletRequest request, JsonPageVo pageVo, @RequestParam HashMap paramMap)
throws Exception {
HashMap<String, Object> map = terminalService.selectList(pageVo.getStartNum(), pageVo.getEndNum(), paramMap);
pageVo.setTotalCount((Integer) map.get("totalCount"));
Map<String, Object> resultMap = new HashMap<String, Object>();
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;
}
}
@@ -0,0 +1,21 @@
package com.eactive.eai.rms.onl.admin.terminal;
import java.util.HashMap;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.eactive.eai.rms.common.base.SqlMapClientTemplateDao;
@Repository
public class TerminalStatusDao extends SqlMapClientTemplateDao {
public int selectListCount(HashMap param) throws Exception {
return (Integer) template.queryForObject("TerminalStatus.selectListCount", param);
}
public List selectList(HashMap param) throws Exception {
return template.queryForList("TerminalStatus.selectList", param);
}
}
@@ -0,0 +1,33 @@
package com.eactive.eai.rms.onl.admin.terminal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class TerminalStatusService {
@Autowired
private TerminalStatusDao terminalDao;
public HashMap<String, Object> selectList(int startNum, int endNum, HashMap paramMap) throws Exception {
// 전체 목록수 얻기
int totalCount = terminalDao.selectListCount(paramMap);
paramMap.put("startNum", startNum);// 시작 record
paramMap.put("endNum", endNum);// 끝 record
List<Map<String, Object>> list = terminalDao.selectList(paramMap);
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("totalCount", totalCount);
map.put("list", list);
return map;
}
}
@@ -0,0 +1,58 @@
package com.eactive.eai.rms.onl.admin.websocket;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
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.base.BaseAnnotationController;
import com.eactive.eai.rms.common.util.CamelCaseUtil;
import com.eactive.eai.rms.common.vo.JsonPageVo;
@Controller
public class WebSocketController extends BaseAnnotationController {
@Autowired
private WebSocketService webSocketService;
@RequestMapping(value = "/onl/admin/adapter/webSocketMan.view")
public 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/adapter/webSocketMan.json", params = "cmd=LIST")
public ModelAndView selectList(HttpServletRequest request, JsonPageVo pageVo, @RequestParam HashMap paramMap)
throws Exception {
logger.debug(paramMap.toString());
HashMap<String, Object> map = webSocketService.selectList(pageVo.getStartNum(), pageVo.getEndNum(), paramMap);
pageVo.setTotalCount((Integer) map.get("totalCount"));
Map<String, Object> resultMap = new HashMap<String, Object>();
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;
}
}
@@ -0,0 +1,157 @@
package com.eactive.eai.rms.onl.admin.websocket;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import com.eactive.eai.common.util.HttpUtil;
import com.eactive.eai.data.entity.onl.server.EAIServer;
import com.eactive.eai.rms.common.base.BaseService;
import com.eactive.eai.rms.data.entity.onl.server.EAIServerService;
@Service
public class WebSocketService extends BaseService {
private EAIServerService eaiServerService;
@Autowired
public WebSocketService(EAIServerService eaiServerService) {
this.eaiServerService = eaiServerService;
}
public HashMap<String, Object> selectList(int startNum, int endNum, HashMap paramMap) throws Exception {
HashMap<String, Object> result = new HashMap<>();
List<HashMap<String, String>> list = new ArrayList<>();
String[] keyArray = {
"wsInstId",
"wsAdapterGroupName",
"loginUserId",
"localSocketAddress",
"remoteSocketAddress",
"socketStatus"
};
/** search parameter **/
boolean searchConditionMatched = true;
String remoteSocketAddressParam = (String) paramMap.get("remoteSocketAddress");
String loginUserId = (String) paramMap.get("loginUserId");
int totalCount = 0;
/** 해당 startNum endNum serverList가져오는 정보로 검색결과와 상관없음 **/
paramMap.put("startNum", 1);
paramMap.put("endNum", 100);
List<EAIServer> serverList = eaiServerService.findAll();
for(EAIServer m : serverList) {
String serverIp = m.getEaisevrip();
if(serverIp.contains("*")) {
continue;
}
String url = buildUrl(m, paramMap);
logger.debug("HttpCall : " + url);
String xmlString = HttpUtil.httpCall(url, "GET");
if(xmlString == null) {
continue;
}
logger.debug("XmlResponseReturn : " + xmlString);
Document doc = parseXmlStringToDocument(xmlString);
Element root = doc.getDocumentElement();
NodeList children = root.getElementsByTagName("Rows");
//<Rows>
for (int i = 0; i < children.getLength(); i++) {
NodeList rowList = ((Element)children.item(i)).getElementsByTagName("Row");
//<Row>
for (int j = 0; j < rowList.getLength(); j++) {
HashMap<String, String> rowUnit = new HashMap<>();
NodeList dataList = ((Element)rowList.item(j)).getElementsByTagName("Data");
//<Data>
for (int k = 0; k < dataList.getLength(); k++) {
Element data = (Element) dataList.item(k);
rowUnit.put(keyArray[k], data.getTextContent());
if(loginUserId != null && k == 2) {
searchConditionMatched = data.getTextContent().contains(loginUserId);
if(!searchConditionMatched) { break; }
}
if(remoteSocketAddressParam != null && k == 4) {
searchConditionMatched = data.getTextContent().contains(remoteSocketAddressParam);
if(!searchConditionMatched) { break; }
}
}//</Data>
if(searchConditionMatched) {
list.add(rowUnit);
totalCount++;
}
}//</Row>
}//</Rows>
}//server
list = paging(startNum, endNum, list);
for(HashMap m : list) {
logger.debug(m.toString());
}
result.put("totalCount", totalCount);
result.put("list", list);
return result;
}
private String buildUrl(EAIServer m, HashMap paramMap) {
String prepend = "http://";
String suppend = "/session/websocketConnections.jsp";
StringBuilder reqUrl = new StringBuilder();
reqUrl.append(prepend);
reqUrl.append((String) m.getEaisevrip());
reqUrl.append(":");
reqUrl.append((String) m.getSevrlsnportname());
reqUrl.append(suppend);
return reqUrl.toString();
}
private Document parseXmlStringToDocument(String xmlString) throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(new InputSource(new StringReader(xmlString)));
return doc;
}
private List<HashMap<String, String>> paging(int startNum, int endNum, List<HashMap<String, String>> list) {
if(list.size() > endNum) {
return list.subList(startNum-1, endNum);
} else {
return list.subList(startNum-1, list.size());
}
}
}