|
|
|
@ -22,7 +22,10 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.Comparator;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -295,6 +298,9 @@ public class StorePromotionDataService {
|
|
|
|
|
// 店长
|
|
|
|
|
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);
|
|
|
|
@ -330,8 +336,8 @@ public class StorePromotionDataService {
|
|
|
|
|
});
|
|
|
|
|
if (CollectionUtils.isNotEmpty(staffDOList)) {
|
|
|
|
|
// 总客户数降序
|
|
|
|
|
staffDOList.stream().sorted(Comparator.comparing(StaffDO::getCusNum, Comparator.nullsLast(Integer::compareTo))).findFirst().get();
|
|
|
|
|
storePromotionDataDO.setStaffDOList(staffDOList);
|
|
|
|
|
List<StaffDO> staffFinalList = staffDOList.stream().sorted(Comparator.comparing(StaffDO::getCusNum, Comparator.nullsFirst(Integer::compareTo)).reversed()).collect(Collectors.toList());
|
|
|
|
|
storePromotionDataDO.setStaffDOList(staffFinalList);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
// 导购
|
|
|
|
@ -343,7 +349,7 @@ public class StorePromotionDataService {
|
|
|
|
|
List<StorePromotionDataDO> staffRankNoList = storePromotionDataDOMapper.selectStaffRankNo(startDate, endDate);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(staffRankNoList)) {
|
|
|
|
|
for (int i = 0; i < staffRankNoList.size(); i++) {
|
|
|
|
|
if (staffRankNoList.get(i).getUserId().equals(userId)) {
|
|
|
|
|
if (staffRankNoList.get(i).getUserId().equals(userId.toString())) {
|
|
|
|
|
rankNo = staffRankNoList.get(i).getRankNo();
|
|
|
|
|
Integer curNewCusNum = staffRankNoList.get(i).getNewCusNum();
|
|
|
|
|
Integer championNewCusNum = staffRankNoList.get(0).getNewCusNum();
|
|
|
|
|