diff --git a/fuintAdmin/src/main.js b/fuintAdmin/src/main.js index 5d561283c..2f4e1828c 100644 --- a/fuintAdmin/src/main.js +++ b/fuintAdmin/src/main.js @@ -50,7 +50,8 @@ Vue.prototype.getName = getName Vue.prototype.download = download Vue.prototype.handleTree = handleTree Vue.prototype.imgurl = 'http://192.168.0.138:8008' -Vue.prototype.pcUrl = 'http://192.168.0.178:83/' +// Vue.prototype.pcUrl = 'http://192.168.0.178:83/' +Vue.prototype.pcUrl = 'https://cashier.youkerr.com/' // 全局组件挂载 Vue.component('DictTag', DictTag) diff --git a/fuintAdmin/src/views/EventMarketing/SaveBlock/index.vue b/fuintAdmin/src/views/EventMarketing/SaveBlock/index.vue index 3f1d35584..b04e9fb33 100644 --- a/fuintAdmin/src/views/EventMarketing/SaveBlock/index.vue +++ b/fuintAdmin/src/views/EventMarketing/SaveBlock/index.vue @@ -734,9 +734,10 @@ validityOne: null, validityTwo:null, validity:row.validity, - giftCardDetail: row.useInstructions , //券详情 + giftCardDetail: row.cardDetail , //券详情 giftCardTime: row.validity, //券有效期 - giftCardTotal: 1 //券数量 + giftCardTotal: 1, //券数量 + instruction: row.useInstructions, //使用说明 } this.duihuanquanlist.push(data) this.$message.success("新增成功") @@ -762,9 +763,10 @@ validityZero: row.validityZero, validityOne: row.validityOne, validityTwo:row.validityTwo, - giftCardDetail: "满"+ row.satisfiedAmount+"减 "+row.discountAmount+"元" , //券详情 + giftCardDetail:row.cardDetail , //券详情 giftCardTime: "", //券有效期 - giftCardTotal: 1//券数量 + giftCardTotal: 1,//券数量 + instruction: row.instruction,//使用说明 } this.youhuiquanlist.push(data) this.$message.success("新增成功") diff --git a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue index cc2a3743a..908013d54 100644 --- a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue +++ b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue @@ -1017,7 +1017,7 @@ export default { validityZero: row.validityZero, validityOne: row.validityOne, validityTwo:row.validityTwo, - giftCardDetail: "满"+ row.satisfiedAmount+"减 "+row.discountAmount+"元" , //券详情 + giftCardDetail: row.cardDetail, //券详情 giftCardTime: "", //券有效期 giftCardTotal: 1,//券数量 instruction: row.instruction,//使用说明 diff --git a/fuintAdmin/src/views/EventMarketing/activeNewlyweds/index.vue b/fuintAdmin/src/views/EventMarketing/activeNewlyweds/index.vue index de8dd701e..15d953038 100644 --- a/fuintAdmin/src/views/EventMarketing/activeNewlyweds/index.vue +++ b/fuintAdmin/src/views/EventMarketing/activeNewlyweds/index.vue @@ -816,7 +816,7 @@ export default { validityZero: row.validityZero, validityOne: row.validityOne, validityTwo:row.validityTwo, - giftCardDetail: "满"+ row.satisfiedAmount+"减 "+row.discountAmount+"元" , //券详情 + giftCardDetail: row.cardDetail , //券详情 giftCardTime: "", //券有效期 giftCardTotal: 1,//券数量 instruction: row.instruction,//使用说明 diff --git a/fuintAdmin/src/views/EventMarketing/activeRecommend/index.vue b/fuintAdmin/src/views/EventMarketing/activeRecommend/index.vue index 097ca0da8..1df89074b 100644 --- a/fuintAdmin/src/views/EventMarketing/activeRecommend/index.vue +++ b/fuintAdmin/src/views/EventMarketing/activeRecommend/index.vue @@ -985,7 +985,7 @@ export default { validityZero: row.validityZero, validityOne: row.validityOne, validityTwo:row.validityTwo, - giftCardDetail: "满"+ row.satisfiedAmount+"减 "+row.discountAmount+"元" , //券详情 + giftCardDetail:row.cardDetail , //券详情 giftCardTime: "", //券有效期 giftCardTotal: 1,//券数量 instruction: row.instruction,//使用说明 @@ -1015,7 +1015,7 @@ export default { validityZero: row.validityZero, validityOne: row.validityOne, validityTwo:row.validityTwo, - giftCardDetail: "满"+ row.satisfiedAmount+"减 "+row.discountAmount+"元" , //券详情 + giftCardDetail: row.cardDetail , //券详情 giftCardTime: "", //券有效期 giftCardTotal: 1,//券数量 instruction: row.instruction,//使用说明 diff --git a/fuintAdmin/src/views/EventMarketing/yijiancoupon/index.vue b/fuintAdmin/src/views/EventMarketing/yijiancoupon/index.vue index ba0a52b46..6521f16fe 100644 --- a/fuintAdmin/src/views/EventMarketing/yijiancoupon/index.vue +++ b/fuintAdmin/src/views/EventMarketing/yijiancoupon/index.vue @@ -806,7 +806,7 @@ export default { validityOne: null, validityTwo:null, validity:row.validity, - cardDetail: row.useInstructions , //券详情 + cardDetail: row.cardDetail , //券详情 giftCardTime: row.validity, //券有效期 giftCardTotal: 1 //券数量 } @@ -835,7 +835,7 @@ export default { validityZero: row.validityZero, validityOne: row.validityOne, validityTwo:row.validityTwo, - cardDetail: "满"+ row.satisfiedAmount+"减 "+row.discountAmount+"元" , //券详情 + cardDetail: row.cardDetail , //券详情 giftCardTime: "", //券有效期 giftCardTotal: 1//券数量 } diff --git a/fuintAdmin/src/views/userGrade/index.vue b/fuintAdmin/src/views/userGrade/index.vue index f47bf4f2b..14f895c65 100644 --- a/fuintAdmin/src/views/userGrade/index.vue +++ b/fuintAdmin/src/views/userGrade/index.vue @@ -978,7 +978,7 @@ export default { validityZero: row.validityZero, validityOne: row.validityOne, validityTwo:row.validityTwo, - giftCardDetail: "满"+ row.satisfiedAmount+"减 "+row.discountAmount+"元" , //券详情 + giftCardDetail: row.cardDetail , //券详情 giftCardTime: "", //券有效期 giftCardTotal: 1,//券数量 instruction: row.instruction,//使用说明 diff --git a/fuintAdmin_zt/src/main.js b/fuintAdmin_zt/src/main.js index 82a714338..631da0e71 100644 --- a/fuintAdmin_zt/src/main.js +++ b/fuintAdmin_zt/src/main.js @@ -49,7 +49,8 @@ Vue.prototype.download = download Vue.prototype.handleTree = handleTree // Vue.prototype.pcUrl = 'http://192.168.0.121:82/' // Vue.prototype.pcUrl = 'http://192.168.31.96:82/' -Vue.prototype.pcUrl = 'http://47.95.206.185:85/' +// Vue.prototype.pcUrl = 'http://47.95.206.185:85/' +Vue.prototype.pcUrl = 'https://www.youkerr.com/' // 全局组件挂载 Vue.component('DictTag', DictTag) 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 735d439f6..0723fab98 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 @@ -188,7 +188,7 @@ public class FyPayServiceImpl implements FyPayService { oilOrder.setOrderStatus("paid"); oilOrder.setPayTime(date); oilOrderService.updateCardAndActiveById(oilOrder.getStoreId(),oilOrder.getUserId(),oilOrder.getActiveId(),oilOrder.getCouponId(),oilOrder.getActiveType(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(), Integer.valueOf(oilOrder.getOils())); - staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),"1",orderNo); + if (ObjectUtil.isNotEmpty(oilOrder.getStaffId())) staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),"1",orderNo); // 修改油罐容量 List jsonObjects = JSONArray.parseArray(map1.get("oilOrder"), JSONObject.class); if (jsonObjects.size()<=1) { @@ -216,7 +216,7 @@ public class FyPayServiceImpl implements FyPayService { if (goodsOrder.getUserId()!=null){ isMember = true; } - staffCommissionService.countStaffCommission(goodsOrder.getStaffId(),goodsOrder.getStoreId(),goodsOrder.getAmount(),goodsOrder.getPayAmount(),"2",orderNo); + if (ObjectUtil.isNotEmpty(goodsOrder.getStaffId())) staffCommissionService.countStaffCommission(goodsOrder.getStaffId(),goodsOrder.getStoreId(),goodsOrder.getAmount(),goodsOrder.getPayAmount(),"2",orderNo); if (!map1.get("goodsOrder").equals("[]")){ List goods = JSONArray.parseArray(map1.get("goodsOrder"), JSONObject.class); OrderGoods orderGoods = new OrderGoods(); @@ -253,7 +253,7 @@ public class FyPayServiceImpl implements FyPayService { } for (OilOrder order : list) { if (order.getOrderType().equals("主订单")){ - staffCommissionService.countStaffCommission(order.getStaffId(),order.getStoreId(),order.getOrderAmount(),order.getPayAmount(),"1",orderNo); + if (ObjectUtil.isNotEmpty(order.getStaffId()))staffCommissionService.countStaffCommission(order.getStaffId(),order.getStoreId(),order.getOrderAmount(),order.getPayAmount(),"1",orderNo); } // 添加多个油品订单 order.setOrderStatus("paid"); 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 877987adf..391e88dd2 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 @@ -116,50 +116,51 @@ public class StaffCommissionServiceImpl extends ServiceImpl(); - queryWrapper.eq("store_id",storeId); - queryWrapper.eq("status","qy"); + if (ObjectUtil.isNotEmpty(staffId)) { + LJStaff staff = staffService.selectStaffById(staffId); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("store_id", storeId); + queryWrapper.eq("status", "qy"); // 查询当前店铺启用的提成方案信息 - List list = baseMapper.selectList(queryWrapper); - if (list.size()>0 && ObjectUtil.isNotEmpty(staff)){ - for (StaffCommission staffCommission : list) { - CommissionRecord commissionRecord = new CommissionRecord(); - 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); + List list = baseMapper.selectList(queryWrapper); + if (list.size() > 0 && ObjectUtil.isNotEmpty(staff)) { + for (StaffCommission staffCommission : list) { + CommissionRecord commissionRecord = new CommissionRecord(); + 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())){ @@ -172,114 +173,115 @@ public class StaffCommissionServiceImpl extends ServiceImpl= Double.valueOf(staffCommission.getMeetCondition())) { - if (unit.equals("元")) { - commissionRecord.setAmount(royaltyRate); - } - if (unit.equals("%")) { - commissionRecord.setAmount(amount * (royaltyRate / 100)); + 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)); + 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); } - commissionRecordService.insertRecord(commissionRecord); } } - } - if (type.equals("3") && 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 (type.equals("3") && 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 (unit.equals("%")) { - commissionRecord.setAmount(amount * (royaltyRate / 100)); + 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)); + 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); } - commissionRecordService.insertRecord(commissionRecord); } } - } - if (type.equals("4") && 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 (type.equals("4") && 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 (unit.equals("%")) { - commissionRecord.setAmount(amount * (royaltyRate / 100)); + 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)); + 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); } - commissionRecordService.insertRecord(commissionRecord); } } } 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 19ae112c1..d36bc67c3 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 @@ -462,7 +462,11 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setPayTime(new Date()); order.setOrderStatus("paid"); } - baseMapper.insert(order); + if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))){ + baseMapper.updateById(order); + }else { + baseMapper.insert(order); + } oilOrder1 = this.selectOilOrderByOrderNo(orderNo); } } @@ -669,7 +673,8 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setStoreId(accountInfo.getStoreId()); order.setUserId(userId); order.setCommissionAmount(Double.valueOf(map.get("commissionAmount"))); - order.setStaffId(Integer.valueOf(map.get("staffId"))); + if (ObjectUtil.isNotEmpty(map.get("staffId"))) + order.setStaffId(Integer.valueOf(map.get("staffId"))); order.setTerminal(map.get("terminal")); order.setOils((String) oilOrders.get(i).get("oilName")); order.setOilGunNum(oilOrders.get(i).get("gunName").toString()); @@ -682,7 +687,11 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setPayTime(new Date()); this.addOilTrack(oilOrders.get(i), accountInfo.getStoreId()); - baseMapper.insert(order); + if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))){ + baseMapper.updateById(order); + }else { + baseMapper.insert(order); + } oilOrder = this.selectOilOrderByOrderNo(orderNo); this.updateGrowthValue1(oilAmount,0.0, userId, Integer.valueOf(oilOrder.getOils()), refuelMoneyLiters - Double.valueOf(oilOrders.get(i).get("liters").toString()), storeId,orderNo); @@ -706,7 +715,8 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setStoreId(accountInfo.getStoreId()); order.setUserId(userId); order.setCommissionAmount(Double.valueOf(map.get("commissionAmount"))); - order.setStaffId(Integer.valueOf(map.get("staffId"))); + if (ObjectUtil.isNotEmpty(map.get("staffId"))) + order.setStaffId(Integer.valueOf(map.get("staffId"))); order.setTerminal(map.get("terminal")); order.setOils((String) oilOrders.get(i).get("oilName")); order.setOilGunNum(oilOrders.get(i).get("gunName").toString()); @@ -719,7 +729,11 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setPayTime(new Date()); this.addOilTrack(oilOrders.get(i), accountInfo.getStoreId()); - baseMapper.insert(order); + if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))){ + baseMapper.updateById(order); + }else { + baseMapper.insert(order); + } oilOrder = this.selectOilOrderByOrderNo(orderNo); this.updateGrowthValue1(oilAmount,(Double.valueOf(oilOrders.get(i).get("liters").toString())-refuelMoneyLiters)*oilPrice, userId, Integer.valueOf(oilOrder.getOils()), 0.0, storeId,orderNo); @@ -743,7 +757,8 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setStoreId(accountInfo.getStoreId()); order.setUserId(userId); order.setCommissionAmount(Double.valueOf(map.get("commissionAmount"))); - order.setStaffId(Integer.valueOf(map.get("staffId"))); + if (ObjectUtil.isNotEmpty(map.get("staffId"))) + order.setStaffId(Integer.valueOf(map.get("staffId"))); order.setTerminal(map.get("terminal")); order.setOils((String) oilOrders.get(i).get("oilName")); order.setOilGunNum(oilOrders.get(i).get("gunName").toString()); @@ -756,7 +771,11 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setPayTime(new Date()); this.addOilTrack(oilOrders.get(i), accountInfo.getStoreId()); - baseMapper.insert(order); + if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))){ + baseMapper.updateById(order); + }else { + baseMapper.insert(order); + } oilOrder = this.selectOilOrderByOrderNo(orderNo); this.updateGrowthValue1(oilAmount,oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo); @@ -785,7 +804,8 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setStoreId(accountInfo.getStoreId()); order.setUserId(userId); order.setCommissionAmount(Double.valueOf(map.get("commissionAmount"))); - order.setStaffId(Integer.valueOf(map.get("staffId"))); + if (ObjectUtil.isNotEmpty(map.get("staffId"))) + order.setStaffId(Integer.valueOf(map.get("staffId"))); order.setTerminal(map.get("terminal")); order.setOils((String) oilOrders.get(i).get("oilName")); order.setOilGunNum(oilOrders.get(i).get("gunName").toString()); @@ -798,7 +818,12 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setPayTime(new Date()); this.addOilTrack(oilOrders.get(i), accountInfo.getStoreId()); - baseMapper.insert(order); + if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))){ + baseMapper.updateById(order); + }else { + baseMapper.insert(order); + } + oilOrder = this.selectOilOrderByOrderNo(orderNo); this.updateGrowthValue1(oilAmount,oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo); @@ -807,7 +832,8 @@ public class OilOrderServiceImpl extends ServiceImpl i if (flag){ - cashierOrder.setStaffId(Integer.valueOf(map.get("staffId"))); + if (ObjectUtil.isNotEmpty(map.get("staffId"))) + cashierOrder.setStaffId(Integer.valueOf(map.get("staffId"))); cashierOrder.setStoreId(accountInfo.getStoreId()); cashierOrder.setPayUser(userVo1.getMobile()); cashierOrder.setAmount(oilAmount); @@ -853,7 +879,8 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setStoreId(accountInfo.getStoreId()); order.setUserId(userId); order.setCommissionAmount(Double.valueOf(map.get("commissionAmount"))); - order.setStaffId(Integer.valueOf(map.get("staffId"))); + if (ObjectUtil.isNotEmpty(map.get("staffId"))) + order.setStaffId(Integer.valueOf(map.get("staffId"))); order.setTerminal(map.get("terminal")); order.setOils((String) oilOrders.get(i).get("oilName")); order.setOilGunNum(oilOrders.get(i).get("gunName").toString()); @@ -866,13 +893,18 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setPayTime(new Date()); this.addOilTrack(oilOrders.get(i), accountInfo.getStoreId()); - baseMapper.insert(order); + if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))){ + baseMapper.updateById(order); + }else { + baseMapper.insert(order); + } } OilOrder oilOrder = this.selectOilOrderByOrderNo(orderNo); // 添加收银台订单信息 CashierOrder cashierOrder = new CashierOrder(); - cashierOrder.setStaffId(Integer.valueOf(map.get("staffId"))); + if (ObjectUtil.isNotEmpty(map.get("staffId"))) + cashierOrder.setStaffId(Integer.valueOf(map.get("staffId"))); cashierOrder.setStoreId(accountInfo.getStoreId()); cashierOrder.setPayUser(userVo1.getMobile()); cashierOrder.setAmount(oilAmount); @@ -1052,7 +1084,12 @@ public class OilOrderServiceImpl extends ServiceImpl i LJUserVo userVo = userService.selectUserById(oilOrder.getUserId(),oilOrder.getStoreId()); oilOrder.setPayUser(userVo.getMobile()); - baseMapper.insert(oilOrder); +// baseMapper.insert(oilOrder); + if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))){ + baseMapper.updateById(oilOrder); + }else { + baseMapper.insert(oilOrder); + } return orderNo; } diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue index 8559bc7af..31f46b73f 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue @@ -134,7 +134,7 @@ 余额:{{ item.refuelMoney ? item.refuelMoney : 0.00 }}L) -
- {{ consumeRefuelMoney.toFixed(2) }}L
+
- {{ consumeRefuelMoney }}L
@@ -144,7 +144,7 @@ 储值卡 (账户余额:{{ balance }}元)
-
-¥{{ consumeAmount.toFixed(2) }}
+
-¥{{ consumeAmount }}
@@ -1145,7 +1145,7 @@
储值卡付款
-
¥{{ consumeAmount.toFixed(2) }}
+
¥{{ consumeAmount }}
囤油卡付款
@@ -3320,7 +3320,7 @@ this.checkAll4 = true if (this.balance!=0 && this.balance >= this.hoardAmount){ this.oilActualPay = 0 - this.consumeAmount = 0 + this.consumeAmount = this.hoardAmount }else { this.oilActualPay = (this.hoardAmount - this.balance).toFixed(2) this.consumeAmount = this.balance @@ -3345,6 +3345,9 @@ this.oilActualPay = this.oilAmount - this.oilDiscount - this.couponAmount - this.fullReduction - this.balance this.consumeAmount = this.balance } + }else { + this.oilActualPay = this.oilAmount - this.oilDiscount - this.couponAmount - this.fullReduction + this.consumeAmount = 0 } }else { this.oilActualPay = this.oilAmount.toFixed(2) @@ -3702,6 +3705,8 @@ _this.oilAmount = 0; _this.refuelMoney1 = [] let hoardAmount1 = 0; + let index = 0 + let lastMoney=0;; _this.oilOrder.forEach(item => { let conRefMon = 0; let hoardAmount = 0; @@ -3709,39 +3714,40 @@ let amount1 = 0; let id = "" if (_this.refuelMoney){ + let innerFlag = 0; for (let i = 0;i < _this.refuelMoney.length;i++){ // 囤油卡升数变化 - if (_this.refuelMoney[i].oilType==item.oilName && _this.refuelMoney[i].refuelMoney>0){ + if (_this.refuelMoney[i].oilType==item.oilName && _this.refuelMoney[i].refuelMoney>0&&_this.consumeRefuelMoney<_this.refuelMoney[i].refuelMoney){ _this.refuelMoney1.push(item) id = item.id _this.isOilStorageCard = true console.log(_this.refuelMoney[i].refuelMoney , item.liters,1547) - if (+_this.refuelMoney[i].refuelMoney >= +item.liters){ - conRefMon = item.liters + if(item.liters<=_this.refuelMoney[i].refuelMoney- _this.consumeRefuelMoney){ + conRefMon= item.liters }else { - conRefMon = _this.refuelMoney[i].refuelMoney - // 扣除升数后需要消费的金额 - hoardAmount = item.amount - (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2) + conRefMon = _this.refuelMoney[i].refuelMoney - _this.consumeRefuelMoney + //剩余油需要换算钱 + let lastOil = item.liters - conRefMon + hoardAmount = lastOil * item.oilPrice } - } - if (_this.refuelMoney[i].oilType!=item.oilName){ - amount = item.amount + lastMoney += +hoardAmount + innerFlag =1; + } } + if(innerFlag ==0){ + lastMoney += +item.amount + } + }else { + lastMoney += +item.amount } + _this.consumeRefuelMoney += +conRefMon console.log(hoardAmount,1254) - hoardAmount1 += +hoardAmount - amount1 += +amount - _this.hoardAmount = hoardAmount1 + _this.hoardAmount = +lastMoney.toFixed(2) _this.oilAmount += +item.amount - // _this.changeBalance(_this.hoardAmount,id) - // if (_this.consumeRefuelMoney!=0){ - // _this.isOilStorageCard = true; - // _this.checkAll3 = true; - // _this.consumeAmount = 0; - // } }) + _this.isDefaultUseCard(); }, changeBalance(hoardAmount,id){