@ -18,6 +18,7 @@ import org.nl.wms.basedata.service.dto.VehicleDto;
import org.nl.wms.ext.acs.service.AcsToWmsService ;
import org.nl.wms.ext.acs.service.AcsToWmsService ;
import org.nl.wms.log.LokiLog ;
import org.nl.wms.log.LokiLog ;
import org.nl.wms.log.LokiLogType ;
import org.nl.wms.log.LokiLogType ;
import org.nl.wms.sch.manage.RegionEnum ;
import org.nl.wms.sch.manage.TaskStatusEnum ;
import org.nl.wms.sch.manage.TaskStatusEnum ;
import org.nl.wms.sch.manage.WorkOrderEnum ;
import org.nl.wms.sch.manage.WorkOrderEnum ;
import org.nl.wms.sch.service.TaskService ;
import org.nl.wms.sch.service.TaskService ;
@ -188,6 +189,59 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if ( ObjectUtil . isEmpty ( type ) ) throw new BadRequestException ( "类型不能为空" ) ;
if ( ObjectUtil . isEmpty ( type ) ) throw new BadRequestException ( "类型不能为空" ) ;
if ( ObjectUtil . isEmpty ( point_code ) ) throw new BadRequestException ( "点位不能为空" ) ;
if ( ObjectUtil . isEmpty ( point_code ) ) throw new BadRequestException ( "点位不能为空" ) ;
// 类型映射
String regionId = WQLObject
. getWQLObject ( "sch_base_point" )
. query ( "point_code = '" + point_code + "'" )
. uniqueResult ( 0 )
. getString ( "region_id" ) ;
switch ( type ) {
case "1" :
// 设备送料入库
if ( StrUtil . equals ( regionId , RegionEnum . HNQ . getId ( ) ) ) {
type = "1" ;
} else if ( StrUtil . equals ( regionId , RegionEnum . YZQ . getId ( ) ) ) {
type = "5" ;
} else if ( StrUtil . equals ( regionId , RegionEnum . YQ . getId ( ) ) ) {
type = "8" ;
} else if ( StrUtil . equals ( regionId , RegionEnum . ZDCDX . getId ( ) ) ) {
type = "11" ;
}
break ;
case "2" :
// 设备叫料出库
if ( StrUtil . equals ( regionId , RegionEnum . YZQ . getId ( ) ) ) {
type = "3" ;
} else if ( StrUtil . equals ( regionId , RegionEnum . YQ . getId ( ) ) ) {
type = "7" ;
} else if ( StrUtil . equals ( regionId , RegionEnum . ZDCDX . getId ( ) ) ) {
type = "9" ;
}
break ;
case "3" :
// 设备送空托盘
if ( StrUtil . equals ( regionId , RegionEnum . YZQ . getId ( ) ) ) {
type = "4" ;
} else if ( StrUtil . equals ( regionId , RegionEnum . ZDCDX . getId ( ) ) ) {
type = "10" ;
} else if ( StrUtil . equals ( regionId , RegionEnum . KGTDPQ . getId ( ) ) ) {
type = "13" ;
}
break ;
case "4" :
// 设备叫空托盘
if ( StrUtil . equals ( regionId , RegionEnum . HNQ . getId ( ) ) ) {
type = "2" ;
} else if ( StrUtil . equals ( regionId , RegionEnum . YZQ . getId ( ) ) ) {
type = "6" ;
} else if ( StrUtil . equals ( regionId , RegionEnum . ZDCDX . getId ( ) ) ) {
type = "12" ;
}
break ;
default :
throw new BadRequestException ( "ACS任务类型错误" ) ;
}
// 参数统一获取
// 参数统一获取
JSONObject param = new JSONObject ( ) ;
JSONObject param = new JSONObject ( ) ;
param . put ( "vehicle_code" , vehicle_code ) ;
param . put ( "vehicle_code" , vehicle_code ) ;
@ -395,6 +449,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
jsonObject . put ( "type" , "5" ) ;
jsonObject . put ( "type" , "5" ) ;
}
}
this . apply ( jsonObject ) ;
this . apply ( jsonObject ) ;
jsonObject . put ( "type" , "1" ) ;
this . apply ( ( JSONObject ) jsonObject ) ;
}
}
/ * *
/ * *
@ -464,7 +520,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
//将起点终点确定不下发的任务查出来,将木托盘点位解锁,起点改为扫描点,is_auto_issue 改为1,
//将起点终点确定不下发的任务查出来,将木托盘点位解锁,起点改为扫描点,is_auto_issue 改为1,
String device_code = ( String ) jsonObject . get ( "device_code" ) ;
String device_code = ( String ) jsonObject . get ( "device_code" ) ;
WQLObject task_Table = WQLObject . getWQLObject ( "SCH_BASE_Task" ) ;
WQLObject task_Table = WQLObject . getWQLObject ( "SCH_BASE_Task" ) ;
JSONObject taskObj = task_Table . query ( "task_status='" + TaskStatusEnum . START_AND_POINT . getCode ( ) + "' and is_auto_issue='0'" , "create_time desc" ) . uniqueResult ( 0 ) ;
JSONObject taskObj = task_Table . query ( "task_status='" + TaskStatusEnum . START_AND_POINT . getCode ( ) + "' and is_auto_issue='0'" , "create_time desc" ) . uniqueResult ( 0 ) ;
String start_point_code = taskObj . getString ( "point_code1" ) ;
String start_point_code = taskObj . getString ( "point_code1" ) ;
WQLObject pointTable = WQLObject . getWQLObject ( "sch_base_point" ) ;
WQLObject pointTable = WQLObject . getWQLObject ( "sch_base_point" ) ;
JSONObject startObj = pointTable . query ( "point_code ='" + start_point_code + "'" ) . uniqueResult ( 0 ) ;
JSONObject startObj = pointTable . query ( "point_code ='" + start_point_code + "'" ) . uniqueResult ( 0 ) ;