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