This commit is contained in:
sw 2024-11-19 11:32:38 +08:00
parent 2e2a71c064
commit 3914945210
5 changed files with 74 additions and 28 deletions

View File

@ -15,5 +15,6 @@ public class CardFuelRecordDTO extends CardFuelRecord {
private Integer cardFavorableId;
//卡券领取记录id
private Integer cardRecordId;
//0储存卡1囤油卡
private String carType;
}

View File

@ -16,6 +16,7 @@ import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;
@ -242,5 +243,9 @@ public class CardValueRecordController extends BaseController {
public ResponseObject getCardValueByCardValueId(@Param("cardValueConditionVo") CardValueConditionVo cardValueConditionVo){
return getSuccessResult(cardValueRecordService.getCardValueByCardValueId(cardValueConditionVo));
}
@GetMapping("/checkTheStatusOfYourPayments")
public ResponseObject checkTheStatusOfYourPayments(Integer id) throws Exception{
return getSuccessResult(cardValueRecordService.checkTheStatusOfYourPayments(id));
}
}

View File

@ -31,6 +31,9 @@ public class CardValueRecordDTO extends CardValueRecord {
@JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
private Date expireTime;
//0储存卡1囤油卡
private String carType;
// /**
// * 会员id
// */

View File

@ -532,6 +532,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueRecordDTO.setGiftBalance(Optional.of(selectCard.getGiftBalance().doubleValue()).orElse(0d));
//赠送积分
cardValueRecordDTO.setPoints(Optional.ofNullable(selectCard.getPoints()).orElse(0));
cardValueRecordDTO.setCarType("0");
//赠送优惠卷
if (CollectionUtil.isNotEmpty(selectCard.getCardCouponList())){
cardValueRecordDTO.setCouponIds(selectCard.getCardCouponList().stream().map(CardCoupon::getId).collect(Collectors.toList()).toString());
@ -615,6 +616,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardFuelRecordDTO.setPoints(Optional.ofNullable(selectCard.getPoints()).orElse(0));
cardFuelRecordDTO.setPaymentType(selectCard.getPaymentType());
cardFuelRecordDTO.setPayChannel(selectCard.getPayChannel());
cardFuelRecordDTO.setCarType("1");
if (ObjectUtils.isEmpty(selectCard.getChooseStaff()) || selectCard.getChooseStaff() == 0) {
cardFuelRecordDTO.setMtStaffId(nowAccountInfo.getStaffId());
cardFuelRecordDTO.setRealName(nowAccountInfo.getRealName());

View File

@ -556,6 +556,7 @@ import {userListByPhone} from "@/api/cashier/user";
import {VueClipboard} from 'vue-clipboard2';
import {getDicts} from "@/api/dict/data";
import {
getCheckTheStatusOfYourPaymentApi,
getCheckTheStatusOfYourPaymentApis,
rechargeCard
} from "@/api/cashier/cardSet";
@ -1041,43 +1042,77 @@ export default {
this.payForm.seekZero = makeChange
this.payForm.payChannel = 'cashier'
let id;
let carType;
await rechargeCard(this.payForm).then(response => {
if (response.data != null) {
this.loading = true;
id = response.data.id
carType = response.data.carType
}
});
let this_ = this
console.log(this.payForm,1054)
//
let timer = setInterval(async () => {
let flag = false
await getCheckTheStatusOfYourPaymentApis(id).then(async response => {
if (response.data != null) {
const payStatus = response.data.payStatus
this_.orderNo=response.data.paymentNo
if (payStatus === "unpaid") {
this_.isQuery = true;
} else if (payStatus === "paid") {
//
this_.isPaySuccess = true;
this_.isQuery = false;
this_.rechargeBalCard = true
// await this_.printLocally1()
flag = true
// await this_.cardValueReport()
// await this_.getMemberAfter();
clearInterval(timer);
} else if (payStatus === "payFail") {
this_.isPaySuccess = false;
this_.isQuery = false;
clearInterval(timer);
if(carType==="0"){
let timer = setInterval(async () => {
let flag = false
await getCheckTheStatusOfYourPaymentApi(id).then(async response => {
if (response.data != null) {
const payStatus = response.data.payStatus
this_.orderNo=response.data.paymentNo
if (payStatus === "unpaid") {
this_.isQuery = true;
} else if (payStatus === "paid") {
//
this_.isPaySuccess = true;
this_.isQuery = false;
this_.rechargeBalCard = true
// await this_.printLocally1()
flag = true
// await this_.cardValueReport()
// await this_.getMemberAfter();
clearInterval(timer);
} else if (payStatus === "payFail") {
this_.isPaySuccess = false;
this_.isQuery = false;
clearInterval(timer);
}
}
}
// await this_.getMemberAfter();
})
if (flag) await this_.cardValueReport()
}, 1000);
// await this_.getMemberAfter();
})
if (flag) await this_.cardValueReport()
}, 1000);
}else if(carType==="1"){
let timer = setInterval(async () => {
let flag = false
await getCheckTheStatusOfYourPaymentApis(id).then(async response => {
if (response.data != null) {
const payStatus = response.data.payStatus
this_.orderNo=response.data.paymentNo
if (payStatus === "unpaid") {
this_.isQuery = true;
} else if (payStatus === "paid") {
//
this_.isPaySuccess = true;
this_.isQuery = false;
this_.rechargeBalCard = true
// await this_.printLocally1()
flag = true
// await this_.cardValueReport()
// await this_.getMemberAfter();
clearInterval(timer);
} else if (payStatus === "payFail") {
this_.isPaySuccess = false;
this_.isQuery = false;
clearInterval(timer);
}
}
// await this_.getMemberAfter();
})
if (flag) await this_.cardValueReport()
}, 1000);
}
let timer2 = setInterval(function () {
if (!this_.isQuery || !this_.openConfirm) {