| | |
| | | import com.yeshi.fanli.entity.admin.GoodsClassAdmin;
|
| | | import com.yeshi.fanli.entity.admin.HotSearchAdmin;
|
| | | import com.yeshi.fanli.entity.admin.RecommendBannerAdmin;
|
| | | import com.yeshi.fanli.entity.admin.RecommendSectionAdmin;
|
| | | import com.yeshi.fanli.entity.admin.RecommendSpecialAdmin;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | |
|
| | |
| | | });
|
| | | LinkedHashMap<Long, Object> newMap = new LinkedHashMap<Long, Object>();
|
| | | for (Entry<Long, GoodsClassAdmin> entry : list) {
|
| | | newMap.put(entry.getKey(), entry.getValue());
|
| | | }
|
| | | return newMap;
|
| | | } else if (obj instanceof RecommendSectionAdmin) {
|
| | | List<Map.Entry<Long, RecommendSectionAdmin>> list = new ArrayList<Map.Entry<Long, RecommendSectionAdmin>>(
|
| | | (Collection) map.entrySet());
|
| | | Collections.sort(list, new Comparator<Map.Entry<Long, RecommendSectionAdmin>>() {
|
| | | public int compare(Map.Entry<Long, RecommendSectionAdmin> mapping1,
|
| | | Map.Entry<Long, RecommendSectionAdmin> mapping2) {
|
| | | int orderby1 = mapping1.getValue().getRecommendSection().getOrderby();
|
| | | int orderby2 = mapping2.getValue().getRecommendSection().getOrderby();
|
| | | return orderby1 - orderby2;
|
| | | }
|
| | | });
|
| | | LinkedHashMap<Long, Object> newMap = new LinkedHashMap<Long, Object>();
|
| | | for (Entry<Long, RecommendSectionAdmin> entry : list) {
|
| | | newMap.put(entry.getKey(), entry.getValue());
|
| | | }
|
| | | return newMap;
|