소스정리

main
이범준 5 months ago
parent b7aaa79a7f
commit 497ffd0990

@ -23,58 +23,13 @@ import cfs.trsmrcv.service.CommRelayServerService;
import cfs.trsmrcv.service.CommSmartPlatformFISService;
@Controller
public class Comm3HoJController {
public class Comm3HoIrregularController {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource(name = "trsmrcvDao")
private TrsmrcvDao trsmrcvDao;
@Resource(name = "commRelayServerService")
private CommRelayServerService commRelayServerService;
@Resource(name = "cfsCommonService")
private CfsCommonService cfsCommonService;
@Resource(name = "commSmartPlatformPRPDao")
private CommSmartPlatformPRPDao commSmartPlatformPRPDao;
@Resource(name="commSmartPlatformFISService")
private CommSmartPlatformFISService commSmartPlatformFISService;
/**
* (cutmp4)
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/selectDefaultCarInfoMovie.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> selectDefaultCarInfoMovie(@RequestBody Map<String, String> param,
HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
List<Map<String, Object>> obj = null;
try {
obj = commRelayServerService.selectDefaultCarMovieInfo(param);
if (obj == null || obj.size() == 0) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
result.setMsg(ResultSmartPlatform.RESULT_KEY_DEFAULT, "조회결과가 없습니다.");
return result.getResult();
}
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, obj);
} catch (RuntimeException e) {
e.printStackTrace();
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
} catch (Exception e) {
e.printStackTrace();
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
/**
*

@ -0,0 +1,67 @@
package cfs.trsmrcv.web;
import java.util.List;
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.common.service.CfsCommonService;
import cfs.common.util.Result;
import cfs.common.util.ResultSmartPlatform;
import cfs.trsmrcv.dao.CommSmartPlatformPRPDao;
import cfs.trsmrcv.dao.TrsmrcvDao;
import cfs.trsmrcv.service.CommRelayServerService;
import cfs.trsmrcv.service.CommSmartPlatformFISService;
@Controller
public class Comm3HoRegularController {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource(name = "commRelayServerService")
private CommRelayServerService commRelayServerService;
/**
* (cutmp4)
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/selectDefaultCarInfoMovie.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> selectDefaultCarInfoMovie(@RequestBody Map<String, String> param,
HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
List<Map<String, Object>> obj = null;
try {
obj = commRelayServerService.selectDefaultCarMovieInfo(param);
if (obj == null || obj.size() == 0) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
result.setMsg(ResultSmartPlatform.RESULT_KEY_DEFAULT, "조회결과가 없습니다.");
return result.getResult();
}
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, obj);
} catch (RuntimeException e) {
e.printStackTrace();
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
} catch (Exception e) {
e.printStackTrace();
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
}

File diff suppressed because it is too large Load Diff

@ -1,90 +0,0 @@
package cfs.trsmrcv.web;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.json.simple.JSONObject;
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.common.service.CfsCommonService;
import cfs.common.util.CallWebService;
import cfs.common.util.ResultSmartPlatform;
import cfs.trsmrcv.dao.TrsmrcvDao;
@Controller
public class CommHoController {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource(name = "trsmrcvDao")
private TrsmrcvDao trsmrcvDao;
@Resource(name = "cfsCommonService")
private CfsCommonService cfsCommonService;
/**
* ANPR (,,SD) 1jar,3jar = , c = vhcleNum
*
* <pre></pre>
*/
@SuppressWarnings("unchecked")
@RequestMapping(value = "/cfs/trsmrcv/callANPRStatusInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> callANPRStatusInfo(
@RequestBody Map<String, Object> param,
HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
//통합관제센터에 전달
String url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_035");
CallWebService callWebService = new CallWebService(url);
JSONObject paramWeb = new JSONObject();
paramWeb.put("camId", param.get("camId"));
paramWeb.put("colctTime", param.get("colctTime"));
paramWeb.put("camConectSttus", param.get("camConectSttus"));
paramWeb.put("rtuTp", param.get("rtuTp")); //온도
paramWeb.put("bxDoorSttus", param.get("bxDoorSttus")); //함체도어상태
paramWeb.put("camSdCardSttus", param.get("camSdCardSttus")); //SD카메라상태
// {camId=999999999, colctTime=2019061815000000, vhcleNum=0,
// rtuTp=30, bxDoorSttus=0, camSdCardSttus=0}
Map<String, String> mapOrg = new HashMap<String, String>();
mapOrg.put("headerTypCd", "601");
mapOrg.put("trnsmitSysCd", "CFS");
mapOrg.put("mesgTypCd", "M62");
mapOrg.put("data", paramWeb.toString());
Map<String, String> map = callWebService.callWebServicePost(mapOrg);
System.out.println("==== " + map.toString());
if (map == null || map.get("result").toString().equals("FAIL") == true) {
// 조회 실패
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
return result.getResult();
}
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
} catch (RuntimeException e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} catch (Exception e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} finally {
logger.info(result.getResult().get("resultMessage").toString());
}
return result.getResult();
}
}

@ -0,0 +1,673 @@
package cfs.trsmrcv.web;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.json.simple.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.ContextLoader;
import cfs.common.service.CfsCommonService;
import cfs.common.util.CallWebService;
import cfs.common.util.Result;
import cfs.common.util.ResultSmartPlatform;
import cfs.trsmrcv.dao.TrsmrcvDao;
import cfs.trsmrcv.service.CommCollectServerService;
import cfs.trsmrcv.service.CommRelayServerService;
import cfs.trsmrcv.service.CommSmartPlatformAISService;
import cfs.trsmrcv.service.CommSmartPlatformFISService;
import cfs.trsmrcv.service.CommSmartPlatformPRPService;
import cfs.trsmrcv.vo.AICarNoSearchVO;
@Controller
public class CommHoIrregularController {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource(name = "trsmrcvDao")
private TrsmrcvDao trsmrcvDao;
@Resource(name = "commRelayServerService")
private CommRelayServerService commRelayServerService;
@Resource(name = "cfsCommonService")
private CfsCommonService cfsCommonService;
@Resource(name="commCollectServerService")
private CommCollectServerService commCollectServerService;
@Resource(name="commSmartPlatformFISService")
private CommSmartPlatformFISService commSmartPlatformFISService;
@Resource(name="commSmartPlatformAISService")
private CommSmartPlatformAISService commSmartPlatformAISService;
private ApplicationContext getApplicationContext() {
return ContextLoader.getCurrentWebApplicationContext();
}
//
/**
*
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/saveCarThroughInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> saveCarThroughInfo(
@RequestParam String in_id,
@RequestParam String in_fare,
@RequestParam String in_booth,
@RequestParam String in_date,
@RequestParam String in_seqno,
@RequestParam String in_rf_seqno,
@RequestParam String in_car,
@RequestParam String in_collect,
@RequestParam String in_army,
@RequestParam String in_stop,
@RequestParam String in_move,
@RequestParam String in_amount,
@RequestParam String in_x,
@RequestParam String in_y,
@RequestParam String in_garo,
@RequestParam String in_sero,
@RequestParam String in_card_ret,
@RequestParam String in_other,
@RequestParam String in_rfid_kbn,
@RequestParam String in_tag,
@RequestParam String in_carkind,
@RequestParam String in_collect_new,
@RequestParam String in_sens_time,
@RequestParam String in_auto_kind,
@RequestParam String in_key_yn
, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, Object> mapOrg = new HashMap<String, Object>();
mapOrg.put("in_id", in_id);
mapOrg.put("in_fare", in_fare);
mapOrg.put("in_booth", in_booth);
mapOrg.put("in_date", in_date);
mapOrg.put("in_seqno", in_seqno);
mapOrg.put("in_rf_seqno", in_rf_seqno);
mapOrg.put("in_car", in_car);
mapOrg.put("in_collect", in_collect);
mapOrg.put("in_army", in_army);
mapOrg.put("in_stop", in_stop);
mapOrg.put("in_move", in_move);
mapOrg.put("in_amount", in_amount);
mapOrg.put("in_x", in_x);
mapOrg.put("in_y", in_y);
mapOrg.put("in_garo", in_garo);
mapOrg.put("in_sero", in_sero);
mapOrg.put("in_card_ret", in_card_ret);
mapOrg.put("in_other", in_other);
mapOrg.put("in_rfid_kbn", in_rfid_kbn);
mapOrg.put("in_tag", in_tag);
mapOrg.put("in_carkind", in_carkind);
mapOrg.put("in_collect_new", in_collect_new);
mapOrg.put("in_sens_time", in_sens_time);
if(in_auto_kind.length() != 2){
mapOrg.put("in_auto_kind", "00");
}else{
mapOrg.put("in_auto_kind", in_auto_kind);
}
if(in_key_yn.length() != 1){
mapOrg.put("in_key_yn", "0");
}else{
mapOrg.put("in_key_yn", in_key_yn);
}
mapOrg.put("out_ret", -1);
commRelayServerService.callSP_FARE_INS(mapOrg);
// 사전등록결제 요청인 경우
// 2019.08.29 수정
String strCollect = mapOrg.get("in_collect_new").toString();
if (strCollect.equals("60") || strCollect.equals("61") || strCollect.equals("62") || strCollect.equals("63")
|| strCollect.equals("64") || strCollect.equals("66")) {
System.out.println("##### 사전결제 시작 ####");
callPreRegistPayment(mapOrg);
}
if (mapOrg.get("out_ret").toString().equals("1") == true) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
} else if (mapOrg.get("out_ret").toString().equals("2") == true) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "중복 데이터 추가 오류가 발생했습니다.1");
} else {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
}
} catch (RuntimeException e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} catch (Exception e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} finally {
logger.info("fare처리 result =" + result.getResult());
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
//
/**
*
*
* <pre></pre>
*/
private int callPreRegistPayment(Map<String, Object> map) {
int nReturn = 0;
try {
// 사전등록결제를 위한 함수 호출
List<Map<String, Object>> obj = null;
obj = commRelayServerService.selectPreRegistCar(map);
if (obj == null || obj.size() == 0) {
return -1;
}
Map<String, Object> mapOrg = new HashMap<String, Object>();
mapOrg.put("WORKER_ID", map.get("in_fare").toString() + map.get("in_id").toString());
mapOrg.put("FARE_OFFICE_ID", map.get("in_fare").toString());
mapOrg.put("BOOTH_ID", map.get("in_booth").toString());
String str = map.get("in_date").toString();
mapOrg.put("YEAR", str.substring(0, 4));
mapOrg.put("MONTH", str.substring(4, 6));
mapOrg.put("DAY", str.substring(6, 8));
mapOrg.put("WORK_TIMES", str.substring(8, 14));
mapOrg.put("SEQNO", map.get("in_seqno").toString());
mapOrg.put("PASS_DATE", str);
mapOrg.put("PASS_AMOUNT", map.get("in_amount").toString());
mapOrg.put("CAR_NO", obj.get(0).get("CAR_NO").toString());
mapOrg.put("CAR_OWNER_CI", obj.get(0).get("CAR_OWNER_CI").toString());
mapOrg.put("COLLECT_ID_NEW", map.get("in_collect_new").toString());
// Call the method of the service
CommSmartPlatformPRPService service = (CommSmartPlatformPRPService) getApplicationContext()
.getBean("commSmartPlatformPRPService");
map = service.callPreRegistPayment(mapOrg);
System.out.println("==== " + map.toString());
if (map == null || map.get("result").toString().equals("FAIL") == true) {
// 조회 실패
nReturn = -1;
// 미납으로 상태정보 변경
}
service = null;
} catch (RuntimeException e) {
logger.info("catch check");
} catch (Exception e) {
logger.info("catch check");
}
return nReturn;
}
//
/**
*
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/saveCardPaymentInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> saveCardPaymentInfo(
@RequestParam String in_id,
@RequestParam String in_fare,
@RequestParam String in_booth,
@RequestParam String in_date,
@RequestParam String in_time,
@RequestParam String in_seqno,
@RequestParam String in_kbn,
@RequestParam String in_card,
@RequestParam String in_collect,
@RequestParam String in_be_amount,
@RequestParam String in_amount,
@RequestParam String in_re_amount,
@RequestParam String in_terminal_id,
@RequestParam String in_sam_id,
@RequestParam String in_sam_seqno,
@RequestParam String in_card_seqno,
@RequestParam String in_algorithm_id,
@RequestParam String in_key_version,
@RequestParam String in_e_cash,
@RequestParam String in_sam_tot_seqno,
@RequestParam String in_sam_collect_cnt,
@RequestParam String in_sam_tot_amount,
@RequestParam String in_sign_value,
@RequestParam String in_person_code,
@RequestParam String in_zipge_id,
@RequestParam String in_alias_no,
@RequestParam String in_issue_id
, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, Object> mapOrg = new HashMap<String, Object>();
mapOrg.put("in_id", in_id);
mapOrg.put("in_fare", in_fare);
mapOrg.put("in_booth", in_booth);
mapOrg.put("in_date", in_date);
mapOrg.put("in_time", in_time);
mapOrg.put("in_seqno", in_seqno);
mapOrg.put("in_kbn", in_kbn);
mapOrg.put("in_card", in_card);
mapOrg.put("in_collect", in_collect);
mapOrg.put("in_be_amount", in_be_amount);
mapOrg.put("in_amount", in_amount);
mapOrg.put("in_re_amount", in_re_amount);
mapOrg.put("in_terminal_id", in_terminal_id);
mapOrg.put("in_sam_id", in_sam_id);
mapOrg.put("in_sam_seqno", in_sam_seqno);
mapOrg.put("in_card_seqno", in_card_seqno);
mapOrg.put("in_algorithm_id", in_algorithm_id);
mapOrg.put("in_key_version", in_key_version);
mapOrg.put("in_e_cash", in_e_cash);
mapOrg.put("in_sam_tot_seqno", in_sam_tot_seqno);
mapOrg.put("in_sam_collect_cnt", in_sam_collect_cnt);
mapOrg.put("in_sam_tot_amount", in_sam_tot_amount);
mapOrg.put("in_sign_value", in_sign_value);
mapOrg.put("in_person_code", in_person_code);
mapOrg.put("in_zipge_id", in_zipge_id);
mapOrg.put("in_alias_no", in_alias_no);
mapOrg.put("in_issue_id", in_issue_id);
mapOrg.put("out_ret", -1);
commRelayServerService.callSP_RF_INS(mapOrg);
if (mapOrg.get("out_ret").toString().equals("1") == true) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
} else if (mapOrg.get("out_ret").toString().equals("2") == true) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "중복 데이터 추가 오류가 발생했습니다.4");
} else {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
}
} catch (RuntimeException e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} catch (Exception e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
//
/**
*
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/saveWorkInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> saveWorkInfo(
@RequestParam String in_id,
@RequestParam String in_fare,
@RequestParam String in_booth,
@RequestParam String in_st_date,
@RequestParam String in_ed_date,
@RequestParam String in_cash,
@RequestParam String in_k_cash,
@RequestParam String in_free,
@RequestParam String in_minap,
@RequestParam String in_coupon,
@RequestParam String in_k_coupon,
@RequestParam String in_sun,
@RequestParam String in_k_sun,
@RequestParam String in_who,
@RequestParam String in_k_who,
@RequestParam String in_sale,
@RequestParam String in_k_sale,
@RequestParam String in_total_amount,
@RequestParam String in_repay_q,
@RequestParam String in_repay_m,
@RequestParam String in_prp_q,
@RequestParam String in_prp_m,
@RequestParam String in_k_prp_q,
@RequestParam String in_k_prp_m,
@RequestParam String in_seqno
, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, Object> mapOrg = new HashMap<String, Object>();
mapOrg.put("in_id", in_id);
mapOrg.put("in_fare", in_fare);
mapOrg.put("in_booth", in_booth);
mapOrg.put("in_st_date", in_st_date);
mapOrg.put("in_ed_date", in_ed_date);
mapOrg.put("in_cash", in_cash);
mapOrg.put("in_k_cash", in_k_cash);
mapOrg.put("in_free", in_free);
mapOrg.put("in_minap", in_minap);
mapOrg.put("in_coupon", in_coupon);
mapOrg.put("in_k_coupon", in_k_coupon);
mapOrg.put("in_sun", in_sun);
mapOrg.put("in_k_sun", in_k_sun);
mapOrg.put("in_who", in_who);
mapOrg.put("in_k_who", in_k_who);
mapOrg.put("in_sale", in_sale);
mapOrg.put("in_k_sale", in_k_sale);
mapOrg.put("in_total_amount", in_total_amount);
mapOrg.put("in_repay_q", in_repay_q);
mapOrg.put("in_repay_m", in_repay_m);
mapOrg.put("in_prp_q", in_prp_q);
mapOrg.put("in_prp_m", in_prp_m);
mapOrg.put("in_k_prp_q", in_k_prp_q);
mapOrg.put("in_k_prp_m", in_k_prp_m);
mapOrg.put("in_seqno", in_seqno);
mapOrg.put("out_ret", -1);
commRelayServerService.callSP_ADJUST_INS(mapOrg);
if (mapOrg.get("out_ret").toString().equals("1") == true) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
} else if (mapOrg.get("out_ret").toString().equals("2") == true) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "중복 데이터 추가 오류가 발생했습니다.3");
} else {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
}
} catch (RuntimeException e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} catch (Exception e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
//
/**
*
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/saveDayTrafficInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> saveDayTrafficInfo(
@RequestParam String in_fare,
@RequestParam String in_booth,
@RequestParam String in_date,
@RequestParam String d_seq,
@RequestParam String in_car,
@RequestParam String in_carkind,
@RequestParam String c_id
, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, Object> mapOrg = new HashMap<String, Object>();
mapOrg.put("in_fare", in_fare);
mapOrg.put("in_booth", in_booth);
mapOrg.put("in_date", in_date);
mapOrg.put("d_seq", d_seq);
mapOrg.put("in_car", in_car);
mapOrg.put("in_carkind", in_carkind);
mapOrg.put("c_id", c_id);
mapOrg.put("WORKER", "server");
if (commRelayServerService.insertDayTrafficInfo(mapOrg) < 0) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "중복 데이터 추가 오류가 발생했습니다.1");
} else {
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, "");
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
}
} catch (RuntimeException e) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "중복 데이터 추가 오류가 발생했습니다.2");
} catch (Exception e) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "중복 데이터 추가 오류가 발생했습니다.3");
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
/**
* AI ( )
* <pre></pre>
*/
@RequestMapping(value="/cfs/trsmrcv/callCarNoDecision.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> callCarNoDecision(
@RequestParam String aiCarNoReqSeq
, @RequestParam String workerId
, @RequestParam String fareOfficeId
, @RequestParam String boothId
, @RequestParam String year
, @RequestParam String month
, @RequestParam String day
, @RequestParam String workTimes
, @RequestParam String seqno
, @RequestParam String collectId
, @RequestParam String cardRet
, @RequestParam String passDate
, @RequestParam String passAmount
, @RequestParam String carNoImgPath
, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
AICarNoSearchVO vo = new AICarNoSearchVO();
vo.setAiCarNoReqSeq(aiCarNoReqSeq);
vo.setWorkerId(workerId);
vo.setFareOfficeId(fareOfficeId);
vo.setBoothId(boothId);
vo.setYear(year);
vo.setMonth(month);
vo.setDay(day);
vo.setWorkTimes(workTimes);
vo.setSeqno(seqno);
vo.setCollectId(collectId);
vo.setCardRet(cardRet);
vo.setPassDate(passDate);
vo.setPassAmount(passAmount); //원래의도 : 금액, 실제 : sofa+정지이미지관련코드1자리+동영상관련코드1자리+금액의앞3자리
vo.setCarNoImgPath(transFileName(carNoImgPath));
vo.setWorker("test");
// AI 서비스 호출
CalcFeeThread runnable = new CalcFeeThread(commSmartPlatformAISService, vo, cfsCommonService.findCommonSecureGet("ITF_CFS_O_010"));
Thread thread3 = new Thread(runnable);
thread3.setName("Thread #3");
thread3.start();
if(runnable.isSucess() == true) {
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, "");
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
}
else {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
}
}catch(RuntimeException e) {
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
} catch (Exception e) {
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
//
/**
* (*_*_*_*.jpg -> 2N?TTC_~ )
* <pre></pre>
*/
private String transFileName(String strImageOrg) {
//
Map<String, String> cctvID = new HashMap<String, String>();
cctvID.put("101", "A10401001");
cctvID.put("102", "A10301002");
cctvID.put("103", "A10201003");
cctvID.put("104", "A10101004");
cctvID.put("105", "A10111005");
cctvID.put("106", "A10211006");
cctvID.put("107", "A10311007");
cctvID.put("108", "A10411008");
cctvID.put("301", "A10503001");
cctvID.put("302", "A10403002");
cctvID.put("303", "A10303003");
cctvID.put("304", "A10203004");
cctvID.put("305", "폐쇄차로");
cctvID.put("306", "폐쇄차로");
cctvID.put("307", "A10213005");
cctvID.put("308", "A10313006");
cctvID.put("309", "A10413007");
cctvID.put("310", "A10513008");
// 진입 4 진출 8
String[] strarr = strImageOrg.split("_");
System.out.println("=== strImageOrg : " + strImageOrg);
System.out.println("=== strarr[] : " + strarr[0]); //날짜
System.out.println("=== strarr[] : " + strarr[1]); //시간
System.out.println("=== strarr[] : " + strarr[2]); //시퀀스+징수코드
String tennel = strarr[3].substring(0, 1); //터널
String line = strarr[3].substring(1, 3); //차로
String dirc = strarr[3].substring(3); //원래의도 : 통행방향, 실제 : 감지시간의첫자리
dirc = cctvID.get(tennel + line); //덧씌움
dirc = dirc.substring(dirc.length() - 1);
Map<String,String> mapDic = new HashMap<String, String>();
mapDic.put("1", "0");
mapDic.put("2", "0");
mapDic.put("3", "0");
mapDic.put("4", "0");
mapDic.put("5", "1");
mapDic.put("6", "1");
mapDic.put("7", "1");
mapDic.put("8", "1");
System.out.println("==map dirc== : [" + mapDic.get(dirc) + "]==");
StringBuilder strbuf = new StringBuilder();
strbuf.append(strarr[0].substring(0, 4));
strbuf.append("/");
strbuf.append(strarr[0].substring(4, 6));
strbuf.append("/");
strbuf.append(strarr[0].substring(6, 8));
strbuf.append("/");
strbuf.append(cctvID.get(tennel + line));
strbuf.append("/");
strbuf.append(strarr[1].substring(0, 2));
strbuf.append("/");
strbuf.append("2");
System.out.println("==String Buf 1 == : [" + strbuf + "]==");
if (tennel.equals("1"))
strbuf.append("NO");
else if (tennel.equals("3"))
strbuf.append("NT");
else
return null;
strbuf.append("TT");
strbuf.append("C");
strbuf.append("_");
strbuf.append(cctvID.get(tennel + line));
strbuf.append("_");
strbuf.append(strarr[0]);
strbuf.append("_");
strbuf.append(strarr[1]);
strbuf.append("_");
strbuf.append(strarr[2]); //시퀀스+징수코드
strbuf.append(".jpg");
System.out.println("==String Buf 2 == : [" + strbuf + "]==");
return strbuf.toString();
}
/**
* ANPR (1,3 anpr_img_send 1ftp )(, )
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/callANPRCarNoInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> callANPRCarNoInfo(
@RequestBody Map<String, String> param,
HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
param.put("WORKER", "admin");
if (commRelayServerService.insertAnprRecvLog(param) < 0) {
// 실패
result.setErrorMsg(null, null);
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
param.remove("fareId");
param.remove("boothId");
param.remove("WORKER");
//인터페이스명 : 차량번호 인식 정보 송신
//스마트플랫폼 : /rest/broker/fis/setVhcleNumRecogInfo
//과태료 api : /fis/rest/api/getRealReceiveVhcleParams
String url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_032");
CallWebService callWebService = new CallWebService(url);
Map<String, String> map = callWebService.callWebServicePost(param);
System.out.println("==== " + map.toString());
if (map == null || map.get("result").toString().equals("FAIL") == true) {
// 조회 실패
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
return result.getResult();
}
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다."); // (IoT
// 미전송상태)
} catch (RuntimeException e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} catch (Exception e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} finally {
logger.info(result.getResult().get("resultMessage").toString());
}
return result.getResult();
}
}

@ -1,102 +0,0 @@
package cfs.trsmrcv.web;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.json.simple.JSONObject;
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.common.service.CfsCommonService;
import cfs.common.util.CallWebService;
import cfs.common.util.Result;
import cfs.common.util.ResultSmartPlatform;
import cfs.trsmrcv.dao.TrsmrcvDao;
import cfs.trsmrcv.service.CommCollectServerService;
import cfs.trsmrcv.service.CommRelayServerService;
import cfs.trsmrcv.service.CommSmartPlatformFISService;
@Controller
public class CommHoJController {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource(name = "trsmrcvDao")
private TrsmrcvDao trsmrcvDao;
@Resource(name = "commRelayServerService")
private CommRelayServerService commRelayServerService;
@Resource(name = "cfsCommonService")
private CfsCommonService cfsCommonService;
@Resource(name="commCollectServerService")
private CommCollectServerService commCollectServerService;
@Resource(name="commSmartPlatformFISService")
private CommSmartPlatformFISService commSmartPlatformFISService;
/**
* ANPR (1,3 anpr_img_send ftp )
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/callANPRCarNoInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> callANPRCarNoInfo(
@RequestBody Map<String, String> param,
HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
param.put("WORKER", "admin");
if (commRelayServerService.insertAnprRecvLog(param) < 0) {
// 실패
result.setErrorMsg(null, null);
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
param.remove("fareId");
param.remove("boothId");
param.remove("WORKER");
//인터페이스명 : 차량번호 인식 정보 송신
//스마트플랫폼 : /rest/broker/fis/setVhcleNumRecogInfo
//과태료 api : /fis/rest/api/getRealReceiveVhcleParams
String url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_032");
CallWebService callWebService = new CallWebService(url);
Map<String, String> map = callWebService.callWebServicePost(param);
System.out.println("==== " + map.toString());
if (map == null || map.get("result").toString().equals("FAIL") == true) {
// 조회 실패
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
return result.getResult();
}
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다."); // (IoT
// 미전송상태)
} catch (RuntimeException e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} catch (Exception e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} finally {
logger.info(result.getResult().get("resultMessage").toString());
}
return result.getResult();
}
}

@ -0,0 +1,904 @@
package cfs.trsmrcv.web;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import cfs.common.service.CfsCommonService;
import cfs.common.util.CallWebService;
import cfs.common.util.Result;
import cfs.common.util.ResultSmartPlatform;
import cfs.trsmrcv.service.CommCollectServer2Service;
import cfs.trsmrcv.service.CommCollectServerService;
import cfs.trsmrcv.service.CommRelayServerService;
import cfs.trsmrcv.service.CommSmartPlatformFISService;
@Controller
public class CommHoRegularController {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource(name = "cfsCommonService")
private CfsCommonService cfsCommonService;
@Resource(name="commCollectServerService")
private CommCollectServerService commCollectServerService;
@Resource(name="commCollectServer2Service")
private CommCollectServer2Service commCollectServer2Service;
@Resource(name = "commRelayServerService")
private CommRelayServerService commRelayServerService;
@Resource(name="commSmartPlatformFISService")
private CommSmartPlatformFISService commSmartPlatformFISService;
// 각 마스터 flag 조회
@RequestMapping(value="/cfs/trsmrcv/selectMstFlag.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> selectMstFlag(
@RequestParam String workDt
, @RequestParam String kind
, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
Map<String, Object> mapOrg = new HashMap<String, Object>();
mapOrg.put("workDt", workDt);
mapOrg.put("kind", kind);
List<Map<String, Object>> obj = null;
try {
obj = commCollectServer2Service.selectMstFlag(mapOrg);
switch(Integer.parseInt(kind)) {
case 0: // 면제
return checkExempt(obj.get(0), workDt, result);
case 1: // 감면
return checkScar(obj.get(0), workDt, result);
case 2: // 사전등록
return checkPreregist(obj.get(0), workDt, result);
case 3: // RFID
logger.info("RFID현행화 막음");
default:
result.setMsg(ResultSmartPlatform.RESULT_KEY_DEFAULT, "kind 오류.");
logger.info(result.getResult().get("resultMessage").toString());
}
}catch(RuntimeException e) {
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
} catch (Exception e) {
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
private Map<String, Object> checkExempt(Map<String, Object> map, String workDt, ResultSmartPlatform result) {
Map<String, Object> mapResult = new HashMap<String, Object>();
try {
if(map.get("EXEMPT_SENDTIME").toString().equals(workDt) == true
&& map.get("EXEMPT_FLAG").toString().equals("1") == true) {
mapResult.put("flag", "1");
System.out.println("============= makeExempt 2 : " + mapResult);
} else {
mapResult.put("flag", "0");
System.out.println("============= makeExempt 3 : " + mapResult);
}
} catch(RuntimeException e) {
e.printStackTrace();
logger.info("catch check");
} catch (Exception e) {
e.printStackTrace();
logger.info("catch check");
}
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, mapResult);
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
private Map<String, Object> checkScar(Map<String, Object> map, String workDt, ResultSmartPlatform result) {
Map<String, Object> mapResult = new HashMap<String, Object>();
try {
if(map.get("RED_SENDTIME").toString().equals(workDt) == true
&& map.get("RED_FLAG").toString().equals("1") == true) {
mapResult.put("flag", "1");
} else {
mapResult.put("flag", "0");
}
} catch(RuntimeException e) {
e.printStackTrace();
logger.info("catch check");
} catch (Exception e) {
e.printStackTrace();
logger.info("catch check");
}
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, mapResult);
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
private Map<String, Object> checkPreregist(Map<String, Object> map, String workDt, ResultSmartPlatform result) {
Map<String, Object> mapResult = new HashMap<String, Object>();
try {
if(map.get("PRP_SENDTIME").toString().equals(workDt) == true
&& map.get("PRP_FLAG").toString().equals("1") == true) {
mapResult.put("flag", "1");
} else {
mapResult.put("flag", "0");
}
} catch(RuntimeException e) {
e.printStackTrace();
logger.info("catch check");
} catch (Exception e) {
e.printStackTrace();
logger.info("catch check");
}
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, mapResult);
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
// 마스터 완료 플래그 갱신
@RequestMapping(value="/cfs/trsmrcv/updateMstFlag.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> updateMstFlag(
@RequestParam String workDt
, @RequestParam String kind
, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
Map<String, Object> mapOrg = new HashMap<String, Object>();
mapOrg.put("workDt", workDt);
mapOrg.put("kind", kind);
logger.info("마스터 완료 플래그 갱신: " + kind);
try {
switch(Integer.parseInt(kind)) {
case 0: // 면제
mapOrg.put("EXEMPT_FLAG", "2");
break;
case 1: // 감면
mapOrg.put("RED_FLAG", "2");
break;
case 2: // 사전등록
mapOrg.put("PRP_FLAG", "2");
break;
case 3: // RFID
mapOrg.put("RFID_FLAG", "2");
break;
default:
result.setMsg(ResultSmartPlatform.RESULT_KEY_DEFAULT, "kind 오류.");
logger.info(result.getResult().get("resultMessage").toString());
}
mapOrg.put("UPDATE_YN", "Y");
commCollectServer2Service.updateMstFlag(mapOrg);
commCollectServer2Service.updateBasicData(mapOrg);
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
result.setMsg(ResultSmartPlatform.RESULT_KEY_DEFAULT, "");
}catch(RuntimeException e) {
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
} catch (Exception e) {
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
/**
* ( )
* <pre></pre>
*/
@Transactional
@RequestMapping(value="/cfs/trsmrcv/selectPreRegistCarInfoChangeNeo.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> selectPreRegistCarInfoChangeNeo(
@RequestParam String start_dt
, @RequestParam String end_dt
, @RequestParam String index_start
, @RequestParam String index_end
, @RequestParam String req_seq
, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
logger.info("=== 사전등록결제 변동분 req_seq : " + req_seq);
try {
long start = System.currentTimeMillis(); // 작동 시간 측정용
List<Map<String, Object>> obj = commCollectServerService.selectMstFlag(new HashMap<String, Object>());
if(obj == null || obj.size() == 0) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
result.setMsg(ResultSmartPlatform.RESULT_KEY_DEFAULT, "조회결과가 없습니다.");
return result.getResult();
}
logger.info("==== 사전등록결제정보 변동분 조회 신규 - 2");
logger.info("==== PRP_FLAG : " + obj.get(0).get("PRP_FLAG").toString());
logger.info("==== PRP_SENDTIME : " + obj.get(0).get("PRP_SENDTIME").toString());
logger.info("==== end_dt.substring(0, 8) : " + end_dt.substring(0, 8));
if(!(
obj.get(0).get("PRP_FLAG").toString().equals("2") == true
&& obj.get(0).get("PRP_SENDTIME").toString().equals(end_dt.substring(0, 8)) == true
)
) {
//마스터 작업중이므로 변동분 미처리
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
result.setMsg(ResultSmartPlatform.RESULT_KEY_DEFAULT, "조회결과가 없습니다.");
return result.getResult();
}
//
Map<String,String> mapOrg = new HashMap<String,String>();
mapOrg.put("req_seq", req_seq);
List<Map<String, Object>> newList = commCollectServerService.selectSendPreRegistCarInfo(mapOrg);
if(newList == null || newList.size() == 0) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
result.setMsg(ResultSmartPlatform.RESULT_KEY_DEFAULT, "조회결과가 없습니다.");
return result.getResult();
}
logger.info("==== 사전등록결제정보 변동분 조회 신규 - 6");
String str = "";
StringBuffer strbuf = new StringBuffer();
for(int i = 0; i < newList.size(); i++) {
str = String.format("%010d%s%s%s"
, Integer.parseInt(newList.get(i).get("PRP_INFO_SEQ").toString())
, newList.get(i).get("REGIST_DIV").toString()
, newList.get(i).get("CHG_DATA_KIND").toString()
, newList.get(i).get("CAR_NO_HEX").toString().trim());
strbuf.append(str);
}
long end = System.currentTimeMillis(); // 작동 시간 측정용
double d = end -start;
logger.info("==== 사전등록결제정보 변동분 조회 소요시간 1 :" + d) ;
logger.info("==== 사전등록결제정보 변동분 조회 신규 - 7");
commCollectServerService.updatePreRegistInfoSend(newList);
d = end -start;
logger.info("==== 사전등록결제정보 변동분 조회 소요시간 2 :" + d) ;
d = end -start;
logger.info("==== 사전등록결제정보 변동분 조회 소요시간 3 :" + d) ;
logger.info("==== 사전등록결제정보 변동분 조회 신규 - 8");
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
result.setMsg(ResultSmartPlatform.RESULT_KEY_DEFAULT, strbuf.toString());
}catch(RuntimeException e) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
result.setMsg(ResultSmartPlatform.RESULT_KEY_DEFAULT, "조회결과가 없습니다.");
return result.getResult();
} catch (Exception e) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
result.setMsg(ResultSmartPlatform.RESULT_KEY_DEFAULT, "조회결과가 없습니다.");
return result.getResult();
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
@RequestMapping(value="/cfs/trsmrcv/callGetFileWeb2Was.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> callGetFileWeb2Was (
@RequestParam String workDt,
@RequestParam String kind
, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
logger.info("======== callGetFileWeb2Was.do" );
logger.info("======== kind 0: " + kind);
try {
String command = "";
if(kind.equals("1") == true) {
// 발행사 데이터
command = String.format("sh /gpta/source-app/cfs/relay_jar/run_issue.sh");
shellCmd(command);
} else if(kind.equals("0") == true) {
// RFID 데이터
} else {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR, "kind값 오류");
return result.getResult();
}
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
result.setMsg(ResultSmartPlatform.RESULT_KEY_DEFAULT, "");
}catch(RuntimeException e) {
e.printStackTrace();
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
} catch (Exception e) {
e.printStackTrace();
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
private boolean shellCmd(String cmd) {
Process process = null;
Runtime runtime = Runtime.getRuntime();
StringBuffer successOutput = new StringBuffer();
StringBuffer errorOutput = new StringBuffer();
BufferedReader successBufferReader = null;
BufferedReader errorBufferReader = null;
String msg = null;
boolean result = false;
logger.info("shellCmd - 1");
List<String> cmdList = new ArrayList<String>();
cmdList.add("/bin/sh");
cmdList.add("-c");
cmdList.add(cmd);
String[] array = cmdList.toArray(new String[cmdList.size()]);
try {
process = runtime.exec(array);
successBufferReader = new BufferedReader(new InputStreamReader(process.getInputStream(), "UTF-8"));
while ((msg = successBufferReader.readLine()) != null) {
successOutput.append(msg + System.getProperty("line.separator"));
}
errorBufferReader = new BufferedReader(new InputStreamReader(process.getErrorStream(), "UTF-8"));
while ((msg = errorBufferReader.readLine()) != null) {
errorOutput.append(msg + System.getProperty("line.separator"));
}
process.waitFor();
if (process.exitValue() == 0) {
result = true;
} else {
logger.info("abnormal finish error : " + successOutput.toString());
}
if (errorOutput.toString().length() > 0) {
logger.info("error : " + errorOutput.toString());
}
} catch (IOException e) {
logger.info(e.getMessage());
} catch (InterruptedException e) {
logger.info(e.getMessage());
} finally {
try {
process.destroy();
if (successBufferReader != null) successBufferReader.close();
if (errorBufferReader != null) errorBufferReader.close();
} catch (IOException e1) {
logger.info(e1.getMessage());
}
}
return result;
}
/**
*
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/selectCreateBasicData.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> selectCreateBasicData(@RequestParam String in_id,
@RequestParam String in_fare, @RequestParam String in_booth
, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, Object> mapOrg = new HashMap<String, Object>();
mapOrg.put("in_id", in_id);
mapOrg.put("in_fare", in_fare);
mapOrg.put("in_booth", in_booth);
List<Map<String, Object>> obj = null;
obj = commRelayServerService.selectCreateBasicData(mapOrg);
if (obj != null) {
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, obj);
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 조회가 완료되었습니다.");
}
} catch (RuntimeException e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} catch (Exception e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
/**
*
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/updateBasicData.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> updateBasicData(@RequestParam String fareOfficeId,
@RequestParam String kind, @RequestParam String start_tm, @RequestParam String end_tm
, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, Object> mapOrg = new HashMap<String, Object>();
mapOrg.put("fareOfficeId", fareOfficeId);
mapOrg.put("kind", kind);
mapOrg.put("start_tm", start_tm);
mapOrg.put("end_tm", end_tm);
System.out.println("========== start_tm : " + start_tm);
System.out.println("========== end_tm : " + end_tm);
if (commRelayServerService.updateBasicData(mapOrg) < 0) {
// 실패
result.setErrorMsg(null, null);
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, "");
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 조회가 완료되었습니다.");
} catch (RuntimeException e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} catch (Exception e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
//
/**
*
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/selectWorkerInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> selectWorkerInfo(@RequestParam String in_id, @RequestParam String in_fare,
@RequestParam String in_booth
, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, Object> mapOrg = new HashMap<String, Object>();
mapOrg.put("in_id", in_id);
mapOrg.put("in_fare", in_fare);
mapOrg.put("in_booth", in_booth);
List<Map<String, Object>> obj = null;
obj = commRelayServerService.selectWorkerInfo(mapOrg);
if (obj != null) {
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, obj);
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 조회가 완료되었습니다.");
}
} catch (RuntimeException e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} catch (Exception e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
/**
*
* <pre></pre>
*/
@RequestMapping(value="/cfs/trsmrcv/callPreRegistDayCloseSummary.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> callPreRegistDayCloseSummary(
@RequestParam String insttNo
, @RequestParam String insttCntcJobSe
, @RequestParam String requstDt
, @RequestParam String startClosDt
, @RequestParam String endClosDt
, HttpServletRequest request) throws Exception {
// 로직은 ServiceImplement 로 이동
Map<String, String> param = new HashMap<String, String>();
param.put("insttNo", insttNo);
param.put("insttCntcJobSe", insttCntcJobSe);
param.put("requstDt", requstDt);
param.put("startClosDt", startClosDt);
param.put("endClosDt", endClosDt);
return commCollectServerService.callPreRegistDayCloseSummary(param);
}
/**
*
* <pre></pre>
*/
@RequestMapping(value="/cfs/trsmrcv/callPreRegistDayCloseReturn.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> callPreRegistDayCloseReturn(
@RequestParam String insttNo
, @RequestParam String insttCntcJobSe
, @RequestParam String requstDt
, @RequestParam String startClosDt
, @RequestParam String endClosDt
, HttpServletRequest request) throws Exception {
// 로직은 ServiceImplement 로 이동
Map<String, String> param = new HashMap<String, String>();
param.put("insttNo", insttNo);
param.put("insttCntcJobSe", insttCntcJobSe);
param.put("requstDt", requstDt);
param.put("startClosDt", startClosDt);
param.put("endClosDt", endClosDt);
return commCollectServerService.callPreRegistDayCloseReturn(param);
}
/**
* e
* <pre></pre>
*/
@RequestMapping(value="/cfs/trsmrcv/selectEgreenState.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> selectEgreenState(
@RequestParam(value = "start_dt", required = false, defaultValue = "") String start_dt
, @RequestParam(value = "end_dt", required = false, defaultValue = "") String end_dt
, @RequestParam(value = "rgstNmbr", required = false, defaultValue = "") String rgstNmbr
, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, Object> mapTarg = new HashMap<String, Object>();
if(start_dt.equals("") == true || end_dt.equals("") == true) {
result.setMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, "기간 파라미터 오류.");
System.out.println("=== " + start_dt);
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
mapTarg.put("start_dt", start_dt);
mapTarg.put("end_dt", end_dt);
mapTarg.put("rgstNmbr", null);
if(rgstNmbr.length() > 0) {
String[] arr = rgstNmbr.split(",");
if(arr.length > 0)
mapTarg.put("rgstNmbr", arr);
}
List<Map<String, Object>> objTarg = commCollectServerService.selectEtgreenStateTargert(mapTarg);
if(objTarg == null || objTarg.size() == 0) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.(조회 대상 0)");
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, new HashMap<String, Object>());
return result.getResult();
}
mapTarg.remove("rgstNmbr");
String strConKey = "";
String strCreateState = "";
for(int n = 0; n < objTarg.size() -1 ; n++) {
if(objTarg.get(n).get("RGST_NMBR") != null || objTarg.get(n).get("RGST_NMBR").toString().equals("") == true) {
mapTarg.put("rgstNmbr", objTarg.get(n).get("RGST_NMBR").toString());
List<Map<String, Object>> obj = commCollectServerService.selectEtgreenState(mapTarg);
if(obj == null || obj.size() == 0) {
commCollectServerService.updatePenaltyEgreenState(objTarg.get(n));
commCollectServerService.updatePenaltyEgreenState2(objTarg.get(n));
continue;
}
strConKey = obj.get(0).get("CON_KEY").toString();
if(obj.get(0).get("DATA_CD") == null) {
mapTarg.put("EGREEN_RESULT_ID", "10"); // 점수
}
else {
strCreateState = obj.get(0).get("DATA_CD").toString();
if(strCreateState.equals("20") == false) {
mapTarg.put("EGREEN_RESULT_ID", strCreateState); // 제작 오류...
}
else {
if(obj.get(0).get("DELIVRSLT_CD") == null) { //재발 전...
mapTarg.put("EGREEN_RESULT_ID", strCreateState);
}
else {
mapTarg.put("EGREEN_RESULT_ID", "3" + obj.get(0).get("DELIVRSLT_CD").toString());
}
}
}
mapTarg.put("PENALTY_MANAGE_YEAR", strConKey.substring(0, 4));
mapTarg.put("PENALTY_SEQNO", strConKey.substring(4, 10));
commCollectServerService.updatePenaltyEgreenState(mapTarg);
mapTarg.put("FILE_NAME", objTarg.get(n).get("FILE_NAME").toString());
commCollectServerService.updatePenaltyEgreenState2(mapTarg);
}
} // end for n
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, "");
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
} catch (Exception e) {
e.printStackTrace();
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
/**
* - KT
* <pre></pre>
*/
@SuppressWarnings({ "unchecked" })
@Transactional
@RequestMapping(value="/cfs/trsmrcv/callMobileNotiKTStatus.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> callMobileNotiKTStatus(
@RequestParam String start_dt
, @RequestParam String end_dt
, HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
Map<String, String> param = new HashMap<String, String>();
param.put("start_dt", start_dt);
param.put("end_dt", end_dt);
JSONParser parser = new JSONParser();
try {
String url = "";
List<Map<String, Object>> list = commSmartPlatformFISService.selectKTMoblieNotification(param);
if(list == null || list.size() ==0) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "조회대상이 없습니다.");
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
Map<String, String> mapOrg = new HashMap<String, String>();
String strSrcKey = list.get(0).get("ELC_DOCU_NO").toString();
String penaltyYn = list.get(0).get("PENALTY").toString();
String workerId = list.get(0).get("WORKER_ID").toString();
String fareOfficeId = list.get(0).get("FARE_OFFICE_ID").toString();
String boothId = list.get(0).get("BOOTH_ID").toString();
String year = list.get(0).get("YEAR").toString();
String month = list.get(0).get("MONTH").toString();
String day = list.get(0).get("DAY").toString();
String workTimes = list.get(0).get("WORK_TIMES").toString();
String seqno = list.get(0).get("SEQNO").toString();
for(int i = 1; i < list.size(); i++) {
strSrcKey += ",";
workerId += ",";
fareOfficeId += ",";
boothId += ",";
year += ",";
month += ",";
day += ",";
workTimes += ",";
seqno += ",";
penaltyYn += ",";
strSrcKey += list.get(i).get("ELC_DOCU_NO").toString();
workerId += list.get(i).get("WORKER_ID").toString();
fareOfficeId += list.get(i).get("FARE_OFFICE_ID").toString();
boothId += list.get(i).get("BOOTH_ID").toString();
year += list.get(i).get("YEAR").toString();
month += list.get(i).get("MONTH").toString();
day += list.get(i).get("DAY").toString();
workTimes += list.get(i).get("WORK_TIMES").toString();
seqno += list.get(i).get("SEQNO").toString();
penaltyYn += list.get(i).get("PENALTY").toString();
} // end for i
System.out.println("kt확인 로그1");
mapOrg.put("srcKey", strSrcKey);
mapOrg.put("workerId", workerId);
mapOrg.put("fareOfficeId", fareOfficeId);
mapOrg.put("boothId", boothId);
mapOrg.put("year", year);
mapOrg.put("month", month);
mapOrg.put("day", day);
mapOrg.put("workTimes", workTimes);
mapOrg.put("seqno", seqno);
mapOrg.put("penaltyYn", penaltyYn);
System.out.println("kt확인 로그2");
String secureResult = cfsCommonService.findCommonSecureGet("sysId");
System.out.println("kt확인 로그3");
mapOrg.put("sysId", secureResult);
Date time = new Date();
SimpleDateFormat sdf = new SimpleDateFormat ("yyyyMMddHHmmss");
mapOrg.put("tranDate", sdf.format(time));
mapOrg.put("transId", sdf.format(time));
System.out.println("kt확인 로그4");
url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_009");
CallWebService callWebService = new CallWebService(url);
System.out.println("kt확인 로그5");
System.out.println("==== " + mapOrg.toString());
Map<String, String> map = callWebService.callWebServicePost(mapOrg);
System.out.println("==== KT 전송상태 조회 결과");
System.out.println("==== " + map.toString());
if(map == null || map.get("result").toString().equals("FAIL") == true) {
logger.info("========================== 0");
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "수신 FAIL");
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
// 서비스 결과 확인 후 수정
logger.info("========================== 1");
JSONObject jsonObj = (JSONObject)parser.parse(map.get("data").toString());
List<Map<String, String>> obj = (List<Map<String, String>>)jsonObj.get("resp");
logger.info("========================== obj.size : " + obj.size());
for(int i = 0; i < obj.size(); i++) {
obj.get(i).put("notiType", "2");
obj.get(i).put("WORKER", "admin");
logger.info("========================== srcKey : " + obj.get(i).get("srcKey").toString());
logger.info("========================== ELC_DOCU_NO : " + list.get(i).get("ELC_DOCU_NO").toString());
obj.get(i).put("ELC_DOCU_NO", obj.get(i).get("srcKey").toString());
if(obj.get(i).get("mmsSndgRsltDvcd").toString().equals("40") == false && obj.get(i).get("mmsSndgRsltDvcd").toString().equals("") == false) {
logger.info("========================== 전송 성공 코드 : " + obj.get(i).get("mmsSndgRsltDvcd").toString());
obj.get(i).put("STAT_CD", "10"); // KT 다회선 전송 실패
obj.get(i).put("mobileId", "10"); // KT 전송 실패
//과태료 상태 변경
commSmartPlatformFISService.updateKTMobilePenState(obj.get(i));
//후납 상태 변경
commSmartPlatformFISService.updateKTMobileDelState(obj.get(i));
}
commSmartPlatformFISService.updateKTMobileNotification(obj.get(i));
commSmartPlatformFISService.updateKTMobileNotificationLog(obj.get(i));
}
obj.clear();
obj = null;
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
}catch(RuntimeException e) {
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
e.printStackTrace();
} catch (Exception e) {
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
e.printStackTrace();
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
/**
* ANPR (,,SD) 1jar,3jar = , c = vhcleNum
*
* <pre></pre>
*/
@SuppressWarnings("unchecked")
@RequestMapping(value = "/cfs/trsmrcv/callANPRStatusInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> callANPRStatusInfo(
@RequestBody Map<String, Object> param,
HttpServletRequest request) throws Exception {
ResultSmartPlatform result = new ResultSmartPlatform();
try {
//통합관제센터에 전달
String url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_035");
CallWebService callWebService = new CallWebService(url);
JSONObject paramWeb = new JSONObject();
paramWeb.put("camId", param.get("camId"));
paramWeb.put("colctTime", param.get("colctTime"));
paramWeb.put("camConectSttus", param.get("camConectSttus"));
paramWeb.put("rtuTp", param.get("rtuTp")); //온도
paramWeb.put("bxDoorSttus", param.get("bxDoorSttus")); //함체도어상태
paramWeb.put("camSdCardSttus", param.get("camSdCardSttus")); //SD카메라상태
// {camId=999999999, colctTime=2019061815000000, vhcleNum=0,
// rtuTp=30, bxDoorSttus=0, camSdCardSttus=0}
Map<String, String> mapOrg = new HashMap<String, String>();
mapOrg.put("headerTypCd", "601");
mapOrg.put("trnsmitSysCd", "CFS");
mapOrg.put("mesgTypCd", "M62");
mapOrg.put("data", paramWeb.toString());
Map<String, String> map = callWebService.callWebServicePost(mapOrg);
System.out.println("==== " + map.toString());
if (map == null || map.get("result").toString().equals("FAIL") == true) {
// 조회 실패
result.setMsg(ResultSmartPlatform.STATUS_ERROR, ResultSmartPlatform.STATUS_ERROR_MESSAGE);
return result.getResult();
}
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
} catch (RuntimeException e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} catch (Exception e) {
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} finally {
logger.info(result.getResult().get("resultMessage").toString());
}
return result.getResult();
}
}

@ -1,11 +1,8 @@
package cfs.trsmrcv.web;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -15,8 +12,6 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import cfs.fine.dao.FinePenaltyDao;
import cfs.fine.service.FinePenaltyService;
import cfs.fine.vo.PenaltyParamVO;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
@ -24,20 +19,13 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.ContextLoader;
import com.clipsoft.org.apache.commons.lang.StringUtils;
import com.google.gson.JsonArray;
import cfs.common.service.CfsCommonService;
import cfs.common.util.CallWebService;
import cfs.common.util.HttpUtil;
import cfs.common.util.Result;
import cfs.common.util.ResultSmartPlatform;
import cfs.trsmrcv.dao.TrsmrcvDao;

Loading…
Cancel
Save