From 6755515b1ffc880f51362bc61e7fb09a510c1839 Mon Sep 17 00:00:00 2001 From: misworga831 Date: Mon, 22 Jan 2024 10:43:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?upgrade:=20=E6=9B=B4=E6=96=B0=20hutool=20?= =?UTF-8?q?=E5=92=8C=20mybatis=20plus=20=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatisplus/external/InsertIgnoreBatchAllColumn.java | 6 +++++- .../lili/mybatis/mybatisplus/external/SpiceSqlInjector.java | 2 +- pom.xml | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/framework/src/main/java/cn/lili/mybatis/mybatisplus/external/InsertIgnoreBatchAllColumn.java b/framework/src/main/java/cn/lili/mybatis/mybatisplus/external/InsertIgnoreBatchAllColumn.java index 9b3bf815e..5a601cb9b 100644 --- a/framework/src/main/java/cn/lili/mybatis/mybatisplus/external/InsertIgnoreBatchAllColumn.java +++ b/framework/src/main/java/cn/lili/mybatis/mybatisplus/external/InsertIgnoreBatchAllColumn.java @@ -28,6 +28,10 @@ public class InsertIgnoreBatchAllColumn extends AbstractMethod { @Accessors(chain = true) private Predicate predicate; + protected InsertIgnoreBatchAllColumn(String methodName) { + super(methodName); + } + @SuppressWarnings("Duplicates") @Override public MappedStatement injectMappedStatement(Class mapperClass, Class modelClass, TableInfo tableInfo) { @@ -36,7 +40,7 @@ public class InsertIgnoreBatchAllColumn extends AbstractMethod { String sqlTemplate = ""; List fieldList = tableInfo.getFieldList(); - String insertSqlColumn = tableInfo.getKeyInsertSqlColumn(true, false) + + String insertSqlColumn = tableInfo.getKeyInsertSqlColumn(true, "", false) + this.filterTableFieldInfo(fieldList, predicate, TableFieldInfo::getInsertSqlColumn, EMPTY); String columnScript = LEFT_BRACKET + insertSqlColumn.substring(0, insertSqlColumn.length() - 1) + RIGHT_BRACKET; String insertSqlProperty = tableInfo.getKeyInsertSqlProperty(true, ENTITY_DOT, false) + diff --git a/framework/src/main/java/cn/lili/mybatis/mybatisplus/external/SpiceSqlInjector.java b/framework/src/main/java/cn/lili/mybatis/mybatisplus/external/SpiceSqlInjector.java index 78f98eeb5..f27c9382c 100644 --- a/framework/src/main/java/cn/lili/mybatis/mybatisplus/external/SpiceSqlInjector.java +++ b/framework/src/main/java/cn/lili/mybatis/mybatisplus/external/SpiceSqlInjector.java @@ -28,7 +28,7 @@ public class SpiceSqlInjector extends DefaultSqlInjector { // methodList.add(new InsertBatchSomeColumn(t -> !t.isLogicDelete() && !"update_time".equals(t.getColumn()))); // 要逻辑删除 t.isLogicDelete() 默认不要 methodList.add(new InsertBatchSomeColumn(t -> !t.isLogicDelete())); - methodList.add(new InsertIgnoreBatchAllColumn()); + methodList.add(new InsertIgnoreBatchAllColumn("insertIgnoreBatchAllColumn")); return methodList; } } diff --git a/pom.xml b/pom.xml index 4245d25fe..578abc289 100644 --- a/pom.xml +++ b/pom.xml @@ -25,12 +25,12 @@ registry.cn-beijing.aliyuncs.com/lili-images 1 4.22.32.ALL - 3.5.1 - 5.8.14 + 3.5.5 + 5.8.24 2.0.3.RELEASE 3.0.4 2.9.10 - 1.18.24 + 1.18.30 3.15.6 4.5.18 3.11.1 From ee8f5b6e1e02394a5f203660007e97ed0eb54f80 Mon Sep 17 00:00:00 2001 From: misworga831 Date: Mon, 22 Jan 2024 10:44:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=9C=B0=E5=9D=80=E5=AD=98=E5=82=A8=E7=BB=93?= =?UTF-8?q?=E6=9E=84=EF=BC=8C=E5=8F=AA=E4=BF=9D=E7=95=99=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=EF=BC=8C=E5=8E=BB=E9=99=A4=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E6=97=A0=E6=95=88=E5=8F=82=E6=95=B0=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=9B=BE=E7=89=87=E8=A7=84=E5=88=99=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=85=A8=E9=83=A8=E9=80=9A=E7=94=A8spu?= =?UTF-8?q?=E5=9B=BE=E7=89=87=EF=BC=8C=E5=8F=AF=E4=B8=BA=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=20=E8=A7=84=E6=A0=BC=E9=A1=B9=20=E5=8D=95=E7=8B=AC?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=80=E4=B8=AA=E5=9B=BE=E7=89=87=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/goods/entity/dto/GoodsImportDTO.java | 3 +-- .../modules/goods/entity/vos/SpecValueVO.java | 15 +-------------- .../goods/serviceimpl/GoodsImportServiceImpl.java | 12 +++++------- .../goods/serviceimpl/GoodsSkuServiceImpl.java | 12 +++++------- 4 files changed, 12 insertions(+), 30 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/goods/entity/dto/GoodsImportDTO.java b/framework/src/main/java/cn/lili/modules/goods/entity/dto/GoodsImportDTO.java index 39c2d25b0..ca985c7df 100644 --- a/framework/src/main/java/cn/lili/modules/goods/entity/dto/GoodsImportDTO.java +++ b/framework/src/main/java/cn/lili/modules/goods/entity/dto/GoodsImportDTO.java @@ -7,7 +7,6 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.util.List; -import java.util.Map; /** * 商品导入DTO @@ -36,7 +35,7 @@ public class GoodsImportDTO { private Boolean release; @ApiModelProperty(value = "商品图片") - private List> images; + private List images; private List goodsGalleryList; @ApiModelProperty(value = "成本价") diff --git a/framework/src/main/java/cn/lili/modules/goods/entity/vos/SpecValueVO.java b/framework/src/main/java/cn/lili/modules/goods/entity/vos/SpecValueVO.java index 89a9d5407..c46bfc1f0 100644 --- a/framework/src/main/java/cn/lili/modules/goods/entity/vos/SpecValueVO.java +++ b/framework/src/main/java/cn/lili/modules/goods/entity/vos/SpecValueVO.java @@ -32,18 +32,5 @@ public class SpecValueVO implements Serializable { * 规格图片 */ @ApiModelProperty(value = "规格的图片") - private List specImage; - - @Data - public static class SpecImages implements Serializable { - - private static final long serialVersionUID = 1816357809660916086L; - - private String url; - - private String name; - - private String status; - - } + private List specImage; } diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsImportServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsImportServiceImpl.java index bcf056c20..e8169538b 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsImportServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsImportServiceImpl.java @@ -33,7 +33,9 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; import java.net.URLEncoder; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; @Slf4j @Service @@ -203,15 +205,11 @@ public class GoodsImportServiceImpl implements GoodsImportService { goodsImportDTO.setCategory(category); goodsImportDTO.setTemplate(templateId); goodsImportDTO.setGoodsUnit(objects.get(4).toString().substring(objects.get(4).toString().indexOf("-") + 1)); - goodsImportDTO.setRelease(objects.get(5).toString().equals("上架") ? true : false); + goodsImportDTO.setRelease(objects.get(5).toString().equals("上架")); - List> images = new ArrayList<>(); List goodsGalleryList = new ArrayList<>(); - Map map = new HashMap<>(); - map.put("url", objects.get(6).toString()); - images.add(map); goodsGalleryList.add(objects.get(6).toString()); - goodsImportDTO.setImages(images); + goodsImportDTO.setImages(goodsGalleryList); goodsImportDTO.setGoodsGalleryList(goodsGalleryList); goodsImportDTO.setCost(Convert.toDouble(objects.get(7))); diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java index 38c8bfaeb..97e202ec2 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java @@ -334,6 +334,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl i } } + goodsSkuDetail.getGoodsGalleryList().addAll(goodsVO.getGoodsGalleryList()); map.put("data", goodsSkuDetail); //获取分类 @@ -474,13 +475,10 @@ public class GoodsSkuServiceImpl extends ServiceImpl i SpecValueVO specValueVO = new SpecValueVO(); if ("images".equals(entry.getKey())) { specValueVO.setSpecName(entry.getKey()); - if (entry.getValue().toString().contains("url")) { - List specImages = JSONUtil.toList(JSONUtil.parseArray(entry.getValue()), - SpecValueVO.SpecImages.class); - specValueVO.setSpecImage(specImages); - goodsGalleryList = - specImages.stream().map(SpecValueVO.SpecImages::getUrl).collect(Collectors.toList()); - } + List specImages = JSONUtil.toList(JSONUtil.parseArray(entry.getValue()), + String.class); + specValueVO.setSpecImage(specImages); + goodsGalleryList = new ArrayList<>(specImages); } else { specValueVO.setSpecName(entry.getKey()); specValueVO.setSpecValue(entry.getValue().toString());