Yonyou EAI Docking Operation Manual

1. Environmental Preparation

1.1 Find a computer that provides a deployment agent, and require
a. The computer is allowed to be accessed from the external network (for security, you can allow the server to specify the ip of FunShare to access, and you must tell the user, otherwise, if there is a security problem, you will be responsible);
b. The current system will not be shut down frequently [preferably a linux system, or a springboard machine];
1.2 Provide the IP+port or domain name of the server where the agent is deployed [Step 1, the server where the agent service is deployed];
1.3 Provide the ip of the server for the test account set [the computer where the U8 test account set is located, the icon is as follows]:
1.4 Provide the IP and database name of the U8 database, and you can query the database users of the corresponding account set (only the query permission is enough, normally only the query permission is required, and there will be security issues.);
1.5 Provide the account set and account set password of the test account set [for testing and configuring docking information];
1.6 Let the customer IT execute the following sql to create a temporary table in the account set that needs to be connected:
CREATE TABLE [dbo].[sync_obj_record] ( [id] bigint NOT NULL, [obj_name] varchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL, [md_str] varchar(32) COLLATE Chinese_PRC_CI_AS NOT NULL, [data_id] varchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL, [data_body] text COLLATE Chinese_PRC_CI_AS NOT NULL, [version] int NOT NULL, [create_time] bigint NOT NULL, [update_time] bigint NOT NULL, CONSTRAINT [PK__sync_obj__3213E83F46CC8028] PRIMARY KEY CLUSTERED ([id]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] go ALTER TABLE [dbo].[sync_obj_record] SET (LOCK_ESCALATION = TABLE) go CREATE UNIQUE NONCLUSTERED INDEX [sync_obj_record_u1] ON [dbo].[sync_obj_record] ( [obj_name] ASC, [data_id] ASC )

2. Configure Docking Environment

2.1 Account Environment Configuration

2.1.1 Configure EAI

Find the EAI program on the account's U8 server, open the EAI interface settings, configure the account set, and [uncheck and ignore custom extended information], and the account can configure it by himself if it involves permission issues

2.1.2 Configure Running Environment

Enter the netdisk to download agent service
Configure Agent Service
1. Call the /adapt/proxy/api/test interface on the external network to test. If the interface test is successful, it means that the external network access authority is normal;
Server base path: the value of server.servlet.context-path in http://ip:port/start.bat/adapt/proxy/api
Server login interface: http://ip: the value of server.servlet.context-path in port/start.bat/adapt/proxy/api/login
New interface for the server: http://ip: the value of server.servlet.context-path in port/start.bat/adapt/proxy/api/create
Server update interface: http://ip: the value of server.servlet.context-path in port/start.bat/adapt/proxy/api/udpate
Server batch interface: http://ip: the value of server.servlet.context-path in port/start.bat/adapt/proxy/api/queryMasterBatch
A single server interface: http://ip: the value of server.servlet.context-path in port/start.bat/adapt/proxy/api/queryMasterById
Verify login interface:

2.3 Configure Integration Platform

2.3.1 Manufacturer Configuration

ERP Service Path: fill in the server basic path: http://ip: the value of server.servlet.context-path in port/start.bat/adapt/proxy /api
EAI Receiver: default u8 is fine
EAI Caller: registration code in EAI configuration (see 2.1.2 Configuring EAI)
Agent 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. (Refer to step 2.1.3.1 to configure the password)

2.3.2 Configure Objects that Support Docking

​ Refer to U8openApi: http://open.yonyouup.com/apiCenter/index New additions and updates supported by openApi. EAI is supported. The query logic of the database to be queried. So if know the table. All objects are supported from erp to crm. Download the U8 client or directly download the following attachments:
META-INF.zip
825 KB
The files in the directory can find the query sql. and fields of objects that are not preset:

2.3.3 EAI Debugging

3. General Rules

3.1 Configuration Process

​ Open the ERP object configuration and configure the object (commonly used objects have been preset). What needs to be done is to modify the option value of the relevant drop-down option field (because the radio enumeration of each enterprise is different, there is no preset). In addition, some of the radio selections of U8 can be used as search association fields. However, the option value needs to be synchronized to an object of CRM first; the specific configuration steps are as follows:
1. Select the coding field for docking fields;
2. If there is no docking field in the preset, you need to manually preset it yourself. For the field rules, please find it in the xml file in the attachment of [META-INF.zip] (maybe in the query.add or edit file of the object);
3. Configure the synchronization strategy and field mapping for docking (generally do not go into details, please refer to [Integration Platform Manual if you are unclear) ]), an additional point: Required fields and default values ​​need to be passed【Valued fields in the configuration file template】. If it is not passed, an error will be reported;
4. The new extension field CRM in U8 is synchronized to U8 [for all objects with details, the details require adding an extension field to connect to the detail code or unique field of CRM];
5. Primary Key Rules: The primary key of the primary object is the primary key of the ERP, and the primary key of the secondary object is the primary key of the database id of the secondary object. Therefore, from the object id, it needs to be checked out through sql. It is necessary to configure the sql of query detail id;
6. Modify the EAI configuration. Modify the scene:
  1. Add non-preset object ERP to crm direction;
  2. Detailed query primary key Sql from CRM to ERP;
  3. Insert database operation (dangerous operation, it is recommended not to operate. It may mess up the customer system, and it will run normally. Abnormal circumstances may cause the entire system to crash. If you need to use it, please sign an agreement with the customer)
  4. Modify the query sql statement
Open the build API and enter the configuration:
Enter the generation api inside:
Table primary key field: the primary key of the synchronization object in the table corresponding to U8;
Interface primary key field: the primary key field in the interface (it is the same field name as the primary key in the field configured by the ERP object);
Batch query sql: can be found in the file in the METE-INF attachment. Master and detail sql are separate
Query the primary key sql: If the primary object is newly added via EAI message (no statement added in batches), it does not need to be filled in. EAI packets default to code as the primary key. Details must be filled in
Add/update sql: sql statement syntax refers to sqlserver syntax. The field values ​​involved in adding and updating need to be written in the format of '#field name in object'. If the id of the parent class needs to be passed in to sql, then The corresponding value is written as '#pid';
sql writing rules: sql syntax is the standard syntax of sqlserver. Value substitution rules in sql use '#field'. Field is the field in the ERP object list.

3.2 Document Configuration

The U8 fields that need to be passed are referenced as follows, and the specific field value mapping is configured according to the actual customer options:

​3.2.1 Account Object

If you use the crm customer code as the ERP customer code, you can connect the normal mapping fields; if you need to use the erp customer code serial number generation rules, follow the steps:
1. First configure the U8 client to use automatic code generation:
2. To configure field mapping, you need to create a new ERP customer code field in crm. Then connect the ERP customer code with the customer code field of U8. And set the default value, and after synchronization, the function needs to write the customer code field returned by the interface into the ERP customer code field of CRM

3.2.2 Sales Order

Create a new extension field in U8, refer to [Screenshot of Point 5 of General Rules]. Depending on the product object, you need to synchronize the product object first; complete the configuration process in the general rules: ERP object configuration → field configuration → policy configuration. Enter the field mapping configuration. For the configured fields, please check which fields are required in U8.
a. All required fields [with * in U8] need to be docked; the U8 fields that need to be transmitted are referred to as follows, and the specific field value mapping is configured according to the actual customer option:
Notes on order docking:
1. The tax rate on the head of the form and the tax rate on the body of the form need to be consistent;
2. If the order details are passed in the total price and tax, the table body needs to be passed in【Currency price and tax total】Otherwise an error will be reported【Program error does not set the object variable or With block variable, this error is generally caused by the lack of field transmission】 It is necessary to add an extension field in the U8 and integrated platform configuration to connect to the crm order product code. At the same time, it is necessary to modify the ERP field configuration to generate the sql statement of the query detail id (the id of the order detail in the database) in the api;

3.2.3 Invoice

Please note: Synchronizing delivery orders from CRM to U8 temporarily does not support checking orders through delivery orders, and cannot check delivery orders through order placement! The U8 fields that need to be passed are referenced as follows, and the specific field value mapping is configured according to the actual customer options:
It is necessary to add an extension field in the U8 and integrated platform configuration to connect to the crm order product code. At the same time, it is necessary to modify the ERP field configuration to generate the sql statement of the query detail id in the api.
create TRIGGER [shengchengdingdanhao] ON [dbo].[DispatchList] after insert, update AS begin update DispatchList set DispatchList.cSOCode= (select DispatchLists.cordercode from DispatchLists inner join inserted on DispatchLists.DLID=inserted.DLID and DispatchLists.irowno=1) from DispatchList inner join inserted on DispatchList.DLID=inserted.DLID and inserted.cVouchType=05 end

3.2.4 Collection Receipt

The U8 fields that need to be passed are referenced as follows, and the specific field value mapping is configured according to the actual customer options:

3.2.5 Sales Invoice

3.2.6 Products

The connection between U8 and CRM product objects is relatively routine and normal. The product name of U8 may be repeated. However, the product name of crm is not allowed to be repeated, so you can use the format of a product code + product name to connect to crm products.
Of course, the specific format of this field can be defined by yourself. Just modify the sql of the query;
Mapping field configuration reference:

3.2.7 Import Product Category

Product category import reference: Product Manual

3.2.8 Inventory Details

The inventory of U8 is the real-time inventory details, so it is necessary to open the inventory details to connect to the crm. Cannot dock directly to inventory objects
Open the inventory detail object in CRM:
To configure policy detail field mapping, refer to the following configuration:

4. Common Problems

4.1 Start the start.bat log to report an error. The log in the run.log appears: parse String to Object error: UnExpected character

This problem is due to a problem with the character set of the configuration file, which can be modified by downloading AdaptConnectConfig in the document. Or add parameters when starting: -DconfigCharset=The character set of the current file
The default character set encoding of Windows Notepad is ANSI encoding
start javaw -jar MidProxyServer.jar -Dserver.port=xxxx-Dserver.servlet.context-path=/xxx -DconfigCharset=ANSI
Simple processing method: copy and process the text. Save it again with a utf8 editor. Just make sure the file format is utf8. The character set loaded by default is utf8

4.2 The startup strategy reports null

Troubleshooting steps for this type of problem:
  1. Please check whether the service deployed on the customer's computer starts normally. This error will be reported if it is not started. The service needs to be started manually if there are other agents. you need to start another agent
  2. Please check whether the IP and port corresponding to the service deployed on the customer's computer have external access authority, if not, this error will be reported
  3. For this type of problem, customers can open the external network permissions and call directly on the external network: http://ip:port/start.bat in server.servlet. The value of context-path /adapt/proxy/api/test is accessed. If the request is normal, the service is started. And it can be requested normally:

4.3 An unknown exception occurred during EAI execution

Error in calling ERP interface: Failed to call external http interface, error message: 20005, U8 service call failed: key=''; an unknown exception occurred in EAI execution, and the error has been caught. Exception information: wrong file name or number (error number: 52 error source: U8Distribute error location: 15)
Solution: Refer to the configuration of the object of the current document. The reason for this error is that there are some mandatory fields that are not passed. Refer to the document field configuration post-validation of the example;

4.4 EAI Service Exception: null

Failed to call the external http interface, error message: EAI service exception: The problem is that the call to the EAI interface does not return information normally. The reason is generally that the EAI server is abnormal. It may be that the EAI service is down or the network of the EAI server and proxy service has changed. .
Check method:
Call on the deployed proxy server: EAI interface path in AdaptConnectConfig.json http://EAI service ip (default in U8 enterprise The computer using the platform software, the ip in step 3 in the customer environment preparation)/u8eai/import.asp
Check if the server can be accessed normally. It is normal to return the following:

4.5 Login authentication failed, please try again

This type of error reporting: first use postman to adjust the interface to see if it can be accessed normally. For debugging methods, refer to the postman test login interface in [Configure Integration Platform];

4.6 Invalid Column Name 'cbdefine11'

For this type of error, please open the interface details:
  1. View the sql corresponding to the error field in the message;
  2. Check whether there is a problem with the extended fields configured in configuration process 4. If the field names of the extended fields generated by each customer are different. Then manually modify the field name, and at the same time, you need to modify the sql of the query Id in the EAI configuration;
  3. Check the sql of the detailed id of the configuration process 5.1

4.7 Program Error with No Object Variable or With block Variable

Generally, the parameter format of the packet is abnormal. Please refer to the case field configuration of the corresponding object crm to erp.
2023-02-22
0 0