6.1 KiB
6.1 KiB
金蝶云星空·企业版字段映射配置
1、字段映射
1.1、基础信息
名称 | 说明 | 示例 |
---|---|---|
同步顺序 | 按此设置的顺序进行同步,不能有重复的顺序 | |
from语句 | pdmitem是物料表、cfobjkind是对象分类表 | pdmitem a left JOIN cfobjkind b on a.itemkindid = b.objkindid |
where条件 | viewid = 1 and a.stat = 4 and a.itemid > 0 | |
order by排序 | itemcode | |
erp接口 | BD_MATERIAL:物料接口,ENG_BOM:bom接口 |
1.2、字段映射
1.2.1、接口位置
1.2.2、新增字段映射
1.2.3、发布
在左侧输入框内查询条件,然后点测试发布,会在右侧中显示同步结果
2、日志
2.1、同步日志
用于查看同步日志,默认查看当天的日志
2.2、操作日志
记录字段映射的操作日志
3、注意事项
3.1、版本规则
将字母改成数字
4、按钮脚本
4.1、物料同步按钮
uses MyClass,Variables,BaseUtil,CommonFunc,DataConst,CFFrm,CFSimplePropFrm,Forms,StdCtrls,Variants,SysUtils,Classes,Controls,Dialogs,
CHostIntf,ProductClas,DocClas,LoginClas,VirtualTrees,CEntClas,PathClas,JsonHttpClient,JSON;
var
jsonObject: TJSONObject; //请求对象
request: string; //请求对象转成的json字符串
response : String;//返回json字符串
begin
if Application.MessageBox( '确定同步吗', '同步确认', 1) = 1 then begin
btncxtsCusPage_1.Enabled := False; //禁用按钮,防止重复点
try
jsonObject := TJSONObject.Create;
jsonObject.AddPair('sql', 'a.viewid = 1 and a.itemcode = ''' + fedtItemCode.Text + '''');
jsonObject.AddPair('syncId', '1904456130482036739');
request := jsonObject.ToString; //举例中转字符串后为:{“itemid”:”11111”}
response := TJsonHttpClient.post7TS1('http://192.168.254.20:8005/erp/sync/manual',request,'application/json',''); //发起请求读取返回值
finally
jsonObject.Free;
btncxtsCusPage_1.Enabled := True; //不管是否失败,释放资源,启用按钮
end;
//showmessage(inttostr(length(response)));
if(length(response) = 0) then exit;
//response := StringReplace(response,'\n',#10,[rfReplaceAll]);
//response := StringReplace(response,'\t',#9,[rfReplaceAll]);
showmessage(response);
end;
end.
4.2、BOM同步按钮
uses MyClass,Variables,BaseUtil,CommonFunc,DataConst,CFFrm,CFSimplePropFrm,Forms,StdCtrls,Variants,SysUtils,Classes,Controls,Dialogs,
CHostIntf,ProductClas,DocClas,LoginClas,VirtualTrees,CEntClas,PathClas,JsonHttpClient,JSON;
var
jsonObject: TJSONObject; //请求对象
request: string; //请求对象转成的json字符串
response : String;//返回json字符串
begin
if Application.MessageBox( '确定同步吗', '同步确认', 1) = 1 then begin
btncxtsCusPage_2.Enabled := False; //禁用按钮,防止重复点
try
jsonObject := TJSONObject.Create;
jsonObject.AddPair('sql', 'a.viewid = 1 and a.itemcode = ''' + fedtItemCode.Text + '''');
jsonObject.AddPair('syncId', '1904456130482036737');
request := jsonObject.ToString; //举例中转字符串后为:{“itemid”:”11111”}
response := TJsonHttpClient.post7TS1('http://192.168.254.20:8005/erp/sync/manual',request,'application/json',''); //发起请求读取返回值
finally
jsonObject.Free;
btncxtsCusPage_2.Enabled := True; //不管是否失败,释放资源,启用按钮
end;
//showmessage(inttostr(length(response)));
if(length(response) = 0) then exit;
//response := StringReplace(response,'\n',#10,[rfReplaceAll]);
//response := StringReplace(response,'\t',#9,[rfReplaceAll]);
showmessage(response);
end;
end.
注:需修改脚本ip,并开放端口