diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketMaterial.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketMaterial.java index f179a40..8857e59 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketMaterial.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketMaterial.java @@ -57,6 +57,10 @@ public class SupermarketMaterial extends BaseEntity { @ApiModelProperty(value = "类别ids") private Long[] materialTypeIds; + /** 原料类型(1原料2商品) */ + @ApiModelProperty(value = "原料类型(1原料2商品)") + private Long goodsType; + /** 条码 */ @Excel(name = "条码") @ApiModelProperty(value = "条码") diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookMaterialMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookMaterialMapper.xml index c35b197..6f85081 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookMaterialMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookMaterialMapper.xml @@ -57,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - where cm.material_id = #{materialId} + where cm.goods_type = 1 and cm.material_id = #{materialId} + + + - + + goods_type = 2 and sm.area_id = #{areaId} and sm.material_name like concat('%', #{materialName}, '%') and sm.material_code like concat('%', #{materialCode}, '%') @@ -71,17 +73,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into supermarket_material + insert into cook_material area_id, material_name, material_code, img_url, material_type_id, + goods_type, bar_code, unit_id, sale_price, @@ -104,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{materialCode}, #{imgUrl}, #{materialTypeId}, + #{goodsType}, #{barCode}, #{unitId}, #{salePrice}, @@ -123,13 +127,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update supermarket_material + update cook_material area_id = #{areaId}, material_name = #{materialName}, material_code = #{materialCode}, img_url = #{imgUrl}, material_type_id = #{materialTypeId}, + goods_type = #{goodsType}, bar_code = #{barCode}, unit_id = #{unitId}, sale_price = #{salePrice}, @@ -150,11 +155,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from supermarket_material where material_id = #{materialId} + delete from cook_material where material_id = #{materialId} - delete from supermarket_material where material_id in + delete from cook_material where material_id in #{materialId} @@ -162,7 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + sm.goods_type = 2 and sm.bar_code like concat('%', #{barCode}, '%') and sm.material_name like concat('%', #{materialName}, '%') and sp.supermarket_id = #{supermarketId} @@ -59,12 +60,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sm.shelf_life_days, sm.pur_price_ceiling, sm.big_category_id, sm.`size`, sm.description, sm.create_by, sm.create_time, sm.update_by, sm.update_time, ba.area_name, smt.material_type_name, iu.unit_name - from supermarket_material sm + from cook_material sm left join basic_area ba on ba.area_id = sm.area_id left join supermarket_material_type smt on smt.material_type_id = sm.material_type_id left join ims_unit iu on iu.unit_id = sm.unit_id left join supermarket_product sp on sm.material_id=sp.material_id - where sp.material_id is null + where sm.goods_type = 2 and sp.material_id is null and sm.area_id = #{areaId} and sm.material_name like concat('%', #{materialName}, '%') and sm.bar_code = #{barCode} @@ -73,12 +74,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"