futurefuturehx
12/25/2018 - 2:34 AM

切割计数

切割计数

//计数器记录下一级结果个数
	            Integer count = 0;
	            String preClr = "";
	            String preName = "";
	            if(clrResult.size()>0) {
		            clrResult.first();
		            preClr = clrResult.getString("CLR_CENTER_NO");
		            preName = clrResult.getString("CENTER_NAME");
		            clrResult.beforeFirst();
	            }
	            logger.debug("clrResult.size():"+clrResult.size());
	            while(clrResult.next()) {
	            	logger.debug("clrResult.getRow():"+clrResult.getRow());
	            	if((!clrResult.getString("CLR_CENTER_NO").equals(preClr))||clrResult.getRow()==clrResult.size()) {
	            		JSONObject jsonObject =new JSONObject();
		            	jsonObject.put("clrCenterNo",preClr);
		            	jsonObject.put("clrCenterName",preName);
		            	if(clrResult.getRow()==clrResult.size()) {
		            		count++;
		            		logger.debug("经过了3");
		            	}
		            	jsonObject.put("resultSize",count);
		            	jsonObject.put("date",date);
		            	logger.debug("jsonObject:"+jsonObject);
		            	retList.add(jsonObject);
		            	preClr=clrResult.getString("CLR_CENTER_NO");
		            	preName=clrResult.getString("CENTER_NAME");
		            	count=1;
	            	}else {
	            		count++;
	            	}
	            }