取得下一个Id 商品分类Id组成(2010年后的年月日时分秒+本机Id五位)
()
| 26 | * 商品分类Id组成(2010年后的年月日时分秒+本机Id五位) |
| 27 | */ |
| 28 | public Long nextNumber(){ |
| 29 | //这里是atoNum到MAX_VALUE=9999的时候重新设成0 |
| 30 | int MAX_VALUE = 99999; |
| 31 | number.compareAndSet(MAX_VALUE, 0); |
| 32 | DateTime end = new DateTime(); |
| 33 | //计算区间毫秒数 |
| 34 | Duration d = new Duration(begin, end); |
| 35 | long second = d.getStandardSeconds();//秒 |
| 36 | |
| 37 | return Long.parseLong(second+(String.format("%05d", number.incrementAndGet()))); |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * 标签放入标签中(递归) |
no test coverage detected