From e9dd0600c265fc49860562724ff69e249e12721d Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Wed, 17 Jan 2024 14:14:19 +0800 Subject: [PATCH] bug --- fuintAdmin/src/views/staff/list.vue | 43 +++-- .../views/staffCommission/staffCommission.vue | 151 ++++++++++-------- fuintAdmin_zt/src/main.js | 2 +- .../fuyou/service/MerchantConfigService.java | 2 +- .../fuyou/service/impl/FyPayServiceImpl.java | 14 +- .../impl/MerchantConfigServiceImpl.java | 3 +- .../controller/StaffCommissionController.java | 3 +- .../mapper/StaffCommissionMapper.java | 3 +- .../mapper/xml/StaffCommissionMapper.xml | 8 +- .../service/CommissionRecordService.java | 6 + .../service/StaffCommissionService.java | 14 +- .../impl/CommissionRecordServiceImpl.java | 5 + .../impl/StaffCommissionServiceImpl.java | 101 +++++++++--- .../commission/vo/StaffCommissionVo.java | 12 ++ .../impl/IntegralOrdersServiceImpl.java | 2 +- .../impl/ActiveExchangeServiceImpl.java | 8 +- .../fuint/business/order/entity/OilOrder.java | 2 +- .../business/order/mapper/HangBillMapper.java | 6 +- .../order/mapper/xml/AllOrderInfoMapper.xml | 2 +- .../mapper/xml/CardValueChildOrderMapper.xml | 2 +- .../order/mapper/xml/CashierOrderMapper.xml | 2 +- .../order/mapper/xml/HangBillMapper.xml | 7 +- .../order/mapper/xml/LJOrderMapper.xml | 2 +- .../order/mapper/xml/OilOrderMapper.xml | 4 +- .../order/mapper/xml/ReturnRecordMapper.xml | 2 +- .../order/service/HangBillService.java | 6 +- .../service/impl/HangBillServiceImpl.java | 8 +- .../service/impl/OilOrderServiceImpl.java | 5 +- .../service/impl/LJUserGradeServiceImpl.java | 2 +- .../views/cashier/NewComponents/credit.vue | 12 +- .../views/cashier/NewComponents/homeindex.vue | 44 ++++- .../cashier/orderComponents/order_Unpaid.vue | 20 ++- gasStation-uni/pages/refuel/refuel.vue | 1 + .../pagesRefuel/orderDetail/index.vue | 14 +- 34 files changed, 351 insertions(+), 167 deletions(-) create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/vo/StaffCommissionVo.java diff --git a/fuintAdmin/src/views/staff/list.vue b/fuintAdmin/src/views/staff/list.vue index 500b53a0c..42e14d9d1 100644 --- a/fuintAdmin/src/views/staff/list.vue +++ b/fuintAdmin/src/views/staff/list.vue @@ -145,9 +145,13 @@ + @@ -602,6 +606,7 @@ export default { submitForm: function() { this.$refs["form"].validate(valid => { if (valid) { + this.form.auditPrem = this.form.auditPrem.toString(); if (!this.form.id) { queryStaff({mobile:this.form.mobile}).then( response => { if(response.data!=null){ @@ -610,31 +615,25 @@ export default { this.form.posPrem = JSON.stringify(this.form.posPrem); this.form.appletPrem = JSON.stringify(this.form.appletPrem); addStaff(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); + if (response.data==1){ + this.$modal.msgSuccess("新增成功"); + this.open = false; + this.getList(); + } }); } }) } else { - // queryStaff({mobile:this.form.mobile}).then( response => { - // if (response.data != null) { - // this.$modal.msgError("手机号已存在"); - // } else { - // this.form.posPrem = JSON.stringify(this.form.posPrem); - // this.form.appletPrem = JSON.stringify(this.form.appletPrem); - updateStaff(this.form).then(response => { - if (response.data==1){ - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }else { - this.$modal.msgError("手机号已存在"); - } + updateStaff(this.form).then(response => { + if (response.data==1){ + this.$modal.msgSuccess("修改成功"); + this.open = false; + this.getList(); + }else { + this.$modal.msgError("手机号已存在"); + } - }); - // } - // }) + }); } } }); diff --git a/fuintAdmin/src/views/staffCommission/staffCommission.vue b/fuintAdmin/src/views/staffCommission/staffCommission.vue index f0a4d085a..f8893e4ae 100644 --- a/fuintAdmin/src/views/staffCommission/staffCommission.vue +++ b/fuintAdmin/src/views/staffCommission/staffCommission.vue @@ -23,21 +23,21 @@ @sort-change="handleSortChange"> - - + + + + - + @@ -121,12 +121,18 @@ + + + + + + + v-for="item in roleList" + :key="item.dutyId+''" + :label="item.dutyName" + :value="item.dutyId+''" + > @@ -134,9 +140,12 @@ - + {{ dict.label }} + + {{ dict.label }} + @@ -216,6 +225,7 @@ import { queryCommission, updateCommission } from "@/api/staffCommission/staffcommission"; +import {listDuty} from "@/api/staff/duty"; export default { dicts: ['source','role','zhzt','comissionType','staff_role'], @@ -252,6 +262,7 @@ export default { }, // 显示搜索条件 showSearch: true, + roleList:[], // 表单校验 rules: { name: [ @@ -283,8 +294,15 @@ export default { }, created() { this.getList(); + this.getDuty(); }, methods:{ + // 查询角色列表 + getDuty(){ + listDuty().then(response => { + this.roleList = response.data + }) + }, // 点击标签页 handleClick(tab, event) { if (this.activeName == 'oil'){ @@ -378,70 +396,63 @@ export default { submitForm: function() { this.$refs["form"].validate(valid => { if (valid) { - // let date = new Date(); - // let year = date.getFullYear() - // let month = date.getMonth()+1 - // let day = date.getDate() - // let hour = date.getHours() - // let minutes = date.getMinutes() - // let second = date.getSeconds() - // let now = year+"-"+this.add0(month)+"-"+this.add0(day)+" "+hour+":"+minutes+":"+second - // if(this.form.takeEffect[0] < now && this.form.takeEffect[1] > now){ - // this.form.status = 'qy' - // }else { - // this.form.status = 'jy' - // } - // // this.form.commissionSource = this.commissionSource.toString() - // this.form.takeEffect = JSON.stringify(this.form.takeEffect) if (this.form.id) { - if (this.changeCom){ - queryCommission(this.form).then(response => { - if (response.data != null) { - if (this.changeCom) { - this.$modal.msgError("同一个角色组只能对应一个" + this.form.commissionSource + "提成方案") - }else { - this.$modal.msgError("当前时间段已存在相同油品、相同角色组的方案") - } - } else { - this.form.royaltyRate = this.form.royaltyRate + this.select - updateCommission(this.form).then(response => { - this.$modal.msgSuccess("提成方案更新成功"); - this.open = false; - this.changeCom = false; - this.getList(); - }); - } - }) - }else { + // if (this.changeCom){ + // queryCommission(this.form).then(response => { + // if (response.data != null) { + // if (this.changeCom) { + // this.$modal.msgError("同一个角色组只能对应一个" + this.form.commissionSource + "提成方案") + // }else { + // this.$modal.msgError("当前时间段已存在相同油品、相同角色组的方案") + // } + // } else { + // this.form.royaltyRate = this.form.royaltyRate + this.select + // updateCommission(this.form).then(response => { + // this.$modal.msgSuccess("提成方案更新成功"); + // this.open = false; + // this.changeCom = false; + // this.getList(); + // }); + // } + // }) + // }else { this.form.royaltyRate = this.form.royaltyRate + this.select updateCommission(this.form).then(response => { - this.$modal.msgSuccess("提成方案更新成功"); - this.open = false; - this.getList(); - }); - } - } else { - queryCommission(this.form).then(response => { - if (response.data != null){ - if (response.data.status == 'qy'){ - this.$modal.msgError("同一个角色组只能对应一个"+this.form.commissionSource+"提成方案") + if (response.data==1){ + this.$modal.msgSuccess("提成方案更新成功"); + this.open = false; + this.getList(); }else { - this.form.royaltyRate = this.form.royaltyRate + this.select - addCommission(this.form).then(response => { + this.$modal.msgError("同一个角色组只能对应一个" + this.form.commissionSource + "提成方案") + } + }); + // } + } else { + // queryCommission(this.form).then(response => { + // if (response.data != null){ + // if (response.data.status == 'qy'){ + // this.$modal.msgError("同一个角色组只能对应一个"+this.form.commissionSource+"提成方案") + // }else { + // this.form.royaltyRate = this.form.royaltyRate + this.select + // addCommission(this.form).then(response => { + // this.$modal.msgSuccess("提成方案新增成功"); + // this.open = false; + // this.getList(); + // }); + // } + // }else { + this.form.royaltyRate = this.form.royaltyRate + this.select + addCommission(this.form).then(response => { + if (response.data==1) { this.$modal.msgSuccess("提成方案新增成功"); this.open = false; this.getList(); - }); - } - }else { - this.form.royaltyRate = this.form.royaltyRate + this.select - addCommission(this.form).then(response => { - this.$modal.msgSuccess("提成方案新增成功"); - this.open = false; - this.getList(); + }else { + this.$modal.msgError("同一个角色组只能对应一个"+this.form.commissionSource+"提成方案") + } }); - } - }) + // } + // }) } } }); diff --git a/fuintAdmin_zt/src/main.js b/fuintAdmin_zt/src/main.js index bdaeea126..06ac16beb 100644 --- a/fuintAdmin_zt/src/main.js +++ b/fuintAdmin_zt/src/main.js @@ -48,7 +48,7 @@ Vue.prototype.getName = getName Vue.prototype.download = download Vue.prototype.handleTree = handleTree // Vue.prototype.pcUrl = 'http://192.168.0.121:82/' -Vue.prototype.pcUrl = 'http://192.168.0.178:82/' +Vue.prototype.pcUrl = 'http://192.168.0.121:82/' // 全局组件挂载 Vue.component('DictTag', DictTag) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/MerchantConfigService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/MerchantConfigService.java index e87aa2999..3e19db985 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/MerchantConfigService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/MerchantConfigService.java @@ -34,7 +34,7 @@ public interface MerchantConfigService extends IService { * 根据店铺id查询商户信息 * @return */ - public List selectMeChByIsOpen(); + public List selectMeChByIsOpen(Integer storeId); /** * 查询所有商户配置信息 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 fb19dcc04..df187974c 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 @@ -483,12 +483,19 @@ public class FyPayServiceImpl implements FyPayService { allOrderInfo.setType(receiveParameter.getType()); allOrderInfo.setStoreId(receiveParameter.getStoreId()); allOrderInfo.setGoodsMoney(receiveParameter.getGoodsMoney()); + allOrderInfo.setPayMoney(receiveParameter.getGoodsMoney()); allOrderInfo.setPayType(receiveParameter.getPayType()); allOrderInfo.setUserId(receiveParameter.getUserId()); allOrderInfo.setPayChannel("cashier"); allOrderInfo.setStatus(payStatus); + if (payStatus.equals("paid")){ + allOrderInfo.setPayTime(new Date()); + } allOrderInfo.setContent(receiveParameter.getContent()); - allOrderInfoService.insertAllOrderInfo(allOrderInfo); + AllOrderInfo allOrderInfo1 = allOrderInfoService.selectAllOrderInfoByOrderNo(receiveParameter.getOrderNo()); + if (ObjectUtil.isEmpty(allOrderInfo1)){ + allOrderInfoService.insertAllOrderInfo(allOrderInfo); + } } /** @@ -505,7 +512,10 @@ public class FyPayServiceImpl implements FyPayService { allOrderInfo.setPayChannel("applet"); allOrderInfo.setStatus("unpaid"); allOrderInfo.setContent(receiveParameter.getContent()); - allOrderInfoService.insertAllOrderInfo(allOrderInfo); + AllOrderInfo allOrderInfo1 = allOrderInfoService.selectAllOrderInfoByOrderNo(receiveParameter.getOrderNo()); + if (ObjectUtil.isEmpty(allOrderInfo1)){ + allOrderInfoService.insertAllOrderInfo(allOrderInfo); + } } @Override diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/MerchantConfigServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/MerchantConfigServiceImpl.java index 098d9b9d5..ceb9357e8 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/MerchantConfigServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/MerchantConfigServiceImpl.java @@ -46,9 +46,10 @@ public class MerchantConfigServiceImpl extends ServiceImpl selectMeChByIsOpen() { + public List selectMeChByIsOpen(Integer storeId) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("is_open_rule","1"); + queryWrapper.eq("store_id",storeId); List list = baseMapper.selectList(queryWrapper); return list; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/controller/StaffCommissionController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/controller/StaffCommissionController.java index f7d5c5323..4d2147466 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/controller/StaffCommissionController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/controller/StaffCommissionController.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.commission.entity.StaffCommission; import com.fuint.business.commission.service.StaffCommissionService; +import com.fuint.business.commission.vo.StaffCommissionVo; import com.fuint.framework.web.BaseController; import com.fuint.framework.web.ResponseObject; import org.springframework.beans.factory.annotation.Autowired; @@ -31,7 +32,7 @@ public class StaffCommissionController extends BaseController { @RequestParam(value = "page",defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){ Page page =new Page(pageNo,pageSize); - IPage list = commissionService.selectCommissionList(page,commission); + IPage list = commissionService.selectCommissionList(page,commission); return getSuccessResult(list); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/StaffCommissionMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/StaffCommissionMapper.java index 927533a75..c4d28e10f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/StaffCommissionMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/StaffCommissionMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.commission.entity.StaffCommission; +import com.fuint.business.commission.vo.StaffCommissionVo; import org.apache.ibatis.annotations.Param; public interface StaffCommissionMapper extends BaseMapper { @@ -12,5 +13,5 @@ public interface StaffCommissionMapper extends BaseMapper { * @param page * @return */ - public IPage selectCommissionList(Page page,@Param("commission") StaffCommission commission); + public IPage selectCommissionList(Page page, @Param("commission") StaffCommission commission); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/xml/StaffCommissionMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/xml/StaffCommissionMapper.xml index e3e30c7e5..e733fe7f9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/xml/StaffCommissionMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/xml/StaffCommissionMapper.xml @@ -2,14 +2,14 @@ - select * from staff_commission + select sc.*,td.duty_name from staff_commission sc left join t_duty td on sc.staff_role_group = td.duty_id - - store_id = #{commission.storeId} - and commission_source = #{commission.commissionSource} + sc.store_id = #{commission.storeId} + and sc.commission_source = #{commission.commissionSource} \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/CommissionRecordService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/CommissionRecordService.java index 77779c3a2..ed1e0226f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/CommissionRecordService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/CommissionRecordService.java @@ -56,4 +56,10 @@ public interface CommissionRecordService { */ boolean deleteById(Integer id); + /** + * 添加提成记录信息 + * @param commissionRecord + * @return + */ + int insertRecord(CommissionRecord commissionRecord); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/StaffCommissionService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/StaffCommissionService.java index 6f01be84d..8d96bb447 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/StaffCommissionService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/StaffCommissionService.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.fuint.business.commission.entity.StaffCommission; +import com.fuint.business.commission.vo.StaffCommissionVo; import java.util.List; import java.util.Map; @@ -17,7 +18,7 @@ public interface StaffCommissionService extends IService { * @param page * @return */ - public IPage selectCommissionList(Page page, StaffCommission commission); + public IPage selectCommissionList(Page page, StaffCommission commission); /** * 根据id查询员工提成方案信息 @@ -53,4 +54,15 @@ public interface StaffCommissionService extends IService { */ public int updateStaffCommission(StaffCommission commission); + /** + * 根据员工id计算提成金额 + * @param staffId 员工id + * @param storeId 店铺id + * @param amount 订单金额 + * @param payAmount 实付金额 + * @param oilLiters 油品消费升数 + * @param type 订单类型(油品、非油品) + * @param orderNo 关联订单号 + */ + void countStaffCommission(Integer staffId,Integer storeId,Double amount,Double payAmount,Double oilLiters,String type,String orderNo); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/CommissionRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/CommissionRecordServiceImpl.java index 6031554a6..2a307f78d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/CommissionRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/CommissionRecordServiceImpl.java @@ -92,4 +92,9 @@ public class CommissionRecordServiceImpl implements CommissionRecordService { public boolean deleteById(Integer id) { return this.commissionRecordMapper.deleteById(id) > 0; } + + @Override + public int insertRecord(CommissionRecord commissionRecord) { + return commissionRecordMapper.insert(commissionRecord); + } } 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 7fa72c35d..9313267dd 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 @@ -1,14 +1,19 @@ package com.fuint.business.commission.service.impl; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.fuint.business.commission.entity.CommissionRecord; import com.fuint.business.commission.entity.StaffCommission; import com.fuint.business.commission.mapper.StaffCommissionMapper; +import com.fuint.business.commission.service.CommissionRecordService; import com.fuint.business.commission.service.StaffCommissionService; +import com.fuint.business.commission.vo.StaffCommissionVo; import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.text.SimpleDateFormat; @@ -26,26 +31,12 @@ import java.util.Map; @Service public class StaffCommissionServiceImpl extends ServiceImpl implements StaffCommissionService { @Override - public IPage selectCommissionList(Page page, StaffCommission commission) { + public IPage selectCommissionList(Page page, StaffCommission commission) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); Integer storeId = nowAccountInfo.getStoreId(); commission.setStoreId(storeId); - IPage staffCommissionIPage = baseMapper.selectCommissionList(page, commission); - for (StaffCommission record : staffCommissionIPage.getRecords()) { - if (record.getTakeEffect()!=null && record.getTakeEffect().equals("")){ - String substring = record.getTakeEffect().substring(24, 43); - Date date = new Date(); - SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String now = dateFormat.format(date); - int row = substring.compareTo(now); - if (row == -1){ - record.setStatus("jy"); - baseMapper.updateById(record); - } - } - } - IPage commissionIPage = baseMapper.selectCommissionList(page, commission); - return commissionIPage; + IPage staffCommissionIPage = baseMapper.selectCommissionList(page, commission); + return staffCommissionIPage; } @Override @@ -74,18 +65,90 @@ public class StaffCommissionServiceImpl extends ServiceImpl(); + queryWrapper.eq("store_id",storeId); + queryWrapper.eq("status","qy"); +// 查询当前店铺启用的提成方案信息 + List list = baseMapper.selectList(queryWrapper); + if (list.size()>0){ + for (StaffCommission staffCommission : list) { + CommissionRecord commissionRecord = new CommissionRecord(); + if (type.equals(staffCommission.getCommissionSource())){ + commissionRecord.setStaffId(staffId); + commissionRecord.setStoreId(storeId); + commissionRecord.setType(type+"订单出售"); + commissionRecord.setDescription(type+"订单出售提成"); + 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)); + } + } + } +// 按照加油数量计算提成 + 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); + } + } + } + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/vo/StaffCommissionVo.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/vo/StaffCommissionVo.java new file mode 100644 index 000000000..6e46c822d --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/vo/StaffCommissionVo.java @@ -0,0 +1,12 @@ +package com.fuint.business.commission.vo; + +import com.fuint.business.commission.entity.StaffCommission; +import lombok.Data; + +@Data +public class StaffCommissionVo extends StaffCommission { + /** + * 角色名 + */ + private String dutyName; +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java index ff76c1830..df8d0a40f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java @@ -508,7 +508,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService { if (flag) { // 调用支付接口 // 判断是否开启支付规则 - List list = merchantConfigService.selectMeChByIsOpen(); + List list = merchantConfigService.selectMeChByIsOpen(integralOrdersList.getStoreId()); // if (list.size() > 0) { // oilConfigService.oilRule(); // } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java index c5c1105d7..62fdbdf73 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java @@ -423,10 +423,10 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { public PaymentActiveVO paymentActive(PaymentActiveDTO paymentActiveDTO) { PaymentActiveVO paymentActiveVO = new PaymentActiveVO(); Integer storeId = paymentActiveDTO.getStoreId(); - BigDecimal amount = new BigDecimal(0.00); - BigDecimal fullAmount = new BigDecimal(0.00); - BigDecimal a = new BigDecimal(0.1); - BigDecimal b = new BigDecimal(10); + BigDecimal amount = new BigDecimal("0.00"); + BigDecimal fullAmount = new BigDecimal("0.00"); + BigDecimal a = new BigDecimal("0.1"); + BigDecimal b = new BigDecimal("10"); //折扣 List activeDiscountVOList = oilOrderMapper.selectActiveDiscount(storeId,paymentActiveDTO.getAmount()); if (CollectionUtils.isNotEmpty(activeDiscountVOList)){ diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/OilOrder.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/OilOrder.java index 56c0d72ee..8050e8bb5 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/OilOrder.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/OilOrder.java @@ -125,7 +125,7 @@ public class OilOrder extends BaseEntity implements Serializable { /** * 油罐id */ - @TableField(exist = false) +// @TableField(exist = false) private Integer tankId; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/HangBillMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/HangBillMapper.java index 50afb0d19..d857d4924 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/HangBillMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/HangBillMapper.java @@ -39,17 +39,17 @@ public interface HangBillMapper extends BaseMapper { * 查询当前店铺所有的订单总额 * @return */ - double selectAllAmount(@Param("storeId") int storeId); + Double selectAllAmount(@Param("storeId") int storeId); /** * 查询当前店铺归还的账单总额 * @return */ - double selectReturnAmount(@Param("storeId") int storeId); + Double selectReturnAmount(@Param("storeId") int storeId); /** * 查询当前店铺未归还的账单总额 * @return */ - double selectNoReturnAmount(@Param("storeId") int storeId); + Double selectNoReturnAmount(@Param("storeId") int storeId); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml index 760725821..9cae9b51a 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml @@ -54,7 +54,7 @@ and date_format(pay_time,'%y%m%d') <= date_format(#{allOrderInfo.params.endTime},'%y%m%d') - order by pay_time desc + order by aoi.create_time desc \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CashierOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CashierOrderMapper.xml index 9f17307dc..2c18c0180 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CashierOrderMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CashierOrderMapper.xml @@ -24,7 +24,7 @@ and date_format(pay_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d') - order by pay_time desc + order by create_time desc - select sum(amount) from hang_bill where store_id = #{storeId} - select sum(repaid_amount) from hang_bill where store_id = #{storeId} - select sum(outstand_amount) from hang_bill where store_id = #{storeId} \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/LJOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/LJOrderMapper.xml index e61fdb9f3..09548d11c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/LJOrderMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/LJOrderMapper.xml @@ -30,7 +30,7 @@ and date_format(create_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d') - order by pay_time desc + order by create_time desc diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/ReturnRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/ReturnRecordMapper.xml index 9321e7e98..445d43b94 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/ReturnRecordMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/ReturnRecordMapper.xml @@ -12,7 +12,7 @@ rd.hang_bill_id = #{returnRecord.hangBillId} - order by pay_time desc + order by rd.create_time desc diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/HangBillService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/HangBillService.java index a48e20c28..755dddbd5 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/HangBillService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/HangBillService.java @@ -83,7 +83,7 @@ public interface HangBillService extends IService { * 查询当前店铺所有的订单总额 * @return */ - double selectAllAmount(); + Double selectAllAmount(); /** * 查询当前店铺归还账单的数量 @@ -95,11 +95,11 @@ public interface HangBillService extends IService { * 查询当前店铺归还的账单总额 * @return */ - double selectReturnAmount(); + Double selectReturnAmount(); /** * 查询当前店铺未归还的账单总额 * @return */ - double selectNoReturnAmount(); + Double selectNoReturnAmount(); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HangBillServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HangBillServiceImpl.java index 81bd89192..76b3f95c5 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HangBillServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HangBillServiceImpl.java @@ -254,7 +254,7 @@ public class HangBillServiceImpl extends ServiceImpl i } @Override - public double selectAllAmount() { + public Double selectAllAmount() { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); return baseMapper.selectAllAmount(nowAccountInfo.getStoreId()); } @@ -269,13 +269,13 @@ public class HangBillServiceImpl extends ServiceImpl i } @Override - public double selectReturnAmount() { + public Double selectReturnAmount() { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); return baseMapper.selectReturnAmount(nowAccountInfo.getStoreId()); } @Override - public double selectNoReturnAmount() { + public Double selectNoReturnAmount() { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); return baseMapper.selectNoReturnAmount(nowAccountInfo.getStoreId()); } @@ -290,7 +290,7 @@ public class HangBillServiceImpl extends ServiceImpl i if (!map.get("repaidAmount").equals("0") && !payType.equals("CASH")){ Integer allAmount = (int) (Double.valueOf(map.get("repaidAmount"))*100); // 判断是否开启支付规则 - List list = merchantConfigService.selectMeChByIsOpen(); + List list = merchantConfigService.selectMeChByIsOpen(storeId); if (list.size()>0){ oilConfigService.oilRule(); } 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 4ee13cdf3..27a25b2ac 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 @@ -369,6 +369,7 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setPayType(payType); order.setInvoicing("未开票"); order.setOrderStatus(payStatus); + order.setTankId(Integer.valueOf(jsonObjects.get(0).get("tankId").toString())); if (payType.equals("CASH")){ order.setPayTime(new Date()); this.addOilTrack(jsonObjects.get(i),storeId); @@ -386,7 +387,7 @@ public class OilOrderServiceImpl extends ServiceImpl i if (!map.get("allAmount").equals("0") && !map.get("payType").equals("CASH")){ Integer allAmount = (int) (Double.valueOf(map.get("allAmount"))*100); // 判断是否开启支付规则 - List list = merchantConfigService.selectMeChByIsOpen(); + List list = merchantConfigService.selectMeChByIsOpen(storeId); if (list.size()>0){ oilConfigService.oilRule(); } @@ -1173,7 +1174,7 @@ public class OilOrderServiceImpl extends ServiceImpl i int growth = balance.getGrowthValue(); if (refuelMoney==null){ String refuelMoney1 = balance.getRefuelMoney(); - if (StringUtils.isNotEmpty(refuelMoney1)){ + if (StringUtils.isNotEmpty(refuelMoney1) && !"null".equals(refuelMoney1)){ JSONArray objects = JSONArray.parseArray(refuelMoney); JSONArray objects1 = JSONArray.parseArray(refuelMoney1); List list = new ArrayList<>(); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java index d70954804..3631e9017 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java @@ -129,7 +129,7 @@ public class LJUserGradeServiceImpl extends ServiceImpl { - this.allAmount = res.data + if (res.data) { + this.allAmount = res.data + } }) hangBillAllReturnAmount().then(res => { - this.returnAllAmount = res.data + if (res.data) { + this.returnAllAmount = res.data + } }) hangBillAllNoReturnAmount().then(res => { - this.noReturnAllAmount = res.data + if (res.data) { + this.noReturnAllAmount = res.data + } }) }, getPayMeth(list,val){ diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue index ed67e71e4..4730977cf 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue @@ -508,7 +508,22 @@ - + + +
+ + + +
+
+ + { - console.log(res) if (res.data.storedQuantity-this.form.liters<0){ this.$modal.msgError("所加油的升数大于油罐内的升数,请重新选择加油升数") return; @@ -2546,7 +2564,7 @@ return; } } - if (!this.authCode){ + if (!this.authCode && ((+this.oilActualPay) + (+this.goodsActualPay))>0){ this.$modal.msgError("请先扫码"); return; } @@ -2654,6 +2672,7 @@ _this.oilOrder = [] _this.goodsOrder = [] _this.amount = 0 + _this.seekZero = 0; }; this.userNo = "" this.map = { @@ -2724,6 +2743,7 @@ if (response.data!=null){ if (response.data.status == "unpaid"){ _this.isQuery = true; + _this.dialogVisiblejLoading = true } if (response.data.status == "paid"){ _this.isPay = true; @@ -2749,7 +2769,8 @@ let timer2 = setInterval(function () { if (_this.isQuery || !_this.dialogVisiblej) { _this.loading = false; - _this.isPay = true; + // _this.isPay = true; + // _this.countdown() clearInterval(timer); clearTimeout(timer3); @@ -2764,7 +2785,22 @@ this.isPaySuccess = false; }, 10000) }, + + // 倒计时刷新 + countdown(){ + let _this = this + let timer = setInterval(() => { + // countdown减1 + _this.timestamp--; + // 如果倒计时为0,清除定时器 + if(_this.timestamp === 0) { + clearInterval(timer) + _this.timestamp = 15 + } + }, 1000); + }, handClose(){ + this.dialogVisiblejLoading = false // this.resetting1() this.authCode = ""; this.userNo = "" diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Unpaid.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Unpaid.vue index fab9f847a..461de1df0 100644 --- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Unpaid.vue +++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Unpaid.vue @@ -145,7 +145,11 @@
- + + +