From a22249bfe0ac068f7c2c0a167aa8102ea98def0e Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期二, 04 六月 2024 12:01:02 +0800
Subject: [PATCH] 提交LocalDateTime 序列化 反序列化配置

---
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/IGoodsSkuService.java                             |    7 +
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsInfoTitleValueServiceImpl.java          |   12 +++
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/IGoodsInfoTitleValueService.java                  |   10 ++
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/vo/GoodsSkuVO.java                  |    3 
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/MgtGoodsSkuController.java          |    6 +
 ruoyi-modules/ruoyi-goods/src/main/resources/mapper/goods/GoodsInfoTitleValueMapper.xml                           |   17 ++++
 ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/config/ApplicationConfig.java          |   70 +++++++++++++++++
 ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/management/MgtAuctionScreenController.java |    7 -
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/vo/GoodsInfoTitleValueVO.java       |   31 +++++++
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/dto/GoodsSkuDTO.java                |    6 -
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsSkuServiceImpl.java                     |   42 ++++++++--
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/mapper/GoodsInfoTitleValueMapper.java                     |   10 ++
 12 files changed, 196 insertions(+), 25 deletions(-)

diff --git a/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/config/ApplicationConfig.java b/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/config/ApplicationConfig.java
index d7477b0..dfb1063 100644
--- a/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/config/ApplicationConfig.java
+++ b/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/config/ApplicationConfig.java
@@ -1,9 +1,17 @@
 package com.ruoyi.common.security.config;
 
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.TimeZone;
 import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
 import org.springframework.context.annotation.Bean;
+import org.springframework.core.convert.converter.Converter;
 
 /**
  * 系统配置
@@ -12,6 +20,9 @@
  */
 public class ApplicationConfig
 {
+
+    private static final String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
+    private static final String DATE_PATTERN = "yyyy-MM-dd";
     /**
      * 时区配置
      */
@@ -29,4 +40,63 @@
         };
     }
 
+    /**
+     * string转localdate
+     */
+    @Bean
+    public Converter<String, LocalDate> localDateConverter() {
+        return new Converter<String, LocalDate>() {
+            @Override
+            public LocalDate convert(String source) {
+                if (source.trim().length() == 0) {
+                    return null;
+                }
+                try {
+                    return LocalDate.parse(source);
+                } catch (Exception e) {
+                    return LocalDate.parse(source, DateTimeFormatter.ofPattern(DATE_PATTERN));
+                }
+            }
+        };
+    }
+
+    /**
+     * string转localdatetime
+     */
+    @Bean
+    public Converter<String, LocalDateTime> localDateTimeConverter() {
+        return new Converter<String, LocalDateTime>() {
+            @Override
+            public LocalDateTime convert(String source) {
+                if (source.trim().length() == 0) {
+                    return null;
+                }
+                // 先尝试ISO格式: 2019-07-15T16:00:00
+                try {
+                    return LocalDateTime.parse(source);
+                } catch (Exception e) {
+                    return LocalDateTime.parse(source,
+                            DateTimeFormatter.ofPattern(DATE_TIME_PATTERN));
+                }
+            }
+        };
+    }
+
+    /**
+     * 统一配置
+     */
+    @Bean
+    public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
+        JavaTimeModule module = new JavaTimeModule();
+        LocalDateTimeDeserializer localDateTimeDeserializer = new LocalDateTimeDeserializer(
+                DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+        module.addDeserializer(LocalDateTime.class, localDateTimeDeserializer);
+        return builder -> {
+            builder.simpleDateFormat(DATE_TIME_PATTERN);
+            builder.serializers(new LocalDateSerializer(DateTimeFormatter.ofPattern(DATE_PATTERN)));
+            builder.serializers(
+                    new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DATE_TIME_PATTERN)));
+            builder.modules(module);
+        };
+    }
 }
diff --git a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/management/MgtAuctionScreenController.java b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/management/MgtAuctionScreenController.java
index 14a05bb..1bd2565 100644
--- a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/management/MgtAuctionScreenController.java
+++ b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/management/MgtAuctionScreenController.java
@@ -14,8 +14,6 @@
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.utils.page.PageDTO;
 import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import java.util.List;
@@ -27,7 +25,6 @@
 import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 /**
@@ -117,9 +114,7 @@
      */
     @PutMapping("/add-backup-goods")
     @ApiOperation(value = "选择备选商品", notes = "选择备选商品")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "idList", value = "备选商品id集合", required = true, dataType = "List")})
-    public R<?> addBackupGoods(@RequestParam("idList") List<Long> idList) {
+    public R<?> addBackupGoods(@RequestBody List<Long> idList) {
         auctionSalesroomService.addBackupGoods(idList);
         return R.ok();
     }
diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/MgtGoodsSkuController.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/MgtGoodsSkuController.java
index ce8a7ec..6cbb9bb 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/MgtGoodsSkuController.java
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/MgtGoodsSkuController.java
@@ -27,6 +27,7 @@
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -163,4 +164,9 @@
         return R.ok();
     }
 
+    @ApiOperation("查看详情")
+    @GetMapping("/detail/{id}")
+    public R<GoodsSkuVO> getGoodsDetail(@PathVariable("id") Long id) {
+        return R.ok(goodsSkuService.getGoodsDetail(id));
+    }
 }
diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/dto/GoodsSkuDTO.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/dto/GoodsSkuDTO.java
index 3d5edcb..6c6ba49 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/dto/GoodsSkuDTO.java
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/dto/GoodsSkuDTO.java
@@ -1,6 +1,5 @@
 package com.ruoyi.goods.controller.management.dto;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import java.io.Serializable;
@@ -12,8 +11,6 @@
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import lombok.Data;
-
-import com.ruoyi.goods.controller.management.dto.GoodsInfoTitleValueDTO;
 
 /**
  * @author mitao
@@ -33,8 +30,7 @@
     private String skuName;
 
     @ApiModelProperty(value = "商品年份")
-    @NotBlank(message = "商品年份不能为空")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @NotNull(message = "商品年份不能为空")
     private LocalDateTime years;
 
     @ApiModelProperty(value = "商品分类id")
diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/vo/GoodsInfoTitleValueVO.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/vo/GoodsInfoTitleValueVO.java
new file mode 100644
index 0000000..60ae491
--- /dev/null
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/vo/GoodsInfoTitleValueVO.java
@@ -0,0 +1,31 @@
+package com.ruoyi.goods.controller.management.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.NotNull;
+import lombok.Data;
+
+/**
+ * @author mitao
+ * @date 2024/5/20
+ */
+@Data
+@ApiModel(value = "商品信息视图对象", description = "商品信息视图对象")
+public class GoodsInfoTitleValueVO implements Serializable {
+
+    private static final long serialVersionUID = -6419722448469655827L;
+
+    @ApiModelProperty(value = "商品信息标题id")
+    @NotNull(message = "商品信息标题id不能为空")
+    private Long goodsInfoTitleId;
+
+    @ApiModelProperty(value = "标题名称")
+    private String titleName;
+
+    @ApiModelProperty(value = "内容")
+    private String content;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sortNum;
+}
diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/vo/GoodsSkuVO.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/vo/GoodsSkuVO.java
index b4d1b44..5fca933 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/vo/GoodsSkuVO.java
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/vo/GoodsSkuVO.java
@@ -2,7 +2,6 @@
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.common.core.enums.ListingStatusEnum;
-import com.ruoyi.goods.controller.management.dto.GoodsInfoTitleValueDTO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import java.io.Serializable;
@@ -74,7 +73,7 @@
     private String sharePic;
 
     @ApiModelProperty(value = "商品信息")
-    private List<GoodsInfoTitleValueDTO> goodsInfoTitleValueDTOList;
+    private List<GoodsInfoTitleValueVO> goodsInfoTitleValueVOList;
 
     @ApiModelProperty(value = "商品描述")
     private String description;
diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/mapper/GoodsInfoTitleValueMapper.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/mapper/GoodsInfoTitleValueMapper.java
index 5c36726..e7605a7 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/mapper/GoodsInfoTitleValueMapper.java
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/mapper/GoodsInfoTitleValueMapper.java
@@ -1,7 +1,10 @@
 package com.ruoyi.goods.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.goods.controller.management.vo.GoodsInfoTitleValueVO;
 import com.ruoyi.goods.domain.GoodsInfoTitleValue;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * <p>
@@ -13,4 +16,11 @@
  */
 public interface GoodsInfoTitleValueMapper extends BaseMapper<GoodsInfoTitleValue> {
 
+    /**
+     * 根据商品id查询信息标题列表
+     *
+     * @param id 商品id
+     * @return List<GoodsInfoTitleValueVO>
+     */
+    List<GoodsInfoTitleValueVO> listByGoodsId(@Param("id") Long id);
 }
diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/IGoodsInfoTitleValueService.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/IGoodsInfoTitleValueService.java
index a6c7de6..b325507 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/IGoodsInfoTitleValueService.java
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/IGoodsInfoTitleValueService.java
@@ -1,7 +1,9 @@
 package com.ruoyi.goods.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.goods.controller.management.vo.GoodsInfoTitleValueVO;
 import com.ruoyi.goods.domain.GoodsInfoTitleValue;
+import java.util.List;
 
 /**
  * <p>
@@ -19,4 +21,12 @@
      * @param id 商品SKU的唯一标识符。
      */
     void removeByGoodsSkuId(Long id);
+
+    /**
+     * 根据商品id查询信息标题列表
+     *
+     * @param id 商品id
+     * @return List<GoodsInfoTitleValueVO>
+     */
+    List<GoodsInfoTitleValueVO> listByGoodsId(Long id);
 }
diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/IGoodsSkuService.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/IGoodsSkuService.java
index 8693f69..72ec0ad 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/IGoodsSkuService.java
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/IGoodsSkuService.java
@@ -10,11 +10,10 @@
 import com.ruoyi.system.api.domain.dto.GoodsStockUpdDTO;
 import com.ruoyi.system.api.domain.dto.HomeGoodsSkuDTO;
 import com.ruoyi.system.api.domain.dto.ListStatusDTO;
-import com.ruoyi.system.api.domain.vo.HomeGoodsSkuListVO;
 import com.ruoyi.system.api.domain.vo.HomeGoodsSkuInfoVO;
-import org.springframework.web.bind.annotation.RequestBody;
-
+import com.ruoyi.system.api.domain.vo.HomeGoodsSkuListVO;
 import java.util.List;
+import org.springframework.web.bind.annotation.RequestBody;
 
 /**
  * <p>
@@ -68,4 +67,6 @@
     PageDTO<HomeGoodsSkuListVO> getHomeGoodsSkuVOList(@RequestBody HomeGoodsSkuDTO homeGoodsSkuDTO);
 
     HomeGoodsSkuInfoVO getHomeGoodsSkuInfo(@RequestBody HomeGoodsSkuDTO homeGoodsSkuDTO);
+
+    GoodsSkuVO getGoodsDetail(Long id);
 }
diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsInfoTitleValueServiceImpl.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsInfoTitleValueServiceImpl.java
index 859b52f..5eee667 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsInfoTitleValueServiceImpl.java
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsInfoTitleValueServiceImpl.java
@@ -1,9 +1,11 @@
 package com.ruoyi.goods.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.goods.controller.management.vo.GoodsInfoTitleValueVO;
 import com.ruoyi.goods.domain.GoodsInfoTitleValue;
 import com.ruoyi.goods.mapper.GoodsInfoTitleValueMapper;
 import com.ruoyi.goods.service.IGoodsInfoTitleValueService;
+import java.util.List;
 import org.springframework.stereotype.Service;
 
 /**
@@ -29,4 +31,14 @@
         this.lambdaUpdate().eq(GoodsInfoTitleValue::getGoodsSkuId, id).remove();
     }
 
+    /**
+     * 根据商品id查询信息标题列表
+     *
+     * @param id 商品id
+     * @return List<GoodsInfoTitleValueVO>
+     */
+    @Override
+    public List<GoodsInfoTitleValueVO> listByGoodsId(Long id) {
+        return baseMapper.listByGoodsId(id);
+    }
 }
diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsSkuServiceImpl.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsSkuServiceImpl.java
index 8d0d431..900adb0 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsSkuServiceImpl.java
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsSkuServiceImpl.java
@@ -1,4 +1,5 @@
 package com.ruoyi.goods.service.impl;
+
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -16,8 +17,8 @@
 import com.ruoyi.goods.controller.management.dto.GoodsInfoTitleValueDTO;
 import com.ruoyi.goods.controller.management.dto.GoodsSkuDTO;
 import com.ruoyi.goods.controller.management.dto.GoodsSkuQuery;
+import com.ruoyi.goods.controller.management.vo.GoodsInfoTitleValueVO;
 import com.ruoyi.goods.controller.management.vo.GoodsSkuVO;
-import com.ruoyi.system.api.domain.GoodsGroupPurchase;
 import com.ruoyi.goods.domain.GoodsInfoTitleValue;
 import com.ruoyi.goods.domain.MemberGoodsCollection;
 import com.ruoyi.goods.mapper.GoodsGroupPurchaseMapper;
@@ -26,11 +27,19 @@
 import com.ruoyi.goods.service.IGoodsInfoTitleValueService;
 import com.ruoyi.goods.service.IGoodsSkuService;
 import com.ruoyi.goods.service.IMemberGoodsCollectionService;
-import com.ruoyi.system.api.domain.*;
+import com.ruoyi.system.api.domain.GoodsBrand;
+import com.ruoyi.system.api.domain.GoodsCategory;
+import com.ruoyi.system.api.domain.GoodsFlavorType;
+import com.ruoyi.system.api.domain.GoodsGroupPurchase;
+import com.ruoyi.system.api.domain.GoodsSeckill;
+import com.ruoyi.system.api.domain.GoodsSeries;
+import com.ruoyi.system.api.domain.GoodsSku;
 import com.ruoyi.system.api.domain.dto.GoodsStockUpdDTO;
 import com.ruoyi.system.api.domain.dto.HomeGoodsSkuDTO;
 import com.ruoyi.system.api.domain.dto.ListStatusDTO;
-
+import com.ruoyi.system.api.domain.vo.HomeGoodsSkuInfoVO;
+import com.ruoyi.system.api.domain.vo.HomeGoodsSkuListVO;
+import com.ruoyi.system.api.feignClient.GoodsSkuClient;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.List;
@@ -38,10 +47,7 @@
 import java.util.Objects;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
-
-import com.ruoyi.system.api.domain.vo.HomeGoodsSkuListVO;
-import com.ruoyi.system.api.domain.vo.HomeGoodsSkuInfoVO;
-import com.ruoyi.system.api.feignClient.GoodsSkuClient;
+import javax.annotation.Resource;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.redisson.api.RLock;
@@ -49,8 +55,6 @@
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
 
 /**
  * <p>
@@ -69,6 +73,7 @@
     private final GoodsSeckillMapper goodsSeckillMapper;
     private final GoodsGroupPurchaseMapper goodsGroupPurchaseMapper;
     private final RedissonClient redissonClient;
+
     @Resource
     private  GoodsSkuClient goodsSkuClient;
 
@@ -409,4 +414,23 @@
                 .eq(GoodsSku::getStock, skus.getStock())
                 .update();
     }
+
+    /**
+     * 根据商品id查询信息标题列表
+     *
+     * @param id 商品id
+     * @return List<GoodsInfoTitleValueVO>
+     */
+    @Override
+    public GoodsSkuVO getGoodsDetail(Long id) {
+        GoodsSku goodsSku = this.getById(id);
+        if (StringUtils.isNull(goodsSku)) {
+            throw new ServiceException("商品不存在");
+        }
+        GoodsSkuVO goodsSkuVO = BeanUtils.copyBean(goodsSku, GoodsSkuVO.class);
+        List<GoodsInfoTitleValueVO> goodsInfoTitleValueVOList = goodsInfoTitleValueService.listByGoodsId(
+                id);
+        goodsSkuVO.setGoodsInfoTitleValueVOList(goodsInfoTitleValueVOList);
+        return goodsSkuVO;
+    }
 }
diff --git a/ruoyi-modules/ruoyi-goods/src/main/resources/mapper/goods/GoodsInfoTitleValueMapper.xml b/ruoyi-modules/ruoyi-goods/src/main/resources/mapper/goods/GoodsInfoTitleValueMapper.xml
index d150ea2..916088a 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/resources/mapper/goods/GoodsInfoTitleValueMapper.xml
+++ b/ruoyi-modules/ruoyi-goods/src/main/resources/mapper/goods/GoodsInfoTitleValueMapper.xml
@@ -2,4 +2,21 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.goods.mapper.GoodsInfoTitleValueMapper">
 
+  <select id="listByGoodsId"
+    resultType="com.ruoyi.goods.controller.management.vo.GoodsInfoTitleValueVO"
+    parameterType="java.lang.Long">
+    SELECT titv.goods_info_title_id,
+    titv.content,
+    titv.sort_num,
+    tit.title_name
+    FROM t_goods_info_title_value titv
+    LEFT JOIN t_goods_info_title tit
+    ON titv.goods_info_title_id = tit.id
+    <where>
+      titv.del_flag = 0 AND tit.del_flag = 0
+      <if test="id != null">
+        AND titv.goods_sku_id = #{id}
+      </if>
+    </where>
+  </select>
 </mapper>

--
Gitblit v1.7.1