Browse Source

WrTrade2/QueryPerformancePlan 增加方向出参

zhou.xiaoning 2 years ago
parent
commit
cf25169e3d
5 changed files with 22 additions and 16 deletions
  1. 4 4
      controllers/guangzuan/tradeService.go
  2. 1 1
      docs/docs.go
  3. 1 1
      docs/swagger.json
  4. 1 1
      docs/swagger.yaml
  5. 15 9
      models/wrTrade2.go

+ 4 - 4
controllers/guangzuan/tradeService.go

@@ -18,8 +18,8 @@ import (
 // @Security Group
 // @Security Group
 // @Param    userid   query    int    true  "用户ID"
 // @Param    userid   query    int    true  "用户ID"
 // @Param    executestatus query    int false "执行状态 - 1:未生效 2:进行中 3:已结束"
 // @Param    executestatus query    int false "执行状态 - 1:未生效 2:进行中 3:已结束"
-// @Param    page          query    int false "页码"
-// @Param    pagesize      query    int false "每页条数"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
 // @Success  200           {array}  models.GzcjjcorderM
 // @Success  200           {array}  models.GzcjjcorderM
 // @Failure  500     {object} app.Response
 // @Failure  500     {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrder [get]
 // @Router   /Guangzuan/QueryGZCJJCOrder [get]
@@ -39,8 +39,8 @@ func QueryGZCJJCOrder(c *gin.Context) {
 // @Security Group
 // @Security Group
 // @Param    userid        query    int true  "用户ID"
 // @Param    userid        query    int true  "用户ID"
 // @Param    orderid  query    string false "单据ID"
 // @Param    orderid  query    string false "单据ID"
-// @Param    page     query    int    false "页码"
-// @Param    pagesize query    int    false "每页条数"
+// @Param    page          query    int false "页码"
+// @Param    pagesize      query    int false "每页条数"
 // @Success  200      {array}  models.GzcjjcorderdetailM
 // @Success  200      {array}  models.GzcjjcorderdetailM
 // @Failure  500           {object} app.Response
 // @Failure  500           {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrderDetail [get]
 // @Router   /Guangzuan/QueryGZCJJCOrderDetail [get]

+ 1 - 1
docs/docs.go

@@ -55810,7 +55810,7 @@ const docTemplate = `{
                     "type": "string"
                     "type": "string"
                 },
                 },
                 "starttime": {
                 "starttime": {
-                    "description": "开始时间",
+                    "description": "当前步骤开始时间",
                     "type": "string"
                     "type": "string"
                 },
                 },
                 "steptypeid": {
                 "steptypeid": {

+ 1 - 1
docs/swagger.json

@@ -55801,7 +55801,7 @@
                     "type": "string"
                     "type": "string"
                 },
                 },
                 "starttime": {
                 "starttime": {
-                    "description": "开始时间",
+                    "description": "当前步骤开始时间",
                     "type": "string"
                     "type": "string"
                 },
                 },
                 "steptypeid": {
                 "steptypeid": {

+ 1 - 1
docs/swagger.yaml

@@ -25510,7 +25510,7 @@ definitions:
         description: 发货备注[物流单号]
         description: 发货备注[物流单号]
         type: string
         type: string
       starttime:
       starttime:
-        description: 开始时间
+        description: 当前步骤开始时间
         type: string
         type: string
       steptypeid:
       steptypeid:
         description: 履约步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票
         description: 履约步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票

+ 15 - 9
models/wrTrade2.go

@@ -1538,7 +1538,7 @@ type WrPerformancePlan struct {
 	EXPRESSFEE               float64 `json:"expressfee"  xorm:"EXPRESSFEE" form:"expressfee"`                      // 运费
 	EXPRESSFEE               float64 `json:"expressfee"  xorm:"EXPRESSFEE" form:"expressfee"`                      // 运费
 	CONTRACTID               int64   `json:"contractid"  xorm:"CONTRACTID" form:"contractid"`                      // 合同ID
 	CONTRACTID               int64   `json:"contractid"  xorm:"CONTRACTID" form:"contractid"`                      // 合同ID
 	CURSTEPDEADLINE          string  `json:"curstepdeadline"  xorm:"CURSTEPDEADLINE" form:"curstepdeadline"`       // 当前步骤到期时间
 	CURSTEPDEADLINE          string  `json:"curstepdeadline"  xorm:"CURSTEPDEADLINE" form:"curstepdeadline"`       // 当前步骤到期时间
-	STARTTIME                string  `json:"starttime"  xorm:"'STARTTIME'"`                                        // 开始时间
+	STARTTIME                string  `json:"starttime"  xorm:"'STARTTIME'"`                                        // 当前步骤开始时间
 	QTY                      float64 `json:"qty"  xorm:"QTY" form:"qty"`                                           // 履约数量
 	QTY                      float64 `json:"qty"  xorm:"QTY" form:"qty"`                                           // 履约数量
 	STEPTYPEID               int32   `json:"steptypeid"  xorm:"STEPTYPEID" form:"steptypeid"`                      // 履约步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移 9:释放卖方冻结  10:货款溢短 11:生成合同[中江] 12:运费 90:确认支付 91. 确认放行 92买方支付(直接扣款)   用于-1模板“
 	STEPTYPEID               int32   `json:"steptypeid"  xorm:"STEPTYPEID" form:"steptypeid"`                      // 履约步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移 9:释放卖方冻结  10:货款溢短 11:生成合同[中江] 12:运费 90:确认支付 91. 确认放行 92买方支付(直接扣款)   用于-1模板“
 	ACTIVATEMONTH            string  `json:"activatemonth"  xorm:"'ACTIVATEMONTH'"`                                // 履约激活月 [无仓单的交易收月](yyyy-MM)
 	ACTIVATEMONTH            string  `json:"activatemonth"  xorm:"'ACTIVATEMONTH'"`                                // 履约激活月 [无仓单的交易收月](yyyy-MM)
@@ -1550,12 +1550,12 @@ type WrPerformancePlan struct {
 	SELLUSERNAME string `json:"sellusername"  xorm:"'SELLUSERNAME'"` // 卖方名字
 	SELLUSERNAME string `json:"sellusername"  xorm:"'SELLUSERNAME'"` // 卖方名字
 	TYPENAME     string `json:"typename"  xorm:"'TYPENAME'"`         // 履约类型 名称
 	TYPENAME     string `json:"typename"  xorm:"'TYPENAME'"`         // 履约类型 名称
 
 
-	USERID       int64    `json:"userid" form:"userid" binding:"required"` // 用户id
-	BUYORSELL    int32    `json:"buyorsell" form:"buyorsell"`              // 买卖方向 0-买 1-卖
-	STATUS       string   `json:"-" form:"status"`                         // 状态筛选
-	UNPAIDAMOUNT SFLOAT64 `json:"unpaidamount"  xorm:"'UNPAIDAMOUNT'"`     // 剩余款(待支付金额)
-	BEGINDATE    string   `json:"begindate" form:"begindate"`              // 开始交易日(yyyymmdd)
-	ENDDATE      string   `json:"enddate" form:"enddate"`                  // 结束交易日(yyyymmdd)
+	USERID       int64    `json:"userid" form:"userid" binding:"required"`     // 用户id
+	BUYORSELL    int32    `json:"buyorsell" form:"buyorsell" xorm:"BUYORSELL"` // 买卖方向 0-买 1-卖
+	STATUS       string   `json:"-" form:"status"`                             // 状态筛选
+	UNPAIDAMOUNT SFLOAT64 `json:"unpaidamount"  xorm:"'UNPAIDAMOUNT'"`         // 剩余款(待支付金额)
+	BEGINDATE    string   `json:"begindate" form:"begindate"`                  // 开始交易日(yyyymmdd)
+	ENDDATE      string   `json:"enddate" form:"enddate"`                      // 结束交易日(yyyymmdd)
 }
 }
 
 
 func (r *WrPerformancePlan) calc() {
 func (r *WrPerformancePlan) calc() {
@@ -1568,7 +1568,9 @@ func (r *WrPerformancePlan) calc() {
 func (r *WrPerformancePlan) buildSql() string {
 func (r *WrPerformancePlan) buildSql() string {
 	var sqlId utils.SQLVal = `
 	var sqlId utils.SQLVal = `
 with tmp as
 with tmp as
- (select to_char(t.wrfactortypeid) wrfactortypeid,
+ (select
+		%v BUYORSELL, 
+		to_char(t.wrfactortypeid) wrfactortypeid,
          t.wrfactortypename,
          t.wrfactortypename,
          t.wrstandardid,
          t.wrstandardid,
          t.deliverygoodsid,
          t.deliverygoodsid,
@@ -1657,6 +1659,7 @@ select to_char(t.PERFORMANCEPLANID) PERFORMANCEPLANID,
   left join market m on t.marketid=m.marketid
   left join market m on t.marketid=m.marketid
  where 1 = 1
  where 1 = 1
 `
 `
+	sqlId.FormatParam(r.BUYORSELL)
 	if r.BUYORSELL == 0 {
 	if r.BUYORSELL == 0 {
 		sqlId.And("u1.userid", r.USERID)
 		sqlId.And("u1.userid", r.USERID)
 	} else {
 	} else {
@@ -1670,7 +1673,9 @@ select to_char(t.PERFORMANCEPLANID) PERFORMANCEPLANID,
 func (r *WrPerformancePlan) buildSqlHis() string {
 func (r *WrPerformancePlan) buildSqlHis() string {
 	var sqlId utils.SQLVal = `
 	var sqlId utils.SQLVal = `
 with tmp as
 with tmp as
- (select to_char(t.wrfactortypeid) wrfactortypeid,
+ (select
+		%v BUYORSELL, 
+		to_char(t.wrfactortypeid) wrfactortypeid,
          t.wrfactortypename,
          t.wrfactortypename,
          t.wrstandardid,
          t.wrstandardid,
          t.deliverygoodsid,
          t.deliverygoodsid,
@@ -1759,6 +1764,7 @@ select to_char(t.PERFORMANCEPLANID) PERFORMANCEPLANID,
   left join market m on t.marketid=m.marketid
   left join market m on t.marketid=m.marketid
  where 1 = 1 and t.isvaliddata=1
  where 1 = 1 and t.isvaliddata=1
 `
 `
+	sqlId.FormatParam(r.BUYORSELL)
 	if r.BUYORSELL == 0 {
 	if r.BUYORSELL == 0 {
 		sqlId.And("u1.userid", r.USERID)
 		sqlId.And("u1.userid", r.USERID)
 	} else {
 	} else {