@ -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 ) ;
@ -197,19 +251,19 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
/ *
/ *
* 根据type判断是什么业务类型 :
* 根据type判断是什么业务类型 :
* 1 . 混碾机送料入库 - 困料货架
* 1 . 混碾机送料入库 - 困料货架
* 2 . 混碾机呼叫空托盘
* 2 . 混碾机呼叫空托盘
* 3 . 压制机上料位叫料出库
* 3 . 压制机上料位叫料出库
* 4 . 压制机上料位送空盅
* 4 . 压制机上料位送空盅
* 5 . 压制机满料入库
* 5 . 压制机满料入库
* 6 . 压制机呼叫空钢托盘
* 6 . 压制机呼叫空钢托盘
* 7 . 烧制叫料出库
* 7 . 烧制叫料出库
* 8 . 烧制送料入库
* 8 . 烧制送料入库
* 9 . 分拣叫料出库
* 9 . 分拣叫料出库
* 10 . 分拣送空钢托盘
* 10 . 分拣送空钢托盘
* 11 . 分拣送料入库
* 11 . 分拣送料入库
* 12 . 分拣呼叫木托盘
* 12 . 分拣呼叫木托盘
* 13 . 叠盘区送空钢托盘
* 13 . 叠盘区送空钢托盘
* /
* /
switch ( type ) {
switch ( type ) {
case "1" :
case "1" :
@ -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 ) ;