Browse Source

车票增加分类ids字段

zoujiajian 11 months ago
parent
commit
dff8cab89a

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/mapper/GoodsDonCategoryRelateMapper.java

@@ -18,4 +18,6 @@ public interface GoodsDonCategoryRelateMapper extends BaseMapper<GoodsDonCategor
 	List<GoodsDonCategory> getCateGoryViewByGoodsId(Long goodsId);
 
 	void saveBatchGoodsRelate(@Param("goodsId") Long goodsId, @Param("list") List<Long> categoryList);
+
+	List<Long> selectCategoryIdsByGid(Long goodsId);
 }

+ 6 - 0
netflix-dao/src/main/java/com/cyksj/model/views/RenewalView.java

@@ -345,6 +345,12 @@ public class RenewalView {
     @DbField("a.act_code")
     private String actCode;
 
+    /**
+     * 分类id
+     */
+    @DbIgnore
+    private List<Long> categoryIdList;
+
     /**
      * mj 套餐包最低单价
      */

+ 4 - 0
netflix-dao/src/main/resources/mapper/GoodsDonCategoryRelateMapper.xml

@@ -16,4 +16,8 @@
         select gc.* from goods_don_category gc left join goods_don_category_relate gcr on gcr.category = gc.id
         where gcr.goods_id = #{goodsId}
     </select>
+
+    <select id="selectCategoryIdsByGid" resultType="java.lang.Long">
+        select distinct category from goods_don_category_relate where goods_id = #{goodsId}
+    </select>
 </mapper>

+ 4 - 0
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -207,6 +207,8 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 
 	private final ClaudeCodeUserRenewExpiryRecordMapper claudeCodeUserRenewExpiryRecordMapper;
 
+	private final GoodsDonCategoryRelateMapper goodsDonCategoryRelateMapper;
+
 	private final ClaudeCodeService claudeCodeService;
 
 	@Override
@@ -295,6 +297,8 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				if (ticket.getSkuNum() > 1) {
 					ticket.setIsMulti(true);
 				}
+				//分类ids
+				ticket.setCategoryIdList(goodsDonCategoryRelateMapper.selectCategoryIdsByGid(ticket.getGoodsId()));
 				//chatGPT直连
 				if (ticket.getGoodsId().equals(42l)) {
 					if (StrUtil.isNotBlank(ticket.getAccount())) {