|
|
@ -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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* VO层转为DTO层 修改版
|
|
|
|
|
|
|
|
* @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;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* VO层转为DTO层
|
|
|
|
* VO层转为DTO层
|
|
|
|
* @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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|