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

Commit 12e0d45b authored by 张禹's avatar 张禹

Merge branch 'pre' into 'master'

Pre

See merge request !298
parents 63c66cdd 479c3ffd
...@@ -345,6 +345,7 @@ public class GoblinRedisConst { ...@@ -345,6 +345,7 @@ public class GoblinRedisConst {
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
public static final String GOBLIN_ORDER_LOG = PREFIX.concat("order:log:");//无用 public static final String GOBLIN_ORDER_LOG = PREFIX.concat("order:log:");//无用
public static final String GOBLIN_EXPRESS_PRICE = PREFIX.concat("express:price");//快递费
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
public static final String GOBLIN_NUM_LIST = PREFIX.concat("nft:num:");//$key+":"+$skuId 根据skuId获取序号list public static final String GOBLIN_NUM_LIST = PREFIX.concat("nft:num:");//$key+":"+$skuId 根据skuId获取序号list
......
...@@ -112,6 +112,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -112,6 +112,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
skuAndPreListAndNumber.add(skuId + "," + pre + "," + number); skuAndPreListAndNumber.add(skuId + "," + pre + "," + number);
// 判断库存 // 判断库存
GoblinGoodsSkuInfoVo skuVo = redisUtils.getGoodsSkuInfoVo(skuParam.getSkuId()); GoblinGoodsSkuInfoVo skuVo = redisUtils.getGoodsSkuInfoVo(skuParam.getSkuId());
if(!skuParam.getSpuId().equals(skuVo.getSpuId())){
throw new Exception("参数异常");
}
int limitCount = skuVo.getBuyLimit() == 0 ? Integer.MAX_VALUE : skuVo.getBuyLimit(); int limitCount = skuVo.getBuyLimit() == 0 ? Integer.MAX_VALUE : skuVo.getBuyLimit();
//判断限购 //判断限购
if (orderUtils.noZhengzaiOrder(uid)) { if (orderUtils.noZhengzaiOrder(uid)) {
...@@ -151,7 +154,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -151,7 +154,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
return orderUtils.orderException(skuAndPreListAndNumber, platformCodeList, storeCodeList, uid, "参数异常"); return orderUtils.orderException(skuAndPreListAndNumber, platformCodeList, storeCodeList, uid, "参数异常");
// throw new Exception("参数异常"); // throw new Exception("参数异常");
} }
return payOrder(preParam, orderSqlParams, uid); ResponseDto<GoblinPayInnerResultVo> data = payOrder(preParam, orderSqlParams, uid);
log.info(UserPathDto.setData("下单(唤起支付)", param, data));
return data;
} catch (Exception e) { } catch (Exception e) {
log.error("Kylin Order Pay Error = {}", e); log.error("Kylin Order Pay Error = {}", e);
Long time3 = System.currentTimeMillis(); Long time3 = System.currentTimeMillis();
...@@ -356,7 +361,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -356,7 +361,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
if (addressesVo == null) { if (addressesVo == null) {
storeOrder.setPriceExpress(BigDecimal.ZERO); storeOrder.setPriceExpress(BigDecimal.ZERO);
} else { } else {
storeOrder.setPriceExpress(BigDecimal.TEN); storeOrder.setPriceExpress(redisUtils.getExpressPrice());
} }
storeOrder.setPriceTotal(storeTotalPrice.add(storeOrder.getPriceExpress())); storeOrder.setPriceTotal(storeTotalPrice.add(storeOrder.getPriceExpress()));
BigDecimal priceActual = storeOrder.getPriceTotal().subtract(voucherPrice).subtract(storeVoucherPrice); BigDecimal priceActual = storeOrder.getPriceTotal().subtract(voucherPrice).subtract(storeVoucherPrice);
...@@ -421,13 +426,13 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -421,13 +426,13 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
String payCode; String payCode;
if (preParam.getPriceActual().compareTo(BigDecimal.valueOf(0)) > 0 && !preParam.getPayType().equals("huifu")) { if (preParam.getPriceActual().compareTo(BigDecimal.valueOf(0)) > 0 && !preParam.getPayType().equals("huifu")) {
// 调用支付 // 调用支付
if (preParam.getPayType().equalsIgnoreCase(DragonConstant.PayChannelEnum.WEPAY.getCode())) { // if (preParam.getPayType().equalsIgnoreCase(DragonConstant.PayChannelEnum.WEPAY.getCode())) {
if (preParam.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.JS.getCode()) || preParam.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.APPLET.getCode())) { // if (preParam.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.JS.getCode()) || preParam.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.APPLET.getCode())) {
if (StringUtil.isEmpty(preParam.getOpenId())) { // if (StringUtil.isEmpty(preParam.getOpenId())) {
return ResponseDto.failure("微信支付openId不能为空!"); // return ResponseDto.failure("微信支付openId不能为空!");
} // }
} // }
} // }
DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew(); DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew();
dragonPayBaseReqDto.setPayType(preParam.getPayType()); dragonPayBaseReqDto.setPayType(preParam.getPayType());
dragonPayBaseReqDto.setDeviceFrom(preParam.getDeviceFrom()); dragonPayBaseReqDto.setDeviceFrom(preParam.getDeviceFrom());
...@@ -616,7 +621,6 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -616,7 +621,6 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
String sqlData = SqlMapping.gets(sqls, sqlDataSku, sqlDataOrder, sqlDataAttr); String sqlData = SqlMapping.gets(sqls, sqlDataSku, sqlDataOrder, sqlDataAttr);
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_ORDER_CREATE_PAY.getKey(), sqlData); queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_ORDER_CREATE_PAY.getKey(), sqlData);
log.info(UserPathDto.setData("下单(唤起支付)", preParam, payInnerResultVo));
if (isFree && preParam.getPayType().equals("huifu")) { if (isFree && preParam.getPayType().equals("huifu")) {
SyncOrderParam syncOrderParam = SyncOrderParam.getNew(); SyncOrderParam syncOrderParam = SyncOrderParam.getNew();
syncOrderParam.setOrderCode(preParam.getOrderMasterCode()); syncOrderParam.setOrderCode(preParam.getOrderMasterCode());
......
...@@ -665,14 +665,14 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -665,14 +665,14 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
if (name.equals("")) { if (name.equals("")) {
name = "正在现场"; name = "正在现场";
} }
// 调用支付 // // 调用支付
if (payOrderParam.getPayType().equalsIgnoreCase(DragonConstant.PayChannelEnum.WEPAY.getCode())) { // if (payOrderParam.getPayType().equalsIgnoreCase(DragonConstant.PayChannelEnum.WEPAY.getCode())) {
if (payOrderParam.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.JS.getCode()) || payOrderParam.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.APPLET.getCode())) { // if (payOrderParam.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.JS.getCode()) || payOrderParam.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.APPLET.getCode())) {
if (StringUtil.isEmpty(payOrderParam.getOpenId())) { // if (StringUtil.isEmpty(payOrderParam.getOpenId())) {
return ResponseDto.failure("微信支付openId不能为空!"); // return ResponseDto.failure("微信支付openId不能为空!");
} // }
} // }
} // }
DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew(); DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew();
dragonPayBaseReqDto.setPayType(payOrderParam.getPayType()); dragonPayBaseReqDto.setPayType(payOrderParam.getPayType());
dragonPayBaseReqDto.setDeviceFrom(payOrderParam.getDeviceFrom()); dragonPayBaseReqDto.setDeviceFrom(payOrderParam.getDeviceFrom());
...@@ -795,13 +795,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -795,13 +795,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
if (name.equals("")) { if (name.equals("")) {
name = "正在现场"; name = "正在现场";
} }
if (payAgainParam.getPayType().equalsIgnoreCase(DragonConstant.PayChannelEnum.WEPAY.getCode())) { // if (payAgainParam.getPayType().equalsIgnoreCase(DragonConstant.PayChannelEnum.WEPAY.getCode())) {
if (payAgainParam.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.JS.getCode()) || payAgainParam.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.APPLET.getCode())) { // if (payAgainParam.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.JS.getCode()) || payAgainParam.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.APPLET.getCode())) {
if (StringUtil.isEmpty(payAgainParam.getOpenId())) { // if (StringUtil.isEmpty(payAgainParam.getOpenId())) {
return ResponseDto.failure("微信支付openId不能为空!"); // return ResponseDto.failure("微信支付openId不能为空!");
} // }
} // }
} // }
DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew(); DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew();
dragonPayBaseReqDto.setPayType(payAgainParam.getPayType()); dragonPayBaseReqDto.setPayType(payAgainParam.getPayType());
dragonPayBaseReqDto.setDeviceFrom(payAgainParam.getDeviceFrom()); dragonPayBaseReqDto.setDeviceFrom(payAgainParam.getDeviceFrom());
......
...@@ -14,6 +14,7 @@ import org.springframework.stereotype.Component; ...@@ -14,6 +14,7 @@ import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
...@@ -722,4 +723,15 @@ public class GoblinRedisUtils { ...@@ -722,4 +723,15 @@ public class GoblinRedisUtils {
return (int) obj; return (int) obj;
} }
} }
//获取快递费
public BigDecimal getExpressPrice() {
String rdk = GoblinRedisConst.GOBLIN_EXPRESS_PRICE;
Object obj = redisUtil.get(rdk);
if (obj == null) {
return BigDecimal.TEN;
} else {
return BigDecimal.valueOf((int) obj);
}
}
} }
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