Prechádzať zdrojové kódy

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

hr~ 1 mesiac pred
rodič
commit
7961ca8a2e

+ 1 - 0
lot/src/main/java/cn/hobbystocks/auc/domain/LotFans.java

@@ -62,5 +62,6 @@ public class LotFans {
     /** 更新时间 */
     private LocalDateTime updateTime;
 
+    private Integer delFlag;
 
 }

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

@@ -20,4 +20,8 @@ public interface SpuCategoryMapper {
     List<Long> listChildByParentId(@Param("mainCategoryId") Long mainCategoryId);
 
     List<Long> listLotIdsByCategoryIds(@Param("categoryIds") List<Long> categoryIds);
+
+    void insertLotCategoryRelation(@Param("lotId") Long lotId, @Param("categoryIds") List<Long> categoryIds);
+
+    void deleteLotCategoryRelation(@Param("lotId") Long lotId);
 }

+ 20 - 4
lot/src/main/java/cn/hobbystocks/auc/service/impl/LotServiceImpl.java

@@ -375,9 +375,25 @@ public class LotServiceImpl extends ServiceImpl<LotMapper,Lot> implements ILotSe
                 lotMapper.updateLot(lot);
             }
             redisCache.setCacheMapValue(String.format(Constants.REDIS_MAP_AUC_LOT_TEMPLATE, lot.getAuctionId()), lot.getId().toString(), liveContext.getLive());
+            // 保存拍品分类关联
+            saveLotCategoryRelation(lot);
             }, true);
     }
 
+    private void saveLotCategoryRelation(Lot lot) {
+        List<Long> categoryIds = new ArrayList<>();
+        if (StringUtils.isNotEmpty(lot.getCategory())) {
+            categoryIds.add(Long.parseLong(lot.getCategory()));
+        }
+        if (StringUtils.isNotEmpty(lot.getSubCategory())) {
+            categoryIds.add(Long.parseLong(lot.getSubCategory()));
+        }
+        if (!categoryIds.isEmpty()) {
+            spuCategoryMapper.deleteLotCategoryRelation(lot.getId());
+            spuCategoryMapper.insertLotCategoryRelation(lot.getId(), categoryIds);
+        }
+    }
+
     @Override
     @Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
     public void pubLots(Auction auction) {
@@ -967,11 +983,11 @@ public class LotServiceImpl extends ServiceImpl<LotMapper,Lot> implements ILotSe
         }
 
         Long favoriteCount = lotFansMapper.selectCount(new LambdaQueryWrapper<LotFans>()
-                .eq(LotFans::getLotId, lot.getId())
-                .eq(LotFans::getUserId, userInfo.getId().longValue())
-                .eq(LotFans::getType, "user_like"));
+            .eq(LotFans::getLotId, lot.getId())
+            .eq(LotFans::getDelFlag, 0)
+            .eq(LotFans::getUserId, userInfo.getId().longValue())
+            .eq(LotFans::getType, "user_like"));
         response.setIsFans(favoriteCount > 0);
-
         LambdaQueryWrapper<DepositOrder> depositQuery = new LambdaQueryWrapper<DepositOrder>()
                 .eq(DepositOrder::getUserId, userInfo.getId())
                 .in(DepositOrder::getStatus,  1);

+ 11 - 1
lot/src/main/resources/mapper/SpuCategoryMapper.xml

@@ -74,9 +74,19 @@
             </foreach>
             AND del_flag = 0
         </where>
+    </select>
 
+    <delete id="deleteLotCategoryRelation">
+        DELETE FROM lot_category_relation WHERE lot_id = #{lotId}
+    </delete>
 
-    </select>
+    <insert id="insertLotCategoryRelation">
+        INSERT INTO lot_category_relation (lot_id, category_id, del_flag)
+        VALUES
+        <foreach collection="categoryIds" item="categoryId" separator=",">
+            (#{lotId}, #{categoryId}, 0)
+        </foreach>
+    </insert>
 
 
     <insert id="createCategory" parameterType="cn.hobbystocks.auc.domain.SpuCategory">