| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import oshi.driver.unix.aix.Ls; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | /** |
| | | * 查询基础设置列表 |
| | | */ |
| | | // @ApiOperation( value = "查询基础设置列表") |
| | | // @PostMapping(value = "/list") |
| | | // public AjaxResult<PageInfo<TFoundationPersonVO>> list(@RequestBody TFoundationPersonQuery query) { |
| | | // return AjaxResult.success(foundationPersonService.getList(query)); |
| | | // } |
| | | |
| | | @ApiOperation( value = "查询基础设置列表") |
| | | @PostMapping(value = "/list") |
| | | public AjaxResult<PageInfo<TFoundationPersonVO>> list(@RequestBody TFoundationPersonQuery query) { |
| | | return AjaxResult.success(foundationPersonService.getList(query)); |
| | | public AjaxResult<List<TFoundationPersonVO>> list(@RequestBody TFoundationPersonQuery query) { |
| | | return AjaxResult.success(foundationPersonService.getSetList()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiOperation( value = "查看基础设置详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TFoundationPersonVO> getDetailById(@RequestParam("id") Long id) { |
| | | public AjaxResult<List<TFoundationPersonVO>> getDetailByMealType(@RequestParam("mealType") Integer mealType) { |
| | | // 查询基础设置 |
| | | List<TFoundationConfig> list = foundationConfigService.list(Wrappers.lambdaQuery(TFoundationConfig.class) |
| | | .eq(TFoundationConfig::getPersonId, id)); |
| | | TFoundationPerson foundationPerson = foundationPersonService.getById(id); |
| | | TFoundationPersonVO foundationPersonVO = new TFoundationPersonVO(); |
| | | BeanUtils.copyProperties(foundationPerson, foundationPersonVO); |
| | | foundationPersonVO.setFoundationConfigs(list); |
| | | // 查询店铺 |
| | | TShop shop = shopService.getById(foundationPersonVO.getShopId()); |
| | | foundationPersonVO.setShop(shop); |
| | | return AjaxResult.success(foundationPersonVO); |
| | | List<TFoundationPersonVO> foundationPersonVOS = foundationPersonService.getPersonList(); |
| | | List<TFoundationPersonVO> collect = foundationPersonVOS.stream().filter(e -> Objects.equals(e.getMealType(), mealType)).collect(Collectors.toList()); |
| | | for (TFoundationPersonVO foundationPersonVO : collect) { |
| | | List<TFoundationConfig> list = foundationConfigService.list(Wrappers.lambdaQuery(TFoundationConfig.class) |
| | | .eq(TFoundationConfig::getPersonId, foundationPersonVO.getId())); |
| | | foundationPersonVO.setFoundationConfigs(list); |
| | | // 查询店铺 |
| | | TShop shop = shopService.getById(foundationPersonVO.getShopId()); |
| | | foundationPersonVO.setShop(shop); |
| | | } |
| | | return AjaxResult.success(collect); |
| | | } |
| | | |
| | | /** |