fubojin hai 3 semanas
pai
achega
66321ace82
Modificáronse 19 ficheiros con 314 adicións e 436 borrados
  1. 31 1
      pom.xml
  2. 5 5
      yami-shop-common/pom.xml
  3. 0 177
      yami-shop-common/src/main/java/com/yami/shop/common/util/PoiExcelUtil.java
  4. 2 5
      yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/api/paotui/PaoTuiApi.java
  5. 2 1
      yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/service/impl/DeliveryOrderServiceImpl.java
  6. 1 0
      yami-shop-delivery/yami-shop-delivery-multishop/src/main/java/com/yami/shop/delivery/multishop/controller/FetchController.java
  7. 1 0
      yami-shop-discount/yami-shop-discount-multishop/src/main/java/com/yami/shop/discount/platform/controller/DiscountController.java
  8. 1 0
      yami-shop-distribution/yami-shop-distribution-multishop/src/main/java/com/yami/shop/distribution/multishop/controller/DistributionProdController.java
  9. 1 0
      yami-shop-groupbuy/yami-shop-groupbuy-multishop/src/main/java/com/yami/shop/groupbuy/multishop/controller/GroupActivityController.java
  10. 1 0
      yami-shop-groupbuy/yami-shop-groupbuy-multishop/src/main/java/com/yami/shop/groupbuy/multishop/controller/GroupProdController.java
  11. 5 5
      yami-shop-platform/pom.xml
  12. 2 4
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopDetailController.java
  13. 2 1
      yami-shop-seckill/yami-shop-seckill-multishop/src/main/java/com/yami/shop/seckill/multishop/controller/SeckillController.java
  14. 35 18
      yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/StoreManagementService.java
  15. 42 41
      yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryServiceImpl.java
  16. 8 8
      yami-shop-service/src/main/java/com/yami/shop/service/impl/PointsRechargeServiceImpl.java
  17. 172 168
      yami-shop-service/src/main/java/com/yami/shop/service/impl/ProductServiceImpl.java
  18. 2 2
      yami-shop-service/src/main/java/com/yami/shop/service/impl/QnhServiceImpl.java
  19. 1 0
      yami-shop-user/yami-shop-user-multishop/src/main/java/com/yami/shop/user/multishop/listener/OrderRefundListener.java

+ 31 - 1
pom.xml

@@ -37,10 +37,11 @@
         <spring-boot.version>2.1.9.RELEASE</spring-boot.version>
         <security.oauth.auto.version>2.1.9.RELEASE</security.oauth.auto.version>
         <java.version>1.8</java.version>
+        <log4j.version>2.17.2</log4j.version>
         <guava.version>28.2-jre</guava.version>
         <hutool.version>4.6.4</hutool.version>
         <jsoup.version>1.12.1</jsoup.version>
-        <poi.version>3.17</poi.version>
+        <poi.version>5.2.3</poi.version>
         <qiniu.version>7.2.18</qiniu.version>
         <weixin.version>3.9.0</weixin.version>
         <orika.version>1.5.4</orika.version>
@@ -157,6 +158,11 @@
                 <artifactId>poi</artifactId>
                 <version>${poi.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.apache.poi</groupId>
+                <artifactId>poi-ooxml</artifactId>
+                <version>${poi.version}</version>
+            </dependency>
 
             <!-- 排除 Tomcat 改用 Undertow -->
             <dependency>
@@ -184,11 +190,35 @@
 
     <dependencies>
 
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-api</artifactId>
+            <version>${log4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-core</artifactId>
+            <version>${log4j.version}</version>
+        </dependency>
         <!-- 推荐版本 -->
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>easyexcel</artifactId>
             <version>3.3.3</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.poi</groupId>
+                    <artifactId>poi</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.poi</groupId>
+                    <artifactId>poi-ooxml</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.logging.log4j</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <!-- Apache Commons Lang -->
         <dependency>

+ 5 - 5
yami-shop-common/pom.xml

@@ -93,11 +93,11 @@
             <groupId>com.github.binarywang</groupId>
             <artifactId>weixin-java-mp</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi</artifactId>
-            <scope>compile</scope>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>org.apache.poi</groupId>-->
+<!--            <artifactId>poi</artifactId>-->
+<!--            <scope>compile</scope>-->
+<!--        </dependency>-->
         <dependency>
             <groupId>com.huaweicloud</groupId>
             <artifactId>esdk-obs-java</artifactId>

+ 0 - 177
yami-shop-common/src/main/java/com/yami/shop/common/util/PoiExcelUtil.java

@@ -1,177 +0,0 @@
-package com.yami.shop.common.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.util.CellRangeAddress;
-
-/**
- * 功能: poi导出excel工具类
- *
- * @author lhd
- */
-public class PoiExcelUtil {
-
-    /**
-     * 获取单元格的值
-     *
-     * @param fCell
-     * @return
-     */
-    public static String getCellValue(Cell fCell) {
-        if (fCell == null){
-            return null;
-        }
-        if (fCell.getCellType() == Cell.CELL_TYPE_STRING) {
-            return fCell.getStringCellValue();
-        } else if (fCell.getCellType() == Cell.CELL_TYPE_BOOLEAN) {
-            return String.valueOf(fCell.getBooleanCellValue());
-        } else if (fCell.getCellType() == Cell.CELL_TYPE_FORMULA) {
-            return fCell.getCellFormula();
-        } else if (fCell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
-            return String.valueOf(fCell.getNumericCellValue());
-        }
-        return null;
-    }
-
-    /**
-     * 合并单元格处理,获取合并行
-     *
-     * @param sheet
-     * @return List<CellRangeAddress>
-     */
-    public static List<CellRangeAddress> getCombineCell(Sheet sheet) {
-        List<CellRangeAddress> list = new ArrayList<CellRangeAddress>();
-        // 获得一个 sheet 中合并单元格的数量
-        int sheetmergerCount = sheet.getNumMergedRegions();
-        // 遍历所有的合并单元格
-        for (int i = 0; i < sheetmergerCount; i++) {
-            // 获得合并单元格保存进list中
-            CellRangeAddress ca = sheet.getMergedRegion(i);
-            list.add(ca);
-        }
-        return list;
-    }
-
-    public static int getRowNum(List<CellRangeAddress> listCombineCell, Cell cell, Sheet sheet) {
-        int xr = 0;
-        int firstC = 0;
-        int lastC = 0;
-        int firstR = 0;
-        int lastR = 0;
-        for (CellRangeAddress ca : listCombineCell) {
-            // 获得合并单元格的起始行, 结束行, 起始列, 结束列
-            firstC = ca.getFirstColumn();
-            lastC = ca.getLastColumn();
-            firstR = ca.getFirstRow();
-            lastR = ca.getLastRow();
-            if (cell.getRowIndex() >= firstR && cell.getRowIndex() <= lastR) {
-                if (cell.getColumnIndex() >= firstC && cell.getColumnIndex() <= lastC) {
-                    xr = lastR;
-                }
-            }
-
-        }
-        return xr;
-
-    }
-
-    /**
-     * 判断单元格是否为合并单元格,是的话则将单元格的值返回
-     *
-     * @param listCombineCell
-     *            存放合并单元格的list
-     * @param cell
-     *            需要判断的单元格
-     * @param sheet
-     *            sheet
-     * @return
-     */
-    public static String isCombineCell(List<CellRangeAddress> listCombineCell, Cell cell, Sheet sheet) throws Exception {
-        int firstC = 0;
-        int lastC = 0;
-        int firstR = 0;
-        int lastR = 0;
-        String cellValue = null;
-        for (CellRangeAddress ca : listCombineCell) {
-            // 获得合并单元格的起始行, 结束行, 起始列, 结束列
-            firstC = ca.getFirstColumn();
-            lastC = ca.getLastColumn();
-            firstR = ca.getFirstRow();
-            lastR = ca.getLastRow();
-            if (cell.getRowIndex() >= firstR && cell.getRowIndex() <= lastR) {
-                if (cell.getColumnIndex() >= firstC && cell.getColumnIndex() <= lastC) {
-                    Row fRow = sheet.getRow(firstR);
-                    Cell fCell = fRow.getCell(firstC);
-                    cellValue = getCellValue(fCell);
-                    break;
-                }
-            } else {
-                cellValue = "";
-            }
-        }
-        return cellValue;
-    }
-
-    /**
-     * 获取合并单元格的值
-     *
-     * @param sheet
-     * @param row
-     * @param column
-     * @return
-     */
-    public static String getMergedRegionValue(Sheet sheet, int row, int column) {
-        int sheetMergeCount = sheet.getNumMergedRegions();
-
-        for (int i = 0; i < sheetMergeCount; i++) {
-            CellRangeAddress ca = sheet.getMergedRegion(i);
-            int firstColumn = ca.getFirstColumn();
-            int lastColumn = ca.getLastColumn();
-            int firstRow = ca.getFirstRow();
-            int lastRow = ca.getLastRow();
-
-            if (row >= firstRow && row <= lastRow) {
-                if (column >= firstColumn && column <= lastColumn) {
-                    Row fRow = sheet.getRow(firstRow);
-                    Cell fCell = fRow.getCell(firstColumn);
-                    return getCellValue(fCell);
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * 判断指定的单元格是否是合并单元格
-     *
-     * @param sheet
-     * @param row
-     *            行下标
-     * @param column
-     *            列下标
-     * @return
-     */
-    public static boolean isMergedRegion(Sheet sheet, int row, int column) {
-        int sheetMergeCount = sheet.getNumMergedRegions();
-        for (int i = 0; i < sheetMergeCount; i++) {
-            CellRangeAddress range = sheet.getMergedRegion(i);
-            int firstColumn = range.getFirstColumn();
-            int lastColumn = range.getLastColumn();
-            int firstRow = range.getFirstRow();
-            int lastRow = range.getLastRow();
-            if (row >= firstRow && row <= lastRow) {
-                if (column >= firstColumn && column <= lastColumn) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-
-}

+ 2 - 5
yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/api/paotui/PaoTuiApi.java

@@ -6,25 +6,22 @@ import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
-import com.yami.shop.common.exception.YamiShopBindException;
 import com.yami.shop.config.ShopConfig;
 import com.yami.shop.delivery.comment.api.paotui.model.Base;
 import com.yami.shop.delivery.comment.api.paotui.model.request.*;
 import com.yami.shop.delivery.comment.api.paotui.model.response.*;
-import lombok.extern.log4j.Log4j2;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.lang.reflect.Type;
-import java.math.BigDecimal;
 import java.time.Instant;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
 
 @Component
-@Log4j2
+@Slf4j
 public class PaoTuiApi {
 
     private static String host = "http://open.maiyatian.com/";

+ 2 - 1
yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/service/impl/DeliveryOrderServiceImpl.java

@@ -33,6 +33,7 @@ import com.yami.shop.service.UserAddrOrderService;
 import lombok.AllArgsConstructor;
 import lombok.extern.log4j.Log4j;
 import lombok.extern.log4j.Log4j2;
+import lombok.extern.slf4j.Slf4j;
 import ma.glasnost.orika.MapperFacade;
 import org.apache.commons.collections.CollectionUtils;
 import org.springframework.stereotype.Service;
@@ -50,7 +51,7 @@ import java.util.Objects;
  */
 @Service
 @AllArgsConstructor
-@Log4j2
+@Slf4j
 public class DeliveryOrderServiceImpl extends ServiceImpl<DeliveryOrderMapper, DeliveryOrder> implements DeliveryOrderService {
 
     private final DeliveryOrderMapper deliveryOrderMapper;

+ 1 - 0
yami-shop-delivery/yami-shop-delivery-multishop/src/main/java/com/yami/shop/delivery/multishop/controller/FetchController.java

@@ -14,6 +14,7 @@ import com.yami.shop.bean.enums.OfflineHandleEventType;
 import com.yami.shop.bean.model.OfflineHandleEvent;
 import com.yami.shop.bean.param.OfflineHandleEventAuditParam;
 import com.yami.shop.common.annotation.SysLog;
+import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.common.exception.YamiShopBindException;
 import com.yami.shop.common.util.PageParam;
 import com.yami.shop.delivery.comment.model.Fetch;

+ 1 - 0
yami-shop-discount/yami-shop-discount-multishop/src/main/java/com/yami/shop/discount/platform/controller/DiscountController.java

@@ -17,6 +17,7 @@ import com.yami.shop.bean.enums.OfflineHandleEventType;
 import com.yami.shop.bean.model.OfflineHandleEvent;
 import com.yami.shop.bean.model.Product;
 import com.yami.shop.bean.param.OfflineHandleEventAuditParam;
+import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.common.exception.YamiShopBindException;
 import com.yami.shop.common.util.PageParam;
 import com.yami.shop.discount.comment.model.Discount;

+ 1 - 0
yami-shop-distribution/yami-shop-distribution-multishop/src/main/java/com/yami/shop/distribution/multishop/controller/DistributionProdController.java

@@ -19,6 +19,7 @@ import com.yami.shop.bean.model.IndexImg;
 import com.yami.shop.bean.model.OfflineHandleEvent;
 import com.yami.shop.bean.model.Product;
 import com.yami.shop.bean.param.OfflineHandleEventAuditParam;
+import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.common.exception.YamiShopBindException;
 import com.yami.shop.common.util.PageParam;
 import com.yami.shop.distribution.comment.model.DistributionProd;

+ 1 - 0
yami-shop-groupbuy/yami-shop-groupbuy-multishop/src/main/java/com/yami/shop/groupbuy/multishop/controller/GroupActivityController.java

@@ -16,6 +16,7 @@ import com.yami.shop.bean.model.OfflineHandleEvent;
 import com.yami.shop.bean.model.Product;
 import com.yami.shop.bean.param.OfflineHandleEventAuditParam;
 import com.yami.shop.common.annotation.SysLog;
+import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.common.exception.YamiShopBindException;
 import com.yami.shop.common.util.PageParam;
 import com.yami.shop.groupbuy.comment.dto.GroupActivityDto;

+ 1 - 0
yami-shop-groupbuy/yami-shop-groupbuy-multishop/src/main/java/com/yami/shop/groupbuy/multishop/controller/GroupProdController.java

@@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yami.shop.bean.enums.ProdType;
 import com.yami.shop.bean.model.Product;
 import com.yami.shop.common.annotation.SysLog;
+import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.common.exception.YamiShopBindException;
 import com.yami.shop.common.util.PageParam;
 import com.yami.shop.groupbuy.comment.api.dto.ApiGroupActivityDto;

+ 5 - 5
yami-shop-platform/pom.xml

@@ -26,11 +26,11 @@
             <artifactId>yami-shop-sys</artifactId>
             <version>${yami.shop.version}</version>
         </dependency>
-       <dependency>
-	       <groupId>org.apache.poi</groupId>
-	       <artifactId>poi-ooxml</artifactId>
-	       <version>${poi.version}</version>
-       </dependency>
+<!--       <dependency>-->
+<!--	       <groupId>org.apache.poi</groupId>-->
+<!--	       <artifactId>poi-ooxml</artifactId>-->
+<!--	       <version>${poi.version}</version>-->
+<!--       </dependency>-->
         <dependency>
             <groupId>com.yami.shop</groupId>
             <artifactId>yami-shop-quartz</artifactId>

+ 2 - 4
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopDetailController.java

@@ -71,10 +71,8 @@ public class ShopDetailController {
     public R<IPage<ShopDetail>> page(@ModelAttribute PageParam pageParam,
                                       @ModelAttribute ShopDetail shopDetail ) {
         IPage<ShopDetail> page = shopDetailService.page(pageParam,new LambdaQueryWrapper<ShopDetail>()
-                .eq(ObjectUtils.isNotEmpty(shopDetail.getShopName()),ShopDetail::getShopName, shopDetail.getShopName())
-                .eq(ObjectUtils.isNotEmpty(shopDetail.getHbStationNo()),ShopDetail::getHbStationNo, shopDetail.getHbStationNo()));
-
-
+                .like(ObjectUtils.isNotEmpty(shopDetail.getShopName()),ShopDetail::getShopName, shopDetail.getShopName())
+                .like(ObjectUtils.isNotEmpty(shopDetail.getHbStationNo()),ShopDetail::getHbStationNo, shopDetail.getHbStationNo()));
         return R.SUCCESS(page);
     }
 

+ 2 - 1
yami-shop-seckill/yami-shop-seckill-multishop/src/main/java/com/yami/shop/seckill/multishop/controller/SeckillController.java

@@ -15,6 +15,7 @@ import com.yami.shop.bean.model.Product;
 import com.yami.shop.bean.param.OfflineHandleEventAuditParam;
 import com.yami.shop.bean.param.ProductParam;
 import com.yami.shop.common.enums.YamiHttpStatus;
+import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.common.exception.YamiShopBindException;
 import com.yami.shop.seckill.multishop.dto.SeckillProdDto;
 import com.yami.shop.seckill.multishop.param.SeckillParam;
@@ -184,7 +185,7 @@ public class SeckillController {
     public ResponseEntity<Void> invalidById(@PathVariable Long seckillId) {
         Seckill seckill = seckillService.getSeckillById(seckillId);
         if (!SecurityUtils.getShopUser().getShopId().equals(seckill.getShopId())) {
-            throw new GlobalException(YamiHttpStatus.UNAUTHORIZED);
+            throw new GlobalException("");
         }
         seckillService.invalidById(seckill);
 

+ 35 - 18
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/StoreManagementService.java

@@ -124,11 +124,7 @@ public class StoreManagementService implements IStoreManagementService {
             String outStationNo = bodyJson.getString("outStationNo");
 
             String hb = doGetStation(outStationNo);
-            ShopDetail shopDetail = shopDetailMapper.selectByOutStationNo(outStationNo);
-            if (shopDetail != null) {
-                log.info("门店已存在{}", outStationNo);
-                return HBR.success();
-            }
+
             JSONObject goodsInfoJson = JSON.parseObject(hb);
             // 2. 逐层解析获取result
             JSONObject result = goodsInfoJson.getJSONObject("result");
@@ -145,31 +141,52 @@ public class StoreManagementService implements IStoreManagementService {
             shopDetailInfo.setShopLng(resultData.getString("latitude"));
             shopDetailInfo.setThirdPartyCode(resultData.getString("stationId"));
             shopDetailInfo.setNotice(resultData.getString("notice"));
+            shopDetailInfo.setTel(resultData.getString("phone"));
             //海博门店ID
             shopDetailInfo.setHbStationId(resultData.getString("stationId"));
             //商家门店编码
             shopDetailInfo.setOutStationNo(resultData.getString("outStationNo"));
+            //海博门店编码
+            shopDetailInfo.setHbStationNo(resultData.getString("outStationNo"));
             //经营状态
             shopDetailInfo.setRunStatus(resultData.getInteger("runStatus"));
             //营业状态
             shopDetailInfo.setShopStatus(resultData.getInteger("businessStatus"));
-            //营业时间
-            shopDetailInfo.setBusinessTime(resultData.getString("businessTime"));
-            shopDetailMapper.insert(shopDetailInfo);
-            //添加默认配送模板
 
-            Transport2 transport2 = new Transport2();
-            //所有数据设置默认值
+            shopDetailInfo.setBusinessTime(resultData.getString("businessTime"));
             //配送范围经纬度
             JSONArray coordinates = resultData.getJSONArray("coordinates");
-            transport2.setTransName("默认配送模板");
-            transport2.setDistance(100.0);
-            transport2.setAmount(1.0);
-            transport2.setPiece(5.0);
-            transport2.setCreateTime(new Date());
-            transport2.setShopId(shopDetailInfo.getShopId());
-            transport2Mapper.insert(transport2);
+            //营业时间
+            JSONArray businessTimes = resultData.getJSONArray("businessTime");
+            String businessTime = "";
+            for (Object businessTimeInfo : businessTimes) {
+                JSONObject coordinateJson = JSON.parseObject(businessTimeInfo.toString());
+                String end = coordinateJson.getString("end");
+                String start = coordinateJson.getString("start");
+                businessTime = ("".equals(businessTime) ? "" : (businessTime + ";")) + start + "-" + end;
+            }
+            shopDetailInfo.setBusinessTime(businessTime);
 
+            ShopDetail shopDetail = shopDetailMapper.selectByHbStationId(resultData.getString("stationId"));
+            if (shopDetail != null) {
+                log.info("存在门店不需要新增直接修改{}", outStationNo);
+                shopDetailInfo.setShopId(shopDetail.getShopId());
+                shopDetailMapper.updateById(shopDetailInfo);
+            }else {
+                shopDetailMapper.insert(shopDetailInfo);
+                log.info("门店变更成功{}", shopDetailInfo);
+
+                //添加默认配送模板
+                Transport2 transport2 = new Transport2();
+                //所有数据设置默认值
+                transport2.setTransName("默认配送模板");
+                transport2.setDistance(100.0);
+                transport2.setAmount(1.0);
+                transport2.setPiece(5.0);
+                transport2.setCreateTime(new Date());
+                transport2.setShopId(shopDetailInfo.getShopId());
+                transport2Mapper.insert(transport2);
+            }
             return HBR.success();
         } catch (Exception e) {
             log.error("门店变更失败:{}", e.getMessage(), e);

+ 42 - 41
yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryServiceImpl.java

@@ -330,47 +330,48 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
 
 	// 校验与解析分离
 	private List<List<String>> validateAndParseExcel(MultipartFile excelFile) throws Exception {
-		Workbook workBook = WorkbookFactory.create(excelFile.getInputStream());
-		Sheet sheet = workBook.getSheetAt(0);
-
-		// 校验标题行
-		Row headerRow = sheet.getRow(0);
-		List<String> headers = new ArrayList<>();
-		if (headerRow != null) {
-			for (int i = 0; i < headerRow.getLastCellNum(); i++) {
-				Cell cell = headerRow.getCell(i, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
-				cell.setCellType(CellType.STRING);
-				String value = cell.getStringCellValue().trim();
-				if (value.isEmpty()) throw new GlobalException("第" + (i+1) + "列标题为空");
-				headers.add(value);
-			}
-		}
-
-		// 校验列数与列名
-		if (headers.size() != 3) throw new GlobalException("模板列数必须为3列");
-		String[] expected = {"一级分类名称", "二级分类名称", "三级分类名称"};
-		for (int i = 0; i < expected.length; i++) {
-			if (!headers.get(i).equals(expected[i])) {
-				throw new GlobalException("第" + (i+1) + "列名称应为【" + expected[i] + "】");
-			}
-		}
-
-		// 提取数据行
-		List<List<String>> result = new ArrayList<>();
-		for (int rowNum = 1; rowNum <= sheet.getLastRowNum(); rowNum++) {
-			Row dataRow = sheet.getRow(rowNum);
-			List<String> rowData = new ArrayList<>(3);
-			for (int i = 0; i < 3; i++) {
-				Cell cell = dataRow.getCell(i, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
-				cell.setCellType(CellType.STRING);
-				rowData.add(cell.getStringCellValue().trim());
-			}
-			if (rowData.get(0).isEmpty() || rowData.get(1).isEmpty()) {
-				throw new GlobalException("一级和二级分类名称不能为空");
-			}
-			result.add(rowData);
-		}
-		return result;
+//		Workbook workBook = WorkbookFactory.create(excelFile.getInputStream());
+//
+//		Sheet sheet = workBook.getSheetAt(0);
+//
+//		// 校验标题行
+//		Row headerRow = sheet.getRow(0);
+//		List<String> headers = new ArrayList<>();
+//		if (headerRow != null) {
+//			for (int i = 0; i < headerRow.getLastCellNum(); i++) {
+//				Cell cell = headerRow.getCell(i, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
+//				cell.setCellType(CellType.STRING);
+//				String value = cell.getStringCellValue().trim();
+//				if (value.isEmpty()) throw new GlobalException("第" + (i+1) + "列标题为空");
+//				headers.add(value);
+//			}
+//		}
+//
+//		// 校验列数与列名
+//		if (headers.size() != 3) throw new GlobalException("模板列数必须为3列");
+//		String[] expected = {"一级分类名称", "二级分类名称", "三级分类名称"};
+//		for (int i = 0; i < expected.length; i++) {
+//			if (!headers.get(i).equals(expected[i])) {
+//				throw new GlobalException("第" + (i+1) + "列名称应为【" + expected[i] + "】");
+//			}
+//		}
+//
+//		// 提取数据行
+//		List<List<String>> result = new ArrayList<>();
+//		for (int rowNum = 1; rowNum <= sheet.getLastRowNum(); rowNum++) {
+//			Row dataRow = sheet.getRow(rowNum);
+//			List<String> rowData = new ArrayList<>(3);
+//			for (int i = 0; i < 3; i++) {
+//				Cell cell = dataRow.getCell(i, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
+//				cell.setCellType(CellType.STRING);
+//				rowData.add(cell.getStringCellValue().trim());
+//			}
+//			if (rowData.get(0).isEmpty() || rowData.get(1).isEmpty()) {
+//				throw new GlobalException("一级和二级分类名称不能为空");
+//			}
+//			result.add(rowData);
+//		}
+		return new ArrayList<>( );
 	}
 	// 分类保存逻辑(若允许放宽主键依赖,可开启批量插入)
 	private void saveCategoryHierarchy(List<List<String>> dataRows, Long shopId) {

+ 8 - 8
yami-shop-service/src/main/java/com/yami/shop/service/impl/PointsRechargeServiceImpl.java

@@ -9,8 +9,9 @@ import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.dao.*;
 import com.yami.shop.service.PointsFailureRecordService;
 import com.yami.shop.service.PointsRechargeService;
+import com.yami.shop.service.impl.PointsRechargeTemplateDTO;
 import lombok.AllArgsConstructor;
-import lombok.extern.log4j.Log4j2;
+import lombok.extern.log4j.Log4j;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -29,7 +30,7 @@ import java.util.List;
  */
 @Service
 @AllArgsConstructor
-@Log4j2
+//@Log4j
 public class PointsRechargeServiceImpl extends ServiceImpl<PointsRechargeMapper, PointsRecharge> implements PointsRechargeService {
 
     private final PointsRechargeMapper pointsRechargeMapper;
@@ -46,7 +47,7 @@ public class PointsRechargeServiceImpl extends ServiceImpl<PointsRechargeMapper,
         response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
 
         // 创建示例数据
-        List<com.yami.shop.service.impl.PointsRechargeTemplateDTO> templateData = new ArrayList<>();
+        List<PointsRechargeTemplateDTO> templateData = new ArrayList<>();
         // 使用EasyExcel导出模板
         EasyExcel.write(response.getOutputStream(), com.yami.shop.service.impl.PointsRechargeTemplateDTO.class)
                 .sheet("积分充值导入模板")
@@ -57,10 +58,10 @@ public class PointsRechargeServiceImpl extends ServiceImpl<PointsRechargeMapper,
     @Override
     public String importPointsRecharge(MultipartFile file) {
         // 读取Excel数据
-        List<com.yami.shop.service.impl.PointsRechargeTemplateDTO> importData = null;
+        List<PointsRechargeTemplateDTO> importData = null;
         try {
             importData = EasyExcel.read(file.getInputStream())
-                    .head(com.yami.shop.service.impl.PointsRechargeTemplateDTO.class)
+                    .head(PointsRechargeTemplateDTO.class)
                     .sheet()
                     .doReadSync();
         } catch (IOException e) {
@@ -71,7 +72,7 @@ public class PointsRechargeServiceImpl extends ServiceImpl<PointsRechargeMapper,
         int failCount = 0;
 
         for (int i = 0; i < importData.size(); i++) {
-            com.yami.shop.service.impl.PointsRechargeTemplateDTO templateDTO = importData.get(i);
+            PointsRechargeTemplateDTO templateDTO = importData.get(i);
             try {
 
                 // 数据校验
@@ -146,8 +147,7 @@ public class PointsRechargeServiceImpl extends ServiceImpl<PointsRechargeMapper,
 
                 // 保存失败记录
                 pointsFailureRecordService.save(failureRecord);
-
-                log.error("导入第{}行数据失败!", i + 1, e);
+//                log.error("导入第{}行数据失败!", i + 1, e);
                 failCount++;
             }
         }

+ 172 - 168
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProductServiceImpl.java

@@ -38,7 +38,7 @@ import com.yami.shop.common.exception.YamiShopBindException;
 import com.yami.shop.common.util.Arith;
 import com.yami.shop.common.util.Json;
 import com.yami.shop.common.util.PageParam;
-import com.yami.shop.common.util.PoiExcelUtil;
+//import com.yami.shop.common.util.PoiExcelUtil;
 import com.yami.shop.dao.*;
 import com.yami.shop.service.*;
 import lombok.AllArgsConstructor;
@@ -487,174 +487,178 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
 
     @Override
     public Object parseFile(MultipartFile file, Long shopId) throws Exception {
-        //读取工作簿
-        Workbook workBook = WorkbookFactory.create(file.getInputStream());
-        //读取工作表
-        Sheet sheet = workBook.getSheetAt(0);
-        int rowNumber = sheet.getPhysicalNumberOfRows();
-
-        //校验是否填写内容
-        if (rowNumber <= 2) {
-            throw new GlobalException("文件无内容!");
-        }
-        // * 2.1不是Excel文件,直接返回提示信息
-        if (!(file.getOriginalFilename().contains("xls") || file.getOriginalFilename().contains("xlsx"))) {
-            // 格式错误
-            throw  new YamiShopBindException("文件格式错误");
-        }
-
-        //TODO 如果三级分类需要获取最底层的分类
-        // 获取平台分类map
-        List<Category> categories = categoryService.list(new LambdaQueryWrapper<Category>()
-                .eq(Category::getShopId,0).eq(Category::getGrade,2));
-        // 如果重复的key取最后一个的值
-        Map<String, Long> categoryMap = categories.stream().collect(Collectors.toMap(Category::getCategoryName, Category::getCategoryId,(key1 , key2)-> key2));
-
-        // 获取店铺分类map
-        List<Category> shopCategories = categoryService.listByShopId(shopId);
-        // 如果重复的key取最后一个的值
-        Map<String, Long> shopCategoryMap = shopCategories.stream().collect(Collectors.toMap(Category::getCategoryName, Category::getCategoryId,(key1 , key2)-> key2));
-
-        // 获取品牌map
-        List<Brand> brands = brandService.list(new LambdaQueryWrapper<Brand>().eq(Brand::getStatus, 1));
-        Map<String, Long> brandMap = brands.stream().collect(Collectors.toMap(Brand::getBrandName, Brand::getBrandId,(key1 , key2)-> key2));
-
-        // 获取运费模板map
-        List<TransportParam> transportParams = new ArrayList<>();
-        applicationContext.publishEvent(new GetTransportNamesEvent(transportParams,shopId));
-        Map<String, Long> transportMap = transportParams.stream().collect(Collectors.toMap(TransportParam::getTransName, TransportParam::getTransportId,(key1 , key2)-> key2));
-
-        List<Product> products = new ArrayList<>();
-        List<Sku> skuList = new ArrayList<>();
-        Date date = new Date();
-        Integer totalStocks = 0;
-        double price = 0.0;
-        double oriPrice = 0.0;
-        Integer scorePrice = 0;
-        int insertRows = 0;
-        Product product = new Product();
-        //循环读取每一行数据并校验
-        for (int i = 2; i < rowNumber; i++) {
-            try {
-                //读取行
-                Row row = sheet.getRow(i);
-//                String[] hearder = { "产品名称", "平台分类", "店铺分类", "所属品牌", "产品卖点", "配送方式","运费设置",
+        return null;
+    }
+//    @Override
+//    public Object parseFile(MultipartFile file, Long shopId) throws Exception {
+//        //读取工作簿
+//        Workbook workBook = WorkbookFactory.create(file.getInputStream());
+//        //读取工作表
+//        Sheet sheet = workBook.getSheetAt(0);
+//        int rowNumber = sheet.getPhysicalNumberOfRows();
+//
+//        //校验是否填写内容
+//        if (rowNumber <= 2) {
+//            throw new GlobalException("文件无内容!");
+//        }
+//        // * 2.1不是Excel文件,直接返回提示信息
+//        if (!(file.getOriginalFilename().contains("xls") || file.getOriginalFilename().contains("xlsx"))) {
+//            // 格式错误
+//            throw  new YamiShopBindException("文件格式错误");
+//        }
+//
+//        //TODO 如果三级分类需要获取最底层的分类
+//        // 获取平台分类map
+//        List<Category> categories = categoryService.list(new LambdaQueryWrapper<Category>()
+//                .eq(Category::getShopId,0).eq(Category::getGrade,2));
+//        // 如果重复的key取最后一个的值
+//        Map<String, Long> categoryMap = categories.stream().collect(Collectors.toMap(Category::getCategoryName, Category::getCategoryId,(key1 , key2)-> key2));
+//
+//        // 获取店铺分类map
+//        List<Category> shopCategories = categoryService.listByShopId(shopId);
+//        // 如果重复的key取最后一个的值
+//        Map<String, Long> shopCategoryMap = shopCategories.stream().collect(Collectors.toMap(Category::getCategoryName, Category::getCategoryId,(key1 , key2)-> key2));
+//
+//        // 获取品牌map
+//        List<Brand> brands = brandService.list(new LambdaQueryWrapper<Brand>().eq(Brand::getStatus, 1));
+//        Map<String, Long> brandMap = brands.stream().collect(Collectors.toMap(Brand::getBrandName, Brand::getBrandId,(key1 , key2)-> key2));
+//
+//        // 获取运费模板map
+//        List<TransportParam> transportParams = new ArrayList<>();
+//        applicationContext.publishEvent(new GetTransportNamesEvent(transportParams,shopId));
+//        Map<String, Long> transportMap = transportParams.stream().collect(Collectors.toMap(TransportParam::getTransName, TransportParam::getTransportId,(key1 , key2)-> key2));
+//
+//        List<Product> products = new ArrayList<>();
+//        List<Sku> skuList = new ArrayList<>();
+//        Date date = new Date();
+//        Integer totalStocks = 0;
+//        double price = 0.0;
+//        double oriPrice = 0.0;
+//        Integer scorePrice = 0;
+//        int insertRows = 0;
+//        Product product = new Product();
+//        //循环读取每一行数据并校验
+//        for (int i = 2; i < rowNumber; i++) {
+//            try {
+//                //读取行
+//                Row row = sheet.getRow(i);
+////                String[] hearder = { "产品名称", "平台分类", "店铺分类", "所属品牌", "产品卖点", "配送方式","运费设置",
+////                        "规格名称","商品名称", "销售属性组合字符串 格式是p1:v1;p2:v2", "原价", "价格", "积分价格",
+////                        "库存","商家编码","商品条形码" ,"商品重量", "商品体积","产品状态"};
+//                String prodName = Objects.isNull(row.getCell(0))? "":row.getCell(0).getStringCellValue();
+//                String category = Objects.isNull(row.getCell(1))? "":row.getCell(1).getStringCellValue();
+//                String  shopCategory = Objects.isNull(row.getCell(2))? "":row.getCell(2).getStringCellValue();
+//                String brandName = Objects.isNull(row.getCell(3))? "":row.getCell(3).getStringCellValue();
+//                String brif = Objects.isNull(row.getCell(4))? "":row.getCell(4).getStringCellValue();
+//                String dvyType = Objects.isNull(row.getCell(5))? "":row.getCell(5).getStringCellValue();
+//                String transportName = Objects.isNull(row.getCell(6))? "":row.getCell(6).getStringCellValue();
+//                String statusStr = Objects.isNull(row.getCell(7))? "":row.getCell(7).getStringCellValue();
+//                if(StrUtil.isNotBlank(prodName) || !PoiExcelUtil.isMergedRegion(sheet,i,0)) {
+//                    skuList = new ArrayList<>();
+//                    product = new Product();
+//                    totalStocks = 0;
+//                    oriPrice = 0.0;
+//                    scorePrice = 0;
+//                    price = 0.0;
+//                    insertRows++;
+//                    product.setShopId(shopId);
+//                    product.setProdName(prodName);
+//                    product.setCategoryId(categoryMap.get(category));
+//                    product.setShopCategoryId(shopCategoryMap.get(shopCategory));
+//                    product.setBrandId(brandMap.get(brandName));
+//                    product.setBrief(brif);
+//                    product.setDeliveryMode(getDvyType(dvyType));
+//                    product.setDeliveryTemplateId(transportMap.get(transportName));
+//                    //TODO 差商品的图片
+//                    product.setStatus(Objects.equals(statusStr, "上架") ? ProdStatusEnums.NORMAL.getValue() : ProdStatusEnums.SHOP_OFFLINE.getValue());
+//                    product.setPutawayTime(Objects.equals(statusStr, "上架") ? date : null);
+//                    product.setCreateTime(date);
+//                    product.setUpdateTime(date);
+//                    product.setVersion(0);
+//                    // 商品销量设置为0
+//                    product.setSoldNum(0);
+//                    product.setProdType(ProdType.PROD_TYPE_NORMAL.value());
+//                    product.setActivityId(0L);
+//                    product.setPic("2020/07/f29c335ff19746cda1025f363dcc00cf.png");
+//                    product.setImgs("2020/07/f29c335ff19746cda1025f363dcc00cf.png");
+//
+//                    products.add(product);
+//                }
+//                String[] hearder = { "产品名称", "平台分类", "店铺分类", "所属品牌", "产品卖点", "配送方式","运费设置","产品状态",
 //                        "规格名称","商品名称", "销售属性组合字符串 格式是p1:v1;p2:v2", "原价", "价格", "积分价格",
-//                        "库存","商家编码","商品条形码" ,"商品重量", "商品体积","产品状态"};
-                String prodName = Objects.isNull(row.getCell(0))? "":row.getCell(0).getStringCellValue();
-                String category = Objects.isNull(row.getCell(1))? "":row.getCell(1).getStringCellValue();
-                String  shopCategory = Objects.isNull(row.getCell(2))? "":row.getCell(2).getStringCellValue();
-                String brandName = Objects.isNull(row.getCell(3))? "":row.getCell(3).getStringCellValue();
-                String brif = Objects.isNull(row.getCell(4))? "":row.getCell(4).getStringCellValue();
-                String dvyType = Objects.isNull(row.getCell(5))? "":row.getCell(5).getStringCellValue();
-                String transportName = Objects.isNull(row.getCell(6))? "":row.getCell(6).getStringCellValue();
-                String statusStr = Objects.isNull(row.getCell(7))? "":row.getCell(7).getStringCellValue();
-                if(StrUtil.isNotBlank(prodName) || !PoiExcelUtil.isMergedRegion(sheet,i,0)) {
-                    skuList = new ArrayList<>();
-                    product = new Product();
-                    totalStocks = 0;
-                    oriPrice = 0.0;
-                    scorePrice = 0;
-                    price = 0.0;
-                    insertRows++;
-                    product.setShopId(shopId);
-                    product.setProdName(prodName);
-                    product.setCategoryId(categoryMap.get(category));
-                    product.setShopCategoryId(shopCategoryMap.get(shopCategory));
-                    product.setBrandId(brandMap.get(brandName));
-                    product.setBrief(brif);
-                    product.setDeliveryMode(getDvyType(dvyType));
-                    product.setDeliveryTemplateId(transportMap.get(transportName));
-                    //TODO 差商品的图片
-                    product.setStatus(Objects.equals(statusStr, "上架") ? ProdStatusEnums.NORMAL.getValue() : ProdStatusEnums.SHOP_OFFLINE.getValue());
-                    product.setPutawayTime(Objects.equals(statusStr, "上架") ? date : null);
-                    product.setCreateTime(date);
-                    product.setUpdateTime(date);
-                    product.setVersion(0);
-                    // 商品销量设置为0
-                    product.setSoldNum(0);
-                    product.setProdType(ProdType.PROD_TYPE_NORMAL.value());
-                    product.setActivityId(0L);
-                    product.setPic("2020/07/f29c335ff19746cda1025f363dcc00cf.png");
-                    product.setImgs("2020/07/f29c335ff19746cda1025f363dcc00cf.png");
-
-                    products.add(product);
-                }
-                String[] hearder = { "产品名称", "平台分类", "店铺分类", "所属品牌", "产品卖点", "配送方式","运费设置","产品状态",
-                        "规格名称","商品名称", "销售属性组合字符串 格式是p1:v1;p2:v2", "原价", "价格", "积分价格",
-                        "库存","商家编码","商品条形码" ,"商品重量", "商品体积"};
-                String  skuName = Objects.isNull(row.getCell(8))? "":row.getCell(8).getStringCellValue();
-                String skuProdName = Objects.isNull(row.getCell(9))? "":row.getCell(9).getStringCellValue();
-                String  properties = Objects.isNull(row.getCell(10))? "":row.getCell(10).getStringCellValue();
-                double skuOriPrice = Objects.isNull(row.getCell(11))? 0.0:row.getCell(11).getNumericCellValue();
-                double skuPrice = Objects.isNull(row.getCell(12))? 0.0:row.getCell(12).getNumericCellValue();
-                Integer skuScorePrice = Integer.valueOf(StrUtil.isBlank(row.getCell(13).getStringCellValue())? "0":row.getCell(13).getStringCellValue());
-                Integer stocks = Objects.isNull(row.getCell(14))? 0:(int)(row.getCell(14).getNumericCellValue());
-                String partyCode = "";
-                if(Objects.nonNull(row.getCell(15))) {
-                    row.getCell(15).setCellType(CellType.STRING);
-                    partyCode  = row.getCell(15).getStringCellValue();
-                }
-                String modelId = "";
-                if(Objects.nonNull(row.getCell(15))) {
-                    row.getCell(16).setCellType(CellType.STRING);
-                    modelId  = row.getCell(15).getStringCellValue();
-                }
-                double weight = Objects.isNull(row.getCell(17))? 0.0:row.getCell(17).getNumericCellValue();
-                double volume = Objects.isNull(row.getCell(18))? 0.0:row.getCell(18).getNumericCellValue();
-                oriPrice = Objects.equals(oriPrice ,0.0) ? skuOriPrice:oriPrice;
-                price = Objects.equals(price ,0.0) ? skuPrice:price;
-
-                Sku sku = new Sku();
-                sku.setSkuName(skuName);
-                sku.setProdName(skuProdName);
-                sku.setProperties(properties);
-                sku.setOriPrice(skuOriPrice);
-                sku.setPrice(skuPrice);
-                sku.setStocks(stocks);
-                sku.setSkuScore(skuScorePrice);
-                sku.setModelId(modelId);
-                sku.setPartyCode(partyCode);
-                sku.setVolume(volume);
-                sku.setUpdateTime(date);
-                sku.setWeight(weight);
-                sku.setVersion(1);
-                sku.setIsDelete(0);
-                sku.setStatus(1);
-                skuList.add(sku);
-                // 如果prodName为空并且为合并行则为一个prod
-                totalStocks += stocks;
-                if(price > skuPrice) {
-                    oriPrice = skuOriPrice;
-                    price = skuPrice;
-                    scorePrice = skuScorePrice;
-                }
-                product.setOriPrice(oriPrice);
-                product.setScorePrice(scorePrice);
-                product.setPrice(price);
-                product.setTotalStocks(totalStocks);
-                product.setSkuList(skuList);
-            } catch (Exception e) {
-                //错误信息提示
-                System.out.println("第" + (i + 1) + "行数据有错误," + e.getMessage());
-            }
-        }
-        workBook.close();
-        //不为空批量导入
-        if(CollectionUtils.isNotEmpty(products)){
-            saveBatch(products);
-//            List<Sku> skuDb = new ArrayList<>();
-            for (Product productDb : products) {
-                List<Sku> skus = productDb.getSkuList();
-                skuMapper.insertBatch(productDb.getProdId(),skus);
-//                skus.forEach(sku -> sku.setProdId(product.getProdId()));
-//                skuDb.addAll(skus);
-            }
-//            skuMapper.save(skuDb);
-                return "检查到" + insertRows + "条商品,成功导入" + products.size() + "条卡密!";
-            }
-        return "数据错误!导入0条";
-    }
+//                        "库存","商家编码","商品条形码" ,"商品重量", "商品体积"};
+//                String  skuName = Objects.isNull(row.getCell(8))? "":row.getCell(8).getStringCellValue();
+//                String skuProdName = Objects.isNull(row.getCell(9))? "":row.getCell(9).getStringCellValue();
+//                String  properties = Objects.isNull(row.getCell(10))? "":row.getCell(10).getStringCellValue();
+//                double skuOriPrice = Objects.isNull(row.getCell(11))? 0.0:row.getCell(11).getNumericCellValue();
+//                double skuPrice = Objects.isNull(row.getCell(12))? 0.0:row.getCell(12).getNumericCellValue();
+//                Integer skuScorePrice = Integer.valueOf(StrUtil.isBlank(row.getCell(13).getStringCellValue())? "0":row.getCell(13).getStringCellValue());
+//                Integer stocks = Objects.isNull(row.getCell(14))? 0:(int)(row.getCell(14).getNumericCellValue());
+//                String partyCode = "";
+//                if(Objects.nonNull(row.getCell(15))) {
+//                    row.getCell(15).setCellType(CellType.STRING);
+//                    partyCode  = row.getCell(15).getStringCellValue();
+//                }
+//                String modelId = "";
+//                if(Objects.nonNull(row.getCell(15))) {
+//                    row.getCell(16).setCellType(CellType.STRING);
+//                    modelId  = row.getCell(15).getStringCellValue();
+//                }
+//                double weight = Objects.isNull(row.getCell(17))? 0.0:row.getCell(17).getNumericCellValue();
+//                double volume = Objects.isNull(row.getCell(18))? 0.0:row.getCell(18).getNumericCellValue();
+//                oriPrice = Objects.equals(oriPrice ,0.0) ? skuOriPrice:oriPrice;
+//                price = Objects.equals(price ,0.0) ? skuPrice:price;
+//
+//                Sku sku = new Sku();
+//                sku.setSkuName(skuName);
+//                sku.setProdName(skuProdName);
+//                sku.setProperties(properties);
+//                sku.setOriPrice(skuOriPrice);
+//                sku.setPrice(skuPrice);
+//                sku.setStocks(stocks);
+//                sku.setSkuScore(skuScorePrice);
+//                sku.setModelId(modelId);
+//                sku.setPartyCode(partyCode);
+//                sku.setVolume(volume);
+//                sku.setUpdateTime(date);
+//                sku.setWeight(weight);
+//                sku.setVersion(1);
+//                sku.setIsDelete(0);
+//                sku.setStatus(1);
+//                skuList.add(sku);
+//                // 如果prodName为空并且为合并行则为一个prod
+//                totalStocks += stocks;
+//                if(price > skuPrice) {
+//                    oriPrice = skuOriPrice;
+//                    price = skuPrice;
+//                    scorePrice = skuScorePrice;
+//                }
+//                product.setOriPrice(oriPrice);
+//                product.setScorePrice(scorePrice);
+//                product.setPrice(price);
+//                product.setTotalStocks(totalStocks);
+//                product.setSkuList(skuList);
+//            } catch (Exception e) {
+//                //错误信息提示
+//                System.out.println("第" + (i + 1) + "行数据有错误," + e.getMessage());
+//            }
+//        }
+//        workBook.close();
+//        //不为空批量导入
+//        if(CollectionUtils.isNotEmpty(products)){
+//            saveBatch(products);
+////            List<Sku> skuDb = new ArrayList<>();
+//            for (Product productDb : products) {
+//                List<Sku> skus = productDb.getSkuList();
+//                skuMapper.insertBatch(productDb.getProdId(),skus);
+////                skus.forEach(sku -> sku.setProdId(product.getProdId()));
+////                skuDb.addAll(skus);
+//            }
+////            skuMapper.save(skuDb);
+//                return "检查到" + insertRows + "条商品,成功导入" + products.size() + "条卡密!";
+//            }
+//        return "数据错误!导入0条";
+//    }
 
     @Override
     public IPage<Product> pageProducts(PageParam<Product> page, ProductParam product) {

+ 2 - 2
yami-shop-service/src/main/java/com/yami/shop/service/impl/QnhServiceImpl.java

@@ -24,7 +24,7 @@ import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.common.exception.YamiShopBindException;
 import com.yami.shop.dao.ShopDetailMapper;
 import com.yami.shop.service.*;
-import lombok.extern.log4j.Log4j2;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -43,7 +43,7 @@ import java.util.stream.IntStream;
  * @author wy
  */
 @Service
-@Log4j2
+@Slf4j
 public class QnhServiceImpl implements IQnhService {
     //测试
 //    private static final String APP_ID = "101151";

+ 1 - 0
yami-shop-user/yami-shop-user-multishop/src/main/java/com/yami/shop/user/multishop/listener/OrderRefundListener.java

@@ -8,6 +8,7 @@ import com.yami.shop.bean.event.OrderRefundSuccessEvent;
 import com.yami.shop.bean.model.Order;
 import com.yami.shop.bean.model.OrderItem;
 import com.yami.shop.bean.model.UserExtension;
+import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.common.exception.YamiShopBindException;
 import com.yami.shop.service.OrderService;
 import com.yami.shop.service.UserExtensionService;