MCPcopy Create free account
hub / github.com/diyhi/bbs / nextNumber

Method nextNumber

src/main/java/cms/component/topic/TagComponent.java:28–38  ·  view source on GitHub ↗

取得下一个Id 商品分类Id组成(2010年后的年月日时分秒+本机Id五位)

()

Source from the content-addressed store, hash-verified

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 * 标签放入标签中(递归)

Callers 4

addMembershipCardMethod · 0.45
addTagMethod · 0.45
addTagMethod · 0.45
addHelpTypeMethod · 0.45

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected