|
@@ -2161,36 +2161,6 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //补发好友欢迎语
|
|
|
|
|
-// void sendHookWelcome(QwUser qwUser,SendWelcomeMsgParam sendWelcomeMsgParam,QwExternalContact qwExternalContact){
|
|
|
|
|
-// if (qwUser.getAppKey()!=null&& !qwUser.getAppKey().isEmpty()){
|
|
|
|
|
-// ArrayList<String> msgParamList=new ArrayList<>();
|
|
|
|
|
-// msgParamList.add(sendWelcomeMsgParam.getText().getContent());
|
|
|
|
|
-// sendWelcomeMsgParam.getAttachments().forEach(item->{
|
|
|
|
|
-// if (("link").equals(item.getMsgtype())) {
|
|
|
|
|
-// msgParamList.add(item.getLink().getUrl());
|
|
|
|
|
-// }
|
|
|
|
|
-// });
|
|
|
|
|
-// if (!msgParamList.isEmpty()){
|
|
|
|
|
-// for (String value : msgParamList) {
|
|
|
|
|
-// QwHookSendMsgParam sendMsgParam=new QwHookSendMsgParam();
|
|
|
|
|
-// QwHookSendMsgParam.QwHookSendMsgData sendMsgData=new QwHookSendMsgParam.QwHookSendMsgData();
|
|
|
|
|
-// sendMsgParam.setType(101003);
|
|
|
|
|
-// sendMsgData.setMsg(value);
|
|
|
|
|
-// sendMsgData.setOpenId(qwExternalContact.getExternalUserId());
|
|
|
|
|
-// sendMsgData.setSyncKey("1");
|
|
|
|
|
-// sendMsgParam.setData(sendMsgData);
|
|
|
|
|
-// SendHookAIParam sendAIParam = new SendHookAIParam();
|
|
|
|
|
-// sendAIParam.setCmd("aiReplyMsg");
|
|
|
|
|
-// sendAIParam.setData(JSONUtil.toJsonStr(sendMsgParam));
|
|
|
|
|
-// sendAIParam.setKey(qwUser.getAppKey());
|
|
|
|
|
-// logger.info("补欢迎语:" + qwExternalContact.getExternalUserId()+":"+value);
|
|
|
|
|
-// redisTemplate.opsForList().leftPush("AiMsg:"+qwUser.getAppKey(), JSON.toJSONString(sendAIParam));
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-
|
|
|
|
|
SendWelcomeMsgParam welcomeMsg(String content,List<SendWelcomeMsgParam.Attachment> attachments,QwUser qwUser,String corpId,Long id){
|
|
SendWelcomeMsgParam welcomeMsg(String content,List<SendWelcomeMsgParam.Attachment> attachments,QwUser qwUser,String corpId,Long id){
|
|
|
SendWelcomeMsgParam sendWelcomeMsgParam = new SendWelcomeMsgParam();
|
|
SendWelcomeMsgParam sendWelcomeMsgParam = new SendWelcomeMsgParam();
|
|
|
TextMessage textMessage = new TextMessage();
|
|
TextMessage textMessage = new TextMessage();
|
|
@@ -2253,14 +2223,6 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
@Override
|
|
@Override
|
|
|
public void insertQwExternalContactByExternalUserId(String externalUserID, String userID, Long companyId, String corpId, String state, String welcomeCode, QwUser qwUser) throws ParseException {
|
|
public void insertQwExternalContactByExternalUserId(String externalUserID, String userID, Long companyId, String corpId, String state, String welcomeCode, QwUser qwUser) throws ParseException {
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-// String qwApiExternal=redisCache.getCacheObject("qwApiExternal:"+userID+":"+corpId+":"+externalUserID);
|
|
|
|
|
-// if (!StringUtil.strIsNullOrEmpty(qwApiExternal)){
|
|
|
|
|
-// return;
|
|
|
|
|
-// }else {
|
|
|
|
|
-// redisCache.setCacheObject("qwApiExternal:"+userID+":"+corpId+":"+externalUserID ,"1",10, TimeUnit.MINUTES);
|
|
|
|
|
-// }
|
|
|
|
|
-
|
|
|
|
|
// 获取当前日期(只包含年月日)
|
|
// 获取当前日期(只包含年月日)
|
|
|
LocalDate currentDate = LocalDate.now();
|
|
LocalDate currentDate = LocalDate.now();
|
|
|
// 获取当前系统时间 (HH:mm)
|
|
// 获取当前系统时间 (HH:mm)
|
|
@@ -2280,22 +2242,6 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
qwExternalContact.setExternalUserId(externalUserID); // 设置外部联系人ID
|
|
qwExternalContact.setExternalUserId(externalUserID); // 设置外部联系人ID
|
|
|
qwExternalContact.setCorpId(corpId);
|
|
qwExternalContact.setCorpId(corpId);
|
|
|
qwExternalContact.setCreateTime(new Date());
|
|
qwExternalContact.setCreateTime(new Date());
|
|
|
- //重粉问题
|
|
|
|
|
- try {
|
|
|
|
|
- new Thread(() -> {
|
|
|
|
|
- try {
|
|
|
|
|
- Thread.sleep(3000);
|
|
|
|
|
- } catch (InterruptedException e) {
|
|
|
|
|
- logger.error("添加等待时长错误", e);
|
|
|
|
|
- }
|
|
|
|
|
- rocketMQTemplate.syncSend("repeat-upload", JSON.toJSONString(RepeatUploadVo.builder().type(0).externalUserId(externalUserID).build()));
|
|
|
|
|
- }).start();
|
|
|
|
|
- }catch (Exception e){
|
|
|
|
|
- logger.error("重粉提交mq失败", e);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
//先入一次库
|
|
//先入一次库
|
|
|
if (isNewQwExternalContact) {
|
|
if (isNewQwExternalContact) {
|
|
|
qwExternalContact.setName("待同步客户");
|
|
qwExternalContact.setName("待同步客户");
|
|
@@ -2306,56 +2252,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
} else {
|
|
} else {
|
|
|
qwExternalContactMapper.updateQwExternalContact(qwExternalContact);
|
|
qwExternalContactMapper.updateQwExternalContact(qwExternalContact);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
QwExternalContact contact=qwExternalContact;
|
|
QwExternalContact contact=qwExternalContact;
|
|
|
-
|
|
|
|
|
-// if (state != null && state != "") {
|
|
|
|
|
-// String s = "way:" + corpId + ":";
|
|
|
|
|
-// if (state.contains(s)) {
|
|
|
|
|
-// if (welcomeCode != null && welcomeCode != "") {
|
|
|
|
|
-// String substring = state.substring(state.indexOf(s) + s.length());
|
|
|
|
|
-// QwContactWay qwContactWay = qwContactWayMapper.selectQwContactWayById(Long.parseLong(substring));
|
|
|
|
|
-// logger.info("qwContactWay:"+qwContactWay);
|
|
|
|
|
-// if (qwContactWay != null) {
|
|
|
|
|
-// isWay = true;
|
|
|
|
|
-// wayId = qwContactWay;
|
|
|
|
|
-// if (qwContactWay.getIsWelcome() != null && qwContactWay.getIsWelcome() == 1) {
|
|
|
|
|
-// Boolean isClose = true;
|
|
|
|
|
-// if (wayId.getIsSpanWelcome() == 1) {
|
|
|
|
|
-// ExternalContact externalContact = externalContactResult.getExternal_contact();
|
|
|
|
|
-// String name = externalContact.getName();
|
|
|
|
|
-// String closeWelcomeWord = wayId.getCloseWelcomeWord();
|
|
|
|
|
-// if (closeWelcomeWord != null && closeWelcomeWord.length() > 0) {
|
|
|
|
|
-// List<String> strings = JSON.parseArray(closeWelcomeWord, String.class);
|
|
|
|
|
-// for (String string : strings) {
|
|
|
|
|
-// if (name.contains(string)) {
|
|
|
|
|
-// isClose = false;
|
|
|
|
|
-// break;
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// if (qwContactWay.getIsWelcome() == 1 && isClose) {
|
|
|
|
|
-// isSend = qwContactWayService.sendWelcomeMsg(qwContactWay, corpId, welcomeCode,qwUser,contact.getId());
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// if (qwContactWay.getUserType() == 1 && qwContactWay.getIsUserLimit() == 1) {
|
|
|
|
|
-// QwContactWayUser qwContactWayUser = qwContactWayUserMapper.selectQwContactWayUserByUserIdAndCompanyId(userID, corpId);
|
|
|
|
|
-// if (qwContactWayUser != null) {
|
|
|
|
|
-// qwContactWayUser.setDayCount(qwContactWayUser.getDayCount() - 1);
|
|
|
|
|
-// qwContactWayUserMapper.updateQwContactWayUser(qwContactWayUser);
|
|
|
|
|
-// if (qwContactWayUser.getDayCount() <= 0) {
|
|
|
|
|
-// //超过限制
|
|
|
|
|
-// qwContactWayService.updateQwContactWayBYLimit(qwContactWayUser.getWayId());
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-
|
|
|
|
|
if (welcomeCode != null && !welcomeCode.isEmpty()) {
|
|
if (welcomeCode != null && !welcomeCode.isEmpty()) {
|
|
|
// 查询成员的欢迎语以及欢迎图片
|
|
// 查询成员的欢迎语以及欢迎图片
|
|
|
log.info("qw_user_id:{},external_id:{}: 查询欢迎语开始", qwUser.getId(), externalUserID);
|
|
log.info("qw_user_id:{},external_id:{}: 查询欢迎语开始", qwUser.getId(), externalUserID);
|