This commit is contained in:
zpc 2025-09-03 03:35:41 +08:00
parent 612359f92a
commit 9e31244b9d
3 changed files with 187 additions and 78 deletions

View File

@ -9,6 +9,7 @@
***********************************************************************/
using SqlSugar;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
@ -37,7 +38,7 @@ namespace CoreCms.Net.Model.Entities
public System.Int32 id { get; set; }
public System.Int32 id { get; set; }
/// <summary>
@ -49,7 +50,7 @@ namespace CoreCms.Net.Model.Entities
public System.Int32 reservation_id { get; set; }
public System.Int32 reservation_id { get; set; }
/// <summary>
@ -61,7 +62,7 @@ namespace CoreCms.Net.Model.Entities
public System.Int32 user_id { get; set; }
public System.Int32 user_id { get; set; }
/// <summary>
@ -73,7 +74,7 @@ namespace CoreCms.Net.Model.Entities
public System.Int32 role { get; set; }
public System.Int32 role { get; set; }
/// <summary>
@ -85,7 +86,7 @@ namespace CoreCms.Net.Model.Entities
public System.DateTime join_time { get; set; }
public System.DateTime join_time { get; set; }
/// <summary>
@ -97,7 +98,7 @@ namespace CoreCms.Net.Model.Entities
public System.DateTime? quit_time { get; set; }
public System.DateTime? quit_time { get; set; }
/// <summary>
@ -109,8 +110,27 @@ namespace CoreCms.Net.Model.Entities
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; }
}
}

View File

@ -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
}
}

View File

@ -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)',
@ -212,7 +212,7 @@
var participants = [];
// 分离发起者和参与者
d.participants.forEach(function(it) {
d.participants.forEach(function (it) {
if (it.role == 1) {
initiator = it;
} else {
@ -242,7 +242,7 @@
// 显示参与者
if (participants.length > 0) {
// 统计正常状态的参与者数量
var normalParticipantsCount = participants.filter(function(it) {
var normalParticipantsCount = participants.filter(function (it) {
return it.status == 0;
}).length;
@ -251,7 +251,7 @@
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) {
@ -269,6 +269,10 @@
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, '&quot;') + ', ' + it.id + ')">强制退出</span>';
}
html += '</div>';
// 显示参与时间
@ -285,6 +289,41 @@
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>';
});
}
@ -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>