public Map<String, List<MyServiceOrder>> getyyMyServiceOrders(Integer userId) {
List<ServiceOrders> allOrders = this.serviceOrdersDao.getOrdersByUserId(userId);
Map<String, List<MyServiceOrder>> map = new HashMap<>();
for (ServiceOrders order : allOrders) {
String yyStatus = this.getyyOrderStatus(order.getYyStatus().toString());
if (StringUtils.isBlank(yyStatus)) {
continue;
}
MyServiceOrder myOrder = this.getMyServiceOrder(order);
if (map.containsKey(yyStatus)) {
map.get(yyStatus).add(myOrder);
} else {
List<MyServiceOrder> list = new ArrayList<>();
list.add(myOrder);
map.put(yyStatus, list);
}
}
return map;
List<ServiceOrders> allOrders = this.serviceOrdersDao.getOrdersByUserId(userId);
Map<String, List<MyServiceOrder>> map = new HashMap<>();
for (ServiceOrders order : allOrders) {
String yyStatus = this.getyyOrderStatus(order.getYyStatus().toString());
if (StringUtils.isBlank(yyStatus)) {
continue;
}
MyServiceOrder myOrder = this.getMyServiceOrder(order);
if (map.containsKey(yyStatus)) {
map.get(yyStatus).add(myOrder);
} else {
List<MyServiceOrder> list = new ArrayList<>();
list.add(myOrder);
map.put(yyStatus, list);
}
}
return map;
}
private String getyyOrderStatus(String status) {
//定义待处理2
if ("1,2".indexOf(status) >= 0) {
return OrderStatus.YYWAITING_PAY.getValue();
}
//定义待收货3
if ("3,4,5,6".indexOf(status) >= 0) {
return OrderStatus.YYPAID.getValue();
}
//定义待评价6
if ("7,8".indexOf(status) >= 0) {
return OrderStatus.YYWAITING_DEAL.getValue();
}
return null;
}