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