for循环记住break跳出

List<DataModel> models = this.modelService.queryDataModelByDevtype(logicResform.getLog_res_devtype());
if (models != null && models.size() > 0){
	for (DataModel model : models){
		if("channel".equals(model.getFieldname())){
			String channelvalue = request.getParameter(PREFIX_FIELD + model.getFieldname());
			if(channelvalue == null || channelvalue.trim().equals("")){
				throw new Exception("通道值不能为空!");
			}
			logicResform.setLogic_res_deveui(buildingid+"."+channelvalue);
			break;
		}
	}
}else{
	throw new Exception("资源类型不能为空!");
}

猜你喜欢

转载自blog.csdn.net/ZHOU_VIP/article/details/110084645
今日推荐