스케쥴러 수동 처리 추가

main
이범준 3 months ago
parent 0bb9c9f53e
commit 25220fc1ff

@ -0,0 +1,86 @@
package cfs.schd;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import cfs.trsmrcv.service.CommCollectServerService;
@Component("brsEndOfDayInfo")
public class BrsEndOfDayInfo {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource(name="commCollectServerService")
private CommCollectServerService commCollectServerService;
public void getBrsSummaryInfo(String inYmd) {
String targetYMD = "";
SimpleDateFormat sdf8 = (new SimpleDateFormat("yyyyMMdd"));
SimpleDateFormat sdf14 = (new SimpleDateFormat("yyyyMMddHHmmss"));
Date now = new Date();
if(inYmd == null || inYmd.equals("")){
Calendar cal = Calendar.getInstance();
cal.setTime(now);
cal.add(Calendar.DAY_OF_MONTH, -1);
targetYMD = sdf8.format(cal.getTime());
} else {
targetYMD = inYmd;
}
Map<String, String> param = new HashMap<String, String>();
param.put("insttNo", "BRSMC0300001");
param.put("insttCntcJobSe", "006");
param.put("requstDt", sdf14.format(now));
param.put("startClosDt", targetYMD);
param.put("endClosDt", targetYMD);
try {
commCollectServerService.callPreRegistDayCloseSummary(param);
} catch (Exception e) {
e.printStackTrace();
}
}
public void getBrsRejectInfo(String inYmd) {
String targetYMD = "";
SimpleDateFormat sdf8 = (new SimpleDateFormat("yyyyMMdd"));
SimpleDateFormat sdf14 = (new SimpleDateFormat("yyyyMMddHHmmss"));
Date now = new Date();
if(inYmd == null || inYmd.equals("")){
Calendar cal = Calendar.getInstance();
cal.setTime(now);
cal.add(Calendar.DAY_OF_MONTH, -1);
targetYMD = sdf8.format(cal.getTime());
} else {
targetYMD = inYmd;
}
Map<String, String> param = new HashMap<String, String>();
param.put("insttNo", "BRSMC0300001");
param.put("insttCntcJobSe", "018");
param.put("requstDt", sdf14.format(now));
param.put("startClosDt", targetYMD);
param.put("endClosDt", targetYMD);
try {
commCollectServerService.callPreRegistDayCloseReturn(param);
} catch (Exception e) {
e.printStackTrace();
}
}
}

@ -34,15 +34,20 @@ public class SendStatusInfo {
@Resource(name="commSmartPlatformFISService")
private CommSmartPlatformFISService commSmartPlatformFISService;
public void checkEgreenStatus(){
public void checkEgreenStatus(String inYmd){
String targetYMD = "";
SimpleDateFormat sdf8 = (new SimpleDateFormat("yyyyMMdd"));
Date now = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(now);
cal.add(Calendar.DAY_OF_MONTH, -1);
String targetYMD = sdf8.format(cal.getTime());
if(inYmd == null || inYmd.equals("")){
Calendar cal = Calendar.getInstance();
cal.setTime(now);
cal.add(Calendar.DAY_OF_MONTH, -1);
targetYMD = sdf8.format(cal.getTime());
} else {
targetYMD = inYmd;
}
List<Map<String, Object>> targetList = null;
@ -87,7 +92,7 @@ public class SendStatusInfo {
strConKey = obj.get(0).get("CON_KEY").toString();
if(obj.get(0).get("DATA_CD") == null) {
inMap.put("EGREEN_RESULT_ID", "10"); //
inMap.put("EGREEN_RESULT_ID", "10"); //
} else {
strCreateState = obj.get(0).get("DATA_CD").toString();
@ -96,8 +101,7 @@ public class SendStatusInfo {
} else {
if(obj.get(0).get("DELIVRSLT_CD") == null) { //재발 전...
inMap.put("EGREEN_RESULT_ID", strCreateState);
}
else {
} else {
inMap.put("EGREEN_RESULT_ID", "3" + obj.get(0).get("DELIVRSLT_CD").toString());
}
}
@ -118,14 +122,20 @@ public class SendStatusInfo {
}
public void checkKtStatus(){
public void checkKtStatus(String inYmd){
String targetYMD = "";
SimpleDateFormat sdf8 = (new SimpleDateFormat("yyyyMMdd"));
Date now = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(now);
cal.add(Calendar.DAY_OF_MONTH, -2);
String targetYMD = sdf8.format(cal.getTime());
if(inYmd == null || inYmd.equals("")){
Calendar cal = Calendar.getInstance();
cal.setTime(now);
cal.add(Calendar.DAY_OF_MONTH, -2);
targetYMD = sdf8.format(cal.getTime());
} else {
targetYMD = inYmd;
}
Map<String, String> param = new HashMap<String, String>();

@ -18,6 +18,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import cfs.WASInfo;
import cfs.schd.BrsEndOfDayInfo;
import cfs.schd.ExemptCarInfo;
import cfs.schd.LocalResidentsCarInfo;
import cfs.schd.PrpCarInfo;
@ -51,6 +52,9 @@ public class CfsScheduleCron {
@Resource(name="sendStatusInfo")
private SendStatusInfo sendStatusInfo;
@Resource(name="brsEndOfDayInfo")
private BrsEndOfDayInfo brsEndOfDayInfo;
@Resource(name="commCollectServerService")
private CommCollectServerService commCollectServerService;
@ -90,7 +94,7 @@ public class CfsScheduleCron {
return;
}
sendStatusInfo.checkEgreenStatus();
sendStatusInfo.checkEgreenStatus("");
}
@ -105,7 +109,7 @@ public class CfsScheduleCron {
return;
}
sendStatusInfo.checkKtStatus();
sendStatusInfo.checkKtStatus("");
}
/**
@ -120,27 +124,7 @@ public class CfsScheduleCron {
return;
}
SimpleDateFormat sdf8 = (new SimpleDateFormat("yyyyMMdd"));
SimpleDateFormat sdf14 = (new SimpleDateFormat("yyyyMMddHHmmss"));
Date now = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(now);
cal.add(Calendar.DAY_OF_MONTH, -1);
String targetYMD = sdf8.format(cal.getTime());
Map<String, String> param = new HashMap<String, String>();
param.put("insttNo", "BRSMC0300001");
param.put("insttCntcJobSe", "006");
param.put("requstDt", sdf14.format(now));
param.put("startClosDt", targetYMD);
param.put("endClosDt", targetYMD);
try {
commCollectServerService.callPreRegistDayCloseSummary(param);
} catch (Exception e) {
e.printStackTrace();
}
brsEndOfDayInfo.getBrsSummaryInfo("");
}
/**
@ -155,28 +139,7 @@ public class CfsScheduleCron {
return;
}
SimpleDateFormat sdf8 = (new SimpleDateFormat("yyyyMMdd"));
SimpleDateFormat sdf14 = (new SimpleDateFormat("yyyyMMddHHmmss"));
Date now = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(now);
cal.add(Calendar.DAY_OF_MONTH, -1);
String targetYMD = sdf8.format(cal.getTime());
Map<String, String> param = new HashMap<String, String>();
param.put("insttNo", "BRSMC0300001");
param.put("insttCntcJobSe", "018");
param.put("requstDt", sdf14.format(now));
param.put("startClosDt", targetYMD);
param.put("endClosDt", targetYMD);
try {
commCollectServerService.callPreRegistDayCloseReturn(param);
} catch (Exception e) {
e.printStackTrace();
}
brsEndOfDayInfo.getBrsRejectInfo("");
}

@ -0,0 +1,98 @@
package cfs.trsmrcv.web;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import cfs.schd.BrsEndOfDayInfo;
import cfs.schd.ExemptCarInfo;
import cfs.schd.PrpCarInfo;
import cfs.schd.SendStatusInfo;
@Controller
public class SudongController {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource(name="prpCarInfo")
private PrpCarInfo prpCarInfo;
@Resource(name="exemptCarInfo")
private ExemptCarInfo exemptCarInfo;
@Resource(name="sendStatusInfo")
private SendStatusInfo sendStatusInfo;
@Resource(name="brsEndOfDayInfo")
private BrsEndOfDayInfo brsEndOfDayInfo;
@RequestMapping(value="/rest/sudong/checkEgreenStatus", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> checkEgreenStatus(@RequestBody Map<String,Object> reqMap) throws Exception {
Map result = new HashMap();
String ymd = reqMap.get("ymd").toString();
sendStatusInfo.checkEgreenStatus(ymd);
result.put("res", "OK");
return result;
}
@RequestMapping(value="/rest/sudong/checkKtStatus", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> checkKtStatus(@RequestBody Map<String,Object> reqMap) throws Exception {
Map result = new HashMap();
String ymd = reqMap.get("ymd").toString();
sendStatusInfo.checkKtStatus(ymd);
result.put("res", "OK");
return result;
}
@RequestMapping(value="/rest/sudong/getBrsSummaryInfo", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> getBrsSummaryInfo(@RequestBody Map<String,Object> reqMap) throws Exception {
Map result = new HashMap();
String ymd = reqMap.get("ymd").toString();
brsEndOfDayInfo.getBrsSummaryInfo(ymd);
result.put("res", "OK");
return result;
}
@RequestMapping(value="/rest/sudong/getBrsRejectInfo", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> getBrsRejectInfo(@RequestBody Map<String,Object> reqMap) throws Exception {
Map result = new HashMap();
String ymd = reqMap.get("ymd").toString();
brsEndOfDayInfo.getBrsRejectInfo(ymd);
result.put("res", "OK");
return result;
}
@RequestMapping(value="/rest/sudong/makeExemptMaster", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> makeExemptMaster(HttpServletRequest request) throws Exception {
Map result = new HashMap();
prpCarInfo.makeExemptMaster();
result.put("res", "OK");
return result;
}
@RequestMapping(value="/rest/sudong/makeScarMaster", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> makeScarMaster(HttpServletRequest request) throws Exception {
Map result = new HashMap();
prpCarInfo.makeScarMaster();
result.put("res", "OK");
return result;
}
@RequestMapping(value="/rest/sudong/makePreregistMaster.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> makePreregistMaster(HttpServletRequest request) throws Exception {
Map result = new HashMap();
prpCarInfo.makePreregistMaster();
result.put("res", "OK");
return result;
}
}

@ -29,8 +29,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
import cfs.WASInfo;
import cfs.common.util.ResultSmartPlatform;
import cfs.schd.ExemptCarInfo;
import cfs.schd.PrpCarInfo;
import cfs.schd.dao.SchdDao;
import cfs.trsmrcv.dao.TrsmrcvDao;
@ -45,12 +43,6 @@ public class TestController {
@Resource(name = "schdDao")
private SchdDao schdDao;
@Resource(name="prpCarInfo")
private PrpCarInfo prpCarInfo;
@Resource(name="exemptCarInfo")
private ExemptCarInfo exemptCarInfo;
@RequestMapping(value="/cfs/trsmrcv/sleep.do", method=RequestMethod.GET)
public @ResponseBody Map<String, Object> sleep(HttpServletRequest request) throws Exception {
TrsmrcvUtil.printRequestHeader(request);
@ -91,30 +83,6 @@ public class TestController {
return result;
}
@RequestMapping(value="/cfs/sudong/makeExemptMaster.do", method=RequestMethod.GET)
public @ResponseBody Map<String, Object> makeExemptMaster(HttpServletRequest request) throws Exception {
Map result = new HashMap();
prpCarInfo.makeExemptMaster();
result.put("res", "OK");
return result;
}
@RequestMapping(value="/cfs/sudong/makeScarMaster.do", method=RequestMethod.GET)
public @ResponseBody Map<String, Object> makeScarMaster(HttpServletRequest request) throws Exception {
Map result = new HashMap();
prpCarInfo.makeScarMaster();
result.put("res", "OK");
return result;
}
@RequestMapping(value="/cfs/sudong/makePreregistMaster.do", method=RequestMethod.GET)
public @ResponseBody Map<String, Object> makePreregistMaster(HttpServletRequest request) throws Exception {
Map result = new HashMap();
prpCarInfo.makePreregistMaster();
result.put("res", "OK");
return result;
}
@RequestMapping(value="/rest/test/nothing.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> nothing(@RequestBody Map<String,Object> reqMap) throws Exception {

Loading…
Cancel
Save