页面自动加载时赋值,页面用的ajax请求。
-- Create sequence
create sequence SEQ_COMP_PREREGID_NOminvalue 1
maxvalue 99999
start with 6
increment by 1
cache 20
cycle;
调用service
public String autoCompPreregid() {
// 日期格式
String date=DateTimeUtil.fromtDate(new Date(), "yyMMdd");
// 5位序列
int num = this.dao.getSequenceValue("NO");
String str ="0000"+num;
if(str.length()>6){
str.substring(1);
}
return date+str;
}