@@ -1471,7 +1471,8 @@ public class MesToLmsServiceImpl implements MesToLmsService {
public JSONObject sendProcessInfo ( JSONObject param ) {
log . info ( " sendProcessInfo输入参数为: ------------------- " + param . toString ( ) ) ;
WQLObject coolIvtTab = WQLObject . getWQLObject ( " ST_IVT_CoolPointIvt " ) ; // 冷却区点位库存表
// 冷却区点位库存表
WQLObject coolIvtTab = WQLObject . getWQLObject ( " ST_IVT_CoolPointIvt " ) ;
JSONObject resultParam = new JSONObject ( ) ;
try {
@@ -1500,10 +1501,6 @@ public class MesToLmsServiceImpl implements MesToLmsService {
//上料
if ( " 1 " . equals ( Type ) ) {
String up_scroll = device_jo . getString ( " up_scroll " ) ;
String up_pcsn = device_jo . getString ( " up_pcsn " ) ;
/*if (StrUtil.isNotEmpty(up_pcsn)) {
throw new BadRequestException("LMS系统上【" + ResourceName + "】表处机上还存在母卷号,不能进行上料!");
}*/
//查询母卷所在点位
JSONObject jsonCoolIvt = coolIvtTab . query ( " container_name = ' " + containerName + " ' and full_point_status = '02' and cool_ivt_status <> '04' " ) . uniqueResult ( 0 ) ;
JSONObject form = new JSONObject ( ) ;
@@ -1512,7 +1509,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
form . put ( " point_code1 " , jsonCoolIvt . getString ( " full_point_code " ) ) ;
form . put ( " point_code2 " , device_jo . getString ( " up_point_code " ) ) ;
form . put ( " task_type " , " 010702 " ) ;
form . put ( " material_code " , jsonCoolIvt . getString ( " container_n ame" ) ) ;
form . put ( " material_code " , containerN ame ) ;
form . put ( " vehicle_code " , jsonCoolIvt . getString ( " full_vehicle_code " ) ) ;
form . put ( " product_area " , device_jo . getString ( " product_area " ) ) ;
} else {
@@ -1531,7 +1528,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
form . put ( " point_code4 " , jsonIvt . getString ( " empty_point_code " ) ) ;
}
form . put ( " task_type " , " 010701 " ) ;
form . put ( " material_code " , jsonCoolIvt . getString ( " container_n ame" ) ) ;
form . put ( " material_code " , containerN ame ) ;
form . put ( " vehicle_code " , jsonCoolIvt . getString ( " full_vehicle_code " ) ) ;
form . put ( " product_area " , device_jo . getString ( " product_area " ) ) ;
}
@@ -1549,7 +1546,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
//寻找可用的冷却区满轴点位
form . put ( " point_code2 " , jsonIvt . getString ( " full_point_code " ) ) ;
form . put ( " task_type " , " 010704 " ) ;
form . put ( " material_code " , device_jo . getString ( " up_pcsn " ) ) ;
form . put ( " material_code " , containerName ) ;
form . put ( " vehicle_code " , device_jo . getString ( " up_scroll " ) ) ;
form . put ( " product_area " , device_jo . getString ( " product_area " ) ) ;
processTask . createTask ( form ) ;
@@ -1568,6 +1565,89 @@ public class MesToLmsServiceImpl implements MesToLmsService {
return resultParam ;
}
@Override
@Transactional ( rollbackFor = Exception . class )
public JSONObject processFoilStart ( JSONObject param ) {
log . info ( " processFoilStart接口输入参数为: ------------------- " + param . toString ( ) ) ;
String FoilContainerName = param . getString ( " FoilContainerName " ) ;
String TRContainerName = param . getString ( " TRContainerName " ) ;
String ResourceName = param . getString ( " ResourceName " ) ;
String MfgOrderName = param . getString ( " MfgOrderName " ) ;
String ProductName = param . getString ( " ProductName " ) ;
String Description = param . getString ( " Description " ) ;
String UpCoilerDate = param . getString ( " UpCoilerDate " ) ;
WQLObject pointTab = WQLObject . getWQLObject ( " st_ivt_stpointivt " ) ;
WQLObject orderTab = WQLObject . getWQLObject ( " PDM_BI_SurProcessOrder " ) ;
JSONObject result = new JSONObject ( ) ;
try {
// 校验数据
if ( ObjectUtil . isEmpty ( FoilContainerName ) ) {
throw new BadRequestException ( " 母卷号不能为空 " ) ;
}
if ( ObjectUtil . isEmpty ( TRContainerName ) ) {
throw new BadRequestException ( " 表处批次号不能为空 " ) ;
}
if ( ObjectUtil . isEmpty ( ResourceName ) ) {
throw new BadRequestException ( " 机台编码不能为空 " ) ;
}
if ( ObjectUtil . isEmpty ( MfgOrderName ) ) {
throw new BadRequestException ( " 生产工单不能为空 " ) ;
}
if ( ObjectUtil . isEmpty ( ProductName ) ) {
throw new BadRequestException ( " 产品编码不能为空 " ) ;
}
if ( ObjectUtil . isEmpty ( Description ) ) {
throw new BadRequestException ( " 产品名称不能为空 " ) ;
}
if ( ObjectUtil . isEmpty ( UpCoilerDate ) ) {
throw new BadRequestException ( " 开始时间不能为空 " ) ;
}
JSONObject jsonPoint = pointTab . query ( " ext_code =' " + ResourceName + " ' " ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( jsonPoint ) ) {
jsonPoint = new JSONObject ( ) ;
}
// 插入生箔工序工单表
JSONObject json = new JSONObject ( ) ;
json . put ( " workorder_id " , IdUtil . getSnowflake ( 1 , 1 ) . nextId ( ) ) ;
json . put ( " foil_container_ame " , FoilContainerName ) ;
json . put ( " container_name " , TRContainerName ) ;
json . put ( " resource_name " , ResourceName ) ;
json . put ( " mfg_order_name " , MfgOrderName ) ;
json . put ( " product_name " , ProductName ) ;
json . put ( " description " , Description ) ;
json . put ( " up_coiler_date " , UpCoilerDate ) ;
json . put ( " product_area " , jsonPoint . getString ( " product_area " ) ) ;
json . put ( " point_code " , jsonPoint . getString ( " point_code " ) ) ;
json . put ( " realstart_time " , DateUtil . now ( ) ) ;
json . put ( " status " , " 01 " ) ;
json . put ( " is_delete " , " 0 " ) ;
json . put ( " productin_qty " , 0 ) ;
json . put ( " create_id " , " 1 " ) ;
json . put ( " create_name " , " 管理员 " ) ;
json . put ( " create_time " , DateUtil . now ( ) ) ;
orderTab . insert ( json ) ;
// 返回成功
result . put ( " RTYPE " , " S " ) ;
result . put ( " RTMSG " , " 操作成功! " ) ;
result . put ( " RTOAL " , 1 ) ;
result . put ( " RTDAT " , null ) ;
} catch ( Exception e ) {
// 返回失败
result . put ( " RTYPE " , " E " ) ;
result . put ( " RTMSG " , " 操作失败! " + e . getMessage ( ) ) ;
result . put ( " RTOAL " , 0 ) ;
result . put ( " RTDAT " , null ) ;
}
log . info ( " processFoilStart接口输出参数为: ------------------- " + result . toString ( ) ) ;
return result ;
}
@Override
public JSONObject sendTargetHouse ( JSONObject param ) {
log . info ( " sendTargetHouse输入参数为: ------------------- " + param . toString ( ) ) ;