流程
This commit is contained in:
@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.system.api.carteen;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.module.system.api.carteen.dto.CarteenRespDto;
|
||||
|
||||
/**
|
||||
* 菜品营养 Service 接口
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
public interface CarteenApi {
|
||||
|
||||
/**
|
||||
* 获得门店信息
|
||||
*/
|
||||
public CarteenRespDto getCarteen(Long id);
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.system.api.carteen.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 门店管理 DO
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class CarteenRespDto{
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 门店名称
|
||||
*/
|
||||
private String storesName;
|
||||
/**
|
||||
* 门店状态,1已禁用0已启用
|
||||
*/
|
||||
private Boolean status;
|
||||
/**
|
||||
* 多储位管理,1已禁用0已启用
|
||||
*/
|
||||
private Boolean multipleManage;
|
||||
/**
|
||||
* 是否启用公众号点餐,1不支持0支持
|
||||
*/
|
||||
private Boolean accountOrder;
|
||||
/**
|
||||
* 门店地址
|
||||
*/
|
||||
private String storeAddress;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
private Long tenantId;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String serialNumber;
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.system.api.dish;
|
||||
|
||||
import cn.iocoder.yudao.module.system.api.dish.dto.DishesRespDto;
|
||||
|
||||
/**
|
||||
* @author zt
|
||||
* @description <description class purpose>
|
||||
* @since 2024/4/7
|
||||
*/
|
||||
public interface DishesApi {
|
||||
|
||||
/**
|
||||
* @Description: 根据菜品id 获取菜品属性
|
||||
*/
|
||||
public DishesRespDto getDish(Long id);
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.system.api.dish.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@Data
|
||||
public class DishesRespDto {
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
private String dishesName;
|
||||
|
||||
private String dishesImageUrl;
|
||||
|
||||
private String dishesAttribute;
|
||||
|
||||
private BigDecimal dishesBasePrice;
|
||||
|
||||
private BigDecimal dishesVipBasePrice;
|
||||
|
||||
private BigDecimal dishesWeighPrice;
|
||||
|
||||
private BigDecimal dishesVipWeighPrice;
|
||||
|
||||
private String dishecCook;
|
||||
|
||||
private String dishecType;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -12,10 +12,15 @@ import java.util.List;
|
||||
*/
|
||||
public interface DishesNutritionApi {
|
||||
/**
|
||||
* @return
|
||||
* @Description: 根据菜品id 获取菜品营养
|
||||
* @Author: qjq
|
||||
* @Date: 2024/4/2 16:58
|
||||
* @return
|
||||
*/
|
||||
public List<DishesNutritionRespDTO> getDishesList(Long ids);
|
||||
|
||||
/**
|
||||
* @Description: 根据菜品id 获取菜品能量
|
||||
*/
|
||||
public DishesNutritionRespDTO getDishEnergy(Long id);
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.system.api.carteen;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.api.carteen.dto.CarteenRespDto;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.carteen.CarteenDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dishes.DishesDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.carteen.CarteenMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.dishes.DishesMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 门店管理 Service 实现类
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CarteenApiImpl implements CarteenApi {
|
||||
|
||||
@Resource
|
||||
private CarteenMapper carteenMapper;
|
||||
|
||||
@Resource
|
||||
private DishesMapper dishesMapper;
|
||||
|
||||
@Override
|
||||
public CarteenRespDto getCarteen(Long id){
|
||||
DishesDO dishesDO = dishesMapper.selectById(id);
|
||||
CarteenDO carteenDO = carteenMapper.selectById(dishesDO.getCarteenId());
|
||||
return BeanUtils.toBean(carteenDO, CarteenRespDto.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.system.api.dish;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.api.dish.dto.DishesRespDto;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dishes.DishesDO;
|
||||
import cn.iocoder.yudao.module.system.service.dishes.DishesService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 菜品营养 Service 接口
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Service
|
||||
public class DishesApiImpl implements DishesApi {
|
||||
|
||||
@Resource
|
||||
private DishesService dishesService;
|
||||
|
||||
@Override
|
||||
public DishesRespDto getDish(Long id) {
|
||||
DishesDO dishes = dishesService.getDishes(id);
|
||||
return BeanUtils.toBean(dishes,DishesRespDto.class);
|
||||
}
|
||||
}
|
@ -33,4 +33,14 @@ public class DishesNutritionApiImpl implements DishesNutritionApi {
|
||||
return BeanUtils.toBean(dishesNutritionMapper.selectList(new LambdaQueryWrapperX<DishesNutritionDO>()
|
||||
.eqIfPresent(DishesNutritionDO::getDishesId,ids)),DishesNutritionRespDTO.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DishesNutritionRespDTO getDishEnergy(Long id) {
|
||||
return BeanUtils.toBean(dishesNutritionMapper.selectOne(new LambdaQueryWrapperX<DishesNutritionDO>()
|
||||
.eqIfPresent(DishesNutritionDO::getDishesId,id)
|
||||
.eqIfPresent(DishesNutritionDO::getNutritionName,"能量")
|
||||
.last("limit 1")),DishesNutritionRespDTO.class);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user