20240120-ljl-routeConfig
ljl 10 months ago
parent 326e21ebaa
commit 9bb0ee768b

@ -688,4 +688,12 @@ class LogisticsConst {
),
);
}
public static function isWangdianWaybill($waybillType) {
return self::waybillWangdian == $waybillType;
}
public static function isPddbill($waybillType) {
return self::waybillPdd == $waybillType;
}
}

@ -160,7 +160,45 @@ class ExpressTplService extends AbstractService {
CheckClient::checkEmpty($tplId, null, '模板id不能为空');
$expressTpl = $this->expressTplRepository->getUserExpressTplById($mallId, $tplId);
CheckClient::checkEmpty($expressTpl, null, '模板不存在');
}
private function buildWaybillAccount($expressTpl, $data) {
if (LogisticsConst::isWangdianWaybill($expressTpl['waybillType'])) {
$waybillAccount = $this->buildWangdianWaybillAccount($data);
} elseif (LogisticsConst::isPddbill($expressTpl['waybillType'])) {
$waybillAccount = $this->buildPddCloudWaybillAccount($data);
} else {
throw new BizException('暂不支持该面单类型');
}
return $waybillAccount;
}
private function buildWangdianWaybillAccount($params) {
return [
'customerName' => $params['customerName'],
'customerPwd' => $params['customerPwd'],
'monthCode' => $params['monthCode'],
'sendSite' => $params['sendSite'],
'serviceType' => $params['serviceType'],
'orderType' => $params['orderType'],
'payType' => $params['payType'],
'insureType' => $params['insureType'],
'insureValueTimes' => $params['insureValueTimes'],
'branchName' => $params['branchName'],
];
}
private function buildPddCloudWaybillAccount($params) {
return [
'branchCode' => $params['branchCode'],
'branchName' => $params['branchName'],
'customerCode' => $params['customerCode'],
'branchAddress' => $params['branchAddress'],
'orderType' => $params['orderType'],
'payType' => $params['payType'],
'serviceList' => $params['serviceList'],
];
}
public function saveUserExpressTpl($mallId, $params) {
@ -729,11 +767,11 @@ class ExpressTplService extends AbstractService {
foreach ($netSiteInfo['branch_account_cols'] as $item) {
foreach($item['shipp_address_cols'] as $address) {
$addressList[] = [
'branchCode' => $item['branch_code'],
'country' => $address['country'],
'province' => $address['province'],
'city' => $address['city'],
'county' => $address['district'],
'address' => $address['detail'],
'district' => $address['district'],
'detail' => $address['detail'],
];
}
$netsiteList[] = [

Loading…
Cancel
Save