From 971846e60e2445284f28ab22e9777f2cac2132c3 Mon Sep 17 00:00:00 2001 From: wangpengfei <1928057482@qq.com> Date: Thu, 18 Jan 2024 16:43:05 +0800 Subject: [PATCH] 1/18 --- .../api/customerstore/CustomerStore.java | 31 + .../api/customerstore/CustomerStoreDto.java | 28 + .../api/customerstore/CustomerStoreQuery.java | 15 + .../api/customerstore/CustomerStoreVo.java | 33 + .../VegeCellarReserveDetails.java | 26 + .../VegeCellarReserveDetailsDto.java | 14 + .../VegeCellarReserveDetailsQuery.java | 8 + .../api/vegecallerreserveorder/Goods.java | 17 + .../LpkReserveOrderCardVo.java | 56 ++ .../vegecallerreserveorder/MergeStrategy.java | 92 +++ .../vegecallerreserveorder/OrderGoodsVo.java | 15 + .../ReserveOrderExport.java | 55 ++ .../ReserveOrderExportByBank.java | 48 ++ .../ReserveOrderExportByStore.java | 50 ++ .../ReserveOrderExportByZ.java | 36 + .../VegeCellarReserveOrder.java | 29 + .../VegeCellarReserveOrderDto.java | 26 + .../VegeCellarReserveOrderQuery.java | 21 + .../VegeCellarReserveOrderVo.java | 39 + .../appletgiftbag/AppletGiftBagService.java | 2 +- .../customerstore/CustomerStoreMapper.java | 16 + .../biz/customerstore/CustomerStoreMapper.xml | 11 + .../biz/customerstore/CustomerStoreRest.java | 30 + .../customerstore/CustomerStoreService.java | 32 + .../biz/lpkcustomer/LpkCustomerService.java | 1 + .../biz/lpkgoods/LpkGoodsService.java | 4 - .../VegeCellarReserveDetailsMapper.java | 28 + .../VegeCellarReserveDetailsMapper.xml | 37 + .../VegeCellarReserveDetailsRest.java | 25 + .../VegeCellarReserveDetailsService.java | 67 ++ .../VegeCellarReserveOrderMapper.java | 44 ++ .../VegeCellarReserveOrderMapper.xml | 488 +++++++++++++ .../VegeCellarReserveOrderRest.java | 90 +++ .../VegeCellarReserveOrderService.java | 666 ++++++++++++++++++ .../yxt/yythmall/config/SaTokenConfigure.java | 1 + 35 files changed, 2176 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/yxt/yythmall/api/customerstore/CustomerStore.java create mode 100644 src/main/java/com/yxt/yythmall/api/customerstore/CustomerStoreDto.java create mode 100644 src/main/java/com/yxt/yythmall/api/customerstore/CustomerStoreQuery.java create mode 100644 src/main/java/com/yxt/yythmall/api/customerstore/CustomerStoreVo.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreservedetails/VegeCellarReserveDetails.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreservedetails/VegeCellarReserveDetailsDto.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreservedetails/VegeCellarReserveDetailsQuery.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/Goods.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/LpkReserveOrderCardVo.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/MergeStrategy.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/OrderGoodsVo.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExport.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExportByBank.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExportByStore.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExportByZ.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrder.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderDto.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderQuery.java create mode 100644 src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderVo.java create mode 100644 src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreMapper.java create mode 100644 src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreMapper.xml create mode 100644 src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreRest.java create mode 100644 src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreService.java create mode 100644 src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsMapper.java create mode 100644 src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsMapper.xml create mode 100644 src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsRest.java create mode 100644 src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsService.java create mode 100644 src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.java create mode 100644 src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.xml create mode 100644 src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderRest.java create mode 100644 src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java diff --git a/src/main/java/com/yxt/yythmall/api/customerstore/CustomerStore.java b/src/main/java/com/yxt/yythmall/api/customerstore/CustomerStore.java new file mode 100644 index 0000000..e60e953 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/customerstore/CustomerStore.java @@ -0,0 +1,31 @@ +package com.yxt.yythmall.api.customerstore; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.util.Date; +import java.util.UUID; + +/** + * @author wangpengfei + * @date 2023/11/21 15:06 + */ +@ApiModel(value = "礼包包含商品信息", description = "礼包包含商品信息") +@TableName("customer_store") +@Data +public class CustomerStore { + private String id; + private String sid = UUID.randomUUID().toString(); + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String customerSid; + private String storeSid; +// private String isGrounding; + private String phone; + private String name; + +} diff --git a/src/main/java/com/yxt/yythmall/api/customerstore/CustomerStoreDto.java b/src/main/java/com/yxt/yythmall/api/customerstore/CustomerStoreDto.java new file mode 100644 index 0000000..a6b8388 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/customerstore/CustomerStoreDto.java @@ -0,0 +1,28 @@ +package com.yxt.yythmall.api.customerstore; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2023/11/21 15:13 + */ +@ApiModel(value = "礼包包含商品信息 数据传输对象", description = "礼包包含商品信息 数据传输对象") +@Data +public class CustomerStoreDto implements Dto { + private String id; + private String sid ; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String customerSid; + private String storeSid; + // private String isGrounding; + private String phone; + private String name; +} diff --git a/src/main/java/com/yxt/yythmall/api/customerstore/CustomerStoreQuery.java b/src/main/java/com/yxt/yythmall/api/customerstore/CustomerStoreQuery.java new file mode 100644 index 0000000..d48f97f --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/customerstore/CustomerStoreQuery.java @@ -0,0 +1,15 @@ +package com.yxt.yythmall.api.customerstore; + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/11/21 15:31 + */ +@ApiModel(value = "礼包包含商品信息 查询条件", description = "礼包包含商品信息 查询条件") +@Data +public class CustomerStoreQuery implements Query { + +} diff --git a/src/main/java/com/yxt/yythmall/api/customerstore/CustomerStoreVo.java b/src/main/java/com/yxt/yythmall/api/customerstore/CustomerStoreVo.java new file mode 100644 index 0000000..f88070b --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/customerstore/CustomerStoreVo.java @@ -0,0 +1,33 @@ +package com.yxt.yythmall.api.customerstore; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2023/11/21 15:12 + */ +@Data +@ApiModel(value = "礼包包含商品信息 视图数据对象", description = "礼包包含商品信息 视图数据对象") +@NoArgsConstructor +public class CustomerStoreVo implements Vo { + private String id; + private String sid ; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String customerSid; + private String storeSid; + private String storeName;//提货点名称 + private String businessHours;//营业时间 + private String address;//地址 + // private String isGrounding; + private String phone;//电话 + private String name;//姓名 +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreservedetails/VegeCellarReserveDetails.java b/src/main/java/com/yxt/yythmall/api/vegecallerreservedetails/VegeCellarReserveDetails.java new file mode 100644 index 0000000..6f9754b --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreservedetails/VegeCellarReserveDetails.java @@ -0,0 +1,26 @@ +package com.yxt.yythmall.api.vegecallerreservedetails; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; +import java.util.UUID; + +/** + * @author wangpengfei + * @date 2023/11/23 10:29 + */ +@Data +public class VegeCellarReserveDetails { + private String id; + private String sid= UUID.randomUUID().toString(); + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date createTime; + private String remarks; + private String cardSid; + private String goodsSid; + private double goodsNumber=0; + private String num; + private String orderSid; + private String goodsName; +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreservedetails/VegeCellarReserveDetailsDto.java b/src/main/java/com/yxt/yythmall/api/vegecallerreservedetails/VegeCellarReserveDetailsDto.java new file mode 100644 index 0000000..04e36e0 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreservedetails/VegeCellarReserveDetailsDto.java @@ -0,0 +1,14 @@ +package com.yxt.yythmall.api.vegecallerreservedetails; + +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/11/23 10:29 + */ +@Data +public class VegeCellarReserveDetailsDto { + private String cardSid; + private String goodsSid; + private String goodsNumber; +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreservedetails/VegeCellarReserveDetailsQuery.java b/src/main/java/com/yxt/yythmall/api/vegecallerreservedetails/VegeCellarReserveDetailsQuery.java new file mode 100644 index 0000000..79964e2 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreservedetails/VegeCellarReserveDetailsQuery.java @@ -0,0 +1,8 @@ +package com.yxt.yythmall.api.vegecallerreservedetails; + +/** + * @author wangpengfei + * @date 2023/11/23 10:30 + */ +public class VegeCellarReserveDetailsQuery { +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/Goods.java b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/Goods.java new file mode 100644 index 0000000..d763745 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/Goods.java @@ -0,0 +1,17 @@ +package com.yxt.yythmall.api.vegecallerreserveorder; + +import com.yxt.common.core.utils.ExportEntityMap; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/11/23 14:34 + */ +@Data +public class Goods { + private double goodsNumber;//数量 + private String goodsSid;//商品sid + @ExportEntityMap(CnName = "商品明细", EnName = "goodsInfo") + private String goodsInfo; + +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/LpkReserveOrderCardVo.java b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/LpkReserveOrderCardVo.java new file mode 100644 index 0000000..32d80a4 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/LpkReserveOrderCardVo.java @@ -0,0 +1,56 @@ +package com.yxt.yythmall.api.vegecallerreserveorder; + +import cn.hutool.core.date.DateUtil; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.vo.Vo; +import com.yxt.yythmall.api.lpkgiftcard.GoodsVo; +import lombok.Data; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * @author Fan + * @description + * @date 2023/11/27 16:53 + */ +@Data +public class LpkReserveOrderCardVo implements Vo { + private String code; //卡号 + private String sid; +// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8") + private Date reserveDate; //预约时间 + private String store; //提货门店 + private String storeSid; //提货门店 + private String bagName; //礼包 + private String cardSid; // 提货卡sid + private String orderSid; //预约订单sid + private String userName; + private String userPhone; + private String state;//提货状态 + private List goodsVos; + private String goods; + private String serialNumber; + private String type; + + public String getBagName() { + if(StringUtils.isBlank(bagName)){ + bagName="福礼卡"; + } + return bagName; + } + + public String getState() { + SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); + int c= DateUtil.parse(sdf.format(reserveDate)).compareTo(DateUtil.parse(sdf.format(new Date()))); + if(String.valueOf(c).equals("-1")){ + this.state="已提货"; + }else{ + this.state="未提货"; + } + return state; + } +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/MergeStrategy.java b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/MergeStrategy.java new file mode 100644 index 0000000..922084b --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/MergeStrategy.java @@ -0,0 +1,92 @@ +package com.yxt.yythmall.api.vegecallerreserveorder; + +import com.alibaba.excel.metadata.Head; +import com.alibaba.excel.write.merge.AbstractMergeStrategy; +import org.apache.commons.collections.map.HashedMap; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.util.CellRangeAddress; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * @author wangpengfei + * @date 2023/12/15 13:43 + */ +public class MergeStrategy extends AbstractMergeStrategy { + + // 合并的列编号,从0开始,指定的index或自己按字段顺序数 + private Set mergeCellIndex = new HashSet<>(); + + // 数据集大小,用于区别结束行位置 + private Integer maxRow = 0; + + // 禁止无参声明 + private MergeStrategy() { + } + + public MergeStrategy(Integer maxRow, int... mergeCellIndex) { + Arrays.stream(mergeCellIndex).forEach(item -> { + this.mergeCellIndex.add(item); + }); + this.maxRow = maxRow; + } + + // 记录上一次合并的信息 + private Map lastRow = new HashedMap(); + + // 每行每列都会进入,绝对不要在这写循环 + @Override + protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) { + int currentCellIndex = cell.getColumnIndex(); + // 判断该行是否需要合并 + if (mergeCellIndex.contains(currentCellIndex)) { + String currentCellValue = cell.getStringCellValue(); + int currentRowIndex = cell.getRowIndex(); + if (!lastRow.containsKey(currentCellIndex)) { + // 记录首行起始位置 + lastRow.put(currentCellIndex, new MergeRange(currentCellValue, currentRowIndex, currentRowIndex, currentCellIndex, currentCellIndex)); + return; + } + //有上行这列的值了,拿来对比. + MergeRange mergeRange = lastRow.get(currentCellIndex); + if (!(mergeRange.lastValue != null && mergeRange.lastValue.equals(currentCellValue))) { + // 结束的位置触发下合并. + // 同行同列不能合并,会抛异常 + if (mergeRange.startRow != mergeRange.endRow || mergeRange.startCell != mergeRange.endCell) { + sheet.addMergedRegionUnsafe(new CellRangeAddress(mergeRange.startRow, mergeRange.endRow, mergeRange.startCell, mergeRange.endCell)); + } + // 更新当前列起始位置 + lastRow.put(currentCellIndex, new MergeRange(currentCellValue, currentRowIndex, currentRowIndex, currentCellIndex, currentCellIndex)); + } + // 合并行 + 1 + mergeRange.endRow += 1; + // 结束的位置触发下最后一次没完成的合并 + if (relativeRowIndex.equals(maxRow - 1)) { + MergeRange lastMergeRange = lastRow.get(currentCellIndex); + // 同行同列不能合并,会抛异常 + if (lastMergeRange.startRow != lastMergeRange.endRow || lastMergeRange.startCell != lastMergeRange.endCell) { + sheet.addMergedRegionUnsafe(new CellRangeAddress(lastMergeRange.startRow, lastMergeRange.endRow, lastMergeRange.startCell, lastMergeRange.endCell)); + } + } + } + } +} +class MergeRange { + public int startRow; + public int endRow; + public int startCell; + public int endCell; + public String lastValue; + + public MergeRange(String lastValue, int startRow, int endRow, int startCell, int endCell) { + this.startRow = startRow; + this.endRow = endRow; + this.startCell = startCell; + this.endCell = endCell; + this.lastValue = lastValue; + } +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/OrderGoodsVo.java b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/OrderGoodsVo.java new file mode 100644 index 0000000..067c42a --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/OrderGoodsVo.java @@ -0,0 +1,15 @@ +package com.yxt.yythmall.api.vegecallerreserveorder; + +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +/** + * @author Fan + * @description + * @date 2023/11/28 10:11 + */ +@Data +public class OrderGoodsVo implements Vo { + private int num; + private String goodName; +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExport.java b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExport.java new file mode 100644 index 0000000..9c28358 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExport.java @@ -0,0 +1,55 @@ +package com.yxt.yythmall.api.vegecallerreserveorder; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * @author Fan + * @description + * @date 2023/11/28 10:26 + */ +@Getter +@Setter +@EqualsAndHashCode +public class ReserveOrderExport { + + @ColumnWidth(20) + @ExcelProperty(value = "预约时间",index = 0) + private String reserveDate; + @ColumnWidth(20) + @ExcelProperty(value = "支行",index = 1) + private String bankName; + @ColumnWidth(20) + @ExcelProperty(value = "提货门店",index = 2) + private String store; + @ColumnWidth(20) + @ExcelProperty(value = "礼包名称",index = 3) + private String bagName; + + @ColumnWidth(20) + @ExcelProperty(value = "提货卡序列号",index = 4) + private String serialNumber; + + @ColumnWidth(20) + @ExcelProperty(value = "姓名",index = 5) + private String userName; + + @ColumnWidth(20) + @ExcelProperty(value = "联系方式",index = 6) + private String userPhone; + + @ColumnWidth(20) + @ExcelProperty(value = "商品名称",index = 7) + private String goodsName; + @ColumnWidth(20) + @ExcelProperty(value = "商品数量(份)",index = 8) + private String goodsNumber; + @ExcelIgnore + private String sid; + @ExcelIgnore + private String goodsSid; +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExportByBank.java b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExportByBank.java new file mode 100644 index 0000000..c371d60 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExportByBank.java @@ -0,0 +1,48 @@ +package com.yxt.yythmall.api.vegecallerreserveorder; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * @author wangpengfei + * @date 2023/12/11 13:58 + */ +@Getter +@Setter +@EqualsAndHashCode +public class ReserveOrderExportByBank { + @ColumnWidth(20) + @ExcelProperty(value = "预约时间",index = 0) + private String reserveDate; + @ColumnWidth(20) + @ExcelProperty(value = "支行",index = 1) + private String bankName; + @ColumnWidth(20) + @ExcelProperty(value = "卡类型",index = 2) + private String cardType; + @ColumnWidth(20) + @ExcelProperty(value = "商品名称",index = 3) + private String goodsName; + @ColumnWidth(20) + @ExcelProperty(value = "商品数量(份)",index = 4) + private String goodsNumber; + @ColumnWidth(20) + @ExcelProperty(value = "联系人",index = 5) + private String linker; + @ColumnWidth(20) + @ExcelProperty(value = "联系电话",index = 6) + private String linkPhone; + @ColumnWidth(50) + @ExcelProperty(value = "地址",index = 7) + private String address; + + @ExcelIgnore + private String storeSid; + @ExcelIgnore + private String goodsSid; + +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExportByStore.java b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExportByStore.java new file mode 100644 index 0000000..c5a0e33 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExportByStore.java @@ -0,0 +1,50 @@ +package com.yxt.yythmall.api.vegecallerreserveorder; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * @author wangpengfei + * @date 2023/12/11 13:58 + */ +@Getter +@Setter +@EqualsAndHashCode +public class ReserveOrderExportByStore { + @ColumnWidth(20) + @ExcelProperty(value = "预约时间",index = 0) + private String reserveDate; + @ColumnWidth(20) + @ExcelProperty(value = "支行",index = 1) + private String bankName; + @ColumnWidth(20) + @ExcelProperty(value = "提货门店",index = 2) + private String store; + @ColumnWidth(20) + @ExcelProperty(value = "卡类型",index = 3) + private String cardType; + @ColumnWidth(20) + @ExcelProperty(value = "商品名称",index = 4) + private String goodsName; + @ColumnWidth(20) + @ExcelProperty(value = "商品数量(份)",index = 5) + private String goodsNumber; + @ColumnWidth(20) + @ExcelProperty(value = "联系人",index = 6) + private String linker; + @ColumnWidth(20) + @ExcelProperty(value = "联系电话",index = 7) + private String linkPhone; + @ColumnWidth(50) + @ExcelProperty(value = "地址",index = 8) + private String address; + + @ExcelIgnore + private String storeSid; + @ExcelIgnore + private String goodsSid; +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExportByZ.java b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExportByZ.java new file mode 100644 index 0000000..30edde5 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/ReserveOrderExportByZ.java @@ -0,0 +1,36 @@ +package com.yxt.yythmall.api.vegecallerreserveorder; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * @author wangpengfei + * @date 2023/12/11 13:58 + */ +@Getter +@Setter +@EqualsAndHashCode +public class ReserveOrderExportByZ { + @ColumnWidth(20) + @ExcelProperty(value = "预约时间",index = 0) + private String reserveDate; + @ColumnWidth(20) + @ExcelProperty(value = "卡类型",index = 1) + private String cardType; + @ColumnWidth(20) + @ExcelProperty(value = "商品名称",index = 2) + private String goodsName; + @ColumnWidth(20) + @ExcelProperty(value = "商品数量(份)",index = 3) + private String goodsNumber; + + @ExcelIgnore + private String storeSid; + @ExcelIgnore + private String goodsSid; + +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrder.java b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrder.java new file mode 100644 index 0000000..cb22c8c --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrder.java @@ -0,0 +1,29 @@ +package com.yxt.yythmall.api.vegecallerreserveorder; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; +import java.util.UUID; + +/** + * @author wangpengfei + * @date 2023/11/23 10:29 + */ +@Data +public class VegeCellarReserveOrder { + private String id; + private String sid= UUID.randomUUID().toString(); + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + + private String customerSid; + private String reserveDate; + private String storeSid; + private String userName; + private String userPhone; + private String userAddress; + +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderDto.java b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderDto.java new file mode 100644 index 0000000..4fbd66b --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderDto.java @@ -0,0 +1,26 @@ +package com.yxt.yythmall.api.vegecallerreserveorder; + +import com.yxt.common.core.dto.Dto; +import com.yxt.yythmall.api.lpkgiftcard.GoodsVo; +import lombok.Data; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2023/11/23 10:29 + */ +@Data +public class VegeCellarReserveOrderDto implements Dto { + private String customerSid; + private String reserveDate; + private String storeSid; + private String userName; + private String userPhone; + private String userAddress; + private List goodsVos; + private String orderSid; + private String addressName; + private String cardType;//提货类型,1=提货卡;2=福利卡 + +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderQuery.java b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderQuery.java new file mode 100644 index 0000000..93116ef --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderQuery.java @@ -0,0 +1,21 @@ +package com.yxt.yythmall.api.vegecallerreserveorder; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/11/23 10:30 + */ +@Data +public class VegeCellarReserveOrderQuery implements Query { + private String userName; //用户名 + private String store; // 门店 + private String startDate; //预约开始日期 + private String endDate; // 预约结束日期 + private String userSid; + private String storeSid; + private String bankSid; + private String bankName; + private String serialNumber; +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderVo.java b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderVo.java new file mode 100644 index 0000000..495a738 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderVo.java @@ -0,0 +1,39 @@ +package com.yxt.yythmall.api.vegecallerreserveorder; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author Fan + * @description + * @date 2023/11/27 15:11 + */ +@Data +public class VegeCellarReserveOrderVo implements Vo { + private String sid; //预约订单sid + private String userName; //用户名 + private String userPhone; //用户电话 + private String store; //门店 + private String storeSid; //门店 + @JsonFormat(pattern = "yyyy-MM-dd ",timezone="GMT+8") + private Date reserveDate; //预约时间 + private String bagName; //礼包 + private String code; //卡号 + private String goodsInfo; + private List goodsVo = new ArrayList<>(); + private List goods=new ArrayList<>(); + private String bankName; + private String goodsSid; + private String goodsName; + private String goodsNumber; + private String serialNumber; + private String linker; + private String linkPhone; + private String address; + private String cardType; +} diff --git a/src/main/java/com/yxt/yythmall/biz/appletgiftbag/AppletGiftBagService.java b/src/main/java/com/yxt/yythmall/biz/appletgiftbag/AppletGiftBagService.java index ce3258e..78c1ab1 100644 --- a/src/main/java/com/yxt/yythmall/biz/appletgiftbag/AppletGiftBagService.java +++ b/src/main/java/com/yxt/yythmall/biz/appletgiftbag/AppletGiftBagService.java @@ -248,7 +248,7 @@ public class AppletGiftBagService extends MybatisBaseService().eq("sid",sid)); + AppletGiftBag bag=baseMapper.selectOne(new QueryWrapper().eq("sid","e49555f2-5370-45b0-9637-aa4d54c22e31")); vo.setRemarks(bag.getRemarks()); vo.setIconUrl(fileUploadComponent.getUrlPrefix() +bag.getIconUrl()); recommendRecord recommendRecord=new recommendRecord(); diff --git a/src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreMapper.java b/src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreMapper.java new file mode 100644 index 0000000..af565f3 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreMapper.java @@ -0,0 +1,16 @@ +package com.yxt.yythmall.biz.customerstore; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yxt.yythmall.api.customerstore.CustomerStore; +import com.yxt.yythmall.api.customerstore.CustomerStoreVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2023/11/21 15:03 + */ +@Mapper +public interface CustomerStoreMapper extends BaseMapper { + CustomerStoreVo getStoreBySid(@Param("customerSid") String customerSid); +} diff --git a/src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreMapper.xml b/src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreMapper.xml new file mode 100644 index 0000000..4fe5184 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreMapper.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreRest.java b/src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreRest.java new file mode 100644 index 0000000..b6dfdb7 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreRest.java @@ -0,0 +1,30 @@ +package com.yxt.yythmall.biz.customerstore; + +import com.yxt.common.core.result.ResultBean; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author wangpengfei + * @date 2023/11/21 15:03 + */ + +@Api(tags = "客户网点关联") +@RestController +@RequestMapping("customerstore") +public class CustomerStoreRest { + + @Autowired + CustomerStoreService customerStoreService; + + @ApiOperation("我的默认提货地点") + @GetMapping("/getStoreBySid/{sid}") + public ResultBean getStoreBySid(@PathVariable String sid) { + return customerStoreService.getStoreBySid(sid); + } +} diff --git a/src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreService.java b/src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreService.java new file mode 100644 index 0000000..078a8d9 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreService.java @@ -0,0 +1,32 @@ +package com.yxt.yythmall.biz.customerstore; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.core.result.ResultBean; +import com.yxt.yythmall.api.customerstore.CustomerStore; +import com.yxt.yythmall.api.customerstore.CustomerStoreDto; +import com.yxt.yythmall.api.customerstore.CustomerStoreVo; +import org.springframework.stereotype.Service; + +/** + * @author wangpengfei + * @date 2023/11/21 15:03 + */ +@Service +public class CustomerStoreService extends MybatisBaseService { + + public ResultBean getStoreBySid(String customerSid) { + ResultBean rb=new ResultBean().fail(); + CustomerStoreVo vo=baseMapper.getStoreBySid(customerSid); + return rb.success().setData(vo); + } + public ResultBean saveStore(CustomerStoreDto dto){ + ResultBean rb=new ResultBean(); + baseMapper.delete(new QueryWrapper().eq("customerSid",dto.getCustomerSid())); + CustomerStore customerStore=new CustomerStore(); + BeanUtil.copyProperties(dto, customerStore, "id", "sid"); + baseMapper.insert(customerStore); + return rb.success().setMsg("成功"); + } +} diff --git a/src/main/java/com/yxt/yythmall/biz/lpkcustomer/LpkCustomerService.java b/src/main/java/com/yxt/yythmall/biz/lpkcustomer/LpkCustomerService.java index 15bd06b..3a0b5de 100644 --- a/src/main/java/com/yxt/yythmall/biz/lpkcustomer/LpkCustomerService.java +++ b/src/main/java/com/yxt/yythmall/biz/lpkcustomer/LpkCustomerService.java @@ -140,6 +140,7 @@ public class LpkCustomerService extends MybatisBaseService getCustomerInfo(String sid) { ResultBean rb = ResultBean.fireFail(); LpkCustomerVo lpkCustomer= baseMapper.getCustomerInfo(sid); + lpkCustomer.setPhoto(fileUploadComponent.getUrlPrefix() + lpkCustomer.getPhoto()); return rb.success().setData(lpkCustomer); } diff --git a/src/main/java/com/yxt/yythmall/biz/lpkgoods/LpkGoodsService.java b/src/main/java/com/yxt/yythmall/biz/lpkgoods/LpkGoodsService.java index 15cdb61..6ba0a95 100644 --- a/src/main/java/com/yxt/yythmall/biz/lpkgoods/LpkGoodsService.java +++ b/src/main/java/com/yxt/yythmall/biz/lpkgoods/LpkGoodsService.java @@ -207,10 +207,6 @@ public class LpkGoodsService extends MybatisBaseService vo =new ArrayList<>(); -// GoodsTypeVo vo1=new GoodsTypeVo(); -// vo1.setSid("3"); -// vo1.setName("全部分类"); -// vo1.setCount("1"); GoodsTypeVo vo2=new GoodsTypeVo(); vo2.setSid("0"); vo2.setName("百姓菜窖"); diff --git a/src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsMapper.java b/src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsMapper.java new file mode 100644 index 0000000..44d91d7 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsMapper.java @@ -0,0 +1,28 @@ +package com.yxt.yythmall.biz.vegecallerreservedetail; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yxt.yythmall.api.vegecallerreservedetails.VegeCellarReserveDetails; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2023/11/23 10:36 + */ +@Mapper +public interface VegeCellarReserveDetailsMapper extends BaseMapper { + @Select("select sum(goodsNumber) as goodsNumber , goodsSid as goodsSid from lpk_reserve_order_goods where cardSid=#{cardSid} and goodsSid=#{goodsSid}") + VegeCellarReserveDetails getReserveByCardSid(@Param("cardSid") String cardSid, @Param("goodsSid") String goodsSid); + + VegeCellarReserveDetails selByOrderSidAndGoodSid(@Param("orderSid") String orderSid, @Param("goodsSid") String goodsSid); + + @Select("select * from lpk_reserve_order_goods where orderSid=#{orderSid}") + List selByOrderSid(String orderSid); + + List selInOrderSid(@Param("orderSids") List orderSids); + @Select("select *,goodsNumber as num from lpk_reserve_order_goods where orderSid=#{orderSid}") + List selByOrderSids(String orderSid); +} diff --git a/src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsMapper.xml b/src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsMapper.xml new file mode 100644 index 0000000..f121216 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsRest.java b/src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsRest.java new file mode 100644 index 0000000..1670fb4 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsRest.java @@ -0,0 +1,25 @@ +package com.yxt.yythmall.biz.vegecallerreservedetail; + +import io.swagger.annotations.Api; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author wangpengfei + * @date 2023/11/23 10:35 + */ +@Api(tags = "预约订单信息") +@RestController +@RequestMapping("lpksreservoordersss") +public class VegeCellarReserveDetailsRest { + @Autowired + VegeCellarReserveDetailsService vegeCellarReserveOrderService; + + +// @ApiOperation("预约提交") +// @PostMapping("/submissionDetail") +// public ResultBean submissionDetail(VegeCellarReserveOrderDto dto){ +// return VegeCellarReserveOrderService.submissionDetail(dto); +// } +} diff --git a/src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsService.java b/src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsService.java new file mode 100644 index 0000000..b3f33c4 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsService.java @@ -0,0 +1,67 @@ +package com.yxt.yythmall.biz.vegecallerreservedetail; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.core.result.ResultBean; +import com.yxt.yythmall.api.empcardgiftgoods.EmpCardGiftGoodsVo; +import com.yxt.yythmall.api.lpkgiftcard.AppletVo; +import com.yxt.yythmall.api.lpkgiftcard.GoodsVo; +import com.yxt.yythmall.api.vegecallerreservedetails.VegeCellarReserveDetails; +import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderDto; +import com.yxt.yythmall.biz.empcardgiftgoods.EmpCardGiftGoodsService; +import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2023/11/23 10:36 + */ +@Service +public class VegeCellarReserveDetailsService extends MybatisBaseService { + @Autowired + LpkGiftCardService lpkGiftCardService; + @Autowired + EmpCardGiftGoodsService empCardGiftGoodsService; + + + public ResultBean getReserveByCardSid(String carSid, String goodsSid) { + ResultBean rb = new ResultBean(); + VegeCellarReserveDetails goods = baseMapper.getReserveByCardSid(carSid, goodsSid); + return rb.success().setData(goods); + } + + public ResultBean submissionDetail(VegeCellarReserveOrderDto dto) { + ResultBean rb = new ResultBean(); + VegeCellarReserveDetails goods = new VegeCellarReserveDetails(); + BeanUtil.copyProperties(dto, goods, "id", "sid"); +// goods.setCardSid(dto.getSid()); + for (GoodsVo goods1 : dto.getGoodsVos()) { + if (goods1.getSelect() != 0) { +// goods.setCardSid(dto.getSid()); + goods.setGoodsSid(goods1.getGoodsSid()); + goods.setGoodsNumber(goods1.getSelect()); + goods.setCreateTime(new DateTime()); + baseMapper.insert(goods); + } + } + + return rb.success().setData("预约成功"); + } + + public VegeCellarReserveDetails selByOrderSidAndGoodSid(String orderSid, String goodsSid) { + return baseMapper.selByOrderSidAndGoodSid(orderSid,goodsSid); + } + public List selByOrderSid(String orderSid) { + return baseMapper.selByOrderSid(orderSid); + } + public List selInOrderSid(List orderSids) { + return baseMapper.selInOrderSid(orderSids); + } + public List selByOrderSids(String orderSid) { + return baseMapper.selByOrderSids(orderSid); + } +} diff --git a/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.java b/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.java new file mode 100644 index 0000000..1cec28f --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.java @@ -0,0 +1,44 @@ +package com.yxt.yythmall.biz.vegecallerreserveorder; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; + +import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrder; +import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2023/11/23 10:36 + */ +@Mapper +public interface VegeCellarReserveOrderMapper extends BaseMapper { +// IPage orderList(IPage page, @Param("qw") VegeCellarReserveOrderQuery qw); +// IPage orderListByStore(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); +// IPage orderListByBank(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); +// IPage orderListByZ(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); +//// List orderByCardSid(String sid); +// +//// IPage orderListByUserSid(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); +// IPage orderListByUserSid(IPage page, @Param("userSid")String userSid); +// +// List exportExcel(@Param("qw") VegeCellarReserveOrderQuery qw); +// List exportExcelByStore(@Param(Constants.WRAPPER) QueryWrapper qw); +// List exportExcelByBank(@Param(Constants.WRAPPER) QueryWrapper qw); +// List exportExcelByZ(@Param(Constants.WRAPPER) QueryWrapper qw); +// @Select("select sid from lpk_reserve_order where storeSid=#{storeSid} and reserveDate =#{reserveDate}") +// List getOrderByStore(@Param("storeSid")String storeSid,@Param("reserveDate")String reserveDate); +// @Select("select * from lpk_reserve_order where customerSid =#{sid} order by createTime desc limit 1") +// VegeCellarReserveOrderVo getStoreByCustomerSid(@Param("sid") String sid); +// @Select("select * from lpk_reserve_order where cardSid =#{sid} order by reserveDate desc limit 1") +// VegeCellarReserveOrderVo selByCardSid(@Param("sid") String sid); +// @Select("SELECT o.*,st.`name` AS store FROM lpk_reserve_order o LEFT JOIN lpk_store st ON o.storeSid = st.sid where o.cardSid =#{sid} ORDER BY o.reserveDate desc") +// List selOrderByCardSid(@Param("sid") String sid); + +} diff --git a/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.xml b/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.xml new file mode 100644 index 0000000..58247f0 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.xml @@ -0,0 +1,488 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderRest.java b/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderRest.java new file mode 100644 index 0000000..ca5aef4 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderRest.java @@ -0,0 +1,90 @@ +package com.yxt.yythmall.biz.vegecallerreserveorder; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderDto; +import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderQuery; +import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @author wangpengfei + * @date 2023/11/23 10:35 + */ +@Api(tags = "预约订单信息") +@RestController +@RequestMapping("/lpksreservoorders") +public class VegeCellarReserveOrderRest { + @Autowired + VegeCellarReserveOrderService vegeCellarReserveOrderService; +// +// + @ApiOperation("预约提交") + @PostMapping("/submission") + public ResultBean submission(@RequestBody VegeCellarReserveOrderDto dto) { + return vegeCellarReserveOrderService.submission(dto); + } +// +// @ApiOperation("订单列表") +// @PostMapping("/orderList") +// public ResultBean> orderList(@RequestBody PagerQuery pq) { +// return vegeCellarReserveOrderService.orderList(pq); +// } +// @ApiOperation("订单门店汇总列表") +// @PostMapping("/orderListByStore") +// public ResultBean> orderListByStore(@RequestBody PagerQuery pq) { +// return vegeCellarReserveOrderService.orderListByStore(pq); +// } +// @ApiOperation("订单门店支行汇总列表") +// @PostMapping("/orderListByBank") +// public ResultBean> orderListByBank(@RequestBody PagerQuery pq) { +// return vegeCellarReserveOrderService.orderListByBank(pq); +// } +// @ApiOperation("订单总汇总列表") +// @PostMapping("/orderListByZ") +// public ResultBean> orderListByZ(@RequestBody PagerQuery pq) { +// return vegeCellarReserveOrderService.orderListByZ(pq); +// } +// @ApiOperation("根据提货卡查询预约记录") +// @GetMapping("/orderByCardSid/{sid}") +// public ResultBean orderByCardSid(@PathVariable("sid") String sid) { +// return vegeCellarReserveOrderService.orderByCardSid(sid); +// } +// +// @ApiOperation("移动端预约订单列表") +// @PostMapping("/orderListByUserSid") +// public ResultBean> orderListByUserSid(@RequestBody PagerQuery pq) { +// return vegeCellarReserveOrderService.orderListByUserSid(pq); +// } +// +// @ApiOperation("预约记录详情") +// @GetMapping("/orderDetails/{orderSid}") +// public ResultBean orderDetails(@PathVariable("orderSid") String orderSid) { +// return vegeCellarReserveOrderService.orderDetails(orderSid); +// } +// +// @ApiOperation(value = "预约订单信息列表导出") +// @PostMapping("/exportExcel") +// public void exportExcel(@RequestBody VegeCellarReserveOrderQuery query) { +// vegeCellarReserveOrderService.exportExcel(query); +// } +// @ApiOperation(value = "预约订单门店汇总导出") +// @PostMapping("/exportExcelByStore") +// public void exportExcelByStore(@RequestBody VegeCellarReserveOrderQuery query) { +// vegeCellarReserveOrderService.exportExcelByStore(query); +// } +// @ApiOperation(value = "预约订单支行汇总导出") +// @PostMapping("/exportExcelByBank") +// public void exportExcelByBank(@RequestBody VegeCellarReserveOrderQuery query) { +// vegeCellarReserveOrderService.exportExcelByBank(query); +// } +// @ApiOperation(value = "预约订单总汇总导出") +// @PostMapping("/exportExcelByZ") +// public void exportExcelByZ(@RequestBody VegeCellarReserveOrderQuery query) { +// vegeCellarReserveOrderService.exportExcelByZ(query); +// } +} diff --git a/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java b/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java new file mode 100644 index 0000000..3f72d2a --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java @@ -0,0 +1,666 @@ +package com.yxt.yythmall.biz.vegecallerreserveorder; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.write.metadata.style.WriteCellStyle; +import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.yythmall.api.lpkgiftbaggoods.LpkGiftBagGoodsVo; +import com.yxt.yythmall.api.lpkgiftcard.AppletVo; +import com.yxt.yythmall.api.lpkgiftcard.GoodsVo; +import com.yxt.yythmall.api.lpkgoods.LpkGoods; +import com.yxt.yythmall.api.lpkstore.LpkStore; +import com.yxt.yythmall.api.lpkstore.StoreSelect; +import com.yxt.yythmall.api.vegecallerreserveorder.*; +import com.yxt.yythmall.biz.lpkgiftbaggoods.LpkGiftBagGoodsService; +import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardMapper; +import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService; +import com.yxt.yythmall.biz.lpkstore.LpkStoreService; +import com.yxt.yythmall.biz.vegecallerreservedetail.VegeCellarReserveDetailsService; +import com.yxt.yythmall.utils.StyleUtils; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.BufferedOutputStream; +import java.io.IOException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2023/11/23 10:36 + */ +@Service +public class VegeCellarReserveOrderService extends MybatisBaseService { + @Autowired + VegeCellarReserveDetailsService vegeCellarReserveDetailsService; +// @Autowired +// LpkGiftCardMapper lpkGiftCardMapper; +// @Autowired +// LpkGiftBagGoodsService lpkGiftBagGoodsService; +// @Autowired +// LpkStoreService lpkStoreService; +// @Autowired +// private FileUploadComponent fileUploadComponent; +// @Autowired +// private LpkGoodsService lpkGoodsService; +// @Autowired +// private HttpServletResponse response; +// + public ResultBean submission(VegeCellarReserveOrderDto dto) { + ResultBean rb = new ResultBean().fail(); + boolean b=isSatAndSun(dto.getReserveDate()); + if(!b){ + return rb.setMsg("周六、周日不能预约提货"); + } + VegeCellarReserveOrder order = new VegeCellarReserveOrder(); + BeanUtil.copyProperties(dto, order, "id", "sid"); + order.setStoreSid(dto.getStoreSid()); +// order.setCardSid(dto.getSid()); + order.setCreateTime(new DateTime()); + baseMapper.insert(order); + dto.setOrderSid(order.getSid()); + vegeCellarReserveDetailsService.submissionDetail(dto); + return rb.success().setData("预约成功"); + } + public boolean isSatAndSun(String date){ + DateTime dateTime = DateUtil.parse(date);; // 获取当前时间 + int dayOfWeek = dateTime.dayOfWeekEnum().getValue();// 获取星期几(1-7) + System.out.println(dayOfWeek); + if (dayOfWeek == 1 || dayOfWeek == 7) { + return false; + } else { + return true; + } + } +// @Test +// public void isSatAndSun(){ +// String date="2023-12-11"; +// DateTime dateTime = DateUtil.parse(date);; // 获取当前时间 +// int dayOfWeek = dateTime.dayOfWeekEnum().getValue();// 获取星期几(1-7) +// +// System.out.println(dayOfWeek); +// if (dayOfWeek == 1 || dayOfWeek == 7) { +// System.out.println(dayOfWeek); +// } else { +// System.out.println(11111); +// } +// } +// public ResultBean> orderList(PagerQuery pq) { +// ResultBean rb = ResultBean.fireFail(); +// VegeCellarReserveOrderQuery query = pq.getParams(); +// IPage page = PagerUtil.queryToPage(pq); +// IPage pagging = baseMapper.orderList(page, query); +// List records = pagging.getRecords(); +// if (!records.isEmpty()) { +// records.forEach(s -> { +// List orderGoods = VegeCellarReserveOrderGoodsService.selByOrderSid(s.getSid()); +// List goodsVoList = new ArrayList<>(); +// if (!orderGoods.isEmpty()) { +// for (VegeCellarReserveOrderGoods orderGood : orderGoods) { +// OrderGoodsVo goodsVo = new OrderGoodsVo(); +// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) { +// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid()); +// if (null != lpkGoods) { +// goodsVo.setGoodName(lpkGoods.getName()); +// } +// } +// if (orderGood.getGoodsNumber() != 0) { +// goodsVo.setNum((int) orderGood.getGoodsNumber()); +// } +// goodsVoList.add(goodsVo); +// } +// } +// s.setGoodsVo(goodsVoList); +// }); +// } +// PagerVo p = PagerUtil.pageToVo(pagging, null); +// return rb.success().setData(p); +// } +// public ResultBean> orderListByStore(PagerQuery pq) { +// ResultBean rb = ResultBean.fireFail(); +// VegeCellarReserveOrderQuery query = pq.getParams(); +// QueryWrapper qw = new QueryWrapper<>(); +// qw.eq("1", "1"); +// if (StringUtils.isNotBlank(query.getStore())) { +// qw.like("s.name", query.getStore()); +// } +// if (StringUtils.isNotBlank(query.getBankName())) { +// qw.like("d.name", query.getBankName()); +// } +// if (StringUtils.isNotBlank(query.getBankSid())) { +// qw.eq("s.bankSid", query.getBankSid()); +// } +// if (StringUtils.isNotBlank(query.getStartDate())) { +// +// String startDate = query.getStartDate(); +// qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (o.reserveDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')"); +// } +// if (StringUtils.isNotBlank(query.getEndDate())) { +// String endDate = query.getEndDate(); +// qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')"); +// } +// +// qw.orderByAsc("o.reserveDate"); +// qw.orderByDesc("d.sid"); +// qw.orderByDesc("s.sid"); +// qw.groupBy("o.cardType"); +// qw.groupBy("o.reserveDate"); +// qw.groupBy("t.goodsSid"); +// qw.groupBy("s.name"); +// IPage page = PagerUtil.queryToPage(pq); +// IPage pagging = baseMapper.orderListByStore(page, qw); +//// List records = pagging.getRecords(); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); +//// if (!records.isEmpty()) { +//// records.forEach(s -> { +//// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); +//// s.setGoodsName(lpkGoods.getName()); +//// }); +//// } +// PagerVo p = PagerUtil.pageToVo(pagging, null); +// return rb.success().setData(p); +// } +// public ResultBean> orderListByBank(PagerQuery pq) { +// ResultBean rb = ResultBean.fireFail(); +// VegeCellarReserveOrderQuery query = pq.getParams(); +// QueryWrapper qw = new QueryWrapper<>(); +// qw.eq("1", "1"); +// +// if (StringUtils.isNotBlank(query.getStartDate())) { +// +// String startDate = query.getStartDate(); +// qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (o.reserveDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')"); +// } +// if (StringUtils.isNotBlank(query.getEndDate())) { +// String endDate = query.getEndDate(); +// qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')"); +// } +// if (StringUtils.isNotBlank(query.getBankSid())) { +// qw.eq("s.bankSid", query.getBankSid()); +// } +// +// qw.groupBy("d.sid"); +// qw.groupBy("t.goodsSid"); +// qw.groupBy("o.reserveDate"); +// qw.groupBy("o.cardType"); +// qw.orderByAsc("o.reserveDate"); +// qw.orderByDesc("d.sid"); +// qw.orderByDesc("s.sid"); +//// qw.groupBy("s.name"); +// IPage page = PagerUtil.queryToPage(pq); +// IPage pagging = baseMapper.orderListByBank(page, qw); +// List records = pagging.getRecords(); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); +// +//// if (!records.isEmpty()) { +//// records.forEach(s -> { +//// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); +//// s.setGoodsName(lpkGoods.getName()); +//// }); +//// } +// PagerVo p = PagerUtil.pageToVo(pagging, null); +// return rb.success().setData(p); +// } +// public ResultBean> orderListByZ(PagerQuery pq) { +// ResultBean rb = ResultBean.fireFail(); +// VegeCellarReserveOrderQuery query = pq.getParams(); +// QueryWrapper qw = new QueryWrapper<>(); +// qw.eq("1", "1"); +// if (StringUtils.isNotBlank(query.getStore())) { +// qw.like("s.name", query.getStore()); +// } +// if (StringUtils.isNotBlank(query.getUserName())) { +// qw.like("o.userName", query.getUserName()); +// } +// if (StringUtils.isNotBlank(query.getUserSid())) { +// qw.like("o.customerSid", query.getUserSid()); +// } +// if (StringUtils.isNotBlank(query.getStartDate())) { +// +// String startDate = query.getStartDate(); +// qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (o.reserveDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')"); +// } +// if (StringUtils.isNotBlank(query.getEndDate())) { +// String endDate = query.getEndDate(); +// qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')"); +// } +// if (StringUtils.isNotBlank(query.getBankSid())) { +// qw.eq("s.bankSid", query.getBankSid()); +// } +// qw.orderByAsc("o.reserveDate"); +// qw.groupBy("t.goodsSid"); +// qw.groupBy("o.reserveDate"); +// qw.groupBy("o.cardType"); +//// qw.groupBy("s.name"); +// IPage page = PagerUtil.queryToPage(pq); +// IPage pagging = baseMapper.orderListByZ(page, qw); +// List records = pagging.getRecords(); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); +//// if (!records.isEmpty()) { +//// records.forEach(s -> { +//// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); +//// s.setGoodsName(lpkGoods.getName()); +//// }); +//// } +// PagerVo p = PagerUtil.pageToVo(pagging, null); +// return rb.success().setData(p); +// } +// public ResultBean orderByCardSid(String sid) { +// ResultBean rb = ResultBean.fireFail(); +// List list = baseMapper.orderByCardSid(sid); +// return rb.success().setData(list); +// } +// +// public ResultBean> orderListByUserSid(PagerQuery pq) { +// ResultBean rb = ResultBean.fireFail(); +// VegeCellarReserveOrderQuery query = pq.getParams(); +// QueryWrapper qw = new QueryWrapper<>(); +// if(StringUtils.isBlank(query.getUserSid())){ +// return rb.setMsg("参数不全"); +// } +// qw.eq("o.customerSid", query.getUserSid()); +// qw.eq("o.cardType","1"); +//// qw.orderByDesc("reserveDate"); +// IPage page = PagerUtil.queryToPage(pq); +// IPage pagging = baseMapper.orderListByUserSid(page, query.getUserSid()); +// for(VegeCellarReserveOrderCardVo vo:pagging.getRecords()){ +// List goods =VegeCellarReserveOrderGoodsService.selByOrderSids(vo.getSid()); +// for(VegeCellarReserveOrderGoods goods1:goods){ +// LpkGoods lpkGoods=lpkGoodsService.getOne(new QueryWrapper().eq("sid",goods1.getGoodsSid())); +// if(StringUtils.isBlank(vo.getGoods())){ +// vo.setGoods(lpkGoods.getName()+":"+goods1.getNum()+lpkGoods.getUnitName()); +// }else{ +// vo.setGoods(vo.getGoods()+" "+lpkGoods.getName()+":"+goods1.getNum()+lpkGoods.getUnitName()); +// } +// } +// } +// PagerVo p = PagerUtil.pageToVo(pagging, null); +// return rb.success().setData(p); +// } +// +// public ResultBean orderDetails(String orderSid) { +// ResultBean rb = new ResultBean().fail(); +// VegeCellarReserveOrder VegeCellarReserveOrder = fetchBySid(orderSid); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); +// if (null != VegeCellarReserveOrder) { +// AppletVo vo = lpkGiftCardMapper.getGifCardBySid(VegeCellarReserveOrder.getCardSid()); +// if (StringUtils.isNotBlank(VegeCellarReserveOrder.getStoreSid())) { +// LpkStore lpkStore = lpkStoreService.fetchBySid(VegeCellarReserveOrder.getStoreSid()); +// if (null != lpkStore) { +// if (StringUtils.isNotBlank(lpkStore.getName())) { +// vo.setStore(lpkStore.getName()); +// } +// } +// } +// if (StringUtils.isNotBlank(VegeCellarReserveOrder.getReserveDate())) { +// try { +// Date parse = sdf.parse(VegeCellarReserveOrder.getReserveDate()); +// vo.setReserveDate(sdf.format(parse)); +// } catch (ParseException e) { +// e.printStackTrace(); +// } +// } +// List list = lpkGiftBagGoodsService.getGoodsByBagSid(vo.getGiftbagSid()); +// List l = lpkStoreService.getAllStore().getData(); +// List goodsVos = new ArrayList<>(); +// list.forEach(s -> { +// VegeCellarReserveOrderGoods goods = VegeCellarReserveOrderGoodsService.getReserveByCardSid(vo.getSid(), s.getGoodsSid()).getData(); +// VegeCellarReserveOrderGoods orderGoods = VegeCellarReserveOrderGoodsService.selByOrderSidAndGoodSid(orderSid, s.getGoodsSid()); +// GoodsVo goodsVo = new GoodsVo(); +// goodsVo.setGoods(s.getGoodsName()); +// goodsVo.setNum(s.getGoodsNumber()); +// goodsVo.setGoodsSid(s.getGoodsSid()); +// goodsVo.setPic(fileUploadComponent.getUrlPrefix() + s.getPicUrl()); +// if (null != goods) { +// if (goods.getGoodsNumber() != s.getGoodsNumber()) { +// goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber()); +// goodsVo.setSelect(s.getGoodsNumber() - goods.getGoodsNumber()); +// if (null != orderGoods) { +// goodsVo.setOrderNum(orderGoods.getGoodsNumber()); +// } +// goodsVos.add(goodsVo); +// } +// } else { +// goodsVo.setLNum(s.getGoodsNumber()); +// goodsVo.setSelect(s.getGoodsNumber()); +// goodsVos.add(goodsVo); +// } +// }); +// vo.setGoodsVos(goodsVos); +// vo.setSelect(l); +// return rb.success().setData(vo); +// } +// return rb.success(); +// } +// +// public void exportExcel(VegeCellarReserveOrderQuery query) { +// //得到所有要导出的数据 +// List exportList = baseMapper.exportExcel(query); +// List exportList1 = new ArrayList<>(); +// if (!exportList.isEmpty()) { +// exportList.forEach(s -> { +// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); +// s.setGoodsName(lpkGoods.getName()); +//// if (StringUtils.isNotBlank(s.getUserPhone())) { +////// String phone = s.getUserPhone().substring(0, 3) + "****" + s.getUserPhone().substring(7); +//// String phone = s.getUserPhone(); +//// s.setUserPhone(phone); +//// } +//// List orderGoods = VegeCellarReserveOrderGoodsService.selByOrderSid(s.getSid()); +//// if (!orderGoods.isEmpty()) { +//// int i=0; +//// for (VegeCellarReserveOrderGoods orderGood : orderGoods) { +//// String num = ""; +//// String goodsName = ""; +//// String finWord = ""; +//// String unitName = ""; +//// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) { +//// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid()); +//// if (null != lpkGoods) { +//// goodsName = lpkGoods.getName(); +//// if (StringUtils.isNotBlank(lpkGoods.getUnitName())) { +//// unitName = lpkGoods.getUnitName(); +//// } +//// } +//// } +//// if (orderGood.getGoodsNumber() != 0) { +//// num = String.valueOf((int) orderGood.getGoodsNumber()); +//// } +//// finWord = goodsName+num + unitName ; +//// i++; +//// if(i>1){ +//// ReserveOrderExport en=new ReserveOrderExport(); +//// BeanUtil.copyProperties(s,en , "id"); +//// en.setGoodsInfo(finWord); +//// exportList1.add(en); +//// }else{ +//// s.setGoodsInfo(finWord); +//// exportList1.add(s); +//// } +//// } +//// } +// }); +// } +// //定义导出的excel名字 +// //定义导出的excel名字 +// String excelName = "订单明细.xlsx"; +// String fileNameURL = "1"; +// response.setContentType( "application/vnd.ms-excel"); +// response.setCharacterEncoding("utf8"); +// response.setHeader("Content-disposition","attachment;filename="+ excelName ); +// ServletOutputStream outputStream = null; +// try { +// WriteCellStyle headWriteCellStyle = new WriteCellStyle(); +// +// //设置头居中 +// headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); +// +// //内容策略 +// WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); +// //设置 水平居中 +// contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); +//// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle); +// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleUtils.getHeadStyle(), StyleUtils.getContentStyle()); +// +// EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器 +// .write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExport.class) +// //是否自动关闭输入流 +// .autoCloseStream(Boolean.TRUE) +//// .registerWriteHandler(new MergeStrategy(exportList.size(),1,5)) +// .registerWriteHandler(horizontalCellStyleStrategy) +// .sheet().doWrite(exportList); +// } catch (IOException e) { +// throw new RuntimeException(e); +// } +// } +// public void exportExcelByStore(VegeCellarReserveOrderQuery query) { +// QueryWrapper qw = new QueryWrapper<>(); +// qw.eq("1", "1"); +// if (StringUtils.isNotBlank(query.getStartDate())) { +// String startDate = query.getStartDate(); +// qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (o.reserveDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')"); +// } +// if (StringUtils.isNotBlank(query.getEndDate())) { +// String endDate = query.getEndDate(); +// qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')"); +// } +// if (StringUtils.isNotBlank(query.getStore())) { +// qw.like("s.name", query.getStore()); +// } +// if (StringUtils.isNotBlank(query.getBankSid())) { +// qw.eq("s.bankSid", query.getBankSid()); +// } +// if (StringUtils.isNotBlank(query.getBankName())) { +// qw.like("s.name", query.getBankName()); +// } +// qw.orderByAsc("o.reserveDate"); +// qw.orderByDesc("d.sid"); +// qw.orderByDesc("s.sid"); +// qw.groupBy("o.reserveDate"); +// qw.groupBy("t.goodsSid"); +// qw.groupBy("s.name"); +//// qw.orderByDesc("o.reserveDate"); +//// qw.groupBy("s.name"); +// //得到所有要导出的数据 +// List exportList = baseMapper.exportExcelByStore(qw); +// List exportList1 = new ArrayList<>(); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); +//// if (!exportList.isEmpty()) { +//// exportList.forEach(s -> { +//// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); +//// s.setGoodsName(lpkGoods.getName()); +//// }); +//// } +// //定义导出的excel名字 +// String excelName = "配货信息.xlsx"; +// String fileNameURL = "1"; +// response.setContentType( "application/vnd.ms-excel"); +// response.setCharacterEncoding("utf8"); +// response.setHeader("Content-disposition","attachment;filename="+ excelName ); +// ServletOutputStream outputStream = null; +// try { +// WriteCellStyle headWriteCellStyle = new WriteCellStyle(); +// +// //设置头居中 +// headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); +// +// //内容策略 +// WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); +// //设置 水平居中 +// contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); +//// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle); +// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleUtils.getHeadStyle(), StyleUtils.getContentStyle()); +// +// EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器 +// .write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExportByStore.class) +// //是否自动关闭输入流 +// .autoCloseStream(Boolean.TRUE) +//// .registerWriteHandler(new MergeStrategy(exportList.size(),1,1)) +// .registerWriteHandler(horizontalCellStyleStrategy) +// .sheet().doWrite(exportList); +// } catch (IOException e) { +// throw new RuntimeException(e); +// } +// } +// public void exportExcelByBank(VegeCellarReserveOrderQuery query) { +// QueryWrapper qw = new QueryWrapper<>(); +// qw.eq("1", "1"); +// if (StringUtils.isNotBlank(query.getStartDate())) { +// String startDate = query.getStartDate(); +// qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (o.reserveDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')"); +// } +// if (StringUtils.isNotBlank(query.getEndDate())) { +// String endDate = query.getEndDate(); +// qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')"); +// } +// if (StringUtils.isNotBlank(query.getStore())) { +// qw.like("s.name", query.getStore()); +// } +// if (StringUtils.isNotBlank(query.getBankSid())) { +// qw.eq("s.bankSid", query.getBankSid()); +// } +// qw.orderByDesc("o.reserveDate"); +// qw.groupBy("d.sid"); +// qw.groupBy("t.goodsSid"); +// qw.groupBy("o.reserveDate"); +//// qw.groupBy("s.name"); +// //得到所有要导出的数据 +// List exportList = baseMapper.exportExcelByBank(qw); +// List exportList1 = new ArrayList<>(); +//// if (!exportList.isEmpty()) { +//// exportList.forEach(s -> { +//// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); +//// s.setGoodsName(lpkGoods.getName()); +//// }); +//// } +// //定义导出的excel名字 +// String excelName = "支行汇总信息.xlsx"; +// String fileNameURL = "1"; +// response.setContentType( "application/vnd.ms-excel"); +// response.setCharacterEncoding("utf8"); +// response.setHeader("Content-disposition","attachment;filename="+ excelName ); +// ServletOutputStream outputStream = null; +// try { +// WriteCellStyle headWriteCellStyle = new WriteCellStyle(); +// //设置头居中 +// headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); +// //内容策略 +// WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); +// //设置 水平居中 +// contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); +//// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle); +// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleUtils.getHeadStyle(), StyleUtils.getContentStyle()); +// +// EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器 +// .write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExportByBank.class) +// //是否自动关闭输入流 +// .autoCloseStream(Boolean.TRUE) +//// .registerWriteHandler(new MergeStrategy(exportList.size(),1,5)) +// .registerWriteHandler(horizontalCellStyleStrategy) +// .sheet().doWrite(exportList); +// } catch (IOException e) { +// throw new RuntimeException(e); +// } +// } +// public void exportExcelByZ(VegeCellarReserveOrderQuery query) { +// QueryWrapper qw = new QueryWrapper<>(); +// qw.eq("1", "1"); +// if (StringUtils.isNotBlank(query.getStartDate())) { +// String startDate = query.getStartDate(); +// qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (o.reserveDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')"); +// } +// if (StringUtils.isNotBlank(query.getEndDate())) { +// String endDate = query.getEndDate(); +// qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')"); +// } +// if (StringUtils.isNotBlank(query.getStore())) { +// qw.like("s.name", query.getStore()); +// } +// if (StringUtils.isNotBlank(query.getBankSid())) { +// qw.eq("s.bankSid", query.getBankSid()); +// } +// qw.orderByAsc("o.reserveDate"); +// qw.groupBy("t.goodsSid"); +// qw.groupBy("o.reserveDate"); +//// qw.groupBy("s.name"); +// //得到所有要导出的数据 +// List exportList = baseMapper.exportExcelByZ(qw); +// List exportList1 = new ArrayList<>(); +//// if (!exportList.isEmpty()) { +//// exportList.forEach(s -> { +//// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); +//// s.setGoodsName(lpkGoods.getName()); +////// List list=baseMapper.getOrderByStore(s.getStoreSid(),s.getReserveDate()); +////// List orderGoods = VegeCellarReserveOrderGoodsService.selInOrderSid(list); +////// if (!orderGoods.isEmpty()) { +////// int i=0; +////// for (VegeCellarReserveOrderGoods orderGood : orderGoods) { +////// String num = ""; +////// String goodsName = ""; +////// String finWord = ""; +////// String unitName = ""; +////// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) { +////// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid()); +////// if (null != lpkGoods) { +////// goodsName = lpkGoods.getName(); +////// if (StringUtils.isNotBlank(lpkGoods.getUnitName())) { +////// unitName = lpkGoods.getUnitName(); +////// } +////// } +////// } +////// if (orderGood.getGoodsNumber() != 0) { +////// num = String.valueOf((int) orderGood.getGoodsNumber()); +////// } +////// finWord = goodsName+ num + unitName; +////// i++; +////// if(i>1){ +////// ReserveOrderExportByBank en=new ReserveOrderExportByBank(); +////// BeanUtil.copyProperties(s,en , "id"); +////// en.setGoodsInfo(finWord); +////// exportList1.add(en); +////// }else{ +////// s.setGoodsInfo(finWord); +////// exportList1.add(s); +////// } +////// } +////// } +//// }); +//// } +// //定义导出的excel名字 +// String excelName = "支行汇总信息.xlsx"; +// String fileNameURL = "1"; +// response.setContentType( "application/vnd.ms-excel"); +// response.setCharacterEncoding("utf8"); +// response.setHeader("Content-disposition","attachment;filename="+ excelName ); +// ServletOutputStream outputStream = null; +// try { +// WriteCellStyle headWriteCellStyle = new WriteCellStyle(); +// //设置头居中 +// headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); +// //内容策略 +// WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); +// //设置 水平居中 +// contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); +//// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle); +// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleUtils.getHeadStyle(), StyleUtils.getContentStyle()); +// +// EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器 +// .write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExportByZ.class) +// //是否自动关闭输入流 +// .autoCloseStream(Boolean.TRUE) +//// .registerWriteHandler(new MergeStrategy(exportList.size(),1,5)) +// .registerWriteHandler(horizontalCellStyleStrategy) +// .sheet().doWrite(exportList); +// } catch (IOException e) { +// throw new RuntimeException(e); +// } +// } +// public ResultBean getStoreByCustomerSid(String sid) { +// return new ResultBean().success().setData(baseMapper.getStoreByCustomerSid(sid)); +// } +// public ResultBean selByCardSid(String sid) { +// return new ResultBean().success().setData(baseMapper.selByCardSid(sid)); +// } +// public ResultBean> selOrderByCardSid(String sid) { +// return new ResultBean().success().setData(baseMapper.selOrderByCardSid(sid)); +// } + +} diff --git a/src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java b/src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java index d4da44f..7c3951b 100644 --- a/src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java +++ b/src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java @@ -58,6 +58,7 @@ public class SaTokenConfigure implements WebMvcConfigurer { .excludePathPatterns("/lpkgiftcard/cardShareGoodsDetail/**") .excludePathPatterns("/empcardgift/generateTopEmpCard/**") .excludePathPatterns("/empsreservoorder/createOrder") + .excludePathPatterns("/appletgiftbag/recommendRecord/**") //2024-01-17 .excludePathPatterns("/lpkgiftcard/getAllGoodsType/**") .excludePathPatterns("/lpkgiftcard/getGoodsByType/**")