add
wangpengfei
2023-07-21 6c3cafb8e134685137c8a37f123f6aee18d63006
add

OrderType 工单类型模块
add, Delete, update, list
5个文件已添加
10个文件已修改
832 ■■■■■ 已修改文件
api/v1/index.go 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/orderType.go 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go 188 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 188 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/index.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/orderType.go 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/orderType.go 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/response/response.go 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pkg/ecode/code.go 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/index.go 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/orderType.go 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/dataServer.go 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/index.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/orderType.go 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/index.go
@@ -5,6 +5,7 @@
)
type Group struct {
    OrderTypeApi
    ReportSourceApi
    IsVisitApi
    SolveRateApi
@@ -108,4 +109,5 @@
    solveRateService            = service.ServiceGroup.SolveRateService
    isVisitService              = service.ServiceGroup.IsVisitService
   reportSourceService    = service.ServiceGroup.ReportSourceService
   orderTypeService    = service.ServiceGroup.OrderTypeService
)
api/v1/orderType.go
New file
@@ -0,0 +1,113 @@
package v1
import (
    "aps_crm/model"
    "aps_crm/model/request"
    "aps_crm/model/response"
    "aps_crm/pkg/contextx"
    "aps_crm/pkg/ecode"
    "github.com/gin-gonic/gin"
    "strconv"
)
type OrderTypeApi struct{}
// Add
//
//    @Tags        OrderType
//    @Summary    添加工单类型
//    @Produce    application/json
//    @Param        object    body        request.AddOrderType    true    "查询参数"
//    @Success    200        {object}    contextx.Response{}
//    @Router        /api/orderType/add [post]
func (s *OrderTypeApi) Add(c *gin.Context) {
    var params request.AddOrderType
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    orderType := new(model.OrderType)
    orderType.Name = params.Name
    errCode := orderTypeService.AddOrderType(orderType)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// Delete
//
//    @Tags        OrderType
//    @Summary    删除工单类型
//    @Produce    application/json
//    @Param        id    path        int    true    "查询参数"
//    @Success    200    {object}    contextx.Response{}
//    @Router        /api/orderType/delete/{id} [delete]
func (s *OrderTypeApi) Delete(c *gin.Context) {
    ctx, ok := contextx.NewContext(c, nil)
    if !ok {
        return
    }
    id, _ := strconv.Atoi(c.Param("id"))
    errCode := orderTypeService.DeleteOrderType(id)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// Update
//
//    @Tags        OrderType
//    @Summary    更新工单类型
//    @Produce    application/json
//    @Param        object    body        request.UpdateOrderTypes    true    "查询参数"
//    @Success    200        {object}    contextx.Response{}
//    @Router        /api/orderType/update [put]
func (s *OrderTypeApi) Update(c *gin.Context) {
    var params request.UpdateOrderTypes
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    errCode := orderTypeService.UpdateOrderType(params.OrderTypes)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// List
//
//    @Tags        OrderType
//    @Summary    获取工单类型列表
//    @Produce    application/json
//    @Success    200    {object}    contextx.Response{data=response.OrderTypeResponse}
//    @Router        /api/orderType/list [get]
func (s *OrderTypeApi) List(c *gin.Context) {
    ctx, ok := contextx.NewContext(c, nil)
    if !ok {
        return
    }
    orderTypes, errCode := orderTypeService.GetOrderTypeList()
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.OkWithDetailed(response.OrderTypeResponse{
        List: orderTypes,
    })
}
docs/docs.go
@@ -2430,6 +2430,125 @@
                }
            }
        },
        "/api/orderType/add": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "OrderType"
                ],
                "summary": "添加工单类型",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.AddOrderType"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/orderType/delete/{id}": {
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "OrderType"
                ],
                "summary": "删除工单类型",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "查询参数",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/orderType/list": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "OrderType"
                ],
                "summary": "获取工单类型列表",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/contextx.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/response.OrderTypeResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/api/orderType/update": {
            "put": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "OrderType"
                ],
                "summary": "更新工单类型",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateOrderTypes"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/plan/add": {
            "post": {
                "produces": [
@@ -6289,6 +6408,17 @@
                }
            }
        },
        "model.OrderType": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "model.Plan": {
            "type": "object",
            "properties": {
@@ -7467,6 +7597,17 @@
                },
                "sourceSheet": {
                    "type": "integer"
                }
            }
        },
        "request.AddOrderType": {
            "type": "object",
            "required": [
                "name"
            ],
            "properties": {
                "name": {
                    "type": "string"
                }
            }
        },
@@ -9141,6 +9282,35 @@
                }
            }
        },
        "request.UpdateOrderType": {
            "type": "object",
            "required": [
                "id",
                "name"
            ],
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "request.UpdateOrderTypes": {
            "type": "object",
            "required": [
                "order_type"
            ],
            "properties": {
                "order_type": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/request.UpdateOrderType"
                    }
                }
            }
        },
        "request.UpdatePlan": {
            "type": "object",
            "properties": {
@@ -10166,6 +10336,13 @@
                        "$ref": "#/definitions/model.User"
                    }
                },
                "orderType": {
                    "description": "工单类型",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/model.OrderType"
                    }
                },
                "province": {
                    "description": "省份数据",
                    "type": "array",
@@ -10347,6 +10524,17 @@
                }
            }
        },
        "response.OrderTypeResponse": {
            "type": "object",
            "properties": {
                "list": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/model.OrderType"
                    }
                }
            }
        },
        "response.PageResult": {
            "type": "object",
            "properties": {
docs/swagger.json
@@ -2418,6 +2418,125 @@
                }
            }
        },
        "/api/orderType/add": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "OrderType"
                ],
                "summary": "添加工单类型",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.AddOrderType"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/orderType/delete/{id}": {
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "OrderType"
                ],
                "summary": "删除工单类型",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "查询参数",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/orderType/list": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "OrderType"
                ],
                "summary": "获取工单类型列表",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/contextx.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/response.OrderTypeResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/api/orderType/update": {
            "put": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "OrderType"
                ],
                "summary": "更新工单类型",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateOrderTypes"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/plan/add": {
            "post": {
                "produces": [
@@ -6277,6 +6396,17 @@
                }
            }
        },
        "model.OrderType": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "model.Plan": {
            "type": "object",
            "properties": {
@@ -7455,6 +7585,17 @@
                },
                "sourceSheet": {
                    "type": "integer"
                }
            }
        },
        "request.AddOrderType": {
            "type": "object",
            "required": [
                "name"
            ],
            "properties": {
                "name": {
                    "type": "string"
                }
            }
        },
@@ -9129,6 +9270,35 @@
                }
            }
        },
        "request.UpdateOrderType": {
            "type": "object",
            "required": [
                "id",
                "name"
            ],
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "request.UpdateOrderTypes": {
            "type": "object",
            "required": [
                "order_type"
            ],
            "properties": {
                "order_type": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/request.UpdateOrderType"
                    }
                }
            }
        },
        "request.UpdatePlan": {
            "type": "object",
            "properties": {
@@ -10154,6 +10324,13 @@
                        "$ref": "#/definitions/model.User"
                    }
                },
                "orderType": {
                    "description": "工单类型",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/model.OrderType"
                    }
                },
                "province": {
                    "description": "省份数据",
                    "type": "array",
@@ -10335,6 +10512,17 @@
                }
            }
        },
        "response.OrderTypeResponse": {
            "type": "object",
            "properties": {
                "list": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/model.OrderType"
                    }
                }
            }
        },
        "response.PageResult": {
            "type": "object",
            "properties": {
docs/swagger.yaml
@@ -446,6 +446,13 @@
      title:
        type: string
    type: object
  model.OrderType:
    properties:
      id:
        type: integer
      name:
        type: string
    type: object
  model.Plan:
    properties:
      clientId:
@@ -1231,6 +1238,13 @@
        type: integer
      sourceSheet:
        type: integer
    type: object
  request.AddOrderType:
    properties:
      name:
        type: string
    required:
    - name
    type: object
  request.AddPlan:
    properties:
@@ -2364,6 +2378,25 @@
      sourceSheet:
        type: integer
    type: object
  request.UpdateOrderType:
    properties:
      id:
        type: integer
      name:
        type: string
    required:
    - id
    - name
    type: object
  request.UpdateOrderTypes:
    properties:
      order_type:
        items:
          $ref: '#/definitions/request.UpdateOrderType'
        type: array
    required:
    - order_type
    type: object
  request.UpdatePlan:
    properties:
      id:
@@ -3050,6 +3083,11 @@
        items:
          $ref: '#/definitions/model.User'
        type: array
      orderType:
        description: 工单类型
        items:
          $ref: '#/definitions/model.OrderType'
        type: array
      province:
        description: 省份数据
        items:
@@ -3169,6 +3207,13 @@
      list:
        items:
          $ref: '#/definitions/model.Menu'
        type: array
    type: object
  response.OrderTypeResponse:
    properties:
      list:
        items:
          $ref: '#/definitions/model.OrderType'
        type: array
    type: object
  response.PageResult:
@@ -4818,6 +4863,79 @@
      summary: 更新工单
      tags:
      - OrderManage
  /api/orderType/add:
    post:
      parameters:
      - description: 查询参数
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.AddOrderType'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 添加工单类型
      tags:
      - OrderType
  /api/orderType/delete/{id}:
    delete:
      parameters:
      - description: 查询参数
        in: path
        name: id
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 删除工单类型
      tags:
      - OrderType
  /api/orderType/list:
    get:
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            allOf:
            - $ref: '#/definitions/contextx.Response'
            - properties:
                data:
                  $ref: '#/definitions/response.OrderTypeResponse'
              type: object
      summary: 获取工单类型列表
      tags:
      - OrderType
  /api/orderType/update:
    put:
      parameters:
      - description: 查询参数
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.UpdateOrderTypes'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 更新工单类型
      tags:
      - OrderType
  /api/plan/add:
    post:
      parameters:
model/index.go
@@ -69,6 +69,7 @@
        IsVisit{},
        IsVisit{},
        ReportSource{},
        OrderType{},
    )
    return err
}
model/orderType.go
New file
@@ -0,0 +1,85 @@
package model
import (
    "aps_crm/pkg/mysqlx"
    "gorm.io/gorm"
)
type (
    // OrderType 商机阶段
    OrderType struct {
        Id   int    `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        Name string `json:"name" gorm:"column:name;type:varchar(255);comment:商机阶段名称"`
    }
    OrderTypeSearch struct {
        OrderType
        Orm *gorm.DB
    }
)
func (OrderType) TableName() string {
    return "order_type"
}
func NewOrderTypeSearch() *OrderTypeSearch {
    return &OrderTypeSearch{
        Orm: mysqlx.GetDB(),
    }
}
func (slf *OrderTypeSearch) build() *gorm.DB {
    var db = slf.Orm.Model(&OrderType{})
    if slf.Id != 0 {
        db = db.Where("id = ?", slf.Id)
    }
    if slf.Name != "" {
        db = db.Where("name = ?", slf.Name)
    }
    return db
}
func (slf *OrderTypeSearch) Create(record *OrderType) error {
    var db = slf.build()
    return db.Create(record).Error
}
func (slf *OrderTypeSearch) Delete() error {
    var db = slf.build()
    return db.Delete(&OrderType{}).Error
}
func (slf *OrderTypeSearch) Update(record *OrderType) error {
    var db = slf.build()
    return db.Updates(record).Error
}
func (slf *OrderTypeSearch) Find() (*OrderType, error) {
    var db = slf.build()
    var record = new(OrderType)
    err := db.First(record).Error
    return record, err
}
func (slf *OrderTypeSearch) FindAll() ([]*OrderType, error) {
    var db = slf.build()
    var records = make([]*OrderType, 0)
    err := db.Find(&records).Error
    return records, err
}
func (slf *OrderTypeSearch) SetId(id int) *OrderTypeSearch {
    slf.Id = id
    return slf
}
func (slf *OrderTypeSearch) SetName(name string) *OrderTypeSearch {
    slf.Name = name
    return slf
}
func (slf *OrderTypeSearch) Updates(data map[string]interface{}) error {
    var db = slf.build()
    return db.Updates(data).Error
}
model/request/orderType.go
New file
@@ -0,0 +1,15 @@
package request
type AddOrderType struct {
    Name string `  json:"name" binding:"required"`
}
type UpdateOrderType struct {
    Id   int    `json:"id" binding:"required"`
    Name string `json:"name" binding:"required"`
}
type UpdateOrderTypes struct {
    OrderTypes []*UpdateOrderType `json:"order_type" binding:"required"`
}
model/response/response.go
@@ -180,6 +180,10 @@
    DataResponse struct {
        // 工单类型
        OrderType []*model.OrderType `json:"orderType"`
        // 报表来源
        ReportSource []*model.ReportSource `json:"reportSource"`
@@ -254,4 +258,8 @@
    ReportSourceResponse struct {
        List []*model.ReportSource `json:"list"`
    }
    OrderTypeResponse struct {
        List []*model.OrderType `json:"list"`
    }
)
pkg/ecode/code.go
@@ -316,11 +316,16 @@
    IsVisitSetErr    = 4500004 // 设置服务人员是否来过失败
    IsVisitUpdateErr = 4500005 // 更新服务人员是否来过失败
    ReportSourceExist     = 4600001 // 报表来源已存在
    ReportSourceNotExist  = 4600002 // 报表来源不存在
    ReportSourceListErr   = 4600003 // 获取报表来源列表失败
    ReportSourceSetErr    = 4600004 // 设置报表来源失败
    ReportSourceUpdateErr = 4600005 // 更新报表来源失败
    ReportSourceExist     = 4400001 // 报表来源已存在
    ReportSourceNotExist  = 4400002 // 报表来源不存在
    ReportSourceListErr   = 4400003 // 获取报表来源列表失败
    ReportSourceSetErr    = 4400004 // 设置报表来源失败
    ReportSourceUpdateErr = 4400005 // 更新报表来源失败
    OrderTypeExist     = 4700001 // 工单类型已存在
    OrderTypeNotExist  = 4700002 // 工单类型不存在
    OrderTypeListErr   = 4700003 // 获取工单类型列表失败
    OrderTypeSetErr    = 4700004 // 设置工单类型失败
    OrderTypeUpdateErr = 4700005 // 更新工单类型失败
)
)
router/index.go
@@ -11,6 +11,7 @@
)
type Group struct {
    OrderTypeRouter
    ReportSourceRouter
    IsVisitRouter
    SolveRateRouter
@@ -137,6 +138,7 @@
        routerGroup.InitSolveRateRouter(PrivateGroup)
        routerGroup.InitIsVisitRouter(PrivateGroup)
        routerGroup.InitReportSourceRouter(PrivateGroup)
        routerGroup.InitOrderTypeRouter(PrivateGroup)
    }
    return Router
}
router/orderType.go
New file
@@ -0,0 +1,20 @@
package router
import (
    v1 "aps_crm/api/v1"
    "github.com/gin-gonic/gin"
)
type OrderTypeRouter struct{}
func (s *OrderTypeRouter) InitOrderTypeRouter(router *gin.RouterGroup) {
    orderTypeRouter := router.Group("orderType")
    orderTypeApi := v1.ApiGroup.OrderTypeApi
    {
        orderTypeRouter.POST("add", orderTypeApi.Add)             // 添加$CName$
        orderTypeRouter.DELETE("delete/:id", orderTypeApi.Delete) // 删除$CName$
        orderTypeRouter.PUT("update", orderTypeApi.Update)        // 更新$CName$
        orderTypeRouter.GET("list", orderTypeApi.List)            // 获取$CName$列表
    }
}
service/dataServer.go
@@ -101,6 +101,11 @@
    data.ReportSource = reportSourceList
    // get OrderType list
    orderTypeList, _ := ServiceGroup.GetOrderTypeList()
    data.OrderType = orderTypeList
    errCode = ecode.OK
    return
service/index.go
@@ -50,6 +50,7 @@
    SolveRateService
    IsVisitService
    ReportSourceService
    OrderTypeService
}
var ServiceGroup = new(Group)
service/orderType.go
New file
@@ -0,0 +1,69 @@
package service
import (
    "aps_crm/model"
    "aps_crm/model/request"
    "aps_crm/pkg/ecode"
)
type OrderTypeService struct{}
func (OrderTypeService) AddOrderType(orderType *model.OrderType) int {
    err := model.NewOrderTypeSearch().Create(orderType)
    if err != nil {
        return ecode.OrderTypeExist
    }
    return ecode.OK
}
func (OrderTypeService) DeleteOrderType(id int) int {
    _, err := model.NewOrderTypeSearch().SetId(id).Find()
    if err != nil {
        return ecode.OrderTypeNotExist
    }
    err = model.NewOrderTypeSearch().SetId(id).Delete()
    if err != nil {
        return ecode.OrderTypeNotExist
    }
    return ecode.OK
}
func (OrderTypeService) GetOrderTypeList() ([]*model.OrderType, int) {
    list, err := model.NewOrderTypeSearch().FindAll()
    if err != nil {
        return nil, ecode.OrderTypeListErr
    }
    return list, ecode.OK
}
func (OrderTypeService) UpdateOrderType(orderTypes []*request.UpdateOrderType) int {
    for _, v := range orderTypes {
        // check orderType exist
        _, err := model.NewOrderTypeSearch().SetId(v.Id).Find()
        if err != nil {
            return ecode.OrderTypeNotExist
        }
        err = model.NewOrderTypeSearch().SetId(v.Id).Updates(map[string]interface{}{
            "name": v.Name,
        })
        if err != nil {
            return ecode.OrderTypeSetErr
        }
    }
    return ecode.OK
}
func (OrderTypeService) GetOrderTypeDetail(id int) (*model.OrderType, int) {
    orderType, err := model.NewOrderTypeSearch().SetId(id).Find()
    if err != nil {
        return nil, ecode.OrderTypeNotExist
    }
    return orderType, ecode.OK
}