Ver Fonte

提货门店加上地址信息

zou.yingbin há 4 anos atrás
pai
commit
003038ca3a
5 ficheiros alterados com 110 adições e 1 exclusões
  1. 32 0
      docs/docs.go
  2. 32 0
      docs/swagger.json
  3. 24 0
      docs/swagger.yaml
  4. 19 1
      models/qhj.go
  5. 3 0
      mtpcache/division.go

+ 32 - 0
docs/docs.go

@@ -20266,6 +20266,30 @@ var doc = `{
         "models.QhjPickArea": {
             "type": "object",
             "properties": {
+                "cityid": {
+                    "description": "市",
+                    "type": "integer"
+                },
+                "cityname": {
+                    "description": "城市名称",
+                    "type": "string"
+                },
+                "countryid": {
+                    "description": "国家",
+                    "type": "integer"
+                },
+                "countryname": {
+                    "description": "国家名称",
+                    "type": "string"
+                },
+                "districtid": {
+                    "description": "地区",
+                    "type": "integer"
+                },
+                "districtname": {
+                    "description": "地区名称",
+                    "type": "string"
+                },
                 "fromuserid": {
                     "description": "所属机构(组织机构)( OrgType = 1时为自己, = 2\\3时取上级机构的所属机构)",
                     "type": "integer"
@@ -20274,6 +20298,14 @@ var doc = `{
                     "description": "所属机构名称",
                     "type": "string"
                 },
+                "provinceid": {
+                    "description": "省",
+                    "type": "integer"
+                },
+                "provincename": {
+                    "description": "省名称",
+                    "type": "string"
+                },
                 "suborgtype": {
                     "description": "子机构类型(千海金) - 0:机构 1:代理 2:门店",
                     "type": "integer"

+ 32 - 0
docs/swagger.json

@@ -20250,6 +20250,30 @@
         "models.QhjPickArea": {
             "type": "object",
             "properties": {
+                "cityid": {
+                    "description": "市",
+                    "type": "integer"
+                },
+                "cityname": {
+                    "description": "城市名称",
+                    "type": "string"
+                },
+                "countryid": {
+                    "description": "国家",
+                    "type": "integer"
+                },
+                "countryname": {
+                    "description": "国家名称",
+                    "type": "string"
+                },
+                "districtid": {
+                    "description": "地区",
+                    "type": "integer"
+                },
+                "districtname": {
+                    "description": "地区名称",
+                    "type": "string"
+                },
                 "fromuserid": {
                     "description": "所属机构(组织机构)( OrgType = 1时为自己, = 2\\3时取上级机构的所属机构)",
                     "type": "integer"
@@ -20258,6 +20282,14 @@
                     "description": "所属机构名称",
                     "type": "string"
                 },
+                "provinceid": {
+                    "description": "省",
+                    "type": "integer"
+                },
+                "provincename": {
+                    "description": "省名称",
+                    "type": "string"
+                },
                 "suborgtype": {
                     "description": "子机构类型(千海金) - 0:机构 1:代理 2:门店",
                     "type": "integer"

+ 24 - 0
docs/swagger.yaml

@@ -8791,12 +8791,36 @@ definitions:
     type: object
   models.QhjPickArea:
     properties:
+      cityid:
+        description: 市
+        type: integer
+      cityname:
+        description: 城市名称
+        type: string
+      countryid:
+        description: 国家
+        type: integer
+      countryname:
+        description: 国家名称
+        type: string
+      districtid:
+        description: 地区
+        type: integer
+      districtname:
+        description: 地区名称
+        type: string
       fromuserid:
         description: 所属机构(组织机构)( OrgType = 1时为自己, = 2\3时取上级机构的所属机构)
         type: integer
       fromusername:
         description: 所属机构名称
         type: string
+      provinceid:
+        description: 省
+        type: integer
+      provincename:
+        description: 省名称
+        type: string
       suborgtype:
         description: 子机构类型(千海金) - 0:机构 1:代理 2:门店
         type: integer

+ 19 - 1
models/qhj.go

@@ -613,14 +613,26 @@ type QhjPickArea struct {
 	SHOPPASSWORD   string `json:"-"  xorm:"SHOPPASSWORD"`        // 商城店铺登陆密码(商城店铺角色使用)
 	SUBLEVELPATH   string `json:"-"  xorm:"SUBLEVELPATH"`        // 组织机构层级路径(逗号分隔,首尾加逗号)
 	TRANSURL       string `json:"-"  xorm:"TRANSURL"`            // 物流地址(物流机构)
+	COUNTRYID      int32  `json:"countryid"  xorm:"COUNTRYID"`   // 国家
+	PROVINCEID     int32  `json:"provinceid"  xorm:"PROVINCEID"` // 省
+	CITYID         int32  `json:"cityid"  xorm:"CITYID"`         // 市
+	DISTRICTID     int32  `json:"districtid"  xorm:"DISTRICTID"` // 地区
 
 	USERNAME     string `json:"username"`     // 机构用户名称(门店门称)
 	FROMUSERNAME string `json:"fromusername"` // 所属机构名称
+	COUNTRYNAME  string `json:"countryname"`  // 国家名称
+	CITYNAME     string `json:"cityname"`     // 城市名称
+	PROVINCENAME string `json:"provincename"` // 省名称
+	DISTRICTNAME string `json:"districtname"` // 地区名称
 }
 
 func (r *QhjPickArea) calc() {
 	r.USERNAME = mtpcache.GetUserNameByUserId(r.USERID)
 	r.FROMUSERNAME = mtpcache.GetUserNameByUserId(r.FROMUSERID)
+	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 *QhjPickArea) buildSql() string {
@@ -640,8 +652,14 @@ func (r *QhjPickArea) buildSql() string {
 		"       t.PARENTUSERID," +
 		"       t.ROOTUSERID," +
 		"       t.SUBLEVELPATH," +
-		"       t.ORGTYPE" +
+		"       t.ORGTYPE," +
+		"       u.countryid," +
+		"       u.provinceid," +
+		"       u.cityid," +
+		"       u.districtid," +
+		"       u.address" +
 		"  FROM AREAROLE t" +
+		"  LEFT JOIN USERINFO u on t.userid=u.userid" +
 		" WHERE 1 = 1"
 	sqlId.And("t.SUBORGTYPE", 2)
 	return sqlId.String()

+ 3 - 0
mtpcache/division.go

@@ -79,6 +79,9 @@ func (r *DivisionMgr) Name(Id int64) string {
 
 // 获取行政区名称
 func GetDivisionName(Id int32) string {
+	if Id <= 0 {
+		return ""
+	}
 	if strName := vDivisionMgr.Name(int64(Id)); strName != "" {
 		return strName
 	}