|
|
|
@ -26,7 +26,10 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.StringJoiner;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
|
import java.util.function.Function;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
@ -323,31 +326,6 @@ public class MesWorkOrderCutCheckStepService extends BaseStepService {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//验证扫描信息属于工艺强过码 并且支持跳过,进行数据变更
|
|
|
|
|
private void updateProductionPartAndPsInContextList(StationRequestBean reqBean, List<MesProductionPartContext> productionPartContextList, List<MesProductionPsInContext> cachedProductionPsInContextList, String craftJumpCode) {
|
|
|
|
|
productionPartContextList.forEach(o -> {
|
|
|
|
|
if (o.getCheckSeqResult().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0) {
|
|
|
|
|
o.setCraftJumpCode(craftJumpCode);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
cachedProductionPsInContextList.forEach(o -> {
|
|
|
|
|
if (o.getCheckCraftResult().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0) o.setCraftJumpCode(craftJumpCode);
|
|
|
|
|
});
|
|
|
|
|
//保存上下文产出零件信息
|
|
|
|
|
productionDispatchContextStepService.dispatchProductionPartContext(reqBean, productionPartContextList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//验证是否支持跳过
|
|
|
|
|
private Boolean checkIsAllowJump(List<MesProductionPartContext> productionPartContextList, List<MesProductionPsInContext> cachedProductionPsInContextList) {
|
|
|
|
|
Optional<MesProductionPartContext> optional1 = CollectionUtils.isEmpty(productionPartContextList) ? null : productionPartContextList.stream().filter(o -> (null != o && o.getCheckSeqResult().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).findFirst();
|
|
|
|
|
Optional<MesProductionPsInContext> optional2 = CollectionUtils.isEmpty(cachedProductionPsInContextList) ? null : cachedProductionPsInContextList.stream().filter(o -> (null != o && o.getCheckCraftResult().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).findFirst();
|
|
|
|
|
if (null != optional1 && optional1.isPresent()) return true;
|
|
|
|
|
if (null != optional2 && optional2.isPresent()) return true;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<MesProductionPartContext> removeBusiData(StationRequestBean reqBean) {
|
|
|
|
|
productionDispatchContextStepService.removeProductionPartContext(reqBean);
|
|
|
|
|
productionDispatchContextStepService.removeProductionPsInContext(reqBean);
|
|
|
|
@ -356,24 +334,10 @@ public class MesWorkOrderCutCheckStepService extends BaseStepService {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//验证扫描信息是否属于工艺强过码
|
|
|
|
|
public Boolean matchCraftJumpCode(MesProductionProcessContext productionProcessContext, List<MesEquipVariableCollectContext> equipVariableCollectContextList) {
|
|
|
|
|
if (equipVariableCollectContextList.size() != 1 || MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue() != equipVariableCollectContextList.get(0).getMessageSource()) return false;
|
|
|
|
|
if (!equipVariableCollectContextList.get(0).getEquipVariableValue().equals(productionProcessContext.getCraftJumpCode())) return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据是否空腔搜集数据
|
|
|
|
|
public List<MesProductionPartContext> filterProductionPartContext(List<MesProductionPartContext> productionPartContextList, Boolean flag) {
|
|
|
|
|
return flag ? productionPartContextList.stream().filter(o -> (null != o && o.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).collect(Collectors.toList()) :
|
|
|
|
|
productionPartContextList.stream().filter(o -> (null != o && o.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0)).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//验证是否全部为空腔
|
|
|
|
|
public Boolean checkIsAllFinishCode(StationRequestBean reqBean, List<MesProductionPartContext> productionPartContextList) {
|
|
|
|
|
Optional<MesProductionPartContext> optional = productionPartContextList.stream().filter(o -> (null != o && o.getIsFinishCode().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).findFirst();
|
|
|
|
|
if (null != optional && optional.isPresent()) return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|