From ca6db30a525a5171b20d235d9b179667ce158df2 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Thu, 3 Jul 2025 11:22:52 +0800 Subject: [PATCH] =?UTF-8?q?bug-6674-=E6=94=B9=E9=A3=9F=E5=A0=82=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E6=97=B6=E5=90=8C=E6=97=B6=E6=94=B9=E6=A1=A3=E5=8F=A3?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canteen/core/basic/mapper/BasicStallMapper.java | 2 ++ .../core/basic/service/impl/BasicCanteenServiceImpl.java | 9 ++++++++- .../src/main/resources/mapper/basic/BasicStallMapper.xml | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/basic/mapper/BasicStallMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/basic/mapper/BasicStallMapper.java index 9aa3a76..dedeeb3 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/basic/mapper/BasicStallMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/basic/mapper/BasicStallMapper.java @@ -46,6 +46,8 @@ public interface BasicStallMapper { */ public int updateBasicStall(BasicStall basicStall); + public int updateStallToNewAreaId(BasicStall basicStall); + /** * 删除档口信息 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/basic/service/impl/BasicCanteenServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/basic/service/impl/BasicCanteenServiceImpl.java index f0b23b8..dbeba78 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/basic/service/impl/BasicCanteenServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/basic/service/impl/BasicCanteenServiceImpl.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Objects; import java.util.stream.Collectors; +import com.bonus.canteen.core.basic.domain.BasicStall; import com.bonus.canteen.core.basic.mapper.BasicStallMapper; import com.bonus.canteen.core.utils.BnsConstants; import com.bonus.common.core.exception.ServiceException; @@ -90,7 +91,13 @@ public class BasicCanteenServiceImpl implements IBasicCanteenService { if (otherCanteenNameList.contains(basicCanteen.getCanteenName())) { throw new ServiceException("该区域食堂名称已存在"); } - return basicCanteenMapper.updateBasicCanteen(basicCanteen); + int count = basicCanteenMapper.updateBasicCanteen(basicCanteen); + //食堂更换区域id时,同时更换档口区域id + BasicStall basicStall = new BasicStall(); + basicStall.setAreaId(basicCanteen.getAreaId()); + basicStall.setCanteenId(basicCanteen.getCanteenId()); + basicStallMapper.updateStallToNewAreaId(basicStall); + return count; } catch (Exception e) { throw new ServiceException(e.getMessage()); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/basic/BasicStallMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/basic/BasicStallMapper.xml index bc51e95..42abd42 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/basic/BasicStallMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/basic/BasicStallMapper.xml @@ -159,6 +159,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where stall_id = #{stallId} + + update basic_stall set area_id = #{areaId} + where canteen_id = #{canteenId} + + update basic_stall set del_flag = '2' where stall_id = #{stallId}