|
|
|
|
@ -11,6 +11,10 @@ import java.io.UnsupportedEncodingException;
|
|
|
|
|
import java.net.HttpURLConnection;
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
import java.net.URLConnection;
|
|
|
|
|
import java.nio.charset.Charset;
|
|
|
|
|
import java.nio.file.Files;
|
|
|
|
|
import java.nio.file.Paths;
|
|
|
|
|
import java.nio.file.StandardCopyOption;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.LinkedList;
|
|
|
|
|
@ -24,6 +28,7 @@ import org.apache.commons.collections.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import cfs.common.dao.CodeInfoDao;
|
|
|
|
|
@ -31,11 +36,14 @@ import cfs.common.service.CfsCommonService;
|
|
|
|
|
import cfs.common.util.HttpUtil;
|
|
|
|
|
import cfs.common.util.ObjectUtil;
|
|
|
|
|
import cfs.common.util.Result;
|
|
|
|
|
import cfs.common.util.SftpUtil;
|
|
|
|
|
import cfs.common.util.StringUtil;
|
|
|
|
|
import cfs.common.util.ZipUtil;
|
|
|
|
|
import cfs.common.vo.ParamBean;
|
|
|
|
|
import cfs.fine.dao.FinePenaltyDao;
|
|
|
|
|
import cfs.fine.service.FinePenaltyService;
|
|
|
|
|
import cfs.fine.vo.PenaltyParamVO;
|
|
|
|
|
import cfs.trsmrcv.dao.TrsmrcvDao;
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
|
|
|
|
@Service("finePenaltyService")
|
|
|
|
|
@ -51,6 +59,12 @@ public class FinePenaltyServiceImpl implements FinePenaltyService {
|
|
|
|
|
@Resource(name="cfsCommonService")
|
|
|
|
|
private CfsCommonService cfsCommonService;
|
|
|
|
|
|
|
|
|
|
@Resource(name="trsmrcvDao")
|
|
|
|
|
private TrsmrcvDao trsmrcvDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private SftpUtil sftpUtil;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<PenaltyParamVO> findPenaltyList(PenaltyParamVO param) throws Exception {
|
|
|
|
|
return finePenaltyDao.findPenaltyList(param);
|
|
|
|
|
@ -3107,11 +3121,34 @@ public class FinePenaltyServiceImpl implements FinePenaltyService {
|
|
|
|
|
txtImage += "P11110"+param.getPenaltyManageYear()+String.format("%06d", Integer.parseInt(param.getPenaltySeqno()))+"A.JPG" + "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String line = conOrg+ "|" + conRCEPTID+ "|" + dataCd+ "|" + divKb + "|" + dfpayYn+ "|" + rcptKb+ "|"
|
|
|
|
|
+ sealCd+ "|" + wordKb+ "|" + mailCnt+ "|" + recevCnt+ "|" + envCd+ "|" + colorYn+ "|"
|
|
|
|
|
+ MM_YN+ "|" + FLEX_CD+ "|" + DM_CNT+ "|" + SB_FG+ "|" + APVL_NB+ "|" + SEND_DATE+ "|"
|
|
|
|
|
+ SEND_TIME+ "|" + CON_KEY+ "|" + RELORSECT_CD+ "|" + CON_DATA+ "|" + SENDER_NM+ "|"
|
|
|
|
|
+ SENDER_ZIPCODE+ "|" + SENDER_ADDR+ "|" + SENDER_DTAILADDR+ "|" + SENDER_DATA+ "|"
|
|
|
|
|
String line =
|
|
|
|
|
conOrg+ "|"
|
|
|
|
|
+ conRCEPTID+ "|"
|
|
|
|
|
+ dataCd+ "|"
|
|
|
|
|
+ divKb + "|"
|
|
|
|
|
+ dfpayYn+ "|"
|
|
|
|
|
+ rcptKb+ "|"
|
|
|
|
|
+ sealCd+ "|"
|
|
|
|
|
+ wordKb+ "|"
|
|
|
|
|
+ mailCnt+ "|"
|
|
|
|
|
+ recevCnt+ "|"
|
|
|
|
|
+ envCd+ "|"
|
|
|
|
|
+ colorYn+ "|"
|
|
|
|
|
+ MM_YN+ "|"
|
|
|
|
|
+ FLEX_CD+ "|"
|
|
|
|
|
+ DM_CNT+ "|"
|
|
|
|
|
+ SB_FG+ "|"
|
|
|
|
|
+ APVL_NB+ "|"
|
|
|
|
|
+ SEND_DATE+ "|"
|
|
|
|
|
+ SEND_TIME+ "|"
|
|
|
|
|
+ CON_KEY+ "|" //20번째항목
|
|
|
|
|
+ RELORSECT_CD+ "|"
|
|
|
|
|
+ CON_DATA+ "|"
|
|
|
|
|
+ SENDER_NM+ "|"
|
|
|
|
|
+ SENDER_ZIPCODE+ "|"
|
|
|
|
|
+ SENDER_ADDR+ "|"
|
|
|
|
|
+ SENDER_DTAILADDR+ "|"
|
|
|
|
|
+ SENDER_DATA+ "|" //27번째항목
|
|
|
|
|
+ SQL_CNT+ "|" + RECEV_NM+ "|" + RECEV_ZIPCODE+ "|" + RECEV_ADDR+ "|" + RECEV_DTAILADDR+ "|"
|
|
|
|
|
+ RGST_NMBR+ "|" + RECEV_DATA+ "|" + TEL_NUMBER1+ "|" + TEL_NUMBER2+ "|" + TEL_NUMBER3+ "|"
|
|
|
|
|
+ PHONE_NUMBER1+ "|" + PHONE_NUMBER2+ "|" + PHONE_NUMBER3+ "|" + RETURN_NM+ "|" + RETURN_ZIPCODE+ "|"
|
|
|
|
|
@ -3122,7 +3159,9 @@ public class FinePenaltyServiceImpl implements FinePenaltyService {
|
|
|
|
|
+ RECEV_RENTAL_MANUAL+ "|" + RECEV_RENTAL_PRINTTYPE+ "|" + RECEV_RENTAL_JNO+ "|" + RECEV_LAW_INFO+ "|"
|
|
|
|
|
+ RECEV_RECALL_TEL+ "|" + RECEV_JANAP_TEL+ "|" + RECEV_NAPBU_INFO+ "|"+RECEV_RECALL_USEGIGAN_INFO+ "|" + RECEV_MM_CODE_1+ "|"
|
|
|
|
|
+ RECEV_PO_CODE_1+ "|" + RECEV_BARCODE1D_1+ "|" + RECEV_BARCODE2D_1+ "|" + RECEV_INGB2_1+ "|"
|
|
|
|
|
+ RECEV_CARNO_1+ "|" + RECEV_WDATETIME_1+ "|" + RECEV_DONG_1+ "|" + RECEV_POS_1+ "|" + RECEV_VIOR_1+ "|"
|
|
|
|
|
+ RECEV_CARNO_1+ "|"
|
|
|
|
|
+ RECEV_WDATETIME_1+ "|"
|
|
|
|
|
+ RECEV_DONG_1+ "|" + RECEV_POS_1+ "|" + RECEV_VIOR_1+ "|"
|
|
|
|
|
+ RECEV_CARKIND_1+ "|" + RECEV_CARID_1+ "|" + RECEV_MOSAICX_1+ "|" + RECEV_MOSAICY_1+ "|" + RECEV_IMGCNT_1+ "|"
|
|
|
|
|
+ RECEV_TWOHOUR_1+ "|" + RECEV_SCHOOL_1+ "|" + RECEV_BASICLIVE_1+ "|" + RECEV_POST_GB_1+ "|"
|
|
|
|
|
+ RECEV_PRINTDATE_1+ "|" + RECEV_GOJINUMBER_1+ "|" + RECEV_ORG_AMT_1+ "|" + RECEV_KEUMINFO_1+ "|"
|
|
|
|
|
@ -3139,15 +3178,19 @@ public class FinePenaltyServiceImpl implements FinePenaltyService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
findCreateImageFileList(txt,fileFullName);
|
|
|
|
|
this.findCreateImageFileList(txt,fileFullName);
|
|
|
|
|
|
|
|
|
|
findCreateImageFileList(txtImage,cfsCommonService.findCommonSecureGet("FIlE_PATH")+CON_KEY+"img.txt");
|
|
|
|
|
this.findCreateImageFileList(txtImage,cfsCommonService.findCommonSecureGet("FIlE_PATH")+CON_KEY+"img.txt");
|
|
|
|
|
|
|
|
|
|
findCreateImageUpload(paramList);
|
|
|
|
|
this.findCreateImageUpload(paramList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String command = String.format("sh "+"/gpta/source-app/cfs/egreen/snd_eGreen.sh "+"/gpta/source-app/cfs/egreen"+" "+CON_KEY);
|
|
|
|
|
shellCmd(command);
|
|
|
|
|
|
|
|
|
|
//String path = this.egreen_step4("/gpta/source-app/cfs/egreen", CON_KEY);
|
|
|
|
|
//this.egreen_step5(path);
|
|
|
|
|
|
|
|
|
|
}catch(RuntimeException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
logger.info("catch check");
|
|
|
|
|
@ -3158,28 +3201,93 @@ public class FinePenaltyServiceImpl implements FinePenaltyService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void findCreateImageFileList(String txt, String fileName) throws Exception {
|
|
|
|
|
System.out.println(txt);
|
|
|
|
|
System.out.println(fileName);
|
|
|
|
|
System.out.println("**===================================");
|
|
|
|
|
|
|
|
|
|
BufferedWriter bf = new BufferedWriter(new FileWriter(fileName));
|
|
|
|
|
try{
|
|
|
|
|
|
|
|
|
|
bf.write(txt);
|
|
|
|
|
bf.flush();
|
|
|
|
|
|
|
|
|
|
logger.info("무사 성공났다"+fileName);
|
|
|
|
|
|
|
|
|
|
}catch(RuntimeException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
logger.info("catch check");
|
|
|
|
|
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
logger.info("catch check");
|
|
|
|
|
|
|
|
|
|
}finally{
|
|
|
|
|
if(bf != null)
|
|
|
|
|
bf.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String egreen_step4(String rootWork, String conkey) throws Exception {
|
|
|
|
|
String result = "";
|
|
|
|
|
|
|
|
|
|
String chg_files_path = rootWork+"/data";
|
|
|
|
|
|
|
|
|
|
String readLineFileName_SUFFIX = "img.txt";
|
|
|
|
|
String chg_file_name_PREFIX = "LGRDFB$";
|
|
|
|
|
|
|
|
|
|
String readLineFileName = conkey+readLineFileName_SUFFIX;
|
|
|
|
|
String readLineFilePath = rootWork+"/"+readLineFileName;
|
|
|
|
|
|
|
|
|
|
String firstTxtName = conkey+".txt";
|
|
|
|
|
String firstTxtPath = rootWork+"/"+firstTxtName;
|
|
|
|
|
String firstZipName = conkey+".zip";
|
|
|
|
|
String firstZipPath = rootWork+"/"+firstZipName;
|
|
|
|
|
|
|
|
|
|
String chg_file_name_no_ext = chg_file_name_PREFIX+conkey;
|
|
|
|
|
String chg_file_name_txt = chg_file_name_no_ext+".txt";
|
|
|
|
|
String chg_file_path_txt = chg_files_path+"/"+chg_file_name_txt;
|
|
|
|
|
String chg_file_name_zip = chg_file_name_no_ext+".zip";
|
|
|
|
|
String chg_file_path_zip = chg_files_path+"/"+chg_file_name_zip;
|
|
|
|
|
|
|
|
|
|
Files.move(Paths.get(firstTxtPath), Paths.get(chg_file_path_txt), StandardCopyOption.REPLACE_EXISTING);
|
|
|
|
|
|
|
|
|
|
BufferedReader br = Files.newBufferedReader(Paths.get(readLineFilePath));
|
|
|
|
|
Charset.forName("UTF-8");
|
|
|
|
|
List<String> lines = new ArrayList<String>();
|
|
|
|
|
String line = "";
|
|
|
|
|
while ((line = br.readLine()) != null) {
|
|
|
|
|
if(line != null && !line.equals("")){
|
|
|
|
|
lines.add(line);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ZipUtil.makeZip(rootWork, lines, firstZipName);
|
|
|
|
|
|
|
|
|
|
for(String one : lines){
|
|
|
|
|
Files.delete(Paths.get(rootWork+"/"+one));
|
|
|
|
|
}
|
|
|
|
|
Files.delete(Paths.get(readLineFilePath));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Files.move(Paths.get(firstZipPath), Paths.get(chg_file_path_zip), StandardCopyOption.REPLACE_EXISTING);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result = chg_files_path + "/" + chg_file_name_no_ext;
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean egreen_step5(String path){
|
|
|
|
|
Map<String,String> connectionInfo = trsmrcvDao.selectConnectionInfo("EGREEN_ESB_AGENT_FTP");
|
|
|
|
|
|
|
|
|
|
boolean initResult = sftpUtil.init(
|
|
|
|
|
connectionInfo.get("CONNECT_IP"),
|
|
|
|
|
connectionInfo.get("USER_ID"),
|
|
|
|
|
connectionInfo.get("USER_PASS"),
|
|
|
|
|
Integer.parseInt(connectionInfo.get("CONNECT_PORT"))
|
|
|
|
|
);
|
|
|
|
|
if(!initResult){
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
boolean uploadResult = sftpUtil.sFtpUpload2(connectionInfo.get("PATH_INFO"), new File(path+".txt"), new File(path+".zip"));
|
|
|
|
|
|
|
|
|
|
return uploadResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean shellCmd(String cmd) {
|
|
|
|
|
Process process = null;
|
|
|
|
|
|