@@ -13,7 +13,6 @@ import org.nl.exception.BadRequestException;
import org.nl.modules.security.service.dto.JwtUserDto ;
import org.nl.modules.system.service.impl.ParamServiceImpl ;
import org.nl.modules.system.util.CodeUtil ;
import org.nl.pda.exception.PdaRequestException ;
import org.nl.pda.st.in.service.HandNewMaterialService ;
import org.nl.utils.SecurityUtils ;
import org.nl.utils.SpringContextHolder ;
@@ -51,27 +50,27 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
WQLObject task_wql = WQLObject . getWQLObject ( " SCH_BASE_Task " ) ;
WQLObject point_wql = WQLObject . getWQLObject ( " SCH_BASE_Point " ) ;
if ( ObjectUtil . isEmpty ( jsonObject . get ( " storagevehicle_code " ) ) ) {
throw new Pda RequestException( " 输入的载具号不能为空! " ) ;
throw new Bad RequestException( " 输入的载具号不能为空! " ) ;
}
String storagevehicle_code = ( String ) jsonObject . get ( " storagevehicle_code " ) ;
String flag = ( String ) jsonObject . get ( " option " ) ;
JSONObject vehicle_jo = vehicle_wql . query ( " storagevehicle_code = ' " + storagevehicle_code + " ' AND is_delete = '0' AND is_used = '1' " ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( vehicle_jo ) ) {
throw new Pda RequestException( " 该载具不存在! " ) ;
throw new Bad RequestException( " 该载具不存在! " ) ;
}
//查询是否存在未完成的任务
JSONObject task_jo = task_wql . query ( " vehicle_code = ' " + storagevehicle_code + " ' AND is_delete = '0' AND task_status < '99' " ) . uniqueResult ( 0 ) ;
if ( ! ObjectUtil . isEmpty ( task_jo ) ) {
throw new Pda RequestException( " 该载具存在未完成的任务! " ) ;
throw new Bad RequestException( " 该载具存在未完成的任务! " ) ;
}
//查询该载具是否存在组盘记录
if ( ! flag . equals ( " 5 " ) ) {
JSONArray mater_rows = bucket_wql . query ( " storagevehicle_code = ' " + vehicle_jo . getString ( " storagevehicle_code " ) + " ' AND status IN ('03','02') " ) . getResultJSONArray ( 0 ) ;
if ( mater_rows . size ( ) > 0 ) {
throw new Pda RequestException( " 请选择空托盘! " ) ;
throw new Bad RequestException( " 请选择空托盘! " ) ;
}
}
@@ -82,28 +81,28 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
case " 1 " :
case " 2 " :
if ( ! ObjectUtil . isEmpty ( point_jo ) ) {
throw new Pda RequestException( " 该载具存在点位上! " ) ;
throw new Bad RequestException( " 该载具存在点位上! " ) ;
}
//校验载具为塑料托盘
if ( ! vehicle_jo . getString ( " storagevehicle_type " ) . equals ( " 20 " ) ) {
throw new Pda RequestException( " 必须使用塑料托盘! " ) ;
throw new Bad RequestException( " 必须使用塑料托盘! " ) ;
}
break ;
case " 3 " :
//校验载具为塑料托盘
if ( ! vehicle_jo . getString ( " storagevehicle_type " ) . equals ( " 10 " ) ) {
throw new Pda RequestException( " 必须使用铁托盘! " ) ;
throw new Bad RequestException( " 必须使用铁托盘! " ) ;
}
String point_code2 = ( String ) jsonObject . get ( " point_code " ) ;
if ( ! ObjectUtil . isEmpty ( point_jo ) & & ! point_jo . getString ( " point_code " ) . equals ( point_code2 ) ) {
throw new Pda RequestException( " 该载具存在别的点位上! " ) ;
throw new Bad RequestException( " 该载具存在别的点位上! " ) ;
}
break ;
case " 4 " :
case " 7 " :
String point_code = ( String ) jsonObject . get ( " point_code " ) ;
if ( ! ObjectUtil . isEmpty ( point_jo ) & & ! point_jo . getString ( " point_code " ) . equals ( point_code ) ) {
throw new Pda RequestException( " 该载具存在别的点位上! " ) ;
throw new Bad RequestException( " 该载具存在别的点位上! " ) ;
}
break ;
case " 5 " :
@@ -125,7 +124,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
WQLObject mater_wql = WQLObject . getWQLObject ( " md_me_materialbase " ) ;
WQLObject unit_wql = WQLObject . getWQLObject ( " md_pb_measureunit " ) ;
if ( ObjectUtil . isEmpty ( jsonObject . get ( " bucket_code " ) ) ) {
throw new Pda RequestException( " 桶码不能为空! " ) ;
throw new Bad RequestException( " 桶码不能为空! " ) ;
}
String bucket_code = ( String ) jsonObject . get ( " bucket_code " ) ;
String flag = ( String ) jsonObject . get ( " option " ) ;
@@ -164,48 +163,48 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
bucket_jo . put ( " qty_unit_id " , mater_jo . getString ( " base_unit_id " ) ) ;
bucket_jo . put ( " qty_unit_name " , unit_jo . getString ( " unit_name " ) ) ;
} catch ( Exception e ) {
throw new Pda RequestException( " 桶二维码数据有误! " ) ;
throw new Bad RequestException( " 桶二维码数据有误! " ) ;
}
/*if (!bill.get("pcsn").equals(bucket_jo.getString("pcsn"))) {
throw new Pda RequestException("单据批次和桶批次不同!");
throw new Bad RequestException("单据批次和桶批次不同!");
}*/
} else {
if ( ! bucket_jo . getString ( " storagevehicle_type " ) . equals ( " 01 " ) & & ! bucket_jo . getString ( " storagevehicle_type " ) . equals ( " 02 " ) ) {
throw new Pda RequestException( " 桶类型必须为原料桶或辅料桶! " ) ;
throw new Bad RequestException( " 桶类型必须为原料桶或辅料桶! " ) ;
}
if ( ! bucket_jo . getString ( " status " ) . equals ( " 01 " ) ) {
throw new Pda RequestException( " 桶状态必须为生成! " ) ;
throw new Bad RequestException( " 桶状态必须为生成! " ) ;
}
/*if (!bill.get("material_id").equals(bucket_jo.getString("material_id"))) {
throw new Pda RequestException("单据物料和桶物料不同!");
throw new Bad RequestException("单据物料和桶物料不同!");
}
if (!bill.get("pcsn").equals(bucket_jo.getString("pcsn"))) {
throw new Pda RequestException("单据批次和桶批次不同!");
throw new Bad RequestException("单据批次和桶批次不同!");
}*/
}
break ;
case " 2 " :
if ( ObjectUtil . isEmpty ( bucket_jo ) ) {
throw new Pda RequestException( " 未查询到桶相关信息 " ) ;
throw new Bad RequestException( " 未查询到桶相关信息 " ) ;
}
if ( ! bucket_jo . getString ( " storagevehicle_type " ) . equals ( " 02 " ) ) {
throw new Pda RequestException( " 桶类型必须为辅料桶! " ) ;
throw new Bad RequestException( " 桶类型必须为辅料桶! " ) ;
}
if ( ! bucket_jo . getString ( " status " ) . equals ( " 01 " ) ) {
throw new Pda RequestException( " 桶状态必须为生成! " ) ;
throw new Bad RequestException( " 桶状态必须为生成! " ) ;
}
break ;
case " 5 " :
if ( ObjectUtil . isEmpty ( bucket_jo ) ) {
throw new Pda RequestException( " 未查询到桶相关信息 " ) ;
throw new Bad RequestException( " 未查询到桶相关信息 " ) ;
}
if ( ! bucket_jo . getString ( " status " ) . equals ( " 01 " ) ) {
throw new Pda RequestException( " 桶状态必须为生成! " ) ;
throw new Bad RequestException( " 桶状态必须为生成! " ) ;
}
boolean is_rf = materialbaseService . isAlongMaterType ( MaterOptTypeEnum . RF . getCode ( ) , bucket_jo . getString ( " material_id " ) , null ) ;
//桶内物料必须为软废;
if ( ! is_rf ) {
throw new Pda RequestException( " 桶内物料不为软废! " ) ;
throw new Bad RequestException( " 桶内物料不为软废! " ) ;
}
bucket_jo . put ( " is_new " , " 1 " ) ;
break ;
@@ -213,31 +212,31 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
case " 4 " :
case " 6 " :
if ( ObjectUtil . isEmpty ( bucket_jo ) ) {
throw new Pda RequestException( " 未查询到桶相关信息 " ) ;
throw new Bad RequestException( " 未查询到桶相关信息 " ) ;
}
if ( ! bucket_jo . getString ( " status " ) . equals ( " 01 " ) ) {
throw new Pda RequestException( " 桶状态必须为生成! " ) ;
throw new Bad RequestException( " 桶状态必须为生成! " ) ;
}
boolean is_pgf = materialbaseService . isAlongMaterType ( MaterOptTypeEnum . PGF . getCode ( ) , bucket_jo . getString ( " material_id " ) , null ) ;
//桶内物料必须为PG粉;
if ( ! is_pgf ) {
throw new Pda RequestException( " 桶内物料不为PG粉! " ) ;
throw new Bad RequestException( " 桶内物料不为PG粉! " ) ;
}
break ;
case " 7 " :
if ( ObjectUtil . isEmpty ( bucket_jo ) ) {
throw new Pda RequestException( " 未查询到桶相关信息 " ) ;
throw new Bad RequestException( " 未查询到桶相关信息 " ) ;
}
if ( ! bucket_jo . getString ( " status " ) . equals ( " 01 " ) ) {
throw new Pda RequestException( " 桶状态必须为生成! " ) ;
throw new Bad RequestException( " 桶状态必须为生成! " ) ;
}
is_rf = materialbaseService . isAlongMaterType ( MaterOptTypeEnum . RF . getCode ( ) , bucket_jo . getString ( " material_id " ) , null ) ;
//桶内物料必须为软废;
if ( ! is_rf ) {
throw new Pda RequestException( " 桶内物料不为软废! " ) ;
throw new Bad RequestException( " 桶内物料不为软废! " ) ;
}
if ( ! bucket_jo . getString ( " is_active " ) . equals ( " 1 " ) ) {
throw new Pda RequestException( " 桶内物料必须可用! " ) ;
throw new Bad RequestException( " 桶内物料必须可用! " ) ;
}
break ;
@@ -273,7 +272,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
HashMap < String , String > vehicle = ( HashMap < String , String > ) jsonObject . get ( " vehicle " ) ;
HashMap < String , String > source_bill = ( HashMap < String , String > ) jsonObject . get ( " bill " ) ;
if ( ObjectUtil . isEmpty ( vehicle ) ) {
throw new Pda RequestException( " 载具不能为空,请点击查询载具是否可用! " ) ;
throw new Bad RequestException( " 载具不能为空,请点击查询载具是否可用! " ) ;
}
HashMap < String , String > point = new HashMap < > ( ) ;
String flag = ( String ) jsonObject . get ( " option " ) ;
@@ -288,32 +287,32 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
if ( flag . equals ( " 3 " ) | | flag . equals ( " 4 " ) | | flag . equals ( " 7 " ) ) {
point = ( HashMap < String , String > ) jsonObject . get ( " point " ) ;
if ( ObjectUtil . isEmpty ( point ) ) {
throw new Pda RequestException( " 点位不能为空,请点击查询点位是否可用! " ) ;
throw new Bad RequestException( " 点位不能为空,请点击查询点位是否可用! " ) ;
}
JSONObject vehicle_jo = vehicle_wql . query ( " storagevehicle_code = ' " + storagevehicle_code + " ' AND is_delete = '0' AND is_used = '1' " ) . uniqueResult ( 0 ) ;
//校验载具为塑料托盘
if ( flag . equals ( " 3 " ) ) {
if ( ! vehicle_jo . getString ( " storagevehicle_type " ) . equals ( " 10 " ) ) {
throw new Pda RequestException( " 必须使用铁托盘! " ) ;
throw new Bad RequestException( " 必须使用铁托盘! " ) ;
}
}
//查询该载具是否存在组盘记录
JSONArray mater_rows = bucket_wql . query ( " storagevehicle_code = ' " + vehicle_jo . getString ( " storagevehicle_code " ) + " ' AND status IN ('03','02') " ) . getResultJSONArray ( 0 ) ;
if ( mater_rows . size ( ) > 0 ) {
throw new Pda RequestException( " 请选择空托盘! " ) ;
throw new Bad RequestException( " 请选择空托盘! " ) ;
}
JSONObject point_jo = point_wql . query ( " vehicle_code = ' " + storagevehicle_code + " ' " ) . uniqueResult ( 0 ) ;
if ( ! ObjectUtil . isEmpty ( point_jo ) & & ! point_jo . getString ( " point_code " ) . equals ( point . get ( " point_code " ) ) ) {
throw new Pda RequestException( " 该载具存在别的点位上! " ) ;
throw new Bad RequestException( " 该载具存在别的点位上! " ) ;
}
//查询是否存在未完成的任务
JSONObject task_jo = task_wql . query ( " vehicle_code = ' " + storagevehicle_code + " ' AND is_delete = '0' AND task_status < '99' " ) . uniqueResult ( 0 ) ;
if ( ! ObjectUtil . isEmpty ( task_jo ) ) {
throw new Pda RequestException( " 该载具存在未完成的任务! " ) ;
throw new Bad RequestException( " 该载具存在未完成的任务! " ) ;
}
JSONObject start_point = point_wql . query ( " point_code = ' " + point . get ( " point_code " ) + " ' " ) . uniqueResult ( 0 ) ;
if ( ! start_point . getString ( " lock_type " ) . equals ( " 00 " ) ) {
throw new Pda RequestException( " 该点位已被锁定! " ) ;
throw new Bad RequestException( " 该点位已被锁定! " ) ;
}
}
//插入主表
@@ -347,7 +346,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
}
JSONObject jo_now = WQL . getWO ( " QPADST_IN_SERVICE " ) . addParam ( " flag " , " 11 " ) . addParam ( " storagevehicle_code " , storagevehicle_code ) . process ( ) . uniqueResult ( 0 ) ;
if ( jo_now ! = null ) {
throw new Pda RequestException( " 该载具 " + storagevehicle_code + " 已存在未完成的出入库单! " ) ;
throw new Bad RequestException( " 该载具 " + storagevehicle_code + " 已存在未完成的出入库单! " ) ;
}
JSONObject mst_jo = new JSONObject ( ) ;
String bill_code = CodeUtil . getNewCode ( " IO_CODE " ) ;
@@ -392,20 +391,20 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
JSONObject bucket_jo = bucket_wql . query ( " bucketunique = ' " + row . get ( " bucketunique " ) + " ' AND material_id = ' " + row . get ( " material_id " ) + " ' AND pcsn = ' " + row . get ( " pcsn " ) + " ' " ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( bucket_jo ) ) {
throw new Pda RequestException( " 桶号: " + row . get ( " bucketunique " ) + " 查不到对应物料批次记录! " ) ;
throw new Bad RequestException( " 桶号: " + row . get ( " bucketunique " ) + " 查不到对应物料批次记录! " ) ;
}
if ( ! ObjectUtil . isEmpty ( bucket_jo ) & & ! bucket_jo . getString ( " status " ) . equals ( " 01 " ) ) {
//如果为软废采购入库,判断是否为新加,不是新加的不需要判断是否组盘
if ( ! flag . equals ( " 5 " ) & & row . containsKey ( " is_new " ) & & row . get ( " is_new " ) . equals ( " 0 " ) ) {
throw new Pda RequestException( " 桶 " + bucket_jo . getString ( " bucketunique " ) + " 已经组盘! " ) ;
throw new Bad RequestException( " 桶 " + bucket_jo . getString ( " bucketunique " ) + " 已经组盘! " ) ;
}
}
if ( flag . equals ( " 1 " ) ) {
if ( StrUtil . isNotEmpty ( material_id ) & & StrUtil . isNotEmpty ( pcsn ) ) {
if ( ! row . get ( " material_id " ) . equals ( material_id ) | | ! pcsn . equals ( row . get ( " pcsn " ) ) ) {
throw new Pda RequestException( " 存在不同物料、批次的明细! " ) ;
throw new Bad RequestException( " 存在不同物料、批次的明细! " ) ;
}
}
}
@@ -415,7 +414,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
boolean is_pgf = materialbaseService . isAlongMaterType ( MaterOptTypeEnum . PGF . getCode ( ) , bucket_jo . getString ( " material_id " ) , null ) ;
//桶内物料必须为PG粉;
if ( ! is_pgf ) {
throw new Pda RequestException( " 桶内物料不为PG粉! " ) ;
throw new Bad RequestException( " 桶内物料不为PG粉! " ) ;
}
}
@@ -424,7 +423,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
boolean is_rf = materialbaseService . isAlongMaterType ( MaterOptTypeEnum . RF . getCode ( ) , bucket_jo . getString ( " material_id " ) , null ) ;
//桶内物料必须为软废;
if ( ! is_rf ) {
throw new Pda RequestException( " 桶内物料不为软废! " ) ;
throw new Bad RequestException( " 桶内物料不为软废! " ) ;
}
}
@@ -445,7 +444,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
boolean is_pgf = materialbaseService . isAlongMaterType ( MaterOptTypeEnum . PGF . getCode ( ) , bucket_jo . getString ( " material_id " ) , null ) ;
//桶内物料必须为PG粉;
if ( ! is_pgf ) {
throw new Pda RequestException( " 桶内物料不为PG粉! " ) ;
throw new Bad RequestException( " 桶内物料不为PG粉! " ) ;
}
}
@@ -475,7 +474,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
if ( flag . equals ( " 7 " ) ) {
//判断软废是否可用
if ( ! bucket_now . getString ( " is_active " ) . equals ( " 1 " ) ) {
throw new Pda RequestException( bucket_now . getString ( " bucketunique " ) + " 桶,软废不可用! " ) ;
throw new Bad RequestException( bucket_now . getString ( " bucketunique " ) + " 桶,软废不可用! " ) ;
}
}
@@ -546,28 +545,28 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
String source_bill_code = ( String ) bill . get ( " source_bill_code " ) ;
String source_billdtl_id = ( String ) bill . get ( " source_billdtl_id " ) ;
if ( ! source_billdtl_id . equals ( source_bill . get ( " source_billdtl_id " ) ) ) {
throw new Pda RequestException( " 关联单据不同! " ) ;
throw new Bad RequestException( " 关联单据不同! " ) ;
}
JSONObject receive_mst_jo = receive_mst . query ( " receive_code = ' " + source_bill_code + " ' " ) . uniqueResult ( 0 ) ;
JSONObject receive_dtl_jo = receive_dtl . query ( " receivedtl_id = ' " + source_billdtl_id + " ' " ) . uniqueResult ( 0 ) ;
if ( ! bill . get ( " material_id " ) . equals ( row . get ( " material_id " ) ) | | ! bill . get ( " pcsn " ) . equals ( row . get ( " pcsn " ) ) ) {
throw new Pda RequestException( " 单据物料批次和桶物料批次不同! " ) ;
throw new Bad RequestException( " 单据物料批次和桶物料批次不同! " ) ;
}
if ( ObjectUtil . isEmpty ( receive_mst_jo ) | | ObjectUtil . isEmpty ( receive_dtl_jo ) ) {
throw new Pda RequestException( " 传入的收货单信息有误! " ) ;
throw new Bad RequestException( " 传入的收货单信息有误! " ) ;
}
if ( receive_mst_jo . getString ( " status " ) . equals ( " 99 " ) | | receive_mst_jo . getString ( " is_delete " ) . equals ( " 1 " ) ) {
throw new Pda RequestException( " 该到货通知单: " + source_bill_code + " 已完成或删除 " ) ;
throw new Bad RequestException( " 该到货通知单: " + source_bill_code + " 已完成或删除 " ) ;
}
if ( receive_dtl_jo . getString ( " status " ) . equals ( " 99 " ) ) {
throw new Pda RequestException( " 收货单明细已完成! " ) ;
throw new Bad RequestException( " 收货单明细已完成! " ) ;
}
double unin = receive_dtl_jo . getDouble ( " receive_qty " ) - receive_dtl_jo . getDouble ( " instor_qty " ) ;
if ( unin < = 0 ) {
throw new Pda RequestException( " 收货明细未入库数为0! " ) ;
throw new Bad RequestException( " 收货明细未入库数为0! " ) ;
}
if ( bucket_now . getDouble ( " storage_qty " ) > unin ) {
throw new Pda RequestException( " 当前组盘入库数 " + bucket_now . getDouble ( " storage_qty " ) + " 大于收货明细未入库数 " + unin + " ! " ) ;
throw new Bad RequestException( " 当前组盘入库数 " + bucket_now . getDouble ( " storage_qty " ) + " 大于收货明细未入库数 " + unin + " ! " ) ;
}
bucket_now . put ( " source_billdtl_id " , bill . get ( " source_billdtl_id " ) ) ;
bucket_now . put ( " source_bill_type " , bill . get ( " source_bill_type " ) ) ;
@@ -591,7 +590,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
//查询该单据是否存在
JSONObject pro_jo = WQLObject . getWQLObject ( " PCS_IF_PurchaseOrderProc " ) . query ( " id = ' " + row . get ( " source_billdtl_id " ) + " ' " ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( pro_jo ) ) {
throw new Pda RequestException( " 采购订单数据发生变化,请重新选择选择明细生成入库单! " ) ;
throw new Bad RequestException( " 采购订单数据发生变化,请重新选择选择明细生成入库单! " ) ;
}
HashMap < String , String > proc_map = new HashMap < > ( ) ;
proc_map . put ( " proc_status " , " 02 " ) ;
@@ -718,11 +717,11 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
public Map < String , Object > findVehicle ( Map < String , String > jsonObject , HttpContext ctx ) {
String bucket_code = jsonObject . get ( " bucket_code " ) ;
if ( StrUtil . isEmpty ( bucket_code ) ) {
throw new Pda RequestException( " 桶码不能为空! " ) ;
throw new Bad RequestException( " 桶码不能为空! " ) ;
}
JSONObject bucket_jo = WQLObject . getWQLObject ( " md_pb_bucketrecord " ) . query ( " bucketunique = ' " + bucket_code + " ' AND status = '01' " ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( bucket_jo ) ) {
throw new Pda RequestException( " 未查询到相关桶信息! " ) ;
throw new Bad RequestException( " 未查询到相关桶信息! " ) ;
}
JSONObject mater_jo = WQLObject . getWQLObject ( " md_me_materialbase " ) . query ( " material_id = ' " + bucket_jo . getString ( " material_id " ) + " ' " ) . uniqueResult ( 0 ) ;
String material_code = mater_jo . getString ( " material_code " ) ;
@@ -737,7 +736,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
map . put ( " material_id " , mater_jo . getString ( " material_id " ) ) ;
String max_quantity = SpringContextHolder . getBean ( ParamServiceImpl . class ) . findByCode ( " MAX_QUANTITY " ) . getValue ( ) ;
if ( StrUtil . isEmpty ( max_quantity ) ) {
throw new Pda RequestException( " 未设置满托盘桶数'MAX_QUANTITY'系统参数 " ) ;
throw new Bad RequestException( " 未设置满托盘桶数'MAX_QUANTITY'系统参数 " ) ;
}
map . put ( " max_quantity " , max_quantity ) ;
JSONObject vehicle_rows = WQL . getWO ( " QPADST_IN_SERVICE " ) . addParamMap ( map ) . pageQuery ( ctx , " seq_no,bucket_num " ) ;
@@ -755,13 +754,13 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
WQLObject vehicle_wql = WQLObject . getWQLObject ( " MD_PB_StorageVehicleInfo " ) ;
WQLObject bucket_wql = WQLObject . getWQLObject ( " MD_PB_BucketRecord " ) ;
if ( ObjectUtil . isEmpty ( jsonObject . get ( " point_code " ) ) ) {
throw new Pda RequestException( " 输入点位不能为空! " ) ;
throw new Bad RequestException( " 输入点位不能为空! " ) ;
}
String point_code = ( String ) jsonObject . get ( " point_code " ) ;
JSONObject point_jo = point_wql . query ( " point_code = ' " + point_code + " ' " ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( point_jo ) ) {
throw new Pda RequestException( " 未查询到相关点位信息! " ) ;
throw new Bad RequestException( " 未查询到相关点位信息! " ) ;
}
String vehicle_code = point_jo . getString ( " vehicle_code " ) ;
@@ -771,13 +770,13 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
vehicle = vehicle_wql . query ( " storagevehicle_code = ' " + vehicle_code + " ' " ) . uniqueResult ( 0 ) ;
if ( ! vehicle . getString ( " storagevehicle_type " ) . equals ( " 10 " ) ) {
throw new Pda RequestException( " 请选择铁托盘! " ) ;
throw new Bad RequestException( " 请选择铁托盘! " ) ;
}
//获取桶信息
JSONArray rows = bucket_wql . query ( " storagevehicle_code = ' " + vehicle_code + " ' AND status IN ('01','02','03') " ) . getResultJSONArray ( 0 ) ;
if ( rows . size ( ) > 0 ) {
throw new Pda RequestException( " 点位上不为空载具! " ) ;
throw new Bad RequestException( " 点位上不为空载具! " ) ;
}
}
JSONObject returnjo = new JSONObject ( ) ;
@@ -793,21 +792,21 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
public Map < String , Object > needVehicle ( Map jsonObject ) {
WQLObject point_wql = WQLObject . getWQLObject ( " SCH_BASE_Point " ) ;
if ( ObjectUtil . isEmpty ( jsonObject . get ( " point " ) ) ) {
throw new Pda RequestException( " 点位不能为空! " ) ;
throw new Bad RequestException( " 点位不能为空! " ) ;
}
String point = ( String ) jsonObject . get ( " point " ) ;
JSONObject point_jo = point_wql . query ( " point_code = ' " + point + " ' " ) . uniqueResult ( 0 ) ;
if ( ! StrUtil . isEmpty ( point_jo . getString ( " storagevehicle_code " ) ) ) {
throw new Pda RequestException( " 该点位上存在载具! " ) ;
throw new Bad RequestException( " 该点位上存在载具! " ) ;
}
if ( ! point_jo . getString ( " lock_type " ) . equals ( " 00 " ) ) {
throw new Pda RequestException( " 该点位已被锁定! " ) ;
throw new Bad RequestException( " 该点位已被锁定! " ) ;
}
JSONObject start_point = point_wql . query ( " point_status = '01' AND lock_type = '00' AND is_used = '1' AND is_delete = '0' AND area_type = '27' " ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( start_point ) ) {
throw new Pda RequestException( " 暂无空托盘! " ) ;
throw new Bad RequestException( " 暂无空托盘! " ) ;
}
//创建任务
@@ -831,7 +830,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
mapnow . put ( " task_status " , " 02 " ) ;
WQLObject . getWQLObject ( " SCH_BASE_Task " ) . update ( mapnow , " taskdtl_id = ' " + task_id + " ' " ) ;
} else {
throw new Pda RequestException( " 任务下发失败: " + result . getString ( " message " ) ) ;
throw new Bad RequestException( " 任务下发失败: " + result . getString ( " message " ) ) ;
}
}
@@ -845,7 +844,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
@Override
public Map < String , Object > queryLKvehicle ( Map jsonObject ) {
if ( ObjectUtil . isEmpty ( jsonObject . get ( " lk_vehicle " ) ) ) {
throw new Pda RequestException( " 立库载具码不能为空! " ) ;
throw new Bad RequestException( " 立库载具码不能为空! " ) ;
}
String lk_vehicle = ( String ) jsonObject . get ( " lk_vehicle " ) ;
JSONArray rows = WQL . getWO ( " QPADST_IN_SERVICE " ) . addParam ( " flag " , " 3 " ) . addParam ( " storagevehicle_code " , lk_vehicle ) . process ( ) . getResultJSONArray ( 0 ) ;
@@ -870,10 +869,10 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
@Override
public Map < String , Object > askVehicle ( Map jsonObject ) {
if ( ObjectUtil . isEmpty ( jsonObject . get ( " point " ) ) ) {
throw new Pda RequestException( " 点位不能为空! " ) ;
throw new Bad RequestException( " 点位不能为空! " ) ;
}
if ( ObjectUtil . isEmpty ( jsonObject . get ( " vehicle_row " ) ) ) {
throw new Pda RequestException( " 选择载具不能为空! " ) ;
throw new Bad RequestException( " 选择载具不能为空! " ) ;
}
String point_code = ( String ) jsonObject . get ( " point " ) ;