瀏覽代碼

Merge branch 'zx_saas_goods' of http://git.dayaedu.com/yonge/mec into zx_saas_goods

刘俊驰 1 年之前
父節點
當前提交
95415fb7f1

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SellOrderDao.java

@@ -245,5 +245,5 @@ public interface SellOrderDao extends BaseDAO<Integer, SellOrder> {
 
     void updateShippedStatus(@Param("orderNos") List<String> orderNos);
 
-    void updateOrganGoodsCost(@Param("orderSkuSync") OrderSkuSync orderSkuSync);
+    void updateOrganGoodsCost(@Param("skuSync") OrderSkuSync.SkuSync skuSync, @Param("orderNo") String orderNo);
 }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/GoodsWrapper.java

@@ -167,6 +167,9 @@ public class GoodsWrapper {
 
         private String childOrganCostPrice;
 
+        @ApiModelProperty(value = "品牌名称")
+        private String brandName;
+
         private List<GoodsSub> goodsSubList = new ArrayList<>();
 
         @Override

+ 67 - 47
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java

@@ -204,22 +204,22 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void addGoods(List<GoodsWrapper.Goods> goodsList, Integer operatorId) {
-		List<String> snList = goodsList.stream().map(GoodsWrapper.Goods::getSn).collect(Collectors.toList());
-		if (snList.size() != new HashSet<>(snList).size()) {
-			throw new BizException("商品货号重复");
-		}
-		List<Goods> bySns = goodsDao.findBySns(snList);
-		if (!CollectionUtils.isEmpty(bySns)) {
-			throw new BizException("商品货号重复");
-		}
+//		List<String> snList = goodsList.stream().map(GoodsWrapper.Goods::getSn).collect(Collectors.toList());
+//		if (snList.size() != new HashSet<>(snList).size()) {
+//			throw new BizException("商品货号重复");
+//		}
+//		List<Goods> bySns = goodsDao.findBySns(snList);
+//		if (!CollectionUtils.isEmpty(bySns)) {
+//			throw new BizException("商品货号重复");
+//		}
 		for (GoodsWrapper.Goods goods : goodsList) {
 			if (StringUtils.isBlank(goods.getSn())) {
 				throw new BizException("请指定商品货号");
 			}
-			Goods existsGood = goodsDao.lockBySn(goods.getSn());
-			if (Objects.nonNull(existsGood)) {
-				throw new BizException("商品货号重复");
-			}
+//			Goods existsGood = goodsDao.lockBySn(goods.getSn());
+//			if (Objects.nonNull(existsGood)) {
+//				throw new BizException("商品货号重复");
+//			}
 			List<GoodsWrapper.GoodsSub> goodsSubList = goods.getGoodsSubList();
 			//获取最小的库存数
 			String skuIds = goodsSubList.stream().map(e -> e.getSku().toString()).collect(Collectors.joining(","));
@@ -614,6 +614,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 		List<String> errList = new ArrayList<>();
 //		Map<String, List<Map<String, Object>>> sheetsListMap = POIUtil.importExcel(new ByteArrayInputStream(file.getBytes()), 2, file.getOriginalFilename());
 		Map<String, List<Map<String, Object>>> sheetsListMap = POIUtil.importExcel(excel, 2);
+		excel.deleteOnExit();
 		if (sheetsListMap.values().isEmpty()) {
 			errList.add("excel未解析到数据");
 			return getExportErrLogFile(errList);
@@ -665,12 +666,12 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 		});
 
 		// excel中所有的sn
-		List<String> snSet = firstSheet.stream().map(next -> next.get("组合商品货号").toString()).filter(StringUtils::isNotEmpty).collect(Collectors.toList());
+//		List<String> snSet = firstSheet.stream().map(next -> next.get("组合商品货号").toString()).filter(StringUtils::isNotEmpty).collect(Collectors.toList());
 		// 获取重复的货号
-		List<String> repeatSnList = snSet.stream().collect(Collectors.groupingBy(e -> e, Collectors.counting()))
-				.entrySet().stream().filter(e -> e.getValue() > 1)
-				.map(Map.Entry::getKey).collect(Collectors.toList());
-		List<String> existSnList = goodsDao.findBySns(snSet.stream().distinct().collect(Collectors.toList())).stream().map(Goods::getSn).distinct().collect(Collectors.toList());
+//		List<String> repeatSnList = snSet.stream().collect(Collectors.groupingBy(e -> e, Collectors.counting()))
+//				.entrySet().stream().filter(e -> e.getValue() > 1)
+//				.map(Map.Entry::getKey).collect(Collectors.toList());
+//		List<String> existSnList = goodsDao.findBySns(snSet.stream().distinct().collect(Collectors.toList())).stream().map(Goods::getSn).distinct().collect(Collectors.toList());
 
 		Map<String, Long> brandNameIdMap = mallFeignService.getList().stream().collect(Collectors.toMap(BrandDto::getName, BrandDto::getId));
 
@@ -704,6 +705,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 				String sn = row.get("组合商品货号").toString();
 				if (StringUtils.isNotEmpty(sn)) {
 					beforeGoods.clear();
+					snSubGoodsMap.clear();
 				}
 				String subGoodsName = null;
 				String subGoodsSku = null;
@@ -748,16 +750,17 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 						}
 						beforeGoods.put(fieldCode, value);
 					}
-					if ("sn".equals(fieldCode)) {
-						if (existSnList.contains(value.toString())) {
-							lineErrList.add("货号[" + value + "]已存在");
-						} else {
-							if (repeatSnList.contains(value.toString())) {
-								lineErrList.add("货号[" + value + "]重复");
-							}
-						}
-						objectMap.put(fieldCode, value);
-					} else if ("marketPrice".equals(fieldCode)
+//					if ("sn".equals(fieldCode)) {
+//						if (existSnList.contains(value.toString())) {
+//							lineErrList.add("货号[" + value + "]已存在");
+//						} else {
+//							if (repeatSnList.contains(value.toString())) {
+//								lineErrList.add("货号[" + value + "]重复");
+//							}
+//						}
+//						objectMap.put(fieldCode, value);
+//					} else
+						if ("marketPrice".equals(fieldCode)
 							|| "discountPrice".equals(fieldCode)
 							|| "groupPurchasePrice".equals(fieldCode)) {
 						if (NumberUtils.isNumber(value.toString())) {
@@ -857,17 +860,19 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 					lineErrList.add("可售分部至少需要填写一个");
 				}
 				// 校验子商品sku是否重复
-				String tempSn = objectMap.get("sn").toString();
-				String tempSku = objectMap.get("sku").toString();
-				byte[] images = objectMap.getBytes("image");
-				snImageMap.put(tempSn, images);
-				if (StringUtils.isNotEmpty(tempSn) && StringUtils.isNotEmpty(tempSku)) {
-					Set<String> set = snSubGoodsMap.getOrDefault(tempSn, new HashSet<>());
-					if (set.contains(tempSku)) {
-						lineErrList.add("子商品SKU重复");
-					} else {
-						set.add(tempSku);
-						snSubGoodsMap.put(tempSn, set);
+				String tempSn = objectMap.getOrDefault("sn", "").toString();
+				String tempSku = objectMap.getOrDefault("sku", "").toString();
+				if (StringUtils.isNotEmpty(tempSn)) {
+					byte[] images = objectMap.getBytes("image");
+					snImageMap.put(tempSn, images);
+					if (StringUtils.isNotEmpty(tempSku)) {
+						Set<String> set = snSubGoodsMap.getOrDefault(tempSn, new HashSet<>());
+						if (set.contains(tempSku)) {
+							lineErrList.add("子商品SKU重复");
+						} else {
+							set.add(tempSku);
+							snSubGoodsMap.put(tempSn, set);
+						}
 					}
 				}
 
@@ -926,6 +931,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 			Goods goods = JSON.parseObject(JSON.toJSONString(good), Goods.class);
 			goods.setStatus(YesOrNoEnum.NO);
 			goods.setStockCount(stock);
+			goods.setGroupGoods(true);
 			this.insert(goods);
 
 			List<GoodsSub> subList = goodsSubList.stream().map(next -> {
@@ -1267,6 +1273,11 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 		}
 		GoodsWrapper.Goods detail = JSON.parseObject(JSON.toJSONString(goods), GoodsWrapper.Goods.class);
 		detail.setGoodsSubList(queryGoodsSubByGoodId(goodsId));
+		String brand = detail.getBrand();
+		if (StringUtils.isNotEmpty(brand) && NumberUtils.isNumber(brand)) {
+			Map<Long, String> brandIdNameMap = queryGoodsBrandList().stream().collect(Collectors.toMap(BrandDto::getId, BrandDto::getName));
+			detail.setBrandName(brandIdNameMap.getOrDefault(Long.valueOf(brand), ""));
+		}
 		return detail;
 	}
 
@@ -1295,15 +1306,6 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 		goodsInfo = JSON.parseObject(JSON.toJSONString(goods), Goods.class);
 		goodsInfo.setStatus(null);
 		if (!goodsSubList.isEmpty()) {
-			goodsInfo.setComplementGoodsIdList(null);
-			UpdateWrapper<GoodsSub> delWrapper = new UpdateWrapper<>();
-			delWrapper.eq("goods_id_", goods.getId());
-			goodsSubService.getBaseMapper().delete(delWrapper);
-
-			List<GoodsSub> goodsSubs = JSON.parseArray(JSON.toJSONString(goodsSubList), GoodsSub.class);
-			goodsSubs.forEach(next -> next.setGoodsId(goods.getId()));
-			goodsSubService.saveBatch(goodsSubs);
-
 			BigDecimal organCostPrice = goodsSubList.stream().map(GoodsWrapper.GoodsSub::getGoodsPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
 			goodsInfo.setOrganCostPrice(organCostPrice);
 
@@ -1318,6 +1320,24 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 			if(CollectionUtils.isEmpty(productList)){
 				throw new BizException("子商品不存在");
 			}
+			Map<Integer, Long> skuIdGoodIdMap = productList.stream().collect(Collectors.toMap(PmsProductDto::getSkuStockId, PmsProductDto::getGoodsId));
+
+			List<GoodsSub> goodsSubs = JSON.parseArray(JSON.toJSONString(goodsSubList), GoodsSub.class);
+			for (GoodsSub next : goodsSubs) {
+				next.setGoodsId(goods.getId());
+				if (skuIdGoodIdMap.containsKey(next.getSku())) {
+					next.setMallGoodsId(skuIdGoodIdMap.get(next.getSku()).intValue());
+				} else {
+					throw new BizException("存在删除的子商品");
+				}
+			}
+
+			UpdateWrapper<GoodsSub> delWrapper = new UpdateWrapper<>();
+			delWrapper.eq("goods_id_", goods.getId());
+			goodsSubService.getBaseMapper().delete(delWrapper);
+			goodsSubService.saveBatch(goodsSubs);
+
+			goodsInfo.setComplementGoodsIdList(null);
 			//获取最小库存数量
 			Integer stock = productList.stream().map(PmsProductDto::getStock).min(Integer::compareTo).get();
 			goodsInfo.setStockCount(stock);

+ 12 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SellOrderServiceImpl.java

@@ -561,7 +561,12 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
     public List<OrderCreate.OrderItem> convertMallOrder(List<SellOrder> sellOrderList) {
         List<OrderCreate.OrderItem> orderItems = new ArrayList<>();
         for (SellOrder e : sellOrderList) {
-            List<GoodsSub> list = goodsSubService.lambdaQuery().eq(GoodsSub::getGoodsId, e.getParentGoodsId()).list();
+            OrderCreate.OrderItem orderItemCreate = new OrderCreate.OrderItem();
+            orderItemCreate.setProductQuantity(e.getNum());
+            orderItemCreate.setProductSkuId(e.getGoodsSkuId().longValue());
+            orderItemCreate.setRealAmount(e.getExpectAmount());
+            orderItems.add(orderItemCreate);
+            /*List<GoodsSub> list = goodsSubService.lambdaQuery().eq(GoodsSub::getGoodsId, e.getParentGoodsId()).list();
             if(CollectionUtils.isEmpty(list)){
                 throw new RuntimeException("子商品不存在,请联系管理员");
             }
@@ -586,8 +591,8 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
                     orderItemCreate.setRealAmount(multiply);
                     waitRemitFee = waitRemitFee.subtract(multiply);
                 }
-                orderItems.add(orderItemCreate);
-            }
+                orderItems.add(orderItemCreate);*/
+//            }
         }
         return orderItems;
     }
@@ -655,7 +660,10 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
         List<Goods> goodies = goodsDao.getGoodies(goodsIds);
         BigDecimal goodsTotalPrice = goodies.stream().map(Goods::getGroupPurchasePrice).reduce(BigDecimal.ZERO, BigDecimal::add);
 
-        AccountType accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(order.getPaymentChannel()), order.getMerNos(), order.getTenantId());
+        AccountType accountType = AccountType.INTERNAL;
+        if(StringUtils.isNotEmpty(order.getPaymentChannel())){
+            accountType  = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(order.getPaymentChannel()), order.getMerNos(), order.getTenantId());
+        }
         PmsProductQueryParamDto paramDto = new PmsProductQueryParamDto();
         String skuIds = goodsSubService.lambdaQuery().in(GoodsSub::getGoodsId, goodies.stream().map(Goods::getId).collect(Collectors.toList())).list()
                 .stream().map(e->e.getSku().toString()).collect(Collectors.joining(","));

+ 3 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -2206,8 +2206,9 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
     @Transactional(rollbackFor = Exception.class)
     public void updateShippedStatus(List<OrderSkuSync> orderSkuSyncs) {
         for (OrderSkuSync orderSkuSync : orderSkuSyncs) {
-            //更新商品订单成本
-            sellOrderDao.updateOrganGoodsCost(orderSkuSync);
+            for (int i = 0; i < orderSkuSync.getSkuSyncList().size(); i++) {
+                sellOrderDao.updateOrganGoodsCost(orderSkuSync.getSkuSyncList().get(i), orderSkuSync.getOrderNo());
+            }
         }
     }
 

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentRouteOrderServiceImpl.java

@@ -344,7 +344,7 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
                     mallOrder.setOrderItemList(items);
                     CommonResult<Boolean> result = mallFeignService.productOrderCreate(mallOrder);
                     if (result.getCode() != 200) {
-                        throw new BizException("同步商城订单失败",result.getMessage());
+                        throw new BizException("同步商城订单失败: {}",result.getMessage());
                     }
                 }
             }

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -437,6 +437,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
                 amount = amount.subtract(balance);
                 studentPaymentOrder.setActualAmount(amount);
                 studentPaymentOrder.setBalancePaymentAmount(balance);
+                studentPaymentOrder.setPaymentChannel("BALANCE");
                 sysUserCashAccountService.updateBalance(studentId, balance.negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "商品销售");
             }
         }

+ 4 - 4
mec-biz/src/main/resources/config/mybatis/GoodsMapper.xml

@@ -368,7 +368,7 @@
             <if test="replacementShowOrganId!=null and replacementShowOrganId!=''">
                 AND INTE_ARRAY(#{replacementShowOrganId},g.replacement_show_organ_id_)
             </if>
-            <if test="brandId != null and brandId != ''">
+            <if test="brandId != null">
                 AND g.brand_ = #{brandId}
             </if>
             <if test="noOrganSearch == null">
@@ -386,13 +386,13 @@
                 AND (g.sn_=#{search} OR g.id_=#{search} OR g.name_ LIKE CONCAT('%', #{search}, '%'))
             </if>
             <if test="name != null and name != ''">
-                AND t.name_ like CONCAT('%', #{name}, '%'))
+                AND g.name_ like CONCAT('%', #{name}, '%')
             </if>
             <if test="sn != null and sn != ''">
-                AND t.sn_ like CONCAT('%', #{sn}, '%'))
+                AND g.sn_ like CONCAT('%', #{sn}, '%')
             </if>
             <if test="groupGoods != null">
-                AND t.group_goods_ = #{groupGoods}
+                AND g.group_goods_ = #{groupGoods}
             </if>
         </where>
     </sql>

+ 2 - 4
mec-biz/src/main/resources/config/mybatis/SellOrderMapper.xml

@@ -282,10 +282,8 @@
         </foreach>
     </update>
     <update id="updateOrganGoodsCost">
-        <foreach collection="orderSkuSync.skuSyncList" item="sellOrder" separator=";">
-            update sell_order SET organ_sell_cost_ = #{sellOrder.price} ,delivery_time_ = NOW()
-                              where order_no_ = #{orderSkuSync.orderNo} AND goods_sku_id_ = #{sellOrder.sku}
-        </foreach>
+        update sell_order SET organ_sell_cost_ = #{skuSync.price} ,delivery_time_ = NOW()
+                          where order_no_ = #{orderNo} AND goods_sku_id_ = #{skuSync.sku} AND  organ_sell_cost_ IS NULL
     </update>
 
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">

+ 5 - 0
mec-util/pom.xml

@@ -101,5 +101,10 @@
 			<artifactId>spring-expression</artifactId>
 			<version>5.1.18.RELEASE</version>
 		</dependency>
+		<dependency>
+			<groupId>dom4j</groupId>
+			<artifactId>dom4j</artifactId>
+			<version>1.6.1</version>
+		</dependency>
 	</dependencies>
 </project>

+ 139 - 4
mec-util/src/main/java/com/ym/mec/util/excel/POIUtil.java

@@ -1,5 +1,6 @@
 package com.ym.mec.util.excel;
 
+import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -14,9 +15,13 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipInputStream;
 
 import org.apache.commons.beanutils.NestedNullException;
 import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.POIXMLDocumentPart;
 import org.apache.poi.hssf.usermodel.HSSFCell;
@@ -45,6 +50,9 @@ import org.apache.poi.xssf.usermodel.XSSFPicture;
 import org.apache.poi.xssf.usermodel.XSSFShape;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
 import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTMarker;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -54,6 +62,8 @@ import org.springframework.expression.spel.support.StandardEvaluationContext;
 
 import com.ym.mec.util.exception.UtilException;
 
+import javax.imageio.ImageIO;
+
 public class POIUtil {
 
 	private final static Logger LOGGER = LoggerFactory.getLogger(POIUtil.class);
@@ -467,9 +477,16 @@ public class POIUtil {
 			fis.close();
 			throw new UtilException("excel文件的扩展名是.xls or .xlsx!");
 		}
+		String absolutePath = excelFile.getAbsolutePath();
 		String ext = excelFile.getName().substring(index).toLowerCase();
+		// 处理WPS嵌入的图片
+		Map<String, String> codeRidMap = new HashMap<>();
+		Map<String, String> ridImgMap = new HashMap<>();
 		try {
 			if (".xlsx".equals(ext.toLowerCase())) {
+				// 处理WPS中图片问题
+				codeRidMap.putAll(ridWithIDRelationShip(absolutePath));
+				ridImgMap.putAll(ridWithImagePathRelationShip(absolutePath));
 				// 支持excel2007 xlsx格式
 				workbook = new XSSFWorkbook(fis);
 			} else if (".xls".equals(ext)) {
@@ -501,6 +518,12 @@ public class POIUtil {
 			currentRowNum = 0;
 			// 顺序取sheet
 			sheet = workbook.getSheetAt(i);
+			Map<String, List<PictureData>> picMap = null;
+			if(sheet instanceof  XSSFSheet){
+				picMap = getXlsxPictures((XSSFSheet) sheet);
+			}else if(sheet instanceof  HSSFSheet){
+				picMap = getXlsPictures((HSSFSheet) sheet);
+			}
 			List<Map<String, Object>> datas = new ArrayList<Map<String, Object>>();
 			rowIter = sheet.iterator();
 			while (rowIter.hasNext()) {
@@ -536,12 +559,43 @@ public class POIUtil {
 					currentCellNum = 0;
 					while (cellIter.hasNext()) {
 						cell = cellIter.next();
-						cell.setCellType(Cell.CELL_TYPE_STRING);
-						String fieldValue = cell.getStringCellValue();
-						obj.put(fieldsName[currentCellNum], fieldValue);
-						currentCellNum++;
+
+						if(cell.getCellType() == Cell.CELL_TYPE_FORMULA){
+							Object fieldValue = "";
+							if(cell.getStringCellValue().contains("DISPIMG")){
+								String value = cell.getStringCellValue();
+								String imageId = value.substring(value.indexOf("ID_") + 3, value.lastIndexOf("\""));
+								String rid = codeRidMap.get(imageId);
+								String picPath = ridImgMap.get(rid);
+								InputStream picInputStream = openZipFile(absolutePath,"xl/" + picPath);
+								if (picInputStream != null) {
+									fieldValue= IOUtils.toByteArray(picInputStream);
+								}
+							}else {
+								fieldValue = cell.getStringCellValue();
+							}
+							obj.put(fieldsName[currentCellNum], fieldValue);
+						}else {
+							cell.setCellType(Cell.CELL_TYPE_STRING);
+							String fieldValue = cell.getStringCellValue();
+							obj.put(fieldsName[currentCellNum], fieldValue);
+							currentCellNum++;
+						}
+					}
+				}
+
+				if (picMap != null) {
+					for (Entry<String, List<PictureData>> pics : picMap.entrySet()) {
+						String key = pics.getKey();
+						String[] split = key.split("-");
+						int rowIndex = Integer.parseInt(split[0]);
+						int cellIndex = Integer.parseInt(split[1]);
+						if (rowIndex != (currentRowNum - 1)) continue;
+						obj.put(fieldsName[cellIndex], pics.getValue());
 					}
 				}
+
+
 				if (obj != null)
 					datas.add(obj);
 
@@ -989,4 +1043,85 @@ public class POIUtil {
 		return workbook;
 	}
 
+
+	 // 解析WPS中的图片,WPS中的图片和office中图片存储方式不一致
+	 private static Map<String, String> ridWithIDRelationShip(String path) {
+		 Map<String, String> imageIdMappingMap = new HashMap<>();
+		 try (InputStream inputStream = openZipFile(path, "xl/cellimages.xml")) {
+			 //读取关系xml文件
+			 // 创建SAXReader对象
+			 SAXReader reader = new SAXReader();
+			 // 加载xml文件
+			 Document dc = reader.read(inputStream);
+			 // 获取根节点
+			 Element rootElement = dc.getRootElement();
+			 //获取子节点 每一个图片节点
+			 List<Element> cellImageList = rootElement.elements();
+
+			 //循环处理每一个图片
+			 for (Element cellImage : cellImageList) {
+				 Element pic = cellImage.element("pic");
+				 Element nvPicPr = pic.element("nvPicPr");
+				 Element cNvPr = nvPicPr.element("cNvPr");
+				 //图片id
+				 String imageId = cNvPr.attribute("name").getValue().replace("ID_", "");
+//                        imageId = subImageId(imageId);
+				 Element blipFill = pic.element("blipFill");
+				 Element blip = blipFill.element("blip");
+				 //图片Rid
+				 String imageRid = blip.attribute("embed").getValue();
+				 //存入map中
+				 imageIdMappingMap.put(imageId, imageRid);
+			 }
+		 } catch (Exception e) {
+			 LOGGER.error("解析excel失败:{}", e.getMessage());
+		 }
+		 return imageIdMappingMap;
+	 }
+
+	private static Map<String, String> ridWithImagePathRelationShip(String path) {
+		Map<String, String> imageMap = new HashMap<>();
+		try (InputStream inputStream = openZipFile(path, "xl/_rels/cellimages.xml.rels")) {
+			//读取关系文件
+			// 创建SAXReader对象
+			SAXReader reader = new SAXReader();
+			// 加载xml文件
+			Document dc = reader.read(inputStream);
+			// 获取根节点
+			Element rootElement = dc.getRootElement();
+
+			List<Element> imageRelationshipList = rootElement.elements();
+
+			//处理每个关系
+			for (Element imageRelationship : imageRelationshipList) {
+				String imageRid = imageRelationship.attribute("Id").getValue();
+				String imagePath = imageRelationship.attribute("Target").getValue();
+				imageMap.put(imageRid, imagePath);
+			}
+
+		} catch (Exception e) {
+			LOGGER.error("解析excel失败:{}", e.getMessage());
+		}
+		return imageMap;
+	}
+
+	private static InputStream openZipFile(String excelFilePath, String excelZipFile) {
+		try {
+			File file = new File(excelFilePath);
+			ZipFile zipFile = new ZipFile(file);
+			ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(file));
+
+			ZipEntry nextEntry;
+			while ((nextEntry = zipInputStream.getNextEntry()) != null) {
+				String name = nextEntry.getName();
+				if (name.equalsIgnoreCase(excelZipFile)) {
+					return zipFile.getInputStream(nextEntry);
+				}
+			}
+		} catch (Exception e) {
+			LOGGER.error("解析excel失败:{}", e.getMessage());
+		}
+		return null;
+	}
+
 }