6/19 解决了菜品/套餐页面修改窗口无法关闭的问题,以及菜品管理页面菜品分类字段显示空白的问题
This commit is contained in:
parent
2fa3110b84
commit
ee47200b4e
@ -44,6 +44,12 @@ public class CategoryController {
|
||||
@Autowired
|
||||
private CategoryService categoryService;
|
||||
|
||||
@GetMapping("list")
|
||||
public Result<List<CategoryDTO>> list(@RequestParam Map<String, Object> params){
|
||||
List<CategoryDTO> list = categoryService.list(params);
|
||||
return new Result<List<CategoryDTO>>().ok(list);
|
||||
}
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页")
|
||||
@ApiImplicitParams({
|
||||
|
@ -10,6 +10,8 @@ import io.renren.common.validator.ValidatorUtils;
|
||||
import io.renren.common.validator.group.AddGroup;
|
||||
import io.renren.common.validator.group.DefaultGroup;
|
||||
import io.renren.common.validator.group.UpdateGroup;
|
||||
import io.renren.modules.front.bean.Category;
|
||||
import io.renren.modules.front.service.CategoryService;
|
||||
import io.renren.modules.takeout.dto.DishDTO;
|
||||
import io.renren.modules.takeout.excel.DishExcel;
|
||||
import io.renren.modules.takeout.service.DishService;
|
||||
@ -41,9 +43,18 @@ public class DishController {
|
||||
@Autowired
|
||||
private DishService dishService;
|
||||
|
||||
@Autowired
|
||||
private CategoryService categoryService;
|
||||
|
||||
@Autowired
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
@GetMapping("list")
|
||||
public Result<List<DishDTO>> list(@RequestParam Map<String, Object> params){
|
||||
List<DishDTO> list = dishService.list(params);
|
||||
return new Result<List<DishDTO>>().ok(list);
|
||||
}
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页")
|
||||
@ApiImplicitParams({
|
||||
@ -55,7 +66,13 @@ public class DishController {
|
||||
@RequiresPermissions("takeout:dish:page")
|
||||
public Result<PageData<DishDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
PageData<DishDTO> page = dishService.page(params);
|
||||
|
||||
List<DishDTO> dishDTOList = page.getList();
|
||||
for (DishDTO dishDTO : dishDTOList) {
|
||||
Long categoryId = dishDTO.getCategoryId();
|
||||
Category category = categoryService.getById(categoryId);
|
||||
dishDTO.setCategoryName(category.getName());
|
||||
}
|
||||
page.setList(dishDTOList);
|
||||
return new Result<PageData<DishDTO>>().ok(page);
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,9 @@ public class DishDTO implements Serializable {
|
||||
@ApiModelProperty(value = "菜品分类id")
|
||||
private Long categoryId;
|
||||
|
||||
@ApiModelProperty(value = "菜品分类名称")
|
||||
private String categoryName;
|
||||
|
||||
@ApiModelProperty(value = "菜品价格")
|
||||
private BigDecimal price;
|
||||
|
||||
|
@ -23,9 +23,11 @@ public class CategoryServiceImpl extends CrudServiceImpl<CategoryDao, CategoryEn
|
||||
@Override
|
||||
public QueryWrapper<CategoryEntity> getWrapper(Map<String, Object> params){
|
||||
String id = (String)params.get("id");
|
||||
String type = (String) params.get("type");
|
||||
|
||||
QueryWrapper<CategoryEntity> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
|
||||
wrapper.eq(StringUtils.isNotBlank(type), "type", type);
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
@ -23,9 +23,11 @@ public class DishServiceImpl extends CrudServiceImpl<DishDao, DishEntity, DishDT
|
||||
@Override
|
||||
public QueryWrapper<DishEntity> getWrapper(Map<String, Object> params){
|
||||
String id = (String)params.get("id");
|
||||
String categoryId = (String)params.get("categoryId");
|
||||
|
||||
QueryWrapper<DishEntity> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
|
||||
wrapper.eq(StringUtils.isNotBlank(categoryId), "category_id", categoryId);
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user