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/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 1709d66c..bf22d801 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; } 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; - } 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); 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} -