package com.za.bean.db.order

import android.os.Parcel
import android.os.Parcelable
import androidx.room.Entity
import androidx.room.PrimaryKey

@Entity(tableName = "order_info")
data class OrderInfo(
	@PrimaryKey(autoGenerate = false) var taskId : Int? = null, //订单号       "taskId":5313005
	var userOrderId : Int? = null, //订单id
	var taskCode : String? = null, //订单编码    "taskCode":"ZD20190308009965"
	var customerName : String? = null, //客户姓名  "customerName":"越继安"
	var customerPhone : String? = null, //客户电话  "customerPhone":"18078815268"
	var carBrand : String? = null, //车辆品牌   "carBrand":""
	var modelVinNo : String? = null,
	var carModel : String? = null, //车辆型号  "carModel":"秦"
	var carNo : String? = null, //客户车车牌号  "carNo":"粤AF53918"
	var carVin : String? = null, //客户车Vin码  "carVin":"LGXC76C30J0132942"
	var taskState : String? = null, //订单状态   "taskState":"GOTO"
	var nextState : String? = null, //下一步状态
	var electronOrderState : Int? = null, //电子工单状态：1检查损伤 2生成车辆检查表签字 3作业完成签字
	var address : String? = null, //任务地址   "address":"广东省广州市白云区107国道石井凰岗路342号(白云黄石、同德围地区近庆丰兴隆公园)美景大酒店"
	var addressProperty : String? = null, //任务地址类型   "addressProperty":"地面"
	var addressRemark : String? = null, //事发地地址补充
	var distAddress : String? = null, //目的地地址   "distAddress":"广东省广州市白云区雅岗南大道"
	var distAddressRemark : String? = null, //目的地地址补充
	var expectArriveTime : String? = null, //预计到达时间  "expectArriveTime":"2019-03-08 05:11:07"
	var serviceTypeName : String? = null, //服务类型 "serviceTypeName":"故障--平板拖车"
	var orderSource : String? = null, //  "orderSource":"中道救援-比亚迪道路救援项目"
	var flowType : Int? = null, //流程类型   0 综合服务 1小修  2拖车 3取送件 4在线技术解决  5组合服务 6拖车简化流程 7武汉交管服务
	var settleType : Int? = null, //结算类型 1 月结 2 现金
	var settleTypeStr : String? = null, //结算类型
	var supplierId : Int? = null,
	var startTime : String? = null, //发车时间
	var operationTime : String? = null, //作业完成时间
	var dispatchTime : String? = null, //派单时间  "dispatchTime":"2019-03-08 04:26:07"
	var verifyType : Int? = null, //验证类型 "verifyType": 0 跳过验证  1和2 车牌和车架号验证  5 新车验证
	var verifyValue : String? = null, //验证内容  "verifyValue":"粤AF53918"
	var holdon : Boolean? = null, //是否被挂起  "holdon":false
	var isCurrent : Boolean? = null, //是否为正在做的任务
	var flow : String? = null, //流程状态  "flow":"START,GOTO,VERIFY,EXAMINE,OPERATION,SENDTO,SETTLEMENT,FINISH"
	var externalCode : String? = null, //
	var plateNumber : String? = null,
	var distaddressProperty : String? = null,
	var vehiclePointRemark : String? = null,
	var destinationRemark : String? = null,
	var lat : Double? = null,
	var lng : Double? = null,
	var distLat : Double? = null,
	var distLng : Double? = null,
	var hotline : String? = null,
	var createTime : String? = null,
	var acceptTime : String? = null,
	var arriveTime : String? = null,
	var arriveDestTime : String? = null,
	var needECDevice : Boolean? = null,
	var needDestAddress : Boolean? = null,
	var linkToDocs : Boolean? = null,
	var linkToDaDianH5 : Boolean? = null,
	var carFactory : Boolean? = null,
	var needWaterMarker : Boolean? = null,
	var needShowPhoneBrand : Boolean? = null,
	var taskNotes : String? = null, //救援要求
	var feeStandard : String? = null, //收费标准
	var customerNotes : String? = null, //客户提醒
	var otherNotes : String? = null, //特殊提醒
	var isNewCar : Boolean? = null, //是否新车
	var ECDeviceString : String? = null, //搭电设备照片提示
	var customerReportImgs : String? = null, //客户上报照片，多张照片用;分隔
	var arriveRemind : String? = null,
	var arriveRemindLink : String? = null,
	var policyNo : String? = null, // 平安拖车责任险 保单号
	var advanceTime : Long? = null,
	var importantTip : String? = null,
	var hasReplaceBatteryCapable : Int? = null, //是否有更换电瓶的能力  1 搭电可以更换电瓶  2搭电不可以更换电瓶 其他的不展示
	var taskSuccessStatus : Int? = null, //作业是否完成 0 完成  1未完成 拖车默认完成
	var tyreNumber : Int? = null, //辅助费用
) : Parcelable {
	constructor(parcel : Parcel) : this(parcel.readValue(Int::class.java.classLoader) as? Int,
		parcel.readValue(Int::class.java.classLoader) as? Int,
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readValue(Int::class.java.classLoader) as? Int,
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readValue(Int::class.java.classLoader) as? Int,
		parcel.readValue(Int::class.java.classLoader) as? Int,
		parcel.readString(),
		parcel.readValue(Int::class.java.classLoader) as? Int,
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readValue(Int::class.java.classLoader) as? Int,
		parcel.readString(),
		parcel.readValue(Boolean::class.java.classLoader) as? Boolean,
		parcel.readValue(Boolean::class.java.classLoader) as? Boolean,
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readValue(Double::class.java.classLoader) as? Double,
		parcel.readValue(Double::class.java.classLoader) as? Double,
		parcel.readValue(Double::class.java.classLoader) as? Double,
		parcel.readValue(Double::class.java.classLoader) as? Double,
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readValue(Boolean::class.java.classLoader) as? Boolean,
		parcel.readValue(Boolean::class.java.classLoader) as? Boolean,
		parcel.readValue(Boolean::class.java.classLoader) as? Boolean,
		parcel.readValue(Boolean::class.java.classLoader) as? Boolean,
		parcel.readValue(Boolean::class.java.classLoader) as? Boolean,
		parcel.readValue(Boolean::class.java.classLoader) as? Boolean,
		parcel.readValue(Boolean::class.java.classLoader) as? Boolean,
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readValue(Boolean::class.java.classLoader) as? Boolean,
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readString(),
		parcel.readValue(Long::class.java.classLoader) as? Long,
		parcel.readString(),
		parcel.readValue(Int::class.java.classLoader) as? Int,
		parcel.readValue(Int::class.java.classLoader) as? Int,
		parcel.readValue(Int::class.java.classLoader) as? Int) {
	}

	override fun writeToParcel(parcel : Parcel, flags : Int) {
		parcel.writeValue(taskId)
		parcel.writeValue(userOrderId)
		parcel.writeString(taskCode)
		parcel.writeString(customerName)
		parcel.writeString(customerPhone)
		parcel.writeString(carBrand)
		parcel.writeString(modelVinNo)
		parcel.writeString(carModel)
		parcel.writeString(carNo)
		parcel.writeString(carVin)
		parcel.writeString(taskState)
		parcel.writeString(nextState)
		parcel.writeValue(electronOrderState)
		parcel.writeString(address)
		parcel.writeString(addressProperty)
		parcel.writeString(addressRemark)
		parcel.writeString(distAddress)
		parcel.writeString(distAddressRemark)
		parcel.writeString(expectArriveTime)
		parcel.writeString(serviceTypeName)
		parcel.writeString(orderSource)
		parcel.writeValue(flowType)
		parcel.writeValue(settleType)
		parcel.writeString(settleTypeStr)
		parcel.writeValue(supplierId)
		parcel.writeString(startTime)
		parcel.writeString(operationTime)
		parcel.writeString(dispatchTime)
		parcel.writeValue(verifyType)
		parcel.writeString(verifyValue)
		parcel.writeValue(holdon)
		parcel.writeValue(isCurrent)
		parcel.writeString(flow)
		parcel.writeString(externalCode)
		parcel.writeString(plateNumber)
		parcel.writeString(distaddressProperty)
		parcel.writeString(vehiclePointRemark)
		parcel.writeString(destinationRemark)
		parcel.writeValue(lat)
		parcel.writeValue(lng)
		parcel.writeValue(distLat)
		parcel.writeValue(distLng)
		parcel.writeString(hotline)
		parcel.writeString(createTime)
		parcel.writeString(acceptTime)
		parcel.writeString(arriveTime)
		parcel.writeString(arriveDestTime)
		parcel.writeValue(needECDevice)
		parcel.writeValue(needDestAddress)
		parcel.writeValue(linkToDocs)
		parcel.writeValue(linkToDaDianH5)
		parcel.writeValue(carFactory)
		parcel.writeValue(needWaterMarker)
		parcel.writeValue(needShowPhoneBrand)
		parcel.writeString(taskNotes)
		parcel.writeString(feeStandard)
		parcel.writeString(customerNotes)
		parcel.writeString(otherNotes)
		parcel.writeValue(isNewCar)
		parcel.writeString(ECDeviceString)
		parcel.writeString(customerReportImgs)
		parcel.writeString(arriveRemind)
		parcel.writeString(arriveRemindLink)
		parcel.writeString(policyNo)
		parcel.writeValue(advanceTime)
		parcel.writeString(importantTip)
		parcel.writeValue(hasReplaceBatteryCapable)
		parcel.writeValue(taskSuccessStatus)
		parcel.writeValue(tyreNumber)
	}

	override fun describeContents() : Int {
		return 0
	}

	companion object CREATOR : Parcelable.Creator<OrderInfo> {
		override fun createFromParcel(parcel : Parcel) : OrderInfo {
			return OrderInfo(parcel)
		}

		override fun newArray(size : Int) : Array<OrderInfo?> {
			return arrayOfNulls(size)
		}
	}
}