api/Wms gzt_bind 增加 error 日志
This commit is contained in:
parent
42dd50e1ef
commit
dd39b4d287
@ -317,15 +317,18 @@ class Wms extends Api
|
|||||||
}
|
}
|
||||||
public function gzt_bind(){
|
public function gzt_bind(){
|
||||||
$params=$this->request->post();
|
$params=$this->request->post();
|
||||||
|
\think\Log::error("[gzt_bind] 入参: " . json_encode($params, JSON_UNESCAPED_UNICODE));
|
||||||
$GztModel = new \app\common\model\wms\Gzt;
|
$GztModel = new \app\common\model\wms\Gzt;
|
||||||
$WAREHOUSEID = $this->auth->warehouseid;
|
$WAREHOUSEID = $this->auth->warehouseid;
|
||||||
$gzt = $GztModel->where(['id'=>$params["id"],"wareHouseId"=>$WAREHOUSEID,"type"=>2])->find();
|
$gzt = $GztModel->where(['id'=>$params["id"],"wareHouseId"=>$WAREHOUSEID,"type"=>2])->find();
|
||||||
if(!$gzt){
|
if(!$gzt){
|
||||||
|
\think\Log::error("[gzt_bind] 工作台不存在或类型错误: id={$params['id']} wareHouseId={$WAREHOUSEID}");
|
||||||
$this->error("工作台不存在,或工作台是团购类型");
|
$this->error("工作台不存在,或工作台是团购类型");
|
||||||
}
|
}
|
||||||
$sid = $this->redis->get("bindcode_".$params["code"]);
|
$sid = $this->redis->get("bindcode_".$params["code"]);
|
||||||
$sid2 = $this->redis->get("gzt_".$gzt["id"]);
|
$sid2 = $this->redis->get("gzt_".$gzt["id"]);
|
||||||
if(!$sid){
|
if(!$sid){
|
||||||
|
\think\Log::error("[gzt_bind] 无记录或二维码已失效: code={$params['code']} gzt_id={$gzt['id']}");
|
||||||
$this->error('无记录或二维码已失效');
|
$this->error('无记录或二维码已失效');
|
||||||
}else{
|
}else{
|
||||||
$uuid = Random::uuid();
|
$uuid = Random::uuid();
|
||||||
@ -341,6 +344,10 @@ class Wms extends Api
|
|||||||
$options = [];
|
$options = [];
|
||||||
$urlEncodedString = http_build_query($requsetData);
|
$urlEncodedString = http_build_query($requsetData);
|
||||||
$req = Http::sendRequest($url, $urlEncodedString, 'POST', $options);
|
$req = Http::sendRequest($url, $urlEncodedString, 'POST', $options);
|
||||||
|
\think\Log::error("[gzt_bind] binded 请求结果: " . json_encode($req, JSON_UNESCAPED_UNICODE));
|
||||||
|
if(!$req['ret']){
|
||||||
|
\think\Log::error("[gzt_bind] binded 发送失败: " . json_encode($req, JSON_UNESCAPED_UNICODE));
|
||||||
|
}
|
||||||
if($sid2){
|
if($sid2){
|
||||||
$requsetData = [
|
$requsetData = [
|
||||||
'sid'=>$sid2,
|
'sid'=>$sid2,
|
||||||
@ -349,6 +356,10 @@ class Wms extends Api
|
|||||||
];
|
];
|
||||||
$urlEncodedString = http_build_query($requsetData);
|
$urlEncodedString = http_build_query($requsetData);
|
||||||
$req = Http::sendRequest($url, $urlEncodedString, 'POST', $options);
|
$req = Http::sendRequest($url, $urlEncodedString, 'POST', $options);
|
||||||
|
\think\Log::error("[gzt_bind] cheakBind 请求结果: " . json_encode($req, JSON_UNESCAPED_UNICODE));
|
||||||
|
if(!$req['ret']){
|
||||||
|
\think\Log::error("[gzt_bind] cheakBind 发送失败: " . json_encode($req, JSON_UNESCAPED_UNICODE));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$this->success('绑定成功');
|
$this->success('绑定成功');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user