生成编号

/*kccj为订单号前缀字符串*/
private String createOrderNoByMaxOrderNo(String kccj, PurCheckStockInfoBo purCheckStockInfoBo) {
		//查询条件前缀 到月
		SimpleDateFormat sdfSel = new SimpleDateFormat("yyyyMM");
		String nowDayStr = sdfSel.format(new Date());
		StringBuilder orderNoSel = new StringBuilder();
		orderNoSel.append(kccj).append(nowDayStr);
		//实际拼写订单前缀 到日
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
		String nowDayStrQz = sdf.format(new Date());
		StringBuilder orderNoQz = new StringBuilder();
		orderNoQz.append(kccj).append(nowDayStrQz);
		purCheckStockInfoBo.setDjCodeSel(orderNoSel.toString());
		String maxDjCode = purCheckStockInfoBoDao.selectTodayMaxDjCode(purCheckStockInfoBo);
		return Utils.createDjCodeByMaxOrderNo(orderNoQz,maxDjCode);
	}

 

你可能感兴趣的:(数据库及SQL)