package service import ( "cu-helper/cus-eng-con-sys/config" "cu-helper/cus-eng-con-sys/cryptokit" "cu-helper/cus-eng-con-sys/model" "strings" "github.com/mizuki1412/go-core-kit/class/exception" "github.com/mizuki1412/go-core-kit/service/logkit" ) // ReqAccApply 验收申请请求 /* 验收申请分2个步骤进行 1、获取下一步办理人员Assignee 2、提交验收申请请求 */ func ReqAccApply(ctx *model.Ctx) { //这里YSQR指的是下一个步骤,获取下一个步骤办理人员 id := getAssigneeId(ctx, "YSQR") reqAccApplyPushProcess(ctx, id) } func reqAccApplyPushProcess(ctx *model.Ctx, assigneeId string) { remandId := getRemandId(ctx) token := getToken(ctx.RestyClient) processInstanceId := ctx.Data.Get("processInstanceId").String() processDefinitionKey := ctx.Data.Get("processDefinitionKey").String() taskId := ctx.Data.Get("id").String() html1 := toAcceptanceConfirm2(ctx, remandId) html2 := toRemandShowCommon(ctx.RestyClient, remandId) h := model.NewHeader("application/x-www-form-urlencoded; charset=UTF-8") header := h.GenReqParam() f := model.NewAccApplyPushProcess(token, remandId, processInstanceId, taskId, html1, html2, assigneeId, processDefinitionKey) form := f.GenReqParam() client := ctx.RestyClient resp, err := client.R(). SetHeaders(header).SetFormData(form).Post(config.UrlPrefix + "/zjgd/frm/acceptanceController/pushProcess.action") if err != nil { panic(exception.New(err.Error())) } data := strings.Trim(resp.String(), `"`) logkit.Info("accApplyPushProcess:" + cryptokit.Decrypt(data)) }