ソースを参照

所有商品信息显示plu,英文名称;收银端页面增加可用库存显示

hhq 4 年 前
コミット
8f711f775a

+ 0 - 2
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java

@@ -4,7 +4,6 @@ import com.kmall.admin.dto.GoodsDetailsDto;
 import com.kmall.admin.dto.GoodsDto;
 import com.kmall.admin.entity.GoodsEntity;
 import com.kmall.admin.entity.GoodsGalleryEntity;
-import com.kmall.admin.entity.StoreEntity;
 import com.kmall.admin.service.GoodsGalleryService;
 import com.kmall.admin.service.GoodsService;
 import com.kmall.admin.service.OfflineCartService;
@@ -16,7 +15,6 @@ import com.kmall.common.constant.JxlsXmlTemplateName;
 import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.common.utils.*;
 import com.kmall.common.utils.excel.ExcelUtil;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;

+ 10 - 0
kmall-admin/src/main/java/com/kmall/admin/dto/GoodsDetailsDto.java

@@ -36,6 +36,16 @@ public class GoodsDetailsDto {
     private String specification;
     //商品主图
     private String primaryPicUrl;
+    //门店商品库存
+    private String stockNum;
+
+    public String getStockNum() {
+        return stockNum;
+    }
+
+    public void setStockNum(String stockNum) {
+        this.stockNum = stockNum;
+    }
 
     public String getGoodsSn() {
         return goodsSn;

+ 22 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/GoodsEntity.java

@@ -202,6 +202,28 @@ public class GoodsEntity implements Serializable {
      */
     private String isGoodsShareStock;
 
+    // PLU
+    private String plu;
+
+    // 英文名称
+    private String englishName;
+
+    public String getPlu() {
+        return plu;
+    }
+
+    public void setPlu(String plu) {
+        this.plu = plu;
+    }
+
+    public String getEnglishName() {
+        return englishName;
+    }
+
+    public void setEnglishName(String englishName) {
+        this.englishName = englishName;
+    }
+
     public String getIsGoodsShareStock() {
         return isGoodsShareStock;
     }

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

@@ -119,6 +119,9 @@ public class GoodsServiceImpl implements GoodsService {
         builder.put("goodsDesc", "商品描述");
         builder.put("isOnSale", "上架");
         builder.put("isHot", "热销");
+        builder.put("englishName", "商品英文名称");
+        builder.put("plu", "PLU");
+
 
         R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
         if (Integer.valueOf(r.get("code").toString()) != 0) {

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

@@ -227,7 +227,7 @@
 
     <select id="queryGoodsDetailsByProdBarcode" resultType="com.kmall.admin.dto.GoodsDetailsDto">
         SELECT distinct
-        a.goods_sn as GoodsSn,m.retail_price as retailPrice,a.prod_barcode as prodBarcode,a.name,a.brand,a.goods_desc as goodsDesc,a.goods_unit as goodsUnit,a.goods_rate as goodsRate,a.primary_pic_url ,r.value as specification
+        a.goods_sn as GoodsSn,m.retail_price as retailPrice,a.prod_barcode as prodBarcode,a.name,a.brand,a.goods_desc as goodsDesc,a.goods_unit as goodsUnit,a.goods_rate as goodsRate,a.primary_pic_url ,m.stock_num as stockNum,r.value as specification
         FROM
             mall_goods a
         LEFT JOIN mall_goods_specification r ON r.goods_id = a.id
@@ -278,6 +278,9 @@
         <if test="name != null and name != ''">
             AND mall_goods.name LIKE concat('%',#{name},'%')
         </if>
+        <if test="englishName != null and englishName != ''">
+            AND mall_goods.english_name LIKE concat('%',#{englishName},'%')
+        </if>
         <!--<if test="brandId != null and brandId != ''">
             AND mall_goods.brand_id = #{brandId}
         </if>
@@ -296,6 +299,9 @@
         <if test="sku != null and sku != ''">
             AND mall_goods.sku LIKE concat('%',#{sku},'%')
         </if>
+        <if test="plu != null and plu != ''">
+            AND mall_goods.plu LIKE concat('%',#{plu},'%')
+        </if>
         <if test="isDelete != null">
             AND mall_goods.is_Delete = #{isDelete}
         </if>
@@ -434,6 +440,8 @@
 			`goods_sn`,
 			`prod_barcode`,
 			`sku`,
+			`plu`,
+			`english_name`,
 			`goods_biz_type`,
 			`name`,
 			`unit_code`,
@@ -482,6 +490,8 @@
 			#{goodsSn},
 			#{prodBarcode},
 			#{sku},
+			#{plu},
+			#{englishName},
 			#{goodsBizType},
 			#{name},
 			#{unitCode},
@@ -534,6 +544,8 @@
             <if test="goodsSn != null">`goods_sn` = #{goodsSn},</if>
             <if test="prodBarcode != null">`prod_barcode` = #{prodBarcode},</if>
             <if test="sku != null">`sku` = #{sku},</if>
+            <if test="plu != null">`plu` = #{plu},</if>
+            <if test="englishName != null">`english_name` = #{englishName},</if>
             <if test="goodsBizType != null">`goods_biz_type` = #{goodsBizType},</if>
             <if test="name != null">`name` = #{name},</if>
             <if test="unitCode != null">`unit_code` = #{unitCode},</if>

+ 4 - 3
kmall-admin/src/main/webapp/WEB-INF/page/sale/sale.html

@@ -61,11 +61,12 @@
                     <li style="margin-top: 50px;" >
                         <div v-show="goodsDetail" style="font-size: 1.2em">
                             <img style="height: 400px;width: 400px;" :src="goods.primaryPicUrl" class="img-rounded"/>
-                            <h3 style="margin: 8px;">{{goods.name}}</h3>
-                            <p style="margin: 8px;">单价: {{goods.retailPrice}}</p>
+                            <h1 style="margin: 8px;"><strong>{{goods.name}}</strong></h1>
+                            <p style="margin: 8px;">单价: <strong>{{goods.retailPrice}}</strong> /元</p>
                             <p style="margin: 8px;">规格: {{goods.specification}}</p>
                             <p style="margin: 8px;">条形码: {{goods.prodBarcode}}</p>
-                            <span style="margin: 8px;">商品描述: {{goods.goodsDesc}}</span>
+                            <!--<span style="margin: 8px;">商品描述: {{goods.goodsDesc}}</span>-->
+                            <span style="margin: 8px;">门店库存: {{goods.stockNum}}</span>
                         </div>
                         <div v-show="!goodsDetail">
                             <h3 style="text-align: center">请扫描商品</h3>

+ 12 - 0
kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html

@@ -86,6 +86,12 @@
                     <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
                 </i-col>
                 <i-col span="3">
+                    <i-input v-model="q.englishName" @on-enter="query" placeholder="英文名称"/>
+                </i-col>
+                <!--<i-col span="3">-->
+                <!--<i-input v-model="q.plu" @on-enter="query" placeholder="PLU"/>-->
+                <!--</i-col>-->
+                <i-col span="3">
                     <i-select v-model="q.goodsBizType" placeholder="货品业务类型"
                               label-in-value>
                         <i-option v-for="macro in macros" :value="macro.value" :key="macro.id">{{macro.name}}
@@ -199,6 +205,12 @@
                     <Form-item label="名称" prop="name">
                         <i-input v-model="goods.name" placeholder="名称"/>
                     </Form-item>
+                    <Form-item label="英文名称" prop="englishName">
+                        <i-input v-model="goods.englishName" placeholder="名称"/>
+                    </Form-item>
+                    <Form-item label="PLU" prop="plu">
+                        <i-input v-model="goods.plu" placeholder="名称"/>
+                    </Form-item>
                     <Form-item label="商品单位" prop="goodsUnit">
                         <i-input v-model="goods.goodsUnit" placeholder="商品单位" style="width: 268px;"/>
                     </Form-item>

+ 1 - 0
kmall-admin/src/main/webapp/js/sale/sale.js

@@ -61,6 +61,7 @@ let vm = new Vue({
                     thisGoods.retailPrice = r.goodsDetails.retailPrice;
                     thisGoods.specification = r.goodsDetails.specification;
                     thisGoods.prodBarcode = r.goodsDetails.prodBarcode;
+                    thisGoods.stockNum = r.goodsDetails.stockNum;
                    //  thisGoods.goodsDesc = r.goodsDetails.goodsDesc;
                     thisGoods.sellVolume = 1;
 

+ 4 - 0
kmall-admin/src/main/webapp/js/shop/goods.js

@@ -8,6 +8,8 @@ $(function () {
             {label: '第三方商户编号', name: 'thirdPartyMerchCode', index: 'thirdPartyMerchCode', width: 160, align: 'center'},
             {label: '商品编码', name: 'goodsSn', index: 'goods_Sn', width: 180, align: 'center'},
             {label: 'SKU', name: 'sku', index: 'sku', width: 180, align: 'center'},
+            {label: 'PLU', name: 'plu', index: 'plu', width: 180, align: 'center'},
+            {label: '英文名称', name: 'englishName', index: 'englishName', width: 180, align: 'center'},
             {label: '产品条码', name: 'prodBarcode', index: 'prod_barcode', width: 160, align: 'center'},
             // {label: '商品类型', name: 'categoryName', index: 'category_id', width: 40, align: 'center'},
             {label: '名称', name: 'name', index: 'name', width: 500, align: 'left'},
@@ -459,6 +461,8 @@ var vm = new Vue({
             $("#jqGrid").jqGrid('setGridParam', {
                 postData: {
                     'name': vm.q.name,
+                    'englishName': vm.q.englishName,
+                    // 'plu': vm.q.plu,
                     'goodsSn': vm.q.goodsSn,
                     'prodBarcode': vm.q.prodBarcode,
                     'goodsBizType': vm.q.goodsBizType,

+ 0 - 0
kmall-admin/src/main/webapp/statics/img/logotest2.png → kmall-admin/src/main/webapp/statics/img/logotest2.jpg