瀏覽代碼

上传部分代码

lvhao 5 月之前
父節點
當前提交
262f6ddddb

+ 108 - 0
core/CoreApp/controllers/Queueu9.php

@@ -0,0 +1,108 @@
+<?php defined('BASEPATH') OR exit('No direct script access allowed');
+/**
+ * 该类执行队列使用
+ */
+class Queueu9 extends Start_Controller {
+    private $url = "http://git.wepolicy.cn/";
+    private $api = 20250217;
+	public function __construct(){
+		parent::__construct();
+		$this->load->_model("Model_zzquque_u9",'zzquque_u9');
+        $this->load->_model("Model_aaconf","aaconf");
+        $this->load->_model("Model_logic_u9xg",'logic_u9xg');
+	}
+    
+    //定义方法的调用规则 获取URI第二段值
+    public function _remap($arg,$arg_array)
+    {
+        $api = $this->input->get('api',true);
+        if($api != $this->api){
+            exit('No direct script access allowed');
+        }
+        if($arg == 'xdls')//执行小单的流转到临时仓的队列
+        {
+            $this->xdls();
+        }
+        if($arg == 'xdlsbe')//执行小单的流转到临时仓的队列
+        {
+            $this->xdlsBeforeSh();
+        }
+        if($arg == 'xdlsaf')//执行小单的流转到临时仓的队列
+        {
+            $this->xdlsAfterSh();
+        }
+        else
+        {
+            $this->_index();
+        }
+    }
+    public function _index(){
+        $this->logic_u9xg->xdlsBeforeCreate([]);
+       
+        exit('No direct script access allowed index'."<br/>");
+    }
+     //执行小单的流转到临时仓的队列  计划10分钟一次
+    public function xdls(){
+        $mh = curl_multi_init();
+ 
+        // 创建多个 cURL 资源
+        $ch1 = curl_init();
+        curl_setopt($ch1, CURLOPT_URL, $this->url."queueu9/xdlsbe?api=".$this->api."&rqyz1=".date("Ymd"));
+        curl_multi_add_handle($mh, $ch1);
+         
+        $ch2 = curl_init();
+        curl_setopt($ch2, CURLOPT_URL, $this->url."queueu9/xdlsaf?api=".$this->api."&rqyz1=".date("Ymd"));
+        curl_multi_add_handle($mh, $ch2);
+         
+        // 执行句柄
+        $running = null;
+        do {
+            $mrc = curl_multi_exec($mh, $running);
+        } while ($mrc == CURLM_OK && $running > 0);
+         
+        // 关闭句柄
+        curl_multi_remove_handle($mh, $ch1);
+        curl_multi_remove_handle($mh, $ch2);
+        curl_multi_close($mh);
+        exit("Queue execution completed"."<br/>");
+    }
+   
+    public function xdlsBeforeSh(){
+        $rqyz = $this->input->get('rqyz',true);
+        if($rqyz != date("Ymd")){
+            exit('No direct script access allowed before'."<br/>");
+        }
+        if(!$this->aaconf->u9xg()){
+            exit('This feature is not available <br/>'); 
+        }
+        //10 代表了是小单   type类型可在model中的getType()查看到
+        $list = $this->zzquque_u9->find_all("type = 10 and status = 0 and sh_flag = 0","*",null,0,100);
+        if(empty($list)){
+            exit("No data to be executed at the moment <br/>");
+        }
+        foreach($list as $k=>$v){
+            $this->xdlsBeforeShDetail($v);
+        }
+        exit("Data execution completed <br/>");
+
+    }
+
+    public function xdlsBeforeShDetail($info){
+      
+    }   
+
+    public function xdlsAfterSh(){
+        $rqyz = $this->input->get('rqyz',true);
+        if($rqyz != date("Ymd")){
+            exit('No direct script access allowed after'."<br/>");
+        }
+        if(!$this->aaconf->u9xg()){
+            exit('This feature is not available'); 
+        }
+        //10 代表了是小单   type类型可在model中的getType()查看到
+        $list = $this->zzquque_u9->find_all("type = 10 and status =  1 and sh_flag = 1 and sh_status = 0","*",null,0,100);
+        if(empty($list)){
+            exit("No data to be executed at the moment");
+        }
+    }
+}

+ 14 - 0
core/CoreApp/models/Model_aaconf.php

@@ -0,0 +1,14 @@
+<?php
+/**
+ * 此类是记录一些常用的配置数据
+ * */
+class Model_aaconf extends Lin_Model {
+    
+    function __construct(){
+		parent::__construct();
+    } 
+    //判断香港和u9系统对接功能是否上线
+    public function u9xg(){
+        return true;
+    }
+}

+ 1 - 1
core/CoreApp/models/Model_apiyy.php

@@ -171,7 +171,7 @@ class Model_apiyy extends Lin_Model
 		return $res;
 	}
 	
-	public function get_lpxf($data)//传递料品
+	public function get_lpxf($data)//传递料品   也可以叫做档案下发  但是档案下发是啥意思 我不太懂
 	{
 		$list["0"]["EntityFullName"] = 'UFIDA.U9.CBO.SCM.Item.ItemMaster';
         $list["0"]["EntityCode"] = $data['jm'];//料号,SKU

+ 377 - 0
core/CoreApp/models/Model_apiyyv1.php

@@ -0,0 +1,377 @@
+<?php
+/**
+ * 为防后期调用u9接口复用问题这里决定重新封装apiyy的接口
+ */
+class Model_apiyyv1 extends Lin_Model 
+{
+
+	public $base_url = "http://172.31.105.167";
+	function __construct(){
+		parent::__construct();
+		$this->load->database();
+		$this->table = 'apiyy';
+		$this->load_table('apiyy');
+	}
+    /**
+	 * 生成u9的调出单  
+	 */
+	public function dcdCrate($params,$token){
+		$list = $this->dcDataTrans($params);
+		$list = json_encode($list);
+		$url = '/U9C/webapi/TransferOut/Create';
+		$url = $this->base_url.$url;
+		$header[] = "Content-Type: application/json";
+        $header[] = "Token: ".$token;
+		$res = $this->sendReq($url,$header,$list);
+		return array($res,$list);
+	}
+	/**
+	 * 提交调出单
+	 */
+	public function dcdSubmit($params,$token){
+		$list  = [
+			[
+				'Code'=>$params['number'] //调出单单号
+			]
+		];
+		$url = '/U9C/webapi/TransferOut/Submit';
+		$url = $this->base_url.$url;
+		$header[] = "Content-Type: application/json";
+        $header[] = "Token: ".$token;
+		$res = $this->sendReq($url,$header,$list);
+		return array($res,$list);
+	}
+	/**
+	 * 审核调出单
+	 */
+	public function dcdApprove($params,$token){
+		$list  = [
+			[
+				'Code'=>$params['number'] //调出单单号
+			]
+		];
+		$url = '/U9C/webapi/TransferOut/Approve';
+		$url = $this->base_url.$url;
+		$header[] = "Content-Type: application/json";
+        $header[] = "Token: ".$token;
+		$res = $this->sendReq($url,$header,$list);
+		return array($res,$list);
+	}
+	/**
+	 * 生成u9的销售单
+	 * 只是财务记录 不牵扯到库存
+	 */
+	public function xsdCreate($params,$token){
+		$list = $this->xsdDataTrans($params);
+		$list = json_encode($list);
+		$url = '/U9C/webapi/SO/Create';
+		$url = $this->base_url.$url;
+		$header[] = "Content-Type: application/json";
+        $header[] = "Token: ".$token;
+		$res = $this->sendReq($url,$header,$list);
+		return array($res,$list);
+	}
+	/**
+	 * 销售单提交
+	 */
+	public function xsdSubmit($params,$token){
+		$list  = [
+			[
+				'Code'=>$params['number'] //单号
+			]
+		];
+		$url = '/U9C/webapi/SO/Submit';
+		$url = $this->base_url.$url;
+		$header[] = "Content-Type: application/json";
+        $header[] = "Token: ".$token;
+		$res = $this->sendReq($url,$header,$list);
+		return array($res,$list);
+	}
+	 /**
+	  * 销售单审核
+	  */
+	  public function xsdApprove($params,$token){
+		$list  = [
+			[
+				'Code'=>$params['number'] //单号
+			]
+		];
+		$url = '/U9C/webapi/SO/Approve';
+		$url = $this->base_url.$url;
+		$header[] = "Content-Type: application/json";
+        $header[] = "Token: ".$token;
+		$res = $this->sendReq($url,$header,$list);
+		return array($res,$list);
+	}
+	/**
+	 * 生成u9的采购单
+	 * 只是财务记录 不牵扯到库存
+	 * 目前采用的是无源的
+	 */
+	public function cgdCreate($params,$token){
+		$list = $this->cgdDataTrans($params);
+		$list = json_encode($list);
+		$url = '/U9C/webapi/PurchaseOrder/Create';
+		$url = $this->base_url.$url;
+		$header[] = "Content-Type: application/json";
+        $header[] = "Token: ".$token;
+		$res = $this->sendReq($url,$header,$list);
+		return array($res,$list);
+	}
+	/**
+	 * 采购单提交
+	 */
+	public function cgdSubmit($params,$token){
+		$list  = [
+			[
+				'Code'=>$params['number'] //单号
+			]
+		];
+		$url = '/U9C/webapi/PurchaseOrder/Submit';
+		$url = $this->base_url.$url;
+		$header[] = "Content-Type: application/json";
+        $header[] = "Token: ".$token;
+		$res = $this->sendReq($url,$header,$list);
+		return array($res,$list);
+	}
+	 /**
+	  * 采购单审核
+	  */
+	  public function cgdApprove($params,$token){
+		$list  = [
+			[
+				'Code'=>$params['number'] //单号
+			]
+		];
+		$url = '/U9C/PurchaseOrder/Approve';
+		$url = $this->base_url.$url;
+		$header[] = "Content-Type: application/json";
+        $header[] = "Token: ".$token;
+		$res = $this->sendReq($url,$header,$list);
+		return array($res,$list);
+	}
+	/**
+	 * 生成u9的标准出货单
+	 * 会造成库存变动
+	 * 使用的是有源的就是销售单
+	 */
+	public function bzchCreate($params,$token){
+		$list = $this->yybzchDataTrans($params);
+		$list = json_encode($list);
+		$url = '/U9C/webapi/Ship/CreateBySrcDoc';
+		$url = $this->base_url.$url;
+		$header[] = "Content-Type: application/json";
+        $header[] = "Token: ".$token;
+		$res = $this->sendReq($url,$header,$list);
+		return array($res,$list);
+
+	}
+
+	/**
+	 * 标准出货单提交并审核
+	 */
+	public function bzchSubmitAndApprove($params,$token){
+		$list  = [
+			[
+				'Code'=>$params['number'] //单号
+			]
+		];
+		$url = '/U9C/webapi/Ship/SubmitAndApprove';
+		$url = $this->base_url.$url;
+		$header[] = "Content-Type: application/json";
+        $header[] = "Token: ".$token;
+		$res = $this->sendReq($url,$header,$list);
+		return array($res,$list);
+	}
+	/**
+	 * 生成u9的标准收获单
+	 * 会造成库存变动
+	 * 这个也是有源的是采购单  不过估计用不上   先不写
+	 */
+	public function bzshCreate($params,$token){
+
+	}
+
+
+
+	public function sendReq($url,$header,$list){
+		$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);
+		return $res;
+	}
+
+	//调出单的数据转化
+	public function dcDataTrans($params){
+		$trans_out_lines = [];
+		foreach($params['list'] as $k=>$v){
+			$trans_out_lines[] = [
+				"ItemInfo" =>[
+					"ItemCode"=>$v['jm'],//用友的简码
+				],
+				"TransOutWh_Code"=>$v['dcckbm'],//调出仓库编码
+				"StoreUOM_Code"=>"条",//调出库存单位Code  如条
+				"StoreUOMQty"=>$v['dcsl'],//调出数量
+				"StorageType"=>4,//存储类型:待检;1:在检;2:不合格;3:报废;4:可用;5:冻结;6:退回;7:待返工
+				"LotInfo_Code"=>"",//批号Code   不知道有啥用 暂时留空吧
+				"TransOutOwnerOrg_Code"=>$params['owner_code'],//货主组织Code
+				"DescFlexField"=>[
+					"PubDescSeg2"=>$params['yyid'],//来源店铺  这种需要在店铺表中有
+					"PubDescSeg4"=>$params['number'],//订单编码
+					"PubDescSeg5"=>$params['shipremarks'],//订单的备注
+				],
+				"TransOutSubLines"=>[
+					[
+						'TransInWh_Code'=>$params['dczzbm'],//调入仓库编码
+						'StorageType'=>4,//存储类型:待检;1:在检;2:不合格;3:报废;4:可用;5:冻结;6:退回;7:待返工
+						'TransInOrg_Code'=>$params['drzz_code'],//调入组织Code
+						'TransOutOwnerOrg_Code'=>$params['owner_code'],//货主组织Code
+						'StoreUOMQty'=>$v['dcsl'],
+					]
+				],
+				"TransOutBins"=>[
+					[
+						'BinInfo_Code'=>'',//库位Code
+						'StoreUOMQty'=>1//	分配数量
+					]
+				]
+			];
+			
+		}
+		$data = [];
+		$data[] = [
+			"OtherID"=>$params['number'],//第三方数据唯一性标识,此字段需要返回
+			"TransOutDocType_Code"=> $params['TransOutDocType_Code'],//单据类型在u9中设置的 详情到u9界面查看  TransOut001  组织间调拨  TransOut002 仓库转储  TransOut004 委外加工发料  TransOut005  委外加工退料
+			"BusinessDate"=>date("Y-m-d",$params['time']),//日期
+			"TransferDirection"=>$params['TransferDirection'],//调拨方向 0:普通;1:退货
+			"TransOutLines"=>$trans_out_lines,
+		];
+		return $data;
+	}
+	//销售单的数据转化
+	public function xsdDataTrans($params){
+		$so_lines = [];
+		foreach($params['list'] as $k=>$v){
+			
+			$so_lines[] = [
+				'TU'=>"条",//销售单位编码
+				'ItemCode'=>"",//用友的编码
+				'PU'=>'条',//计价单位编码
+				"ShipTogetherFlag"=>-1,//成套收发货标志
+				'DocLineNo'=>$k+1,
+				'CustomerItemNo'=>'',//客户料号
+				'CustomerItemName'=>'',//客户品名 
+				'FinallyPriceTC'=>$v['final_price'],//最终价  单价
+				'PubDescSeg10'=>'',
+				'SOShiplineDTOList'=>[  //销售订单计划行
+					[
+						'IsMRPRequire',  //MRP需求
+						'DemandType',//需求分类
+						'RequireDate'=>date('m/d/Y H:i:s',$v['dtime']),
+					]
+				],
+				'RecTerm'=>'',//目前找不到了
+				'FreeType'=>'',//免费品类型 (无默认值请传-1;赠品请传0;备损品请传1)   徐凯设定的是  如果钱小于0.01  那么就传0 其他的传递-1
+				'UsableQtyOfInv'=>0,//文档中未查询到
+				'PubDescSeg3'=>'',
+				'PubDescSeg4'=>'',
+				'PriceList'=>'',//价表编码 (该属性可为空,且无默认值)
+				'TaxMoneyTC'=>0,//税额 (该属性可为空,且无默认值)
+				'TaxSchedule'=>'YZ05',//税组合编码 (该属性可为空,且无默认值)  不知道这个是啥 徐凯的老代码是这么写的
+				'DescFlexField'=>[
+					'PubDescSeg3'=>'',
+				],
+				'OrderByQtyTU'=>'',//销售数量 (该属性可为空,且无默认值)
+				'OrderByQtyPU'=>'',//计价数量 (该属性可为空,且无默认值)
+				'OrderPriceTC'=>'',//定价 (该属性可为空,且无默认值)
+				'Memo'=>'',//备注
+			];
+		}
+		$data = [];
+		$data[] = [
+			"OrderBy"=>$params['yyid'],//用友的商户的id
+			"OtherID"=>$params['number'],//第三方传入ID
+			"SaleDepartment"=>"",//部门编码  可为空
+			"DocumentType"=>"SO1",//单据类型编码  标准销售单  So1是默认值
+			"DocNo"=>"",//单据类型编码
+			"AC"=>"C009",//美金
+			"TC"=>"C009",//美金
+			"ShipToSite"=>"",//收货位置编码
+			"PubDescSeg2"=>"",
+			"SOSrcType"=>0,
+			"Seller"=>"",//业务员编码  可为空
+			"ConfirmTerm"=>"",//但是现有文档没有
+			"Memo"=>"",//备注
+			"ShipRule"=>"",//但是现有文档没有
+			"SOLineDTOList"=>$so_lines,
+		];
+		return $data;
+	}
+
+	public function cgdDataTrans($params){
+		$po_lines = [];
+		foreach($params['list'] as $k=>$v){
+			$po_lines[] = [
+				//"POLineID"=>0,//采购订单行ID
+				'ItemInfo'=>[
+					'm_code'=>'',//用友料号
+				],
+				"ReqQtyTU"=>'',//需求数量
+				"ReqQtyTBU"=>0,//确认数量
+				"SupplierConfirmQtyTU"=>'',//确认数量
+				"SupplierConfirmQtyTBU"=>'',//确认数量
+				"FinallyPriceTC"=>'',//最终价格
+				"IsPresent"=>false,//赠品
+				
+			];
+			
+		}
+		$data = [];
+		$data[] = [
+			'DocNo'=>"",
+			"DocumentType"=>'PO01',//PO01  标准采购默认值
+			'BizType'=>0,//业务类型:AR_Invoice 销售发票 0 (默认值),PM005 标准采购 316 ,PM055 全程委外采购 326 ,PM050 工序外协采购 325
+			"BusinessDate"=>date("Y-m-d H:i:s"),
+			'OtherID'=>"",
+			'DescFlexField'=>[],
+			'Supplier'=>[
+				'Code'=>'',//供应商编码  到时间找下
+			],
+			'IsPriceIncludeTax'=>false,
+			"POLineDTOList"=>$po_lines
+		];
+		return $data;
+	}
+
+	public function yybzchDataTrans($params){
+		$data = [];
+		foreach($params['list'] as $k=>$v ){
+			$data[] = [
+				"SrcDocType"=>1,//售订单 Value:1 出货计划 Value:2 销售合同 Value:3 预出货单 Value:4
+				"SrcDocNo"=>'',//来源单号
+				//"SrcDocLineNo"=>,
+				//"SrcDocSubLineNo",
+				"WH"=>'',//存储地点ID
+				"CurShipQty1"=>'',//本次出货量
+				"SOIsConsign"=>false,//	是否补货
+				"OptionalSplitTerm"=>[],
+				"DescFlexField"=>[],
+				"LineDescFlexField"=>[],
+				//"ShipDate",//出货单日期(该属性可为空,且无默认值)
+				//"ShipConfirmDate"//出货确认日期(该属性可为空,且无默认值)
+				"DocStatus"=>0,//单据状态:0开立;1审核中;2已审核,可用值:0,1,2,3
+
+			];
+		}
+		return $data;
+	}
+	
+}

+ 37 - 0
core/CoreApp/models/Model_logic_u9xg.php

@@ -0,0 +1,37 @@
+<?php
+/**
+ * 此模型是为了支持从许昌销售公司调出库存到香港公司仓库的功能支持
+ */
+class Model_logic_u9xg extends Lin_Model {
+    public $xdcp_code = '';//许昌成品库的编码  测试的时候就用龙盈工厂的仓库
+    public $xdxgls_code = '';//香港临时库的编码   测试的时候用销售公司成品库的编码
+    function __construct(){
+        parent::__construct();
+        $this->load->_model('Model_settingtest','settingtest');
+    }
+    public function getToken($type){
+        $name = "get_yytoken_".$type;
+        $token = $this->settingtest->$name();
+        return $token;
+    }
+    //由于调出单生成可能不会申请后实时出现 需要差几分钟再去申请,避免这种错误
+    //从许昌成品库调出库存到香港临时仓
+    //创建 调出单 销售单 采购单
+    public function xdlsBeforeCreate($info){
+        $this->getToken(101);
+    }
+    // 提交调出单 销售单 采购单
+    public function xdlsBeforeSub($info){
+
+    }
+    //审核调出单  销售单 采购单
+    public function xdlsBeforecheck($info){
+
+    }
+
+    //系统审核许昌成品库调出库存到香港临时仓的调出单 同时建立销售单 和出货单
+    public function xdlsAfterDetail($info){
+
+    }
+   
+}

+ 103 - 0
core/CoreApp/models/Model_settingtest.php

@@ -0,0 +1,103 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
+class Model_settingtest extends Lin_Model 
+{
+	function __construct(){
+	parent::__construct();
+    $this->load_table('setting');
+}
+	
+
+	
+	
+	public function get_yytoken_101()
+	{
+		$setting = $this->setting->get_data();
+		
+		$time = time();
+		$yytoken = $setting['yytoken']['svalue']; 
+		$yytokentime = $setting['yytoken']['time'];
+		if(($yytokentime - $time) < 0)
+		{
+			/** 获取Token **/
+			$url = 'http://139.129.33.38:80/U9C/webapi/OAuth2/AuthLogin?clientid=test&entCode=998&orgCode=101&clientsecret='.$setting['yy-clientsecret']['svalue'].'&userCode='.$setting['yy-usercode']['svalue'];
+			$ch = curl_init();
+        	curl_setopt($ch, CURLOPT_URL, $url);
+        	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+        	//curl_setopt($ch, CURLOPT_HTTPHEADER, $headerA);
+        	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+        	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+        	$res = curl_exec($ch);
+			$headerA = curl_getinfo($ch);
+			$a = json_decode($res,true); 
+			$this->setting->save(array('svalue'=>$a['Data'],'expiretime'=>$time+14000),'yytoken');
+			return $a['Data'];
+			/** 获取Token **/
+		}
+		else
+		{
+			return $yytoken;  
+		}
+	
+	}
+	
+	public function get_yytoken_120()
+	{
+		$setting = $this->setting->get_data();
+		$time = time();
+		$yytoken = $setting['yytoken_gc']['svalue']; 
+		$yytokentime = $setting['yytoken_gc']['time'];
+		if(($yytokentime - $time) < 0)
+		{
+			/** 获取Token **/
+			$url = 'http://139.129.33.38:80/U9C/webapi/OAuth2/AuthLogin?clientid=test&entCode=998&orgCode=120&clientsecret='.$setting['yy-clientsecret']['svalue'].'&userCode='.$setting['yy-usercode']['svalue'];
+			$ch = curl_init();
+        	curl_setopt($ch, CURLOPT_URL, $url);
+        	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+        	//curl_setopt($ch, CURLOPT_HTTPHEADER, $headerA);
+        	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+        	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+        	$res = curl_exec($ch);
+			$headerA = curl_getinfo($ch);
+			$a = json_decode($res,true);
+			$this->setting->save(array('svalue'=>$a['Data'],'expiretime'=>$time+14000),'yytoken_gc');
+			return $a['Data'];
+			/** 获取Token **/
+		}
+		else
+		{
+			return $yytoken;  
+		}
+		
+	}
+	
+	
+	public function get_yytoken_130()
+	{
+		$setting = $this->setting->get_data();
+		$time = time();
+		$yytoken = $setting['yytoken_xs']['svalue']; 
+		$yytokentime = $setting['yytoken_xs']['time'];
+		if(($yytokentime - $time) < 0)
+		{
+			/** 获取Token **/
+			$url = 'http://139.129.33.38:80/U9C/webapi/OAuth2/AuthLogin?clientid=test&entCode=998&orgCode=130&clientsecret='.$setting['yy-clientsecret']['svalue'].'&userCode='.$setting['yy-usercode']['svalue'];
+			$ch = curl_init();
+        	curl_setopt($ch, CURLOPT_URL, $url);
+        	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+        	//curl_setopt($ch, CURLOPT_HTTPHEADER, $headerA);
+        	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+        	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+        	$res = curl_exec($ch);
+			$headerA = curl_getinfo($ch);
+			$a = json_decode($res,true);
+			$this->setting->save(array('svalue'=>$a['Data'],'expiretime'=>$time+14000),'yytoken_xs');
+			return $a['Data'];
+			/** 获取Token **/
+		}
+		else
+		{
+			return $yytoken;  
+		}
+		
+	}
+}  //end class

+ 19 - 0
core/CoreApp/models/Model_zzquque_u9.php

@@ -0,0 +1,19 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
+class Model_zzquque_u9 extends Lin_Model 
+{
+	function __construct(){
+		parent::__construct();
+		$this->load->database();
+		$this->table = 'zzquque_u9';
+		$this->load_table('zzquque_u9');
+
+	}
+	
+	public function getType(){
+		return [
+			1=>"备货流转-在途",//实际就是在途库存的在途过程 需要在香港组织留痕
+			2=>"备货流转-美仓",//实际就是在途库存的完成过程 需要在香港组织留痕
+			10=>"小单临时",//实际就是小单从许昌仓发出后 需要在香港组织留痕
+		];
+	}
+}  

+ 2 - 2
template/erp/fullorder_edit.html

@@ -9,9 +9,9 @@
 <a href="javascript:void(0);" class="exptj">添 加</a>
 <a href="javascript:void(0);" class="expxg">修 改</a>
 <a href="javascript:void(0);" class="expsc">删 除</a>
-{if $thfpdata != ''}
+<!-- {if $thfpdata != ''}
 <a href="javascript:void(0);" class="ckthfpdata">查看替换内容</a>
-{/if}
+{/if} -->
 </div>
 <div id="datatext">
 <table class="datatitle data" border="0" style="border-collapse:collapse;">

+ 2 - 2
template/erp/fullordersmt_edit.html

@@ -9,9 +9,9 @@
 <a href="javascript:void(0);" class="exptj">添 加</a>
 <a href="javascript:void(0);" class="expxg">修 改</a>
 <a href="javascript:void(0);" class="expsc">删 除</a>
-{if $thfpdata != ''}
+<!-- {if $thfpdata != ''}
 <a href="javascript:void(0);" class="ckthfpdata">查看替换内容</a>
-{/if}
+{/if} -->
 </div>
 <div id="datatext">
 <table class="datatitle data" border="0" style="border-collapse:collapse;">

+ 2 - 2
template/erp/fullordertt_edit.html

@@ -9,9 +9,9 @@
 <a href="javascript:void(0);" class="exptj">添 加</a>
 <a href="javascript:void(0);" class="expxg">修 改</a>
 <a href="javascript:void(0);" class="expsc">删 除</a>
-{if $thfpdata != ''}
+<!-- {if $thfpdata != ''}
 <a href="javascript:void(0);" class="ckthfpdata">查看替换内容</a>
-{/if}
+{/if} -->
 </div>
 <div id="datatext">
 <table class="datatitle data" border="0" style="border-collapse:collapse;">