@@ -18,6 +18,9 @@ import org.nl.common.utils.IdUtil;
import org.nl.modules.common.exception.BadRequestException ;
import org.nl.modules.wql.WQL ;
import org.nl.modules.wql.core.bean.WQLObject ;
import org.nl.modules.wql.util.SpringContextHolder ;
import org.nl.wms.ext.acs.service.AcsToWmsService ;
import org.nl.wms.ext.acs.service.WmsToAcsService ;
import org.nl.wms.pda.mps.eum.RegionTypeEnum ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.stereotype.Service ;
@@ -61,6 +64,12 @@ public class InBoxManageServiceImpl implements InBoxManageService {
*/
private final IschBaseTaskService ischBaseTaskService ;
@Autowired
private WmsToAcsService wmsToAcsService ;
@Autowired
private AcsToWmsService acsToWmsService ;
@Override
@Transactional ( rollbackFor = Exception . class )
public void inBox ( JSONObject whereJson ) {
@@ -116,6 +125,9 @@ public class InBoxManageServiceImpl implements InBoxManageService {
jsonTaskParam . put ( " next_device_code " , jsonAttr . getString ( " struct_code " ) ) ;
jsonTaskParam . put ( " vehicle_code " , whereJson . getString ( " box_no " ) ) ;
jsonTaskParam . put ( " vehicle_code2 " , whereJson . getString ( " vehicle_code " ) ) ;
JSONObject param = new JSONObject ( ) ;
param . put ( " vehicle_type " , boxDao . getVehicle_type ( ) ) ;
jsonTaskParam . put ( " request_param " , param . toString ( ) ) ;
TwoInBoxTask taskBean = new TwoInBoxTask ( ) ;
taskBean . createTask ( jsonTaskParam ) ;
@@ -137,7 +149,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
// 载具表
WQLObject vehicleTab = WQLObject . getWQLObject ( " md_pb_storagevehicleinfo " ) ;
// 载具扩展属性表
WQLObject veExtTab = WQLObject. getWQLObject( " md_pb_storagevehicleext" ) ;
// WQLObject veExtTab = WQLObject. getWQLObject(" md_pb_storagevehicleext") ;
/*
* 查询mes木箱信息, 插入木箱信息表
*/
@@ -174,12 +186,54 @@ public class InBoxManageServiceImpl implements InBoxManageService {
// jsonVeExt.put("device_uuid", IdUtil.getLongId());
// veExtTab.insert(jsonVeExt);
// 下发桁架任务
//查询当前入库拆叠盘位的托盘类型是否一致如果一致
String vehicle_type = boxDao . getVehicle_type ( ) ;
// 判断入库叠盘位的 托盘类型是否相同、是否叠满
JSONObject device_jo = new JSONObject ( ) ;
device_jo . put ( " device_code " , " RK1004 " ) ;
device_jo . put ( " product_area " , IOSEnum . PRODUCT_AREA . code ( " BLK " ) ) ;
JSONArray device_ja = new JSONArray ( ) ;
device_ja . add ( device_jo ) ;
JSONObject device_data = wmsToAcsService . getPointStatus ( device_ja ) ;
JSONObject data = device_data . getJSONArray ( " data " ) . getJSONObject ( 0 ) ;
//如果此时拆叠盘位为空
if ( data . getString ( " move " ) . equals ( IOSEnum . IS_NOTANDYES . code ( " 否 " ) ) ) {
//生成空托盘出库任务
JSONObject apply_jo = new JSONObject ( ) ;
apply_jo . put ( " device_code " , " RK1004 " ) ;
apply_jo . put ( " type " , " 3 " ) ;
apply_jo . put ( " container_type " , vehicle_type ) ;
acsToWmsService . applyTwo ( apply_jo ) ;
} else {
if ( ! data . getString ( " container_type " ) . equals ( vehicle_type ) ) {
//给ACS下发拆叠盘位的空托盘入库信号, 并进行空托盘出库
JSONArray action_rows = new JSONArray ( ) ;
JSONObject action_jo = new JSONObject ( ) ;
action_jo . put ( " device_code " , " RK1004 " ) ;
action_jo . put ( " code " , " to_command " ) ;
action_jo . put ( " product_area " , IOSEnum . PRODUCT_AREA . code ( " BLK " ) ) ;
action_jo . put ( " value " , " 4 " ) ;
action_rows . add ( action_jo ) ;
wmsToAcsService . action ( action_rows ) ;
//生成空托盘出库任务
JSONObject apply_jo = new JSONObject ( ) ;
apply_jo . put ( " device_code " , " RK1004 " ) ;
apply_jo . put ( " type " , " 3 " ) ;
apply_jo . put ( " container_type " , vehicle_type ) ;
acsToWmsService . applyTwo ( apply_jo ) ;
}
}
JSONObject taskParam = new JSONObject ( ) ;
taskParam . put ( " task_type " , " 010713 " ) ;
taskParam . put ( " start_device_code " , whereJson . getString ( " point_code " ) ) ;
taskParam . put ( " next_device_code " , " RK1005 " ) ;
taskParam . put ( " vehicle_code " , whereJson . getString ( " vehicle_code " ) ) ;
taskParam. put ( " vehicle_code2" , whereJson. getString( " vehicle_code " ) ) ;
taskParam . put ( " vehicle_code " , whereJson . getString ( " box_no " ) ) ;
// taskParam.put(" vehicle_code2", whereJson. getString("box_no")) ;
JSONObject param = new JSONObject ( ) ;
param . put ( " layer " , whereJson . getString ( " layer " ) ) ;
param . put ( " length " , boxDao . getBox_length ( ) ) ;