Ver Fonte

1.订单超时未支付 没有进入悔拍状态
3.资产·珍品 "status":1 竞拍中,查询不到数据
4.后台订单详情的接口缺少两个字段 支付时间和订单状态
5.订单详情接口,已发货,缺少物流信息
6.成交订单支付 需要一个地址id
7.发布时保存相对应分类数据

hr~ há 1 mês atrás
pai
commit
15da9f80d0

+ 2 - 0
lot/src/main/java/cn/hobbystocks/auc/mapper/SpuCategoryMapper.java

@@ -21,6 +21,8 @@ public interface SpuCategoryMapper {
 
     List<Long> listLotIdsByCategoryIds(@Param("categoryIds") List<Long> categoryIds);
 
+    List<Long> selectCategoryIdsByNames(@Param("names") List<String> names);
+
     void insertLotCategoryRelation(@Param("lotId") Long lotId, @Param("categoryIds") List<Long> categoryIds);
 
     void deleteLotCategoryRelation(@Param("lotId") Long lotId);

+ 9 - 6
lot/src/main/java/cn/hobbystocks/auc/service/impl/LotServiceImpl.java

@@ -381,16 +381,19 @@ public class LotServiceImpl extends ServiceImpl<LotMapper,Lot> implements ILotSe
     }
 
     private void saveLotCategoryRelation(Lot lot) {
-        List<Long> categoryIds = new ArrayList<>();
+        List<String> names = new ArrayList<>();
         if (StringUtils.isNotEmpty(lot.getCategory())) {
-            categoryIds.add(Long.parseLong(lot.getCategory()));
+            names.add(lot.getCategory());
         }
         if (StringUtils.isNotEmpty(lot.getSubCategory())) {
-            categoryIds.add(Long.parseLong(lot.getSubCategory()));
+            names.add(lot.getSubCategory());
         }
-        if (!categoryIds.isEmpty()) {
-            spuCategoryMapper.deleteLotCategoryRelation(lot.getId());
-            spuCategoryMapper.insertLotCategoryRelation(lot.getId(), categoryIds);
+        if (!names.isEmpty()) {
+            List<Long> categoryIds = spuCategoryMapper.selectCategoryIdsByNames(names);
+            if (!CollectionUtils.isEmpty(categoryIds)) {
+                spuCategoryMapper.deleteLotCategoryRelation(lot.getId());
+                spuCategoryMapper.insertLotCategoryRelation(lot.getId(), categoryIds);
+            }
         }
     }
 

+ 9 - 0
lot/src/main/resources/mapper/SpuCategoryMapper.xml

@@ -88,6 +88,15 @@
         </foreach>
     </insert>
 
+    <select id="selectCategoryIdsByNames" resultType="java.lang.Long">
+        SELECT id FROM spu_category
+        WHERE category_name IN
+        <foreach collection="names" item="name" open="(" separator="," close=")">
+            #{name}
+        </foreach>
+        AND del_flag = 0 AND status = 1
+    </select>
+
 
     <insert id="createCategory" parameterType="cn.hobbystocks.auc.domain.SpuCategory">
         insert into spu_category (category_name,is_cascade,sub_label,sort,parent_id,icon_url,status,create_time,update_time)