@ -61,14 +61,26 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
case "1" :
jsonObject . put ( "start_point_code" , device_code ) ;
jsonObject . put ( "create_mode" , "01" ) ;
produceInfoByCode = this . getProduceInfoByCode ( device_code ) ;
//批次 物料,客户要从排产单里面去取
jsonObject . put ( "pcsn" , "pcsn" ) ;
jsonObject . put ( "create_mode" , "01" ) ;
jsonObject . put ( "material_id" , produceInfoByCode . getString ( "material_id" ) ) ;
jsonObject . put ( "cust_id" , produceInfoByCode . getString ( "cust_id" ) ) ;
jsonObject . put ( "stewing_time" , produceInfoByCode . getString ( "stewing_time" ) ) ;
jsonObject . put ( "producetask_id" , produceInfoByCode . getString ( "producetask_id" ) ) ;
if ( ! StrUtil . equals ( device_code , "CYBZW" ) ) {
produceInfoByCode = this . getProduceInfoByCode ( device_code ) ;
jsonObject . put ( "material_id" , produceInfoByCode . getString ( "material_id" ) ) ;
produceInfoByCode = this . getProduceInfoByCode ( device_code ) ;
//批次 物料,客户要从排产单里面去取
jsonObject . put ( "create_mode" , "01" ) ;
jsonObject . put ( "material_id" , produceInfoByCode . getString ( "material_id" ) ) ;
jsonObject . put ( "cust_id" , produceInfoByCode . getString ( "cust_id" ) ) ;
jsonObject . put ( "stewing_time" , produceInfoByCode . getString ( "stewing_time" ) ) ;
jsonObject . put ( "producetask_id" , produceInfoByCode . getString ( "producetask_id" ) ) ;
} else {
String vehicle_code = ( String ) jsonObject . get ( "vehicle_code" ) ;
JSONObject groupObj = WQLObject . getWQLObject ( "st_buss_vehiclegroup" ) . query ( "vehicle_code='" + vehicle_code + "'" , "create_time desc" ) . uniqueResult ( 0 ) ;
jsonObject . put ( "create_mode" , "01" ) ;
jsonObject . put ( "material_id" , groupObj . getString ( "material_uuid" ) ) ;
jsonObject . put ( "cust_id" , groupObj . getString ( "cust_id" ) ) ;
jsonObject . put ( "stewing_time" , "0" ) ;
jsonObject . put ( "vehicle_code" , vehicle_code ) ;
jsonObject . put ( "producetask_id" , groupObj . getString ( "producetask_id" ) ) ;
}
sendMaterialTask . createTask ( ( JSONObject ) JSON . toJSON ( jsonObject ) ) ;
break ;
case "2" :
@ -78,9 +90,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
//批次 物料,客户要从排产单里面去取
jsonObject . put ( "pcsn" , "pcsn" ) ;
if ( ! StrUtil . equals ( device_code , "RY W") ) {
if ( ! StrUtil . equals ( device_code , "CYBZ W" ) ) {
produceInfoByCode = this . getProduceInfoByCode ( device_code ) ;
jsonObject . put ( "material_id" , produceInfoByCode . getString ( "material_id" ) ) ;
jsonObject . put ( "material_id" , produceInfoByCode . getString ( "material_id" ) ) ;
}
@ -114,10 +126,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
StrUtil . equals ( device_code , "YZJ07XL02" ) | |
StrUtil . equals ( device_code , "YZJ08XL01" ) | |
StrUtil . equals ( device_code , "YZJ08XL02" ) | |
StrUtil . equals ( device_code , "FJJXS01MD1" ) | |
StrUtil . equals ( device_code , "FJJXS01MD2" ) | |
StrUtil . equals ( device_code , "FJJXS02MD1" ) | |
StrUtil . equals ( device_code , "FJJXS02MD2" )
StrUtil . equals ( device_code , "FJMDJXSDJW01" ) | |
StrUtil . equals ( device_code , "FJMDJXSDJW02" )
) {
produceInfoByCode = this . getProduceInfoByCode ( device_code ) ;
String material_id = produceInfoByCode . getString ( "material_id" ) ;
@ -163,7 +173,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONObject produceInfoByCode = new JSONObject ( ) ;
String device_code = ( String ) jsonObject . get ( "device_code" ) ;
String vehicle_code = ( String ) jsonObject . get ( "vehicle_code" ) ;
String qty = String . valueOf ( jsonObject . get ( "qty" ) ) ;
String qty = String . valueOf ( jsonObject . get ( "qty" ) ) ;
produceInfoByCode = this . getProduceInfoByCode ( device_code ) ;
String material_id = ( String ) produceInfoByCode . get ( "material_id" ) ;
String cust_id = ( String ) produceInfoByCode . get ( "cust_id" ) ;
@ -257,8 +267,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
String producetask_id = vehicleObj . getString ( "producetask_id" ) ;
JSONObject taskObj = WQLObject . getWQLObject ( "PDM_MG_produceTask" ) . query ( "producetask_id='" + producetask_id + "'" ) . uniqueResult ( 0 ) ;
//1代表去出窑,2 是优先包装
String is_package = "1" ;
if ( StrUtil . equals ( taskObj . getString ( "is_package" ) , "1" ) ) {
is_package = "2" ;
}
JSONObject returnjo = new JSONObject ( ) ;
returnjo . put ( "is_package" , taskObj . getString ( "is_package" ) ) ;
returnjo . put ( "is_package" , is_package ) ;
return returnjo ;
}
@ -288,6 +303,21 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
vehicle_table . insert ( json ) ;
JSONObject returnjo = new JSONObject ( ) ;
returnjo . put ( "vehicle_code" , vehicle_code ) ;
returnjo . put ( "status" , HttpStatus . OK . value ( ) ) ;
//将起点终点确定不下发的任务查出来,将木托盘点位解锁,起点改为扫描点,is_auto_issue 改为1,
String device_code = ( String ) jsonObject . get ( "device_code" ) ;
WQLObject task_Table = WQLObject . getWQLObject ( "SCH_BASE_Task" ) ;
JSONObject taskObj = task_Table . query ( "task_status='04' and is_auto_issue='0'" , "create_time desc" ) . uniqueResult ( 0 ) ;
String start_point_code = taskObj . getString ( "start_point_code" ) ;
WQLObject pointTable = WQLObject . getWQLObject ( "sch_base_point" ) ;
JSONObject startObj = pointTable . query ( "point_code ='" + start_point_code + "'" ) . uniqueResult ( 0 ) ;
startObj . put ( "lock_type" , "00" ) ;
pointTable . update ( startObj ) ;
taskObj . put ( "start_point_code" , device_code ) ;
taskObj . put ( "is_auto_issue" , "1" ) ;
taskObj . put ( "vehicle_code" , vehicle_code ) ;
task_Table . update ( taskObj ) ;
//
return returnjo ;
}
@ -311,19 +341,25 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
@Transactional ( rollbackFor = Exception . class )
public Map < String , Object > getVehicleInfoBycode ( Map jsonObject ) {
String vehicle_code = ( String ) jsonObject . get ( "vehicle_code" ) ;
String device_code = ( String ) jsonObject . get ( "device_code" ) ;
JSONObject pointObj = WQLObject . getWQLObject ( "sch_base_point" ) . query ( "point_code='" + device_code + "'" ) . uniqueResult ( 0 ) ;
String vehicle_code = pointObj . getString ( "vehicle_code" ) ;
if ( StrUtil . isEmpty ( vehicle_code ) ) {
throw new BadRequestException ( "托盘编码不能为空!" ) ;
throw new BadRequestException ( "点位编码为'" + device_code + "'未找到托盘信息 !" ) ;
}
JSONObject vehicleObj = WQLObject . getWQLObject ( "st_buss_vehiclegroup" ) . query ( "vehicle_code='" + vehicle_code + "' AND is_delete='0'" ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( vehicleObj ) ) {
throw new BadRequestException ( "未找到托盘号为'" + vehicle_code + "'的托盘信息!" ) ;
}
return vehicleObj ;
JSONObject result = new JSONObject ( ) ;
result . put ( "status" , HttpStatus . OK . value ( ) ) ;
result . put ( "message" , "反馈成功!" ) ;
result . put ( "data" , vehicleObj ) ;
return result ;
}
@Override
public Map < String , Object > sureProduceTask ( Map jsonObject ) {
public Map < String , Object > sureProduceTask ( Map jsonObject ) {
String producetask_code = ( String ) jsonObject . get ( "producetask_code" ) ;
String device_code = ( String ) jsonObject . get ( "device_code" ) ;
String material_code = ( String ) jsonObject . get ( "material_code" ) ;
@ -352,15 +388,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
throw new BadRequestException ( "物料编码不能为空!" ) ;
}
if ( ! StrUtil . equals ( materialObj . getString ( "material_id" ) , taskObj . getString ( "material_id" ) ) ) {
throw new BadRequestException ( "物料标识不一样!" ) ;
if ( ! StrUtil . equals ( materialObj . getString ( "material_id" ) , taskObj . getString ( "material_id" ) ) ) {
throw new BadRequestException ( "物料标识不一样!" ) ;
}
taskObj . put ( "producetask_status" , "04" ) ;
}
if ( StrUtil . equals ( "2" , type ) ) {
taskObj . put ( "producetask_status" , "05" ) ;
taskObj . put ( "real_qty" , qty ) ;
taskObj . put ( "real_qty" , qty ) ;
}
taskTable . update ( taskObj ) ;
JSONObject result = new JSONObject ( ) ;
@ -378,7 +414,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
for ( int i = 0 ; i < array . size ( ) ; i + + ) {
JSONObject row = array . getJSONObject ( i ) ;
String task_id = row . getString ( "ext_task_uuid" ) ;
row . put ( "task_id" , task_id ) ;
row . put ( "task_id" , task_id ) ;
TaskDto taskDto = taskService . findById ( task_id ) ;
String processing_class = taskDto . getHandle_class ( ) ;
//1:执行中,2:完成 ,3:acs取消