Merge remote-tracking branch 'origin/release-v0.0.1' into release-v0.0.1
This commit is contained in:
commit
2e8f90d71d
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ruoyi.business.controller;
|
package com.ruoyi.business.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
|
@ -19,6 +21,8 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团队奖励明细Controller
|
* 团队奖励明细Controller
|
||||||
*
|
*
|
||||||
|
|
@ -31,20 +35,24 @@ public class BizTeamRewardController extends BaseController
|
||||||
{
|
{
|
||||||
private String prefix = "business/reward";
|
private String prefix = "business/reward";
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private IBizTeamRewardService bizTeamRewardService;
|
private IBizTeamRewardService bizTeamRewardService;
|
||||||
|
|
||||||
@RequiresPermissions("business:reward:view")
|
@RequiresPermissions("business:member:view")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public String reward()
|
public String reward(Long memberID, String rewardDate, ModelMap mmap)
|
||||||
{
|
{
|
||||||
|
mmap.put("memberID", memberID);
|
||||||
|
//检索当前一天结算
|
||||||
|
mmap.put("rewardDate", DateUtils.getDate(-1, rewardDate));
|
||||||
|
mmap.put("rewardType", BizTeamReward.TEAM_REWARD_TYPE_TEAM);
|
||||||
return prefix + "/reward";
|
return prefix + "/reward";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询团队奖励明细列表
|
* 查询团队奖励明细列表
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("business:reward:list")
|
@RequiresPermissions("business:member:view")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(BizTeamReward bizTeamReward)
|
public TableDataInfo list(BizTeamReward bizTeamReward)
|
||||||
|
|
@ -54,73 +62,4 @@ public class BizTeamRewardController extends BaseController
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出团队奖励明细列表
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("business:reward:export")
|
|
||||||
@Log(title = "团队奖励明细", businessType = BusinessType.EXPORT)
|
|
||||||
@PostMapping("/export")
|
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult export(BizTeamReward bizTeamReward)
|
|
||||||
{
|
|
||||||
List<BizTeamReward> list = bizTeamRewardService.selectBizTeamRewardList(bizTeamReward);
|
|
||||||
ExcelUtil<BizTeamReward> util = new ExcelUtil<BizTeamReward>(BizTeamReward.class);
|
|
||||||
return util.exportExcel(list, "reward");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增团队奖励明细
|
|
||||||
*/
|
|
||||||
@GetMapping("/add")
|
|
||||||
public String add()
|
|
||||||
{
|
|
||||||
return prefix + "/add";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增保存团队奖励明细
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("business:reward:add")
|
|
||||||
@Log(title = "团队奖励明细", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping("/add")
|
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult addSave(BizTeamReward bizTeamReward)
|
|
||||||
{
|
|
||||||
return toAjax(bizTeamRewardService.insertBizTeamReward(bizTeamReward));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改团队奖励明细
|
|
||||||
*/
|
|
||||||
@GetMapping("/edit/{id}")
|
|
||||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
|
||||||
{
|
|
||||||
BizTeamReward bizTeamReward = bizTeamRewardService.selectBizTeamRewardById(id);
|
|
||||||
mmap.put("bizTeamReward", bizTeamReward);
|
|
||||||
return prefix + "/edit";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改保存团队奖励明细
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("business:reward:edit")
|
|
||||||
@Log(title = "团队奖励明细", businessType = BusinessType.UPDATE)
|
|
||||||
@PostMapping("/edit")
|
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult editSave(BizTeamReward bizTeamReward)
|
|
||||||
{
|
|
||||||
return toAjax(bizTeamRewardService.updateBizTeamReward(bizTeamReward));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除团队奖励明细
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("business:reward:remove")
|
|
||||||
@Log(title = "团队奖励明细", businessType = BusinessType.DELETE)
|
|
||||||
@PostMapping( "/remove")
|
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult remove(String ids)
|
|
||||||
{
|
|
||||||
return toAjax(bizTeamRewardService.deleteBizTeamRewardByIds(ids));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@ public class BizTeamReward extends BaseEntity
|
||||||
@Excel(name = "团队用户ID")
|
@Excel(name = "团队用户ID")
|
||||||
private Long rewardMemberId;
|
private Long rewardMemberId;
|
||||||
|
|
||||||
|
/** 团队用户名称 */
|
||||||
|
@Excel(name = "团队用户名称")
|
||||||
|
private String rewardMemberName;
|
||||||
|
|
||||||
/** 用户购买产品数量 */
|
/** 用户购买产品数量 */
|
||||||
@Excel(name = "用户购买产品数量")
|
@Excel(name = "用户购买产品数量")
|
||||||
private Long rewardProductCount;
|
private Long rewardProductCount;
|
||||||
|
|
@ -70,7 +74,16 @@ public class BizTeamReward extends BaseEntity
|
||||||
{
|
{
|
||||||
return memberId;
|
return memberId;
|
||||||
}
|
}
|
||||||
public void setRewardMemberId(Long rewardMemberId)
|
|
||||||
|
public String getRewardMemberName() {
|
||||||
|
return rewardMemberName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRewardMemberName(String rewardMemberName) {
|
||||||
|
this.rewardMemberName = rewardMemberName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRewardMemberId(Long rewardMemberId)
|
||||||
{
|
{
|
||||||
this.rewardMemberId = rewardMemberId;
|
this.rewardMemberId = rewardMemberId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,16 +20,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectBizTeamRewardVo">
|
<sql id="selectBizTeamRewardVo">
|
||||||
select id, member_id, reward_member_id, reward_product_count, reward_amount, product_id, reward_type, reward_date, create_by, create_time, update_by, update_time from biz_team_reward
|
select a.id, a.member_id, reward_member_id, (concat(b.member_name, b.mobile)) rewardMemberName, reward_product_count, reward_amount, product_id, reward_type, reward_date, a.create_by, a.create_time, a.update_by, a.update_time from biz_team_reward a
|
||||||
|
left join biz_member b on a.reward_member_id = b.id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectBizTeamRewardList" parameterType="BizTeamReward" resultMap="BizTeamRewardResult">
|
<select id="selectBizTeamRewardList" parameterType="BizTeamReward" resultMap="BizTeamRewardResult">
|
||||||
<include refid="selectBizTeamRewardVo"/>
|
<include refid="selectBizTeamRewardVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="memberId != null "> and member_id = #{memberId}</if>
|
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||||
<if test="rewardMemberId != null "> and reward_member_id = #{rewardMemberId}</if>
|
|
||||||
<if test="rewardProductCount != null "> and reward_product_count = #{rewardProductCount}</if>
|
|
||||||
<if test="rewardAmount != null "> and reward_amount = #{rewardAmount}</if>
|
|
||||||
<if test="productId != null "> and product_id = #{productId}</if>
|
<if test="productId != null "> and product_id = #{productId}</if>
|
||||||
<if test="rewardType != null "> and reward_type = #{rewardType}</if>
|
<if test="rewardType != null "> and reward_type = #{rewardType}</if>
|
||||||
<if test="rewardDate != null and rewardDate != ''"> and reward_date = #{rewardDate}</if>
|
<if test="rewardDate != null and rewardDate != ''"> and reward_date = #{rewardDate}</if>
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,11 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'changeDesc',
|
field: 'changeDesc',
|
||||||
title: '交易备注'
|
title: '交易备注',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
let isTeam = value == "团队奖励";
|
||||||
|
return isTeam ? (value + " <a href='javascript:;' onclick='showTeamDetail(\"" + row.createTime + "\")'>[查看详细]</a>") : value;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'businessNo',
|
field: 'businessNo',
|
||||||
|
|
@ -114,6 +118,12 @@
|
||||||
};
|
};
|
||||||
$.table.init(options);
|
$.table.init(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//团队奖励明细
|
||||||
|
function showTeamDetail(createTime){
|
||||||
|
let dateStr = createTime.split(" ")[0];
|
||||||
|
$.modal.open(dateStr + "团队奖励明细", ctx + "business/reward?memberID=" + $("#memberId").val() + "&rewardDate=" + dateStr);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
<!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" style="height: 0;display: none">
|
||||||
|
<form id="formId">
|
||||||
|
<div class="select-list">
|
||||||
|
<input name="memberId" type="hidden" th:value="*{memberID}"/>
|
||||||
|
<input name="rewardType" type="hidden" th:value="*{rewardType}"/>
|
||||||
|
<input name="rewardDate" type="hidden" th:value="*{rewardDate}"/>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:reward:add">
|
||||||
|
<i class="fa fa-plus"></i> 添加
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="business:reward:edit">
|
||||||
|
<i class="fa fa-edit"></i> 修改
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:reward:remove">
|
||||||
|
<i class="fa fa-remove"></i> 删除
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:reward: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" />
|
||||||
|
<style>
|
||||||
|
.fixed-table-toolbar{height: 0;overflow: hidden}
|
||||||
|
</style>
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "business/reward";
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
var options = {
|
||||||
|
url: prefix + "/list",
|
||||||
|
modalName: "团队奖励明细",
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: '团队奖励ID',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'rewardMemberName',
|
||||||
|
title: '团队用户',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'rewardProductCount',
|
||||||
|
title: '盒数',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'rewardAmount',
|
||||||
|
title: '福豆数量',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'rewardDate',
|
||||||
|
title: '奖励日期',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '创建时间',
|
||||||
|
align: 'center'
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
$.table.init(options);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -56,9 +56,16 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||||
*
|
*
|
||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
public static String getDate(int diff)
|
public static String getDate(int diff, String ... dateStr)
|
||||||
{
|
{
|
||||||
Calendar now = Calendar.getInstance();
|
Calendar now = Calendar.getInstance();
|
||||||
|
if (dateStr.length > 0) {
|
||||||
|
try {
|
||||||
|
now.setTime(parseDate(dateStr[0], YYYY_MM_DD));
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
now.add(Calendar.DAY_OF_MONTH, diff);
|
now.add(Calendar.DAY_OF_MONTH, diff);
|
||||||
return dateTime(now.getTime());
|
return dateTime(now.getTime());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue