feat: 외부연계 주민신고 데이타 처리 진행

main
minuk926 2 years ago
parent a5a93d6ec2
commit a30a2ead01

@ -0,0 +1,39 @@
package kr.xit.fims.biz.ec.service;
import java.util.Arrays;
import java.util.List;
import org.springframework.stereotype.Service;
import kr.xit.framework.biz.cmm.model.NatlNewspaperRcvXmlDto;
import kr.xit.framework.support.util.xml.XmlParseUtils;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Service
public class EcNatlNewspaperService {
private NatlNewspaperRcvXmlDto natlNewspaperXmlDto;
public void saveEsbRvc(final List<String> fullFileList) {
List<String> list = Arrays.asList(
"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/202209160959023e60d9$EPOUGA$1140100_2022091609485096255243399.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/202209160959269e166c$EPOUGA$1140100_2022091609490868474847710.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609590430a45c$EPOUGA$1140100_2022091609483801480139449.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609590685e4d0$EPOUGA$1140100_2022091609483205285052976.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609591011a94b$EPOUGA$1140100_2022091609484378849086728.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/20220916095908123eab$EPOUGA$1140100_2022091609484239715980892.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/202209160959384350e0$EPOUGA$1140100_2022091609485968983152594.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/20220916095854881357$EPOUGA$1140100_2022091609485673727045043.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609585009058a$EPOUGA$1140100_2022091609484095150560203.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609585264580e$EPOUGA$1140100_2022091609485381568241998.xml"
);
NatlNewspaperRcvXmlDto dto = XmlParseUtils.readXmlToObject(NatlNewspaperRcvXmlDto.class, list.get(0));
}
// public static void main(String[] args) {
// getData(NatlNewspaperRcvXmlDto.class);
// }
}

@ -0,0 +1,81 @@
package kr.xit.fims.biz.ec.web;
import java.util.Arrays;
import java.util.List;
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.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.fims.biz.cmm.FimsConst;
import kr.xit.framework.biz.cmm.model.NatlNewspaperRcvXmlDto;
import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.support.util.AjaxMessageMapRenderer;
import kr.xit.framework.support.util.constants.MessageKey;
import kr.xit.framework.support.util.xml.XmlParseUtils;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Controller
@RequestMapping(value = "/fims/biz/ec")
public class EcNatlNewspaperMgtController {
private NatlNewspaperRcvXmlDto natlNewspaperXmlDto;
@RequestMapping(value = "/ecNatlNewspaperMgtForm")
public void ecNatlNewspaperMgt(){
}
@RequestMapping(value = "/ecNatlNewspaperFileSelPopup")
public ModelAndView ecNatlNewspaperFileSelPopup(){
return new ModelAndView(FimsConst.FIMS_JSP_BASE_PATH +"ec/ecNatlNewspaperFileSelPopup.popup");
}
@RequestMapping(value = "/findDirFiles", consumes = {"multipart/form-data"})
public ModelAndView findDirFiles(@RequestParam(required=false) final MultipartFile mf){
return new ModelAndView(FimsConst.FIMS_JSP_BASE_PATH +"ec/ecNatlNewspaperFileSelPopup.popup");
}
@PostMapping(value = "/saveNatlNewspaer", consumes = {"multipart/form-data"})
//public String uploadZipCodeByExcel(MultipartHttpServletRequest request) {
public ModelAndView saveNatlNewspaer(@RequestParam(required=false) final MultipartFile mf) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_SUCCESS);
return mav;
}
@RequestMapping(value = "/saveNatlNewspaper")
public ModelAndView saveEsbRvc() {
ModelAndView mav = new ModelAndView();
List<String> list = Arrays.asList(
"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/202209160959023e60d9$EPOUGA$1140100_2022091609485096255243399.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/202209160959269e166c$EPOUGA$1140100_2022091609490868474847710.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609590430a45c$EPOUGA$1140100_2022091609483801480139449.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609590685e4d0$EPOUGA$1140100_2022091609483205285052976.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609591011a94b$EPOUGA$1140100_2022091609484378849086728.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/20220916095908123eab$EPOUGA$1140100_2022091609484239715980892.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/202209160959384350e0$EPOUGA$1140100_2022091609485968983152594.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/20220916095854881357$EPOUGA$1140100_2022091609485673727045043.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609585009058a$EPOUGA$1140100_2022091609484095150560203.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609585264580e$EPOUGA$1140100_2022091609485381568241998.xml"
);
NatlNewspaperRcvXmlDto dto = XmlParseUtils.readXmlToObject(NatlNewspaperRcvXmlDto.class, list.get(0));
log.debug(dto.toString());
return mav;
}
// public static void main(String[] args) {
// getData(NatlNewspaperRcvXmlDto.class);
// }
}

@ -1,272 +0,0 @@
package kr.xit.framework.biz.cmm.model;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.json.JSONObject;
import org.json.XML;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.traversal.DocumentTraversal;
import org.w3c.dom.traversal.NodeFilter;
import org.w3c.dom.traversal.NodeIterator;
import org.xml.sax.InputSource;
import com.sun.xml.internal.ws.developer.JAXBContextFactory;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
public class NatlNewspaper {
private NatlNewspaperXmlDto natlNewspaperXmlDto;
public static void main(String[] args) {
// String fileFullPath = "file:///Users/minuk/project_data/fims/01. 연계/01. 국민신문고/rcv/202209160959023e60d9$EPOUGA$1140100_2022091609485096255243399.xml";
// try {
// Document doc = XMLFilePath2Doc(fileFullPath);
// getNodeList(doc, "dmndinfo");
// //getNodeList(doc, "apndfilinfo");
// //getNodeList(doc, "apndfilcont1");
//
// //byte[] decode = Base64.decode(getNodeList(doc, "apndfilcont1"));
// //apndfilinfo
// } catch (Exception e) {
// e.printStackTrace();
// }
String fpath = "/Users/minuk/project_data/fims/01. 연계/01. 국민신문고/rcv/202209160959023e60d9$EPOUGA$1140100_2022091609485096255243399.xml";
// String jsonStr = null;
// try(BufferedReader reader = new BufferedReader(new InputStreamReader(Files.newInputStream(Paths.get(fpath)),
// StandardCharsets.UTF_8) , 1024*1024*2)) {
// //JSONObject json = XML.toJSONObject(reader);
// jsonStr = XML.toString(reader);
// System.out.println(jsonStr);
// }catch(IOException fe){
//
// }
//
// JAXBContext context = null;
// try {
// context = JAXBContext.newInstance(NatlNewspaperXmlDto.class);
// Unmarshaller unmarshaller = context.createUnmarshaller();
// NatlNewspaperXmlDto unmarshal = (NatlNewspaperXmlDto)unmarshaller.unmarshal(new StringReader(jsonStr));
// System.out.println(unmarshal);
// } catch (JAXBException e) {
// throw new RuntimeException(e);
// }
try {
Person person = new Person("jaxb", "jaxb@hello.com");
// JAXBContext 생성 & marshaller 생성
JAXBContext context = JAXBContext.newInstance(Person.class);
Marshaller marshaller = context.createMarshaller();
// 보기 좋게 출력해주는 옵션
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
// 표준 출력으로 결과를 보여준다.
marshaller.marshal(person, System.out);
//JAXBContext context = JAXBContextFactory.createContext(new Class[]{Person.class}, someProperties);
List<String> list = Arrays.asList(
"/Users/minuk/project_data/fims/01. 연계/01. 국민신문고/rcv/202209160959023e60d9$EPOUGA$1140100_2022091609485096255243399.xml"
,"/Users/minuk/project_data/fims/01. 연계/01. 국민신문고/rcv/202209160959269e166c$EPOUGA$1140100_2022091609490868474847710.xml"
,"/Users/minuk/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609590430a45c$EPOUGA$1140100_2022091609483801480139449.xml"
,"/Users/minuk/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609590685e4d0$EPOUGA$1140100_2022091609483205285052976.xml"
,"/Users/minuk/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609591011a94b$EPOUGA$1140100_2022091609484378849086728.xml"
,"/Users/minuk/project_data/fims/01. 연계/01. 국민신문고/rcv/20220916095908123eab$EPOUGA$1140100_2022091609484239715980892.xml"
,"/Users/minuk/project_data/fims/01. 연계/01. 국민신문고/rcv/202209160959384350e0$EPOUGA$1140100_2022091609485968983152594.xml"
,"/Users/minuk/project_data/fims/01. 연계/01. 국민신문고/rcv/20220916095854881357$EPOUGA$1140100_2022091609485673727045043.xml"
,"/Users/minuk/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609585009058a$EPOUGA$1140100_2022091609484095150560203.xml"
,"/Users/minuk/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609585264580e$EPOUGA$1140100_2022091609485381568241998.xml"
);
list.forEach((path) -> {
try{
// JAXBContext 생성 & marshaller 생성
FileInputStream fileInputStream = new FileInputStream(path);
JAXBContext jaxbContext = JAXBContext.newInstance(NatlNewspaperXmlDto.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
unmarshaller.setEventHandler(new CustomEventHandler());
// When
NatlNewspaperXmlDto xmlListTag = (NatlNewspaperXmlDto)unmarshaller.unmarshal(fileInputStream);
System.out.println(xmlListTag.toString());
// 표준 출력으로 결과를 보여준다.
//unmarshaller.unmarshal(xmlListTag);
//AppendFileInfo fileInfo = (AppendFileInfo)unmarshaller.unmarshal(fileInputStream);
//System.out.println(fileInfo.toString());
fileInputStream.close();
}catch(Exception e){
}
});
}catch(Exception e){
}
// try {
// Document doc = XMLFilePath2Doc(fileFullPath);
// getTraversalNodeList(doc);
// } catch (Exception e) {
// e.printStackTrace();
// }
}
/**
* XML String Document
* @param XMLString
* @return Document
*/
public static Document XMLString2Doc(String XMLString) throws Exception {
InputSource is = new InputSource(new StringReader(XMLString));
is.setEncoding(StandardCharsets.UTF_8.toString());
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
return dBuilder.parse(is);
}
/**
* XML Document
* @param fullFilePath
* @return
* @throws Exception
*/
public static Document XMLFilePath2Doc(String fullFilePath) throws Exception {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
return dBuilder.parse(fullFilePath);
}
/**
* Doc list
* @param doc
* @param getNodeList
*/
public static void getNodeList(Document doc, String getNodeList) {
doc.getDocumentElement().normalize();
String nm = doc.getDocumentElement().getNodeName();
System.out.println("Root element :" + doc.getDocumentElement().getNodeName());
NodeList nList = doc.getElementsByTagName(getNodeList);
travNode(nList);
}
//노드 순회 메서드
public static void travNode (NodeList nodes) {
for (int i = 0; i < nodes.getLength(); i++) {
Node n = nodes.item(i);
if (n.getNodeType() == Node.ELEMENT_NODE) {
NodeList childNodes = n.getChildNodes();
int cnt = childNodes.getLength();
if (cnt == 1) {
System.out.printf("%s : %s%n", n.getNodeName(), n.getTextContent());
} else {
System.out.printf("--------[ " + n.getNodeName() + " ]--------%n");
}
if (cnt > 1) {
travNode(childNodes);
}
}
}
}
/**
*
* @param doc
*/
public static void getTraversalNodeList (Document doc) {
//Doc 순회
DocumentTraversal trav = (DocumentTraversal) doc;
DocFilter docFilter = new DocFilter("params");//조건에 따른 필터 처리
NodeIterator it = trav.createNodeIterator(doc.getDocumentElement(),
NodeFilter.SHOW_ELEMENT, docFilter, true);
for (Node n = it.nextNode(); n != null; n = it.nextNode()) {
int cnt = n.getChildNodes().getLength();
if (cnt == 1) {
System.out.printf("%s : %s%n", n.getNodeName(), n.getTextContent());
} else {
System.out.printf("--------[ " + n.getNodeName() + " ]--------%n");
}
}
}
//DocumentTraversal 필터
static class DocFilter implements NodeFilter {
String deptId = "";
public DocFilter (String deptId) {
this.deptId = deptId;
}
@Override
public short acceptNode(Node thisNode) {
if (thisNode.getNodeType() == Node.ELEMENT_NODE) {
Element e = (Element) thisNode;
String nodeName = e.getNodeName();
if (! "params".equals(this.deptId)) {
return NodeFilter.FILTER_REJECT;
}
}
return NodeFilter.FILTER_ACCEPT;// NodeFilter.FILTER_REJECT;
}
}
@NoArgsConstructor
@AllArgsConstructor
@XmlRootElement
private static class Person {
@XmlElement
private String name;
@XmlElement
private String email;
// 생성자, getter, setter 생략
}
}

@ -0,0 +1,428 @@
package kr.xit.framework.biz.cmm.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* <pre>
* interface
* XmlRootElement
* JAXBContext
* XmlAccessorType
* FIELD - (static transient ) XML
* NONE - XML .
* PROPERTY - getter/setter XML .
* PUBLIC_MEMBER - public getter/setter XML .
*
* comment / /
* / /
* </pre>
*/
@Getter
@Setter
@ToString
@XmlRootElement(name = "dmndinfo")
@XmlAccessorType(XmlAccessType.FIELD)
public class NatlNewspaperRcvXmlDto { //extends ExtlEsbDataType {
/**
* :
* PK : number(30) - YYYYMMDDHH24MISSFF+random(9)
*/
@XmlElement(name = "interface_seq_n")
private String interfaceSeqN;
/**
* :
* char(88)
* EC010008
*/
@XmlElement(name = "sys_gubun_c")
private String sysGubunC;
/**
* :
* varchar2(7)
* 1140100 / /
* ex) - 641000
*/
@XmlElement(name = "anc_code_v")
private String ancCodeV;
/**
* :
* char(3)
* 140:(-) / 180: / 140: (-)
*/
@XmlElement(name = "peti_gubun_c")
private String petiGubunC;
/**
* :
* varchar2(7)
* ()
*/
@XmlElement(name = "peti_anc_code_v")
private String petiAncCodeV;
/**
* :
* varchar2(16)
* ( ), null .
* ( )
*/
@XmlElement(name = "peti_no_c")
private String petiNoC;
/**
* :
* varchar2(16)
* ( ), null .
* ( )"
*/
@XmlElement(name = "civil_no_c")
private String civilNoC;
/**
* : /
* varchar2(128)
*/
@XmlElement(name = "peter_name_v")
private String peterNameV;
/**
* : /
* varchar2(7)
*/
@XmlElement(name = "zip_code_c")
private String zipCodeC;
/**
* : /
* varchar2(400)
*/
@XmlElement(name = "address_v")
private String addressV;
/**
*
* varchar2(64)
*/
@XmlElement(name = "email_v")
private String emailV;
/**
*
* varchar2(20)
*/
@XmlElement(name = "cel_no_v")
private String celNoV;
/**
*
* varchar2(20)
*/
@XmlElement(name = "tel_no_v")
private String telNoV;
/**
* : /
* varchar2(500)
*/
@XmlElement(name = "peti_title_v")
private String petiTitleV;
/**
* : /
* clob
*/
@XmlElement(name = "peti_reason_l")
private String petiReasonL;
/**
* : /
* char(1)
* Y = , N = (default N)
* Y ()
* N
*/
@XmlElement(name = "open_yn_c")
private String openYnC;
/**
* : /
* date : YYYYMMDDHH24MISS
*/
@XmlElement(name = "peti_reg_d")
private String petiRegD;
/**
* :
* char(1)
* Y = , N = (default)
*/
@XmlElement(name = "peti_reason_attach_yn_c")
private String petiReasonAttachYnC;
/**
* :
* number(10)
*/
@XmlElement(name = "peti_file_size_n")
private String petiFileSizeN;
//-------------------------------------------------------------
/**
* 1
* varchar2(2000)
*/
@XmlElement(name = "peti_file_path1_v")
private String petiFilePath1V;
/**
* 2
* varchar2(2000)
*/
@XmlElement(name = "peti_file_path2_v")
private String petiFilePath2V;
/**
* 3
* varchar2(2000)
*/
@XmlElement(name = "peti_file_path3_v")
private String petiFilePath3V;
/**
* 4
* varchar2(2000)
*/
@XmlElement(name = "peti_file_path4_v")
private String petiFilePath4V;
/**
* 5
* varchar2(2000)
*/
@XmlElement(name = "peti_file_path5_v")
private String petiFilePath5V;
//-----------------------------------------------------------------------------
/**
* :
* date
* sysdate(YYYYMMDDHH24MISS)
*/
@XmlElement(name = "reg_d")
private String regD;
/**
* :
* char(1)
* 1: / 2: / 1:
*/
@XmlElement(name = "send_yn_c")
private String sendYnC;
/**
*
* date : YYYYMMDDHH24MISS
*/
@XmlElement(name = "send_d")
private String sendD;
/**
* :
* date
* interface DB->XML sysdate(YYYYMMDDHH24MISS)
*/
@XmlElement(name = "apply_d")
private String applyD;
/**
* :
* char(1)
* :Y OR N (default:N , DB Y )
*/
@XmlElement(name = "apply_gubun_c")
private String applyGubunC;
//------------------------------------------------------------------------------------
/**
* 1:
* varchar2(400)
* 0 / / 0
*/
@XmlElement(name = "pcd_gubun_v")
private String pcdGubunV;
/**
* 2:
* varchar2(400)
*/
@XmlElement(name = "pcd_gubun2_v")
private String pcdGubun2V;
/**
* 3:
* varchar2(400)
*/
@XmlElement(name = "pcd_gubun3_v")
private String pcdGubun3V;
/**
* xml :
* varchar2(10)
*/
@XmlElement(name = "ifid")
private String ifid;
/**
* :
* varchar2(7)
*
*/
@XmlElement(name = "srcorgcd")
private String srcorgcd;
/**
* :
* varchar2(7)
* insert 1140100
*/
@XmlElement(name = "tgtorgcd")
private String tgtorgcd;
@XmlElement(name = "apndfilinfo")
private AppendFileInfo appendFileInfo;
//-------------------------------------------------------------------------------------
@XmlElement(name = "peti_path_gubun_c")
private String petiPathGubunC;
/**
* :
* varchar2(7)
*/
@XmlElement(name = "pcd_dept_v")
private String pcdDeptV;
/**
* :
* varchar2(50)
*/
@XmlElement(name = "pcd_dept_nm_v")
private String pcdDeptNmV;
/**
* :
* varchar2(50)
*/
@XmlElement(name = "duty_id_v")
private String dutyIdV;
/**
* :
* varchar2(64)
*/
@XmlElement(name = "pcd_email_v")
private String pcdEmailV;
/**
* :
* varchar2(20)
*/
@XmlElement(name = "pcd_tel_v")
private String pcdTelV;
//-------------------------------------------------------------------------------------
// 선택사항
//-------------------------------------------------------------------------------------
/**
*
* date
*/
@XmlElement(name = "anc_reg_d")
private String ancRegD;
/**
*
* varchar2(4000)
*/
@XmlElement(name = "more_again_v")
private String moreAgainV;
//------------------------------------------------------------------------------
/**
* 1
* char(8)
*/
@XmlElement(name = "satisfy_c")
private String satisfyC;
/**
* 2
* char(8)
*/
@XmlElement(name = "satisfy2_c")
private String satisfy2C;
/**
* 3
* char(8)
*/
@XmlElement(name = "satisfy3_c")
private String satisfy3C;
//------------------------------------------------------------------------------
/**
*
* date
*/
@XmlElement(name = "satisfy_reg_d")
private String satisfyRegD;
/**
* :
* varchar2(7)
* ex) 6410000
*/
@XmlElement(name = "pcd_anc_code_v")
private String pcdAncCodeV;
/**
*
* number(5)
*/
@XmlElement(name = "peti_proc_dur_n")
private String petiProcDurN;
/**
*
* date
*/
@XmlElement(name = "peti_end_d")
private String petiEndD;
@XmlTransient
private String registDt;
@XmlTransient
private String register;
}

@ -5,7 +5,10 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@ -26,10 +29,13 @@ import lombok.ToString;
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@XmlRootElement(name = "dmndinfo")
@XmlAccessorType(XmlAccessType.FIELD)
public class NatlNewspaperXmlDto {
public class NatlNewspaperSendXmlDto {
/**
* :
@ -89,146 +95,186 @@ public class NatlNewspaperXmlDto {
@XmlElement(name = "civil_no_c")
private String civilNoC;
//----------------------------------------------------------------------------------------------------
// 결과(응답) 처리
//----------------------------------------------------------------------------------------------------
/**
* : /
* varchar2(128)
* :
* varchar2(512)
*
*/
@XmlElement(name = "peter_name_v")
private String peterNameV;
@XmlElement(name = "civil_gist_v")
private String civilGistV;
/**
* : /
* :
* clob
*
*/
@XmlElement(name = "civil_abstract_l")
private String civilAbstractL;
/**
* :
* varchar2(7)
*/
@XmlElement(name = "zip_code_c")
private String zipCodeC;
@XmlElement(name = "pcd_dept_v")
private String pcdDeptV;
/**
* : /
* varchar2(400)
* :
* varchar2(50)
*/
@XmlElement(name = "address_v")
private String addressV;
@XmlElement(name = "pcd_dept_nm_v")
private String pcdDeptNmV;
/**
*
* :
* varchar2(50)
*/
@XmlElement(name = "duty_id_v")
private String dutyIdV;
/**
* :
* varchar2(64)
*/
@XmlElement(name = "email_v")
private String emailV;
@XmlElement(name = "pcd_email_v")
private String pcdEmailV;
/**
*
* :
* varchar2(20)
*/
@XmlElement(name = "cel_no_v")
private String celNoV;
@XmlElement(name = "pcd_tel_v")
private String pcdTelV;
/**
*
* varchar2(20)
* :
* clob
*/
@XmlElement(name = "tel_no_v")
private String telNoV;
@XmlElement(name = "pcd_rst_cont_l")
private String pcdRstContL;
/**
* : /
* varchar2(500)
* :
* varchar2(14) : YYYYMMDDHH24MISS
*/
@XmlElement(name = "peti_title_v")
private String petiTitleV;
@XmlElement(name = "do_reg_d")
private String doRegD;
/**
* : /
* clob
* :
* char(1)
* Y = , N = (default)
*/
@XmlElement(name = "peti_reason_l")
private String petiReasonL;
@XmlElement(name = "pcd_rst_cont_attach_yn_c")
private String pcdRstContAttachYnC;
/**
* : /
* :
* varchar2(7)
* ex) 6410000
*/
@XmlElement(name = "pcd_anc_code_v")
private String pcdAncCodeV;
/**
* :
* date
* sysdate(YYYYMMDDHH24MISS)
*/
@XmlElement(name = "reg_d")
private String regD;
/**
* :
* char(1)
* Y = , N = (default N)
* Y ()
* N
* 1: / 2: / 1:
*/
@XmlElement(name = "open_yn_c")
private String openYnC;
@XmlElement(name = "send_yn_c")
private String sendYnC;
/**
* : /
*
* date : YYYYMMDDHH24MISS
*/
@XmlElement(name = "peti_reg_d")
private String petiRegD;
@XmlElement(name = "send_d")
private String sendD;
/**
* :
* :
* date
* interface DB->XML sysdate(YYYYMMDDHH24MISS)
*/
@XmlElement(name = "apply_d")
private String applyD;
/**
* :
* char(1)
* Y = , N = (default)
* :Y OR N (default:N , DB Y )
*/
@XmlElement(name = "peti_reason_attach_yn_c")
private String petiReasonAttachYnC;
@XmlElement(name = "apply_gubun_c")
private String applyGubunC;
//------------------------------------------------------------------------------------
/**
* :
* number(10)
* 1:
* varchar2(400)
* 0 / / 0
*/
@XmlElement(name = "peti_file_size_n")
private String petiFileSizeN;
@XmlElement(name = "pcd_gubun_v")
private String pcdGubunV;
//-------------------------------------------------------------
/**
* 1
* varchar2(2000)
* 2:
* varchar2(400)
*/
@XmlElement(name = "peti_file_path1_v")
private String petiFilePath1V;
@XmlElement(name = "pcd_gubun2_v")
private String pcdGubun2V;
/**
* 2
* varchar2(2000)
* 3:
* varchar2(400)
*/
@XmlElement(name = "peti_file_path2_v")
private String petiFilePath2V;
@XmlElement(name = "pcd_gubun3_v")
private String pcdGubun3V;
//-------------------------------------------------------------------------------------
/**
* 3
* varchar2(2000)
* xml :
* varchar2(10)
*/
@XmlElement(name = "peti_file_path3_v")
private String petiFilePath3V;
@XmlElement(name = "ifid")
private String ifid;
/**
* 4
* varchar2(2000)
* :
* varchar2(7)
*
*/
@XmlElement(name = "peti_file_path4_v")
private String petiFilePath4V;
@XmlElement(name = "srcorgcd")
private String srcorgcd;
/**
* 5
* varchar2(2000)
* :
* varchar2(7)
* insert 1140100
*/
@XmlElement(name = "peti_file_path5_v")
private String petiFilePath5V;
//-----------------------------------------------------------------------------
/*
@Getter
@Setter
@XmlRootElement(name="petiFilePaths")
private static class PetiFilePaths{
private List<PetiFilePath> petiFilePath;
@XmlElement(name = "tgtorgcd")
private String tgtorgcd;
@Getter
@Setter
@XmlRootElement(name="petiFilePath")
public static class PetiFilePath {
private String petiFilePath;
}
}
*/
@ -280,177 +326,168 @@ public class NatlNewspaperXmlDto {
@XmlElement(name = "satisfy_reg_d")
private String satisfyRegD;
/**
* :
* date
* sysdate(YYYYMMDDHH24MISS)
*/
@XmlElement(name = "reg_d")
private String regD;
/**
* :
* char(1)
* 1: / 2: / 1:
*/
@XmlElement(name = "send_yn_c")
private String sendYnC;
/**
*
* date : YYYYMMDDHH24MISS
*/
@XmlElement(name = "send_d")
private String sendD;
/**
* :
* date
* interface DB->XML sysdate(YYYYMMDDHH24MISS)
*/
@XmlElement(name = "apply_d")
private String applyD;
/**
* :
* char(1)
* :Y OR N (default:N , DB Y )
* : /
* varchar2(128)
*/
@XmlElement(name = "apply_gubun_c")
private String applyGubunC;
@XmlElement(name = "peter_name_v")
private String peterNameV;
//------------------------------------------------------------------------------------
/**
* 1:
* varchar2(400)
* 0 / / 0
* : /
* varchar2(7)
*/
@XmlElement(name = "pcd_gubun_v")
private String pcdGubunV;
@XmlElement(name = "zip_code_c")
private String zipCodeC;
/**
* 2:
* : /
* varchar2(400)
*/
@XmlElement(name = "pcd_gubun2_v")
private String pcdGubun2V;
@XmlElement(name = "address_v")
private String addressV;
/**
* 3:
* varchar2(400)
*
* varchar2(64)
*/
@XmlElement(name = "pcd_gubun3_v")
private String pcdGubun3V;
//-------------------------------------------------------------------------------------
@XmlElement(name = "email_v")
private String emailV;
/**
* xml :
* varchar2(10)
*
* varchar2(20)
*/
@XmlElement(name = "ifid")
private String ifid;
@XmlElement(name = "cel_no_v")
private String celNoV;
/**
* :
* varchar2(7)
*
*
* varchar2(20)
*/
@XmlElement(name = "srcorgcd")
private String srcorgcd;
@XmlElement(name = "tel_no_v")
private String telNoV;
/**
* :
* varchar2(7)
* insert 1140100
* : /
* varchar2(500)
*/
@XmlElement(name = "tgtorgcd")
private String tgtorgcd;
@XmlElement(name = "peti_path_gubun_c")
private String petiPathGubunC;
@XmlElement(name = "apndfilinfo")
private AppendFileInfo appendFileInfo;
@XmlElement(name = "peti_title_v")
private String petiTitleV;
//----------------------------------------------------------------------------------------------------
// 결과(응답) 처리
//----------------------------------------------------------------------------------------------------
/**
* :
* varchar2(512)
*
* : /
* clob
*/
@XmlElement(name = "civil_gist_v")
private String civilGistV;
@XmlElement(name = "peti_reason_l")
private String petiReasonL;
/**
* :
* clob
*
* : /
* char(1)
* Y = , N = (default N)
* Y ()
* N
*/
@XmlElement(name = "civil_abstract_l")
private String civilAbstractL;
@XmlElement(name = "open_yn_c")
private String openYnC;
/**
* :
* varchar2(7)
* : /
* date : YYYYMMDDHH24MISS
*/
@XmlElement(name = "pcd_dept_v")
private String pcdDeptV;
@XmlElement(name = "peti_reg_d")
private String petiRegD;
/**
* :
* varchar2(50)
* :
* char(1)
* Y = , N = (default)
*/
@XmlElement(name = "pcd_dept_nm_v")
private String pcdDeptNmV;
@XmlElement(name = "peti_reason_attach_yn_c")
private String petiReasonAttachYnC;
/**
* :
* varchar2(50)
* :
* number(10)
*/
@XmlElement(name = "duty_id_v")
private String dutyIdV;
@XmlElement(name = "peti_file_size_n")
private String petiFileSizeN;
//-------------------------------------------------------------
/**
* :
* varchar2(64)
* 1
* varchar2(2000)
*/
@XmlElement(name = "pcd_email_v")
private String pcdEmailV;
@XmlElement(name = "peti_file_path1_v")
private String petiFilePath1V;
/**
* :
* varchar2(20)
* 2
* varchar2(2000)
*/
@XmlElement(name = "pcd_tel_v")
private String pcdTelV;
@XmlElement(name = "peti_file_path2_v")
private String petiFilePath2V;
/**
* :
* clob
* 3
* varchar2(2000)
*/
@XmlElement(name = "pcd_rst_cont_l")
private String pcdRstContL;
@XmlElement(name = "peti_file_path3_v")
private String petiFilePath3V;
/**
* :
* varchar2(14) : YYYYMMDDHH24MISS
* 4
* varchar2(2000)
*/
@XmlElement(name = "do_reg_d")
private String doRegD;
@XmlElement(name = "peti_file_path4_v")
private String petiFilePath4V;
/**
* :
* char(1)
* Y = , N = (default)
* 5
* varchar2(2000)
*/
@XmlElement(name = "pcd_rst_cont_attach_yn_c")
private String pcdRstContAttachYnC;
@XmlElement(name = "peti_file_path5_v")
private String petiFilePath5V;
//-----------------------------------------------------------------------------
@XmlElement(name = "peti_path_gubun_c")
private String petiPathGubunC;
/**
*
@ -496,14 +533,6 @@ public class NatlNewspaperXmlDto {
private String pcdFilePath5V;
//----------------------------------------------------------------------
/**
* :
* varchar2(7)
* ex) 6410000
*/
@XmlElement(name = "pcd_anc_code_v")
private String pcdAncCodeV;
/**
*
* number(5)

@ -191,7 +191,7 @@ public abstract class AjaxMessageMapRenderer {
//if(EXCEPTION_LOG_TRACE) {
throw BizRuntimeException.create(
MessageUtils.getMessageKey(resultCode),
resultCode,
MessageUtils.getMessageArguments(resultArgs)
);
// }else {

@ -16,7 +16,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
/**
* JSON Util Class
*/
public class JsonUtil {
public class JsonUtils {
/**
* Object json string
@ -93,7 +93,7 @@ public class JsonUtil {
String rltStr;
try {
rltStr = jsonEnterConvert((JsonUtil.toJson(obj)));
rltStr = jsonEnterConvert((JsonUtils.toJson(obj)));
} catch(Exception e) {
rltStr = "";
}

@ -2,23 +2,12 @@ package kr.xit.framework.support.util;
import org.springframework.util.StringUtils;
import kr.xit.framework.support.util.constants.MessageGroupKey;
/**
* Message Utility .
* @author julim
*/
public abstract class MessageUtils {
/**
* EndUser . prefix message key group "user" .
* @param messageKey message key group message key.
* @return message key group message key.
*/
public static String getMessageKey(String messageKey) {
return MessageGroupKey.MESSAGE_CATEGORY_USER+"."+messageKey;
}
/**
* ";" delimiter message arguments String .
* @param argumentList ";" delimiter message arguments

@ -1,18 +0,0 @@
package kr.xit.framework.support.util.constants;
/**
* @author jeonghoyeol
*/
public abstract class MessageGroupKey {
/**
* EndUser .
*
* EndUser [].[]
* [] 'user' prefix .
* ) user.cmm.success.system
*
*/
public static final String MESSAGE_CATEGORY_USER = "user";
}

@ -1,9 +1,11 @@
package kr.xit.framework.biz.cmm.model;
package kr.xit.framework.support.util.xml;
import javax.xml.bind.ValidationEvent;
import javax.xml.bind.ValidationEventHandler;
import javax.xml.bind.ValidationEventLocator;
import kr.xit.framework.support.exception.BizRuntimeException;
import kr.xit.framework.support.util.constants.MessageKey;
import lombok.extern.slf4j.Slf4j;
/**
@ -13,19 +15,19 @@ import lombok.extern.slf4j.Slf4j;
* ValidationEvent.FATAL_ERROR( 2)
*/
@Slf4j
public class CustomEventHandler implements ValidationEventHandler {
public class JAXCustomEventHandler implements ValidationEventHandler {
public boolean handleEvent(ValidationEvent event) {
if (event.getSeverity() == ValidationEvent.FATAL_ERROR
|| event.getSeverity() == ValidationEvent.ERROR) {
ValidationEventLocator locator = event.getLocator();
String message = event.getMessage();
log.error("Severity: " + event.getSeverity());
log.error("Line Number: " + locator.getLineNumber());
log.error("Column Number: " + locator.getColumnNumber());
log.error("Event Message: " + message);
//log.error("{}", event);
log.error("{}", locator);
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, message);
}
// 이벤트 에러 발생시 중단 : true - 계속 진행
return false;

@ -0,0 +1,104 @@
package kr.xit.framework.support.util.xml;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import kr.xit.framework.biz.cmm.model.NatlNewspaperRcvXmlDto;
import kr.xit.framework.biz.cmm.model.NatlNewspaperSendXmlDto;
import kr.xit.framework.support.exception.BizRuntimeException;
import kr.xit.framework.support.util.constants.MessageKey;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class XmlParseUtils {
public static <T> T readXmlToObject(final Class<T> t, final String fullFilePath){
// JAXBContext 생성 & marshaller 생성
try(FileInputStream fileInputStream = new FileInputStream(fullFilePath)) {
JAXBContext jaxbContext = JAXBContext.newInstance(t);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
//JAXBContext context = JAXBContextFactory.createContext(new Class[]{clz}, someProperties);
unmarshaller.setEventHandler(new JAXCustomEventHandler());
Object o = unmarshaller.unmarshal(fileInputStream);
return t.cast(o);
}catch(IOException | JAXBException e){
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
}
}
@SuppressWarnings("UnusedReturnValue")
public static <T> String readObjectToXml(final T t, final Class<T> clz){
StringWriter sw = new StringWriter();
// xml 생성
try{
// JAXBContext 생성 & marshaller 생성
JAXBContext context = JAXBContext.newInstance(clz);
Marshaller marshaller = context.createMarshaller();
marshaller.setEventHandler(new JAXCustomEventHandler());
// 옵션 -------------------------------------------------
//standalone="yes"
//xmlStreamWriter.writeProcessingInstruction("xml", "version=\"1.0\" encoding=\"UTF-8\"");
// xmlHeader 제거 : standalone="yes"가 붙어서 ...
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
marshaller.setProperty(Marshaller.JAXB_ENCODING, StandardCharsets.UTF_8.name());
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
// xmlHeader write
sw.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
// xml 파일 생성
marshaller.marshal(t, sw);
}catch(JAXBException e){
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
}
return sw.toString();
}
public static void main(String[] args) {
NatlNewspaperSendXmlDto sendDto = NatlNewspaperSendXmlDto.builder()
.interfaceSeqN("999999")
.pcdRstContL("1. 교통질서 확립에 힘써주신 점에 대해 감사드립니다.\n"
+ "\n"
+ "2. 귀하께서 안전신문고를 통해 신청하신 민원에 대한 검토 결과를 다음과 같이 알려드립니다.\n"
+ "\n"
+ "3. 귀하의 민원내용은 불법 주?정차 신고에 관한 것으로 판단됩니다.\n"
+ "\n"
+ "4. 귀하의 신고에 대해 검토한 결과는 다음과 같습니다.\n"
+ " 가. 해당 차량은 ?도로교통법?제32조, 제33조, 제34조, 제35조에 의거한 불법 주?정차 차량으로 판단됩니다.\n"
+ " 나. 따라서, 위반 차량에 대해 주?정차 위반 과태료 부과 처분이 이루어졌음을 알려드립니다.\n"
+ "\n"
+ "5. 안전을 위한 시민 정신에 감사드리며, 답변 내용에 대한 추가 설명이 필요한 경우 군포시청 차량관리과 주차단속팀 박효주 주무관(☏031-390-0291)에게 연락 주시면 친절히 안내해 드리도록 하겠습니다. 감사합니다.")
.addressV("ldlldl")
.applyGubunC("Y").build();
String xmlStr = XmlParseUtils.readObjectToXml(sendDto, NatlNewspaperSendXmlDto.class);
log.debug(xmlStr);
log.debug("\n\n\n");
List<String> list = Arrays.asList(
"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/202209160959023e60d9$EPOUGA$1140100_2022091609485096255243399.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/202209160959269e166c$EPOUGA$1140100_2022091609490868474847710.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609590430a45c$EPOUGA$1140100_2022091609483801480139449.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609590685e4d0$EPOUGA$1140100_2022091609483205285052976.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609591011a94b$EPOUGA$1140100_2022091609484378849086728.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/20220916095908123eab$EPOUGA$1140100_2022091609484239715980892.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/202209160959384350e0$EPOUGA$1140100_2022091609485968983152594.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/20220916095854881357$EPOUGA$1140100_2022091609485673727045043.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609585009058a$EPOUGA$1140100_2022091609484095150560203.xml"
// ,"D:/project_data/fims/01. 연계/01. 국민신문고/rcv/2022091609585264580e$EPOUGA$1140100_2022091609485381568241998.xml"
);
NatlNewspaperRcvXmlDto dto = XmlParseUtils.readXmlToObject(NatlNewspaperRcvXmlDto.class, list.get(0));
log.debug(dto.toString());
}
}

@ -0,0 +1,100 @@
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
<div class="popup" style="min-width: 100%;">
<div class="popup_inner" style="max-width: 800px;">
<p class="pop_title">주민 신고(국민신문고) 접수 파일 선택</p>
<form>
<table class="tbl03">
<caption>주민 신고 접수 파일 선택</caption>
<colgroup>
<col style="width: 40%"/>
<col/>
</colgroup>
<tbody>
<tr>
<th class="required" scope="row" nowrap >
<label for="file">주민 신고 접수 파일</label>
</th>
<td>
<input type="file" name="file" id="file" accept="application/xml" style="width: 100%"/>
</td>
</tr>
<tr>
<th class="required" scope="row" nowrap >
<label for="file">주민 신고 접수 파일</label>
</th>
<td>
<input type="file" name="fileFolder" webkitdirectory style="width: 100%"/>
</td>
</tr>
</tbody>
</table>
</form>
<div class="file_list">
<div class="popup_btn">
<span class="flr p_flr">
<a href="#" class="btn blue" id="btnSave">파일 처리</a>
<a href="#" class="btn lightgray" id="btnClose" onclick="window.close(); return false;">닫기</a>
</span>
</div>
<!-- //등록버튼 -->
</div>
</div>
<!-- //popup -->
<script type="text/javaScript">
const input = document.querySelector('input[name=fileFolder]');
const preview = document.querySelector('.file_list');
$('input:file[name=fileFolder]').on('change', () => {
const selectedFiles = input.files;
const list = document.createElement('ul');
preview.appendChild(list);
for(const file of selectedFiles) {
const listItem = document.createElement('li');
const summary = document.createElement('div');
summary.textContent = file.webkitRelativePath;
listItem.appendChild(summary);
list.appendChild(listItem);
}
})
$('#btnSave').on('click', () => {
const uploadPath = $("#file")[0];
console.log("uploadFile: ", uploadPath.files)
if(uploadPath.files.length === 0){
alert("파일은 선택해주세요");
return false;
}
const formData = new FormData();
formData.append("uploadPath", uploadPath.files[0]);
for(let key of formData.keys()) {
console.log(key);
}
for(let value of formData.values()) {
console.log(value);
}
$.ajax({
type:"POST",
url: '<c:url value="/framework/biz/mng/code/uploadZipCodeByExcel.do"/>',
processData: false,
contentType: false,
data: formData,
success: function(res){
if(res.result) alert('실제 업로드 처리 구현 필요');
},
err: function(err){
console.log("err:", err)
}
})
})
</script>

@ -0,0 +1,222 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
<form id="frmSearch" name="frmSearch">
<div class="search r2">
<table>
<caption>검색조건</caption>
<colgroup>
<col style="width: 400px;"/>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
</colgroup>
<tbody>
<tr>
<td colspan="5">
<select name="searchCondition" id="searchCondition" title="조회조건" class="selectBox" onchange="fnBiz.onSearchChange()">
<option value="tmplatNm">템플릿명</option>
<option value="tmplatSeCode">템플릿구분</option>
</select>
<input name="searchKeyword" title="검색어" type="text"/>
<code:select codeId="XIT005" id="searchKeyword" name="searchKeyword" title="템플릿구분" cls="selectBox" alt="selectBox tag" display="false" disabled="true"/>
</td>
<td colspan="6">
<input type="button" id="btnSearch" class="btn_search" title="검색" value="검색"/>
</td>
</tr>
</tbody>
</table>
</div>
</form>
<!-- //검색 -->
<div class="page_btn">
<span class="fll">
<div class="list clearfix" id="totCnt">전체 ㅣ <span></span></div>
</span>
<span class="flr">
<a href="#" class="btn darkgray" id="btnRegist" title="템플릿 등록">등록</a>
</span>
</div>
<!-- //버튼 및 페이지정보 -->
<!-- 데이터 출력 -->
<div id="grid"></div>
<script type="text/javaScript">
/**************************************************************************
* Global Variable
**************************************************************************/
let GRID = null;
var callbackSearch = () => fnBiz.search();
/* *******************************
* Biz function
******************************* */
const fnBiz = {
search: () => {
GRID.reloadData();
}
,pagePopup: function(flag, params){
let url = '<c:url value="/framework/biz/mng/bbs/mngBoardTmplMgtPopup.do"/>';
let popTitle;
let popOption = {width: 530, height:410};
switch (flag) {
case "add": //등록
popTitle = "템플릿 등록";
break;
case "detail": //상세
popTitle = "템플릿 상세";
break;
case "file":
url = '<c:url value="/fims/biz/ec/ecNatlNewspaperFileSelPopup.do"/>';
popOption = {width: 800, height:300};
popTitle = "주민 신고 데이타 선택";
break;
default:
break;
}
CmmPopup.open(url, params, popOption, popTitle);
}
,onClickGrid: function(props){
const rowData = props.grid.getRow(props.rowKey);
fnBiz.pagePopup('detail', rowData);
}
,onSearchChange: () => {
if($('#searchCondition').val() === 'tmplatSeCode'){
$('select[name="searchKeyword"]')
.css('display', 'inline-block')
.attr('disabled', false);
$('input[name="searchKeyword"]')
.css('display', 'none')
.attr('disabled', true);
}else{
$('select[name="searchKeyword"]')
.css('display', 'none')
.attr('disabled', true);
$('input[name="searchKeyword"]')
.css('display', 'inline-block')
.attr('disabled', false);
}
}
}
/**************************************************************************
* event
**************************************************************************/
$(() => {
$('#btnSearch').on('click', () => fnBiz.search());
$('#btnRegist').on('click', () => {
fnBiz.pagePopup('file');
});
});
/* *******************************
* Grid
******************************* */
const initGrid = () => {
const gridColumns = [
{
header: '템플릿명',
name: 'tmplatNm',
minWidth: 200,
sortable: true,
sortingType: 'desc',
//align: 'center',
renderer: {
type: CustomButtonRenderer,
options: {
formatter: (props)=>{
return {
formatter: props.grid.getRow(props.rowKey).tmplatNm
,element: "text"
}
}
,eventFunction: fnBiz.onClickGrid
,eventType: "click"
}
}
},
{
header: '템플릿구분',
name: 'tmplatSeCodeNm',
width: 80,
sortable: false,
align: 'center'
},
{
header: '템플릿경로',
name: 'tmplatCours',
minWidth: 200,
sortable: false,
//align: 'left'
},
{
header: '사용여부',
name: 'useAt',
width: 60,
sortable: false,
align: 'center',
formatter: 'listItemText',
editable: false,
editor: {
type: 'select', //select, radio, checkbox, text
options: {
listItems: [
{value: 'Y', text: '사용'},
{value: 'N', text: '미사용'}
]
}
},
},
{
header: '등록일자',
name: 'frstRegisterPnttm',
width: 160,
sortable: false,
align: 'center',
formatter({value}){
return setDateTimeFmt(value);
}
}
];
const gridOptions = {
el: 'grid',
rowHeaders: ['rowNum'],
columns: gridColumns
};
const gridDatasource = {
initialRequest: true, // 화면 load시 조회 안함 - default
api: {
readData: {
url: '<c:url value="/framework/biz/mng/bbs/findBoardTmpls.do"/>'
,serializer: (params) => {
const schKey = $('#searchCondition').val();
let schValue = $('input[name=searchKeyword]').val();
if(schKey === 'tmplatSeCode') schValue = $('select[name=searchKeyword]').val();
return getPageParam({[schKey]: schValue}, params);
}
}
}
};
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
});
}
/**************************************************************************
* initialize
**************************************************************************/
$(document).ready(function(){
initGrid();
});
</script>
Loading…
Cancel
Save