Merge branch 'feature/trippest'

mobile-first
lyt 6 years ago
commit de2031e472

@ -35,14 +35,16 @@ class Order_finance extends CI_Controller {
// 重新生成账单
// HT批量按钮调用
// 仅读取成本信息计算
public function single_order_report($coli_sn=0, $debug=false)
public function single_order_report($coli_sn=0, $debug=false, $force_action=false )
{
$debug = boolval($debug);
$force_action = boolval($force_action);
$order_info = $this->OrderFinance_model->get_order_info($coli_sn);
if (empty($order_info)) {
return;
}
$report_order_exists = $this->OrderFinance_model->get_report_order($order_info->ordernumber);
if ( ! empty($report_order_exists) && $debug===false) {
if ( ! empty($report_order_exists) && $debug===false && $force_action===false) {
return $this->output->set_content_type('application/json')->set_output(json_encode($report_order_exists));
}
return $this->generate_report($order_info, $debug);
@ -50,15 +52,17 @@ class Order_finance extends CI_Controller {
// 重新生成账单
// HT单团财务表页面调用, 先刷新一次成本
public function single_order_report_refresh($coli_sn=0, $debug=false)
public function single_order_report_refresh($coli_sn=0, $debug=false, $force_action=false)
{
ignore_user_abort(true);
$debug = boolval($debug);
$force_action = boolval($force_action);
// 刷新成本
$controller_name = "TulanduoApi";
require_once($controller_name . '.php');
$vendor_class = new $controller_name();
$ret = $vendor_class->insert_HT_order_operation($coli_sn, null, false);
$this->single_order_report($coli_sn, $debug);
$this->single_order_report($coli_sn, $debug, $force_action);
}
/*!

@ -207,6 +207,8 @@ class Vendor_money extends CI_Controller {
}
// 财务表成本和实际成本不相等
$result['diff_cost'] = $this->money_model->report_tour_diff($start_date, $end_date, implode(',', $vendors));
$this->async_fresh_report($result['diff_cost'], 'gci_no');
$result['diff_cost'] = $this->money_model->report_tour_diff($start_date, $end_date, implode(',', $vendors));
return $this->load->view('vendor_money_sum', $result);
// return $this->output->set_content_type('application/json')->set_output(json_encode($result));
;
@ -323,17 +325,7 @@ class Vendor_money extends CI_Controller {
$xls_data = $this->read_excel($read_path);
unlink($upload_data['upload_data']['full_path']);
$xls_ht_diff = $this->diff_xls_ht_cost($xls_data, $HT_combine_cost);
foreach ($xls_ht_diff['cost_error'] as $kc => $cost_error) {
$colis = $this->get_gci_coli($cost_error['GCI_combineNo'], false);
if (array_sum(array_column($colis['data'], 'no_fresh')) > 0
|| array_sum(array_column($colis['data'], 'cgi_check')) > 0
) {
continue;
}
foreach ($colis['data'] as $kco => $coli) {
async_curl("https://www.mycht.cn/webht.php/apps/trippestOrderSync/order_finance/single_order_report_refresh/" . $coli['COLI_SN'], 2);
}
}
$this->async_fresh_report($xls_ht_diff['cost_error']);
}
if ( ! empty($xls_data)) {
// 批量`重新生成账单`之后, 在对比一次
@ -345,6 +337,27 @@ class Vendor_money extends CI_Controller {
return $this->load->view('order_report_precheck', $ret);
}
/*!
* @Author: LYT: lyt@hainatravel.com
* @Date: 2019-12-06 11:25:16
* @Desc: 批量重新生成账单, 跳过含有其他供应商的和已审核保存的
*/
private function async_fresh_report($gci_nos, $key_name='GCI_combineNo')
{
foreach ($gci_nos as $kc => $gci) {
$colis = $this->get_gci_coli($gci[$key_name], false);
if (array_sum(array_column($colis['data'], 'no_fresh')) > 0
|| array_sum(array_column($colis['data'], 'cgi_check')) > 0
) {
continue;
}
foreach ($colis['data'] as $kco => $coli) {
async_curl("https://www.mycht.cn/webht.php/apps/trippestOrderSync/order_finance/single_order_report_refresh/" . $coli['COLI_SN'] . "/0/1", 2);
}
}
return false;
}
private function diff_xls_ht_cost($xls_data, $HT_combine_cost)
{
$cost_error = array();

Loading…
Cancel
Save