|
|
@ -3,7 +3,9 @@ package cn.estsh.i3plus.core.apiservice.util;
|
|
|
|
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
|
|
|
|
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysOrderNoRule;
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysOrderNoRule;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import java.text.MessageFormat;
|
|
|
|
import java.text.MessageFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
@ -18,8 +20,16 @@ import java.text.SimpleDateFormat;
|
|
|
|
public class OrderNoMakeUtil {
|
|
|
|
public class OrderNoMakeUtil {
|
|
|
|
|
|
|
|
|
|
|
|
public static SysOrderNoRule next(SysOrderNoRule orderNoRule) {
|
|
|
|
public static SysOrderNoRule next(SysOrderNoRule orderNoRule) {
|
|
|
|
StringBuilder orderNo = new StringBuilder(orderNoRule.getOrderNoRule());
|
|
|
|
// 数据校验
|
|
|
|
|
|
|
|
if(orderNoRule == null || StringUtils.isBlank(orderNoRule.getOrderNoRule())){
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_NOT_EXIT.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("单号生成规则不存在")
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder orderNo = new StringBuilder(orderNoRule.getOrderNoRule());
|
|
|
|
String[] dateTime = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(System.currentTimeMillis()).split("-");
|
|
|
|
String[] dateTime = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(System.currentTimeMillis()).split("-");
|
|
|
|
// 单号表达式
|
|
|
|
// 单号表达式
|
|
|
|
replace(orderNo, PlatformConstWords.YEAR, dateTime[0]);
|
|
|
|
replace(orderNo, PlatformConstWords.YEAR, dateTime[0]);
|
|
|
|