2 Commits a302c915a3 ... 148a51a1dd

Autore SHA1 Messaggio Data
  muchinfo 148a51a1dd Merge branch 'master' of http://192.168.31.240:3000/MTP2.0_New/MTP20_IF 3 settimane fa
  muchinfo 3926bbd3af update 3 settimane fa

+ 9 - 9
config/config.xml

@@ -53,16 +53,16 @@
     <Password value="123456"/>
   </MySQLSetting>
 <Tencent>
-  <Enabled value="0"/>
-  <SecretId value=""/>
-  <SecretKey value=""/>
+  <Enabled value="1"/>
+  <SecretId value="AKIDPktwvneP2WqxvmWFsMclmfLLKDyrbAXp"/>
+  <SecretKey value="GNH9tX8c6Wls02vhNzUvdLuGMYfeVErM"/>
   <EndPoint value="essbasic.tencentcloudapi.com"/>
-  <AppId value=""/>
-  <ProxyOrganizationName value=""/>
-  <ProxyOrganizationOpenId value=""/>
-  <ProxyOperatorOpenId value=""/>
-  <SignToken value=""/>
-  <SignKey value=""/>
+  <AppId value="yDtr0UUh4ovhh2UxWcABZ1mEOVsJC517"/>
+  <ProxyOrganizationName value="广西三农互联网平台有限公司"/>
+  <ProxyOrganizationOpenId value="GXSN"/>
+  <ProxyOperatorOpenId value="GXSN_LEGAL"/>
+  <SignToken value="ED0AA210B83F48ADB2DADAA1437D9B2B"/>
+  <SignKey value="E3A12EBDEBFA4A57A38159C32B5DDCF3"/>
 </Tencent>
   <Asign>
     <Url value="https://oapi.asign.cn"/>

+ 4 - 0
config/readme.md

@@ -289,6 +289,10 @@ YKHJ_LEGAL - 法人(甲方自动签署)
 
 ### 广西三农业互联网平台有限公司 - 正式环境
 
+GXSN_LEGAL - 法人 yDtr0UUh4a0rb9UEy67AP1NMWIfvmN04
+GXSN_ADMIN - 管理员
+GXSN_TEST - 测试账号(已删除) yDtzsUU8a27y23Uxnzh7kBgn5NN3qb6m
+
 ```xml
 <Tencent>
   <Enabled value="1"/>

+ 4 - 4
controllers/guangzuan/tradeService.go

@@ -18,8 +18,8 @@ import (
 // @Security Group
 // @Param    userid   query    int    true  "用户ID"
 // @Param    executestatus query    int false "执行状态 - 1:未生效 2:进行中 3:已结束"
-// @Param    page     query    int    false "页码"
-// @Param    pagesize query    int    false "每页条数"
+// @Param    page          query    int false "页码"
+// @Param    pagesize      query    int false "每页条数"
 // @Success  200           {array}  models.GzcjjcorderM
 // @Failure  500     {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrder [get]
@@ -39,8 +39,8 @@ func QueryGZCJJCOrder(c *gin.Context) {
 // @Security Group
 // @Param    userid        query    int true  "用户ID"
 // @Param    orderid  query    string false "单据ID"
-// @Param    page          query    int false "页码"
-// @Param    pagesize      query    int false "每页条数"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
 // @Success  200      {array}  models.GzcjjcorderdetailM
 // @Failure  500           {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrderDetail [get]

+ 36 - 0
controllers/tencent/test.go

@@ -31,6 +31,42 @@ func CreateConsoleLoginUrl(c *gin.Context) {
 	appG.Response(http.StatusOK, e.SUCCESS, *response.Response.ConsoleUrl)
 }
 
+// DescribeIntegrationEmployees 查询企业员工信息列表
+// @Summary  查询企业员工信息列表
+// @Produce  json
+// @Security ApiKeyAuth
+// @accept   application/json
+// @Success  200 {object} app.Response
+// @Failure  500 {object} app.Response
+// @Router   /Tencent/DescribeIntegrationEmployees [post]
+// @Tags     腾讯电子签
+func DescribeIntegrationEmployees(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	agent := utils.SetAgent(nil, nil, nil)
+	response, _ := tencent.DescribeIntegrationEmployees(agent)
+
+	appG.Response(http.StatusOK, e.SUCCESS, response.Response.Employees)
+}
+
+// SyncProxyOrganizationOperators 企业员工离职
+// @Summary  企业员工离职
+// @Produce  json
+// @Security ApiKeyAuth
+// @accept   application/json
+// @Success  200 {object} app.Response
+// @Failure  500 {object} app.Response
+// @Router   /Tencent/SyncProxyOrganizationOperators [post]
+// @Tags     腾讯电子签
+func SyncProxyOrganizationOperators(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	agent := utils.SetAgent(nil, nil, nil)
+	response, _ := tencent.SyncProxyOrganizationOperators(agent)
+
+	appG.Response(http.StatusOK, e.SUCCESS, response.Response)
+}
+
 type GetTemplateInfoReq struct {
 	ContractName string `form:"contractName" binding:"required"` // 合同模块名称
 }

+ 66 - 0
docs/docs.go

@@ -19749,6 +19749,39 @@ const docTemplate = `{
                 }
             }
         },
+        "/Tencent/DescribeIntegrationEmployees": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "腾讯电子签"
+                ],
+                "summary": "查询企业员工信息列表",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Tencent/GetFlowStatus": {
             "get": {
                 "security": [
@@ -20007,6 +20040,39 @@ const docTemplate = `{
                 }
             }
         },
+        "/Tencent/SyncProxyOrganizationOperators": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "腾讯电子签"
+                ],
+                "summary": "企业员工离职",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/TencentCloud/BankCard4": {
             "post": {
                 "security": [

+ 66 - 0
docs/swagger.json

@@ -19741,6 +19741,39 @@
                 }
             }
         },
+        "/Tencent/DescribeIntegrationEmployees": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "腾讯电子签"
+                ],
+                "summary": "查询企业员工信息列表",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Tencent/GetFlowStatus": {
             "get": {
                 "security": [
@@ -19999,6 +20032,39 @@
                 }
             }
         },
+        "/Tencent/SyncProxyOrganizationOperators": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "腾讯电子签"
+                ],
+                "summary": "企业员工离职",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/TencentCloud/BankCard4": {
             "post": {
                 "security": [

+ 40 - 0
docs/swagger.yaml

@@ -45380,6 +45380,26 @@ paths:
       summary: 通过合同模板名称直接发起签署流程
       tags:
       - 腾讯电子签
+  /Tencent/DescribeIntegrationEmployees:
+    post:
+      consumes:
+      - application/json
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/app.Response'
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询企业员工信息列表
+      tags:
+      - 腾讯电子签
   /Tencent/GetFlowStatus:
     get:
       consumes:
@@ -45541,6 +45561,26 @@ paths:
       summary: 查询用户电子签记录表
       tags:
       - 腾讯电子签
+  /Tencent/SyncProxyOrganizationOperators:
+    post:
+      consumes:
+      - application/json
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            $ref: '#/definitions/app.Response'
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 企业员工离职
+      tags:
+      - 腾讯电子签
   /TencentCloud/BankCard4:
     post:
       consumes:

+ 1 - 1
go.mod

@@ -65,7 +65,7 @@ require (
 	github.com/swaggo/files v1.0.1
 	github.com/swaggo/gin-swagger v1.6.0
 	github.com/swaggo/swag v1.16.2
-	github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1050
+	github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.48
 	github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/essbasic v1.0.772
 	github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/faceid v1.0.1050
 	go.mongodb.org/mongo-driver v1.4.0

+ 2 - 1
go.sum

@@ -251,8 +251,9 @@ github.com/tealeg/xlsx v1.0.5/go.mod h1:btRS8dz54TDnvKNosuAqxrM1QgN1udgk9O34bDCn
 github.com/tebeka/strftime v0.1.3 h1:5HQXOqWKYRFfNyBMNVc9z5+QzuBtIXy03psIhtdJYto=
 github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ=
 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.772/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
-github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1050 h1:SnzAe4ntwwrUf0jzgxE5Qm7wH8atRwvaDT+njfNExJ4=
 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1050/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.48 h1:aoRUrz2ag27jQWcOKHgeE+toSti6/xPqHKMLruOtJuM=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.48/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/essbasic v1.0.772 h1:iD060QlYTUVdEJ3stHhLZzuTYtKFuTbsMCygrcSisaM=
 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/essbasic v1.0.772/go.mod h1:4zkfwdL6iHCeCd+WTi9ngH2//I5dkM+n0J5b18t1MQQ=
 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/faceid v1.0.1050 h1:fH0/hKqwMgT2H9qPy3yqs/Tj+cAoyGyTw5JdQdpv+MU=

+ 4 - 0
routers/router.go

@@ -893,6 +893,10 @@ func InitRouter() *gin.Engine {
 		tencentR.Use(token.Auth()).POST("InitMdUserSwapProtocol", tencent.InitMdUserSwapProtocol)
 
 		tencentR.Use(token.Auth()).GET("GetTemplateInfo", tencent.GetTemplateInfo)
+
+		tencentR.Use(token.Auth()).POST("DescribeIntegrationEmployees", tencent.DescribeIntegrationEmployees)
+		tencentR.Use(token.Auth()).POST("SyncProxyOrganizationOperators", tencent.SyncProxyOrganizationOperators)
+
 	}
 
 	// ************************* 腾讯云 *************************

+ 10 - 0
services/tencent/ess.go

@@ -24,6 +24,16 @@ func CreateConsoleLoginUrl(agent *essbasic.Agent, proxyOrganizationName string)
 	return
 }
 
+func DescribeIntegrationEmployees(agent *essbasic.Agent) (response *essbasic.ChannelDescribeEmployeesResponse, err error) {
+	response, err = essapi.DescribeIntegrationEmployees(agent)
+	return
+}
+
+func SyncProxyOrganizationOperators(agent *essbasic.Agent) (response *essbasic.SyncProxyOrganizationOperatorsResponse, err error) {
+	response, err = essapi.SyncProxyOrganizationOperators(agent)
+	return
+}
+
 // InitTencentESS 按用户ID和机构ID创建腾讯电子签业务信息
 func InitTencentESS(userId, areaUserId int) (err error) {
 	esignTemplateConfigs, err := models.QueryEsignTemplateConfigs(2, 4)

+ 48 - 0
services/tencent/essapi/CreateConsoleLoginUrl.go

@@ -29,3 +29,51 @@ func CreateConsoleLoginUrl(agent *essbasic.Agent, proxyOrganizationName string)
 
 	return
 }
+
+func DescribeIntegrationEmployees(agent *essbasic.Agent) (response *essbasic.ChannelDescribeEmployeesResponse, err error) {
+	if utils.TencentESSClient == nil {
+		err = fmt.Errorf("腾讯电子签客户端未初始化")
+		logger.GetLogger().Errorf("DescribeIntegrationEmployees failed: %s", err.Error())
+		return
+	}
+
+	// 实例化一个请求对象,每个接口都会对应一个request对象
+	request := essbasic.NewChannelDescribeEmployeesRequest()
+	request.Agent = agent
+	limit := int64(20)
+	request.Limit = &limit
+
+	response, err = utils.TencentESSClient.ChannelDescribeEmployees(request)
+	if _, ok := err.(*errors.TencentCloudSDKError); ok {
+		logger.GetLogger().Errorf("DescribeIntegrationEmployees failed: %s", err.Error())
+		return
+	}
+
+	return
+}
+
+func SyncProxyOrganizationOperators(agent *essbasic.Agent) (response *essbasic.SyncProxyOrganizationOperatorsResponse, err error) {
+	if utils.TencentESSClient == nil {
+		err = fmt.Errorf("腾讯电子签客户端未初始化")
+		logger.GetLogger().Errorf("SyncProxyOrganizationOperators failed: %s", err.Error())
+		return
+	}
+
+	// 实例化一个请求对象,每个接口都会对应一个request对象
+	request := essbasic.NewSyncProxyOrganizationOperatorsRequest()
+	request.Agent = agent
+	request.OperatorType = utils.SetPointValue("RESIGN")
+	request.ProxyOrganizationOperators = []*essbasic.ProxyOrganizationOperator{
+		&essbasic.ProxyOrganizationOperator{
+			Id: utils.SetPointValue("GXSN_TEST"),
+		},
+	}
+
+	response, err = utils.TencentESSClient.SyncProxyOrganizationOperators(request)
+	if _, ok := err.(*errors.TencentCloudSDKError); ok {
+		logger.GetLogger().Errorf("SyncProxyOrganizationOperators failed: %s", err.Error())
+		return
+	}
+
+	return
+}