Commit 4094c1ba by zhiheng.zhang

取餐码代码抽取

parent 99245caf
...@@ -71,6 +71,7 @@ import org.apache.commons.lang.StringUtils; ...@@ -71,6 +71,7 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.FastDateFormat; import org.apache.commons.lang.time.FastDateFormat;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
...@@ -78,7 +79,9 @@ import java.math.BigDecimal; ...@@ -78,7 +79,9 @@ import java.math.BigDecimal;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException; import java.security.spec.InvalidKeySpecException;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -87,6 +90,11 @@ import static cn.freemud.constant.OrderRefundConstant.ALLOW_REFUND; ...@@ -87,6 +90,11 @@ import static cn.freemud.constant.OrderRefundConstant.ALLOW_REFUND;
@Component @Component
public class OrderAdapter { public class OrderAdapter {
public final static String TAKECODEKEY = "takecode";
public static final String REDIS_KEY_SEP = ":";
public static final String numberChar = "0123456789";
public static final String numberCharWithoutZero = "12345";
private static FastDateFormat yyyyMMddHHmmss = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss", Locale.CHINA); private static FastDateFormat yyyyMMddHHmmss = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss", Locale.CHINA);
private static String SPMCHID = "1237482502"; private static String SPMCHID = "1237482502";
...@@ -123,6 +131,9 @@ public class OrderAdapter { ...@@ -123,6 +131,9 @@ public class OrderAdapter {
private static Gson gson = new Gson(); private static Gson gson = new Gson();
@Autowired
private RedisTemplate redisTemplate;
/** /**
* @param createOrderVo * @param createOrderVo
* @param shoppingCartGoodsDto * @param shoppingCartGoodsDto
......
...@@ -28,6 +28,7 @@ import org.apache.commons.lang.ObjectUtils; ...@@ -28,6 +28,7 @@ import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.jaxb.OrderAdapter;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment