|
@@ -110,27 +110,29 @@ class Cabinet extends Base
|
|
|
json_success($result);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- public function OpenBoxR($params){
|
|
|
- if($params['code'] == 0){
|
|
|
- $this->box_action_record($params['cabinet_code'] , $params['box_position_list'][0] , 1);
|
|
|
- }else{
|
|
|
- json_error(2000,$params['msg']);
|
|
|
- }
|
|
|
- }
|
|
|
/**
|
|
|
- * 关闭箱门
|
|
|
+ * 锁柜
|
|
|
*/
|
|
|
- public function LockBox()
|
|
|
+ public function LockCabinet()
|
|
|
{
|
|
|
- $params['cabinet_number'] = input('param.cabinet_number');
|
|
|
- $params['box_number '] = input('param.box_number');
|
|
|
+ $params['id'] = $this->getid();
|
|
|
+ $params['cabinet_code'] = input('param.cabinet_number');
|
|
|
|
|
|
- $params = $this->get_cabinet($params['cabinet_number']);
|
|
|
+ $cabinet = $this->get_cabinet($params['cabinet_number']);
|
|
|
+ $params['delay_time'] = 0;
|
|
|
+ if($cabinet == false){
|
|
|
+ return json(json_error_exception('1008'));
|
|
|
+ }
|
|
|
+ $params['ret_queue'] = session_id();
|
|
|
+ $params['req_url'] = $cabinet['req_url'];
|
|
|
+ $params['key'] = $cabinet['login_key'];
|
|
|
+ $params['method'] = 'LockCabinetR';
|
|
|
|
|
|
- $content = $this->proc_request(self::queue_name,'close_box',$params);
|
|
|
- if($content['value'] == 'ok'){
|
|
|
-// $this->change_status($params['cabinet_number'] , $params['box_number'] , 3);
|
|
|
+ $result = $this->proc_request(self::queue_name,'LockCabinet',$params);
|
|
|
+ if($result == false) {
|
|
|
+ json_error(2000);
|
|
|
+ } else {
|
|
|
+ json_success($result);
|
|
|
}
|
|
|
}
|
|
|
|