From 681cfddf206282646a963b4f33ccd5e4d8d16221 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Mon, 14 Oct 2024 18:00:48 +0800 Subject: [PATCH] 10.14 --- .../service/impl/OilOrderServiceImpl.java | 22 ++++++-- .../service/impl/PayCenterServiceImpl.java | 3 +- fuintCashierWeb/src/router/index.js | 51 +++++++++++-------- .../cashier/NewComponents/HandoverRecord.vue | 2 +- .../views/cashier/NewComponents/newHome.vue | 4 +- 5 files changed, 51 insertions(+), 31 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java index 55c7f88b9..15162d936 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java @@ -663,7 +663,7 @@ public class OilOrderServiceImpl extends ServiceImpl i cashierOrder.setAfterDiscountAmount(oilAmount + goodsAmount - oilDiscount - goodsDiscount); // 如果金额不等于0调用第三方支付接口 - if (!map.get("allAmount").equals("0") && !map.get("payType").equals("CASH") && !payType.equals("after_pay")) { + if (!map.get("allAmount").equals("0") && !map.get("payType").equals("CASH") && !payType.equals("after_pay") && !payType.equals("card_value") && !payType.equals("fule_card")) { Integer allAmount = (int) (Double.valueOf(map.get("allAmount")) * 100); // 处理支付需要的数据 @@ -1160,10 +1160,25 @@ public class OilOrderServiceImpl extends ServiceImpl i // 判断油品消费升数是否可使用 Double fuelAmount = userFuelService.selectByUserIdAndOilId(userId, Integer.valueOf(oilOrders.get("oils").toString()), storeId); + List oilIds = cardValueRuleService.getOilIds(storeId); + boolean flag = false; + for (String oilId : oilIds) { + if (oilId.equals(oilOrders.get("oils").toString())) { + flag = true; + } + } + + if (fuelAmount < oilCardAmount && cardBalance < oilActualPay) { res.put("error", "余额不足,请分开支付"); return res; } + if (fuelAmount < oilCardAmount && cardBalance >= oilActualPay){ + if (!flag) { + res.put("error", "此油品不支持储值卡支付"); + return res; + } + } OilOrder order = new OilOrder(); @@ -1197,10 +1212,7 @@ public class OilOrderServiceImpl extends ServiceImpl i } // 计算成长值 - this.updateGrowthValue1(oilAmount, 0.0, userId, Integer.valueOf(order.getOils()), 0.0, storeId, orderNo); - // 修改囤油卡升数信息 -// userFuelService. - // 修改储值卡余额信息 + this.updateGrowthValue1(oilAmount, oilActualPay, userId, Integer.valueOf(order.getOils()), 0.0, storeId, orderNo); cashierOrder.setStaffId(order.getStaffId()); cashierOrder.setStoreId(accountInfo.getStoreId()); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/pay/service/impl/PayCenterServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/pay/service/impl/PayCenterServiceImpl.java index f1f0ad805..3d98dde3e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/pay/service/impl/PayCenterServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/pay/service/impl/PayCenterServiceImpl.java @@ -1,6 +1,7 @@ package com.fuint.pay.service.impl; import cn.hutool.core.date.DateField; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONUtil; @@ -595,7 +596,7 @@ public class PayCenterServiceImpl implements PayCenterService { m2.put("storeId", userBalance.getStoreId()); MtInvitation invitation = mtInvitationService.getOneByMap(m2); // 当推荐人 不为null时 再去判断推荐人是否有资格参与活动 - if (invitation != null) { + if (invitation != null && ObjectUtil.isNotEmpty(invitation.getInviterId())) { // 根据店铺id 和 邀请人id 查询出 邀请人会员信息 UserBalance invitationBalance = userBalanceService.selectUserBalanceByStorId(invitation.getInviterId(), Integer.parseInt(map.get("storeId"))); diff --git a/fuintCashierWeb/src/router/index.js b/fuintCashierWeb/src/router/index.js index f66f4126d..189fb56aa 100644 --- a/fuintCashierWeb/src/router/index.js +++ b/fuintCashierWeb/src/router/index.js @@ -129,6 +129,13 @@ export const constantRoutes = [ name: 'Handover', component: () => import('@/views/cashier/NewComponents/Handover'), }, + { + path: '/handover/info', + component: () => import('@/views/cashier/NewComponents/handover/list'), + name: 'handover-info', + props: true, // 启用路由参数作为组件的props + meta: { title: '交易明细', icon: 'user' } + }, { path: '/details', name: 'details', @@ -142,28 +149,28 @@ export const constantRoutes = [ ] }, - { - path: '/handover', - component: Layout, - hidden: true, - redirect: 'noredirect', - children: [ - { - path: '/handover/info', - component: () => import('@/views/cashier/NewComponents/handover/list'), - name: 'handover-info', - props: true, // 启用路由参数作为组件的props - meta: { title: '交易明细', icon: 'user' } - }, - // { - // path: '/handover/details', - // component: () => import('@/views/handover/info/rec/details'), - // name: 'handover-details', - // props: true, // 启用路由参数作为组件的props - // meta: { title: '交易明细', icon: 'user' } - // }, - ] - } + // { + // path: '/handover', + // component: Layout, + // hidden: true, + // redirect: 'noredirect', + // children: [ + // { + // path: '/handover/info', + // component: () => import('@/views/cashier/NewComponents/handover/list'), + // name: 'handover-info', + // props: true, // 启用路由参数作为组件的props + // meta: { title: '交易明细', icon: 'user' } + // }, + // // { + // // path: '/handover/details', + // // component: () => import('@/views/handover/info/rec/details'), + // // name: 'handover-details', + // // props: true, // 启用路由参数作为组件的props + // // meta: { title: '交易明细', icon: 'user' } + // // }, + // ] + // } ] } diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/HandoverRecord.vue b/fuintCashierWeb/src/views/cashier/NewComponents/HandoverRecord.vue index cc81cb525..b5a4db764 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/HandoverRecord.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/HandoverRecord.vue @@ -119,7 +119,7 @@ export default { transactionDetailMethod(data) { console.log("transactionDetailMethod",data) this.$router.push({ - name: 'handover-info', + path: '/handover/info', params: { staffId : data.staffId, btime : data.startTime, diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue b/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue index 9a4b4714c..8528b45e2 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue @@ -1238,7 +1238,7 @@ export default { setTimeout(function () { _this.loading = false; _this.isPaySuccess = true; - _this.isPay = true; + _this.isPay = false; // _this.printLocally() _this.oilOrderReport() _this.resetting1(); @@ -1247,7 +1247,7 @@ export default { setTimeout(function () { _this.loading = false; _this.isPaySuccess = false; - _this.isPay = true; + _this.isPay = false; _this.resetting1(); this.$modal.msgError(resp.data.error) }, 3000)