This commit is contained in:
gaowdong 2025-02-21 09:36:29 +08:00
commit 4a6b44d2cb
8 changed files with 83 additions and 23 deletions

View File

@ -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<AppletReserveCanteenVO> reserveCanteenList) {
// this.allocCanteenService.checkAndDelReserveCanteen(reserveCanteenList);
// }
public void checkAndDelReserveCanteen(List<AppletReserveCanteenVO> 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));

View File

@ -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<AllocCanteen> {
List<Long> getCanteenIdListByAreaIdList(List<Long> areaIdList);
List<AllocCanteenStallVO> listAllCanteenStall();
void checkAndDelReserveCanteen(List<AppletReserveCanteenVO> reserveCanteenList);
}

View File

@ -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<AllocCanteenMapper, AllocCanteen> implements AllocCanteenService {
@ -61,6 +65,7 @@ public class AllocCanteenServiceImpl extends ServiceImpl<AllocCanteenMapper, All
}
}
@Override
public List<AllocCanteenStallVO> listAllCanteenStall() {
List<AllocCanteenStallVO> canteenList = ((AllocCanteenMapper)this.baseMapper).listAllCanteenStall(LeConstants.COMMON_NO, AllocCanteenTypeEnum.CANTEEN.getKey());
if (CollUtil.isEmpty(canteenList)) {
@ -72,4 +77,60 @@ public class AllocCanteenServiceImpl extends ServiceImpl<AllocCanteenMapper, All
return canteenList;
}
}
@Override
public void checkAndDelReserveCanteen(List<AppletReserveCanteenVO> reserveCanteenList) {
List<Long> canteenIdList = new ArrayList();
List<Long> stallIdList = new ArrayList();
Iterator var4 = reserveCanteenList.iterator();
while(true) {
AppletReserveCanteenVO reserveCanteen;
do {
if (!var4.hasNext()) {
List<AllocCanteen> allocCanteenList = this.list((Wrapper<AllocCanteen>) Wrappers.lambdaQuery(AllocCanteen.class).select(AllocCanteen::getCanteenId, AllocCanteen::getIfReserve).in(AllocCanteen::getCanteenId, canteenIdList));
Map<Long, Integer> allocCanteenMap = (Map)allocCanteenList.stream().collect(Collectors.toMap(AllocCanteen::getCanteenId, AllocCanteen::getIfReserve));
Map<Long, Integer> allocStallMap = new HashMap();
if (CollUtil.isNotEmpty(stallIdList)) {
List<AllocStall> allocStallList = this.allocStallMapper.selectList((Wrapper<AllocStall>)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<AppletReserveCanteenVO> 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<AppletReserveStallVO> 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());
}
}
}
}

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<MenuRecipeMapper, MenuRec
@Autowired
private TransactionDefinition transactionDefinition;
@Autowired
private AllocCanteenApi allocCanteenApi;
@Override
public List<AppletWeekCanteenVO> getWeekMealList(AppletWeekCanteenDTO content) {
Set<Long> effIdSet = this.getShopstallIdListByCustId(content.getCustId(), false);
@ -179,10 +183,12 @@ public class MenuRecipeServiceImpl extends ServiceImpl<MenuRecipeMapper, MenuRec
effIdSet = Sets.newTreeSet();
((Set)effIdSet).add(-1L);
}
List<AppletReserveCanteenVO> resultList = this.menuAppRecipeMapper.selectReserveMealCanteenList((Set)effIdSet);
if (ObjectUtil.isEmpty(resultList)) {
return resultList;
} else {
this.allocCanteenApi.checkAndDelReserveCanteen(resultList);
List<Long> 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<MenuRecipeMapper, MenuRec
}).collect(Collectors.toList());
}
@Override
public Set<Long> changeSurplusNum(List<MenuRecipeChangeSurplusNum> changeSurplusNumList, Long custId, Integer mealtimeType,
LocalDate ordGoodsDate) {
this.checkChangeSurplusNum(changeSurplusNumList, ordGoodsDate, mealtimeType);

View File

@ -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}