This commit is contained in:
cun-nan 2024-10-14 18:00:48 +08:00
parent 07ae17f154
commit 681cfddf20
5 changed files with 51 additions and 31 deletions

View File

@ -663,7 +663,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setAfterDiscountAmount(oilAmount + goodsAmount - oilDiscount - goodsDiscount); cashierOrder.setAfterDiscountAmount(oilAmount + goodsAmount - oilDiscount - goodsDiscount);
// 如果金额不等于0调用第三方支付接口 // 如果金额不等于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); Integer allAmount = (int) (Double.valueOf(map.get("allAmount")) * 100);
// 处理支付需要的数据 // 处理支付需要的数据
@ -1160,10 +1160,25 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 判断油品消费升数是否可使用 // 判断油品消费升数是否可使用
Double fuelAmount = userFuelService.selectByUserIdAndOilId(userId, Integer.valueOf(oilOrders.get("oils").toString()), storeId); Double fuelAmount = userFuelService.selectByUserIdAndOilId(userId, Integer.valueOf(oilOrders.get("oils").toString()), storeId);
List<String> 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) { if (fuelAmount < oilCardAmount && cardBalance < oilActualPay) {
res.put("error", "余额不足,请分开支付"); res.put("error", "余额不足,请分开支付");
return res; return res;
} }
if (fuelAmount < oilCardAmount && cardBalance >= oilActualPay){
if (!flag) {
res.put("error", "此油品不支持储值卡支付");
return res;
}
}
OilOrder order = new OilOrder(); OilOrder order = new OilOrder();
@ -1197,10 +1212,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
} }
// 计算成长值 // 计算成长值
this.updateGrowthValue1(oilAmount, 0.0, userId, Integer.valueOf(order.getOils()), 0.0, storeId, orderNo); this.updateGrowthValue1(oilAmount, oilActualPay, userId, Integer.valueOf(order.getOils()), 0.0, storeId, orderNo);
// 修改囤油卡升数信息
// userFuelService.
// 修改储值卡余额信息
cashierOrder.setStaffId(order.getStaffId()); cashierOrder.setStaffId(order.getStaffId());
cashierOrder.setStoreId(accountInfo.getStoreId()); cashierOrder.setStoreId(accountInfo.getStoreId());

View File

@ -1,6 +1,7 @@
package com.fuint.pay.service.impl; package com.fuint.pay.service.impl;
import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateField;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray; import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
@ -595,7 +596,7 @@ public class PayCenterServiceImpl implements PayCenterService {
m2.put("storeId", userBalance.getStoreId()); m2.put("storeId", userBalance.getStoreId());
MtInvitation invitation = mtInvitationService.getOneByMap(m2); MtInvitation invitation = mtInvitationService.getOneByMap(m2);
// 当推荐人 不为null时 再去判断推荐人是否有资格参与活动 // 当推荐人 不为null时 再去判断推荐人是否有资格参与活动
if (invitation != null) { if (invitation != null && ObjectUtil.isNotEmpty(invitation.getInviterId())) {
// 根据店铺id 邀请人id 查询出 邀请人会员信息 // 根据店铺id 邀请人id 查询出 邀请人会员信息
UserBalance invitationBalance = userBalanceService.selectUserBalanceByStorId(invitation.getInviterId(), Integer.parseInt(map.get("storeId"))); UserBalance invitationBalance = userBalanceService.selectUserBalanceByStorId(invitation.getInviterId(), Integer.parseInt(map.get("storeId")));

View File

@ -129,6 +129,13 @@ export const constantRoutes = [
name: 'Handover', name: 'Handover',
component: () => import('@/views/cashier/NewComponents/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', path: '/details',
name: 'details', name: 'details',
@ -142,28 +149,28 @@ export const constantRoutes = [
] ]
}, },
{ // {
path: '/handover', // path: '/handover',
component: Layout, // component: Layout,
hidden: true, // hidden: true,
redirect: 'noredirect', // redirect: 'noredirect',
children: [ // children: [
{ // {
path: '/handover/info', // path: '/handover/info',
component: () => import('@/views/cashier/NewComponents/handover/list'), // component: () => import('@/views/cashier/NewComponents/handover/list'),
name: 'handover-info', // name: 'handover-info',
props: true, // 启用路由参数作为组件的props // props: true, // 启用路由参数作为组件的props
meta: { title: '交易明细', icon: 'user' } // meta: { title: '交易明细', icon: 'user' }
}, // },
// { // // {
// path: '/handover/details', // // path: '/handover/details',
// component: () => import('@/views/handover/info/rec/details'), // // component: () => import('@/views/handover/info/rec/details'),
// name: 'handover-details', // // name: 'handover-details',
// props: true, // 启用路由参数作为组件的props // // props: true, // 启用路由参数作为组件的props
// meta: { title: '交易明细', icon: 'user' } // // meta: { title: '交易明细', icon: 'user' }
// }, // // },
] // ]
} // }
] ]
} }

View File

@ -119,7 +119,7 @@ export default {
transactionDetailMethod(data) { transactionDetailMethod(data) {
console.log("transactionDetailMethod",data) console.log("transactionDetailMethod",data)
this.$router.push({ this.$router.push({
name: 'handover-info', path: '/handover/info',
params: { params: {
staffId : data.staffId, staffId : data.staffId,
btime : data.startTime, btime : data.startTime,

View File

@ -1238,7 +1238,7 @@ export default {
setTimeout(function () { setTimeout(function () {
_this.loading = false; _this.loading = false;
_this.isPaySuccess = true; _this.isPaySuccess = true;
_this.isPay = true; _this.isPay = false;
// _this.printLocally() // _this.printLocally()
_this.oilOrderReport() _this.oilOrderReport()
_this.resetting1(); _this.resetting1();
@ -1247,7 +1247,7 @@ export default {
setTimeout(function () { setTimeout(function () {
_this.loading = false; _this.loading = false;
_this.isPaySuccess = false; _this.isPaySuccess = false;
_this.isPay = true; _this.isPay = false;
_this.resetting1(); _this.resetting1();
this.$modal.msgError(resp.data.error) this.$modal.msgError(resp.data.error)
}, 3000) }, 3000)