zhou.xiaoning 2 лет назад
Родитель
Сommit
91748b4387
9 измененных файлов с 1788 добавлено и 21 удалено
  1. 9 9
      controllers/ferroalloy/trade.go
  2. 58 0
      controllers/guangzuan/trade.go
  3. 486 3
      docs/docs.go
  4. 486 3
      docs/swagger.json
  5. 349 3
      docs/swagger.yaml
  6. 3 3
      models/ferroalloy.go
  7. 284 0
      models/guangzuan.go
  8. 110 0
      models/ori.go
  9. 3 0
      routers/router.go

+ 9 - 9
controllers/ferroalloy/trade.go

@@ -11,12 +11,12 @@ import (
 // @Summary  查询我的订单-采购订单
 // @Produce  json
 // @Security ApiKeyAuth
-// @Param    userid      query    int     true  "用户ID"
+// @Param    userid         query    int    true  "用户ID"
 // @Param    type     query    int false "类型 - 0:未完成 1:已完成"
-// @Param    page        query    int     false "页码"
-// @Param    pagesize    query    int     false "每页条数"
+// @Param    page           query    int    false "页码"
+// @Param    pagesize       query    int    false "每页条数"
 // @Success  200      {array}  models.Thjpurchasetradedetail
-// @Failure  500          {object} app.Response
+// @Failure  500            {object} app.Response
 // @Router   /Ferroalloy/QueryTHJPurchaseTradeDetail [get]
 // @Tags     铁合金
 func QueryTHJPurchaseTradeDetail(c *gin.Context) {
@@ -122,11 +122,11 @@ func QueryTHJPromotionIncomeDetail(c *gin.Context) {
 // @Summary  定金比例个性化查询
 // @Produce  json
 // @Security ApiKeyAuth
-// @Param    userid       query    int true  "用户ID"
-// @Param    wrstandardid query    int true  "现货商品ID"
-// @Param    page         query    int false "页码"
-// @Param    pagesize     query    int false "每页条数"
-// @Success  200          {array}  models.GThjinvesotrdeposit
+// @Param    userid      query    int     true  "用户ID"
+// @Param    presaleapplyid query    string true  "预售申请ID"
+// @Param    page        query    int     false "页码"
+// @Param    pagesize    query    int     false "每页条数"
+// @Success  200            {array}  models.GThjinvesotrdeposit
 // @Failure  500      {object} app.Response
 // @Router   /Ferroalloy/QueryTHJinvesotrdeposit [get]
 // @Tags     铁合金

+ 58 - 0
controllers/guangzuan/trade.go

@@ -95,3 +95,61 @@ func QueryDiamond(c *gin.Context) {
 	}
 	a.DoGetDataByPage(&m)
 }
+
+// QueryGzbscinOutOrder
+// @Summary  保税仓出入库申请表查询
+// @Produce  json
+// @Security ApiKeyAuth
+// @Param    userid    query    int true  "用户ID"
+// @Param    ordertype query    int true  "单据类型 - 1:进仓 2:出仓(枚举:GZBSCOrderType)"
+// @Param    listtype  query    int false "列表类型 - 0.全部 1.待上传 2.进行中 3.已结束"
+// @Param    page      query    int false "页码"
+// @Param    pagesize  query    int false "每页条数"
+// @Success  200       {array}  models.GGzbscinoutorder
+// @Failure  500       {object} app.Response
+// @Router   /Guangzuan/QueryGzbscinOutOrder [get]
+// @Tags     铁合金
+func QueryGzbscinOutOrder(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.GGzbscinoutorder{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}
+
+// QueryBScinOutOrderDetail
+// @Summary  保税仓出入库申请明细表查询
+// @Produce  json
+// @Security ApiKeyAuth
+// @Param    userid   query    int    true  "用户ID"
+// @Param    orderid  query    string true  "申请ID"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
+// @Success  200      {array}  models.BScinoutorderdetail
+// @Failure  500      {object} app.Response
+// @Router   /Guangzuan/QueryBScinOutOrderDetail [get]
+// @Tags     铁合金
+func QueryBScinOutOrderDetail(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.BScinoutorderdetail{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}
+
+// QueryBScOutOrderDetailatt
+// @Summary  保税仓出库申请明细附表查询
+// @Produce  json
+// @Security ApiKeyAuth
+// @Param    userid   query    int    true  "用户ID"
+// @Param    orderid  query    string true  "申请ID"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
+// @Success  200      {array}  models.BScoutorderdetailatt
+// @Failure  500      {object} app.Response
+// @Router   /Guangzuan/QueryBScinOutOrderDetail [get]
+// @Tags     铁合金
+func QueryBScOutOrderDetailatt(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.BScoutorderdetailatt{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}

+ 486 - 3
docs/docs.go

@@ -8775,9 +8775,9 @@ const docTemplate = `{
                         "required": true
                     },
                     {
-                        "type": "integer",
-                        "description": "现货商品ID",
-                        "name": "wrstandardid",
+                        "type": "string",
+                        "description": "预售申请ID",
+                        "name": "presaleapplyid",
                         "in": "query",
                         "required": true
                     },
@@ -9282,6 +9282,67 @@ const docTemplate = `{
                 }
             }
         },
+        "/Guangzuan/QueryBScinOutOrderDetail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "铁合金"
+                ],
+                "summary": "保税仓出库申请明细附表查询",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请ID",
+                        "name": "orderid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.BScoutorderdetailatt"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Guangzuan/QueryBuyOrder": {
             "get": {
                 "security": [
@@ -9788,6 +9849,73 @@ const docTemplate = `{
                 }
             }
         },
+        "/Guangzuan/QueryGzbscinOutOrder": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "铁合金"
+                ],
+                "summary": "保税仓出入库申请表查询",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "单据类型 - 1:进仓 2:出仓(枚举:GZBSCOrderType)",
+                        "name": "ordertype",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "列表类型 - 0.全部 1.待上传 2.进行中 3.已结束",
+                        "name": "listtype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.GGzbscinoutorder"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Guangzuan/QueryGzcjjcorderoperate": {
             "get": {
                 "security": [
@@ -24750,6 +24878,240 @@ const docTemplate = `{
                 }
             }
         },
+        "models.BScinoutorderdetail": {
+            "type": "object",
+            "required": [
+                "orderid",
+                "userid"
+            ],
+            "properties": {
+                "backagenum": {
+                    "description": "件数",
+                    "type": "integer"
+                },
+                "bagweightgm": {
+                    "description": "连袋重(克)",
+                    "type": "number"
+                },
+                "countryname": {
+                    "description": "产销国",
+                    "type": "string"
+                },
+                "currencydes": {
+                    "description": "币种",
+                    "type": "string"
+                },
+                "currencyname": {
+                    "description": "币制",
+                    "type": "string"
+                },
+                "customsno": {
+                    "description": "报关单号(进仓:录入时更新,出仓申请时有)",
+                    "type": "string"
+                },
+                "customsvalue": {
+                    "description": "报关总值",
+                    "type": "number"
+                },
+                "detailid": {
+                    "description": "明细ID(807+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "executionflag": {
+                    "description": "海关执行标志",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "goodsnum": {
+                    "description": "商品编号",
+                    "type": "string"
+                },
+                "goodsspec": {
+                    "description": "规格",
+                    "type": "string"
+                },
+                "legalunit": {
+                    "description": "法定计量单位",
+                    "type": "string"
+                },
+                "netweightct": {
+                    "description": "净重(克拉)",
+                    "type": "number"
+                },
+                "netweightgm": {
+                    "description": "净重(克)",
+                    "type": "number"
+                },
+                "orderid": {
+                    "description": "申请ID",
+                    "type": "string"
+                },
+                "origincountry": {
+                    "description": "原产国",
+                    "type": "string"
+                },
+                "prepricegm": {
+                    "description": "单价(克)",
+                    "type": "number"
+                },
+                "rawdetail": {
+                    "description": "原料明细",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "reportunit": {
+                    "description": "申报计量单位",
+                    "type": "string"
+                },
+                "storageperiod": {
+                    "description": "存储(监管)期限",
+                    "type": "string"
+                },
+                "totalprice": {
+                    "description": "总价",
+                    "type": "number"
+                },
+                "unitprice": {
+                    "description": "单价",
+                    "type": "number"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
+        },
+        "models.BScoutorderdetailatt": {
+            "type": "object",
+            "required": [
+                "orderid",
+                "userid"
+            ],
+            "properties": {
+                "countryname": {
+                    "description": "产销国",
+                    "type": "string"
+                },
+                "curcustomsvalue": {
+                    "description": "本次扣减货值(报关总值)",
+                    "type": "number"
+                },
+                "curnetweightct": {
+                    "description": "本次扣减量(克拉)",
+                    "type": "number"
+                },
+                "curnetweightgm": {
+                    "description": "本次扣减净重(克)",
+                    "type": "number"
+                },
+                "currencyname": {
+                    "description": "币制",
+                    "type": "string"
+                },
+                "curtotalprice": {
+                    "description": "本次扣减货值",
+                    "type": "number"
+                },
+                "customsno": {
+                    "description": "报关单号",
+                    "type": "string"
+                },
+                "customsvalue": {
+                    "description": "报关总值",
+                    "type": "number"
+                },
+                "detailattid": {
+                    "description": "明细ID(810+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "executionflag": {
+                    "description": "海关执行标志",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "goodsnum": {
+                    "description": "商品编号",
+                    "type": "string"
+                },
+                "goodsspec": {
+                    "description": "规格型号",
+                    "type": "string"
+                },
+                "jckdate": {
+                    "description": "进口日期",
+                    "type": "string"
+                },
+                "legalunit": {
+                    "description": "法定计量单位",
+                    "type": "string"
+                },
+                "netweightct": {
+                    "description": "净重(克拉)",
+                    "type": "number"
+                },
+                "netweightgm": {
+                    "description": "净重(克)",
+                    "type": "number"
+                },
+                "orderid": {
+                    "description": "申请ID",
+                    "type": "string"
+                },
+                "remaincurnetweightgm": {
+                    "description": "结余净重(克)",
+                    "type": "number"
+                },
+                "remaincustomsvalue": {
+                    "description": "结余报关总值",
+                    "type": "number"
+                },
+                "remainnetweightct": {
+                    "description": "结余净重(克拉)",
+                    "type": "number"
+                },
+                "remaintotalprice": {
+                    "description": "结余总价",
+                    "type": "number"
+                },
+                "reportunit": {
+                    "description": "申报计量单位",
+                    "type": "string"
+                },
+                "storageperiod": {
+                    "description": "存储(监管)期限",
+                    "type": "string"
+                },
+                "totalprice": {
+                    "description": "总价",
+                    "type": "number"
+                },
+                "unitprice": {
+                    "description": "单价",
+                    "type": "number"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
+        },
         "models.BuyOrder": {
             "type": "object",
             "properties": {
@@ -32838,6 +33200,127 @@ const docTemplate = `{
                 }
             }
         },
+        "models.GGzbscinoutorder": {
+            "type": "object",
+            "required": [
+                "ordertype",
+                "userid"
+            ],
+            "properties": {
+                "applicanttime": {
+                    "description": "申请时间",
+                    "type": "string"
+                },
+                "bagweightgm": {
+                    "description": "连袋重(克)",
+                    "type": "number"
+                },
+                "checklistno": {
+                    "description": "核注清单号",
+                    "type": "string"
+                },
+                "confirmdate": {
+                    "description": "进出仓确认时间",
+                    "type": "string"
+                },
+                "confirmername": {
+                    "description": "进出仓确认人",
+                    "type": "string"
+                },
+                "confirmtradedate": {
+                    "description": "进出仓确认交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "contactname": {
+                    "description": "申请方联系人",
+                    "type": "string"
+                },
+                "contactnum": {
+                    "description": "申请方联系电话",
+                    "type": "string"
+                },
+                "customsno": {
+                    "description": "报关单号",
+                    "type": "string"
+                },
+                "customstotalvalue": {
+                    "description": "报关总值",
+                    "type": "number"
+                },
+                "goodsname": {
+                    "description": "商品名称 - 明细的商品名称拼接(\"/\")",
+                    "type": "string"
+                },
+                "jckdate": {
+                    "description": "进出口日期",
+                    "type": "string"
+                },
+                "logisticscompany": {
+                    "description": "物流公司名称",
+                    "type": "string"
+                },
+                "logisticsno": {
+                    "description": "托运单号",
+                    "type": "string"
+                },
+                "netweightct": {
+                    "description": "净重(克拉)",
+                    "type": "number"
+                },
+                "netweightgm": {
+                    "description": "净重(克)",
+                    "type": "number"
+                },
+                "orderid": {
+                    "description": "申请ID(806+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "ordernum": {
+                    "description": "单据编号",
+                    "type": "string"
+                },
+                "orderstatus": {
+                    "description": "进出仓状态 - 1.待确认 2.待上传 3.报关中 4.进仓中 5.出仓中 20.已关闭 21.确认拒绝(枚举:GZBSCOrderStatus)",
+                    "type": "integer"
+                },
+                "ordertype": {
+                    "description": "单据类型 - 1:进仓 2:出仓(枚举:GZBSCOrderType)",
+                    "type": "integer"
+                },
+                "outtype": {
+                    "description": "出仓类型 - 1:转厂 2:出境(枚举:GZBSCOutType)",
+                    "type": "integer"
+                },
+                "sealno": {
+                    "description": "进出仓封条号",
+                    "type": "string"
+                },
+                "signeedate": {
+                    "description": "收发货人日期",
+                    "type": "string"
+                },
+                "signeename": {
+                    "description": "收发货人",
+                    "type": "string"
+                },
+                "totalprice": {
+                    "description": "总价",
+                    "type": "number"
+                },
+                "useraddress": {
+                    "description": "申请方地点",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "申请用户ID",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "申请方名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.GThjinvesotrdeposit": {
             "type": "object",
             "required": [

+ 486 - 3
docs/swagger.json

@@ -8766,9 +8766,9 @@
                         "required": true
                     },
                     {
-                        "type": "integer",
-                        "description": "现货商品ID",
-                        "name": "wrstandardid",
+                        "type": "string",
+                        "description": "预售申请ID",
+                        "name": "presaleapplyid",
                         "in": "query",
                         "required": true
                     },
@@ -9273,6 +9273,67 @@
                 }
             }
         },
+        "/Guangzuan/QueryBScinOutOrderDetail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "铁合金"
+                ],
+                "summary": "保税仓出库申请明细附表查询",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请ID",
+                        "name": "orderid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.BScoutorderdetailatt"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Guangzuan/QueryBuyOrder": {
             "get": {
                 "security": [
@@ -9779,6 +9840,73 @@
                 }
             }
         },
+        "/Guangzuan/QueryGzbscinOutOrder": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "铁合金"
+                ],
+                "summary": "保税仓出入库申请表查询",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "单据类型 - 1:进仓 2:出仓(枚举:GZBSCOrderType)",
+                        "name": "ordertype",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "列表类型 - 0.全部 1.待上传 2.进行中 3.已结束",
+                        "name": "listtype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.GGzbscinoutorder"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Guangzuan/QueryGzcjjcorderoperate": {
             "get": {
                 "security": [
@@ -24741,6 +24869,240 @@
                 }
             }
         },
+        "models.BScinoutorderdetail": {
+            "type": "object",
+            "required": [
+                "orderid",
+                "userid"
+            ],
+            "properties": {
+                "backagenum": {
+                    "description": "件数",
+                    "type": "integer"
+                },
+                "bagweightgm": {
+                    "description": "连袋重(克)",
+                    "type": "number"
+                },
+                "countryname": {
+                    "description": "产销国",
+                    "type": "string"
+                },
+                "currencydes": {
+                    "description": "币种",
+                    "type": "string"
+                },
+                "currencyname": {
+                    "description": "币制",
+                    "type": "string"
+                },
+                "customsno": {
+                    "description": "报关单号(进仓:录入时更新,出仓申请时有)",
+                    "type": "string"
+                },
+                "customsvalue": {
+                    "description": "报关总值",
+                    "type": "number"
+                },
+                "detailid": {
+                    "description": "明细ID(807+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "executionflag": {
+                    "description": "海关执行标志",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "goodsnum": {
+                    "description": "商品编号",
+                    "type": "string"
+                },
+                "goodsspec": {
+                    "description": "规格",
+                    "type": "string"
+                },
+                "legalunit": {
+                    "description": "法定计量单位",
+                    "type": "string"
+                },
+                "netweightct": {
+                    "description": "净重(克拉)",
+                    "type": "number"
+                },
+                "netweightgm": {
+                    "description": "净重(克)",
+                    "type": "number"
+                },
+                "orderid": {
+                    "description": "申请ID",
+                    "type": "string"
+                },
+                "origincountry": {
+                    "description": "原产国",
+                    "type": "string"
+                },
+                "prepricegm": {
+                    "description": "单价(克)",
+                    "type": "number"
+                },
+                "rawdetail": {
+                    "description": "原料明细",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "reportunit": {
+                    "description": "申报计量单位",
+                    "type": "string"
+                },
+                "storageperiod": {
+                    "description": "存储(监管)期限",
+                    "type": "string"
+                },
+                "totalprice": {
+                    "description": "总价",
+                    "type": "number"
+                },
+                "unitprice": {
+                    "description": "单价",
+                    "type": "number"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
+        },
+        "models.BScoutorderdetailatt": {
+            "type": "object",
+            "required": [
+                "orderid",
+                "userid"
+            ],
+            "properties": {
+                "countryname": {
+                    "description": "产销国",
+                    "type": "string"
+                },
+                "curcustomsvalue": {
+                    "description": "本次扣减货值(报关总值)",
+                    "type": "number"
+                },
+                "curnetweightct": {
+                    "description": "本次扣减量(克拉)",
+                    "type": "number"
+                },
+                "curnetweightgm": {
+                    "description": "本次扣减净重(克)",
+                    "type": "number"
+                },
+                "currencyname": {
+                    "description": "币制",
+                    "type": "string"
+                },
+                "curtotalprice": {
+                    "description": "本次扣减货值",
+                    "type": "number"
+                },
+                "customsno": {
+                    "description": "报关单号",
+                    "type": "string"
+                },
+                "customsvalue": {
+                    "description": "报关总值",
+                    "type": "number"
+                },
+                "detailattid": {
+                    "description": "明细ID(810+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "executionflag": {
+                    "description": "海关执行标志",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "goodsnum": {
+                    "description": "商品编号",
+                    "type": "string"
+                },
+                "goodsspec": {
+                    "description": "规格型号",
+                    "type": "string"
+                },
+                "jckdate": {
+                    "description": "进口日期",
+                    "type": "string"
+                },
+                "legalunit": {
+                    "description": "法定计量单位",
+                    "type": "string"
+                },
+                "netweightct": {
+                    "description": "净重(克拉)",
+                    "type": "number"
+                },
+                "netweightgm": {
+                    "description": "净重(克)",
+                    "type": "number"
+                },
+                "orderid": {
+                    "description": "申请ID",
+                    "type": "string"
+                },
+                "remaincurnetweightgm": {
+                    "description": "结余净重(克)",
+                    "type": "number"
+                },
+                "remaincustomsvalue": {
+                    "description": "结余报关总值",
+                    "type": "number"
+                },
+                "remainnetweightct": {
+                    "description": "结余净重(克拉)",
+                    "type": "number"
+                },
+                "remaintotalprice": {
+                    "description": "结余总价",
+                    "type": "number"
+                },
+                "reportunit": {
+                    "description": "申报计量单位",
+                    "type": "string"
+                },
+                "storageperiod": {
+                    "description": "存储(监管)期限",
+                    "type": "string"
+                },
+                "totalprice": {
+                    "description": "总价",
+                    "type": "number"
+                },
+                "unitprice": {
+                    "description": "单价",
+                    "type": "number"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
+        },
         "models.BuyOrder": {
             "type": "object",
             "properties": {
@@ -32829,6 +33191,127 @@
                 }
             }
         },
+        "models.GGzbscinoutorder": {
+            "type": "object",
+            "required": [
+                "ordertype",
+                "userid"
+            ],
+            "properties": {
+                "applicanttime": {
+                    "description": "申请时间",
+                    "type": "string"
+                },
+                "bagweightgm": {
+                    "description": "连袋重(克)",
+                    "type": "number"
+                },
+                "checklistno": {
+                    "description": "核注清单号",
+                    "type": "string"
+                },
+                "confirmdate": {
+                    "description": "进出仓确认时间",
+                    "type": "string"
+                },
+                "confirmername": {
+                    "description": "进出仓确认人",
+                    "type": "string"
+                },
+                "confirmtradedate": {
+                    "description": "进出仓确认交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "contactname": {
+                    "description": "申请方联系人",
+                    "type": "string"
+                },
+                "contactnum": {
+                    "description": "申请方联系电话",
+                    "type": "string"
+                },
+                "customsno": {
+                    "description": "报关单号",
+                    "type": "string"
+                },
+                "customstotalvalue": {
+                    "description": "报关总值",
+                    "type": "number"
+                },
+                "goodsname": {
+                    "description": "商品名称 - 明细的商品名称拼接(\"/\")",
+                    "type": "string"
+                },
+                "jckdate": {
+                    "description": "进出口日期",
+                    "type": "string"
+                },
+                "logisticscompany": {
+                    "description": "物流公司名称",
+                    "type": "string"
+                },
+                "logisticsno": {
+                    "description": "托运单号",
+                    "type": "string"
+                },
+                "netweightct": {
+                    "description": "净重(克拉)",
+                    "type": "number"
+                },
+                "netweightgm": {
+                    "description": "净重(克)",
+                    "type": "number"
+                },
+                "orderid": {
+                    "description": "申请ID(806+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "ordernum": {
+                    "description": "单据编号",
+                    "type": "string"
+                },
+                "orderstatus": {
+                    "description": "进出仓状态 - 1.待确认 2.待上传 3.报关中 4.进仓中 5.出仓中 20.已关闭 21.确认拒绝(枚举:GZBSCOrderStatus)",
+                    "type": "integer"
+                },
+                "ordertype": {
+                    "description": "单据类型 - 1:进仓 2:出仓(枚举:GZBSCOrderType)",
+                    "type": "integer"
+                },
+                "outtype": {
+                    "description": "出仓类型 - 1:转厂 2:出境(枚举:GZBSCOutType)",
+                    "type": "integer"
+                },
+                "sealno": {
+                    "description": "进出仓封条号",
+                    "type": "string"
+                },
+                "signeedate": {
+                    "description": "收发货人日期",
+                    "type": "string"
+                },
+                "signeename": {
+                    "description": "收发货人",
+                    "type": "string"
+                },
+                "totalprice": {
+                    "description": "总价",
+                    "type": "number"
+                },
+                "useraddress": {
+                    "description": "申请方地点",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "申请用户ID",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "申请方名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.GThjinvesotrdeposit": {
             "type": "object",
             "required": [

+ 349 - 3
docs/swagger.yaml

@@ -3833,6 +3833,180 @@ definitions:
     - roletype
     - userid
     type: object
+  models.BScinoutorderdetail:
+    properties:
+      backagenum:
+        description: 件数
+        type: integer
+      bagweightgm:
+        description: 连袋重(克)
+        type: number
+      countryname:
+        description: 产销国
+        type: string
+      currencydes:
+        description: 币种
+        type: string
+      currencyname:
+        description: 币制
+        type: string
+      customsno:
+        description: 报关单号(进仓:录入时更新,出仓申请时有)
+        type: string
+      customsvalue:
+        description: 报关总值
+        type: number
+      detailid:
+        description: 明细ID(807+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      executionflag:
+        description: 海关执行标志
+        type: string
+      goodsid:
+        description: 商品ID
+        type: integer
+      goodsname:
+        description: 商品名称
+        type: string
+      goodsnum:
+        description: 商品编号
+        type: string
+      goodsspec:
+        description: 规格
+        type: string
+      legalunit:
+        description: 法定计量单位
+        type: string
+      netweightct:
+        description: 净重(克拉)
+        type: number
+      netweightgm:
+        description: 净重(克)
+        type: number
+      orderid:
+        description: 申请ID
+        type: string
+      origincountry:
+        description: 原产国
+        type: string
+      prepricegm:
+        description: 单价(克)
+        type: number
+      rawdetail:
+        description: 原料明细
+        type: string
+      remark:
+        description: 备注
+        type: string
+      reportunit:
+        description: 申报计量单位
+        type: string
+      storageperiod:
+        description: 存储(监管)期限
+        type: string
+      totalprice:
+        description: 总价
+        type: number
+      unitprice:
+        description: 单价
+        type: number
+      userid:
+        description: 用户ID
+        type: integer
+    required:
+    - orderid
+    - userid
+    type: object
+  models.BScoutorderdetailatt:
+    properties:
+      countryname:
+        description: 产销国
+        type: string
+      curcustomsvalue:
+        description: 本次扣减货值(报关总值)
+        type: number
+      curnetweightct:
+        description: 本次扣减量(克拉)
+        type: number
+      curnetweightgm:
+        description: 本次扣减净重(克)
+        type: number
+      currencyname:
+        description: 币制
+        type: string
+      curtotalprice:
+        description: 本次扣减货值
+        type: number
+      customsno:
+        description: 报关单号
+        type: string
+      customsvalue:
+        description: 报关总值
+        type: number
+      detailattid:
+        description: 明细ID(810+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      executionflag:
+        description: 海关执行标志
+        type: string
+      goodsid:
+        description: 商品ID
+        type: integer
+      goodsname:
+        description: 商品名称
+        type: string
+      goodsnum:
+        description: 商品编号
+        type: string
+      goodsspec:
+        description: 规格型号
+        type: string
+      jckdate:
+        description: 进口日期
+        type: string
+      legalunit:
+        description: 法定计量单位
+        type: string
+      netweightct:
+        description: 净重(克拉)
+        type: number
+      netweightgm:
+        description: 净重(克)
+        type: number
+      orderid:
+        description: 申请ID
+        type: string
+      remaincurnetweightgm:
+        description: 结余净重(克)
+        type: number
+      remaincustomsvalue:
+        description: 结余报关总值
+        type: number
+      remainnetweightct:
+        description: 结余净重(克拉)
+        type: number
+      remaintotalprice:
+        description: 结余总价
+        type: number
+      reportunit:
+        description: 申报计量单位
+        type: string
+      storageperiod:
+        description: 存储(监管)期限
+        type: string
+      totalprice:
+        description: 总价
+        type: number
+      unitprice:
+        description: 单价
+        type: number
+      userid:
+        description: 用户ID
+        type: integer
+    required:
+    - orderid
+    - userid
+    type: object
   models.BuyOrder:
     properties:
       accountid:
@@ -9834,6 +10008,96 @@ definitions:
         description: 昨价
         type: number
     type: object
+  models.GGzbscinoutorder:
+    properties:
+      applicanttime:
+        description: 申请时间
+        type: string
+      bagweightgm:
+        description: 连袋重(克)
+        type: number
+      checklistno:
+        description: 核注清单号
+        type: string
+      confirmdate:
+        description: 进出仓确认时间
+        type: string
+      confirmername:
+        description: 进出仓确认人
+        type: string
+      confirmtradedate:
+        description: 进出仓确认交易日(yyyyMMdd)
+        type: string
+      contactname:
+        description: 申请方联系人
+        type: string
+      contactnum:
+        description: 申请方联系电话
+        type: string
+      customsno:
+        description: 报关单号
+        type: string
+      customstotalvalue:
+        description: 报关总值
+        type: number
+      goodsname:
+        description: 商品名称 - 明细的商品名称拼接("/")
+        type: string
+      jckdate:
+        description: 进出口日期
+        type: string
+      logisticscompany:
+        description: 物流公司名称
+        type: string
+      logisticsno:
+        description: 托运单号
+        type: string
+      netweightct:
+        description: 净重(克拉)
+        type: number
+      netweightgm:
+        description: 净重(克)
+        type: number
+      orderid:
+        description: 申请ID(806+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      ordernum:
+        description: 单据编号
+        type: string
+      orderstatus:
+        description: 进出仓状态 - 1.待确认 2.待上传 3.报关中 4.进仓中 5.出仓中 20.已关闭 21.确认拒绝(枚举:GZBSCOrderStatus)
+        type: integer
+      ordertype:
+        description: 单据类型 - 1:进仓 2:出仓(枚举:GZBSCOrderType)
+        type: integer
+      outtype:
+        description: 出仓类型 - 1:转厂 2:出境(枚举:GZBSCOutType)
+        type: integer
+      sealno:
+        description: 进出仓封条号
+        type: string
+      signeedate:
+        description: 收发货人日期
+        type: string
+      signeename:
+        description: 收发货人
+        type: string
+      totalprice:
+        description: 总价
+        type: number
+      useraddress:
+        description: 申请方地点
+        type: string
+      userid:
+        description: 申请用户ID
+        type: integer
+      username:
+        description: 申请方名称
+        type: string
+    required:
+    - ordertype
+    - userid
+    type: object
   models.GThjinvesotrdeposit:
     properties:
       depositrate:
@@ -31668,11 +31932,11 @@ paths:
         name: userid
         required: true
         type: integer
-      - description: 现货商品ID
+      - description: 预售申请ID
         in: query
-        name: wrstandardid
+        name: presaleapplyid
         required: true
-        type: integer
+        type: string
       - description: 页码
         in: query
         name: page
@@ -31983,6 +32247,45 @@ paths:
       summary: 钻石价格计算器
       tags:
       - 广钻
+  /Guangzuan/QueryBScinOutOrderDetail:
+    get:
+      parameters:
+      - description: 用户ID
+        in: query
+        name: userid
+        required: true
+        type: integer
+      - description: 申请ID
+        in: query
+        name: orderid
+        required: true
+        type: string
+      - description: 页码
+        in: query
+        name: page
+        type: integer
+      - description: 每页条数
+        in: query
+        name: pagesize
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.BScoutorderdetailatt'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 保税仓出库申请明细附表查询
+      tags:
+      - 铁合金
   /Guangzuan/QueryBuyOrder:
     get:
       parameters:
@@ -32288,6 +32591,49 @@ paths:
       summary: 查询出境检测单据明细(批次信息)
       tags:
       - 广钻
+  /Guangzuan/QueryGzbscinOutOrder:
+    get:
+      parameters:
+      - description: 用户ID
+        in: query
+        name: userid
+        required: true
+        type: integer
+      - description: 单据类型 - 1:进仓 2:出仓(枚举:GZBSCOrderType)
+        in: query
+        name: ordertype
+        required: true
+        type: integer
+      - description: 列表类型 - 0.全部 1.待上传 2.进行中 3.已结束
+        in: query
+        name: listtype
+        type: integer
+      - description: 页码
+        in: query
+        name: page
+        type: integer
+      - description: 每页条数
+        in: query
+        name: pagesize
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.GGzbscinoutorder'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 保税仓出入库申请表查询
+      tags:
+      - 铁合金
   /Guangzuan/QueryGzcjjcorderoperate:
     get:
       parameters:

+ 3 - 3
models/ferroalloy.go

@@ -2043,7 +2043,7 @@ type GThjinvesotrdeposit struct {
 
 	QTY int64 `json:"qty" xorm:"QTY"` // 可用量
 
-	WRSTANDARDID int64 `json:"-" xorm:"-" form:"wrstandardid" binding:"required"` // 现货商品ID
+	PRESALEAPPLYID string `json:"-" xorm:"-" form:"presaleapplyid" binding:"required"` // 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
 
 	PageEx `xorm:"extends"` // 页码信息
 }
@@ -2061,12 +2061,12 @@ func (r *GThjinvesotrdeposit) buildSql() string {
 		where (
 			t.userid = %v or 
 			t.userid in (select t.refereeuserid from useraccount t where t.userid=%v))
-			AND t.depositrate not in (select distinct t.depositrate from THJ_PresaleApplyDeposit t where t.wrstandardid = %v
+			AND t.depositrate not in (select distinct t.depositrate from THJ_PresaleApplyDeposit t where t.presaleapplyid = %v
 		) and t.depositqty >0
 		group by t.depositrate
 		order by t.depositrate
 	`
-	sqlId.FormatParam(r.USERID, r.USERID, r.WRSTANDARDID)
+	sqlId.FormatParam(r.USERID, r.USERID, r.PRESALEAPPLYID)
 
 	sqlId.Page(r.Page, r.PageSize)
 	return sqlId.String()

+ 284 - 0
models/guangzuan.go

@@ -3555,3 +3555,287 @@ func (r *Fworderoperate) GetDataEx() (interface{}, error) {
 	}
 	return sData, nil
 }
+
+// GGzbscinoutorder 保税仓出入库申请表
+type GGzbscinoutorder struct {
+	ORDERID           string  `json:"orderid" xorm:"ORDERID"`                                         // 申请ID(806+Unix秒时间戳(10位)+xxxxxx)
+	ORDERTYPE         int32   `json:"ordertype" xorm:"ORDERTYPE" form:"ordertype" binding:"required"` // 单据类型 - 1:进仓 2:出仓(枚举:GZBSCOrderType)
+	USERID            int64   `json:"userid" xorm:"USERID" form:"userid" binding:"required"`          // 申请用户ID
+	USERNAME          string  `json:"username" xorm:"USERNAME"`                                       // 申请方名称
+	USERADDRESS       string  `json:"useraddress" xorm:"USERADDRESS"`                                 // 申请方地点
+	CONTACTNAME       string  `json:"contactname" xorm:"CONTACTNAME"`                                 // 申请方联系人
+	CONTACTNUM        string  `json:"contactnum" xorm:"CONTACTNUM"`                                   // 申请方联系电话
+	LOGISTICSCOMPANY  string  `json:"logisticscompany" xorm:"LOGISTICSCOMPANY"`                       // 物流公司名称
+	LOGISTICSNO       string  `json:"logisticsno" xorm:"LOGISTICSNO"`                                 // 托运单号
+	APPLICANTTIME     string  `json:"applicanttime" xorm:"APPLICANTTIME"`                             // 申请时间
+	OUTTYPE           int32   `json:"outtype" xorm:"OUTTYPE"`                                         // 出仓类型 - 1:转厂 2:出境(枚举:GZBSCOutType)
+	ORDERSTATUS       int32   `json:"orderstatus" xorm:"ORDERSTATUS"`                                 // 进出仓状态 - 1.待确认 2.待上传 3.报关中 4.进仓中 5.出仓中 20.已关闭 21.确认拒绝(枚举:GZBSCOrderStatus)
+	JCKDATE           string  `json:"jckdate" xorm:"JCKDATE"`                                         // 进出口日期
+	CUSTOMSNO         string  `json:"customsno" xorm:"CUSTOMSNO"`                                     // 报关单号
+	CHECKLISTNO       string  `json:"checklistno" xorm:"CHECKLISTNO"`                                 // 核注清单号
+	SIGNEENAME        string  `json:"signeename" xorm:"SIGNEENAME"`                                   // 收发货人
+	SIGNEEDATE        string  `json:"signeedate" xorm:"SIGNEEDATE"`                                   // 收发货人日期
+	SEALNO            string  `json:"sealno" xorm:"SEALNO"`                                           // 进出仓封条号
+	CONFIRMERNAME     string  `json:"confirmername" xorm:"CONFIRMERNAME"`                             // 进出仓确认人
+	CONFIRMDATE       string  `json:"confirmdate" xorm:"CONFIRMDATE"`                                 // 进出仓确认时间
+	CONFIRMTRADEDATE  string  `json:"confirmtradedate" xorm:"CONFIRMTRADEDATE"`                       // 进出仓确认交易日(yyyyMMdd)
+	NETWEIGHTCT       float64 `json:"netweightct" xorm:"NETWEIGHTCT"`                                 // 净重(克拉)
+	NETWEIGHTGM       float64 `json:"netweightgm" xorm:"NETWEIGHTGM"`                                 // 净重(克)
+	BAGWEIGHTGM       float64 `json:"bagweightgm" xorm:"BAGWEIGHTGM"`                                 // 连袋重(克)
+	TOTALPRICE        float64 `json:"totalprice" xorm:"TOTALPRICE"`                                   // 总价
+	CUSTOMSTOTALVALUE float64 `json:"customstotalvalue" xorm:"CUSTOMSTOTALVALUE"`                     // 报关总值
+	GOODSNAME         string  `json:"goodsname" xorm:"GOODSNAME"`                                     // 商品名称 - 明细的商品名称拼接("/")
+	ORDERNUM          string  `json:"ordernum" xorm:"ORDERNUM"`                                       // 单据编号
+
+	ListType int `json:"-" xorm:"-" form:"listtype"` // 列表类型 - 0.全部 1.待上传 2.进行中 3.已结束
+
+	PageEx `xorm:"extends"` // 页码信息
+}
+
+func (r *GGzbscinoutorder) calc() {
+
+}
+
+func (r *GGzbscinoutorder) buildSql() string {
+	var sqlId utils.SQLVal = `
+		select 
+			to_char(t.ORDERID) ORDERID,
+			t.ORDERTYPE,
+			t.USERID,
+			t.USERNAME,
+			t.USERADDRESS,
+			t.CONTACTNAME,
+			t.CONTACTNUM,
+			t.LOGISTICSCOMPANY,
+			t.LOGISTICSNO,
+			to_char(t.APPLICANTTIME, 'yyyy-mm-dd hh24:mi:ss') APPLICANTTIME,
+			t.OUTTYPE,
+			t.ORDERSTATUS,
+			to_char(t.JCKDATE, 'yyyy-mm-dd') JCKDATE,
+			t.CUSTOMSNO,
+			t.CHECKLISTNO,
+			t.SIGNEENAME,
+			to_char(t.SIGNEEDATE, 'yyyy-mm-dd') SIGNEEDATE,
+			t.SEALNO,
+			t.CONFIRMERNAME,
+			to_char(t.CONFIRMDATE, 'yyyy-mm-dd') CONFIRMDATE,
+			t.CONFIRMTRADEDATE,
+			t.NETWEIGHTCT,
+			t.NETWEIGHTGM,
+			t.BAGWEIGHTGM,
+			t.TOTALPRICE,
+			t.CUSTOMSTOTALVALUE,
+			t.GOODSNAME,
+			t.ORDERNUM
+		from GZ_BSCInOutOrder t
+		where t.userid = %v and t.ORDERTYPE = %v and %v
+		order by t.APPLICANTTIME desc
+	`
+
+	e := "1=1"
+	if r.ListType != 0 {
+		switch r.ListType {
+		case 1:
+			e = "t.ORDERSTATUS = 2"
+		case 2:
+			e = "t.ORDERSTATUS < 20"
+		case 3:
+			e = "t.ORDERSTATUS >= 20"
+		}
+	}
+	sqlId.FormatParam(r.USERID, r.ORDERTYPE, e)
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *GGzbscinoutorder) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]GGzbscinoutorder, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	total := 0
+	for i := range sData {
+		sData[i].calc()
+		total = sData[i].Total
+	}
+	return sData, err, r.Page, r.PageSize, total
+}
+
+// BScinoutorderdetail 保税仓出入库申请明细表
+type BScinoutorderdetail struct {
+	DETAILID      string  `json:"detailid" xorm:"DETAILID"`                                 // 明细ID(807+Unix秒时间戳(10位)+xxxxxx)
+	ORDERID       string  `json:"orderid" xorm:"ORDERID" form:"orderid" binding:"required"` // 申请ID
+	GOODSID       int64   `json:"goodsid" xorm:"GOODSID"`                                   // 商品ID
+	GOODSSPEC     string  `json:"goodsspec" xorm:"GOODSSPEC"`                               // 规格
+	RAWDETAIL     string  `json:"rawdetail" xorm:"RAWDETAIL"`                               // 原料明细
+	BACKAGENUM    int32   `json:"backagenum" xorm:"BACKAGENUM"`                             // 件数
+	NETWEIGHTCT   float64 `json:"netweightct" xorm:"NETWEIGHTCT"`                           // 净重(克拉)
+	NETWEIGHTGM   float64 `json:"netweightgm" xorm:"NETWEIGHTGM"`                           // 净重(克)
+	BAGWEIGHTGM   float64 `json:"bagweightgm" xorm:"BAGWEIGHTGM"`                           // 连袋重(克)
+	PREPRICEGM    float64 `json:"prepricegm" xorm:"PREPRICEGM"`                             // 单价(克)
+	TOTALPRICE    float64 `json:"totalprice" xorm:"TOTALPRICE"`                             // 总价
+	CURRENCYDES   string  `json:"currencydes" xorm:"CURRENCYDES"`                           // 币种
+	CUSTOMSVALUE  float64 `json:"customsvalue" xorm:"CUSTOMSVALUE"`                         // 报关总值
+	ORIGINCOUNTRY string  `json:"origincountry" xorm:"ORIGINCOUNTRY"`                       // 原产国
+	REMARK        string  `json:"remark" xorm:"REMARK"`                                     // 备注
+	USERID        int64   `json:"userid" xorm:"USERID" form:"userid" binding:"required"`    // 用户ID
+	CUSTOMSNO     string  `json:"customsno" xorm:"CUSTOMSNO"`                               // 报关单号(进仓:录入时更新,出仓申请时有)
+
+	GOODSNUM      string    `json:"goodsnum" xorm:"GOODSNUM"`           // 商品编号
+	GOODSNAME     string    `json:"goodsname" xorm:"GOODSNAME"`         // 商品名称
+	COUNTRYNAME   string    `json:"countryname" xorm:"COUNTRYNAME"`     // 产销国
+	REPORTUNIT    string    `json:"reportunit" xorm:"REPORTUNIT"`       // 申报计量单位
+	LEGALUNIT     string    `json:"legalunit" xorm:"LEGALUNIT"`         // 法定计量单位
+	UNITPRICE     float64   `json:"unitprice" xorm:"UNITPRICE"`         // 单价
+	CURRENCYNAME  string    `json:"currencyname" xorm:"CURRENCYNAME"`   // 币制
+	EXECUTIONFLAG string    `json:"executionflag" xorm:"EXECUTIONFLAG"` // 海关执行标志
+	STORAGEPERIOD time.Time `json:"storageperiod" xorm:"STORAGEPERIOD"` // 存储(监管)期限
+
+	PageEx `xorm:"extends"` // 页码信息
+}
+
+func (r *BScinoutorderdetail) calc() {
+
+}
+
+func (r *BScinoutorderdetail) buildSql() string {
+	var sqlId utils.SQLVal = `
+		SELECT 
+			to_char(t.DETAILID) DETAILID,
+			to_char(t.ORDERID) ORDERID,
+			t.GOODSID,
+			t.GOODSSPEC,
+			t.RAWDETAIL,
+			t.BACKAGENUM,
+			t.NETWEIGHTCT,
+			t.NETWEIGHTGM,
+			t.BAGWEIGHTGM,
+			t.PREPRICEGM,
+			t.TOTALPRICE,
+			t.CURRENCYDES,
+			t.CUSTOMSVALUE,
+			t.ORIGINCOUNTRY,
+			t.REMARK,
+			t.USERID,
+			t.CUSTOMSNO,
+			a.GOODSNUM,
+			a.GOODSNAME,
+			a.COUNTRYNAME,
+			a.REPORTUNIT,
+			a.LEGALUNIT,
+			a.UNITPRICE,
+			a.CURRENCYNAME,
+			a.EXECUTIONFLAG,
+			a.STORAGEPERIOD
+		FROM GZ_BSCInOutOrderDetail t 
+		LEFT JOIN GZ_BSCGoods a ON a.goodsid = t.goodsid 
+		WHERE t.USERID = %v AND t.ORDERID = %v 
+		ORDER BY a.GOODSNAME 
+	`
+
+	sqlId.FormatParam(r.USERID, r.ORDERID)
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *BScinoutorderdetail) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]BScinoutorderdetail, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	total := 0
+	for i := range sData {
+		sData[i].calc()
+		total = sData[i].Total
+	}
+	return sData, err, r.Page, r.PageSize, total
+}
+
+// BScoutorderdetailatt 保税仓出库申请明细附表
+type BScoutorderdetailatt struct {
+	DETAILATTID          string    `json:"detailattid" xorm:"DETAILATTID"`                           // 明细ID(810+Unix秒时间戳(10位)+xxxxxx)
+	ORDERID              string    `json:"orderid" xorm:"ORDERID" form:"orderid" binding:"required"` // 申请ID
+	GOODSID              int64     `json:"goodsid" xorm:"GOODSID"`                                   // 商品ID
+	CUSTOMSNO            string    `json:"customsno" xorm:"CUSTOMSNO"`                               // 报关单号
+	JCKDATE              time.Time `json:"jckdate" xorm:"JCKDATE"`                                   // 进口日期
+	NETWEIGHTCT          float64   `json:"netweightct" xorm:"NETWEIGHTCT"`                           // 净重(克拉)
+	CURNETWEIGHTCT       float64   `json:"curnetweightct" xorm:"CURNETWEIGHTCT"`                     // 本次扣减量(克拉)
+	REMAINNETWEIGHTCT    float64   `json:"remainnetweightct" xorm:"REMAINNETWEIGHTCT"`               // 结余净重(克拉)
+	NETWEIGHTGM          float64   `json:"netweightgm" xorm:"NETWEIGHTGM"`                           // 净重(克)
+	CURNETWEIGHTGM       float64   `json:"curnetweightgm" xorm:"CURNETWEIGHTGM"`                     // 本次扣减净重(克)
+	REMAINCURNETWEIGHTGM float64   `json:"remaincurnetweightgm" xorm:"REMAINCURNETWEIGHTGM"`         // 结余净重(克)
+	TOTALPRICE           float64   `json:"totalprice" xorm:"TOTALPRICE"`                             // 总价
+	CURTOTALPRICE        float64   `json:"curtotalprice" xorm:"CURTOTALPRICE"`                       // 本次扣减货值
+	REMAINTOTALPRICE     float64   `json:"remaintotalprice" xorm:"REMAINTOTALPRICE"`                 // 结余总价
+	CUSTOMSVALUE         float64   `json:"customsvalue" xorm:"CUSTOMSVALUE"`                         // 报关总值
+	CURCUSTOMSVALUE      float64   `json:"curcustomsvalue" xorm:"CURCUSTOMSVALUE"`                   // 本次扣减货值(报关总值)
+	REMAINCUSTOMSVALUE   float64   `json:"remaincustomsvalue" xorm:"REMAINCUSTOMSVALUE"`             // 结余报关总值
+	USERID               int64     `json:"userid" xorm:"USERID" form:"userid" binding:"required"`    // 用户ID
+
+	GOODSNUM      string    `json:"goodsnum" xorm:"GOODSNUM"`           // 商品编号
+	GOODSNAME     string    `json:"goodsname" xorm:"GOODSNAME"`         // 商品名称
+	GOODSSPEC     string    `json:"goodsspec" xorm:"GOODSSPEC"`         // 规格型号
+	COUNTRYNAME   string    `json:"countryname" xorm:"COUNTRYNAME"`     // 产销国
+	REPORTUNIT    string    `json:"reportunit" xorm:"REPORTUNIT"`       // 申报计量单位
+	LEGALUNIT     string    `json:"legalunit" xorm:"LEGALUNIT"`         // 法定计量单位
+	UNITPRICE     float64   `json:"unitprice" xorm:"UNITPRICE"`         // 单价
+	CURRENCYNAME  string    `json:"currencyname" xorm:"CURRENCYNAME"`   // 币制
+	EXECUTIONFLAG string    `json:"executionflag" xorm:"EXECUTIONFLAG"` // 海关执行标志
+	STORAGEPERIOD time.Time `json:"storageperiod" xorm:"STORAGEPERIOD"` // 存储(监管)期限
+
+	PageEx `xorm:"extends"` // 页码信息
+}
+
+func (r *BScoutorderdetailatt) calc() {
+
+}
+
+func (r *BScoutorderdetailatt) buildSql() string {
+	var sqlId utils.SQLVal = `
+		SELECT 
+			to_char(t.DETAILATTID) DETAILATTID,
+			to_char(t.ORDERID) ORDERID,
+			t.GOODSID,
+			t.CUSTOMSNO,
+			to_char(t.JCKDATE, 'yyyy-mm-dd') JCKDATE,
+			t.NETWEIGHTCT,
+			t.CURNETWEIGHTCT,
+			t.REMAINNETWEIGHTCT,
+			t.NETWEIGHTGM,
+			t.CURNETWEIGHTGM,
+			t.REMAINCURNETWEIGHTGM,
+			t.TOTALPRICE,
+			t.CURTOTALPRICE,
+			t.REMAINTOTALPRICE,
+			t.CUSTOMSVALUE,
+			t.CURCUSTOMSVALUE,
+			t.REMAINCUSTOMSVALUE,
+			t.USERID,
+			a.GOODSNUM,
+			a.GOODSNAME,
+			a.COUNTRYNAME,
+			a.REPORTUNIT,
+			a.LEGALUNIT,
+			a.UNITPRICE,
+			a.CURRENCYNAME,
+			a.EXECUTIONFLAG,
+			a.STORAGEPERIOD
+		FROM GZ_BSCOUTORDERDETAILATT t 
+		WHERE t.USERID = %v AND t.ORDERID = %v 
+		ORDER BY a.GOODSNAME, t.JCKDATE
+	`
+
+	sqlId.FormatParam(r.USERID, r.ORDERID)
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *BScoutorderdetailatt) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]BScoutorderdetailatt, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	total := 0
+	for i := range sData {
+		sData[i].calc()
+		total = sData[i].Total
+	}
+	return sData, err, r.Page, r.PageSize, total
+}

+ 110 - 0
models/ori.go

@@ -344,3 +344,113 @@ type Thjinvesotrdepositlog struct {
 func (r *Thjinvesotrdepositlog) TableName() string {
 	return "THJ_INVESOTRDEPOSITLOG"
 }
+
+// Gzbscinoutorder 保税仓出入库申请表
+type Gzbscinoutorder struct {
+	ORDERID           int64     `json:"orderid" xorm:"ORDERID"`                     // 申请ID(806+Unix秒时间戳(10位)+xxxxxx)
+	ORDERTYPE         int32     `json:"ordertype" xorm:"ORDERTYPE"`                 // 单据类型 - 1:进仓 2:出仓(枚举:GZBSCOrderType)
+	USERID            int64     `json:"userid" xorm:"USERID"`                       // 申请用户ID
+	USERNAME          string    `json:"username" xorm:"USERNAME"`                   // 申请方名称
+	USERADDRESS       string    `json:"useraddress" xorm:"USERADDRESS"`             // 申请方地点
+	CONTACTNAME       string    `json:"contactname" xorm:"CONTACTNAME"`             // 申请方联系人
+	CONTACTNUM        string    `json:"contactnum" xorm:"CONTACTNUM"`               // 申请方联系电话
+	LOGISTICSCOMPANY  string    `json:"logisticscompany" xorm:"LOGISTICSCOMPANY"`   // 物流公司名称
+	LOGISTICSNO       string    `json:"logisticsno" xorm:"LOGISTICSNO"`             // 托运单号
+	APPLICANTTIME     time.Time `json:"applicanttime" xorm:"APPLICANTTIME"`         // 申请时间
+	OUTTYPE           int32     `json:"outtype" xorm:"OUTTYPE"`                     // 出仓类型 - 1:转厂 2:出境(枚举:GZBSCOutType)
+	ORDERSTATUS       int32     `json:"orderstatus" xorm:"ORDERSTATUS"`             // 进出仓状态 - 1.待确认 2.待上传 3.报关中 4.进仓中 5.出仓中 20.已关闭 21.确认拒绝(枚举:GZBSCOrderStatus)
+	JCKDATE           time.Time `json:"jckdate" xorm:"JCKDATE"`                     // 进出口日期
+	CUSTOMSNO         string    `json:"customsno" xorm:"CUSTOMSNO"`                 // 报关单号
+	CHECKLISTNO       string    `json:"checklistno" xorm:"CHECKLISTNO"`             // 核注清单号
+	SIGNEENAME        string    `json:"signeename" xorm:"SIGNEENAME"`               // 收发货人
+	SIGNEEDATE        time.Time `json:"signeedate" xorm:"SIGNEEDATE"`               // 收发货人日期
+	SEALNO            string    `json:"sealno" xorm:"SEALNO"`                       // 进出仓封条号
+	CONFIRMERNAME     string    `json:"confirmername" xorm:"CONFIRMERNAME"`         // 进出仓确认人
+	CONFIRMDATE       time.Time `json:"confirmdate" xorm:"CONFIRMDATE"`             // 进出仓确认时间
+	CONFIRMTRADEDATE  string    `json:"confirmtradedate" xorm:"CONFIRMTRADEDATE"`   // 进出仓确认交易日(yyyyMMdd)
+	NETWEIGHTCT       float64   `json:"netweightct" xorm:"NETWEIGHTCT"`             // 净重(克拉)
+	NETWEIGHTGM       float64   `json:"netweightgm" xorm:"NETWEIGHTGM"`             // 净重(克)
+	BAGWEIGHTGM       float64   `json:"bagweightgm" xorm:"BAGWEIGHTGM"`             // 连袋重(克)
+	TOTALPRICE        float64   `json:"totalprice" xorm:"TOTALPRICE"`               // 总价
+	CUSTOMSTOTALVALUE float64   `json:"customstotalvalue" xorm:"CUSTOMSTOTALVALUE"` // 报关总值
+	GOODSNAME         string    `json:"goodsname" xorm:"GOODSNAME"`                 // 商品名称 - 明细的商品名称拼接("/")
+	ORDERNUM          string    `json:"ordernum" xorm:"ORDERNUM"`                   // 单据编号
+}
+
+// TableName is GZ_BSCINOUTORDER
+func (r *Gzbscinoutorder) TableName() string {
+	return "GZ_BSCINOUTORDER"
+}
+
+// Gzbscinoutorderdetail 保税仓出入库申请明细表
+type Gzbscinoutorderdetail struct {
+	DETAILID      int64   `json:"detailid" xorm:"DETAILID"`           // 明细ID(807+Unix秒时间戳(10位)+xxxxxx)
+	ORDERID       int64   `json:"orderid" xorm:"ORDERID"`             // 申请ID
+	GOODSID       int64   `json:"goodsid" xorm:"GOODSID"`             // 商品ID
+	GOODSSPEC     string  `json:"goodsspec" xorm:"GOODSSPEC"`         // 规格
+	RAWDETAIL     string  `json:"rawdetail" xorm:"RAWDETAIL"`         // 原料明细
+	BACKAGENUM    int32   `json:"backagenum" xorm:"BACKAGENUM"`       // 件数
+	NETWEIGHTCT   float64 `json:"netweightct" xorm:"NETWEIGHTCT"`     // 净重(克拉)
+	NETWEIGHTGM   float64 `json:"netweightgm" xorm:"NETWEIGHTGM"`     // 净重(克)
+	BAGWEIGHTGM   float64 `json:"bagweightgm" xorm:"BAGWEIGHTGM"`     // 连袋重(克)
+	PREPRICEGM    float64 `json:"prepricegm" xorm:"PREPRICEGM"`       // 单价(克)
+	TOTALPRICE    float64 `json:"totalprice" xorm:"TOTALPRICE"`       // 总价
+	CURRENCYDES   string  `json:"currencydes" xorm:"CURRENCYDES"`     // 币种
+	CUSTOMSVALUE  float64 `json:"customsvalue" xorm:"CUSTOMSVALUE"`   // 报关总值
+	ORIGINCOUNTRY string  `json:"origincountry" xorm:"ORIGINCOUNTRY"` // 原产国
+	REMARK        string  `json:"remark" xorm:"REMARK"`               // 备注
+	USERID        int64   `json:"userid" xorm:"USERID"`               // 用户ID
+	CUSTOMSNO     string  `json:"customsno" xorm:"CUSTOMSNO"`         // 报关单号(进仓:录入时更新,出仓申请时有)
+}
+
+// TableName is GZ_BSCINOUTORDERDETAIL
+func (r *Gzbscinoutorderdetail) TableName() string {
+	return "GZ_BSCINOUTORDERDETAIL"
+}
+
+// Gzbscgoods 保税商品表
+type Gzbscgoods struct {
+	GOODSID       int64     `json:"goodsid" xorm:"GOODSID"`             // 商品ID(料号)
+	GOODSNUM      string    `json:"goodsnum" xorm:"GOODSNUM"`           // 商品编号
+	GOODSNAME     string    `json:"goodsname" xorm:"GOODSNAME"`         // 商品名称
+	GOODSSPEC     string    `json:"goodsspec" xorm:"GOODSSPEC"`         // 规格型号
+	COUNTRYNAME   string    `json:"countryname" xorm:"COUNTRYNAME"`     // 产销国
+	REPORTUNIT    string    `json:"reportunit" xorm:"REPORTUNIT"`       // 申报计量单位
+	LEGALUNIT     string    `json:"legalunit" xorm:"LEGALUNIT"`         // 法定计量单位
+	UNITPRICE     float64   `json:"unitprice" xorm:"UNITPRICE"`         // 单价
+	CURRENCYNAME  string    `json:"currencyname" xorm:"CURRENCYNAME"`   // 币制
+	EXECUTIONFLAG string    `json:"executionflag" xorm:"EXECUTIONFLAG"` // 海关执行标志
+	STORAGEPERIOD time.Time `json:"storageperiod" xorm:"STORAGEPERIOD"` // 存储(监管)期限
+}
+
+// TableName is GZ_BSCGOODS
+func (r *Gzbscgoods) TableName() string {
+	return "GZ_BSCGOODS"
+}
+
+// Gzbscoutorderdetailatt 保税仓出库申请明细附表
+type Gzbscoutorderdetailatt struct {
+	DETAILATTID          int64     `json:"detailattid" xorm:"DETAILATTID"`                   // 明细ID(810+Unix秒时间戳(10位)+xxxxxx)
+	ORDERID              int64     `json:"orderid" xorm:"ORDERID"`                           // 申请ID
+	GOODSID              int64     `json:"goodsid" xorm:"GOODSID"`                           // 商品ID
+	CUSTOMSNO            string    `json:"customsno" xorm:"CUSTOMSNO"`                       // 报关单号
+	JCKDATE              time.Time `json:"jckdate" xorm:"JCKDATE"`                           // 进口日期
+	NETWEIGHTCT          float64   `json:"netweightct" xorm:"NETWEIGHTCT"`                   // 净重(克拉)
+	CURNETWEIGHTCT       float64   `json:"curnetweightct" xorm:"CURNETWEIGHTCT"`             // 本次扣减量(克拉)
+	REMAINNETWEIGHTCT    float64   `json:"remainnetweightct" xorm:"REMAINNETWEIGHTCT"`       // 结余净重(克拉)
+	NETWEIGHTGM          float64   `json:"netweightgm" xorm:"NETWEIGHTGM"`                   // 净重(克)
+	CURNETWEIGHTGM       float64   `json:"curnetweightgm" xorm:"CURNETWEIGHTGM"`             // 本次扣减净重(克)
+	REMAINCURNETWEIGHTGM float64   `json:"remaincurnetweightgm" xorm:"REMAINCURNETWEIGHTGM"` // 结余净重(克)
+	TOTALPRICE           float64   `json:"totalprice" xorm:"TOTALPRICE"`                     // 总价
+	CURTOTALPRICE        float64   `json:"curtotalprice" xorm:"CURTOTALPRICE"`               // 本次扣减货值
+	REMAINTOTALPRICE     float64   `json:"remaintotalprice" xorm:"REMAINTOTALPRICE"`         // 结余总价
+	CUSTOMSVALUE         float64   `json:"customsvalue" xorm:"CUSTOMSVALUE"`                 // 报关总值
+	CURCUSTOMSVALUE      float64   `json:"curcustomsvalue" xorm:"CURCUSTOMSVALUE"`           // 本次扣减货值(报关总值)
+	REMAINCUSTOMSVALUE   float64   `json:"remaincustomsvalue" xorm:"REMAINCUSTOMSVALUE"`     // 结余报关总值
+	USERID               int64     `json:"userid" xorm:"USERID"`                             // 用户ID
+}
+
+// TableName is GZ_BSCOUTORDERDETAILATT
+func (r *Gzbscoutorderdetailatt) TableName() string {
+	return "GZ_BSCOUTORDERDETAILATT"
+}

+ 3 - 0
routers/router.go

@@ -688,6 +688,9 @@ func InitRouter() *gin.Engine {
 		guangzuanR.GET("QueryTradeReport", guangzuan.QueryTradeReport)
 		guangzuanR.GET("QueryGzcjjcorderoperate", guangzuan.QueryGzcjjcorderoperate)
 		guangzuanR.GET("QueryFworderoperate", guangzuan.QueryFworderoperate)
+		guangzuanR.GET("QueryGzbscinOutOrder", guangzuan.QueryGzbscinOutOrder)
+		guangzuanR.GET("QueryBScinOutOrderDetail", guangzuan.QueryBScinOutOrderDetail)
+		guangzuanR.GET("QueryBScOutOrderDetailatt", guangzuan.QueryBScOutOrderDetailatt)
 	}
 
 	// **************************上海铁合金*************************