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 1/4] 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 @@
               <el-select v-model="form.roleId" placeholder="请选择角色">
                 <el-option
                   v-for="item in roleList"
-                  :key="item.dutyId"
+                  :key="item.dutyId+''"
                   :label="item.dutyName"
-                  :value="item.dutyId"
+                  :value="item.dutyId+''"
+                ></el-option>
+                <el-option
+                  label="油站站长"
+                  :value="12+''"
                 ></el-option>
 
               </el-select>
@@ -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">
           <el-table-column label="ID" prop="id" align="center" width="60"/>
           <el-table-column label="方案名称" prop="name" align="center"/>
-          <el-table-column label="员工角色" prop="staffRoleGroup" align="center">
-            <template slot-scope="scope">
-              <dict-tag :options="dict.type.staff_role" :value="scope.row.staffRoleGroup"/>
-            </template>
+          <el-table-column label="员工角色" prop="dutyName" align="center">
+<!--            <template slot-scope="scope">-->
+<!--              <dict-tag :options="dict.type.staff_role" :value="scope.row.staffRoleGroup"/>-->
+<!--            </template>-->
           </el-table-column>
           <el-table-column label="提成来源" prop="commissionSource" align="center" />
-          <el-table-column label="满足条件" prop="meetCondition" align="center">
+          <el-table-column label="满足条件" prop="meetCondition" align="center" width="260">
             <template slot-scope="scope">
-              <span v-if="form.type == 'orderAmount'">
+              <span v-if="scope.row.type == 'orderAmount'">
                 订单金额消费满{{scope.row.meetCondition}}元
               </span>
-              <span v-if="form.type == 'payAmount'">
+              <span v-if="scope.row.type == 'payAmount'">
                 实际金额消费满{{scope.row.meetCondition}}元
               </span>
-              <span v-if="form.type == 'refuleNum'">
+              <span v-if="scope.row.type == 'refuleNum'">
                 加油数量消费满{{scope.row.meetCondition}}单位(升/立方)
               </span>
             </template>
@@ -121,12 +121,18 @@
           <el-col :span="24">
             <el-form-item label="角色组" prop="staffRoleGroup">
               <el-select v-model="form.staffRoleGroup" placeholder="请选择所属角色">
+<!--                <el-option-->
+<!--                  v-for="dict in dict.type.staff_role"-->
+<!--                  :key="dict.value"-->
+<!--                  :label="dict.label"-->
+<!--                  :value="dict.value"-->
+<!--                />-->
                 <el-option
-                  v-for="dict in dict.type.staff_role"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                />
+                  v-for="item in roleList"
+                  :key="item.dutyId+''"
+                  :label="item.dutyName"
+                  :value="item.dutyId+''"
+                ></el-option>
               </el-select>
             </el-form-item>
           </el-col>
@@ -134,9 +140,12 @@
         <el-row>
           <el-col :span="24">
             <el-form-item label="提成类型" prop="type">
-              <el-radio-group v-model="form.type">
+              <el-radio-group v-model="form.type" v-if="form.commissionSource=='油品'">
                 <el-radio v-for="dict in dict.type.comissionType"  :label="dict.value">{{ dict.label }}</el-radio>
               </el-radio-group>
+              <el-radio-group v-model="form.type" v-else>
+                <el-radio v-for="dict in dict.type.comissionType"  :label="dict.value" v-if="dict.value!='refuleNum'">{{ dict.label }}</el-radio>
+              </el-radio-group>
             </el-form-item>
           </el-col>
         </el-row>
@@ -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<MerchantConfig> {
      * 根据店铺id查询商户信息
      * @return
      */
-    public List<MerchantConfig> selectMeChByIsOpen();
+    public List<MerchantConfig> 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<MerchantConfigMapper,
     }
 
     @Override
-    public List<MerchantConfig> selectMeChByIsOpen() {
+    public List<MerchantConfig> 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<StaffCommission> list = commissionService.selectCommissionList(page,commission);
+        IPage<StaffCommissionVo> 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<StaffCommission> {
@@ -12,5 +13,5 @@ public interface StaffCommissionMapper extends BaseMapper<StaffCommission> {
      * @param page
      * @return
      */
-    public IPage<StaffCommission> selectCommissionList(Page page,@Param("commission") StaffCommission commission);
+    public IPage<StaffCommissionVo> 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 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fuint.business.commission.mapper.StaffCommissionMapper">
     <sql id="selectCommission">
-        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
     </sql>
 
-    <select id="selectCommissionList" resultType="com.fuint.business.commission.entity.StaffCommission">
+    <select id="selectCommissionList" resultType="com.fuint.business.commission.vo.StaffCommissionVo">
         <include refid="selectCommission"></include>
         <where>
-            store_id = #{commission.storeId}
-            and commission_source = #{commission.commissionSource}
+            sc.store_id = #{commission.storeId}
+            and sc.commission_source = #{commission.commissionSource}
         </where>
     </select>
 </mapper>
\ 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<StaffCommission> {
      * @param page
      * @return
      */
-    public IPage<StaffCommission> selectCommissionList(Page page, StaffCommission commission);
+    public IPage<StaffCommissionVo> selectCommissionList(Page page, StaffCommission commission);
 
     /**
      * 根据id查询员工提成方案信息
@@ -53,4 +54,15 @@ public interface StaffCommissionService extends IService<StaffCommission> {
      */
     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<StaffCommissionMapper, StaffCommission> implements StaffCommissionService {
     @Override
-    public IPage<StaffCommission> selectCommissionList(Page page, StaffCommission commission) {
+    public IPage<StaffCommissionVo> selectCommissionList(Page page, StaffCommission commission) {
         AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
         Integer storeId = nowAccountInfo.getStoreId();
         commission.setStoreId(storeId);
-        IPage<StaffCommission> 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<StaffCommission> commissionIPage = baseMapper.selectCommissionList(page, commission);
-        return commissionIPage;
+        IPage<StaffCommissionVo> staffCommissionIPage = baseMapper.selectCommissionList(page, commission);
+        return staffCommissionIPage;
     }
 
     @Override
@@ -74,18 +65,90 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
 
     @Override
     public int insertStaffCommission(StaffCommission commission) {
+        StaffCommission staffCommission = this.selectCommissionByRole(commission);
+        int row = 0;
+//        判断当前店铺是否存在同角色的同一提成方案
+        if (ObjectUtil.isNotEmpty(staffCommission)){
+            row = 0;
+            return row;
+        }
         AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
         Integer storeId = nowAccountInfo.getStoreId();
         commission.setStoreId(storeId);
-        int row = baseMapper.insert(commission);
+        row = baseMapper.insert(commission);
         return row;
     }
 
     @Override
     public int updateStaffCommission(StaffCommission commission) {
-        int row = baseMapper.updateById(commission);
+        StaffCommission staffCommission = this.selectCommissionByRole(commission);
+        int row = 0;
+//        判断当前店铺是否存在同角色的同一提成方案
+        if (ObjectUtil.isNotEmpty(staffCommission) && staffCommission.getId()!=commission.getId()){
+            row = 0;
+            return row;
+        }
+        row = baseMapper.updateById(commission);
         return row;
     }
 
+    @Autowired
+    private CommissionRecordService commissionRecordService;
 
+    @Override
+    public void countStaffCommission(Integer staffId,Integer storeId,Double amount,Double payAmount,Double oilLiters,String type,String orderNo) {
+        QueryWrapper queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("store_id",storeId);
+        queryWrapper.eq("status","qy");
+//        查询当前店铺启用的提成方案信息
+        List<StaffCommission> 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<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen();
+            List<MerchantConfig> 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<ActiveDiscountPayVO> 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<HangBill> {
      * 查询当前店铺所有的订单总额
      * @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 @@
         <if test="allOrderInfo.params.endTime != null and allOrderInfo.params.endTime != ''"><!-- 结束时间检索 -->
             and date_format(pay_time,'%y%m%d') &lt;= date_format(#{allOrderInfo.params.endTime},'%y%m%d')
         </if>
-        order by pay_time desc
+        order by aoi.create_time desc
     </select>
     <select id="sumPayMoney" resultType="java.lang.String">
         select
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CardValueChildOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CardValueChildOrderMapper.xml
index 3b3e14d2a..c694c4f6f 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CardValueChildOrderMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CardValueChildOrderMapper.xml
@@ -18,7 +18,7 @@
             <if test="order.status != null and order.status != ''">
                 and cvco.status = #{order.status}
             </if>
-            order by cvco.pay_time desc
+            order by cvco.create_time desc
         </where>
     </select>
 </mapper>
\ 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 @@
             <if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
                 and date_format(pay_time,'%y%m%d') &lt;= date_format(#{order.params.endTime},'%y%m%d')
             </if>
-            order by pay_time desc
+            order by create_time desc
         </where>
     </select>
     <select id="selectCashierOrderById" resultType="com.fuint.business.order.vo.CashierOrderVo"
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/HangBillMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/HangBillMapper.xml
index 5546a03ac..1b928cf4f 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/HangBillMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/HangBillMapper.xml
@@ -36,6 +36,7 @@
             <if test="hangBill.params.endTime != null and hangBill.params.endTime != ''"><!-- 结束时间检索 -->
                 and date_format(hb.create_time,'%y%m%d') &lt;= date_format(#{hangBill.params.endTime},'%y%m%d')
             </if>
+            order by create_time desc
         </where>
     </select>
     <select id="selectHangBillById" resultType="com.fuint.business.order.vo.HangBillVo" parameterType="int">
@@ -52,13 +53,13 @@
         </where>
     </select>
 
-    <select id="selectAllAmount" resultType="double">
+    <select id="selectAllAmount" resultType="java.lang.Double">
         select sum(amount) from hang_bill where store_id = #{storeId}
     </select>
-    <select id="selectReturnAmount" resultType="double">
+    <select id="selectReturnAmount" resultType="java.lang.Double">
         select sum(repaid_amount) from hang_bill where store_id = #{storeId}
     </select>
-    <select id="selectNoReturnAmount" resultType="double">
+    <select id="selectNoReturnAmount" resultType="java.lang.Double">
         select sum(outstand_amount) from hang_bill where store_id = #{storeId}
     </select>
 </mapper>
\ 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 @@
             <if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
                 and date_format(create_time,'%y%m%d') &lt;= date_format(#{order.params.endTime},'%y%m%d')
             </if>
-            order by pay_time desc
+            order by create_time desc
         </where>
     </select>
     <select id="getMtOrderList" resultType="com.fuint.business.order.vo.LJOrderVo">
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml
index 6973c2dd6..7303b81cb 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml
@@ -39,7 +39,7 @@
             <if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
                 and date_format(pay_time,'%y%m%d') &lt;= date_format(#{order.params.endTime},'%y%m%d')
             </if>
-            order by pay_time desc
+            order by create_time desc
         </where>
     </select>
     <select id="selectOilOrderByOrderNo" resultType="com.fuint.business.order.vo.OilOrderVo"
@@ -75,7 +75,7 @@
             <if test="order.remark != null and order.remark != ''">
                 and remark = #{order.remark}
             </if>
-            order by pay_time desc
+            order by create_time desc
         </where>
     </select>
 
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 @@
         <include refid="selectReturnRecord"></include>
         <where>
             rd.hang_bill_id = #{returnRecord.hangBillId}
-            order by pay_time desc
+            order by rd.create_time desc
         </where>
     </select>
 <!--    <select id="selectHangBillById" resultType="com.fuint.business.order.vo.HangBillVo" parameterType="int">-->
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<HangBill> {
      * 查询当前店铺所有的订单总额
      * @return
      */
-    double selectAllAmount();
+    Double selectAllAmount();
 
     /**
      * 查询当前店铺归还账单的数量
@@ -95,11 +95,11 @@ public interface HangBillService extends IService<HangBill> {
      * 查询当前店铺归还的账单总额
      * @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<HangBillMapper, HangBill> 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<HangBillMapper, HangBill> 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<HangBillMapper, HangBill> i
         if (!map.get("repaidAmount").equals("0") && !payType.equals("CASH")){
             Integer allAmount = (int) (Double.valueOf(map.get("repaidAmount"))*100);
 //            判断是否开启支付规则
-            List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen();
+            List<MerchantConfig> 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<OilOrderMapper, OilOrder> 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<OilOrderMapper, OilOrder> i
         if (!map.get("allAmount").equals("0") && !map.get("payType").equals("CASH")){
             Integer allAmount = (int) (Double.valueOf(map.get("allAmount"))*100);
 //            判断是否开启支付规则
-            List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen();
+            List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId);
             if (list.size()>0){
                 oilConfigService.oilRule();
             }
@@ -1173,7 +1174,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> 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<RefuelMoney> 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<LJUserGradeMapper, LJUse
                         res.put("userGrade",baseMapper.selectById(Integer.valueOf(gradeId)));
                         return res;
                     }else {
-                        return null;
+                        return res;
                     }
                 }
             }
diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/credit.vue b/fuintCashierWeb/src/views/cashier/NewComponents/credit.vue
index a9c256388..74b4fe9ab 100644
--- a/fuintCashierWeb/src/views/cashier/NewComponents/credit.vue
+++ b/fuintCashierWeb/src/views/cashier/NewComponents/credit.vue
@@ -806,13 +806,19 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
           this.returnTotal = res.data
         })
         hangBillAllAmount().then(res => {
-          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 @@
       </div>
     </el-dialog>
 
-<!--    会员登录-->
+    <!--    立即结算-->
+    <el-dialog
+      title="扫码支付"
+      :visible.sync="dialogVisiblejLoading"
+      width="30%"
+      :close-on-click-modal="false">
+      <div>
+        <el-result icon="info" title="支付状态未查询成功,请移至订单查看">
+          <template slot="extra">
+            <el-button type="primary" @click="handClose">关 闭</el-button>
+          </template>
+        </el-result>
+      </div>
+    </el-dialog>
+
+    <!--    会员登录-->
     <el-dialog
       title="会员信息"
       :visible.sync="dialogVisiblevip"
@@ -883,8 +898,11 @@
         oilGunList:[],
         // 支付方式列表
         payList:[],
+        // 倒计时
+        timestamp: 15,
         dialogVisible: false,
         dialogVisiblej: false,
+        dialogVisiblejLoading: false,
         dialogVisiblevip:false,
         dialogVisibleamount:false,
         dialogVisibleMember:false,
@@ -2299,6 +2317,7 @@
       },
       // 重置油品订单
       resetting(){
+        this.seekZero = 0;
         this.oilOrder = [];
         this.oilActualPay = 0;
         this.oilTotal = 0;
@@ -2339,7 +2358,6 @@
 
         // 校验油罐内油是否足够
         getOilTank(this.form.tankId).then(res => {
-          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 @@
               </el-form>
             </template>
           </el-table-column>
-          <el-table-column prop="terminal" label="终端" align="center" width="80"></el-table-column>
+          <el-table-column prop="terminal" label="终端" align="center" width="80">
+            <template slot-scope="props">
+              <span>{{ getVal(terminalList,props.row.terminal) }}</span>
+            </template>
+          </el-table-column>
           <el-table-column prop="oils" label="油品/油枪" align="center">
             <template slot-scope="props">
               <span>{{ getName(oilNameList,props.row.oils) }}/{{ getName1(oilGunList,props.row.oilGunNum) }}</span>
@@ -252,6 +256,8 @@
           cash:'0',
         },
         oilGunList:[],
+        // 终端列表
+        terminalList:[],
       }
     },
     created() {
@@ -261,6 +267,15 @@
       this.getOilGunList();
     },
     methods:{
+      getVal(list,val){
+        let name = "";
+        list.forEach(item => {
+          if (item.dictValue == val){
+            name = item.dictLabel
+          }
+        })
+        return name;
+      },
       // 获取油枪信息
       getOilGunList(){
         getOilNumberGun().then(res => {
@@ -356,6 +371,9 @@
         queryStaffs().then( response => {
           this.staffList = response.data;
         })
+        getDicts("terminal").then( response => {
+          this.terminalList = response.data;
+        })
       },
       // 获取列表信息
       getList(val){
diff --git a/gasStation-uni/pages/refuel/refuel.vue b/gasStation-uni/pages/refuel/refuel.vue
index 5154ee99e..3f9556f3f 100644
--- a/gasStation-uni/pages/refuel/refuel.vue
+++ b/gasStation-uni/pages/refuel/refuel.vue
@@ -335,6 +335,7 @@
 				this.oilOrder.storeId = this.storeId
 				this.oilOrder.staffId = id
 				this.oilOrder.oilNum = Math.ceil((this.value/this.oilPrice)*100)/100
+				this.oilOrder.tankId = uni.getStorageSync("tankId")
 				let _this = this;
 				// 添加油品订单信息
 				request({
diff --git a/gasStation-uni/pagesRefuel/orderDetail/index.vue b/gasStation-uni/pagesRefuel/orderDetail/index.vue
index 23b79610c..feeab8f71 100644
--- a/gasStation-uni/pagesRefuel/orderDetail/index.vue
+++ b/gasStation-uni/pagesRefuel/orderDetail/index.vue
@@ -39,7 +39,7 @@
 
 			<view style="background-color: white;width: 94%;margin: 15px auto;">
 				
-				<view class="desc" v-if="isStoreValueCard">
+				<view class="desc">
 					<view style="display: flex;">
 						储值卡
 						<span style="display: flex;">(<span v-if="isUseChildCard">主卡</span>余额:¥{{user.cardBalance}})</span>
@@ -74,7 +74,7 @@
 					</view>
 				</view>
 				
-				<view class="desc" v-if="isFullPreferential">
+				<view class="desc">
 					<view style="display: flex;">
 						活动优惠
 						<!-- <span style="display: flex;">(满减活动)</span> -->
@@ -91,7 +91,7 @@
 					</view>
 				</view>
 				
-				<view class="desc" v-if="cardsList.length>0">
+				<view class="desc" >
 					<view style="display: flex;">
 						优惠券优惠
 						<span style="display: flex;">(优惠券)</span>
@@ -108,7 +108,7 @@
 					</view>
 				</view>
 				
-				<view class="desc" v-if="isGradePreferential">
+				<view class="desc">
 					<view style="display: flex;">
 						会员等级优惠
 						<!-- <span style="display: flex;">({{userGrade.name}})</span> -->
@@ -254,7 +254,7 @@
 		},
 		onLoad(e) {
 			this.orderNo = e.orderNo
-			// this.orderNo = "2345202401161204280406d3"
+			// this.orderNo = "234520240117095256fbd86e"
 		},
 		onShow() {
 			this.getOilOrder();
@@ -827,7 +827,7 @@
 					}
 					_this.user = res.data.userVo;
 					_this.user = res.data.userVo;
-					if (res.data.userVo.refuelMoney){
+					if (res.data.userVo.refuelMoney && res.data.userVo.refuelMoney!='null'){
 						_this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney)
 						_this.refuelMoneyAfter = JSON.parse(res.data.userVo.refuelMoney)
 						_this.chooseRefuelMoney()
@@ -852,7 +852,7 @@
 						_this.getStaffList(res.data.staffId)
 						_this.getStore(res.data.storeId)
 						_this.getOilNumber(res.data.storeId)
-						_this.chooseCoupons()
+						// _this.chooseCoupons()
 						_this.getUser(res.data.userId)
 					}
 				})

From 45677555fcefaf13c745d885c2782b0e2a069d61 Mon Sep 17 00:00:00 2001
From: cun-nan <19819293608@163.com>
Date: Wed, 17 Jan 2024 16:26:08 +0800
Subject: [PATCH 2/4] bug

---
 .../api/staffCommission/staffcommission.js    |  21 +-
 .../views/staffCommission/staffCommission.vue | 244 +++++++++++++-----
 .../CommissionRecordController.java           |  25 ++
 .../mapper/CommissionRecordMapper.java        |  15 ++
 .../mapper/xml/CommissionRecordMapper.xml     |  50 ++++
 .../service/CommissionRecordService.java      |  15 ++
 .../impl/CommissionRecordServiceImpl.java     |  15 ++
 .../commission/vo/CommissionRecordVo.java     |  14 +-
 .../controller/LJUserController.java          |   4 +-
 .../userManager/mapper/xml/LJUserMapper.xml   |   5 +-
 .../userManager/service/LJUserService.java    |   2 +-
 .../service/impl/LJUserServiceImpl.java       |   2 +-
 .../pagesRefuel/orderDetail/index.vue         |   1 +
 13 files changed, 336 insertions(+), 77 deletions(-)

diff --git a/fuintAdmin/src/api/staffCommission/staffcommission.js b/fuintAdmin/src/api/staffCommission/staffcommission.js
index 84e67e956..a5a335787 100644
--- a/fuintAdmin/src/api/staffCommission/staffcommission.js
+++ b/fuintAdmin/src/api/staffCommission/staffcommission.js
@@ -44,10 +44,29 @@ export function updateCommission(data) {
   })
 }
 
-// 删除会员
+// 删除员工提成方案
 export function delCommission(id) {
   return request({
     url: '/business/commission/staffCommission/' + id,
     method: 'delete'
   })
 }
+
+// 查询员工提成记录
+export function listCommissionRecord(query) {
+  return request({
+    url: '/commissionRecord/list',
+    method: 'get',
+    params: query
+  })
+}
+
+
+// 查询员工提成总额
+export function allAmountCommissionRecord(query) {
+  return request({
+    url: '/commissionRecord/allAmount',
+    method: 'get',
+    params: query
+  })
+}
diff --git a/fuintAdmin/src/views/staffCommission/staffCommission.vue b/fuintAdmin/src/views/staffCommission/staffCommission.vue
index f8893e4ae..e7014d39b 100644
--- a/fuintAdmin/src/views/staffCommission/staffCommission.vue
+++ b/fuintAdmin/src/views/staffCommission/staffCommission.vue
@@ -4,15 +4,97 @@
       <el-tabs v-model="activeName" @tab-click="handleClick">
         <el-tab-pane label="油品提成方案" name="oil"></el-tab-pane>
         <el-tab-pane label="非油品提成方案" name="nonOil"></el-tab-pane>
+        <el-tab-pane label="员工提成记录" name="staffCommission">
+          <div>
+            <el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" label-width="68px">
+              <el-form-item label="交易员工" prop="staffId">
+                <el-select
+                  v-model="queryParams1.staffId"
+                  clearable
+                  placeholder="全部"
+                >
+                  <el-option v-for="item in staffList" :key="item.id" :label="item.realName" :value="item.id">
+                    <span style="float: left">{{ item.realName }}</span>
+                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.mobile }}</span>
+                  </el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="订单类型">
+                <el-input v-model="queryParams1.type" placeholder="请输入订单类型"></el-input>
+              </el-form-item>
+              <el-form-item label="订单号">
+                <el-input v-model="queryParams1.orderNo" placeholder="请输入订单号"></el-input>
+              </el-form-item>
+                <el-form-item label="创建时间">
+                  <el-date-picker
+                    v-model="dateRange"
+                    style="width: 240px"
+                    size="medium"
+                    value-format="yyyy-MM-dd"
+                    type="daterange"
+                    range-separator="-"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期"
+                  ></el-date-picker>
+                </el-form-item>
+              <el-form-item>
+                <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+                <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+              </el-form-item>
+            </el-form>
+          </div>
+          <el-card class="box-card">
+            <div slot="header" class="clearfix">
+              <span>会员充值统计</span>
+            </div>
+            <div class="box-gang">
+              <div class="box">
+                <div class="size-hui">提成笔数</div>
+                <div class="size-bole">{{ total1 }}</div>
+              </div>
+              <div class="box">
+                <div class="size-hui">提成金额</div>
+                <div class="size-bole">{{ allAmount }}</div>
+              </div>
+            </div>
+          </el-card>
+          <div style="margin-top: 20px" v-if="activeName=='staffCommission'">
+            <el-table ref="tables" v-loading="loading" :data="commissionList">
+              <el-table-column label="ID" prop="id" align="center" width="60"/>
+              <el-table-column label="员工信息" align="center">
+                <el-table-column label="姓名" prop="realName" align="center"/>
+                <el-table-column label="手机号" prop="mobile" align="center"/>
+              </el-table-column>
+              <el-table-column label="类型" prop="type" align="center" />
+              <el-table-column label="提成金额(元)" prop="amount" align="center" width="260"/>
+              <el-table-column label="关联订单号" prop="orderNo" align="center"/>
+              <el-table-column label="描述" prop="description" align="center"/>
+              <el-table-column label="创建时间" prop="createTime" align="center" width="160">
+                <template slot-scope="scope">
+                  <span>{{ parseTime(scope.row.createTime) }}</span>
+                </template>
+              </el-table-column>
+            </el-table>
+
+            <pagination
+              v-show="total1>0"
+              :total="total1"
+              :page.sync="queryParams1.page"
+              :limit.sync="queryParams1.pageSize"
+              @pagination="getCommissionList"
+            />
+          </div>
+        </el-tab-pane>
       </el-tabs>
 
       <el-alert
         title="方案说明"
         type="info"
-        description="同一角色组、同一参与油品只能设置一种启用的提成方案">
+        v-if="activeName=='oil' || activeName=='nonOil'"
+        description="同一角色组、同一参与油品只能设置一种启用的提成方案,挂账订单不参与提成">
       </el-alert>
 
-      <div style="margin-top: 20px">
+      <div style="margin-top: 20px" v-if="activeName=='oil' || activeName=='nonOil'">
         <el-button
           type="primary"
           icon="el-icon-plus"
@@ -88,9 +170,10 @@
           @pagination="getList"
         />
       </div>
+
     </el-card>
 
-    <!-- 添加或修改对话框 -->
+    <!-- 添加或修改提成方案对话框 -->
     <el-dialog :close-on-click-modal="false" :title="title" width="40%" :visible.sync="open" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="90px">
         <el-row>
@@ -106,14 +189,6 @@
               <el-radio-group v-model="form.commissionSource">
                 <el-radio v-for="dict in dict.type.source" @change="isChange" :label="dict.value">{{ dict.label }}</el-radio>
               </el-radio-group>
-<!--              <el-radio-group v-model="commissionSource" ref="" @change="getCheckbox">-->
-<!--                <el-checkbox-->
-<!--                  v-for="dict in dict.type.source"-->
-<!--                  :key="dict.value"-->
-<!--                  :label="dict.label"-->
-<!--                  :value="dict.value"-->
-<!--                ></el-checkbox>-->
-<!--              </el-radio-group>-->
             </el-form-item>
           </el-col>
         </el-row>
@@ -121,12 +196,6 @@
           <el-col :span="24">
             <el-form-item label="角色组" prop="staffRoleGroup">
               <el-select v-model="form.staffRoleGroup" placeholder="请选择所属角色">
-<!--                <el-option-->
-<!--                  v-for="dict in dict.type.staff_role"-->
-<!--                  :key="dict.value"-->
-<!--                  :label="dict.label"-->
-<!--                  :value="dict.value"-->
-<!--                />-->
                 <el-option
                   v-for="item in roleList"
                   :key="item.dutyId+''"
@@ -179,21 +248,6 @@
             </el-form-item>
           </el-col>
         </el-row>
-<!--        <el-row>-->
-<!--          <el-col :span="24">-->
-<!--            <el-form-item label="生效时间" prop="takeEffect">-->
-<!--              <el-date-picker-->
-<!--                v-model="form.takeEffect"-->
-<!--                type="daterange"-->
-<!--                value-format="yyyy-MM-dd HH:mm:ss"-->
-<!--                range-separator="至"-->
-<!--                start-placeholder="开始日期"-->
-<!--                end-placeholder="结束日期">-->
-<!--              </el-date-picker>-->
-<!--              <div style="font-size: 12px;color: grey">时间范围内的油品交易有效</div>-->
-<!--            </el-form-item>-->
-<!--          </el-col>-->
-<!--        </el-row>-->
         <el-row>
           <el-col :span="24">
             <el-form-item label="方案状态" prop="status">
@@ -219,18 +273,21 @@
 
 
 import {
-  addCommission, delCommission,
+  addCommission, allAmountCommissionRecord, delCommission,
   getCommission,
-  listCommission,
+  listCommission, listCommissionRecord,
   queryCommission,
   updateCommission
 } from "@/api/staffCommission/staffcommission";
 import {listDuty} from "@/api/staff/duty";
+import {queryStaffs} from "@/api/order/staff";
 
 export default {
   dicts: ['source','role','zhzt','comissionType','staff_role'],
   data(){
     return {
+      // 提成总额
+      allAmount:0,
       changeCom:false,
       activeName: 'oil',
       select:"元",
@@ -241,8 +298,10 @@ export default {
       title: "",
       // 总条数
       total: 0,
+      total1: 0,
       // 表格数据
       list: [],
+      commissionList: [],
       // 是否显示修改对话框
       open: false,
       // 默认排序
@@ -255,6 +314,13 @@ export default {
         name: '',
         commissionSource:'油品'
       },
+      queryParams1: {
+        page: 1,
+        pageSize: 10,
+      },
+      staffList:[],
+      // 日期范围
+      dateRange: [],
       // 表单参数
       form: {
         type:'orderAmount',
@@ -295,8 +361,14 @@ export default {
   created() {
     this.getList();
     this.getDuty();
+    this.getStaffList();
   },
   methods:{
+    getStaffList(){
+      queryStaffs().then( response => {
+        this.staffList = response.data;
+      })
+    },
     // 查询角色列表
     getDuty(){
       listDuty().then(response => {
@@ -314,7 +386,8 @@ export default {
           commissionSource:'油品'
         };
         this.getList();
-      }else {
+      }
+      if (this.activeName == 'nonOil') {
         this.queryParams = {
           page: 1,
           pageSize: 10,
@@ -324,6 +397,13 @@ export default {
         };
         this.getList();
       }
+      if (this.activeName == 'staffCommission') {
+        this.queryParams1 = {
+          page: 1,
+          pageSize: 10,
+        };
+        this.getCommissionList();
+      }
     },
 
     getCheckbox(){
@@ -338,6 +418,20 @@ export default {
         this.loading = false;
       });
     },
+    // 查询员工提成记录信息
+    getCommissionList(){
+      this.loading = true;
+      listCommissionRecord(this.addDateRange(this.queryParams1, this.dateRange)).then(res => {
+        this.commissionList = res.data.records;
+        this.total1 = res.data.total;
+        this.loading = false;
+      })
+      allAmountCommissionRecord(this.addDateRange(this.queryParams1, this.dateRange)).then(res => {
+        if (res.data){
+          this.allAmount = res.data
+        }
+      })
+    },
     // 表单重置
     reset() {
       this.resetForm("form");
@@ -374,6 +468,22 @@ export default {
         this.title = "编辑提成方案";
       });
     },
+
+    // 搜索按钮操作
+    handleQuery() {
+      this.queryParams1.page = 1;
+      this.getCommissionList();
+    },
+    // 重置按钮操作
+    resetQuery() {
+      this.dateRange = [];
+      this.queryParams1 = {
+        page: 1,
+        pageSize: 10,
+      }
+      // this.resetForm("queryForm");
+      this.handleQuery();
+    },
     // 删除按钮操作
     handleDelete(row) {
       const name = row.name
@@ -397,25 +507,6 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           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 {
               this.form.royaltyRate = this.form.royaltyRate + this.select
               updateCommission(this.form).then(response => {
                 if (response.data==1){
@@ -426,21 +517,7 @@ export default {
                   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) {
@@ -451,8 +528,6 @@ export default {
                     this.$modal.msgError("同一个角色组只能对应一个"+this.form.commissionSource+"提成方案")
                   }
                 });
-            //   }
-            // })
           }
         }
       });
@@ -483,4 +558,33 @@ export default {
     height: 100vh;
     background: #f6f8f9;
   }
+  .clearfix{
+    width: 100%;
+
+  }
+  .box-card{
+    width: 100%;
+    margin-bottom: 15px;
+  }
+  .box-gang{
+    width: 100%;
+    display: flex;
+    align-items: center;
+  }
+  .box{
+     width: 200px;
+     box-sizing: border-box;
+     padding: 10px;
+     background: #f9f9f9;
+     height: 86px;
+     margin-right: 10px;
+   }
+  .size-hui{
+    font-size: 14px;
+    margin-bottom: 10px;
+    margin-top: 10px;
+  }
+  .size-bole{
+    font-weight: bold;
+  }
 </style>
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/controller/CommissionRecordController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/controller/CommissionRecordController.java
index 538880a0a..8d510e012 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/controller/CommissionRecordController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/controller/CommissionRecordController.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.CommissionRecord;
 import com.fuint.business.commission.service.CommissionRecordService;
+import com.fuint.business.commission.vo.CommissionRecordVo;
 import com.fuint.framework.web.BaseController;
 import com.fuint.framework.web.ResponseObject;
 import org.springframework.web.bind.annotation.*;
@@ -89,7 +90,31 @@ public class CommissionRecordController extends BaseController {
         return getSuccessResult(this.commissionRecordService.deleteById(id));
     }
 
+    /**
+     * 根据条件分页查询提成记录信息
+     * @param commissionRecord
+     * @param pageNo
+     * @param pageSize
+     * @return
+     */
+    @GetMapping("list")
+    public ResponseObject list(CommissionRecordVo commissionRecord,
+                               @RequestParam(value = "page",defaultValue = "1") Integer pageNo,
+                               @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize) {
+        Page page = new Page(pageNo, pageSize);
+        IPage< CommissionRecordVo> iPageList = this.commissionRecordService.selectCommissionList(page, commissionRecord);
+        return getSuccessResult(iPageList);
+    }
 
+    /**
+     * 消费总金额
+     * @param commissionRecord
+     * @return
+     */
+    @GetMapping("allAmount")
+    public ResponseObject allAmount(CommissionRecordVo commissionRecord) {
+        return getSuccessResult(commissionRecordService.selectAllAmount(commissionRecord));
+    }
 
 }
 
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/CommissionRecordMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/CommissionRecordMapper.java
index 56b9c7367..169447230 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/CommissionRecordMapper.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/CommissionRecordMapper.java
@@ -3,6 +3,7 @@ package com.fuint.business.commission.mapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fuint.business.commission.entity.CommissionRecord;
+import com.fuint.business.commission.vo.CommissionRecordVo;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.data.domain.Pageable;
 import java.util.List;
@@ -81,5 +82,19 @@ public interface CommissionRecordMapper {
      */
     int deleteById(Integer id);
 
+
+    /**
+     * 根据条件分页查询员工提成记录信息
+     * @param page
+     * @param commissionRecord
+     * @return
+     */
+    IPage<CommissionRecordVo> selectCommissionList(@Param("page") Page page,@Param("commissionRecord") CommissionRecordVo commissionRecord);
+
+    /**
+     * 根据条件查询提成总额
+     * @return
+     */
+    Double selectAllAmount(@Param("commissionRecord") CommissionRecordVo commissionRecord);
 }
 
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/xml/CommissionRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/xml/CommissionRecordMapper.xml
index a4bc7cfc0..daa529200 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/xml/CommissionRecordMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/mapper/xml/CommissionRecordMapper.xml
@@ -183,5 +183,55 @@
         delete from commission_record where id = #{id}
     </delete>
 
+
+    <select id="selectCommissionList" resultType="com.fuint.business.commission.vo.CommissionRecordVo">
+        select cr.*,ms.real_name,ms.mobile from commission_record cr
+            left join mt_staff ms on cr.staff_id = ms.id
+        <where>
+            <if test="commissionRecord.storeId != null and commissionRecord.storeId != ''">
+                and cr.store_id = #{commissionRecord.storeId}
+            </if>
+            <if test="commissionRecord.staffId != null and commissionRecord.staffId != ''">
+                and cr.staff_id = #{commissionRecord.staffId}
+            </if>
+            <if test="commissionRecord.type != null and commissionRecord.type != ''">
+                and cr.type like concat('%', #{commissionRecord.type}, '%')
+            </if>
+            <if test="commissionRecord.orderNo != null and commissionRecord.orderNo != ''">
+                and cr.order_no like concat('%', #{commissionRecord.orderNo}, '%')
+            </if>
+            <if test="commissionRecord.params.beginTime != null and commissionRecord.params.beginTime != ''"><!-- 开始时间检索 -->
+                and date_format(cr.create_time,'%y%m%d') &gt;= date_format(#{commissionRecord.params.beginTime},'%y%m%d')
+            </if>
+            <if test="commissionRecord.params.endTime != null and commissionRecord.params.endTime != ''"><!-- 结束时间检索 -->
+                and date_format(cr.create_time,'%y%m%d') &lt;= date_format(#{commissionRecord.params.endTime},'%y%m%d')
+            </if>
+        </where>
+        order by cr.create_time desc
+    </select>
+    <select id="selectAllAmount" resultType="java.lang.Double"
+            parameterType="com.fuint.business.commission.vo.CommissionRecordVo">
+        select sum(amount) from commission_record
+        <where>
+            <if test="commissionRecord.storeId != null and commissionRecord.storeId != ''">
+                and store_id = #{commissionRecord.storeId}
+            </if>
+            <if test="commissionRecord.staffId != null and commissionRecord.staffId != ''">
+                and staff_id = #{commissionRecord.staffId}
+            </if>
+            <if test="commissionRecord.type != null and commissionRecord.type != ''">
+                and type like concat('%', #{commissionRecord.type}, '%')
+            </if>
+            <if test="commissionRecord.orderNo != null and commissionRecord.orderNo != ''">
+                and order_no like concat('%', #{commissionRecord.orderNo}, '%')
+            </if>
+            <if test="commissionRecord.params.beginTime != null and commissionRecord.params.beginTime != ''"><!-- 开始时间检索 -->
+                and date_format(create_time,'%y%m%d') &gt;= date_format(#{commissionRecord.params.beginTime},'%y%m%d')
+            </if>
+            <if test="commissionRecord.params.endTime != null and commissionRecord.params.endTime != ''"><!-- 结束时间检索 -->
+                and date_format(create_time,'%y%m%d') &lt;= date_format(#{commissionRecord.params.endTime},'%y%m%d')
+            </if>
+        </where>
+    </select>
 </mapper>
 
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 ed1e0226f..b8c2d4d19 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
@@ -3,6 +3,7 @@ package com.fuint.business.commission.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fuint.business.commission.entity.CommissionRecord;
+import com.fuint.business.commission.vo.CommissionRecordVo;
 import io.lettuce.core.dynamic.annotation.Param;
 
 
@@ -62,4 +63,18 @@ public interface CommissionRecordService {
      * @return
      */
     int insertRecord(CommissionRecord commissionRecord);
+
+    /**
+     * 根据条件分页查询员工提成记录信息
+     * @param page
+     * @param commissionRecord
+     * @return
+     */
+    IPage<CommissionRecordVo> selectCommissionList(Page page, CommissionRecordVo commissionRecord);
+
+    /**
+     * 根据条件查询提成总额
+     * @return
+     */
+    Double selectAllAmount(CommissionRecordVo commissionRecord);
 }
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 2a307f78d..6e7be2f8b 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
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fuint.business.commission.entity.CommissionRecord;
 import com.fuint.business.commission.mapper.CommissionRecordMapper;
 import com.fuint.business.commission.service.CommissionRecordService;
+import com.fuint.business.commission.vo.CommissionRecordVo;
 import org.springframework.stereotype.Service;
 import com.fuint.common.util.TokenUtil;
 import io.lettuce.core.dynamic.annotation.Param;
@@ -97,4 +98,18 @@ public class CommissionRecordServiceImpl implements CommissionRecordService {
     public int insertRecord(CommissionRecord commissionRecord) {
         return commissionRecordMapper.insert(commissionRecord);
     }
+
+    @Override
+    public IPage<CommissionRecordVo> selectCommissionList(Page page, CommissionRecordVo commissionRecord) {
+        AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
+        commissionRecord.setStoreId(nowAccountInfo.getStoreId());
+        return commissionRecordMapper.selectCommissionList(page, commissionRecord);
+    }
+
+    @Override
+    public Double selectAllAmount(CommissionRecordVo commissionRecord) {
+        AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
+        commissionRecord.setStoreId(nowAccountInfo.getStoreId());
+        return commissionRecordMapper.selectAllAmount(commissionRecord);
+    }
 }
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/vo/CommissionRecordVo.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/vo/CommissionRecordVo.java
index 42e429aa8..fbf155a1d 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/vo/CommissionRecordVo.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/vo/CommissionRecordVo.java
@@ -1,4 +1,16 @@
 package com.fuint.business.commission.vo;
 
-public class CommissionRecordVo {
+import com.fuint.business.commission.entity.CommissionRecord;
+import lombok.Data;
+
+@Data
+public class CommissionRecordVo extends CommissionRecord {
+    /**
+     * 员工姓名
+     */
+    private String realName;
+    /**
+     * 员工手机号
+     */
+    private String mobile;
 }
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java
index 6eab3dfc3..28ec04963 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java
@@ -97,8 +97,8 @@ public class LJUserController extends BaseController {
      * @return
      */
     @GetMapping("/statistic")
-    public ResponseObject getStatistic(){
-        Map<String, Object> map = userService.selectStatistic();
+    public ResponseObject getStatistic(LJUserVo user){
+        Map<String, Object> map = userService.selectStatistic(user);
         return getSuccessResult(map);
     }
 
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml
index 59e8298e2..10e30bc12 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml
@@ -55,7 +55,10 @@
     </select>
 <!--    查询会员统计信息-->
     <select id="selectSumByStore" resultType="java.lang.Double" parameterType="int">
-        select sum(${sumValue}) from mt_user_balance where chain_store_id = #{chainStoreId}
+        select sum(${sumValue}) from mt_user_balance
+        <where>
+            chain_store_id = #{chainStoreId}
+        </where>
     </select>
 <!--    根据手机号查询会员信息-->
     <select id="selectUserByMobile" resultType="com.fuint.business.userManager.vo.LJUserVo"
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java
index b2b2301c4..3665b682f 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java
@@ -44,7 +44,7 @@ public interface LJUserService extends IService<LJUser> {
      * 查询会员统计信息
      * @return
      */
-    public Map<String ,Object> selectStatistic();
+    public Map<String ,Object> selectStatistic(LJUserVo user);
 
     /**
      * 根据id查询会员信息
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java
index 3de97b9ff..d378de44f 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java
@@ -92,7 +92,7 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
      * @return
      */
     @Override
-    public Map<String, Object> selectStatistic() {
+    public Map<String, Object> selectStatistic(LJUserVo user) {
         Map<String ,Object> map = new HashMap<>();
         AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
         Integer storeId = nowAccountInfo.getStoreId();
diff --git a/gasStation-uni/pagesRefuel/orderDetail/index.vue b/gasStation-uni/pagesRefuel/orderDetail/index.vue
index feeab8f71..ff86c74a3 100644
--- a/gasStation-uni/pagesRefuel/orderDetail/index.vue
+++ b/gasStation-uni/pagesRefuel/orderDetail/index.vue
@@ -126,6 +126,7 @@
 				</view>
 				<view class="desc" v-if="!isFullPreferential && !isGradePreferential && !isOilStorageCard && !isStoreValueCard">无优惠</view>
 				
+				<view style="margin: 10px 20px 0;color: red;font-size: 12px;">已为您计算出最大优惠</view>
 				<view style="margin: 10px 20px 0;color: red;font-size: 12px;">注:囤油卡不参与任何优惠活动</view>
 			</view>
 

From 0111c8055ca7bd13741a15549f89a94bebacd799 Mon Sep 17 00:00:00 2001
From: cun-nan <19819293608@163.com>
Date: Wed, 17 Jan 2024 17:36:21 +0800
Subject: [PATCH 3/4] bug

---
 .../api/fuyou/controller/FyPayController.java |  2 +-
 .../service/impl/LJStaffServiceImpl.java      |  1 +
 .../business/order/entity/CashierOrder.java   |  4 ++
 .../service/impl/OilOrderServiceImpl.java     |  5 +++
 fuintCashierWeb/src/api/cashier/hangbill.js   | 12 ++++--
 .../views/cashier/NewComponents/credit.vue    | 39 ++++++++++++++-----
 .../pagesRefuel/orderDetail/index.vue         | 12 +++---
 7 files changed, 55 insertions(+), 20 deletions(-)

diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/FyPayController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/FyPayController.java
index e8b774665..b6ebf50be 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/FyPayController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/controller/FyPayController.java
@@ -62,7 +62,7 @@ public class FyPayController {
 //                业务逻辑 判断订单状态
                 AllOrderInfo allOrderInfo = allOrderInfoService.selectAllOrderInfoByOrderNo(orderNo);
                 if (ObjectUtil.isNotEmpty(allOrderInfo)){
-                    allOrderInfo.setPayMoney(Double.valueOf(settleOrderAmt));
+                    allOrderInfo.setPayMoney(Double.valueOf(settleOrderAmt)/100);
                     allOrderInfo.setTransactionId(transactionId);
                     allOrderInfo.setStatus("paid");
                     allOrderInfo.setPayTime(new Date());
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java
index cd8947dfb..05815516e 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java
@@ -210,6 +210,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
         if (StringUtils.isNotEmpty(staff.getPassword())){
             TAccount tAccount = accountService.selectAccountByStaffId(staff.getId());
             tAccount.setPassword(staff.getPassword());
+            tAccount.setAccountName(staff.getMobile());
             accountService.entryptPassword(tAccount);
             try {
                 accountService.editAccount(tAccount,null);
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/CashierOrder.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/CashierOrder.java
index cc73328a3..83f3af19c 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/CashierOrder.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/CashierOrder.java
@@ -98,5 +98,9 @@ public class CashierOrder extends BaseEntity implements Serializable {
      * 退款备注
      */
     private String refundRemark;
+    /**
+     * 支付方式
+     */
+    private String payType;
 }
 
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 27a25b2ac..9f3a99cb4 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
@@ -330,6 +330,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
         cashierOrder.setOilOrderAmount(oilAmount);
         cashierOrder.setOilDiscountAmount(oilDiscount);
         cashierOrder.setTerminal(terminal);
+        cashierOrder.setPayType(payType);
 
 //        添加油品订单信息
         if (!oilOrder.equals("[]")){
@@ -638,6 +639,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
                         cashierOrder.setTerminal(map.get("terminal"));
                         cashierOrder.setOilOrderId(oilOrder.getId());
                         cashierOrder.setSeekZero(0.0);
+                        cashierOrder.setPayType(map.get("payType"));
                         cashierOrderService.insertCashierOrder(cashierOrder);
                         this.insertAllOrderInfo(orderNo, storeId, oilAmount, map.get("payType"), userId, "PC", "1", status);
                         res.put("success","success");
@@ -698,6 +700,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
                     cashierOrder.setTerminal(map.get("terminal"));
                     cashierOrder.setOilOrderId(oilOrder.getId());
                     cashierOrder.setSeekZero(0.0);
+                    cashierOrder.setPayType(map.get("payType"));
                     cashierOrderService.insertCashierOrder(cashierOrder);
                     this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
                     this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"PC","1","paid");
@@ -867,6 +870,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
         cashierOrder.setOilDiscountAmount(oilOrder.getDiscountAmount());
         cashierOrder.setTerminal(oilOrder.getTerminal());
         cashierOrder.setSeekZero(0.0);
+        cashierOrder.setPayType(oilOrder.getPayType());
         cashierOrderService.insertCashierOrder(cashierOrder);
         return orderNo;
     }
@@ -1065,6 +1069,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
                 this.addOilTracks(oilOrder,oilOrder.getStoreId());
                 CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
                 if (ObjectUtil.isNotEmpty(cashierOrder)){
+                    cashierOrder.setOilOrderId(oilOrder.getId());
                     cashierOrder.setPayTime(new Date());
                     cashierOrder.setStatus("paid");
                     cashierOrder.setOilDiscountAmount(oilOrder.getDiscountAmount());
diff --git a/fuintCashierWeb/src/api/cashier/hangbill.js b/fuintCashierWeb/src/api/cashier/hangbill.js
index 7628192cf..de5533365 100644
--- a/fuintCashierWeb/src/api/cashier/hangbill.js
+++ b/fuintCashierWeb/src/api/cashier/hangbill.js
@@ -62,33 +62,37 @@ export function editHangBill(data) {
 }
 
 // 当前店铺归还账单的数量
-export function hangBillReturnTotal() {
+export function hangBillReturnTotal(query) {
   return request({
     url: '/business/hangBill/returnTotal',
     method: 'get',
+    params: query
   })
 }
 
 // 当前店铺归还账单的数量
-export function hangBillAllAmount() {
+export function hangBillAllAmount(query) {
   return request({
     url: '/business/hangBill/allAmount',
     method: 'get',
+    params: query
   })
 }
 
 // 当前店铺归还账单的数量
-export function hangBillAllReturnAmount() {
+export function hangBillAllReturnAmount(query) {
   return request({
     url: '/business/hangBill/allReturnAmount',
     method: 'get',
+    params: query
   })
 }
 
 // 当前店铺归还账单的数量
-export function hangBillAllNoReturnAmount() {
+export function hangBillAllNoReturnAmount(query) {
   return request({
     url: '/business/hangBill/allNoReturnAmount',
     method: 'get',
+    params: query
   })
 }
diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/credit.vue b/fuintCashierWeb/src/views/cashier/NewComponents/credit.vue
index 74b4fe9ab..6cfb03b5f 100644
--- a/fuintCashierWeb/src/views/cashier/NewComponents/credit.vue
+++ b/fuintCashierWeb/src/views/cashier/NewComponents/credit.vue
@@ -554,6 +554,21 @@
       </div>
     </el-dialog>
 
+    <!--    立即结算-->
+    <el-dialog
+      title="扫码支付"
+      :visible.sync="dialogVisiblejLoading"
+      width="30%"
+      :close-on-click-modal="false">
+      <div>
+        <el-result icon="info" title="支付状态未查询成功,请移至订单查看">
+          <template slot="extra">
+            <el-button type="primary" @click="handClose">关 闭</el-button>
+          </template>
+        </el-result>
+      </div>
+    </el-dialog>
+
 <!--      批量挂账归还-->
     <el-dialog title="批量挂账归还" :visible.sync="open3" append-to-body>
         <el-form ref="form3" :model="form3">
@@ -757,6 +772,7 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
         open3:false,
         open4:false,
         dialogVisiblej:false,
+        dialogVisiblejLoading: false,
         // 是否查询支付成功信息
         isQuery:true,
         // 是否是批量归还
@@ -784,7 +800,7 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
       this.getUnitList();
       this.getPayList();
       this.getLists();
-      this.getStatistic();
+      // this.getStatistic();
     },
     directives: {
       // 注册一个局部的自定义指令 v-focus
@@ -802,20 +818,20 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
     methods:{
       // 获取挂账统计信息
       getStatistic(){
-        hangBillReturnTotal().then(res => {
+        hangBillReturnTotal(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
           this.returnTotal = res.data
         })
-        hangBillAllAmount().then(res => {
+        hangBillAllAmount(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
           if (res.data) {
             this.allAmount = res.data
           }
         })
-        hangBillAllReturnAmount().then(res => {
+        hangBillAllReturnAmount(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
           if (res.data) {
             this.returnAllAmount = res.data
           }
         })
-        hangBillAllNoReturnAmount().then(res => {
+        hangBillAllNoReturnAmount(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
           if (res.data) {
             this.noReturnAllAmount = res.data
           }
@@ -941,6 +957,7 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
         this.repaidAmount = repaidAmount
       },
       handClose(){
+        this.dialogVisiblejLoading = false
         this.isPay = true;
         this.isPaySuccess = false;
         this.dialogVisiblej = false;
@@ -1002,15 +1019,18 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
             response.data.forEach(item => {
               if (item.payStatus == "unpaid"){
                 _this.isQuery = true;
+                _this.dialogVisiblejLoading = true
               }
               if (item.payStatus == "paid"){
                 _this.isPaySuccess = true;
+                _this.isPay = false;
                 _this.isQuery = false;
                 _this.loading = false;
                 clearInterval(timer);
               }
               if (item.payStatus == "payFail"){
                 _this.isPaySuccess = false;
+                _this.isPay = false;
                 _this.isQuery = false;
                 _this.loading = false;
                 clearInterval(timer);
@@ -1021,15 +1041,15 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
         let timer2 = setInterval(function () {
           if (_this.isBatch) {
             if (_this.isQuery || !_this.open3 || !_this.open4){
-              _this.loading = false;
-              _this.isPay = false;
+              // _this.loading = false;
+              // _this.isPay = false;
               clearInterval(timer);
               clearTimeout(timer3);
             }
           }else {
             if (_this.isQuery || !_this.open2) {
-              _this.loading = false;
-              _this.isPay = false;
+              // _this.loading = false;
+              // _this.isPay = false;
               clearInterval(timer);
               clearTimeout(timer3);
             }
@@ -1180,6 +1200,7 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
           this.hangBillList = response.data.records
           this.total = response.data.total;
         })
+        this.getStatistic();
       },
       // 搜索按钮操作
       handleQuery() {
diff --git a/gasStation-uni/pagesRefuel/orderDetail/index.vue b/gasStation-uni/pagesRefuel/orderDetail/index.vue
index ff86c74a3..255d4344d 100644
--- a/gasStation-uni/pagesRefuel/orderDetail/index.vue
+++ b/gasStation-uni/pagesRefuel/orderDetail/index.vue
@@ -82,11 +82,11 @@
 					<view style="display: flex;">
 						<span style="margin-right: 10px;display: flex;">
 							-¥{{fullRedece}}
-							<span style="margin-left: 8px;margin-top: 8px;">
+							<!-- <span style="margin-left: 8px;margin-top: 8px;">
 								<u-checkbox-group>
 									<u-checkbox v-model="checkFull" :checked="checkFull" @change="changeFull"></u-checkbox>
 								</u-checkbox-group>
-							</span>
+							</span> -->
 						</span>
 					</view>
 				</view>
@@ -99,11 +99,11 @@
 					<view style="display: flex;">
 						<span style="margin-right: 10px;display: flex;">
 							-¥{{couponRedece}}
-							<span style="margin-left: 8px;margin-top: 8px;">
+							<!-- <span style="margin-left: 8px;margin-top: 8px;">
 								<u-checkbox-group>
 									<u-checkbox v-model="checkCoupon" :checked="checkCoupon" @change="changeCoupon"></u-checkbox>
 								</u-checkbox-group>
-							</span>
+							</span> -->
 						</span>
 					</view>
 				</view>
@@ -116,11 +116,11 @@
 					<view style="display: flex;">
 						<span style="margin-right: 10px;display: flex;">
 							-¥{{gradeRedece}}
-							<span style="margin-left: 8px;margin-top: 8px;">
+							<!-- <span style="margin-left: 8px;margin-top: 8px;">
 								<u-checkbox-group>
 									<u-checkbox v-model="checkGrade" @change="changeGrade"></u-checkbox>
 								</u-checkbox-group>
-							</span>
+							</span> -->
 						</span>
 					</view>
 				</view>

From 4df95eff141e41e8e6531446117dd6d98727e9b9 Mon Sep 17 00:00:00 2001
From: cun-nan <19819293608@163.com>
Date: Wed, 17 Jan 2024 18:17:57 +0800
Subject: [PATCH 4/4] bug

---
 .../fuyou/service/impl/FyPayServiceImpl.java  | 11 ++-
 .../impl/StaffCommissionServiceImpl.java      |  9 ++-
 .../service/impl/AllOrderInfoServiceImpl.java |  8 ++-
 .../service/impl/CashierOrderServiceImpl.java |  9 ++-
 .../service/impl/OilOrderServiceImpl.java     | 68 ++++++++++++-------
 5 files changed, 73 insertions(+), 32 deletions(-)

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 df187974c..7b437c056 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
@@ -9,6 +9,7 @@ import com.fuint.api.fuyou.entity.*;
 import com.fuint.api.fuyou.service.FyPayService;
 import com.fuint.api.fuyou.service.MerchantConfigService;
 import com.fuint.api.fuyou.util.Utils;
+import com.fuint.business.commission.service.StaffCommissionService;
 import com.fuint.business.integral.entity.IntegralOrders;
 import com.fuint.business.integral.service.IntegralOrdersService;
 import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
@@ -45,6 +46,9 @@ public class FyPayServiceImpl implements FyPayService {
     private CardFuelRecordService cardFuelRecordService;
     @Resource
     private IntegralOrdersService integralOrdersService;
+    @Autowired
+    private StaffCommissionService staffCommissionService;
+
     /**
      * 条码支付
      * @param map1
@@ -171,7 +175,7 @@ public class FyPayServiceImpl implements FyPayService {
 //                        油品订单
                         oilOrder.setOrderStatus("paid");
                         oilOrder.setPayTime(date);
-
+                        staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),oilOrder.getOilNum(),"油品",orderNo);
 //                        修改油罐容量
                         List<JSONObject> jsonObjects = JSONArray.parseArray(map1.get("oilOrder"), JSONObject.class);
                         if (jsonObjects.size()<=1) {
@@ -193,7 +197,7 @@ public class FyPayServiceImpl implements FyPayService {
 //                        商品订单
                         goodsOrder.setStatus("paid");
                         goodsOrder.setPayTime(date);
-
+                        staffCommissionService.countStaffCommission(goodsOrder.getStaffId(),goodsOrder.getStoreId(),goodsOrder.getAmount(),goodsOrder.getPayAmount(),0.0,"商品",orderNo);
                         if (!map1.get("goodsOrder").equals("[]")){
                             List<JSONObject> goods = JSONArray.parseArray(map1.get("goodsOrder"), JSONObject.class);
                             OrderGoods orderGoods = new OrderGoods();
@@ -225,6 +229,9 @@ public class FyPayServiceImpl implements FyPayService {
                     if (!ArrayUtil.isEmpty(list)){
                         if (list.size()>1){
                             for (OilOrder order : list) {
+                                if (order.getOrderType().equals("主订单")){
+                                    staffCommissionService.countStaffCommission(order.getStaffId(),order.getStoreId(),order.getOrderAmount(),order.getPayAmount(),order.getOilNum(),"油品",orderNo);
+                                }
 //                            添加多个油品订单
                                 order.setOrderStatus("paid");
                                 order.setPayTime(date);
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 9313267dd..dd34ba54f 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
@@ -11,6 +11,8 @@ 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.business.member.entity.LJStaff;
+import com.fuint.business.member.service.ILJStaffService;
 import com.fuint.common.dto.AccountInfo;
 import com.fuint.common.util.TokenUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -94,18 +96,21 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
 
     @Autowired
     private CommissionRecordService commissionRecordService;
+    @Autowired
+    private ILJStaffService staffService;
 
     @Override
     public void countStaffCommission(Integer staffId,Integer storeId,Double amount,Double payAmount,Double oilLiters,String type,String orderNo) {
+        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){
+        if (list.size()>0 && ObjectUtil.isNotEmpty(staff)){
             for (StaffCommission staffCommission : list) {
                 CommissionRecord commissionRecord = new CommissionRecord();
-                if (type.equals(staffCommission.getCommissionSource())){
+                if (type.equals(staffCommission.getCommissionSource()) && staff.getRoleId().equals(staffCommission.getStaffRoleGroup())){
                     commissionRecord.setStaffId(staffId);
                     commissionRecord.setStoreId(storeId);
                     commissionRecord.setType(type+"订单出售");
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java
index f9c390c69..6982b8b41 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java
@@ -79,7 +79,13 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
 
     @Override
     public int insertAllOrderInfo(AllOrderInfo allOrderInfo) {
-        return baseMapper.insert(allOrderInfo);
+        int row = 0;
+        AllOrderInfo allOrderInfo1 = this.selectAllOrderInfoByOrderNo(allOrderInfo.getOrderNo());
+        if (ObjectUtil.isNotEmpty(allOrderInfo1)){
+            return row;
+        }
+        row = baseMapper.insert(allOrderInfo);
+        return row;
     }
 
 
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/CashierOrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/CashierOrderServiceImpl.java
index c475cb4da..2d22cdd02 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/CashierOrderServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/CashierOrderServiceImpl.java
@@ -1,5 +1,6 @@
 package com.fuint.business.order.service.impl;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.excel.EasyExcel;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -73,7 +74,13 @@ public class CashierOrderServiceImpl extends ServiceImpl<CashierOrderMapper, Cas
 
     @Override
     public int insertCashierOrder(CashierOrder order) {
-        int row = baseMapper.insert(order);
+        CashierOrder cashierOrder = this.selectCashierOrder(order.getOrderNo());
+        int row = 0;
+        if (ObjectUtil.isNotEmpty(cashierOrder)){
+            row = 0;
+            return row;
+        }
+        row = baseMapper.insert(order);
         return row;
     }
 
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 9f3a99cb4..3ca918090 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
@@ -13,6 +13,7 @@ import com.fuint.api.fuyou.entity.ReceiveParameter;
 import com.fuint.api.fuyou.service.FyPayService;
 import com.fuint.api.fuyou.service.MerchantConfigService;
 import com.fuint.api.fuyou.service.OilConfigService;
+import com.fuint.business.commission.service.StaffCommissionService;
 import com.fuint.business.convenienceSore.entity.LJGoods;
 import com.fuint.business.convenienceSore.service.LJGoodsService;
 import com.fuint.business.marketingActivity.cardFule.entity.CardFuelRecord;
@@ -89,6 +90,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
     private OilConfigService oilConfigService;
     @Autowired
     private LJGoodsService goodsService;
+    @Autowired
+    private StaffCommissionService staffCommissionService;
 
     @Override
     public IPage<OilOrder> selectOilOrderList(Page page, OilOrder order) {
@@ -245,8 +248,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
             payStatus = "unpaid";
         }
 
-
-
         Map<String,Object> orders = new HashMap<>();
 
         OilOrder oilOrder1 = null;
@@ -278,6 +279,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
             ljOrder.setStaffId(staffId);
             ljOrder.setStatus(payStatus);
             if (payType.equals("CASH")){
+                staffCommissionService.countStaffCommission(staffId,storeId,goodsAmount,goodsActualPay,0.0,"商品",orderNo);
                 ljOrder.setPayTime(new Date());
             }
 //        将商品订单的json数据转换为数组
@@ -309,28 +311,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
             ljOrder1 = orderService.selectGoodsOrder(orderNo);
         }
 
-//        添加收银台订单信息
-        CashierOrder cashierOrder = new CashierOrder();
-        cashierOrder.setStaffId(staffId);
-        cashierOrder.setStoreId(storeId);
-        cashierOrder.setPayUser(payUser);
-        cashierOrder.setAmount(oilAmount+goodsAmount);
-        cashierOrder.setStatus(payStatus);
-        if (payType.equals("CASH")){
-            cashierOrder.setPayAmount(Double.valueOf(map.get("authCode")));
-            cashierOrder.setPayTime(new Date());
-            this.insertAllOrderInfo(orderNo,storeId,Double.valueOf(map.get("allAmount")),payType,userId,"PC","6","paid");
-        }else {
-            cashierOrder.setPayAmount(oilActualPay+goodsActualPay);
-        }
-        cashierOrder.setSeekZero(seekZero);
-        cashierOrder.setOrderNo(orderNo);
-        cashierOrder.setGoodsOrderAmount(goodsAmount);
-        cashierOrder.setGoodsDiscountAmount(goodsDiscount);
-        cashierOrder.setOilOrderAmount(oilAmount);
-        cashierOrder.setOilDiscountAmount(oilDiscount);
-        cashierOrder.setTerminal(terminal);
-        cashierOrder.setPayType(payType);
+        Double oilLiters = 0.0;
 
 //        添加油品订单信息
         if (!oilOrder.equals("[]")){
@@ -341,11 +322,15 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
                 Double amount = Double.valueOf(jsonObjects.get(i).get("amount").toString());
                 Double oilPrice = Double.valueOf(jsonObjects.get(i).get("oilPrice").toString());
                 Double oilNum = amount/oilPrice;
+                oilLiters += oilNum;
                 if (i==0){
                     order.setOrderType("主订单");
                     order.setOrderAmount(amount);
                     order.setPayAmount(oilActualPay);
                     order.setOrderNo(orderNo);
+                    if (payType.equals("CASH")){
+                        staffCommissionService.countStaffCommission(staffId,storeId,oilAmount,oilActualPay,oilLiters,"油品",orderNo);
+                    }
                 }else {
                     order.setOrderType("子订单");
                     order.setOrderAmount(amount);
@@ -384,6 +369,29 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
             }
         }
 
+//        添加收银台订单信息
+        CashierOrder cashierOrder = new CashierOrder();
+        cashierOrder.setStaffId(staffId);
+        cashierOrder.setStoreId(storeId);
+        cashierOrder.setPayUser(payUser);
+        cashierOrder.setAmount(oilAmount+goodsAmount);
+        cashierOrder.setStatus(payStatus);
+        if (payType.equals("CASH")){
+            cashierOrder.setPayAmount(Double.valueOf(map.get("authCode")));
+            cashierOrder.setPayTime(new Date());
+            this.insertAllOrderInfo(orderNo,storeId,Double.valueOf(map.get("allAmount")),payType,userId,"PC","6","paid");
+        }else {
+            cashierOrder.setPayAmount(oilActualPay+goodsActualPay);
+        }
+        cashierOrder.setSeekZero(seekZero);
+        cashierOrder.setOrderNo(orderNo);
+        cashierOrder.setGoodsOrderAmount(goodsAmount);
+        cashierOrder.setGoodsDiscountAmount(goodsDiscount);
+        cashierOrder.setOilOrderAmount(oilAmount);
+        cashierOrder.setOilDiscountAmount(oilDiscount);
+        cashierOrder.setTerminal(terminal);
+        cashierOrder.setPayType(payType);
+
 //        如果金额不等于0调用第三方支付接口
         if (!map.get("allAmount").equals("0") && !map.get("payType").equals("CASH")){
             Integer allAmount = (int) (Double.valueOf(map.get("allAmount"))*100);
@@ -505,6 +513,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
                             //            添加收银台订单信息
                     CashierOrder cashierOrder = new CashierOrder();
                     boolean flag = false;
+                    Double oilLiters = 0.0;
                     for (int i = 0;i < oilOrders.size();i++) {
                         if (oilOrders.get(i).get("oilName").equals(oilName.getId().toString())){
                             Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
@@ -513,6 +522,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
                                 flag = true;
                                 status = "paid";
                                 Double oilNum = amount / oilPrice;
+                                oilLiters += oilNum;
                                 if (i == 0) {
                                     order.setOrderType("主订单");
                                     order.setOrderAmount(amount);
@@ -549,6 +559,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
                                 flag = true;
                                 status = "paid";
                                 Double oilNum = amount / oilPrice;
+                                oilLiters += oilNum;
                                 if (i == 0) {
                                     order.setOrderType("主订单");
                                     order.setOrderAmount(amount);
@@ -585,6 +596,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
                                 flag = true;
                                 status = "paid";
                                 Double oilNum = amount / oilPrice;
+                                oilLiters += oilNum;
                                 if (i == 0) {
                                     order.setOrderType("主订单");
                                     order.setOrderAmount(amount);
@@ -617,7 +629,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
                                 oilOrder = this.selectOilOrderByOrderNo(orderNo);
                                 this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
 //                                this.insertCardBalance((Double.valueOf(oilOrders.get(i).get("liters").toString())-refuelMoneyLiters)*oilPrice,userId,storeId);
-
                             }else {
                                 res.put("error","囤油卡或储值卡余额不足!");
                             }
@@ -642,6 +653,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
                         cashierOrder.setPayType(map.get("payType"));
                         cashierOrderService.insertCashierOrder(cashierOrder);
                         this.insertAllOrderInfo(orderNo, storeId, oilAmount, map.get("payType"), userId, "PC", "1", status);
+                        staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")),storeId,oilAmount,oilAmount,oilLiters,"油品",orderNo);
                         res.put("success","success");
                     }
                 }
@@ -650,10 +662,12 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
                 if (cardBalance>=oilAmount){
 //       添加油品订单信息
                     OilOrder order = new OilOrder();
+                    Double oilLiters = 0.0;
                     for (int i = 0;i < oilOrders.size();i++) {
                         Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
                         Double oilPrice = Double.valueOf(oilOrders.get(i).get("oilPrice").toString());
                         Double oilNum = amount / oilPrice;
+                        oilLiters += oilNum;
                         if (i == 0) {
                             order.setOrderType("主订单");
                             order.setOrderAmount(amount);
@@ -704,7 +718,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
                     cashierOrderService.insertCashierOrder(cashierOrder);
                     this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
                     this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"PC","1","paid");
-
+                    staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")),storeId,oilAmount,oilAmount,oilLiters,"油品",orderNo);
 //                    this.insertCardBalance(oilAmount,userId,storeId);
                     res.put("success","success");
                 }else {
@@ -997,6 +1011,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
             this.updateGrowthValue(payAmount,userId, Integer.valueOf(oilOrder.getOils()),oilCardAmount,oilOrder.getStoreId(),orderNo);
             this.addOilTracks(oilOrder,oilOrder.getStoreId());
             this.insertCardOrder(oilOrder.getUserId(),oilOrder.getStoreId(),orderNo,oilOrder.getOrderAmount(),"paid", Double.valueOf(balanceAmount),payAmount);
+            staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getOrderAmount(),oilOrder.getOilNum(),"油品",orderNo);
             oilOrder.setPayAmount(payAmount);
             oilOrder.setDiscountAmount(Double.valueOf(discountAmount));
             oilOrder.setPayTime(new Date());
@@ -1067,6 +1082,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
                 }
                 this.updateGrowthValue(oilOrder.getPayAmount(),userId, Integer.valueOf(oilOrder.getOils()),null,oilOrder.getStoreId(),orderNo);
                 this.addOilTracks(oilOrder,oilOrder.getStoreId());
+                staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),oilOrder.getOilNum(),"油品",orderNo);
                 CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
                 if (ObjectUtil.isNotEmpty(cashierOrder)){
                     cashierOrder.setOilOrderId(oilOrder.getId());