20240120-ljl-routeConfig
ljl 10 months ago
parent b61466d148
commit 201ffd5174

@ -547,6 +547,16 @@ class PrintSettingController extends AbstractApiController {
return $this->renderSuccess();
}
/**
* @api GET 获取物流网点
* @param int logisticsId * 物流ID
* @param int wbUserId 授权账号ID
*/
public function getLogisticsNetSites() {
$netSiteList = $this->expressTplService->getLogisticsNetSites($_GET['logisticsId'], $_GET['wbUserId'] ?: 0, CommonTool::getOperatorInfo());
return $this->renderSuccess(['netSiteList' => $netSiteList]);
}
/**
* @api POST 添加发货单模板
* @param string sysTplId * 系统模板ID

@ -701,4 +701,46 @@ class ExpressTplService extends AbstractService {
}
return $authCodeInfo['authCode'];
}
public function getLogisticsNetSites($logisticsId, $wbUserId, $operatorInfo) {
CheckClient::checkEmpty($logisticsId, 'logisticsId');
$accessToken = $operatorInfo['accessToken'];
$wbUserId = intval($wbUserId);
$companyCode = $this->logisticsPlatformDao->getCompanyCodeByLogisticsId($logisticsId, AppConst::appPlatformPdd);
$searchWaybillRet = PddApi::searchPddWaybill($companyCode, $accessToken, $wbUserId);
CheckClient::checkIsFailRet($searchWaybillRet);
$netSiteInfo = $searchWaybillRet['waybillApplyInfos'][$companyCode] ?: null;
return $this->buildNetSiteList($netSiteInfo);
}
private function buildNetSiteList($netSiteInfo) {
if (empty($netSiteInfo)) {
return null;
}
$netsiteList = [];
foreach ($netSiteInfo['branch_account_cols'] as $item) {
foreach($item['shipp_address_cols'] as $address) {
$addressList[] = [
'branchCode' => $item['branch_code'],
'province' => $address['province'],
'city' => $address['city'],
'county' => $address['district'],
'address' => $address['detail'],
];
}
$netsiteList[] = [
'wpType' => $netSiteInfo['wp_type'],
'logisticsCode' => $netSiteInfo['wp_code'],
'branchCode' => $item['branch_code'],
'branchName' => $item['branch_name'],
'quantity' => $item['quantity'],
'cancelQuantity' => $item['cancel_quantity'],
'recycledQuantity' => $item['recycled_quantity'],
'allocatedQuantity' => $item['allocated_quantity'],
'serviceInfo' => $item['service_info_cols'],
'addressList' => $addressList
];
}
return $netsiteList;
}
}

@ -2757,6 +2757,7 @@ class CommonTool {
'mallId' => $_SESSION[SessionConst::mallId],
'mallName' => $_SESSION[SessionConst::mallName],
'mallSubAccountId' => $_SESSION[SessionConst::mallSubAccountId],
'accessToken' => $_SESSION[SessionConst::accessToken],
'ip' => self::clientIp(),
'hostname' => gethostname(),
'currentUrl' => ZcUrlHelper::getCurrentUrl(false),

@ -32,7 +32,7 @@ class PddApi extends PddApiAbstract {
public static function kmsSearchBatch($inputList, $accessToken) {
$req = new PddOpenKmsSearchBatchRequest();
$req->setInputList(json_encode($inputList));
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -46,7 +46,7 @@ class PddApi extends PddApiAbstract {
public static function getKmsEncryptList($dataList, $accessToken) {
$req = new PddOpenKmsEncryptBatchRequest();
$req->setDataList(json_encode($dataList));
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -68,7 +68,7 @@ class PddApi extends PddApiAbstract {
public static function getDecryptMaskList($dataList, $accessToken) {
$req = new PddOpenDecryptMaskBatchRequest();
$req->setDataList(json_encode($dataList));
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -77,7 +77,7 @@ class PddApi extends PddApiAbstract {
$req = new PddOpenVirtualNumberCheck();
$req->setOrderSn($orderSn);
$req->setVirtualNumber($virtualNumber);
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -94,7 +94,7 @@ class PddApi extends PddApiAbstract {
$req->setAddress($receiverInfo['address']);
$req->setReceiverName($receiverInfo['receiverName']);
$req->setReceiverPhone($receiverInfo['receiverPhone']);
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -104,7 +104,7 @@ class PddApi extends PddApiAbstract {
$req->setTag($tag ?: '');
$req->setNote($note ?: '');
$req->setTagName($tagName ?: '');
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -112,7 +112,7 @@ class PddApi extends PddApiAbstract {
$req = new PddOpenDecryptBatchRequest();
$req->setDataList(json_encode($dataList));
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -121,7 +121,7 @@ class PddApi extends PddApiAbstract {
$req = new PddOpenWaybillTypeReportRequest();
$req->setOrderSnList(json_encode($orderSnList));
$req->setWaybillType($waybillType);
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -130,7 +130,7 @@ class PddApi extends PddApiAbstract {
$req = new PddOpenOrderChannelReportRequest();
$req->setOrderSnList(json_encode($orderSnList));
$req->setOrderChannel($orderChannel);
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -154,7 +154,7 @@ class PddApi extends PddApiAbstract {
$req->setRefundAddressId($deliveryInfo['refundAddressId']);
}
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -170,7 +170,7 @@ class PddApi extends PddApiAbstract {
$req->setExtraTrackType($extraTrackType);
}
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -179,7 +179,7 @@ class PddApi extends PddApiAbstract {
$req->setWpCode($wpCode);
$req->setWaybillCode($waybillCode);
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -189,8 +189,7 @@ class PddApi extends PddApiAbstract {
$req->setWpCode($wpCode);
}
$response = self::getClient()->execute($req, $accessToken, $wbUserId);
$response = self::execute($req, $accessToken, $wbUserId);
if (CommonTool::isFailRet($response)) {
return $response;
}
@ -205,7 +204,7 @@ class PddApi extends PddApiAbstract {
$req->setWpCode($wpCode);
}
$response = self::getClient()->execute($req, $accessToken, $wbUserId);
$response = self::execute($req, $accessToken, $wbUserId);
if (CommonTool::isFailRet($response)) {
return $response;
}
@ -477,7 +476,7 @@ class PddApi extends PddApiAbstract {
public static function getRefundAddressList($accessToken) {
$req = new PddRefundAddressListGet();
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -498,7 +497,7 @@ class PddApi extends PddApiAbstract {
$req->setReturnAddressId($deliveryInfo['returnAddressId']);
}
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -508,7 +507,7 @@ class PddApi extends PddApiAbstract {
$req->setMailNo($mailNo);
$req->setCache($cache);
$response = self::getClient()->execute($req);
$response = self::execute($req);
return self::handleResponse($response);
}
@ -518,7 +517,7 @@ class PddApi extends PddApiAbstract {
$req->setTrackNo($expressNo);
$req->setTel($tel);
$response = self::getClient()->execute($req);
$response = self::execute($req);
return self::handleResponse($response);
}
@ -527,7 +526,7 @@ class PddApi extends PddApiAbstract {
return CommonTool::failResult('禁止请求该接口');
}
$req = new PddFdsRoleGetRequest();
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
@ -543,14 +542,14 @@ class PddApi extends PddApiAbstract {
$req = new PddFdsOrderGetRequest();
$req->setParamFdsOrderGetRequest(json_encode($paramFdsOrderGetRequest));
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
public static function getGoodsDetail($goodsId, $accessToken) {
$req = new PddGoodsDetailGetRequest();
$req->setGoodsId($goodsId);
$response = self::getClient()->execute($req, $accessToken);
$response = self::execute($req, $accessToken);
return self::handleResponse($response);
}
}
Loading…
Cancel
Save