|
@@ -2962,70 +2962,107 @@ class Systemprint extends Start_Controller {
|
|
|
$oldprinttime = ($fullorder['printtime'] > 0)?$fullorder['oldprinttime'].$fullorder['printtime'].'-':'';
|
|
$oldprinttime = ($fullorder['printtime'] > 0)?$fullorder['oldprinttime'].$fullorder['printtime'].'-':'';
|
|
|
$fullorder['printtime'] = date('m-d H:i',$time);//打印用时间、发货单用,不能删
|
|
$fullorder['printtime'] = date('m-d H:i',$time);//打印用时间、发货单用,不能删
|
|
|
$pdfnum = 1;//PDF打印几遍
|
|
$pdfnum = 1;//PDF打印几遍
|
|
|
-
|
|
|
|
|
- if($fullorder['waybillid'] != '')
|
|
|
|
|
- {
|
|
|
|
|
- $del = $this->cne->get_del($fullorder['waybillid']);
|
|
|
|
|
- }
|
|
|
|
|
- $barcode = $this->cne->get_data($fullorder);
|
|
|
|
|
- $this->logic_ding->sendToDing("扫面发货单出运单".json_encode($barcode,JSON_UNESCAPED_UNICODE));
|
|
|
|
|
- if($barcode['x'] == 1)
|
|
|
|
|
- {
|
|
|
|
|
- $bctime = date('Ymd',$time);
|
|
|
|
|
- $Hwaybill = $barcode['waybill'];
|
|
|
|
|
- $Hyd = $this->_pdfurl($barcode['yd'],'y-'.$Hwaybill,$bctime);
|
|
|
|
|
- //$Hfp = $this->_pdfurl($barcode['fp'],'f-'.$Hwaybill,$bctime);//保留PDF,不需要打印
|
|
|
|
|
- if(isset($barcode['yd']) && isset($Hwaybill))
|
|
|
|
|
- {
|
|
|
|
|
- if($fullorder['waybill'] != "")
|
|
|
|
|
- {
|
|
|
|
|
- $oldwaybill = $fullorder['oldwaybill'].'-'.date('Ymd',$time).'/'.$fullorder['waybill'];
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- $oldwaybill = $fullorder['oldwaybill'];
|
|
|
|
|
|
|
+ if($info['express'] == 75){
|
|
|
|
|
+ $barcode = $this->cne->get_yd($info['waybillid'],2, 0);
|
|
|
|
|
+ if(!empty($barcode)){
|
|
|
|
|
+ $bctime = date('Ymd',$time);
|
|
|
|
|
+ $Hwaybill = $info['waybill'];
|
|
|
|
|
+ $Hyd = $this->_pdfurl($barcode['yd'],'y-'.$Hwaybill,$bctime);
|
|
|
|
|
+ if($fullorder['waybill'] != "")
|
|
|
|
|
+ {
|
|
|
|
|
+ $oldwaybill = $fullorder['oldwaybill'].'-'.date('Ymd',$time).'/'.$fullorder['waybill'];
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ $oldwaybill = $fullorder['oldwaybill'];
|
|
|
|
|
+ }
|
|
|
|
|
+ $oldwaybill .= '-'.$bctime.'/'.$Hwaybill;
|
|
|
|
|
+ $fullorder['printnumber'] = $fullorder['printnumber'] +1;//不能删
|
|
|
|
|
+ if($this->$fullorder_name->save(array('waybill'=>$Hwaybill,'waybillid'=>$barcode['waybillid'],'printtime'=>$time,'printnumber'=>$fullorder['printnumber'],'print'=>3,'oldwaybill'=>$oldwaybill,'oldprinttime'=>$oldprinttime,'failed'=>''),$info['id']))
|
|
|
|
|
+ {
|
|
|
|
|
+ $text = array('yd'=>base_url().'data/pdf/'.$bctime.'/y-'.$Hwaybill.'.pdf','mode'=>100);
|
|
|
|
|
+ $this->logic_ding->sendToDing("扫面发货单出运单的text".json_encode($text,JSON_UNESCAPED_UNICODE));
|
|
|
|
|
+ echo json_encode([
|
|
|
|
|
+ 'code'=>1,
|
|
|
|
|
+ 'msg'=>"ok",
|
|
|
|
|
+ 'data'=>$text
|
|
|
|
|
+ ],JSON_UNESCAPED_UNICODE);
|
|
|
|
|
+ die;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ echo json_encode([
|
|
|
|
|
+ 'code'=>-1,
|
|
|
|
|
+ 'msg'=>"订单信息保存异常",
|
|
|
|
|
+ 'data'=>[]
|
|
|
|
|
+ ],JSON_UNESCAPED_UNICODE);
|
|
|
|
|
+ die;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- $oldwaybill .= '-'.$bctime.'/'.$Hwaybill;
|
|
|
|
|
- $fullorder['printnumber'] = $fullorder['printnumber'] +1;//不能删
|
|
|
|
|
- if($this->$fullorder_name->save(array('waybill'=>$Hwaybill,'waybillid'=>$barcode['waybillid'],'printtime'=>$time,'printnumber'=>$fullorder['printnumber'],'print'=>3,'oldwaybill'=>$oldwaybill,'oldprinttime'=>$oldprinttime,'failed'=>''),$info['id']))
|
|
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if($fullorder['waybillid'] != '')
|
|
|
|
|
+ {
|
|
|
|
|
+ $del = $this->cne->get_del($fullorder['waybillid']);
|
|
|
|
|
+ }
|
|
|
|
|
+ $barcode = $this->cne->get_data($fullorder);
|
|
|
|
|
+ $this->logic_ding->sendToDing("扫面发货单出运单".json_encode($barcode,JSON_UNESCAPED_UNICODE));
|
|
|
|
|
+ if($barcode['x'] == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ $bctime = date('Ymd',$time);
|
|
|
|
|
+ $Hwaybill = $barcode['waybill'];
|
|
|
|
|
+ $Hyd = $this->_pdfurl($barcode['yd'],'y-'.$Hwaybill,$bctime);
|
|
|
|
|
+ //$Hfp = $this->_pdfurl($barcode['fp'],'f-'.$Hwaybill,$bctime);//保留PDF,不需要打印
|
|
|
|
|
+ if(isset($barcode['yd']) && isset($Hwaybill))
|
|
|
{
|
|
{
|
|
|
- $text = array('yd'=>base_url().'data/pdf/'.$bctime.'/y-'.$Hwaybill.'.pdf','mode'=>100);
|
|
|
|
|
- $this->logic_ding->sendToDing("扫面发货单出运单的text".json_encode($text,JSON_UNESCAPED_UNICODE));
|
|
|
|
|
- echo json_encode([
|
|
|
|
|
- 'code'=>1,
|
|
|
|
|
- 'msg'=>"ok",
|
|
|
|
|
- 'data'=>$text
|
|
|
|
|
- ],JSON_UNESCAPED_UNICODE);
|
|
|
|
|
- die;
|
|
|
|
|
- }else{
|
|
|
|
|
- echo json_encode([
|
|
|
|
|
- 'code'=>-1,
|
|
|
|
|
- 'msg'=>"订单信息保存异常",
|
|
|
|
|
- 'data'=>[]
|
|
|
|
|
- ],JSON_UNESCAPED_UNICODE);
|
|
|
|
|
- die;
|
|
|
|
|
|
|
+ if($fullorder['waybill'] != "")
|
|
|
|
|
+ {
|
|
|
|
|
+ $oldwaybill = $fullorder['oldwaybill'].'-'.date('Ymd',$time).'/'.$fullorder['waybill'];
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ $oldwaybill = $fullorder['oldwaybill'];
|
|
|
|
|
+ }
|
|
|
|
|
+ $oldwaybill .= '-'.$bctime.'/'.$Hwaybill;
|
|
|
|
|
+ $fullorder['printnumber'] = $fullorder['printnumber'] +1;//不能删
|
|
|
|
|
+ if($this->$fullorder_name->save(array('waybill'=>$Hwaybill,'waybillid'=>$barcode['waybillid'],'printtime'=>$time,'printnumber'=>$fullorder['printnumber'],'print'=>3,'oldwaybill'=>$oldwaybill,'oldprinttime'=>$oldprinttime,'failed'=>''),$info['id']))
|
|
|
|
|
+ {
|
|
|
|
|
+ $text = array('yd'=>base_url().'data/pdf/'.$bctime.'/y-'.$Hwaybill.'.pdf','mode'=>100);
|
|
|
|
|
+ $this->logic_ding->sendToDing("扫面发货单出运单的text".json_encode($text,JSON_UNESCAPED_UNICODE));
|
|
|
|
|
+ echo json_encode([
|
|
|
|
|
+ 'code'=>1,
|
|
|
|
|
+ 'msg'=>"ok",
|
|
|
|
|
+ 'data'=>$text
|
|
|
|
|
+ ],JSON_UNESCAPED_UNICODE);
|
|
|
|
|
+ die;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ echo json_encode([
|
|
|
|
|
+ 'code'=>-1,
|
|
|
|
|
+ 'msg'=>"订单信息保存异常",
|
|
|
|
|
+ 'data'=>[]
|
|
|
|
|
+ ],JSON_UNESCAPED_UNICODE);
|
|
|
|
|
+ die;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- $failed = $barcode['Description'];//错误提示
|
|
|
|
|
- //$fullorder['printnumber'] = $fullorder['printnumber'] +1;
|
|
|
|
|
- //$this->$fullorder_name->save(array('print'=>1,'failed'=>$failed,'printnumber'=>$fullorder['printnumber']),$info['id']);
|
|
|
|
|
- $this->$fullorder_name->save(array('print'=>1,'failed'=>$failed),$info['id']);
|
|
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ $failed = $barcode['Description'];//错误提示
|
|
|
|
|
+ //$fullorder['printnumber'] = $fullorder['printnumber'] +1;
|
|
|
|
|
+ //$this->$fullorder_name->save(array('print'=>1,'failed'=>$failed,'printnumber'=>$fullorder['printnumber']),$info['id']);
|
|
|
|
|
+ $this->$fullorder_name->save(array('print'=>1,'failed'=>$failed),$info['id']);
|
|
|
|
|
+ echo json_encode([
|
|
|
|
|
+ 'code'=>-1,
|
|
|
|
|
+ 'msg'=>$failed,
|
|
|
|
|
+ 'data'=>[]
|
|
|
|
|
+ ],JSON_UNESCAPED_UNICODE);
|
|
|
|
|
+ die;
|
|
|
|
|
+ }
|
|
|
echo json_encode([
|
|
echo json_encode([
|
|
|
'code'=>-1,
|
|
'code'=>-1,
|
|
|
- 'msg'=>$failed,
|
|
|
|
|
|
|
+ 'msg'=>"执行订单异常,请联系技术",
|
|
|
'data'=>[]
|
|
'data'=>[]
|
|
|
],JSON_UNESCAPED_UNICODE);
|
|
],JSON_UNESCAPED_UNICODE);
|
|
|
die;
|
|
die;
|
|
|
}
|
|
}
|
|
|
- echo json_encode([
|
|
|
|
|
- 'code'=>-1,
|
|
|
|
|
- 'msg'=>"执行订单异常,请联系技术",
|
|
|
|
|
- 'data'=>[]
|
|
|
|
|
- ],JSON_UNESCAPED_UNICODE);
|
|
|
|
|
- die;
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function _ckpmcheck(){
|
|
public function _ckpmcheck(){
|