正在显示
6 个修改的文件
包含
67 行增加
和
72 行删除
@@ -62,7 +62,7 @@ func (c *Client) Login(acctID string, username string, password string, lcid ... | @@ -62,7 +62,7 @@ func (c *Client) Login(acctID string, username string, password string, lcid ... | ||
62 | } | 62 | } |
63 | 63 | ||
64 | // ExecuteBillQuery 单据查询 | 64 | // ExecuteBillQuery 单据查询 |
65 | -func (c *Client) ExecuteBillQuery(param RequestExecuteBillQuery) (*QueryResult, error) { | 65 | +func (c *Client) ExecuteBillQuery(param RequestExecuteBillQuery) (*BillQueryResult, error) { |
66 | api := "/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc" | 66 | api := "/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc" |
67 | paramFomat := []interface{}{param} | 67 | paramFomat := []interface{}{param} |
68 | resp, err := c.PostRequest(api, paramFomat) | 68 | resp, err := c.PostRequest(api, paramFomat) |
@@ -75,6 +75,11 @@ func (c *Client) ExecuteBillQuery(param RequestExecuteBillQuery) (*QueryResult, | @@ -75,6 +75,11 @@ func (c *Client) ExecuteBillQuery(param RequestExecuteBillQuery) (*QueryResult, | ||
75 | if err != nil { | 75 | if err != nil { |
76 | return nil, err | 76 | return nil, err |
77 | } | 77 | } |
78 | - queryResult := newQueryResult(dataByte, param.FieldKeys) | 78 | + queryResult := newBillQueryResult(dataByte, param.FieldKeys) |
79 | return queryResult, queryResult.Error() | 79 | return queryResult, queryResult.Error() |
80 | } | 80 | } |
81 | + | ||
82 | +//QueryGroupInfo 分组信息查询 | ||
83 | +func (c *Client) QueryGroupInfo() { | ||
84 | + | ||
85 | +} |
1 | -package material | ||
2 | - | ||
3 | -//物料数据字段 | ||
4 | - | ||
5 | -//FormId | ||
6 | -const ( | ||
7 | - FORM_ID_BD_MATERIAL string = "BD_MATERIAL" | ||
8 | -) | ||
9 | - | ||
10 | -//物料字段FieldKey 描述 | ||
11 | -const ( | ||
12 | - //物料表主键 | ||
13 | - FMATERIALID string = "FMATERIALID" | ||
14 | - /* | ||
15 | - 数据状态,对应描述如下 | ||
16 | - "Z":暂存,"A":创建,"B":审核中,"C":已审核,"D":重新审核 | ||
17 | - */ | ||
18 | - FDocumentStatus string = "FDocumentStatus" | ||
19 | - //物料名称 | ||
20 | - FName string = "FName" | ||
21 | - //物料编码 | ||
22 | - FNumber string = "FNumber" | ||
23 | - //规格型号 | ||
24 | - FSpecification string = "FSpecification" | ||
25 | - /* | ||
26 | - 禁用状态,对应描述如下 | ||
27 | - "A":否,"B":是 | ||
28 | - */ | ||
29 | - FForbidStatus string = "FForbidStatus" | ||
30 | - /* | ||
31 | - 物料属性 | ||
32 | - 10:资产,9:配置,2:自制,11:费用,12:模型,5:虚拟,7:一次性 | ||
33 | - 12:产品系列,3:委外,4:特征,6:服务,1:外购 | ||
34 | - */ | ||
35 | - FErpClsID string = "FErpClsID" | ||
36 | - //基本单位id | ||
37 | - FBASEUNITID string = "FBaseUnitId" | ||
38 | - //基本单位 名称 | ||
39 | - FBaseUnitId_FName string = "FBaseUnitId.FName" | ||
40 | - //创建日期 如:"2022-01-08T19:36:06.843" | ||
41 | - FCreateDate string = "FCreateDate" | ||
42 | - //修改日期 如: "2022-01-08T19:36:06.843" | ||
43 | - FModifyDate string = "FModifyDate" | ||
44 | - //禁用日期 如:"2022-01-08T19:36:06.843" | ||
45 | - FForbidDate string = "FForbidDate" | ||
46 | - //审核日期 如:"2022-01-08T19:36:06.843" | ||
47 | - FApproveDate string = "FApproveDate" | ||
48 | - //物料分组id | ||
49 | - FMaterialGroup string = "FMaterialGroup" | ||
50 | - //物料分组名称 | ||
51 | - FMaterialGroup_FName string = "FMaterialGroup.FName" | ||
52 | - /* | ||
53 | - 是否使用 | ||
54 | - 1:是,0:否 | ||
55 | - */ | ||
56 | - FRefStatus string = "FRefStatus" | ||
57 | - // ...其他有需要的在补充 | ||
58 | -) |
@@ -30,26 +30,25 @@ func (qe QueryError) Error() string { | @@ -30,26 +30,25 @@ func (qe QueryError) Error() string { | ||
30 | return str | 30 | return str |
31 | } | 31 | } |
32 | 32 | ||
33 | -/*QueryResult 单据查询结果 | 33 | +/*BillQueryResult 单据查询结果 |
34 | 当接口调用失败时得到的json 结构对应[][]QueryError,如: | 34 | 当接口调用失败时得到的json 结构对应[][]QueryError,如: |
35 | [[{"Result":{"ResponseStatus":{"Errors":[{"Message":"元数据中标识为FUseOrg的字段不存在"}]}}}]] | 35 | [[{"Result":{"ResponseStatus":{"Errors":[{"Message":"元数据中标识为FUseOrg的字段不存在"}]}}}]] |
36 | 当接口调用成功的得到的json结构对应[][]interface{},如: | 36 | 当接口调用成功的得到的json结构对应[][]interface{},如: |
37 | [["xxx","abc",2345]] | 37 | [["xxx","abc",2345]] |
38 | */ | 38 | */ |
39 | -type QueryResult struct { | 39 | +type BillQueryResult struct { |
40 | FieldKeys []string //对应的键名 ,注意数据的顺序 | 40 | FieldKeys []string //对应的键名 ,注意数据的顺序 |
41 | Buf []byte //原始的数据byte | 41 | Buf []byte //原始的数据byte |
42 | - | ||
43 | } | 42 | } |
44 | 43 | ||
45 | -func newQueryResult(buf []byte, keys string) *QueryResult { | ||
46 | - return &QueryResult{ | 44 | +func newBillQueryResult(buf []byte, keys string) *BillQueryResult { |
45 | + return &BillQueryResult{ | ||
47 | Buf: buf, | 46 | Buf: buf, |
48 | FieldKeys: strings.Split(keys, ","), | 47 | FieldKeys: strings.Split(keys, ","), |
49 | } | 48 | } |
50 | } | 49 | } |
51 | 50 | ||
52 | -func (result *QueryResult) ToMapString() []map[string]string { | 51 | +func (result *BillQueryResult) ToMapString() []map[string]string { |
53 | if result.IsError() { | 52 | if result.IsError() { |
54 | return nil | 53 | return nil |
55 | } | 54 | } |
@@ -70,7 +69,7 @@ func (result *QueryResult) ToMapString() []map[string]string { | @@ -70,7 +69,7 @@ func (result *QueryResult) ToMapString() []map[string]string { | ||
70 | return mapResult | 69 | return mapResult |
71 | } | 70 | } |
72 | 71 | ||
73 | -func (result *QueryResult) ToMap() []map[string]interface{} { | 72 | +func (result *BillQueryResult) ToMap() []map[string]interface{} { |
74 | if result.IsError() { | 73 | if result.IsError() { |
75 | return nil | 74 | return nil |
76 | } | 75 | } |
@@ -91,7 +90,7 @@ func (result *QueryResult) ToMap() []map[string]interface{} { | @@ -91,7 +90,7 @@ func (result *QueryResult) ToMap() []map[string]interface{} { | ||
91 | return mapResult | 90 | return mapResult |
92 | } | 91 | } |
93 | 92 | ||
94 | -func (result *QueryResult) Error() error { | 93 | +func (result *BillQueryResult) Error() error { |
95 | var ( | 94 | var ( |
96 | errMsg QueryError | 95 | errMsg QueryError |
97 | err error | 96 | err error |
@@ -112,11 +111,11 @@ func (result *QueryResult) Error() error { | @@ -112,11 +111,11 @@ func (result *QueryResult) Error() error { | ||
112 | } | 111 | } |
113 | 112 | ||
114 | //TODO 将结果解析为结构体 | 113 | //TODO 将结果解析为结构体 |
115 | -// func (result *QueryResult) ToStruct(v interface{}) error { | 114 | +// func (result *BillQueryResult) ToStruct(v interface{}) error { |
116 | // return nil | 115 | // return nil |
117 | // } | 116 | // } |
118 | 117 | ||
119 | -func (result *QueryResult) IsError() bool { | 118 | +func (result *BillQueryResult) IsError() bool { |
120 | jResult := gjson.ParseBytes(result.Buf) | 119 | jResult := gjson.ParseBytes(result.Buf) |
121 | for _, arr1 := range jResult.Array() { | 120 | for _, arr1 := range jResult.Array() { |
122 | for _, item := range arr1.Array() { | 121 | for _, item := range arr1.Array() { |
@@ -4,7 +4,7 @@ import "testing" | @@ -4,7 +4,7 @@ import "testing" | ||
4 | 4 | ||
5 | func TestErrorResult(t *testing.T) { | 5 | func TestErrorResult(t *testing.T) { |
6 | jsonByte := []byte(`[[{"Result":{"ResponseStatus":{"ErrorCode":500,"IsSuccess":false,"Errors":[{"FieldName":null,"Message":"元数据中标识为FUseOrg的字段不存在","DIndex":0}],"SuccessEntitys":[],"SuccessMessages":[],"MsgCode":9}}}]]`) | 6 | jsonByte := []byte(`[[{"Result":{"ResponseStatus":{"ErrorCode":500,"IsSuccess":false,"Errors":[{"FieldName":null,"Message":"元数据中标识为FUseOrg的字段不存在","DIndex":0}],"SuccessEntitys":[],"SuccessMessages":[],"MsgCode":9}}}]]`) |
7 | - result := newQueryResult(jsonByte, "") | 7 | + result := newBillQueryResult(jsonByte, "") |
8 | if !result.IsError() { | 8 | if !result.IsError() { |
9 | t.Error("没有正确识别错误的消息数据") | 9 | t.Error("没有正确识别错误的消息数据") |
10 | return | 10 | return |
@@ -24,7 +24,7 @@ func TestErrorResult(t *testing.T) { | @@ -24,7 +24,7 @@ func TestErrorResult(t *testing.T) { | ||
24 | 24 | ||
25 | func TestRightResult(t *testing.T) { | 25 | func TestRightResult(t *testing.T) { |
26 | jsonByte := []byte(`[["xxx","abc",2345],["xxa","abc1",23457],["xxb","abc2",23458]]`) | 26 | jsonByte := []byte(`[["xxx","abc",2345],["xxa","abc1",23457],["xxb","abc2",23458]]`) |
27 | - result := newQueryResult(jsonByte, "name,desc,number") | 27 | + result := newBillQueryResult(jsonByte, "name,desc,number") |
28 | if result.IsError() { | 28 | if result.IsError() { |
29 | t.Error("数据解析失败") | 29 | t.Error("数据解析失败") |
30 | return | 30 | return |
pkg/infrastructure/utils/k3cloud/readme.md
0 → 100644
1 | +## API | ||
2 | + | ||
3 | +| 名称 | 链接 | | ||
4 | +| -------------- | ---------------------------------------------------------------------------------- | | ||
5 | +| _登陆验证接口_ | /Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc | | ||
6 | +| _单据查询_ | /Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc | | ||
7 | +| _元数据查询_ | /Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.QueryBusinessInfo.common.kdsvc | | ||
8 | +| | | | ||
9 | +| | | | ||
10 | + | ||
11 | +## FORMID | ||
12 | + | ||
13 | +| FORMID | 模块 | 备注 | | ||
14 | +| :---------------- | --------------------------- | ---- | | ||
15 | +| BD_MATERIAL | 基础管理-基础资料-物料 | | | ||
16 | +| SAL_MATERIALGROUP | 基础管理-基础资料-物料-分组 | | | ||
17 | +| | | | | ||
18 | + | ||
19 | +## 物料字段描述(部分) | ||
20 | + | ||
21 | +| 字段名 | 备注 | | ||
22 | +| -------------------- | ------------------------------------------------------------------------------------------------------------- | | ||
23 | +| FMATERIALID | 物料表主键 | | ||
24 | +| FDocumentStatus | _数据状态,对应描述如下_ _"Z":暂存,"A":创建,"B":审核中,"C":已审核,"D":重新审核_ | | ||
25 | +| FName | _物料名称_ | | ||
26 | +| FNumber | _物料编码_ | | ||
27 | +| FSpecification | _规格型号_ | | ||
28 | +| FForbidStatus | _禁用状态,对应描述如下_"A":否,"B":是 | | ||
29 | +| FErpClsID | _物料属性_ _10:资产,9:配置,2:自制,11:费用,12:模型,5:虚拟,7:一次性_ _12:产品系列,3:委外,4:特征,6:服务,1:外购_ | | ||
30 | +| FBaseUnitId | _基本单位 id_ | | ||
31 | +| FBaseUnitId.FName | _基本单位名称_ | | ||
32 | +| FCreateDate | _创建日期 如:"2022-01-08T19:36:06.843"_ | | ||
33 | +| FModifyDate | _修改日期 如: "2022-01-08T19:36:06.843"_ | | ||
34 | +| FForbidDate | _禁用日期 如:"2022-01-08T19:36:06.843"_ | | ||
35 | +| FApproveDate | _审核日期 如:"2022-01-08T19:36:06.843"_ | | ||
36 | +| FMaterialGroup | _物料分组 id_ | | ||
37 | +| FMaterialGroup.FName | _物料分组名称_ | | ||
38 | +| FRefStatus | _是否使用_ _1:是,0:否_ | | ||
39 | +| | | | ||
40 | + | ||
41 | +### 分组列表字段描述 | ||
42 | + | ||
43 | +| 字段名 | 备注 | 类型 | | ||
44 | +| --------- | --------- | -------- | | ||
45 | +| FID | 表主键 id | 整型数字 | | ||
46 | +| FNumber | 分组编码 | 字符串 | | ||
47 | +| FName | 分组名称 | 字符串 | | ||
48 | +| FParentId | 上级分组 | 字符串 | | ||
49 | +| | | | |
-
请 注册 或 登录 后发表评论