Merge branch 'master' of http://git.hchbox.com/yuyou/client into master

master
土豆兄弟 4 years ago
commit 7bef9201de

@ -66,6 +66,23 @@ public class ABClient {
CommonResponse.createBySuccess() : CommonResponse.createByErrorMessage("调用失败请重试"); CommonResponse.createBySuccess() : CommonResponse.createByErrorMessage("调用失败请重试");
} }
/**
* AB - yznew
*
* @return
*/
@PostMapping("/api/req/taginfo/yznew")
@ResponseBody
public CommonResponse getDBTagInfoNew(@RequestBody ABClientInterMessageNewVO vo) {
// 记录日志
log.info("====== [ one request comming,request content is {} ] ======", vo.toString());
// 转换实体类映射
List<ABMessageDTO> dtos = ABMessageConverter.convertABMessageDTOFromNewVO(vo);
// 调用业务处理接口 返回校验成功的结果
return abClientService.recordAndSendABClientMsg(dtos) ?
CommonResponse.createBySuccess() : CommonResponse.createByErrorMessage("调用失败请重试");
}
/** /**
* AB - * AB -
* *

@ -7,6 +7,7 @@ import com.yuyou.openapi.openapi.common.security.SecurityService;
import com.yuyou.openapi.openapi.model.dataobject.*; import com.yuyou.openapi.openapi.model.dataobject.*;
import com.yuyou.openapi.openapi.model.dto.ABMessageDTO; import com.yuyou.openapi.openapi.model.dto.ABMessageDTO;
import com.yuyou.openapi.openapi.model.dto.LieheMessageDTO; import com.yuyou.openapi.openapi.model.dto.LieheMessageDTO;
import com.yuyou.openapi.openapi.model.vo.ABClientInterMessageNewVO;
import com.yuyou.openapi.openapi.model.vo.ABClientInterMessageVO; import com.yuyou.openapi.openapi.model.vo.ABClientInterMessageVO;
import com.yuyou.openapi.openapi.utils.DateUtils; import com.yuyou.openapi.openapi.utils.DateUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -59,6 +60,51 @@ public class ABMessageConverter {
return dataList; return dataList;
} }
/**
* VODTO
* @param abMessageVO
* @return
*/
public static List<ABMessageDTO> convertABMessageDTOFromNewVO(ABClientInterMessageNewVO abMessageVO) {
ArrayList<ABMessageDTO> dataList = new ArrayList<>();
if (abMessageVO == null){
return dataList;
}
// List<ABClientInterMessageNewVO.DetailInfoNew> detailInfoList = abMessageVO.getData();
// if (CollectionUtils.isEmpty(detailInfoList)){
// return dataList;
// }
ABMessageDTO abMessageDTO = new ABMessageDTO();
abMessageDTO.setAppId(abMessageVO.getAppId());
abMessageDTO.setTimestamp(abMessageVO.getTimestamp());
// 设置默认的坐席ID为 0
if (abMessageVO.getEmpId() == null){
abMessageVO.setEmpId(0);
}
// 对特殊的ActName进行处理
checkSpecailAppNameNew(abMessageVO);
BeanUtils.copyProperties(abMessageVO, abMessageDTO);
dataList.add(abMessageDTO);
// detailInfoList.forEach(
// each->{
// ABMessageDTO abMessageDTO = new ABMessageDTO();
// abMessageDTO.setAppId(abMessageVO.getAppId());
// abMessageDTO.setTimestamp(abMessageVO.getTimestamp());
// // 设置默认的坐席ID为 0
// if (each.getEmpId() == null){
// each.setEmpId(0);
// }
// // 对特殊的ActName进行处理
// checkSpecailAppNameNew(each);
// BeanUtils.copyProperties(each, abMessageDTO);
// dataList.add(abMessageDTO);
// }
// );
return dataList;
}
/** /**
* VODTO * VODTO
* @param abMessageVO * @param abMessageVO
@ -801,4 +847,23 @@ public class ABMessageConverter {
detailInfo.setActName(matchActName); detailInfo.setActName(matchActName);
} }
/**
* AppName
* :
* xxxx-1-1
* xxxx-1
*
*
* @param detailInfo AppName
* @return
*/
private static void checkSpecailAppNameNew(ABClientInterMessageNewVO detailInfo){
String actName = detailInfo.getActName();
String decodeStr = Base64.decodeStr(actName, CharsetUtil.UTF_8);
log.info("test decodeStr str is {}", decodeStr);
String matchActName = StringUtils.substringBeforeLast(decodeStr, "-");
detailInfo.setActName(matchActName);
}
} }

@ -0,0 +1,115 @@
package com.yuyou.openapi.openapi.model.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import java.io.Serializable;
import java.util.List;
/**
* Copyright (C), 2012 - 2018, qyx
* FileName: ABClientInterMessageVO
* Author: x
* Date: 2020/8/5 2:00 PM
* Description: AB
* History:
* <author> <time> <version> <desc>
* x 2020/8/5 v1.0
*/
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ABClientInterMessageNewVO extends ABClientBaseVO implements Serializable {
/**
*
*/
@JsonProperty(value = "data")
private List<DetailInfoNew> data;
/**
* poneNum Base64
*/
@JsonProperty(value = "mobile")
private String mobile;
/**
* Base64
*/
@JsonProperty(value = "actName")
private String actName;
/**
* Base64
*/
@JsonProperty(value = "app_id")
private String appId;
/**
*
*/
@JsonProperty(value = "startTime")
private Long startTime;
/**
* 1:A,2:B....
*/
@JsonProperty(value = "clientType")
private Integer clientType;
/**
* ID
*/
@JsonProperty(value = "recId")
private String recId;
/**
* , , 0
*/
@JsonProperty(value = "emp_id", defaultValue = "0")
private Integer empId;
/**
* ps:
*
*
*
*
* static
*
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class DetailInfoNew{
/**
* ,
*/
private List<ChatMsgNew> messages;
// modify by x 2021-1-29
/**
*
*/
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public static class ChatMsgNew {
private Long talkTime;
private Integer talkerType;
private String message;
}
}
}
Loading…
Cancel
Save