init
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.eactive.eai.rms.service.tas;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.eactive.eai.rms.common.interceptor.InterceptorSkipController;
|
||||
|
||||
@Controller
|
||||
public class TasInfoController implements InterceptorSkipController {
|
||||
|
||||
@Autowired
|
||||
private TasInfoService service;
|
||||
|
||||
@RequestMapping("/service/tasInfoService.do")
|
||||
private ModelAndView selectDetail(HttpServletRequest request,
|
||||
HttpServletResponse response, @RequestParam(required = true) String bzwkDstcd) throws Exception {
|
||||
|
||||
HashMap resultMap = service.selectTasInfoWithBizCode(bzwkDstcd);
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView",resultMap);
|
||||
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.eactive.eai.rms.service.tas;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.eactive.eai.rms.common.base.SqlMapClientTemplateDao;
|
||||
|
||||
@Repository("tasInfoDao")
|
||||
public class TasInfoDao extends SqlMapClientTemplateDao {
|
||||
protected final Logger logger = Logger.getLogger(getClass());
|
||||
|
||||
public List selectBizAdapterInfoList(HashMap param) throws Exception {
|
||||
return template.queryForList("TasInfo.selectBizAdapterInfoList", param);
|
||||
}
|
||||
|
||||
public List selectAdapterMessageKeyInfoList(HashMap param) throws Exception {
|
||||
return template.queryForList("TasInfo.selectAdapterMessageKeyInfoList", param);
|
||||
}
|
||||
|
||||
public List selectLayoutInfo(HashMap param) throws Exception {
|
||||
return template.queryForList("TasInfo.selectLayoutInfo", param);
|
||||
}
|
||||
|
||||
public List selectLayoutList(HashMap param) throws Exception {
|
||||
return template.queryForList("TasInfo.selectLayoutList", param);
|
||||
}
|
||||
|
||||
public List selectCallType(HashMap param) throws Exception {
|
||||
return template.queryForList("TasInfo.selectCallType", param);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
package com.eactive.eai.rms.service.tas;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.eactive.eai.rms.common.base.BaseService;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceContextHolder;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
||||
|
||||
@Service("tasInfoService")
|
||||
public class TasInfoService extends BaseService {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("tasInfoDao")
|
||||
private TasInfoDao dao;
|
||||
|
||||
public HashMap selectBizAdapterInfoList(HashMap paramMap) throws Exception {
|
||||
List list = dao.selectBizAdapterInfoList(paramMap);
|
||||
HashMap map = new HashMap();
|
||||
map.put("info", list);
|
||||
return map;
|
||||
}
|
||||
|
||||
public HashMap selectAdapterMessageKeyInfoList(HashMap paramMap) throws Exception {
|
||||
List list = dao.selectAdapterMessageKeyInfoList(paramMap);
|
||||
HashMap map = new HashMap();
|
||||
map.put("info", list);
|
||||
return map;
|
||||
}
|
||||
|
||||
public HashMap selectLayoutInfo(HashMap paramMap) throws Exception {
|
||||
List list = dao.selectLayoutInfo(paramMap);
|
||||
HashMap map = new HashMap();
|
||||
map.put("info", list);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public HashMap selectLayoutList(HashMap paramMap) throws Exception {
|
||||
List list = dao.selectLayoutList(paramMap);
|
||||
HashMap map = new HashMap();
|
||||
map.put("info", list);
|
||||
return map;
|
||||
}
|
||||
|
||||
public HashMap selectCallType(HashMap paramMap) throws Exception {
|
||||
List list = dao.selectCallType(paramMap);
|
||||
HashMap map = new HashMap();
|
||||
map.put("info", list);
|
||||
return map;
|
||||
}
|
||||
|
||||
public HashMap selectTasInfoWithBizCode(String bzwkDstcd) throws Exception {
|
||||
HashMap<String,Object> map = new HashMap<String,Object>();
|
||||
|
||||
HashMap resultMap = new HashMap();
|
||||
|
||||
String error = null;
|
||||
|
||||
do {
|
||||
if(bzwkDstcd == null || bzwkDstcd.length() < 3) {
|
||||
error = "업무코드오류";
|
||||
break;
|
||||
}
|
||||
bzwkDstcd = bzwkDstcd.trim();
|
||||
|
||||
map.put("bzwkDstcd", bzwkDstcd);
|
||||
|
||||
List<DataSourceType> dataTypes = DataSourceTypeManager.getOnlineDataSourceTypes();
|
||||
DataSourceContextHolder.setDataSourceType(dataTypes.get(0));
|
||||
|
||||
ArrayList adapterList = (ArrayList)dao.selectBizAdapterInfoList(map);
|
||||
|
||||
if(adapterList.size() == 0) {
|
||||
error = "어댑터 미등록";
|
||||
break;
|
||||
}
|
||||
HashMap adapterInfo = (HashMap)adapterList.get(0);
|
||||
|
||||
resultMap.put("adapterGroupName", adapterInfo.get("ADPTRBZWKGROUPNAME"));
|
||||
|
||||
resultMap.put("apCodeName", adapterInfo.get("BZWKDSTICNAME"));
|
||||
resultMap.put("apCode", adapterInfo.get("EAIBZWKDSTCD"));
|
||||
|
||||
resultMap.put("orgName", adapterInfo.get("ADPTRBZWKGROUPDESC"));
|
||||
resultMap.put("orgCode", adapterInfo.get("OSIDINSTINO"));
|
||||
|
||||
resultMap.put("adapterName", adapterInfo.get("BZWKDSTNAME"));
|
||||
resultMap.put("adapter", adapterInfo.get("BZWKDSTCD"));
|
||||
|
||||
map.put("adapterBzwkGroupName", adapterInfo.get("ADPTRBZWKGROUPNAME"));
|
||||
|
||||
ArrayList messageKeys = (ArrayList)dao.selectAdapterMessageKeyInfoList(map);
|
||||
|
||||
if(messageKeys.size() == 0) {
|
||||
error = "전문종별 미등록";
|
||||
break;
|
||||
}
|
||||
else {
|
||||
HashMap messageKey = null;
|
||||
if(messageKeys.size() > 0) {
|
||||
messageKey = (HashMap)messageKeys.get(0);
|
||||
resultMap.put("telgmFldOfst", messageKey.get("MSGFLDSTARTSITUVAL"));
|
||||
resultMap.put("telgmFldLen", messageKey.get("MSGFLDLEN"));
|
||||
}
|
||||
if(messageKeys.size() > 1) {
|
||||
messageKey = (HashMap)messageKeys.get(1);
|
||||
resultMap.put("bzwkFldOfst", messageKey.get("MSGFLDSTARTSITUVAL"));
|
||||
resultMap.put("bzwkFldLen", messageKey.get("MSGFLDLEN"));
|
||||
}
|
||||
}
|
||||
|
||||
int offset = 0;
|
||||
int len = 0;
|
||||
HashMap layoutItem = null;
|
||||
// 취급
|
||||
map.put("eaiSvcName", bzwkDstcd+"%02");
|
||||
ArrayList layoutInfos1 = (ArrayList)dao.selectLayoutInfo(map);
|
||||
if(layoutInfos1.size() == 0) {
|
||||
error = "취급 서비스 미등록";
|
||||
break;
|
||||
}
|
||||
HashMap layoutInfo1 = (HashMap)layoutInfos1.get(0);
|
||||
|
||||
String bzwkFldName1 = (String)layoutInfo1.get("BZWKFLDNAME");
|
||||
|
||||
// resultMap.put("C_LAYOUT", layoutInfo1.get("LOUTNAME"));
|
||||
// resultMap.put("C_BZWKFLDNAME", bzwkFldName1);
|
||||
|
||||
|
||||
String[] colNames = bzwkFldName1.split("\\.");
|
||||
String colName = colNames[colNames.length-1];
|
||||
|
||||
map.put("loutName", layoutInfo1.get("LOUTNAME"));
|
||||
|
||||
ArrayList layoutList1 = (ArrayList)dao.selectLayoutList(map);
|
||||
|
||||
offset = 0;
|
||||
for(int i=0; i< layoutList1.size(); i++) {
|
||||
layoutItem = (HashMap)layoutList1.get(i);
|
||||
if(colName.equals(layoutItem.get("LOUTITEMNAME"))) {
|
||||
len = (int)layoutItem.get("LOUTITEMLENCNT");
|
||||
break;
|
||||
}
|
||||
offset = offset + (int)layoutItem.get("LOUTITEMLENCNT");
|
||||
}
|
||||
resultMap.put("resSerNoFldOfst", offset);
|
||||
resultMap.put("resSerNoFldLen", len);
|
||||
|
||||
// 개설
|
||||
map.put("eaiSvcName", bzwkDstcd+"%01");
|
||||
ArrayList layoutInfos2 = (ArrayList)dao.selectLayoutInfo(map);
|
||||
|
||||
if(layoutInfos2.size() == 0) {
|
||||
error = "개설 서비스 미등록";
|
||||
break;
|
||||
}
|
||||
HashMap layoutInfo2 = (HashMap)layoutInfos2.get(0);
|
||||
|
||||
String bzwkFldName2 = (String)layoutInfo2.get("BZWKFLDNAME");
|
||||
|
||||
// resultMap.put("G_LAYOUT", layoutInfo2.get("LOUTNAME"));
|
||||
// resultMap.put("G_BZWKFLDNAME", bzwkFldName2);
|
||||
|
||||
String[] colNames2 = bzwkFldName2.split("\\.");
|
||||
String colName2 = colNames2[colNames2.length-1];
|
||||
|
||||
map.put("loutName", layoutInfo2.get("LOUTNAME"));
|
||||
|
||||
ArrayList layoutList2 = (ArrayList)dao.selectLayoutList(map);
|
||||
|
||||
offset = 0;
|
||||
|
||||
for(int i=0; i< layoutList2.size(); i++) {
|
||||
layoutItem = (HashMap)layoutList2.get(i);
|
||||
if(colName2.equals(layoutItem.get("LOUTITEMNAME"))) {
|
||||
len = (int)layoutItem.get("LOUTITEMLENCNT");
|
||||
break;
|
||||
}
|
||||
offset = offset + (int)layoutItem.get("LOUTITEMLENCNT");
|
||||
}
|
||||
resultMap.put("reqSerNoFldOfst", offset);
|
||||
resultMap.put("reqSerNoFldLen", len);
|
||||
|
||||
|
||||
// syncFlag
|
||||
ArrayList callList = (ArrayList)dao.selectCallType(map);
|
||||
|
||||
String callType = "1";
|
||||
HashMap callTypeMap = (HashMap)callList.get(0);
|
||||
if("ASYN".equals(callTypeMap.get("RESPONSETYPE"))) {
|
||||
callType = "2";
|
||||
}
|
||||
resultMap.put("syncFlag", callType);
|
||||
|
||||
} while(false);
|
||||
|
||||
if(error != null) resultMap.put("ERROR", error);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user