UserAppIndexController.java 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package com.ruoyi.app.user;
  2. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  3. import com.ruoyi.app.mendian.PosStoreEnrichService;
  4. import com.ruoyi.common.annotation.Anonymous;
  5. import com.ruoyi.common.core.controller.BaseController;
  6. import com.ruoyi.common.core.domain.AjaxResult;
  7. import com.ruoyi.system.domain.*;
  8. import com.ruoyi.system.mapper.PosStoreMapper;
  9. import com.ruoyi.system.mapper.PosFoodMapper;
  10. import com.ruoyi.system.service.*;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.web.bind.annotation.GetMapping;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RestController;
  15. import org.springframework.web.bind.annotation.*;
  16. import java.math.BigDecimal;
  17. import java.util.List;
  18. import com.ruoyi.system.mapper.PosOrderMapper;
  19. import com.ruoyi.app.user.dto.StoreOutput;
  20. /**
  21. * 用户美食首页
  22. *
  23. * @author ruoyi
  24. */
  25. @RestController
  26. @RequestMapping("/user/index")
  27. public class UserAppIndexController extends BaseController {
  28. @Autowired
  29. private IPosTypeService posTypeService;
  30. @Autowired
  31. private IPosFoodService posFoodService;
  32. @Autowired
  33. private IPosOrderService posOrderService;
  34. @Autowired
  35. private PosOrderMapper posOrderMapper;
  36. @Autowired
  37. private IFoodStatisticsService foodStatisticsService;
  38. @Autowired
  39. private PosStoreMapper posStoreMapper;
  40. @Autowired
  41. private PosFoodMapper posFoodMapper;
  42. @Autowired
  43. private IInfoUserService infoUserService;
  44. @Autowired
  45. private PosStoreEnrichService posStoreEnrichService;
  46. /**
  47. * 获取门店分页列表
  48. */
  49. @Anonymous
  50. @GetMapping("/getStoreList")
  51. public AjaxResult getFoodStoreList(@RequestParam String language,
  52. @RequestParam BigDecimal longitude,
  53. @RequestParam BigDecimal latitude,
  54. @RequestParam Integer page,
  55. @RequestParam(defaultValue = "0") Long flId) {
  56. List<PosStore> storeList = posStoreMapper.getjxStore(longitude,latitude,(page-1)*10,flId);
  57. posStoreEnrichService.enrichStoreList(storeList);
  58. int count = posStoreMapper.getjxStoreCount(longitude,latitude,flId);
  59. Page<StoreOutput> result = posStoreEnrichService.buildStoreOutputPage(storeList, language, page, count);
  60. return success(result);
  61. }
  62. }