if else 代码优化. java代码优化
程序员文章站
2024-02-13 10:24:16
...
if (orderId.startsWith("Company")) {
List<CompanyInfoVO> list = companyInfoService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
} else if (orderId.startsWith("AgentCharge")) {// 代理记账
List<AgentChargeVO> list = agentChargeService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
} else if (orderId.startsWith("Other")) {// 其他业务
List<CompanyOtherVO> list = companyOtherService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
} else if (orderId.startsWith("TrademarkRegister")) {// 商标注册
List<TrademarkRegisterVO> list = trademarkRegisterService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
} else if (orderId.startsWith("TrademarkChange")) {// 商标变更
List<TrademarkChangeVO> list = trademarkChangeService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
} else if (orderId.startsWith("TrademarkReview")) {// 商标复议
List<TrademarkReviewVO> list = trademarkReviewService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
} else if (orderId.startsWith("TradeCompany")) {// 商标复议
List<TradeCompanyVO> list = tradeCompanyService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
} else if (orderId.startsWith("TradeTrademark")) {// 商标复议
List<TradeTrademarkVO> list = tradeTrademarkService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
}
List<CompanyInfoVO> list = companyInfoService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
} else if (orderId.startsWith("AgentCharge")) {// 代理记账
List<AgentChargeVO> list = agentChargeService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
} else if (orderId.startsWith("Other")) {// 其他业务
List<CompanyOtherVO> list = companyOtherService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
} else if (orderId.startsWith("TrademarkRegister")) {// 商标注册
List<TrademarkRegisterVO> list = trademarkRegisterService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
} else if (orderId.startsWith("TrademarkChange")) {// 商标变更
List<TrademarkChangeVO> list = trademarkChangeService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
} else if (orderId.startsWith("TrademarkReview")) {// 商标复议
List<TrademarkReviewVO> list = trademarkReviewService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
} else if (orderId.startsWith("TradeCompany")) {// 商标复议
List<TradeCompanyVO> list = tradeCompanyService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
} else if (orderId.startsWith("TradeTrademark")) {// 商标复议
List<TradeTrademarkVO> list = tradeTrademarkService.list(condition);
if (list.isEmpty()) {
return list.get(0).getPaymentStatus();
}
}