master
jiangyunjie 6 years ago
parent 5a2b013757
commit ca48dac3c8

@ -84,4 +84,9 @@ public class Constants {
* type
*/
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 Date latestUpdate;
}

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

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

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

@ -400,6 +400,10 @@
GROUP BY userId ORDER BY newCusNum DESC ) a,
( SELECT @rank := 0 ) b
</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>

Loading…
Cancel
Save