Переглянути джерело

fixed 商品分配店铺bug

fushengqian 6 місяців тому
батько
коміт
1e8b8db0f1

+ 1 - 1
fuint-application/src/main/java/com/fuint/common/service/impl/GoodsServiceImpl.java

@@ -110,7 +110,7 @@ public class GoodsServiceImpl extends ServiceImpl<MtGoodsMapper, MtGoods> implem
         if (StringUtils.isNotBlank(storeId)) {
             lambdaQueryWrapper.eq(MtGoods::getStoreId, storeId)
                                .or(qw -> qw.eq(MtGoods::getStoreId, 0)
-                               .inSql(MtGoods::getId, "SELECT s.goods_id FROM mt_store_goods s WHERE s.store_id = "+ storeId +""));
+                               .inSql(MtGoods::getId, "SELECT s.goods_id FROM mt_store_goods s WHERE s.store_id = "+ storeId +" and s.status='A'"));
         }
         String type = paginationRequest.getSearchParams().get("type") == null ? "" : paginationRequest.getSearchParams().get("type").toString();
         if (StringUtils.isNotBlank(type)) {

+ 3 - 3
fuint-repository/src/main/resources/mapper/MtGoodsMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fuint.repository.mapper.MtGoodsMapper">
     <select id="getStoreGoodsList" resultType="com.fuint.repository.model.MtGoods">
-        select * from mt_goods t where (t.STORE_ID = #{storeId} or (t.STORE_ID = 0 AND t.id IN( SELECT s.GOODS_ID FROM mt_store_goods s WHERE STORE_ID = #{storeId} )))
+        select * from mt_goods t where (t.STORE_ID = #{storeId} or (t.STORE_ID = 0 AND t.id IN( SELECT s.GOODS_ID FROM mt_store_goods s WHERE s.STORE_ID = #{storeId} AND s.STATUS = 'A')))
         <if test="cateId != null and cateId > 0">
             AND t.CATE_ID = #{cateId}
         </if>
@@ -17,7 +17,7 @@
             AND t.MERCHANT_ID = #{merchantId}
         </if>
         <if test="storeId != null and storeId > 0">
-            and (t.STORE_ID = #{storeId} or (t.STORE_ID = 0 AND t.id IN( SELECT s.GOODS_ID FROM mt_store_goods s WHERE STORE_ID = #{storeId} )))
+            and (t.STORE_ID = #{storeId} or (t.STORE_ID = 0 AND t.id IN( SELECT s.GOODS_ID FROM mt_store_goods s WHERE s.STORE_ID = #{storeId} AND s.STATUS = 'A' )))
         </if>
         and t.PRICE > 0
         and (t.name like concat('%',#{keyword},'%') or t.goods_no = #{keyword} or t.ID = #{keyword} or t.description like concat('%',#{keyword},'%'))
@@ -42,7 +42,7 @@
             AND g.MERCHANT_ID = #{merchantId}
         </if>
         <if test="storeId != null and storeId > 0">
-            AND (g.STORE_ID = #{storeId} OR (g.STORE_ID = 0 AND g.id IN( SELECT s.GOODS_ID FROM mt_store_goods s WHERE STORE_ID = #{storeId} )))
+            AND (g.STORE_ID = #{storeId} OR (g.STORE_ID = 0 AND g.id IN( SELECT s.GOODS_ID FROM mt_store_goods s WHERE s.STORE_ID = #{storeId} AND s.STATUS = 'A')))
         </if>
         <if test="cateId != null and cateId > 0">
             AND g.CATE_ID = #{cateId}