generated from root/miduo_server
删除扶持记录
parent
8ceca7193a
commit
940ad7e436
|
@ -37,21 +37,28 @@ public class GmController {
|
|||
private UserInfoDao userInfoDao;
|
||||
@Resource
|
||||
private BanFuctionDao banFuctionDao;
|
||||
@Resource
|
||||
private SupportController supportController;
|
||||
|
||||
@RequestMapping(value = "/sendGm", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public @ResponseBody
|
||||
int publishNotice(HttpServletRequest request) throws Exception {
|
||||
List<ServerInfo> allServerInfo = serverInfoDao.getAllServerInfo();
|
||||
List<String> serverList = new ArrayList<>();
|
||||
|
||||
for (ServerInfo serverInfo : allServerInfo) {
|
||||
serverList.add(serverInfo.getServer_id());
|
||||
}
|
||||
|
||||
allServerInfo.forEach(v->serverList.add(v.getServer_id()));
|
||||
String cmd = request.getParameter("content");
|
||||
// 订单返利
|
||||
if(cmd.equals("recharge")){
|
||||
recharge();
|
||||
return 0;
|
||||
}
|
||||
// 扶持删除条目
|
||||
if (cmd.contains("support#remove#")){
|
||||
String[] split = cmd.split("#");
|
||||
supportController.removeSupportOrderById(Integer.parseInt(split[2]));
|
||||
return 0;
|
||||
}
|
||||
|
||||
String serverId = request.getParameter("serverId");
|
||||
String[] split = serverId.split(",");
|
||||
for (String str : split) {
|
||||
|
|
|
@ -467,4 +467,13 @@ public class SupportController {
|
|||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除扶持记录
|
||||
* @param id
|
||||
* @throws Exception
|
||||
*/
|
||||
public void removeSupportOrderById(int id) throws Exception {
|
||||
supportOrderDao.removeSupportOrder(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,13 @@ public interface SupportOrderDao {
|
|||
*/
|
||||
void updateSupportOrderStatus(int id,int status,String auditor) throws Exception;
|
||||
|
||||
/**
|
||||
* 修改订单信息和审核人
|
||||
* @param id
|
||||
* @throws Exception
|
||||
*/
|
||||
void removeSupportOrder(int id) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据申请人修改订单状态
|
||||
* @param proposer
|
||||
|
|
|
@ -26,14 +26,20 @@ public class SupportOrderDaoImpl implements SupportOrderDao {
|
|||
public List<SupportOrder> getSupportOrderList() throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
Query query = new Query();
|
||||
return mongoTemplate.find(query, SupportOrder.class);
|
||||
List<SupportOrder> orders = mongoTemplate.find(query, SupportOrder.class);
|
||||
orders.removeIf(v->v.getIsDelete() == 1);
|
||||
return orders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupportOrder getSupportOrder(int id) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
Query query = new Query(Criteria.where("_id").is(id));
|
||||
return mongoTemplate.findOne(query, SupportOrder.class);
|
||||
SupportOrder order = mongoTemplate.findOne(query, SupportOrder.class);
|
||||
if (order == null || order.getIsDelete() == 1){
|
||||
return null;
|
||||
}
|
||||
return order;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -52,6 +58,15 @@ public class SupportOrderDaoImpl implements SupportOrderDao {
|
|||
mongoTemplate.updateMulti(query, update, SupportOrder.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeSupportOrder(int id) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
Query query = new Query(Criteria.where("_id").is(id));
|
||||
Update update = new Update();
|
||||
update.set("isDelete",1);
|
||||
mongoTemplate.updateMulti(query, update, SupportOrder.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSupportOrderStatusByProposer(String proposer, int status) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
|
|
|
@ -65,6 +65,12 @@ public class SupportOrder {
|
|||
@Field(value = "createTime")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@Field(value = "isDelete")
|
||||
private int isDelete;
|
||||
|
||||
/**
|
||||
* 描述内容,不入库
|
||||
*/
|
||||
|
@ -188,6 +194,14 @@ public class SupportOrder {
|
|||
this.userMessage = userMessage;
|
||||
}
|
||||
|
||||
public int getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(int isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SupportOrder{" +
|
||||
|
|
|
@ -125,11 +125,19 @@
|
|||
|
||||
function sub() {
|
||||
var content = $("input[name='content']").val();
|
||||
var serverId = $("#serverId").val().toString();
|
||||
if (content == null || content === ""){
|
||||
alert("发送内容不能为空");
|
||||
return false;
|
||||
}
|
||||
var serverId = $("#serverId").val();
|
||||
if (serverId == null || serverId === ""){
|
||||
alert("服务器列表不能为空");
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: {
|
||||
"serverId": serverId,
|
||||
"serverId": serverId.toString(),
|
||||
"content": content
|
||||
},
|
||||
url: "/sendGm",
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
<i class="Hui-iconfont"></i> 首页
|
||||
<span class="c-gray en">></span> 扶持功能
|
||||
<span class="c-gray en">></span> 扶持进度查看
|
||||
<a class="btn btn-success radius r" style="margin-top:3px;padding-bottom: 3px;" href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="Hui-iconfont"></i>
|
||||
</a>
|
||||
</nav>
|
||||
<div class="page-container" style="text-align: center">
|
||||
<h2><span style="color:red;">扶持进度查看</span></h2>
|
||||
|
@ -32,7 +35,7 @@
|
|||
<table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
|
||||
<thead>
|
||||
<tr class="text-c">
|
||||
<!--<th width="25"><input type="checkbox" name="" value=""/></th>-->
|
||||
<th width="20">ID</th>
|
||||
<th width="100">申请日期</th>
|
||||
<th width="500">描述</th>
|
||||
<th width="100">进度</th>
|
||||
|
@ -41,7 +44,7 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="obj:${orderList}">
|
||||
<!--<td><input type="checkbox" value="" name=""/></td>-->
|
||||
<td th:text="${obj.getId()}" style="text-align: center;"></td>
|
||||
<td th:text="${obj.createTime}" style="text-align: center;"></td>
|
||||
<td th:text="${obj.content}" style="text-align: center;"></td>
|
||||
<th th:switch="${obj.status}" style="text-align: center;">
|
||||
|
|
Loading…
Reference in New Issue