This commit is contained in:
cun-nan 2024-03-16 13:40:36 +08:00
parent b49b8c72f0
commit e2c8850da2
12 changed files with 219 additions and 170 deletions

View File

@ -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)

View File

@ -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("新增成功")

View File

@ -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,//使

View File

@ -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,//使

View File

@ -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,//使

View File

@ -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//
}

View File

@ -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,//使

View File

@ -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)

View File

@ -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<JSONObject> 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<JSONObject> 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");

View File

@ -116,50 +116,51 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
@Override
public void countStaffCommission(Integer staffId,Integer storeId,Double amount,Double payAmount,String type,String orderNo) {
LJStaff staff = staffService.selectStaffById(staffId);
QueryWrapper queryWrapper = new QueryWrapper<>();
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<StaffCommission> 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<StaffCommission> 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<StaffCommissionMappe
// commissionRecordService.insertRecord(commissionRecord);
// }
// }
}
}
}
}
if (type.equals("2") && 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("2") && 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("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);
}
}
}

View File

@ -462,7 +462,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> 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<OilOrderMapper, OilOrder> 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<OilOrderMapper, OilOrder> 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<OilOrderMapper, OilOrder> 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<OilOrderMapper, OilOrder> 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<OilOrderMapper, OilOrder> 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<OilOrderMapper, OilOrder> 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<OilOrderMapper, OilOrder> 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<OilOrderMapper, OilOrder> 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<OilOrderMapper, OilOrder> 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<OilOrderMapper, OilOrder> 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<OilOrderMapper, OilOrder> 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<OilOrderMapper, OilOrder> 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;
}

View File

@ -134,7 +134,7 @@
余额{{ item.refuelMoney ? item.refuelMoney : 0.00 }}L
</div>
</div>
<div>- {{ consumeRefuelMoney.toFixed(2) }}L</div>
<div>- {{ consumeRefuelMoney }}L</div>
</div>
<div class="center-left-hj" v-show="isMember">
<div>
@ -144,7 +144,7 @@
储值卡
<span>账户余额{{ balance }}</span>
</div>
<div>-{{ consumeAmount.toFixed(2) }}</div>
<div>-{{ consumeAmount }}</div>
</div>
<div class="center-left-hj" v-show="isMember && couponDiscount.length>0">
<div>
@ -1145,7 +1145,7 @@
</div>
<div class="input-box" v-if="isMember && consumeAmount>0">
<div>储值卡付款</div>
<div>{{ consumeAmount.toFixed(2) }}</div>
<div>{{ consumeAmount }}</div>
</div>
<div class="input-box" v-if="isMember && consumeRefuelMoney>0">
<div>囤油卡付款</div>
@ -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){