Bläddra i källkod

增加接口:查业务管理/结算(拆分字段显示)

zou.yingbin 4 år sedan
förälder
incheckning
41204aaaaf
5 ändrade filer med 452 tillägg och 1 borttagningar
  1. 70 1
      controllers/ermcp/qryOPApply.go
  2. 141 0
      docs/docs.go
  3. 141 0
      docs/swagger.json
  4. 99 0
      docs/swagger.yaml
  5. 1 0
      routers/router.go

+ 70 - 1
controllers/ermcp/qryOPApply.go

@@ -147,6 +147,75 @@ func QueryBusinessJs(c *gin.Context) {
 	}
 }
 
+// 查询业务管理/结算响应(拆分字段)
+type QryBussinessJsExRsp struct {
+	models.ErmcpOPApplyModel
+	ReckonType  string  `json:"reckontype"`  // 结算类型
+	ReckonValue float64 `json:"reckonvalue"` // 值
+}
+
+// @Summary 查询业务管理(结算)(对应菜单:业务管理/结算[拆分记录])
+// @Produce json
+// @Security ApiKeyAuth
+// @Param UserId query int true "用户ID"
+// @Param relatedid query string false "现货合同ID, 不填则查所有"
+// @Success 200 {array} QryBussinessJsExRsp
+// @Failure 500 {object} app.Response
+// @Router /Ermcp/QueryBusinessJsEx [get]
+// @Tags 企业风险管理(app)
+func QueryBusinessJsEx(c *gin.Context) {
+	appG := app.Gin{C: c}
+	var req QryOPApplyReq
+	_ = c.ShouldBind(&req)
+	m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId, USERID: req.UserId}
+	if d, err := m.GetData(2); err == nil {
+		//构建应答数据
+		sData := make([]QryBussinessJsExRsp, 0)
+		for _, v := range d {
+			var rsp QryBussinessJsExRsp
+			var rd ReckonData
+			rsp.ErmcpOPApplyModel = v
+			if len(rsp.DETAILJSON) > 0 {
+				if err := json.Unmarshal([]byte(rsp.DETAILJSON), &rd); err == nil{
+					if rd.ReckonRealQty != nil{
+						rsp.ReckonType = "结算量"
+						rsp.ReckonValue = *rd.ReckonRealQty
+						sData = append(sData, rsp)
+					}
+					if rd.ReckonOtherAmount != nil{
+						rsp.ReckonType = "其它费用"
+						rsp.ReckonValue = *rd.ReckonOtherAmount
+						sData = append(sData, rsp)
+					}
+					if rd.ReckonAdjustAmount != nil{
+						rsp.ReckonType = "调整金额"
+						rsp.ReckonValue = *rd.ReckonAdjustAmount
+						sData = append(sData, rsp)
+					}
+					if rd.AddMargin != nil{
+						rsp.ReckonType = "追加保证金"
+						rsp.ReckonValue = *rd.AddMargin
+						sData = append(sData, rsp)
+					}
+					if rd.DecMargin != nil{
+						rsp.ReckonType = "减少保证金"
+						rsp.ReckonValue = *rd.DecMargin
+						sData = append(sData, rsp)
+					}
+					if rd.ReckonOsAmount != nil{
+						rsp.ReckonType = "溢短金额"
+						rsp.ReckonValue = *rd.ReckonOsAmount
+						sData = append(sData, rsp)
+					}
+				}
+			}
+		}
+		appG.Response(http.StatusOK, e.SUCCESS, sData)
+	} else {
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+	}
+}
+
 // 查询业务管理/款项响应
 type QryBussinessKxRsp struct {
 	models.ErmcpOPApplyModel
@@ -175,7 +244,7 @@ func QueryBusinessKx(c *gin.Context) {
 			var rsp QryBussinessKxRsp
 			rsp.ErmcpOPApplyModel = v
 			if len(rsp.DETAILJSON) > 0 {
-				if err := json.Unmarshal([]byte(rsp.DETAILJSON), &rsp.KxData); err == nil{
+				if err := json.Unmarshal([]byte(rsp.DETAILJSON), &rsp.KxData); err == nil {
 					rsp.KxData.CalcKxType(rsp.CONTRACTTYPE)
 					sData = append(sData, rsp)
 				}

+ 141 - 0
docs/docs.go

@@ -903,6 +903,54 @@ var doc = `{
                 }
             }
         },
+        "/Ermcp/QueryBusinessJsEx": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "企业风险管理(app)"
+                ],
+                "summary": "查询业务管理(结算)(对应菜单:业务管理/结算[拆分记录])",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "UserId",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "现货合同ID, 不填则查所有",
+                        "name": "relatedid",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/ermcp.QryBussinessJsExRsp"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Ermcp/QueryBusinessKx": {
             "get": {
                 "security": [
@@ -6639,6 +6687,99 @@ var doc = `{
                 }
             }
         },
+        "ermcp.QryBussinessJsExRsp": {
+            "type": "object",
+            "properties": {
+                "applyid": {
+                    "description": "申请人",
+                    "type": "string"
+                },
+                "applyname": {
+                    "description": "申请人名称",
+                    "type": "string"
+                },
+                "applystatus": {
+                    "description": "申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                    "type": "integer"
+                },
+                "applytime": {
+                    "description": "申请时间",
+                    "type": "string"
+                },
+                "auditname": {
+                    "description": "审核人名称",
+                    "type": "string"
+                },
+                "audittime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "buyusername": {
+                    "description": "采购方名称",
+                    "type": "string"
+                },
+                "contractno": {
+                    "description": "合同编号",
+                    "type": "string"
+                },
+                "contractstatus": {
+                    "description": "合同状态- 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回",
+                    "type": "integer"
+                },
+                "contracttype": {
+                    "description": "现货合同类型 - 1:采购 -1:销售",
+                    "type": "integer"
+                },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
+                "goodscode": {
+                    "description": "点价合约",
+                    "type": "string"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "operateapplyid": {
+                    "description": "操作申请ID(603+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "operateapplytype": {
+                    "description": "操作申请类型 - 1:点价 2:结算登记 3:款项登记 4:发票登记",
+                    "type": "integer"
+                },
+                "pricemove": {
+                    "description": "升贴水",
+                    "type": "number"
+                },
+                "pricetype": {
+                    "description": "定价类型 - 1:一口价 2:点价 3:暂定价",
+                    "type": "integer"
+                },
+                "reckontype": {
+                    "description": "结算类型",
+                    "type": "string"
+                },
+                "reckonvalue": {
+                    "description": "值",
+                    "type": "number"
+                },
+                "relatedid": {
+                    "description": "现货合同ID",
+                    "type": "string"
+                },
+                "sellusername": {
+                    "description": "销售方名字",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
+        },
         "ermcp.QryBussinessJsRsp": {
             "type": "object",
             "properties": {

+ 141 - 0
docs/swagger.json

@@ -887,6 +887,54 @@
                 }
             }
         },
+        "/Ermcp/QueryBusinessJsEx": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "企业风险管理(app)"
+                ],
+                "summary": "查询业务管理(结算)(对应菜单:业务管理/结算[拆分记录])",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "UserId",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "现货合同ID, 不填则查所有",
+                        "name": "relatedid",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/ermcp.QryBussinessJsExRsp"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Ermcp/QueryBusinessKx": {
             "get": {
                 "security": [
@@ -6623,6 +6671,99 @@
                 }
             }
         },
+        "ermcp.QryBussinessJsExRsp": {
+            "type": "object",
+            "properties": {
+                "applyid": {
+                    "description": "申请人",
+                    "type": "string"
+                },
+                "applyname": {
+                    "description": "申请人名称",
+                    "type": "string"
+                },
+                "applystatus": {
+                    "description": "申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                    "type": "integer"
+                },
+                "applytime": {
+                    "description": "申请时间",
+                    "type": "string"
+                },
+                "auditname": {
+                    "description": "审核人名称",
+                    "type": "string"
+                },
+                "audittime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "buyusername": {
+                    "description": "采购方名称",
+                    "type": "string"
+                },
+                "contractno": {
+                    "description": "合同编号",
+                    "type": "string"
+                },
+                "contractstatus": {
+                    "description": "合同状态- 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回",
+                    "type": "integer"
+                },
+                "contracttype": {
+                    "description": "现货合同类型 - 1:采购 -1:销售",
+                    "type": "integer"
+                },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
+                "goodscode": {
+                    "description": "点价合约",
+                    "type": "string"
+                },
+                "goodsname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "operateapplyid": {
+                    "description": "操作申请ID(603+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "operateapplytype": {
+                    "description": "操作申请类型 - 1:点价 2:结算登记 3:款项登记 4:发票登记",
+                    "type": "integer"
+                },
+                "pricemove": {
+                    "description": "升贴水",
+                    "type": "number"
+                },
+                "pricetype": {
+                    "description": "定价类型 - 1:一口价 2:点价 3:暂定价",
+                    "type": "integer"
+                },
+                "reckontype": {
+                    "description": "结算类型",
+                    "type": "string"
+                },
+                "reckonvalue": {
+                    "description": "值",
+                    "type": "number"
+                },
+                "relatedid": {
+                    "description": "现货合同ID",
+                    "type": "string"
+                },
+                "sellusername": {
+                    "description": "销售方名字",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
+        },
         "ermcp.QryBussinessJsRsp": {
             "type": "object",
             "properties": {

+ 99 - 0
docs/swagger.yaml

@@ -993,6 +993,75 @@ definitions:
         description: 用户ID
         type: integer
     type: object
+  ermcp.QryBussinessJsExRsp:
+    properties:
+      applyid:
+        description: 申请人
+        type: string
+      applyname:
+        description: 申请人名称
+        type: string
+      applystatus:
+        description: 申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+        type: integer
+      applytime:
+        description: 申请时间
+        type: string
+      auditname:
+        description: 审核人名称
+        type: string
+      audittime:
+        description: 审核时间
+        type: string
+      buyusername:
+        description: 采购方名称
+        type: string
+      contractno:
+        description: 合同编号
+        type: string
+      contractstatus:
+        description: 合同状态- 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
+        type: integer
+      contracttype:
+        description: 现货合同类型 - 1:采购 -1:销售
+        type: integer
+      enumdicname:
+        description: 单位名称
+        type: string
+      goodscode:
+        description: 点价合约
+        type: string
+      goodsname:
+        description: 商品名称
+        type: string
+      operateapplyid:
+        description: 操作申请ID(603+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      operateapplytype:
+        description: 操作申请类型 - 1:点价 2:结算登记 3:款项登记 4:发票登记
+        type: integer
+      pricemove:
+        description: 升贴水
+        type: number
+      pricetype:
+        description: 定价类型 - 1:一口价 2:点价 3:暂定价
+        type: integer
+      reckontype:
+        description: 结算类型
+        type: string
+      reckonvalue:
+        description: 值
+        type: number
+      relatedid:
+        description: 现货合同ID
+        type: string
+      sellusername:
+        description: 销售方名字
+        type: string
+      userid:
+        description: 用户ID
+        type: integer
+    type: object
   ermcp.QryBussinessJsRsp:
     properties:
       addmargin:
@@ -8052,6 +8121,36 @@ paths:
       summary: 查询业务管理(结算)(对应菜单:业务管理/结算)
       tags:
       - 企业风险管理(app)
+  /Ermcp/QueryBusinessJsEx:
+    get:
+      parameters:
+      - description: 用户ID
+        in: query
+        name: UserId
+        required: true
+        type: integer
+      - description: 现货合同ID, 不填则查所有
+        in: query
+        name: relatedid
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/ermcp.QryBussinessJsExRsp'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询业务管理(结算)(对应菜单:业务管理/结算[拆分记录])
+      tags:
+      - 企业风险管理(app)
   /Ermcp/QueryBusinessKx:
     get:
       parameters:

+ 1 - 0
routers/router.go

@@ -320,6 +320,7 @@ func InitRouter() *gin.Engine {
 		ermcpR.GET("/QueryHedgePlan", ermcp.QueryHedgePlan)
 		ermcpR.GET("/QueryBusinessDj", ermcp.QueryBusinessDj)
 		ermcpR.GET("/QueryBusinessJs", ermcp.QueryBusinessJs)
+		ermcpR.GET("/QueryBusinessJsEx", ermcp.QueryBusinessJsEx)
 		ermcpR.GET("/QueryBusinessKx", ermcp.QueryBusinessKx)
 		ermcpR.GET("/QueryBusinessFp", ermcp.QueryBusinessFp)
 		ermcpR.GET("/QueryChangeLog", ermcp.QueryChangeLog)