Prechádzať zdrojové kódy

修改excel生成和下载方式

ssk 4 mesiacov pred
rodič
commit
c6885c23bb

+ 13 - 7
alien-entity/src/main/java/shop/alien/entity/store/excelVo/util/ExcelGenerator.java

@@ -4,17 +4,23 @@ import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
-import java.io.ByteArrayOutputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
 import java.lang.reflect.Field;
 import java.net.URL;
 import java.util.List;
 
 public class ExcelGenerator {
 
-    public static <T> void generateExcel(String filePath, List<T> dataList, Class<T> clazz) throws IOException {
+    public static <T> String generateExcel(String filePath, List<T> dataList, Class<T> clazz) throws IOException {
+        String osName = System.getProperty("os.name").toLowerCase();
+        if (osName.contains("win")) {
+            filePath = "c:/" + filePath;
+            String substring = filePath.substring(0, filePath.lastIndexOf("/"));
+            File dir = new File(substring);
+            if (!dir.exists()) {
+                dir.mkdirs();
+            }
+        }
         // 创建一个新的工作簿
         XSSFWorkbook workbook = new XSSFWorkbook();
         // 创建一个工作表
@@ -62,8 +68,7 @@ public class ExcelGenerator {
                     try {
                         String imageUrl = (String) field.get(obj);
                         if (imageUrl != null && !imageUrl.isEmpty()) {
-                            try (InputStream is = new URL(imageUrl).openStream();
-                                 ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
+                            try (InputStream is = new URL(imageUrl).openStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
                                 byte[] buffer = new byte[1024];
                                 int length;
                                 while ((length = is.read(buffer)) != -1) {
@@ -122,5 +127,6 @@ public class ExcelGenerator {
 
         // 关闭工作簿
         workbook.close();
+        return filePath;
     }
 }    

+ 11 - 21
alien-store/src/main/java/shop/alien/store/service/LifeAppealManageService.java

@@ -4,25 +4,28 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
 import shop.alien.entity.store.LifeAppealManage;
 import shop.alien.entity.store.LifeNotice;
 import shop.alien.entity.store.StoreComment;
 import shop.alien.entity.store.StoreCommentAppeal;
 import shop.alien.entity.store.dto.LifeAppealManageDto;
 import shop.alien.entity.store.excelVo.LifeAppealManageExcelVo;
+import shop.alien.entity.store.excelVo.StoreInfoExcelVo;
 import shop.alien.entity.store.excelVo.util.ExcelGenerator;
 import shop.alien.entity.store.vo.LifeAppealManageVo;
 import shop.alien.mapper.LifeAppealManageMapper;
 import shop.alien.mapper.LifeNoticeMapper;
 import shop.alien.mapper.StoreCommentAppealMapper;
 import shop.alien.mapper.StoreCommentMapper;
+import shop.alien.util.ali.AliOSSUtil;
 
+import java.io.File;
 import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -45,6 +48,7 @@ public class LifeAppealManageService {
 
     private final StoreCommentMapper storeCommentMapper;
 
+    private final AliOSSUtil aliOSSUtil;
 
     @Value("${spring.web.resources.excel-path}")
     private String excelPath;
@@ -52,9 +56,6 @@ public class LifeAppealManageService {
     @Value("${spring.web.resources.excel-generate-path}")
     private String excelGeneratePath;
 
-    @Value("${spring.web.resources.url}")
-    private String fileUrl;
-
     public IPage<LifeAppealManageVo> getStores(int page, int size, String storeName, String storeContact, String storePhone, String appealType) {
         IPage<LifeAppealManageVo> storePage = new Page<>(page, size);
         return lifeAppealManageMapper.getAppealManagement(storePage, storeName, storeContact, storePhone, appealType);
@@ -80,7 +81,6 @@ public class LifeAppealManageService {
             queryWrapper.eq(StoreComment::getId, storeCommentAppeal.getCommentId());
             storeCommentMapper.delete(queryWrapper);
         }
-
         LifeNotice notice = new LifeNotice();
         if (lifeAppealManageDto.getAppealType().equals("1")) {
             notice.setContext("系统同意了您的申请");
@@ -91,7 +91,6 @@ public class LifeAppealManageService {
         notice.setNoticeType(1);
         lifeNoticeMapper.insert(notice);
         return storeCommentAppealMapper.updateById(storeCommentAppeal);
-
     }
 
     public int setIsRead(String id) {
@@ -102,10 +101,6 @@ public class LifeAppealManageService {
         return lifeAppealManageMapper.update(null, updateWrapper);
     }
 
-    public List<LifeAppealManage> getAllList() {
-        return lifeAppealManageMapper.selectList(new LambdaQueryWrapper<>());
-    }
-
     public List<LifeAppealManage> getAppealByStoreId(String storeId) {
         LambdaUpdateWrapper<LifeAppealManage> wrapper = new LambdaUpdateWrapper<>();
         wrapper.eq(LifeAppealManage::getStoreId, storeId)
@@ -135,14 +130,12 @@ public class LifeAppealManageService {
 
     public String appealsExport(String appealType, String storeName, String storePhone) throws IOException {
         QueryWrapper<LifeAppealManage> wrapper = new QueryWrapper<>();
-
-        wrapper.eq(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(appealType), "appeal_status", appealType);
-        wrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(storeName), "store_name", storeName);
-        wrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(storePhone), "store_phone", storePhone);
+        wrapper.eq(StringUtils.isNotEmpty(appealType), "appeal_status", appealType);
+        wrapper.like(StringUtils.isNotEmpty(storeName), "store_name", storeName);
+        wrapper.like(StringUtils.isNotEmpty(storePhone), "store_phone", storePhone);
         wrapper.eq("delete_flag", 0);
         wrapper.orderByDesc("created_time");
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy/M/d HH:mm:ss");
-
         List<LifeAppealManageVo> storeStaffConfig = lifeAppealManageMapper.getAppealManagement(storeName, storePhone, appealType, null);
         storeStaffConfig.forEach(item -> {
             if ("0".equals(item.getAppealType())) {
@@ -152,13 +145,10 @@ public class LifeAppealManageService {
             } else {
                 item.setAppealType("已驳回");
             }
-
         });
-
         List<LifeAppealManageExcelVo> storeStaffConfigs = new ArrayList<>();
         int index = 1;
         for (LifeAppealManage record : storeStaffConfig) {
-
             LifeAppealManageExcelVo storeCouponStatusVo = new LifeAppealManageExcelVo();
             BeanUtils.copyProperties(record, storeCouponStatusVo);
             storeCouponStatusVo.setId(index++); // 设置序号
@@ -166,8 +156,8 @@ public class LifeAppealManageService {
             storeStaffConfigs.add(storeCouponStatusVo);
         }
         String fileName = UUID.randomUUID().toString().replace("-", "");
-
-        ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeStaffConfigs, LifeAppealManageExcelVo.class);
-        return fileUrl + "excel" + excelGeneratePath + fileName + ".xlsx";
+        String filePath = ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeStaffConfigs, LifeAppealManageExcelVo.class);
+        String url = aliOSSUtil.uploadFile(new File(filePath), "excel/" + fileName + ".xlsx");
+        return url;
     }
 }

+ 10 - 42
alien-store/src/main/java/shop/alien/store/service/LifeUserOrderService.java

@@ -10,13 +10,15 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import shop.alien.entity.store.*;
 import shop.alien.entity.store.excelVo.LifeUserOrderExcelVo;
+import shop.alien.entity.store.excelVo.StoreInfoExcelVo;
 import shop.alien.entity.store.excelVo.util.ExcelGenerator;
 import shop.alien.entity.store.vo.StoreInfoVo;
-import shop.alien.store.config.GaoDeMapUtil;
 import shop.alien.mapper.*;
-import shop.alien.store.service.impl.StoreUserServiceImpl;
+import shop.alien.store.config.GaoDeMapUtil;
+import shop.alien.util.ali.AliOSSUtil;
 import shop.alien.util.common.AlipayTradeRefund;
 
+import java.io.File;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -57,8 +59,10 @@ public class LifeUserOrderService {
     private final LifeNoticeMapper lifeNoticeMapper;
 
     private final StoreImgMapper storeImgMapper;
+
     private final StoreUserMapper storeUserMapper;
-    private final StoreUserServiceImpl storeUserService;
+
+    private final AliOSSUtil aliOSSUtil;
 
     @Value("${spring.web.resources.excel-path}")
     private String excelPath;
@@ -388,18 +392,6 @@ public class LifeUserOrderService {
             returnMap.put("success", "退款失败");
             return returnMap;
         }
-
-        // 添加审核锚点
-//        WebAudit webAudit = new WebAudit();
-//        webAudit.setId(refundOrder.getOrderId());
-//        webAudit.setType("2");
-//        webAudit.setContent(order.getOrderNo());
-//        Integer i = webAuditService.platformAuditRefundTrack(webAudit);
-//        if (!(i > 0)) {
-//            returnMap.put("success", "退款失败");
-//            return returnMap;
-//        }
-
         Date now = new Date();
         order.setStatus(4);
         order.setUpdatedTime(now);
@@ -407,7 +399,6 @@ public class LifeUserOrderService {
         lifeUserOrderMapper.updateById(order);
         refundOrder.setApplicationTime(now);
         refundOrder.setRefundTime(now);
-
         // 将退款记录插入到数据库中
         if (lifeRefundOrderMapper.insert(refundOrder) > 0) {
             returnMap.put("success", "退款成功");
@@ -422,7 +413,6 @@ public class LifeUserOrderService {
             lifeMessage.setNoticeType(2);
             lifeNoticeMapper.insert(lifeMessage);
         }
-
         // 券核销完成后,退款的情况下,需要向 store_income_details_record 表插入一条记录
         if (null != refundOrder.getStoreId()) {
             BigDecimal amounts = new BigDecimal(refundOrder.getAmount()).multiply(new BigDecimal(100));
@@ -474,15 +464,11 @@ public class LifeUserOrderService {
         // 定义格式化模式
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         List<LifeUserOrderExcelVo> lifeUserOrderExcelVos = new ArrayList<>();
-
-        String fileName = UUID.randomUUID().toString().replace("-", "");
-
         LambdaUpdateWrapper<LifeUserOrder> wrapper = new LambdaUpdateWrapper<>();
         wrapper.eq(StringUtils.isNotEmpty(status), LifeUserOrder::getStatus, status);
         wrapper.like(StringUtils.isNotEmpty(orderNo), LifeUserOrder::getOrderNo, orderNo);
         wrapper.like(StringUtils.isNotEmpty(storeId), LifeUserOrder::getStoreId, storeId);
 
-        List<LifeUserOrder> lifeUserOrders = new ArrayList<>();
         boolean flag = true;
         if (StringUtils.isNotEmpty(quanName)) {
             LambdaUpdateWrapper<LifeCoupon> wrapper1 = new LambdaUpdateWrapper<>();
@@ -497,26 +483,15 @@ public class LifeUserOrderService {
         }
         if (flag) {
             wrapper.orderByAsc(LifeUserOrder::getStatus).orderByDesc(LifeUserOrder::getUpdatedTime);
-            lifeUserOrders = lifeUserOrderMapper.selectList(wrapper);
         }
-
         List<Map<String, Object>> orderNoPage = lifeUserOrderMapper.selectMaps(wrapper);
         List<Object> orderNos = orderNoPage.stream()
                 .map(record -> record.get("order_no"))
                 .collect(Collectors.toList());
-
-
-        // 如果没有订单号,直接返回
-//        if (CollectionUtils.isEmpty(orderNos)) {
-//            iPage.setRecords(returnList);
-//            return iPage;
-//        }
-
         // 根据订单号列表查询所有相关订单明细
         LambdaQueryWrapper<LifeUserOrder> detailWrapper = new LambdaQueryWrapper<>();
         detailWrapper.in(LifeUserOrder::getOrderNo, orderNos);
         List<LifeUserOrder> allOrderDetails = lifeUserOrderMapper.selectList(detailWrapper);
-
         // 按订单号分组处理
         Map<String, List<LifeUserOrder>> orderDetailsGrouped = allOrderDetails.stream()
                 .collect(Collectors.groupingBy(LifeUserOrder::getOrderNo));
@@ -528,7 +503,6 @@ public class LifeUserOrderService {
             LifeCoupon quan = lifeCouponMapper.selectById(lifeUserOrder.getQuanId());
             QueryWrapper<StoreInfoVo> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("a.id", lifeUserOrder.getStoreId());
-
             StoreInfoVo storeInfoVoOne = storeInfoMapper.getStoreInfoVoOne(queryWrapper);
             LifeUserOrderExcelVo lifeUserOrderExcelVo = new LifeUserOrderExcelVo();
             lifeUserOrderExcelVo.setSerialNumber(++serialNumber);
@@ -539,17 +513,12 @@ public class LifeUserOrderService {
             lifeUserOrderExcelVo.setPrice("¥" + quan.getPrice());
             lifeUserOrderExcelVo.setStoreContact(storeInfoVoOne.getStoreContact());
             lifeUserOrderExcelVo.setPhone(storeInfoVoOne.getStorePhone());
-
-
             Instant instant = lifeUserOrder.getPayTime().toInstant();
             // 格式化时间
             String formattedTime = instant.atZone(ZoneId.systemDefault()).toLocalDateTime().format(formatter);
             lifeUserOrderExcelVo.setPayTime(formattedTime);
-
             lifeUserOrderExcelVo.setFinishTime(formattedTime);
-
             lifeUserOrderExcelVo.setOrderStatus(String.valueOf(lifeUserOrder.getStatus()));
-
             // 订单状态转换
             switch (lifeUserOrder.getStatus()) {
                 case 0:
@@ -576,11 +545,10 @@ public class LifeUserOrderService {
                 default:
                     lifeUserOrderExcelVo.setOrderStatus("未知状态");
             }
-
             lifeUserOrderExcelVos.add(lifeUserOrderExcelVo);
         }
-
-        ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", lifeUserOrderExcelVos, LifeUserOrderExcelVo.class);
-        return fileUrl + "excel" + excelGeneratePath + fileName + ".xlsx";
+        String fileName = UUID.randomUUID().toString().replace("-", "");
+        String filePath = ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", lifeUserOrderExcelVos, LifeUserOrderExcelVo.class);
+        return aliOSSUtil.uploadFile(new File(filePath), "excel/" + fileName + ".xlsx");
     }
 }

+ 10 - 9
alien-store/src/main/java/shop/alien/store/service/impl/LifeUserViolationServiceImpl.java

@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import shop.alien.entity.store.*;
 import shop.alien.entity.store.dto.LifeUserViolationDto;
+import shop.alien.entity.store.excelVo.LifeUserOrderExcelVo;
 import shop.alien.entity.store.excelVo.LifeUserViolationExcelVO;
 import shop.alien.entity.store.excelVo.util.ExcelGenerator;
 import shop.alien.entity.store.vo.LifeUserViolationVo;
@@ -24,8 +25,10 @@ import shop.alien.mapper.*;
 import shop.alien.store.config.WebSocketProcess;
 import shop.alien.store.service.*;
 import shop.alien.store.util.FunctionMagic;
+import shop.alien.util.ali.AliOSSUtil;
 import shop.alien.util.common.JwtUtil;
 
+import java.io.File;
 import java.io.IOException;
 import java.time.Instant;
 import java.time.ZoneId;
@@ -60,7 +63,6 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
 
     private final StoreUserService storeUserService;
 
-
     private final LifeUserDynamicsService lifeUserDynamicsService;
 
     private final StoreCommentService storeCommentService;
@@ -71,17 +73,16 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
 
     private final WebSocketProcess webSocketProcess;
 
+    private final AliOSSUtil aliOSSUtil;
+
     @Value("${spring.web.resources.excel-path}")
     private String excelPath;
 
     @Value("${spring.web.resources.excel-generate-path}")
     private String excelGeneratePath;
 
-    @Value("${spring.web.resources.url}")
-    private String fileUrl;
-
     @Override
-    public int reporting(LifeUserViolation lifeuserViolation) throws Exception  {
+    public int reporting(LifeUserViolation lifeuserViolation) throws Exception {
         try {
             int result = lifeUserViolationMapper.insert(lifeuserViolation);
             if (result > 0) {
@@ -109,7 +110,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
         return 0;
     }
 
-    private static LifeNotice getLifeNotice(LifeUserViolation lifeuserViolation)  {
+    private static LifeNotice getLifeNotice(LifeUserViolation lifeuserViolation) {
         JSONObject data = JwtUtil.getCurrentUserInfo();
         String phoneId = null;
         if (data != null) {
@@ -335,7 +336,6 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
         queryWrapper.eq(StringUtils.isNotEmpty(processingStatus), PROCESSING_STATUS, processingStatus).and(flag, wrapper -> wrapper.nested(wq -> wq.eq(REPORTING_USER_TYPE, "1").in(!MIDs.isEmpty(), REPORTING_USER_ID, MIDs)).or(wq -> wq.eq(REPORTING_USER_TYPE, "2").in(!UIDs.isEmpty(), REPORTING_USER_ID, UIDs))).orderByDesc("updated_time");
         List<LifeUserViolation> resultPage = lifeUserViolationMapper.selectList(queryWrapper);
         List<LifeUserViolationExcelVO> res = Lists.newArrayList();
-        String fileName = UUID.randomUUID().toString().replace("-", "");
         AtomicInteger serialNumber = new AtomicInteger(1);
         resultPage.forEach(e -> {
             LifeUserViolationExcelVO dto = new LifeUserViolationExcelVO();
@@ -384,8 +384,9 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
             }
             res.add(dto);
         });
-        ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", res, LifeUserViolationExcelVO.class);
-        return fileUrl + "excel" + excelGeneratePath + fileName + ".xlsx";
+        String fileName = UUID.randomUUID().toString().replace("-", "");
+        String filePath = ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", res, LifeUserViolationExcelVO.class);
+        return aliOSSUtil.uploadFile(new File(filePath), "excel/" + fileName + ".xlsx");
     }
 
     @Override

+ 56 - 65
alien-store/src/main/java/shop/alien/store/service/impl/PlatformStoreCouponServiceImpl.java

@@ -13,6 +13,7 @@ import shop.alien.entity.store.LifeCoupon;
 import shop.alien.entity.store.LifeGroupBuyMain;
 import shop.alien.entity.store.StoreImg;
 import shop.alien.entity.store.StoreInfo;
+import shop.alien.entity.store.excelVo.LifeUserViolationExcelVO;
 import shop.alien.entity.store.excelVo.StoreCouponStatusVo;
 import shop.alien.entity.store.excelVo.util.ExcelGenerator;
 import shop.alien.entity.store.vo.LifeCouponVo;
@@ -22,7 +23,9 @@ import shop.alien.mapper.PlatformStoreLifeGroupBuyMainMapper;
 import shop.alien.mapper.StoreImgMapper;
 import shop.alien.mapper.StoreInfoMapper;
 import shop.alien.store.service.PlatformStoreCouponService;
+import shop.alien.util.ali.AliOSSUtil;
 
+import java.io.File;
 import java.io.IOException;
 import java.time.LocalDateTime;
 import java.time.ZoneId;
@@ -36,21 +39,22 @@ import java.util.stream.Collectors;
 public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponService {
 
     private final PlatformStoreCouponMapper platformStoreCouponMapper;
+
     private final PlatformStoreLifeGroupBuyMainMapper platformStoreLifeGroupBuyMainMapper;
+
     private final StoreInfoMapper storeInfoMapper;
+
     private final StoreImgMapper storeImgMapper;
 
-    List<LifeCouponVo> toExcel = new ArrayList<>();
+    private final AliOSSUtil aliOSSUtil;
 
+    List<LifeCouponVo> toExcel = new ArrayList<>();
 
     @Value("${spring.web.resources.excel-path}")
     private String excelPath;
-    @Value("${spring.web.resources.excel-clearing-receipt}")
-    private String excelClearingReceipt;
+
     @Value("${spring.web.resources.excel-generate-path}")
     private String excelGeneratePath;
-    @Value("${spring.web.resources.url}")
-    private String fileUrl;
 
     @Override
     public IPage<LifeCouponVo> getCouponList(Integer page, Integer size, String storeName, String status, String createdTime, String phone, String type) {
@@ -94,22 +98,22 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
     public IPage<LifeGroupBuyMainVo> getLifeGroupBuyMainList(Integer page, Integer size, String storeName, String status, String createdTime, String phone, String expiredState) {
         QueryWrapper<LifeGroupBuyMainVo> wrapper = new QueryWrapper<>();
         wrapper.like(StringUtils.isNotEmpty(storeName), "store.store_name", storeName);
-        if(status==null || status.equals("")){
-            wrapper.in("life.status",1,2,3,4,5,6,7);
+        if (status == null || status.equals("")) {
+            wrapper.in("life.status", 1, 2, 3, 4, 5, 6, 7);
         }
-        if(status.equals("9")){
-            wrapper.in("life.status",4,5,6,7);
-        }else{
+        if (status.equals("9")) {
+            wrapper.in("life.status", 4, 5, 6, 7);
+        } else {
             wrapper.eq(StringUtils.isNotEmpty(status), "life.status", status);
         }
         //0:套餐未过期 1:套餐已过期
         LocalDateTime nowDate = LocalDateTime.now(); // 获取当前时间
-        if(expiredState!=null){
-            if(expiredState.equals("0")){
-                wrapper.gt("life.end_time",nowDate);
+        if (expiredState != null) {
+            if (expiredState.equals("0")) {
+                wrapper.gt("life.end_time", nowDate);
             }
-            if(expiredState.equals("1")){
-                wrapper.lt("life.end_time",nowDate);
+            if (expiredState.equals("1")) {
+                wrapper.lt("life.end_time", nowDate);
             }
         }
 
@@ -142,11 +146,6 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
     public IPage<LifeCouponVo> getCouponStatusList(Integer page, Integer size, String status, String expiredState) {
         IPage<LifeCouponVo> iPage = new Page<>(page, size);
         QueryWrapper<LifeCouponVo> wrapper = new QueryWrapper<>();
-
-//        wrapper.like(StringUtils.isNotEmpty(storeName), "store.store_name", storeName);
-//        wrapper.eq(StringUtils.isNotEmpty(status), "coupon.status", status);
-
-
         // 定义允许的状态值
         List<String> allowedStatus = Arrays.asList("1", "2", "3");
         if ("-3".equals(status)) { // 已售罄(逻辑状态,状态为进行中但是余量为0的)
@@ -163,16 +162,12 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
                 wrapper.eq("coupon.status", status);
             }
         }
-
         wrapper.eq("coupon.delete_flag", 0);
         wrapper.eq("store.delete_flag", 0);
         wrapper.eq("user.delete_flag", 0);
         wrapper.eq("coupon.status_delete_flag", 0);
-//        wrapper.like(StringUtils.isNotEmpty(createdTime),"coupon.created_time", createdTime);
-//        wrapper.like(StringUtils.isNotEmpty(phone),"user.phone", phone);
         wrapper.isNotNull("coupon.status");
         wrapper.orderByDesc("coupon.created_time");
-
         Date currentDate = new Date();
         if ("0".equals(expiredState)) {
             wrapper.ge("coupon.end_date", currentDate);
@@ -233,7 +228,7 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
 
     @Override
     public int approvalCoupon(Integer id, Integer status, String comment, String type) {
-        if(type.equals("0")){
+        if (type.equals("0")) {
             LifeCoupon coupon = platformStoreCouponMapper.selectById(id);
             if (null == coupon) return 0;
 
@@ -250,8 +245,8 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
                 coupon.setStartDate(new Date());
             }
             return platformStoreCouponMapper.updateById(coupon);
-        }else{
-           LifeGroupBuyMain lifeGroupBuyMain = platformStoreLifeGroupBuyMainMapper.selectById(id);
+        } else {
+            LifeGroupBuyMain lifeGroupBuyMain = platformStoreLifeGroupBuyMainMapper.selectById(id);
             if (null == lifeGroupBuyMain) return 0;
             lifeGroupBuyMain.setStatus(status);
             lifeGroupBuyMain.setApprovalComments(comment);
@@ -261,7 +256,6 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
             }
             return platformStoreLifeGroupBuyMainMapper.updateById(lifeGroupBuyMain);
         }
-
     }
 
     @Override
@@ -367,31 +361,31 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
             storeCouponStatusVos.add(storeCouponStatusVo);
         }
         String fileName = UUID.randomUUID().toString().replace("-", "");
-
-        ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeCouponStatusVos, StoreCouponStatusVo.class);
-        return fileUrl + "excel" + excelGeneratePath + fileName + ".xlsx";
+        String filePath = ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeCouponStatusVos, StoreCouponStatusVo.class);
+        String url = aliOSSUtil.uploadFile(new File(filePath), "excel/" + fileName + ".xlsx");
+        return url;
     }
 
     @Override
     public String lifeGroupBuyMainStatusExport(String status, String expiredState) throws IOException {
         QueryWrapper<LifeGroupBuyMainVo> wrapper = new QueryWrapper<>();
         // 定义允许的状态值
-        if(status==null || status.equals("")){
-            wrapper.in("life.status",1,2,3,4,5,6,7);
+        if (StringUtils.isEmpty(status)) {
+            wrapper.in("life.status", 1, 2, 3, 4, 5, 6, 7);
         }
-        if(status.equals("9")){
-            wrapper.in("life.status",4,5,6,7);
-        }else{
+        if (status.equals("9")) {
+            wrapper.in("life.status", 4, 5, 6, 7);
+        } else {
             wrapper.eq(StringUtils.isNotEmpty(status), "life.status", status);
         }
         //0:套餐未过期 1:套餐已过期
         LocalDateTime nowDate = LocalDateTime.now(); // 获取当前时间
-        if(expiredState!=null){
-            if(expiredState.equals("0")){
-                wrapper.gt("life.end_time",nowDate);
+        if (expiredState != null) {
+            if (expiredState.equals("0")) {
+                wrapper.gt("life.end_time", nowDate);
             }
-            if(expiredState.equals("1")){
-                wrapper.lt("life.end_time",nowDate);
+            if (expiredState.equals("1")) {
+                wrapper.lt("life.end_time", nowDate);
             }
         }
 
@@ -411,13 +405,11 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
                 item.setCouponState("审核拒绝");
             } else if (item.getStatus() == 4 && item.getInventoryNum() == 0) {
                 item.setCouponState("已售罄");
-            } else if (item.getStatus() == 5 && item.getInventoryNum()>0) {
+            } else if (item.getStatus() == 5 && item.getInventoryNum() > 0) {
                 item.setCouponState("进行中");
-            }
-            else if (item.getStatus() == 6) {
+            } else if (item.getStatus() == 6) {
                 item.setCouponState("已下架");
-            }
-            else if (item.getStatus() == 7) {
+            } else if (item.getStatus() == 7) {
                 item.setCouponState("已结束");
             }
             item.setCouponName(item.getGroupName());
@@ -478,9 +470,8 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
             storeCouponStatusVos.add(storeCouponStatusVo);
         }
         String fileName = UUID.randomUUID().toString().replace("-", "");
-
-        ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeCouponStatusVos, StoreCouponStatusVo.class);
-        return fileUrl + "excel" + excelGeneratePath + fileName + ".xlsx";
+        String filePath = ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeCouponStatusVos, StoreCouponStatusVo.class);
+        return aliOSSUtil.uploadFile(new File(filePath), "excel/" + fileName + ".xlsx");
     }
 
     @Override
@@ -498,12 +489,12 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
         StoreInfo storeUser = storeInfoMapper.selectById(lifeGroupBuyMain.getStoreId());
 
         List<String> collect = Arrays.stream(lifeGroupBuyMain.getImageId().split(","))
-                    .map(String::trim)
-                    .collect(Collectors.toList());
+                .map(String::trim)
+                .collect(Collectors.toList());
         List<StoreImg> storeImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().in(StoreImg::getId, collect));
 
         LifeGroupBuyMainVo lifeGroupBuyMainVo = new LifeGroupBuyMainVo();
-        BeanUtils.copyProperties(lifeGroupBuyMain,lifeGroupBuyMainVo);
+        BeanUtils.copyProperties(lifeGroupBuyMain, lifeGroupBuyMainVo);
         lifeGroupBuyMainVo.setStoreName(storeUser.getStoreName());
         lifeGroupBuyMainVo.setStoreImgList(storeImgs);
         //0:套餐未过期 1:套餐已过期
@@ -512,21 +503,21 @@ public class PlatformStoreCouponServiceImpl implements PlatformStoreCouponServic
         // 格式化日期
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         String formattedEndDate = "";
-            LocalDateTime endDateTime = lifeGroupBuyMainVo.getEndTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
-            // 调整结束时间为前一天的23:59:59
-            endDateTime = endDateTime.minusDays(1).withHour(23).withMinute(59).withSecond(59);
+        LocalDateTime endDateTime = lifeGroupBuyMainVo.getEndTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+        // 调整结束时间为前一天的23:59:59
+        endDateTime = endDateTime.minusDays(1).withHour(23).withMinute(59).withSecond(59);
 //            formattedEndDate = endDateTime.format(formatter);
 
-            // 核心逻辑:未过期时赋 0,已过期赋 1(与前端枚举定义一致)
-            if (nowDate.isBefore(endDateTime)) {
-                // 计算剩余天数
-                long remainingDays = ChronoUnit.DAYS.between(nowDate, endDateTime);
-                lifeGroupBuyMainVo.setDaysToExpire(remainingDays + "天");
-                lifeGroupBuyMainVo.setExpiredState("0"); // 当前时间未超过 endDate → 未到期
-            } else {
-                lifeGroupBuyMainVo.setDaysToExpire("0天");
-                lifeGroupBuyMainVo.setExpiredState("1"); // 当前时间超过 endDate → 已到期
-            }
+        // 核心逻辑:未过期时赋 0,已过期赋 1(与前端枚举定义一致)
+        if (nowDate.isBefore(endDateTime)) {
+            // 计算剩余天数
+            long remainingDays = ChronoUnit.DAYS.between(nowDate, endDateTime);
+            lifeGroupBuyMainVo.setDaysToExpire(remainingDays + "天");
+            lifeGroupBuyMainVo.setExpiredState("0"); // 当前时间未超过 endDate → 未到期
+        } else {
+            lifeGroupBuyMainVo.setDaysToExpire("0天");
+            lifeGroupBuyMainVo.setExpiredState("1"); // 当前时间超过 endDate → 已到期
+        }
 
         return lifeGroupBuyMainVo;
     }

+ 8 - 7
alien-store/src/main/java/shop/alien/store/service/impl/StoreActivityServiceImpl.java

@@ -20,8 +20,10 @@ import shop.alien.entity.store.vo.StoreActivityVo;
 import shop.alien.entity.store.vo.StoreInfoVo;
 import shop.alien.mapper.*;
 import shop.alien.store.service.StoreActivityService;
+import shop.alien.util.ali.AliOSSUtil;
 import shop.alien.util.common.StringToJsonConverterUtils;
 
+import java.io.File;
 import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.time.Instant;
@@ -49,9 +51,6 @@ public class StoreActivityServiceImpl extends ServiceImpl<StoreActivityMapper, S
     @Value("${spring.web.resources.excel-generate-path}")
     private String excelGeneratePath;
 
-    @Value("${spring.web.resources.url}")
-    private String fileUrl;
-
     private final StoreActivityRuleDetailMapper storeActivityRuleDetailMapper;
 
     private final StoreInfoMapper storeInfoMapper;
@@ -62,6 +61,8 @@ public class StoreActivityServiceImpl extends ServiceImpl<StoreActivityMapper, S
 
     private final StoreActivityRuleMapper storeActivityRuleMapper;
 
+    private final AliOSSUtil aliOSSUtil;
+
     @Override
     public IPage<StoreActivityVo> getActiveList(int page, int size, String status, String createdTime) {
         // 创建格式化对象
@@ -430,7 +431,7 @@ public class StoreActivityServiceImpl extends ServiceImpl<StoreActivityMapper, S
                 }
             }
             // 转换为Integer集合
-            if (integerList.size() > 0) {
+            if (!integerList.isEmpty()) {
                 List<LifeUserVo> lifeUserVos = new ArrayList<>();
                 for (Integer userId : integerList) {
                     LifeUser lifeUser = lifeUserMapper.selectById(userId);
@@ -483,7 +484,6 @@ public class StoreActivityServiceImpl extends ServiceImpl<StoreActivityMapper, S
                 new LambdaQueryWrapper<StoreActivity>()
                         .like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(status), StoreActivity::getStatus, status)
                         .like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(createdTime), StoreActivity::getCreatedTime, createdTime));
-        String fileName = UUID.randomUUID().toString().replace("-", "");
         List<StoreActivityExcelVo> storeInfoExcelVos = new ArrayList<>();
         int serialNumber = 0;
         for (StoreActivity storeActivity : storeActivities) {
@@ -519,8 +519,9 @@ public class StoreActivityServiceImpl extends ServiceImpl<StoreActivityMapper, S
             storeActivityExcelVo.setApprovalOpinion(storeActivity.getApprovalOpinion());
             storeInfoExcelVos.add(storeActivityExcelVo);
         }
-        ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeInfoExcelVos, StoreActivityExcelVo.class);
-        return fileUrl + "excel" + excelGeneratePath + fileName + ".xlsx";
+        String fileName = UUID.randomUUID().toString().replace("-", "");
+        String filePath = ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeInfoExcelVos, StoreActivityExcelVo.class);
+        return aliOSSUtil.uploadFile(new File(filePath), "excel/" + fileName + ".xlsx");
     }
 
     /**

+ 183 - 336
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -22,10 +22,10 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartRequest;
-import shop.alien.entity.result.R;
 import shop.alien.entity.store.*;
 import shop.alien.entity.store.dto.NearMeDto;
 import shop.alien.entity.store.dto.StoreInfoDto;
+import shop.alien.entity.store.excelVo.StoreActivityExcelVo;
 import shop.alien.entity.store.excelVo.StoreInfoExcelVo;
 import shop.alien.entity.store.excelVo.StoreInfoExpiredRecordsExcelVo;
 import shop.alien.entity.store.excelVo.util.ExcelExporter;
@@ -39,15 +39,16 @@ import shop.alien.store.service.StoreClockInService;
 import shop.alien.store.service.StoreInfoService;
 import shop.alien.store.util.FileUploadUtil;
 import shop.alien.store.util.GroupConstant;
+import shop.alien.util.ali.AliOSSUtil;
 import shop.alien.util.common.DistanceUtil;
 
+import java.io.File;
 import java.io.IOException;
 import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
 import java.time.*;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeFormatterBuilder;
-import java.time.format.TextStyle;
 import java.time.temporal.ChronoField;
 import java.time.temporal.ChronoUnit;
 import java.util.*;
@@ -114,15 +115,14 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
     private final StoreClockInService storeClockInService;
 
+    private final AliOSSUtil aliOSSUtil;
+
     @Value("${spring.web.resources.excel-path}")
     private String excelPath;
 
     @Value("${spring.web.resources.excel-generate-path}")
     private String excelGeneratePath;
 
-    @Value("${spring.web.resources.url}")
-    private String fileUrl;
-
     /**
      * 懒得查, 留着导出Excel
      */
@@ -168,7 +168,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         for (StoreUser storeUser : storeUsers) {
             storeMainInfoVo.setLogoutFlagUser(storeUser.getLogoutFlag());
         }
-
         // 计算店铺到最近地铁站的距离
         JSONObject nearbySubway = gaoDeMapUtil.getNearbySubway(storeMainInfoVo.getStorePosition().split(",")[0], storeMainInfoVo.getStorePosition().split(",")[1]);
         // 地铁名
@@ -177,7 +176,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         // 地铁站经纬度
         String subWayJing = nearbySubway.getString("location") == null ? null : nearbySubway.getString("location").split(",")[0];
         String subWayWei = nearbySubway.getString("location") == null ? null : nearbySubway.getString("location").split(",")[1];
-
         if ((subWayJing != null && !subWayJing.isEmpty()) && (subWayWei != null && !subWayWei.isEmpty())) {
             double storeJing = Double.parseDouble(storeMainInfoVo.getStorePosition().split(",")[0]);
             double storeWei = Double.parseDouble(storeMainInfoVo.getStorePosition().split(",")[1]);
@@ -186,7 +184,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         } else {
             storeMainInfoVo.setDistance2(0);
         }
-
         return storeMainInfoVo;
     }
 
@@ -201,7 +198,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         if (storeMainInfoVo.getRenewContractStatus() == 1) {
             storeMainInfoVo.setRenewContractStatus(0);
         }
-
         if (storeMainInfoVo.getStoreStatus() == -1) {
             LocalDateTime localDateTime = storeMainInfoVo.getLogoutTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
             LocalDateTime future = localDateTime.plusDays(7);
@@ -259,9 +255,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
     @Override
     public List<StoreInfoVo> getStoreInfoVo(String storeName, Integer id) {
         QueryWrapper<StoreInfoVo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq(null != id, "a.id", id)
-                .like(!storeName.isEmpty(), "a.store_name", storeName)
-                .eq("a.delete_flag", 0);
+        queryWrapper.eq(null != id, "a.id", id).like(!storeName.isEmpty(), "a.store_name", storeName).eq("a.delete_flag", 0);
         return storeInfoMapper.getStoreInfoVoList(queryWrapper);
     }
 
@@ -281,18 +275,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         checkAndUpdateExpiredRecords();
         IPage<StoreInfoVo> iPage = new Page<>(page, size);
         QueryWrapper<StoreInfoVo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.like(storeName != null && !storeName.isEmpty(), "a.store_name", storeName)
-                .like(storeContact != null && !storeContact.isEmpty(), "b.name", storeContact)
-                .like(storePhone != null && !storePhone.isEmpty(), "b.phone", storePhone)
-                .like(storeType != null && !storeType.isEmpty(), "a.store_type", storeType)
-                .eq(StringUtils.isNotEmpty(storeApplicationStatus), "a.store_application_status", storeApplicationStatus)
-                .eq(StringUtils.isNotEmpty(businessSection), "a.business_section", businessSection)
-                .eq(StringUtils.isNotEmpty(storeStatus), "a.store_status", storeStatus)
-                .eq(StringUtils.isNotEmpty(renewContractStatus),"a.renew_contract_status",renewContractStatus)
-                .like(StringUtils.isNotEmpty(id), "a.id", id)
-                .eq("a.delete_flag", 0)
-                .eq("b.delete_flag", 0)
-                .orderByDesc("a.created_time");
+        queryWrapper.like(storeName != null && !storeName.isEmpty(), "a.store_name", storeName).like(storeContact != null && !storeContact.isEmpty(), "b.name", storeContact).like(storePhone != null && !storePhone.isEmpty(), "b.phone", storePhone).like(storeType != null && !storeType.isEmpty(), "a.store_type", storeType).eq(StringUtils.isNotEmpty(storeApplicationStatus), "a.store_application_status", storeApplicationStatus).eq(StringUtils.isNotEmpty(businessSection), "a.business_section", businessSection).eq(StringUtils.isNotEmpty(storeStatus), "a.store_status", storeStatus).eq(StringUtils.isNotEmpty(renewContractStatus), "a.renew_contract_status", renewContractStatus).like(StringUtils.isNotEmpty(id), "a.id", id).eq("a.delete_flag", 0).eq("b.delete_flag", 0).orderByDesc("a.created_time");
         //如果查询未过期
         // 获取当前时刻
         Date currentDate = new Date();
@@ -320,22 +303,10 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         if (!records.isEmpty()) {
             // 提前查询所有需要的字典数据
             List<StoreInfoVo> collect = records.stream().filter(record -> StringUtils.isNotEmpty(record.getStoreType())).collect(Collectors.toList());
-            Set<String> allTypes = collect.stream()
-                    .map(StoreInfoVo::getStoreType)
-                    .flatMap(type -> Arrays.stream(type.split(",")))
-                    .collect(Collectors.toSet());
-
-            List<StoreDictionary> storeDictionaries = storeDictionaryMapper.selectList(
-                    new LambdaQueryWrapper<StoreDictionary>()
-                            .eq(StoreDictionary::getTypeName, "storeType")
-                            .isNull(StoreDictionary::getParentId)
-                            .in(allTypes.size() > 0, StoreDictionary::getDictId, allTypes)
-            );
-            Map<String, String> typeMap = storeDictionaries.stream()
-                    .collect(Collectors.toMap(
-                            StoreDictionary::getDictId,
-                            StoreDictionary::getDictDetail
-                    ));
+            Set<String> allTypes = collect.stream().map(StoreInfoVo::getStoreType).flatMap(type -> Arrays.stream(type.split(","))).collect(Collectors.toSet());
+
+            List<StoreDictionary> storeDictionaries = storeDictionaryMapper.selectList(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getTypeName, "storeType").isNull(StoreDictionary::getParentId).in(!allTypes.isEmpty(), StoreDictionary::getDictId, allTypes));
+            Map<String, String> typeMap = storeDictionaries.stream().collect(Collectors.toMap(StoreDictionary::getDictId, StoreDictionary::getDictDetail));
 
             Map<String, List<LifeCoupon>> quanListByStoreId = new HashMap<>();
             Map<Object, List<Map<String, Object>>> avgScoreMap = new HashMap<>();
@@ -345,27 +316,20 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             if (StringUtils.isNotEmpty(businessSection) && businessSection.equals("1")) {
                 List<Integer> storeIds = records.stream().map(StoreInfoVo::getId).collect(Collectors.toList());
                 LambdaUpdateWrapper<LifeCoupon> quanWrapper = new LambdaUpdateWrapper<>();
-                quanWrapper.in(LifeCoupon::getStoreId, storeIds)
-                        .eq(LifeCoupon::getStatus, 1)
-                        .orderByDesc(LifeCoupon::getCreatedTime);
+                quanWrapper.in(LifeCoupon::getStoreId, storeIds).eq(LifeCoupon::getStatus, 1).orderByDesc(LifeCoupon::getCreatedTime);
                 List<LifeCoupon> quanList = lifeCouponMapper.selectList(quanWrapper);
                 quanListByStoreId = quanList.stream().collect(Collectors.groupingBy(LifeCoupon::getStoreId));
                 // 获取全部店铺的评分与平均花销
                 // TODO sotre_comment 没有花销 怎么算平均花销
                 avgScoreMap = storeEvaluationMapper.allStoreAvgScore().stream().collect(Collectors.groupingBy(o -> o.get("store_id")));
-                commentMap = storeCommentMapper.selectList(new QueryWrapper<StoreComment>().eq("business_type", "5")
-                        .eq("delete_flag", 0)).stream().collect(Collectors.groupingBy(StoreComment::getStoreId));
+                commentMap = storeCommentMapper.selectList(new QueryWrapper<StoreComment>().eq("business_type", "5").eq("delete_flag", 0)).stream().collect(Collectors.groupingBy(StoreComment::getStoreId));
                 avgPriceMap = lifeUserOrderMapper.allStoreAvgPrice().stream().collect(Collectors.groupingBy(o -> o.get("store_id")));
             }
-
             for (StoreInfoVo record : records) {
                 //处理类型
                 if (StringUtils.isNotEmpty(record.getStoreType())) {
                     String[] types = record.getStoreType().split(",");
-                    List<String> typeDetails = Arrays.stream(types)
-                            .map(typeMap::get)
-                            .filter(Objects::nonNull)
-                            .collect(Collectors.toList());
+                    List<String> typeDetails = Arrays.stream(types).map(typeMap::get).filter(Objects::nonNull).collect(Collectors.toList());
                     record.setStoreTypeStr(String.join(",", typeDetails));
                     record.setStoreTypeList(Arrays.asList(types));
                 }
@@ -379,7 +343,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
                     // 获取当前时间
                     Calendar now = Calendar.getInstance();
                     Date nowCurrentDate = now.getTime();
-
                     // 计算 30 天后的时间
                     now.add(Calendar.DAY_OF_YEAR, 30);
                     Date thirtyDaysLater = now.getTime();
@@ -470,9 +433,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
     @Override
     public boolean setStoreState(String storeId, Integer businessStatus) {
         LambdaUpdateWrapper<StoreInfo> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper
-                .eq(StoreInfo::getId, storeId)
-                .set(StoreInfo::getBusinessStatus, businessStatus);
+        updateWrapper.eq(StoreInfo::getId, storeId).set(StoreInfo::getBusinessStatus, businessStatus);
         return this.update(null, updateWrapper);
     }
 
@@ -538,7 +499,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
     @Override
     public StoreInfoVo saveStoreInfo(StoreInfoDto storeInfoDto) throws Exception {
-
         //获取经营板块id
         Integer businessSection = storeInfoDto.getBusinessSection();
         //查询经营板块名称
@@ -548,11 +508,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         List<String> businessTypeNames = new ArrayList<>();
         //获取经营种类名称
         for (String businessType : businessTypes) {
-            StoreDictionary storeDictionary =
-                    storeDictionaryMapper
-                            .selectOne(
-                                    new LambdaQueryWrapper<StoreDictionary>()
-                                            .eq(StoreDictionary::getDictId, businessType).eq(StoreDictionary::getParentId, businessSectionName.getId()));
+            StoreDictionary storeDictionary = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, businessType).eq(StoreDictionary::getParentId, businessSectionName.getId()));
             businessTypeNames.add(storeDictionary.getDictDetail());
         }
 
@@ -583,22 +539,18 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         //存入审批状态为待审批
         storeInfo.setStoreApplicationStatus(0);
         //处理一下行政区域信息
-        EssentialCityCode essentialCityCode1 =
-                essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionProvinceAdcode()));
+        EssentialCityCode essentialCityCode1 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionProvinceAdcode()));
         storeInfo.setAdministrativeRegionProvinceName(essentialCityCode1.getAreaName());
-        EssentialCityCode essentialCityCode2 =
-                essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionCityAdcode()));
+        EssentialCityCode essentialCityCode2 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionCityAdcode()));
         storeInfo.setAdministrativeRegionCityName(essentialCityCode2.getAreaName());
-        EssentialCityCode essentialCityCode3 =
-                essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionDistrictAdcode()));
+        EssentialCityCode essentialCityCode3 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionDistrictAdcode()));
         storeInfo.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
         if (null == storeInfo.getCommissionRate()) {
             storeInfo.setCommissionRate("3");
         }
         storeInfoMapper.insert(storeInfo);
         result.setId(storeInfo.getId());
-        nearMeService.inGeolocation(new Point(Double.parseDouble(storeInfoDto.getStorePositionLongitude()),
-                Double.parseDouble(storeInfoDto.getStorePositionLatitude())), storeInfo.getId().toString(), Boolean.TRUE);
+        nearMeService.inGeolocation(new Point(Double.parseDouble(storeInfoDto.getStorePositionLongitude()), Double.parseDouble(storeInfoDto.getStorePositionLatitude())), storeInfo.getId().toString(), Boolean.TRUE);
         //修改门店店铺用户绑定关系
         String userAccount = storeInfoDto.getUserAccount();
         StoreUser storeUser = storeUserMapper.selectById(userAccount);
@@ -615,7 +567,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             storeImg.setImgUrl(licenseAddress);
             storeImgMapper.insert(storeImg);
         }
-
         //存入店铺合同图片
         List<String> contractImageList = storeInfoDto.getContractImageList();
         for (String licenseAddress : contractImageList) {
@@ -627,7 +578,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             storeImg.setImgUrl(licenseAddress);
             storeImgMapper.insert(storeImg);
         }
-
         return result;
     }
 
@@ -635,22 +585,19 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
     public int saveStoreInfoDraft(StoreInfoDraft storeInfoDraft) {
         //处理一下行政区域信息
         if (storeInfoDraft.getAdministrativeRegionProvinceAdcode() != null) {
-            EssentialCityCode essentialCityCode1 =
-                    essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfoDraft.getAdministrativeRegionProvinceAdcode()));
+            EssentialCityCode essentialCityCode1 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfoDraft.getAdministrativeRegionProvinceAdcode()));
             if (null != essentialCityCode1) {
                 storeInfoDraft.setAdministrativeRegionProvinceName(essentialCityCode1.getAreaName());
             }
         }
         if (storeInfoDraft.getAdministrativeRegionCityAdcode() != null) {
-            EssentialCityCode essentialCityCode2 =
-                    essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfoDraft.getAdministrativeRegionCityAdcode()));
+            EssentialCityCode essentialCityCode2 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfoDraft.getAdministrativeRegionCityAdcode()));
             if (null != essentialCityCode2) {
                 storeInfoDraft.setAdministrativeRegionCityName(essentialCityCode2.getAreaName());
             }
         }
         if (storeInfoDraft.getAdministrativeRegionDistrictAdcode() != null) {
-            EssentialCityCode essentialCityCode3 =
-                    essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfoDraft.getAdministrativeRegionDistrictAdcode()));
+            EssentialCityCode essentialCityCode3 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfoDraft.getAdministrativeRegionDistrictAdcode()));
             if (null != essentialCityCode3) {
                 storeInfoDraft.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
             }
@@ -683,8 +630,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         //如果更换了用户,则原有用户绑定门店删除
         if (!userAccountId.equals(storeUserEntity.getId().toString())) {
             LambdaUpdateWrapper<StoreUser> storeUserLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
-            storeUserLambdaUpdateWrapper.set(StoreUser::getStoreId, null)
-                    .eq(StoreUser::getId, storeUserEntity.getId());
+            storeUserLambdaUpdateWrapper.set(StoreUser::getStoreId, null).eq(StoreUser::getId, storeUserEntity.getId());
             storeUserMapper.update(null, storeUserLambdaUpdateWrapper);
         }
         //获取经营板块id
@@ -696,11 +642,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         List<String> businessTypeNames = new ArrayList<>();
         //获取经营种类名称
         for (String businessType : businessTypes) {
-            StoreDictionary storeDictionary =
-                    storeDictionaryMapper
-                            .selectOne(
-                                    new LambdaQueryWrapper<StoreDictionary>()
-                                            .eq(StoreDictionary::getDictId, businessType).eq(StoreDictionary::getParentId, businessSectionName.getId()));
+            StoreDictionary storeDictionary = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, businessType).eq(StoreDictionary::getParentId, businessSectionName.getId()));
             businessTypeNames.add(storeDictionary.getDictDetail());
         }
 
@@ -729,18 +671,14 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         storeInfo.setBusinessTypes(String.join(",", businessTypes));
         storeInfo.setBusinessTypesName(String.join(",", businessTypeNames));
         //处理一下行政区域信息
-        EssentialCityCode essentialCityCode1 =
-                essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionProvinceAdcode()));
+        EssentialCityCode essentialCityCode1 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionProvinceAdcode()));
         storeInfo.setAdministrativeRegionProvinceName(essentialCityCode1.getAreaName());
-        EssentialCityCode essentialCityCode2 =
-                essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionCityAdcode()));
+        EssentialCityCode essentialCityCode2 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionCityAdcode()));
         storeInfo.setAdministrativeRegionCityName(essentialCityCode2.getAreaName());
-        EssentialCityCode essentialCityCode3 =
-                essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionDistrictAdcode()));
+        EssentialCityCode essentialCityCode3 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionDistrictAdcode()));
         storeInfo.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
         storeInfoMapper.updateById(storeInfo);
-        nearMeService.inGeolocation(new Point(Double.parseDouble(storeInfoDto.getStorePositionLongitude()),
-                Double.parseDouble(storeInfoDto.getStorePositionLatitude())), storeInfo.getId().toString(), Boolean.TRUE);
+        nearMeService.inGeolocation(new Point(Double.parseDouble(storeInfoDto.getStorePositionLongitude()), Double.parseDouble(storeInfoDto.getStorePositionLatitude())), storeInfo.getId().toString(), Boolean.TRUE);
 
         //修改门店店铺用户绑定关系
         String userAccount = storeInfoDto.getUserAccount();
@@ -777,8 +715,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
     @Override
     public String deleteStoreInfo(StoreInfoDto storeInfoDto) {
-        StoreUser storeUser = storeUserMapper
-                .selectOne(new LambdaQueryWrapper<StoreUser>().eq(StoreUser::getStoreId, storeInfoDto.getId()));
+        StoreUser storeUser = storeUserMapper.selectOne(new LambdaQueryWrapper<StoreUser>().eq(StoreUser::getStoreId, storeInfoDto.getId()));
         //判断是否有未完成的订单
         List<LifeUserOrder> lifeUserOrders = lifeUserOrderMapper.selectList(new LambdaQueryWrapper<LifeUserOrder>().in(LifeUserOrder::getStatus, 0, 3).eq(ObjectUtils.isNotEmpty(storeUser), LifeUserOrder::getUserId, storeUser.getId()).eq(LifeUserOrder::getDeleteFlag, 0));
         if (ObjectUtils.isNotEmpty(lifeUserOrders)) {
@@ -787,8 +724,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             //判断是否修改变更过的用户账户
             if (storeUser != null) {
                 LambdaUpdateWrapper<StoreUser> storeUserLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
-                storeUserLambdaUpdateWrapper.set(StoreUser::getStoreId, null)
-                        .eq(StoreUser::getId, storeUser.getId());
+                storeUserLambdaUpdateWrapper.set(StoreUser::getStoreId, null).eq(StoreUser::getId, storeUser.getId());
                 storeUserMapper.update(null, storeUserLambdaUpdateWrapper);
             }
             //删除商铺信息
@@ -811,9 +747,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
     @Override
     public List<StoreDictionaryVo> getBusinessSection() {
-        List<StoreDictionary> businessSection = storeDictionaryMapper.selectList(
-                new LambdaQueryWrapper<StoreDictionary>()
-                        .eq(StoreDictionary::getTypeName, "business_section").ne(StoreDictionary::getDictId, 0));
+        List<StoreDictionary> businessSection = storeDictionaryMapper.selectList(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getTypeName, "business_section").ne(StoreDictionary::getDictId, 0));
         List<StoreDictionaryVo> voList = new ArrayList<>();
         for (StoreDictionary storeDictionary : businessSection) {
             StoreDictionaryVo vo = new StoreDictionaryVo();
@@ -825,9 +759,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
     @Override
     public List<StoreDictionaryVo> getBusinessSectionTypes(String parentId) {
-        StoreDictionary businessSection = storeDictionaryMapper.selectOne(
-                new LambdaQueryWrapper<StoreDictionary>()
-                        .eq(StoreDictionary::getTypeName, "business_section").eq(StoreDictionary::getDictId, parentId));
+        StoreDictionary businessSection = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getTypeName, "business_section").eq(StoreDictionary::getDictId, parentId));
         List<StoreDictionary> storeDictionaries = storeDictionaryMapper.selectList(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getParentId, businessSection.getId()));
         List<StoreDictionaryVo> voList = new ArrayList<>();
         for (StoreDictionary storeDictionary : storeDictionaries) {
@@ -840,10 +772,8 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
     @Override
     public List<StoreUserVo> getUnboundAccountList(String id) {
-
         List<StoreUserVo> storeUserVoList = new ArrayList<>();
-        List<StoreUser> storeUsers =
-                storeUserMapper.selectList(new LambdaQueryWrapper<StoreUser>().isNull(StoreUser::getStoreId));
+        List<StoreUser> storeUsers = storeUserMapper.selectList(new LambdaQueryWrapper<StoreUser>().isNull(StoreUser::getStoreId));
         for (StoreUser storeUser : storeUsers) {
             StoreUserVo vo = new StoreUserVo();
             BeanUtils.copyProperties(storeUser, vo);
@@ -866,13 +796,9 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
     @Override
     public void addBusinessSectionAndTypes(StoreInfoDto storeInfoDto) {
-        StoreDictionary businessSectionParent = storeDictionaryMapper.selectOne(
-                new LambdaQueryWrapper<StoreDictionary>()
-                        .eq(StoreDictionary::getTypeName, "business_section").eq(StoreDictionary::getDictId, 0));
+        StoreDictionary businessSectionParent = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getTypeName, "business_section").eq(StoreDictionary::getDictId, 0));
         //查看当前最大id
-        List<StoreDictionary> businessSection = storeDictionaryMapper.selectList(
-                new LambdaQueryWrapper<StoreDictionary>()
-                        .eq(StoreDictionary::getTypeName, "business_section"));
+        List<StoreDictionary> businessSection = storeDictionaryMapper.selectList(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getTypeName, "business_section"));
         Integer maxId = 0;
         for (StoreDictionary storeDictionary : businessSection) {
             if (Integer.parseInt(storeDictionary.getDictId()) > maxId) {
@@ -935,7 +861,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         }
         result.setBusinessLicenseAddress(storeImgPaths);
         result.setContractImageList(storeContractImagePathImgs);
-
         //存入续签合同地址
         List<StoreImg> renewContractImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 22));
         List<String> renewContractImagePathImgs = new ArrayList<>();
@@ -950,7 +875,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         } else {
             result.setEntranceImage("null");
         }
-
         // 存放商家头像
         List<StoreImg> storeImgs1 = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 10));
         if (!storeImgs1.isEmpty()) {
@@ -961,7 +885,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         // 设置经纬度
         result.setStorePositionLongitude(result.getStorePosition().split(",")[0]);
         result.setStorePositionLatitude(result.getStorePosition().split(",")[1]);
-
         // 设置距离
         if ((jingdu != null && !jingdu.isEmpty()) && (weidu != null && !weidu.isEmpty())) {
             double storeJing = Double.parseDouble(result.getStorePosition().split(",")[0]);
@@ -969,7 +892,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             double storeDistance = DistanceUtil.haversineCalculateDistance(Double.parseDouble(jingdu), Double.parseDouble(weidu), storeJing, storeWei);
             result.setDistance(storeDistance);
         }
-
         // 计算店铺到最近地铁站的距离
         JSONObject nearbySubway = gaoDeMapUtil.getNearbySubway(result.getStorePosition().split(",")[0], result.getStorePosition().split(",")[1]);
         // 地铁名
@@ -978,7 +900,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         // 地铁站经纬度
         String subWayJing = nearbySubway.getString("location") == null ? null : nearbySubway.getString("location").split(",")[0];
         String subWayWei = nearbySubway.getString("location") == null ? null : nearbySubway.getString("location").split(",")[1];
-
         if ((subWayJing != null && !subWayJing.isEmpty()) && (subWayWei != null && !subWayWei.isEmpty())) {
             double storeJing = Double.parseDouble(result.getStorePosition().split(",")[0]);
             double storeWei = Double.parseDouble(result.getStorePosition().split(",")[1]);
@@ -987,23 +908,18 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         } else {
             result.setDistance2(0);
         }
-
         // 当前登录用户是否收藏
         LambdaUpdateWrapper<LifeCollect> shouCangWrapper = new LambdaUpdateWrapper<>();
-        shouCangWrapper.eq(LifeCollect::getUserId, userId)
-                .eq(LifeCollect::getStoreId, storeId);
+        shouCangWrapper.eq(LifeCollect::getUserId, userId).eq(LifeCollect::getStoreId, storeId);
         LifeCollect shouCang = lifeCollectMapper.selectOne(shouCangWrapper);
         if (null == shouCang) {
             result.setCollection(0);
         } else {
             result.setCollection(1);
         }
-
         // 获取店铺优惠券列表
         LambdaUpdateWrapper<LifeCoupon> quanWrapper = new LambdaUpdateWrapper<>();
-        quanWrapper.eq(LifeCoupon::getStoreId, storeId)
-                .eq(LifeCoupon::getStatus, 1)
-                .eq(LifeCoupon::getType, 1);
+        quanWrapper.eq(LifeCoupon::getStoreId, storeId).eq(LifeCoupon::getStatus, 1).eq(LifeCoupon::getType, 1);
         List<LifeCoupon> quanList = lifeCouponMapper.selectList(quanWrapper);
         List<LifeCouponVo> quanVoList = new ArrayList<>();
         List<String> collect = quanList.stream().map(LifeCoupon::getId).collect(Collectors.toList());
@@ -1024,23 +940,17 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
         // 获取店铺团购
         LambdaUpdateWrapper<LifeCoupon> tuangouWrapper = new LambdaUpdateWrapper<>();
-        tuangouWrapper.eq(LifeCoupon::getStoreId, storeId)
-                .eq(LifeCoupon::getStatus, 1)
-                .eq(LifeCoupon::getType, 2).orderByDesc(LifeCoupon::getCreatedTime);
+        tuangouWrapper.eq(LifeCoupon::getStoreId, storeId).eq(LifeCoupon::getStatus, 1).eq(LifeCoupon::getType, 2).orderByDesc(LifeCoupon::getCreatedTime);
         List<LifeCoupon> tuangouList = lifeCouponMapper.selectList(tuangouWrapper);
         List<LifeCouponVo> tuangouVOList = new ArrayList<>();
         for (LifeCoupon lifeCoupon : tuangouList) {
             LifeCouponVo lifeCouponVo = new LifeCouponVo();
             BeanUtils.copyProperties(lifeCoupon, lifeCouponVo);
             if (StringUtils.isNotEmpty(lifeCoupon.getImagePath())) {
-                List<String> ids = Arrays.stream(lifeCoupon.getImagePath().split(","))
-                        .map(String::trim)
-                        .collect(Collectors.toList());
+                List<String> ids = Arrays.stream(lifeCoupon.getImagePath().split(",")).map(String::trim).collect(Collectors.toList());
                 List<StoreImg> imgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().in(StoreImg::getId, ids));
                 if (imgList != null) {
-                    String imgs = imgList.stream()
-                            .map(StoreImg::getImgUrl)
-                            .collect(Collectors.joining(","));
+                    String imgs = imgList.stream().map(StoreImg::getImgUrl).collect(Collectors.joining(","));
                     lifeCouponVo.setImgs(imgs);
                 }
             }
@@ -1090,8 +1000,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
         // 获取店铺动态列表
         QueryWrapper<LifeUserDynamics> dynamicsWrapper = new QueryWrapper<>();
-        dynamicsWrapper.eq("phone_id", "store_" + result.getStorePhone())
-                .orderByDesc("lud.created_time");
+        dynamicsWrapper.eq("phone_id", "store_" + result.getStorePhone()).orderByDesc("lud.created_time");
         List<LifeUserDynamicsVo> storeDynamicslist = lifeUserDynamicsMapper.getStoreDynamicslist(userId, dynamicsWrapper);
         List<LifeUserDynamicsVo> storeDynamicslist2 = storeDynamicslist.stream().limit(10).collect(Collectors.toList());
         result.setDynamicsList(storeDynamicslist2);
@@ -1159,16 +1068,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         // 定义格式化模式
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         // 先将 Date 转换为 Instant
-        List<StoreInfoVo> storeInfoVos = storeInfoMapper.getStoreInfoVo(
-                new QueryWrapper<StoreInfoVo>()
-                        .like(StringUtils.isNotEmpty(id), "a.id", id)
-                        .like(StringUtils.isNotEmpty(storePhone), "b.phone", storePhone)
-                        .eq(StringUtils.isNotEmpty(storeApplicationStatusStr), "a.store_application_status", storeApplicationStatusStr)
-                        .eq(StringUtils.isNotEmpty(businessSection), "a.business_section", businessSection)
-                        .eq("a.delete_flag", 0)
-                        .eq("b.delete_flag", 0)
-                        .orderByDesc("a.created_time"));
-        String fileName = UUID.randomUUID().toString().replace("-", "");
+        List<StoreInfoVo> storeInfoVos = storeInfoMapper.getStoreInfoVo(new QueryWrapper<StoreInfoVo>().like(StringUtils.isNotEmpty(id), "a.id", id).like(StringUtils.isNotEmpty(storePhone), "b.phone", storePhone).eq(StringUtils.isNotEmpty(storeApplicationStatusStr), "a.store_application_status", storeApplicationStatusStr).eq(StringUtils.isNotEmpty(businessSection), "a.business_section", businessSection).eq("a.delete_flag", 0).eq("b.delete_flag", 0).orderByDesc("a.created_time"));
         List<StoreInfoExcelVo> storeInfoExcelVos = new ArrayList<>();
         int serialNumber = 0;
         for (StoreInfoVo storeInfoVo : storeInfoVos) {
@@ -1200,8 +1100,9 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             //存入创建时间
             storeInfoExcelVos.add(storeInfoExcelVo);
         }
-        ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeInfoExcelVos, StoreInfoExcelVo.class);
-        return fileUrl + "excel" + excelGeneratePath + fileName + ".xlsx";
+        String fileName = UUID.randomUUID().toString().replace("-", "");
+        String filePath = ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeInfoExcelVos, StoreInfoExcelVo.class);
+        return aliOSSUtil.uploadFile(new File(filePath), "excel/" + fileName + ".xlsx");
     }
 
     @Override
@@ -1211,13 +1112,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         // 定义格式化模式
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         // 先将 Date 转换为 Instant
-        List<StoreInfoVo> storeInfoVos = storeInfoMapper.getStoreInfoVo(
-                new QueryWrapper<StoreInfoVo>()
-                        .like(StringUtils.isNotEmpty(id), "a.id", id)
-                        .eq("a.delete_flag", 0)
-                        .eq("b.delete_flag", 0)
-                        .orderByDesc("a.created_time"));
-        String fileName = UUID.randomUUID().toString().replace("-", "");
+        List<StoreInfoVo> storeInfoVos = storeInfoMapper.getStoreInfoVo(new QueryWrapper<StoreInfoVo>().like(StringUtils.isNotEmpty(id), "a.id", id).eq("a.delete_flag", 0).eq("b.delete_flag", 0).orderByDesc("a.created_time"));
         List<StoreInfoExpiredRecordsExcelVo> storeInfoExpiredRecordsExcelVos = new ArrayList<>();
         int serialNumber = 0;
         for (StoreInfoVo storeInfoVo : storeInfoVos) {
@@ -1273,10 +1168,12 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
                     storeInfoExpiredRecordsExcelVos.add(storeInfoExpiredRecordsExcelVo);
                 }
             }
-
         }
-        ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeInfoExpiredRecordsExcelVos, StoreInfoExpiredRecordsExcelVo.class);
-        return fileUrl + "excel" + excelGeneratePath + fileName + ".xlsx";
+        String fileName = UUID.randomUUID().toString().replace("-", "");
+        String filePath = ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeInfoExpiredRecordsExcelVos, StoreInfoExpiredRecordsExcelVo.class);
+        String url = aliOSSUtil.uploadFile(new File(filePath), "/excel/" + fileName + ".xlsx");
+        new File(filePath).delete();
+        return url;
     }
 
     @Override
@@ -1316,9 +1213,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         if (lat != null && lon != null && distance != null) {
             List<NearMeDto> nearMeDtos = nearMeService.nearbyMerchants(lon, lat, distance, flag);
             if (nearMeDtos != null && !nearMeDtos.isEmpty()) {
-                storeId = nearMeDtos.stream()
-                        .map(item -> String.valueOf(item.getConent()))
-                        .collect(Collectors.joining(","));
+                storeId = nearMeDtos.stream().map(item -> String.valueOf(item.getConent())).collect(Collectors.joining(","));
             }
         }
 
@@ -1344,42 +1239,28 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             List<String> storeIds = Arrays.asList(storeId.split(","));
             if (StringUtils.isNotEmpty(startTime) && StringUtils.isNotEmpty(endTime)) {
                 List<StoreBusinessInfo> storeBusinessInfos = storeBusinessInfoMapper.selectList(new LambdaQueryWrapper<StoreBusinessInfo>().in(StoreBusinessInfo::getStoreId, storeIds));
-                DateTimeFormatter formatter = new DateTimeFormatterBuilder()
-                        .appendValue(ChronoField.HOUR_OF_DAY, 1, 2, java.time.format.SignStyle.NOT_NEGATIVE)
-                        .appendLiteral(':')
-                        .appendValue(ChronoField.MINUTE_OF_HOUR, 2)
-                        .toFormatter();
-                List<StoreBusinessInfo> list = storeBusinessInfos.stream()
-                        .filter(item -> {
-                            // 商家开门时间
-                            LocalTime timeStart = LocalTime.parse(item.getEndTime(), formatter);
-                            // 商家关门时间
-                            LocalTime timeEnd = LocalTime.parse(item.getEndTime(), formatter);
-                            // 开始时间
-                            LocalTime time1 = LocalTime.parse(startTime);
-                            // 结束时间
-                            LocalTime time2 = LocalTime.parse(endTime);
-                            return !time1.isBefore(timeStart) && !time2.isAfter(timeEnd);
-                        })
-                        .collect(Collectors.toList());
-
-                storeIds = list.stream()
-                        .map(item -> String.valueOf(item.getStoreId()))
-                        .collect(Collectors.toList());
+                DateTimeFormatter formatter = new DateTimeFormatterBuilder().appendValue(ChronoField.HOUR_OF_DAY, 1, 2, java.time.format.SignStyle.NOT_NEGATIVE).appendLiteral(':').appendValue(ChronoField.MINUTE_OF_HOUR, 2).toFormatter();
+                List<StoreBusinessInfo> list = storeBusinessInfos.stream().filter(item -> {
+                    // 商家开门时间
+                    LocalTime timeStart = LocalTime.parse(item.getEndTime(), formatter);
+                    // 商家关门时间
+                    LocalTime timeEnd = LocalTime.parse(item.getEndTime(), formatter);
+                    // 开始时间
+                    LocalTime time1 = LocalTime.parse(startTime);
+                    // 结束时间
+                    LocalTime time2 = LocalTime.parse(endTime);
+                    return !time1.isBefore(timeStart) && !time2.isAfter(timeEnd);
+                }).collect(Collectors.toList());
+
+                storeIds = list.stream().map(item -> String.valueOf(item.getStoreId())).collect(Collectors.toList());
             }
-            storeIds.stream()
-                    .filter(Objects::nonNull) // 确保 storeId 不为 null
+            storeIds.stream().filter(Objects::nonNull) // 确保 storeId 不为 null
                     .distinct() // 去重
-                    .map(String::valueOf)
-                    .collect(Collectors.toList());
+                    .map(String::valueOf).collect(Collectors.toList());
             if (priceStr != null && priceEnd != null) {
                 List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStoreId, storeIds));
-                List<LifeCoupon> list = lifeCoupons.stream()
-                        .filter(item -> Double.parseDouble(item.getPrice()) >= priceStr && Double.parseDouble(item.getPrice()) < priceEnd)
-                        .collect(Collectors.toList());
-                storeIds = list.stream()
-                        .map(item -> String.valueOf(item.getStoreId()))
-                        .collect(Collectors.toList());
+                List<LifeCoupon> list = lifeCoupons.stream().filter(item -> Double.parseDouble(item.getPrice()) >= priceStr && Double.parseDouble(item.getPrice()) < priceEnd).collect(Collectors.toList());
+                storeIds = list.stream().map(item -> String.valueOf(item.getStoreId())).collect(Collectors.toList());
             }
             if (!CollectionUtils.isEmpty(storeIds)) {
                 LambdaQueryWrapper<StoreInfo> queryWrapper = new LambdaQueryWrapper<>();
@@ -1438,50 +1319,36 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             List<String> storeIds = Arrays.asList(storeId.split(","));
             if (StringUtils.isNotEmpty(startTime) && StringUtils.isNotEmpty(endTime)) {
                 List<StoreBusinessInfo> storeBusinessInfos = storeBusinessInfoMapper.selectList(new LambdaQueryWrapper<StoreBusinessInfo>().in(StoreBusinessInfo::getStoreId, storeIds));
-                DateTimeFormatter formatter = new DateTimeFormatterBuilder()
-                        .appendValue(ChronoField.HOUR_OF_DAY, 1, 2, java.time.format.SignStyle.NOT_NEGATIVE)
-                        .appendLiteral(':')
-                        .appendValue(ChronoField.MINUTE_OF_HOUR, 2)
-                        .toFormatter();
-                List<StoreBusinessInfo> list = storeBusinessInfos.stream()
-                        .filter(item -> {
-                            // 商家开门时间
-                            LocalTime timeStart = LocalTime.parse(item.getEndTime(), formatter);
-                            // 商家关门时间
-                            LocalTime timeEnd = LocalTime.parse(item.getEndTime(), formatter);
-                            // 开始时间
-                            LocalTime time1 = LocalTime.parse(startTime);
-                            // 结束时间
-                            LocalTime time2 = LocalTime.parse(endTime);
-                            return !time1.isBefore(timeStart) && !time2.isAfter(timeEnd);
-                        })
-                        .collect(Collectors.toList());
-
-                storeIds = list.stream()
-                        .map(item -> String.valueOf(item.getStoreId()))
-                        .collect(Collectors.toList());
+                DateTimeFormatter formatter = new DateTimeFormatterBuilder().appendValue(ChronoField.HOUR_OF_DAY, 1, 2, java.time.format.SignStyle.NOT_NEGATIVE).appendLiteral(':').appendValue(ChronoField.MINUTE_OF_HOUR, 2).toFormatter();
+                List<StoreBusinessInfo> list = storeBusinessInfos.stream().filter(item -> {
+                    // 商家开门时间
+                    LocalTime timeStart = LocalTime.parse(item.getEndTime(), formatter);
+                    // 商家关门时间
+                    LocalTime timeEnd = LocalTime.parse(item.getEndTime(), formatter);
+                    // 开始时间
+                    LocalTime time1 = LocalTime.parse(startTime);
+                    // 结束时间
+                    LocalTime time2 = LocalTime.parse(endTime);
+                    return !time1.isBefore(timeStart) && !time2.isAfter(timeEnd);
+                }).collect(Collectors.toList());
+
+                storeIds = list.stream().map(item -> String.valueOf(item.getStoreId())).collect(Collectors.toList());
             }
-            storeIds.stream()
-                    .filter(Objects::nonNull) // 确保 storeId 不为 null
+            storeIds.stream().filter(Objects::nonNull) // 确保 storeId 不为 null
                     .distinct() // 去重
-                    .map(String::valueOf)
-                    .collect(Collectors.toList());
+                    .map(String::valueOf).collect(Collectors.toList());
             if (priceStr != null && priceEnd != null) {
                 List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStoreId, storeIds));
-                List<LifeCoupon> list = lifeCoupons.stream()
-                        .filter(item -> Double.parseDouble(item.getPrice()) >= priceStr && Double.parseDouble(item.getPrice()) < priceEnd)
-                        .collect(Collectors.toList());
-                storeIds = list.stream()
-                        .map(item -> String.valueOf(item.getStoreId()))
-                        .collect(Collectors.toList());
+                List<LifeCoupon> list = lifeCoupons.stream().filter(item -> Double.parseDouble(item.getPrice()) >= priceStr && Double.parseDouble(item.getPrice()) < priceEnd).collect(Collectors.toList());
+                storeIds = list.stream().map(item -> String.valueOf(item.getStoreId())).collect(Collectors.toList());
             }
             if (!CollectionUtils.isEmpty(storeIds)) {
                 queryWrapper.in("a.id", storeIds);
             }
         }
 
-        queryWrapper.eq("a.delete_flag",0);
-        queryWrapper.eq("a.logout_flag",0);
+        queryWrapper.eq("a.delete_flag", 0);
+        queryWrapper.eq("a.logout_flag", 0);
         queryWrapper.like(StringUtils.isNotEmpty(vo.getFoodType()), "a.business_types_name", vo.getFoodType());
         queryWrapper.like(StringUtils.isNotEmpty(vo.getStoreName()), "a.store_name", vo.getStoreName());
 
@@ -1491,7 +1358,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             }
         }
         queryWrapper.orderByAsc("dist");
-        storeInfoIPage = storeInfoMapper.getPageForDistance(page,lon + "," + lat, queryWrapper);
+        storeInfoIPage = storeInfoMapper.getPageForDistance(page, lon + "," + lat, queryWrapper);
         List<StoreInfoVo> storeInfoVoList = storeInfoIPage.getRecords();
 
         // 提取所有符合条件的门店ID
@@ -1515,7 +1382,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         // 遍历所有门店信息,构造返回结果
         for (StoreInfoVo store : storeInfoVoList) {
             Map<String, Object> storeMap = new HashMap<>();
-            storeMap.put("dist",store.getDist());
+            storeMap.put("dist", store.getDist());
             // 添加门店的业务状态及其描述
             storeMap.put("businessStatus", store.getBusinessStatus());
             storeMap.put("businessStatusStr", store.getBusinessStatusStr());
@@ -1605,9 +1472,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             List<StoreInfo> infos = storeInfoMapper.selectList(queryWrapper);
             storeInfos.addAll(infos);
         }
-        return new ArrayList<>(storeInfos.stream()
-                .collect(Collectors.toMap(StoreInfo::getId, info -> info, (existing, replacement) -> existing))
-                .values());
+        return new ArrayList<>(storeInfos.stream().collect(Collectors.toMap(StoreInfo::getId, info -> info, (existing, replacement) -> existing)).values());
     }
 
     public static String findCommon(String... strings) {
@@ -1631,46 +1496,41 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
      */
     public void checkAndUpdateExpiredRecords() {
         LambdaUpdateWrapper<StoreInfo> queryWrapper = new LambdaUpdateWrapper<>();
-        queryWrapper.isNotNull(StoreInfo::getExpirationTime)
-                .lt(StoreInfo::getExpirationTime, LocalDateTime.now())
-                .eq(StoreInfo::getBusinessStatus, 0)
-                .set(StoreInfo::getBusinessStatus, 99);
+        queryWrapper.isNotNull(StoreInfo::getExpirationTime).lt(StoreInfo::getExpirationTime, LocalDateTime.now()).eq(StoreInfo::getBusinessStatus, 0).set(StoreInfo::getBusinessStatus, 99);
         this.update(queryWrapper);
     }
 
     @Override
     public void logoutStore(StoreInfoVo storeInfo) {
-                // 通过id获取当前店铺信息
-                LambdaQueryWrapper<StoreInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-                lambdaQueryWrapper.eq(StoreInfo::getId, storeInfo.getId());
-                StoreInfo storeIn = storeInfoMapper.selectOne(lambdaQueryWrapper);
-                if (storeIn != null) {
-                    // 添加注销原因
-                    storeIn.setLogoutReason(storeInfo.getLogoutReason());
-                    // 添加注销code
-                    storeIn.setLogoutCode(storeInfo.getLogoutCode());
-                    // 注销中状态
-                    storeIn.setStoreStatus(-1);
-                    // 添加注销申请时间
-                    storeIn.setLogoutTime(new Date());
-                    // 更新logout_flag状态为1
-                    storeIn.setLogoutFlag(1);
-                    int num = storeInfoMapper.updateById(storeIn);
-                    if (num > 0) {
-                        // 发送通知
-                        LifeNotice lifeMessage = new LifeNotice();
-                        lifeMessage.setReceiverId("store_" + storeInfo.getStorePhone());
-                        String text = "您提交的店铺注销申请已成功提交, 系统将按流程进行处理. 注销申请提交后, 将进入7天的冷静期. 期间您可以随时在" +
-                                "[门店装修]-[操作]中撤回申请. 冷静期结束后, 系统将正式开始注销操作. 店铺内所有数据将被永久清除, 且无法恢复." +
-                                "如有疑问, 可联系客服咨询. 感谢您使用我们的服务.";
-                        lifeMessage.setContext(text);
-                        lifeMessage.setTitle("注销店铺通知");
-                        lifeMessage.setSenderId("system");
-                        lifeMessage.setIsRead(0);
-                        lifeMessage.setNoticeType(1);
-                        lifeNoticeMapper.insert(lifeMessage);
-                    }
-                }
+        // 通过id获取当前店铺信息
+        LambdaQueryWrapper<StoreInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+        lambdaQueryWrapper.eq(StoreInfo::getId, storeInfo.getId());
+        StoreInfo storeIn = storeInfoMapper.selectOne(lambdaQueryWrapper);
+        if (storeIn != null) {
+            // 添加注销原因
+            storeIn.setLogoutReason(storeInfo.getLogoutReason());
+            // 添加注销code
+            storeIn.setLogoutCode(storeInfo.getLogoutCode());
+            // 注销中状态
+            storeIn.setStoreStatus(-1);
+            // 添加注销申请时间
+            storeIn.setLogoutTime(new Date());
+            // 更新logout_flag状态为1
+            storeIn.setLogoutFlag(1);
+            int num = storeInfoMapper.updateById(storeIn);
+            if (num > 0) {
+                // 发送通知
+                LifeNotice lifeMessage = new LifeNotice();
+                lifeMessage.setReceiverId("store_" + storeInfo.getStorePhone());
+                String text = "您提交的店铺注销申请已成功提交, 系统将按流程进行处理. 注销申请提交后, 将进入7天的冷静期. 期间您可以随时在" + "[门店装修]-[操作]中撤回申请. 冷静期结束后, 系统将正式开始注销操作. 店铺内所有数据将被永久清除, 且无法恢复." + "如有疑问, 可联系客服咨询. 感谢您使用我们的服务.";
+                lifeMessage.setContext(text);
+                lifeMessage.setTitle("注销店铺通知");
+                lifeMessage.setSenderId("system");
+                lifeMessage.setIsRead(0);
+                lifeMessage.setNoticeType(1);
+                lifeNoticeMapper.insert(lifeMessage);
+            }
+        }
     }
 
     @Override
@@ -1696,10 +1556,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
             lifeMessage.setReceiverId("store_" + storeInfo.getStorePhone());
             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             String storeDate = simpleDateFormat.format(new DateTime());
-            String text = "处理结果:已撤回注销申请" +
-                    "处理时间:" + storeDate +
-                    "当前店铺状态已恢复正常. 您可以继续使用该店铺登录并享受各项服务, 所有店铺数据均已妥善保留." +
-                    "若您后续仍有注销需求, 可随时通过门店装修页面重新提交申请. 感谢您的理解与支持!";
+            String text = "处理结果:已撤回注销申请" + "处理时间:" + storeDate + "当前店铺状态已恢复正常. 您可以继续使用该店铺登录并享受各项服务, 所有店铺数据均已妥善保留." + "若您后续仍有注销需求, 可随时通过门店装修页面重新提交申请. 感谢您的理解与支持!";
             lifeMessage.setContext(text);
             lifeMessage.setTitle("撤销店铺注销通知");
             lifeMessage.setSenderId("system");
@@ -1726,75 +1583,67 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
     @Override
     public int saveOrUpdateStoreInfo(StoreInfoDto storeInfodto) {
-            if (storeInfodto.getId() != null) {
-                //效验当前店铺存在未完成的订单及正在销售的商品
-                verificationStoreInfoStatus(storeInfodto);
-
-                //获取经营板块id
-                Integer businessSection = storeInfodto.getBusinessSection();
-                //查询经营板块名称
-                StoreDictionary businessSectionName = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, businessSection).eq(StoreDictionary::getTypeName, "business_section"));
-                //查询经营种类
-                List<String> businessTypeNames = new ArrayList<>();
-                List<String> businessTypes = storeInfodto.getBusinessTypes();
-                if (!CollectionUtils.isEmpty(businessTypes)) {
-                    //获取经营种类名称
-                    for (String businessType : businessTypes) {
-                        StoreDictionary storeDictionary =
-                                storeDictionaryMapper
-                                        .selectOne(
-                                                new LambdaQueryWrapper<StoreDictionary>()
-                                                        .eq(StoreDictionary::getDictId, businessType).eq(StoreDictionary::getParentId, businessSectionName.getId()));
-                        businessTypeNames.add(storeDictionary.getDictDetail());
-                    }
-                }
-                StoreInfo storeInfo = new StoreInfo();
-                BeanUtils.copyProperties(storeInfodto, storeInfo);
-
-                //存入经纬度
-                if(StringUtils.isEmpty(storeInfodto.getStorePositionLongitude())||StringUtils.isEmpty(storeInfodto.getStorePositionLatitude())){
-                    StoreInfo storeIn = storeInfoMapper.selectById(storeInfodto.getId());
-                    storeInfo.setStorePosition(storeIn.getStorePosition());
-                }else{
-                    storeInfo.setStorePosition(storeInfodto.getStorePositionLongitude() + "," + storeInfodto.getStorePositionLatitude());
+        if (storeInfodto.getId() != null) {
+            //效验当前店铺存在未完成的订单及正在销售的商品
+            verificationStoreInfoStatus(storeInfodto);
+
+            //获取经营板块id
+            Integer businessSection = storeInfodto.getBusinessSection();
+            //查询经营板块名称
+            StoreDictionary businessSectionName = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, businessSection).eq(StoreDictionary::getTypeName, "business_section"));
+            //查询经营种类
+            List<String> businessTypeNames = new ArrayList<>();
+            List<String> businessTypes = storeInfodto.getBusinessTypes();
+            if (!CollectionUtils.isEmpty(businessTypes)) {
+                //获取经营种类名称
+                for (String businessType : businessTypes) {
+                    StoreDictionary storeDictionary = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, businessType).eq(StoreDictionary::getParentId, businessSectionName.getId()));
+                    businessTypeNames.add(storeDictionary.getDictDetail());
                 }
+            }
+            StoreInfo storeInfo = new StoreInfo();
+            BeanUtils.copyProperties(storeInfodto, storeInfo);
 
-                //存入门店状态
-                storeInfo.setStoreStatus(storeInfodto.getStoreStatus());
-                //板块及类型
-                storeInfo.setBusinessSection(businessSection);
-                storeInfo.setBusinessSectionName(businessSectionName.getDictDetail());
-                if (!CollectionUtils.isEmpty(businessTypes) && !CollectionUtils.isEmpty(businessTypeNames)) {
-                    storeInfo.setBusinessTypes(String.join(",", businessTypes));
-                    storeInfo.setBusinessTypesName(String.join(",", businessTypeNames));
-                }
-                //处理一下行政区域信息
-                EssentialCityCode essentialCityCode1 =
-                        essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionProvinceAdcode()));
-                storeInfo.setAdministrativeRegionProvinceName(essentialCityCode1.getAreaName());
-                EssentialCityCode essentialCityCode2 =
-                        essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionCityAdcode()));
-                storeInfo.setAdministrativeRegionCityName(essentialCityCode2.getAreaName());
-                EssentialCityCode essentialCityCode3 =
-                        essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionDistrictAdcode()));
-                storeInfo.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
-                int num = storeInfoMapper.updateById(storeInfo);
-                if(!StringUtils.isEmpty(storeInfodto.getStorePositionLongitude())&&!StringUtils.isEmpty(storeInfodto.getStorePositionLatitude())){
-                    nearMeService.inGeolocation(new Point(Double.parseDouble(storeInfodto.getStorePositionLongitude()),
-                            Double.parseDouble(storeInfodto.getStorePositionLatitude())), storeInfo.getId().toString(), Boolean.TRUE);
-                }
-                return num;
-
+            //存入经纬度
+            if (StringUtils.isEmpty(storeInfodto.getStorePositionLongitude()) || StringUtils.isEmpty(storeInfodto.getStorePositionLatitude())) {
+                StoreInfo storeIn = storeInfoMapper.selectById(storeInfodto.getId());
+                storeInfo.setStorePosition(storeIn.getStorePosition());
             } else {
-                StoreInfo storeInfo = new StoreInfo();
-                BeanUtils.copyProperties(storeInfodto, storeInfo);
-                int num = storeInfoMapper.insert(storeInfo);
-                return num;
+                storeInfo.setStorePosition(storeInfodto.getStorePositionLongitude() + "," + storeInfodto.getStorePositionLatitude());
+            }
+
+            //存入门店状态
+            storeInfo.setStoreStatus(storeInfodto.getStoreStatus());
+            //板块及类型
+            storeInfo.setBusinessSection(businessSection);
+            storeInfo.setBusinessSectionName(businessSectionName.getDictDetail());
+            if (!CollectionUtils.isEmpty(businessTypes) && !CollectionUtils.isEmpty(businessTypeNames)) {
+                storeInfo.setBusinessTypes(String.join(",", businessTypes));
+                storeInfo.setBusinessTypesName(String.join(",", businessTypeNames));
             }
+            //处理一下行政区域信息
+            EssentialCityCode essentialCityCode1 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionProvinceAdcode()));
+            storeInfo.setAdministrativeRegionProvinceName(essentialCityCode1.getAreaName());
+            EssentialCityCode essentialCityCode2 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionCityAdcode()));
+            storeInfo.setAdministrativeRegionCityName(essentialCityCode2.getAreaName());
+            EssentialCityCode essentialCityCode3 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionDistrictAdcode()));
+            storeInfo.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
+            int num = storeInfoMapper.updateById(storeInfo);
+            if (!StringUtils.isEmpty(storeInfodto.getStorePositionLongitude()) && !StringUtils.isEmpty(storeInfodto.getStorePositionLatitude())) {
+                nearMeService.inGeolocation(new Point(Double.parseDouble(storeInfodto.getStorePositionLongitude()), Double.parseDouble(storeInfodto.getStorePositionLatitude())), storeInfo.getId().toString(), Boolean.TRUE);
+            }
+            return num;
+
+        } else {
+            StoreInfo storeInfo = new StoreInfo();
+            BeanUtils.copyProperties(storeInfodto, storeInfo);
+            int num = storeInfoMapper.insert(storeInfo);
+            return num;
+        }
     }
 
     @Override
-    public Map<String, String>  storeInfoVerification(int id) {
+    public Map<String, String> storeInfoVerification(int id) {
         Map<String, String> storeInfoMap = new HashMap<>();
         LambdaQueryWrapper<StoreInfo> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(StoreInfo::getId, id);
@@ -1815,9 +1664,8 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
                 storeInfoMap.put("storeOrderStatus", "1");
             }
             //判断店铺存在正在售卖的商品 0:未通过 1:通过
-            List<LifeGroupBuyMain> lifeGroupBuyMainList = lifeGroupBuyMainMapper.selectList(new LambdaQueryWrapper<LifeGroupBuyMain>().eq(LifeGroupBuyMain::getStoreId,id).eq(LifeGroupBuyMain::getStatus,5).eq(LifeGroupBuyMain::getDeleteFlag,0));
-            List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStatus, 0, 1)
-                    .and(qw -> qw.gt(LifeCoupon::getStockQty, 0).or().gt(LifeCoupon::getSingleQty, 0)).eq(LifeCoupon::getStoreId, id).eq(LifeCoupon::getType,1).eq(LifeCoupon::getDeleteFlag, 0));
+            List<LifeGroupBuyMain> lifeGroupBuyMainList = lifeGroupBuyMainMapper.selectList(new LambdaQueryWrapper<LifeGroupBuyMain>().eq(LifeGroupBuyMain::getStoreId, id).eq(LifeGroupBuyMain::getStatus, 5).eq(LifeGroupBuyMain::getDeleteFlag, 0));
+            List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStatus, 0, 1).and(qw -> qw.gt(LifeCoupon::getStockQty, 0).or().gt(LifeCoupon::getSingleQty, 0)).eq(LifeCoupon::getStoreId, id).eq(LifeCoupon::getType, 1).eq(LifeCoupon::getDeleteFlag, 0));
             if (!CollectionUtils.isEmpty(lifeCoupons) || !CollectionUtils.isEmpty(lifeGroupBuyMainList)) {
                 storeInfoMap.put("storeGoodsStatus", "0");
             } else {
@@ -1911,9 +1759,8 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
                 throw new RuntimeException("店铺有未完成的订单");
             }
             //判断店铺有正在售卖的商品
-            List<LifeGroupBuyMain> lifeGroupBuyMainList = lifeGroupBuyMainMapper.selectList(new LambdaQueryWrapper<LifeGroupBuyMain>().eq(LifeGroupBuyMain::getStoreId,storeInfo.getId()).eq(LifeGroupBuyMain::getStatus,5).eq(LifeGroupBuyMain::getDeleteFlag,0));
-            List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStatus, 0, 1)
-                    .and(qw -> qw.gt(LifeCoupon::getStockQty, 0).or().gt(LifeCoupon::getSingleQty, 0)).eq(LifeCoupon::getStoreId, storeInfo.getId()).eq(LifeCoupon::getType,1).eq(LifeCoupon::getDeleteFlag, 0));
+            List<LifeGroupBuyMain> lifeGroupBuyMainList = lifeGroupBuyMainMapper.selectList(new LambdaQueryWrapper<LifeGroupBuyMain>().eq(LifeGroupBuyMain::getStoreId, storeInfo.getId()).eq(LifeGroupBuyMain::getStatus, 5).eq(LifeGroupBuyMain::getDeleteFlag, 0));
+            List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStatus, 0, 1).and(qw -> qw.gt(LifeCoupon::getStockQty, 0).or().gt(LifeCoupon::getSingleQty, 0)).eq(LifeCoupon::getStoreId, storeInfo.getId()).eq(LifeCoupon::getType, 1).eq(LifeCoupon::getDeleteFlag, 0));
             if (!CollectionUtils.isEmpty(lifeCoupons) || !CollectionUtils.isEmpty(lifeGroupBuyMainList)) {
                 throw new RuntimeException("店铺有正在销售的商品");
             }

+ 10 - 10
alien-store/src/main/java/shop/alien/store/service/impl/StoreStaffConfigServiceImpl.java

@@ -2,18 +2,21 @@ package shop.alien.store.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
 import shop.alien.entity.store.StoreStaffConfig;
+import shop.alien.entity.store.excelVo.StoreInfoExpiredRecordsExcelVo;
 import shop.alien.entity.store.excelVo.StoreStaffConfigExcelVo;
 import shop.alien.entity.store.excelVo.util.ExcelGenerator;
 import shop.alien.mapper.StoreStaffConfigMapper;
 import shop.alien.store.service.StoreStaffConfigService;
+import shop.alien.util.ali.AliOSSUtil;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Date;
@@ -32,6 +35,8 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
 
     private final StoreStaffConfigMapper storeStaffConfigMapper;
 
+    private final AliOSSUtil aliOSSUtil;
+
     @Value("${spring.web.resources.excel-path}")
     private String excelPath;
     @Value("${spring.web.resources.excel-clearing-receipt}")
@@ -52,7 +57,7 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
 
     @Override
     public int addOrUpdateStaffConfig(StoreStaffConfig storeStaffConfig) {
-        if (StringUtils.isEmpty(storeStaffConfig.getId())) {
+        if (StringUtils.isEmpty(storeStaffConfig.getId().toString())) {
             Date nowDate = new Date(System.currentTimeMillis());
             storeStaffConfig.setCreatedTime(nowDate);
             return storeStaffConfigMapper.insert(storeStaffConfig);
@@ -78,11 +83,9 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
     @Override
     public String staffConfigExport(String status) throws IOException {
         QueryWrapper<StoreStaffConfig> wrapper = new QueryWrapper<>();
-
-        wrapper.eq(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(status), "status", status);
+        wrapper.eq(StringUtils.isNotEmpty(status), "status", status);
         wrapper.eq("delete_flag", 0);
         wrapper.orderByDesc("created_time");
-
         List<StoreStaffConfig> storeStaffConfig = storeStaffConfigMapper.selectList(wrapper);
         storeStaffConfig.forEach(item -> {
             if ("0".equals(item.getStatus())) {
@@ -94,7 +97,6 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
             }
 
         });
-
         List<StoreStaffConfigExcelVo> storeStaffConfigs = new ArrayList<>();
         int index = 1;
         for (StoreStaffConfig record : storeStaffConfig) {
@@ -104,10 +106,8 @@ public class StoreStaffConfigServiceImpl implements StoreStaffConfigService {
             storeStaffConfigs.add(storeCouponStatusVo);
         }
         String fileName = UUID.randomUUID().toString().replace("-", "");
-
-        ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeStaffConfigs, StoreStaffConfigExcelVo.class);
-        return fileUrl + "excel" + excelGeneratePath + fileName + ".xlsx";
+        String filePath = ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeStaffConfigs, StoreStaffConfigExcelVo.class);
+        return aliOSSUtil.uploadFile(new File(filePath), "excel/" + fileName + ".xlsx");
     }
 
-
 }

+ 34 - 36
alien-store/src/main/java/shop/alien/store/service/impl/StoreUserServiceImpl.java

@@ -28,13 +28,17 @@ import shop.alien.store.config.BaseRedisService;
 import shop.alien.store.service.NearMeService;
 import shop.alien.store.service.StoreUserService;
 import shop.alien.store.util.FunctionMagic;
+import shop.alien.util.ali.AliOSSUtil;
 import shop.alien.util.common.DateUtils;
 import shop.alien.util.common.JwtUtil;
 
+import java.io.File;
 import java.io.IOException;
 import java.text.SimpleDateFormat;
-import java.time.*;
-
+import java.time.Duration;
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 
@@ -50,23 +54,6 @@ import java.util.*;
 @RequiredArgsConstructor
 public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser> implements StoreUserService {
 
-    @Value("${spring.web.resources.excel-path}")
-    private String excelPath;
-
-    @Value("${spring.web.resources.excel-generate-path}")
-    private String excelGeneratePath;
-
-    @Value("${spring.web.resources.url}")
-    private String fileUrl;
-
-    @Value("${jwt.expiration-time}")
-    private String effectiveTime;
-
-    /**
-     * 设定初始化默认密码
-     */
-    private static final String DEFAULT_PASSWORD = "123456";
-
     private final StoreUserMapper storeUserMapper;
 
     private final StoreInfoMapper storeInfoMapper;
@@ -83,6 +70,22 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
 
     private final NearMeService nearMeService;
 
+    private final AliOSSUtil aliOSSUtil;
+
+    @Value("${spring.web.resources.excel-path}")
+    private String excelPath;
+
+    @Value("${spring.web.resources.excel-generate-path}")
+    private String excelGeneratePath;
+
+    @Value("${jwt.expiration-time}")
+    private String effectiveTime;
+
+    /**
+     * 设定初始化默认密码
+     */
+    private static final String DEFAULT_PASSWORD = "123456";
+
     /**
      * 手机号获取
      *
@@ -196,10 +199,10 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
     @Override
     public R<String> forgetOrModifyPassword(String phone, String newPhone, String oldPassword, String newPassword, String confirmNewPassword, String verificationCode, Integer type) {
         boolean flag = false;
-        try{
+        try {
             //类型为0 忘记密码
             if (type == 0) {
-               return forgetPassword(phone, newPassword, verificationCode);
+                return forgetPassword(phone, newPassword, verificationCode);
             }
             //修改密码
             else if (type == 1) {
@@ -225,7 +228,7 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
             }
             //更换绑定手机号
             else if (type == 2) {
-               return ChangeBoundPhone(phone, newPhone, verificationCode);
+                return ChangeBoundPhone(phone, newPhone, verificationCode);
             }
             return R.success("密码修改成功");
         } catch (Exception e) {
@@ -320,10 +323,10 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
             newUpdateWrapper.eq(StoreUser::getPhone, newPhone);
             StoreUser newStoreUser = this.getOne(newUpdateWrapper);
             if (newStoreUser != null) {
-                if(newStoreUser.getPhone().equals(newPhone)){
+                if (newStoreUser.getPhone().equals(newPhone)) {
                     throw new RuntimeException("该手机号已注册过商户");
                 }
-            }else{
+            } else {
                 LambdaUpdateWrapper<StoreUser> updateWrapper = new LambdaUpdateWrapper<>();
                 updateWrapper.eq(StoreUser::getPhone, phone);
                 StoreUser storeUser = this.getOne(updateWrapper);
@@ -502,7 +505,6 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
                         .like(StringUtils.isNotEmpty(phone), StoreUser::getPhone, phone)
                         .eq(StringUtils.isNotEmpty(status), StoreUser::getStatus, status)
         );
-        String fileName = UUID.randomUUID().toString().replace("-", "");
         List<StoreUserExcelVo> storeUserExcelVoList = new ArrayList<>();
         int serialNumber = 0;
         for (StoreUser storeUser : storeUsers) {
@@ -517,12 +519,11 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
             storeUserExcelVo.setStatus(storeUser.getStatus() == 0 ? "启用" : "禁用");
             storeUserExcelVoList.add(storeUserExcelVo);
         }
-        ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeUserExcelVoList, StoreUserExcelVo.class);
-        return fileUrl + "excel" + excelGeneratePath + fileName + ".xlsx";
-
+        String fileName = UUID.randomUUID().toString().replace("-", "");
+        String filePath = ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeUserExcelVoList, StoreUserExcelVo.class);
+        return aliOSSUtil.uploadFile(new File(filePath), "excel/" + fileName + ".xlsx");
     }
 
-
     /**
      * 注册校验
      *
@@ -535,8 +536,6 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
         queryWrapper.in(StoreUser::getStatus, 0, 1);
         List<StoreUser> storeUsers = storeUserMapper.selectList(queryWrapper);
         return CollectionUtils.isEmpty(storeUsers) ? Boolean.TRUE : Boolean.FALSE;
-
-
     }
 
     /**
@@ -654,7 +653,7 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
         StoreUser storeUser = storeUserMapper.selectOne(storeUserLambdaQueryWrapper);
         String key = "verification_" + storeUser.getPhone();
         String redisVerificationCode = baseRedisService.getString(key);
-        if(redisVerificationCode!=null){
+        if (redisVerificationCode != null) {
             if (redisVerificationCode.equals(storeUserVo.getVerificationCode())) {
                 if (storeUser != null) {
                     // 添加注销原因
@@ -686,7 +685,7 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
             } else {
                 throw new RuntimeException("验证码错误");
             }
-        }else{
+        } else {
             throw new RuntimeException("验证码错误");
         }
     }
@@ -756,15 +755,14 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
 
     @Override
     public List<String> getIds(String name, String phone) {
-        if (Objects.isNull(name) && Objects.isNull(phone)) return Arrays.asList("");
+        if (Objects.isNull(name) && Objects.isNull(phone)) return Collections.singletonList("");
         LambdaQueryWrapper<StoreUser> wrapper = new LambdaQueryWrapper<>();
-
         List<Triple<Boolean, SFunction<StoreUser, ?>, Object>> conditions = new ArrayList<>();
         conditions.add(Triple.of(StringUtils.isNotEmpty(name), StoreUser::getName, name));
         conditions.add(Triple.of(StringUtils.isNotEmpty(phone), StoreUser::getPhone, phone));
         FunctionMagic.buildLikeConditions(wrapper, conditions);
         List<String> res = FunctionMagic.convertToIds(storeUserMapper.selectList(wrapper), StoreUser::getId);
-        return CollectionUtils.isEmpty(res) ? Arrays.asList("") : res;
+        return CollectionUtils.isEmpty(res) ? Collections.singletonList("") : res;
     }
 
 }