添加h5历史记录周菜谱
This commit is contained in:
parent
8f6432ce38
commit
114e26f840
|
|
@ -152,9 +152,10 @@ public class MenuRecipeServiceImpl extends ServiceImpl<MenuRecipeMapper, MenuRec
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AppletWeekRecipeVO> getWeekRecipeDetailList(AppletWeekRecipeDTO content) {
|
public List<AppletWeekRecipeVO> getWeekRecipeDetailList(AppletWeekRecipeDTO content) {
|
||||||
|
Set<Long> effIdSet = this.getShopstallIdListByCustId(content.getCustId(), false);
|
||||||
|
System.err.println("档口id集合: " + effIdSet.size());
|
||||||
List<Long> recipeIdList = Lists.newArrayList();
|
List<Long> recipeIdList = Lists.newArrayList();
|
||||||
if (ObjectUtil.isNull(content.getRecipeId())) {
|
if (ObjectUtil.isNull(content.getRecipeId())) {
|
||||||
Set<Long> effIdSet = this.getShopstallIdListByCustId(content.getCustId(), false);
|
|
||||||
if (ObjectUtil.isEmpty(effIdSet)) {
|
if (ObjectUtil.isEmpty(effIdSet)) {
|
||||||
effIdSet = Sets.newTreeSet();
|
effIdSet = Sets.newTreeSet();
|
||||||
((Set) effIdSet).add(-1L);
|
((Set) effIdSet).add(-1L);
|
||||||
|
|
@ -165,7 +166,7 @@ public class MenuRecipeServiceImpl extends ServiceImpl<MenuRecipeMapper, MenuRec
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LocalDate applyDate = content.getApplyDate();
|
LocalDate applyDate = LocalDate.parse(content.getDate());
|
||||||
LocalDate now = LocalDate.now();
|
LocalDate now = LocalDate.now();
|
||||||
|
|
||||||
if (applyDate.isBefore(now)) {
|
if (applyDate.isBefore(now)) {
|
||||||
|
|
@ -178,7 +179,7 @@ public class MenuRecipeServiceImpl extends ServiceImpl<MenuRecipeMapper, MenuRec
|
||||||
System.out.println("Parsed date and time: " + bindDate);
|
System.out.println("Parsed date and time: " + bindDate);
|
||||||
if(bindDate.isBefore(applyDate)){
|
if(bindDate.isBefore(applyDate)){
|
||||||
System.out.println("绑定日期早于查询历史信息日期");
|
System.out.println("绑定日期早于查询历史信息日期");
|
||||||
recipeIdList = this.menuAppRecipeMapper.selectWeekRecipeId(content.getRecipeId(), null);
|
recipeIdList = this.menuAppRecipeMapper.selectWeekRecipeId(content.getRecipeId(), effIdSet);
|
||||||
}else{
|
}else{
|
||||||
System.out.println("绑定日期迟于查询历史信息日期");
|
System.out.println("绑定日期迟于查询历史信息日期");
|
||||||
List<Long> repeIdList = this.menuAppRecipeMapper.getRecipeIdListByRecipeId(content.getRecipeId());
|
List<Long> repeIdList = this.menuAppRecipeMapper.getRecipeIdListByRecipeId(content.getRecipeId());
|
||||||
|
|
@ -190,10 +191,10 @@ public class MenuRecipeServiceImpl extends ServiceImpl<MenuRecipeMapper, MenuRec
|
||||||
}
|
}
|
||||||
} else if (applyDate.isAfter(now)) {
|
} else if (applyDate.isAfter(now)) {
|
||||||
System.out.println("applyDate 晚于当前日期");
|
System.out.println("applyDate 晚于当前日期");
|
||||||
recipeIdList = this.menuAppRecipeMapper.selectWeekRecipeId(content.getRecipeId(), null);
|
recipeIdList = this.menuAppRecipeMapper.selectWeekRecipeId(content.getRecipeId(), effIdSet);
|
||||||
} else {
|
} else {
|
||||||
System.out.println("applyDate 等于当前日期");
|
System.out.println("applyDate 等于当前日期");
|
||||||
recipeIdList = this.menuAppRecipeMapper.selectWeekRecipeId(content.getRecipeId(), null);
|
recipeIdList = this.menuAppRecipeMapper.selectWeekRecipeId(content.getRecipeId(), effIdSet);
|
||||||
}
|
}
|
||||||
if(recipeIdList == null || recipeIdList.size() == 0){
|
if(recipeIdList == null || recipeIdList.size() == 0){
|
||||||
throw new ServiceException("本档口没有更早的历史菜谱记录");
|
throw new ServiceException("本档口没有更早的历史菜谱记录");
|
||||||
|
|
|
||||||
|
|
@ -102,10 +102,12 @@
|
||||||
left join menu_recipe mr on mar.recipe_id = mr.recipe_id
|
left join menu_recipe mr on mar.recipe_id = mr.recipe_id
|
||||||
where
|
where
|
||||||
bind_type = 3
|
bind_type = 3
|
||||||
and mr.eff_id in
|
<if test="effIdSet !=null and effIdSet.size()>0">
|
||||||
<foreach collection="effIdSet" item="effId" separator="," open="(" close=")">
|
and mr.eff_id in
|
||||||
#{effId}
|
<foreach collection="effIdSet" item="effId" separator="," open="(" close=")">
|
||||||
</foreach>
|
#{effId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<if test="recipeId != null">
|
<if test="recipeId != null">
|
||||||
and mar.recipe_id = #{recipeId}
|
and mar.recipe_id = #{recipeId}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -359,7 +361,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getBingTimeByRecipeId" resultType="java.lang.String">
|
<select id="getBingTimeByRecipeId" resultType="java.lang.String">
|
||||||
select bind_time from menu_app_recipe where recipe_id = #{recipeId}
|
select bind_time from menu_app_recipe where recipe_id = #{recipeId} and bind_type = 3
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue