5.11号功能优化,添加清库按钮

master
duhui 2022-05-11 17:05:08 +08:00
parent 776d7c95e5
commit 9749283319
4 changed files with 69 additions and 11 deletions

View File

@ -263,15 +263,10 @@ public class ServerInfoController {
if (info.getStatusInt() == notOperateState){
// 2.1 修改跨服信息
updateGameGroupId(vo.getServer_id(),vo.getCrossGroupId());
// 2.3 从未运营修改为其他状态时,执行清库操作
if (vo.getStatusInt() != notOperateState){
TaskKit.scheduleWithFixedOne(()->autoServerManager.manualStartServer(vo),0);
}else {
// 修改开服时间
serverInfoDao.updateOpenServerTime(vo.getServer_id(),vo.getOpenTime());
// 重启服务器
GMHandler.sendGm(info.getServer_id(),"reloadserverconfig");
}
// 2.2 修改开服时间
serverInfoDao.updateOpenServerTime(vo.getServer_id(),vo.getOpenTime());
// 重启服务器
GMHandler.sendGm(info.getServer_id(),"reloadserverconfig");
}else {
updateGmGroupId(vo.getServer_id(),vo.getCrossGroupId());
}
@ -279,6 +274,35 @@ public class ServerInfoController {
return 1;
}
/**
*
* @return
* @throws Exception
*/
@RequestMapping(value = "/cleanupServer", method = {RequestMethod.POST, RequestMethod.GET})
public @ResponseBody
int cleanupServer(HttpServletRequest request) throws Exception {
boolean power = commonManager.verifyPower(request, PowersEnum.CLEANUP_SERVER_PERMISSIONS);
if (!power){
return 2;
}
String serverId = request.getParameter("serverId");
ServerInfo info = serverInfoDao.getServerInfo(serverId);
// 服务器信息不存在
if (info == null){
return 0;
}
// 状态错误
if (info.getStatusInt() != ServerStatusEnum.NOT_OPERATE.getId()){
return 3;
}
// 2. 清库
ServerInfoVo serverInfoVo = createServerVo(info,1);
TaskKit.scheduleWithFixedOne(()->autoServerManager.manualStartServer(serverInfoVo),0);
return 1;
}
/**
*
* @param request

View File

@ -23,6 +23,7 @@ public enum PowersEnum {
DELETE_SERVER_PERMISSIONS(207,"权限:删除服务器",200,0,""),
TRANSFER_SERVER_PERMISSIONS(208,"迁服",200,1,"/html/transferServer.html"),
RESTART_SERVER_PERMISSIONS(209,"权限:重启服务器",200,0,""),
CLEANUP_SERVER_PERMISSIONS(210,"权限:清库",200,0,""),
// 序列号管理300-399
SERIAL_NUMBER_MANAGER(300,"序列号管理",300,1,""),

View File

@ -123,6 +123,9 @@
<button type="button" th:id="${obj.getServer_id()}" class="btn btn-secondary" onclick="return restartServer(this)">
<i class="Hui-iconfont"></i> 重启
</button>
<button type="button" th:id="${obj.getServer_id()}" class="btn btn-info" onclick="return cleanupServer(this)">
<i class="Hui-iconfont"></i> 清库
</button>
</td>
</tr>
</tbody>
@ -218,6 +221,36 @@
}
}
// 删除服务器列表
function cleanupServer(obj) {
var serverId = $(obj).attr("id");
var msg = "只有处于未运营状态的服务器才会执行清库操作,请问是否要清库该服务器:{"+serverId+"},\n\n请确认";
if (confirm(msg) === false) {
return false;
}
$.ajax({
type: "POST",
data: {
"serverId": serverId
},
url: "/cleanupServer",
success: function (data) {
if (data === 1) {
alert("操作成功");
}
if (data === 0) {
alert("操作失败");
}
if (data === 2) {
alert("权限不足,操作失败!");
}
if (data === 3) {
alert("当前服务器未处于未运营状态,操作失败!");
}
}
})
}
// 批量修改服务器状态
function updateServers() {
var serverId = $("#serverId").val().toString();

View File

@ -31,10 +31,10 @@
<p class="f-14" style="line-height:32px;">
1、封禁列表显示字段优化<br>
2、封禁列表添加天眼封禁显示<br>
3、服务器列表添加重启按钮<br>
3、服务器列表添加重启和清库按钮<br>
4、服务器修改信息添加开服时间字段<br>
5、<span style="color: red">必看</span>:服务器处于<span style="color: red">未运营</span>状态时修改服务器的跨服id和开服时间会立刻生效其他状态时修改会延迟生效具体生效时间根据功能不同来定<br>
ps跨服id每周一零点更新开服时间于服务器重启后更新<br>
ps跨服id每周一零点更新开服时间非未运营状态修改无效<br>
6、聊天管理界面添加封禁功能删除功能暂未完成需注意封禁功能对于没有显示账号id的玩家无法封禁请前往封禁列表自行操作更新后的内容都会包含有账号id<br>
7、添加重启服务器功能权限
</p>