瀏覽代碼

业务管理返回现货商品信息

zou.yingbin 4 年之前
父節點
當前提交
8214660a67
共有 4 個文件被更改,包括 197 次插入24 次删除
  1. 60 0
      docs/docs.go
  2. 60 0
      docs/swagger.json
  3. 45 0
      docs/swagger.yaml
  4. 32 24
      models/ermcpOPApply.go

+ 60 - 0
docs/docs.go

@@ -7766,6 +7766,18 @@ var doc = `{
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品id",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
                 }
             }
         },
@@ -7859,6 +7871,18 @@ var doc = `{
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品id",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
                 }
             }
         },
@@ -7956,6 +7980,18 @@ var doc = `{
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品id",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
                 }
             }
         },
@@ -8069,6 +8105,18 @@ var doc = `{
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品id",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
                 }
             }
         },
@@ -8170,6 +8218,18 @@ var doc = `{
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品id",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
                 }
             }
         },

+ 60 - 0
docs/swagger.json

@@ -7750,6 +7750,18 @@
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品id",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
                 }
             }
         },
@@ -7843,6 +7855,18 @@
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品id",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
                 }
             }
         },
@@ -7940,6 +7964,18 @@
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品id",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
                 }
             }
         },
@@ -8053,6 +8089,18 @@
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品id",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
                 }
             }
         },
@@ -8154,6 +8202,18 @@
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品id",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
                 }
             }
         },

+ 45 - 0
docs/swagger.yaml

@@ -981,6 +981,15 @@ definitions:
       userid:
         description: 用户ID
         type: integer
+      wrstandardcode:
+        description: 现货商品代码
+        type: string
+      wrstandardid:
+        description: 现货商品id
+        type: integer
+      wrstandardname:
+        description: 现货商品名称
+        type: string
     type: object
   ermcp.QryBussinessFpRsp:
     properties:
@@ -1050,6 +1059,15 @@ definitions:
       userid:
         description: 用户ID
         type: integer
+      wrstandardcode:
+        description: 现货商品代码
+        type: string
+      wrstandardid:
+        description: 现货商品id
+        type: integer
+      wrstandardname:
+        description: 现货商品名称
+        type: string
     type: object
   ermcp.QryBussinessJsExRsp:
     properties:
@@ -1122,6 +1140,15 @@ definitions:
       userid:
         description: 用户ID
         type: integer
+      wrstandardcode:
+        description: 现货商品代码
+        type: string
+      wrstandardid:
+        description: 现货商品id
+        type: integer
+      wrstandardname:
+        description: 现货商品名称
+        type: string
     type: object
   ermcp.QryBussinessJsRsp:
     properties:
@@ -1206,6 +1233,15 @@ definitions:
       userid:
         description: 用户ID
         type: integer
+      wrstandardcode:
+        description: 现货商品代码
+        type: string
+      wrstandardid:
+        description: 现货商品id
+        type: integer
+      wrstandardname:
+        description: 现货商品名称
+        type: string
     type: object
   ermcp.QryBussinessKxRsp:
     properties:
@@ -1281,6 +1317,15 @@ definitions:
       userid:
         description: 用户ID
         type: integer
+      wrstandardcode:
+        description: 现货商品代码
+        type: string
+      wrstandardid:
+        description: 现货商品id
+        type: integer
+      wrstandardname:
+        description: 现货商品名称
+        type: string
     type: object
   ermcp.QryErmcpRsp:
     $ref: '#/definitions/models.ErmcpModel'

+ 32 - 24
models/ermcpOPApply.go

@@ -12,30 +12,33 @@ import (
 	"mtp2_if/logger"
 )
 
-//现货合同操作数据
+// ErmcpOPApplyModel 现货合同操作数据
 type ErmcpOPApplyModel struct {
-	USERID           int64   `json:"userid"  xorm:"'USERID'"`                     //用户ID
-	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'"`               //申请人名称
-	AUDITNAME        string  `json:"auditname"  xorm:"'AUDITNAME'"`               //审核人名称
-	CONTRACTSTATUS   int32   `json:"contractstatus"  xorm:"'CONTRACTSTATUS'"`     //合同状态- 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
-	ATTACHURL        string  `json:"attachurl"  xorm:"'ATTACHURL'"`               //附件
+	USERID           int64   `json:"userid"  xorm:"'USERID'"`                     // 用户ID
+	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'"`               // 申请人名称
+	AUDITNAME        string  `json:"auditname"  xorm:"'AUDITNAME'"`               // 审核人名称
+	CONTRACTSTATUS   int32   `json:"contractstatus"  xorm:"'CONTRACTSTATUS'"`     // 合同状态- 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
+	ATTACHURL        string  `json:"attachurl"  xorm:"'ATTACHURL'"`               // 附件
+	WRSTANDARDNAME   string  `json:"wrstandardname"  xorm:"'WRSTANDARDNAME'"`     // 现货商品名称
+	WRSTANDARDCODE   string  `json:"wrstandardcode"  xorm:"'WRSTANDARDCODE'"`     // 现货商品代码
+	WRSTANDARDID     int     `json:"wrstandardid"  xorm:"'WRSTANDARDID'"`         // 现货商品id
 }
 
 func (r *ErmcpOPApplyModel) buildSql(opType int32) string {
@@ -55,6 +58,9 @@ func (r *ErmcpOPApplyModel) buildSql(opType int32) string {
 		"       s.pricemove," +
 		"       s.userid," +
 		"       s.contractstatus," +
+		"       w.wrstandardname," +
+		"       w.wrstandardcode," +
+		"       w.wrstandardid," +
 		"       g.GOODSNAME," +
 		"       g.GOODSCODE," +
 		"       e.EnumdicName," +
@@ -67,6 +73,8 @@ func (r *ErmcpOPApplyModel) buildSql(opType int32) string {
 		"    on t.relatedid = s.spotcontractid" +
 		"  left join goods g" +
 		"    on s.goodsid = g.goodsid" +
+		"  left join wrstandard w" +
+		"    on s.wrstandardid = w.wrstandardid" +
 		"  left join loginaccount u3" +
 		"    on t.applyid = u3.loginid" +
 		"  left join loginaccount u4" +
@@ -88,7 +96,7 @@ func (r *ErmcpOPApplyModel) buildSql(opType int32) string {
 	return fmt.Sprintf(sqlId, opType, r.USERID)
 }
 
-// 从数据库中查询合同操作申请相关信息, opType 操作申请类型 - 1:点价 2:结算登记 3:款项登记 4:发票登记
+// GetData 从数据库中查询合同操作申请相关信息, opType 操作申请类型 - 1:点价 2:结算登记 3:款项登记 4:发票登记
 func (r *ErmcpOPApplyModel) GetData(opType int32) ([]ErmcpOPApplyModel, error) {
 	sData := make([]ErmcpOPApplyModel, 0)
 	e := db.GetEngine()