|
|
|
|
@ -28,9 +28,11 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
import cokr.xit.base.file.ZIP;
|
|
|
|
|
import cokr.xit.fims.nxrp.Hirer;
|
|
|
|
|
import cokr.xit.fims.nxrp.NisIndivQuery;
|
|
|
|
|
import cokr.xit.fims.nxrp.dao.NisIndivMapper;
|
|
|
|
|
import cokr.xit.fims.nxrp.service.NisIndivService;
|
|
|
|
|
import cokr.xit.fims.nxrp.service.bean.NisIndivBean;
|
|
|
|
|
import cokr.xit.foundation.Downloadable;
|
|
|
|
|
import cokr.xit.foundation.data.DataObject;
|
|
|
|
|
import cokr.xit.foundation.web.AbstractController;
|
|
|
|
|
|
|
|
|
|
@Controller
|
|
|
|
|
@ -44,25 +46,39 @@ public class NxrpController extends AbstractController {
|
|
|
|
|
private NisIndivService nisIndivService;
|
|
|
|
|
@Resource(name = "nisIndivBean")
|
|
|
|
|
private NisIndivBean nisIndivBean;
|
|
|
|
|
@Resource(name = "nisIndivMapper")
|
|
|
|
|
private NisIndivMapper nisIndivMapper;
|
|
|
|
|
|
|
|
|
|
//테스트
|
|
|
|
|
@RequestMapping(name="계약정보 만들고 보내기", value="/sendIndivJeju01.do")
|
|
|
|
|
public ModelAndView sendNisIndivJeju01(HttpServletRequest hreq, NisIndivQuery req) {
|
|
|
|
|
public ModelAndView sendNisIndivJeju01(HttpServletRequest hreq, NisIndivQuery req) throws InterruptedException {
|
|
|
|
|
|
|
|
|
|
String random = hreq.getParameter("random");
|
|
|
|
|
boolean randomFlag = true;
|
|
|
|
|
if(random != null && random.equals("N")) {
|
|
|
|
|
randomFlag = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NisIndivQuery query = new NisIndivQuery();
|
|
|
|
|
query.setSggCd("50110");
|
|
|
|
|
query.setTaskSeCd("ECA");
|
|
|
|
|
String zipPath = nisIndivBean.makeNisIndivJeju01(query, randomFlag);
|
|
|
|
|
|
|
|
|
|
if(zipPath != null && !zipPath.equals("")) {
|
|
|
|
|
nisIndivBean.send_DO_to_SI(zipPath);
|
|
|
|
|
|
|
|
|
|
List<DataObject> sggTasks = nisIndivMapper.getNxrpRentSggTask("");
|
|
|
|
|
|
|
|
|
|
for(DataObject sggTask : sggTasks) {
|
|
|
|
|
Thread.sleep(2000);
|
|
|
|
|
query.setSggCd(sggTask.string("SGG_CD"));
|
|
|
|
|
query.setTaskSeCd(sggTask.string("TASK_SE_CD"));
|
|
|
|
|
String zipPath = nisIndivBean.makeNisIndivJeju01(query, randomFlag);
|
|
|
|
|
if(zipPath != null && !zipPath.equals("")) {
|
|
|
|
|
nisIndivBean.send_DO_to_SI(zipPath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new ModelAndView("jsonView");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -70,7 +86,7 @@ public class NxrpController extends AbstractController {
|
|
|
|
|
|
|
|
|
|
//테스트서버에서 압축파일만들고 제주도운영서버에 파일보내기
|
|
|
|
|
@RequestMapping(name="테스트서버에서 압축파일만들고 제주도운영서버에 파일보내기", value="/jeju01_test_to_jejudo.do")
|
|
|
|
|
public ModelAndView jeju01_test_to_jejudo(HttpServletRequest hreq, NisIndivQuery req) {
|
|
|
|
|
public ModelAndView jeju01_test_to_jejudo(HttpServletRequest hreq, NisIndivQuery req) throws InterruptedException {
|
|
|
|
|
|
|
|
|
|
ModelAndView jsonView = new ModelAndView("jsonView");
|
|
|
|
|
|
|
|
|
|
@ -95,20 +111,28 @@ public class NxrpController extends AbstractController {
|
|
|
|
|
randomFlag = false;
|
|
|
|
|
}
|
|
|
|
|
NisIndivQuery query = new NisIndivQuery();
|
|
|
|
|
query.setSggCd("50110");
|
|
|
|
|
query.setTaskSeCd("ECA");
|
|
|
|
|
String zipPath = nisIndivBean.makeNisIndivJeju01(query, randomFlag);
|
|
|
|
|
String zipFolder = FilenameUtils.getPath(zipPath);
|
|
|
|
|
|
|
|
|
|
if(zipPath != null && !zipPath.equals("")) {
|
|
|
|
|
MultipartTest mt = new MultipartTest();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
mt.multipartPost(zipPath, zipFolder, url+"/is/rentcar/intf/nxrp/jeju01_multipart_to_jejusi.do");
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
List<DataObject> sggTasks = nisIndivMapper.getNxrpRentSggTask("");
|
|
|
|
|
for(DataObject sggTask : sggTasks) {
|
|
|
|
|
Thread.sleep(2000);
|
|
|
|
|
query.setSggCd(sggTask.string("SGG_CD"));
|
|
|
|
|
query.setTaskSeCd(sggTask.string("TASK_SE_CD"));
|
|
|
|
|
|
|
|
|
|
String zipPath = nisIndivBean.makeNisIndivJeju01(query, randomFlag);
|
|
|
|
|
String zipFolder = FilenameUtils.getPath(zipPath);
|
|
|
|
|
|
|
|
|
|
if(zipPath != null && !zipPath.equals("")) {
|
|
|
|
|
MultipartTest mt = new MultipartTest();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
mt.multipartPost(zipPath, zipFolder, url+"/is/rentcar/intf/nxrp/jeju01_multipart_to_jejusi.do");
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
(new File(zipPath)).delete();
|
|
|
|
|
}
|
|
|
|
|
(new File(zipPath)).delete();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
jsonView.addObject("res", "ok");
|
|
|
|
|
@ -134,12 +158,18 @@ public class NxrpController extends AbstractController {
|
|
|
|
|
|
|
|
|
|
//테스트 계약정보만들기
|
|
|
|
|
@RequestMapping(name="계약정보만들기", value="/makeJeju01.do")
|
|
|
|
|
public ModelAndView makeJeju01(NisIndivQuery req) {
|
|
|
|
|
public ModelAndView makeJeju01(NisIndivQuery req) throws InterruptedException {
|
|
|
|
|
|
|
|
|
|
NisIndivQuery query = new NisIndivQuery();
|
|
|
|
|
query.setSggCd("50110");
|
|
|
|
|
query.setTaskSeCd("ECA");
|
|
|
|
|
String zipPath = nisIndivBean.makeNisIndivJeju01(query,true);
|
|
|
|
|
|
|
|
|
|
List<DataObject> sggTasks = nisIndivMapper.getNxrpRentSggTask("");
|
|
|
|
|
|
|
|
|
|
for(DataObject sggTask : sggTasks) {
|
|
|
|
|
Thread.sleep(2000);
|
|
|
|
|
query.setSggCd(sggTask.string("SGG_CD"));
|
|
|
|
|
query.setTaskSeCd(sggTask.string("TASK_SE_CD"));
|
|
|
|
|
String zipPath = nisIndivBean.makeNisIndivJeju01(query,true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new ModelAndView("jsonView");
|
|
|
|
|
}
|
|
|
|
|
@ -150,13 +180,18 @@ public class NxrpController extends AbstractController {
|
|
|
|
|
|
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
String ymd = now.format(DateTimeFormatter.ofPattern("yyyyMMdd"));
|
|
|
|
|
String sggCd = "50110";
|
|
|
|
|
File folder = new File("/files/temp/sendLcns/"+sggCd+"/"+ymd);
|
|
|
|
|
File[] files = folder.listFiles();
|
|
|
|
|
for(File file : files) {
|
|
|
|
|
nisIndivBean.send_DO_to_SI(file.getPath());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<String> nxrpSggs = nisIndivMapper.getNxrpRentSgg("");
|
|
|
|
|
|
|
|
|
|
for(String nxrpSgg : nxrpSggs) {
|
|
|
|
|
String sggCd = nxrpSgg;
|
|
|
|
|
|
|
|
|
|
File folder = new File("/files/temp/sendLcns/"+sggCd+"/"+ymd);
|
|
|
|
|
File[] files = folder.listFiles();
|
|
|
|
|
for(File file : files) {
|
|
|
|
|
nisIndivBean.send_DO_to_SI(file.getPath());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new ModelAndView("jsonView");
|
|
|
|
|
}
|
|
|
|
|
|