| @@ -1072,32 +1072,28 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| private ResultData getCarNewMemberCountInWeek(TenantEntity tenantEntity) { | private ResultData getCarNewMemberCountInWeek(TenantEntity tenantEntity) { | ||||
| // List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| HashMap<String, Object> weekParams = new HashMap<>(); | |||||
| // weekParams.put("tenantEntitys", tenantEntitys); | |||||
| weekParams.put("tenantId", tenantEntity.getTenantId()); | |||||
| weekParams.put("finalTenantId", tenantEntity.getFinalTenantId()); | |||||
| if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | |||||
| weekParams.put("parentTenantId", tenantEntity.getParentTenantId()); | |||||
| } | |||||
| String oneWeekStartdate = DateUtils.getTimeBefore(7, new Date()); | String oneWeekStartdate = DateUtils.getTimeBefore(7, new Date()); | ||||
| String oneWeekEndDate = DateUtils.getTimeBefore(1, new Date()); | String oneWeekEndDate = DateUtils.getTimeBefore(1, new Date()); | ||||
| weekParams.put("startdate", oneWeekStartdate + " 00:00:00"); | |||||
| weekParams.put("enddate", oneWeekEndDate + " 23:59:59"); | |||||
| weekParams.put("cmdType", EnumCarCmd.CAR_ETCP_CALLBACK_PAY_MANUAL.getCode()); | |||||
| List<Map<String, Object>> carCountHistory = wxCUserCarMapper.queryCarCountHistory(weekParams); | |||||
| Map<String, Object> weekCarCollect = carCountHistory.stream().collect(Collectors.toMap(m -> { | |||||
| return (String) m.get("create_time"); | |||||
| WxChartDataEntity chartData = new WxChartDataEntity(); | |||||
| chartData.updateTenantInfo(tenantEntity); | |||||
| chartData.setType(EnumChartType.CAR_NEW_MEMBER.getCode()); | |||||
| chartData.setStartTime(DateUtils.stringToDate(oneWeekStartdate)); | |||||
| chartData.setEndTime(DateUtils.stringToDate(oneWeekEndDate)); | |||||
| List<WxChartDataEntity> list = wxChartDataMapper.findList(chartData); | |||||
| Map<String, String> collect = list.stream().collect(Collectors.toMap(m -> { | |||||
| return new SimpleDateFormat("yyyy-MM-dd").format(m.getQuerytime()); | |||||
| }, m -> { | }, m -> { | ||||
| return m.get("count"); | |||||
| return m.getResult(); | |||||
| })); | })); | ||||
| List<String> days = DateUtils.getTjTimeList(oneWeekStartdate, oneWeekEndDate, "0"); | List<String> days = DateUtils.getTjTimeList(oneWeekStartdate, oneWeekEndDate, "0"); | ||||
| List<String> timeList = new ArrayList<>(); | List<String> timeList = new ArrayList<>(); | ||||
| List<Object> valList = new ArrayList<>(); | List<Object> valList = new ArrayList<>(); | ||||
| for (String date : days) { | for (String date : days) { | ||||
| String newdate = date.substring(5, date.length()).replace("-", "/"); | String newdate = date.substring(5, date.length()).replace("-", "/"); | ||||
| Object o = weekCarCollect.get(newdate); | |||||
| Object o = collect.get(date); | |||||
| timeList.add(newdate); | timeList.add(newdate); | ||||
| if (o == null) { | if (o == null) { | ||||
| valList.add(0L); | valList.add(0L); | ||||