|
|
|
@ -363,7 +363,7 @@ public class WxResponseService {
|
|
|
|
|
String res = WeixinApi.getExternalContactInfo(externalUserID);
|
|
|
|
|
log.info(res);
|
|
|
|
|
//添加客户并添加店铺企业微信信息
|
|
|
|
|
addExternalContact(res,state);
|
|
|
|
|
addExternalContact(res,userID,state);
|
|
|
|
|
|
|
|
|
|
// welcomeCodeNode = root.getElementsByTagName("WelcomeCode");
|
|
|
|
|
// welcomeCode = welcomeCodeNode.item(0).getTextContent();
|
|
|
|
@ -372,15 +372,19 @@ public class WxResponseService {
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case "add_half_external_contact":
|
|
|
|
|
// NodeList stateNode2 = root.getElementsByTagName("State");
|
|
|
|
|
// if(stateNode2.getLength() > 0){
|
|
|
|
|
// String state2 = stateNode2.item(0).getTextContent();
|
|
|
|
|
// log.info(state2);
|
|
|
|
|
// }
|
|
|
|
|
log.info("add_half_external_contact 外部联系人添加了配置了客户联系功能且开启了免验证的成员时(此时成员尚未确认添加对方为好友),回调该事件");
|
|
|
|
|
NodeList stateNodeHalf = root.getElementsByTagName("State");
|
|
|
|
|
String statehalf = "";
|
|
|
|
|
if(stateNodeHalf.getLength() > 0) {
|
|
|
|
|
statehalf = stateNodeHalf.item(0).getTextContent();
|
|
|
|
|
log.info(statehalf);
|
|
|
|
|
}
|
|
|
|
|
log.info("add_external_contact 配置了客户联系功能的成员添加外部联系人时,回调该事件");
|
|
|
|
|
|
|
|
|
|
// 调用外部联系人详情接口 查看state字段
|
|
|
|
|
String res2 = WeixinApi.getExternalContactInfo(externalUserID);
|
|
|
|
|
log.info(res2);
|
|
|
|
|
String reshalf = WeixinApi.getExternalContactInfo(externalUserID);
|
|
|
|
|
log.info(reshalf);
|
|
|
|
|
//添加客户并添加店铺企业微信信息
|
|
|
|
|
addExternalContact(reshalf,userID,statehalf);
|
|
|
|
|
break;
|
|
|
|
|
case "del_external_contact":
|
|
|
|
|
log.info("del_external_contact 配置了客户联系功能的成员删除外部联系人时,回调该事件");
|
|
|
|
@ -456,7 +460,7 @@ public class WxResponseService {
|
|
|
|
|
* 添加客户
|
|
|
|
|
* @param res
|
|
|
|
|
*/
|
|
|
|
|
public void addExternalContact(String res,String state) throws WxErrorException {
|
|
|
|
|
public void addExternalContact(String res,String cpUserId,String state) throws WxErrorException {
|
|
|
|
|
OpCustomerEnterpriseWechat ocew = analyticCustomerEnterprise(res);
|
|
|
|
|
ocew.setState(state);
|
|
|
|
|
CustomerDTO customerDTO = new CustomerDTO();
|
|
|
|
@ -469,8 +473,7 @@ public class WxResponseService {
|
|
|
|
|
customerDTO.setShopCode(split[0]);
|
|
|
|
|
customerDTO.setStaffCode(split[1]);
|
|
|
|
|
}else{
|
|
|
|
|
String cpuserId = ocew.getUserid();
|
|
|
|
|
Long storeId = privilageCpUserStoreDOMapper.selectOneByCpUserId(cpuserId);
|
|
|
|
|
Long storeId = privilageCpUserStoreDOMapper.selectOneByCpUserId(cpUserId);
|
|
|
|
|
PoiStore poiStore = poiStoreDOMapper.selectById(storeId);
|
|
|
|
|
customerDTO.setShopCode(poiStore.getCode());
|
|
|
|
|
String staffCode = poiStoreStaffDOMapper.selectShopManagerByShop(storeId);
|
|
|
|
|