Forráskód Böngészése

积分流水详情

bihuisong 5 hónapja
szülő
commit
c749544e2c

+ 2 - 2
qmjszx-admin/src/main/resources/templates/system/bill/bill.html

@@ -77,8 +77,8 @@
                     visible: false
                 },
                 {
-                    field: 'userId',
-                    title: '用户uid'
+                    field: 'realName',
+                    title: '用户名称'
                 },
                 {
                     field: 'title',

+ 71 - 0
qmjszx-admin/src/main/resources/templates/system/bill/billList.html

@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <th:block th:include="include :: header('用户积分流水列表')" th:value="${id}"/>
+</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>-->
+<!--                                <input type="hidden" name="id" id="id" th:value="${id}"/>-->
+<!--                            </li>-->
+<!--                        </ul>-->
+<!--                    </div>-->
+<!--                </form>-->
+<!--            </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 prefix = ctx + "system/bill";
+
+        $(function() {
+            var options = {
+                url: prefix + "/listByUserId",
+                modalName: "用户积分流水详情",
+                columns: [{
+                    checkbox: true
+                },
+                {
+                    field: 'id',
+                    title: '用户账单id',
+                    visible: false
+                },
+                {
+                    field: 'realName',
+                    title: '用户名称'
+                },
+                {
+                    field: 'title',
+                    title: '账单标题'
+                },
+                {
+                    field: 'number',
+                    title: '明细数字'
+                },
+                {
+                    field: 'balance',
+                    title: '剩余'
+                },
+                {
+                    field: 'useCategory',
+                    title: '积分用途'
+                },
+                {
+                    field: 'remark',
+                    title: '备注'
+                },
+                ]
+            };
+            $.table.init(options);
+        });
+    </script>
+</body>
+</html>

+ 71 - 64
qmjszx-admin/src/main/resources/templates/system/member/member.html

@@ -1,69 +1,71 @@
 <!DOCTYPE html>
-<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<html lang="zh" xmlns:th="http://www.thymeleaf.org">
 <head>
-    <th:block th:include="include :: header('会员用户信息列表')" />
+    <th:block th:include="include :: header('会员用户信息列表')"/>
 </head>
 <body class="gray-bg">
-     <div class="container-div">
-        <div class="row">
-            <div class="col-sm-12 search-collapse">
-                <form id="formId">
-                    <div class="select-list">
-                        <ul>
-                            <li>
-                                <label>真实姓名:</label>
-                                <input type="text" name="realName"/>
-                            </li>
-                            <li>
-                                <label>手机号码:</label>
-                                <input type="text" name="mobile"/>
-                            </li>
-                            <li>
-                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
-                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
-                            </li>
-                        </ul>
-                    </div>
-                </form>
-            </div>
+<div class="container-div">
+    <div class="row">
+        <div class="col-sm-12 search-collapse">
+            <form id="formId">
+                <div class="select-list">
+                    <ul>
+                        <li>
+                            <label>真实姓名:</label>
+                            <input type="text" name="realName"/>
+                        </li>
+                        <li>
+                            <label>手机号码:</label>
+                            <input type="text" name="mobile"/>
+                        </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()">-->
-<!--                    <i class="fa fa-plus"></i> 添加-->
-<!--                </a>-->
-<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()">-->
-<!--                    <i class="fa fa-edit"></i> 修改-->
-<!--                </a>-->
-<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()">-->
-<!--                    <i class="fa fa-remove"></i> 删除-->
-<!--                </a>-->
-<!--                <a class="btn btn-warning" onclick="$.table.exportExcel()">-->
-<!--                    <i class="fa fa-download"></i> 导出-->
-<!--                </a>-->
-            </div>
-            <div class="col-sm-12 select-table table-striped">
-                <table id="bootstrap-table"></table>
-            </div>
+        <div class="btn-group-sm" id="toolbar" role="group">
+            <!--                <a class="btn btn-success" onclick="$.operate.add()">-->
+            <!--                    <i class="fa fa-plus"></i> 添加-->
+            <!--                </a>-->
+            <!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()">-->
+            <!--                    <i class="fa fa-edit"></i> 修改-->
+            <!--                </a>-->
+            <!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()">-->
+            <!--                    <i class="fa fa-remove"></i> 删除-->
+            <!--                </a>-->
+            <!--                <a class="btn btn-warning" onclick="$.table.exportExcel()">-->
+            <!--                    <i class="fa fa-download"></i> 导出-->
+            <!--                </a>-->
+        </div>
+        <div class="col-sm-12 select-table table-striped">
+            <table id="bootstrap-table"></table>
         </div>
     </div>
-    <th:block th:include="include :: footer" />
-    <script th:inline="javascript">
-        var editFlag = [[${@permission.hasPermi('system:member:edit')}]];
-        var removeFlag = [[${@permission.hasPermi('system:member:remove')}]];
-        var prefix = ctx + "system/member";
+</div>
+<th:block th:include="include :: footer"/>
+<script th:inline="javascript">
+    var editFlag = [[${@permission.hasPermi('system:member:edit')}]];
+    var removeFlag = [[${@permission.hasPermi('system:member:remove')}]];
+    var prefix = ctx + "system/member";
 
-        $(function() {
-            var options = {
-                url: prefix + "/list",
-                createUrl: prefix + "/add",
-                updateUrl: prefix + "/edit/{id}",
-                removeUrl: prefix + "/remove",
-                exportUrl: prefix + "/export",
-                exchangeUrl: "system/bill/exchange/{id}",
-                modalName: "礼品",
-                columns: [{
-                    checkbox: true
-                },
+    $(function () {
+        var options = {
+            url: prefix + "/list",
+            createUrl: prefix + "/add",
+            updateUrl: prefix + "/edit/{id}",
+            removeUrl: prefix + "/remove",
+            exportUrl: prefix + "/export",
+            exchangeUrl: "system/bill/exchange/{id}",
+            modalName: "礼品",
+            columns: [{
+                checkbox: true
+            },
                 {
                     field: 'id',
                     title: '用户id',
@@ -100,17 +102,22 @@
                 {
                     title: '操作',
                     align: 'center',
-                    formatter: function(value, row, index) {
+                    formatter: function (value, row, index) {
                         var actions = [];
                         // actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
-                        actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="$.operate.exchange(\'' + row.id + '\')"><i class="fa fa-exchange"></i>兑换</a>');
+                        actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="listByUserId(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a>');
+                        actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="$.operate.exchange(\'' + row.id + '\')"><i class="fa fa-plus"></i>兑换</a>');
                         // actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                         return actions.join('');
                     }
                 }]
-            };
-            $.table.init(options);
-        });
-    </script>
+        };
+        $.table.init(options);
+    });
+
+    function listByUserId(id) {
+        $.modal.open("用户积分流水列表", ctx + "system/bill/flowingWater/" + id);
+    }
+</script>
 </body>
 </html>

+ 20 - 0
qmjszx-business/src/main/java/beilv/userbill/controller/SysUserBillController.java

@@ -135,4 +135,24 @@ public class SysUserBillController extends BaseController {
     public AjaxResult exchangeSave(SysMemberDTO dto) {
         return toAjax(sysUserBillService.exchange(dto));
     }
+
+    /**
+     * 用户积分流水列表
+     */
+    @GetMapping("/flowingWater/{id}")
+    public String flowingWater(@PathVariable("id") Long id, ModelMap mmap) {
+        mmap.put("id", id);
+        return prefix + "/billList";
+    }
+
+    /**
+     * 查询用户积分流水列表
+     */
+    @PostMapping("/listByUserId")
+    @ResponseBody
+    public TableDataInfo listByUserId(SysUserBill sysUserBill) {
+        startPage();
+        List<SysUserBill> list = sysUserBillService.listByUserId(sysUserBill.getId());
+        return getDataTable(list);
+    }
 }

+ 14 - 0
qmjszx-business/src/main/java/beilv/userbill/domain/SysUserBill.java

@@ -93,6 +93,11 @@ public class SysUserBill {
      */
     private Integer delFlag;
 
+    /**
+     * 用户名称
+     */
+    private String realName;
+
     public void setId(Long id) {
         this.id = id;
     }
@@ -205,6 +210,14 @@ public class SysUserBill {
         this.remark = remark;
     }
 
+    public String getRealName() {
+        return realName;
+    }
+
+    public void setRealName(String realName) {
+        this.realName = realName;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@@ -222,6 +235,7 @@ public class SysUserBill {
                 .append("updateBy", getUpdateBy())
                 .append("updateTime", getUpdateTime())
                 .append("delFlag", getDelFlag())
+                .append("realName", getRealName())
                 .toString();
     }
 }

+ 8 - 0
qmjszx-business/src/main/java/beilv/userbill/mapper/SysUserBillMapper.java

@@ -74,4 +74,12 @@ public interface SysUserBillMapper
      */
     void income(Long userId, String title, BigDecimal number,
                 BigDecimal balance, String remark);
+
+    /**
+     * 根据userId查询用户积分流水列表
+     *
+     * @param userId 用户ID
+     * @return 用户积分流水集合
+     */
+    public List<SysUserBill> listByUserId(Long userId);
 }

+ 8 - 0
qmjszx-business/src/main/java/beilv/userbill/service/ISysUserBillService.java

@@ -92,4 +92,12 @@ public interface ISysUserBillService {
      * @return 结果
      */
     int exchange(SysMemberDTO dto);
+
+    /**
+     * 根据userId查询用户积分流水列表
+     *
+     * @param userId 用户ID
+     * @return 用户积分流水集合
+     */
+    public List<SysUserBill> listByUserId(Long userId);
 }

+ 6 - 0
qmjszx-business/src/main/java/beilv/userbill/service/impl/SysUserBillServiceImpl.java

@@ -14,6 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
+import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 
@@ -156,4 +157,9 @@ public class SysUserBillServiceImpl implements ISysUserBillService {
         return sysMemberMapper.updateSysMember(sysMember);
     }
 
+    @Override
+    public List<SysUserBill> listByUserId(Long userId) {
+        return sysUserBillMapper.listByUserId(userId);
+    }
+
 }

+ 49 - 22
qmjszx-business/src/main/resources/mapper/userbill/SysUserBillMapper.xml

@@ -19,37 +19,41 @@
         <result property="updateBy" column="update_by"/>
         <result property="updateTime" column="update_time"/>
         <result property="delFlag" column="del_flag"/>
+        <result property="realName" column="real_name"/>
     </resultMap>
 
     <sql id="selectSysUserBillVo">
-        select id,
-               user_id,
-               pm,
-               title,
-               number,
-               balance,
-               use_category,
-               remark,
-               status,
-               create_by,
-               create_time,
-               update_by,
-               update_time,
-               del_flag
-        from sys_user_bill
+        select sub.id,
+               sub.user_id,
+               sub.pm,
+               sub.title,
+               sub.number,
+               sub.balance,
+               sub.use_category,
+               sub.remark,
+               sub.status,
+               sub.create_by,
+               sub.create_time,
+               sub.update_by,
+               sub.update_time,
+               sub.del_flag,
+               sm.real_name
+        from sys_user_bill sub
+                 left join sys_member sm on sub.user_id = sm.id
     </sql>
 
     <select id="selectSysUserBillList" parameterType="SysUserBill" resultMap="SysUserBillResult">
         <include refid="selectSysUserBillVo"/>
         <where>
-            <if test="userId != null ">and user_id = #{userId}</if>
-            <if test="pm != null ">and pm = #{pm}</if>
-            <if test="title != null  and title != ''">and title = #{title}</if>
-            <if test="number != null ">and number = #{number}</if>
-            <if test="balance != null ">and balance = #{balance}</if>
-            <if test="useCategory != null  and useCategory != ''">and use_category = #{useCategory}</if>
-            <if test="status != null ">and status = #{status}</if>
+            <if test="userId != null ">and sub.user_id = #{userId}</if>
+            <if test="pm != null ">and sub.pm = #{pm}</if>
+            <if test="title != null  and title != ''">and sub.title = #{title}</if>
+            <if test="number != null ">and sub.number = #{number}</if>
+            <if test="balance != null ">and sub.balance = #{balance}</if>
+            <if test="useCategory != null  and useCategory != ''">and sub.use_category = #{useCategory}</if>
+            <if test="status != null ">and sub.status = #{status}</if>
         </where>
+        order by sub.create_time desc
     </select>
 
     <select id="selectSysUserBillById" parameterType="Long" resultMap="SysUserBillResult">
@@ -124,4 +128,27 @@
         </foreach>
     </delete>
 
+    <select id="listByUserId" parameterType="SysUserBill" resultMap="SysUserBillResult">
+        select sub.id,
+        sub.user_id,
+        sub.pm,
+        sub.title,
+        sub.number,
+        sub.balance,
+        sub.use_category,
+        sub.remark,
+        sub.status,
+        sub.create_by,
+        sub.create_time,
+        sub.update_by,
+        sub.update_time,
+        sub.del_flag,
+        sm.real_name
+        from sys_user_bill sub
+        left join sys_member sm on sub.user_id = sm.id
+        <where>
+            <if test="userId != null ">and sub.user_id = #{userId}</if>
+        </where>
+        order by sub.create_time desc
+    </select>
 </mapper>

+ 17 - 0
qmjszx-pay/pom.xml

@@ -53,6 +53,23 @@
             <groupId>qmjszx</groupId>
             <artifactId>qmjszx-generator</artifactId>
         </dependency>
+        <!-- 业务模块 -->
+        <dependency>
+            <groupId>qmjszx</groupId>
+            <artifactId>qmjszx-business</artifactId>
+        </dependency>
+
+        <!-- 工具模块 -->
+        <dependency>
+            <groupId>qmjszx</groupId>
+            <artifactId>qmjszx-common</artifactId>
+        </dependency>
+
+        <!-- 系统模块 -->
+        <dependency>
+            <groupId>qmjszx</groupId>
+            <artifactId>qmjszx-system</artifactId>
+        </dependency>
 
         <!-- 微信支付-->
         <dependency>