|
@@ -833,9 +833,10 @@ class destination_delivery {
|
|
|
$special_requirements = common::check_input($_POST['special_requirements']);
|
|
$special_requirements = common::check_input($_POST['special_requirements']);
|
|
|
|
|
|
|
|
//检查不能重复添加booking 这里空运没问题,但是会遇到相同hbol 不同的柜子情况,本质上来说就是一条
|
|
//检查不能重复添加booking 这里空运没问题,但是会遇到相同hbol 不同的柜子情况,本质上来说就是一条
|
|
|
- $sqlWhere = ' where ' . common::searchExtendHand_KLN("ocean", $_SESSION["ONLINE_USER"]);
|
|
|
|
|
|
|
+ //$sqlWhere = ' where ' . common::searchExtendHand_KLN("ocean", $_SESSION["ONLINE_USER"]);
|
|
|
//兜底规则
|
|
//兜底规则
|
|
|
- $sqlWhere .= " and eta >= now() - INTERVAL '6 months' and eta <= now() + INTERVAL '6 months'";
|
|
|
|
|
|
|
+ //$sqlWhere .= " and eta >= now() - INTERVAL '6 months' and eta <= now() + INTERVAL '6 months'";
|
|
|
|
|
+ //and exists(select 1 from public.kln_ocean oo ". $sqlWhere." and oo.serial_no = any(kde.h_serial_no) limit 1)
|
|
|
|
|
|
|
|
$ckeckedSql = "with save_table as (
|
|
$ckeckedSql = "with save_table as (
|
|
|
select regexp_split_to_table('".utils::implode(',',$h_serial_no)."', ',') as serial_no
|
|
select regexp_split_to_table('".utils::implode(',',$h_serial_no)."', ',') as serial_no
|
|
@@ -847,8 +848,7 @@ class destination_delivery {
|
|
|
where status not in ('Cancel','Reject')
|
|
where status not in ('Cancel','Reject')
|
|
|
and exists(select 1 from save_table where save_table.serial_no = any(kde.h_serial_no))
|
|
and exists(select 1 from save_table where save_table.serial_no = any(kde.h_serial_no))
|
|
|
and (exists(select 1 from save_table_ctnr where save_table_ctnr.ctnr = ANY(regexp_split_to_array(kde.ctnr, ','))
|
|
and (exists(select 1 from save_table_ctnr where save_table_ctnr.ctnr = ANY(regexp_split_to_array(kde.ctnr, ','))
|
|
|
- or COALESCE(kde.ctnr,'') = ''))
|
|
|
|
|
- and exists(select 1 from public.kln_ocean oo ". $sqlWhere." and oo.serial_no = any(kde.h_serial_no) limit 1)";
|
|
|
|
|
|
|
+ or COALESCE(kde.ctnr,'') = ''))";
|
|
|
//代表编辑
|
|
//代表编辑
|
|
|
if(!empty($serial_no)){
|
|
if(!empty($serial_no)){
|
|
|
$ckeckedSql .=" and kde.serial_no <> '$serial_no'";
|
|
$ckeckedSql .=" and kde.serial_no <> '$serial_no'";
|
|
@@ -856,7 +856,7 @@ class destination_delivery {
|
|
|
|
|
|
|
|
$checkeData = common::excuteObjectSql($ckeckedSql);
|
|
$checkeData = common::excuteObjectSql($ckeckedSql);
|
|
|
if(!empty($checkeData['h_bol'])){
|
|
if(!empty($checkeData['h_bol'])){
|
|
|
- $data = array("msg" =>"The ".$checkeData['h_bol'] .",".$checkeData['ctnr'] ." already exists");
|
|
|
|
|
|
|
+ $data = array("msg" =>"The HBOL NO: ".$checkeData['h_bol'] .", Destination Delivery cannot be created repeatedly.");
|
|
|
common::echo_json_encode(200,$data);
|
|
common::echo_json_encode(200,$data);
|
|
|
exit();
|
|
exit();
|
|
|
}
|
|
}
|
|
@@ -1459,7 +1459,7 @@ class destination_delivery {
|
|
|
LIMIT 1
|
|
LIMIT 1
|
|
|
) r ON true
|
|
) r ON true
|
|
|
order by md.eta desc";
|
|
order by md.eta desc";
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
$rs = common::excuteListSql($sql);
|
|
$rs = common::excuteListSql($sql);
|
|
|
error_log($sql);
|
|
error_log($sql);
|
|
|
if(empty($rs)){
|
|
if(empty($rs)){
|