java
12 list集合参数传进来 逗号分割查询1,2,3,4, String no = getParamStr( map, "no" ); if( StringUtil.empty( no ) ) { logger.error( "no is null", this ); return getJsonResult( ExceptionCode.PARAM_NULL_ERROR ); } // TODO:具体接口业务逻辑 List noList = new ArrayList(); // noList = Arrays.asList( no.toCharArray().toString() ); if( no.indexOf( "," ) < 0 ) { noList.add( no.substring( 1, no.length() - 1 ) ); } else { for( String str : no.split( "," ) ) { noList.add( str ); } } List commodityList = commodityService.selectByNoList( noList ); 13 封装接口部分属性传输出去 Map retMap = new HashMap(); List list = new ArrayList(); retMap.put( "rencommendType", Integer.parseInt( rencommendType ) ); List recommendWidgetList = widgetService.selectByRencommendType( retMap ); if( !recommendWidgetList.isEmpty() ) { for( RecommendWidget recommendWidget : recommendWidgetList ) { CommodityVO vo = new CommodityVO(); int id = recommendWidget.getTargetEntityId(); Commodity commodity = commodityService.selectByPrimaryKey( id ); vo.setId( commodity.getId() ); vo.setImgPath( recommendWidget.getImgPath() ); vo.setName( commodity.getName() ); vo.setPriceMeili( commodity.getPriceMeili() ); list.add( vo ); } } if( list != null ) { return getSuccessJsonResult( list );