333
This commit is contained in:
parent
612359f92a
commit
9e31244b9d
|
|
@ -9,6 +9,7 @@
|
|||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
|
|
@ -25,92 +26,111 @@ namespace CoreCms.Net.Model.Entities
|
|||
public SQReservationParticipants()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 参与记录ID
|
||||
/// </summary>
|
||||
[Display(Name = "参与记录ID")]
|
||||
|
||||
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 预约ID
|
||||
/// </summary>
|
||||
[Display(Name = "预约ID")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 reservation_id { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32 reservation_id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 参与者ID(关联用户表,暂时占位)
|
||||
/// </summary>
|
||||
[Display(Name = "参与者ID(关联用户表,暂时占位)")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 user_id { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32 user_id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 角色:0=参与者,1=发起者
|
||||
/// </summary>
|
||||
[Display(Name = "角色:0=参与者,1=发起者")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 role { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32 role { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 加入时间
|
||||
/// </summary>
|
||||
[Display(Name = "加入时间")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime join_time { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.DateTime join_time { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 退出时间
|
||||
/// </summary>
|
||||
[Display(Name = "退出时间")]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.DateTime? quit_time { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.DateTime? quit_time { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 状态,0正常,1已退出
|
||||
/// </summary>
|
||||
[Display(Name = "状态,0正常,1已退出")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 status { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32 status { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Display(Name = "备注")]
|
||||
|
||||
[StringLength(maximumLength: 500, ErrorMessage = "{0}不能超过{1}字")]
|
||||
public System.String remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 重要数据
|
||||
/// </summary>
|
||||
[Display(Name = "重要数据")]
|
||||
|
||||
[StringLength(maximumLength: 500, ErrorMessage = "{0}不能超过{1}字")]
|
||||
public System.String important_data { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否需要退款。0 无需退款,未交押金,1 交押金,待退款,2,交押金,退款中,3 退款成功,9退款失败
|
||||
/// </summary>
|
||||
[Display(Name = "是否需要退款。0 无需退款,未交押金,1 交押金,待退款,2,交押金,退款中,3 退款成功,9退款失败")]
|
||||
public System.Int32 is_refund { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@ ICoreCmsUserServices userServices
|
|||
}
|
||||
foreach (var item in pageList)
|
||||
{
|
||||
var temp = participants.Where(it => it.reservation_id == item.id).OrderBy(it=>it.role).ThenBy(it=>it.status).ToList();
|
||||
var temp = participants.Where(it => it.reservation_id == item.id).OrderBy(it => it.role).ThenBy(it => it.status).ToList();
|
||||
var dto = _mapper.Map<List<SQReservationParticipantsDto>>(temp);
|
||||
if (userList != null && userList.Count > 0)
|
||||
{
|
||||
|
|
@ -930,7 +930,7 @@ ICoreCmsUserServices userServices
|
|||
mySheet.SetColumnWidth(2, 10 * 256);
|
||||
|
||||
var cell3 = headerRow.CreateCell(3);
|
||||
cell3.SetCellValue("房间名称(冗余存储,比如 304号-大包,30元/小时)");
|
||||
cell3.SetCellValue("房间名称");
|
||||
cell3.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(3, 10 * 256);
|
||||
|
||||
|
|
@ -955,12 +955,12 @@ ICoreCmsUserServices userServices
|
|||
mySheet.SetColumnWidth(7, 10 * 256);
|
||||
|
||||
var cell8 = headerRow.CreateCell(8);
|
||||
cell8.SetCellValue("玩法类型(如:补克)");
|
||||
cell8.SetCellValue("玩法类型");
|
||||
cell8.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(8, 10 * 256);
|
||||
|
||||
var cell9 = headerRow.CreateCell(9);
|
||||
cell9.SetCellValue("具体规则(如:斗地主)");
|
||||
cell9.SetCellValue("具体规则");
|
||||
cell9.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(9, 10 * 256);
|
||||
|
||||
|
|
@ -970,12 +970,12 @@ ICoreCmsUserServices userServices
|
|||
mySheet.SetColumnWidth(10, 10 * 256);
|
||||
|
||||
var cell11 = headerRow.CreateCell(11);
|
||||
cell11.SetCellValue("是否禁烟:0=不限制,1=禁烟,2=不禁烟");
|
||||
cell11.SetCellValue("是否禁烟");
|
||||
cell11.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(11, 10 * 256);
|
||||
|
||||
var cell12 = headerRow.CreateCell(12);
|
||||
cell12.SetCellValue("性别限制:0=不限,1=男,2=女");
|
||||
cell12.SetCellValue("性别");
|
||||
cell12.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(12, 10 * 256);
|
||||
|
||||
|
|
@ -990,17 +990,17 @@ ICoreCmsUserServices userServices
|
|||
mySheet.SetColumnWidth(14, 10 * 256);
|
||||
|
||||
var cell15 = headerRow.CreateCell(15);
|
||||
cell15.SetCellValue("最大年龄限制,0=不限");
|
||||
cell15.SetCellValue("最大年龄限制");
|
||||
cell15.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(15, 10 * 256);
|
||||
|
||||
var cell16 = headerRow.CreateCell(16);
|
||||
cell16.SetCellValue("鸽子费(保证金)");
|
||||
cell16.SetCellValue("鸽子费");
|
||||
cell16.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(16, 10 * 256);
|
||||
|
||||
var cell17 = headerRow.CreateCell(17);
|
||||
cell17.SetCellValue("状态:0=待开始,1=进行中,2=已结束,3=取消");
|
||||
cell17.SetCellValue("状态");
|
||||
cell17.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(17, 10 * 256);
|
||||
|
||||
|
|
@ -1167,6 +1167,32 @@ ICoreCmsUserServices userServices
|
|||
#endregion
|
||||
|
||||
|
||||
#region 强制退出参与者======================================================
|
||||
|
||||
[HttpPost]
|
||||
[Description("强制退出参与者")]
|
||||
public AdminUiCallBack ForceExitParticipant([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
if (entity.id > 0)
|
||||
{
|
||||
var re = _SQReservationParticipantsServices.QueryById(entity.id);
|
||||
if (re != null)
|
||||
{
|
||||
re.status = 1;
|
||||
re.remarks = $"后台于{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}强制退出!";
|
||||
if (re.is_refund == 1)
|
||||
{
|
||||
re.is_refund = 2;
|
||||
}
|
||||
_SQReservationParticipantsServices.Update(re);
|
||||
jm.msg = "强制退出成功";
|
||||
jm.code = 0;
|
||||
}
|
||||
}
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@
|
|||
var debug = layui.setter.debug;
|
||||
var roomOptions;
|
||||
var dicOptions;
|
||||
var coreHelper;
|
||||
layui.data.done = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d); }
|
||||
|
|
@ -143,10 +144,9 @@
|
|||
, form = layui.form
|
||||
, laydate = layui.laydate
|
||||
, setter = layui.setter
|
||||
, coreHelper = layui.coreHelper
|
||||
, util = layui.util
|
||||
, view = layui.view;
|
||||
|
||||
coreHelper = layui.coreHelper;
|
||||
var searchwhere;
|
||||
//监听搜索
|
||||
form.on('submit(LAY-app-SQReservations-search)',
|
||||
|
|
@ -206,20 +206,20 @@
|
|||
if (!d.participants || d.participants.length === 0) {
|
||||
return '<div style="color: #999; font-style: italic;">暂无参与人员</div>';
|
||||
}
|
||||
|
||||
|
||||
var html = '<div style="line-height: 1.6;line-height: 1.6;overflow: auto;height: 100%;width: 100%;">';
|
||||
var initiator = null;
|
||||
var participants = [];
|
||||
|
||||
|
||||
// 分离发起者和参与者
|
||||
d.participants.forEach(function(it) {
|
||||
d.participants.forEach(function (it) {
|
||||
if (it.role == 1) {
|
||||
initiator = it;
|
||||
} else {
|
||||
participants.push(it);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 显示发起者
|
||||
if (initiator) {
|
||||
html += '<div style="margin-bottom: 8px; border-left: 2px solid #5FB878; padding-left: 8px;">';
|
||||
|
|
@ -228,30 +228,30 @@
|
|||
html += '<span style="font-weight: bold;">' + (initiator.UserName || '用户' + initiator.user_id) + '</span>';
|
||||
html += '<span style="color: #999; font-size: 12px; margin-left: 5px;">(ID: ' + initiator.user_id + ')</span>';
|
||||
html += '</div>';
|
||||
|
||||
|
||||
// 显示发起时间
|
||||
if (initiator.join_time) {
|
||||
html += '<div style="color: #666; font-size: 11px;">';
|
||||
html += '<span style="color: #999;">发起时间:</span>' + initiator.join_time;
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
|
||||
// 显示参与者
|
||||
if (participants.length > 0) {
|
||||
// 统计正常状态的参与者数量
|
||||
var normalParticipantsCount = participants.filter(function(it) {
|
||||
var normalParticipantsCount = participants.filter(function (it) {
|
||||
return it.status == 0;
|
||||
}).length;
|
||||
|
||||
|
||||
html += '<div style="margin-bottom: 5px;">';
|
||||
html += '<span style="background: #1E9FFF; color: white; padding: 2px 6px; border-radius: 3px; font-size: 12px; margin-right: 5px;">参与者</span>';
|
||||
html += '<span style="color: #666; font-size: 12px;">(' + normalParticipantsCount + '人)</span>';
|
||||
html += '</div>';
|
||||
|
||||
participants.forEach(function(it, index) {
|
||||
|
||||
participants.forEach(function (it, index) {
|
||||
var statusText = '';
|
||||
var statusColor = '';
|
||||
if (it.status == 0) {
|
||||
|
|
@ -261,7 +261,7 @@
|
|||
statusText = '已退出';
|
||||
statusColor = '#FF5722';
|
||||
}
|
||||
|
||||
|
||||
html += '<div style="margin-left: 15px; margin-bottom: 8px; font-size: 12px; border-left: 2px solid #E6E6E6; padding-left: 8px;">';
|
||||
html += '<div style="margin-bottom: 3px;">';
|
||||
html += '<span style="color: #333; font-weight: 500;">' + (it.UserName || '用户' + it.user_id) + '</span>';
|
||||
|
|
@ -269,15 +269,19 @@
|
|||
if (statusText) {
|
||||
html += '<span style="background: ' + statusColor + '; color: white; padding: 1px 4px; border-radius: 2px; font-size: 10px; margin-left: 5px;">' + statusText + '</span>';
|
||||
}
|
||||
// 当用户状态为正常时,显示强制退出按钮
|
||||
if (it.status == 0) {
|
||||
html += '<span style="background: #FF5722; color: white; padding: 1px 4px; border-radius: 2px; font-size: 10px; margin-left: 5px; cursor: pointer;" onclick="forceExitParticipant(' + JSON.stringify(it).replace(/"/g, '"') + ', ' + it.id + ')">强制退出</span>';
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
|
||||
// 显示参与时间
|
||||
if (it.join_time) {
|
||||
html += '<div style="color: #666; font-size: 11px; margin-bottom: 2px;">';
|
||||
html += '<span style="color: #999;">参与时间:</span>' + it.join_time;
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
|
||||
// 显示退出时间(仅当状态为已退出时)
|
||||
if (it.status == 1 && it.quit_time) {
|
||||
html += '<div style="color: #666; font-size: 11px;">';
|
||||
|
|
@ -285,10 +289,45 @@
|
|||
html += '</div>';
|
||||
}
|
||||
|
||||
// 显示鸽子费退款状态
|
||||
if (it.is_refund !== undefined && it.is_refund !== null) {
|
||||
var refundText = '';
|
||||
var refundColor = '';
|
||||
switch (it.is_refund) {
|
||||
case 0:
|
||||
refundText = '无需退款';
|
||||
refundColor = '#999';
|
||||
break;
|
||||
case 1:
|
||||
refundText = '已付鸽子费';
|
||||
refundColor = '#1E9FFF';
|
||||
break;
|
||||
case 2:
|
||||
refundText = '退款中';
|
||||
refundColor = '#FFB800';
|
||||
break;
|
||||
case 3:
|
||||
refundText = '退款成功';
|
||||
refundColor = '#5FB878';
|
||||
break;
|
||||
case 9:
|
||||
refundText = '退款失败';
|
||||
refundColor = '#FF5722';
|
||||
break;
|
||||
default:
|
||||
refundText = '未知状态';
|
||||
refundColor = '#999';
|
||||
}
|
||||
html += '<div style="color: #666; font-size: 11px; margin-top: 2px;">';
|
||||
html += '<span style="color: #999;">鸽子费:</span>';
|
||||
html += '<span style="background: ' + refundColor + '; color: white; padding: 1px 4px; border-radius: 2px; font-size: 10px;">' + refundText + '</span>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
html += '</div>';
|
||||
return html;
|
||||
}
|
||||
|
|
@ -661,4 +700,28 @@
|
|||
form.render();
|
||||
});
|
||||
};
|
||||
|
||||
// 强制退出参与者函数
|
||||
function forceExitParticipant(participant, reservationId) {
|
||||
layer.confirm('确定要强制退出该参与者吗?如果用户已付鸽子费,会自动退还!', {
|
||||
icon: 3,
|
||||
title: '确认操作'
|
||||
}, function (index) {
|
||||
// 关闭确认框
|
||||
layer.close(index);
|
||||
|
||||
// 调用API强制退出参与者
|
||||
coreHelper.Post("Api/SQReservations/ForceExitParticipant", {
|
||||
id: reservationId,
|
||||
}, function (e) {
|
||||
if (e.code === 0) {
|
||||
layer.msg('强制退出成功', { icon: 1 });
|
||||
// 重新加载表格数据
|
||||
layui.table.reloadData('LAY-app-SQReservations-tableBox');
|
||||
} else {
|
||||
layer.msg(e.msg || '操作失败', { icon: 2 });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user