@ -192,9 +192,7 @@ public class SendMaterialTask extends AbstractAcsTask {
throw new BadRequestException ( "载具不能为空!" ) ;
throw new BadRequestException ( "载具不能为空!" ) ;
}
}
//判断起点有没有未完成的指令
//判断起点有没有未完成的指令
JSONObject beforTaskObj = taskTable .
JSONObject beforTaskObj = taskTable . query ( "is_delete='0' and start_point_code='" + start_point_code + "' and task_status <>'" + TaskStatusEnum . FINISHED . getCode ( ) + "'" ) . uniqueResult ( 0 ) ;
query ( "is_delete='0' and start_point_code='" + start_point_code + "' and task_status <>'" + TaskStatusEnum . FINISHED . getCode ( ) + "'" )
. uniqueResult ( 0 ) ;
if ( ObjectUtil . isNotEmpty ( beforTaskObj ) ) {
if ( ObjectUtil . isNotEmpty ( beforTaskObj ) ) {
throw new BadRequestException ( "存在指令号为'" + beforTaskObj . getString ( "task_code" ) + "' 未完成!" ) ;
throw new BadRequestException ( "存在指令号为'" + beforTaskObj . getString ( "task_code" ) + "' 未完成!" ) ;
}
}
@ -232,8 +230,7 @@ public class SendMaterialTask extends AbstractAcsTask {
if ( StrUtil . isEmpty ( is_full ) ) {
if ( StrUtil . isEmpty ( is_full ) ) {
throw new BadRequestException ( "是否满托不能为空!" ) ;
throw new BadRequestException ( "是否满托不能为空!" ) ;
}
}
JSONObject workInfo = WQL . getWO ( "QSTRUCT_RULE" ) . addParam ( "flag" , "1" ) . addParam ( "code" , start_point_code )
JSONObject workInfo = WQL . getWO ( "QSTRUCT_RULE" ) . addParam ( "flag" , "1" ) . addParam ( "code" , start_point_code ) . process ( ) . uniqueResult ( 0 ) ;
. process ( ) . uniqueResult ( 0 ) ;
String workprocedure_id = workInfo . getString ( "workprocedure_id" ) ;
String workprocedure_id = workInfo . getString ( "workprocedure_id" ) ;
WorkProcedureEnum workProcedureEnum = WorkProcedureEnum . get ( workprocedure_id ) ;
WorkProcedureEnum workProcedureEnum = WorkProcedureEnum . get ( workprocedure_id ) ;
String vehilce_type = "" ;
String vehilce_type = "" ;
@ -263,9 +260,12 @@ public class SendMaterialTask extends AbstractAcsTask {
qty_unit_id = BussConstant . HN_IN_QTY_UNIT_ID ;
qty_unit_id = BussConstant . HN_IN_QTY_UNIT_ID ;
bill_type = BillTypeEnum . FJRK . getCode ( ) ;
bill_type = BillTypeEnum . FJRK . getCode ( ) ;
endArea_type = AreaEnum . BZZC . getCode ( ) ;
endArea_type = AreaEnum . BZZC . getCode ( ) ;
vehicle_code = startPoint . getVehicle_code ( ) ;
if ( StrUtil . equals ( is_full , "1" ) ) {
if ( StrUtil . equals ( is_full , "1" ) ) {
next_point_code = "BZX01" ;
next_point_code = "BZX01" ;
if ( StrUtil . equals ( vehicle_code , "0" ) ) {
vehicle_code = startPoint . getVehicle_code ( ) ;
}
}
}
break ;
break ;
@ -288,11 +288,7 @@ public class SendMaterialTask extends AbstractAcsTask {
//创建入库单据
//创建入库单据
//假如静置时间为空,则取物料表上的静置时间
//假如静置时间为空,则取物料表上的静置时间
if ( StrUtil . isEmpty ( stewing_time ) ) {
if ( StrUtil . isEmpty ( stewing_time ) ) {
stewing_time = WQLObject
stewing_time = WQLObject . getWQLObject ( "md_me_material" ) . query ( "material_id ='" + material_id + "'" ) . uniqueResult ( 0 ) . getString ( "stewing_time" ) ;
. getWQLObject ( "md_me_material" )
. query ( "material_id ='" + material_id + "'" )
. uniqueResult ( 0 )
. getString ( "stewing_time" ) ;
}
}
JSONObject iosObj = new JSONObject ( ) ;
JSONObject iosObj = new JSONObject ( ) ;
iosObj . put ( "iostorinv_id" , IdUtil . getSnowflake ( 1 , 1 ) . nextId ( ) ) ;
iosObj . put ( "iostorinv_id" , IdUtil . getSnowflake ( 1 , 1 ) . nextId ( ) ) ;
@ -330,9 +326,7 @@ public class SendMaterialTask extends AbstractAcsTask {
//终点点加锁
//终点点加锁
HashMap lock_map = new HashMap ( ) ;
HashMap lock_map = new HashMap ( ) ;
lock_map . put ( "lock_type" , "01" ) ;
lock_map . put ( "lock_type" , "01" ) ;
WQLObject
WQLObject . getWQLObject ( "sch_base_point" ) . update ( lock_map , "point_code = '" + next_point_code + "'" ) ;
. getWQLObject ( "sch_base_point" )
. update ( lock_map , "point_code = '" + next_point_code + "'" ) ;
CodeUtil . getNewCode ( "TASK_CODE" ) ;
CodeUtil . getNewCode ( "TASK_CODE" ) ;
JSONObject taskObj = new JSONObject ( ) ;
JSONObject taskObj = new JSONObject ( ) ;
taskObj . put ( "task_id" , task_id ) ;
taskObj . put ( "task_id" , task_id ) ;