| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- package dingtalk
- import (
- "dashoo.cn/opms_libary/plugin/dingtalk/workflow"
- "dashoo.cn/opms_libary/utils"
- "fmt"
- "testing"
- )
- func TestQuerySchemaByProcessCode(t *testing.T) {
- client := NewClient()
- w := client.GetWorkflow()
- s, _ := w.QuerySchemaByProcessCode("PROC-7A5F6215-A8CF-4DD1-AB2C-5B1AB84C4E19")
- fmt.Println(s)
- }
- func TestSign(t *testing.T) {
- client := NewClient()
- s := client.GetJsapi()
- //s.Sign("", "")
- fmt.Println(s)
- }
- func TestStartProcessInstance(t *testing.T) {
- client := NewClient()
- w := client.GetWorkflow()
- TextField_1QEXO83G7GDC0 := &workflow.StartProcessInstanceRequestFormComponentValues{
- Id: utils.String("TextField_1QEXO83G7GDC0"),
- Name: utils.String("客户编码"),
- Value: utils.String("CT00001"),
- }
- TextField_13MDZ97RV16K0 := &workflow.StartProcessInstanceRequestFormComponentValues{
- Id: utils.String("TextField_13MDZ97RV16K0"),
- Name: utils.String("客户名称"),
- Value: utils.String("测试客户"),
- }
- TextField_1ZY48VZY6WG00 := &workflow.StartProcessInstanceRequestFormComponentValues{
- Id: utils.String("TextField_1ZY48VZY6WG00"),
- Name: utils.String("申请人"),
- Value: utils.String("系统管理员"),
- }
- TextareaField_5U6VKA6N1VK0 := &workflow.StartProcessInstanceRequestFormComponentValues{
- Id: utils.String("TextareaField_5U6VKA6N1VK0"),
- Name: utils.String("申请说明"),
- Value: utils.String("申请说明"),
- }
- //DDAttachment_17PC5KQBVEM80 := &workflow.StartProcessInstanceRequestFormComponentValues{
- // Id: tea.String("DDAttachment_17PC5KQBVEM80"),
- // Name: tea.String("附件"),
- // Value: tea.String("123xxxxxxxx"),
- //}
- startProcessInstanceRequest := &workflow.StartProcessInstanceRequest{
- OriginatorUserId: utils.String("47073111989114"),
- ProcessCode: utils.String("PROC-FE42B2D1-6097-4DE8-8AC5-23541B7D5C8A"),
- DeptId: utils.Int64(435711466),
- FormComponentValues: []*workflow.StartProcessInstanceRequestFormComponentValues{TextField_1QEXO83G7GDC0, TextField_13MDZ97RV16K0, TextField_1ZY48VZY6WG00, TextareaField_5U6VKA6N1VK0},
- }
- //w.StartProcessInstance("47073111989114", "PROC-7A5F6215-A8CF-4DD1-AB2C-5B1AB84C4E19", 435711466) 8xljy04PZiS9iPxp5PhDnUzQiEiE
- resp, _ := w.StartProcessInstance(startProcessInstanceRequest)
- fmt.Println(resp)
- }
- func TestQueryUserInfoByPhone(t *testing.T) {
- client := NewClient()
- c := client.GetContact()
- resp1 := c.QueryUserIdByPhone("18653295560")
- resp2 := c.QueryUserInfoByUserId(resp1.Result.Userid)
- fmt.Println(resp2)
- }
|