From b02836d6cdcc2092eb6a864f52c90379e4d171b9 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Thu, 25 Mar 2021 11:28:46 +0800
Subject: [PATCH] Merge branch 'score_shop' of http://120.27.238.55:7000/r/beauty-erp into score_shop

---
 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml                 |   12 ++++++
 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java |    2 +
 zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html      |   48 ++++++++++-------------
 3 files changed, 35 insertions(+), 27 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java
index 164c641..4f0b0d9 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java
@@ -168,6 +168,8 @@
         loginUser = bizUserDao.selectById(loginUser.getUserId());
         if(loginUser.getIsSales()==1){
             return AjaxResult.buildSuccessInstance("只有非分销员才能被绑定成客户");
+        }if (StringUtils.isNotBlank(loginUser.getParentOpenId())){
+            return AjaxResult.buildSuccessInstance("已经被绑定");
         }else{
             if (StringUtils.isBlank(loginUser.getParentOpenId())) {
                 Map<String, Object> updateParam = new HashMap<>();
diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml
index 7d6030d..13a8e2e 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml
@@ -22,6 +22,7 @@
         <result property="sealCount" column="seal_count"/>
         <result property="stockCode" column="stock_code"/>
         <result property="shopId" column="shop_id"/>
+        <result property="selfPrice" column="self_price"/>
         <result property="sealesPrice" column="seales_price"/>
         <result property="invitationPrice" column="invitation_price"/>
         <result property="scorePrice" column="score_price"/>
@@ -50,6 +51,7 @@
         <result property="sealCount" column="seal_count"/>
         <result property="stockCode" column="stock_code"/>
         <result property="shopId" column="shop_id"/>
+        <result property="selfPrice" column="self_price"/>
         <result property="sealesPrice" column="seales_price"/>
         <result property="invitationPrice" column="invitation_price"/>
         <result property="scorePrice" column="score_price"/>
@@ -75,6 +77,7 @@
 			seal_count,
 			stock_code,
 			shop_id,
+self_price,
 seales_price,
 invitation_price,
         score_price,
@@ -102,6 +105,7 @@
 			#{item.sealCount},
 			#{item.stockCode},
 			#{item.shopId},
+			#{item.selfPrice},
 			#{item.sealesPrice},
 			#{item.invitationPrice},
 			#{item.scorePrice},
@@ -234,6 +238,10 @@
                 score_count = #{scoreCount},
             </if>
 
+            <if test="_parameter.containsKey('selfPrice')">
+                self_price = #{selfPrice},
+            </if>
+
 
         </set>
         WHERE id=#{id}
@@ -293,6 +301,10 @@
                 score_count = #{record.scoreCount},
             </if>
 
+            <if test="record.selfPrice != null ">
+                self_price = #{record.selfPrice},
+            </if>
+
 
         </set>
         WHERE id=#{record.id}
diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html b/zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html
index fe12dac..d8ed383 100644
--- a/zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html
+++ b/zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html
@@ -221,6 +221,7 @@
                                     <th>消费可得积分</th>
                                     <th>关联ERP产品</th>
                                     <th>排序</th>
+                                    <th>自购返佣</th>
                                     <th>推广提成</th>
                                     <th>邀请提成</th>
                                     <th>兑换所需金额</th>
@@ -353,6 +354,7 @@
         <input autocomplete="off"   type="hidden" class="form-control" name="erpGoodsCode">
     </div></td>
     <td><input autocomplete="off"   type="text" class="form-control" name=""></td>
+        <td><input autocomplete="off"   type="text" class="form-control" name=""></td>
         <td><input autocomplete="off"   type="text" class="form-control" name=""></td>
         <td><input autocomplete="off"   type="text" class="form-control" name=""></td>
         <td><input autocomplete="off"   type="text" class="form-control" name=""></td>
@@ -528,7 +530,10 @@
             if (goodsName == null || typeof stockCode == 'undefined') {
                 goodsName = "";
             }
-
+            var selfPrice = shopSkus[c].selfPrice;
+            if (selfPrice == null || typeof selfPrice == 'undefined') {
+                selfPrice = "";
+            }
             var sealesPrice = shopSkus[c].sealesPrice;
             if (sealesPrice == null || typeof sealesPrice == 'undefined') {
                 sealesPrice = "";
@@ -559,6 +564,7 @@
                 +'<td><div id="erpNoDiv"><button class="btn btn-info" onclick="selectProduct(\'shopIdValue\',\''+trId+'\')"><i class="fa fa-plus"></i></button>'
                 +'<p class="form-control-static erpGoodsName">'+ goodsName +'</p><input autocomplete="off" class="form-control" type="hidden"  value="'+stockCode+'" name="erpGoodsCode"></div></td>'
                 +'<td><input autocomplete="off"   type="text" class="form-control"  value="'+sort+'" name=""></td>'
+                +'<td><input autocomplete="off"   type="text" class="form-control"  value="'+selfPrice+'" name=""></td>'
                 +'<td><input autocomplete="off"   type="text" class="form-control"  value="'+sealesPrice+'" name=""></td>'
                 +'<td><input autocomplete="off"   type="text" class="form-control"  value="'+invitationPrice+'" name=""></td>'
                 +'<td><input autocomplete="off"   type="text" class="form-control"  value="'+scorePrice+'" name=""></td>'
@@ -745,61 +751,63 @@
             if (i != 0) {
                 var tds = $(this).find("td");
                 var length = tds.length - 1;
-                var id = tds.eq(length - 12).find("input").val();
+                var id = tds.eq(length - 13).find("input").val();
                 if(id == null){
                     id ="";
                 }
                 sku.id = id;
 
                 //规格名称
-                var name = tds.eq(length - 11).find("input").val();
+                var name = tds.eq(length - 12).find("input").val();
                 if(name == null){
                     name = "";
                 }
                 sku.name = name;
 
                 //图片地址
-                var path = tds.eq(length - 10).find("img").attr("src");
+                var path = tds.eq(length - 11).find("img").attr("src");
                 if(path == null){
                     path = "";
                 }
                 sku.imgPath = path;
 
                 //库存
-                var stock = tds.eq(length - 9).find("input").val();
+                var stock = tds.eq(length - 10).find("input").val();
                 if(stock == ""){
                     stock = 0;
                 }
                 sku.stock = stock;
 
                 //价格
-                var price = tds.eq(length -8).find("input").val();
+                var price = tds.eq(length -9).find("input").val();
                 if(price == ""){
                     price =0;
                 }
                 sku.price = price;
 
                 //积分
-                var score = tds.eq(length - 7).find("input").val();
+                var score = tds.eq(length - 8).find("input").val();
                 if(score == ""){
                     score = 0;
                 }
                 sku.score = score;
 
                 //品种编码
-                var stockCode = tds.eq(length - 6).find("input").val();
+                var stockCode = tds.eq(length - 7).find("input").val();
                 if(stockCode == null || typeof stockCode == 'undefined'){
                     stockCode = '';
                 }
                 sku.stockCode = stockCode;
 
                 //排序
-                var sort = tds.eq(length - 5).find("input").val();
+                var sort = tds.eq(length - 6).find("input").val();
                 if(sort == ""){
                     sort = 0;
                 }
                 sku.sort = sort;
-
+                //推广提成
+                var selfPrice = tds.eq(length - 5).find("input").val();
+                sku.selfPrice = selfPrice;
                 //推广提成
                 var sealesPrice = tds.eq(length - 4).find("input").val();
                 sku.sealesPrice = sealesPrice;
@@ -838,20 +846,6 @@
                 var tds = $(this).find("td");
                 var length = tds.length - 1;
 
-                if(ableSales==1){
-                    //推广提成
-                    var sealesPrice = tds.eq(length - 4).find("input").val();
-                    //邀请提成
-                    var invitationPrice = tds.eq(length - 3).find("input").val();
-                    if(sealesPrice == ""||invitationPrice==""){
-                        layer.msg("请填写推广提成和邀请提成",{
-                            icon : 2,
-                            time : 2000
-                        });
-                        flag = true;
-                        return false;
-                    }
-                }
 
                 if(ableScorePay==1){
                     //兑换所需金额
@@ -868,7 +862,7 @@
                     }
                 }
 
-                var name = tds.eq(length - 11).find("input").val();
+                var name = tds.eq(length - 12).find("input").val();
                 if(name == ""){
                     layer.msg("请填写规格名称",{
                         icon : 2,
@@ -886,7 +880,7 @@
                     return false;
                 }
 
-                var stock = tds.eq(length -9).find("input").val();
+                var stock = tds.eq(length -10).find("input").val();
                 if(stock == ""){
                     layer.msg("请填写库存",{
                         icon : 2,
@@ -895,7 +889,7 @@
                     flag = true;
                     return false;
                 }
-                var price = tds.eq(length - 8 ).find("input").val();
+                var price = tds.eq(length - 9 ).find("input").val();
                 if(price == ""){
                     layer.msg("请填写价格",{
                         icon : 2,

--
Gitblit v1.9.1