| | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.dao.admin.response.InterestedListVO; |
| | | import com.doumee.dao.business.dao.UserActionMapper; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | | import com.doumee.service.business.third.model.PageData; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<InterestedListVO> getCarUseStatistics(Integer type){ |
| | | List<String> weekDays = DateUtil.getBeforDays(new Date(),Objects.isNull(type)||Constants.equalsInteger(type,Constants.ZERO)?7:15); |
| | | MPJLambdaWrapper<CarUseBook> wrapper = new MPJLambdaWrapper<CarUseBook>() |
| | | .selectAll(CarUseBook.class) |
| | | .eq(CarUseBook::getIsdeleted, Constants.ZERO) |
| | | .eq(CarUseBook::getStatus,Constants.TWO) |
| | | .apply(" CREATE_DATE > CURDATE() - INTERVAL "+(Objects.isNull(type)||Constants.equalsInteger(type,Constants.ZERO)?7:15)+" DAY ") |
| | | .orderByDesc(CarUseBook::getCreateDate); |
| | | List<CarUseBook> carUseBookList = carUseBookMapper.selectJoinList(CarUseBook.class,wrapper); |
| | | List<InterestedListVO> list = new ArrayList<>(); |
| | | for (String days:weekDays) { |
| | | InterestedListVO vo = new InterestedListVO(); |
| | | vo.setName(days); |
| | | vo.setNum(Constants.ZERO); |
| | | vo.setNextNum(Constants.ZERO); |
| | | if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(carUseBookList)) { |
| | | vo.setNum( |
| | | carUseBookList.stream().filter(i->DateUtil.dateToString(i.getCreateDate(),"yyyy-MM-dd").equals(days)) |
| | | .collect(Collectors.toList()).size() |
| | | ); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | |
| | | } |