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

Commit 2ce4b3c3 authored by 胡佳晨's avatar 胡佳晨

提交日志

parent ace5b09c
...@@ -68,10 +68,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -68,10 +68,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
List<String> skuAndPreListAndNumber = CollectionUtil.arrayListString(); List<String> skuAndPreListAndNumber = CollectionUtil.arrayListString();
List<String> platformCodeList = CollectionUtil.arrayListString(); List<String> platformCodeList = CollectionUtil.arrayListString();
List<String> storeCodeList = CollectionUtil.arrayListString(); List<String> storeCodeList = CollectionUtil.arrayListString();
List<GoblinOrderSqlParam> orderSqlParams = ObjectUtil.getGoblinOrderSqlParamArrayListList(); List<GoblinOrderSqlParam> orderSqlParams = ObjectUtil.getGoblinOrderSqlParamArrayListList();
String orderMasterCode = IDGenerator.storeMasterCode();//总订单id String orderMasterCode = IDGenerator.storeMasterCode();//总订单id
GoblinOrderPreParam preParam = GoblinOrderPreParam.getNew(); GoblinOrderPreParam preParam = GoblinOrderPreParam.getNew();
preParam.setAuthCode(param.getAuthCode()); preParam.setAuthCode(param.getAuthCode());
preParam.setPayType(param.getPayType()); preParam.setPayType(param.getPayType());
...@@ -91,11 +90,13 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -91,11 +90,13 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
AddressVo addressesVo = null; AddressVo addressesVo = null;
if (noZhengzaiOrder(uid)) { if (noZhengzaiOrder(uid)) {
addressesVo = param.getAddressesVo(); addressesVo = param.getAddressesVo();
long time3 = System.currentTimeMillis();
if (orderUtils.getMember(uid) != null) { if (orderUtils.getMember(uid) != null) {
isMember = true; isMember = true;
} else { } else {
isMember = false; isMember = false;
} }
log.error("获取会员信息:"+(System.currentTimeMillis()-time3)+"ms");
} else { } else {
isMember = false; isMember = false;
} }
...@@ -107,7 +108,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -107,7 +108,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
String skuId = skuParam.getSkuId(); String skuId = skuParam.getSkuId();
int number = skuParam.getNumber(); int number = skuParam.getNumber();
GoblinGoodsSkuInfoVo skuVo = redisUtils.getGoodsSkuInfoVo(skuId); GoblinGoodsSkuInfoVo skuVo = redisUtils.getGoodsSkuInfoVo(skuId);
log.info("获取skuVo" + (System.currentTimeMillis() - time3) + "ms"); log.error("获取skuVo" + (System.currentTimeMillis() - time3) + "ms");
if (!(skuVo.getStatus().equals("3") && skuVo.getShelvesStatus().equals("3")) || skuVo.getDelFlg().equals("1")) { if (!(skuVo.getStatus().equals("3") && skuVo.getShelvesStatus().equals("3")) || skuVo.getDelFlg().equals("1")) {
throw new Exception("不可购买"); throw new Exception("不可购买");
} }
...@@ -129,7 +130,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -129,7 +130,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
} }
int surplusGeneral = redisUtils.decrSkuStock(pre, skuId, number); int surplusGeneral = redisUtils.decrSkuStock(pre, skuId, number);
skuAndPreListAndNumber.add(skuId + "," + pre + "," + number); skuAndPreListAndNumber.add(skuId + "," + pre + "," + number);
log.info("判断逻辑 " + (System.currentTimeMillis() - time3) + "ms"); log.error("判断逻辑 " + (System.currentTimeMillis() - time3) + "ms");
//库存回滚 //库存回滚
if (surplusGeneral < 0) { if (surplusGeneral < 0) {
redisUtils.incrSkuStock(pre, skuId, number); redisUtils.incrSkuStock(pre, skuId, number);
...@@ -137,9 +138,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -137,9 +138,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
} }
}//GoblinOrderSkuParam }//GoblinOrderSkuParam
//下单 //下单
Long orderTime = System.currentTimeMillis();
GoblinOrderPreParam pre = order(param, storeParam, uid, isMember, addressesVo, orderMasterCode, orderId, orderCode, platformCodeList, storeCodeList); GoblinOrderPreParam pre = order(param, storeParam, uid, isMember, addressesVo, orderMasterCode, orderId, orderCode, platformCodeList, storeCodeList);
log.error("下单接口耗时" + (System.currentTimeMillis() - orderTime) + "ms");
preParam.setPriceActual(preParam.getPriceActual().add(pre.getPriceActual())); preParam.setPriceActual(preParam.getPriceActual().add(pre.getPriceActual()));
preParam.setStoreName(preParam.getStoreName() + "," + pre.getStoreName()); preParam.setStoreName(preParam.getStoreName() + "," + pre.getStoreName());
preParam.setSkuName(preParam.getSkuName() + "," + pre.getSkuName()); preParam.setSkuName(preParam.getSkuName() + "," + pre.getSkuName());
...@@ -237,6 +236,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -237,6 +236,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
Long time3 = System.currentTimeMillis(); Long time3 = System.currentTimeMillis();
GoblinGoodsSkuInfoVo skuVo = redisUtils.getGoodsSkuInfoVo(skuParam.getSkuId()); GoblinGoodsSkuInfoVo skuVo = redisUtils.getGoodsSkuInfoVo(skuParam.getSkuId());
GoblinGoodsInfoVo spuVo = redisUtils.getGoodsInfoVo(skuParam.getSpuId()); GoblinGoodsInfoVo spuVo = redisUtils.getGoodsInfoVo(skuParam.getSpuId());
log.error("获取会员sku&spu:"+(System.currentTimeMillis()-time3)+"ms");
//todo //todo
if (!spuVo.getStoreId().equals(storeParam.getStoreId()) || !skuVo.getStoreId().equals(storeParam.getStoreId())) { if (!spuVo.getStoreId().equals(storeParam.getStoreId()) || !skuVo.getStoreId().equals(storeParam.getStoreId())) {
throw new Exception("非法参数"); throw new Exception("非法参数");
...@@ -254,18 +254,18 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -254,18 +254,18 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
} }
//活动价格 //活动价格
time3 = System.currentTimeMillis(); time3 = System.currentTimeMillis();
if (pre != null) { // if (pre != null) {
GoblinGoodsSkuInfoVo skuMarketVo = redisUtils.getGoodsSkuInfoVo(skuParam.getSkuId().split(pre)[0]); // GoblinGoodsSkuInfoVo skuMarketVo = redisUtils.getGoodsSkuInfoVo(skuParam.getSkuId().split(pre)[0]);
priceBase = skuMarketVo.getPrice(); // priceBase = skuMarketVo.getPrice();
if (isMember) { // if (isMember) {
priceBase = skuMarketVo.getPriceMember(); // priceBase = skuMarketVo.getPriceMember();
} // }
} else { // } else {
priceBase = skuVo.getPrice(); priceBase = skuVo.getPrice();
if (isMember) { if (isMember) {
priceBase = skuVo.getPriceMember(); priceBase = skuVo.getPriceMember();
} }
} // }
//todo //todo
//获得活动优惠价格 //获得活动优惠价格
// priceBase = priceBase.multiply(BigDecimal.valueOf(skuParam.getNumber())); // priceBase = priceBase.multiply(BigDecimal.valueOf(skuParam.getNumber()));
...@@ -315,7 +315,6 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -315,7 +315,6 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
spuIds = spuIds.concat(item.getSpuId() + ","); spuIds = spuIds.concat(item.getSpuId() + ",");
} }
} }
long time3 = System.currentTimeMillis();
HashMap<String, Object> hashMap = orderUtils.useCoupon(platVoucherCode, "购买商品[" + orderCode + "]", storeTotalPrice, spuIds, uid); HashMap<String, Object> hashMap = orderUtils.useCoupon(platVoucherCode, "购买商品[" + orderCode + "]", storeTotalPrice, spuIds, uid);
//todo //todo
if (hashMap != null) { if (hashMap != null) {
...@@ -340,9 +339,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -340,9 +339,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
spuIds = spuIds.concat(item.getSpuId() + ","); spuIds = spuIds.concat(item.getSpuId() + ",");
} }
} }
long time1 = System.currentTimeMillis();
GoblinUseResultVo storeCouponVo = orderUtils.useStoreCoupon(storeVoucherCode, "购买商品[" + orderCode + "]", storeTotalPrice, spuIds, uid); GoblinUseResultVo storeCouponVo = orderUtils.useStoreCoupon(storeVoucherCode, "购买商品[" + orderCode + "]", storeTotalPrice, spuIds, uid);
log.info("goblin接口调用:" + (System.currentTimeMillis() - time1) + "秒");
String typeVoucher; String typeVoucher;
if (storeCouponVo != null) { if (storeCouponVo != null) {
storeVoucherPrice = storeCouponVo.getValue(); storeVoucherPrice = storeCouponVo.getValue();
...@@ -356,6 +353,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -356,6 +353,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
} }
long time3 = System.currentTimeMillis(); long time3 = System.currentTimeMillis();
GoblinStoreInfoVo storeInfoVo = redisUtils.getStoreInfoVo(storeId); GoblinStoreInfoVo storeInfoVo = redisUtils.getStoreInfoVo(storeId);
log.error("获取店铺信息:"+(System.currentTimeMillis()-time3)+"ms");
//生成订单 //生成订单
GoblinStoreOrder storeOrder = GoblinStoreOrder.getNew(); GoblinStoreOrder storeOrder = GoblinStoreOrder.getNew();
storeOrder.setMasterOrderCode(orderMasterCode); storeOrder.setMasterOrderCode(orderMasterCode);
...@@ -426,7 +424,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -426,7 +424,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
return preParam; return preParam;
} }
private ResponseDto<GoblinPayInnerResultVo> payOrder(GoblinOrderPreParam preParam, List<GoblinOrderSqlParam> sqlParams, String uid) { private ResponseDto<GoblinPayInnerResultVo> payOrder(GoblinOrderPreParam
preParam, List<GoblinOrderSqlParam> sqlParams, String uid) {
long timeAll = System.currentTimeMillis(); long timeAll = System.currentTimeMillis();
//是否免费 //是否免费
boolean isFree = false; boolean isFree = false;
...@@ -525,8 +524,6 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -525,8 +524,6 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
LinkedList<Object[]> sqlDataAttr = CollectionUtil.linkedListObjectArr(); LinkedList<Object[]> sqlDataAttr = CollectionUtil.linkedListObjectArr();
List<GoblinStoreOrderVo> orderVoList = ObjectUtil.getGoblinStoreOrderVoArrayList(); List<GoblinStoreOrderVo> orderVoList = ObjectUtil.getGoblinStoreOrderVoArrayList();
List<GoblinOrderSkuVo> skuVoList = ObjectUtil.getGoblinOrderSkuVoArrayList(); List<GoblinOrderSkuVo> skuVoList = ObjectUtil.getGoblinOrderSkuVoArrayList();
time3 = System.currentTimeMillis();
for (GoblinOrderSqlParam item : sqlParams) { for (GoblinOrderSqlParam item : sqlParams) {
long time2 = System.currentTimeMillis(); long time2 = System.currentTimeMillis();
List<String> goblinOrderSkuIdList = CollectionUtil.linkedListString(); List<String> goblinOrderSkuIdList = CollectionUtil.linkedListString();
...@@ -537,7 +534,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -537,7 +534,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
}); });
//订单 orderSku Vo //订单 orderSku Vo
GoblinOrderSkuVo orderSkuVo = GoblinOrderSkuVo.getNew().copy(orderSku); GoblinOrderSkuVo orderSkuVo = GoblinOrderSkuVo.getNew().copy(orderSku);
// redisUtils.setGoblinOrderSku(orderSkuVo.getOrderSkuId(), orderSkuVo); redisUtils.setGoblinOrderSku(orderSkuVo.getOrderSkuId(), orderSkuVo);
goblinOrderSkuIdList.add(orderSkuVo.getOrderSkuId()); goblinOrderSkuIdList.add(orderSkuVo.getOrderSkuId());
skuVoList.add(orderSkuVo); skuVoList.add(orderSkuVo);
} }
...@@ -567,7 +564,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -567,7 +564,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
orderVo.setOrderSkuVoIds(goblinOrderSkuIdList); orderVo.setOrderSkuVoIds(goblinOrderSkuIdList);
orderVo.setCreatedAt(getNowTime()); orderVo.setCreatedAt(getNowTime());
time2 = System.currentTimeMillis(); time2 = System.currentTimeMillis();
// redisUtils.setGoblinOrder(orderVo.getOrderId(), orderVo); redisUtils.setGoblinOrder(orderVo.getOrderId(), orderVo);
redisUtils.setMasterCode(orderVo.getMasterOrderCode(), preParam.getOrderIdList().substring(1)); redisUtils.setMasterCode(orderVo.getMasterOrderCode(), preParam.getOrderIdList().substring(1));
orderVoList.add(orderVo); orderVoList.add(orderVo);
......
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