Browse Source

首页显示优化以及导入优化

qng 3 years ago
parent
commit
c5c57743e0

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/dao/GoodsDao.java

@@ -30,7 +30,7 @@ public interface GoodsDao extends BaseDao<GoodsEntity> {
 
     GoodsEntity queryObjectByStoreId(@Param("id") Long id, @Param("storeId") Long storeId);
 
-    GoodsEntity queryGoodsByGoodsSnAndStoreId(@Param("goodsSn") String goodsSn, @Param("storeId") Long storeId);
+    GoodsEntity queryGoodsByGoodsSnAndStoreId(@Param("goodsSn") String goodsSn);
 
     GoodsEntity queryByBarcode(String barCode);
 

+ 25 - 20
kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java

@@ -565,7 +565,7 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
                     if(merchEntity != null){
                         storeRelaEntity.setMerchName(merchEntity.getMerchName());
                     }
-                    goodsEntity = goodsDao.queryGoodsByGoodsSnAndStoreId(storeGoodsDto.getGoodsSn(), store.getId());
+                    goodsEntity = goodsDao.queryGoodsByGoodsSnAndStoreId(storeGoodsDto.getGoodsSn());
                     if(goodsEntity == null){//商品不存在
                         isFail = true;
                         failGoodsSnList.add(storeGoodsDto.getStoreName());
@@ -604,9 +604,9 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
                             throw new RRException("该商品主图不能为空!请先在商品管理》所有商品中维护商品编号为【"+goodsEntity.getGoodsSn()+"】的商品主图信息,再来操作门店商品数据");
                         }
                         List<GoodsGalleryEntity> galleryEntityList = goodsGalleryDao.queryObjectByGoodId(goodsEntity.getId());
-                        if (galleryEntityList == null || galleryEntityList.size() <= 0) {
-                            throw new RRException("该商品轮播图不能为空!请先在商品管理》所有商品中维护商品编号为【"+goodsEntity.getGoodsSn()+"】的商品详情轮播图信息,再来操作门店商品数据");
-                        }
+//                        if (galleryEntityList == null || galleryEntityList.size() <= 0) {
+//                            throw new RRException("该商品轮播图不能为空!请先在商品管理》所有商品中维护商品编号为【"+goodsEntity.getGoodsSn()+"】的商品详情轮播图信息,再来操作门店商品数据");
+//                        }
 
                         if(goodsEntity.getIsSupplierGoods().equalsIgnoreCase(Dict.isSupplierGoods.item_1.getItem())) {
                             builder.put("supplierThirdCode", "商品供货商所属第三方商户");
@@ -633,20 +633,20 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
                         }else {
                             storeRelaEntity.setCategoryId(categoryEntity.getId());
                         }
-                        BrandEntity brandEntity = brandDao.queryBrandByBrandNameAndStoreId(storeGoodsDto.getBrandName(), store.getId());
-                        if(brandEntity == null){
-                            isFail = true;
-                            failBrandList.add(storeGoodsDto.getStoreName());
-                        }else {
-                            storeRelaEntity.setBrandId(brandEntity.getId());
-                        }
-                        FreightEntity freightEntity = freightDao.queryFreightByDefaultFreightAndStoreId(storeGoodsDto.getBrandName(), store.getId());
-                        if(freightEntity == null){
-                            isFail = true;
-                            failFreightList.add(storeGoodsDto.getStoreName());
-                        }else {
-                            storeRelaEntity.setFreightId(freightEntity.getId());
-                        }
+//                        BrandEntity brandEntity = brandDao.queryBrandByBrandNameAndStoreId(storeGoodsDto.getBrandName(), store.getId());
+//                        if(brandEntity == null){
+//                            isFail = true;
+//                            failBrandList.add(storeGoodsDto.getStoreName());
+//                        }else {
+//                            storeRelaEntity.setBrandId(brandEntity.getId());
+//                        }
+//                        FreightEntity freightEntity = freightDao.queryFreightByDefaultFreightAndStoreId(storeGoodsDto.getBrandName(), store.getId());
+//                        if(freightEntity == null){
+//                            isFail = true;
+//                            failFreightList.add(storeGoodsDto.getStoreName());
+//                        }else {
+//                            storeRelaEntity.setFreightId(freightEntity.getId());
+//                        }
 
                         //校验总库存
                         if(goodsEntity.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_00.getItem()) && isStockShare.equalsIgnoreCase(Dict.isStockShare.item_1.getItem())){
@@ -745,8 +745,10 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
                         storeRelaEntity.setProductId(product.getId());
 //                    storeRelaEntity.setGoodsBizType(goodsEntity.getGoodsBizType());
 //                    storeRelaEntity.setSku(goodsEntity.getSku());
-                        storeRelaEntity.setRetailPrice(BigDecimal.valueOf(Long.valueOf(storeGoodsDto.getRetailPrice())));
-                        storeRelaEntity.setMarketPrice(BigDecimal.valueOf(Long.valueOf(storeGoodsDto.getMarketPrice())));
+                        BigDecimal bigDecimal = new BigDecimal(storeGoodsDto.getRetailPrice());
+                        storeRelaEntity.setRetailPrice(bigDecimal);
+                        BigDecimal bigDecimal2 = new BigDecimal(storeGoodsDto.getMarketPrice());
+                        storeRelaEntity.setMarketPrice(bigDecimal2);
                         storeRelaEntity.setCreaterSn(user.getUserId().toString());
                         storeRelaEntity.setCreateTime(new Date());
                         storeRelaEntity.setModerSn(user.getUserId().toString());
@@ -757,6 +759,9 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
                     failHaveStoreNameList.add(storeGoodsDto.getStoreName());
                 }
 
+                storeRelaEntity.setStockNum(Integer.parseInt(storeGoodsDto.getStockNum()));
+                BigDecimal bigDecimal2 = new BigDecimal(storeGoodsDto.getMarketPrice());
+                storeRelaEntity.setStockPrice(bigDecimal2);
                 if(!isFail){
                     productStoreRelaDao.save(storeRelaEntity);
                 }

+ 1 - 0
kmall-admin/src/main/resources/mybatis/mapper/CategoryDao.xml

@@ -73,6 +73,7 @@
 		<if test="merchSn != null and merchSn.trim() != ''">
 			AND merch_sn = #{merchSn}
 		</if> and is_show = 1
+		limit 1
 	</select>
 
 	<select id="queryObjectByStoreId" resultType="com.kmall.admin.entity.CategoryEntity">

+ 70 - 13
kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml

@@ -70,6 +70,73 @@
 
     </resultMap>
 
+    <resultMap type="com.kmall.admin.entity.GoodsEntity" id="goodsMapNew">
+        <result property="id" column="id"/>
+        <result property="merchSn" column="merch_sn"/>
+        <!--<result property="categoryId" column="category_id"/>-->
+        <result property="goodsSn" column="goods_sn"/>
+        <result property="name" column="name"/>
+        <!--<result property="brandId" column="brand_id"/>-->
+        <!--<result property="freightId" column="freight_id"/>-->
+        <result property="brand" column="brand"/>
+        <result property="goodsNumber" column="goods_number"/>
+        <result property="keywords" column="keywords"/>
+        <result property="goodsBrief" column="goods_brief"/>
+        <result property="goodsDesc" column="goods_desc"/>
+        <result property="isOnSale" column="is_on_sale"/>
+        <result property="addTime" column="add_time"/>
+        <result property="sortOrder" column="sort_order"/>
+        <result property="isDelete" column="is_delete"/>
+        <!--<result property="attributeCategory" column="attribute_category"/>-->
+        <result property="counterPrice" column="counter_price"/>
+        <result property="extraPrice" column="extra_price"/>
+        <result property="isNew" column="is_new"/>
+        <result property="goodsUnit" column="goods_unit"/>
+        <result property="primaryPicUrl" column="primary_pic_url"/>
+        <result property="listPicUrl" column="list_pic_url"/>
+        <!--<result property="retailPrice" column="retail_price"/>-->
+<!--        <result property="sellVolume" column="sell_volume"/>-->
+        <result property="primaryProductId" column="primary_product_id"/>
+        <result property="unitPrice" column="unit_price"/>
+        <result property="promotionDesc" column="promotion_desc"/>
+        <result property="promotionTag" column="promotion_tag"/>
+        <result property="appExclusivePrice" column="app_exclusive_price"/>
+        <result property="isAppExclusive" column="is_app_exclusive"/>
+        <result property="isLimited" column="is_limited"/>
+        <result property="isHot" column="is_hot"/>
+        <!--<result property="marketPrice" column="market_price"/>-->
+        <result property="goodsType" column="goodsType"/>
+        <result property="sku" column="sku"/>
+        <result property="goodsBizType" column="goods_biz_type"/>
+        <result column="creater_sn" property="createrSn" jdbcType="VARCHAR"/>
+        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
+        <result column="moder_sn" property="moderSn" jdbcType="VARCHAR"/>
+        <result column="mod_time" property="modTime" jdbcType="TIMESTAMP"/>
+        <result column="tstm" property="tstm" jdbcType="TIMESTAMP"/>
+        <result property="prodBarcode" column="prod_barcode"/>
+        <result property="unitCode" column="unit_code"/>
+        <result property="goodsDesc" column="goods_desc"/>
+        <result property="cusGoodsCode" column="cus_goods_code"/>
+        <result property="ciqProdModel" column="ciq_prod_model"/>
+        <result property="oriCntCode" column="ori_cnt_code"/>
+        <result property="cusDeclEle" column="cus_decl_ele"/>
+        <result property="cusRecCode" column="cus_rec_code"/>
+        <result property="supplierId" column="supplier_id"/>
+<!--        <result property="stockNum" column="stock_num"/>-->
+        <result property="storeName" column="store_name"/>
+        <result property="productId" column="productId"/>
+        <result property="storeId" column="storeId"/>
+        <result column="merch_name" property="merchName"/>
+        <result column="storeMarketPrice" property="storeMarketPrice"/>
+        <result column="storeRetailPrice" property="storeRetailPrice"/>
+        <result column="third_party_merch_code" property="thirdPartyMerchCode"/>
+        <result column="isStockShare" property="isStockShare"/>
+        <result column="gross_weight" property="grossWeight"/>
+        <result column="net_weight" property="netWeight"/>
+        <result property="isGoodsShareStock" column="is_goods_share_stock"/>
+
+    </resultMap>
+
     <select id="queryObject" resultType="com.kmall.admin.entity.GoodsEntity">
         SELECT
             a.*, CASE
@@ -136,14 +203,12 @@
         where a.id = #{id} and psr1.store_id = #{storeId}
     </select>
 
-    <select id="queryGoodsByGoodsSnAndStoreId" resultMap="goodsMap">
+    <select id="queryGoodsByGoodsSnAndStoreId" resultMap="goodsMapNew">
         select
         a.sku,
         a.id,
-        psr1.category_id,
         a.goods_sn,
         a.name,
-        psr1.brand_id,
         a.goods_number,
         a.keywords,
         a.goods_brief,
@@ -151,15 +216,12 @@
         a.add_time,
         a.sort_order,
         a.is_delete,
-        psr1.attribute_category,
         a.counter_price,
         a.extra_price,
         a.is_new,
         a.goods_unit,
         a.primary_pic_url,
         a.list_pic_url,
-        psr1.retail_price,
-        psr1.sell_volume,
         a.primary_product_id,
         a.unit_price,
         a.promotion_desc,
@@ -170,9 +232,6 @@
         a.is_hot,
         a.merch_sn,
         m.merch_name,
-        psr1.store_id,
-        psr1.market_price,
-        psr1.stock_num,
         a.goods_desc,a.goods_biz_type,a.goods_rate,
         a.sell_volume goods_sell_volume,
         mb.third_party_merch_code,
@@ -181,11 +240,9 @@
         mb2.third_party_merch_code 'supplierThirdMerchCode',
         mb2.is_stock_share 'isStockShareBySuppler'
         from mall_goods a left join mall_merch m on a.merch_sn = m.merch_sn
-        LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id and a.merch_sn = psr1.merch_sn
-        LEFT JOIN mall_store s ON s.id = psr1.store_id
-        LEFT JOIN third_merchant_biz mb on s.third_party_merch_code = mb.third_party_merch_code
+        LEFT JOIN third_merchant_biz mb on mb.third_party_merch_code = a.third_party_merch_code
         LEFT JOIN third_merchant_biz mb2 ON a.third_party_merch_code = mb2.third_party_merch_code
-        where a.goods_sn = #{goodsSn} and psr1.store_id = #{storeId}
+        where a.goods_sn = #{goodsSn}
     </select>
 
     <select id="queryObjectByProdBarcodeAndBizType" resultType="com.kmall.admin.entity.GoodsEntity">

+ 0 - 3
kmall-api/src/main/resources/mybatis/mapper/ApiGoodsMapper.xml

@@ -372,9 +372,6 @@
                 order by a.id desc
             </otherwise>
         </choose>
-        <if test="offset != null and limit != null">
-            limit #{offset}, #{limit}
-        </if>
     </select>
 
     <select id="queryTotal" resultType="int">

+ 6 - 4
wx-mall/pages/index/index.wxss

@@ -263,12 +263,13 @@
 
 .a-section .b .right {
   float: left;
-  height: 264rpx;
-  width: 400rpx;
+  height: 250rpx;
+  width: 445rpx;
   display: flex;
   flex-flow: row nowrap;
 }
 
+
 .a-section .b .text {
   display: flex;
   flex-wrap: nowrap;
@@ -280,12 +281,13 @@
   margin-left:20rpx;
 }
 
+
 .a-section .b .name {
   /* width: 456rpx; */
   display: block;
   color: #333;
   line-height: 50rpx;
-  font-size: 35rpx;
+  font-size: 33rpx;
   /* font-weight: bolder; */
 }
 
@@ -308,7 +310,7 @@
 
 
 #directionp  {
-  margin-right: 9%;
+  margin-right: 5%;
    
 }