Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
965c082f59
|
|
@ -37,6 +37,8 @@ public interface CookRecipeDishesMapper {
|
||||||
*/
|
*/
|
||||||
public int insertCookRecipeDishes(CookRecipeDishes cookRecipeDishes);
|
public int insertCookRecipeDishes(CookRecipeDishes cookRecipeDishes);
|
||||||
|
|
||||||
|
public int batchInsertCookRecipeDishes(@Param("list") List<CookRecipeDishes> dishesList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改菜品计划菜品关联
|
* 修改菜品计划菜品关联
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ public class CookDishesServiceImpl implements ICookDishesService {
|
||||||
log.debug("总和: {}", nutritionEntity.getCalcium());
|
log.debug("总和: {}", nutritionEntity.getCalcium());
|
||||||
System.err.println("总和:" + nutritionEntity.getCalcium());
|
System.err.println("总和:" + nutritionEntity.getCalcium());
|
||||||
//计算营养成分
|
//计算营养成分
|
||||||
countNum(nutritionEntity, Double.valueOf(cookDishes.getWeight() + ""));
|
// countNum(nutritionEntity, Double.valueOf(cookDishes.getWeight() + ""));
|
||||||
System.err.println("计算后:" + nutritionEntity.getCalcium());
|
System.err.println("计算后:" + nutritionEntity.getCalcium());
|
||||||
log.debug("计算后: {}", nutritionEntity.getCalcium());
|
log.debug("计算后: {}", nutritionEntity.getCalcium());
|
||||||
cookDishesMapper.updateFinalNutrition(nutritionEntity, cookDishes.getDishesId());
|
cookDishesMapper.updateFinalNutrition(nutritionEntity, cookDishes.getDishesId());
|
||||||
|
|
|
||||||
|
|
@ -342,6 +342,7 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
||||||
}
|
}
|
||||||
cookRecipeDetailMapper.insertCookRecipeDetail(cookRecipeDetail); //插入菜谱之执行计划
|
cookRecipeDetailMapper.insertCookRecipeDetail(cookRecipeDetail); //插入菜谱之执行计划
|
||||||
List<CookRecipeDishesDTO> dishesList = detailDTO.getDishesList();
|
List<CookRecipeDishesDTO> dishesList = detailDTO.getDishesList();
|
||||||
|
List<CookRecipeDishes> newDishesList = new ArrayList<>();
|
||||||
for (CookRecipeDishesDTO dishesDTO : dishesList) {
|
for (CookRecipeDishesDTO dishesDTO : dishesList) {
|
||||||
CookRecipeDishes cookRecipeDishes = new CookRecipeDishes();
|
CookRecipeDishes cookRecipeDishes = new CookRecipeDishes();
|
||||||
BeanUtils.copyProperties(dishesDTO, cookRecipeDishes);
|
BeanUtils.copyProperties(dishesDTO, cookRecipeDishes);
|
||||||
|
|
@ -354,8 +355,9 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
||||||
cookRecipeDishes.setSaleNum(saleNum);
|
cookRecipeDishes.setSaleNum(saleNum);
|
||||||
cookRecipeDishes.setRemanentNum((int) (supplyNum - saleNum));
|
cookRecipeDishes.setRemanentNum((int) (supplyNum - saleNum));
|
||||||
cookRecipeDishes.setRecipeDetailId(cookRecipeDetail.getRecipeDetailId());
|
cookRecipeDishes.setRecipeDetailId(cookRecipeDetail.getRecipeDetailId());
|
||||||
cookRecipeDishesMapper.insertCookRecipeDishes(cookRecipeDishes); //插入菜谱之菜品详情
|
newDishesList.add(cookRecipeDishes);
|
||||||
}
|
}
|
||||||
|
cookRecipeDishesMapper.batchInsertCookRecipeDishes(newDishesList); //插入菜谱之菜品详情
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteOldCookRecipeDetailsAndDishes(CookRecipeDTO cookRecipeDTO) {
|
private void deleteOldCookRecipeDetailsAndDishes(CookRecipeDTO cookRecipeDTO) {
|
||||||
|
|
@ -553,6 +555,7 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
||||||
//List<CookRecipeDishes> recipeDishesV2List = Lists.newArrayList();
|
//List<CookRecipeDishes> recipeDishesV2List = Lists.newArrayList();
|
||||||
for (Long recipeId : recipeMap.keySet()) {
|
for (Long recipeId : recipeMap.keySet()) {
|
||||||
List<CookRecipeDetail> cookRecipeDetailList = detailMap.get(recipeId);
|
List<CookRecipeDetail> cookRecipeDetailList = detailMap.get(recipeId);
|
||||||
|
if (!CollectionUtils.isEmpty(cookRecipeDetailList)) {
|
||||||
for (CookRecipeDetail oldDetail : cookRecipeDetailList) {
|
for (CookRecipeDetail oldDetail : cookRecipeDetailList) {
|
||||||
Long oldDetailId = oldDetail.getRecipeDetailId();
|
Long oldDetailId = oldDetail.getRecipeDetailId();
|
||||||
CookRecipeDetail newRecipeDetail = new CookRecipeDetail();
|
CookRecipeDetail newRecipeDetail = new CookRecipeDetail();
|
||||||
|
|
@ -561,7 +564,7 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
||||||
newRecipeDetail.setRecipeId(recipeId);
|
newRecipeDetail.setRecipeId(recipeId);
|
||||||
Long recipeType = recipeTypeMap.get(recipeId);
|
Long recipeType = recipeTypeMap.get(recipeId);
|
||||||
if (ObjectUtil.equal(recipeType, RecipeTypeEnum.WEEKLY.key())) {
|
if (ObjectUtil.equal(recipeType, RecipeTypeEnum.WEEKLY.key())) {
|
||||||
newRecipeDetail.setApplyWeek((long)applyDate.getDayOfWeek().getValue());
|
newRecipeDetail.setApplyWeek((long) applyDate.getDayOfWeek().getValue());
|
||||||
}
|
}
|
||||||
newRecipeDetail.setApplyDate(applyDate);
|
newRecipeDetail.setApplyDate(applyDate);
|
||||||
newRecipeDetail.setDetailType(RecipeDetailTypeEnum.DETAIL_DATA.key());
|
newRecipeDetail.setDetailType(RecipeDetailTypeEnum.DETAIL_DATA.key());
|
||||||
|
|
@ -588,6 +591,7 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public List<CookRecipeDetail> filterCookRecipeDetails(Map<Long, Long> recipeTypeMap, List<CookRecipeDetail> cookRecipeDetails, LocalDate applyDate) {
|
public List<CookRecipeDetail> filterCookRecipeDetails(Map<Long, Long> recipeTypeMap, List<CookRecipeDetail> cookRecipeDetails, LocalDate applyDate) {
|
||||||
return (List)cookRecipeDetails.stream().filter((item) -> {
|
return (List)cookRecipeDetails.stream().filter((item) -> {
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,14 @@ public class KitchenSubPlaceController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询厨房位置信息列表(不分页)")
|
||||||
|
//@RequiresPermissions("kitchen:place:list")
|
||||||
|
@GetMapping("/listAll")
|
||||||
|
public TableDataInfo listAll(KitchenSubPlace kitchenSubPlace) {
|
||||||
|
List<KitchenSubPlace> list = kitchenSubPlaceService.selectKitchenSubPlaceList(kitchenSubPlace);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出厨房位置信息列表
|
* 导出厨房位置信息列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ public class KitchenSubPlace extends BaseEntity {
|
||||||
|
|
||||||
private String canteenName;
|
private String canteenName;
|
||||||
|
|
||||||
|
private Long areaId;
|
||||||
|
|
||||||
private String areaName;
|
private String areaName;
|
||||||
|
|
||||||
/** 仓库id */
|
/** 仓库id */
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
resultType="com.bonus.canteen.core.cook.domain.CookNutritionType">
|
resultType="com.bonus.canteen.core.cook.domain.CookNutritionType">
|
||||||
<include refid="selectCookNutritionTypeVo"/>
|
<include refid="selectCookNutritionTypeVo"/>
|
||||||
where nutrition_type_name = #{nutritionTypeName}
|
where nutrition_type_name = #{nutritionTypeName}
|
||||||
<if test="nutritionTypeId != null and nutritionTypeId != '' "> and parent_id = #{nutritionTypeId}</if>
|
<if test="nutritionTypeId != null and nutritionTypeId != '' "> and nutrition_type_id != #{nutritionTypeId}</if>
|
||||||
limit 1
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
<select id="checkIsExistChildren" resultType="java.lang.Integer">
|
<select id="checkIsExistChildren" resultType="java.lang.Integer">
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<insert id="batchInsertCookRecipeDishes" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into cook_recipe_dishes (recipe_detail_id, dishes_id, price, sale_price, size_type, supply_num, sale_num,
|
||||||
|
remanent_num, limit_num, chef_id, recommend_flag, create_by, create_time)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.recipeDetailId}, #{item.dishesId}, #{item.price}, #{item.salePrice}, #{item.sizeType},
|
||||||
|
#{item.supplyNum}, #{item.saleNum}, #{item.remanentNum}, #{item.limitNum}, #{item.chefId}, #{item.recommendFlag},
|
||||||
|
#{item.createBy}, #{item.createTime})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<update id="updateCookRecipeDishes" parameterType="com.bonus.canteen.core.cook.domain.CookRecipeDishes">
|
<update id="updateCookRecipeDishes" parameterType="com.bonus.canteen.core.cook.domain.CookRecipeDishes">
|
||||||
update cook_recipe_dishes
|
update cook_recipe_dishes
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="imgUrl" column="img_url" />
|
<result property="imgUrl" column="img_url" />
|
||||||
<result property="canteenId" column="canteen_id" />
|
<result property="canteenId" column="canteen_id" />
|
||||||
<result property="canteenName" column="canteen_name" />
|
<result property="canteenName" column="canteen_name" />
|
||||||
|
<result property="areaId" column="area_id" />
|
||||||
<result property="areaName" column="area_name" />
|
<result property="areaName" column="area_name" />
|
||||||
<result property="warehouseId" column="warehouse_id" />
|
<result property="warehouseId" column="warehouse_id" />
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
|
|
@ -18,8 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectKitchenSubPlaceVo">
|
<sql id="selectKitchenSubPlaceVo">
|
||||||
select ksp.sub_place_id, ksp.sub_place_name, ksp.img_url, ksp.canteen_id, ksp.warehouse_id,
|
select ksp.sub_place_id, ksp.sub_place_name, ksp.img_url, ksp.canteen_id, ksp.warehouse_id, ksp.create_by,
|
||||||
ksp.create_by, ksp.create_time, ksp.update_by, ksp.update_time, bc.canteen_name, ba.area_name
|
ksp.create_time, ksp.update_by, ksp.update_time, bc.canteen_name, ba.area_name, ba.area_id
|
||||||
from kitchen_sub_place ksp
|
from kitchen_sub_place ksp
|
||||||
left join basic_canteen bc on bc.canteen_id = ksp.canteen_id
|
left join basic_canteen bc on bc.canteen_id = ksp.canteen_id
|
||||||
left join basic_area ba on ba.area_id = bc.area_id
|
left join basic_area ba on ba.area_id = bc.area_id
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue