|
|
@@ -8,6 +8,7 @@ import (
|
|
|
"mtp2_if/logger"
|
|
|
"mtp2_if/models"
|
|
|
"mtp2_if/services/tencent"
|
|
|
+ "mtp2_if/utils"
|
|
|
"net/http"
|
|
|
"strconv"
|
|
|
|
|
|
@@ -93,14 +94,6 @@ func QianNotice(c *gin.Context) {
|
|
|
appG.Response(http.StatusOK, e.SUCCESS, "ok")
|
|
|
}
|
|
|
|
|
|
-type CreateConsoleLoginUrlReq struct {
|
|
|
- AreaUserId int `form:"areaUserId" binding:"required"` // 机构ID
|
|
|
-}
|
|
|
-
|
|
|
-type CreateConsoleLoginUrlRsp struct {
|
|
|
- ConsoleUrl string `json:"consoleUrl"` // 电子签控制台登录链接
|
|
|
-}
|
|
|
-
|
|
|
// CreateConsoleLoginUrl 创建电子签控制台登录链接
|
|
|
// @Summary 创建电子签控制台登录链接
|
|
|
// @Produce json
|
|
|
@@ -113,20 +106,11 @@ type CreateConsoleLoginUrlRsp struct {
|
|
|
func CreateConsoleLoginUrl(c *gin.Context) {
|
|
|
appG := app.Gin{C: c}
|
|
|
|
|
|
- // 获取请求参数
|
|
|
- var req CreateConsoleLoginUrlReq
|
|
|
- if err := appG.C.ShouldBindQuery(&req); err != nil {
|
|
|
- logger.GetLogger().Errorf("CreateConsoleLoginUrl failed: %s", err.Error())
|
|
|
- appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
|
|
|
- return
|
|
|
- }
|
|
|
+ agent := utils.SetAgent()
|
|
|
+ proxyOrganizationName := "天津麦顿"
|
|
|
+ response, _ := tencent.CreateConsoleLoginUrl(agent, proxyOrganizationName)
|
|
|
|
|
|
- if response, err := tencent.CreateConsoleLoginUrl(req.AreaUserId); err != nil {
|
|
|
- unquotedStr, _ := strconv.Unquote(response.ToJsonString())
|
|
|
- appG.Response(http.StatusOK, e.SUCCESS, CreateConsoleLoginUrlRsp{ConsoleUrl: unquotedStr})
|
|
|
- } else {
|
|
|
- appG.ResponseByMsg(http.StatusBadRequest, e.ERROR, err.Error(), nil)
|
|
|
- }
|
|
|
+ appG.Response(http.StatusOK, e.SUCCESS, response.ToJsonString())
|
|
|
}
|
|
|
|
|
|
type InitTencentESSReq struct {
|
|
|
@@ -235,12 +219,12 @@ func CreateFlowByTemplateDirectly(c *gin.Context) {
|
|
|
}
|
|
|
|
|
|
// 构建电子签平台合同模板名称
|
|
|
- // 格式:合同模板名称_类型标志;例如 "风险提示书_P",个人为P企业为E
|
|
|
+ // 格式:所属会员ID_类型标志_合同模板名称;例如 "1000_P_风险提示书",个人为P企业为A
|
|
|
flag := "P"
|
|
|
if req.UserType == 2 {
|
|
|
- flag = "E"
|
|
|
+ flag = "A"
|
|
|
}
|
|
|
- tmplateName := fmt.Sprintf("%s_%s", record.TEMPLATENAME, flag)
|
|
|
+ tmplateName := fmt.Sprintf("%s_%s_%s", strconv.Itoa(int(record.AREAUSERID)), flag, record.TEMPLATENAME)
|
|
|
|
|
|
personName := ""
|
|
|
personMobile := ""
|
|
|
@@ -267,7 +251,6 @@ func CreateFlowByTemplateDirectly(c *gin.Context) {
|
|
|
|
|
|
type GetFlowStatusReq struct {
|
|
|
ContractNo string `form:"contractno" binding:"required"` // 合同编号
|
|
|
- AreaUserId int `form:"areaUserId" binding:"required"` // 机构ID
|
|
|
}
|
|
|
|
|
|
// GetFlowStatus 获取合同状态
|
|
|
@@ -276,7 +259,6 @@ type GetFlowStatusReq struct {
|
|
|
// @Security ApiKeyAuth
|
|
|
// @accept application/json
|
|
|
// @Param contractno query string true "合同编号"
|
|
|
-// @Param areaUserId query int true "机构ID"
|
|
|
// @Success 200 {object} int "记录状态 - 1:未签署 2:签署中 3:已签署 4:签署拒绝"
|
|
|
// @Failure 500 {object} app.Response
|
|
|
// @Router /Tencent/GetFlowStatus [get]
|
|
|
@@ -292,7 +274,7 @@ func GetFlowStatus(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if recordStatus, err := tencent.GetFlowStatus(req.ContractNo, req.AreaUserId); err == nil {
|
|
|
+ if recordStatus, err := tencent.GetFlowStatus(req.ContractNo); err == nil {
|
|
|
appG.Response(http.StatusOK, e.SUCCESS, recordStatus)
|
|
|
} else {
|
|
|
appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
|