10.8
This commit is contained in:
parent
fe942e2224
commit
c866a4237b
@ -59,7 +59,7 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
|
|||||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("is_use","1");
|
queryWrapper.eq("is_use","1");
|
||||||
queryWrapper.eq("store_id",storeId);
|
queryWrapper.eq("store_id",storeId);
|
||||||
MerchantConfig merchantConfig = baseMapper.selectOne(queryWrapper);
|
// MerchantConfig merchantConfig = baseMapper.selectOne(queryWrapper);
|
||||||
// if (ObjectUtil.isNotEmpty(merchantConfig) && merchantConfig.getIsOpenRule().equals("1")){
|
// if (ObjectUtil.isNotEmpty(merchantConfig) && merchantConfig.getIsOpenRule().equals("1")){
|
||||||
// List<MerchantConfig> list = this.selectMeChByIsOpen(storeId);
|
// List<MerchantConfig> list = this.selectMeChByIsOpen(storeId);
|
||||||
// if (list.size()>0){
|
// if (list.size()>0){
|
||||||
|
@ -123,7 +123,7 @@ public interface OilOrderService extends IService<OilOrder> {
|
|||||||
* @param oilOrder
|
* @param oilOrder
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String addOilOrder(OilOrder oilOrder);
|
public OilOrder addOilOrder(OilOrder oilOrder);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序订单支付
|
* 小程序订单支付
|
||||||
|
@ -1575,7 +1575,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String addOilOrder(OilOrder oilOrder) {
|
public OilOrder addOilOrder(OilOrder oilOrder) {
|
||||||
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo1();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo1();
|
||||||
// 根据日期生成订单信息
|
// 根据日期生成订单信息
|
||||||
@ -1614,7 +1614,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
} else {
|
} else {
|
||||||
baseMapper.insert(oilOrder);
|
baseMapper.insert(oilOrder);
|
||||||
}
|
}
|
||||||
return orderNo;
|
return oilOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1795,8 +1795,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
// 修改订单的优惠金额和支付金额
|
// 修改订单的优惠金额和支付金额
|
||||||
oilOrder.setDiscountAmount(Double.valueOf(discountAmount));
|
oilOrder.setDiscountAmount(Double.valueOf(discountAmount));
|
||||||
oilOrder.setPayAmount(payAmount);
|
oilOrder.setPayAmount(payAmount);
|
||||||
oilOrder.setBalanceAmount(Double.valueOf(balanceAmountSale));
|
// oilOrder.setBalanceAmount(Double.valueOf(balanceAmountSale));
|
||||||
oilOrder.setOilCardAmount(Double.valueOf(oilCardAmountSale));
|
// oilOrder.setOilCardAmount(Double.valueOf(oilCardAmountSale));
|
||||||
if (StringUtils.isNotEmpty(activeId)) {
|
if (StringUtils.isNotEmpty(activeId)) {
|
||||||
oilOrder.setActiveId(Integer.valueOf(activeId));
|
oilOrder.setActiveId(Integer.valueOf(activeId));
|
||||||
}
|
}
|
||||||
|
@ -775,7 +775,7 @@ public class MemberServiceImpl extends ServiceImpl<MtUserMapper, MtUser> impleme
|
|||||||
mtUser.setOpenId(openId);
|
mtUser.setOpenId(openId);
|
||||||
|
|
||||||
mtUser.setMobile(mobile);
|
mtUser.setMobile(mobile);
|
||||||
mtUser.setName("("+mobile+")微信自动注册用户");
|
mtUser.setName("微信用户("+mobile+")");
|
||||||
mtUser.setCreateTime(new Date());
|
mtUser.setCreateTime(new Date());
|
||||||
mtUser.setUpdateTime(new Date());
|
mtUser.setUpdateTime(new Date());
|
||||||
mtUser.setDescription("微信登录自动注册");
|
mtUser.setDescription("微信登录自动注册");
|
||||||
@ -793,7 +793,7 @@ public class MemberServiceImpl extends ServiceImpl<MtUserMapper, MtUser> impleme
|
|||||||
user.setOpenId(openId);
|
user.setOpenId(openId);
|
||||||
|
|
||||||
user.setMobile(mobile);
|
user.setMobile(mobile);
|
||||||
user.setName("("+mobile+")微信自动注册用户");
|
user.setName("微信用户("+mobile+")");
|
||||||
user.setCreateTime(new Date());
|
user.setCreateTime(new Date());
|
||||||
user.setUpdateTime(new Date());
|
user.setUpdateTime(new Date());
|
||||||
user.setDescription("微信登录自动注册");
|
user.setDescription("微信登录自动注册");
|
||||||
|
@ -33,7 +33,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="input_kuang">
|
<view class="input_kuang">
|
||||||
<view class="leftIput">
|
<view class="leftIput">
|
||||||
¥<input style="width: 100%;" v-model="oilOrder.amount" type="text" placeholder="请输入金额" />
|
¥<input style="width: 100%;" v-model="oilOrder.orderAmount" @input="changeAmount()"
|
||||||
|
type="text" placeholder="请输入金额" />
|
||||||
</view>
|
</view>
|
||||||
<view class="rr_box">{{oilOrder.oilNum || 0}}L</view>
|
<view class="rr_box">{{oilOrder.oilNum || 0}}L</view>
|
||||||
</view>
|
</view>
|
||||||
@ -260,7 +261,7 @@
|
|||||||
<image src="../../static/imgs/zficon.png" style="width: 36px; height: 36px; "></image>
|
<image src="../../static/imgs/zficon.png" style="width: 36px; height: 36px; "></image>
|
||||||
<view class="p_ds" style="width: 85%;">
|
<view class="p_ds" style="width: 85%;">
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="">消费应支付245.99元</view>
|
<view class="">消费应支付{{oilOrder.payAmount}}元</view>
|
||||||
<view class="sm-size">会员-储值卡(余额:8900.99)</view>
|
<view class="sm-size">会员-储值卡(余额:8900.99)</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="anxuan">
|
<view class="anxuan">
|
||||||
@ -268,7 +269,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="annius">立即支付245.99元</view>
|
<view class="annius" @click="payment()">立即支付{{oilOrder.payAmount}}元</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<!-- 订单明细 -->
|
<!-- 订单明细 -->
|
||||||
@ -282,22 +283,22 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="p_bs">
|
<view class="p_bs">
|
||||||
<view class="">员工</view>
|
<view class="">员工</view>
|
||||||
<view class="">小王</view>
|
<view class="">{{staffName || '--'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="p_bs">
|
<view class="p_bs">
|
||||||
<view class="">油品单价</view>
|
<view class="">油品单价</view>
|
||||||
<view class="">7.28元/L</view>
|
<view class="">{{oilPrice || 0}}元/{{oilUnit || 'L'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="p_bs">
|
<view class="p_bs">
|
||||||
<view class="">加油升数</view>
|
<view class="">加油升数</view>
|
||||||
<view class="">约36.88L</view>
|
<view class="">约{{oilOrder.oilNum}}L</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="p_bs">
|
<view class="p_bs">
|
||||||
<view class="">加油金额</view>
|
<view class="">加油金额</view>
|
||||||
<view class="">256.89元</view>
|
<view class="">256.89元</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="p_x"></view>
|
<view class="p_x"></view>
|
||||||
<view class="">商品信息</view>
|
<view class="">优惠信息</view>
|
||||||
<view class="p_bs">
|
<view class="p_bs">
|
||||||
<view class="">优惠券</view>
|
<view class="">优惠券</view>
|
||||||
<view class="r-size">-10.00</view>
|
<view class="r-size">-10.00</view>
|
||||||
@ -315,7 +316,7 @@
|
|||||||
<view class="p_x"></view>
|
<view class="p_x"></view>
|
||||||
<view class="p_bs">
|
<view class="p_bs">
|
||||||
<view class="">合计待支付</view>
|
<view class="">合计待支付</view>
|
||||||
<view class="r-size">568.99</view>
|
<view class="r-size">{{oilOrder.payAmount}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="p_x"></view>
|
<view class="p_x"></view>
|
||||||
</view>
|
</view>
|
||||||
@ -403,14 +404,17 @@
|
|||||||
terminal: "applet",
|
terminal: "applet",
|
||||||
oils: "",
|
oils: "",
|
||||||
oilGunNum: "",
|
oilGunNum: "",
|
||||||
oilNum: "",
|
oilNum: 0,
|
||||||
orderAmount: 0,
|
orderAmount: 0,
|
||||||
discountAmount: 0,
|
discountAmount: 0,
|
||||||
payAmount: 0,
|
payAmount: 0,
|
||||||
payType: uni.getStorageSync("appltType"),
|
payType: uni.getStorageSync("appltType"),
|
||||||
},
|
},
|
||||||
// 优惠券列表
|
// 优惠券列表
|
||||||
couponList: []
|
couponList: [],
|
||||||
|
// 是否登录
|
||||||
|
ifLogin: false,
|
||||||
|
orderInfo:{},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@ -478,6 +482,157 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
// 支付接口
|
||||||
|
payment() {
|
||||||
|
this.ifLogin = this.AppToken ? true : false
|
||||||
|
let map = {
|
||||||
|
orderNo: this.oilOrder.orderNo,
|
||||||
|
payAmount: this.oilOrder.payAmount,
|
||||||
|
discountAmount: this.oilOrder.discountAmount,
|
||||||
|
oilCardAmount: '',
|
||||||
|
oilCardLiters: this.oilOrder.oilCardAmount || 0,
|
||||||
|
balanceAmount: this.oilOrder.balanceAmount || 0,
|
||||||
|
isOilStorageCard: false,
|
||||||
|
tankId: this.oilOrder.tankId,
|
||||||
|
isUseChildCard: false,
|
||||||
|
// activeId: this.preferentialData.activeId,
|
||||||
|
// cardFavorableId: this.preferentialData.cardFavorableId,
|
||||||
|
// recordId: this.preferentialData.recordId,
|
||||||
|
// type: this.preferentialData.type,
|
||||||
|
// balanceAmountSale: this.balanceRedece,
|
||||||
|
// oilCardAmountSale: this.oilCardRedece,
|
||||||
|
ifLogin: this.ifLogin,
|
||||||
|
// levelAmount: this.levelAmount,
|
||||||
|
// activeAmount: this.activeAmount
|
||||||
|
};
|
||||||
|
let _this = this;
|
||||||
|
request({
|
||||||
|
url: "business/oilOrder/appletPay",
|
||||||
|
method: 'post',
|
||||||
|
data: map,
|
||||||
|
}).then(res => {
|
||||||
|
let payProvider = "wxpay"
|
||||||
|
if (_this.appltType == "WECHAT") {
|
||||||
|
payProvider = "wxpay"
|
||||||
|
} else {
|
||||||
|
payProvider = "alipay"
|
||||||
|
}
|
||||||
|
if (res.data.error) {
|
||||||
|
request({
|
||||||
|
url: "/business/allOrderInfo/orderStatus",
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
"orderNo": _this.oilOrder.orderNo,
|
||||||
|
"status": "payFail"
|
||||||
|
},
|
||||||
|
}).then((ress) => {})
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.error,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (res.data.code == "error") {
|
||||||
|
request({
|
||||||
|
url: "/business/allOrderInfo/orderStatus",
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
"orderNo": _this.oilOrder.orderNo,
|
||||||
|
"status": "payFail"
|
||||||
|
},
|
||||||
|
}).then((ress) => {})
|
||||||
|
uni.showToast({
|
||||||
|
title: "支付失败,请联系商家",
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (res.data.success == "ok") {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pagesRefuel/orderSuccess/index?orderNo=' + _this.oilOrder.orderNo,
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (res.data.resultMsg == "商户订单号重复") {
|
||||||
|
uni.showToast({
|
||||||
|
title: "商户订单号重复,请重新选择订单信息进行支付!",
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (res.data.data.reservedPayInfo) {
|
||||||
|
_this.orderInfo = JSON.parse(res.data.data.reservedPayInfo);
|
||||||
|
uni.requestPayment({
|
||||||
|
// 微信支付provider: 'wxpay' 支付宝支付 'alipay'
|
||||||
|
provider: payProvider,
|
||||||
|
// 时间戳
|
||||||
|
timeStamp: _this.orderInfo.timeStamp,
|
||||||
|
// 随机字符串
|
||||||
|
nonceStr: _this.orderInfo.nonceStr,
|
||||||
|
// 固定值
|
||||||
|
package: _this.orderInfo.package,
|
||||||
|
// 解密方式
|
||||||
|
signType: 'MD5',
|
||||||
|
// 支付签名
|
||||||
|
paySign: _this.orderInfo.paySign,
|
||||||
|
success: function(res) {
|
||||||
|
console.log('success');
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pagesRefuel/orderSuccess/index?orderNo=' + _this.oilOrder.orderNo,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
request({
|
||||||
|
url: "/business/allOrderInfo/orderStatus",
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
"orderNo": res.data.data.orderNo,
|
||||||
|
"status": "payFail"
|
||||||
|
},
|
||||||
|
}).then((res) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: "支付失败!",
|
||||||
|
icon: "error"
|
||||||
|
})
|
||||||
|
})
|
||||||
|
console.log('fail:', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (_this.appltType == "ALIPAY") {
|
||||||
|
my.tradePay({
|
||||||
|
tradeNO: res.data.data.reservedTransactionId
|
||||||
|
}, function(resp) {
|
||||||
|
if (resp.resultCode == '9000') {
|
||||||
|
console.log("支付成功")
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pagesRefuel/orderSuccess/index?orderNo=' + _this.oilOrder.orderNo,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
request({
|
||||||
|
url: "/business/allOrderInfo/orderStatus",
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
"orderNo": res.data.data.orderNo,
|
||||||
|
"status": "payFail"
|
||||||
|
},
|
||||||
|
}).then((res) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: "支付失败!",
|
||||||
|
icon: "error"
|
||||||
|
})
|
||||||
|
})
|
||||||
|
console.log('支付失败,' + resp.resultCode);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeAmount() {
|
||||||
|
if (this.oilOrder.orderAmount) {
|
||||||
|
this.oilOrder.payAmount = this.oilOrder.orderAmount - this.oilOrder.discountAmount
|
||||||
|
this.oilOrder.oilNum = (this.oilOrder.orderAmount / this.oilPrice).toFixed(2)
|
||||||
|
}
|
||||||
|
},
|
||||||
getCouponList() {
|
getCouponList() {
|
||||||
request({
|
request({
|
||||||
url: "pay/paycenter/getCoupon",
|
url: "pay/paycenter/getCoupon",
|
||||||
@ -510,6 +665,7 @@
|
|||||||
this.oilPrice = data.oilPrice
|
this.oilPrice = data.oilPrice
|
||||||
this.oilUnit = data.unit
|
this.oilUnit = data.unit
|
||||||
this.oilOrder.oils = data.oilNameId
|
this.oilOrder.oils = data.oilNameId
|
||||||
|
this.oilOrder.tankId = data.oilGunList[0].tankId
|
||||||
uni.setStorageSync("tankId", data.oilGunList[0].tankId)
|
uni.setStorageSync("tankId", data.oilGunList[0].tankId)
|
||||||
this.oilGunName = data.oilGunList[0].gunName
|
this.oilGunName = data.oilGunList[0].gunName
|
||||||
}
|
}
|
||||||
@ -529,6 +685,7 @@
|
|||||||
this.qhindex = index
|
this.qhindex = index
|
||||||
this.selectShow = false
|
this.selectShow = false
|
||||||
this.oilOrder.oilGunNum = data.id
|
this.oilOrder.oilGunNum = data.id
|
||||||
|
this.oilOrder.tankId = data.tankId
|
||||||
uni.setStorageSync("tankId", data.tankId)
|
uni.setStorageSync("tankId", data.tankId)
|
||||||
this.oilGunName = data.gunName
|
this.oilGunName = data.gunName
|
||||||
},
|
},
|
||||||
@ -538,7 +695,41 @@
|
|||||||
},
|
},
|
||||||
goPayment() {
|
goPayment() {
|
||||||
// 判断一下按照什么方式支付的
|
// 判断一下按照什么方式支付的
|
||||||
|
if (this.oilOrder.orderAmount <= 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请先输入加油金额",
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
request({
|
||||||
|
url: "business/petrolStationManagement/oilTank/" + uni.getStorageSync('tankId'),
|
||||||
|
method: 'get',
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.data.storedQuantity - this.oilOrder.oilNum < 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "所加油的升数大于油罐内的升数,请重新选择加油升数",
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
this.ConfirmPayment = true
|
this.ConfirmPayment = true
|
||||||
|
this.addOrder()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
// 点击支付添加油品订单信息
|
||||||
|
addOrder() {
|
||||||
|
this.oilOrder.storeId = uni.getStorageSync('storeId')
|
||||||
|
request({
|
||||||
|
url: "business/oilOrder/addOilOrder",
|
||||||
|
method: 'post',
|
||||||
|
data: this.oilOrder,
|
||||||
|
}).then((res) => {
|
||||||
|
console.log(res,578);
|
||||||
|
this.oilOrder = res.data
|
||||||
|
})
|
||||||
},
|
},
|
||||||
Selectclose() {
|
Selectclose() {
|
||||||
this.Selectemployees = false
|
this.Selectemployees = false
|
||||||
@ -648,6 +839,7 @@
|
|||||||
if (res.data[0].oilGunList) {
|
if (res.data[0].oilGunList) {
|
||||||
_this.oilGunList = res.data[0].oilGunList
|
_this.oilGunList = res.data[0].oilGunList
|
||||||
_this.oilOrder.oilGunNum = res.data[0].oilGunList[0].id
|
_this.oilOrder.oilGunNum = res.data[0].oilGunList[0].id
|
||||||
|
_this.oilOrder.tankId = res.data[0].oilGunList[0].tankId
|
||||||
uni.setStorageSync("tankId", res.data[0].oilGunList[0].tankId)
|
uni.setStorageSync("tankId", res.data[0].oilGunList[0].tankId)
|
||||||
_this.oilGunName = res.data[0].oilGunList[0].gunName
|
_this.oilGunName = res.data[0].oilGunList[0].gunName
|
||||||
}
|
}
|
||||||
@ -699,7 +891,6 @@
|
|||||||
} else {
|
} else {
|
||||||
this.toPayment(id)
|
this.toPayment(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 去支付(之前的)
|
// 去支付(之前的)
|
||||||
|
Loading…
Reference in New Issue
Block a user