| | |
| | | import com.doumee.dao.business.dto.InParkDataDTO; |
| | | import com.doumee.dao.business.model.Category; |
| | | import com.doumee.dao.business.model.InoutRecord; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.business.vo.GeneralDataVO; |
| | | import com.doumee.dao.business.vo.InParkUserDataVO; |
| | | import com.doumee.service.business.InoutRecordService; |
| | |
| | | @Override |
| | | public PageData<InoutRecord> findPage(PageWrap<InoutRecord> pageWrap) { |
| | | IPage<InoutRecord> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<InoutRecord> queryWrapper = new QueryWrapper<>(); |
| | | MPJLambdaWrapper<InoutRecord> queryWrapper = new MPJLambdaWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getId, pageWrap.getModel().getId()); |
| | | } |
| | | if (pageWrap.getModel().getCreator() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCreator, pageWrap.getModel().getCreator()); |
| | | } |
| | | if (pageWrap.getModel().getCreateDate() != null) { |
| | | queryWrapper.lambda().ge(InoutRecord::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate())); |
| | | queryWrapper.lambda().le(InoutRecord::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate())); |
| | | } |
| | | if (pageWrap.getModel().getEditor() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getEditor, pageWrap.getModel().getEditor()); |
| | | } |
| | | if (pageWrap.getModel().getEditDate() != null) { |
| | | queryWrapper.lambda().ge(InoutRecord::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate())); |
| | | queryWrapper.lambda().le(InoutRecord::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate())); |
| | | } |
| | | if (pageWrap.getModel().getIsdeleted() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getIsdeleted, pageWrap.getModel().getIsdeleted()); |
| | | } |
| | | if (pageWrap.getModel().getRemark() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getRemark, pageWrap.getModel().getRemark()); |
| | | } |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getType, pageWrap.getModel().getType()); |
| | | } |
| | | if (pageWrap.getModel().getHkEventId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getHkEventId, pageWrap.getModel().getHkEventId()); |
| | | } |
| | | if (pageWrap.getModel().getHkId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getHkId, pageWrap.getModel().getHkId()); |
| | | } |
| | | if (pageWrap.getModel().getMemberId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getMemberId, pageWrap.getModel().getMemberId()); |
| | | } |
| | | if (pageWrap.getModel().getCarId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCarId, pageWrap.getModel().getCarId()); |
| | | } |
| | | if (pageWrap.getModel().getCategoryId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCategoryId, pageWrap.getModel().getCategoryId()); |
| | | } |
| | | if (pageWrap.getModel().getCategoryName() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCategoryName, pageWrap.getModel().getCategoryName()); |
| | | } |
| | | if (pageWrap.getModel().getCarBizType() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCarBizType, pageWrap.getModel().getCarBizType()); |
| | | } |
| | | if (pageWrap.getModel().getMemberType() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getMemberType, pageWrap.getModel().getMemberType()); |
| | | } |
| | | if (pageWrap.getModel().getMemberName() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getMemberName, pageWrap.getModel().getMemberName()); |
| | | } |
| | | if (pageWrap.getModel().getCarCode() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCarCode, pageWrap.getModel().getCarCode()); |
| | | } |
| | | if (pageWrap.getModel().getObjType() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getObjType, pageWrap.getModel().getObjType()); |
| | | } |
| | | if (pageWrap.getModel().getObjId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getObjId, pageWrap.getModel().getObjId()); |
| | | } |
| | | if (pageWrap.getModel().getInOrOut() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getInOrOut, pageWrap.getModel().getInOrOut()); |
| | | } |
| | | if (pageWrap.getModel().getDeviceName() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getDeviceName, pageWrap.getModel().getDeviceName()); |
| | | } |
| | | InoutRecord model = pageWrap.getModel(); |
| | | queryWrapper.selectAll(InoutRecord.class) |
| | | .eq(InoutRecord::getIsdeleted,Constants.ZERO) |
| | | // .eq(Objects.nonNull(model.getType()),InoutRecord::getType, model.getType()) |
| | | .isNotNull(Objects.nonNull(model.getType())&&Constants.equalsInteger(model.getType(),Constants.ZERO),InoutRecord::getCarCode) |
| | | .isNotNull(Objects.nonNull(model.getType())&&Constants.equalsInteger(model.getType(),Constants.ONE),InoutRecord::getMemberPhone) |
| | | .eq(Objects.nonNull(model.getInOrOut()),InoutRecord::getInOrOut, model.getInOrOut()) |
| | | .eq(Objects.nonNull(model.getObjType()),InoutRecord::getObjType, model.getObjType()) |
| | | .eq(Objects.nonNull(model.getCarBizType()),InoutRecord::getCarBizType, model.getCarBizType()) |
| | | .eq(Objects.nonNull(model.getMemberType()),InoutRecord::getMemberType, model.getMemberType()) |
| | | .ge(Objects.nonNull(model.getStartDate()),InoutRecord::getCreateDate, Utils.Date.getStart(model.getStartDate())) |
| | | .le(Objects.nonNull(model.getEndDate()),InoutRecord::getCreateDate, Utils.Date.getEnd(model.getEndDate())) |
| | | .and(StringUtils.isNotBlank(model.getCategoryName()),i->i.like(InoutRecord::getCategoryName,model.getCategoryName()).or().like(InoutRecord::getCategoryParentName,model.getCategoryName())) |
| | | .and(StringUtils.isNotBlank(model.getMemberName()),i->i.like(InoutRecord::getMemberName,model.getMemberName()).or().like(InoutRecord::getMemberPhone,model.getMemberName())) |
| | | .and(StringUtils.isNotBlank(model.getCarCode()),i->i.like(InoutRecord::getCarCode,model.getCarCode()).or().like(InoutRecord::getRemark,model.getCarCode())) |
| | | .like(StringUtils.isNotBlank(model.getCompanyName()),InoutRecord::getCompanyName,model.getCompanyName()) |
| | | .like(StringUtils.isNotBlank(model.getDeviceName()),InoutRecord::getDeviceName,model.getDeviceName()) |
| | | .orderByDesc(InoutRecord::getId) |
| | | ; |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | |
| | | 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); |
| | | } |
| | | }else{ |
| | | List<String> categoryNameList = yearList.stream().filter(i-> StringUtils.isNotBlank(i.getCategoryParentName())).map(i->i.getCategoryParentName()).collect(Collectors.toList()); |
| | | List<String> categoryNameList = yearList.stream().filter(i-> StringUtils.isNotBlank(i.getCategoryParentName())) |
| | | .map(i->i.getCategoryParentName()).collect(Collectors.toList()); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(categoryNameList)){ |
| | | Set<String> setList = new HashSet<>(categoryNameList); |
| | | for (String categoryName:setList) { |
| | |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | List<InoutRecord> allList = inoutRecordMapper.selectJoinList(InoutRecord.class,new MPJLambdaWrapper<InoutRecord>() |
| | | .selectAll(InoutRecord.class) |
| | | .eq(InoutRecord::getIsdeleted,Constants.ZERO) |
| | | List<InoutRecord> allList = new ArrayList<>(); |
| | | MPJLambdaWrapper mpjLambdaWrapper = new MPJLambdaWrapper<InoutRecord>().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()+"' ) ") |
| | | .apply(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),7)," ( DATE_FORMAT(CREATE_DATE, '%Y-%m') = '"+inParkDataDTO.getDateStr()+"' ) ") |
| | | ); |
| | | .apply(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),7)," ( DATE_FORMAT(CREATE_DATE, '%Y-%m') = '"+inParkDataDTO.getDateStr()+"' ) "); |
| | | if(Constants.equalsInteger(inParkDataDTO.getIsGroupBy(),Constants.ONE)){ |
| | | mpjLambdaWrapper.groupBy(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),4)&&Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO), |
| | | "car_code,category_name,DATE_FORMAT(CREATE_DATE, '%Y-%m')") |
| | | .groupBy(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),7)&&Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO), |
| | | "car_code,category_name,DATE_FORMAT(CREATE_DATE, '%Y-%m-%d')") |
| | | .groupBy(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),4)&&Constants.equalsInteger(inParkDataDTO.getType(),Constants.ONE), |
| | | "member_phone,MEMBER_TYPE,DATE_FORMAT(CREATE_DATE, '%Y-%m')") |
| | | .groupBy(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),7)&&Constants.equalsInteger(inParkDataDTO.getType(),Constants.ONE), |
| | | "member_phone,MEMBER_TYPE,DATE_FORMAT(CREATE_DATE, '%Y-%m-%d')"); |
| | | if(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),4)&&Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO)){ |
| | | mpjLambdaWrapper.select("car_code,category_name,DATE_FORMAT(CREATE_DATE, '%Y-%m') as createDateStr "); |
| | | }else if(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),7)&&Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO)){ |
| | | mpjLambdaWrapper.select("car_code,category_name,DATE_FORMAT(CREATE_DATE, '%Y-%m-%d') as createDateStr "); |
| | | }else if(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),4)&&Constants.equalsInteger(inParkDataDTO.getType(),Constants.ONE)){ |
| | | |
| | | mpjLambdaWrapper.select("member_phone,MEMBER_TYPE,DATE_FORMAT(CREATE_DATE, '%Y-%m') as createDateStr"); |
| | | }else{ |
| | | mpjLambdaWrapper.select("member_phone,MEMBER_TYPE,DATE_FORMAT(CREATE_DATE, '%Y-%m-%d') as createDateStr "); |
| | | } |
| | | |
| | | }else{ |
| | | mpjLambdaWrapper.selectAll(InoutRecord.class); |
| | | if(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),4)&&Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO)){ |
| | | mpjLambdaWrapper.select("DATE_FORMAT(CREATE_DATE, '%Y-%m') as createDateStr "); |
| | | }else if(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),7)&&Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO)){ |
| | | mpjLambdaWrapper.select("DATE_FORMAT(CREATE_DATE, '%Y-%m-%d') as createDateStr "); |
| | | }else if(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),4)&&Constants.equalsInteger(inParkDataDTO.getType(),Constants.ONE)){ |
| | | |
| | | mpjLambdaWrapper.select("DATE_FORMAT(CREATE_DATE, '%Y-%m') as createDateStr"); |
| | | }else{ |
| | | mpjLambdaWrapper.select("DATE_FORMAT(CREATE_DATE, '%Y-%m-%d') as createDateStr "); |
| | | } |
| | | // 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()+"' ) ") |
| | | // .apply(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),7)," ( DATE_FORMAT(CREATE_DATE, '%Y-%m') = '"+inParkDataDTO.getDateStr()+"' ) ") |
| | | // ); |
| | | } |
| | | allList = inoutRecordMapper.selectJoinList(InoutRecord.class,mpjLambdaWrapper); |
| | | |
| | | List<List<String>> resultList = new ArrayList<>(); |
| | | if(CollectionUtils.isEmpty(allList)){ |
| | | return resultList; |
| | | } |
| | | if(Constants.equalsInteger(inParkDataDTO.getIsGroupBy(),Constants.ONE)){ |
| | | allList = this.getListByType(allList,inParkDataDTO.getType()); |
| | | } |
| | | |
| | | List<String> dateList = new ArrayList<>(); |
| | |
| | | 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()); |
| | |
| | | public List<List<String>> dealResultData(List<InoutRecord> allList,List<String> dataList ,Integer type,String dateStr){ |
| | | List<List<String>> resultList = new ArrayList<>(); |
| | | List<String> totalString = new ArrayList<>(); |
| | | totalString.add("日期"); |
| | | totalString.add("数据日期"); |
| | | if(Constants.equalsInteger(type,Constants.ZERO)){ |
| | | List<String> categoryNameList = allList.stream().filter(j-> StringUtils.isNotBlank(j.getCategoryName())).map(j->j.getCategoryName()).collect(Collectors.toList()); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(categoryNameList)){ |
| | |
| | | } |
| | | totalString.add("合计"); |
| | | resultList.add(totalString); |
| | | Integer total = 0; |
| | | for (String str:dataList) { |
| | | Integer total = 0; |
| | | List<String> dataChildList = new ArrayList<>(); |
| | | dataChildList.add(str); |
| | | for (String categoryName:setList) { |
| | | List<String> dataChildList = new ArrayList<>(); |
| | | dataChildList.add(str); |
| | | if(Constants.equalsInteger(dateStr.length(),4)){ |
| | | Integer childNum = allList.stream().filter(i->categoryName.equals(i.getCategoryName()) |
| | | && DateUtil.formatDate(i.getCreateDate(),"yyyy-MM").equals(str)).collect(Collectors.toList()).size(); |
| | | && i.getCreateDateStr().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->categoryName.equals(i.getCategoryName()) |
| | | &&DateUtil.formatDate(i.getCreateDate(),"yyyy-MM-dd").equals(str)).collect(Collectors.toList()).size(); |
| | | &&i.getCreateDateStr().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); |
| | | } |
| | | }else{ |
| | | for (int j = 0; j < userTypeList.length; j++) { |
| | |
| | | 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) |
| | | && j.getCreateDateStr().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) |
| | | &&j.getCreateDateStr().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; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public List<InoutRecord> getListByType(List<InoutRecord> list,Integer type){ |
| | |
| | | person -> person, |
| | | (existing, replacement) -> existing |
| | | )); |
| | | |
| | | List<InoutRecord> uniqueList = new ArrayList<>(uniqueByMemberPhone.values()); |
| | | return uniqueList; |
| | | } |
| | |
| | | person -> person, |
| | | (existing, replacement) -> existing |
| | | )); |
| | | |
| | | List<InoutRecord> uniqueList = new ArrayList<>(uniqueByCarCode.values()); |
| | | return uniqueList; |
| | | } |