no message
This commit is contained in:
parent
d6684b413d
commit
16f77aca55
@ -857,6 +857,7 @@ import {
|
||||
} from "@/api/staff/user/cardvaluechild";
|
||||
import {getOilOrderAllAmount} from "@/api/order/oilorder";
|
||||
import {giftCardExchange} from "@/api/giftCard/giftcard";
|
||||
import {getReturnCode, sendPrintIndex} from "@/api/print";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -1378,7 +1379,7 @@ export default {
|
||||
// 存油卡列表
|
||||
},
|
||||
// 确认充值
|
||||
confirm(flag) {
|
||||
async confirm(flag) {
|
||||
this.flag = flag
|
||||
|
||||
|
||||
@ -1406,8 +1407,11 @@ export default {
|
||||
|
||||
this.realyPayBills = this.cardFuelDieselForm.rechargeBalance
|
||||
}
|
||||
// 发送扫码机请求(易联云网络下发)
|
||||
await this.getSendPrintIndex(this.realyPayBills);
|
||||
this.openConfirm = true;
|
||||
this.isPay = true
|
||||
this.getCode(this.realyPayBills)
|
||||
|
||||
this.title = this.payment
|
||||
},
|
||||
@ -1605,6 +1609,8 @@ export default {
|
||||
// 当支付成功时
|
||||
this_.isPaySuccess = true;
|
||||
this_.isQuery = false;
|
||||
this_.cardValueReport()
|
||||
|
||||
this_.getUserInfo()
|
||||
}else if (payStatus === "payFail") {
|
||||
this_.isPaySuccess = false;
|
||||
@ -1681,6 +1687,8 @@ export default {
|
||||
this_.isPaySuccess = true;
|
||||
this_.isQuery = false;
|
||||
this_.getUserInfo()
|
||||
this.fuelDieselReport()
|
||||
|
||||
}
|
||||
if (response.data.payStatus == "payFail") {
|
||||
this_.isPaySuccess = false;
|
||||
@ -1841,8 +1849,105 @@ export default {
|
||||
// 返回
|
||||
goBack() {
|
||||
this.$router.back(-1);
|
||||
}
|
||||
},
|
||||
// 积分表、储值卡详情表、积分详情表、储值卡表、储值卡模板表、用户储值卡关联表、
|
||||
|
||||
cardValueReport() {
|
||||
// 支付方式
|
||||
const payTypeMap = {
|
||||
'CASH': '现金',
|
||||
'WECHAT': '微信',
|
||||
'ALIPAY': '支付宝',
|
||||
'UNIONPAY': '银联二维码',
|
||||
'credit': '挂账',
|
||||
'oilCard': '囤油卡',
|
||||
'balance': '储值卡'
|
||||
};
|
||||
let payTypeText = payTypeMap[this.cardValueForm.paymentType]
|
||||
let actualPay = this.cardValueForm.paymentType == 'CASH' ? this.authCode:this.realyPayBills
|
||||
|
||||
let a = {
|
||||
// 充值金额
|
||||
realyPayBills:this.realyPayBills,
|
||||
//赠送金额
|
||||
giftBalance:this.cardValueForm.giftBalance,
|
||||
// 到账金额
|
||||
getAmount:this.cardValueForm.giftBalance + this.realyPayBills,
|
||||
payType:payTypeText,
|
||||
|
||||
// 实付款
|
||||
actualPay: actualPay,
|
||||
// 找零
|
||||
seekZero:this.seekZero.toFixed(2),
|
||||
}
|
||||
|
||||
printCardValueReport(a).then(res=>{
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
// 网络下发之后获取条码
|
||||
getCode(amount) {
|
||||
this.jishuqi++;
|
||||
if (this.jishuqi == 30) {
|
||||
this.jishuqi = 0
|
||||
return
|
||||
}
|
||||
getReturnCode ({payAmount:amount}).then(res=>{
|
||||
if (res.data === "300") {
|
||||
setTimeout(() => {
|
||||
this.getCode(amount); // 重新发起请求
|
||||
}, 1000); // 停顿一秒
|
||||
}else {
|
||||
this.authCode = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getSendPrintIndex(amount) {
|
||||
sendPrintIndex({payAmount:amount}).then(ress=>{
|
||||
if (ress.data != "success") {
|
||||
this.$modal.msgError("扫码机发起付款失败!")
|
||||
return;
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
fuelDieselReport() {
|
||||
|
||||
// 支付方式
|
||||
const payTypeMap = {
|
||||
'CASH': '现金',
|
||||
'WECHAT': '微信',
|
||||
'ALIPAY': '支付宝',
|
||||
'UNIONPAY': '银联二维码',
|
||||
'credit': '挂账',
|
||||
'oilCard': '囤油卡',
|
||||
'balance': '储值卡'
|
||||
};
|
||||
let payTypeText = payTypeMap[this.cardFuelDieselForm.paymentType]
|
||||
|
||||
let a = {
|
||||
// 充值油品
|
||||
oilType:this.cardFuelDieselForm.type,
|
||||
// 充值升数
|
||||
incomeLitres:this.cardFuelDieselForm.incomeLitres,
|
||||
// 订单金额
|
||||
realyPayBills:this.realyPayBills,
|
||||
// 锁价金额
|
||||
lockupPrice:cardFuelDieselForm.lockupPrice,
|
||||
// 支付方式
|
||||
payType:payTypeText,
|
||||
// 实付款
|
||||
|
||||
// 找零
|
||||
seekZero:this.seekZero.toFixed(2),
|
||||
}
|
||||
|
||||
printFuelDieselReport(a).then(res=>{
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
openConfirm(newValue) {
|
||||
|
@ -110,8 +110,10 @@ public class PrinterServiceImpl implements PrinterService {
|
||||
if (ObjectUtil.isEmpty(infoByStoreId)){
|
||||
return "error";
|
||||
}
|
||||
RequestMethod.getInstance().init(infoByStoreId.getAppKey(),infoByStoreId.getAppSecret());
|
||||
log.info("--yilianyunAccessTokeninit--");
|
||||
|
||||
RequestMethod.getInstance().init(infoByStoreId.getAppKey(),infoByStoreId.getAppSecret());
|
||||
log.info("--yilianyunAccessTokeninit2--");
|
||||
try {
|
||||
// String resJson = RequestMethod.getInstance().scanCodeModel_msign("4004872261", "628023865417");
|
||||
String resJson = RequestMethod.getInstance().scanCodeModel_msign(infoByStoreId.getMachineCode(), infoByStoreId.getMsign());
|
||||
@ -119,6 +121,8 @@ public class PrinterServiceImpl implements PrinterService {
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(resJson);
|
||||
String errorDescription = jsonObject.getString("error_description"); // success
|
||||
log.info("--errorDescriptionToken--{}",errorDescription);
|
||||
|
||||
if ("success".equals(errorDescription)) {
|
||||
JSONObject body = jsonObject.getJSONObject("body");
|
||||
String accessToken = body.getString("access_token");
|
||||
|
Loading…
Reference in New Issue
Block a user