1.请求消息
参数名称 | 中文名称 | 类型 | 是否可空 | 备注 | EOMS对应字段 |
CUST_CODE | 客服流水号 | String | 非空 |
| 客服流水号 |
2。响应消息
参数名称 | 中文名称 | 类型 | 是否可空 | 备注 |
RETURN_CODE | 返回代码 | String | 非空 | 0:成功 非0:失败 |
CODE_DESC | 接口描述 | String | 非空 | 成功 失败。XXXX失败原因 |
OPDETAIL | 详细信息 | String |
| 参见“详细信息约定” |
3.OPDETAIL数据说明
参数名称 | 中文名称 | 类型 | 是否可空 | 备注 | EOMS对应 字段 |
SERIAL NO | 工单流水号 | String |
| 工单流水号 | 工单流水号 |
SERIALNO_KF | 客服流水号 | String |
| 客服流水号 | EOMS页面未呈现,但数据库有 |
CITY | 地市 | String |
| 所属地市 | 所属地市 |
COUNTRY | 区县 | String |
| 所属区县 | 所属区县 |
OPER_TIME | 投诉时间 | String |
| 派单时间 | 工单基本信息中操作时间 |
TIME_LIMIT | 处理时限 | String |
| 故障处理时限 | 处理时限 |
SLA | 集客服务级别 | String |
| 服务级别(SLA) | 集团客户服务级别(SLA等级) |
PROD_TYPE | 业务类型 | String |
| 业务类型 | 工单业务类型 |
FAULT_CONTENT | 投诉内容 | String |
| 投诉内容 | 投诉内容 |
OPERATOR | 处理人 | String |
| 故障处理人,处理环节未到处理完成阶段 ,处理人为空 | 处理完成节点操作人 |
PHONE | 处理人联系方式 | String |
| 故障处理人,处理环节未到处理完成阶段 ,处理人联系方式为空 | 处理完成节点操作人联系方式 |
REC_TIME | 处理环节 | String |
| 当前环节 | 工单当前所处环节 |
ORDER_STATUS | 任务状态 | String |
| 是否接单 | T1未接单 T1已接单 T2未接单 T2已接单 |
4.数据采集逻辑 :当前时间往前7天的工单
5.接口
package com.boco.eoms.sheet.groupcomplaint.service;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import com.boco.eoms.base.util.ApplicationContextHolder;
import com.boco.eoms.base.util.StaticMethod;
import com.boco.eoms.commons.loging.BocoLog;
import com.boco.eoms.commons.statistic.base.util.ExcelConverterUtil;
import com.boco.eoms.commons.util.xml.XmlManage;
import com.boco.eoms.crm.bo.CrmLoader;
import com.boco.eoms.sheet.base.service.IDownLoadSheetAccessoriesService;
import com.boco.eoms.sheet.interfaceBase.util.InterfaceUtilProperties;
/**
*
*
* 投诉工单信息查询接口
*/
public class FindGroupComplaintService {
public String isAlive(){
System.out.println("握手信息");
String isAliveResult = "0";
return isAliveResult;
}
/**
* 构建数据
* @param serSupplier
* @param serCaller
* @param callerPwd
* @param callTime
* @param opDetail
* @return
*/
public Map getDataMap(String serSupplier,String serCaller,String callerPwd,String callTime,String opDetail){
Map map = new HashMap();
map.put("serSupplier", serSupplier);
map.put("serCaller",serCaller);
map.put("callerPwd", callerPwd);
map.put("callTime", callTime);
map.put("opDetail", opDetail);
return map;
}
public String findInfo(String serSupplier,String serCaller,String callerPwd,String callTime,String CUST_CODE)
throws Exception{
BocoLog.info(this, "******调用工单接口开始--gxl************");
BocoLog.info(this, "parentCorrelation=="+CUST_CODE);
BocoLog.info(this, "serSupplier=="+serSupplier);
BocoLog.info(this, "serCaller=="+serCaller);
BocoLog.info(this, "callerPwd=="+callerPwd);
BocoLog.info(this, "callTime=="+callTime);
StringBuffer opDetail = new StringBuffer();
//String head = "<?xml version=\"1.0\" encoding=\"gbk\"?>";
//opDetail.append(head);
String begin = "<opDetail>";
String end = "</opDetail>";
//opDetail.append(begin);
HashMap sheetMap = new HashMap();
sheetMap.put("parentCorrelation", CUST_CODE);
sheetMap.put("serSupplier", serSupplier);
sheetMap.put("serCaller", serCaller);
sheetMap.put("callerPwd", callerPwd);
if (callTime == null || "".equals(callTime)) {
Date curTime = new Date();
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
callTime = df.format(curTime);
}
sheetMap.put("callTime", callTime);
String filePath = StaticMethod.getFilePathForUrl("classpath:config/findGroupComplaintService.xml");
System.out.println(filePath);
InterfaceUtilProperties properties = new InterfaceUtilProperties();
boolean checkResult = this.checkMapData(sheetMap);
if(checkResult) {
String parentCorrelation = StaticMethod.nullObject2String(sheetMap.get("parentCorrelation"));
IDownLoadSheetAccessoriesService sqlMgr =
(IDownLoadSheetAccessoriesService) ApplicationContextHolder.getInstance().getBean("IDownLoadSheetAccessoriesService");
String findSql = StaticMethod.nullObject2String(XmlManage.getFile("/config/findGroupComplaintService.xml").getProperty("findSql"));
findSql = ExcelConverterUtil.replaceAll(findSql, "@parentCorrelation@", parentCorrelation);
List findList = sqlMgr.getSheetAccessoriesList(findSql);
if(findList !=null && findList.size() >0){
Map toFindkMap = null;
for(int i=0;i<findList.size();i++){
Map findkMap = (Map) findList.get(i);
String mainId = (String)findkMap.get("Id");
String sql = StaticMethod.nullObject2String(XmlManage.getFile("/config/findGroupComplaintService.xml").getProperty("sql"));
sql = ExcelConverterUtil.replaceAll(sql, "@mainId@", mainId);
List mainList = sqlMgr.getSheetAccessoriesList(sql);
if(mainList.size() >0){
toFindkMap = (Map) mainList.get(0);
String result = properties.getXmlFromMap(toFindkMap, filePath,"findInfo");
result = result.replaceAll(begin, "");
result = result.replaceAll(end, "");
opDetail.append(result);
}else{
String result1 = "";
opDetail.append(result1);
return getResult("failed", "未找到相应工单", opDetail.toString());
}
}
//opDetail.append(end);
//BocoLog.info(this, "opDetail.toString()=="+opDetail.toString());
return getResult("0", "成功", opDetail.toString());
}
//opDetail.append(end);
//BocoLog.info(this, "未找CUST_CODE到相应工单==="+ CUST_CODE);
//BocoLog.info(this, "opDetail.toString()=="+opDetail.toString());
return getResult("failed", "未找到相应工单", opDetail.toString());
}
//opDetail.append(end);
//BocoLog.info(this, "opDetail.toString()=="+opDetail.toString());
return getResult("failed", "接口参数不能为空", opDetail.toString());
}
/**
* 检查接口传来的字段值
* @param map
* @return
*/
private boolean checkMapData(Map map) {
Iterator it = map.entrySet().iterator();
while (it.hasNext()) {
Map.Entry entry = (Map.Entry)it.next();
Object key = entry.getKey();
Object val = entry.getValue();
if("".equals(val)){
BocoLog.info(this, "字段:==="+key+"===对应值=="+val+":::接口所传值都是必填");
return false;
}
}
return true;
}
private String getResult(String success, String mes, String opDetail)
{
List chNameList = new ArrayList();
List enNameList = new ArrayList();
List contentList = new ArrayList();
if ("0".equals(success)) {
chNameList.add("返回代码");
enNameList.add("RETURN_CODE");
contentList.add("0");
chNameList.add("接口描述");
enNameList.add("CODE_DESC");
contentList.add("成功:" + mes);
} else {
chNameList.add("返回代码");
enNameList.add("RETURN_CODE");
contentList.add("1");
chNameList.add("接口描述");
enNameList.add("CODE_DESC");
contentList.add("失败:" + mes);
}
String head = "<?xml version=\"1.0\" encoding=\"gbk\"?>";
String begin = "<opDetail>";
String end = "</opDetail>";
String value = CrmLoader.createOpDetailXml(chNameList, enNameList, contentList);
value = value.replaceAll(begin, "");
value = value.replaceAll(end, "");
StringBuffer result = new StringBuffer();
result.append(head);
result.append(begin);
result.append(value);
result.append(opDetail);
result.append(end);
return result.toString();
}
}
6.sql配置文件
<?xml version="1.0" encoding="GB2312"?>
<boco>
<findSheet>
<content columnName="parentCorrelation" interfaceEnName="CUST_CODE" interfaceCnName="客服流水号" defauleValue="" />
</findSheet>
<findInfo>
<!-- <content columnName="" interfaceEnName="RETURN_CODE" interfaceCnName="返回代码" defauleValue="0" />
<content columnName="" interfaceEnName="CODE_DESC" interfaceCnName="接口描述" defauleValue="成功" />
-->
<content columnName="sheetId" interfaceEnName="SERIAL NO" interfaceCnName="工单流水号" defauleValue="" />
<content columnName="parentCorrelation" interfaceEnName="SERIALNO_KF" interfaceCnName="客服流水号" defauleValue="" />
<content columnName="cityName" interfaceEnName="CITY" interfaceCnName="地市" defauleValue="" />
<content columnName="countyName" interfaceEnName="COUNTRY" interfaceCnName="区县" defauleValue="" />
<content columnName="sendTime" interfaceEnName="OPER_TIME" interfaceCnName="投诉时间" defauleValue="" />
<content columnName="dealTime2" interfaceEnName="TIME_LIMIT" interfaceCnName="处理时限" defauleValue="" />
<content columnName="customLevel" interfaceEnName="SLA" interfaceCnName="集客服务级别" defauleValue="" />
<content columnName="bservType" interfaceEnName="PROD_TYPE" interfaceCnName="业务类型" defauleValue="" />
<content columnName="complaintDesc" interfaceEnName="FAULT_CONTENT" interfaceCnName="投诉内容" defauleValue="" />
<content columnName="operateUserName" interfaceEnName="OPERATOR" interfaceCnName="处理人" defauleValue="" />
<content columnName="operaterContact" interfaceEnName="PHONE" interfaceCnName="处理人联系方式" defauleValue="" />
<content columnName="taskDisPlayName" interfaceEnName="REC_TIME" interfaceCnName="处理环节" defauleValue="" />
<content columnName="taskStatus" interfaceEnName="ORDER_STATUS" interfaceCnName="任务状态" defauleValue="" />
</findInfo>
<base>
<url>http://localhost:9080/eoms35/services/FindGroupComplaintService?wsdl</url>
<serSupplier></serSupplier> <!--服务提供方-->
<serCaller></serCaller> <!--服务调用方-->
<callerPwd></callerPwd> <!--口令-->
</base>
<!-- 通过传入的集团客户编码获取工单id -->
<findSql>
select m.id as Id from groupcomplaint_main m where m.sendTime > sysdate - 30 and m.parentCorrelation='@parentCorrelation@' order by m.sendTime desc
</findSql>
<!-- 通过工单id获取相应信息 -->
<sql>
select main.sheetId,
main.parentCorrelation,
main.cityName,
main.countyName,
main.sendTime,
main.dealTime2,
F_GET_DICTNAME(main.customLevel) as customLevel,
F_GET_DICTNAME(main.bservType) as bservType,
main.complaintDesc,
USERID2NAME(link.operateUserId) as operateUserName,
link.operaterContact,
(case when main.status = '1' then '已归档' else task.taskDisPlayName end) as taskDisPlayName,
(case when task.taskStatus='2' and task.taskName='FirstExcuteHumTask' then 'T1未接单'
when task.taskStatus='8' and task.taskName='FirstExcuteHumTask' then 'T1已接单'
when task.taskStatus='2' and task.taskName='SecondExcuteHumTask' then 'T2未接单'
when task.taskStatus='8' and task.taskName='SecondExcuteHumTask' then 'T2已接单'
when task.taskName in('DraftHumTask','ByRejectHumTask') then 'T1未接单'
when task.taskName in('CheckingHumTask','HoldHumTask') and tem.activeTemplateId='FirstExcuteHumTask' then 'T2未接单'
when task.taskName in('CheckingHumTask','HoldHumTask') and tem.activeTemplateId='SecondExcuteHumTask' then 'T2已接单'
end) as taskStatus
from groupcomplaint_main main,
(select * from
(select tsk.sheetKey,
(case when tsk.taskName in('CheckingHumTask','HoldHumTask') then
(select lik.activeTemplateId from (select lk.activeTemplateId from groupcomplaint_link lk where lk.operateType='46' and lk.mainId='@mainId@' order by lk.operateTime desc) lik where rownum=1)
end) as activeTemplateId
from groupcomplaint_task tsk,
groupcomplaint_link lik
where
tsk.sheetKey='@mainId@' and tsk.sheetKey=lik.mainId order by tsk.createTime desc) where rownum=1) tem,
(select * from
(select lik.mainId,
(case when lik.activeTemplateId in('FirstExcuteHumTask','SecondExcuteHumTask','CheckingHumTask','HoldHumTask') then
(select lik.operateUserId from (select lk.operateUserId from groupcomplaint_link lk where lk.operateType='46' and lk.mainId='@mainId@' order by lk.operateTime desc) lik where rownum=1)
else '' end) as operateUserId,
(case when lik.activeTemplateId in('FirstExcuteHumTask','SecondExcuteHumTask','CheckingHumTask','HoldHumTask') then
(select lik.operaterContact from (select lk.operaterContact from groupcomplaint_link lk where lk.operateType='46' and lk.mainId='@mainId@' order by lk.operateTime desc) lik where rownum=1)
else '' end) as operaterContact
from groupcomplaint_link lik
where
lik.mainId='@mainId@' order by lik.operateTime desc) where rownum=1) link,
(select * from
(select tsk.sheetKey,
tsk.taskName,
tsk.taskDisPlayName,
taskStatus
from groupcomplaint_task tsk
where
tsk.sheetKey='@mainId@' and tsk.id like '_TKI%' order by tsk.createTime desc) where rownum=1) task
where
main.id=task.sheetkey and main.id= link.mainId and (sysdate - main.SENDTIME) >0 and (sysdate - main.SENDTIME) <7
</sql>
</boco>
7.报文格式要求
[OPDETAIL格式说明]
OPDETAIL中字段信息包括字段中文名、字段英文名、字段类型、字段内容,接口业务信息采用XML格式封装,封装格式如下例所示:
<opDetail> //详细信息
<recordInfo> //记录内容
<fieldInfo> //字段内容
<fieldChName>…</fieldChName> //字段中文名
<fieldEnName>…</fieldEnName> //字段英文名
<fieldContent>…</fieldContent> //字段内容
</fieldInfo>
</recordInfo>
</opDetail>
<opDetail>中可包括多个<recordInfo>部分,<recordInfo>中可包括多个<fieldInfo>部分,在本接口中,一个fieldInfo是一个字段信息,一个recordInfo中是一条工单数据。
8.使用soapUI测试
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.groupcomplaint.sheet.eoms.boco.com">
<soapenv:Header/>
<soapenv:Body>
<ser:findInfo>
<ser:serSupplier>?</ser:serSupplier>
<ser:serCaller>?</ser:serCaller>
<ser:callerPwd>?</ser:callerPwd>
<ser:callTime>?</ser:callTime>
<ser:CUST_CODE>2019032208255000054501</ser:CUST_CODE>
</ser:findInfo>
</soapenv:Body>
</soapenv:Envelope>