|
@@ -1,59 +1,69 @@
|
|
|
package dingtalk
|
|
package dingtalk
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
|
+ "dashoo.cn/opms_libary/plugin/dingtalk/workflow"
|
|
|
|
|
+ "dashoo.cn/opms_libary/utils"
|
|
|
"fmt"
|
|
"fmt"
|
|
|
"testing"
|
|
"testing"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
func TestQuerySchemaByProcessCode(t *testing.T) {
|
|
func TestQuerySchemaByProcessCode(t *testing.T) {
|
|
|
client := NewClient()
|
|
client := NewClient()
|
|
|
|
|
+
|
|
|
w := client.GetWorkflow()
|
|
w := client.GetWorkflow()
|
|
|
s, _ := w.QuerySchemaByProcessCode("PROC-7A5F6215-A8CF-4DD1-AB2C-5B1AB84C4E19")
|
|
s, _ := w.QuerySchemaByProcessCode("PROC-7A5F6215-A8CF-4DD1-AB2C-5B1AB84C4E19")
|
|
|
|
|
|
|
|
fmt.Println(s)
|
|
fmt.Println(s)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func TestSign(t *testing.T) {
|
|
|
|
|
+ client := NewClient()
|
|
|
|
|
+ s := client.GetJsapi()
|
|
|
|
|
+ //s.Sign("", "")
|
|
|
|
|
+
|
|
|
|
|
+ fmt.Println(s)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
func TestStartProcessInstance(t *testing.T) {
|
|
func TestStartProcessInstance(t *testing.T) {
|
|
|
- //client := NewClient()
|
|
|
|
|
- //w := client.GetWorkflow()
|
|
|
|
|
- ////formComponentValues0Details0Details0 := &workflow.StartProcessInstanceRequestFormComponentValuesDetailsDetails{
|
|
|
|
|
- //// Id: tea.String("PhoneField_IZI2LP8QF6O0"),
|
|
|
|
|
- //// BizAlias: tea.String("Phone"),
|
|
|
|
|
- //// Name: tea.String("PhoneField"),
|
|
|
|
|
- //// Value: tea.String("123xxxxxxxx"),
|
|
|
|
|
- //// ExtValue: tea.String("总个数:1"),
|
|
|
|
|
- //// ComponentType: tea.String("PhoneField"),
|
|
|
|
|
- ////}
|
|
|
|
|
- ////formComponentValues0Details0 := &workflow.StartProcessInstanceRequestFormComponentValuesDetails{
|
|
|
|
|
- //// Id: tea.String("PhoneField_IZI2LP8QF6O0"),
|
|
|
|
|
- //// BizAlias: tea.String("Phone"),
|
|
|
|
|
- //// Name: tea.String("PhoneField"),
|
|
|
|
|
- //// Value: tea.String("123xxxxxxxx"),
|
|
|
|
|
- //// ExtValue: tea.String("总个数:1"),
|
|
|
|
|
- //// Details: []*workflow.StartProcessInstanceRequestFormComponentValuesDetailsDetails{formComponentValues0Details0Details0},
|
|
|
|
|
- ////}
|
|
|
|
|
- ////表单信息
|
|
|
|
|
- //TextField_1RC8GZWYGO4G0 := &workflow.StartProcessInstanceRequestFormComponentValues{
|
|
|
|
|
- // Id: tea.String("TextField_1RC8GZWYGO4G0"),
|
|
|
|
|
- // Name: tea.String("单行输入框"),
|
|
|
|
|
- // Value: tea.String("123xxxxxxxx"),
|
|
|
|
|
- //}
|
|
|
|
|
- //
|
|
|
|
|
|
|
+ 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{
|
|
//DDAttachment_17PC5KQBVEM80 := &workflow.StartProcessInstanceRequestFormComponentValues{
|
|
|
// Id: tea.String("DDAttachment_17PC5KQBVEM80"),
|
|
// Id: tea.String("DDAttachment_17PC5KQBVEM80"),
|
|
|
// Name: tea.String("附件"),
|
|
// Name: tea.String("附件"),
|
|
|
// Value: tea.String("123xxxxxxxx"),
|
|
// Value: tea.String("123xxxxxxxx"),
|
|
|
//}
|
|
//}
|
|
|
- //
|
|
|
|
|
- //startProcessInstanceRequest := &workflow.StartProcessInstanceRequest{
|
|
|
|
|
- // OriginatorUserId: tea.String("47073111989114"),
|
|
|
|
|
- // ProcessCode: tea.String("PROC-7A5F6215-A8CF-4DD1-AB2C-5B1AB84C4E19"),
|
|
|
|
|
- // DeptId: tea.Int64(435711466),
|
|
|
|
|
- // FormComponentValues: []*workflow.StartProcessInstanceRequestFormComponentValues{TextField_1RC8GZWYGO4G0, DDAttachment_17PC5KQBVEM80},
|
|
|
|
|
- //}
|
|
|
|
|
- ////w.StartProcessInstance("47073111989114", "PROC-7A5F6215-A8CF-4DD1-AB2C-5B1AB84C4E19", 435711466) 8xljy04PZiS9iPxp5PhDnUzQiEiE
|
|
|
|
|
- //resp, _ := w.StartProcessInstance(startProcessInstanceRequest)
|
|
|
|
|
- //fmt.Println(resp)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ 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) {
|
|
func TestQueryUserInfoByPhone(t *testing.T) {
|