From c5914155ad2c003b112558bd90aa13327fc1ed20 Mon Sep 17 00:00:00 2001 From: zhangtq <2452618307@qq.com> Date: Thu, 6 Feb 2025 10:39:43 +0800 Subject: [PATCH] =?UTF-8?q?/api/v2/alloc/canteen/list-avail-pay-type--?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=A3=9F=E5=A0=82=E6=89=80=E6=9C=89=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E7=9A=84=E6=94=AF=E4=BB=98=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alloc/service/AllocMetadataService.java | 2 + .../impl/AllocMetadataServiceImpl.java | 1 + .../allocation/api/AllocPayMetadataApi.java | 27 ++ .../allocation/api/GlobalMetadataApi.java | 85 +++++ .../controller/AllocCanteenController.java | 45 +++ .../canteen/mapper/AllocCanteenMapper.java | 10 + .../canteen/mapper/AllocCanteenMapper.xml | 4 + .../canteen/model/AllocCanteen.java | 349 ++++++++++++++++++ .../canteen/service/AllocCanteenService.java | 10 + .../service/impl/AllocCanteenServiceImpl.java | 55 +++ 10 files changed, 588 insertions(+) create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/api/AllocPayMetadataApi.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/controller/AllocCanteenController.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/mapper/AllocCanteenMapper.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/mapper/AllocCanteenMapper.xml create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/model/AllocCanteen.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/service/AllocCanteenService.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/service/impl/AllocCanteenServiceImpl.java diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/alloc/service/AllocMetadataService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/alloc/service/AllocMetadataService.java index 88eb0fcf..a28ab7d4 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/alloc/service/AllocMetadataService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/alloc/service/AllocMetadataService.java @@ -9,4 +9,6 @@ import java.util.List; public interface AllocMetadataService { List listPayMetadataByType(MetadataModelTypeEnum modelType, Long canteenId, Long stallId); + + List listPayMetadataCacheable(MetadataModelTypeEnum modelTypeEnum); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/alloc/service/impl/AllocMetadataServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/alloc/service/impl/AllocMetadataServiceImpl.java index 5061c83b..4f31bd1d 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/alloc/service/impl/AllocMetadataServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/alloc/service/impl/AllocMetadataServiceImpl.java @@ -30,6 +30,7 @@ public class AllocMetadataServiceImpl extends ServiceImpl listPayMetadataCacheable(MetadataModelTypeEnum modelTypeEnum) { return this.listPayMetadataCacheable(modelTypeEnum.getKey()); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/api/AllocPayMetadataApi.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/api/AllocPayMetadataApi.java new file mode 100644 index 00000000..d851c15b --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/api/AllocPayMetadataApi.java @@ -0,0 +1,27 @@ +package com.bonus.core.allocation.api; + +import cn.hutool.core.util.StrUtil; +import com.bonus.core.common.enums.MetadataModelTypeEnum; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +@Component +public class AllocPayMetadataApi { + private static final Logger log = LoggerFactory.getLogger(AllocPayMetadataApi.class); + @Resource + @Lazy + private GlobalMetadataApi globalMetadataApi; + + + public List supportPayChannels(Long canteenId) { + String supportChannels = this.globalMetadataApi.getAvailableValue(MetadataModelTypeEnum.PAY, "payTypes", canteenId, (Long)null); + log.info("【支付配置】当前配置支持支付方式:{}", supportChannels); + return (List) StrUtil.splitTrim(supportChannels, ",").stream().filter(Objects::nonNull).map(Integer::valueOf).collect(Collectors.toList()); + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/api/GlobalMetadataApi.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/api/GlobalMetadataApi.java index d603ab09..90d1a713 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/api/GlobalMetadataApi.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/api/GlobalMetadataApi.java @@ -1,17 +1,25 @@ package com.bonus.core.allocation.api; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.bonus.constant.LeConstants; import com.bonus.core.allocation.alloc.model.AllocMetadata; import com.bonus.core.allocation.alloc.service.AllocMetadataService; +import com.bonus.core.allocation.canteen.model.AllocStall; import com.bonus.core.allocation.util.MetadataUtil; import com.bonus.core.common.enums.MetadataModelTypeEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; import javax.annotation.Resource; +import java.util.Iterator; import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; @Component public class GlobalMetadataApi { @@ -20,6 +28,10 @@ public class GlobalMetadataApi { @Lazy private AllocMetadataService allocMetadataService; + @Resource + @Lazy + private AllocStallApi allocStallApi; + public T getModel(MetadataModelTypeEnum modelTypeEnum, T t, Long canteenId, Long stallId) { List metadataList = this.getList(modelTypeEnum, canteenId, stallId); return MetadataUtil.transferToPayModel(metadataList, t); @@ -30,4 +42,77 @@ public class GlobalMetadataApi { Long finalStallId = ObjectUtil.equal(stallId, -1) ? null : stallId; return this.allocMetadataService.listPayMetadataByType(modelTypeEnum, finalCanteenId, finalStallId); } + + public String getAvailableValue(MetadataModelTypeEnum modelTypeEnum, String modelKey, Long canteenId, Long stallId) { + return this.getAvailableValue(modelTypeEnum, modelKey, "", canteenId, stallId); + } + + public String getAvailableValue(MetadataModelTypeEnum modelTypeEnum, String modelKey, String defaultValue, Long canteenId, Long stallId) { + List metadataList = this.getAvailableList(modelTypeEnum, canteenId, stallId); + return (String)metadataList.stream().filter((s) -> { + return StrUtil.equals(s.getModelKey(), modelKey); + }).map(AllocMetadata::getModelValue).filter(Objects::nonNull).findFirst().orElse(defaultValue); + } + + public List getAvailableList(MetadataModelTypeEnum modelTypeEnum, Long canteenId, Long stallId) { + if (ObjectUtil.isNotNull(stallId) && ObjectUtil.isNull(canteenId)) { + AllocStall stall = this.allocStallApi.getAllocStall(stallId); + if (!ObjectUtil.isNull(stall) && !ObjectUtil.isNull(stall.getCanteenId())) { + canteenId = stall.getCanteenId(); + } else { + log.warn("【配置项】未查到档口关联食堂:{},{},{}", new Object[]{modelTypeEnum, canteenId, stallId}); + } + } + + Long finalCanteenId = ObjectUtil.equal(canteenId, -1) ? null : canteenId; + Long finalStallId = ObjectUtil.equal(stallId, -1) ? null : stallId; + if (!modelTypeEnum.supportSeparated() || finalCanteenId == null && finalStallId == null) { + log.info("[配置]查询返回商户层配置信息"); + return this.allocMetadataService.listPayMetadataByType(modelTypeEnum, finalCanteenId, finalStallId); + } else { + List metadataList = (List)this.allocMetadataService.listPayMetadataCacheable(modelTypeEnum).stream().filter((s) -> { + return LeConstants.COMMON_YES.equals(s.getIfActive()); + }).collect(Collectors.toList()); + List stallList = CollUtil.newArrayList(new AllocMetadata[0]); + List canteenList = CollUtil.newArrayList(new AllocMetadata[0]); + List merchantList = CollUtil.newArrayList(new AllocMetadata[0]); + Iterator var11 = metadataList.iterator(); + + while(var11.hasNext()) { + AllocMetadata metadata = (AllocMetadata)var11.next(); + if (metadata.getStallId() != null) { + stallList.add(metadata); + } else if (metadata.getCanteenId() != null) { + canteenList.add(metadata); + } else { + merchantList.add(metadata); + } + } + + List result; + if (finalStallId != null && CollUtil.isNotEmpty(stallList)) { + log.warn("[配置]返回档口层配置信息,canteenId:{}, stallId:{}", canteenId, stallId); + result = (List)stallList.stream().filter((s) -> { + return ObjectUtil.equal(s.getStallId(), finalStallId); + }).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(result)) { + return result; + } + } + + if (finalCanteenId != null) { + log.warn("[配置]返回食堂层配置信息,canteenId:{}, stallId:{}", canteenId, stallId); + result = (List)canteenList.stream().filter((s) -> { + return ObjectUtil.equal(s.getCanteenId(), finalCanteenId); + }).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(result)) { + return result; + } + } + + log.warn("[配置]返回商户层配置信息,canteenId:{}, stallId:{}", canteenId, stallId); + return merchantList; + } + } + } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/controller/AllocCanteenController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/controller/AllocCanteenController.java new file mode 100644 index 00000000..776d1c3a --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/controller/AllocCanteenController.java @@ -0,0 +1,45 @@ +package com.bonus.core.allocation.canteen.controller; + +import cn.hutool.core.lang.tree.Tree; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.core.allocation.canteen.model.AllocCanteen; +import com.bonus.core.allocation.canteen.service.AllocCanteenService; +import com.bonus.core.allocation.canteen.service.AllocStallService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.time.LocalDate; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping({"/api/v2/alloc/canteen"}) +@Api( + tags = {"lsh_食堂档口相关控制器"} +) +public class AllocCanteenController { + private static final Logger log = LoggerFactory.getLogger(AllocCanteenController.class); + @Resource + @Lazy + private AllocCanteenService allocCanteenService; + + @ApiOperation("查询食堂所有开启的支付方式") + @PostMapping({"/list-avail-pay-type"}) + public AjaxResult listAvailPayTypeForApp(@RequestBody AllocCanteen bean) { + if (bean.getCanteenId() == null) { + return AjaxResult.error("食堂ID不能为空"); + } + return AjaxResult.success(this.allocCanteenService.listAvailPayTypeForApp(bean.getCanteenId())); + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/mapper/AllocCanteenMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/mapper/AllocCanteenMapper.java new file mode 100644 index 00000000..847ea091 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/mapper/AllocCanteenMapper.java @@ -0,0 +1,10 @@ +package com.bonus.core.allocation.canteen.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.bonus.core.allocation.canteen.model.AllocCanteen; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface AllocCanteenMapper extends BaseMapper { +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/mapper/AllocCanteenMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/mapper/AllocCanteenMapper.xml new file mode 100644 index 00000000..bf7a4a3f --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/mapper/AllocCanteenMapper.xml @@ -0,0 +1,4 @@ + + + + diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/model/AllocCanteen.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/model/AllocCanteen.java new file mode 100644 index 00000000..1a752d15 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/model/AllocCanteen.java @@ -0,0 +1,349 @@ +package com.bonus.core.allocation.canteen.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.bonus.core.common.utils.SysUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.time.LocalDateTime; +import java.time.LocalTime; + +@TableName("alloc_canteen") +@ApiModel("食堂信息表") +public class AllocCanteen { + @TableId + @ApiModelProperty("主键id") + private Long id; + @ApiModelProperty("食堂id") + private Long canteenId; + @ApiModelProperty("食堂编号") + private String canteenNum; + @ApiModelProperty("食堂名称") + private String canteenName; + @ApiModelProperty("区域id") + private Long areaId; + @ApiModelProperty("食堂业务类型") + private Integer canteenType; + @ApiModelProperty("第三方食堂id") + private String thirdCanteenId; + @ApiModelProperty("授权人员") + private Long effId; + @ApiModelProperty("人员id") + private Long custId; + @ApiModelProperty("联系电话") + private String contactTel; + @ApiModelProperty("主营项目") + private String mainProject; + @ApiModelProperty("食堂营业状态") + private Integer businessState; + @ApiModelProperty("营业时间") + private LocalTime startBusinessTime; + private LocalTime endBusinessTime; + @ApiModelProperty("食堂图片链接") + private String imgUrl; + @ApiModelProperty("最大容纳人数") + private Integer capacity; + @ApiModelProperty("是否启用支付配置") + private Integer ifEnablePay; + @ApiModelProperty("支付方式(多个数据之间使用,分隔)") + private String payTypes; + @ApiModelProperty("是否启用配送配置") + private Integer ifEnableDelivery; + @ApiModelProperty("配送方式(多个数据之间 使用,分隔)") + private String deliveries; + @ApiModelProperty("是否启用点餐配置") + private Integer ifEnableOrder; + @ApiModelProperty("是否支持报餐") + private Integer ifBook; + @ApiModelProperty("是否支持预定餐") + private Integer ifReserve; + @ApiModelProperty("是否启用收款码") + private Integer ifEnablePayCode; + @ApiModelProperty("食堂收款码链接") + private String payCodeUrl; + @ApiModelProperty("食堂特殊标识") + private Integer specialFlag; + @ApiModelProperty("是否删除") + private Integer ifDel; + @ApiModelProperty("备注") + private String remark; + @ApiModelProperty("创建人") + private String crby; + @ApiModelProperty("创建时间") + private LocalDateTime crtime; + @ApiModelProperty("更新人") + private String upby; + @ApiModelProperty("更新时间") + private LocalDateTime uptime; + + public AllocCanteen(Long canteenId) { + this.canteenId = canteenId; + } + + public AllocCanteen(Long canteenId, String canteenName, Long areaId, String thirdCanteenId) { + this.canteenId = canteenId; + this.canteenName = canteenName; + this.areaId = areaId; + this.thirdCanteenId = thirdCanteenId; + } + + public String getImgUrl() { + return SysUtil.getCutPath(this.imgUrl); + } + + public String getPayCodeUrl() { + return SysUtil.getCutPath(this.payCodeUrl); + } + + public Long getId() { + return this.id; + } + + public Long getCanteenId() { + return this.canteenId; + } + + public String getCanteenNum() { + return this.canteenNum; + } + + public String getCanteenName() { + return this.canteenName; + } + + public Long getAreaId() { + return this.areaId; + } + + public Integer getCanteenType() { + return this.canteenType; + } + + public String getThirdCanteenId() { + return this.thirdCanteenId; + } + + public Long getEffId() { + return this.effId; + } + + public Long getCustId() { + return this.custId; + } + + public String getContactTel() { + return this.contactTel; + } + + public String getMainProject() { + return this.mainProject; + } + + public Integer getBusinessState() { + return this.businessState; + } + + public LocalTime getStartBusinessTime() { + return this.startBusinessTime; + } + + public LocalTime getEndBusinessTime() { + return this.endBusinessTime; + } + + public Integer getCapacity() { + return this.capacity; + } + + public Integer getIfEnablePay() { + return this.ifEnablePay; + } + + public String getPayTypes() { + return this.payTypes; + } + + public Integer getIfEnableDelivery() { + return this.ifEnableDelivery; + } + + public String getDeliveries() { + return this.deliveries; + } + + public Integer getIfEnableOrder() { + return this.ifEnableOrder; + } + + public Integer getIfBook() { + return this.ifBook; + } + + public Integer getIfReserve() { + return this.ifReserve; + } + + public Integer getIfEnablePayCode() { + return this.ifEnablePayCode; + } + + public Integer getSpecialFlag() { + return this.specialFlag; + } + + public Integer getIfDel() { + return this.ifDel; + } + + public String getRemark() { + return this.remark; + } + + public String getCrby() { + return this.crby; + } + + public LocalDateTime getCrtime() { + return this.crtime; + } + + public String getUpby() { + return this.upby; + } + + public LocalDateTime getUptime() { + return this.uptime; + } + + public void setId(final Long id) { + this.id = id; + } + + public void setCanteenId(final Long canteenId) { + this.canteenId = canteenId; + } + + public void setCanteenNum(final String canteenNum) { + this.canteenNum = canteenNum; + } + + public void setCanteenName(final String canteenName) { + this.canteenName = canteenName; + } + + public void setAreaId(final Long areaId) { + this.areaId = areaId; + } + + public void setCanteenType(final Integer canteenType) { + this.canteenType = canteenType; + } + + public void setThirdCanteenId(final String thirdCanteenId) { + this.thirdCanteenId = thirdCanteenId; + } + + public void setEffId(final Long effId) { + this.effId = effId; + } + + public void setCustId(final Long custId) { + this.custId = custId; + } + + public void setContactTel(final String contactTel) { + this.contactTel = contactTel; + } + + public void setMainProject(final String mainProject) { + this.mainProject = mainProject; + } + + public void setBusinessState(final Integer businessState) { + this.businessState = businessState; + } + + public void setStartBusinessTime(final LocalTime startBusinessTime) { + this.startBusinessTime = startBusinessTime; + } + + public void setEndBusinessTime(final LocalTime endBusinessTime) { + this.endBusinessTime = endBusinessTime; + } + + public void setImgUrl(final String imgUrl) { + this.imgUrl = imgUrl; + } + + public void setCapacity(final Integer capacity) { + this.capacity = capacity; + } + + public void setIfEnablePay(final Integer ifEnablePay) { + this.ifEnablePay = ifEnablePay; + } + + public void setPayTypes(final String payTypes) { + this.payTypes = payTypes; + } + + public void setIfEnableDelivery(final Integer ifEnableDelivery) { + this.ifEnableDelivery = ifEnableDelivery; + } + + public void setDeliveries(final String deliveries) { + this.deliveries = deliveries; + } + + public void setIfEnableOrder(final Integer ifEnableOrder) { + this.ifEnableOrder = ifEnableOrder; + } + + public void setIfBook(final Integer ifBook) { + this.ifBook = ifBook; + } + + public void setIfReserve(final Integer ifReserve) { + this.ifReserve = ifReserve; + } + + public void setIfEnablePayCode(final Integer ifEnablePayCode) { + this.ifEnablePayCode = ifEnablePayCode; + } + + public void setPayCodeUrl(final String payCodeUrl) { + this.payCodeUrl = payCodeUrl; + } + + public void setSpecialFlag(final Integer specialFlag) { + this.specialFlag = specialFlag; + } + + public void setIfDel(final Integer ifDel) { + this.ifDel = ifDel; + } + + public void setRemark(final String remark) { + this.remark = remark; + } + + public void setCrby(final String crby) { + this.crby = crby; + } + + public void setCrtime(final LocalDateTime crtime) { + this.crtime = crtime; + } + + public void setUpby(final String upby) { + this.upby = upby; + } + + public void setUptime(final LocalDateTime uptime) { + this.uptime = uptime; + } + + public AllocCanteen() { + } +} 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 new file mode 100644 index 00000000..23a7d1b6 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/service/AllocCanteenService.java @@ -0,0 +1,10 @@ +package com.bonus.core.allocation.canteen.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.bonus.core.allocation.canteen.model.AllocCanteen; + +import java.util.List; + +public interface AllocCanteenService extends IService { + List listAvailPayTypeForApp(Long canteenId); +} 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 new file mode 100644 index 00000000..4ea61455 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/core/allocation/canteen/service/impl/AllocCanteenServiceImpl.java @@ -0,0 +1,55 @@ +package com.bonus.core.allocation.canteen.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.lang.tree.Tree; +import cn.hutool.core.lang.tree.TreeNodeConfig; +import cn.hutool.core.lang.tree.TreeUtil; +import cn.hutool.core.text.CharSequenceUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.bonus.constant.LeConstants; +import com.bonus.core.allocation.api.AllocMetadataApi; +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.AllocCanteenService; +import com.bonus.core.common.utils.TenantContextHolder; +import com.bonus.core.menu.vo.AppletReserveStallVO; +import com.bonus.utils.AesEncryptUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.lang.invoke.SerializedLambda; +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class AllocCanteenServiceImpl extends ServiceImpl implements AllocCanteenService { + private static final Logger log = LoggerFactory.getLogger(AllocCanteenServiceImpl.class); + private static final String CACHE_PREFIX = "yst:"; + private static final String CACHE_KEY = "alloc-canteen"; + private static final long CACHE_SECONDS = 3600L; + @Resource + @Lazy + private AllocPayMetadataApi allocPayMetadataApi; + + + @Override + public List listAvailPayTypeForApp(Long canteenId) { + return this.allocPayMetadataApi.supportPayChannels(canteenId); + } +}