Browse Source

Merge branch 'master' of 192.168.30.132:MTP2.0/MTP20_IF

zhou.xiaoning 4 years ago
parent
commit
98720a13e1
8 changed files with 2572 additions and 532 deletions
  1. 34 0
      controllers/ermcp/qryErmcp.go
  2. 183 0
      controllers/ermcp/qryOPApply.go
  3. 748 151
      docs/docs.go
  4. 748 151
      docs/swagger.json
  5. 668 227
      docs/swagger.yaml
  6. 103 3
      models/ermcp.go
  7. 83 0
      models/ermcpOPApply.go
  8. 5 0
      routers/router.go

+ 34 - 0
controllers/ermcp/qryErmcp.go

@@ -15,6 +15,40 @@ import (
 	"net/http"
 )
 
+// 查询现货合同
+type QrySpotContractReq struct {
+	QueryType int32 `form:"QueryType" binding:"required"`    // 查询类型 1-未提交 2-待审核 3-履约中 4-已完成
+}
+
+// 查询现货合同应答
+type QrySpotContractRsp models.ErmcpSpotContractModel
+
+// QuerySpotContract  企业风险管理合同查询
+// @Summary 查询现货合同(对应现货合同菜单)
+// @Produce json
+// @Security ApiKeyAuth
+// @Param QueryType query int true "查询类型 1-未提交 2-待审核 3-履约中 4-已完成"
+// @Success 200 {array} QrySpotContractRsp
+// @Failure 500 {object} app.Response
+// @Router /Ermcp/QuerySpotContract [get]
+// @Tags 企业风险管理(app)
+func QuerySpotContract(c *gin.Context) {
+	appG := app.Gin{C: c}
+	var req QrySpotContractReq
+	if err := c.ShouldBind(&req); err != nil {
+		logger.GetLogger().Errorf("parse query req: %v", err)
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	var m models.ErmcpSpotContractModel
+	if d, err := m.GetData(req.QueryType); err == nil {
+		appG.Response(http.StatusOK, e.SUCCESS, d)
+	} else {
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+	}
+}
+
 // 查询合同请求结构
 type QryErmcpReq struct {
 	ContractType int32 `form:"contracttype" binding:"required"` // 合同类型

+ 183 - 0
controllers/ermcp/qryOPApply.go

@@ -0,0 +1,183 @@
+/**
+* @Author: zou.yingbin
+* @Create  : 2021/1/11 17:58
+* @Modify  : 2021/1/11 17:58
+ */
+
+package ermcp
+
+import (
+	"encoding/json"
+	"github.com/gin-gonic/gin"
+	"mtp2_if/global/app"
+	"mtp2_if/global/e"
+	"mtp2_if/models"
+	"net/http"
+)
+
+//点价数据
+type DjData struct {
+	PricedPrice *float64 `json:"pricedPrice,omitempty"` //点价价格(非必填)
+	PricedQty   *float64 `json:"pricedQty,omitempty"`   //点价数量(非必填)
+}
+
+//结点登记数据
+type ReckonData struct {
+	ReckonRealQty      *float64 `json:"reckonRealQty,omitempty"`      //结算实际数量(非必填)
+	ReckonOsAmount     *float64 `json:"reckonOsAmount,omitempty"`     //结算溢短金额(非必填)
+	ReckonOtherAmount  *float64 `json:"reckonOtherAmount,omitempty"`  //结算其他费用(非必填)
+	ReckonAdjustAmount *float64 `json:"reckonAdjustAmount,omitempty"` //结算调整金额(非必填)
+	AddMargin          *float64 `json:"addMargin,omitempty"`          //追加保证金(非必填)
+	DecMargin          *float64 `json:"decMargin,omitempty"`          //减少保证金(非必填)
+}
+
+//款项操作
+type KxData struct {
+	PayAmount    *float64 `json:"payAmount,omitempty"`    //收付款(非必填)
+	DeductAmount *float64 `json:"deductAmount,omitempty"` //退款(非必填)
+}
+
+//开票操作数据
+type KpData struct {
+	InvoiceAmount *float64 //已开收票金额(销售为开票,采购为收票)
+}
+
+// 查询合同操作请求
+type QryOPApplyReq struct {
+}
+
+// 查询业务管理/点价应答
+type QryBusinessDjRsp struct {
+	models.ErmcpOPApplyModel
+	DjData
+}
+
+// QueryBusinessDj  企业风险管理合同操作查询
+// @Summary 查询业务管理(点价)(对应菜单:业务管理/点价)
+// @Produce json
+// @Security ApiKeyAuth
+// @Success 200 {array} QryBusinessDjRsp
+// @Failure 500 {object} app.Response
+// @Router /Ermcp/QueryBusinessDj [get]
+// @Tags 企业风险管理(app)
+func QueryBusinessDj(c *gin.Context) {
+	appG := app.Gin{C: c}
+	var m models.ErmcpOPApplyModel
+	if d, err := m.GetData(1); err == nil {
+		//构建应答数据
+		sData := make([]QryBusinessDjRsp, 0)
+		for _, v := range d {
+			var rsp QryBusinessDjRsp
+			rsp.ErmcpOPApplyModel = v
+			if len(rsp.DETAILJSON) > 0{
+				_ = json.Unmarshal([]byte(rsp.DETAILJSON), &rsp.DjData)
+			}
+			sData = append(sData, rsp)
+		}
+		appG.Response(http.StatusOK, e.SUCCESS, sData)
+	} else {
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+	}
+}
+
+// 查询业务管理/结算响应
+type QryBussinessJsRsp struct {
+	models.ErmcpOPApplyModel
+	ReckonData
+}
+
+// QueryBusinessJs  企业风险管理合同操作查询
+// @Summary 查询业务管理(结算)(对应菜单:业务管理/结算)
+// @Produce json
+// @Security ApiKeyAuth
+// @Success 200 {array} QryBussinessJsRsp
+// @Failure 500 {object} app.Response
+// @Router /Ermcp/QueryBusinessJs [get]
+// @Tags 企业风险管理(app)
+func QueryBusinessJs(c *gin.Context) {
+	appG := app.Gin{C: c}
+	var m models.ErmcpOPApplyModel
+	if d, err := m.GetData(2); err == nil {
+		//构建应答数据
+		sData := make([]QryBussinessJsRsp, 0)
+		for _, v := range d {
+			var rsp QryBussinessJsRsp
+			rsp.ErmcpOPApplyModel = v
+			if len(rsp.DETAILJSON) > 0 {
+				_ = json.Unmarshal([]byte(rsp.DETAILJSON), &rsp.ReckonData)
+			}
+			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
+	KxData
+}
+
+// QueryBusinessKx  企业风险管理合同操作查询
+// @Summary 查询业务管理(款项)(对应菜单:业务管理/款项)
+// @Produce json
+// @Security ApiKeyAuth
+// @Success 200 {array} QryBussinessKxRsp
+// @Failure 500 {object} app.Response
+// @Router /Ermcp/QueryBusinessKx [get]
+// @Tags 企业风险管理(app)
+func QueryBusinessKx(c *gin.Context) {
+	appG := app.Gin{C: c}
+	var m models.ErmcpOPApplyModel
+	if d, err := m.GetData(3); err == nil {
+		//构建应答数据
+		sData := make([]QryBussinessKxRsp, 0)
+		for _, v := range d {
+			var rsp QryBussinessKxRsp
+			rsp.ErmcpOPApplyModel = v
+			if len(rsp.DETAILJSON) > 0 {
+				_ = json.Unmarshal([]byte(rsp.DETAILJSON), &rsp.KxData)
+			}
+			sData = append(sData, rsp)
+		}
+		appG.Response(http.StatusOK, e.SUCCESS, sData)
+	} else {
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+	}
+}
+
+// 查询业务管理/款项响应
+type QryBussinessFpRsp struct {
+	models.ErmcpOPApplyModel
+	KpData
+}
+
+// QueryBusinessFp  企业风险管理合同操作查询
+// @Summary 查询业务管理(发票)(对应菜单:业务管理/发票)
+// @Produce json
+// @Security ApiKeyAuth
+// @Success 200 {array} QryBussinessFpRsp
+// @Failure 500 {object} app.Response
+// @Router /Ermcp/QueryBusinessFp [get]
+// @Tags 企业风险管理(app)
+func QueryBusinessFp(c *gin.Context) {
+	appG := app.Gin{C: c}
+	var m models.ErmcpOPApplyModel
+	if d, err := m.GetData(4); err == nil {
+		//构建应答数据
+		sData := make([]QryBussinessFpRsp, 0)
+		for _, v := range d {
+			var rsp QryBussinessFpRsp
+			rsp.ErmcpOPApplyModel = v
+			if len(rsp.DETAILJSON) > 0 {
+				_ = json.Unmarshal([]byte(rsp.DETAILJSON), &rsp.KpData)
+			}
+			sData = append(sData, rsp)
+		}
+		appG.Response(http.StatusOK, e.SUCCESS, sData)
+	} else {
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+	}
+}

File diff suppressed because it is too large
+ 748 - 151
docs/docs.go


File diff suppressed because it is too large
+ 748 - 151
docs/swagger.json


+ 668 - 227
docs/swagger.yaml

@@ -87,6 +87,7 @@ definitions:
       province:
         $ref: '#/definitions/models.Division'
         description: 省
+        type: object
     type: object
   common.QueryTableDefineRsp:
     properties:
@@ -840,165 +841,251 @@ definitions:
     - mindeliveryqty
     - xdeliveryratio
     type: object
-  ermcp.QryErmcpRsp:
+  ermcp.QryBusinessDjRsp:
     properties:
-      accountid:
-        description: 账户ID
+      APPLYID:
+        description: 申请人
         type: string
-      accountname:
-        description: 账户名称
+      APPLYNAME:
+        description: 申请人名称
         type: string
-      contracctstatus:
-        description: 合同状态- 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
+      APPLYSTATUS:
+        description: 申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
         type: integer
-      convertfactor:
-        description: 标仓系数
-        type: number
-      daikaiAmount:
-        description: 待开票额
-        type: number
-      deliveryenddate:
-        description: 交割结束日
-        type: string
-      deliverygoodscode:
-        description: 现货商品代码
+      APPLYTIME:
+        description: 申请时间
         type: string
-      deliverygoodsid:
-        description: 现货商品ID
-        type: integer
-      deliverygoodsname:
-        description: 现货商品名称
+      AUDITTIME:
+        description: 审核时间
         type: string
-      deliverystartdate:
-        description: 交割开始日
+      BUYUSERNAME:
+        description: 采购方名称
         type: string
-      enddate:
-        description: 点价结束日
+      CONTRACTNO:
+        description: 合同编号
         type: string
-      enumdicname:
+      CONTRACTTYPE:
+        description: 现货合同类型 - 1:采购 -1:销售
+        type: integer
+      EnumdicName:
         description: 单位名称
         type: string
-      goodscode:
-        description: 点价商品代码
+      GOODSCODE:
+        description: 点价合约
         type: string
-      goodsid:
-        description: 点价商品ID
+      GOODSNAME:
+        description: 商品名称
+        type: string
+      OPERATEAPPLYID:
+        description: 操作申请ID(603+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      OPERATEAPPLYTYPE:
+        description: 操作申请类型 - 1:点价 2:结算登记 3:款项登记 4:发票登记
         type: integer
-      invoiceamount:
-        description: 已开票额
-        type: number
-      payamount:
-        description: 已收付额(收款或付款)
-        type: number
-      pricedqty:
-        description: 已定价量
-        type: number
-      pricemove:
-        description: 升贴水
-        type: number
-      pricetype:
+      PRICETYPE:
         description: 定价类型 - 1:一口价 2:点价 3:暂定价
         type: integer
-      producttype:
-        description: 产品类型 - 1:标准仓单 2:等标 3:非标
-        type: integer
-      qty:
-        description: 合同量
-        type: number
-      spotcontractid:
-        description: 合同ID
-        type: integer
-      spotgoodsdesc:
-        description: 商品型号(商品规格)
+      RELATEDID:
+        description: 现货合同ID
         type: string
-      startdate:
-        description: 点价开始日
+      SELLUSERNAME:
+        description: 销售方名字
         type: string
-      unpayAmount:
-        description: 待支收额(支付或收款)
-        type: number
-      unpricedqty:
-        description: 未定价量
+      pricedPrice:
+        description: 点价价格(非必填)
         type: number
-      unsureqty:
-        description: 未确定量
+      pricedQty:
+        description: 点价数量(非必填)
         type: number
     type: object
-  ermcp.QryHedgePlanRsp:
+  ermcp.QryBussinessFpRsp:
     properties:
-      contracttype:
-        description: 计划类型 - 1:采购 -1:销售
+      APPLYID:
+        description: 申请人
+        type: string
+      APPLYNAME:
+        description: 申请人名称
+        type: string
+      APPLYSTATUS:
+        description: 申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
         type: integer
-      convertfactor:
-        description: 标仓系数
-        type: number
-      deliverygoodsid:
-        description: 现货品种ID
+      APPLYTIME:
+        description: 申请时间
+        type: string
+      AUDITTIME:
+        description: 审核时间
+        type: string
+      BUYUSERNAME:
+        description: 采购方名称
+        type: string
+      CONTRACTNO:
+        description: 合同编号
+        type: string
+      CONTRACTTYPE:
+        description: 现货合同类型 - 1:采购 -1:销售
         type: integer
-      deliverygoodsname:
-        description: 现货品种名称
+      EnumdicName:
+        description: 单位名称
         type: string
-      hedgeplanid:
-        description: 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
+      GOODSCODE:
+        description: 点价合约
         type: string
-      hedgeplanno:
-        description: 套保计划编号
+      GOODSNAME:
+        description: 商品名称
         type: string
-      hedgeplanstatus:
-        description: 套保计划状态 -  0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
+      OPERATEAPPLYID:
+        description: 操作申请ID(603+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      OPERATEAPPLYTYPE:
+        description: 操作申请类型 - 1:点价 2:结算登记 3:款项登记 4:发票登记
         type: integer
-      planqty:
-        description: 计划数量
+      PRICETYPE:
+        description: 定价类型 - 1:一口价 2:点价 3:暂定价
+        type: integer
+      RELATEDID:
+        description: 现货合同ID
+        type: string
+      SELLUSERNAME:
+        description: 销售方名字
+        type: string
+      invoiceAmount:
+        description: 已开收票金额(销售为开票,采购为收票)
         type: number
-      plantime:
-        description: 计划时间
+    type: object
+  ermcp.QryBussinessJsRsp:
+    properties:
+      APPLYID:
+        description: 申请人
         type: string
-      producttype:
-        description: 产品类型 - 1:标准仓单 2:等标 3:非标
+      APPLYNAME:
+        description: 申请人名称
+        type: string
+      APPLYSTATUS:
+        description: 申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
         type: integer
-      remark:
-        description: 备注
+      APPLYTIME:
+        description: 申请时间
         type: string
-      spotgoodsdesc:
-        description: 商品型号
+      AUDITTIME:
+        description: 审核时间
         type: string
-      wrstandardid:
-        description: 现货商品ID
+      BUYUSERNAME:
+        description: 采购方名称
+        type: string
+      CONTRACTNO:
+        description: 合同编号
+        type: string
+      CONTRACTTYPE:
+        description: 现货合同类型 - 1:采购 -1:销售
         type: integer
-      wrstandardname:
-        description: 现货商品名称
+      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
+      PRICETYPE:
+        description: 定价类型 - 1:一口价 2:点价 3:暂定价
+        type: integer
+      RELATEDID:
+        description: 现货合同ID
         type: string
+      SELLUSERNAME:
+        description: 销售方名字
+        type: string
+      addMargin:
+        description: 追加保证金(非必填)
+        type: number
+      decMargin:
+        description: 减少保证金(非必填)
+        type: number
+      reckonAdjustAmount:
+        description: 结算调整金额(非必填)
+        type: number
+      reckonOsAmount:
+        description: 结算溢短金额(非必填)
+        type: number
+      reckonOtherAmount:
+        description: 结算其他费用(非必填)
+        type: number
+      reckonRealQty:
+        description: 结算实际数量(非必填)
+        type: number
     type: object
-  ermcp.QryUserInfoRsp:
+  ermcp.QryBussinessKxRsp:
     properties:
-      address:
-        description: 通讯地址
+      APPLYID:
+        description: 申请人
         type: string
-      cardnum:
-        description: 证件号码
+      APPLYNAME:
+        description: 申请人名称
         type: string
-      cardtype:
-        description: 证件类型
+      APPLYSTATUS:
+        description: 申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+        type: integer
+      APPLYTIME:
+        description: 申请时间
         type: string
-      customername:
-        description: 企业名称
+      AUDITTIME:
+        description: 审核时间
         type: string
-      mobile:
-        description: 手机号码
+      BUYUSERNAME:
+        description: 采购方名称
         type: string
-      remark:
-        description: 备注
+      CONTRACTNO:
+        description: 合同编号
         type: string
-      status:
-        description: 账户状态
+      CONTRACTTYPE:
+        description: 现货合同类型 - 1:采购 -1:销售
+        type: integer
+      EnumdicName:
+        description: 单位名称
         type: string
-      telphone:
-        description: 联系电话
+      GOODSCODE:
+        description: 点价合约
         type: string
-      userinfotype:
-        description: 客户类型
+      GOODSNAME:
+        description: 商品名称
+        type: string
+      OPERATEAPPLYID:
+        description: 操作申请ID(603+Unix秒时间戳(10位)+xxxxxx)
         type: string
+      OPERATEAPPLYTYPE:
+        description: 操作申请类型 - 1:点价 2:结算登记 3:款项登记 4:发票登记
+        type: integer
+      PRICETYPE:
+        description: 定价类型 - 1:一口价 2:点价 3:暂定价
+        type: integer
+      RELATEDID:
+        description: 现货合同ID
+        type: string
+      SELLUSERNAME:
+        description: 销售方名字
+        type: string
+      deductAmount:
+        description: 退款(非必填)
+        type: number
+      payAmount:
+        description: 收付款(非必填)
+        type: number
     type: object
+  ermcp.QryErmcpRsp:
+    $ref: '#/definitions/models.ErmcpModel'
+  ermcp.QryHedgePlanRsp:
+    $ref: '#/definitions/models.ErmcpHedgePlan'
+  ermcp.QrySpotContractRsp:
+    $ref: '#/definitions/models.ErmcpSpotContractModel'
+  ermcp.QryUserInfoRsp:
+    $ref: '#/definitions/models.ErmcpUserModel'
   erms2.QueryArbitrageStrategyRsp:
     properties:
       applybasis:
@@ -1844,26 +1931,7 @@ definitions:
     - spotcontractid
     type: object
   erms3.QryPendingBizRsp:
-    properties:
-      accountid:
-        description: 现货账户
-        type: string
-      areaname:
-        description: 所属部门
-        type: string
-      bizid:
-        description: 业务ID
-        type: string
-      bizname:
-        description: 业务名称
-        type: string
-      status:
-        description: 状态,0:待审核 1:审核通过 2:审核中 3:审核失败 4已撤销 5:审核拒绝
-        type: integer
-      type:
-        description: 业务类型,1-期现套利,2-仓单回购,3-现货贸易
-        type: integer
-    type: object
+    $ref: '#/definitions/models.PendingAuditBizModel'
   erms3.QueryBusinessInfoRsp:
     properties:
       businessid:
@@ -1930,6 +1998,7 @@ definitions:
       ouruser:
         $ref: '#/definitions/erms3.CustomerInfo'
         description: 我方账号
+        type: object
       warehouseinfos:
         description: 仓库信息列表
         items:
@@ -2136,125 +2205,369 @@ definitions:
       price:
         description: 价格
         type: number
-      qty:
-        description: 数量
+      qty:
+        description: 数量
+        type: number
+    required:
+    - amount
+    - price
+    - qty
+    type: object
+  hsby.GetHsbyMyCountRsp:
+    properties:
+      myCouponCount:
+        description: 我的优惠卷数量
+        type: integer
+      myOrderDetailListingCount:
+        description: 我的订单求购中数量
+        type: integer
+      myOrderDetailPreCount:
+        description: 我的订单抢购中数量
+        type: integer
+      myPackageUnReceiveCount:
+        description: 我的包裹待收货数量
+        type: integer
+      myPackageUnSendCount:
+        description: 我的包裹待发货数量
+        type: integer
+      myPayOrderCount:
+        description: 我的订单待付款数量
+        type: integer
+    type: object
+  hsby.QueryProvincesAndCitiesRsp:
+    properties:
+      cities:
+        description: 市
+        items:
+          $ref: '#/definitions/models.Division'
+        type: array
+      province:
+        $ref: '#/definitions/models.Division'
+        description: 省
+        type: object
+    type: object
+  models.Division:
+    properties:
+      autoid:
+        description: 自增ID
+        type: integer
+      divisioncode:
+        description: 行政代码
+        type: string
+      divisionlevel:
+        description: 行政级别
+        type: string
+      divisionname:
+        description: 行政名称
+        type: string
+      modifierid:
+        description: 修改人
+        type: integer
+      modifytime:
+        description: 修改时间
+        type: string
+      parentcode:
+        description: 上级行政代码
+        type: string
+      pathname:
+        description: 路径名称
+        type: string
+      postcode:
+        description: 邮政编码
+        type: string
+      separablename:
+        description: 可拆分的全称
+        type: string
+      shortcode:
+        description: 地区简码
+        type: string
+    required:
+    - autoid
+    - divisioncode
+    type: object
+  models.Enumdicitem:
+    properties:
+      autoid:
+        description: 自增ID
+        type: integer
+      bankmappedvalue:
+        description: 银行服务对应值
+        type: string
+      enumdiccode:
+        description: 所属枚举代码
+        type: string
+      enumdicid:
+        description: 所属枚举ID
+        type: integer
+      enumdicname:
+        description: 枚举项名称
+        type: string
+      enumitemname:
+        description: 枚举项值
+        type: integer
+      enumitemstatus:
+        description: 枚举项状态 - 1.启用 2.不启用
+        type: integer
+      enumitemvalue:
+        description: 通用值 - [币种通用简写]
+        type: string
+      param1:
+        description: 参数1[币种:币种小数位]
+        type: string
+      param2:
+        description: 参数1[币种:币种显示单位]
+        type: string
+      remark:
+        description: 备注
+        type: string
+    required:
+    - autoid
+    - enumdiccode
+    - enumdicid
+    - enumitemname
+    type: object
+  models.ErmcpHedgePlan:
+    properties:
+      contracttype:
+        description: 计划类型 - 1:采购 -1:销售
+        type: integer
+      convertfactor:
+        description: 标仓系数
+        type: number
+      deliverygoodsid:
+        description: 现货品种ID
+        type: integer
+      deliverygoodsname:
+        description: 现货品种名称
+        type: string
+      hedgeplanid:
+        description: 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      hedgeplanno:
+        description: 套保计划编号
+        type: string
+      hedgeplanstatus:
+        description: 套保计划状态 -  0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
+        type: integer
+      planqty:
+        description: 计划数量
+        type: number
+      plantime:
+        description: 计划时间
+        type: string
+      producttype:
+        description: 产品类型 - 1:标准仓单 2:等标 3:非标
+        type: integer
+      remark:
+        description: 备注
+        type: string
+      spotgoodsdesc:
+        description: 商品型号
+        type: string
+      wrstandardid:
+        description: 现货商品ID
+        type: integer
+      wrstandardname:
+        description: 现货商品名称
+        type: string
+    type: object
+  models.ErmcpModel:
+    properties:
+      accountid:
+        description: 账户ID
+        type: string
+      accountname:
+        description: 账户名称
+        type: string
+      contracctstatus:
+        description: 合同状态- 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
+        type: integer
+      convertfactor:
+        description: 标仓系数
+        type: number
+      daikaiAmount:
+        description: 待开票额
+        type: number
+      deliveryenddate:
+        description: 交割结束日
+        type: string
+      deliverygoodscode:
+        description: 现货商品代码
+        type: string
+      deliverygoodsid:
+        description: 现货商品ID
+        type: integer
+      deliverygoodsname:
+        description: 现货商品名称
+        type: string
+      deliverystartdate:
+        description: 交割开始日
+        type: string
+      enddate:
+        description: 点价结束日
+        type: string
+      enumdicname:
+        description: 单位名称
+        type: string
+      goodscode:
+        description: 点价商品代码
+        type: string
+      goodsid:
+        description: 点价商品ID
+        type: integer
+      invoiceamount:
+        description: 已开票额
+        type: number
+      payamount:
+        description: 已收付额(收款或付款)
+        type: number
+      pricedqty:
+        description: 已定价量
+        type: number
+      pricemove:
+        description: 升贴水
+        type: number
+      pricetype:
+        description: 定价类型 - 1:一口价 2:点价 3:暂定价
+        type: integer
+      producttype:
+        description: 产品类型 - 1:标准仓单 2:等标 3:非标
+        type: integer
+      qty:
+        description: 合同量
+        type: number
+      spotcontractid:
+        description: 合同ID
+        type: string
+      spotgoodsdesc:
+        description: 商品型号(商品规格)
+        type: string
+      startdate:
+        description: 点价开始日
+        type: string
+      unpayAmount:
+        description: 待支收额(支付或收款)
+        type: number
+      unpricedqty:
+        description: 未定价量
+        type: number
+      unsureqty:
+        description: 未确定量
         type: number
-    required:
-    - amount
-    - price
-    - qty
     type: object
-  hsby.GetHsbyMyCountRsp:
+  models.ErmcpSpotContractModel:
     properties:
-      myCouponCount:
-        description: 我的优惠卷数量
-        type: integer
-      myOrderDetailListingCount:
-        description: 我的订单求购中数量
-        type: integer
-      myOrderDetailPreCount:
-        description: 我的订单抢购中数量
-        type: integer
-      myPackageUnReceiveCount:
-        description: 我的包裹待收货数量
+      AMOUNT:
+        description: 金额 [1:一口价、3:暂定价]
+        type: number
+      BUYUSERID:
+        description: 采购方ID
         type: integer
-      myPackageUnSendCount:
-        description: 我的包裹待发货数量
+      BUYUSERName:
+        description: 采购方名称
+        type: string
+      CONTRACCTSTATUS:
+        description: 合同状态 - 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
         type: integer
-      myPayOrderCount:
-        description: 我的订单待付款数量
+      CONTRACTNO:
+        description: 现货合同编号
+        type: string
+      CONTRACTTYPE:
+        description: 现货合同类型 - 1:采购 -1:销售
         type: integer
-    type: object
-  hsby.QueryProvincesAndCitiesRsp:
-    properties:
-      cities:
-        description: 市
-        items:
-          $ref: '#/definitions/models.Division'
-        type: array
-      province:
-        $ref: '#/definitions/models.Division'
-        description: 省
-    type: object
-  models.Division:
-    properties:
-      autoid:
-        description: 自增ID
+      CONVERTFACTOR:
+        description: 标仓系数
+        type: number
+      DELIVERYENDDATE:
+        description: 交收期(结束)
+        type: string
+      DELIVERYGOODSCODE:
+        description: 现货品种代码
+        type: string
+      DELIVERYGOODSID:
+        description: 现货品种ID
         type: integer
-      divisioncode:
-        description: 行政代码
+      DELIVERYGOODSNAME:
+        description: 现货品种名称
         type: string
-      divisionlevel:
-        description: 行政级别
+      DELIVERYSTARTDATE:
+        description: 交收期(开始)
         type: string
-      divisionname:
-        description: 行政名称
+      ENDDATE:
+        description: 点价结束日期 [2:点价 3:暂定价]
         type: string
-      modifierid:
-        description: 修改人
-        type: integer
-      modifytime:
-        description: 修改时间
+      EnumdicName:
+        description: 单位名称
         type: string
-      parentcode:
-        description: 上级行政代码
+      GOODSCODE:
+        description: 点价合约代码
         type: string
-      pathname:
-        description: 路径名称
+      GOODSID:
+        description: 点价合约ID - 0:为现货,其它为期货商品合约ID [2:点价 3:暂定价]
+        type: integer
+      MARGIN:
+        description: 当前保证金
+        type: number
+      PRICE:
+        description: 价格\暂定价 [1:一口价、3:暂定价]
+        type: number
+      PRICEMOVE:
+        description: 升贴水 [2:点价 3:暂定价]
+        type: number
+      PRICETYPE:
+        description: 定价类型 - 1:一口价 2:点价 3:暂定价
+        type: integer
+      PRODUCTTYPE:
+        description: 产品类型 - 1:标准仓单 2:等标 3:非标
+        type: integer
+      QTY:
+        description: 数量
+        type: number
+      SELLUSERID:
+        description: 销售方ID
+        type: integer
+      SELLUSERNAME:
+        description: 销售方名称
         type: string
-      postcode:
-        description: 邮政编码
+      SPOTCONTRACTID:
+        description: 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
         type: string
-      separablename:
-        description: 可拆分的全称
+      SPOTGOODSDESC:
+        description: 商品型号
         type: string
-      shortcode:
-        description: 地区简码
+      STARTDATE:
+        description: 点价开始日期 [2:点价 3:暂定价]
         type: string
-    required:
-    - autoid
-    - divisioncode
     type: object
-  models.Enumdicitem:
+  models.ErmcpUserModel:
     properties:
-      autoid:
-        description: 自增ID
-        type: integer
-      bankmappedvalue:
-        description: 银行服务对应值
-        type: string
-      enumdiccode:
-        description: 所属枚举代码
+      address:
+        description: 通讯地址
         type: string
-      enumdicid:
-        description: 所属枚举ID
-        type: integer
-      enumdicname:
-        description: 枚举项名称
+      cardnum:
+        description: 证件号码
         type: string
-      enumitemname:
-        description: 枚举项值
-        type: integer
-      enumitemstatus:
-        description: 枚举项状态 - 1.启用 2.不启用
-        type: integer
-      enumitemvalue:
-        description: 通用值 - [币种通用简写]
+      cardtype:
+        description: 证件类型
         type: string
-      param1:
-        description: 参数1[币种:币种小数位]
+      customername:
+        description: 企业名称
         type: string
-      param2:
-        description: 参数1[币种:币种显示单位]
+      mobile:
+        description: 手机号码
         type: string
       remark:
         description: 备注
         type: string
-    required:
-    - autoid
-    - enumdiccode
-    - enumdicid
-    - enumitemname
+      status:
+        description: 账户状态
+        type: string
+      telphone:
+        description: 联系电话
+        type: string
+      userinfotype:
+        description: 客户类型
+        type: string
     type: object
   models.GoodsIDAndName:
     properties:
@@ -3659,6 +3972,27 @@ definitions:
         description: 菜单标题
         type: string
     type: object
+  models.PendingAuditBizModel:
+    properties:
+      accountid:
+        description: 现货账户
+        type: string
+      areaname:
+        description: 所属部门
+        type: string
+      bizid:
+        description: 业务ID
+        type: string
+      bizname:
+        description: 业务名称
+        type: string
+      status:
+        description: 状态,0:待审核 1:审核通过 2:审核中 3:审核失败 4已撤销 5:审核拒绝
+        type: integer
+      type:
+        description: 业务类型,1-期现套利,2-仓单回购,3-现货贸易
+        type: integer
+    type: object
   models.QuotePrimaryMenu:
     properties:
       Index:
@@ -5653,6 +5987,7 @@ definitions:
 info:
   contact: {}
   description: 新的查询服务,替代原通用查询服务。
+  license: {}
   termsOfService: http://muchinfo.cn
   title: MTP2.0 查询服务 API
   version: "1.0"
@@ -6092,6 +6427,86 @@ paths:
       summary: 查询商品交割关系表
       tags:
       - 交割服务
+  /Ermcp/QueryBusinessDj:
+    get:
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/ermcp.QryBusinessDjRsp'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询业务管理(点价)(对应菜单:业务管理/点价)
+      tags:
+      - 企业风险管理(app)
+  /Ermcp/QueryBusinessFp:
+    get:
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/ermcp.QryBussinessFpRsp'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询业务管理(发票)(对应菜单:业务管理/发票)
+      tags:
+      - 企业风险管理(app)
+  /Ermcp/QueryBusinessJs:
+    get:
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/ermcp.QryBussinessJsRsp'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询业务管理(结算)(对应菜单:业务管理/结算)
+      tags:
+      - 企业风险管理(app)
+  /Ermcp/QueryBusinessKx:
+    get:
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/ermcp.QryBussinessKxRsp'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询业务管理(款项)(对应菜单:业务管理/款项)
+      tags:
+      - 企业风险管理(app)
   /Ermcp/QueryContract:
     get:
       parameters:
@@ -6149,6 +6564,32 @@ paths:
       summary: 查询套保计划
       tags:
       - 企业风险管理(app)
+  /Ermcp/QuerySpotContract:
+    get:
+      parameters:
+      - description: 查询类型 1-未提交 2-待审核 3-履约中 4-已完成
+        in: query
+        name: QueryType
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/ermcp.QrySpotContractRsp'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询现货合同(对应现货合同菜单)
+      tags:
+      - 企业风险管理(app)
   /Ermcp/QueryUserInfo:
     get:
       parameters:

+ 103 - 3
models/ermcp.go

@@ -13,9 +13,109 @@ import (
 	"mtp2_if/logger"
 )
 
-// 风险管理合同
+// 现货合同结构(对应现货合同菜单)
+type ErmcpSpotContractModel struct {
+	SPOTCONTRACTID    string  `json:"SPOTCONTRACTID"  xorm:"'SPOTCONTRACTID'"`       //现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
+	CONTRACTNO        string  `json:"CONTRACTNO"  xorm:"'CONTRACTNO'"`               //现货合同编号
+	CONTRACTTYPE      int32   `json:"CONTRACTTYPE"  xorm:"'CONTRACTTYPE'"`           //现货合同类型 - 1:采购 -1:销售
+	BUYUSERID         int64   `json:"BUYUSERID"  xorm:"'BUYUSERID'"`                 //采购方ID
+	BUYUSERName       string  `json:"BUYUSERName"  xorm:"'BUYUSERName'"`             //采购方名称
+	SELLUSERID        int64   `json:"SELLUSERID"  xorm:"'SELLUSERID'"`               //销售方ID
+	SELLUSERNAME      string  `json:"SELLUSERNAME"  xorm:"'SELLUSERNAME'"`           //销售方名称
+	DELIVERYGOODSID   int32   `json:"DELIVERYGOODSID"  xorm:"'DELIVERYGOODSID'"`     //现货品种ID
+	DELIVERYGOODSCODE string  `json:"DELIVERYGOODSCODE"  xorm:"'DELIVERYGOODSCODE'"` //现货品种代码
+	DELIVERYGOODSNAME string  `json:"DELIVERYGOODSNAME"  xorm:"'DELIVERYGOODSNAME'"` //现货品种名称
+	PRODUCTTYPE       int32   `json:"PRODUCTTYPE"  xorm:"'PRODUCTTYPE'"`             //产品类型 - 1:标准仓单 2:等标 3:非标
+	CONVERTFACTOR     float64 `json:"CONVERTFACTOR"  xorm:"'CONVERTFACTOR'"`         //标仓系数
+	SPOTGOODSDESC     string  `json:"SPOTGOODSDESC"  xorm:"'SPOTGOODSDESC'"`         //商品型号
+	PRICETYPE         int32   `json:"PRICETYPE"  xorm:"'PRICETYPE'"`                 //定价类型 - 1:一口价 2:点价 3:暂定价
+	QTY               float64 `json:"QTY"  xorm:"'QTY'"`                             //数量
+	PRICE             float64 `json:"PRICE"  xorm:"'PRICE'"`                         //价格\暂定价 [1:一口价、3:暂定价]
+	AMOUNT            float64 `json:"AMOUNT"  xorm:"'AMOUNT'"`                       //金额 [1:一口价、3:暂定价]
+	DELIVERYSTARTDATE string  `json:"DELIVERYSTARTDATE"  xorm:"'DELIVERYSTARTDATE'"` //交收期(开始)
+	DELIVERYENDDATE   string  `json:"DELIVERYENDDATE"  xorm:"'DELIVERYENDDATE'"`     //交收期(结束)
+	GOODSID           int32   `json:"GOODSID"  xorm:"'GOODSID'"`                     //点价合约ID - 0:为现货,其它为期货商品合约ID [2:点价 3:暂定价]
+	GOODSCODE         string  `json:"GOODSCODE"  xorm:"'GOODSCODE'"`                 //点价合约代码
+	PRICEMOVE         float64 `json:"PRICEMOVE"  xorm:"'PRICEMOVE'"`                 //升贴水 [2:点价 3:暂定价]
+	STARTDATE         string  `json:"STARTDATE"  xorm:"'STARTDATE'"`                 //点价开始日期 [2:点价 3:暂定价]
+	ENDDATE           string  `json:"ENDDATE"  xorm:"'ENDDATE'"`                     //点价结束日期 [2:点价 3:暂定价]
+	MARGIN            float64 `json:"MARGIN"  xorm:"'MARGIN'"`                       //当前保证金
+	EnumdicName       string  `json:"EnumdicName"  xorm:"'ENUMDICNAME'"`             //单位名称
+	CONTRACCTSTATUS   int32   `json:"CONTRACCTSTATUS"  xorm:"'CONTRACCTSTATUS'"`     //合同状态 - 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
+}
+
+func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
+	str := "SELECT to_char(t.SPOTCONTRACTID) SPOTCONTRACTID," +
+		"       t.CONTRACTNO," +
+		"       t.CONTRACTTYPE," +
+		"       t.BUYUSERID," +
+		"       t.SELLUSERID," +
+		"       t.DELIVERYGOODSID," +
+		"       t.PRODUCTTYPE," +
+		"       t.CONVERTFACTOR," +
+		"       t.SPOTGOODSDESC," +
+		"       t.PRICETYPE," +
+		"       t.QTY," +
+		"       t.PRICE," +
+		"       t.AMOUNT," +
+		"       t.DELIVERYSTARTDATE," +
+		"       t.DELIVERYENDDATE," +
+		"       t.GOODSID," +
+		"       t.PRICEMOVE," +
+		"       t.STARTDATE," +
+		"       t.ENDDATE," +
+		"       t.MARGIN," +
+		"       t.CONTRACCTSTATUS," +
+		"       u1.accountname      BuyUserName," +
+		"       u2.accountname      SellUserName," +
+		"       g.deliverygoodscode," +
+		"       g.deliverygoodsname," +
+		"       g2.goodscode" +
+		"       e.Enumdicname"+
+		"  FROM ERMCP_SPOTCONTRACT t" +
+		"  left join useraccount u1" +
+		"    on t.buyuserid = u1.userid" +
+		"  left join useraccount u2" +
+		"    on t.selluserid = u2.userid" +
+		"  left join deliverygoods g" +
+		"    on t.deliverygoodsid = g.deliverygoodsid" +
+		"  left join goods g2" +
+		"    on t.goodsid = g2.goodsid" +
+		"  left join enumdicitem e on g.goodsunitid = e.enumitemname and e.enumdiccode = 'goodsunit'" +
+		"  where t.contracctstatus in (%v)"
+
+	// 查询类型 1-未提交 2-待审核 3-履约中 4-已完成
+	// 合同状态 - 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
+	var status string
+	switch nQueryType {
+	case 1:
+		status = "0"
+	case 2:
+		status = "1"
+	case 3:
+		status = "2"
+	case 4:
+		status = "3,5,6"
+	}
+
+	return fmt.Sprintf(str, status)
+}
+
+// 从数据库中查询现货合同
+func (r *ErmcpSpotContractModel) GetData(nQueryType int32) ([]ErmcpSpotContractModel, error) {
+	sData := make([]ErmcpSpotContractModel, 0)
+	e := db.GetEngine()
+	s := e.SQL(r.buildSql(nQueryType))
+	if err := s.Find(&sData); err != nil {
+		logger.GetLogger().Errorf("ermcp query fail:%v", err)
+		return sData, err
+	}
+	return sData, nil
+}
+
+// 风险管理合同(对应采购和销售菜单)
 type ErmcpModel struct {
-	SpotContractId    int64   `json:"spotcontractid"  xorm:"'SPOTCONTRACTID'"`       // 合同ID
+	SpotContractId    string  `json:"spotcontractid"  xorm:"'SPOTCONTRACTID'"`       // 合同ID
 	AccountId         string  `json:"accountid"  xorm:"'ACCOUNTID'"`                 // 账户ID
 	AccountName       string  `json:"accountname"  xorm:"'ACCOUNTNAME'"`             // 账户名称
 	DeliveryGoodsId   int     `json:"deliverygoodsid"  xorm:"'DELIVERYGOODSID'"`     // 现货商品ID
@@ -47,7 +147,7 @@ type ErmcpModel struct {
 // 组装查询的sql
 func (r *ErmcpModel) buildSql(nContractType, nQueryType int32) string {
 	str := "select t.contractno," +
-		"       t.SpotContractId," +
+		"       to_char(t.SpotContractId) SpotContractId," +
 		"       t.deliverygoodsid," +
 		"       t.spotgoodsdesc," +
 		"       t.goodsid," +

+ 83 - 0
models/ermcpOPApply.go

@@ -0,0 +1,83 @@
+/**
+* @Author: zou.yingbin
+* @Create  : 2021/1/12 10:38
+* @Modify  : 2021/1/12 10:38
+ */
+
+package models
+
+import (
+	"fmt"
+	"mtp2_if/db"
+	"mtp2_if/logger"
+)
+
+//现货合同操作数据
+type ErmcpOPApplyModel struct {
+	OPERATEAPPLYID   string `json:"OPERATEAPPLYID"  xorm:"'OPERATEAPPLYID'"`     //操作申请ID(603+Unix秒时间戳(10位)+xxxxxx)
+	OPERATEAPPLYTYPE int32  `json:"OPERATEAPPLYTYPE"  xorm:"'OPERATEAPPLYTYPE'"` //操作申请类型 - 1:点价 2:结算登记 3:款项登记 4:发票登记
+	RELATEDID        string `json:"RELATEDID"  xorm:"'RELATEDID'"`               //现货合同ID
+	DETAILJSON       string `json:"-"  xorm:"'DETAILJSON'"`                      //明细JSON
+	APPLYID          string `json:"APPLYID"  xorm:"'APPLYID'"`                   //申请人
+	APPLYTIME        string `json:"APPLYTIME"  xorm:"'APPLYTIME'"`               //申请时间
+	APPLYSTATUS      int32  `json:"APPLYSTATUS"  xorm:"'APPLYSTATUS'"`           //申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+	AUDITTIME        string `json:"AUDITTIME"  xorm:"'AUDITTIME'"`               //审核时间
+	CONTRACTTYPE     int32  `json:"CONTRACTTYPE"  xorm:"'CONTRACTTYPE'"`         //现货合同类型 - 1:采购 -1:销售
+	CONTRACTNO       string `json:"CONTRACTNO"  xorm:"'CONTRACTNO'"`             //合同编号
+	PRICETYPE        int32  `json:"PRICETYPE"  xorm:"'PRICETYPE'"`               //定价类型 - 1:一口价 2:点价 3:暂定价
+	PRICEMOVE        float64`json:"PRICEMOVE"  xorm:"'PRICEMOVE'"`               //升贴水
+	GOODSNAME        string `json:"GOODSNAME"  xorm:"'GOODSNAME'"`               //商品名称
+	GOODSCODE        string `json:"GOODSCODE"  xorm:"'GOODSCODE'"`               //点价合约
+	EnumdicName      string `json:"EnumdicName"  xorm:"'ENUMDICNAME'"`           //单位名称
+	BUYUSERNAME      string `json:"BUYUSERNAME"  xorm:"'BUYUSERNAME'"`           //采购方名称
+	SELLUSERNAME     string `json:"SELLUSERNAME"  xorm:"'SELLUSERNAME'"`         //销售方名字
+	APPLYNAME        string `json:"APPLYNAME"  xorm:"'APPLYNAME'"`               //申请人名称
+}
+
+func (r *ErmcpOPApplyModel) buildSql(opType int32) string {
+	sqlId := "select to_char(t.OPERATEAPPLYID) OPERATEAPPLYID," +
+		"       t.OPERATEAPPLYTYPE," +
+		"       to_char(t.RELATEDID) RELATEDID," +
+		"       t.DETAILJSON," +
+		"       to_char(t.APPLYID) APPLYID," +
+		"       to_char(t.APPLYTIME,'yyyy-mm-dd hh:mi') APPLYTIME," +
+		"       t.APPLYSTATUS," +
+		"       to_char(t.AUDITTIME,'yyyy-mm-dd hh:mi') AUDITTIME," +
+		"       t.CONTRACTTYPE," +
+		"       s.CONTRACTNO," +
+		"       s.PRICETYPE," +
+		"       s.pricemove,"+
+		"       g.GOODSNAME," +
+		"       g.GOODSCODE," +
+		"       e.EnumdicName," +
+		"       m.username APPLYName," +
+		"       u1.accountname buyuserName," +
+		"       u2.accountname selluserName" +
+		"  from ermcp_contractoperateapply t" +
+		"  left join ermcp_spotcontract s" +
+		"    on t.relatedid = s.spotcontractid" +
+		"  left join goods g" +
+		"    on s.goodsid = g.goodsid" +
+		"  left join loginaccount l on t.applyid=l.loginid" +
+		"  left join systemmanager m on m.logincode=l.logincode" +
+		"  left join useraccount u1 on s.buyuserid=u1.userid" +
+		"  left join useraccount u2 on s.selluserid=u2.userid" +
+		"  left join enumdicitem e" +
+		"    on e.enumitemname = g.goodunitid" +
+		"   and e.enumdiccode = 'goodsunit'" +
+		"  where t.operateapplytype = %v"
+
+	return fmt.Sprintf(sqlId, opType)
+}
+
+// 从数据库中查询合同操作申请相关信息, opType 操作申请类型 - 1:点价 2:结算登记 3:款项登记 4:发票登记
+func (r *ErmcpOPApplyModel) GetData(opType int32) ([]ErmcpOPApplyModel, error) {
+	sData := make([]ErmcpOPApplyModel, 0)
+	e := db.GetEngine()
+	s := e.SQL(r.buildSql(opType))
+	if err := s.Find(&sData); err != nil {
+		logger.GetLogger().Errorf("ermcp query fail:%v", err)
+		return sData, err
+	}
+	return sData, nil
+}

+ 5 - 0
routers/router.go

@@ -299,8 +299,13 @@ func InitRouter() *gin.Engine {
 	{
 		// 查询待点价、履约和全部合同
 		ermcpR.GET("/QueryUserInfo", ermcp.QueryUserInfo)
+		ermcpR.GET("/QuerySpotContract", ermcp.QuerySpotContract)
 		ermcpR.GET("/QueryContract", ermcp.QueryContract)
 		ermcpR.GET("/QueryHedgePlan", ermcp.QueryHedgePlan)
+		ermcpR.GET("/QueryBusinessDj", ermcp.QueryBusinessDj)
+		ermcpR.GET("/QueryBusinessJs", ermcp.QueryBusinessJs)
+		ermcpR.GET("/QueryBusinessKx", ermcp.QueryBusinessKx)
+		ermcpR.GET("/QueryBusinessFp", ermcp.QueryBusinessFp)
 	}
 
 	return r

Some files were not shown because too many files changed in this diff