CRM

纷享销客CRM集成用友BIP

一、集成简介

用友BIP,全称为用友商业创新平台,是用友公司采用新一代信息技术,根据云原生、元数据驱动、中台化和数用分离的架构设计打造的平台。该平台涵盖了平台服务、应用服务、业务服务与数据服务等形态,集工具、能力和资源服务为一体,致力于服务企业与产业商业创新的平台型、生态化的云服务群。在中大型企业市场上占有重要地位。纷享销客作为国内CRM领域的领军企业,与BIP客户群高度重合,如果企业同时在使用BIP和CRM,打通两套系统非常有必要、也非常有价值。

二、打通两套系统给企业带来的价值

保证数据的及时性、完整性、准确性:基础数据可以一端维护,两端共享,通过唯一的主键绑定,双方系统互相可以识别,单据类数据可以根据业务场景需求,选择在哪套系统中录入,控制数据流向和同步时间节点。

提高效率,降低人工操作成本:使用CRM的业务人员,可以通过CRM系统查询到BIP内的数据,像库存、信用余额、发货通知、应收账款等等,便于及时处理客户业务,一些人员下单可以直接在CRM完成,及时同步至BIP。

提供数据决策支持:通过数据的同步,打破了数据孤岛,让售前、售中、售后的数据聚集在一个平台,便于通过完整的数据链条进行数据分析,为企业管理层战略决策提供数据支持。

三、集成的实现方式

高代码开发:通过调用双方开放平台接口,完成数据同步的开发功能。用友BIP开放平台文档:BIP高级版OPENAPI文档,BIP旗舰版OPERAPI文档,https://open.fxiaoke.com/。通过高代码开发的方式,较为复杂,但更加灵活,需要有系统一方或双方配合完成,也可有独立的第三方完成。提供接口鉴权的相关秘钥即可。

插件实现:BIP和纷享均有标准的同步插件可以使用,通过简单的配置及少量代码开发,即可完成同步。

四、集成常见问题

BIP接口鉴权的加密算法,社区里提供了多种语言的加密实现方法,可自行查找。附Python源码:

#!/usr/bin/env python

# -*- coding:utf-8 -*-

# Author:wangzhifeng@tongdog.com.cn

import requests

import json

import pymysql

import time

import hashlib

import base64

from Crypto.Signature import pss

from Crypto.Hash import SHA256

from Crypto.Cipher import PKCS1_OAEP

from Crypto.PublicKey import RSA

class nccloud():

# 构造方法

def __init__(self):

self.client_id = ""

self.client_secret = ""

self.biz_center = ""

self.username = ""

self.pubkey = ""

self.header = {'Content-type': "application/x-www-form-urlencoded"}

self.getAccessToken()

# 获取用友BIP高级版(原NCcloud)accessToken

def getAccessToken(self):

connect = pymysql.connect(

host='127.0.0.1', user='root', password='root', database='django')

cursor = connect.cursor(cursor=pymysql.cursors.DictCursor)

sql = "select * from fx_fxtoken where type = 'nccloud';"

cursor.execute(sql)

result = cursor.fetchone() # 取一条

# print(result)

self.corpId = result['corpid']

self.AccessToken = result['value']

expires_time = result['expire']

if int(time.time()) > int(expires_time):

url = ""

# 请求参数

postdata = {

'grant_type': "client_credentials", # 'grant_type':'password', #密码模式

'client_id': self.client_id,

'client_secret': self.encrtypt(self.client_secret, self.pubkey, 117),

'biz_center': self.biz_center,

'username': self.username,

# SHA256Util.getSHA256(client_id + client_secret + pubKey) client_secre为未加密之前的数据,也就是原数据

'signature': self.sign_hash(self.client_id+self.client_secret+self.pubkey+self.salt(self.pubkey)),

}

print(postdata)

result = requests.post(url, data=postdata, headers={

'Content-type': "application/x-www-form-urlencoded", }).json()

print(result)

self.AccessToken = result["data"]["access_token"]

self.expire = 1000

cursor.execute("update fx_fxtoken set expire = {0} , value = '{1}',corpId = '{2}' where type = 'nccloud';".format(

self.expire, self.AccessToken, self.client_id))

cursor.close()

connect.close()

def encrtypt(self, data, public_code, length):

public_key = RSA.importKey(base64.b64decode(public_code))

encrypt_data = []

cipher = PKCS1_OAEP.new(public_key, hashAlgo=SHA256,

mgfunc=lambda x, y: pss.MGF1(x, y, SHA256))

for i in range(0, len(str(data)), length):

encrypt_data.append(base64.b64encode(cipher.encrypt(

str(data)[i:i + length].encode())).decode())

return encrypt_data[0]

def salt(self, pubkey):

sha1 = hashlib.sha1(pubkey.encode()).digest()

sha1 = hashlib.sha1(sha1).digest()

salt_data = base64.b64encode(sha1[:16]).decode()

return str(salt_data)

def sign_hash(self, message):

hash_data = hashlib.sha256()

hash_data.update(message.encode('utf-8'))

return hash_data.hexdigest()

if __name__ == '__main__':

nccloud = nccloud()

2.BIP旧版本没有查询类接口:考虑升版,或者开发定制型接口,在社区有公布数据字典。

3.纷享销客字段在哪里看,管理员账号登录纷享以后,在后台:定制开发平台->对象及API可查看。

交流用友BIP和纷享CRM集成相关问题:wangzhifeng@tongdog.com.cn

注:本文转载自知乎,转载目的在于传递更多信息,并不代表本站赞同其观点和立场。