zhou.xiaoning 3 年之前
父節點
當前提交
de30e38f18
共有 6 個文件被更改,包括 734 次插入3 次删除
  1. 41 0
      controllers/wrTrade2/qryWrTrade.go
  2. 208 1
      docs/docs.go
  3. 208 1
      docs/swagger.json
  4. 145 1
      docs/swagger.yaml
  5. 130 0
      models/wrTrade2.go
  6. 2 0
      routers/router.go

+ 41 - 0
controllers/wrTrade2/qryWrTrade.go

@@ -8,7 +8,10 @@ package wrTrade2
 
 import (
 	"mtp2_if/global/app"
+	"mtp2_if/global/e"
+	"mtp2_if/logger"
 	"mtp2_if/models"
+	"net/http"
 
 	"github.com/gin-gonic/gin"
 )
@@ -825,3 +828,41 @@ func QueryWrClientAdSpaceConfig(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }
+
+// QueryXhcpSellBackApply
+// @Summary 查询我的回收申请(新会陈皮)
+// @Produce json
+// @Security ApiKeyAuth
+// @Param userid query int true "用户ID"
+// @Success 200 {array} models.Xhcpsellbackapply
+// @Failure 500 {object} app.Response
+// @Router /WrTrade2/QueryXhcpSellBackApply [get]
+// @Tags 仓单贸易v2
+func QueryXhcpSellBackApply(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.Xhcpsellbackapply{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}
+
+// InsertXhcpSellBackApply
+// @Summary 新增回收申请(新会陈皮)
+// @Produce json
+// @Security ApiKeyAuth
+// @Param jsonBody body models.XhcpSellBackApplyEx true "回收申请"
+// @Success 200 {object} app.Response
+// @Failure 500 {object} app.Response
+// @Router /WrTrade2/InsertXhcpSellBackApply [post]
+// @Tags 仓单贸易v2
+func InsertXhcpSellBackApply(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.XhcpSellBackApplyEx{}
+	a.DoBindReq(&m)
+
+	if err := m.Insert(); err == nil {
+		a.Response(http.StatusOK, e.SUCCESS, "OK")
+	} else {
+		logger.GetLogger().Errorf("insert fail, %v", err)
+		a.Response(http.StatusBadRequest, e.ERROR_OPERATION_FAILED, nil)
+	}
+}

+ 208 - 1
docs/docs.go

@@ -5592,7 +5592,7 @@ var doc = `{
                         "ApiKeyAuth": []
                     }
                 ],
-                "description": "已完成项目查询: 项目状态 = 3:正常完结 or 5:异常完结",
+                "description": "已完成项目查询 -\u003e 项目状态 = 3:正常完结 or 5:异常完结",
                 "produces": [
                     "application/json"
                 ],
@@ -12277,6 +12277,47 @@ var doc = `{
                 }
             }
         },
+        "/WrTrade2/InsertXhcpSellBackApply": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "新增回收申请(新会陈皮)",
+                "parameters": [
+                    {
+                        "description": "回收申请",
+                        "name": "jsonBody",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/models.XhcpSellBackApplyEx"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryDeliveryGoodsSection": {
             "get": {
                 "security": [
@@ -14695,6 +14736,48 @@ var doc = `{
                 }
             }
         },
+        "/WrTrade2/QueryXhcpSellBackApply": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询我的回收申请(新会陈皮)",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Xhcpsellbackapply"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/ZJ/GetBankTip": {
             "get": {
                 "produces": [
@@ -39135,6 +39218,130 @@ var doc = `{
                 }
             }
         },
+        "models.XhcpSellBackApplyEx": {
+            "type": "object",
+            "required": [
+                "userid"
+            ],
+            "properties": {
+                "applyremark": {
+                    "description": "申请备注",
+                    "type": "string"
+                },
+                "expirytype": {
+                    "description": "寄售有效期 - 1:3天 2:7天 3:15天 4:长期",
+                    "type": "integer"
+                },
+                "goodsspec": {
+                    "description": "商品规格 - 1:整件 2;整提 3:单罐 4:单盒",
+                    "type": "integer"
+                },
+                "holeflag": {
+                    "description": "是否破洞[原封] - 1:无破洞 2:破洞",
+                    "type": "integer"
+                },
+                "isunopened": {
+                    "description": "是否原封 - 0:否 1:是",
+                    "type": "integer"
+                },
+                "mpflag": {
+                    "description": "磨皮类型[原封] - 1:无磨皮 2:小磨皮 3:磨皮",
+                    "type": "integer"
+                },
+                "openflag": {
+                    "description": "是否非原封 - 0:无 1:皮张大、片张完整,无杂质、虫蛀、霉变、病变、烧皮。 2:片张较大、皮张基本完整,少量断片,少量病变、轻微虫蛀和烧皮。 3:皮张小、片张不完整,断片、碎片较多,有一定量杂质、病斑、虫蛀和烧皮。",
+                    "type": "integer"
+                },
+                "phonenum": {
+                    "description": "联系电话",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "所属用户ID",
+                    "type": "integer"
+                },
+                "zpflag": {
+                    "description": "皱皮类型[原封] - 1:无皱皮 2:小皱皮 3:皱皮",
+                    "type": "integer"
+                }
+            }
+        },
+        "models.Xhcpsellbackapply": {
+            "type": "object",
+            "required": [
+                "userid"
+            ],
+            "properties": {
+                "applyid": {
+                    "description": "申请人",
+                    "type": "integer"
+                },
+                "applyremark": {
+                    "description": "申请备注",
+                    "type": "string"
+                },
+                "applysrc": {
+                    "description": "申请来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "applystatus": {
+                    "description": "申请状态 - 1:待确认 2:已处理",
+                    "type": "integer"
+                },
+                "applytime": {
+                    "description": "申请时间",
+                    "type": "string"
+                },
+                "auditremark": {
+                    "description": "审核备注",
+                    "type": "string"
+                },
+                "auditsrc": {
+                    "description": "审核来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "expirytype": {
+                    "description": "寄售有效期 - 1:3天 2:7天 3:15天 4:长期",
+                    "type": "integer"
+                },
+                "goodsspec": {
+                    "description": "商品规格 - 1:整件 2;整提 3:单罐 4:单盒",
+                    "type": "integer"
+                },
+                "holeflag": {
+                    "description": "是否破洞[原封] - 1:无破洞 2:破洞",
+                    "type": "integer"
+                },
+                "isunopened": {
+                    "description": "是否原封 - 0:否 1:是",
+                    "type": "integer"
+                },
+                "mpflag": {
+                    "description": "磨皮类型[原封] - 1:无磨皮 2:小磨皮 3:磨皮",
+                    "type": "integer"
+                },
+                "openflag": {
+                    "description": "是否非原封 - 0:无 1:皮张大、片张完整,无杂质、虫蛀、霉变、病变、烧皮。 2:片张较大、皮张基本完整,少量断片,少量病变、轻微虫蛀和烧皮。 3:皮张小、片张不完整,断片、碎片较多,有一定量杂质、病斑、虫蛀和烧皮。",
+                    "type": "integer"
+                },
+                "phonenum": {
+                    "description": "联系电话",
+                    "type": "string"
+                },
+                "sellbackapplyid": {
+                    "description": "回收申请ID - SEQ_XHCP_SELLBACKAPPLY",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "所属用户ID",
+                    "type": "integer"
+                },
+                "zpflag": {
+                    "description": "皱皮类型[原封] - 1:无皱皮 2:小皱皮 3:皱皮",
+                    "type": "integer"
+                }
+            }
+        },
         "order.QueryHisTradeDetailRsp": {
             "type": "object",
             "required": [

+ 208 - 1
docs/swagger.json

@@ -5576,7 +5576,7 @@
                         "ApiKeyAuth": []
                     }
                 ],
-                "description": "已完成项目查询: 项目状态 = 3:正常完结 or 5:异常完结",
+                "description": "已完成项目查询 -\u003e 项目状态 = 3:正常完结 or 5:异常完结",
                 "produces": [
                     "application/json"
                 ],
@@ -12261,6 +12261,47 @@
                 }
             }
         },
+        "/WrTrade2/InsertXhcpSellBackApply": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "新增回收申请(新会陈皮)",
+                "parameters": [
+                    {
+                        "description": "回收申请",
+                        "name": "jsonBody",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/models.XhcpSellBackApplyEx"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryDeliveryGoodsSection": {
             "get": {
                 "security": [
@@ -14679,6 +14720,48 @@
                 }
             }
         },
+        "/WrTrade2/QueryXhcpSellBackApply": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询我的回收申请(新会陈皮)",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Xhcpsellbackapply"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/ZJ/GetBankTip": {
             "get": {
                 "produces": [
@@ -39119,6 +39202,130 @@
                 }
             }
         },
+        "models.XhcpSellBackApplyEx": {
+            "type": "object",
+            "required": [
+                "userid"
+            ],
+            "properties": {
+                "applyremark": {
+                    "description": "申请备注",
+                    "type": "string"
+                },
+                "expirytype": {
+                    "description": "寄售有效期 - 1:3天 2:7天 3:15天 4:长期",
+                    "type": "integer"
+                },
+                "goodsspec": {
+                    "description": "商品规格 - 1:整件 2;整提 3:单罐 4:单盒",
+                    "type": "integer"
+                },
+                "holeflag": {
+                    "description": "是否破洞[原封] - 1:无破洞 2:破洞",
+                    "type": "integer"
+                },
+                "isunopened": {
+                    "description": "是否原封 - 0:否 1:是",
+                    "type": "integer"
+                },
+                "mpflag": {
+                    "description": "磨皮类型[原封] - 1:无磨皮 2:小磨皮 3:磨皮",
+                    "type": "integer"
+                },
+                "openflag": {
+                    "description": "是否非原封 - 0:无 1:皮张大、片张完整,无杂质、虫蛀、霉变、病变、烧皮。 2:片张较大、皮张基本完整,少量断片,少量病变、轻微虫蛀和烧皮。 3:皮张小、片张不完整,断片、碎片较多,有一定量杂质、病斑、虫蛀和烧皮。",
+                    "type": "integer"
+                },
+                "phonenum": {
+                    "description": "联系电话",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "所属用户ID",
+                    "type": "integer"
+                },
+                "zpflag": {
+                    "description": "皱皮类型[原封] - 1:无皱皮 2:小皱皮 3:皱皮",
+                    "type": "integer"
+                }
+            }
+        },
+        "models.Xhcpsellbackapply": {
+            "type": "object",
+            "required": [
+                "userid"
+            ],
+            "properties": {
+                "applyid": {
+                    "description": "申请人",
+                    "type": "integer"
+                },
+                "applyremark": {
+                    "description": "申请备注",
+                    "type": "string"
+                },
+                "applysrc": {
+                    "description": "申请来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "applystatus": {
+                    "description": "申请状态 - 1:待确认 2:已处理",
+                    "type": "integer"
+                },
+                "applytime": {
+                    "description": "申请时间",
+                    "type": "string"
+                },
+                "auditremark": {
+                    "description": "审核备注",
+                    "type": "string"
+                },
+                "auditsrc": {
+                    "description": "审核来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "expirytype": {
+                    "description": "寄售有效期 - 1:3天 2:7天 3:15天 4:长期",
+                    "type": "integer"
+                },
+                "goodsspec": {
+                    "description": "商品规格 - 1:整件 2;整提 3:单罐 4:单盒",
+                    "type": "integer"
+                },
+                "holeflag": {
+                    "description": "是否破洞[原封] - 1:无破洞 2:破洞",
+                    "type": "integer"
+                },
+                "isunopened": {
+                    "description": "是否原封 - 0:否 1:是",
+                    "type": "integer"
+                },
+                "mpflag": {
+                    "description": "磨皮类型[原封] - 1:无磨皮 2:小磨皮 3:磨皮",
+                    "type": "integer"
+                },
+                "openflag": {
+                    "description": "是否非原封 - 0:无 1:皮张大、片张完整,无杂质、虫蛀、霉变、病变、烧皮。 2:片张较大、皮张基本完整,少量断片,少量病变、轻微虫蛀和烧皮。 3:皮张小、片张不完整,断片、碎片较多,有一定量杂质、病斑、虫蛀和烧皮。",
+                    "type": "integer"
+                },
+                "phonenum": {
+                    "description": "联系电话",
+                    "type": "string"
+                },
+                "sellbackapplyid": {
+                    "description": "回收申请ID - SEQ_XHCP_SELLBACKAPPLY",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "所属用户ID",
+                    "type": "integer"
+                },
+                "zpflag": {
+                    "description": "皱皮类型[原封] - 1:无皱皮 2:小皱皮 3:皱皮",
+                    "type": "integer"
+                }
+            }
+        },
         "order.QueryHisTradeDetailRsp": {
             "type": "object",
             "required": [

+ 145 - 1
docs/swagger.yaml

@@ -18172,6 +18172,99 @@ definitions:
         description: 现货商品名称
         type: string
     type: object
+  models.XhcpSellBackApplyEx:
+    properties:
+      applyremark:
+        description: 申请备注
+        type: string
+      expirytype:
+        description: 寄售有效期 - 1:3天 2:7天 3:15天 4:长期
+        type: integer
+      goodsspec:
+        description: 商品规格 - 1:整件 2;整提 3:单罐 4:单盒
+        type: integer
+      holeflag:
+        description: 是否破洞[原封] - 1:无破洞 2:破洞
+        type: integer
+      isunopened:
+        description: 是否原封 - 0:否 1:是
+        type: integer
+      mpflag:
+        description: 磨皮类型[原封] - 1:无磨皮 2:小磨皮 3:磨皮
+        type: integer
+      openflag:
+        description: 是否非原封 - 0:无 1:皮张大、片张完整,无杂质、虫蛀、霉变、病变、烧皮。 2:片张较大、皮张基本完整,少量断片,少量病变、轻微虫蛀和烧皮。
+          3:皮张小、片张不完整,断片、碎片较多,有一定量杂质、病斑、虫蛀和烧皮。
+        type: integer
+      phonenum:
+        description: 联系电话
+        type: string
+      userid:
+        description: 所属用户ID
+        type: integer
+      zpflag:
+        description: 皱皮类型[原封] - 1:无皱皮 2:小皱皮 3:皱皮
+        type: integer
+    required:
+    - userid
+    type: object
+  models.Xhcpsellbackapply:
+    properties:
+      applyid:
+        description: 申请人
+        type: integer
+      applyremark:
+        description: 申请备注
+        type: string
+      applysrc:
+        description: 申请来源 - 1:管理端 2:终端
+        type: integer
+      applystatus:
+        description: 申请状态 - 1:待确认 2:已处理
+        type: integer
+      applytime:
+        description: 申请时间
+        type: string
+      auditremark:
+        description: 审核备注
+        type: string
+      auditsrc:
+        description: 审核来源 - 1:管理端 2:终端
+        type: integer
+      expirytype:
+        description: 寄售有效期 - 1:3天 2:7天 3:15天 4:长期
+        type: integer
+      goodsspec:
+        description: 商品规格 - 1:整件 2;整提 3:单罐 4:单盒
+        type: integer
+      holeflag:
+        description: 是否破洞[原封] - 1:无破洞 2:破洞
+        type: integer
+      isunopened:
+        description: 是否原封 - 0:否 1:是
+        type: integer
+      mpflag:
+        description: 磨皮类型[原封] - 1:无磨皮 2:小磨皮 3:磨皮
+        type: integer
+      openflag:
+        description: 是否非原封 - 0:无 1:皮张大、片张完整,无杂质、虫蛀、霉变、病变、烧皮。 2:片张较大、皮张基本完整,少量断片,少量病变、轻微虫蛀和烧皮。
+          3:皮张小、片张不完整,断片、碎片较多,有一定量杂质、病斑、虫蛀和烧皮。
+        type: integer
+      phonenum:
+        description: 联系电话
+        type: string
+      sellbackapplyid:
+        description: 回收申请ID - SEQ_XHCP_SELLBACKAPPLY
+        type: string
+      userid:
+        description: 所属用户ID
+        type: integer
+      zpflag:
+        description: 皱皮类型[原封] - 1:无皱皮 2:小皱皮 3:皱皮
+        type: integer
+    required:
+    - userid
+    type: object
   order.QueryHisTradeDetailRsp:
     properties:
       accountid:
@@ -23720,7 +23813,7 @@ paths:
       - 企业风险管理v3(app)
   /Ermcp8/QueryErmcp2HedgedItem:
     get:
-      description: '已完成项目查询: 项目状态 = 3:正常完结 or 5:异常完结'
+      description: 已完成项目查询 -> 项目状态 = 3:正常完结 or 5:异常完结
       parameters:
       - description: 用户ID
         in: query
@@ -27935,6 +28028,31 @@ paths:
       tags:
       - 仓单贸易
       - 仓单贸易
+  /WrTrade2/InsertXhcpSellBackApply:
+    post:
+      parameters:
+      - description: 回收申请
+        in: body
+        name: jsonBody
+        required: true
+        schema:
+          $ref: '#/definitions/models.XhcpSellBackApplyEx'
+      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:
+      - 仓单贸易v2
   /WrTrade2/QueryDeliveryGoodsSection:
     get:
       produces:
@@ -29471,6 +29589,32 @@ paths:
       summary: 查询发票信息
       tags:
       - 仓单贸易v2
+  /WrTrade2/QueryXhcpSellBackApply:
+    get:
+      parameters:
+      - description: 用户ID
+        in: query
+        name: userid
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.Xhcpsellbackapply'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询我的回收申请(新会陈皮)
+      tags:
+      - 仓单贸易v2
   /ZJ/GetBankTip:
     get:
       produces:

+ 130 - 0
models/wrTrade2.go

@@ -7,12 +7,15 @@
 package models
 
 import (
+	"errors"
 	"fmt"
 	"mtp2_if/db"
 	"mtp2_if/mtpcache"
 	"mtp2_if/utils"
 	"sort"
+	"strconv"
 	"strings"
+	"time"
 )
 
 // WrOrderQuote 买卖大厅行情
@@ -4987,3 +4990,130 @@ func (r *WrClientAdSpaceConfig) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// Xhcpsellbackapply 回收鉴别申请表
+type Xhcpsellbackapply struct {
+	SELLBACKAPPLYID string    `json:"sellbackapplyid"  xorm:"SELLBACKAPPLYID"`                // 回收申请ID - SEQ_XHCP_SELLBACKAPPLY
+	PHONENUM        string    `json:"phonenum"  xorm:"PHONENUM"`                              // 联系电话
+	GOODSSPEC       int32     `json:"goodsspec"  xorm:"GOODSSPEC"`                            // 商品规格 - 1:整件 2;整提 3:单罐 4:单盒
+	EXPIRYTYPE      int32     `json:"expirytype"  xorm:"EXPIRYTYPE"`                          // 寄售有效期 - 1:3天 2:7天 3:15天 4:长期
+	ISUNOPENED      int32     `json:"isunopened"  xorm:"ISUNOPENED"`                          // 是否原封 - 0:否 1:是
+	ZPFLAG          int32     `json:"zpflag"  xorm:"ZPFLAG"`                                  // 皱皮类型[原封] - 1:无皱皮 2:小皱皮 3:皱皮
+	MPFLAG          int32     `json:"mpflag"  xorm:"MPFLAG"`                                  // 磨皮类型[原封] - 1:无磨皮 2:小磨皮 3:磨皮
+	HOLEFLAG        int32     `json:"holeflag"  xorm:"HOLEFLAG"`                              // 是否破洞[原封] - 1:无破洞 2:破洞
+	OPENFLAG        int32     `json:"openflag"  xorm:"OPENFLAG"`                              // 是否非原封 - 0:无 1:皮张大、片张完整,无杂质、虫蛀、霉变、病变、烧皮。 2:片张较大、皮张基本完整,少量断片,少量病变、轻微虫蛀和烧皮。 3:皮张小、片张不完整,断片、碎片较多,有一定量杂质、病斑、虫蛀和烧皮。
+	APPLYREMARK     string    `json:"applyremark"  xorm:"APPLYREMARK"`                        // 申请备注
+	APPLYSRC        int32     `json:"applysrc"  xorm:"APPLYSRC"`                              // 申请来源 - 1:管理端 2:终端
+	APPLYID         int64     `json:"applyid"  xorm:"APPLYID"`                                // 申请人
+	APPLYTIME       time.Time `json:"applytime"  xorm:"APPLYTIME"`                            // 申请时间
+	APPLYSTATUS     int32     `json:"applystatus"  xorm:"APPLYSTATUS"`                        // 申请状态 - 1:待确认 2:已处理
+	AUDITREMARK     string    `json:"auditremark"  xorm:"AUDITREMARK"`                        // 审核备注
+	AUDITSRC        int32     `json:"auditsrc"  xorm:"AUDITSRC"`                              // 审核来源 - 1:管理端 2:终端
+	AUDITID         int64     `json:"-"  xorm:"AUDITID"`                                      // 审核人
+	AUDITTIME       time.Time `json:"-"  xorm:"AUDITTIME"`                                    // 审核时间
+	USERID          int64     `json:"userid"  xorm:"USERID" form:"userid" binding:"required"` // 所属用户ID
+}
+
+// TableName is XHCP_SELLBACKAPPLY
+func (r *Xhcpsellbackapply) TableName() string {
+	return "XHCP_SELLBACKAPPLY"
+}
+
+func (r *Xhcpsellbackapply) calc() {
+
+}
+
+func (r *Xhcpsellbackapply) buildSql() string {
+	var sqlId utils.SQLVal = `
+	SELECT 
+		to_char(t.SELLBACKAPPLYID) SELLBACKAPPLYID,
+       	t.PHONENUM,
+       	t.GOODSSPEC,
+       	t.EXPIRYTYPE,
+       	t.ISUNOPENED,
+       	t.ZPFLAG,
+       	t.MPFLAG,
+       	t.HOLEFLAG,
+		t.OPENFLAG,
+		t.APPLYREMARK,
+		t.APPLYID,
+		to_char(t.APPLYTIME, 'yyyy-mm-dd hh24:mi:ss') APPLYTIME,
+		t.APPLYSTATUS,
+		t.APPLYSTATUS,
+		t.AUDITREMARK,
+       	t.AUDITSRC,
+       	t.AUDITID,
+		t.USERID
+	FROM XHCP_SELLBACKAPPLY t
+	WHERE 1 = 1
+	`
+	sqlId.And("t.userid", r.USERID)
+
+	return sqlId.String()
+}
+
+func (r *Xhcpsellbackapply) GetDataEx() (interface{}, error) {
+	sData := make([]Xhcpsellbackapply, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}
+
+// XhcpSellBackApplyEx 回收鉴别申请表
+type XhcpSellBackApplyEx struct {
+	SELLBACKAPPLYID string    `json:"-"  xorm:"SELLBACKAPPLYID"`                              // 回收申请ID - SEQ_XHCP_SELLBACKAPPLY
+	PHONENUM        string    `json:"phonenum"  xorm:"PHONENUM"`                              // 联系电话
+	GOODSSPEC       int32     `json:"goodsspec"  xorm:"GOODSSPEC"`                            // 商品规格 - 1:整件 2;整提 3:单罐 4:单盒
+	EXPIRYTYPE      int32     `json:"expirytype"  xorm:"EXPIRYTYPE"`                          // 寄售有效期 - 1:3天 2:7天 3:15天 4:长期
+	ISUNOPENED      int32     `json:"isunopened"  xorm:"ISUNOPENED"`                          // 是否原封 - 0:否 1:是
+	ZPFLAG          int32     `json:"zpflag"  xorm:"ZPFLAG"`                                  // 皱皮类型[原封] - 1:无皱皮 2:小皱皮 3:皱皮
+	MPFLAG          int32     `json:"mpflag"  xorm:"MPFLAG"`                                  // 磨皮类型[原封] - 1:无磨皮 2:小磨皮 3:磨皮
+	HOLEFLAG        int32     `json:"holeflag"  xorm:"HOLEFLAG"`                              // 是否破洞[原封] - 1:无破洞 2:破洞
+	OPENFLAG        int32     `json:"openflag"  xorm:"OPENFLAG"`                              // 是否非原封 - 0:无 1:皮张大、片张完整,无杂质、虫蛀、霉变、病变、烧皮。 2:片张较大、皮张基本完整,少量断片,少量病变、轻微虫蛀和烧皮。 3:皮张小、片张不完整,断片、碎片较多,有一定量杂质、病斑、虫蛀和烧皮。
+	APPLYREMARK     string    `json:"applyremark"  xorm:"APPLYREMARK"`                        // 申请备注
+	APPLYSRC        int32     `json:"-"  xorm:"APPLYSRC"`                                     // 申请来源 - 1:管理端 2:终端
+	APPLYID         int64     `json:"-"  xorm:"APPLYID"`                                      // 申请人
+	APPLYTIME       time.Time `json:"-"  xorm:"APPLYTIME"`                                    // 申请时间
+	APPLYSTATUS     int32     `json:"-"  xorm:"APPLYSTATUS"`                                  // 申请状态 - 1:待确认 2:已处理
+	AUDITREMARK     string    `json:"-"  xorm:"AUDITREMARK"`                                  // 审核备注
+	AUDITSRC        int32     `json:"-"  xorm:"AUDITSRC"`                                     // 审核来源 - 1:管理端 2:终端
+	AUDITID         int64     `json:"-"  xorm:"AUDITID"`                                      // 审核人
+	AUDITTIME       time.Time `json:"-"  xorm:"AUDITTIME"`                                    // 审核时间
+	USERID          int64     `json:"userid"  xorm:"USERID" form:"userid" binding:"required"` // 所属用户ID
+}
+
+func (r *XhcpSellBackApplyEx) Insert() error {
+	engine := db.GetEngine()
+
+	session := engine.NewSession()
+	defer session.Close()
+
+	// add Begin() before any action
+	if err := session.Begin(); err != nil {
+		return err
+	}
+
+	// 自增ID
+	seqMap, err := session.QueryString("SELECT SEQ_SellbackApplyI.nextval SELLBACKAPPLYID FROM dual")
+	if err != nil {
+		return err
+	}
+	if len(seqMap) <= 0 {
+		return errors.New("获取自增ID错误")
+	}
+	sellbackapplyid, _ := strconv.Atoi(seqMap[0]["SELLBACKAPPLYID"])
+	r.USERID = int64(sellbackapplyid)
+	r.APPLYSRC = 2
+	r.APPLYSTATUS = 1
+	r.APPLYTIME = time.Now()
+
+	// 插入数据
+	if _, err = session.Insert(r); err != nil {
+		return err
+	}
+
+	// add Commit() after all actions
+	return session.Commit()
+}

+ 2 - 0
routers/router.go

@@ -598,6 +598,8 @@ func InitRouter() *gin.Engine {
 		wrTrade2R.GET("QueryWrDraftUserInfo", wrTrade2.QueryWrDraftUserInfo)
 		wrTrade2R.GET("QueryWrBrandAndYears", wrTrade2.QueryWrBrandAndYears)
 		wrTrade2R.GET("QueryWrClientAdSpaceConfig", wrTrade2.QueryWrClientAdSpaceConfig)
+		wrTrade2R.GET("QueryXhcpSellBackApply", wrTrade2.QueryXhcpSellBackApply)
+		wrTrade2R.POST("InsertXhcpSellBackApply", wrTrade2.InsertXhcpSellBackApply)
 	}
 
 	// **************************天津麦顿*************************