master
jiangyunjie 6 years ago
parent 5a2b013757
commit ca48dac3c8

@ -84,4 +84,9 @@ public class Constants {
* type * type
*/ */
public static final String BSD_REQ_QRCODE_TYPE_SELLER = "1"; public static final String BSD_REQ_QRCODE_TYPE_SELLER = "1";
/**
* 0
*/
public static final Integer CUS_NUM_ZERO = 0;
} }

@ -124,4 +124,9 @@ public class StorePromotionDataDO {
* *
*/ */
private Integer differFromChampion; private Integer differFromChampion;
/**
*
*/
private Date latestUpdate;
} }

@ -193,4 +193,11 @@ public interface StorePromotionDataDOMapper {
List<StorePromotionDataDO> selectStaffRankNo(@Param("startDate") Date startDate, List<StorePromotionDataDO> selectStaffRankNo(@Param("startDate") Date startDate,
@Param("endDate") Date endDate, @Param("endDate") Date endDate,
@Param("storeId") Long storeId); @Param("storeId") Long storeId);
/**
*
* @param storeId
* @return
*/
Date selectLatestUpdateTime(@Param("storeId") Long storeId);
} }

@ -322,9 +322,9 @@ public class StorePromotionDataService {
switch (roleCode) { switch (roleCode) {
// 店长 // 店长
case Constants.WX_USER_ROLE_SHOP_MANAGER: case Constants.WX_USER_ROLE_SHOP_MANAGER:
cusNum = storePromotionDataDOMapper.selectWxSumCusNumByCondition(null, storeId, null, null, Constants.STORE_SELLER_CUS_RELATION_TYPE_VALID); cusNum = storePromotionDataDOMapper.selectWxSumCusNumByCondition(null, storeId, null, null, null);
newCusNum = storePromotionDataDOMapper.selectWxSumCusNumByCondition(null, storeId, startDate, endDate, Constants.STORE_SELLER_CUS_RELATION_TYPE_VALID); newCusNum = storePromotionDataDOMapper.selectWxSumCusNumByCondition(null, storeId, startDate, endDate, null);
newCusNumLast = storePromotionDataDOMapper.selectWxSumCusNumByCondition(null, storeId, lastStartDate, lastEndDate, Constants.STORE_SELLER_CUS_RELATION_TYPE_VALID); newCusNumLast = storePromotionDataDOMapper.selectWxSumCusNumByCondition(null, storeId, lastStartDate, lastEndDate, null);
// 店铺排名 // 店铺排名
List<StorePromotionDataDO> storeRankNoList = storePromotionDataDOMapper.selectStoreRankNo(startDate, endDate); List<StorePromotionDataDO> storeRankNoList = storePromotionDataDOMapper.selectStoreRankNo(startDate, endDate);
if (CollectionUtils.isNotEmpty(storeRankNoList)) { if (CollectionUtils.isNotEmpty(storeRankNoList)) {
@ -350,9 +350,13 @@ public class StorePromotionDataService {
Long id = storeDO.getId(); Long id = storeDO.getId();
if (null != staffCusNumMap && staffCusNumMap.get(id) != null) { if (null != staffCusNumMap && staffCusNumMap.get(id) != null) {
storeDO.setCusNum(staffCusNumMap.get(id)); storeDO.setCusNum(staffCusNumMap.get(id));
} else {
storeDO.setCusNum(Constants.CUS_NUM_ZERO);
} }
if (null != staffNewCusNumMap && staffNewCusNumMap.get(id) != null) { if (null != staffNewCusNumMap && staffNewCusNumMap.get(id) != null) {
storeDO.setNewCusNum(staffNewCusNumMap.get(id)); storeDO.setNewCusNum(staffNewCusNumMap.get(id));
} else {
storeDO.setNewCusNum(Constants.CUS_NUM_ZERO);
} }
}); });
if (CollectionUtils.isNotEmpty(staffDOList)) { if (CollectionUtils.isNotEmpty(staffDOList)) {
@ -379,6 +383,10 @@ public class StorePromotionDataService {
} }
} }
} }
Date latestUpdate = storePromotionDataDOMapper.selectLatestUpdateTime(storeId);
if (null != latestUpdate) {
storePromotionDataDO.setLatestUpdate(latestUpdate);
}
break; break;
default: default:
break; break;

@ -3,6 +3,7 @@
<mapper namespace="com.kiisoo.ic.customer.mapper.OpSellerCustomerRelationDOMapper"> <mapper namespace="com.kiisoo.ic.customer.mapper.OpSellerCustomerRelationDOMapper">
<select id="selectShopListByDate" resultType="com.kiisoo.ic.customer.bean.FriendDTO"> <select id="selectShopListByDate" resultType="com.kiisoo.ic.customer.bean.FriendDTO">
SELECT SELECT
DISTINCT
t2.NAME AS customerName, t2.NAME AS customerName,
t2.id AS customerId, t2.id AS customerId,
t2.phone AS mobile, t2.phone AS mobile,

@ -400,6 +400,10 @@
GROUP BY userId ORDER BY newCusNum DESC ) a, GROUP BY userId ORDER BY newCusNum DESC ) a,
( SELECT @rank := 0 ) b ( SELECT @rank := 0 ) b
</select> </select>
<select id="selectLatestUpdateTime" resultType="java.util.Date">
select max(create_time) from op_seller_customer_relation where store_id = #{storeId}
order by create_time desc
</select>
</mapper> </mapper>

Loading…
Cancel
Save