61 lines
1.6 KiB
JavaScript
61 lines
1.6 KiB
JavaScript
|
|
const dayjs = require("dayjs");
|
||
|
|
|
||
|
|
exports.formatEMSOrderData = function (order) {
|
||
|
|
return [
|
||
|
|
{
|
||
|
|
createdTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||
|
|
ecommerceUserId: "ZYTZYY",
|
||
|
|
senderNo: process.env.CONFIG_EMS_SENDER_NO,
|
||
|
|
logisticsOrderNo: order.orderNo,
|
||
|
|
batchNo: "1",
|
||
|
|
waybillNo: "",
|
||
|
|
oneBillFlag: "0",
|
||
|
|
oneBillNum: "1",
|
||
|
|
submailNo: "",
|
||
|
|
oneBillFeeType: "1",
|
||
|
|
contentsAttribute: "3",
|
||
|
|
productType: "1",
|
||
|
|
bizProductNo: "1",
|
||
|
|
weight: "",//500
|
||
|
|
volume: "",//200
|
||
|
|
length: "",//
|
||
|
|
width: "",//
|
||
|
|
height: "",
|
||
|
|
postageTotal: "",//
|
||
|
|
pickupNotes: "",
|
||
|
|
insuranceFlag: "1",
|
||
|
|
insuranceAmount: "",
|
||
|
|
paymentMode: "1",
|
||
|
|
codFlag: "9",
|
||
|
|
codAmount: "",
|
||
|
|
sender: {
|
||
|
|
name: "震元堂中医院",
|
||
|
|
postCode: "",
|
||
|
|
phone: "",
|
||
|
|
mobile: "15957525904",
|
||
|
|
prov: "浙江省",
|
||
|
|
city: "绍兴市",
|
||
|
|
county: "越城区",
|
||
|
|
address: "胜利西路657号主楼1层"
|
||
|
|
},
|
||
|
|
receiver: {
|
||
|
|
name: order.receiveInfo.name,
|
||
|
|
postCode: "",
|
||
|
|
phone: order.receiveInfo.mobile,
|
||
|
|
mobile: order.receiveInfo.mobile,
|
||
|
|
prov: order.receiveInfo.region[0]||'',
|
||
|
|
city: order.receiveInfo.region[1]|'',
|
||
|
|
county: order.receiveInfo.region[2]||'',
|
||
|
|
address: order.receiveInfo.address||''
|
||
|
|
},
|
||
|
|
cargos: order.wines.map((wine) => ({
|
||
|
|
cargoName: wine.name,
|
||
|
|
cargoCategory: "",
|
||
|
|
cargoQuantity: wine.quantity,
|
||
|
|
cargoValue: '',
|
||
|
|
cargoWeight: "",
|
||
|
|
}))
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}
|