CommUnknownController 삭제

main
이범준 5 months ago
parent 2dcbdb5801
commit bfdadcc513

@ -1,755 +0,0 @@
package cfs.trsmrcv.web;
import java.awt.image.BufferedImage;
import java.io.File;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
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.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.dao.CommSmartPlatformPRPDao;
import cfs.trsmrcv.dao.TrsmrcvDao;
import cfs.trsmrcv.service.CommCollectServerService;
import cfs.trsmrcv.service.CommRelayServerService;
@Controller
public class CommUnknownController {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource(name="trsmrcvDao")
private TrsmrcvDao trsmrcvDao;
@Resource(name="commCollectServerService")
private CommCollectServerService commCollectServerService;
@Resource(name = "commRelayServerService")
private CommRelayServerService commRelayServerService;
@Resource(name="cfsCommonService")
private CfsCommonService cfsCommonService;
@Resource(name = "commSmartPlatformPRPDao")
private CommSmartPlatformPRPDao commSmartPlatformPRPDao;
/**
*
* <pre></pre>
*/
@RequestMapping(value="/cfs/trsmrcv/insertServerStautsOne.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> insertServerStautsOne(
@RequestParam String sysTyCode
, @RequestParam String sysSttuscode
, HttpServletRequest request) throws Exception {
Map<String,String> susinInfo = TrsmrcvUtil.getInfoMapForConnSusinLog(request);
trsmrcvDao.insertConnSusinLog(susinInfo);
ResultSmartPlatform result = new ResultSmartPlatform();
try {
// 파라미터 없는 경우.....
Map<String, String> mapOrg = new HashMap<String, String>();
mapOrg.put("sysTyCode", sysTyCode);
mapOrg.put("sysSttuscode", sysSttuscode);
if(commCollectServerService.insertServerStauts(mapOrg) < 0) {
// 실패
result.setErrorMsg(null, null);
}
else {
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, "");
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
}
}catch(RuntimeException e) {
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
} catch (Exception e) {
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
}
finally {
logger.info(result.getResult().get("resultMessage").toString());
}
return result.getResult();
}
/**
*
* <pre></pre>
*/
@RequestMapping(value="/cfs/trsmrcv/callMobileNotificationList.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> callMobileNotificationList(@RequestBody Map<String, String> param, HttpServletRequest request) throws Exception {
Map<String,String> susinInfo = TrsmrcvUtil.getInfoMapForConnSusinLog(request);
trsmrcvDao.insertConnSusinLog(susinInfo);
ResultSmartPlatform result = new ResultSmartPlatform();
List<Map<String, Object>> obj = null;
try {
obj = commCollectServerService.selectMobileNotification(param);
if(obj != null && obj.size() == 0) {
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "전송 대상이 없습니다.");
}
// 사전통지 요청 - 파라미터 임시...
Map<String, String> mapOrg = new HashMap<String, String>();
// 모바일 고지 웹서비스 요청
String strMsg = "";
String url = "";
String secureResult = cfsCommonService.findCommonSecureGet("sysId");
// 카카오 인증 검증
for(int i=0; i< obj.size(); i++){
mapOrg.put("sysId", secureResult);
mapOrg.put("tranDate", obj.get(i).get("NEXT_SEND_DATES").toString());
mapOrg.put("transId", obj.get(i).get("MOB_NOTI_SEQ").toString());
mapOrg.put("sci", obj.get(i).get("CAR_OWNER_CI").toString());
StringBuffer strbuf = new StringBuffer();
if(obj.get(i).get("NOTI_TYPE").toString().equals("0") == true) { // 카카오
//
url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_006");
//
strbuf.append(String.format("%s 이용자님\n", obj.get(i).get("CAR_NO").toString()));
strMsg = obj.get(i).get("PASS_DATE").toString();
strbuf.append(String.format("%s.%s.%s %s:%s\n"
, strMsg.substring(0, 4)
, strMsg.substring(4, 6)
, strMsg.substring(6, 8)
, strMsg.substring(8, 10)
, strMsg.substring(10, 12)
));
strbuf.append(String.format("남산%s호터널 %s차로 이용.\n"
, obj.get(i).get("FARE_OFFICE_ID").toString()
, obj.get(i).get("BOOTH_ID").toString()
));
strbuf.append(String.format("혼잡통행료 미납금 %,d원이 발생했습니다.\n"
, Integer.parseInt(obj.get(i).get("PASS_AMOUNT").toString())
));
strMsg = obj.get(i).get("DELIVERY_DTDM").toString();
strbuf.append(String.format("납부기한(%s.%s.%s)이 자나면 과태료가 부과됩니다.\n"
, strMsg.substring(0, 4)
, strMsg.substring(4, 6)
, strMsg.substring(6, 8)
));
strbuf.append("기한내에 납부해 주세요");
//
obj.get(i).put("NOTI_TYPE", "1");
obj.get(i).put("STAT_CD", "1");
}
else { // KT
//
url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_007");
obj.get(i).put("NOTI_TYPE", "2");
obj.get(i).put("STAT_CD", "3");
}
mapOrg.put("title", "남산터널 미납이용료 청구 안내"); // 임시
mapOrg.put("messageType", "");
mapOrg.put("message", strbuf.toString());
CallWebService callWebService = new CallWebService(url);
Map<String, String> map = callWebService.callWebServicePost(mapOrg);
System.out.println("==== " + map.toString());
if(map == null || map.get("result").toString().equals("FAIL") == true) {
// 조회 실패
result.setErrorMsg(null, null);
}
else {
JSONParser parser = new JSONParser();
// 확인여부
JSONObject jsonParam = (JSONObject)parser.parse(map.get("data").toString());
obj.get(i).put("ELC_DOCU_NO", jsonParam.get("txId")); // 전자서명원문접수번호
if(jsonParam.get("status").toString().equals("Y") == true) {
param.put("STAT_CD", obj.get(i).get("STAT_CD").toString()); // 1, 3 : 성공
}
}
// 모바일고지내역 저장
obj.get(i).put("EXT_NOTI", strbuf.toString());
obj.get(i).put("WORKER", "admin");
if(commCollectServerService.updateMobileNotification(obj.get(i)) < 0) {
// 실패
result.setErrorMsg(null, null);
}
// 모바일고지이력 저장
if(commCollectServerService.insertMobileNotificationLog(obj.get(i)) < 0) {
// 실패
result.setErrorMsg(null, null);
}
param.remove("notiType");
param.remove("WORKER");
callWebService = null;
} // end for i
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, param);
}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>
*/
@RequestMapping(value="/cfs/trsmrcv/callMobileNotiResult.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> callMobileNotiResult(
@RequestParam String start_dt
, @RequestParam String end_dt
, HttpServletRequest request) throws Exception {
Map<String,String> susinInfo = TrsmrcvUtil.getInfoMapForConnSusinLog(request);
trsmrcvDao.insertConnSusinLog(susinInfo);
ResultSmartPlatform result = new ResultSmartPlatform();
Map<String, Object> param = new HashMap<String, Object>();
param.put("start_dt", start_dt);
param.put("end_dt", end_dt);
List<Map<String, Object>> obj = null;
try {
String url = "";
obj = commCollectServerService.selectNoMobileNoti(param);
JSONParser parser = new JSONParser();
String secureResult = cfsCommonService.findCommonSecureGet("sysId");
Map<String, String> mapOrg = new HashMap<String, String>();
mapOrg.put("sysId", secureResult);
Date time = new Date();
SimpleDateFormat sdf = new SimpleDateFormat ("yyyyMMddHHmmss");
mapOrg.put("tranDate", sdf.format(time));
for(int i = 0; i < obj.size(); i++) {
mapOrg.put("transId", obj.get(i).get("TRANS_ID").toString() );
if(obj.get(i).get("NOTI_TYPE").toString().equals("0") == true) {
// 카카오 상태 확인 요청 웹서비스 호출
url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_008");
mapOrg.put("txId", obj.get(i).get("ELC_DOCU_NO").toString() );
mapOrg.put("envelopeId", obj.get(i).get("ELC_DOCU_NO").toString() );
}
else if(obj.get(i).get("NOTI_TYPE").toString().equals("1") == true) {
url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_009");
mapOrg.put("srcKey", obj.get(i).get("ELC_DOCU_NO").toString() );
}
else {
// 실패
continue;
}
CallWebService callWebService = new CallWebService(url);
Map<String, String> map = callWebService.callWebServicePost(mapOrg);
System.out.println("==== " + map.toString());
if(map == null || map.get("result").toString().equals("FAIL") == true) {
logger.info("========================== 0");
result.setErrorMsg(null, null);
logger.info(result.getResult().get("resultMessage").toString());
continue;
}
logger.info("========================== 1");
JSONObject jsonObj = (JSONObject)parser.parse(map.get("data").toString());
obj.get(i).put("STAT_CD", jsonObj.get("status"));
// 모바일고지내역 저장
obj.get(i).put("WORKER", "admin");
if(commCollectServerService.updateMobileNotification(obj.get(i)) < 0) {
// 실패
logger.info("========================== 2");
result.setErrorMsg(null, null);
}
logger.info("========================== 32");
// 모바일고지이력 저장
if(commCollectServerService.insertMobileNotificationLog(obj.get(i)) < 0) {
// 실패
logger.info("========================== 3");
result.setErrorMsg(null, null);
}
logger.info("========================== 4");
} // end for i
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, param);
}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();
}
/**
* eTax Insert
* <pre></pre>
*/
@SuppressWarnings("unchecked")
@RequestMapping(value="/cfs/trsmrcv/insertEtax.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> insertEtax(@RequestBody Map<String, Object> paramList, HttpServletRequest request) throws Exception {
Map<String,String> susinInfo = TrsmrcvUtil.getInfoMapForConnSusinLog(request);
trsmrcvDao.insertConnSusinLog(susinInfo);
ResultSmartPlatform result = new ResultSmartPlatform();
List<Map<String, String>> list = (List<Map<String, String>>)paramList.get("data");
int nTotalAmount = 0;
try {
Map<String, String> param = null;
for(int index = 0; index < list.size(); index++) {
param = list.get(index);
nTotalAmount += Integer.parseInt(param.get("SUM_AMT"));
// eTax뱅킹 명세 등록
if(commCollectServerService.insertEtaxDetail(param) < 0) {
result.setErrorMsg(null, null);
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
}
if(param != null) {
param.put("RCP_REQ_CN", String.format("%d", list.size()));
param.put("RCP_REQ_AM", String.format("%d", nTotalAmount));
param.put("USER_ID", "user");
param.put("TMS_CSVT_NM", "근무자");
param.put("TMS_CSVT_CTCAD", "02-1234-1234");
// eTax뱅킹 명세 등록
if(commCollectServerService.insertEtaxSummary(param) < 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(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>
*/
@RequestMapping(value="/cfs/trsmrcv/uploadImage.do", method=RequestMethod.POST)
public @ResponseBody Map<String, Object> uploadImage(@RequestBody List<Map<String, Object>> paramList, HttpServletRequest request) throws Exception {
Map<String,String> susinInfo = TrsmrcvUtil.getInfoMapForConnSusinLog(request);
trsmrcvDao.insertConnSusinLog(susinInfo);
ResultSmartPlatform result = new ResultSmartPlatform();
try {
for(Map<String, Object> param : paramList){
String saveFileName = param.get("saveFileName").toString();
String format = param.get("format").toString();
String imageUrl = param.get("imageUrl").toString();
File saveFile = new File(saveFileName);
URL url = null;
BufferedImage bi = null;
url = new URL(imageUrl); // 다운로드 할 이미지 URL
bi = ImageIO.read(url);
ImageIO.write(bi, format, saveFile); // 저장할 파일 형식, 저장할 파일명
}
} catch (Exception e) {
e.printStackTrace();
}
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
/**
*
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/callCoilectServerStatusInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> callCoilectServerStatusInfo(@RequestBody Map<String, Object> param,
HttpServletRequest request) throws Exception {
Map<String,String> susinInfo = TrsmrcvUtil.getInfoMapForConnSusinLog(request);
trsmrcvDao.insertConnSusinLog(susinInfo);
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, Object> mapOrg = param;
if (commRelayServerService.updateCollectServerStatus(mapOrg) < 0) {
// 실패
result.setErrorMsg(null, null);
} else {
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);
} finally {
logger.info(result.getResult().get("resultMessage").toString());
}
return result.getResult();
}
/**
*
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/selectBoothCodeInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> selectBoothCodeInfo(@RequestBody Map<String, Object> param,
HttpServletRequest request) throws Exception {
Map<String,String> susinInfo = TrsmrcvUtil.getInfoMapForConnSusinLog(request);
trsmrcvDao.insertConnSusinLog(susinInfo);
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, Object> mapOrg = param;
List<Map<String, Object>> obj = null;
obj = commRelayServerService.selectBoothCodeInfo(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/selectFareInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> selectFareInfo(@RequestBody Map<String, Object> param,
HttpServletRequest request) throws Exception {
Map<String,String> susinInfo = TrsmrcvUtil.getInfoMapForConnSusinLog(request);
trsmrcvDao.insertConnSusinLog(susinInfo);
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, Object> mapOrg = param;
List<Map<String, Object>> obj = null;
obj = commRelayServerService.selectFareInfo(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/selectIssueOfficeCodeInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> selectIssueOfficeCodeInfo(@RequestBody Map<String, Object> param,
HttpServletRequest request) throws Exception {
Map<String,String> susinInfo = TrsmrcvUtil.getInfoMapForConnSusinLog(request);
trsmrcvDao.insertConnSusinLog(susinInfo);
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, Object> mapOrg = param;
List<Map<String, Object>> obj = null;
obj = commRelayServerService.selectIssueOfficeCodeInfo(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/selectPreRegistCarCode.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> selectPreRegistCarCode(@RequestBody Map<String, Object> param,
HttpServletRequest request) throws Exception {
Map<String,String> susinInfo = TrsmrcvUtil.getInfoMapForConnSusinLog(request);
trsmrcvDao.insertConnSusinLog(susinInfo);
ResultSmartPlatform result = new ResultSmartPlatform();
try {
Map<String, Object> mapOrg = param;
List<Map<String, Object>> obj = null;
obj = commRelayServerService.selectPreRegistCarCode(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/saveNightThroughInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> saveNightThroughInfo(@RequestParam String in_fare,
@RequestParam String in_booth, @RequestParam String in_date, @RequestParam String in_time,
@RequestParam String in_count
, HttpServletRequest request) throws Exception {
Map<String,String> susinInfo = TrsmrcvUtil.getInfoMapForConnSusinLog(request);
trsmrcvDao.insertConnSusinLog(susinInfo);
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("in_time", in_time);
mapOrg.put("in_count", in_count);
mapOrg.put("out_ret", -1);
commRelayServerService.callSP_NIGHT_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, "중복 데이터 추가 오류가 발생했습니다.2");
} 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/selectTable.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> selectTable(@RequestParam String in_sql_select,
@RequestParam String in_start, @RequestParam String in_end
, HttpServletRequest request) throws Exception {
Map<String,String> susinInfo = TrsmrcvUtil.getInfoMapForConnSusinLog(request);
trsmrcvDao.insertConnSusinLog(susinInfo);
ResultSmartPlatform result = new ResultSmartPlatform();
try {
List<Map<String, Object>> list = null;
Map<String, Object> mapOrg = new HashMap<String, Object>();
mapOrg.put("in_sql_select", in_sql_select);
mapOrg.put("in_start", in_start);
mapOrg.put("in_end", in_end);
list = commRelayServerService.selectTable(mapOrg);
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, list);
} catch (RuntimeException e) {
e.printStackTrace();
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} catch (Exception e) {
e.printStackTrace();
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
}
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
/**
* ANPR
*
* <pre></pre>
*/
@RequestMapping(value = "/cfs/trsmrcv/callANPRSendInfo.do", method = RequestMethod.POST)
public @ResponseBody Map<String, Object> callANPRSendInfo(@RequestBody Map<String, String> param, HttpServletRequest request) throws Exception {
Map<String,String> susinInfo = TrsmrcvUtil.getInfoMapForConnSusinLog(request);
trsmrcvDao.insertConnSusinLog(susinInfo);
ResultSmartPlatform result = new ResultSmartPlatform();
try {
//ANPR로그 조회 기반으로 데이터 전송
List<Map<String, Object>> list = commRelayServerService.selectAnprRecvLog(param);
logger.info("list.size()" + list.size());
//조회 실패
if (list.size() == 0 || list == null) {
// 실패
result.setErrorMsg(null, null);
logger.info(result.getResult().get("resultMessage").toString());
return result.getResult();
}
for(Map<String, Object> data : list){
Map<String, String> getData = new HashMap<String, String>();
getData.put("allImagePath", data.get("ALL_IMAGE_PATH").toString());
getData.put("vhcleImagePath", data.get("VHCLE_IMAGE_PATH").toString());
getData.put("vhcleColor", data.get("VHCLE_COLOR").toString());
getData.put("recogCnfdncRate", data.get("RECOG_CNFDNC_RATE").toString());
getData.put("nopltImagePath", data.get("NOPLT_IMAGE_PATH").toString());
getData.put("pasageTime", data.get("PASAGE_TIME").toString());
getData.put("vhcleDrc", data.get("VHCLE_DRC").toString());
getData.put("tfclneInfo", data.get("TFCLNE_INFO").toString());
getData.put("camId", data.get("CAM_ID").toString());
getData.put("vhcleKnd", data.get("VHCLE_KND").toString());
getData.put("recogReqreTime", data.get("RECOG_REQRE_TIME").toString());
getData.put("regltTrgetSe", data.get("REGLT_TRGET_SE").toString());
getData.put("inputKnd", data.get("INPUT_KND").toString());
getData.put("vhcleNum", data.get("VHCLE_NUM").toString());
String url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_032");
CallWebService callWebService = new CallWebService(url);
Map<String, String> map = callWebService.callWebServicePost(getData);
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) {
e.printStackTrace();
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} catch (Exception e) {
e.printStackTrace();
result.setErrorMsg(ResultSmartPlatform.STATUS_ERROR_DEFAULT_DETAIL_CODE, null);
} finally {
logger.info(result.getResult().get("resultMessage").toString());
}
return result.getResult();
}
}
Loading…
Cancel
Save