From c8427638985e85040d4e0994c875933f3f2a4fa4 Mon Sep 17 00:00:00 2001 From: liux <963924687@qq.com> Date: Thu, 20 Feb 2025 13:02:10 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/core/customer/controller/CustAddrController.java | 6 +++--- .../bonus/core/customer/controller/CustInfoController.java | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/customer/controller/CustAddrController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/customer/controller/CustAddrController.java index e09334dd..358ce682 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/customer/controller/CustAddrController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/customer/controller/CustAddrController.java @@ -68,9 +68,9 @@ public class CustAddrController extends BaseController { .eq(CustAddr::getCustId, casual.getCustId()) .eq(CustAddr::getIfDel, LeConstants.COMMON_NO) .orderByDesc(CustAddr::getId)); - custAddrList.forEach((custAddr) -> { - custAddr.setMobile(this.aesEncryptUtil.aesEncrypt(custAddr.getMobile())); - }); +// custAddrList.forEach((custAddr) -> { +// custAddr.setMobile(this.aesEncryptUtil.aesEncrypt(custAddr.getMobile())); +// }); return success(custAddrList); } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/customer/controller/CustInfoController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/customer/controller/CustInfoController.java index b8a60fa8..1d0e8b16 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/customer/controller/CustInfoController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/customer/controller/CustInfoController.java @@ -89,6 +89,7 @@ public class CustInfoController extends BaseController { //System.out.println(sm4Decrypt("29G1AUHDmLvPe1tt0t12Dw==##encrypted")); result.setMobile(sm4Decrypt(result.getMobile())); result.setCustName(sm4Decrypt(result.getCustName())); + result.setIdCard(sm4Decrypt(result.getIdCard())); ar.put("data", result); return ar; } From 4cdef0b7518ab866df4ccea387582fc461fae91b Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Thu, 20 Feb 2025 13:04:36 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap-smart_canteen_local.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/bootstrap-smart_canteen_local.yml b/bonus-modules/bonus-smart-canteen/src/main/resources/bootstrap-smart_canteen_local.yml index 16ba80b2..8a054aaa 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/bootstrap-smart_canteen_local.yml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/bootstrap-smart_canteen_local.yml @@ -34,11 +34,5 @@ mybatis: map-underscore-to-camel-case: true -system: - sysfile: - prefixOffline: http://localhost:9000/lnyst - prefixOnline: http://localhost:9000/lnyst - bucket: /lnyst - From 244755f7ce5279a7e45a0162dce0ec6711c560b6 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Thu, 20 Feb 2025 13:10:58 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap-smart_canteen_local.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/bootstrap-smart_canteen_local.yml b/bonus-modules/bonus-smart-canteen/src/main/resources/bootstrap-smart_canteen_local.yml index 1331287c..8a054aaa 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/bootstrap-smart_canteen_local.yml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/bootstrap-smart_canteen_local.yml @@ -34,13 +34,5 @@ mybatis: map-underscore-to-camel-case: true -system: - sysfile: - prefixOffline: http://localhost:9000/lnyst - prefixOnline: http://localhost:9000/lnyst - bucket: /lnyst - notify: - notify-url: ${NOTIFY_UNIFY_URL:/smart-canteen/api/v2/pay/ali/notify} - From ac0a15597c231194ff656786809e6ae8ab05b152 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Thu, 20 Feb 2025 14:17:17 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/core/menu/dto/AppletReserveCanteenDTO.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/menu/dto/AppletReserveCanteenDTO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/menu/dto/AppletReserveCanteenDTO.java index cc091a4b..c7a44388 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/menu/dto/AppletReserveCanteenDTO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/menu/dto/AppletReserveCanteenDTO.java @@ -7,11 +7,6 @@ import javax.validation.constraints.NotNull; @Data public class AppletReserveCanteenDTO { - @ApiModelProperty("菜谱日期") - private @NotNull(message = "菜谱id不能为空") String applyDate; @ApiModelProperty("人员id") private Long custId; - @ApiModelProperty("菜谱id") - private Long recipeId; - } From 7fa5b3d685e5c37fd6115196fc3438068d240664 Mon Sep 17 00:00:00 2001 From: skjia <106962133@qq.com> Date: Thu, 20 Feb 2025 15:14:34 +0800 Subject: [PATCH 5/5] =?UTF-8?q?jsk=20=20=20getReserveMealCanteenList=20=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/allocation/api/AllocCanteenApi.java | 7 +- .../canteen/service/AllocCanteenService.java | 3 + .../service/impl/AllocCanteenServiceImpl.java | 69 +++++++++++++++++-- .../service/impl/MenuRecipeServiceImpl.java | 7 ++ 4 files changed, 79 insertions(+), 7 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/api/AllocCanteenApi.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/api/AllocCanteenApi.java index bbb1d9c2..f7837bfe 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/api/AllocCanteenApi.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/api/AllocCanteenApi.java @@ -10,6 +10,7 @@ import com.bonus.core.allocation.canteen.service.AllocAreaService; import com.bonus.core.allocation.canteen.service.AllocCanteenService; import com.bonus.core.allocation.canteen.service.AllocMealLineService; import com.bonus.core.allocation.canteen.vo.AllocAreaFullNameVO; +import com.bonus.core.menu.vo.AppletReserveCanteenVO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -145,9 +146,9 @@ public class AllocCanteenApi { // return this.allocCanteenService.checkCanteenIfReserve(canteenId, stallId); // } // -// public void checkAndDelReserveCanteen(List reserveCanteenList) { -// this.allocCanteenService.checkAndDelReserveCanteen(reserveCanteenList); -// } + public void checkAndDelReserveCanteen(List reserveCanteenList) { + this.allocCanteenService.checkAndDelReserveCanteen(reserveCanteenList); + } // // public boolean checkCanteenBookExist() { // long bookNum = this.allocCanteenService.count((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(AllocCanteen.class).eq(AllocCanteen::getIfBook, LeConstants.COMMON_YES)).eq(AllocCanteen::getIfDel, LeConstants.COMMON_NO)); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/service/AllocCanteenService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/service/AllocCanteenService.java index 99115b87..3c4d4ce1 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/service/AllocCanteenService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/service/AllocCanteenService.java @@ -3,6 +3,7 @@ package com.bonus.core.allocation.canteen.service; import com.baomidou.mybatisplus.extension.service.IService; import com.bonus.core.allocation.canteen.model.AllocCanteen; import com.bonus.core.allocation.canteen.vo.AllocCanteenStallVO; +import com.bonus.core.menu.vo.AppletReserveCanteenVO; import java.util.List; @@ -12,4 +13,6 @@ public interface AllocCanteenService extends IService { List getCanteenIdListByAreaIdList(List areaIdList); List listAllCanteenStall(); + + void checkAndDelReserveCanteen(List reserveCanteenList); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/service/impl/AllocCanteenServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/service/impl/AllocCanteenServiceImpl.java index c0644bf4..1162d252 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/service/impl/AllocCanteenServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/service/impl/AllocCanteenServiceImpl.java @@ -1,16 +1,22 @@ package com.bonus.core.allocation.canteen.service.impl; import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.bonus.constant.LeConstants; import com.bonus.core.allocation.api.AllocPayMetadataApi; import com.bonus.core.allocation.canteen.mapper.AllocCanteenMapper; import com.bonus.core.allocation.canteen.mapper.AllocStallMapper; import com.bonus.core.allocation.canteen.model.AllocCanteen; +import com.bonus.core.allocation.canteen.model.AllocStall; import com.bonus.core.allocation.canteen.service.AllocAreaService; import com.bonus.core.allocation.canteen.service.AllocCanteenService; import com.bonus.core.allocation.canteen.vo.AllocCanteenStallVO; import com.bonus.core.common.enums.AllocCanteenTypeEnum; +import com.bonus.core.menu.vo.AppletReserveCanteenVO; +import com.bonus.core.menu.vo.AppletReserveStallVO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -18,10 +24,8 @@ import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; @Service public class AllocCanteenServiceImpl extends ServiceImpl implements AllocCanteenService { @@ -61,6 +65,7 @@ public class AllocCanteenServiceImpl extends ServiceImpl listAllCanteenStall() { List canteenList = ((AllocCanteenMapper)this.baseMapper).listAllCanteenStall(LeConstants.COMMON_NO, AllocCanteenTypeEnum.CANTEEN.getKey()); if (CollUtil.isEmpty(canteenList)) { @@ -72,4 +77,60 @@ public class AllocCanteenServiceImpl extends ServiceImpl reserveCanteenList) { + List canteenIdList = new ArrayList(); + List stallIdList = new ArrayList(); + Iterator var4 = reserveCanteenList.iterator(); + + while(true) { + AppletReserveCanteenVO reserveCanteen; + do { + if (!var4.hasNext()) { + List allocCanteenList = this.list((Wrapper) Wrappers.lambdaQuery(AllocCanteen.class).select(AllocCanteen::getCanteenId, AllocCanteen::getIfReserve).in(AllocCanteen::getCanteenId, canteenIdList)); + Map allocCanteenMap = (Map)allocCanteenList.stream().collect(Collectors.toMap(AllocCanteen::getCanteenId, AllocCanteen::getIfReserve)); + Map allocStallMap = new HashMap(); + if (CollUtil.isNotEmpty(stallIdList)) { + List allocStallList = this.allocStallMapper.selectList((Wrapper)Wrappers.lambdaQuery(AllocStall.class).select(AllocStall::getStallId, AllocStall::getIfReserve).in(AllocStall::getStallId, stallIdList)); + allocStallMap = (Map)allocStallList.stream().collect(Collectors.toMap(AllocStall::getStallId, AllocStall::getIfReserve)); + } + + Iterator canteenIterator = reserveCanteenList.iterator(); + + while(true) { + while(canteenIterator.hasNext()) { + AppletReserveCanteenVO reserveCanteenVO = (AppletReserveCanteenVO)canteenIterator.next(); + Integer canteenIfReserve = (Integer)allocCanteenMap.get(reserveCanteenVO.getCanteenId()); + if (!LeConstants.COMMON_YES.equals(canteenIfReserve)) { + canteenIterator.remove(); + } else if (CollUtil.isNotEmpty(reserveCanteenVO.getStallList())) { + Iterator stallIterator = reserveCanteenVO.getStallList().iterator(); + + while(stallIterator.hasNext()) { + AppletReserveStallVO reserveStallVO = (AppletReserveStallVO)stallIterator.next(); + Integer stallIfReserve = (Integer)((Map)allocStallMap).get(reserveStallVO.getStallId()); + if (!LeConstants.COMMON_YES.equals(stallIfReserve)) { + stallIterator.remove(); + } + } + } + } + + return; + } + } + + reserveCanteen = (AppletReserveCanteenVO)var4.next(); + canteenIdList.add(reserveCanteen.getCanteenId()); + } while(!CollUtil.isNotEmpty(reserveCanteen.getStallList())); + + Iterator var6 = reserveCanteen.getStallList().iterator(); + + while(var6.hasNext()) { + AppletReserveStallVO reserveStall = (AppletReserveStallVO)var6.next(); + stallIdList.add(reserveStall.getStallId()); + } + } + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/menu/service/impl/MenuRecipeServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/menu/service/impl/MenuRecipeServiceImpl.java index d9a7e62e..942ab8c4 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/menu/service/impl/MenuRecipeServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/menu/service/impl/MenuRecipeServiceImpl.java @@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.bonus.common.core.exception.ServiceException; import com.bonus.constant.DelFlagEnum; +import com.bonus.core.allocation.api.AllocCanteenApi; import com.bonus.core.allocation.api.AllocDeliveryApi; import com.bonus.core.allocation.api.AllocMealtimeApi; import com.bonus.core.allocation.canteen.model.AllocDeliveryCostModel; @@ -101,6 +102,9 @@ public class MenuRecipeServiceImpl extends ServiceImpl getWeekMealList(AppletWeekCanteenDTO content) { Set effIdSet = this.getShopstallIdListByCustId(content.getCustId(), false); @@ -179,10 +183,12 @@ public class MenuRecipeServiceImpl extends ServiceImpl resultList = this.menuAppRecipeMapper.selectReserveMealCanteenList((Set)effIdSet); if (ObjectUtil.isEmpty(resultList)) { return resultList; } else { + this.allocCanteenApi.checkAndDelReserveCanteen(resultList); List stallIdList = (List)resultList.stream().flatMap((canteen) -> { return canteen.getStallList().stream().map(AppletReserveStallVO::getStallId); }).collect(Collectors.toList()); @@ -461,6 +467,7 @@ public class MenuRecipeServiceImpl extends ServiceImpl changeSurplusNum(List changeSurplusNumList, Long custId, Integer mealtimeType, LocalDate ordGoodsDate) { this.checkChangeSurplusNum(changeSurplusNumList, ordGoodsDate, mealtimeType);