首页接口

master
jiangyunjie 6 years ago
parent 28541c3216
commit 2aec41eaff

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

Loading…
Cancel
Save