|
|
|
@ -22,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -89,6 +90,13 @@ public class MesWorkOrderCheckNosortStepService extends MesWorkOrderCheckStepSer
|
|
|
|
|
//验证是否支持跳过
|
|
|
|
|
Boolean isAllowJump = checkIsAllowJump(cachedProductionPartContextList);
|
|
|
|
|
|
|
|
|
|
//不属于工艺强过码,如果此前存在工艺验证失败的数据 则清除此前的产出零件信息
|
|
|
|
|
if (!isCraftJumpCode && isAllowJump) {
|
|
|
|
|
//删除上下文产出零件信息
|
|
|
|
|
productionDispatchContextStepService.deleteProductionPartContext(reqBean);
|
|
|
|
|
cachedProductionPartContextList = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//当前不允许跳过
|
|
|
|
|
if (isCraftJumpCode && !isAllowJump)
|
|
|
|
|
return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.SCAN.getValue()).
|
|
|
|
@ -155,20 +163,20 @@ public class MesWorkOrderCheckNosortStepService extends MesWorkOrderCheckStepSer
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//验证扫描信息是否属于工艺强过码
|
|
|
|
|
public Boolean doMatchCraftJumpCode(MesProductionProcessContext productionProcessContext, List<MesEquipVariableCollectContext> equipVariableCollectContextList) {
|
|
|
|
|
private Boolean doMatchCraftJumpCode(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 Boolean checkIsAllowJump(List<MesProductionPartContext> productionPartContextList) {
|
|
|
|
|
private Boolean checkIsAllowJump(List<MesProductionPartContext> productionPartContextList) {
|
|
|
|
|
Optional<MesProductionPartContext> optional = CollectionUtils.isEmpty(productionPartContextList) ? null : productionPartContextList.stream().filter(o -> (null != o && o.getCheckSeqResult().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).findFirst();
|
|
|
|
|
return (null != optional && optional.isPresent()) ? true : false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//验证扫描信息属于工艺强过码 并且支持跳过,进行数据变更
|
|
|
|
|
public void updateProductionPartContextList(StationRequestBean reqBean, List<MesProductionPartContext> productionPartContextList, String craftJumpCode) {
|
|
|
|
|
private void updateProductionPartContextList(StationRequestBean reqBean, List<MesProductionPartContext> productionPartContextList, String craftJumpCode) {
|
|
|
|
|
productionPartContextList.forEach(o -> {
|
|
|
|
|
if (o.getCheckSeqResult().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0) o.setCraftJumpCode(craftJumpCode);
|
|
|
|
|
});
|
|
|
|
|