{
  "swagger": "2.0",
  "info": {
    "title": "内部订单",
    "version": "last"
  },
  "basePath": "/",
  "tags": [
    {
      "name": "公共分类",
      "description": "公共分类"
    }
  ],
  "schemes": ["http"],
  "paths": {
    "/erp/order/listByPage": {
      "post": {
        "tags": ["公共分类"],
        "summary": "订单列表查询",
        "description": "",
        "consumes": ["application/json"],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "title": "title",
              "properties": {
                "current": {
                  "type": "number",
                  "title": "当前页码",
                  "description": "当前页码"
                },
                "size": {
                  "type": "string",
                  "title": "每页条数",
                  "description": "每页条数"
                },
                "search": {
                  "type": "object",
                  "properties": {
                    "mainOrderId": {
                      "type": "string",
                      "title": "主订单id",
                      "description": "主订单id"
                    },
                    "productName": {
                      "type": "string",
                      "title": "商品名称",
                      "description": "商品名称"
                    }
                  },
                  "required": ["mainOrderId", "productName"],
                  "title": "查询参数",
                  "description": "查询参数"
                }
              },
              "required": ["current", "size", "search"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "current": {
                      "type": "number"
                    },
                    "pages": {
                      "type": "number"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "main_order_id": {
                            "type": "number"
                          },
                          "sales_code": {
                            "type": "string"
                          },
                          "customer_name": {
                            "type": "string"
                          },
                          "customer_contact_number": {
                            "type": "string"
                          },
                          "customer_shipping_address": {
                            "type": "string"
                          },
                          "institution_contact_name": {
                            "type": "string"
                          },
                          "institution": {
                            "type": "string"
                          },
                          "main_order_create_time": {
                            "type": "string"
                          },
                          "main_order_update_time": {
                            "type": "string"
                          },
                          "main_order_create_by_name": {
                            "type": "string"
                          },
                          "main_order_update_by_name": {
                            "type": "null"
                          },
                          "btns": {
                            "type": "string",
                            "description": "权限按钮"
                          },
                          "sub_orders": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "sub_order_id": {
                                  "type": "number"
                                },
                                "product_code": {
                                  "type": "number"
                                },
                                "product_name": {
                                  "type": "string"
                                },
                                "quantity": {
                                  "type": "number"
                                },
                                "product_price": {
                                  "type": "number"
                                },
                                "unit": {
                                  "type": "string"
                                },
                                "parameters": {
                                  "type": ["null", "string"]
                                },
                                "total_payment": {
                                  "type": "number"
                                },
                                "sub_order_payment": {
                                  "type": "number"
                                },
                                "is_cancel": {
                                  "type": "number"
                                },
                                "logistics_status": {
                                  "type": "string"
                                },
                                "payment_status": {
                                  "type": "string"
                                },
                                "payment_method": {
                                  "type": "string"
                                },
                                "payment_channel": {
                                  "type": "string"
                                },
                                "payment_transaction_id": {
                                  "type": ["string", "null"]
                                },
                                "invoice_information": {
                                  "type": ["string", "null"]
                                },
                                "invoicing_status": {
                                  "type": "string"
                                },
                                "product_belong_department": {
                                  "type": "string"
                                },
                                "waybill_number": {
                                  "type": ["number", "null"]
                                },
                                "notes": {
                                  "type": ["string", "null"]
                                },
                                "examine_notes": {
                                  "type": ["null", "string"]
                                },
                                "order_status": {
                                  "type": "string"
                                },
                                "sub_order_create_time": {
                                  "type": "string"
                                },
                                "sub_order_update_time": {
                                  "type": "string"
                                },
                                "sub_order_create_by_name": {
                                  "type": "string"
                                },
                                "sub_order_update_by_name": {
                                  "type": "null"
                                },
                                "btns": {
                                  "type": "string",
                                  "description": "权限按钮"
                                }
                              },
                              "required": [
                                "sub_order_id",
                                "product_code",
                                "product_name",
                                "quantity",
                                "product_price",
                                "unit",
                                "parameters",
                                "total_payment",
                                "sub_order_payment",
                                "is_cancel",
                                "logistics_status",
                                "payment_status",
                                "payment_method",
                                "payment_channel",
                                "payment_transaction_id",
                                "invoice_information",
                                "invoicing_status",
                                "product_belong_department",
                                "waybill_number",
                                "notes",
                                "examine_notes",
                                "order_status",
                                "sub_order_create_time",
                                "sub_order_update_time",
                                "sub_order_create_by_name",
                                "sub_order_update_by_name",
                                "btns"
                              ]
                            }
                          }
                        },
                        "required": [
                          "main_order_id",
                          "sales_code",
                          "customer_name",
                          "customer_contact_number",
                          "customer_shipping_address",
                          "institution_contact_name",
                          "institution",
                          "main_order_create_time",
                          "main_order_update_time",
                          "main_order_create_by_name",
                          "main_order_update_by_name",
                          "sub_orders",
                          "btns"
                        ]
                      }
                    },
                    "total": {
                      "type": "number"
                    },
                    "size": {
                      "type": "number"
                    }
                  },
                  "required": ["size"]
                },
                "message": {
                  "type": "string"
                },
                "code": {
                  "type": "number"
                }
              }
            }
          }
        }
      }
    },
    "/erp/order/add": {
      "post": {
        "tags": ["公共分类"],
        "summary": "订单新增",
        "description": "",
        "consumes": ["application/json"],
        "parameters": [
          {
            "name": "add_token",
            "in": "header",
            "description": "add_token (Only:undefined)",
            "required": true,
            "type": "string"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "sales_code": {
                  "type": "string"
                },
                "customer_name": {
                  "type": "string"
                },
                "customer_contact_number": {
                  "type": "string"
                },
                "customer_shipping_address": {
                  "type": "string"
                },
                "institution_contact_name": {
                  "type": "string"
                },
                "institution": {
                  "type": "string"
                },
                "sub_orders": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "product_code": {
                        "type": "number"
                      },
                      "product_name": {
                        "type": "string"
                      },
                      "quantity": {
                        "type": "number"
                      },
                      "product_price": {
                        "type": "number"
                      },
                      "unit": {
                        "type": "string"
                      },
                      "parameters": {
                        "type": "string"
                      },
                      "total_payment": {
                        "type": "number"
                      },
                      "sub_order_payment": {
                        "type": "number"
                      },
                      "payment_status": {
                        "type": "string"
                      },
                      "payment_method": {
                        "type": "string"
                      },
                      "payment_channel": {
                        "type": "string"
                      },
                      "payment_transaction_id": {
                        "type": "string",
                        "description": "预付必填"
                      },
                      "invoice_information": {
                        "type": "string",
                        "description": "需要开票必填"
                      },
                      "invoicing_status": {
                        "type": "string"
                      },
                      "product_belong_department": {
                        "type": "string"
                      },
                      "notes": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "product_code",
                      "product_name",
                      "quantity",
                      "product_price",
                      "unit",
                      "parameters",
                      "total_payment",
                      "sub_order_payment",
                      "payment_status",
                      "payment_method",
                      "payment_channel",
                      "invoicing_status",
                      "product_belong_department"
                    ]
                  }
                }
              },
              "required": [
                "sales_code",
                "customer_name",
                "customer_contact_number",
                "customer_shipping_address",
                "institution_contact_name",
                "sub_orders",
                "institution"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "code": {
                  "type": "number"
                }
              }
            }
          }
        }
      }
    },
    "/erp/order/update": {
      "post": {
        "tags": ["公共分类"],
        "summary": "订单编辑",
        "description": "",
        "consumes": ["application/json"],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "sales_code": {
                  "type": "string"
                },
                "customer_name": {
                  "type": "string"
                },
                "customer_contact_number": {
                  "type": "string"
                },
                "customer_shipping_address": {
                  "type": "string"
                },
                "institution_contact_name": {
                  "type": "string"
                },
                "institution": {
                  "type": "string"
                },
                "sub_orders": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "product_code": {
                        "type": "number"
                      },
                      "product_name": {
                        "type": "string"
                      },
                      "quantity": {
                        "type": "number"
                      },
                      "product_price": {
                        "type": "number"
                      },
                      "unit": {
                        "type": "string"
                      },
                      "parameters": {
                        "type": "string"
                      },
                      "total_payment": {
                        "type": "number"
                      },
                      "sub_order_payment": {
                        "type": "number"
                      },
                      "payment_status": {
                        "type": "string"
                      },
                      "payment_method": {
                        "type": "string"
                      },
                      "payment_channel": {
                        "type": "string"
                      },
                      "payment_transaction_id": {
                        "type": "string"
                      },
                      "invoice_information": {
                        "type": "string"
                      },
                      "invoicing_status": {
                        "type": "string"
                      },
                      "product_belong_department": {
                        "type": "string"
                      },
                      "notes": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "product_code",
                      "product_name",
                      "quantity",
                      "product_price",
                      "unit",
                      "parameters",
                      "total_payment",
                      "sub_order_payment",
                      "payment_status",
                      "payment_method",
                      "payment_channel",
                      "invoicing_status",
                      "product_belong_department"
                    ]
                  }
                }
              },
              "required": [
                "sales_code",
                "customer_name",
                "customer_contact_number",
                "customer_shipping_address",
                "institution_contact_name",
                "institution",
                "sub_orders"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "code": {
                  "type": "number"
                }
              }
            }
          }
        }
      }
    },
    "definitions": {}
  }
}