生成一个订单号的做法
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss"); String newDate=sdf.format(new Date()); String randomStr = RandomStringUtils.randomAlphanumeric(4).toUpperCase(); //生成一个4位随机大写字母+数字组合; deliveryOrder.setId("S"+ newDate + randomStr); org.apache.commons.lang3.RandomStringUtils; 在这个包下面

浙公网安备 33010602011771号