You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.5 KiB
Go

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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))
}