From 2fc94aad3d4ab01db116a7624bc9d7507c1e9721 Mon Sep 17 00:00:00 2001 From: 13405411873 <1994398261@qq.com> Date: Tue, 8 Oct 2024 11:38:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=90=A5=E9=94=80=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EventMarketing/storeOilBlock/index.vue | 18 +- fuintAdmin/src/views/login.vue | 14 +- .../fuyou/service/impl/FyPayServiceImpl.java | 32 ++- .../business/cashierGoods/entity/MtGoods.java | 1 + .../controller/CardCouponController.java | 13 ++ .../cardCoupon/mapper/CardCouponMapper.java | 1 + .../mapper/xml/CardCouponMapper.xml | 13 ++ .../cardCoupon/service/CardCouponService.java | 4 + .../service/impl/CardCouponServiceImpl.java | 5 + .../controller/CardFuelDieselController.java | 9 +- .../cardFule/entity/CardFuelDiesel.java | 3 +- .../cardFule/entity/CardFuelRecord.java | 1 + .../cardFule/mapper/CardFuelDieselMapper.java | 1 + .../mapper/xml/CardFuelDieselMapper.xml | 3 + .../service/CardFuelDieselService.java | 2 +- .../impl/CardFuelDieselServiceImpl.java | 30 ++- .../impl/CardFuelRecordServiceImpl.java | 2 + .../controller/CardValueRecordController.java | 6 + .../cardValue/dto/SelectCard.java | 47 +++++ .../cardValue/entity/CardValueRecord.java | 3 + .../service/CardValueRecordService.java | 4 +- .../impl/CardValueRecordServiceImpl.java | 184 +++++++++++++++-- .../service/impl/CardValueServiceImpl.java | 11 +- fuintCashierWeb/src/api/cashier/cardSet.js | 9 + fuintCashierWeb/src/api/newHome/newHome.js | 22 ++ .../views/cashier/NewComponents/newHome.vue | 195 +++++++----------- .../newHomeComponents/memberRecharge.vue | 110 ++++++---- 27 files changed, 519 insertions(+), 224 deletions(-) create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/dto/SelectCard.java diff --git a/fuintAdmin/src/views/EventMarketing/storeOilBlock/index.vue b/fuintAdmin/src/views/EventMarketing/storeOilBlock/index.vue index ff0cf38ed..cce86e7bd 100644 --- a/fuintAdmin/src/views/EventMarketing/storeOilBlock/index.vue +++ b/fuintAdmin/src/views/EventMarketing/storeOilBlock/index.vue @@ -259,13 +259,13 @@
- - + + + :value="dict.id"> @@ -466,7 +466,7 @@ tableData: [], oilList:[], ruleForm:{ - oilType:2, + oilNumberId:null, lockupPrice: "" , lockPrice: "" , lockMoney: "" , @@ -492,7 +492,7 @@ pageSize:10, }, rules:{ - oilType: [ + oilNumberId: [ { required: true, message: '不能为空', trigger: 'blur' }, ], rechargeBalance: [ @@ -603,7 +603,6 @@ this.oilList = [] oilName(this.queryParams.type).then(res=>{ this.oilList = res.data.records - console.log('我的油站' ,res) }) this.getlist() }, @@ -658,10 +657,7 @@ }) }, postadd(formName){ - if( this.ruleForm.oilType =='' || this.ruleForm.rechargeBalance =='' || this.ruleForm.points =='' ){ - this.$message.error("必填项不能为空") - return - } + this.ruleForm.type = this.queryParams.type this.ruleForm.status = '1' // this.ruleForm.startTime = this.ruleForm.startTime.toLocaleDateString() diff --git a/fuintAdmin/src/views/login.vue b/fuintAdmin/src/views/login.vue index 9e60206c3..e8f149bc2 100644 --- a/fuintAdmin/src/views/login.vue +++ b/fuintAdmin/src/views/login.vue @@ -279,15 +279,9 @@ export default { Cookies.remove('rememberMe'); } app.$store.dispatch("Login", this.loginForm).then(() => { - // Cookies.set("DUTY_ROLE_CODE", res.data.dutyRoleCode); - console.log(1234567890) - // if (Cookies.get("DUTY_ROLE_CODE") && Cookies.get("DUTY_ROLE_CODE") == 2) { - // // if (sessionStorage.getItem('IS_ZT_LOGIN')&& sessionStorage.getItem('IS_ZT_LOGIN') == 2) { - // location.replace(this.cashierUrl); - // }else { if (Cookies.get("IS_ZT_LOGIN")) { const data = JSON.parse(Cookies.get("IS_ZT_LOGIN")) - console.log("dataJSON",data) + console.log("url",this.ztUrl+"resource_oilbank?token="+data.token) location.replace(this.ztUrl+"resource_oilbank?token="+data.token); }else if (Cookies.get("IS_CA_LOGIN")){ const data = JSON.parse(Cookies.get("IS_CA_LOGIN")) @@ -296,14 +290,8 @@ export default { }else { app.$router.push({ path: this.redirect || "/" }).catch(()=>{}); } - // } - - }).catch(() => { app.loading = false; - // if (app.captchaOnOff) { - // app.getCode(); - // } }); } }); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java index 33db6d5bc..1bfe1859c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java @@ -19,6 +19,7 @@ import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRe import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService; import com.fuint.business.marketingActivity.cardFule.entity.CardFuelRecord; import com.fuint.business.marketingActivity.cardFule.service.CardFuelRecordService; +import com.fuint.business.marketingActivity.cardFuleOrders.service.CardFuleOrdersService; import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord; import com.fuint.business.marketingActivity.cardValue.service.CardValueRecordService; import com.fuint.business.marketingActivity.cardValueOrders.service.CardValueOrdersService; @@ -65,6 +66,8 @@ public class FyPayServiceImpl implements FyPayService { @Resource private CardValueOrdersService cardValueOrdersService; + @Resource + private CardFuleOrdersService fuleOrdersService; /** * 条码支付 @@ -305,19 +308,17 @@ public class FyPayServiceImpl implements FyPayService { } } if ("CVR".equals(type)) { + //储值卡订单 payStates = "paid"; receiveParameter.setType("2"); - if (ObjectUtil.isNotEmpty(goodsOrder) && ObjectUtil.isNotEmpty(goodsOrder.getUserId())) { receiveParameter.setUserId(goodsOrder.getUserId()); } -// if (!ObjectUtil.isEmpty(map1.get("orderId"))) { -// -// } + } if ("CFR".equals(type)) { + //囤油卡订单 payStates = "paid"; - cardValueOrdersService.updateBalance(orderNo,payStatus); } if ("IOS".equals(type)) { // 积分商城 payStates = "paid"; @@ -360,13 +361,11 @@ public class FyPayServiceImpl implements FyPayService { } if ("CVR".equals(type)) { payStates = "payFail"; - if (!ObjectUtil.isEmpty(map1.get("orderId"))) { - - } + cardValueOrdersService.updateOrderStatus(orderNo,payStatus); } if ("CFR".equals(type)) { payStates = "payFail"; - cardValueOrdersService.updateBalance(orderNo,payStatus); + } if ("IOS".equals(type)) { payStates = "payFail"; @@ -411,12 +410,10 @@ public class FyPayServiceImpl implements FyPayService { cashierOrderService.updateCashierOrder(cashierOrder); } if ("CVR".equals(type) && !ObjectUtil.isEmpty(map1.get("orderId"))) { -// 储值卡 - - + //储值卡 Integer id = Integer.parseInt(map1.get("orderId")); cardValueRecordService.editPayStatus(id, payStates); - + cardValueOrdersService.updateBalance(orderNo,payStatus); CardValueRecord byId = cardValueRecordService.getById(id); receiveParameter.setType("3"); if (byId.getMtUserId() != null) { @@ -425,10 +422,9 @@ public class FyPayServiceImpl implements FyPayService { receiveParameter.setContent("储值卡订单"); } if ("CFR".equals(type) && !ObjectUtil.isEmpty(map1.get("orderId"))) { -// 囤油卡 + //囤油卡 Integer id = Integer.parseInt(map1.get("orderId")); cardFuelRecordService.editPayStatus(id, payStates); - cardValueOrdersService.updateBalance(orderNo,payStatus); CardFuelRecord cardFuelRecord = cardFuelRecordService.queryById(id); receiveParameter.setType("5"); if (cardFuelRecord.getMtUserId() != null) { @@ -437,10 +433,9 @@ public class FyPayServiceImpl implements FyPayService { receiveParameter.setContent("囤油卡订单"); } if ("IOS".equals(type)) { -// 积分商城 + //积分商城 String storeId = ObjectUtil.isEmpty(map1.get("storeId")) ? "-1" : map1.get("storeId"); integralOrdersService.editPayStatus(orderNo, payStates, Integer.parseInt(storeId)); - IntegralOrders integralOrders = integralOrdersService.queryIntegralOrdersByOrderNo(orderNo, Integer.parseInt(storeId)); receiveParameter.setType("4"); if (integralOrders.getUserId() != null) { @@ -448,7 +443,6 @@ public class FyPayServiceImpl implements FyPayService { } receiveParameter.setContent("积分订单"); } - if (!reqMap.get("trans_stat").equals("USERPAYING")) { String payChannel = "cashier"; if (ObjectUtil.isNotEmpty(map1.get("payChannel"))) payChannel = map1.get("payChannel"); @@ -456,7 +450,7 @@ public class FyPayServiceImpl implements FyPayService { } if (ObjectUtil.isNotEmpty(merchantConfig)) { -// 添加配置记录信息 + //添加配置记录信息 MerchantConfigRecord merchantConfigRecord = new MerchantConfigRecord(); merchantConfigRecord.setMerchantId(merchantConfig.getId()); if (payStatus.equals("paid")) { diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/cashierGoods/entity/MtGoods.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/cashierGoods/entity/MtGoods.java index 9b0f01948..3a3d04fbb 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/cashierGoods/entity/MtGoods.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/cashierGoods/entity/MtGoods.java @@ -1,5 +1,6 @@ package com.fuint.business.cashierGoods.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.fuint.framework.entity.BaseEntity; import lombok.Data; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/controller/CardCouponController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/controller/CardCouponController.java index 21db8487b..3543a0b9e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/controller/CardCouponController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/controller/CardCouponController.java @@ -60,6 +60,19 @@ public class CardCouponController extends BaseController { cardCoupon.setStoreId(nowAccountInfo.getStoreId()); return getSuccessResult(this.cardCouponService.pageVo(page, cardCoupon)); + } + /** + * 不分页查询在使用中的优惠卷 + * + * @param cardCoupon 查询实体 + * @return 所有数据 + */ + @GetMapping("/getCanUseCoupon") + public ResponseObject getCanUseCoupon(CardCoupon cardCoupon) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + cardCoupon.setStoreId(nowAccountInfo.getStoreId()); + return getSuccessResult(this.cardCouponService.getCanUseCoupon(cardCoupon)); + } /** diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/CardCouponMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/CardCouponMapper.java index ccd848be7..f9a9fff08 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/CardCouponMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/CardCouponMapper.java @@ -29,5 +29,6 @@ public interface CardCouponMapper extends BaseMapper { * @return */ List selectByStoreIdCount(CardCouponUniVo cardCouponUniVos); + List getCanUseCoupon(@Param("cardCoupon") CardCoupon cardCoupon); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/xml/CardCouponMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/xml/CardCouponMapper.xml index 7455a26a1..90c3eadec 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/xml/CardCouponMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/xml/CardCouponMapper.xml @@ -107,5 +107,18 @@ + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/CardCouponService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/CardCouponService.java index ee007e05f..476166d1c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/CardCouponService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/CardCouponService.java @@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon; import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo; +import java.util.List; + /** * 油站优惠卷表2024(CardCoupon)表服务接口 * @@ -14,6 +16,8 @@ import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo; */ public interface CardCouponService extends IService { IPage pageVo(Page page, CardCoupon cardCoupon); + List getCanUseCoupon(CardCoupon cardCoupon); + /** * 上下架 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/impl/CardCouponServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/impl/CardCouponServiceImpl.java index 94c23f37d..67f75cd19 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/impl/CardCouponServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/impl/CardCouponServiceImpl.java @@ -53,6 +53,11 @@ public class CardCouponServiceImpl extends ServiceImpl getCanUseCoupon(CardCoupon cardCoupon) { + return baseMapper.getCanUseCoupon(cardCoupon); + } + @Override public int isOnLine(Integer id) { CardCoupon cardCoupon = baseMapper.selectById(id); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/controller/CardFuelDieselController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/controller/CardFuelDieselController.java index 766ae49d9..934d8125a 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/controller/CardFuelDieselController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/controller/CardFuelDieselController.java @@ -67,7 +67,11 @@ public class CardFuelDieselController extends BaseController { Page page = new Page(pageNo, pageSize); return getSuccessResult(this.cardFuelDieselService.select(page, cardFuelDiesel)); } + @GetMapping("fuelCardList") + public ResponseObject fuelCardList(CardFuelDiesel cardFuelDiesel) { + return getSuccessResult(this.cardFuelDieselService.fuelCardList(cardFuelDiesel)); + } /** * 分页查询所有数据(小程序端) * @param pageNo @@ -145,7 +149,7 @@ public class CardFuelDieselController extends BaseController { //油品名称 String type = cardFuelDiesel.getType(); String oilType = cardFuelDiesel.getOilType(); - OilName oilName1 = oilNameService.selectOilNameById(Integer.parseInt(oilType)); + OilName oilName1 = oilNameService.selectOilNameById(cardFuelDiesel.getOilNumberId()); String oilName = oilName1.getOilName(); activeApplet.setOilName(type+"-"+oilName); //时间 @@ -213,8 +217,7 @@ public class CardFuelDieselController extends BaseController { //油品名称 String type = cardFuelDiesel.getType(); - String oilType = cardFuelDiesel.getOilType(); - OilName oilName1 = oilNameService.selectOilNameById(Integer.parseInt(oilType)); + OilName oilName1 = oilNameService.selectOilNameById(cardFuelDiesel.getOilNumberId()); String oilName = oilName1.getOilName(); activeApplet.setOilName(type+"-"+oilName); //时间 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/entity/CardFuelDiesel.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/entity/CardFuelDiesel.java index 87f94edb5..e7158c623 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/entity/CardFuelDiesel.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/entity/CardFuelDiesel.java @@ -30,7 +30,8 @@ public class CardFuelDiesel extends Model { private String status; //油卡类型 0:汽油卡 1:柴油卡 2:天然气 private String type; - //油品类型:0:0# 1:-10# 2:京0# + //油号id + private Integer oilNumberId; private String oilType; //锁价单价 private Double lockupPrice; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/entity/CardFuelRecord.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/entity/CardFuelRecord.java index 8737d3bad..c1cb05e86 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/entity/CardFuelRecord.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/entity/CardFuelRecord.java @@ -149,6 +149,7 @@ public class CardFuelRecord extends BaseEntity { private String actualPayment; private String makeChange; + private String payChannel; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/mapper/CardFuelDieselMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/mapper/CardFuelDieselMapper.java index 6a5da2ff1..8b8b7ef70 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/mapper/CardFuelDieselMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/mapper/CardFuelDieselMapper.java @@ -14,5 +14,6 @@ import java.util.List; public interface CardFuelDieselMapper extends BaseMapper { List countOilType(Integer storeId); + List fuelCardList(CardFuelDiesel cardFuelDiesel); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/mapper/xml/CardFuelDieselMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/mapper/xml/CardFuelDieselMapper.xml index 88cb8baaf..1cf78fa6f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/mapper/xml/CardFuelDieselMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/mapper/xml/CardFuelDieselMapper.xml @@ -12,5 +12,8 @@ where cf.store_id = #{storeId} group by cf.oil_type + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/CardFuelDieselService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/CardFuelDieselService.java index 243dc72c4..fdd9672fd 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/CardFuelDieselService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/CardFuelDieselService.java @@ -25,7 +25,7 @@ public interface CardFuelDieselService extends IService { * @return */ IPage select(Page page, CardFuelDiesel cardFuelDiesel); - + List fuelCardList (CardFuelDiesel cardFuelDiesel); IPage selectAllApplet(Page page, CardFuelDiesel cardFuelDiesel); List selectAllAppletByStorId(CardFuelDiesel cardFuelDiesel); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelDieselServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelDieselServiceImpl.java index 1fb67d9cc..0a4191f20 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelDieselServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelDieselServiceImpl.java @@ -1,5 +1,6 @@ package com.fuint.business.marketingActivity.cardFule.service.impl; +import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -8,6 +9,7 @@ import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelDieselMapper import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel; import com.fuint.business.marketingActivity.cardFule.service.CardFuelDieselService; import com.fuint.business.marketingActivity.cardFule.vo.CardFuelDieselVO; +import com.fuint.business.marketingActivity.cardValue.entity.CardValue; import com.fuint.business.petrolStationManagement.entity.OilName; import com.fuint.business.petrolStationManagement.entity.OilNumber; import com.fuint.business.petrolStationManagement.service.OilNameService; @@ -79,11 +81,11 @@ public class CardFuelDieselServiceImpl extends ServiceImpl records = page2.getRecords(); //返回囤油卡状态 for (CardFuelDiesel record : records) { - OilNumber oilPrice = oilNumberService.getOilPrice(Integer.parseInt(record.getOilType())); + OilNumber oilPrice = oilNumberService.getOilPrice(record.getOilNumberId()); record.setGbPrice(oilPrice.getGbPrice()); record.setOilPrice(oilPrice.getOilPrice()); - if (ObjectUtils.isNotEmpty(record.getOilType())){ - record.setType(record.getType()+" "+oilNameService.selectOilNameById(Integer.parseInt(record.getOilType())).getOilName()); + if (ObjectUtils.isNotEmpty(record.getOilNumberId())){ + record.setType(record.getType()+" "+oilNameService.selectOilNameById(record.getOilNumberId()).getOilName()); } record.setStatus(record.getStatus().equals("1") ? "true" : "false"); if(ObjectUtils.isNotEmpty(record.getActiveTime()) && "1".equals(record.getActiveTime())){ @@ -102,6 +104,24 @@ public class CardFuelDieselServiceImpl extends ServiceImpl fuelCardList(CardFuelDiesel cardFuelDiesel) { + //获取当前登录用户 + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + String nowTime = DateUtil.format(new Date(), "yyyy-MM-dd")+" 00:00:00"; + LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); + queryWrapper.eq(CardFuelDiesel::getStoreId,nowAccountInfo.getStoreId()).eq(CardFuelDiesel::getActiveStatus,"1").and(it->{ + return it.eq(CardFuelDiesel::getActiveTime,"1").or(item->{ + return item .eq(CardFuelDiesel::getActiveTime,"2") + .le(CardFuelDiesel::getStartTime,nowTime).ge(CardFuelDiesel::getEndTime,nowTime); + }); + }).orderByAsc(CardFuelDiesel::getRechargeBalance); + if(ObjectUtils.isNotEmpty(cardFuelDiesel.getOilNumberId())){ + queryWrapper.eq(CardFuelDiesel::getOilNumberId,cardFuelDiesel.getOilNumberId()); + } + return this.list(queryWrapper); + } + /** * 分页查询所有数据(小程序端) @@ -128,10 +148,10 @@ public class CardFuelDieselServiceImpl extends ServiceImpl records = page1.getRecords(); ArrayList cardFuelDiesels = new ArrayList<>(); for (CardFuelDiesel record : records) { - OilNumber oilPrice = oilNumberService.getOilPrice(Integer.parseInt(record.getOilType())); + OilNumber oilPrice = oilNumberService.getOilPrice(record.getOilNumberId()); record.setGbPrice(oilPrice.getGbPrice()); record.setOilPrice(oilPrice.getOilPrice()); - OilName oilName = oilNameService.selectOilNameById(Integer.parseInt(record.getOilType())); + OilName oilName = oilNameService.selectOilNameById(record.getOilNumberId()); record.setOilType(oilName.getOilName()); Date startTime = record.getStartTime(); Date endTime = record.getEndTime(); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelRecordServiceImpl.java index 089082157..f477e66f9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFule/service/impl/CardFuelRecordServiceImpl.java @@ -57,6 +57,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import com.fuint.common.util.TokenUtil; @@ -638,6 +639,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { private CardBalanceChangeService cardBalanceChangeService; @Resource + @Lazy private CardValueRecordService cardValueRecordService; /** * 屯油卡充值后续处理 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/controller/CardValueRecordController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/controller/CardValueRecordController.java index e9fd63fb7..c33e37fda 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/controller/CardValueRecordController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/controller/CardValueRecordController.java @@ -5,6 +5,7 @@ package com.fuint.business.marketingActivity.cardValue.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.marketingActivity.cardValue.dto.CardValueRecordDTO; +import com.fuint.business.marketingActivity.cardValue.dto.SelectCard; import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord; import com.fuint.business.marketingActivity.cardValue.service.CardValueRecordService; import com.fuint.business.order.entity.LJOrder; @@ -135,6 +136,11 @@ public class CardValueRecordController extends BaseController { return getSuccessResult(this.cardValueRecordService.prepaidCardTopUp(cardValueRecordDTO)); } + @PostMapping("rechargeCard") + public ResponseObject rechargeCard(@RequestBody SelectCard selectCard) { + return getSuccessResult(this.cardValueRecordService.rechargeCard(selectCard)); + } + /** * 查询支付状态 修改相关关联表 * @param id diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/dto/SelectCard.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/dto/SelectCard.java new file mode 100644 index 000000000..53977686e --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/dto/SelectCard.java @@ -0,0 +1,47 @@ +package com.fuint.business.marketingActivity.cardValue.dto; + +import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.math.BigDecimal; +import java.util.List; + +@Data +public class SelectCard { + //卡的主键 + private Integer selectCardId; + //充值的会员主键 + private Integer mtUserId; + // 0储值卡 1囤油卡 2礼品卡 + private String cardType; + //充值本金 + private BigDecimal rechargeBalance; + //赠送金额 + private BigDecimal giftBalance; + //赠送积分 + private Integer points; + //赠送成长值 + private Integer growthValue; + //提成员工 主键 + private Integer chooseStaff; + //充值备注 + private String desc; + //支付方式 + private String paymentType; + //礼品卡卡号 + private String giftCardNo; + //礼品卡卡密 + private String giftCardPwd; + //用户出示的支付授权码 + private String authCode; + //找零金额 + private BigDecimal seekZero; + //储值卡赠送的优惠卷 + List cardCouponList; + //支付通道 支付渠道(小程序applet/收银台cashier/POS端POS) + private String payChannel; + + private String orderNo; + +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/entity/CardValueRecord.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/entity/CardValueRecord.java index f9a0b768f..51da48fa2 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/entity/CardValueRecord.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/entity/CardValueRecord.java @@ -51,6 +51,7 @@ public class CardValueRecord extends Model { private Double rechargeBalance; //储值卡赠送金额 private Double giftBalance; + private String remark; // private Double lockupPrice; //积分 private Integer points; @@ -90,6 +91,8 @@ public class CardValueRecord extends Model { private String actualPayment; private String makeChange; + //赠送优惠卷的主键 + private String couponIds; /** 请求参数 */ diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/CardValueRecordService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/CardValueRecordService.java index 233015638..abe47e6dc 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/CardValueRecordService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/CardValueRecordService.java @@ -1,11 +1,13 @@ package com.fuint.business.marketingActivity.cardValue.service; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.fuint.api.fuyou.entity.ReturnParameter; import com.fuint.business.integral.entity.IntegralDetail; import com.fuint.business.marketingActivity.cardValue.dto.CardValueRecordDTO; +import com.fuint.business.marketingActivity.cardValue.dto.SelectCard; import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord; import com.fuint.business.member.entity.LJStaff; import com.fuint.business.order.entity.CashierOrder; @@ -48,7 +50,7 @@ public interface CardValueRecordService extends IService { * @return */ CardValueRecordDTO prepaidCardTopUp(CardValueRecordDTO cardValueRecordDTO); - + JSONObject rechargeCard(SelectCard selectCard); CardValueRecord checkTheStatusOfYourPayment(Integer id) throws Exception; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java index cf5d73e86..9dd71185c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java @@ -1,5 +1,7 @@ package com.fuint.business.marketingActivity.cardValue.service.impl; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson.JSONObject; @@ -20,6 +22,7 @@ import com.fuint.business.commission.service.CommissionRecordService; import com.fuint.business.commission.service.StaffCommissionService; import com.fuint.business.integral.entity.IntegralDetail; import com.fuint.business.integral.service.IntegralDetailService; +import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon; import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange; import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord; import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService; @@ -29,7 +32,12 @@ import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRe import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService; import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableVO; +import com.fuint.business.marketingActivity.cardFule.dto.CardFuelRecordDTO; +import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel; +import com.fuint.business.marketingActivity.cardFule.service.CardFuelDieselService; +import com.fuint.business.marketingActivity.cardFule.service.CardFuelRecordService; import com.fuint.business.marketingActivity.cardValue.dto.CardValueRecordDTO; +import com.fuint.business.marketingActivity.cardValue.dto.SelectCard; import com.fuint.business.marketingActivity.cardValue.entity.CardValueChild; import com.fuint.business.marketingActivity.cardValue.mapper.CardValueChildMapper; import com.fuint.business.marketingActivity.cardValue.mapper.CardValueRecordMapper; @@ -78,11 +86,13 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.ZoneId; import java.util.*; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; /** * 储值充值表(CardValueRecord)表服务实现类 @@ -109,14 +119,10 @@ public class CardValueRecordServiceImpl extends ServiceImpl map = new HashMap<>(); @@ -436,7 +443,6 @@ public class CardValueRecordServiceImpl extends ServiceImpl msg = new HashMap<>(); // msg.put("tag","cardTag"); // msg.put("orderId",cardValueRecordDTO.getId().toString()); @@ -460,6 +464,159 @@ public class CardValueRecordServiceImpl extends ServiceImpl epsilon + && "unpaid".equals(payStatus)){ + theAmountToBePaid = selectCard.getRechargeBalance().doubleValue(); + flag = true; + } + if (flag) { + int allAmount = (int) (theAmountToBePaid*100); + MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(nowAccountInfo.getStoreId(),"1",null); + // 处理支付需要的数据 + Map map = new HashMap<>(); + map.put("authCode",selectCard.getAuthCode()); + map.put("allAmount", Integer.toString(allAmount)); + map.put("orderNo",orderNo); + map.put("payType",selectCard.getPaymentType()); + map.put("insCd",merchantConfig.getInsCd()); + map.put("mchntCd",merchantConfig.getMchntCd()); + map.put("goodsDes",merchantConfig.getMerchantName()); + map.put("publicKey",merchantConfig.getPublicKey()); + map.put("privateKey",merchantConfig.getPrivateKey()); + map.put("type","CVR"); + map.put("orderId",orderId.toString()); + map.put("storeId",nowAccountInfo.getStoreId().toString()); + map.put("payChannel",selectCard.getPayChannel()); + // 调用支付接口 + try { + fyPayService.pay(map); + } catch (Exception e){ + e.printStackTrace(); + } + } + return res; + + + } + private static AllOrderInfo getAllOrderInfo(CardValueRecordDTO cardValueRecordDTO) { AllOrderInfo allOrderInfo = new AllOrderInfo(); allOrderInfo.setOrderNo(cardValueRecordDTO.getPaymentNo()); @@ -468,6 +625,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl0; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java index 43ce6b7b9..b9b31da68 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java @@ -23,6 +23,7 @@ import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange; import com.fuint.business.marketingActivity.cardExchange.mapper.CardExchangeMapper; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable; import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableMapper; +import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel; import com.fuint.business.marketingActivity.cardValue.dto.CardValueDTO; import com.fuint.business.marketingActivity.cardValue.entity.CardValueChild; import com.fuint.business.marketingActivity.cardValue.mapper.CardValueMapper; @@ -546,11 +547,13 @@ public class CardValueServiceImpl extends ServiceImpl cardValueList(CardValue cardValue) { //获取当前登录用户 AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); - String nowTime = DateUtil.format(new Date(), "yyyy-MM-dd")+"00:00:00"; + String nowTime = DateUtil.format(new Date(), "yyyy-MM-dd")+" 00:00:00"; LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(CardValue::getStoreId,nowAccountInfo.getStoreId()).eq(CardValue::getIsonline,"0").eq(CardValue::getActiveStatus,"1").and(it->{ - return it.eq(CardValue::getActiveTime,"1").or().eq(CardValue::getActiveTime,"2") - .ge(CardValue::getStartTime,nowTime).le(CardValue::getEndTime,nowTime); + queryWrapper.eq(CardValue::getStoreId,nowAccountInfo.getStoreId()).eq(CardValue::getActiveStatus,"1").and(it->{ + return it.eq(CardValue::getActiveTime,"1").or(item->{ + return item .eq(CardValue::getActiveTime,"2") + .le(CardValue::getStartTime,nowTime).ge(CardValue::getEndTime,nowTime); + }); }).orderByAsc(CardValue::getRechargeBalance); return this.list(queryWrapper); } diff --git a/fuintCashierWeb/src/api/cashier/cardSet.js b/fuintCashierWeb/src/api/cashier/cardSet.js index a29f0f1fa..71e9729a1 100644 --- a/fuintCashierWeb/src/api/cashier/cardSet.js +++ b/fuintCashierWeb/src/api/cashier/cardSet.js @@ -35,6 +35,15 @@ export function getPrepaidCardTopUpApi(query) { data: query }) } +// 储值卡购买 +export function rechargeCard(data) { + return request({ + url: 'business/marketingActivity/cardValueRecord/rechargeCard', + method: 'post', + data: data + }) +} + // 余额插入订单 export function getCheckTheStatusOfYourPaymentApi(query) { diff --git a/fuintCashierWeb/src/api/newHome/newHome.js b/fuintCashierWeb/src/api/newHome/newHome.js index 23d025a51..eeb6f566e 100644 --- a/fuintCashierWeb/src/api/newHome/newHome.js +++ b/fuintCashierWeb/src/api/newHome/newHome.js @@ -7,7 +7,21 @@ export function cashRegisterList() { method: 'get', }) } +export function fuelCardList(query) { + return request({ + url: 'business/marketingActivity/cardFuelDiesel/fuelCardList', + method: 'get', + params: query + }) +} +export function getCanUseCoupon(query) { + return request({ + url: '/cardCoupon/getCanUseCoupon', + method: 'get', + params: query + }) +} //根据当前店铺id获取商品列表 export function cashRegisterGoodsList() { return request({ @@ -22,6 +36,14 @@ export function cardValueList() { method: 'get', }) } +// 查询油号 +export function oilName(oilType) { + return request({ + url: '/business/petrolStationManagement/oilNumber/getList2?oilType='+oilType, + method: 'get', + + }) +} export function getCoupons(param) { return request({ url: '/business/marketingActivity/cardValue/getCoupons', diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue b/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue index cd036a39a..923ba6d9b 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue @@ -538,7 +538,7 @@ import pickUp from './newHomeComponents/pickUpTheOrder.vue' import accountPending from './newHomeComponents/accountPending.vue' import memberRecharge from './newHomeComponents/memberRecharge.vue' import refuelingAmount from './newHomeComponents/refuelingAmount.vue' -import { cashRegisterList, cashRegisterGoodsList,getActivityList,getCouponList } from '@/api/newHome/newHome.js' +import { cashRegisterList, cashRegisterGoodsList,getActivityList,getCouponList,getCanUseCoupon } from '@/api/newHome/newHome.js' import {QRCodeByStoreId} from "@/api/staff/qrcode"; import {userListByPhone} from "@/api/cashier/user"; @@ -546,9 +546,7 @@ import { VueClipboard } from 'vue-clipboard2'; import {getDicts} from "@/api/dict/data"; import { getCheckTheStatusOfYourPaymentApi, - getCheckTheStatusOfYourPaymentByFuelApi, - getPrepaidCardTopUpApi, - getPrepaidFuelTopUpApi + rechargeCard } from "@/api/cashier/cardSet"; import {getReturnCode} from "@/api/print"; @@ -557,7 +555,7 @@ export default { return { payForm:{ realyPayBills:0.00, - paymentType:null, + paymentType:'ALIPAY', authCode:null, seekZero:0.00 }, @@ -678,10 +676,29 @@ export default { //会员搜索列表 vipUserList:[], chooseVipUser:{}, - cardValueForm:{}, + cardValueForm:{ + cardValueId: '', // 储值卡id + mtStaffId: '', // + realName: '', + staffMobile: '', + amount: '', // 自定义充值字段 + bidBalance: '', // 储值卡面值 + rechargeBalance: '', // 实际支付 + giftBalance: '',// 赠送金额 + points: '', //赠送积分 + growthValue: '', // 赠送成长值 + remark: '', + paymentType: 'WECHAT', // 支付方式 + royaltyType: '',// 提成类型 + percentageCommissions: null, + amountCommission: null, + rechargeType: '0' + }, + selectCard:{}, flag:1, jishuqi:0, continuePolling: true, // 控制轮询的变量 + sendCouponList:[] } }, watch: { @@ -848,13 +865,43 @@ export default { this.getDisTotal() console.log("选中的优惠券",this.chooseCoupon) }, + // 关闭支付窗口 + handClose1() { + this.isPay = true, + this.isPaySuccess = false, + this.isQuery = true + this.openConfirm = false + + this.payForm.authCode = null + + this.payForm.seekZero = 0 + + this.iniz() + + }, + iniz() { + this.cardValueForm = { + cardValueId: '', // 储值卡id + mtStaffId: '', // + realName: '', + staffMobile: '', + amount: '', // 自定义充值字段 + bidBalance: '', // 储值卡面值 + rechargeBalance: '', // 实际支付 + giftBalance: '',// 赠送金额 + points: '', //赠送积分 + growthValue: '', // 赠送成长值 + remark: '', + paymentType: 'WECHAT', // 支付方式 + royaltyType: '',// 提成类型 + percentageCommissions: null, + amountCommission: null, + rechargeType: '0' + } + }, async collection1() { - let actualPayment = 0 let makeChange = 0 - let userForm = this.chooseVipUser - - if (this.flag === 1) { if (!this.payForm.authCode && this.payForm.paymentType !== "CASH") { this.$message.error('请先扫码'); return @@ -867,22 +914,15 @@ export default { this.$modal.msgError("请输入正确的金额"); return; } - actualPayment = this.payForm.authCode makeChange = this.seekZero } // 会员id 会员名字会员手机号码 - this.cardValueForm.mtUserId = userForm.id - this.cardValueForm.name = userForm.name - this.cardValueForm.mobile = userForm.mobile - // 支付码 - this.cardValueForm.authCode = this.payForm.authCode - this.cardValueForm.realyPayBills = this.realyPayBills - this.cardValueForm.actualPayment = actualPayment - this.cardValueForm.makeChange = makeChange - - + this.payForm.mtUserId = this.chooseVipUser.id + // 现金找零金额 + this.payForm.seekZero = makeChange + this.payForm.payChannel = 'cashier' let id; - await getPrepaidCardTopUpApi(this.cardValueForm).then(response => { + await rechargeCard(this.payForm).then(response => { if (response.data != null) { this.loading = true; id = response.data.id @@ -934,85 +974,6 @@ export default { this_.isAwait = true; }, 15000) - } else if (this.flag === 2) { - if (!this.payForm.authCode && this.cardFuelDieselForm.paymentType !== "CASH") { - this.$message.error('请先扫码'); - return - }else { - if (this.payForm.authCode { - if (response.data != null) { - this.loading = true; - id = response.data.id - } - }); - - - let timer = setInterval(async () => { - getCheckTheStatusOfYourPaymentByFuelApi(id).then(async response => { - if (response.data != null) { - if (response.data.payStatus == "unpaid") { - this_.isQuery = true; - } - if (response.data.payStatus == "paid") { - this_.isPaySuccess = true; - this_.isQuery = false; - this_.rechargeOilCard = true - // await this.printLocally2() - await this.fuelDieselReport() - await this.getMemberAfter(); - clearInterval(timer); - } - if (response.data.payStatus == "payFail") { - this_.isPaySuccess = false; - this_.isQuery = false; - clearInterval(timer); - } - } - }) - }, 500); - - let timer2 = setInterval(function () { - if (this_.isQuery == false || !this_.openConfirm) { - this_.loading = false; - this_.isPay = false; - clearInterval(timer); - clearInterval(timer2); - } - }, 500) - - setTimeout(function () { - clearInterval(timer2); - clearInterval(timer); - this_.loading = false; - this_.isPay = false; - this_.isPaySuccess = false; - this_.isAwait = true; - - }, 15000) - - let this_ = this - } this.$forceUpdate(); }, @@ -1032,16 +993,23 @@ export default { this.$message.error('请选择支付方式'); return } - if (!selectCard.paymentType) { - this.$message.error('请选择输入充值本金'); - return - } - if (!selectCard.paymentType) { + if (!selectCard.rechargeBalance) { this.$message.error('请选择输入充值本金'); return } + this.payForm.rechargeBalance = selectCard.rechargeBalance this.payForm.realyPayBills = selectCard.rechargeBalance + this.payForm.selectCardId = selectCard.id + this.payForm.cardType = selectCard.cardType this.payForm.paymentType = selectCard.paymentType + this.payForm.giftBalance = selectCard.giftBalance + this.payForm.points = selectCard.points + this.payForm.growthValue = selectCard.growthValue + this.payForm.chooseStaff = selectCard.chooseStaff + this.payForm.desc = selectCard.desc + this.payForm.giftCardNo = selectCard.giftCardNo + this.payForm.giftCardPwd = selectCard.giftCardPwd + this.payForm.cardCouponList = selectCard.cardCouponList if (selectCard.cardType == 0){ this.flag = 1 }else if(selectCard.cardType == 1){ @@ -1150,17 +1118,7 @@ export default { this.couponList=[] } }, - copyToClipboard(textToCopy) { - - VueClipboard(textToCopy).then(() => { - this.$message.success("复制成功") - // 复制成功的操作 - }, () => { - console.log('复制失败'); - // 复制失败的操作 - }); - }, - restVipUser(){ + restVipUser(){ this.userInfo = false this.chooseVipUser = {} this.userMobile = '' @@ -1369,6 +1327,9 @@ export default { this.freeIndex = index }, addFreeTicket(){ + getCanUseCoupon().then(res=>{ + this.s + }) this.freeTicket = true }, addMemberRecharge() { diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/newHomeComponents/memberRecharge.vue b/fuintCashierWeb/src/views/cashier/NewComponents/newHomeComponents/memberRecharge.vue index 55830b201..92e3c7b64 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/newHomeComponents/memberRecharge.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/newHomeComponents/memberRecharge.vue @@ -1,5 +1,5 @@