商品单位-仓库管理
This commit is contained in:
parent
349bc91fc2
commit
0b183be6d5
|
|
@ -47,6 +47,11 @@ public class SupermarketMaterial extends BaseEntity {
|
|||
@ApiModelProperty(value = "类别id")
|
||||
private Long materialTypeId;
|
||||
|
||||
/** 类别ids */
|
||||
@Excel(name = "类别ids")
|
||||
@ApiModelProperty(value = "类别ids")
|
||||
private Long[] materialTypeIds;
|
||||
|
||||
/** 条码 */
|
||||
@Excel(name = "条码")
|
||||
@ApiModelProperty(value = "条码")
|
||||
|
|
|
|||
|
|
@ -59,4 +59,6 @@ public interface SupermarketMaterialTypeMapper {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteSupermarketMaterialTypeByMaterialTypeIds(Long[] materialTypeIds);
|
||||
|
||||
public int getSupermarketMaterialTypeChildCountByMaterialTypes(Long[] materialTypeIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,10 +100,14 @@ public class SupermarketMaterialTypeServiceImpl implements ISupermarketMaterialT
|
|||
*/
|
||||
@Override
|
||||
public int deleteSupermarketMaterialTypeByMaterialTypeIds(Long[] materialTypeIds) {
|
||||
int count = supermarketMaterialMapper.getSupermarketMaterialCountByMaterialTypes(materialTypeIds);
|
||||
if (count > 0) {
|
||||
int count1 = supermarketMaterialMapper.getSupermarketMaterialCountByMaterialTypes(materialTypeIds);
|
||||
if (count1 > 0) {
|
||||
throw new ServiceException("该超市商品类型含有商品信息,不能删除");
|
||||
}
|
||||
int count2 = supermarketMaterialTypeMapper.getSupermarketMaterialTypeChildCountByMaterialTypes(materialTypeIds);
|
||||
if (count2 > 0) {
|
||||
throw new ServiceException("该超市商品类型含有子类型,不能删除");
|
||||
}
|
||||
return supermarketMaterialTypeMapper.deleteSupermarketMaterialTypeByMaterialTypeIds(materialTypeIds);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectSupermarketMaterialVo">
|
||||
select material_id, area_id, material_name, material_code, img_url, material_type_id, bar_code, unit_id, sale_price, unit_price, sales_mode, shelf_life_type, shelf_life_days, pur_price_ceiling, big_category_id, size, description, create_by, create_time, update_by, update_time from supermarket_material
|
||||
select material_id, area_id, material_name, material_code, img_url, material_type_id,
|
||||
bar_code, unit_id, sale_price, unit_price, sales_mode, shelf_life_type,
|
||||
shelf_life_days, pur_price_ceiling, big_category_id, `size`, description,
|
||||
create_by, create_time, update_by, update_time
|
||||
from supermarket_material
|
||||
</sql>
|
||||
|
||||
<select id="selectSupermarketMaterialList" parameterType="com.bonus.canteen.core.supermarket.domain.SupermarketMaterial" resultMap="SupermarketMaterialResult">
|
||||
|
|
@ -38,7 +42,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||||
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
||||
<if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
|
||||
<if test="materialTypeId != null "> and material_type_id = #{materialTypeId}</if>
|
||||
<if test="materialTypeIds != null and materialTypeIds.length > 0">
|
||||
and material_type_id in
|
||||
<foreach collection="materialTypeIds" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="barCode != null and barCode != ''"> and bar_code = #{barCode}</if>
|
||||
<if test="unitId != null "> and unit_id = #{unitId}</if>
|
||||
<if test="salePrice != null "> and sale_price = #{salePrice}</if>
|
||||
|
|
@ -75,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="shelfLifeDays != null">shelf_life_days,</if>
|
||||
<if test="purPriceCeiling != null">pur_price_ceiling,</if>
|
||||
<if test="bigCategoryId != null">big_category_id,</if>
|
||||
<if test="size != null">size,</if>
|
||||
<if test="size != null">`size`,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
|
|
@ -123,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="shelfLifeDays != null">shelf_life_days = #{shelfLifeDays},</if>
|
||||
<if test="purPriceCeiling != null">pur_price_ceiling = #{purPriceCeiling},</if>
|
||||
<if test="bigCategoryId != null">big_category_id = #{bigCategoryId},</if>
|
||||
<if test="size != null">size = #{size},</if>
|
||||
<if test="size != null">`size` = #{size},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
|
|
|
|||
|
|
@ -89,4 +89,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{materialTypeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getSupermarketMaterialTypeChildCountByMaterialTypes" resultType="Integer">
|
||||
select count(1)
|
||||
from supermarket_material_type
|
||||
where parent_id in
|
||||
<foreach item="materialTypeId" collection="array" open="(" separator="," close=")">
|
||||
#{materialTypeId}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue