单身证明/订单列表/批量通过+拒绝
This commit is contained in:
parent
2ca59e4baa
commit
76f0a8fd61
|
|
@ -1,6 +1,11 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.system.domain.TbUserMatch;
|
||||
import com.ruoyi.system.domain.TbUserSingle;
|
||||
import com.ruoyi.system.service.ITbUserMatchService;
|
||||
import com.ruoyi.system.service.ITbUserSingleService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
|
@ -34,6 +39,12 @@ public class TbUserMatchOrderController extends BaseController
|
|||
@Autowired
|
||||
private ITbUserMatchOrderService tbUserMatchOrderService;
|
||||
|
||||
@Autowired
|
||||
private ITbUserSingleService tbUserSingleService;
|
||||
|
||||
@Autowired
|
||||
private ITbUserMatchService tbUserMatchService;
|
||||
|
||||
@RequiresPermissions("system:order:view")
|
||||
@GetMapping()
|
||||
public String order()
|
||||
|
|
@ -51,6 +62,19 @@ public class TbUserMatchOrderController extends BaseController
|
|||
{
|
||||
startPage();
|
||||
List<TbUserMatchOrder> list = tbUserMatchOrderService.selectTbUserMatchOrderList(tbUserMatchOrder);
|
||||
list.forEach(order->{
|
||||
if(order.getOrderType() == 6){
|
||||
TbUserMatch tbUserMatch = tbUserMatchService.lambdaQuery().eq(TbUserMatch::getUserId, order.getUserId()).one();
|
||||
if(tbUserMatch!=null){
|
||||
order.setUserName(tbUserMatch.getNickName());
|
||||
}
|
||||
}else {
|
||||
TbUserSingle tbUserSingle = tbUserSingleService.lambdaQuery().eq(TbUserSingle::getUserId, order.getUserId()).one();
|
||||
if(tbUserSingle!=null){
|
||||
order.setUserName(tbUserSingle.getNickName());
|
||||
}
|
||||
}
|
||||
});
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
|
@ -68,6 +72,33 @@ public class TbUserSingleController extends BaseController
|
|||
return util.exportExcel(list, "用户单身信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典详细
|
||||
*/
|
||||
@GetMapping("/detail/{userId}")
|
||||
public String detail(@PathVariable("userId") Long userId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("userId", userId);
|
||||
return "system/single/singleImg";
|
||||
}
|
||||
|
||||
@PostMapping("/audit")
|
||||
@ResponseBody
|
||||
public AjaxResult audit(String ids, Long status){
|
||||
try {
|
||||
List<Long> idList = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
List<TbUserSingle> userSingles = this.tbUserSingleService.lambdaQuery().in(TbUserSingle::getId, idList).list();
|
||||
userSingles.forEach(single->{
|
||||
single.setStatus(status.intValue());
|
||||
});
|
||||
return toAjax(tbUserSingleService.updateBatchById(userSingles));
|
||||
}catch (Exception e){
|
||||
logger.error(ExceptionUtils.getStackTrace(e));
|
||||
return AjaxResult.error(ExceptionUtils.getMessage(e));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户单身信息
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class AdapayReq {
|
|||
private Long userId;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "订单类型 0.初级合伙人 1.高级合伙人 2.区域合伙人")
|
||||
@ApiModelProperty(value = "1:1999合伙人开通,6:9.9 户外运动交友团,7:99 本硕博学历的团,8:199 深圳有房有车的团,9:699元人工牵线")
|
||||
private Long orderType;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,22 @@ public class AdapayServiceImpl implements AdapayService {
|
|||
paymentParams.put("app_id", adapayConfig.getAppId());
|
||||
paymentParams.put("order_no", orderNo);
|
||||
paymentParams.put("pay_channel", "alipay");
|
||||
paymentParams.put("pay_amt", "1999");
|
||||
if(adapayReq.getOrderType() == 6L){
|
||||
// paymentParams.put("pay_amt", "9.90");
|
||||
paymentParams.put("pay_amt", "0.01");
|
||||
}else if(adapayReq.getOrderType() == 1L){
|
||||
paymentParams.put("pay_amt", "1999.00");
|
||||
}else if(adapayReq.getOrderType() == 7L){
|
||||
// paymentParams.put("pay_amt", "99.90");
|
||||
paymentParams.put("pay_amt", "0.01");
|
||||
}else if(adapayReq.getOrderType() == 8L){
|
||||
// paymentParams.put("pay_amt", "199.00");
|
||||
paymentParams.put("pay_amt", "0.01");
|
||||
}else if(adapayReq.getOrderType() == 9L){
|
||||
// paymentParams.put("pay_amt", "699.00");
|
||||
paymentParams.put("pay_amt", "0.01");
|
||||
}
|
||||
|
||||
paymentParams.put("goods_title", "全民脱单合伙人开通");
|
||||
paymentParams.put("goods_desc", "全民脱单合伙人资格开通");
|
||||
paymentParams.put("div_members", "");
|
||||
|
|
@ -70,7 +85,17 @@ public class AdapayServiceImpl implements AdapayService {
|
|||
tbUserMatchOrder.setOrderNo(orderNo);
|
||||
tbUserMatchOrder.setPayStatus("Paying");
|
||||
// 测试订单,目前均为0.01元
|
||||
if(adapayReq.getOrderType() == 6L){
|
||||
tbUserMatchOrder.setOrderMoney(BigDecimal.valueOf(9.90));
|
||||
}else if(adapayReq.getOrderType() == 1L){
|
||||
tbUserMatchOrder.setOrderMoney(BigDecimal.valueOf(1999));
|
||||
}else if(adapayReq.getOrderType() == 7L){
|
||||
tbUserMatchOrder.setOrderMoney(BigDecimal.valueOf(99));
|
||||
}else if(adapayReq.getOrderType() == 8L){
|
||||
tbUserMatchOrder.setOrderMoney(BigDecimal.valueOf(199));
|
||||
}else if(adapayReq.getOrderType() == 9L){
|
||||
tbUserMatchOrder.setOrderMoney(BigDecimal.valueOf(699));
|
||||
}
|
||||
tbUserMatchOrderService.insertTbUserMatchOrder(tbUserMatchOrder);
|
||||
return resp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@
|
|||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('system:order:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('system:order:remove')}]];
|
||||
var orderDict = [[${@dict.getType('user_order_type')}]];
|
||||
var payDict = [[${@dict.getType('order_pay_status')}]];
|
||||
var prefix = ctx + "system/order";
|
||||
|
||||
$(function() {
|
||||
|
|
@ -78,11 +80,20 @@
|
|||
},
|
||||
{
|
||||
field: 'userId',
|
||||
title: '用户id'
|
||||
title: '用户id',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'userName',
|
||||
title: '用户名称'
|
||||
},
|
||||
{
|
||||
field: 'orderType',
|
||||
title: '订单类型 0.初级 1.高级 2.区域'
|
||||
title: '订单类型',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(orderDict, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'orderMoney',
|
||||
|
|
@ -98,7 +109,11 @@
|
|||
},
|
||||
{
|
||||
field: 'payStatus',
|
||||
title: '付款状态'
|
||||
title: '付款状态',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(payDict, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
|
|
|
|||
|
|
@ -48,6 +48,12 @@
|
|||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-primary multiple disabled" onclick="auditStatus(1)" shiro:hasPermission="system:single:edit">
|
||||
<i class="fa fa-edit"></i> 通过
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="auditStatus(2)" shiro:hasPermission="system:single:edit">
|
||||
<i class="fa fa-remove"></i> 拒绝
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:single:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
|
|
@ -226,6 +232,7 @@
|
|||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="checkPass(\'' + row.id + '\')"><i class="fa fa-edit"></i>通过</a> ');
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="checkReject(\'' + row.id + '\')"><i class="fa fa-edit"></i>拒绝</a> ');
|
||||
}
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="detail(\'' + row.userId + '\')"><i class="fa fa-edit"></i>单身证明</a> ');
|
||||
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('');
|
||||
|
|
@ -235,6 +242,23 @@
|
|||
$.table.init(options);
|
||||
});
|
||||
|
||||
function auditStatus(status){
|
||||
table.set();
|
||||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
|
||||
if (rows.length == 0) {
|
||||
$.modal.alertWarning("请至少选择一条记录");
|
||||
return;
|
||||
}
|
||||
$.modal.confirm("确认审核吗?", function() {
|
||||
$.operate.post(prefix + "/audit", { "ids": rows.join(), "status": status });
|
||||
})
|
||||
}
|
||||
|
||||
function detail(id) {
|
||||
var url = prefix + '/detail/' + id;
|
||||
$.modal.open("用户附件", url);
|
||||
}
|
||||
|
||||
function checkPass(id) {
|
||||
$.modal.confirm("确认通过吗?", function() {
|
||||
$.operate.post(prefix + "/edit", { "id": id, "status": 1 });
|
||||
|
|
|
|||
|
|
@ -0,0 +1,89 @@
|
|||
<!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>
|
||||
<input type="text" hidden name="userId" th:value="${userId}"/>
|
||||
</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 editFlag = [[${@permission.hasPermi('system:img:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('system:img:remove')}]];
|
||||
var imgDict = [[${@dict.getType('user_img_type')}]];
|
||||
var prefix = ctx + "system/img";
|
||||
|
||||
$(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: '应用用户id',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'userId',
|
||||
title: '用户id',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'type',
|
||||
title: '图片类型',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(imgDict, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'imgUrl',
|
||||
title: '图片url地址',
|
||||
formatter: function(value) {
|
||||
if (value != null && value !== ''){return '<a target="_blank" href="' + value+ '" download="false">附件图片<a/>';}
|
||||
else {return '<a>无<a/>'}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '状态',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
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>
|
||||
|
|
@ -3,6 +3,7 @@ package com.ruoyi.system.domain;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
|
@ -32,6 +33,9 @@ public class TbUserMatchOrder extends BaseEntity
|
|||
@Excel(name = "用户id")
|
||||
private Long userId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
|
||||
/** 订单类型 0.初级 1.高级 2.区域 */
|
||||
@Excel(name = "订单类型 0.初级 1.高级 2.区域")
|
||||
private Long orderType;
|
||||
|
|
|
|||
Loading…
Reference in New Issue