Memory_LG 3 週間 前
コミット
8483707c9a

+ 23 - 0
qmjszx-admin/src/main/java/beilv/web/controller/vipCard/VipCardController.java

@@ -6,6 +6,9 @@ import beilv.common.core.domain.AjaxResult;
 import beilv.common.core.page.TableDataInfo;
 import beilv.common.enums.BusinessType;
 import beilv.common.utils.poi.ExcelUtil;
+import beilv.shopping.domain.QmjsShoppingMall;
+import beilv.shopping.service.IQmjsShoppingMallService;
+import beilv.vipCard.domain.Exchange;
 import beilv.vipCard.domain.VipCard;
 import beilv.vipCard.service.IVipCardService;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -30,6 +33,9 @@ public class VipCardController extends BaseController {
     @Autowired
     private IVipCardService vipCardService;
 
+    @Autowired
+    private IQmjsShoppingMallService qmjsShoppingMallService;
+
     @RequiresPermissions("business:card:view")
     @GetMapping()
     public String card() {
@@ -123,4 +129,21 @@ public class VipCardController extends BaseController {
     public AjaxResult refund(VipCard vipCard){
         return toAjax(vipCardService.refundById(vipCard));
     }
+
+    @RequiresPermissions("business:card:edit")
+    @GetMapping("/exchange/{id}")
+    public String exchangeInfo(@PathVariable("id") String id, ModelMap mmap) {
+        VipCard vipCard = vipCardService.selectVipCardById(id);
+        mmap.put("vipCard", vipCard);
+        //productList  商品列表
+        mmap.put("productList", qmjsShoppingMallService.selectQmjsShoppingMallList(new QmjsShoppingMall()));
+        return prefix + "/exchange";
+    }
+
+    @RequiresPermissions("business:card:edit")
+    @PostMapping("/exchange")
+    @ResponseBody
+    public AjaxResult exchange(Exchange exchange) {
+        return vipCardService.exchange(exchange);
+    }
 }

+ 2 - 2
qmjszx-admin/src/main/resources/static/ruoyi/js/ry-ui.js

@@ -1164,7 +1164,7 @@ var table = {
                 return url;
             },
             // 兑换礼品
-            exchange: function(id) {
+            /*exchange: function(id) {
                 table.set();
                 if ($.common.isEmpty(id) && table.options.type == table_type.bootstrapTreeTable) {
                     var row = $("#" + table.options.id).bootstrapTreeTable('getSelections')[0];
@@ -1173,7 +1173,7 @@ var table = {
                 } else {
                     $.modal.open("兑换" + table.options.modalName, $.operate.changeUrl(id));
                 }
-            },
+            },*/
             // 兑换礼品访问地址
             changeUrl: function(id) {
                 var url = "/404.html";

+ 8 - 0
qmjszx-admin/src/main/resources/templates/system/mall/add.html

@@ -69,6 +69,14 @@
         </div>
         <div class="col-xs-12">
             <div class="form-group">
+                <label class="col-sm-3 control-label is-required">积分兑换:</label>
+                <div class="col-sm-8">
+                    <input name="goodsScore" class="form-control" type="text" required maxlength="15">
+                </div>
+            </div>
+        </div>
+        <div class="col-xs-12">
+            <div class="form-group">
                 <label class="col-sm-3 control-label">商品状态:</label>
                 <div class="col-sm-8">
                     <select name="goodsState" class="form-control" th:with="type=${@dict.getType('goods_state')}" disabled>

+ 8 - 0
qmjszx-admin/src/main/resources/templates/system/mall/edit.html

@@ -68,6 +68,14 @@
                 </div>
             </div>
         </div>
+        <div class="col-xs-12">
+            <div class="form-group">
+                <label class="col-sm-3 control-label is-required">积分兑换:</label>
+                <div class="col-sm-8">
+                    <input name="suggestionPrice" th:field="*{goodsScore}" class="form-control" type="text" maxlength="15" required>
+                </div>
+            </div>
+        </div>
 <!--        <div class="col-xs-12">-->
 <!--            <div class="form-group">-->
 <!--                <label class="col-sm-3 control-label">商品库存:</label>-->

+ 87 - 82
qmjszx-admin/src/main/resources/templates/system/mall/mall.html

@@ -1,66 +1,68 @@
 <!DOCTYPE html>
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <head>
-    <th:block th:include="include :: header('商城列表')" />
+    <th:block th:include="include :: header('商城列表')"/>
 </head>
 <body class="gray-bg">
-     <div class="container-div">
-        <div class="row">
-            <div class="col-sm-12 search-collapse">
-                <form id="formId">
-                    <div class="select-list">
-                        <ul>
-                            <li>
-                                <label>商品名称:</label>
-                                <input type="text" name="goodsName"/>
-                            </li>
-                            <li>
-                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
-                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
-                            </li>
-                        </ul>
-                    </div>
-                </form>
-            </div>
+<div class="container-div">
+    <div class="row">
+        <div class="col-sm-12 search-collapse">
+            <form id="formId">
+                <div class="select-list">
+                    <ul>
+                        <li>
+                            <label>商品名称:</label>
+                            <input type="text" name="goodsName"/>
+                        </li>
+                        <li>
+                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
+                                    class="fa fa-search"></i>&nbsp;搜索</a>
+                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
+                                    class="fa fa-refresh"></i>&nbsp;重置</a>
+                        </li>
+                    </ul>
+                </div>
+            </form>
+        </div>
 
-            <div class="btn-group-sm" id="toolbar" role="group">
-                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:mall:add">
-                    <i class="fa fa-plus"></i> 添加
-                </a>
-<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:mall:edit">-->
-<!--                    <i class="fa fa-edit"></i> 修改-->
-<!--                </a>-->
-<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:mall:remove">-->
-<!--                    <i class="fa fa-remove"></i> 删除-->
-<!--                </a>-->
-<!--                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:mall:export">-->
-<!--                    <i class="fa fa-download"></i> 导出-->
-<!--                </a>-->
-            </div>
-            <div class="col-sm-12 select-table table-striped">
-                <table id="bootstrap-table"></table>
-            </div>
+        <div class="btn-group-sm" id="toolbar" role="group">
+            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:mall:add">
+                <i class="fa fa-plus"></i> 添加
+            </a>
+            <!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:mall:edit">-->
+            <!--                    <i class="fa fa-edit"></i> 修改-->
+            <!--                </a>-->
+            <!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:mall:remove">-->
+            <!--                    <i class="fa fa-remove"></i> 删除-->
+            <!--                </a>-->
+            <!--                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:mall:export">-->
+            <!--                    <i class="fa fa-download"></i> 导出-->
+            <!--                </a>-->
+        </div>
+        <div class="col-sm-12 select-table table-striped">
+            <table id="bootstrap-table"></table>
         </div>
     </div>
-    <th:block th:include="include :: footer" />
-    <script th:inline="javascript">
-        var editFlag = [[${@permission.hasPermi('system:mall:edit')}]];
-        var removeFlag = [[${@permission.hasPermi('system:mall:remove')}]];
-        var goodsTypeDatas = [[${@dict.getType('goods_type')}]];
-        var goodsCurrentPriceDatas = [[${@dict.getType('sys_yes_no')}]];
-        var prefix = ctx + "system/mall";
+</div>
+<th:block th:include="include :: footer"/>
+<script th:inline="javascript">
+    var editFlag = [[${@permission.hasPermi('system:mall:edit')}]];
+    var removeFlag = [[${@permission.hasPermi('system:mall:remove')}]];
+    var goodsTypeDatas = [[${@dict.getType('goods_type')}]];
+    var goodsCurrentPriceDatas = [[${@dict.getType('sys_yes_no')}]];
+    var prefix = ctx + "system/mall";
 
-        $(function() {
-            var options = {
-                url: prefix + "/list",
-                createUrl: prefix + "/add",
-                updateUrl: prefix + "/edit/{id}",
-                removeUrl: prefix + "/remove",
-                exportUrl: prefix + "/export",
-                modalName: "商品",
-                columns: [{
-                    checkbox: true
-                },
+    $(function () {
+        var options = {
+            url: prefix + "/list",
+            createUrl: prefix + "/add",
+            updateUrl: prefix + "/edit/{id}",
+            removeUrl: prefix + "/remove",
+            exportUrl: prefix + "/export",
+            modalName: "商品",
+            columns: [{
+                checkbox: true
+            },
                 {
                     field: 'id',
                     title: '主键id',
@@ -73,8 +75,8 @@
                 {
                     field: 'goodsType',
                     title: '商品种类',
-                    formatter: function(value, row, index) {
-                       return $.table.selectDictLabel(goodsTypeDatas, value);
+                    formatter: function (value, row, index) {
+                        return $.table.selectDictLabel(goodsTypeDatas, value);
                     }
                 },
                 {
@@ -90,8 +92,8 @@
                 {
                     field: 'goodsCurrentPrice',
                     title: '时价商品',
-                    formatter: function(value, row, index) {
-                       return $.table.selectDictLabel(goodsCurrentPriceDatas, value);
+                    formatter: function (value, row, index) {
+                        return $.table.selectDictLabel(goodsCurrentPriceDatas, value);
                     }
                 },
                 {
@@ -102,6 +104,9 @@
                     field: 'suggestionPrice',
                     title: '建议售价',
                     visible: false
+                }, {
+                    field: 'goodsScore',
+                    title: '积分兑换',
                 },
                 {
                     visible: editFlag == 'hidden' ? false : true,
@@ -114,39 +119,39 @@
                 {
                     title: '操作',
                     align: 'center',
-                    formatter: function(value, row, index) {
+                    formatter: function (value, row, index) {
                         var actions = [];
                         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                         return actions.join('');
                     }
                 }]
-            };
-            $.table.init(options);
-        });
+        };
+        $.table.init(options);
+    });
 
-        /* 商品状态显示 */
-        function statusTools(row) {
-            if (row.goodsState == 2) {
-                return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.id + '\')"></i> ';
-            } else {
-                return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.id + '\')"></i> ';
-            }
+    /* 商品状态显示 */
+    function statusTools(row) {
+        if (row.goodsState == 2) {
+            return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.id + '\')"></i> ';
+        } else {
+            return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.id + '\')"></i> ';
         }
+    }
 
-        /* 商品状态-下架 */
-        function disable(id) {
-            $.modal.confirm("确认要下架商品吗?", function() {
-                $.operate.post(prefix + "/goodsStatus", { "id": id, "goodsState": 2 });
-            })
-        }
+    /* 商品状态-下架 */
+    function disable(id) {
+        $.modal.confirm("确认要下架商品吗?", function () {
+            $.operate.post(prefix + "/goodsStatus", {"id": id, "goodsState": 2});
+        })
+    }
 
-        /* 商品状态-下架 */
-        function enable(id) {
-            $.modal.confirm("确认要上架商品吗?", function() {
-                $.operate.post(prefix + "/goodsStatus", { "id": id, "goodsState": 1 });
-            })
-        }
-    </script>
+    /* 商品状态-下架 */
+    function enable(id) {
+        $.modal.confirm("确认要上架商品吗?", function () {
+            $.operate.post(prefix + "/goodsStatus", {"id": id, "goodsState": 1});
+        })
+    }
+</script>
 </body>
 </html>

+ 14 - 2
qmjszx-admin/src/main/resources/templates/vipCard/card.html

@@ -11,6 +11,10 @@
                 <div class="select-list">
                     <ul>
                         <li>
+                            <label>会员卡号:</label>
+                            <input type="text" name="id"/>
+                        </li>
+                        <li>
                             <label>用户名:</label>
                             <input type="text" name="username"/>
                         </li>
@@ -34,9 +38,9 @@
         </div>
 
         <div class="btn-group-sm" id="toolbar" role="group">
-            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:card:add">
+            <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:card:add">
                 <i class="fa fa-plus"></i> 添加
-            </a>
+            </a>-->
             <!--<a class="btn btn-primary single disabled" onclick="$.operate.edit()"
                shiro:hasPermission="business:card:edit">
                 <i class="fa fa-edit"></i> 修改
@@ -91,6 +95,9 @@
                 {
                     field: 'balance',
                     title: '卡内余额'
+                },{
+                    field: 'score',
+                    title: '当前积分'
                 },
                 {
                     field: 'createTime',
@@ -114,6 +121,7 @@
                         var actions = [];
                         if(row.cardState === "vip_card_state_open"){
                             actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="exchange(\'' + row.id + '\')"><i class="fa fa-random"></i>兑换</a> ');
                             actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>退卡</a>');
                         }
                         return actions.join('');
@@ -122,6 +130,10 @@
         };
         $.table.init(options);
     });
+
+    function exchange(id){
+        $.modal.open("兑换商品", prefix + "/exchange/"+id);
+    }
 </script>
 </body>
 </html>

+ 84 - 0
qmjszx-admin/src/main/resources/templates/vipCard/exchange.html

@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org">
+<head>
+  <th:block th:include="include :: header('积分兑换商品')"/>
+</head>
+<body class="white-bg">
+<div class="wrapper wrapper-content animated fadeInRight ibox-content">
+  <form class="form-horizontal m" id="form-exchange">
+    <!-- 隐藏字段,用于传递用户ID和会员卡号 -->
+    <input name="userId" th:value="${vipCard.userId}" type="hidden">
+    <input name="cardId" th:value="${vipCard.id}" type="hidden">
+    <input name="score" th:value="${vipCard.score}" type="hidden">
+
+    <!-- 会员卡信息 -->
+    <div class="col-xs-12">
+      <div class="form-group">
+        <label class="col-sm-3 control-label">会员卡号:</label>
+        <div class="col-sm-8">
+          <input name="displayCardNumber" th:value="${vipCard.id}" class="form-control" type="text" disabled>
+        </div>
+      </div>
+    </div>
+    <div class="col-xs-12">
+      <div class="form-group">
+        <label class="col-sm-3 control-label">当前积分:</label>
+        <div class="col-sm-8">
+          <input name="displayPoints" th:value="${vipCard.score}" class="form-control" type="text" disabled>
+        </div>
+      </div>
+    </div>
+    <!-- 商品列表 -->
+    <div class="col-xs-12">
+      <div class="form-group">
+        <label class="col-sm-3 control-label">兑换商品:</label>
+        <div class="col-sm-8">
+          <select name="productId" class="form-control">
+            <option value="">请选择商品</option>
+            <option th:each="product : ${productList}" th:value="${product.id}" th:text="${product.goodsName} + ' - ' + ${product.goodsScore} + '积分'"></option>
+          </select>
+        </div>
+      </div>
+    </div>
+    <div class="col-xs-12">
+      <div class="form-group">
+        <div class="col-sm-8 col-sm-offset-3">
+          <button class="btn btn-primary" type="button" onclick="submitHandler()">兑换</button>
+        </div>
+      </div>
+    </div>
+  </form>
+</div>
+<th:block th:include="include :: footer"/>
+<script th:inline="javascript">
+  var prefix = ctx + "vipCard";
+  $("#form-exchange").validate({
+    focusCleanup: true
+  });
+
+  function submitHandler() {
+    var productId = $('select[name="productId"]').val();
+    if (!productId) {
+      $.modal.alertWarning("请选择要兑换的商品!");
+      return;
+    }
+
+    // 获取当前积分
+    var currentPoints = parseFloat($('#form-exchange input[name="score"]').val());
+    // 获取商品所需积分
+    var productPoints = parseFloat($('select[name="productId"] option:selected').text().split(' - ')[1].replace('积分', ''));
+
+    // 判断当前积分是否小于商品所需积分
+    if (currentPoints < productPoints) {
+      $.modal.alertError("积分不足,无法兑换该商品!");
+      return;
+    }
+
+    //+ "&productId=" + productId
+    var productPoints = $('select[name="productId"] option:selected').text().split(' - ')[1].replace('积分', '');
+    var formData = $('#form-exchange').serialize()  + "&payScore=" + productPoints;
+    $.operate.save(prefix + "/exchange", formData);
+  }
+</script>
+</body>
+</html>

+ 4 - 0
qmjszx-business/src/main/java/beilv/shopping/domain/QmjsShoppingMall.java

@@ -73,4 +73,8 @@ public class QmjsShoppingMall extends BaseEntity
     @Excel(name = "商品状态(正常/禁用)")
     private String goodsState;
 
+    @Excel(name="积分兑换")
+    private BigDecimal goodsScore;
+
+
 }

+ 27 - 0
qmjszx-business/src/main/java/beilv/vipCard/domain/Exchange.java

@@ -0,0 +1,27 @@
+package beilv.vipCard.domain;
+
+import lombok.*;
+import org.apache.ibatis.type.Alias;
+
+import java.math.BigDecimal;
+
+@Setter
+@Getter
+@AllArgsConstructor
+@NoArgsConstructor
+@ToString
+@Alias("Exchange")
+public class Exchange {
+    //用户id
+    private String userId;
+    //会员卡号
+    private String cardId;
+    //当前积分
+    private BigDecimal score;
+    //商品编号
+    private String productId;
+    //支付积分
+    private BigDecimal payScore;
+    //创建时间
+    private String creatTime;
+}

+ 4 - 0
qmjszx-business/src/main/java/beilv/vipCard/service/IVipCardService.java

@@ -1,5 +1,7 @@
 package beilv.vipCard.service;
 
+import beilv.common.core.domain.AjaxResult;
+import beilv.vipCard.domain.Exchange;
 import beilv.vipCard.domain.VipCard;
 
 import java.util.List;
@@ -64,4 +66,6 @@ public interface IVipCardService {
     boolean haveVipCard(String userId);
 
     VipCard selectVipCardByUserId(String userId);
+
+    AjaxResult exchange(Exchange exchange);
 }

+ 54 - 1
qmjszx-business/src/main/java/beilv/vipCard/service/impl/VipCardServiceImpl.java

@@ -1,14 +1,23 @@
 package beilv.vipCard.service.impl;
 
+import beilv.common.core.domain.AjaxResult;
 import beilv.common.core.text.Convert;
 import beilv.common.utils.DateUtils;
+import beilv.common.utils.StringUtils;
+import beilv.common.utils.uuid.IdUtils;
 import beilv.utils.UuidUtils;
+import beilv.vipCard.domain.Exchange;
 import beilv.vipCard.domain.VipCard;
 import beilv.vipCard.mapper.VipCardMapper;
 import beilv.vipCard.service.IVipCardService;
+import beilv.vipCardAmountLog.domain.VipCardAmountLog;
+import beilv.vipCardAmountLog.mapper.VipCardAmountLogMapper;
+import beilv.vipCardLog.domain.VipCardLog;
+import beilv.vipCardLog.mapper.VipCardLogMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.util.List;
 
@@ -20,9 +29,14 @@ import java.util.List;
  */
 @Service
 public class VipCardServiceImpl implements IVipCardService {
-    @Autowired
+    @Resource
     private VipCardMapper vipCardMapper;
 
+    @Resource
+    private VipCardLogMapper cardLogMapper;
+
+    @Resource
+    private VipCardAmountLogMapper amountLogMapper;
     /**
      * 查询储值会员卡
      *
@@ -111,4 +125,43 @@ public class VipCardServiceImpl implements IVipCardService {
     public VipCard selectVipCardByUserId(String userId) {
         return vipCardMapper.selectVipCardByUserId(userId);
     }
+
+    @Override
+    public AjaxResult exchange(Exchange exchange) {
+        if(StringUtils.isEmpty(exchange.getCardId())){
+            return AjaxResult.error("会员信息为空!");
+        }
+        if(StringUtils.isEmpty(exchange.getProductId())){
+            return AjaxResult.error("未选中商品信息!");
+        }
+        //生成订单
+        String orderId = IdUtils.fastSimpleUUID();
+        VipCardLog vipCardLog = new VipCardLog();
+        vipCardLog.setId(orderId);
+        vipCardLog.setUserId(exchange.getUserId());
+        vipCardLog.setPaymentType("score");
+        vipCardLog.setOrderType("duihuan");
+        vipCardLog.setBusId(exchange.getProductId());
+        vipCardLog.setPaymentStatus("payment_status_have_paid");
+        vipCardLog.setCreateTime(DateUtils.getNowDate());
+        vipCardLog.setPaymentTime(vipCardLog.getCreateTime());
+        vipCardLog.setPracticalMoney(exchange.getPayScore());
+        vipCardLog.setPaymentId(exchange.getCardId());
+        cardLogMapper.insertVipCardLog(vipCardLog);
+
+        System.out.println("exchange.getPayScore().negate() = " + exchange.getPayScore().negate());
+
+        //存在会员卡, 增加积分流水
+        VipCardAmountLog vipCardAmountLog = new VipCardAmountLog(exchange.getUserId(), exchange.getCardId(), orderId, exchange.getScore(), exchange.getPayScore().negate(), "2");
+        amountLogMapper.insertVipCardAmountLog(vipCardAmountLog);
+
+        //存在会员卡, 增加积分
+        VipCard vipCard = new VipCard();
+        vipCard.setUserId(Long.valueOf(exchange.getUserId()));
+        vipCard.setId(exchange.getCardId());
+        vipCard.setScore(vipCardAmountLog.getRemainingAmount());
+        vipCardMapper.updateVipCard(vipCard);
+
+        return AjaxResult.success();
+    }
 }

+ 6 - 1
qmjszx-business/src/main/resources/mapper/shopping/QmjsShoppingMallMapper.xml

@@ -18,10 +18,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="goodsInventory"    column="goods_inventory"    />
         <result property="inventoryCost"    column="inventory_cost"    />
         <result property="goodsState"    column="goods_state"    />
+        <result property="goodsScore"    column="goods_score"    />
     </resultMap>
 
     <sql id="selectQmjsShoppingMallVo">
-        select id, goods_name, goods_code, goods_type, goods_img, goods_describe, goods_unit, goods_current_price, sale_price, suggestion_price, goods_inventory, inventory_cost, goods_state from qmjs_shopping_mall
+        select id, goods_name, goods_code, goods_type, goods_img, goods_describe, goods_unit, goods_current_price, sale_price, suggestion_price, goods_inventory, inventory_cost, goods_state,goods_score from qmjs_shopping_mall
     </sql>
 
     <select id="selectQmjsShoppingMallList" parameterType="QmjsShoppingMall" resultMap="QmjsShoppingMallResult">
@@ -39,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="goodsInventory != null  and goodsInventory != ''"> and goods_inventory = #{goodsInventory}</if>
             <if test="inventoryCost != null "> and inventory_cost = #{inventoryCost}</if>
             <if test="goodsState != null  and goodsState != ''"> and goods_state = #{goodsState}</if>
+            <if test="goodsScore != null"> and goods_score = #{goodsScore}</if>
         </where>
     </select>
     
@@ -62,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="goodsInventory != null">goods_inventory,</if>
             <if test="inventoryCost != null">inventory_cost,</if>
             <if test="goodsState != null">goods_state,</if>
+            <if test="goodsScore != null">goods_score,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="goodsName != null">#{goodsName},</if>
@@ -76,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="goodsInventory != null">#{goodsInventory},</if>
             <if test="inventoryCost != null">#{inventoryCost},</if>
             <if test="goodsState != null">#{goodsState},</if>
+            <if test="goodsScore != null">#{goodsScore},</if>
          </trim>
     </insert>
 
@@ -94,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="goodsInventory != null">goods_inventory = #{goodsInventory},</if>
             <if test="inventoryCost != null">inventory_cost = #{inventoryCost},</if>
             <if test="goodsState != null">goods_state = #{goodsState},</if>
+            <if test="goodsScore != null">goods_score = #{goodsScore},</if>
         </trim>
         where id = #{id}
     </update>

+ 1 - 1
qmjszx-business/src/main/resources/mapper/vipCard/VipCardMapper.xml

@@ -33,7 +33,7 @@
     </select>
 
     <select id="selectVipCardById" parameterType="String" resultMap="VipCardResult">
-        select a.id, a.vip_level, a.balance, a.create_time, a.refund_time, a.card_state, b.username, b.mobile, a.score
+        select a.id, a.user_id, a.vip_level, a.balance, a.create_time, a.refund_time, a.card_state, b.username, b.mobile, a.score
         from beilv_vip_card a
                  left join sys_member b on a.user_id = b.id
         where a.id = #{id}