hanfucheng hace 5 meses
padre
commit
98ef2e3b84
Se han modificado 27 ficheros con 3047 adiciones y 0 borrados
  1. 116 0
      qmjszx-admin/src/main/java/beilv/web/controller/cardpurchaserecord/CardPurchaseRecordController.java
  2. 116 0
      qmjszx-admin/src/main/java/beilv/web/controller/carinformation/CarInformationController.java
  3. 116 0
      qmjszx-admin/src/main/java/beilv/web/controller/usermembershipcard/UserMembershipCardController.java
  4. 117 0
      qmjszx-admin/src/main/resources/templates/card/add.html
  5. 114 0
      qmjszx-admin/src/main/resources/templates/card/card.html
  6. 66 0
      qmjszx-admin/src/main/resources/templates/card/edit.html
  7. 104 0
      qmjszx-admin/src/main/resources/templates/information/add.html
  8. 105 0
      qmjszx-admin/src/main/resources/templates/information/edit.html
  9. 139 0
      qmjszx-admin/src/main/resources/templates/information/information.html
  10. 131 0
      qmjszx-admin/src/main/resources/templates/record/add.html
  11. 186 0
      qmjszx-admin/src/main/resources/templates/record/edit.html
  12. 138 0
      qmjszx-admin/src/main/resources/templates/record/record.html
  13. 236 0
      qmjszx-business/src/main/java/beilv/cardpurchaserecord/domain/CardPurchaseRecord.java
  14. 61 0
      qmjszx-business/src/main/java/beilv/cardpurchaserecord/mapper/CardPurchaseRecordMapper.java
  15. 61 0
      qmjszx-business/src/main/java/beilv/cardpurchaserecord/service/ICardPurchaseRecordService.java
  16. 104 0
      qmjszx-business/src/main/java/beilv/cardpurchaserecord/service/impl/CardPurchaseRecordServiceImpl.java
  17. 185 0
      qmjszx-business/src/main/java/beilv/carinformation/domain/CarInformation.java
  18. 61 0
      qmjszx-business/src/main/java/beilv/carinformation/mapper/CarInformationMapper.java
  19. 61 0
      qmjszx-business/src/main/java/beilv/carinformation/service/ICarInformationService.java
  20. 103 0
      qmjszx-business/src/main/java/beilv/carinformation/service/impl/CarInformationServiceImpl.java
  21. 160 0
      qmjszx-business/src/main/java/beilv/usermembershipcard/domain/UserMembershipCard.java
  22. 61 0
      qmjszx-business/src/main/java/beilv/usermembershipcard/mapper/UserMembershipCardMapper.java
  23. 61 0
      qmjszx-business/src/main/java/beilv/usermembershipcard/service/IUserMembershipCardService.java
  24. 92 0
      qmjszx-business/src/main/java/beilv/usermembershipcard/service/impl/UserMembershipCardServiceImpl.java
  25. 110 0
      qmjszx-business/src/main/resources/mapper/card/CarInformationMapper.xml
  26. 128 0
      qmjszx-business/src/main/resources/mapper/card/CardPurchaseRecordMapper.xml
  27. 115 0
      qmjszx-business/src/main/resources/mapper/card/UserMembershipCardMapper.xml

+ 116 - 0
qmjszx-admin/src/main/java/beilv/web/controller/cardpurchaserecord/CardPurchaseRecordController.java

@@ -0,0 +1,116 @@
+package beilv.web.controller.cardpurchaserecord;
+
+import beilv.cardpurchaserecord.domain.CardPurchaseRecord;
+import beilv.cardpurchaserecord.service.ICardPurchaseRecordService;
+import beilv.common.annotation.Log;
+import beilv.common.core.controller.BaseController;
+import beilv.common.core.domain.AjaxResult;
+import beilv.common.core.page.TableDataInfo;
+import beilv.common.enums.BusinessType;
+import beilv.common.utils.poi.ExcelUtil;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 购卡记录Controller
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+@Controller
+@RequestMapping("/record")
+public class CardPurchaseRecordController extends BaseController {
+    private String prefix = "record";
+
+    @Autowired
+    private ICardPurchaseRecordService cardPurchaseRecordService;
+
+    @RequiresPermissions("system:record:view")
+    @GetMapping()
+    public String record() {
+        return prefix + "/record";
+    }
+
+    /**
+     * 查询购卡记录列表
+     */
+    @RequiresPermissions("system:record:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(CardPurchaseRecord cardPurchaseRecord) {
+        startPage();
+        List<CardPurchaseRecord> list = cardPurchaseRecordService.selectCardPurchaseRecordList(cardPurchaseRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出购卡记录列表
+     */
+    @RequiresPermissions("system:record:export")
+    @Log(title = "购卡记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(CardPurchaseRecord cardPurchaseRecord) {
+        List<CardPurchaseRecord> list = cardPurchaseRecordService.selectCardPurchaseRecordList(cardPurchaseRecord);
+        ExcelUtil<CardPurchaseRecord> util = new ExcelUtil<CardPurchaseRecord>(CardPurchaseRecord.class);
+        return util.exportExcel(list, "购卡记录数据");
+    }
+
+    /**
+     * 新增购卡记录
+     */
+    @RequiresPermissions("system:record:add")
+    @GetMapping("/add")
+    public String add() {
+        return prefix + "/add";
+    }
+
+    /**
+     * 新增保存购卡记录
+     */
+    @RequiresPermissions("system:record:add")
+    @Log(title = "购卡记录", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    @ResponseBody
+    public AjaxResult addSave(CardPurchaseRecord cardPurchaseRecord) {
+        return toAjax(cardPurchaseRecordService.insertCardPurchaseRecord(cardPurchaseRecord));
+    }
+
+    /**
+     * 修改购卡记录
+     */
+    @RequiresPermissions("system:record:edit")
+    @GetMapping("/edit/{id}")
+    public String edit(@PathVariable("id") Long id, ModelMap mmap) {
+        CardPurchaseRecord cardPurchaseRecord = cardPurchaseRecordService.selectCardPurchaseRecordById(id);
+        mmap.put("cardPurchaseRecord", cardPurchaseRecord);
+        return prefix + "/edit";
+    }
+
+    /**
+     * 修改保存购卡记录
+     */
+    @RequiresPermissions("system:record:edit")
+    @Log(title = "购卡记录", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(CardPurchaseRecord cardPurchaseRecord) {
+        return toAjax(cardPurchaseRecordService.updateCardPurchaseRecord(cardPurchaseRecord));
+    }
+
+    /**
+     * 删除购卡记录
+     */
+    @RequiresPermissions("system:record:remove")
+    @Log(title = "购卡记录", businessType = BusinessType.DELETE)
+    @PostMapping("/remove")
+    @ResponseBody
+    public AjaxResult remove(String ids) {
+        return toAjax(cardPurchaseRecordService.deleteCardPurchaseRecordByIds(ids));
+    }
+}

+ 116 - 0
qmjszx-admin/src/main/java/beilv/web/controller/carinformation/CarInformationController.java

@@ -0,0 +1,116 @@
+package beilv.web.controller.carinformation;
+
+import beilv.carinformation.domain.CarInformation;
+import beilv.carinformation.service.ICarInformationService;
+import beilv.common.annotation.Log;
+import beilv.common.core.controller.BaseController;
+import beilv.common.core.domain.AjaxResult;
+import beilv.common.core.page.TableDataInfo;
+import beilv.common.enums.BusinessType;
+import beilv.common.utils.poi.ExcelUtil;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 卡种信息Controller
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+@Controller
+@RequestMapping("/information")
+public class CarInformationController extends BaseController {
+    private String prefix = "information";
+
+    @Autowired
+    private ICarInformationService carInformationService;
+
+    @RequiresPermissions("system:information:view")
+    @GetMapping()
+    public String information() {
+        return prefix + "/information";
+    }
+
+    /**
+     * 查询卡种信息列表
+     */
+    @RequiresPermissions("system:information:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(CarInformation carInformation) {
+        startPage();
+        List<CarInformation> list = carInformationService.selectCarInformationList(carInformation);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出卡种信息列表
+     */
+    @RequiresPermissions("system:information:export")
+    @Log(title = "卡种信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(CarInformation carInformation) {
+        List<CarInformation> list = carInformationService.selectCarInformationList(carInformation);
+        ExcelUtil<CarInformation> util = new ExcelUtil<CarInformation>(CarInformation.class);
+        return util.exportExcel(list, "卡种信息数据");
+    }
+
+    /**
+     * 新增卡种信息
+     */
+    @RequiresPermissions("system:information:add")
+    @GetMapping("/add")
+    public String add() {
+        return prefix + "/add";
+    }
+
+    /**
+     * 新增保存卡种信息
+     */
+    @RequiresPermissions("system:information:add")
+    @Log(title = "卡种信息", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    @ResponseBody
+    public AjaxResult addSave(CarInformation carInformation) {
+        return toAjax(carInformationService.insertCarInformation(carInformation));
+    }
+
+    /**
+     * 修改卡种信息
+     */
+    @RequiresPermissions("system:information:edit")
+    @GetMapping("/edit/{id}")
+    public String edit(@PathVariable("id") Long id, ModelMap mmap) {
+        CarInformation carInformation = carInformationService.selectCarInformationById(id);
+        mmap.put("carInformation", carInformation);
+        return prefix + "/edit";
+    }
+
+    /**
+     * 修改保存卡种信息
+     */
+    @RequiresPermissions("system:information:edit")
+    @Log(title = "卡种信息", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(CarInformation carInformation) {
+        return toAjax(carInformationService.updateCarInformation(carInformation));
+    }
+
+    /**
+     * 删除卡种信息
+     */
+    @RequiresPermissions("system:information:remove")
+    @Log(title = "卡种信息", businessType = BusinessType.DELETE)
+    @PostMapping("/remove")
+    @ResponseBody
+    public AjaxResult remove(String ids) {
+        return toAjax(carInformationService.deleteCarInformationByIds(ids));
+    }
+}

+ 116 - 0
qmjszx-admin/src/main/java/beilv/web/controller/usermembershipcard/UserMembershipCardController.java

@@ -0,0 +1,116 @@
+package beilv.web.controller.usermembershipcard;
+
+import beilv.common.annotation.Log;
+import beilv.common.core.controller.BaseController;
+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.usermembershipcard.domain.UserMembershipCard;
+import beilv.usermembershipcard.service.IUserMembershipCardService;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 用户会员卡Controller
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+@Controller
+@RequestMapping("/card")
+public class UserMembershipCardController extends BaseController {
+    private String prefix = "card";
+
+    @Autowired
+    private IUserMembershipCardService userMembershipCardService;
+
+    @RequiresPermissions("system:card:view")
+    @GetMapping()
+    public String card() {
+        return prefix + "/card";
+    }
+
+    /**
+     * 查询用户会员卡列表
+     */
+    @RequiresPermissions("system:card:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(UserMembershipCard userMembershipCard) {
+        startPage();
+        List<UserMembershipCard> list = userMembershipCardService.selectUserMembershipCardList(userMembershipCard);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户会员卡列表
+     */
+    @RequiresPermissions("system:card:export")
+    @Log(title = "用户会员卡", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(UserMembershipCard userMembershipCard) {
+        List<UserMembershipCard> list = userMembershipCardService.selectUserMembershipCardList(userMembershipCard);
+        ExcelUtil<UserMembershipCard> util = new ExcelUtil<UserMembershipCard>(UserMembershipCard.class);
+        return util.exportExcel(list, "用户会员卡数据");
+    }
+
+    /**
+     * 新增用户会员卡
+     */
+    @RequiresPermissions("system:card:add")
+    @GetMapping("/add")
+    public String add() {
+        return prefix + "/add";
+    }
+
+    /**
+     * 新增保存用户会员卡
+     */
+    @RequiresPermissions("system:card:add")
+    @Log(title = "用户会员卡", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    @ResponseBody
+    public AjaxResult addSave(UserMembershipCard userMembershipCard) {
+        return toAjax(userMembershipCardService.insertUserMembershipCard(userMembershipCard));
+    }
+
+    /**
+     * 修改用户会员卡
+     */
+    @RequiresPermissions("system:card:edit")
+    @GetMapping("/edit/{id}")
+    public String edit(@PathVariable("id") Long id, ModelMap mmap) {
+        UserMembershipCard userMembershipCard = userMembershipCardService.selectUserMembershipCardById(id);
+        mmap.put("userMembershipCard", userMembershipCard);
+        return prefix + "/edit";
+    }
+
+    /**
+     * 修改保存用户会员卡
+     */
+    @RequiresPermissions("system:card:edit")
+    @Log(title = "用户会员卡", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(UserMembershipCard userMembershipCard) {
+        return toAjax(userMembershipCardService.updateUserMembershipCard(userMembershipCard));
+    }
+
+    /**
+     * 删除用户会员卡
+     */
+    @RequiresPermissions("system:card:remove")
+    @Log(title = "用户会员卡", businessType = BusinessType.DELETE)
+    @PostMapping("/remove")
+    @ResponseBody
+    public AjaxResult remove(String ids) {
+        return toAjax(userMembershipCardService.deleteUserMembershipCardByIds(ids));
+    }
+}

+ 117 - 0
qmjszx-admin/src/main/resources/templates/card/add.html

@@ -0,0 +1,117 @@
+<!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-card-add">
+        <div class="col-xs-12">
+            <div class="form-group">
+                <label class="col-sm-3 control-label is-required">用户:</label>
+                <div class="col-sm-8">
+                    <select name="userId" class="form-control" id="userSelect" required></select>
+                </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">
+                    <select name="cardId" class="form-control" id="cardSelect" required></select>
+                </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="totalNumber" 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 is-required">剩余次数:</label>
+                <div class="col-sm-8">
+                    <input name="remainingNumber" class="form-control" type="number" min="0" step="1" maxlength="8" required>
+                </div>
+            </div>
+        </div>
+    </form>
+</div>
+<th:block th:include="include :: footer"/>
+<script th:inline="javascript">
+    var prefix = ctx + "card"
+    $("#form-card-add").validate({
+        focusCleanup: true
+    });
+
+    //用户列表
+    const userSelect = document.getElementById('userSelect');
+    const userrequestData = {
+        status: "0",
+        delFlag: "0"
+    };
+    $.ajax({
+        url: "/system/member/list",
+        type: "POST",
+        dataType: "json",
+        data: userrequestData,
+        success: function (data) {
+            // 在这里处理成功获取到的数据
+            data.rows.forEach(cardType => {
+                const option = document.createElement('option');
+                option.value = cardType.id;
+                option.text = cardType.realName;
+                userSelect.appendChild(option);
+            });
+        },
+        error: function (xhr, status, error) {
+            // 在这里处理请求出错的情况
+            console.log("Error: " + error);
+        }
+    });
+
+    //卡种列表
+    const cardSelect = document.getElementById('cardSelect');
+    const totalNumberInput = document.getElementsByName("totalNumber")[0];
+    const requestData = {
+        state: "0"
+    };
+    $.ajax({
+        url: "/information/list",
+        type: "POST",
+        dataType: "json",
+        data: requestData,
+        success: function (data) {
+            totalNumberInput.value = data.rows[0].totalNumber
+            // 在这里处理成功获取到的数据
+            data.rows.forEach(cardType => {
+                const option = document.createElement('option');
+                option.value = cardType.id;
+                option.text = cardType.name;
+                cardSelect.appendChild(option);
+            })
+            cardSelect.addEventListener('change', function () {
+                const selectedOption = cardSelect.options[cardSelect.selectedIndex];
+                const selectedCardType = data.rows.find(card => card.id === parseInt(selectedOption.value));
+                if (selectedCardType && totalNumberInput) {
+                    totalNumberInput.value = selectedCardType.totalNumber;
+                }
+            });
+        },
+        error: function (xhr, status, error) {
+            // 在这里处理请求出错的情况
+            console.log("Error: " + error);
+        }
+    });
+
+    function submitHandler() {
+        if ($.validate.form()) {
+            $.operate.save(prefix + "/add", $('#form-card-add').serialize());
+        }
+    }
+</script>
+</body>
+</html>

+ 114 - 0
qmjszx-admin/src/main/resources/templates/card/card.html

@@ -0,0 +1,114 @@
+<!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('用户会员卡列表')" />
+</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="realName"/>
+                            </li>
+                            <li>
+                                <label>手机号码:</label>
+                                <input type="text" name="mobile"/>
+                            </li>
+                            <li>
+                                <label>卡种名称:</label>
+                                <input type="text" name="cardName"/>
+                            </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:card:add">
+                    <i class="fa fa-plus"></i> 添加
+                </a>
+<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:card:edit">-->
+<!--                    <i class="fa fa-edit"></i> 修改-->
+<!--                </a>-->
+<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:card:remove">-->
+<!--                    <i class="fa fa-remove"></i> 删除-->
+<!--                </a>-->
+                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:card: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>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var editFlag = [[${@permission.hasPermi('system:card:edit')}]];
+        var removeFlag = [[${@permission.hasPermi('system:card:remove')}]];
+        var prefix = ctx + "card";
+
+        $(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: '主键',
+                    visible: false
+                },
+                {
+                    field: 'userName',
+                    title: '用户账户'
+                },
+                {
+                    field: 'realName',
+                    title: '姓名'
+                },
+                {
+                    field: 'mobile',
+                    title: '手机号码'
+                },
+                {
+                    field: 'cardName',
+                    title: '卡种名称'
+                },
+                {
+                    field: 'totalNumber',
+                    title: '总次数'
+                },
+                {
+                    field: 'remainingNumber',
+                    title: '剩余次数'
+                // },
+                // {
+                //     title: '操作',
+                //     align: 'center',
+                //     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);
+        });
+    </script>
+</body>
+</html>

+ 66 - 0
qmjszx-admin/src/main/resources/templates/card/edit.html

@@ -0,0 +1,66 @@
+<!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-card-edit" th:object="${userMembershipCard}">
+            <input name="id" th:field="*{id}" type="hidden">
+            <div class="col-xs-12">
+                <div class="form-group">
+                    <label class="col-sm-3 control-label">用户id:</label>
+                    <div class="col-sm-8">
+                        <input name="userId" th:field="*{userId}" class="form-control" type="text">
+                    </div>
+                </div>
+            </div>
+            <div class="col-xs-12">
+                <div class="form-group">
+                    <label class="col-sm-3 control-label">卡种id:</label>
+                    <div class="col-sm-8">
+                        <input name="carId" th:field="*{carId}" class="form-control" type="text">
+                    </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="totalNumber" th:field="*{totalNumber}" class="form-control" type="text">
+                    </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="remainingNumber" th:field="*{remainingNumber}" class="form-control" type="text">
+                    </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="version" th:field="*{version}" class="form-control" type="text">
+                    </div>
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var prefix = ctx + "card";
+        $("#form-card-edit").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/edit", $('#form-card-edit').serialize());
+            }
+        }
+    </script>
+</body>
+</html>

+ 104 - 0
qmjszx-admin/src/main/resources/templates/information/add.html

@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('新增卡种信息')" />
+    <th:block th:include="include :: datetimepicker-css" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-information-add">
+            <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="name" class="form-control" type="text" maxlength="20" required>
+                    </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">
+                        <select name="type" class="form-control" th:with="type=${@dict.getType('card_type')}" required>
+                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                        </select>
+                    </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="totalNumber" class="form-control" type="number" min="0" step="1" maxlength="8" required>
+                    </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="price" class="form-control" type="number" min="0" step="0.01" maxlength="8" required>
+                    </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="point" class="form-control" type="number" min="0" step="1" maxlength="8" required>
+                    </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">
+                        <div class="input-group date">
+                            <input name="expirationDate" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
+                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+                        </div>
+                    </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="notes" class="form-control" type="text" maxlength="255" required>
+                    </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">
+                        <select name="state" class="form-control" th:with="type=${@dict.getType('sys_job_status')}" required>
+                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                        </select>
+                    </div>
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <th:block th:include="include :: datetimepicker-js" />
+    <script th:inline="javascript">
+        var prefix = ctx + "information"
+        $("#form-information-add").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/add", $('#form-information-add').serialize());
+            }
+        }
+
+        $("input[name='expirationDate']").datetimepicker({
+            format: "yyyy-mm-dd",
+            minView: "month",
+            autoclose: true
+        });
+    </script>
+</body>
+</html>

+ 105 - 0
qmjszx-admin/src/main/resources/templates/information/edit.html

@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('修改卡种信息')" />
+    <th:block th:include="include :: datetimepicker-css" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-information-edit" th:object="${carInformation}">
+            <input name="id" th:field="*{id}" type="hidden">
+            <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="name" th:field="*{name}" class="form-control" type="text" maxlength="20">
+                    </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">
+                        <select name="type" class="form-control" th:with="type=${@dict.getType('card_type')}">
+                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{type}"></option>
+                        </select>
+                    </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="totalNumber" th:field="*{totalNumber}" class="form-control" type="number" min="0" step="1" maxlength="8">
+                    </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="price" th:field="*{price}" class="form-control" type="number" min="0" step="0.01" maxlength="8">
+                    </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="point" th:field="*{point}" class="form-control" type="number" min="0" step="1" maxlength="8">
+                    </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">
+                        <div class="input-group date">
+                            <input name="expirationDate" th:value="${#dates.format(carInformation.expirationDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
+                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+                        </div>
+                    </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="notes" th:field="*{notes}" class="form-control" type="text" maxlength="255">
+                    </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">
+                        <select name="state" class="form-control" th:with="type=${@dict.getType('sys_job_status')}">
+                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{state}"></option>
+                        </select>
+                    </div>
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <th:block th:include="include :: datetimepicker-js" />
+    <script th:inline="javascript">
+        var prefix = ctx + "information";
+        $("#form-information-edit").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/edit", $('#form-information-edit').serialize());
+            }
+        }
+
+        $("input[name='expirationDate']").datetimepicker({
+            format: "yyyy-mm-dd",
+            minView: "month",
+            autoclose: true
+        });
+    </script>
+</body>
+</html>

+ 139 - 0
qmjszx-admin/src/main/resources/templates/information/information.html

@@ -0,0 +1,139 @@
+<!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('卡种信息列表')" />
+</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="name"/>
+                            </li>
+                            <li>
+                                <label>类型:</label>
+                                <select name="type" th:with="type=${@dict.getType('card_type')}">
+                                    <option value="">所有</option>
+                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
+                                            th:value="${dict.dictValue}"></option>
+                                </select>
+                            </li>
+                            <li>
+                                <label>状态:</label>
+                                <select name="state" th:with="type=${@dict.getType('sys_job_status')}">
+                                    <option value="">所有</option>
+                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
+                                            th:value="${dict.dictValue}"></option>
+                                </select>
+                            </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:information:add">
+                    <i class="fa fa-plus"></i> 添加
+                </a>
+                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:information:edit">
+                    <i class="fa fa-edit"></i> 修改
+                </a>
+                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:information:remove">
+                    <i class="fa fa-remove"></i> 删除
+                </a>
+                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:information: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>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var editFlag = [[${@permission.hasPermi('system:information:edit')}]];
+        var removeFlag = [[${@permission.hasPermi('system:information:remove')}]];
+        var prefix = ctx + "information";
+        var cardType = [[${@dict.getType('card_type')}]];
+        var sysJobStatus = [[${@dict.getType('sys_job_status')}]];
+
+        $(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: '主键',
+                    visible: false
+                },
+                {
+                    field: 'name',
+                    title: '名称'
+                },
+                {
+                    field: 'type',
+                    title: '类型',
+                    formatter: function (value, row, index) {
+                        return $.table.selectDictLabel(cardType, value);
+                    }
+
+                },
+                {
+                    field: 'totalNumber',
+                    title: '可用次数'
+                },
+                {
+                    field: 'price',
+                    title: '价格'
+                },
+                {
+                    field: 'point',
+                    title: '单次积分'
+                },
+                {
+                    field: 'expirationDate',
+                    title: '有效期'
+                },
+                {
+                    field: 'notes',
+                    title: '使用规则'
+                },
+                {
+                    field: 'state',
+                    title: '状态',
+                    formatter: function (value, row, index) {
+                        return $.table.selectDictLabel(sysJobStatus, value);
+                    }
+                },
+                {
+                    title: '操作',
+                    align: 'center',
+                    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);
+        });
+    </script>
+</body>
+</html>

+ 131 - 0
qmjszx-admin/src/main/resources/templates/record/add.html

@@ -0,0 +1,131 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('新增购卡记录')" />
+    <th:block th:include="include :: datetimepicker-css" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-record-add">
+            <div class="col-xs-12">
+                <div class="form-group">
+                    <label class="col-sm-3 control-label is-required">用户:</label>
+                    <div class="col-sm-8">
+                        <select name="userId" class="form-control" id="userSelect" required></select>
+                    </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">
+                        <select name="cardId" class="form-control" id="cardSelect" required></select>
+                    </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="price" 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 is-required">支付方式:</label>
+                    <div class="col-sm-8">
+                        <input name="paymentWay" class="form-control" type="text" required>
+                    </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="notes" class="form-control" type="text" maxlength="255">
+                    </div>
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <th:block th:include="include :: datetimepicker-js" />
+    <script th:inline="javascript">
+        var prefix = ctx + "record"
+        $("#form-record-add").validate({
+            focusCleanup: true
+        });
+
+        //用户列表
+        const userSelect = document.getElementById('userSelect');
+        const userrequestData = {
+            status: "0",
+            delFlag: "0"
+        };
+        $.ajax({
+            url: "/system/member/list",
+            type: "POST",
+            dataType: "json",
+            data: userrequestData,
+            success: function (data) {
+                // 在这里处理成功获取到的数据
+                data.rows.forEach(cardType => {
+                    const option = document.createElement('option');
+                    option.value = cardType.id;
+                    option.text = cardType.realName;
+                    userSelect.appendChild(option);
+                });
+            },
+            error: function (xhr, status, error) {
+                // 在这里处理请求出错的情况
+                console.log("Error: " + error);
+            }
+        });
+
+        //卡种列表
+        const cardSelect = document.getElementById('cardSelect');
+        const priceInput = document.getElementsByName("price")[0];
+        const requestData = {
+            state: "0"
+        };
+        $.ajax({
+            url: "/information/list",
+            type: "POST",
+            dataType: "json",
+            data: requestData,
+            success: function (data) {
+                priceInput.value = data.rows[0].price
+                // 在这里处理成功获取到的数据
+                data.rows.forEach(cardType => {
+                    const option = document.createElement('option');
+                    option.value = cardType.id;
+                    option.text = cardType.name;
+                    cardSelect.appendChild(option);
+                })
+                cardSelect.addEventListener('change', function () {
+                    const selectedOption = cardSelect.options[cardSelect.selectedIndex];
+                    const selectedCardType = data.rows.find(card => card.id === parseInt(selectedOption.value));
+                    if (selectedCardType && priceInput) {
+                        priceInput.value = selectedCardType.price;
+                    }
+                });
+            },
+            error: function (xhr, status, error) {
+                // 在这里处理请求出错的情况
+                console.log("Error: " + error);
+            }
+        });
+
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                const cardName = cardSelect.options[cardSelect.selectedIndex].text
+                const request =  $('#form-record-add').serialize() + '&cardName='+cardName + '&price=' + priceInput.value
+                console.log(request)
+                $.operate.save(prefix + "/add", request);
+            }
+        }
+    </script>
+</body>
+</html>

+ 186 - 0
qmjszx-admin/src/main/resources/templates/record/edit.html

@@ -0,0 +1,186 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('修改购卡记录')" />
+    <th:block th:include="include :: datetimepicker-css" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-record-edit" th:object="${cardPurchaseRecord}">
+            <input name="id" th:field="*{id}" type="hidden">
+            <div class="col-xs-12">
+                <div class="form-group">
+                    <label class="col-sm-3 control-label">用户:</label>
+                    <div class="col-sm-8">
+                        <select th:field="*{userId}" name="userId" class="form-control" id="userSelect">
+                        </select>
+                    </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="cardId" class="form-control" id="cardSelect">
+                        </select>
+                    </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="price" th:field="*{price}" class="form-control" type="text">
+                    </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">
+                        <div class="input-group date">
+                            <input name="paymentTime" th:value="${#dates.format(cardPurchaseRecord.paymentTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
+                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+                        </div>
+                    </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">
+                        <div class="input-group date">
+                            <input name="refundTime" th:value="${#dates.format(cardPurchaseRecord.refundTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
+                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+                        </div>
+                    </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="paymentWay" th:field="*{paymentWay}" class="form-control" type="text">
+                    </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="state" th:field="*{state}" class="form-control" type="text">
+                    </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="notes" th:field="*{notes}" class="form-control" type="text">
+                    </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="version" th:field="*{version}" class="form-control" type="text">
+                    </div>
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <th:block th:include="include :: datetimepicker-js" />
+    <script th:inline="javascript">
+        var prefix = ctx + "record";
+        $("#form-record-edit").validate({
+            focusCleanup: true
+        });
+
+        //用户列表
+        const userSelect = document.getElementById("userSelect");
+        const selectedUserId = [[${cardPurchaseRecord.userId}]]
+        const userrequestData = {
+            status: "0",
+            delFlag: "0"
+        };
+        $.ajax({
+            url: '/system/member/list',
+            type: 'POST',
+            dataType: 'json',
+            data: userrequestData,
+            success: function (data) {
+                data.rows.forEach(cardType => {
+                    const option = document.createElement('option');
+                    option.value = cardType.id;
+                    option.text = cardType.realName;
+                    userSelect.appendChild(option);
+                });
+                if (selectedUserId) {
+                    $('#userSelect').find('option[value="' + selectedUserId + '"]').prop('selected', true);
+                }
+            },
+            error: function () {
+                console.log('获取用户数据失败');
+            }
+        });
+
+        //卡种列表
+        const cardSelect = document.getElementById('cardSelect');
+        const priceInput = document.getElementsByName("price")[0];
+        const requestData = {
+            state: "0"
+        };
+        const selectedCardId = [[${cardPurchaseRecord.cardId}]]
+        $.ajax({
+            url: "/information/list",
+            type: "POST",
+            dataType: "json",
+            data: requestData,
+            success: function (data) {
+                var a = $('#cardId').val()
+                // 在这里处理成功获取到的数据
+                data.rows.forEach(cardType => {
+                    const option = document.createElement('option');
+                    option.value = cardType.id;
+                    option.text = cardType.name;
+                    cardSelect.appendChild(option);
+                })
+                if (selectedCardId) {
+                    $('#cardSelect').find('option[value="' + selectedCardId + '"]').prop('selected', true);
+                }
+                cardSelect.addEventListener('change', function () {
+                    const selectedOption = cardSelect.options[cardSelect.selectedIndex];
+                    const selectedCardType = data.rows.find(card => card.id === parseInt(selectedOption.value));
+                    if (selectedCardType && priceInput) {
+                        priceInput.value = selectedCardType.price;
+                    }
+                });
+            },
+            error: function (xhr, status, error) {
+                // 在这里处理请求出错的情况
+                console.log("Error: " + error);
+            }
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/edit", $('#form-record-edit').serialize());
+            }
+        }
+
+        $("input[name='paymentTime']").datetimepicker({
+            format: "yyyy-mm-dd",
+            minView: "month",
+            autoclose: true
+        });
+
+        $("input[name='refundTime']").datetimepicker({
+            format: "yyyy-mm-dd",
+            minView: "month",
+            autoclose: true
+        });
+    </script>
+</body>
+</html>

+ 138 - 0
qmjszx-admin/src/main/resources/templates/record/record.html

@@ -0,0 +1,138 @@
+<!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('购卡记录列表')"/>
+</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="realName"/>
+                        </li>
+                        <li>
+                            <label>手机号码:</label>
+                            <input type="text" name="mobile"/>
+                        </li>
+                        <li>
+                            <label>状态:</label>
+                            <select name="state" th:with="state=${@dict.getType('card_status')}">
+                                <option value="">所有</option>
+                                <option th:each="dict : ${state}" th:text="${dict.dictLabel}"
+                                        th:value="${dict.dictValue}"></option>
+                            </select>
+                        </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:record:add">
+                <i class="fa fa-plus"></i> 添加
+            </a>
+<!--            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"-->
+<!--               shiro:hasPermission="system:record:edit">-->
+<!--                <i class="fa fa-edit"></i> 修改-->
+<!--            </a>-->
+<!--            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"-->
+<!--               shiro:hasPermission="system:record:remove">-->
+<!--                <i class="fa fa-remove"></i> 删除-->
+<!--            </a>-->
+            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:record: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>
+</div>
+<th:block th:include="include :: footer"/>
+<script th:inline="javascript">
+    var editFlag = [[${@permission.hasPermi('system:record:edit')}]];
+    var removeFlag = [[${@permission.hasPermi('system:record:remove')}]];
+    var prefix = ctx + "record";
+
+    $(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: '主键',
+                    visible: false
+                },
+                {
+                    field: 'userName',
+                    title: '用户账户'
+                },
+                {
+                    field: 'realName',
+                    title: '姓名'
+                },
+                {
+                    field: 'mobile',
+                    title: '手机号码'
+                },
+                {
+                    field: 'cardName',
+                    title: '卡种名称'
+                },
+                {
+                    field: 'price',
+                    title: '价格'
+                },
+                {
+                    field: 'paymentTime',
+                    title: '支付时间'
+                },
+                {
+                    field: 'refundTime',
+                    title: '退款时间'
+                },
+                {
+                    field: 'paymentWay',
+                    title: '支付方式'
+                },
+                {
+                    field: 'stateLabel',
+                    title: '状态'
+                },
+                {
+                    field: 'notes',
+                    title: '备注'
+                // },
+                // {
+                //     title: '操作',
+                //     align: 'center',
+                //     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);
+    });
+</script>
+</body>
+</html>

+ 236 - 0
qmjszx-business/src/main/java/beilv/cardpurchaserecord/domain/CardPurchaseRecord.java

@@ -0,0 +1,236 @@
+package beilv.cardpurchaserecord.domain;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import beilv.common.annotation.Excel;
+import beilv.common.core.domain.BaseEntity;
+
+/**
+ * 购卡记录对象 card_purchase_record
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+public class CardPurchaseRecord extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** 用户id */
+//    @Excel(name = "用户id")
+    private String userId;
+
+    @Excel(name = "用户账户")
+    private String userName;
+
+    @Excel(name = "姓名")
+    private String realName;
+
+    @Excel(name = "手机号码")
+    private String mobile;
+
+    /** 卡种id */
+//    @Excel(name = "卡种id")
+    private String cardId;
+
+    /** 卡种名称 */
+    @Excel(name = "卡种名称")
+    private String cardName;
+
+    /** 价格 */
+    @Excel(name = "价格")
+    private BigDecimal price;
+
+    /** 支付时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date paymentTime;
+
+    /** 退款时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @Excel(name = "退款时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date refundTime;
+
+    /** 支付方式 */
+    @Excel(name = "支付方式")
+    private String paymentWay;
+
+    /** 状态(待使用、已使用、已退款) */
+//    @Excel(name = "状态", readConverterExp = "待=使用、已使用、已退款")
+    private String state;
+
+    @Excel(name = "状态")
+    private String stateLabel;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String notes;
+
+    /** 版本 */
+//    @Excel(name = "版本")
+    private String version;
+
+    public String getStateLabel() {
+        return stateLabel;
+    }
+
+    public void setStateLabel(String stateLabel) {
+        this.stateLabel = stateLabel;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getRealName() {
+        return realName;
+    }
+
+    public void setRealName(String realName) {
+        this.realName = realName;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+
+    public void setUserId(String userId)
+    {
+        this.userId = userId;
+    }
+
+    public String getUserId()
+    {
+        return userId;
+    }
+
+    public String getCardId() {
+        return cardId;
+    }
+
+    public void setCardId(String cardId) {
+        this.cardId = cardId;
+    }
+
+    public String getCardName() {
+        return cardName;
+    }
+
+    public void setCardName(String cardName) {
+        this.cardName = cardName;
+    }
+
+    public void setPrice(BigDecimal price)
+    {
+        this.price = price;
+    }
+
+    public BigDecimal getPrice()
+    {
+        return price;
+    }
+
+    public void setPaymentTime(Date paymentTime)
+    {
+        this.paymentTime = paymentTime;
+    }
+
+    public Date getPaymentTime()
+    {
+        return paymentTime;
+    }
+
+    public void setRefundTime(Date refundTime)
+    {
+        this.refundTime = refundTime;
+    }
+
+    public Date getRefundTime()
+    {
+        return refundTime;
+    }
+
+    public void setPaymentWay(String paymentWay)
+    {
+        this.paymentWay = paymentWay;
+    }
+
+    public String getPaymentWay()
+    {
+        return paymentWay;
+    }
+
+    public void setState(String state)
+    {
+        this.state = state;
+    }
+
+    public String getState()
+    {
+        return state;
+    }
+
+    public void setNotes(String notes)
+    {
+        this.notes = notes;
+    }
+
+    public String getNotes()
+    {
+        return notes;
+    }
+
+    public void setVersion(String version)
+    {
+        this.version = version;
+    }
+
+    public String getVersion()
+    {
+        return version;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("userId", getUserId())
+            .append("carId", getCardId())
+            .append("carName", getCardName())
+            .append("price", getPrice())
+            .append("paymentTime", getPaymentTime())
+            .append("refundTime", getRefundTime())
+            .append("paymentWay", getPaymentWay())
+            .append("state", getState())
+            .append("notes", getNotes())
+            .append("version", getVersion())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 61 - 0
qmjszx-business/src/main/java/beilv/cardpurchaserecord/mapper/CardPurchaseRecordMapper.java

@@ -0,0 +1,61 @@
+package beilv.cardpurchaserecord.mapper;
+
+import beilv.cardpurchaserecord.domain.CardPurchaseRecord;
+
+import java.util.List;
+
+/**
+ * 购卡记录Mapper接口
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+public interface CardPurchaseRecordMapper {
+    /**
+     * 查询购卡记录
+     *
+     * @param id 购卡记录主键
+     * @return 购卡记录
+     */
+    public CardPurchaseRecord selectCardPurchaseRecordById(Long id);
+
+    /**
+     * 查询购卡记录列表
+     *
+     * @param cardPurchaseRecord 购卡记录
+     * @return 购卡记录集合
+     */
+    public List<CardPurchaseRecord> selectCardPurchaseRecordList(CardPurchaseRecord cardPurchaseRecord);
+
+    /**
+     * 新增购卡记录
+     *
+     * @param cardPurchaseRecord 购卡记录
+     * @return 结果
+     */
+    public int insertCardPurchaseRecord(CardPurchaseRecord cardPurchaseRecord);
+
+    /**
+     * 修改购卡记录
+     *
+     * @param cardPurchaseRecord 购卡记录
+     * @return 结果
+     */
+    public int updateCardPurchaseRecord(CardPurchaseRecord cardPurchaseRecord);
+
+    /**
+     * 删除购卡记录
+     *
+     * @param id 购卡记录主键
+     * @return 结果
+     */
+    public int deleteCardPurchaseRecordById(Long id);
+
+    /**
+     * 批量删除购卡记录
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCardPurchaseRecordByIds(String[] ids);
+}

+ 61 - 0
qmjszx-business/src/main/java/beilv/cardpurchaserecord/service/ICardPurchaseRecordService.java

@@ -0,0 +1,61 @@
+package beilv.cardpurchaserecord.service;
+
+import beilv.cardpurchaserecord.domain.CardPurchaseRecord;
+
+import java.util.List;
+
+/**
+ * 购卡记录Service接口
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+public interface ICardPurchaseRecordService {
+    /**
+     * 查询购卡记录
+     *
+     * @param id 购卡记录主键
+     * @return 购卡记录
+     */
+    public CardPurchaseRecord selectCardPurchaseRecordById(Long id);
+
+    /**
+     * 查询购卡记录列表
+     *
+     * @param cardPurchaseRecord 购卡记录
+     * @return 购卡记录集合
+     */
+    public List<CardPurchaseRecord> selectCardPurchaseRecordList(CardPurchaseRecord cardPurchaseRecord);
+
+    /**
+     * 新增购卡记录
+     *
+     * @param cardPurchaseRecord 购卡记录
+     * @return 结果
+     */
+    public int insertCardPurchaseRecord(CardPurchaseRecord cardPurchaseRecord);
+
+    /**
+     * 修改购卡记录
+     *
+     * @param cardPurchaseRecord 购卡记录
+     * @return 结果
+     */
+    public int updateCardPurchaseRecord(CardPurchaseRecord cardPurchaseRecord);
+
+    /**
+     * 批量删除购卡记录
+     *
+     * @param ids 需要删除的购卡记录主键集合
+     * @return 结果
+     */
+    public int deleteCardPurchaseRecordByIds(String ids);
+
+    /**
+     * 删除购卡记录信息
+     *
+     * @param id 购卡记录主键
+     * @return 结果
+     */
+    public int deleteCardPurchaseRecordById(Long id);
+}

+ 104 - 0
qmjszx-business/src/main/java/beilv/cardpurchaserecord/service/impl/CardPurchaseRecordServiceImpl.java

@@ -0,0 +1,104 @@
+package beilv.cardpurchaserecord.service.impl;
+
+import beilv.cardpurchaserecord.domain.CardPurchaseRecord;
+import beilv.cardpurchaserecord.mapper.CardPurchaseRecordMapper;
+import beilv.cardpurchaserecord.service.ICardPurchaseRecordService;
+import beilv.common.core.text.Convert;
+import beilv.common.utils.DateUtils;
+import beilv.common.utils.ShiroUtils;
+import beilv.common.utils.uuid.IdUtils;
+import beilv.system.service.ISysDictDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 购卡记录Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+@Service
+public class CardPurchaseRecordServiceImpl implements ICardPurchaseRecordService {
+    @Autowired
+    private CardPurchaseRecordMapper cardPurchaseRecordMapper;
+
+    @Autowired
+    private ISysDictDataService dictDataService;
+    /**
+     * 查询购卡记录
+     *
+     * @param id 购卡记录主键
+     * @return 购卡记录
+     */
+    @Override
+    public CardPurchaseRecord selectCardPurchaseRecordById(Long id) {
+        return cardPurchaseRecordMapper.selectCardPurchaseRecordById(id);
+    }
+
+    /**
+     * 查询购卡记录列表
+     *
+     * @param cardPurchaseRecord 购卡记录
+     * @return 购卡记录
+     */
+    @Override
+    public List<CardPurchaseRecord> selectCardPurchaseRecordList(CardPurchaseRecord cardPurchaseRecord) {
+        List<CardPurchaseRecord> cardPurchaseRecords = cardPurchaseRecordMapper.selectCardPurchaseRecordList(cardPurchaseRecord);
+        for (CardPurchaseRecord cardPurchaseRecord2 : cardPurchaseRecords) {
+            cardPurchaseRecord2.setStateLabel(dictDataService.selectDictLabel("card_status",cardPurchaseRecord2.getState()));
+        }
+        return cardPurchaseRecords;
+    }
+
+    /**
+     * 新增购卡记录
+     *
+     * @param cardPurchaseRecord 购卡记录
+     * @return 结果
+     */
+    @Override
+    public int insertCardPurchaseRecord(CardPurchaseRecord cardPurchaseRecord) {
+        cardPurchaseRecord.setCreateBy(ShiroUtils.getUserId().toString());
+        cardPurchaseRecord.setCreateTime(DateUtils.getNowDate());
+        cardPurchaseRecord.setState("1");
+        cardPurchaseRecord.setPaymentTime(DateUtils.getNowDate());
+        cardPurchaseRecord.setVersion("0");
+        return cardPurchaseRecordMapper.insertCardPurchaseRecord(cardPurchaseRecord);
+    }
+
+    /**
+     * 修改购卡记录
+     *
+     * @param cardPurchaseRecord 购卡记录
+     * @return 结果
+     */
+    @Override
+    public int updateCardPurchaseRecord(CardPurchaseRecord cardPurchaseRecord) {
+        cardPurchaseRecord.setUpdateTime(DateUtils.getNowDate());
+        return cardPurchaseRecordMapper.updateCardPurchaseRecord(cardPurchaseRecord);
+    }
+
+    /**
+     * 批量删除购卡记录
+     *
+     * @param ids 需要删除的购卡记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCardPurchaseRecordByIds(String ids) {
+        return cardPurchaseRecordMapper.deleteCardPurchaseRecordByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 删除购卡记录信息
+     *
+     * @param id 购卡记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCardPurchaseRecordById(Long id) {
+        return cardPurchaseRecordMapper.deleteCardPurchaseRecordById(id);
+    }
+}

+ 185 - 0
qmjszx-business/src/main/java/beilv/carinformation/domain/CarInformation.java

@@ -0,0 +1,185 @@
+package beilv.carinformation.domain;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import beilv.common.annotation.Excel;
+import beilv.common.core.domain.BaseEntity;
+
+/**
+ * 卡种信息对象 car_information
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+public class CarInformation extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 名称
+     */
+    @Excel(name = "名称")
+    private String name;
+
+    /**
+     * 类型
+     */
+    private String type;
+
+    @Excel(name = "类型")
+    private String typeLabel;
+
+    /**
+     * 可用次数
+     */
+    @Excel(name = "可用次数")
+    private Integer totalNumber;
+
+    /**
+     * 价格
+     */
+    @Excel(name = "价格")
+    private BigDecimal price;
+
+    /**
+     * 单次积分
+     */
+    @Excel(name = "单次积分")
+    private Integer point;
+
+    /**
+     * 有效期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date expirationDate;
+
+    /**
+     * 使用规则
+     */
+    @Excel(name = "使用规则")
+    private String notes;
+
+    /**
+     * 状态(开启;关闭)
+     */
+    private String state;
+
+    @Excel(name = "状态")
+    private String stateLabel;
+
+    public String getTypeLabel() {
+        return typeLabel;
+    }
+
+    public void setTypeLabel(String typeLabel) {
+        this.typeLabel = typeLabel;
+    }
+
+    public String getStateLabel() {
+        return stateLabel;
+    }
+
+    public void setStateLabel(String stateLabel) {
+        this.stateLabel = stateLabel;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setTotalNumber(Integer totalNumber) {
+        this.totalNumber = totalNumber;
+    }
+
+    public Integer getTotalNumber() {
+        return totalNumber;
+    }
+
+    public void setPrice(BigDecimal price) {
+        this.price = price;
+    }
+
+    public BigDecimal getPrice() {
+        return price;
+    }
+
+    public void setPoint(Integer point) {
+        this.point = point;
+    }
+
+    public Integer getPoint() {
+        return point;
+    }
+
+    public void setExpirationDate(Date expirationDate) {
+        this.expirationDate = expirationDate;
+    }
+
+    public Date getExpirationDate() {
+        return expirationDate;
+    }
+
+    public void setNotes(String notes) {
+        this.notes = notes;
+    }
+
+    public String getNotes() {
+        return notes;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("name", getName())
+                .append("type", getType())
+                .append("totalNumber", getTotalNumber())
+                .append("price", getPrice())
+                .append("point", getPoint())
+                .append("expirationDate", getExpirationDate())
+                .append("notes", getNotes())
+                .append("state", getState())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .toString();
+    }
+}

+ 61 - 0
qmjszx-business/src/main/java/beilv/carinformation/mapper/CarInformationMapper.java

@@ -0,0 +1,61 @@
+package beilv.carinformation.mapper;
+
+import beilv.carinformation.domain.CarInformation;
+
+import java.util.List;
+
+/**
+ * 卡种信息Mapper接口
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+public interface CarInformationMapper {
+    /**
+     * 查询卡种信息
+     *
+     * @param id 卡种信息主键
+     * @return 卡种信息
+     */
+    public CarInformation selectCarInformationById(Long id);
+
+    /**
+     * 查询卡种信息列表
+     *
+     * @param carInformation 卡种信息
+     * @return 卡种信息集合
+     */
+    public List<CarInformation> selectCarInformationList(CarInformation carInformation);
+
+    /**
+     * 新增卡种信息
+     *
+     * @param carInformation 卡种信息
+     * @return 结果
+     */
+    public int insertCarInformation(CarInformation carInformation);
+
+    /**
+     * 修改卡种信息
+     *
+     * @param carInformation 卡种信息
+     * @return 结果
+     */
+    public int updateCarInformation(CarInformation carInformation);
+
+    /**
+     * 删除卡种信息
+     *
+     * @param id 卡种信息主键
+     * @return 结果
+     */
+    public int deleteCarInformationById(Long id);
+
+    /**
+     * 批量删除卡种信息
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCarInformationByIds(String[] ids);
+}

+ 61 - 0
qmjszx-business/src/main/java/beilv/carinformation/service/ICarInformationService.java

@@ -0,0 +1,61 @@
+package beilv.carinformation.service;
+
+import beilv.carinformation.domain.CarInformation;
+
+import java.util.List;
+
+/**
+ * 卡种信息Service接口
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+public interface ICarInformationService {
+    /**
+     * 查询卡种信息
+     *
+     * @param id 卡种信息主键
+     * @return 卡种信息
+     */
+    public CarInformation selectCarInformationById(Long id);
+
+    /**
+     * 查询卡种信息列表
+     *
+     * @param carInformation 卡种信息
+     * @return 卡种信息集合
+     */
+    public List<CarInformation> selectCarInformationList(CarInformation carInformation);
+
+    /**
+     * 新增卡种信息
+     *
+     * @param carInformation 卡种信息
+     * @return 结果
+     */
+    public int insertCarInformation(CarInformation carInformation);
+
+    /**
+     * 修改卡种信息
+     *
+     * @param carInformation 卡种信息
+     * @return 结果
+     */
+    public int updateCarInformation(CarInformation carInformation);
+
+    /**
+     * 批量删除卡种信息
+     *
+     * @param ids 需要删除的卡种信息主键集合
+     * @return 结果
+     */
+    public int deleteCarInformationByIds(String ids);
+
+    /**
+     * 删除卡种信息信息
+     *
+     * @param id 卡种信息主键
+     * @return 结果
+     */
+    public int deleteCarInformationById(Long id);
+}

+ 103 - 0
qmjszx-business/src/main/java/beilv/carinformation/service/impl/CarInformationServiceImpl.java

@@ -0,0 +1,103 @@
+package beilv.carinformation.service.impl;
+
+import beilv.carinformation.domain.CarInformation;
+import beilv.carinformation.mapper.CarInformationMapper;
+import beilv.carinformation.service.ICarInformationService;
+import beilv.common.core.text.Convert;
+import beilv.common.utils.DateUtils;
+import beilv.common.utils.ShiroUtils;
+import beilv.common.utils.uuid.IdUtils;
+import beilv.system.service.ISysDictDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 卡种信息Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+@Service
+public class CarInformationServiceImpl implements ICarInformationService {
+    @Autowired
+    private CarInformationMapper carInformationMapper;
+    @Autowired
+    private ISysDictDataService dictDataService;
+
+    /**
+     * 查询卡种信息
+     *
+     * @param id 卡种信息主键
+     * @return 卡种信息
+     */
+    @Override
+    public CarInformation selectCarInformationById(Long id) {
+        return carInformationMapper.selectCarInformationById(id);
+    }
+
+    /**
+     * 查询卡种信息列表
+     *
+     * @param carInformation 卡种信息
+     * @return 卡种信息
+     */
+    @Override
+    public List<CarInformation> selectCarInformationList(CarInformation carInformation) {
+        List<CarInformation> carInformations = carInformationMapper.selectCarInformationList(carInformation);
+        for (CarInformation carInformation1 : carInformations) {
+            carInformation1.setTypeLabel(dictDataService.selectDictLabel("card_type",carInformation1.getType()));
+            carInformation1.setStateLabel(dictDataService.selectDictLabel("sys_job_status",carInformation1.getState()));
+        }
+        return carInformations;
+    }
+
+    /**
+     * 新增卡种信息
+     *
+     * @param carInformation 卡种信息
+     * @return 结果
+     */
+    @Override
+    public int insertCarInformation(CarInformation carInformation) {
+        carInformation.setCreateTime(DateUtils.getNowDate());
+        carInformation.setCreateBy(ShiroUtils.getUserId().toString());
+        return carInformationMapper.insertCarInformation(carInformation);
+    }
+
+    /**
+     * 修改卡种信息
+     *
+     * @param carInformation 卡种信息
+     * @return 结果
+     */
+    @Override
+    public int updateCarInformation(CarInformation carInformation) {
+        carInformation.setUpdateTime(DateUtils.getNowDate());
+        carInformation.setUpdateBy(ShiroUtils.getUserId().toString());
+        return carInformationMapper.updateCarInformation(carInformation);
+    }
+
+    /**
+     * 批量删除卡种信息
+     *
+     * @param ids 需要删除的卡种信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCarInformationByIds(String ids) {
+        return carInformationMapper.deleteCarInformationByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 删除卡种信息信息
+     *
+     * @param id 卡种信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCarInformationById(Long id) {
+        return carInformationMapper.deleteCarInformationById(id);
+    }
+}

+ 160 - 0
qmjszx-business/src/main/java/beilv/usermembershipcard/domain/UserMembershipCard.java

@@ -0,0 +1,160 @@
+package beilv.usermembershipcard.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import beilv.common.annotation.Excel;
+import beilv.common.core.domain.BaseEntity;
+
+/**
+ * 用户会员卡对象 user_membership_card
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+public class UserMembershipCard extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** 用户id */
+//    @Excel(name = "用户id")
+    private String userId;
+
+    /** 卡种id */
+//    @Excel(name = "卡种id")
+    private String cardId;
+
+    @Excel(name = "用户账户")
+    private String userName;
+
+    @Excel(name = "姓名")
+    private String realName;
+
+    @Excel(name = "手机号码")
+    private String mobile;
+
+    @Excel(name = "卡种名称")
+    private String cardName;
+
+    /** 总次数 */
+    @Excel(name = "总次数")
+    private Integer totalNumber;
+
+    /** 剩余次数 */
+    @Excel(name = "剩余次数")
+    private Integer remainingNumber;
+
+    /** 版本 */
+//    @Excel(name = "版本")
+    private String version;
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getRealName() {
+        return realName;
+    }
+
+    public void setRealName(String realName) {
+        this.realName = realName;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getCardName() {
+        return cardName;
+    }
+
+    public void setCardName(String cardName) {
+        this.cardName = cardName;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+
+    public void setUserId(String userId)
+    {
+        this.userId = userId;
+    }
+
+    public String getUserId()
+    {
+        return userId;
+    }
+
+    public void setCardId(String cardId)
+    {
+        this.cardId = cardId;
+    }
+
+    public String getCardId()
+    {
+        return cardId;
+    }
+
+    public void setTotalNumber(Integer totalNumber)
+    {
+        this.totalNumber = totalNumber;
+    }
+
+    public Integer getTotalNumber()
+    {
+        return totalNumber;
+    }
+
+    public void setRemainingNumber(Integer remainingNumber)
+    {
+        this.remainingNumber = remainingNumber;
+    }
+
+    public Integer getRemainingNumber()
+    {
+        return remainingNumber;
+    }
+
+    public void setVersion(String version)
+    {
+        this.version = version;
+    }
+
+    public String getVersion()
+    {
+        return version;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("userId", getUserId())
+            .append("carId", getCardId())
+            .append("totalNumber", getTotalNumber())
+            .append("remainingNumber", getRemainingNumber())
+            .append("version", getVersion())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 61 - 0
qmjszx-business/src/main/java/beilv/usermembershipcard/mapper/UserMembershipCardMapper.java

@@ -0,0 +1,61 @@
+package beilv.usermembershipcard.mapper;
+
+import beilv.usermembershipcard.domain.UserMembershipCard;
+
+import java.util.List;
+
+/**
+ * 用户会员卡Mapper接口
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+public interface UserMembershipCardMapper {
+    /**
+     * 查询用户会员卡
+     *
+     * @param id 用户会员卡主键
+     * @return 用户会员卡
+     */
+    public UserMembershipCard selectUserMembershipCardById(Long id);
+
+    /**
+     * 查询用户会员卡列表
+     *
+     * @param userMembershipCard 用户会员卡
+     * @return 用户会员卡集合
+     */
+    public List<UserMembershipCard> selectUserMembershipCardList(UserMembershipCard userMembershipCard);
+
+    /**
+     * 新增用户会员卡
+     *
+     * @param userMembershipCard 用户会员卡
+     * @return 结果
+     */
+    public int insertUserMembershipCard(UserMembershipCard userMembershipCard);
+
+    /**
+     * 修改用户会员卡
+     *
+     * @param userMembershipCard 用户会员卡
+     * @return 结果
+     */
+    public int updateUserMembershipCard(UserMembershipCard userMembershipCard);
+
+    /**
+     * 删除用户会员卡
+     *
+     * @param id 用户会员卡主键
+     * @return 结果
+     */
+    public int deleteUserMembershipCardById(Long id);
+
+    /**
+     * 批量删除用户会员卡
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteUserMembershipCardByIds(String[] ids);
+}

+ 61 - 0
qmjszx-business/src/main/java/beilv/usermembershipcard/service/IUserMembershipCardService.java

@@ -0,0 +1,61 @@
+package beilv.usermembershipcard.service;
+
+import beilv.usermembershipcard.domain.UserMembershipCard;
+
+import java.util.List;
+
+/**
+ * 用户会员卡Service接口
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+public interface IUserMembershipCardService {
+    /**
+     * 查询用户会员卡
+     *
+     * @param id 用户会员卡主键
+     * @return 用户会员卡
+     */
+    public UserMembershipCard selectUserMembershipCardById(Long id);
+
+    /**
+     * 查询用户会员卡列表
+     *
+     * @param userMembershipCard 用户会员卡
+     * @return 用户会员卡集合
+     */
+    public List<UserMembershipCard> selectUserMembershipCardList(UserMembershipCard userMembershipCard);
+
+    /**
+     * 新增用户会员卡
+     *
+     * @param userMembershipCard 用户会员卡
+     * @return 结果
+     */
+    public int insertUserMembershipCard(UserMembershipCard userMembershipCard);
+
+    /**
+     * 修改用户会员卡
+     *
+     * @param userMembershipCard 用户会员卡
+     * @return 结果
+     */
+    public int updateUserMembershipCard(UserMembershipCard userMembershipCard);
+
+    /**
+     * 批量删除用户会员卡
+     *
+     * @param ids 需要删除的用户会员卡主键集合
+     * @return 结果
+     */
+    public int deleteUserMembershipCardByIds(String ids);
+
+    /**
+     * 删除用户会员卡信息
+     *
+     * @param id 用户会员卡主键
+     * @return 结果
+     */
+    public int deleteUserMembershipCardById(Long id);
+}

+ 92 - 0
qmjszx-business/src/main/java/beilv/usermembershipcard/service/impl/UserMembershipCardServiceImpl.java

@@ -0,0 +1,92 @@
+package beilv.usermembershipcard.service.impl;
+
+import beilv.common.core.text.Convert;
+import beilv.common.utils.DateUtils;
+import beilv.common.utils.uuid.IdUtils;
+import beilv.usermembershipcard.domain.UserMembershipCard;
+import beilv.usermembershipcard.mapper.UserMembershipCardMapper;
+import beilv.usermembershipcard.service.IUserMembershipCardService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 用户会员卡Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2025-01-02
+ */
+@Service
+public class UserMembershipCardServiceImpl implements IUserMembershipCardService {
+    @Autowired
+    private UserMembershipCardMapper userMembershipCardMapper;
+
+    /**
+     * 查询用户会员卡
+     *
+     * @param id 用户会员卡主键
+     * @return 用户会员卡
+     */
+    @Override
+    public UserMembershipCard selectUserMembershipCardById(Long id) {
+        return userMembershipCardMapper.selectUserMembershipCardById(id);
+    }
+
+    /**
+     * 查询用户会员卡列表
+     *
+     * @param userMembershipCard 用户会员卡
+     * @return 用户会员卡
+     */
+    @Override
+    public List<UserMembershipCard> selectUserMembershipCardList(UserMembershipCard userMembershipCard) {
+        return userMembershipCardMapper.selectUserMembershipCardList(userMembershipCard);
+    }
+
+    /**
+     * 新增用户会员卡
+     *
+     * @param userMembershipCard 用户会员卡
+     * @return 结果
+     */
+    @Override
+    public int insertUserMembershipCard(UserMembershipCard userMembershipCard) {
+        userMembershipCard.setCreateTime(DateUtils.getNowDate());
+        return userMembershipCardMapper.insertUserMembershipCard(userMembershipCard);
+    }
+
+    /**
+     * 修改用户会员卡
+     *
+     * @param userMembershipCard 用户会员卡
+     * @return 结果
+     */
+    @Override
+    public int updateUserMembershipCard(UserMembershipCard userMembershipCard) {
+        userMembershipCard.setUpdateTime(DateUtils.getNowDate());
+        return userMembershipCardMapper.updateUserMembershipCard(userMembershipCard);
+    }
+
+    /**
+     * 批量删除用户会员卡
+     *
+     * @param ids 需要删除的用户会员卡主键
+     * @return 结果
+     */
+    @Override
+    public int deleteUserMembershipCardByIds(String ids) {
+        return userMembershipCardMapper.deleteUserMembershipCardByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 删除用户会员卡信息
+     *
+     * @param id 用户会员卡主键
+     * @return 结果
+     */
+    @Override
+    public int deleteUserMembershipCardById(Long id) {
+        return userMembershipCardMapper.deleteUserMembershipCardById(id);
+    }
+}

+ 110 - 0
qmjszx-business/src/main/resources/mapper/card/CarInformationMapper.xml

@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="beilv.carinformation.mapper.CarInformationMapper">
+
+    <resultMap type="CarInformation" id="CarInformationResult">
+        <result property="id"    column="id"    />
+        <result property="name"    column="name"    />
+        <result property="type"    column="type"    />
+        <result property="totalNumber"    column="total_number"    />
+        <result property="price"    column="price"    />
+        <result property="point"    column="point"    />
+        <result property="expirationDate"    column="expiration_date"    />
+        <result property="notes"    column="notes"    />
+        <result property="state"    column="state"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectCarInformationVo">
+        select id, name, type, total_number, price, point, expiration_date, notes, state, create_by, create_time, update_by, update_time from card_information
+    </sql>
+
+    <select id="selectCarInformationList" parameterType="CarInformation" resultMap="CarInformationResult">
+        <include refid="selectCarInformationVo"/>
+        <where>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="totalNumber != null "> and total_number = #{totalNumber}</if>
+            <if test="price != null "> and price = #{price}</if>
+            <if test="point != null "> and point = #{point}</if>
+            <if test="expirationDate != null "> and expiration_date = #{expirationDate}</if>
+            <if test="notes != null  and notes != ''"> and notes = #{notes}</if>
+            <if test="state != null  and state != ''"> and state = #{state}</if>
+        </where>
+    </select>
+
+    <select id="selectCarInformationById" parameterType="Long" resultMap="CarInformationResult">
+        <include refid="selectCarInformationVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertCarInformation" parameterType="CarInformation">
+        insert into card_information
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="name != null">name,</if>
+            <if test="type != null">type,</if>
+            <if test="totalNumber != null">total_number,</if>
+            <if test="price != null">price,</if>
+            <if test="point != null">point,</if>
+            <if test="expirationDate != null">expiration_date,</if>
+            <if test="notes != null">notes,</if>
+            <if test="state != null">state,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="name != null">#{name},</if>
+            <if test="type != null">#{type},</if>
+            <if test="totalNumber != null">#{totalNumber},</if>
+            <if test="price != null">#{price},</if>
+            <if test="point != null">#{point},</if>
+            <if test="expirationDate != null">#{expirationDate},</if>
+            <if test="notes != null">#{notes},</if>
+            <if test="state != null">#{state},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCarInformation" parameterType="CarInformation">
+        update card_information
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="name != null">name = #{name},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="totalNumber != null">total_number = #{totalNumber},</if>
+            <if test="price != null">price = #{price},</if>
+            <if test="point != null">point = #{point},</if>
+            <if test="expirationDate != null">expiration_date = #{expirationDate},</if>
+            <if test="notes != null">notes = #{notes},</if>
+            <if test="state != null">state = #{state},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCarInformationById" parameterType="Long">
+        delete from card_information where id = #{id}
+    </delete>
+
+    <delete id="deleteCarInformationByIds" parameterType="String">
+        delete from card_information where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+</mapper>

+ 128 - 0
qmjszx-business/src/main/resources/mapper/card/CardPurchaseRecordMapper.xml

@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="beilv.cardpurchaserecord.mapper.CardPurchaseRecordMapper">
+
+    <resultMap type="CardPurchaseRecord" id="CardPurchaseRecordResult">
+        <result property="id"    column="id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="cardId"    column="card_id"    />
+        <result property="cardName"    column="card_name"    />
+        <result property="price"    column="price"    />
+        <result property="paymentTime"    column="payment_time"    />
+        <result property="refundTime"    column="refund_time"    />
+        <result property="paymentWay"    column="payment_way"    />
+        <result property="state"    column="state"    />
+        <result property="notes"    column="notes"    />
+        <result property="version"    column="version"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="userName"    column="username"    />
+        <result property="realName"    column="real_name"    />
+        <result property="mobile"    column="mobile"    />
+    </resultMap>
+
+    <sql id="selectCardPurchaseRecordVo">
+        select a.id, a.user_id, a.card_id, a.card_name, a.price, a.payment_time, a.refund_time, a.payment_way, a.state, a.notes, a.version, a.create_by, a.create_time, a.update_by, a.update_time from card_purchase_record a
+    </sql>
+
+    <select id="selectCardPurchaseRecordList" parameterType="CardPurchaseRecord" resultMap="CardPurchaseRecordResult">
+        select a.id, a.user_id, a.card_id, a.card_name, a.price, a.payment_time, a.refund_time, a.payment_way, a.state, a.notes, a.version, a.create_by, a.create_time, a.update_by, a.update_time,
+        b.username,b.real_name,b.mobile
+        from card_purchase_record a
+        left join sys_member b on a.user_id = b.id
+        <where>
+            <if test="userId != null  and userId != ''"> and user_id = #{userId}</if>
+            <if test="cardId != null  and cardId != ''"> and card_id = #{cardId}</if>
+            <if test="cardName != null  and cardName != ''"> and card_name like concat('%', #{cardName}, '%')</if>
+            <if test="price != null "> and price = #{price}</if>
+            <if test="paymentTime != null "> and payment_time = #{paymentTime}</if>
+            <if test="refundTime != null "> and refund_time = #{refundTime}</if>
+            <if test="paymentWay != null  and paymentWay != ''"> and payment_way = #{paymentWay}</if>
+            <if test="state != null  and state != ''"> and state = #{state}</if>
+            <if test="notes != null  and notes != ''"> and notes = #{notes}</if>
+            <if test="version != null  and version != ''"> and version = #{version}</if>
+            <if test="realName != null  and realName != ''"> and b.real_name like concat('%', #{realName}, '%')</if>
+            <if test="mobile != null  and mobile != ''"> and b.mobile like concat('%', #{mobile}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectCardPurchaseRecordById" parameterType="Long" resultMap="CardPurchaseRecordResult">
+        <include refid="selectCardPurchaseRecordVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertCardPurchaseRecord" parameterType="CardPurchaseRecord">
+        insert into card_purchase_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="cardId != null">card_id,</if>
+            <if test="cardName != null">card_name,</if>
+            <if test="price != null">price,</if>
+            <if test="paymentTime != null">payment_time,</if>
+            <if test="refundTime != null">refund_time,</if>
+            <if test="paymentWay != null">payment_way,</if>
+            <if test="state != null">state,</if>
+            <if test="notes != null">notes,</if>
+            <if test="version != null">version,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="cardId != null">#{cardId},</if>
+            <if test="cardName != null">#{cardName},</if>
+            <if test="price != null">#{price},</if>
+            <if test="paymentTime != null">#{paymentTime},</if>
+            <if test="refundTime != null">#{refundTime},</if>
+            <if test="paymentWay != null">#{paymentWay},</if>
+            <if test="state != null">#{state},</if>
+            <if test="notes != null">#{notes},</if>
+            <if test="version != null">#{version},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCardPurchaseRecord" parameterType="CardPurchaseRecord">
+        update card_purchase_record
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="cardId != null">card_id = #{cardId},</if>
+            <if test="cardName != null">card_name = #{cardName},</if>
+            <if test="price != null">price = #{price},</if>
+            <if test="paymentTime != null">payment_time = #{paymentTime},</if>
+            <if test="refundTime != null">refund_time = #{refundTime},</if>
+            <if test="paymentWay != null">payment_way = #{paymentWay},</if>
+            <if test="state != null">state = #{state},</if>
+            <if test="notes != null">notes = #{notes},</if>
+            <if test="version != null">version = #{version},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCardPurchaseRecordById" parameterType="Long">
+        delete from card_purchase_record where id = #{id}
+    </delete>
+
+    <delete id="deleteCardPurchaseRecordByIds" parameterType="String">
+        delete from card_purchase_record where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+</mapper>

+ 115 - 0
qmjszx-business/src/main/resources/mapper/card/UserMembershipCardMapper.xml

@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="beilv.usermembershipcard.mapper.UserMembershipCardMapper">
+
+    <resultMap type="UserMembershipCard" id="UserMembershipCardResult">
+        <result property="id"    column="id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="cardId"    column="card_id"    />
+        <result property="totalNumber"    column="total_number"    />
+        <result property="remainingNumber"    column="remaining_number"    />
+        <result property="version"    column="version"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="userName"    column="username"    />
+        <result property="realName"    column="real_name"    />
+        <result property="mobile"    column="mobile"    />
+        <result property="cardName"    column="cardName"    />
+    </resultMap>
+
+    <sql id="selectUserMembershipCardVo">
+        select id, user_id, card_id, total_number, remaining_number, version, create_by, create_time, update_by, update_time from user_membership_card
+    </sql>
+
+    <select id="selectUserMembershipCardList" parameterType="UserMembershipCard" resultMap="UserMembershipCardResult">
+        SELECT
+            a.id,
+            a.user_id,
+            b.username,
+            b.real_name,
+            b.mobile,
+            a.card_id,
+            c.name cardName,
+            a.total_number,
+            a.remaining_number
+        FROM
+            user_membership_card a
+            left join sys_member b on a.user_id = b.id
+            left join card_information c on a.card_id = c.id
+        <where>
+            <if test="userId != null  and userId != ''"> and a.user_id = #{userId}</if>
+            <if test="cardId != null  and cardId != ''"> and a.card_id = #{cardId}</if>
+            <if test="totalNumber != null "> and a.total_number = #{totalNumber}</if>
+            <if test="remainingNumber != null "> and a.remaining_number = #{remainingNumber}</if>
+            <if test="version != null  and version != ''"> and a.version = #{version}</if>
+            <if test="realName != null  and realName != ''"> and b.real_name like concat('%', #{realName}, '%')</if>
+            <if test="mobile != null  and mobile != ''"> and b.mobile like concat('%', #{mobile}, '%')</if>
+            <if test="cardName != null  and cardName != ''"> and c.name like concat('%', #{cardName}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectUserMembershipCardById" parameterType="Long" resultMap="UserMembershipCardResult">
+        <include refid="selectUserMembershipCardVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertUserMembershipCard" parameterType="UserMembershipCard">
+        insert into user_membership_card
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="cardId != null">card_id,</if>
+            <if test="totalNumber != null">total_number,</if>
+            <if test="remainingNumber != null">remaining_number,</if>
+            <if test="version != null">version,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="cardId != null">#{cardId},</if>
+            <if test="totalNumber != null">#{totalNumber},</if>
+            <if test="remainingNumber != null">#{remainingNumber},</if>
+            <if test="version != null">#{version},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateUserMembershipCard" parameterType="UserMembershipCard">
+        update user_membership_card
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="cardId != null">card_id = #{cardId},</if>
+            <if test="totalNumber != null">total_number = #{totalNumber},</if>
+            <if test="remainingNumber != null">remaining_number = #{remainingNumber},</if>
+            <if test="version != null">version = #{version},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteUserMembershipCardById" parameterType="Long">
+        delete from user_membership_card where id = #{id}
+    </delete>
+
+    <delete id="deleteUserMembershipCardByIds" parameterType="String">
+        delete from user_membership_card where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+</mapper>