From 76db58bf0661575f88f0d4f4eaee41e014c6ecf3 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 29 Apr 2025 09:47:57 +0800 Subject: [PATCH 1/2] bug 5803 --- .../java/com/bonus/common/houqin/constant/DelFlagEnum.java | 4 ++-- .../bonus/canteen/core/alloc/mapper/AllocAreaMapper.java | 2 ++ .../core/alloc/service/impl/AllocAreaServiceImpl.java | 7 ++++++- .../src/main/resources/mapper/alloc/AllocAreaMapper.xml | 5 +++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bonus-common-biz/src/main/java/com/bonus/common/houqin/constant/DelFlagEnum.java b/bonus-common-biz/src/main/java/com/bonus/common/houqin/constant/DelFlagEnum.java index a24cf4f..11f2fef 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/houqin/constant/DelFlagEnum.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/houqin/constant/DelFlagEnum.java @@ -1,8 +1,8 @@ package com.bonus.common.houqin.constant; public enum DelFlagEnum { - DEL_TRUE(2, "删除"), - DEL_FALSE(0, "正常"); + DEL_FALSE(0, "正常"), + DEL_TRUE(2, "删除"); private final Integer key; private final String value; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocAreaMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocAreaMapper.java index ceaac5f..13ac1c7 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocAreaMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocAreaMapper.java @@ -18,6 +18,8 @@ public interface AllocAreaMapper { */ public AllocArea selectAllocAreaByAreaId(Long areaId); + public AllocArea selectAllocAreaByAreaName(String areaName); + /** * 查询区域列表 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocAreaServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocAreaServiceImpl.java index d849190..834e5b9 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocAreaServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocAreaServiceImpl.java @@ -3,6 +3,7 @@ package com.bonus.canteen.core.alloc.service.impl; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; import com.bonus.canteen.core.common.domain.TreeSelect; import com.bonus.canteen.core.alloc.mapper.AllocAreaMapper; @@ -63,9 +64,13 @@ public class AllocAreaServiceImpl implements IAllocAreaService { public int insertAllocArea(AllocArea allocArea) { allocArea.setCreateTime(DateUtils.getNowDate()); try { + AllocArea checkResult = allocAreaMapper.selectAllocAreaByAreaName(allocArea.getAreaName()); + if (Objects.nonNull(checkResult)) { + throw new ServiceException("区域名称已存在"); + } return allocAreaMapper.insertAllocArea(allocArea); } catch (Exception e) { - throw new ServiceException("错误信息描述"); + throw new ServiceException("新增异常," + e.getMessage()); } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocAreaMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocAreaMapper.xml index 86bc3a3..ed29103 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocAreaMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocAreaMapper.xml @@ -42,6 +42,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where area_id = #{areaId} + + insert into alloc_area From 059bd787c7329c5033e45e71d0866f41debb5f96 Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Tue, 29 Apr 2025 09:48:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/android/UserMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/android/UserMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/android/UserMapper.xml index a541356..0978245 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/android/UserMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/android/UserMapper.xml @@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from sys_user su left join acc_card ac on ac.user_id = su.user_id left join acc_info ai on ai.user_id = su.user_id - where ai.del_flag = '2' + where ai.del_flag = '0' AND su.update_time >= #{time} - INTERVAL 5 SECOND;