660e6812424c4语言:JAVA 场景:重构代码,简化,添加中文注释,增强异常处理 代码: @Override public PlanFlowDto getLastTransport(String orderCode) { List list = this.list(new LambdaQueryWrapper().eq(PlanFlow::getOrderCode, orderCode)); PlanFlowDto flowDto = new PlanFlowDto(); if (CollUtil.isNotEmpty(list)) { PlanFlow planFlow = list.stream().filter(e -> e.getFlowOrder().equals(e.getFlowTotal())).findFirst().orElse(new PlanFlow()); flowDto = StreamlineCopyUtil.beanCopy(planFlow, PlanFlowDto.class); } return flowDto; }