no message

This commit is contained in:
DESKTOP-369JRHT\12997 2024-05-30 16:43:03 +08:00
parent d6684b413d
commit 16f77aca55
2 changed files with 112 additions and 3 deletions

View File

@ -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) {

View File

@ -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");