在项目local.properties里做出如下定义:
keygen.order.code.digits=8
keygen.order.code.start=00000000
keygen.order.code.numeric=true
keygen.order.code.template=$
core-spring.xml:
1
2
3
4
5
6
效果如下:
修改定义后,如果不想重启Hybris server也能让他们立即生效,使用如下Java代码:
import de.hybris.platform.jalo.numberseries.*
NumberSeriesManager nm = NumberSeriesManager.getInstance()
def s = nm.getNumberSeries("order_code")
println "Before: current: ${s.currentNumber} type: ${s.type} template: ${s.template}"
nm.resetNumberSeries(s.key, "777", s.type, s.template )
def s2 = nm.getNumberSeries("order_code")
println "After: current: ${s2.currentNumber} type: ${s2.type} template: ${s2.template}"