|
|
@@ -19,6 +19,15 @@ import (
|
|
|
type DjData struct {
|
|
|
PricedPrice *float64 `json:"pricedPrice,omitempty"` //点价价格(非必填)
|
|
|
PricedQty *float64 `json:"pricedQty,omitempty"` //点价数量(非必填)
|
|
|
+ Amount *float64 `json:"amount,omitempty"` //点价金额=(点价价格+升贴水)*点价数量
|
|
|
+}
|
|
|
+
|
|
|
+//计算点价金额
|
|
|
+func (r *DjData) calc(priceMove float64) {
|
|
|
+ if r.PricedPrice != nil && r.PricedQty != nil{
|
|
|
+ r.Amount = new(float64)
|
|
|
+ *r.Amount = (*r.PricedPrice + priceMove) * (*r.PricedQty)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//结点登记数据
|
|
|
@@ -44,6 +53,8 @@ type KpData struct {
|
|
|
|
|
|
// 查询合同操作请求
|
|
|
type QryOPApplyReq struct {
|
|
|
+ UserId int64 `form:"userId" binding:"required"` //用户ID
|
|
|
+ RelatedId string `form:"relatedid" binding:"required"` //现货合同ID, 不填则查所有
|
|
|
}
|
|
|
|
|
|
// 查询业务管理/点价应答
|
|
|
@@ -56,13 +67,17 @@ type QryBusinessDjRsp struct {
|
|
|
// @Summary 查询业务管理(点价)(对应菜单:业务管理/点价)
|
|
|
// @Produce json
|
|
|
// @Security ApiKeyAuth
|
|
|
+// @Param UserId query int true "用户ID"
|
|
|
+// @Param relatedid query string false "现货合同ID, 不填则查所有"
|
|
|
// @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
|
|
|
+ var req QryOPApplyReq
|
|
|
+ _=c.ShouldBind(&req)
|
|
|
+ m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId, USERID: req.UserId}
|
|
|
if d, err := m.GetData(1); err == nil {
|
|
|
//构建应答数据
|
|
|
sData := make([]QryBusinessDjRsp, 0)
|
|
|
@@ -70,7 +85,9 @@ func QueryBusinessDj(c *gin.Context) {
|
|
|
var rsp QryBusinessDjRsp
|
|
|
rsp.ErmcpOPApplyModel = v
|
|
|
if len(rsp.DETAILJSON) > 0{
|
|
|
- _ = json.Unmarshal([]byte(rsp.DETAILJSON), &rsp.DjData)
|
|
|
+ if err := json.Unmarshal([]byte(rsp.DETAILJSON), &rsp.DjData); err != nil{
|
|
|
+ rsp.DjData.calc(rsp.PRICEMOVE)
|
|
|
+ }
|
|
|
}
|
|
|
sData = append(sData, rsp)
|
|
|
}
|
|
|
@@ -90,13 +107,17 @@ type QryBussinessJsRsp struct {
|
|
|
// @Summary 查询业务管理(结算)(对应菜单:业务管理/结算)
|
|
|
// @Produce json
|
|
|
// @Security ApiKeyAuth
|
|
|
+// @Param UserId query int true "用户ID"
|
|
|
+// @Param relatedid query string false "现货合同ID, 不填则查所有"
|
|
|
// @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
|
|
|
+ var req QryOPApplyReq
|
|
|
+ _=c.ShouldBind(&req)
|
|
|
+ m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId}
|
|
|
if d, err := m.GetData(2); err == nil {
|
|
|
//构建应答数据
|
|
|
sData := make([]QryBussinessJsRsp, 0)
|
|
|
@@ -124,13 +145,17 @@ type QryBussinessKxRsp struct {
|
|
|
// @Summary 查询财务管理(款项)(对应菜单:财务管理/款项)
|
|
|
// @Produce json
|
|
|
// @Security ApiKeyAuth
|
|
|
+// @Param UserId query int true "用户ID"
|
|
|
+// @Param relatedid query string false "现货合同ID, 不填则查所有"
|
|
|
// @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
|
|
|
+ var req QryOPApplyReq
|
|
|
+ _=c.ShouldBind(&req)
|
|
|
+ m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId}
|
|
|
if d, err := m.GetData(3); err == nil {
|
|
|
//构建应答数据
|
|
|
sData := make([]QryBussinessKxRsp, 0)
|
|
|
@@ -158,13 +183,17 @@ type QryBussinessFpRsp struct {
|
|
|
// @Summary 查询财务管理(发票)(对应菜单:财务管理/发票)
|
|
|
// @Produce json
|
|
|
// @Security ApiKeyAuth
|
|
|
+// @Param UserId query int true "用户ID"
|
|
|
+// @Param relatedid query string false "现货合同ID, 不填则查所有"
|
|
|
// @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
|
|
|
+ var req QryOPApplyReq
|
|
|
+ _=c.ShouldBind(&req)
|
|
|
+ m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId}
|
|
|
if d, err := m.GetData(4); err == nil {
|
|
|
//构建应答数据
|
|
|
sData := make([]QryBussinessFpRsp, 0)
|