| | |
| | | List<InoutRecord> yearList = inoutRecordMapper.selectJoinList(InoutRecord.class,new MPJLambdaWrapper<InoutRecord>() |
| | | .selectAll(InoutRecord.class) |
| | | .eq(InoutRecord::getIsdeleted,Constants.ZERO) |
| | | .eq(InoutRecord::getInOrOut,Constants.ZERO) |
| | | .isNotNull(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO),InoutRecord::getCarCode) |
| | | .isNotNull(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ONE),InoutRecord::getMemberPhone) |
| | | .apply(" ( DATE_FORMAT(CREATE_DATE, '%Y') = DATE_FORMAT(now(), '%Y') ) ") |
| | | .orderByAsc(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO),InoutRecord::getCarBizType) |
| | | .orderByAsc(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ONE),InoutRecord::getMemberType) |
| | | ); |
| | | List<InoutRecord> monthList = yearList.stream().filter(i->DateUtil.formatDate(i.getCreateDate(),"yyyy-MM").equals(DateUtil.formatDate(new Date(),"yyyy-MM"))).collect(Collectors.toList()); |
| | | List<InoutRecord> weekList = yearList.stream().filter(i->i.getCreateDate().getTime()>=weekStart).collect(Collectors.toList()); |
| | |
| | | GeneralDataVO generalDataVO = new GeneralDataVO(); |
| | | generalDataVO.setName(userTypeList[i]); |
| | | int index = i; |
| | | generalDataVO.setTotal(yearList.stream().filter(j->Constants.equalsInteger(j.getType(), index)).collect(Collectors.toList()).size()); |
| | | generalDataVO.setTotal(yearList.stream().filter(j->Constants.equalsInteger(j.getMemberType(), index)).collect(Collectors.toList()).size()); |
| | | yearSortList.add(generalDataVO); |
| | | } |
| | | }else{ |
| | |
| | | List<InoutRecord> yearList = inoutRecordMapper.selectJoinList(InoutRecord.class,new MPJLambdaWrapper<InoutRecord>() |
| | | .selectAll(InoutRecord.class) |
| | | .eq(InoutRecord::getIsdeleted,Constants.ZERO) |
| | | .eq(InoutRecord::getInOrOut,Constants.ZERO) |
| | | .isNotNull(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO),InoutRecord::getCarCode) |
| | | .isNotNull(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ONE),InoutRecord::getMemberPhone) |
| | | .apply(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),4)," ( DATE_FORMAT(CREATE_DATE, '%Y') = '"+inParkDataDTO.getDateStr()+"' ) ") |
| | |
| | | GeneralDataVO generalDataVO = new GeneralDataVO(); |
| | | generalDataVO.setName(userTypeList[i]); |
| | | int index = i; |
| | | generalDataVO.setTotal(yearList.stream().filter(j->Constants.equalsInteger(j.getType(), index)).collect(Collectors.toList()).size()); |
| | | generalDataVO.setTotal(yearList.stream().filter(j->Constants.equalsInteger(j.getMemberType(), index)).collect(Collectors.toList()).size()); |
| | | generalDataVO.setRata(new BigDecimal(generalDataVO.getTotal().toString()).divide(new BigDecimal(yearList.size()+""),2,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))); |
| | | rataList.add(generalDataVO); |
| | | } |
| | |
| | | List<InoutRecord> allList = inoutRecordMapper.selectJoinList(InoutRecord.class,new MPJLambdaWrapper<InoutRecord>() |
| | | .selectAll(InoutRecord.class) |
| | | .eq(InoutRecord::getIsdeleted,Constants.ZERO) |
| | | .eq(InoutRecord::getInOrOut,Constants.ZERO) |
| | | .isNotNull(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO),InoutRecord::getCarCode) |
| | | .isNotNull(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ONE),InoutRecord::getMemberPhone) |
| | | .apply(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),4)," ( DATE_FORMAT(CREATE_DATE, '%Y') = '"+inParkDataDTO.getDateStr()+"' ) ") |
| | |
| | | if(Constants.equalsInteger(DateUtil.getNowYearNum(),Integer.valueOf(inParkDataDTO.getDateStr()))){ |
| | | maxMonth = DateUtil.getNowMonthNum(); |
| | | } |
| | | for (int i = 1; i <= maxMonth; i++) { |
| | | for (int i = maxMonth; i >=0 ; i--) { |
| | | dateList.add(DateUtil.getNowYearNum()+"-"+ StringUtils.leftPad(i+"",2,"0")); |
| | | } |
| | | }else { |
| | | //日期 |
| | | Integer year = Integer.valueOf(inParkDataDTO.getDateStr().substring(0,4)); |
| | | Integer month = Integer.valueOf(inParkDataDTO.getDateStr().substring(5,6)); |
| | | Integer month = Integer.valueOf(inParkDataDTO.getDateStr().substring(5,7)); |
| | | Integer today = DateUtil.getNowDayNum(); |
| | | YearMonth yearMonth = YearMonth.of(year, month); |
| | | // 获取该月的最后一天 |
| | | LocalDate lastDayDate = yearMonth.atEndOfMonth(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd"); |
| | | Integer lastDay = Integer.valueOf(lastDayDate.format(formatter)); |
| | | if(Constants.equalsInteger(year,DateUtil.getNowYearNum()) && Constants.equalsInteger(month,DateUtil.getNowMonthNum())){ |
| | | if(today < lastDay){ |
| | | lastDay = today; |
| | | } |
| | | } |
| | | for (int i = 1; i <= lastDay; i++) { |
| | | dateList.add(year + "-" + StringUtils.leftPad(month.toString(),2,"0") + "-" + StringUtils.leftPad(lastDay.toString(),2,"0")); |
| | | for (int i = lastDay; i >= 0 ; i--) { |
| | | dateList.add(year + "-" + StringUtils.leftPad(month.toString(),2,"0") + "-" + StringUtils.leftPad(Integer.toString(i),2,"0")); |
| | | } |
| | | } |
| | | return this.dealResultData(allList,dateList,inParkDataDTO.getType(),inParkDataDTO.getDateStr()); |
| | |
| | | continue; |
| | | } |
| | | totalString.add(userTypeList[j]); |
| | | totalString.add("合计"); |
| | | resultList.add(totalString); |
| | | } |
| | | Integer total = 0; |
| | | totalString.add("合计"); |
| | | resultList.add(totalString); |
| | | for (String str:dataList) { |
| | | for (String typeName:userTypeList) { |
| | | List<String> dataChildList = new ArrayList<>(); |
| | | dataChildList.add(str); |
| | | Integer total = 0; |
| | | List<String> dataChildList = new ArrayList<>(); |
| | | dataChildList.add(str); |
| | | for (int i = 0; i < userTypeList.length; i++) { |
| | | String typeName = userTypeList[i]; |
| | | if(StringUtils.isBlank(typeName)){ |
| | | continue; |
| | | } |
| | | int finalI = i; |
| | | if(Constants.equalsInteger(dateStr.length(),4)){ |
| | | Integer childNum = allList.stream().filter(i->typeName.equals(i.getCategoryName()) |
| | | && DateUtil.formatDate(i.getCreateDate(),"yyyy-MM").equals(str)).collect(Collectors.toList()).size(); |
| | | Integer childNum = allList.stream().filter(j->Constants.equalsInteger(j.getMemberType(), finalI) |
| | | && DateUtil.formatDate(j.getCreateDate(),"yyyy-MM").equals(str)).collect(Collectors.toList()).size(); |
| | | dataChildList.add( |
| | | Integer.toString(childNum) |
| | | ); |
| | | total = total + childNum; |
| | | }else if(Constants.equalsInteger(dateStr.length(),7)){ |
| | | Integer childNum = allList.stream().filter(i->typeName.equals(i.getCategoryName()) |
| | | &&DateUtil.formatDate(i.getCreateDate(),"yyyy-MM-dd").equals(str)).collect(Collectors.toList()).size(); |
| | | Integer childNum = allList.stream().filter(j->Constants.equalsInteger(j.getMemberType(), finalI) |
| | | &&DateUtil.formatDate(j.getCreateDate(),"yyyy-MM-dd").equals(str)).collect(Collectors.toList()).size(); |
| | | dataChildList.add( |
| | | Integer.toString(childNum) |
| | | ); |
| | | total = total + childNum; |
| | | } |
| | | dataChildList.add(Integer.toString(total)); |
| | | resultList.add(dataChildList); |
| | | } |
| | | dataChildList.add(Integer.toString(total)); |
| | | resultList.add(dataChildList); |
| | | } |
| | | } |
| | | return resultList; |