|
|
|
@@ -4,8 +4,10 @@ import com.iformall.common.CommonConstant; |
|
|
|
import com.iformall.domain.dto.cockpit.CountShopByStatusDTO; |
|
|
|
import com.iformall.domain.dto.cockpit.CountUserByGenderDTO; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.domain.vo.cockpit.CountMonthVO; |
|
|
|
import com.iformall.domain.vo.cockpit.CountShopVO; |
|
|
|
import com.iformall.domain.vo.cockpit.CountUserGenderVO; |
|
|
|
import com.iformall.domain.vo.cockpit.MonthDataVO; |
|
|
|
import com.iformall.enums.EnumShopStatus; |
|
|
|
import com.iformall.enums.EnumUserGender; |
|
|
|
import com.iformall.mapper.WxCUserBasicInfoMapper; |
|
|
|
@@ -13,14 +15,14 @@ import com.iformall.mapper.WxShopMapper; |
|
|
|
import com.iformall.service.CockpitScreenService; |
|
|
|
import com.iformall.service.WxCUserBasicInfoService; |
|
|
|
import com.iformall.service.WxMallService; |
|
|
|
import com.iformall.utils.DateUtils; |
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
@@ -96,4 +98,36 @@ public class CockpitScreenServiceImpl implements CockpitScreenService { |
|
|
|
result.setUnRentedShopCountRatio(BigDecimal.ONE.subtract(rentedShopCountRatio)); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<CountMonthVO> countUser(TenantEntity tenantInfo, List<Integer> years) { |
|
|
|
if (CollectionUtils.isEmpty(years)) { |
|
|
|
years.add(DateUtils.getYear(new Date())); |
|
|
|
} |
|
|
|
|
|
|
|
List<CountMonthVO> result = new ArrayList<>(); |
|
|
|
years.forEach(year -> { |
|
|
|
CountMonthVO countMonthVO = new CountMonthVO(); |
|
|
|
List<MonthDataVO> vos = new ArrayList<>(); |
|
|
|
for (int i = 0; i < 12; i++) { |
|
|
|
MonthDataVO vo = new MonthDataVO(); |
|
|
|
vo.setMonth(i + 1); |
|
|
|
Integer count = cUserBasicInfoMapper.countUserByMonth(tenantInfo.getFinalTenantId(), year, i + 1); |
|
|
|
vo.setCount(count); |
|
|
|
vos.add(vo); |
|
|
|
} |
|
|
|
countMonthVO.setYear(year); |
|
|
|
countMonthVO.setMonths(vos); |
|
|
|
result.add(countMonthVO); |
|
|
|
}); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<CountMonthVO> countReachUser(TenantEntity tenantInfo, List<Integer> years) { |
|
|
|
if (CollectionUtils.isEmpty(years)) { |
|
|
|
years.add(DateUtils.getYear(new Date())); |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |