| | |
| | | import cn.exrick.xboot.core.common.utils.ResultUtil; |
| | | import cn.exrick.xboot.core.common.vo.Result; |
| | | import cn.exrick.xboot.your.entity.Car; |
| | | import cn.exrick.xboot.your.service.IEventLogService; |
| | | import cn.exrick.xboot.your.service.IOrderTaskService; |
| | | import cn.exrick.xboot.your.service.*; |
| | | import cn.exrick.xboot.your.vo.Month; |
| | | import cn.exrick.xboot.your.service.ICarService; |
| | | import cn.exrick.xboot.your.service.ICustomerService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @Autowired |
| | | private ICustomerService iCustomerService; |
| | | @Autowired |
| | | private IOrderTaskService iOrderTaskService; |
| | | @Autowired |
| | | private IEventLogService iEventLogService; |
| | | @Autowired |
| | | private IOrderLogService iOrderLogService; |
| | | |
| | | |
| | | @RequestMapping(value = "/getCarCount", method = RequestMethod.GET) |
| | | @ApiOperation(value = "获取车辆数目") |
| | | public Result<Object> getCarCount() { |
| | | Calendar cal = Calendar.getInstance(); |
| | | int year = cal.get(Calendar.YEAR); |
| | | QueryWrapper<Car> wrapper = new QueryWrapper<>(); |
| | | |
| | | int m = cal.get(Calendar.MONTH) + 1; |
| | | |
| | |
| | | public Result<Object> getCustomerCount() { |
| | | Calendar cal = Calendar.getInstance(); |
| | | int year = cal.get(Calendar.YEAR); |
| | | QueryWrapper<Car> wrapper = new QueryWrapper<>(); |
| | | |
| | | int m = cal.get(Calendar.MONTH) + 1; |
| | | |
| | |
| | | int year = cal.get(Calendar.YEAR); |
| | | QueryWrapper<Car> wrapper = new QueryWrapper<>(); |
| | | |
| | | Month month= iOrderTaskService.getSendNum(year); |
| | | Month month= iOrderLogService.getSendNum(year); |
| | | List<Integer> list = new ArrayList<>(); |
| | | if (month==null) { |
| | | month = new Month(); |
| | |
| | | list.add(month.getOctober()/10000); |
| | | list.add(month.getNovember()/10000); |
| | | list.add(month.getDecember()/10000); |
| | | return new ResultUtil<Object>().setData(list); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getAvgNum", method = RequestMethod.GET) |
| | | @ApiOperation(value = "获取商户平均送货数量") |
| | | public Result<Object> getAvgNum() { |
| | | Calendar cal = Calendar.getInstance(); |
| | | int year = cal.get(Calendar.YEAR); |
| | | QueryWrapper<Car> wrapper = new QueryWrapper<>(); |
| | | |
| | | Month month= iCustomerService.getCustomerCount(year); |
| | | Month month2= iOrderTaskService.getSendNum(year); |
| | | |
| | | List<Integer> list = new ArrayList<>(); |
| | | |
| | | if (month==null) { |
| | | month = new Month(); |
| | | } |
| | | if (month2==null){ |
| | | month2=new Month(); |
| | | } |
| | | list.add(month.getJanuary()!=0 ? (month2.getJanuary()/month.getJanuary())/10000 : 0); |
| | | list.add(month.getFebruary()!=0 ? (month2.getFebruary()/month.getFebruary())/10000 : 0); |
| | | list.add(month.getMarch()!=0 ? (month2.getMarch()/month.getMarch())/10000 : 0); |
| | | list.add(month.getApril()!=0 ? (month2.getApril()/month.getApril())/10000 : 0); |
| | | list.add(month.getMay()!=0 ? (month2.getMay()/month.getMay())/10000 : 0); |
| | | list.add(month.getJune()!=0 ? (month2.getJune()/month.getJune())/10000 : 0); |
| | | list.add(month.getJuly()!=0 ? (month2.getJuly()/month.getJuly())/10000 : 0); |
| | | list.add(month.getAugust()!=0 ? (month2.getAugust()/month.getAugust())/10000 : 0); |
| | | list.add(month.getSeptember()!=0 ? (month2.getSeptember()/month.getSeptember())/10000 : 0); |
| | | list.add(month.getOctober()!=0 ? (month2.getOctober()/month.getOctober())/10000 : 0); |
| | | list.add(month.getNovember()!=0 ? (month2.getNovember()/month.getNovember())/10000 : 0); |
| | | list.add(month.getDecember()!=0 ? (month2.getDecember()/month.getDecember())/10000 : 0); |
| | | |
| | | return new ResultUtil<Object>().setData(list); |
| | | } |
| | | |