Sfoglia il codice sorgente

增加企业风管相关客户资料操作接口

zhou.xiaoning 4 anni fa
parent
commit
bf18a7dffa
9 ha cambiato i file con 1228 aggiunte e 6 eliminazioni
  1. 1 1
      config/config.xml
  2. 40 1
      controllers/erms3/customer.go
  3. 39 0
      controllers/user/user.go
  4. 389 1
      docs/docs.go
  5. 389 1
      docs/swagger.json
  6. 282 1
      docs/swagger.yaml
  7. 83 0
      models/account.go
  8. 1 1
      models/quote.go
  9. 4 0
      routers/router.go

+ 1 - 1
config/config.xml

@@ -5,7 +5,7 @@
     <DebugMode value="1"/>
   </WebSetting>
   <LogSetting>
-    <LogPath value="/home/pub/mtp2.0/log/queryservice"/>
+    <LogPath value="./log"/>
     <LogLevel value="5"/>
   </LogSetting>
   <DbSetting>

+ 40 - 1
controllers/erms3/customer.go

@@ -23,7 +23,7 @@ type AddUserInfoApplyReq struct {
 // @Summary 新增客户申请
 // @Produce json
 // @Security ApiKeyAuth
-// @Param jsonBody body AddUserInfoApplyReq true "申请参数"
+// @Param jsonBody body AddUserInfoApplyReq true "用户信息"
 // @Success 200 {object} app.Response
 // @Failure 500 {object} app.Response
 // @Router /Erms3/AddUserInfoApply [post]
@@ -55,6 +55,45 @@ func AddUserInfoApply(c *gin.Context) {
 	appG.Response(http.StatusOK, e.SUCCESS, "OK")
 }
 
+// ModifyUserInfoApplyReq 修改客户申请请求参数
+type ModifyUserInfoApplyReq struct {
+	models.Wskhuserinfo
+}
+
+// ModifyUserInfoApply 修改客户申请
+// @Summary 修改客户申请
+// @description 保存草稿(撤回)- { "userid": int, "userstate": 1 }  提交审核 - { "userid": int, "userstate": 2 }
+// @Produce json
+// @Security ApiKeyAuth
+// @Param jsonBody body ModifyUserInfoApplyReq true "用户信息"
+// @Success 200 {object} app.Response
+// @Failure 500 {object} app.Response
+// @Router /Erms3/ModifyUserInfoApply [post]
+// @Tags 风险管理v3
+func ModifyUserInfoApply(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req ModifyUserInfoApplyReq
+	err := appG.C.ShouldBindJSON(&req)
+	if err != nil {
+		logger.GetLogger().Errorf("ModifyUserInfoApply failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	if err := models.UpdateWSKHUserInfo(req.Wskhuserinfo); err != nil {
+		// 执行失败
+		logger.GetLogger().Errorf("ModifyUserInfoApply failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.ERROR_OPERATION_FAILED, nil)
+		return
+	}
+
+	// 执行成功
+	logger.GetLogger().Debugln("ModifyUserInfoApply successed: %v", "OK")
+	appG.Response(http.StatusOK, e.SUCCESS, "OK")
+}
+
 // QueryUserInfoAppliesReq 客户申请信息查询请求参数
 type QueryUserInfoAppliesReq struct {
 	app.PageInfo

+ 39 - 0
controllers/user/user.go

@@ -366,3 +366,42 @@ func AddMessageBoard(c *gin.Context) {
 	logger.GetLogger().Debugln("AddMessageBoard successed: %v", "ok")
 	appG.Response(http.StatusOK, e.SUCCESS, "")
 }
+
+// UpdateUserAccountStatusReq 更新用户状态请求参数
+type UpdateUserAccountStatusReq struct {
+	UserID        int `json:"userID" binding:"required"`
+	AccountStatus int `json:"accountStatus" binding:"required"`
+}
+
+// UpdateUserAccountStatus 更新用户状态
+// @Summary 更新用户状态
+// @Produce json
+// @Security ApiKeyAuth
+// @Param userID query int true "用户ID"
+// @Param accountStatus query string true "账户状态 -  4:正常 6:注销(停用)"
+// @Success 200 {object} app.Response
+// @Failure 500 {object} app.Response
+// @Router /User/UpdateUserAccountStatus [post]
+// @Tags 用户信息
+func UpdateUserAccountStatus(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req UpdateUserAccountStatusReq
+	if err := appG.C.ShouldBind(&req); err != nil {
+		logger.GetLogger().Errorf("UpdateUserAccountStatus failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	if err := models.UpdateUserAccountStatus(req.UserID, req.AccountStatus); err != nil {
+		// 执行失败
+		logger.GetLogger().Errorf("UpdateUserAccountStatus failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		return
+	}
+
+	// 执行成功
+	logger.GetLogger().Debugln("UpdateUserAccountStatus successed: %v", "ok")
+	appG.Response(http.StatusOK, e.SUCCESS, "")
+}

+ 389 - 1
docs/docs.go

@@ -2120,7 +2120,7 @@ var doc = `{
                 "summary": "新增客户申请",
                 "parameters": [
                     {
-                        "description": "申请参数",
+                        "description": "用户信息",
                         "name": "jsonBody",
                         "in": "body",
                         "required": true,
@@ -2145,6 +2145,48 @@ var doc = `{
                 }
             }
         },
+        "/Erms3/ModifyUserInfoApply": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "保存草稿(撤回)- { \"userid\": int, \"userstate\": 1 }  提交审核 - { \"userid\": int, \"userstate\": 2 }",
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "风险管理v3"
+                ],
+                "summary": "修改客户申请",
+                "parameters": [
+                    {
+                        "description": "用户信息",
+                        "name": "jsonBody",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/erms3.ModifyUserInfoApplyReq"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Erms3/QueryBusinessInfo": {
             "get": {
                 "security": [
@@ -5159,6 +5201,52 @@ var doc = `{
                 }
             }
         },
+        "/User/UpdateUserAccountStatus": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "用户信息"
+                ],
+                "summary": "更新用户状态",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userID",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "账户状态 -  4:正常 6:注销(停用)",
+                        "name": "accountStatus",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WR/GetWRCategoryInfo": {
             "get": {
                 "produces": [
@@ -9126,6 +9214,306 @@ var doc = `{
                 }
             }
         },
+        "erms3.ModifyUserInfoApplyReq": {
+            "type": "object",
+            "required": [
+                "userid"
+            ],
+            "properties": {
+                "accountid": {
+                    "description": "交易系统帐号Id (加密存储)",
+                    "type": "integer"
+                },
+                "areacode": {
+                    "description": "机构代码",
+                    "type": "string"
+                },
+                "areaid": {
+                    "description": "机构Id",
+                    "type": "integer"
+                },
+                "attachment1": {
+                    "description": "附件1",
+                    "type": "string"
+                },
+                "attachment2": {
+                    "description": "附件2",
+                    "type": "string"
+                },
+                "attachment3": {
+                    "description": "附件3",
+                    "type": "string"
+                },
+                "attachment4": {
+                    "description": "附件4",
+                    "type": "string"
+                },
+                "attachment5": {
+                    "description": "附件5",
+                    "type": "string"
+                },
+                "auditedby": {
+                    "description": "审核人",
+                    "type": "string"
+                },
+                "auditime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "bankaccount": {
+                    "description": "银行帐号 (加密存储)",
+                    "type": "string"
+                },
+                "bankaccountname": {
+                    "description": "收款人名称",
+                    "type": "string"
+                },
+                "bankcardbackphotourl": {
+                    "description": "银行卡背面照地址",
+                    "type": "string"
+                },
+                "bankcardfrontphotourl": {
+                    "description": "银行卡正面照地址",
+                    "type": "string"
+                },
+                "bankid": {
+                    "description": "银行编码",
+                    "type": "string"
+                },
+                "bankname": {
+                    "description": "银行名称",
+                    "type": "string"
+                },
+                "bankpictureurl": {
+                    "description": "银行卡正面地址",
+                    "type": "string"
+                },
+                "biznature": {
+                    "description": "企业性质( 企业) - 1:国有控股企业 2:集体控股企业 3:私人控股企业 4:港澳台商控股企业 5:外商控股企业 6:其它",
+                    "type": "integer"
+                },
+                "bizscope": {
+                    "description": "企业经营范围(企业)",
+                    "type": "string"
+                },
+                "biztype": {
+                    "description": "企业类型 - 1:进口/生产 2:销售 3:零售 4:运输 5:仓储",
+                    "type": "integer"
+                },
+                "brokerid": {
+                    "description": "经纪人ID(加密存储)",
+                    "type": "string"
+                },
+                "cardaddress": {
+                    "description": "证件地址 (加密存储)",
+                    "type": "string"
+                },
+                "cardbackphotourl": {
+                    "description": "背面证件照地址",
+                    "type": "string"
+                },
+                "cardfrontphotourl": {
+                    "description": "正面证件照地址",
+                    "type": "string"
+                },
+                "cardnum": {
+                    "description": "证件号码 (加密存储)",
+                    "type": "string"
+                },
+                "cardtype": {
+                    "description": "证件类型",
+                    "type": "integer"
+                },
+                "cityid": {
+                    "description": "市",
+                    "type": "integer"
+                },
+                "company": {
+                    "description": "公司(个人)",
+                    "type": "string"
+                },
+                "contactcardbackphotourl": {
+                    "description": "联系人证件背面图片地址",
+                    "type": "string"
+                },
+                "contactcardfrontphotourl": {
+                    "description": "联系人证件正面图片地址",
+                    "type": "string"
+                },
+                "contactname": {
+                    "description": "联系人",
+                    "type": "string"
+                },
+                "countryid": {
+                    "description": "国家",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "开户申请时间",
+                    "type": "string"
+                },
+                "cusbankid": {
+                    "description": "签约类型",
+                    "type": "string"
+                },
+                "cusbankname": {
+                    "description": "签约类型名称",
+                    "type": "string"
+                },
+                "customername": {
+                    "description": "客户名称(企业名称)",
+                    "type": "string"
+                },
+                "districtid": {
+                    "description": "地区",
+                    "type": "integer"
+                },
+                "email": {
+                    "description": "Email地址(加密存储)",
+                    "type": "string"
+                },
+                "halfbodyphotourl": {
+                    "description": "半身照地址",
+                    "type": "string"
+                },
+                "headurl": {
+                    "description": "头像地址",
+                    "type": "string"
+                },
+                "ipaddress": {
+                    "description": "IP地址",
+                    "type": "string"
+                },
+                "isvalidate": {
+                    "description": "是否有效 (删除后标记为失效) - 0:无效  1:有效",
+                    "type": "string"
+                },
+                "legalcardbackphotourl": {
+                    "description": "法人身份证背面照地址",
+                    "type": "string"
+                },
+                "legalcardfrontphotourl": {
+                    "description": "法人身份证正面照地址",
+                    "type": "string"
+                },
+                "legalpersonname": {
+                    "description": "法人姓名(企业)",
+                    "type": "string"
+                },
+                "logincode": {
+                    "description": "登录帐号 (加密存储)",
+                    "type": "string"
+                },
+                "memberareaid": {
+                    "description": "所属会员ID",
+                    "type": "integer"
+                },
+                "mobile2": {
+                    "description": "手机号码[明文-尚志]",
+                    "type": "string"
+                },
+                "mobilephone": {
+                    "description": "手机号码 (加密存储)",
+                    "type": "string"
+                },
+                "modifiedby": {
+                    "description": "修改人帐号",
+                    "type": "integer"
+                },
+                "modifiedtime": {
+                    "description": "修改时间",
+                    "type": "string"
+                },
+                "nickname": {
+                    "description": "昵称:默认为手机号脱敏(139****9999) 或 名称脱敏(张**)",
+                    "type": "string"
+                },
+                "openmode": {
+                    "description": "开户方式 -  1:管理端开户 2:网上开户注册(会员官网-手机号) 3:微信开户 4:网页交易端注册 5:安卓手机端注册 6:苹果手机端注册 7:PC交易端注册 8:微信快速开户 9:支付宝快速开户 10:手机号快速开户 11:网上开户注册(会员官网-微信认证) 12:网上开户注册(会员官网-支付宝认证)",
+                    "type": "integer"
+                },
+                "otherurl": {
+                    "description": "其它图片地址[使用分号分隔]",
+                    "type": "string"
+                },
+                "postalcode": {
+                    "description": "邮政编码",
+                    "type": "string"
+                },
+                "provinceid": {
+                    "description": "省",
+                    "type": "integer"
+                },
+                "proxystatementurl": {
+                    "description": "授权委托书",
+                    "type": "string"
+                },
+                "qq": {
+                    "description": "QQ(加密存储",
+                    "type": "string"
+                },
+                "referral": {
+                    "description": "推荐人编码",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "removebeforestatus": {
+                    "description": "REMOVEBEFORESTATUS",
+                    "type": "integer"
+                },
+                "sex": {
+                    "description": "性别 - 0:女 1:男",
+                    "type": "integer"
+                },
+                "signedstatus": {
+                    "description": "账户一号签签约状态",
+                    "type": "integer"
+                },
+                "signpdfurl": {
+                    "description": "签约pdf文件",
+                    "type": "string"
+                },
+                "subbranch": {
+                    "description": "开户支行",
+                    "type": "string"
+                },
+                "telphone": {
+                    "description": "联系电话(加密存储)",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID(自增ID)",
+                    "type": "integer"
+                },
+                "userinfotype": {
+                    "description": "用户信息类型 - 1:个人  2:企业",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "用户姓名",
+                    "type": "string"
+                },
+                "userstate": {
+                    "description": "开户状态 -   1:未提交 2: 待初审 3:初审拒绝 4:待复审 5:复审拒绝 6:测评不通过",
+                    "type": "integer"
+                },
+                "usertype": {
+                    "description": "用户类型 - 1:投资者 2:机构",
+                    "type": "integer"
+                },
+                "videourl": {
+                    "description": "视频地址",
+                    "type": "string"
+                },
+                "wechat": {
+                    "description": "微信号   (加密存储)",
+                    "type": "string"
+                }
+            }
+        },
         "erms3.QryAuditContractRsp": {
             "type": "object",
             "required": [

+ 389 - 1
docs/swagger.json

@@ -2104,7 +2104,7 @@
                 "summary": "新增客户申请",
                 "parameters": [
                     {
-                        "description": "申请参数",
+                        "description": "用户信息",
                         "name": "jsonBody",
                         "in": "body",
                         "required": true,
@@ -2129,6 +2129,48 @@
                 }
             }
         },
+        "/Erms3/ModifyUserInfoApply": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "保存草稿(撤回)- { \"userid\": int, \"userstate\": 1 }  提交审核 - { \"userid\": int, \"userstate\": 2 }",
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "风险管理v3"
+                ],
+                "summary": "修改客户申请",
+                "parameters": [
+                    {
+                        "description": "用户信息",
+                        "name": "jsonBody",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/erms3.ModifyUserInfoApplyReq"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Erms3/QueryBusinessInfo": {
             "get": {
                 "security": [
@@ -5143,6 +5185,52 @@
                 }
             }
         },
+        "/User/UpdateUserAccountStatus": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "用户信息"
+                ],
+                "summary": "更新用户状态",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userID",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "账户状态 -  4:正常 6:注销(停用)",
+                        "name": "accountStatus",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WR/GetWRCategoryInfo": {
             "get": {
                 "produces": [
@@ -9110,6 +9198,306 @@
                 }
             }
         },
+        "erms3.ModifyUserInfoApplyReq": {
+            "type": "object",
+            "required": [
+                "userid"
+            ],
+            "properties": {
+                "accountid": {
+                    "description": "交易系统帐号Id (加密存储)",
+                    "type": "integer"
+                },
+                "areacode": {
+                    "description": "机构代码",
+                    "type": "string"
+                },
+                "areaid": {
+                    "description": "机构Id",
+                    "type": "integer"
+                },
+                "attachment1": {
+                    "description": "附件1",
+                    "type": "string"
+                },
+                "attachment2": {
+                    "description": "附件2",
+                    "type": "string"
+                },
+                "attachment3": {
+                    "description": "附件3",
+                    "type": "string"
+                },
+                "attachment4": {
+                    "description": "附件4",
+                    "type": "string"
+                },
+                "attachment5": {
+                    "description": "附件5",
+                    "type": "string"
+                },
+                "auditedby": {
+                    "description": "审核人",
+                    "type": "string"
+                },
+                "auditime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "bankaccount": {
+                    "description": "银行帐号 (加密存储)",
+                    "type": "string"
+                },
+                "bankaccountname": {
+                    "description": "收款人名称",
+                    "type": "string"
+                },
+                "bankcardbackphotourl": {
+                    "description": "银行卡背面照地址",
+                    "type": "string"
+                },
+                "bankcardfrontphotourl": {
+                    "description": "银行卡正面照地址",
+                    "type": "string"
+                },
+                "bankid": {
+                    "description": "银行编码",
+                    "type": "string"
+                },
+                "bankname": {
+                    "description": "银行名称",
+                    "type": "string"
+                },
+                "bankpictureurl": {
+                    "description": "银行卡正面地址",
+                    "type": "string"
+                },
+                "biznature": {
+                    "description": "企业性质( 企业) - 1:国有控股企业 2:集体控股企业 3:私人控股企业 4:港澳台商控股企业 5:外商控股企业 6:其它",
+                    "type": "integer"
+                },
+                "bizscope": {
+                    "description": "企业经营范围(企业)",
+                    "type": "string"
+                },
+                "biztype": {
+                    "description": "企业类型 - 1:进口/生产 2:销售 3:零售 4:运输 5:仓储",
+                    "type": "integer"
+                },
+                "brokerid": {
+                    "description": "经纪人ID(加密存储)",
+                    "type": "string"
+                },
+                "cardaddress": {
+                    "description": "证件地址 (加密存储)",
+                    "type": "string"
+                },
+                "cardbackphotourl": {
+                    "description": "背面证件照地址",
+                    "type": "string"
+                },
+                "cardfrontphotourl": {
+                    "description": "正面证件照地址",
+                    "type": "string"
+                },
+                "cardnum": {
+                    "description": "证件号码 (加密存储)",
+                    "type": "string"
+                },
+                "cardtype": {
+                    "description": "证件类型",
+                    "type": "integer"
+                },
+                "cityid": {
+                    "description": "市",
+                    "type": "integer"
+                },
+                "company": {
+                    "description": "公司(个人)",
+                    "type": "string"
+                },
+                "contactcardbackphotourl": {
+                    "description": "联系人证件背面图片地址",
+                    "type": "string"
+                },
+                "contactcardfrontphotourl": {
+                    "description": "联系人证件正面图片地址",
+                    "type": "string"
+                },
+                "contactname": {
+                    "description": "联系人",
+                    "type": "string"
+                },
+                "countryid": {
+                    "description": "国家",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "开户申请时间",
+                    "type": "string"
+                },
+                "cusbankid": {
+                    "description": "签约类型",
+                    "type": "string"
+                },
+                "cusbankname": {
+                    "description": "签约类型名称",
+                    "type": "string"
+                },
+                "customername": {
+                    "description": "客户名称(企业名称)",
+                    "type": "string"
+                },
+                "districtid": {
+                    "description": "地区",
+                    "type": "integer"
+                },
+                "email": {
+                    "description": "Email地址(加密存储)",
+                    "type": "string"
+                },
+                "halfbodyphotourl": {
+                    "description": "半身照地址",
+                    "type": "string"
+                },
+                "headurl": {
+                    "description": "头像地址",
+                    "type": "string"
+                },
+                "ipaddress": {
+                    "description": "IP地址",
+                    "type": "string"
+                },
+                "isvalidate": {
+                    "description": "是否有效 (删除后标记为失效) - 0:无效  1:有效",
+                    "type": "string"
+                },
+                "legalcardbackphotourl": {
+                    "description": "法人身份证背面照地址",
+                    "type": "string"
+                },
+                "legalcardfrontphotourl": {
+                    "description": "法人身份证正面照地址",
+                    "type": "string"
+                },
+                "legalpersonname": {
+                    "description": "法人姓名(企业)",
+                    "type": "string"
+                },
+                "logincode": {
+                    "description": "登录帐号 (加密存储)",
+                    "type": "string"
+                },
+                "memberareaid": {
+                    "description": "所属会员ID",
+                    "type": "integer"
+                },
+                "mobile2": {
+                    "description": "手机号码[明文-尚志]",
+                    "type": "string"
+                },
+                "mobilephone": {
+                    "description": "手机号码 (加密存储)",
+                    "type": "string"
+                },
+                "modifiedby": {
+                    "description": "修改人帐号",
+                    "type": "integer"
+                },
+                "modifiedtime": {
+                    "description": "修改时间",
+                    "type": "string"
+                },
+                "nickname": {
+                    "description": "昵称:默认为手机号脱敏(139****9999) 或 名称脱敏(张**)",
+                    "type": "string"
+                },
+                "openmode": {
+                    "description": "开户方式 -  1:管理端开户 2:网上开户注册(会员官网-手机号) 3:微信开户 4:网页交易端注册 5:安卓手机端注册 6:苹果手机端注册 7:PC交易端注册 8:微信快速开户 9:支付宝快速开户 10:手机号快速开户 11:网上开户注册(会员官网-微信认证) 12:网上开户注册(会员官网-支付宝认证)",
+                    "type": "integer"
+                },
+                "otherurl": {
+                    "description": "其它图片地址[使用分号分隔]",
+                    "type": "string"
+                },
+                "postalcode": {
+                    "description": "邮政编码",
+                    "type": "string"
+                },
+                "provinceid": {
+                    "description": "省",
+                    "type": "integer"
+                },
+                "proxystatementurl": {
+                    "description": "授权委托书",
+                    "type": "string"
+                },
+                "qq": {
+                    "description": "QQ(加密存储",
+                    "type": "string"
+                },
+                "referral": {
+                    "description": "推荐人编码",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "removebeforestatus": {
+                    "description": "REMOVEBEFORESTATUS",
+                    "type": "integer"
+                },
+                "sex": {
+                    "description": "性别 - 0:女 1:男",
+                    "type": "integer"
+                },
+                "signedstatus": {
+                    "description": "账户一号签签约状态",
+                    "type": "integer"
+                },
+                "signpdfurl": {
+                    "description": "签约pdf文件",
+                    "type": "string"
+                },
+                "subbranch": {
+                    "description": "开户支行",
+                    "type": "string"
+                },
+                "telphone": {
+                    "description": "联系电话(加密存储)",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID(自增ID)",
+                    "type": "integer"
+                },
+                "userinfotype": {
+                    "description": "用户信息类型 - 1:个人  2:企业",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "用户姓名",
+                    "type": "string"
+                },
+                "userstate": {
+                    "description": "开户状态 -   1:未提交 2: 待初审 3:初审拒绝 4:待复审 5:复审拒绝 6:测评不通过",
+                    "type": "integer"
+                },
+                "usertype": {
+                    "description": "用户类型 - 1:投资者 2:机构",
+                    "type": "integer"
+                },
+                "videourl": {
+                    "description": "视频地址",
+                    "type": "string"
+                },
+                "wechat": {
+                    "description": "微信号   (加密存储)",
+                    "type": "string"
+                }
+            }
+        },
         "erms3.QryAuditContractRsp": {
             "type": "object",
             "required": [

+ 282 - 1
docs/swagger.yaml

@@ -2904,6 +2904,231 @@ definitions:
     required:
     - userid
     type: object
+  erms3.ModifyUserInfoApplyReq:
+    properties:
+      accountid:
+        description: 交易系统帐号Id (加密存储)
+        type: integer
+      areacode:
+        description: 机构代码
+        type: string
+      areaid:
+        description: 机构Id
+        type: integer
+      attachment1:
+        description: 附件1
+        type: string
+      attachment2:
+        description: 附件2
+        type: string
+      attachment3:
+        description: 附件3
+        type: string
+      attachment4:
+        description: 附件4
+        type: string
+      attachment5:
+        description: 附件5
+        type: string
+      auditedby:
+        description: 审核人
+        type: string
+      auditime:
+        description: 审核时间
+        type: string
+      bankaccount:
+        description: 银行帐号 (加密存储)
+        type: string
+      bankaccountname:
+        description: 收款人名称
+        type: string
+      bankcardbackphotourl:
+        description: 银行卡背面照地址
+        type: string
+      bankcardfrontphotourl:
+        description: 银行卡正面照地址
+        type: string
+      bankid:
+        description: 银行编码
+        type: string
+      bankname:
+        description: 银行名称
+        type: string
+      bankpictureurl:
+        description: 银行卡正面地址
+        type: string
+      biznature:
+        description: 企业性质( 企业) - 1:国有控股企业 2:集体控股企业 3:私人控股企业 4:港澳台商控股企业 5:外商控股企业 6:其它
+        type: integer
+      bizscope:
+        description: 企业经营范围(企业)
+        type: string
+      biztype:
+        description: 企业类型 - 1:进口/生产 2:销售 3:零售 4:运输 5:仓储
+        type: integer
+      brokerid:
+        description: 经纪人ID(加密存储)
+        type: string
+      cardaddress:
+        description: 证件地址 (加密存储)
+        type: string
+      cardbackphotourl:
+        description: 背面证件照地址
+        type: string
+      cardfrontphotourl:
+        description: 正面证件照地址
+        type: string
+      cardnum:
+        description: 证件号码 (加密存储)
+        type: string
+      cardtype:
+        description: 证件类型
+        type: integer
+      cityid:
+        description: 市
+        type: integer
+      company:
+        description: 公司(个人)
+        type: string
+      contactcardbackphotourl:
+        description: 联系人证件背面图片地址
+        type: string
+      contactcardfrontphotourl:
+        description: 联系人证件正面图片地址
+        type: string
+      contactname:
+        description: 联系人
+        type: string
+      countryid:
+        description: 国家
+        type: integer
+      createtime:
+        description: 开户申请时间
+        type: string
+      cusbankid:
+        description: 签约类型
+        type: string
+      cusbankname:
+        description: 签约类型名称
+        type: string
+      customername:
+        description: 客户名称(企业名称)
+        type: string
+      districtid:
+        description: 地区
+        type: integer
+      email:
+        description: Email地址(加密存储)
+        type: string
+      halfbodyphotourl:
+        description: 半身照地址
+        type: string
+      headurl:
+        description: 头像地址
+        type: string
+      ipaddress:
+        description: IP地址
+        type: string
+      isvalidate:
+        description: 是否有效 (删除后标记为失效) - 0:无效  1:有效
+        type: string
+      legalcardbackphotourl:
+        description: 法人身份证背面照地址
+        type: string
+      legalcardfrontphotourl:
+        description: 法人身份证正面照地址
+        type: string
+      legalpersonname:
+        description: 法人姓名(企业)
+        type: string
+      logincode:
+        description: 登录帐号 (加密存储)
+        type: string
+      memberareaid:
+        description: 所属会员ID
+        type: integer
+      mobile2:
+        description: 手机号码[明文-尚志]
+        type: string
+      mobilephone:
+        description: 手机号码 (加密存储)
+        type: string
+      modifiedby:
+        description: 修改人帐号
+        type: integer
+      modifiedtime:
+        description: 修改时间
+        type: string
+      nickname:
+        description: 昵称:默认为手机号脱敏(139****9999) 或 名称脱敏(张**)
+        type: string
+      openmode:
+        description: 开户方式 -  1:管理端开户 2:网上开户注册(会员官网-手机号) 3:微信开户 4:网页交易端注册 5:安卓手机端注册
+          6:苹果手机端注册 7:PC交易端注册 8:微信快速开户 9:支付宝快速开户 10:手机号快速开户 11:网上开户注册(会员官网-微信认证) 12:网上开户注册(会员官网-支付宝认证)
+        type: integer
+      otherurl:
+        description: 其它图片地址[使用分号分隔]
+        type: string
+      postalcode:
+        description: 邮政编码
+        type: string
+      provinceid:
+        description: 省
+        type: integer
+      proxystatementurl:
+        description: 授权委托书
+        type: string
+      qq:
+        description: QQ(加密存储
+        type: string
+      referral:
+        description: 推荐人编码
+        type: string
+      remark:
+        description: 备注
+        type: string
+      removebeforestatus:
+        description: REMOVEBEFORESTATUS
+        type: integer
+      sex:
+        description: 性别 - 0:女 1:男
+        type: integer
+      signedstatus:
+        description: 账户一号签签约状态
+        type: integer
+      signpdfurl:
+        description: 签约pdf文件
+        type: string
+      subbranch:
+        description: 开户支行
+        type: string
+      telphone:
+        description: 联系电话(加密存储)
+        type: string
+      userid:
+        description: 用户ID(自增ID)
+        type: integer
+      userinfotype:
+        description: 用户信息类型 - 1:个人  2:企业
+        type: integer
+      username:
+        description: 用户姓名
+        type: string
+      userstate:
+        description: '开户状态 -   1:未提交 2: 待初审 3:初审拒绝 4:待复审 5:复审拒绝 6:测评不通过'
+        type: integer
+      usertype:
+        description: 用户类型 - 1:投资者 2:机构
+        type: integer
+      videourl:
+        description: 视频地址
+        type: string
+      wechat:
+        description: 微信号   (加密存储)
+        type: string
+    required:
+    - userid
+    type: object
   erms3.QryAuditContractRsp:
     properties:
       accountid:
@@ -8610,7 +8835,7 @@ paths:
   /Erms3/AddUserInfoApply:
     post:
       parameters:
-      - description: 申请参数
+      - description: 用户信息
         in: body
         name: jsonBody
         required: true
@@ -8632,6 +8857,33 @@ paths:
       summary: 新增客户申请
       tags:
       - 风险管理v3
+  /Erms3/ModifyUserInfoApply:
+    post:
+      description: '保存草稿(撤回)- { "userid": int, "userstate": 1 }  提交审核 - { "userid":
+        int, "userstate": 2 }'
+      parameters:
+      - description: 用户信息
+        in: body
+        name: jsonBody
+        required: true
+        schema:
+          $ref: '#/definitions/erms3.ModifyUserInfoApplyReq'
+      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:
+      - 风险管理v3
   /Erms3/QueryBusinessInfo:
     get:
       parameters:
@@ -10535,6 +10787,35 @@ paths:
       summary: 移除用户商品收藏信息
       tags:
       - 用户信息
+  /User/UpdateUserAccountStatus:
+    post:
+      parameters:
+      - description: 用户ID
+        in: query
+        name: userID
+        required: true
+        type: integer
+      - description: 账户状态 -  4:正常 6:注销(停用)
+        in: query
+        name: accountStatus
+        required: true
+        type: string
+      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:
+      - 用户信息
   /WR/GetWRCategoryInfo:
     get:
       produces:

+ 83 - 0
models/account.go

@@ -805,6 +805,76 @@ func InsertWSKHUserInfo(userinfo Wskhuserinfo) error {
 	return nil
 }
 
+// UpdateWSKHUserInfo 修改网上开户账户信息(客户资料申请)
+func UpdateWSKHUserInfo(userinfo Wskhuserinfo) error {
+	engine := db.GetEngine()
+
+	// 加密数据
+	key, _ := hex.DecodeString(utils.AESSecretKey)
+	// 证件号码
+	if len(userinfo.Cardnum) > 0 {
+		if encrypted, err := utils.AESEncrypt([]byte(userinfo.Cardnum), key); err == nil {
+			userinfo.Cardnum = hex.EncodeToString(encrypted)
+		}
+	}
+	// 证件地址
+	if len(userinfo.Cardaddress) > 0 {
+		if encrypted, err := utils.AESEncrypt([]byte(userinfo.Cardaddress), key); err == nil {
+			userinfo.Cardaddress = hex.EncodeToString(encrypted)
+		}
+	}
+	// 手机
+	if len(userinfo.Mobilephone) > 0 {
+		if encrypted, err := utils.AESEncrypt([]byte(userinfo.Mobilephone), key); err == nil {
+			userinfo.Mobilephone = hex.EncodeToString(encrypted)
+		}
+	}
+	// 微信
+	if len(userinfo.Wechat) > 0 {
+		if encrypted, err := utils.AESEncrypt([]byte(userinfo.Wechat), key); err == nil {
+			userinfo.Wechat = hex.EncodeToString(encrypted)
+		}
+	}
+	// 邮件
+	if len(userinfo.Email) > 0 {
+		if encrypted, err := utils.AESEncrypt([]byte(userinfo.Email), key); err == nil {
+			userinfo.Email = hex.EncodeToString(encrypted)
+		}
+	}
+	// 银行帐号
+	if len(userinfo.Bankaccount) > 0 {
+		if encrypted, err := utils.AESEncrypt([]byte(userinfo.Bankaccount), key); err == nil {
+			userinfo.Bankaccount = hex.EncodeToString(encrypted)
+		}
+	}
+	// 经纪人ID
+	if len(userinfo.Brokerid) > 0 {
+		if encrypted, err := utils.AESEncrypt([]byte(userinfo.Brokerid), key); err == nil {
+			userinfo.Brokerid = hex.EncodeToString(encrypted)
+		}
+	}
+	// 登录帐号
+	if len(userinfo.Logincode) > 0 {
+		if encrypted, err := utils.AESEncrypt([]byte(userinfo.Logincode), key); err == nil {
+			userinfo.Logincode = hex.EncodeToString(encrypted)
+		}
+	}
+
+	// 修改数据
+	// 由于表的主键未定义成ID,所以这里需要用where来过滤
+	userID := userinfo.Userid
+	userinfo.Userid = 0
+	// m := make(map[string]interface{})
+	// j, _ := json.Marshal(userinfo)
+	// json.Unmarshal(j, &m)
+	// delete(m, "USERID")
+	if _, err := engine.Where("USERID = ?", userID).Update(&userinfo); err != nil {
+		return err
+	}
+
+	return nil
+}
+
 // GetWSKHUserInfos 获取开户信息列表
 func GetWSKHUserInfos(userName string) ([]Wskhuserinfo, error) {
 	engine := db.GetEngine()
@@ -837,3 +907,16 @@ func GetUserInfos(userName string) ([]Userinfo, error) {
 
 	return userInfos, nil
 }
+
+// UpdateUserAccountStatus 更新用户状态
+func UpdateUserAccountStatus(userID, accountStatus int) error {
+	engine := db.GetEngine()
+
+	if _, err := engine.Table("USERACCOUNT").
+		Where("USERID = ?", userID).
+		Update(map[string]interface{}{"ACCOUNTSTATUS": accountStatus}); err != nil {
+		return err
+	}
+
+	return nil
+}

+ 1 - 1
models/quote.go

@@ -51,7 +51,7 @@ type CycleData struct {
 
 // Quoteday 行情盘面
 type Quoteday struct {
-	Id                   int64   `xorm:"pk autoincr BIGINT(20)"`
+	ID                   int64   `xorm:"pk autoincr BIGINT(20)"`
 	Exchangedate         int64   `xorm:"not null BIGINT(20)"`
 	Goodscode            string  `xorm:"not null unique CHAR(10)"`
 	Exchangecode         int     `xorm:"INT(11)"`

+ 4 - 0
routers/router.go

@@ -77,6 +77,8 @@ func InitRouter() *gin.Engine {
 		userR.Use(token.Auth()).POST("/AddMessageBoard", user.AddMessageBoard)
 		// 获取用户账号信息
 		userR.Use(token.Auth()).GET("/GetUserAccount", user.GetUserAccount)
+		// 更新用户状态
+		userR.Use(token.Auth()).POST("/UpdateUserAccountStatus", user.UpdateUserAccountStatus)
 	}
 	// ************************ 资金账户 ************************
 	taAccountR := apiR.Group("TaAccount")
@@ -219,6 +221,8 @@ func InitRouter() *gin.Engine {
 		erms3R.GET("/QueryPendingAuditContract", erms3.QueryPendingAuditContract)
 		// 新增客户申请
 		erms3R.POST("/AddUserInfoApply", erms3.AddUserInfoApply)
+		// 修改客户申请
+		erms3R.POST("/ModifyUserInfoApply", erms3.ModifyUserInfoApply)
 		// 客户申请信息查询
 		erms3R.GET("/QueryUserInfoApplies", erms3.QueryUserInfoApplies)
 		// 待审核业务查询