| | |
| | | package com.matrix.system.app.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.system.app.dto.BusinessesDto; |
| | | import com.matrix.system.app.vo.BusinessesDataShowVo; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.SysBusinessData; |
| | | import com.matrix.system.hive.dao.SysBusinessDataDao; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2020-12-28 |
| | | **/ |
| | | @Api(value = "ApiStatisticsAction", tags = "报表接口类") |
| | | @RestController |
| | | @RequestMapping(value = "/api/statistics") |
| | | public class ApiStatisticsAction { |
| | | |
| | | @Autowired |
| | | private SysBusinessDataDao sysBusinessDataDao; |
| | | |
| | | @ApiOperation(value = "公司经营报表/门店经营报表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = BusinessesDataShowVo.class) |
| | | }) |
| | | @PostMapping(value = "/findShopBusinessesData") |
| | | public AjaxResult findShopBusinessesData(@RequestBody BusinessesDto businessesDto) { |
| | | SysBusinessData sysBusinessData = new SysBusinessData(); |
| | | // 若shopId为空,则查询门店经营报表 |
| | | if (businessesDto.getShopId() == null) { |
| | | sysBusinessData.setShopId(businessesDto.getShopId()); |
| | | } |
| | | QueryUtil.setQueryLimitCom(sysBusinessData); |
| | | |
| | | if (BusinessesDto.DAY.equals(businessesDto.getType())) { |
| | | sysBusinessData.setT1("%Y-%m-%d"); |
| | | } else { |
| | | sysBusinessData.setT1("%Y-%m"); |
| | | } |
| | | PaginationVO pageVo = new PaginationVO(); |
| | | pageVo.setOffset((businessesDto.getPageNum() - 1) * businessesDto.getPageSize()); |
| | | pageVo.setLimit(businessesDto.getPageSize()); |
| | | |
| | | return AjaxResult.buildSuccessInstance(sysBusinessDataDao.selectApiBusinessDataInPage(sysBusinessData, pageVo), sysBusinessDataDao.selectApiBusinessDataTotal(sysBusinessData)); |
| | | } |
| | | } |