活动管理-抽奖记录列表修改

This commit is contained in:
dy 2021-03-31 13:45:42 +08:00
parent 6e3a0f4b8f
commit cd5f52c1b5
6 changed files with 218 additions and 155 deletions

View File

@ -525,6 +525,21 @@ var table = {
}); });
return actions.join(''); return actions.join('');
}, },
// 回显奖品名称
selectprivename: function(datas, value) {
if ($.common.isEmpty(datas) || $.common.isEmpty(value)) {
return '';
}
var actions = [];
$.each(datas, function(index, draw) {
if (draw.prizecode == ('' + value)) {
var listClass = $.common.equals("default", draw.listClass) || $.common.isEmpty(draw.listClass) ? "" : "badge badge-" + draw.listClass;
actions.push($.common.sprintf("<span class='%s'>%s</span>", listClass, draw.prizename));
return false;
}
});
return actions.join('');
},
// 回显数据字典(字符串数组) // 回显数据字典(字符串数组)
selectDictLabels: function(datas, value, separator) { selectDictLabels: function(datas, value, separator) {
if ($.common.isEmpty(datas) || $.common.isEmpty(value)) { if ($.common.isEmpty(datas) || $.common.isEmpty(value)) {

View File

@ -33,6 +33,8 @@ public interface DrawPrizeInfoMapper
*/ */
public List<DrawPrizeInfo> selectDrawPrizeInfoList(DrawPrizeInfo drawPrizeInfo); public List<DrawPrizeInfo> selectDrawPrizeInfoList(DrawPrizeInfo drawPrizeInfo);
List<DrawPrizeInfo> findDrawPrizeInfoList();
/** /**
* 新增存储奖品的基础信息 * 新增存储奖品的基础信息
* *

View File

@ -27,6 +27,12 @@ public interface IDrawPrizeInfoService
*/ */
public List<DrawPrizeInfo> selectDrawPrizeInfoList(DrawPrizeInfo drawPrizeInfo); public List<DrawPrizeInfo> selectDrawPrizeInfoList(DrawPrizeInfo drawPrizeInfo);
/**
* 奖品列表-下拉框
* @return
*/
List<DrawPrizeInfo> findDrawPrizeInfoList();
/** /**
* 新增存储奖品的基础信息 * 新增存储奖品的基础信息
* *

View File

@ -15,7 +15,7 @@ import com.ruoyi.common.core.text.Convert;
* @author dy * @author dy
* @date 2021-03-25 * @date 2021-03-25
*/ */
@Service @Service("drawPrize")
public class DrawPrizeInfoServiceImpl implements IDrawPrizeInfoService public class DrawPrizeInfoServiceImpl implements IDrawPrizeInfoService
{ {
@Autowired @Autowired
@ -45,6 +45,11 @@ public class DrawPrizeInfoServiceImpl implements IDrawPrizeInfoService
return drawPrizeInfoMapper.selectDrawPrizeInfoList(drawPrizeInfo); return drawPrizeInfoMapper.selectDrawPrizeInfoList(drawPrizeInfo);
} }
@Override
public List<DrawPrizeInfo> findDrawPrizeInfoList() {
return drawPrizeInfoMapper.findDrawPrizeInfoList();
}
/** /**
* 新增存储奖品的基础信息 * 新增存储奖品的基础信息
* *

View File

@ -36,6 +36,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="findDrawPrizeInfoList" resultMap="DrawPrizeInfoResult">
<include refid="selectDrawPrizeInfoVo"/>
</select>
<select id="selectDrawPrizeInfoById" parameterType="java.lang.String" resultMap="DrawPrizeInfoResult"> <select id="selectDrawPrizeInfoById" parameterType="java.lang.String" resultMap="DrawPrizeInfoResult">
<include refid="selectDrawPrizeInfoVo"/> <include refid="selectDrawPrizeInfoVo"/>
where PRIZEID = #{PRIZEID} where PRIZEID = #{PRIZEID}

View File

@ -1,88 +1,100 @@
<!DOCTYPE html> <!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" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head> <head>
<th:block th:include="include :: header('抽奖记录信息列表')" /> <th:block th:include="include :: header('抽奖记录信息列表')"/>
</head> </head>
<body class="gray-bg"> <body class="gray-bg">
<div class="container-div"> <div class="container-div">
<div class="row"> <div class="row">
<div class="col-sm-12 search-collapse"> <div class="col-sm-12 search-collapse">
<form id="formId"> <form id="formId">
<div class="select-list"> <div class="select-list">
<ul> <ul>
<li> <!-- <li>-->
<label>抽奖流水:</label> <!-- <label>抽奖流水:</label>-->
<input type="text" name="DRAWTRANSEQNO"/> <!-- <input type="text" name="DRAWTRANSEQNO"/>-->
</li> <!-- </li>-->
<li> <li>
<label>活动代码:</label> <label>活动代码:</label>
<input type="text" name="DRAWCODE"/> <select name="DRAWCODE" th:with="drawinfo=${@drawInfo.findDrawInfoList()}">
<option value="">所有</option>
<option th:each="drawInfo : ${drawinfo}" th:text="${drawInfo.DRAWNAME}"
th:value="${drawInfo.DRAWCODE}"></option>
</select>
</li> </li>
<!-- <li>--> <li>
<!-- <label>用户标识:</label>--> <label>用户标识:</label>
<!-- <input type="text" name="USERID"/>--> <input type="text" name="USERID"/>
<!-- </li>--> </li>
<!-- <li>--> <!-- <li>-->
<!-- <label>抽奖时间:</label>--> <!-- <label>抽奖时间:</label>-->
<!-- <input type="text" class="time-input" placeholder="请选择抽奖时间" name="DRAWTIME"/>--> <!-- <input type="text" class="time-input" placeholder="请选择抽奖时间" name="DRAWTIME"/>-->
<!-- </li>--> <!-- </li>-->
<li> <li>
<label>抽奖结果:</label> <label>抽奖结果:</label>
<input type="text" name="DRAWRESULT"/> <input type="text" name="DRAWRESULT"/>
</li> </li>
<li> <li>
<label>奖品代码:</label> <label>奖品代码:</label>
<input type="text" name="PRIZECODE"/> <select name="PRIZECODE" th:with="drawPrize=${@drawPrize.findDrawPrizeInfoList()}">
<option value="">所有</option>
<option th:each="drawPrize : ${drawPrize}" th:text="${drawPrize.PRIZENAME}"
th:value="${drawPrize.PRIZECODE}"></option>
</select>
</li> </li>
<li> <li>
<label>用户名:</label> <label>用户名:</label>
<input type="text" name="USERNAME"/> <input type="text" name="USERNAME"/>
</li> </li>
<li>
<label>奖品类型:</label>
<select name="PRIZETYPE" th:with="type=${@dict.getType('prizeType')}" style="width: 100px">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<!-- <li>--> <!-- <li>-->
<!-- <label>账务日期:</label>--> <!-- <label>奖品类型:</label>-->
<!-- <input type="text" class="time-input" placeholder="请选择账务日期" name="CHECKINGDATE"/>--> <!-- <select name="PRIZETYPE" th:with="type=${@dict.getType('prizeType')}" style="width: 100px">-->
<!-- <option value="">所有</option>-->
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}"-->
<!-- th:value="${dict.dictValue}"></option>-->
<!-- </select>-->
<!-- </li>--> <!-- </li>-->
<!-- <li>-->
<!-- <label>账务日期:</label>-->
<!-- <input type="text" class="time-input" placeholder="请选择账务日期" name="CHECKINGDATE"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>创建时间:</label>-->
<!-- <input type="text" class="time-input" placeholder="请选择创建时间" name="CREATETIMESTAMP"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>最后修改时间:</label>-->
<!-- <input type="text" class="time-input" placeholder="请选择最后修改时间" name="LASTUPDATETIMESTAMP"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>渠道:</label>-->
<!-- <input type="text" name="CHANNEL"/>-->
<!-- </li>-->
<!-- <li>--> <!-- <li>-->
<!-- <label>创建时间:</label>--> <!-- <label>奖品等级:</label>-->
<!-- <input type="text" class="time-input" placeholder="请选择创建时间" name="CREATETIMESTAMP"/>--> <!-- <select name="PRIZELEVEL" th:with="type=${@dict.getType('prizeLevel')}" style="width: 80px">-->
<!-- </li>--> <!-- <option value="">所有</option>-->
<!-- <li>--> <!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}"-->
<!-- <label>最后修改时间:</label>--> <!-- th:value="${dict.dictValue}"></option>-->
<!-- <input type="text" class="time-input" placeholder="请选择最后修改时间" name="LASTUPDATETIMESTAMP"/>--> <!-- </select>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>渠道:</label>-->
<!-- <input type="text" name="CHANNEL"/>-->
<!-- </li>-->
<li>
<label>奖品等级:</label>
<select name="PRIZELEVEL" th:with="type=${@dict.getType('prizeLevel')}" style="width: 80px">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<!-- <li>-->
<!-- <label>奖品项目编码:</label>-->
<!-- <input type="text" name="PROJECTCODE"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>请求来源:</label>-->
<!-- <input type="text" name="SOURCE"/>-->
<!-- </li>--> <!-- </li>-->
<!-- <li>-->
<!-- <label>奖品项目编码:</label>-->
<!-- <input type="text" name="PROJECTCODE"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>请求来源:</label>-->
<!-- <input type="text" name="SOURCE"/>-->
<!-- </li>-->
<li> <li>
<label>手机号:</label> <label>手机号:</label>
<input type="text" name="PHONE"/> <input type="text" name="PHONE"/>
</li> </li>
<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-primary btn-rounded btn-sm" onclick="$.table.search()"><i
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a> 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> </li>
</ul> </ul>
</div> </div>
@ -90,15 +102,15 @@
</div> </div>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="activity:record:add">--> <!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="activity:record:add">-->
<!-- <i class="fa fa-plus"></i> 添加--> <!-- <i class="fa fa-plus"></i> 添加-->
<!-- </a>--> <!-- </a>-->
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="activity:record:edit">--> <!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="activity:record:edit">-->
<!-- <i class="fa fa-edit"></i> 修改--> <!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>--> <!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="activity:record:remove">--> <!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="activity:record:remove">-->
<!-- <i class="fa fa-remove"></i> 删除--> <!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>--> <!-- </a>-->
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="activity:record:export"> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="activity:record:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
@ -107,16 +119,18 @@
<table id="bootstrap-table"></table> <table id="bootstrap-table"></table>
</div> </div>
</div> </div>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer"/>
<script th:inline="javascript"> <script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('activity:record:edit')}]]; var editFlag = [[${@permission.hasPermi('activity:record:edit')}]];
var removeFlag = [[${@permission.hasPermi('activity:record:remove')}]]; var removeFlag = [[${@permission.hasPermi('activity:record:remove')}]];
var prefix = ctx + "activity/record"; var prefix = ctx + "activity/record";
var datas = [[${@dict.getType('prizeLevel')}]]; var datas = [[${@dict.getType('prizeLevel')}]];
var prizetypes = [[${@dict.getType('prizeType')}]]; var prizetypes = [[${@dict.getType('prizeType')}]];
var drawInfoList = [[${@drawInfo.findDrawInfoList()}]];
var drawPrizeList = [[${@drawPrize.findDrawPrizeInfoList()}]];
$(function() { $(function () {
var options = { var options = {
url: prefix + "/list", url: prefix + "/list",
createUrl: prefix + "/add", createUrl: prefix + "/add",
@ -132,21 +146,24 @@
title: '主键', title: '主键',
visible: false visible: false
}, },
{
field: 'drawtranseqno',
title: '抽奖流水'
},
{
field: 'drawcode',
title: '抽奖活动代码'
},
{ {
field: 'userid', field: 'userid',
title: '用户标识' title: '用户标识'
}, },
{ {
field: 'DRAWTIME', field: 'username',
title: '抽奖时间' title: '用户名'
},
{
field: 'phone',
title: '手机号'
},
{
field: 'drawcode',
title: '抽奖活动代码',
formatter: function (value, row, index) {
return $.table.selectDrawname(drawInfoList, value);
}
}, },
{ {
field: 'drawresult', field: 'drawresult',
@ -154,18 +171,37 @@
}, },
{ {
field: 'prizecode', field: 'prizecode',
title: '奖品代码' title: '奖品名称',
formatter: function (value, row, index) {
return $.table.selectprivename(drawPrizeList, value);
}
},
{
field: 'DRAWTIME',
title: '抽奖时间'
},
{
field: 'drawtranseqno',
title: '抽奖流水',
visible: false
},
{
field: 'projectcode',
title: '奖品项目编码',
visible: false
}, },
{ {
field: 'prizetype', field: 'prizetype',
title: '奖品类型', title: '奖品类型',
formatter: function(value, row, index) { visible: false,
formatter: function (value, row, index) {
return $.table.selectDictLabel(prizetypes, value); return $.table.selectDictLabel(prizetypes, value);
} }
}, },
{ {
field: 'CHECKINGDATE', field: 'CHECKINGDATE',
title: '账务日期' title: '账务日期',
visible: false
}, },
// { // {
// field: 'CREATETIMESTAMP', // field: 'CREATETIMESTAMP',
@ -177,34 +213,29 @@
// }, // },
{ {
field: 'channel', field: 'channel',
title: '渠道' title: '渠道',
}, visible: false,
{
field: 'username',
title: '用户名'
}, },
{ {
field: 'prizelevel', field: 'prizelevel',
title: '奖品等级', title: '奖品等级',
formatter: function(value, row, index) { visible: false,
formatter: function (value, row, index) {
return $.table.selectDictLabel(datas, value); return $.table.selectDictLabel(datas, value);
} }
}, },
{
field: 'projectcode',
title: '奖品项目编码'
},
{ {
field: 'source', field: 'source',
title: '请求来源' title: '请求来源',
}, visible: false
{
field: 'phone',
title: '手机号'
}, },
{ {
field: 'extarea', field: 'extarea',
title: '扩展域' title: '扩展域',
visible: false
}, },
// { // {
// title: '操作', // title: '操作',
@ -220,6 +251,6 @@
}; };
$.table.init(options); $.table.init(options);
}); });
</script> </script>
</body> </body>
</html> </html>