记得上下班打卡 | git大法好,push需谨慎

Commit 8db755de authored by 胡佳晨's avatar 胡佳晨

修改 refundCode 改为 雪花id

parent 244568e8
...@@ -25,6 +25,7 @@ public class KylinRedisConst { ...@@ -25,6 +25,7 @@ public class KylinRedisConst {
public static final String TIMES = "kylin:times:id:"; public static final String TIMES = "kylin:times:id:";
public static final String AGENT = "kylin:agent:info"; public static final String AGENT = "kylin:agent:info";
public static final String ORDER_LIST = "kylin:order:list:userId:"; public static final String ORDER_LIST = "kylin:order:list:userId:";
public static final String ORDER_REFUND_TEMP = "kylin:order:refund:";
public static final String ORDER_REFUND_BY_ORDER_ID = "kylin:order:refund:orderId:"; public static final String ORDER_REFUND_BY_ORDER_ID = "kylin:order:refund:orderId:";
public static final String ORDER_REFUND = "kylin:order:refund:orderRefundsId:"; public static final String ORDER_REFUND = "kylin:order:refund:orderRefundsId:";
......
...@@ -103,9 +103,9 @@ public class KylinRefundsStatusServiceImpl { ...@@ -103,9 +103,9 @@ public class KylinRefundsStatusServiceImpl {
kylinOrderRefunds.setOrderRefundsId(orderRefundsId); kylinOrderRefunds.setOrderRefundsId(orderRefundsId);
kylinOrderRefunds.setOrderTicketsId(orderInfo.getOrderTicketsId()); kylinOrderRefunds.setOrderTicketsId(orderInfo.getOrderTicketsId());
String orderRefundCode = orderInfo.getOrderCode(); String orderRefundCode = orderInfo.getOrderCode();
String codeNum = StringUtils.leftPad(String.valueOf(refundCount), 3, "0"); // String codeNum = StringUtils.leftPad(String.valueOf(refundCount), 3, "0");
long currentTime = System.currentTimeMillis()% 100; // long currentTime = System.currentTimeMillis()% 100;
kylinOrderRefunds.setOrderRefundCode(orderRefundCode.concat(codeNum)+currentTime); kylinOrderRefunds.setOrderRefundCode(orderRefundCode.concat(dataUtils.incrOrderRefundCode(orderInfo.getOrderCode())+""));
kylinOrderRefunds.setPrice(refundPrice); kylinOrderRefunds.setPrice(refundPrice);
kylinOrderRefunds.setPriceExpress(priceExpress); kylinOrderRefunds.setPriceExpress(priceExpress);
kylinOrderRefunds.setPriceCharges(priceCharges); kylinOrderRefunds.setPriceCharges(priceCharges);
...@@ -262,9 +262,9 @@ public class KylinRefundsStatusServiceImpl { ...@@ -262,9 +262,9 @@ public class KylinRefundsStatusServiceImpl {
kylinOrderRefunds.setOrderRefundsId(orderRefundsId); kylinOrderRefunds.setOrderRefundsId(orderRefundsId);
kylinOrderRefunds.setOrderTicketsId(orderInfo.getOrderTicketsId()); kylinOrderRefunds.setOrderTicketsId(orderInfo.getOrderTicketsId());
String orderRefundCode = orderInfo.getOrderCode(); String orderRefundCode = orderInfo.getOrderCode();
String codeNum = StringUtils.leftPad(String.valueOf(refundCount), 3, "0"); // String codeNum = StringUtils.leftPad(String.valueOf(refundCount), 3, "0");
long currentTime = System.currentTimeMillis()% 100; // long currentTime = System.currentTimeMillis()% 100;
kylinOrderRefunds.setOrderRefundCode(orderRefundCode.concat(codeNum)+currentTime); kylinOrderRefunds.setOrderRefundCode(orderRefundCode.concat(dataUtils.incrOrderRefundCode(orderInfo.getOrderCode())+""));
kylinOrderRefunds.setPrice(BigDecimal.valueOf(refundPrice)); kylinOrderRefunds.setPrice(BigDecimal.valueOf(refundPrice));
kylinOrderRefunds.setPriceExpress(orderInfo.getPriceExpress()); kylinOrderRefunds.setPriceExpress(orderInfo.getPriceExpress());
kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY); kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY);
......
...@@ -1451,4 +1451,8 @@ public class DataUtils { ...@@ -1451,4 +1451,8 @@ public class DataUtils {
public void incrArCode() { public void incrArCode() {
redisUtil.incr(KylinRedisConst.ACTIVE_USE_AR_COUNT, 1); redisUtil.incr(KylinRedisConst.ACTIVE_USE_AR_COUNT, 1);
} }
public int incrOrderRefundCode(String orderCode) {
return (int) redisUtil.incr(KylinRedisConst.ORDER_REFUND_TEMP + orderCode,1);
}
} }
...@@ -121,9 +121,9 @@ public class KylinRefundsStatusServiceImpl { ...@@ -121,9 +121,9 @@ public class KylinRefundsStatusServiceImpl {
kylinOrderRefunds.setOrderRefundsId(orderRefundsId); kylinOrderRefunds.setOrderRefundsId(orderRefundsId);
kylinOrderRefunds.setOrderTicketsId(orderTicketsId); kylinOrderRefunds.setOrderTicketsId(orderTicketsId);
String orderRefundCode = orderInfo.getOrderCode(); String orderRefundCode = orderInfo.getOrderCode();
long currentTime = System.currentTimeMillis()% 100; // long currentTime = System.currentTimeMillis()% 100;
String codeNum = StringUtils.leftPad(String.valueOf(5), 3, "0"); // String codeNum = StringUtils.leftPad(String.valueOf(5), 3, "0");
kylinOrderRefunds.setOrderRefundCode(orderRefundCode.concat(codeNum)+ currentTime); kylinOrderRefunds.setOrderRefundCode(orderRefundCode.concat(dataUtils.incrOrderRefundCode(orderInfo.getOrderCode())+""));
kylinOrderRefunds.setPrice(entitiesPriceSum); kylinOrderRefunds.setPrice(entitiesPriceSum);
kylinOrderRefunds.setPriceExpress(RefundPriceExpress); kylinOrderRefunds.setPriceExpress(RefundPriceExpress);
kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY); kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY);
......
...@@ -73,6 +73,10 @@ public class DataUtils { ...@@ -73,6 +73,10 @@ public class DataUtils {
redisUtil.set(KylinRedisConst.ORDER_LIST + userId, vo); redisUtil.set(KylinRedisConst.ORDER_LIST + userId, vo);
} }
public int incrOrderRefundCode(String orderCode) {
return (int) redisUtil.incr(KylinRedisConst.ORDER_REFUND_TEMP + orderCode,1);
}
public List<KylinOrderListVo> getOrderList(String userId) { public List<KylinOrderListVo> getOrderList(String userId) {
Object obj = redisUtil.get(KylinRedisConst.ORDER_LIST + userId); Object obj = redisUtil.get(KylinRedisConst.ORDER_LIST + userId);
if (obj != null) { if (obj != null) {
......
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