bug 食堂修改

This commit is contained in:
lizhenhua 2025-08-07 13:09:20 +08:00
parent ac20509ae2
commit 7ae28eac80
4 changed files with 122 additions and 23 deletions

View File

@ -22,7 +22,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
/**
* 原料信息Controller
*
*
* @author xsheng
* @date 2025-05-25
*/

View File

@ -12,7 +12,7 @@ import java.util.List;
/**
* 原料信息对象 cook_material
*
*
* @author xsheng
* @date 2025-05-25
*/
@ -132,4 +132,9 @@ public class CookMaterial extends BaseEntity {
@ApiModelProperty(value = "当前库存总数")
private BigDecimal materialTotalNum;
/**
* 在原料中判断是否存在库存
*/
private String hasInventory;
}

View File

@ -91,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="selenium" column="selenium"/>
<result property="salesNum" column="sales_num"/>
<result property="carotene" column="carotene"/>
<result property="hasInventory" column="has_inventory"/>
</resultMap>
<resultMap id="appletDishesDetailVO" type="com.bonus.canteen.core.cook.vo.AppletDishesDetailVO">
@ -124,20 +124,108 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectCookDishesVo">
select dishes_id, meal_type, custom_id, inventory_id, dishes_name, alias_name, bar_code, intro, cook_id, type_id,cdt.dishes_type_name, classify_id,
effect_id, style_id, if_local_feature, dishes_depart, sequence, pungency_degree, sales_mode, size_type, size_json,
weight, large_weight, little_weight, weight_deviation, price, unit_price, large_price, little_price, image_url,
particulars, recommend, index_recommend, like_survey, like_batch, like_num, initial_score, calories, protein, fat,
carbohydrate, dietary_fiber, cholesterol, calcium, sodium, purine, iron, iodine, kalium, vitamin_a, vitamin_c,
vitamin_e, magnesium, zinc, glycemic_index, sort, cd.canteen_id,bc.canteen_name,cd.shopstall_id,bs.stall_name, hide_flag, convert_flag, material_cost,
gross_profit, gross_profit_rate, public_dishes, cd.area_id,ba.area_name, meal_id, cd.create_by, cd.create_time, cd.update_by, cd.update_time,
cd.processing_method, cd.processing_time, cd.edible, cd.water, cd.ash, cd.retinol, cd.thiamine, cd.riboflavin, cd.niacin, vitamin_d,
cd.phosphorus, cd.selenium,cd.carotene
from cook_dishes cd
left join basic_area ba on cd.area_id = ba.area_id
left join basic_canteen bc on cd.canteen_id = bc.canteen_id
left join basic_stall bs on cd.shopstall_id = bs.stall_id
left join cook_dishes_type cdt on cd.type_id = cdt.dishes_type_id
SELECT
cd.dishes_id,
meal_type,
custom_id,
cd.inventory_id,
dishes_name,
alias_name,
bar_code,
intro,
cook_id,
type_id,
cdt.dishes_type_name,
classify_id,
effect_id,
style_id,
if_local_feature,
dishes_depart,
sequence,
pungency_degree,
sales_mode,
size_type,
size_json,
cd.weight,
large_weight,
little_weight,
weight_deviation,
price,
unit_price,
large_price,
little_price,
image_url,
particulars,
recommend,
index_recommend,
like_survey,
like_batch,
like_num,
initial_score,
calories,
protein,
fat,
carbohydrate,
dietary_fiber,
cholesterol,
calcium,
sodium,
purine,
iron,
iodine,
kalium,
vitamin_a,
vitamin_c,
vitamin_e,
magnesium,
zinc,
glycemic_index,
sort,
cd.canteen_id,
bc.canteen_name,
cd.shopstall_id,
bs.stall_name,
hide_flag,
convert_flag,
material_cost,
gross_profit,
gross_profit_rate,
public_dishes,
cd.area_id,
ba.area_name,
meal_id,
cd.create_by,
cd.create_time,
cd.update_by,
cd.update_time,
cd.processing_method,
cd.processing_time,
cd.edible,
cd.water,
cd.ash,
cd.retinol,
cd.thiamine,
cd.riboflavin,
cd.niacin,
vitamin_d,
cd.phosphorus,
cd.selenium,
cd.carotene,
CASE
WHEN iin.material_num IS NOT NULL
AND iin.material_num > 0 THEN
1 ELSE 0
END AS has_inventory
FROM
cook_dishes cd
LEFT JOIN cook_dishes_material cdm ON cdm.dishes_id = cd.dishes_id
LEFT JOIN ims_inventory iin ON iin.material_id = cdm.material_id
AND iin.del_flag = 0
LEFT JOIN basic_area ba ON cd.area_id = ba.area_id
LEFT JOIN basic_canteen bc ON cd.canteen_id = bc.canteen_id
LEFT JOIN basic_stall bs ON cd.shopstall_id = bs.stall_id
LEFT JOIN cook_dishes_type cdt ON cd.type_id = cdt.dishes_type_id
</sql>
<select id="selectCookDishesList" parameterType="com.bonus.canteen.core.cook.domain.CookDishes" resultMap="CookDishesResult">
@ -223,7 +311,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by cd.create_time desc
</select>
<select id="selectCookDishesByDishesId" parameterType="Long" resultMap="CookDishesResult">
<include refid="selectCookDishesVo"/>
where cd.dishes_id = #{dishesId}
@ -670,4 +758,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{dishesId}
</foreach>
</select>
</mapper>
</mapper>

View File

@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="nutritionTypeName" column="nutrition_type_name" />
<result property="unitName" column="unit_name" />
<result property="materialTotalNum" column="material_total_num" />
<result property="hasInventory" column="has_inventory" />
</resultMap>
<sql id="selectCookMaterialVo">
@ -47,8 +48,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.area_id, a.area_name,
cm.nutrition_type_id, cnt.nutrition_type_name,
iu.unit_name,cm.unit_id,
ii.material_total_num
ii.material_total_num ,
CASE
WHEN iin.material_num IS NOT NULL AND iin.material_num > 0 THEN 1
ELSE 0
END AS has_inventory
from cook_material cm
LEFT JOIN ims_inventory iin ON iin.material_id = cm.material_id and iin.del_flag=0
left join cook_material_type cmt on cm.material_type_id = cmt.material_type_id
left join cook_nutrition_type cnt on cm.nutrition_type_id = cnt.nutrition_type_id
left join cook_nutrition cn on cm.nutrition_id = cn.nutrition_id
@ -95,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by cm.create_time desc
</select>
<select id="selectCookMaterialByMaterialId" parameterType="Long" resultMap="CookMaterialResult">
<include refid="selectCookMaterialVo"/>
<where>
@ -218,9 +224,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteCookMaterialByMaterialIds" parameterType="String">
delete from cook_material where material_id in
delete from cook_material where material_id in
<foreach item="materialId" collection="array" open="(" separator="," close=")">
#{materialId}
</foreach>
</delete>
</mapper>
</mapper>