h5周菜谱
This commit is contained in:
parent
e42bcb884b
commit
0e5cab6adf
|
|
@ -8,7 +8,7 @@ import java.io.Serializable;
|
|||
@Data
|
||||
public class AppletDishesDetailDTO implements Serializable {
|
||||
@ApiModelProperty("客户id")
|
||||
private Long userID;
|
||||
private Long userId;
|
||||
@ApiModelProperty("菜谱详情id")
|
||||
private Long detailId;
|
||||
@ApiModelProperty("菜品id")
|
||||
|
|
|
|||
|
|
@ -63,5 +63,5 @@ public interface CookCollectionDishesMapper {
|
|||
*/
|
||||
public int deleteCookCollectionDishesByDishesIds(Long[] ids);
|
||||
|
||||
public Long getCountByUserIdAndDishesId(Long userId, Long dishesId);
|
||||
public Long getCountByUserIdAndDishesId(@Param("userId") Long userId, @Param("dishesId") Long dishesId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -556,11 +556,11 @@ public class CookDishesServiceImpl implements ICookDishesService {
|
|||
public AppletDishesDetailVO getDishesDetailByDishesId(AppletDishesDetailDTO dishesDetailDTO) {
|
||||
//AppletDishesDetailDTO dishesDetailDTO = (AppletDishesDetailDTO)JSON.parseObject(content, AppletDishesDetailDTO.class);
|
||||
dishesDetailDTO.setDelFlag(DelFlagEnum.DEL_FALSE.key());
|
||||
Long baseDishesId = dishesDetailDTO.getDishesId();
|
||||
Long userId = dishesDetailDTO.getUserID();
|
||||
Long inputDishesId = dishesDetailDTO.getDishesId();
|
||||
Long userId = dishesDetailDTO.getUserId();
|
||||
if (!ObjectUtil.isNull(userId) && userId != -1L) {
|
||||
AppletDishesDetailVO appletDishesDetailVO = cookDishesMapper.selectDishesDetailByDishesId(dishesDetailDTO);
|
||||
Long countDishes = this.cookCollectionDishesMapper.getCountByUserIdAndDishesId(userId, baseDishesId);
|
||||
Long countDishes = this.cookCollectionDishesMapper.getCountByUserIdAndDishesId(userId, inputDishesId);
|
||||
if (ObjectUtil.isNotNull(countDishes) && countDishes > 0L) {
|
||||
appletDishesDetailVO.setIsFavorites(1);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ public class AppletDishesSizeV2VO {
|
|||
@ApiModelProperty("菜品名称")
|
||||
private String dishesName;
|
||||
@ApiModelProperty("库存数量")
|
||||
private Integer surplusNum;
|
||||
private Integer remanentNum;
|
||||
@ApiModelProperty("限购数量")
|
||||
private Integer restrictNum;
|
||||
private Integer limitNum;
|
||||
@ApiModelProperty("菜品价格")
|
||||
private Integer dishesPrice;
|
||||
@ApiModelProperty("优惠价")
|
||||
|
|
@ -149,13 +149,6 @@ public class AppletDishesSizeV2VO {
|
|||
return this.dishesName;
|
||||
}
|
||||
|
||||
public Integer getSurplusNum() {
|
||||
return this.surplusNum;
|
||||
}
|
||||
|
||||
public Integer getRestrictNum() {
|
||||
return this.restrictNum;
|
||||
}
|
||||
|
||||
public Integer getDishesPrice() {
|
||||
return this.dishesPrice;
|
||||
|
|
@ -209,12 +202,20 @@ public class AppletDishesSizeV2VO {
|
|||
this.dishesName = dishesName;
|
||||
}
|
||||
|
||||
public void setSurplusNum(final Integer surplusNum) {
|
||||
this.surplusNum = surplusNum;
|
||||
public Integer getRemanentNum() {
|
||||
return remanentNum;
|
||||
}
|
||||
|
||||
public void setRestrictNum(final Integer restrictNum) {
|
||||
this.restrictNum = restrictNum;
|
||||
public void setRemanentNum(Integer remanentNum) {
|
||||
this.remanentNum = remanentNum;
|
||||
}
|
||||
|
||||
public Integer getLimitNum() {
|
||||
return limitNum;
|
||||
}
|
||||
|
||||
public void setLimitNum(Integer limitNum) {
|
||||
this.limitNum = limitNum;
|
||||
}
|
||||
|
||||
public void setDishesPrice(final Integer dishesPrice) {
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<collection property="dishesDetailList" ofType="com.bonus.canteen.core.cook.vo.AppletDishesSizeV2VO">
|
||||
<result property="dishesId" column="dishes_id"/>
|
||||
<result property="dishesName" column="dishes_name"/>
|
||||
<result property="surplusNum" column="surplus_num"/>
|
||||
<result property="restrictNum" column="restrict_num"/>
|
||||
<result property="remanentNum" column="remanent_num"/>
|
||||
<result property="limitNum" column="limit_num"/>
|
||||
<result property="dishesPrice" column="dishes_price"/>
|
||||
<result property="prefPrice" column="pref_price"/>
|
||||
<result property="sizeType" column="size_type"/>
|
||||
|
|
@ -567,9 +567,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
md.size_json,
|
||||
mrd.price as dishes_price,
|
||||
mrd.sale_price as pref_price,
|
||||
mrd.supply_num - mrd.surplus_num as sales_num,
|
||||
mrd.surplus_num,
|
||||
mrd.restrict_num,
|
||||
mrd.supply_num - mrd.remanent_num as sales_num,
|
||||
mrd.remanent_num,
|
||||
mrd.limit_num,
|
||||
md.calories,
|
||||
md.protein,
|
||||
md.fat,
|
||||
|
|
@ -582,7 +582,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
cook_dishes md
|
||||
left join cook_recipe_dishes mrd on md.dishes_id = mrd.dishes_id
|
||||
where
|
||||
mrd.detail_id = #{detailId} and md.del_flag = #{delFlag}
|
||||
md.dishes_id = #{dishesId} and mrd.recipe_detail_id = #{detailId} and md.del_flag = #{delFlag}
|
||||
</select>
|
||||
|
||||
<select id="getCookMaterialById" resultType="com.bonus.canteen.core.cook.vo.CookMaterialBasVO">
|
||||
|
|
|
|||
Loading…
Reference in New Issue