From f5330be2103f426e8e68c05bbe0b1e413c80b039 Mon Sep 17 00:00:00 2001 From: jiangyunjie Date: Sun, 26 Apr 2020 16:49:23 +0800 Subject: [PATCH] app --- .../mapper/StorePromotionDataDOMapper.java | 4 +- .../service/StorePromotionDataService.java | 10 +-- .../OpSellerCustomerRelationDOMapper.xml | 1 + .../mapper/StorePromotionDataDOMapper.xml | 68 +++++++++++-------- 4 files changed, 50 insertions(+), 33 deletions(-) diff --git a/src/main/java/com/kiisoo/ic/store/mapper/StorePromotionDataDOMapper.java b/src/main/java/com/kiisoo/ic/store/mapper/StorePromotionDataDOMapper.java index e3ddf78..97a35be 100644 --- a/src/main/java/com/kiisoo/ic/store/mapper/StorePromotionDataDOMapper.java +++ b/src/main/java/com/kiisoo/ic/store/mapper/StorePromotionDataDOMapper.java @@ -187,8 +187,10 @@ public interface StorePromotionDataDOMapper { * 查询店铺排名 * @param startDate * @param endDate + * @param storeId * @return */ List selectStaffRankNo(@Param("startDate") Date startDate, - @Param("endDate") Date endDate); + @Param("endDate") Date endDate, + @Param("storeId") Long storeId); } diff --git a/src/main/java/com/kiisoo/ic/store/service/StorePromotionDataService.java b/src/main/java/com/kiisoo/ic/store/service/StorePromotionDataService.java index 2151987..eabd26d 100644 --- a/src/main/java/com/kiisoo/ic/store/service/StorePromotionDataService.java +++ b/src/main/java/com/kiisoo/ic/store/service/StorePromotionDataService.java @@ -315,13 +315,13 @@ public class StorePromotionDataService { Integer newCusNumLast = null; Integer rankNo = null; Integer differFromChampion = null; + Long storeId = storePromotionDataDOMapper.selectStoreIdByUserId(userId); + if (storeId == null) { + return storePromotionDataDO; + } switch (roleCode) { // 店长 case Constants.WX_USER_ROLE_SHOP_MANAGER: - Long storeId = storePromotionDataDOMapper.selectStoreIdByUserId(userId); - if (storeId == null) { - break; - } cusNum = storePromotionDataDOMapper.selectWxSumCusNumByCondition(null, storeId, null, null, Constants.STORE_SELLER_CUS_RELATION_TYPE_VALID); newCusNum = storePromotionDataDOMapper.selectWxSumCusNumByCondition(null, storeId, startDate, endDate, Constants.STORE_SELLER_CUS_RELATION_TYPE_VALID); newCusNumLast = storePromotionDataDOMapper.selectWxSumCusNumByCondition(null, storeId, lastStartDate, lastEndDate, Constants.STORE_SELLER_CUS_RELATION_TYPE_VALID); @@ -367,7 +367,7 @@ public class StorePromotionDataService { newCusNum = storePromotionDataDOMapper.selectWxSumCusNumByCondition(userId, null, startDate, endDate, null); newCusNumLast = storePromotionDataDOMapper.selectWxSumCusNumByCondition(userId, null, lastStartDate, lastEndDate, null); // 店铺排名 - List staffRankNoList = storePromotionDataDOMapper.selectStaffRankNo(startDate, endDate); + List staffRankNoList = storePromotionDataDOMapper.selectStaffRankNo(startDate, endDate, storeId); if (CollectionUtils.isNotEmpty(staffRankNoList)) { for (int i = 0; i < staffRankNoList.size(); i++) { if (staffRankNoList.get(i).getUserId().equals(userId.toString())) { diff --git a/src/main/resources/mapper/OpSellerCustomerRelationDOMapper.xml b/src/main/resources/mapper/OpSellerCustomerRelationDOMapper.xml index 7308155..b7ae0c0 100644 --- a/src/main/resources/mapper/OpSellerCustomerRelationDOMapper.xml +++ b/src/main/resources/mapper/OpSellerCustomerRelationDOMapper.xml @@ -49,6 +49,7 @@ and DATE_FORMAT(t1.create_time,'%Y-%m-%d') <= DATE_FORMAT(#{endDate},'%Y-%m-%d') + order by t1.create_time desc