fanzherong_v před 2 měsíci
rodič
revize
43e0043d12

+ 3 - 3
snowy-admin-web/src/views/biz/statisty/total.vue

@@ -151,7 +151,7 @@
 					<template #tab>
 						<span>
 						<HddOutlined />
-						优惠券列表
+						蛋糕券列表
 						</span>
 					</template>
 					<div id="printForm2">
@@ -334,12 +334,12 @@
 
 	const columns2 = [
 		{
-			title: '优惠券编码',
+			title: '蛋糕券编码',
 			dataIndex: 'couponNo',
 			align: 'center',
 		},
 		{
-			title: '优惠券生成时间',
+			title: '蛋糕券生成时间',
 			dataIndex: 'time',
 			align: 'center',
 		},

+ 2 - 2
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/consumptionrecord/mapper/ConsumptionRecordMapper.java

@@ -42,12 +42,12 @@ public interface ConsumptionRecordMapper extends BaseMapper<ConsumptionRecord> {
 
     UserBalanceResult queryBalanceTotal(@Param("ew") QueryWrapper<ConsumptionRecord> ew);
 
-    List<Map<String,Object>> queryConsumptionChart(@Param("ew") QueryWrapper<ConsumptionRecord> ew);
+    List<Map<String,Object>> queryConsumptionChart(@Param("ew") QueryWrapper<ConsumptionRecord> ew,@Param("orgList") List<String> orgList);
 
     List<Map<String,Object>> queryRechargeChar(@Param("ew") QueryWrapper<ConsumptionRecord> ew);
 
 
-    List<Map<String,Object>> queryEachStore(@Param("orgIds") List<String> orgIds,@Param("startTime") String startTime, @Param("endTime") String endTime);
+    List<Map<String,Object>> queryEachStore(@Param("orgIds") List<String> orgIds,@Param("startTime") String startTime, @Param("endTime") String endTime,@Param("orgList") List<String> orgList);
 
 
 }

+ 12 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/consumptionrecord/mapper/mapping/ConsumptionRecordMapper.xml

@@ -84,6 +84,12 @@
                 WHERE
                     bcr.delete_flag = 'NOT_DELETE'
                 and bcr.consumption_operate in('3','4')
+                <if test="orgList != null and orgList.size > 0">
+                    AND bcr.consumption_org IN
+                    <foreach collection="orgList" item="item" separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
+                </if>
                 GROUP BY
                     LEFT ( bcr.consumption_time, 10 )
                 ORDER BY
@@ -152,6 +158,12 @@
                 GROUP BY su.ORG_ID ) su ON su.ORG_ID = so.id
             where so.PARENT_ID!=0
             and so.DELETE_FLAG = 'NOT_DELETE'
+            <if test="orgList != null and orgList.size > 0">
+                AND so.ID IN
+                <foreach collection="orgList" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
     </select>
 
     <select id="getWarnPageList" resultType="vip.xiaonuo.biz.modular.user.result.BizMemberUserResult">

+ 19 - 2
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/consumptionrecord/service/impl/ConsumptionRecordServiceImpl.java

@@ -470,6 +470,11 @@ public class ConsumptionRecordServiceImpl extends ServiceImpl<ConsumptionRecordM
         if(ObjectUtil.isNotEmpty(consumptionRecordPageParam.getConsumptionTimeBegin()) && ObjectUtil.isNotEmpty(consumptionRecordPageParam.getConsumptionTimeEnd())){
             queryWrapper.between("bcr.consumption_time",consumptionRecordPageParam.getConsumptionTimeBegin()+" 00:00:00",consumptionRecordPageParam.getConsumptionTimeEnd()+" 23:59:59");
         }
+        // 校验数据范围
+        List<String> loginUserDataScope = StpLoginUserUtil.getLoginUserDataScope();
+        if (ObjectUtil.isNotEmpty(loginUserDataScope)) {
+            queryWrapper.in("bcr.consumption_org", loginUserDataScope);
+        }
         queryWrapper.eq("bcr.DELETE_FLAG","NOT_DELETE");
         queryWrapper.in("bcr.consumption_operate","3","4");
         return this.getBaseMapper().getRecordTotal(queryWrapper);
@@ -520,7 +525,13 @@ public class ConsumptionRecordServiceImpl extends ServiceImpl<ConsumptionRecordM
         List<Integer> userCountList = Lists.newArrayList();
         Map<String,Object> result = Maps.newHashMap();
         QueryWrapper<ConsumptionRecord> queryWrapper = new QueryWrapper<>();
-        List<Map<String, Object>> mapList = this.getBaseMapper().queryConsumptionChart(queryWrapper);
+        // 校验数据范围
+        List<String> orgList = Lists.newArrayList();
+        List<String> loginUserDataScope = StpLoginUserUtil.getLoginUserDataScope();
+        if (ObjectUtil.isNotEmpty(loginUserDataScope)) {
+            orgList = loginUserDataScope;
+        }
+        List<Map<String, Object>> mapList = this.getBaseMapper().queryConsumptionChart(queryWrapper,orgList);
         for(Map<String,Object> map: mapList){
             timeList.add(MapUtils.getString(map,"dateTime"));
             moneyList.add(new BigDecimal(MapUtils.getString(map,"consumptionMoney")));
@@ -639,6 +650,12 @@ public class ConsumptionRecordServiceImpl extends ServiceImpl<ConsumptionRecordM
 
     public List<Map<String, Object>> getList(ConsumptionRecordPageParam consumptionRecordPageParam){
         List<String> orgIds = new ArrayList<>();
+        List<String> orgList = Lists.newArrayList();
+        // 校验数据范围
+        List<String> loginUserDataScope = StpLoginUserUtil.getLoginUserDataScope();
+        if (ObjectUtil.isNotEmpty(loginUserDataScope)) {
+            orgList = loginUserDataScope;
+        }
         if(ObjectUtil.isNotEmpty(consumptionRecordPageParam.getOrgId())){
             orgIds = Arrays.asList(consumptionRecordPageParam.getOrgId().split(","));
         }
@@ -650,7 +667,7 @@ public class ConsumptionRecordServiceImpl extends ServiceImpl<ConsumptionRecordM
         if(ObjectUtil.isNotEmpty(consumptionRecordPageParam.getConsumptionTimeEnd())){
             endTime = consumptionRecordPageParam.getConsumptionTimeEnd()+" 23:59:59";
         }
-        List<Map<String, Object>> mapList = this.getBaseMapper().queryEachStore(orgIds, startTime, endTime);
+        List<Map<String, Object>> mapList = this.getBaseMapper().queryEachStore(orgIds, startTime, endTime,orgList);
         return mapList;
     }
 

+ 1 - 1
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargerecord/param/BizRechargeRecordPageParam.java

@@ -60,6 +60,6 @@ public class BizRechargeRecordPageParam {
     @Schema(description = "充值时间结束")
     private String endRechargeTime;
 
-    private Boolean isPay;
+    private String isPay;
 
 }

+ 1 - 5
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/rechargerecord/service/impl/BizRechargeRecordServiceImpl.java

@@ -116,11 +116,7 @@ public class BizRechargeRecordServiceImpl extends ServiceImpl<BizRechargeRecordM
             queryWrapper.lambda().between(BizRechargeRecord::getRechargeTime, bizRechargeRecordPageParam.getStartRechargeTime(), bizRechargeRecordPageParam.getEndRechargeTime());
         }
         if (ObjectUtil.isNotEmpty(bizRechargeRecordPageParam.getIsPay())){
-            if(bizRechargeRecordPageParam.getIsPay()){
-                queryWrapper.lambda().eq(BizRechargeRecord::getIsPay,1);
-            }else{
-                queryWrapper.lambda().eq(BizRechargeRecord::getIsPay,0);
-            }
+            queryWrapper.lambda().eq(BizRechargeRecord::getIsPay,bizRechargeRecordPageParam.getIsPay());
         }
         queryWrapper.lambda().eq(BizRechargeRecord::getUserId, StpLoginUserUtil.getLoginUser().getId());
         queryWrapper.lambda().orderByDesc(BizRechargeRecord::getRechargeTime);