feat: mpower

dev
minuk926 2 years ago
parent b869a7ebad
commit 67ab00d00c

@ -47,6 +47,23 @@ public class BoardService implements IBoardService {
private final PasswordEncoder passwordEncoder; private final PasswordEncoder passwordEncoder;
private final SqlSessionTemplate sqlSessionTemplate; private final SqlSessionTemplate sqlSessionTemplate;
private static final String selectBoardListSql = "SELECT MCB.ci_code,\n" +
" MU.name,\n" +
" MCB.ci_contentno,\n" +
" MCB.ci_title,\n" +
" MCB.ci_contents,\n" +
" MCB.ci_nalja,\n" +
" MCB.ci_step,\n" +
" MCB.ci_revel,\n" +
" MCB.ci_ref,\n" +
" MCB.ci_hit,\n" +
" MCB.ci_pass,\n" +
" MCB.ci_id\n" +
" FROM min_civ_board680 MCB\n" +
" LEFT OUTER JOIN min_userinfo MU\n" +
" ON MCB.ci_id = MU.userid\n" +
" ORDER BY MCB.ci_ref DESC, MCB.ci_step ASC, MCB.ci_code ASC";
@Transactional(readOnly = true) @Transactional(readOnly = true)
public List<Map<String, Object>> findAll(final BoardDto dto, Pageable pageable) { public List<Map<String, Object>> findAll(final BoardDto dto, Pageable pageable) {
@ -54,7 +71,8 @@ public class BoardService implements IBoardService {
MpowerUtils sendXml = new MpowerUtils(); MpowerUtils sendXml = new MpowerUtils();
sendXml.setFeilds("ciCode, ciName, ciContentno, ciTitle, ciContents, ciNalja, ciStep, ciRevel, ciRef, ciHit, ciPass, ciId"); sendXml.setFeilds("ciCode, ciName, ciContentno, ciTitle, ciContents, ciNalja, ciStep, ciRevel, ciRef, ciHit, ciPass, ciId");
sendXml.setQuery(sql); //sendXml.setQuery(sql);
sendXml.setQuery(selectBoardListSql);
return sendXml.selectCustomQuery(); return sendXml.selectCustomQuery();
} }

@ -1,19 +1,8 @@
package com.xit.core.util.mpower; package com.xit.core.util.mpower;
import com.plf.client.Client; import com.plf.client.Client;
import com.xit.core.util.CommUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.StringUtils;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.ParameterMapping;
import org.apache.ibatis.session.SqlSession;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.sql.*; import java.sql.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@ -361,7 +350,7 @@ public class MpowerUtils {
//logger.debug("=====================================================Select Query=================================================="); //logger.debug("=====================================================Select Query==================================================");
//logger.debug(query); //logger.debug(query);
System.out.println("======"+query); log.debug("query\n"+query);
//List<EgovMap> mList = new ArrayList<EgovMap>(); //List<EgovMap> mList = new ArrayList<EgovMap>();
List<Map<String,Object>> mList = new ArrayList<>(); List<Map<String,Object>> mList = new ArrayList<>();
int mListCount = 0; int mListCount = 0;
@ -373,16 +362,15 @@ public class MpowerUtils {
mpower.Request(); mpower.Request();
String result = mpower.getString("result", 0, 0); String result = mpower.getString("result", 0, 0);
System.out.println("#######message = "+mpower.getMessage()); // System.out.println("#######message = "+mpower.getMessage());
System.out.println("#######message charset = "+CommUtil.detectCharset(mpower.getMessage().getBytes())); // System.out.println("#######message charset = "+CommUtil.detectCharset(mpower.getMessage().getBytes()));
// System.out.println("#######message = "+new String(mpower.getMessage().getBytes(), CommUtil.detectCharset(mpower.getMessage().getBytes())));
int row; int row;
if (result.equals("true")){ if (result.equals("true")){
row = mpower.getMaxRow("list1"); row = mpower.getMaxRow("list1");
if(row>0){ if(row>0){
for(int i=0;i<row;i++){ for(int i=0;i<row;i++){
//EgovMap m = new EgovMap();
Map<String,Object> m = new HashMap<>(); Map<String,Object> m = new HashMap<>();
if(!"".equals(feild) && feild != null){ if(!"".equals(feild) && feild != null){
m.put("cbContent", mpower.getString("list1", i, 4)); m.put("cbContent", mpower.getString("list1", i, 4));

Loading…
Cancel
Save