Browse Source

按需求修改多个接口出参

zhou.xiaoning 3 năm trước cách đây
mục cha
commit
566410f0b9
4 tập tin đã thay đổi với 88 bổ sung19 xóa
  1. 20 0
      docs/docs.go
  2. 20 0
      docs/swagger.json
  3. 15 0
      docs/swagger.yaml
  4. 33 19
      models/guangzuan.go

+ 20 - 0
docs/docs.go

@@ -29811,6 +29811,10 @@ const docTemplate = `{
                     "description": "市",
                     "type": "integer"
                 },
+                "cityname": {
+                    "description": "城市名称",
+                    "type": "string"
+                },
                 "contactname": {
                     "description": "联系人",
                     "type": "string"
@@ -29823,6 +29827,10 @@ const docTemplate = `{
                     "description": "国家",
                     "type": "integer"
                 },
+                "countryname": {
+                    "description": "国家名称",
+                    "type": "string"
+                },
                 "createtime": {
                     "description": "创建时间",
                     "type": "string"
@@ -29831,6 +29839,10 @@ const docTemplate = `{
                     "description": "区",
                     "type": "integer"
                 },
+                "districtname": {
+                    "description": "地区名称",
+                    "type": "string"
+                },
                 "hasvideo": {
                     "description": "是否有视频 - 0:无 1:有",
                     "type": "integer"
@@ -29839,6 +29851,10 @@ const docTemplate = `{
                     "description": "省",
                     "type": "integer"
                 },
+                "provincename": {
+                    "description": "省名称",
+                    "type": "string"
+                },
                 "remark": {
                     "description": "审核备注",
                     "type": "string"
@@ -33130,6 +33146,10 @@ const docTemplate = `{
                     "description": "尺寸3 - 类型:2,4,5",
                     "type": "string"
                 },
+                "sizedisplay": {
+                    "description": "尺寸",
+                    "type": "string"
+                },
                 "stonedesc": {
                     "description": "配石描述 - 类型:4",
                     "type": "string"

+ 20 - 0
docs/swagger.json

@@ -29802,6 +29802,10 @@
                     "description": "市",
                     "type": "integer"
                 },
+                "cityname": {
+                    "description": "城市名称",
+                    "type": "string"
+                },
                 "contactname": {
                     "description": "联系人",
                     "type": "string"
@@ -29814,6 +29818,10 @@
                     "description": "国家",
                     "type": "integer"
                 },
+                "countryname": {
+                    "description": "国家名称",
+                    "type": "string"
+                },
                 "createtime": {
                     "description": "创建时间",
                     "type": "string"
@@ -29822,6 +29830,10 @@
                     "description": "区",
                     "type": "integer"
                 },
+                "districtname": {
+                    "description": "地区名称",
+                    "type": "string"
+                },
                 "hasvideo": {
                     "description": "是否有视频 - 0:无 1:有",
                     "type": "integer"
@@ -29830,6 +29842,10 @@
                     "description": "省",
                     "type": "integer"
                 },
+                "provincename": {
+                    "description": "省名称",
+                    "type": "string"
+                },
                 "remark": {
                     "description": "审核备注",
                     "type": "string"
@@ -33121,6 +33137,10 @@
                     "description": "尺寸3 - 类型:2,4,5",
                     "type": "string"
                 },
+                "sizedisplay": {
+                    "description": "尺寸",
+                    "type": "string"
+                },
                 "stonedesc": {
                     "description": "配石描述 - 类型:4",
                     "type": "string"

+ 15 - 0
docs/swagger.yaml

@@ -9873,6 +9873,9 @@ definitions:
       cityid:
         description: 市
         type: integer
+      cityname:
+        description: 城市名称
+        type: string
       contactname:
         description: 联系人
         type: string
@@ -9882,18 +9885,27 @@ definitions:
       countryid:
         description: 国家
         type: integer
+      countryname:
+        description: 国家名称
+        type: string
       createtime:
         description: 创建时间
         type: string
       districtid:
         description: 区
         type: integer
+      districtname:
+        description: 地区名称
+        type: string
       hasvideo:
         description: 是否有视频 - 0:无 1:有
         type: integer
       provinceid:
         description: 省
         type: integer
+      provincename:
+        description: 省名称
+        type: string
       remark:
         description: 审核备注
         type: string
@@ -12314,6 +12326,9 @@ definitions:
       size3:
         description: 尺寸3 - 类型:2,4,5
         type: string
+      sizedisplay:
+        description: 尺寸
+        type: string
       stonedesc:
         description: 配石描述 - 类型:4
         type: string

+ 33 - 19
models/guangzuan.go

@@ -3,6 +3,7 @@ package models
 import (
 	"encoding/hex"
 	"mtp2_if/db"
+	"mtp2_if/mtpcache"
 	"mtp2_if/utils"
 	"strings"
 	"time"
@@ -10,23 +11,28 @@ import (
 
 // Warehouseinfo 仓库信息表
 type GZWarehouseinfo struct {
-	AUTOID          int64     `json:"autoid" xorm:"AUTOID"`                   // 自增ID
-	WAREHOUSECODE   string    `json:"warehousecode" xorm:"WAREHOUSECODE"`     // 仓库代码
-	WAREHOUSENAME   string    `json:"warehousename" xorm:"WAREHOUSENAME"`     // 仓库名称
-	WAREHOUSETYPE   int32     `json:"warehousetype" xorm:"WAREHOUSETYPE"`     // 仓库类型 - 1 厂库  2 自有库  3 合作库
-	AREAUSERID      int64     `json:"areauserid" xorm:"AREAUSERID"`           // 所属机构
-	WAREHOUSESTATUS int32     `json:"warehousestatus" xorm:"WAREHOUSESTATUS"` // 仓库状态 - 1:正常 2:注销 3:待审核 4:审核拒绝
-	COUNTRYID       int32     `json:"countryid" xorm:"COUNTRYID"`             // 国家
-	PROVINCEID      int32     `json:"provinceid" xorm:"PROVINCEID"`           // 省
-	CITYID          int32     `json:"cityid" xorm:"CITYID"`                   // 市
-	DISTRICTID      int32     `json:"districtid" xorm:"DISTRICTID"`           // 区
-	ADDRESS         string    `json:"address" xorm:"ADDRESS"`                 // 详细地址
-	REMARK          string    `json:"remark" xorm:"REMARK"`                   // 审核备注
-	CREATETIME      time.Time `json:"createtime" xorm:"CREATETIME"`           // 创建时间
-	HASVIDEO        int32     `json:"hasvideo" xorm:"HASVIDEO"`               // 是否有视频 - 0:无 1:有
-	VIDEOURL        string    `json:"videourl" xorm:"VIDEOURL"`               // 视频地址
-	CONTACTNAME     string    `json:"contactname" xorm:"CONTACTNAME"`         // 联系人
-	CONTACTNUM      string    `json:"contactnum" xorm:"CONTACTNUM"`           // 联系电话
+	AUTOID          int64  `json:"autoid" xorm:"AUTOID"`                   // 自增ID
+	WAREHOUSECODE   string `json:"warehousecode" xorm:"WAREHOUSECODE"`     // 仓库代码
+	WAREHOUSENAME   string `json:"warehousename" xorm:"WAREHOUSENAME"`     // 仓库名称
+	WAREHOUSETYPE   int32  `json:"warehousetype" xorm:"WAREHOUSETYPE"`     // 仓库类型 - 1 厂库  2 自有库  3 合作库
+	AREAUSERID      int64  `json:"areauserid" xorm:"AREAUSERID"`           // 所属机构
+	WAREHOUSESTATUS int32  `json:"warehousestatus" xorm:"WAREHOUSESTATUS"` // 仓库状态 - 1:正常 2:注销 3:待审核 4:审核拒绝
+	COUNTRYID       int32  `json:"countryid" xorm:"COUNTRYID"`             // 国家
+	PROVINCEID      int32  `json:"provinceid" xorm:"PROVINCEID"`           // 省
+	CITYID          int32  `json:"cityid" xorm:"CITYID"`                   // 市
+	DISTRICTID      int32  `json:"districtid" xorm:"DISTRICTID"`           // 区
+	ADDRESS         string `json:"address" xorm:"ADDRESS"`                 // 详细地址
+	REMARK          string `json:"remark" xorm:"REMARK"`                   // 审核备注
+	CREATETIME      string `json:"createtime" xorm:"CREATETIME"`           // 创建时间
+	HASVIDEO        int32  `json:"hasvideo" xorm:"HASVIDEO"`               // 是否有视频 - 0:无 1:有
+	VIDEOURL        string `json:"videourl" xorm:"VIDEOURL"`               // 视频地址
+	CONTACTNAME     string `json:"contactname" xorm:"CONTACTNAME"`         // 联系人
+	CONTACTNUM      string `json:"contactnum" xorm:"CONTACTNUM"`           // 联系电话
+
+	COUNTRYNAME  string `json:"countryname"`  // 国家名称
+	CITYNAME     string `json:"cityname"`     // 城市名称
+	PROVINCENAME string `json:"provincename"` // 省名称
+	DISTRICTNAME string `json:"districtname"` // 地区名称
 
 	PageEx `xorm:"extends"` // 页码信息
 
@@ -41,7 +47,10 @@ func (r *GZWarehouseinfo) TableName() string {
 }
 
 func (r *GZWarehouseinfo) calc() {
-
+	r.COUNTRYNAME = mtpcache.GetDivisionName(r.COUNTRYID)
+	r.CITYNAME = mtpcache.GetDivisionName(r.CITYID)
+	r.PROVINCENAME = mtpcache.GetDivisionName(r.PROVINCEID)
+	r.DISTRICTNAME = mtpcache.GetDivisionName(r.DISTRICTID)
 }
 
 func (r *GZWarehouseinfo) buildSql() string {
@@ -162,6 +171,7 @@ type MyWRPosition struct {
 	ZSCZCOLOR2TYPE      int32   `json:"zsczcolor2type" xorm:"ZSCZCOLOR2TYPE"`              // 彩钻颜色2 - 枚举”ZSCZColor2Type“ - 类型:5
 	ZSCZCOLOR3TYPE      int32   `json:"zsczcolor3type" xorm:"ZSCZCOLOR3TYPE"`              // 彩钻颜色3 - 枚举”ZSCZColor3Type“ - 类型:5
 	ISVALID             int32   `json:"isvalid" xorm:"ISVALID"`                            // 是否有效 - 0:无效 1:有效
+	SIZEDISPLAY         string  `json:"sizedisplay" xorm:"SIZEDISPLAY"`                    // 尺寸
 
 	QTY            int64   `json:"-" xorm:"QTY"`
 	FREEZERQTY     int64   `json:"-" xorm:"FREEZERQTY"`
@@ -204,7 +214,11 @@ func (r *MyWRPosition) buildSql() string {
 		to_char(t.LADINGBILLID) LADINGBILLID,
 		t.SUBNUM,
 		to_char(od.WRTRADEORDERID) WRTRADEORDERID1,
-		wr.* 
+		wr.*,
+		CASE WHEN
+			wr.SIZE1 IS NOT NULL AND wr.SIZE2 IS NOT NULL AND wr.SIZE2 IS NOT NULL THEN wr.SIZE1 || '*' || wr.SIZE2 || '*' || wr.SIZE3
+			ELSE wr.SIZE1
+		END AS SIZEDISPLAY
 	FROM WRHoldLB t
 	INNER JOIN WRFactorType ft ON t.wrfactortypeid = ft.wrfactortypeid
 	INNER JOIN View_GZ_WRStandard_Ex_Query wr ON ft.wrstandardid = wr.wrstandardid