Browse Source

Merge branch 'master' of hyq/kmall-pt into master

黄亚琴 6 years ago
parent
commit
6d23eb67ea

+ 12 - 12
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java

@@ -332,19 +332,19 @@ public class GoodsServiceImpl implements GoodsService {
                         productStoreRela.setMarketPrice(goods.getMarketPrice());
                     }
                     productStoreRelaDao.update(productStoreRela);
-                }
-                if(!productStoreRela.getMerchSn().equalsIgnoreCase(goods.getMerchSn())
-                        && goods.getIsOnSale() == Integer.parseInt(Dict.isOnSale.item_0.getItem())) {
-                    if (goods.getRetailPrice() != null) {
-                        productStoreRela.setRetailPrice(goods.getRetailPrice());
-                    }
-                    if (goods.getMarketPrice() != null) {
-                        productStoreRela.setMarketPrice(goods.getMarketPrice());
+                }else {
+                    if (goods.getIsOnSale() == Integer.parseInt(Dict.isOnSale.item_0.getItem())) {
+                        if (goods.getRetailPrice() != null) {
+                            productStoreRela.setRetailPrice(goods.getRetailPrice());
+                        }
+                        if (goods.getMarketPrice() != null) {
+                            productStoreRela.setMarketPrice(goods.getMarketPrice());
+                        }
+                        productStoreRela.setMerchSn("");
+                        productStoreRelaDao.update(productStoreRela);
+                    } else {
+                        throw new RRException("商品编码为【" + goods.getGoodsSn() + "】的商品已上架在商户编号为【" + productStoreRela.getMerchSn() + "】的门店中,可先将该商品下架后再进行修改!");
                     }
-                    productStoreRela.setMerchSn("");
-                    productStoreRelaDao.update(productStoreRela);
-                }else{
-                    throw new RRException("商品编码为【"+goods.getGoodsSn()+"】的商品已上架在商户编号为【"+productStoreRela.getMerchSn()+"】的门店中,可先将该商品下架后再进行修改!");
                 }
             }
         }

+ 1 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiFootprintMapper.xml

@@ -32,7 +32,7 @@
             and max.add_time > f.add_time
         </if>
         left join mall_goods g on f.goods_id = g.id
-        LEFT JOIN mall_product_store_rela psr ON psr.goods_id = g.id
+        LEFT JOIN mall_product_store_rela psr ON psr.goods_id = g.id and g.merch_sn = psr.merch_sn
         <where>
             1=1 and psr.stock_num >0  and g.is_delete = 0 and g.is_on_sale = 1
             <if test="user_id != null">