From fced74216881553aae58d705778296459d5bec40 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Thu, 25 Jan 2024 13:19:17 +0800 Subject: [PATCH] bug --- .../impl/StaffCommissionServiceImpl.java | 144 +++++++++--------- .../service/impl/LJStaffServiceImpl.java | 10 +- .../order/mapper/xml/OilOrderMapper.xml | 1 - .../service/impl/OilOrderServiceImpl.java | 2 +- .../pagesMy/CardManagement/CardManagement.vue | 2 +- .../pagesRefuel/orderDetail/index.vue | 7 + 6 files changed, 90 insertions(+), 76 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/StaffCommissionServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/StaffCommissionServiceImpl.java index efc9132fe..b3708bb4e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/StaffCommissionServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/StaffCommissionServiceImpl.java @@ -110,85 +110,93 @@ public class StaffCommissionServiceImpl extends ServiceImpl0 && ObjectUtil.isNotEmpty(staff)){ for (StaffCommission staffCommission : list) { CommissionRecord commissionRecord = new CommissionRecord(); - if (type.equals("1") && staffCommission.getCommissionSource().equals("油品") - && staff.getRoleId().equals(staffCommission.getStaffRoleGroup())){ - commissionRecord.setStaffId(staffId); - commissionRecord.setStoreId(storeId); - commissionRecord.setType(type); - commissionRecord.setDescription(staffCommission.getCommissionSource()+"订单出售提成"); - commissionRecord.setOrderNo(orderNo); - Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0,staffCommission.getRoyaltyRate().length()-1)); - String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length()-1); + String[] staffRoleGroups = staffCommission.getStaffRoleGroup().split(","); + if (type.equals("1") && staffCommission.getCommissionSource().equals("油品")){ + for (String staffRoleGroup : staffRoleGroups) { + if (staff.getRoleId().equals(staffRoleGroup)){ + commissionRecord.setStaffId(staffId); + commissionRecord.setStoreId(storeId); + commissionRecord.setType(type); + commissionRecord.setDescription(staffCommission.getCommissionSource()+"订单出售提成"); + commissionRecord.setOrderNo(orderNo); + Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0,staffCommission.getRoyaltyRate().length()-1)); + String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length()-1); // 按照订单金额计算提成 - if (staffCommission.getType().equals("orderAmount")){ - if (amount>=Double.valueOf(staffCommission.getMeetCondition())){ - if (unit.equals("元")){ - commissionRecord.setAmount(royaltyRate); + if (staffCommission.getType().equals("orderAmount")){ + if (amount>=Double.valueOf(staffCommission.getMeetCondition())){ + if (unit.equals("元")){ + commissionRecord.setAmount(royaltyRate); + } + if (unit.equals("%")){ + commissionRecord.setAmount(amount*(royaltyRate/100)); + } + commissionRecordService.insertRecord(commissionRecord); + } } - if (unit.equals("%")){ - commissionRecord.setAmount(amount*(royaltyRate/100)); - } - commissionRecordService.insertRecord(commissionRecord); - } - } // 按照实付金额计算提成 - if (staffCommission.getType().equals("payAmount")){ - if (payAmount>=Double.valueOf(staffCommission.getMeetCondition())){ - if (unit.equals("元")){ - commissionRecord.setAmount(royaltyRate); + if (staffCommission.getType().equals("payAmount")){ + if (payAmount>=Double.valueOf(staffCommission.getMeetCondition())){ + if (unit.equals("元")){ + commissionRecord.setAmount(royaltyRate); + } + if (unit.equals("%")){ + commissionRecord.setAmount(payAmount*(royaltyRate/100)); + } + commissionRecordService.insertRecord(commissionRecord); + } } - if (unit.equals("%")){ - commissionRecord.setAmount(payAmount*(royaltyRate/100)); - } - commissionRecordService.insertRecord(commissionRecord); - } - } // 按照加油数量计算提成 - if (staffCommission.getType().equals("refuleNum")){ - if (oilLiters>=Double.valueOf(staffCommission.getMeetCondition())){ - if (unit.equals("元")){ - commissionRecord.setAmount(royaltyRate); + if (staffCommission.getType().equals("refuleNum")){ + if (oilLiters>=Double.valueOf(staffCommission.getMeetCondition())){ + if (unit.equals("元")){ + commissionRecord.setAmount(royaltyRate); + } + if (unit.equals("%")){ + commissionRecord.setAmount(oilLiters*(royaltyRate/100)); + } + commissionRecordService.insertRecord(commissionRecord); + } } - if (unit.equals("%")){ - commissionRecord.setAmount(oilLiters*(royaltyRate/100)); + } + } + + } + if (type.equals("2") && staffCommission.getCommissionSource().equals("非油品")){ + for (String staffRoleGroup : staffRoleGroups) { + if (staff.getRoleId().equals(staffRoleGroup)) { + commissionRecord.setStaffId(staffId); + commissionRecord.setStoreId(storeId); + commissionRecord.setType(staffCommission.getCommissionSource() + "订单出售"); + commissionRecord.setDescription(staffCommission.getCommissionSource() + "订单出售提成"); + commissionRecord.setOrderNo(orderNo); + Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0, staffCommission.getRoyaltyRate().length() - 1)); + String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length() - 1); +// 按照订单金额计算提成 + if (staffCommission.getType().equals("orderAmount")) { + if (amount >= Double.valueOf(staffCommission.getMeetCondition())) { + if (unit.equals("元")) { + commissionRecord.setAmount(royaltyRate); + } + if (unit.equals("%")) { + commissionRecord.setAmount(amount * (royaltyRate / 100)); + } + } + } +// 按照实付金额计算提成 + if (staffCommission.getType().equals("payAmount")) { + if (payAmount >= Double.valueOf(staffCommission.getMeetCondition())) { + if (unit.equals("元")) { + commissionRecord.setAmount(royaltyRate); + } + if (unit.equals("%")) { + commissionRecord.setAmount(payAmount * (royaltyRate / 100)); + } + } } commissionRecordService.insertRecord(commissionRecord); } } } - if (type.equals("2") && staffCommission.getCommissionSource().equals("非油品") - && staff.getRoleId().equals(staffCommission.getStaffRoleGroup())){ - commissionRecord.setStaffId(staffId); - commissionRecord.setStoreId(storeId); - commissionRecord.setType(staffCommission.getCommissionSource()+"订单出售"); - commissionRecord.setDescription(staffCommission.getCommissionSource()+"订单出售提成"); - commissionRecord.setOrderNo(orderNo); - Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0,staffCommission.getRoyaltyRate().length()-1)); - String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length()-1); -// 按照订单金额计算提成 - if (staffCommission.getType().equals("orderAmount")){ - if (amount>=Double.valueOf(staffCommission.getMeetCondition())){ - if (unit.equals("元")){ - commissionRecord.setAmount(royaltyRate); - } - if (unit.equals("%")){ - commissionRecord.setAmount(amount*(royaltyRate/100)); - } - } - } -// 按照实付金额计算提成 - if (staffCommission.getType().equals("payAmount")){ - if (payAmount>=Double.valueOf(staffCommission.getMeetCondition())){ - if (unit.equals("元")){ - commissionRecord.setAmount(royaltyRate); - } - if (unit.equals("%")){ - commissionRecord.setAmount(payAmount*(royaltyRate/100)); - } - } - } - commissionRecordService.insertRecord(commissionRecord); - } } } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java index 1579b5565..7e17b4aec 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java @@ -240,13 +240,13 @@ public class LJStaffServiceImpl extends ServiceImpl impl LJStaff staff = this.selectStaffById(id); LJStore store = storeService.selectStoreByStoreId(staff.getStoreId()); //在图片上生成二维码 -// String backgroundImage = "/static/qrCodeImg/laigeyouhui_bg.jpg"; -// String logoImage = "/static/qrCodeImg/logo.png"; - String backgroundImage = env.getProperty("staff.bg"); - String logoImage = env.getProperty("staff.logo"); + String backgroundImage = "/static/qrCodeImg/laigeyouhui_bg.jpg"; + String logoImage = "/static/qrCodeImg/logo.png"; +// String backgroundImage = env.getProperty("staff.bg"); +// String logoImage = env.getProperty("staff.logo"); String url = staff.getStaffCode(); String area = store.getName(); - String finalPath="D:/qrCode/" + area + ".jpg"; + String finalPath="D:/ruoyi/qrCode/" + area + ".jpg"; //背景图片路径 loge图片 二维码 输出地址 createLogoCodePicture(backgroundImage, logoImage, url, finalPath, area,store.getAddress()); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml index 468adceba..e657dc60e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml @@ -66,7 +66,6 @@ user_id = #{order.userId} - and terminal = 'applet' and store_id = #{order.storeId} 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 f0402b898..02f58abba 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 @@ -1038,7 +1038,7 @@ public class OilOrderServiceImpl extends ServiceImpl i receiveParameter.setGoodsMoney(Double.valueOf(map.get("payAmount"))); receiveParameter.setStoreId(oilOrder.getStoreId()); receiveParameter.setPayType(oilOrder.getPayType()); - receiveParameter.setUserId(userId); + receiveParameter.setUserId(oilOrder.getUserId()); // 调用支付接口 try { applet = fyPayService.applet(receiveParameter); diff --git a/gasStation-uni/pagesMy/CardManagement/CardManagement.vue b/gasStation-uni/pagesMy/CardManagement/CardManagement.vue index 3a36602f7..ba7b72b18 100644 --- a/gasStation-uni/pagesMy/CardManagement/CardManagement.vue +++ b/gasStation-uni/pagesMy/CardManagement/CardManagement.vue @@ -43,7 +43,7 @@ {{item.cardChildPhones}} - 去完成 + 查看订单 diff --git a/gasStation-uni/pagesRefuel/orderDetail/index.vue b/gasStation-uni/pagesRefuel/orderDetail/index.vue index 0f597b380..f1637486d 100644 --- a/gasStation-uni/pagesRefuel/orderDetail/index.vue +++ b/gasStation-uni/pagesRefuel/orderDetail/index.vue @@ -289,6 +289,13 @@ // 支付接口 payment(){ + if (this.isUseChildCard){ + if(this.balanceRedece>0){ + this.isUseChildCard = true + }else{ + this.isUseChildCard = false + } + } let map = { orderNo : this.orderNo, payAmount : this.payAmount,