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

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('');
},
// 回显奖品名称
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) {
if ($.common.isEmpty(datas) || $.common.isEmpty(value)) {

View File

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

View File

@ -27,6 +27,12 @@ public interface IDrawPrizeInfoService
*/
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
* @date 2021-03-25
*/
@Service
@Service("drawPrize")
public class DrawPrizeInfoServiceImpl implements IDrawPrizeInfoService
{
@Autowired
@ -45,6 +45,11 @@ public class DrawPrizeInfoServiceImpl implements IDrawPrizeInfoService
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>
</select>
<select id="findDrawPrizeInfoList" resultMap="DrawPrizeInfoResult">
<include refid="selectDrawPrizeInfoVo"/>
</select>
<select id="selectDrawPrizeInfoById" parameterType="java.lang.String" resultMap="DrawPrizeInfoResult">
<include refid="selectDrawPrizeInfoVo"/>
where PRIZEID = #{PRIZEID}

View File

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