123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475 |
- <?php defined('BASEPATH') OR exit('No direct script access allowed');
- class Aay extends Start_Controller {
- public function __construct(){
- parent::__construct();
- $this->load->_model('Model_shop','shop');
- $this->load->_model('Model_fullorder','fullorder');
- $this->load->_model('Model_fullordertt','fullordertt');
- $this->load->_model('Model_fullordersmt','fullordersmt');
- $this->load->_model('Model_fullorder_2020','fullorder2020');
- $this->load->_model('Model_fullordersmt_2020','fullordersmt2020');
- $this->load->_model('Model_customersmt','customersmt');
- $this->load->_model('Model_country','country');
- $this->load->_model('Model_hl','hl');
- $this->load->_model('Model_is','is');
- $this->load->_model('Model_kdniao','kdniao');
- $this->load->_model('Model_typeclass','typeclass');
- $this->load->_model('Model_warehouse','warehouse');
- $this->load->_model('Model_fullorderexcel','fullorderexcel');
- $this->load->_model('Model_dhl','dhl');
- $this->load->_model('Model_usps','usps');
- $this->load->_model('Model_dhltest','dhltest');
- $this->load->_model('Model_customer','customer');
- $this->load->_model('Model_express','express');
- $this->load->_model('Model_notice','notice');
- $this->load->_model('Model_whlabel','whlabel');
- $this->load->_model('Model_productdescribe','productdescribe');
- $this->load->_model('Model_ljg','ljg');
- $this->load->_model('Model_commodityread','commodityread');
- $this->load->_model('Model_service','service');
- $this->load->_model('Model_fedex','fedex');
- $this->load->_model('Model_commodity','commodity');
- $this->load->_model('Model_fullordersmtorder','fullordersmtorder');
- $this->load->_model('Model_ali','ali');
- $this->load->_model('Model_fullordersmthb','fullordersmthb');
- $this->load->_model('Model_fullordersmtbf','fullordersmtbf');
- $this->load->_model('Model_taxzhengzhou','taxzhengzhou');
- $this->load->_model('Model_taxshanghai','taxshanghai');
- $this->load->_model('Model_excel','excel');
- $this->load->_model('Model_ups','ups');
- $this->load->_model('Model_dpd','dpd');
- $this->load->_model('Model_dpdold','dpdold');
- $this->load->_model('Model_dpd_IOSS','dpd_IOSS');
- $this->load->_model('Model_dpdxw','dpdxw');
- $this->load->_model('Model_cne','cne');
- $this->load->_model('Model_outbound','outbound');
- $this->load->_model('Model_api','api');
- $this->load->_model('Model_dhlhz','dhlhz');
- $this->load->_model('Model_apismt','apismt');
- $this->load->_model('Model_specialstock','specialstock');
- $this->load->_model('Model_systemwigsout','systemwigsout');
- $this->load->_model('Model_purchaseorder','purchaseorder');
- $this->load->_model('Model_returns','returns');
- $this->load->_model('Model_whlabellabel','whlabellabel');
- $this->load->_model('Model_whlabelbarcode','whlabelbarcode');
- $this->load->_model('Model_tjadd','tjadd');
- $this->load->_model('Model_stafflist','stafflist');
- $this->load->_model('Model_paypal','paypal');
- $this->load->_model('Model_warehousefactory','warehousefactory');
- $this->load->_model('Model_commodityread_del','commodityreaddel');
- $this->load->_model('Model_als','als');
- $this->load->_model('Model_allocation','allocation');
- $this->load->_model('Model_17track','17track');
- $this->load->_model('Model_hualei','hualei');
- $this->load->_model('Model_ck','ck');
- $this->load->_model('Model_colour','colour');
- $this->load->_model('Model_color','color');
- $this->load->_model('Model_emaildata','emaildata');
- $this->load->_model('Model_wigprint','wigprint');
- $this->load->_model('Model_weight','weight');
- $this->load->_model('Model_whlabeltransport','whlabeltransport');
- $this->load->_model('Model_pay','pay');
- $this->load->_model('Model_orderurl','orderurl');
- $this->load->_model('Model_classid','classid');
- $this->load->_model('Model_apiyy','apiyy');
- $this->load->_model('Model_purchase','purchase');
- $this->load->_model('Model_apitt','apitt');
- }
- //定义方法的调用规则 获取URI第二段值
- public function _remap($arg,$arg_array)
- {
- if($arg == 'a')
- {
- $this->_a($arg_array);
- }
- else if($arg == 'b')
- {
- $this->_b($arg_array);
- }
- else if($arg == 'rk')
- {
- $this->_rk($arg_array);
- }
- else if($arg == 'dc')
- {
- $this->_dc($arg_array);
- }
- }
-
-
- public function _dc($arg_array)
- {
- $data = $this->fullorder->get_number($arg_array[0]);
- $classid = $this->classid->sku();
- $tc = $this->typeclass->find_all();
- $typeclass = array();
- foreach ($tc as $v)
- {
- $tcjm[$v['id']] = array($v['jm'],$v['classid']);
- $typeclass[$v['id']] = array('zh'=>$v['zh'],'classid'=>$v['classid'],'bm'=>$v['bm'],'title'=>$v['title'],'jm'=>$v['jm']);
- }
- $bm = '03';
- $xysc = array();
- $data['lh'] = array();
- $scid = '';$cw = '';$lc = 0;
- $sku = explode(';',trim($data['fpdata'],';'));
- $whlabelsc = explode('|',trim($data['whlabel'],'|'));
- $cs = array();
- foreach($sku as $key=>$val)
- {
- $pm = $classid;
- $jm = $classid;
- $bmpx = array(13=>'',16=>'',18=>'',25=>'',26=>'',41=>'');
- $features = str_replace(array('-163-','-164-','-165-','-166-'),'-',$val);
- $ts = explode('|',trim($features,'|'));
- if(stripos($ts[0],',') !== false)
- {
- $ft = explode(',',$ts[0]);
- $features = explode('-',trim($ft[1],'-'));
- $features[] = $ft[0];
- }
- else
- {
- $features = explode('-',trim($ts[0],'-'));
- }
- foreach($features as $k=>$v)
- {
- if(isset($typeclass[$v]) && isset($bmpx[$typeclass[$v]['classid']]))
- {
- if($typeclass[$v]['bm'] != '')
- {
- $bmpx[$typeclass[$v]['classid']] = $typeclass[$v]['bm'];
- }
- }
- if($v != 0)
- {
- if(isset($pm[$typeclass[$v]['classid']]))
- {
- if($typeclass[$v]['title'] == '9A')
- {
- $pm[$typeclass[$v]['classid']] = '9A';
- }
- else if($typeclass[$v]['title'] == '10A')
- {
- $pm[$typeclass[$v]['classid']] = '10A';
- }
- else
- {
- $clzh = $typeclass[$v]['zh'];
- if(stripos($typeclass[$v]['zh'],'|') !== false)
- {
- $clzh = explode('|',rtrim($typeclass[$v]['zh'],'|'));
- $clzh = $clzh[0];
- }
- $pm[$typeclass[$v]['classid']] = $clzh;
- }
- }
- if(isset($jm[$typeclass[$v]['classid']]))
- {
- if($typeclass[$v]['jm'])
- {
- $jm[$typeclass[$v]['classid']] = $typeclass[$v]['jm'];
- }
- }
- }
- }
- $cs[] = array($bmpx,$jm);
- $jm = array_filter($jm);
- $jm = implode("-",$jm);
- $pm = array_filter($pm);//去除空值
- $zh = implode(" ",$pm);
- $zh = preg_replace("/\r\n|\r|\n/",'',trim($zh,' '));
- $data['lh'][] = array('sku'=>$jm,'ts'=>$ts[2]);
- }
- echo "<pre>";
- print_r($cs);
- echo "<pre>";
- print_r($sku);
- }
-
- public function _rk($arg_array)
- {
-
- $a = $this->fullorder->get_number($arg_array[0]);
-
- $classid = $this->classid->sku();
- $tcall = $this->typeclass->find_all();
- $apiyy = $a;
- $shop = $this->shop->read($a['shop']);
- @$ay = $this->apiyy->_order($apiyy,$classid,$tcall);
-
- echo "<pre>";
- print_r($ay);
- echo "<pre>";
- print_r($a);
- echo "<pre>";
- print_r($shop);
- exit;
- }
-
-
- public function _b()
- {
- $data = $this->fullorder->get_number('Alipearl-70419-001');
- echo "<pre>";
- print_r($data);
- exit;
-
- $data = $this->fullorder->get_number('KISS-30929-094');
- $data['dtime'] = time();
- $classid = $this->classid->sku();
- $tc = $this->typeclass->find_all();
-
-
- $error = '';
- $typeclass = array();
- foreach ($tc as $v)
- {
- $tcjm[$v['id']] = array($v['jm'],$v['classid']);
- $typeclass[$v['id']] = array('zh'=>$v['zh'],'classid'=>$v['classid'],'bm'=>$v['bm'],'title'=>$v['title'],'jm'=>$v['jm']);
- }
- $pm = $classid;
- $jm = $classid;
- $bm = '03';
- $bmpx = array(13=>'',16=>'',18=>'',25=>'',26=>'',41=>'');
- $data['lh'] = array();$sc = array();
- $sku = explode(';',trim($data['fpdata'],';'));
- $whlabelsc = explode('|',trim($data['whlabel'],'|'));
- foreach($sku as $key=>$val)
- {
- $features = str_replace(array('-163-','-164-','-165-','-166-'),'-',$val);
- $ts = explode('|',trim($features,'|'));
- if(stripos($ts[0],',') !== false)
- {
- $ft = explode(',',$ts[0]);
- $features = explode('-',trim($ft[1],'-'));
- $features[] = $ft[0];
- }
- else
- {
- $features = explode('-',trim($ts[0],'-'));
- }
- foreach($features as $k=>$v)
- {
- if(isset($typeclass[$v]) && isset($bmpx[$typeclass[$v]['classid']]))
- {
- if($typeclass[$v]['bm'] != '')
- {
- $bmpx[$typeclass[$v]['classid']] = $typeclass[$v]['bm'];
- }
- }
- if($v != 0)
- {
- if(isset($pm[$typeclass[$v]['classid']]))
- {
- if($typeclass[$v]['title'] == '9A')
- {
- $pm[$typeclass[$v]['classid']] = '9A';
- }
- else if($typeclass[$v]['title'] == '10A')
- {
- $pm[$typeclass[$v]['classid']] = '10A';
- }
- else
- {
- $clzh = $typeclass[$v]['zh'];
- if(stripos($typeclass[$v]['zh'],'|') !== false)
- {
- $clzh = explode('|',rtrim($typeclass[$v]['zh'],'|'));
- $clzh = $clzh[0];
- }
- $pm[$typeclass[$v]['classid']] = $clzh;
- }
- }
- if(isset($jm[$typeclass[$v]['classid']]))
- {
- $jm[$typeclass[$v]['classid']] = $typeclass[$v]['jm'];
- }
- }
- }
- $jm = array_filter($jm);//去除空值
- $pm = array_filter($pm);//去除空值
- $zh = implode(" ",$pm);
- $zh = preg_replace("/\r\n|\r|\n/",'',trim($zh,' '));
- $data['lh'][] = array('sku'=>implode("-",$jm),'ts'=>$ts[2]);
- $lh = $this->apiyy->get_cjlp(array('sku'=>implode("-",$jm),'title'=>$ts[1],'zh'=>$zh,'bm'=>$bm.implode("",$bmpx)));
- $sfsc = explode('-',$whlabelsc[$key]);
- if($sfsc[2] == 'DNOTO')
- {
- $sc[] = $this->apiyy->get_sc(array('sku'=>implode("-",$jm),'title'=>$ts[1],'id'=>$data['id']));
- }
- }
- if($error)
- {
- return array('c'=>1,'error'=>$error,'lx'=>'料号','number'=>$data['number']);exit;
- }
- $a = $this->apiyy->get_order($data);
- if($a == 1)
- {
- return array('c'=>0);exit;
- }
- echo "<pre>";
- print_r($a);
- echo "<pre>";
- print_r($sc);
- echo "<pre>";
- print_r($lh);
- echo "<pre>";
- exit;
- }
-
- public function _bsd($arg_array)
- {
-
- exit;
-
- $post = $this->fullorder->get_number($arg_array[0]);
- $classid = $this->classid->sku();
- $tcall = $this->typeclass->find_all();
- $ay = $this->apiyy->_order($post,$classid,$tcall);
- if($ay['c'] == 1)
- {
- $this->apiyy->insert(array('number'=>$ay['number'],'lx'=>$ay['lx'],'error'=>$ay['error']));
- }
- print_r($a);
- /**
- $a = $this->apiyy->get_cjlp(array('sku'=>'9A-#color25-wavy25-5*5Bob-14-180%-M','title'=>'Wigs 9A #color25 wavy25 5*5 Bob Wig Medium 180% 14inch ','zh'=>'9A 5*5波波头套 14寸 (180%密度) (中号)'));
- echo "<pre>";
- print_r($a);
- exit;
- $tc = $this->typeclass->find_all();
- $typeclass = array();
- foreach ($tc as $v)
- {
- $this->typeclass->save(array('yzh'=>$v['zh']),$v['id']);
- }
- **/
- exit;
-
- $s = $this->fullorder->get_number($arg_array[0]);
- $a = $this->apiyy->get_chd($s);
- echo "<pre>";
- print_r($a);
- exit;
- }
- public function _a($arg_array)
- {
- $list["SqlString"] = "select a.id,a.code,c.name,a.org,b.name org_name from CBO_Wh a left join CBO_Wh_trl c on c.id=a.id left join Base_Organization_trl b on a.org=b.id";
- $list = json_encode($list);
- $token = $this->setting->get_yytoken_101();
- $url = 'http://172.31.105.167/U9C/webapi/QueryCommon/QueryInfoBySql';
- $header[] = "Content-Type: application/json";
- $header[] = "Token: ".$token;
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
- curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $list);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- $res = curl_exec($ch);
- $res = json_decode($res,true);
-
- echo "<pre>";
- print_r($res);
- exit;
- $tc = $this->typeclass->find_all();
- $typeclass = array();
- foreach ($tc as $v)
- {
- $tcjm[$v['id']] = array($v['jm'],$v['classid']);
- $typeclass[$v['id']] = array('zh'=>$v['zh'],'classid'=>$v['classid'],'bm'=>$v['bm'],'title'=>$v['title'],'jm'=>$v['jm']);
- }
- //$s = $this->fullorder->find_all('1=1','*','id desc',100,103);
- $s = $this->fullorder->get_number($arg_array[0]);
- $classid = $this->classid->sku();
- $pm = $classid;
- $jm = $classid;
- $bm = '03';
- $bmpx = array(13=>'',16=>'',18=>'',25=>'',26=>'',41=>'');
- $s['lh'] = array();
- $sku = explode(';',trim($s['fpdata'],';'));
- foreach($sku as $val)
- {
- $features = str_replace(array('-163-','-164-','-165-','-166-'),'-',$val);
- $ts = explode('|',trim($features,'|'));
- if(stripos($ts[0],',') !== false)
- {
- $ft = explode(',',$ts[0]);
- $features = explode('-',trim($ft[1],'-'));
- $features[] = $ft[0];
- }
- else
- {
- $features = explode('-',trim($ft[1],'-'));
- }
- foreach($features as $k=>$v)
- {
- if(isset($typeclass[$v]) && isset($bmpx[$typeclass[$v]['classid']]))
- {
- if($typeclass[$v]['bm'] != '')
- {
- $bmpx[$typeclass[$v]['classid']] = $typeclass[$v]['bm'];
- }
- }
- if($v != 0)
- {
- if(isset($pm[$typeclass[$v]['classid']]))
- {
- if($typeclass[$v]['title'] == '9A')
- {
- $pm[$typeclass[$v]['classid']] = '9A';
- }
- else if($typeclass[$v]['title'] == '10A')
- {
- $pm[$typeclass[$v]['classid']] = '10A';
- }
- else
- {
- $clzh = $typeclass[$v]['zh'];
- if(stripos($typeclass[$v]['zh'],'|') !== false)
- {
- $clzh = explode('|',rtrim($typeclass[$v]['zh'],'|'));
- $clzh = $clzh[0];
- }
- $pm[$typeclass[$v]['classid']] = $clzh;
- }
- }
- if(isset($jm[$typeclass[$v]['classid']]))
- {
- $jm[$typeclass[$v]['classid']] = $typeclass[$v]['jm'];
-
- }
- }
- }
- $jm = array_filter($jm);//去除空值
- $pm = array_filter($pm);//去除空值
- $zh = implode(" ",$pm);
- $zh = preg_replace("/\r\n|\r|\n/",'',trim($zh,' '));
- $s['lh'][] = array('sku'=>implode("-",$jm),'ts'=>$ts[2]);
- $lh = $this->apiyy->get_cjlp(array('sku'=>implode("-",$jm),'title'=>$ts[1],'zh'=>$zh,'bm'=>$bm.implode("",$bmpx)));
- if(!isset($lh['Data'][0]) || $lh['Data'][0]['m_isSucess'] != 1)
- {
- if($lh['Data'][0]['m_errorMsg'] == '料号 已存在,请重新输入!')
- {
- continue;
- }
- else
- {
- print_r($lh);exit;
- }
- }
- }
- $a = $this->apiyy->get_order($s);
- echo "<pre>";
- print_r($a);
- echo "<pre>";
- print_r(array('sku'=>implode("-",$jm),'title'=>$ts[1],'zh'=>$zh,'bm'=>$bm.implode("",$bmpx)));
- exit;
- }
- }
|