From 0234ca086f716473266c9776fa146bf3a99f35bb Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Thu, 19 Jun 2025 17:17:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E4=BD=8D=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/service/impl/BasicAreaServiceImpl.java | 13 ++++++------- .../core/iws/mapper/ImsWarehouseInfoMapper.java | 2 ++ .../resources/mapper/cook/CookMaterialMapper.xml | 14 +++++++------- .../mapper/iws/ImsWarehouseInfoMapper.xml | 9 +++++++++ .../mapper/supermarket/SupermarketInfoMapper.xml | 4 ++-- .../supermarket/SupermarketMaterialMapper.xml | 4 ++-- .../supermarket/SupermarketProductMapper.xml | 8 ++++---- 7 files changed, 32 insertions(+), 22 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/basic/service/impl/BasicAreaServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/basic/service/impl/BasicAreaServiceImpl.java index b4581e6..ef3e899 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/basic/service/impl/BasicAreaServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/basic/service/impl/BasicAreaServiceImpl.java @@ -5,11 +5,10 @@ import java.util.Iterator; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; - import com.bonus.canteen.core.basic.mapper.BasicCanteenMapper; import com.bonus.canteen.core.common.domain.TreeSelect; +import com.bonus.canteen.core.iws.mapper.ImsWarehouseInfoMapper; import com.bonus.canteen.core.supermarket.mapper.SupermarketInfoMapper; -import com.bonus.canteen.core.supply.mapper.SupplyWarehouseInfoMapper; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.StringUtils; @@ -34,7 +33,7 @@ public class BasicAreaServiceImpl implements IBasicAreaService { @Autowired private SupermarketInfoMapper supermarketInfoMapper; @Autowired - SupplyWarehouseInfoMapper supplyWarehouseInfoMapper; + ImsWarehouseInfoMapper imsWarehouseInfoMapper; /** * 查询区域 @@ -118,12 +117,12 @@ public class BasicAreaServiceImpl implements IBasicAreaService { if (count1 > 0) { throw new ServiceException("该区域含有食堂信息,不能删除"); } - int coun2 = supermarketInfoMapper.getSupermarketCountByAreaIds(areaIds); - if (coun2 > 0) { + int count2 = supermarketInfoMapper.getSupermarketCountByAreaIds(areaIds); + if (count2 > 0) { throw new ServiceException("该区域含有超市信息,不能删除"); } - int coun3 = supplyWarehouseInfoMapper.getSupplyWarehouseCountByAreaIds(areaIds); - if (coun3 > 0) { + int count3 = imsWarehouseInfoMapper.getImsWarehouseCountByAreaIds(areaIds); + if (count3 > 0) { throw new ServiceException("该区域含有仓库信息,不能删除"); } return basicAreaMapper.deleteBasicAreaByAreaIds(areaIds); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/iws/mapper/ImsWarehouseInfoMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/iws/mapper/ImsWarehouseInfoMapper.java index c436ca4..029961b 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/iws/mapper/ImsWarehouseInfoMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/iws/mapper/ImsWarehouseInfoMapper.java @@ -18,6 +18,8 @@ public interface ImsWarehouseInfoMapper { */ public ImsWarehouseInfo selectImsWarehouseInfoByWarehouseId(Long warehouseId); + public int getImsWarehouseCountByAreaIds(Long[] areaIds); + /** * 查询仓库信息列表 * 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 fc18516..c35b197 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 @@ -45,13 +45,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" cmt.material_type_id, cmt.material_type_name, a.area_id, a.area_name, cm.nutrition_type_id, cnt.nutrition_type_name, - spu.unit_name,cm.unit_id - from cook_material cm - 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 - left join supply_product_unit spu on cm.unit_id = spu.unit_id - left join basic_area a on cm.area_id = a.area_id + iu.unit_name,cm.unit_id + from cook_material cm + 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 + left join ims_unit iu on cm.unit_id = iu.unit_id + left join basic_area a on cm.area_id = a.area_id + + insert into ims_warehouse_info diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketInfoMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketInfoMapper.xml index b8c53d6..32cccc9 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketInfoMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketInfoMapper.xml @@ -39,10 +39,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" si.min_delivery_time, si.select_time_interval, si.delivery_cost, si.auto_verify_day, si.delivery_way, si.refund_limit_time, si.if_relate_drp, si.meal_code, si.if_enable_pay_code, si.pay_code_url, si.del_flag, si.create_by, si.create_time, si.update_by, si.update_time, - ba.area_name, swi.warehouse_name + ba.area_name, iwi.warehouse_name from supermarket_info si left join basic_area ba on si.area_id = ba.area_id - left join supply_warehouse_info swi on swi.warehouse_id = si.warehouse_id + left join ims_warehouse_info iwi on iwi.warehouse_id = si.warehouse_id diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketProductMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketProductMapper.xml index 47d2568..6008429 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketProductMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketProductMapper.xml @@ -26,10 +26,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select sp.product_id, sp.supermarket_id, sp.material_id, sp.putaway_state, sp.if_online, sp.sale_price, sp.pref_price, sp.person_limit, sp.one_day_limit, sp.img_url, sp.inventory_num, sp.create_by, - sp.create_time, sp.update_by, sp.update_time, sm.material_name,smt.material_type_name, spu.unit_name + sp.create_time, sp.update_by, sp.update_time, sm.material_name,smt.material_type_name, iu.unit_name from supermarket_product sp left join supermarket_material sm on sm.material_id = sp.material_id - left join supply_product_unit spu on spu.unit_id = sm.unit_id + left join ims_unit iu on iu.unit_id = sm.unit_id left join supermarket_material_type smt on smt.material_type_id = sm.material_type_id @@ -58,11 +58,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sm.bar_code, sm.unit_id, sm.sale_price, sm.unit_price, sm.sales_mode, sm.shelf_life_type, 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, spu.unit_name + ba.area_name, smt.material_type_name, iu.unit_name from supermarket_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 supply_product_unit spu on spu.unit_id = sm.unit_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 and sm.area_id = #{areaId}