---
title: "java"
author: "maicose"
date: "2014-12-09T12:10:28Z"
tags: ["Java"]
categories: ["编程语言"]
slug: "java"
draft: false
lastmod: "2014-12-09T12:10:28Z"
id: 2164437
url: "https://maicose.iteye.com/blog/2164437"
---

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( "," ) &lt; 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 );