perf(商城): 下单流程

代码优化
master
hequan_waynaqua 4 years ago
parent b9e01b2d1d
commit 75ad6be14e

@ -65,14 +65,10 @@ public class BaseController {
Page<T> tPage = new Page<>(pageNumber, pageSize);
if (StringUtils.isNotEmpty(sortName)) {
String[] split = sortName.split(",");
for (int i = 0; i < split.length; i++) {
for (String s : split) {
OrderItem orderItem = new OrderItem();
orderItem.setColumn(split[i].replaceAll("[A-Z]", "_$0").toLowerCase());
if (sortOrder != null && sortOrder.startsWith(Constants.ORDER_DESC)) {
orderItem.setAsc(false);
} else {
orderItem.setAsc(true);
}
orderItem.setColumn(s.replaceAll("[A-Z]", "_$0").toLowerCase());
orderItem.setAsc(sortOrder == null || !sortOrder.startsWith(Constants.ORDER_DESC));
tPage.addOrder(orderItem);
}
}
@ -105,7 +101,7 @@ public class BaseController {
* @return
*/
protected <T> Page<T> getPage(int pageNumber, int pageSize) {
return new Page<T>(pageNumber, pageSize);
return new Page<>(pageNumber, pageSize);
}
/**
@ -132,9 +128,7 @@ public class BaseController {
* @return
*/
protected String redirectTo(String url) {
StringBuffer rto = new StringBuffer("redirect:");
rto.append(url);
return rto.toString();
return "redirect:" + url;
}
/**

Loading…
Cancel
Save