首页 > 代码库 > Lambda表达式实用
Lambda表达式实用
public List<SettlementExportView> querySettlementExport(SettlementDemandQueryReq req) { JdbcQuery.Builder queryBuilder = JdbcQuery.from(SettlementExportView.class); SettlementExportViewMetaData md = SettlementExportViewMetaData.instance; DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); //开始结束日期 querySettleCondition(req, DemandViewEntityMetaData.instance, queryBuilder); List<SettlementExportView> list = InstanceFactory.getInstance(SettlementExportViewDao.class).query(queryBuilder.build()); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); return list.stream() .filter(input -> input.getScore()!=null && input.getScore() > 0) .map(view -> { if (view.getUploadQuantity() == null) { view.setUploadQuantity(0d); } if (view.getFinishQuantity() == null) { view.setFinishQuantity(0d); } switch (view.getStatus()) { case SETTLEMENT: view.setStatusName("已结算"); view.setSettlePeriod(dateFormat.format(view.getSettlementDate())); break; case FINISH: if (view.isNeedCheck()) { view.setNeedCheckStr("Y"); }else{ view.setNeedCheckStr("N"); } if (view.getSettlementDate() != null) { view.setStatusName("已结算"); view.setSettlePeriod(dateFormat.format(view.getSettlementDate())); } break; default: view.setStatusName("未结算"); view.setFinishDate(null); } return view; }) .collect(Collectors.toList()); }
Lambda表达式实用
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。