1. Environmental Preparation
- Download 【Agent Installation Package】
- Ask the account to provide a computer for deploying the agent program, and require a. The computer is allowed to be accessed by the server of ShareCRM (for safety, this server can be accessed by specifying the ip of ShareCRM. Be sure to tell the account, otherwise it will appear I am responsible for security issues), b. The current system will not be shut down frequently [preferably a linux system, or a springboard machine] c. Provide the ip and port or domain name of the deployed server
- Provide the IP and database name of the database, as well as the account number of the database. Note: The provided database access account needs to strictly limit the access rights of the corresponding tables. For example, if the current table is only synchronized from the intermediate database to crm, only the current user can only be set to have query permissions. insert. To update and delete permissions, you need to communicate with the customer's IT. Avoid data security issues caused by account leakage in the later stage
Agent Download


2. Configure Docking Environment
2.1 Account Environment Configuration
2.1.1 Prerequisites
- Download JRE or JDK, version 1.8 or above
- Accounts provide database users with query privileges only for related tables or views. Provide database connection information
- Install JRE or JDK (Jdk is recommended) Install JRE: refer to https://jingyan.baidu.com/article/e5c39bf5aa59f639d760332d.html to install JDK: refer to< a href="https://jingyan.baidu.com/article/f96699bb163475894e3c1be4.html">https://jingyan.baidu.com/article/f96699bb163475894e3c1be4.html
- Install JRE: Refer to https://jingyan.baidu.com/article/e5c39bf5aa59f639d760332d.html
- Install JDK: Refer to https://jingyan.baidu.com/article/f96699bb163475894e3c1be4.html
2.1.2 Configure Running Environment
Configuration service local database information: mainly the type of database. And the database ip and account number accessed
- Create a new folder and put DBMidProxyServer.jar (step 1 in environment preparation) into the folder,
- At the same time, create a new config folder in the folder and place: AdaptConnectConfig.json in the config folder. The content of the file is configured according to the following instructions (download AdaptConnectConfig.json)
Mysql version,
driverClass optional
com.mysql.jdbc.Driver is mybatis-connection-java 5 and below
com.mysql.cj.jdbc.Driver is mybatis-connection-Java 6 and above
{
"DBConnect" : {
"driverClass" : "com.mysql.jdbc.Driver",//database driver. Specified according to the database version.
"url" : "jdbc:mysql://database IP:database port/database name?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&useSSL=false",//
"username" : "database account",
"password" : "database password"
},
"dbType" : "MYSQL",
"Security" : {
"username" : "Proxy service account",
"password" : "Proxy service password"
}
}
- Create a start.bat file in the folder (as follows) and change 8001 to the corresponding server port. 001 is specified according to the needs. 001 is mainly used to distinguish the account application. Double-click start.bat to run the proxy service.
for /f "tokens=5" %%a in ('netstat /ano ^| findstr 8001') do taskkill /F /pid %%a
@echo off
start javaw -jar DBMidProxyServer.jar --server.port=8001 --server.servlet.context-path=/001
exist
2.1.3 Agent Service Deployment Verification
Start start.bat
Service log: check the app/log under the folder where DBMidProxyServer.jar is located
Call the test interface of the proxy server on the intranet
Interface address: http://ip: the value of server.servlet.context-path in port/start.bat/dbadapt/proxy/api/test
- Call the value of server.servlet.context-path in http://ip:port/start.bat/dbadapt/proxy/api/test interface on the external network test. If the interface test is successful, it means that the access to the external network is normal
2.1.4 Configure Integration Platform
Interface Test
Server base path: the value of server.servlet.context-path in http://ip:port/start.bat/dbadapt/proxy/api
Server login interface: http://ip: the value of server.servlet.context-path in port/start.bat/dbadapt/proxy/api/login
New server interface: http://ip: the value of server.servlet.context-path in port/start.bat/dbadapt/proxy/api/create
Server update interface: http://ip: the value of server.servlet.context-path in port/start.bat/dbadapt/proxy/api/udpate
Server batch interface: http://ip: the value of server.servlet.context-path in port/start.bat/dbadapt/proxy/api/queryMasterBatch
Single server interface: http://ip: the value of server.servlet.context-path in port/start.bat/dbadapt/proxy/api/queryMasterById
2.2 Vendor Configuration
ERP Service Path: fill in the server basic path: http://ip: the value of server.servlet.context-path in port/start.bat/dbadapt/proxy /api

Connector display name: the name of the A/C set. Multiple account sets do not allow duplicate names,
ERP access path: the domain name or ip of the deployed proxy server + externally mapped port + /dbadapt/proxy/api
Username: The account of the proxy server, which is the same as the value of the name node in Security in AdaptConnectConfig.json
Password: The account of the proxy server, which is the same as the value of the password node in Security in AdaptConnectConfig.json
Proxy service account password: Fill in the account password in the Security node in the configuration file. This account password setting is a bit more complicated.
2.2.1 Object & Object Field Configuration
1. Click on the link object. Enter object list
2. Click New. Enter the object editing interface

If the object is a master-slave structure: please select the intermediate object where the ERP object is split into a master-slave relationship
If the object is only the main object: please select the ERP object without splitting, it is an independent intermediate object
The specific configuration is the same as other channels. But too much introduction.

New field: The primary key field must be specified in the object field list, and the primary and secondary fields must also be specified in the detail field list. Used to identify which master object the current slave object belongs to.

2.2.2 Object Execution Script Configuration
1. Click to Generate API

2. Enter Configuration Interface


Configuration instructions:
1. Table primary key field: the unique field of the table
2. Date query condition column name: the time field used for query
3. Query date format: date field format for query
4. Batch query sql: SQL for polling batch query
5. Query the SQL of the primary key: After adding it, check the sql of the primary key
6. Newly added sql: sql template for inserting tables from CRM to the intermediate library: all values that need to be replaced in the template. All are written in the format of '#field name in the field list' , if the details need to refer to the primary key of the main table: replace it with '#pid'
7. Updated sql: the sql template used to update the table from CRM to the intermediate library: all values that need to be replaced in the template. All are written in the format of '#field name in the field list', if the primary key of the main table needs to be referenced in the details: replace it with '#pid'
2.2.3 Integration Flow Configuration
Enter the integration flow interface. The specific configuration is the same as other channels. But too much introduction.

