Files
OMS/app/taoguaniostockorder/lib/diff/process.php
2025-12-28 23:13:25 +08:00

78 lines
1.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
/**
* 差异定责
*
* @package default
* @author chenping@shopex.cn
* @version Sun Apr 3 20:17:03 2022
**/
class taoguaniostockorder_diff_process
{
/**
* 流程b2s仓发店s2b店退仓s2s店转店b2b仓转仓
*
* @var string
* */
private $_flow;
/**
* 原因less短发more超发wrong错发lost丢失
*
* @var string
* */
private $_reason;
/**
* 责任方branch仓库store门店logistics物流
*
* @var string
* */
private $_responsible;
/**
* __construct
* @param mixed $args args
* @return mixed 返回值
*/
public function __construct($args)
{
$this->_flow = $args['flow'];
$this->_reason = $args['reason'];
$this->_responsible = $args['responsible'];
}
/**
* 定则入口
* @param array $data
* @return void
* @author
**/
public function rulerule($data)
{
try {
$object = kernel::single('taoguaniostockorder_diff_process_' . $this->_responsible);
if (!($object instanceof taoguaniostockorder_diff_process_abstract)) {
return [false, '差异处理类必须继承父类'];
}
$method = $this->_flow . ucfirst($this->_reason);
if (!method_exists($object, $method)) {
return [false, '差异处理类缺少处理[' . $method . ']场景'];
}
return call_user_func_array(array($object, $method), array($data));
} catch (Exception $e) {
return [false, $e->getMessage()];
}
}
}