@ -432,8 +432,16 @@ public class ScheduleServiceImpl implements ScheduleService {
}
@Override
public ScheduleData getScheduleDataBySeqNo ( String seqNo ) {
return scheduleMapper . getScheduleDataBySeqNo ( seqNo ) ;
public ScheduleData getScheduleDataBySeqNo ( SearchScheduleData inData ) {
if ( inData = = null | | ! StringUtils . hasText ( inData . getSeqNo ( ) ) ) {
return null ;
}
SearchScheduleData query = new SearchScheduleData ( ) ;
query . setSeqNo ( inData . getSeqNo ( ) ) ;
if ( inData . getItemNo ( ) ! = null & & inData . getItemNo ( ) > 0 ) {
query . setItemNo ( inData . getItemNo ( ) ) ;
}
return scheduleMapper . getScheduleDataBySeqNo ( query ) ;
}
@Override
@ -1363,7 +1371,9 @@ public class ScheduleServiceImpl implements ScheduleService {
if ( ! StringUtils . hasText ( seqNo ) ) {
throw new XJException ( "派工单号不能为空" ) ;
}
ScheduleData scheduleData = scheduleMapper . getScheduleDataBySeqNo ( seqNo ) ;
SearchScheduleData query = new SearchScheduleData ( ) ;
query . setSeqNo ( seqNo ) ;
ScheduleData scheduleData = scheduleMapper . getScheduleDataBySeqNo ( query ) ;
if ( scheduleData = = null ) {
throw new XJException ( "未找到对应的派工单信息" ) ;
}
@ -3944,8 +3954,20 @@ public class ScheduleServiceImpl implements ScheduleService {
List < ScheduleTodoDetailRecordEntity > reportList = scheduleTodoDetailRecordMapper . selectByInfoCodeAndStage (
site , buNo , infoCode , TODO_DETAIL_STAGE_REPORT ) ;
String processExceptionNo = trimToEmpty ( inData . get ( "mrbInspectionReport" ) ) ;
if ( ! StringUtils . hasText ( processExceptionNo ) ) {
processExceptionNo = trimToEmpty ( inData . get ( "processExceptionNo" ) ) ;
}
String orderNo = trimToEmpty ( inData . get ( "orderNo" ) ) ;
String seqNoText = trimToEmpty ( inData . get ( "seqNo" ) ) ;
if ( ! StringUtils . hasText ( processExceptionNo )
& & StringUtils . hasText ( orderNo )
& & StringUtils . hasText ( seqNoText ) ) {
List < Map < String , Object > > mrbDetailList = scheduleMrbExceptionDetailMapper . getDetailList ( site , orderNo , seqNoText , infoCode ) ;
processExceptionNo = resolveProcessExceptionNo ( mrbDetailList ) ;
}
if ( CollectionUtils . isEmpty ( triggerList ) ) {
String orderNo = trimToEmpty ( inData . get ( "orderNo" ) ) ;
Integer seqNo = toInteger ( inData . get ( "seqNo" ) ) ;
if ( StringUtils . hasText ( orderNo ) & & seqNo ! = null ) {
List < ShiftChangeProductionReportEntity > cacheList = shiftChangeProductionReportMapper . selectUnprocessedData ( site , orderNo , seqNo ) ;
@ -3958,6 +3980,7 @@ public class ScheduleServiceImpl implements ScheduleService {
Map < String , Object > result = new HashMap < > ( ) ;
result . put ( "triggerList" , triggerList = = null ? new ArrayList < > ( ) : triggerList ) ;
result . put ( "reportList" , reportList = = null ? new ArrayList < > ( ) : reportList ) ;
result . put ( "mrbInspectionReport" , processExceptionNo ) ;
return result ;
}
@ -4222,7 +4245,9 @@ public class ScheduleServiceImpl implements ScheduleService {
return "" ;
}
try {
ScheduleData scheduleData = scheduleMapper . getScheduleDataBySeqNo ( inData . getSeqNo ( ) ) ;
SearchScheduleData query = new SearchScheduleData ( ) ;
query . setSeqNo ( inData . getSeqNo ( ) ) ;
ScheduleData scheduleData = scheduleMapper . getScheduleDataBySeqNo ( query ) ;
if ( scheduleData = = null ) {
return "" ;
}
@ -4592,6 +4617,25 @@ public class ScheduleServiceImpl implements ScheduleService {
return detailList ;
}
private String resolveProcessExceptionNo ( List < Map < String , Object > > mrbDetailList ) {
if ( CollectionUtils . isEmpty ( mrbDetailList ) ) {
return "" ;
}
for ( Map < String , Object > row : mrbDetailList ) {
if ( row = = null ) {
continue ;
}
String value = trimToEmpty ( row . get ( "mrbInspectionReport" ) ) ;
if ( ! StringUtils . hasText ( value ) ) {
value = trimToEmpty ( row . get ( "processExceptionNo" ) ) ;
}
if ( StringUtils . hasText ( value ) ) {
return truncate ( value , 100 ) ;
}
}
return "" ;
}
private void fillSplitRuleMetricData ( Map < String , Object > resultMap ,
SplitRollMetricContext metricContext ,
SysSceneExceptionRuleConditionEntity condition ) {