fix: some bugs

This commit is contained in:
xtaodada 2024-06-18 09:06:29 +08:00
parent dca7a58972
commit ea95acec2c
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
10 changed files with 41 additions and 15 deletions

View File

@ -43,8 +43,8 @@ public class AdminMessageController {
}
@RequestMapping("/admin/message/read.do")
public String read(@SessionAttribute AdminUser adminUser, int messageId, HttpSession session) {
messageService.readAdminMessage(adminUser.getAdminId(), messageId);
public String read(@SessionAttribute AdminUser adminUser, int id, HttpSession session) {
messageService.readAdminMessage(adminUser.getAdminId(), id);
messageService.updateSessionAdmin(session, adminUser.getAdminId());
return "redirect:/admin/message.do";
}

View File

@ -43,8 +43,8 @@ public class StuMessageController {
}
@RequestMapping("/stu/message/read.do")
public String read(@SessionAttribute Stu stu, int messageId, HttpSession session) {
messageService.readUserMessage(stu.getUserid(), messageId);
public String read(@SessionAttribute Stu stu, int id, HttpSession session) {
messageService.readUserMessage(stu.getUserid(), id);
messageService.updateSessionStudent(session, stu.getUserid());
return "redirect:/stu/message.do";
}

View File

@ -1,12 +1,15 @@
package cn.edu.cqwu.repair.controller.worker;
import cn.edu.cqwu.repair.dao.OrderDao;
import cn.edu.cqwu.repair.entity.Fault;
import cn.edu.cqwu.repair.entity.Order;
import cn.edu.cqwu.repair.entity.Worker;
import cn.edu.cqwu.repair.util.AppInit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@ -43,4 +46,15 @@ public class WorkerHistoryListController extends HttpServlet {
return "/worker/worker_history_fixList";
}
@RequestMapping("/worker/HistoryList/info.do")
public String orderHistoryInfo(int id, Model model) {
Order byOrderId = orderDao.findByOrderId(id);
if (byOrderId != null) {
model.addAttribute("detail", byOrderId);
return "/stu/detail";
}
model.addAttribute("orderMess", "查询失败");
return "redirect:/worker/HistoryList.do";
}
}

View File

@ -43,8 +43,8 @@ public class WorkerMessageController {
}
@RequestMapping("/worker/message/read.do")
public String read(@SessionAttribute Worker workerUser, int messageId, HttpSession session) {
messageService.readWorkerMessage(workerUser.getUserid(), messageId);
public String read(@SessionAttribute Worker workerUser, int id, HttpSession session) {
messageService.readWorkerMessage(workerUser.getUserid(), id);
messageService.updateSessionWorker(session, workerUser.getUserid());
return "redirect:/worker/message.do";
}

View File

@ -102,7 +102,9 @@ public class OrderDaoImpl implements OrderDao {
@Override
public ArrayList<Order> findHistoryList(int workerId) {
QueryWrapper qw = new QueryWrapper();
qw.select(ORDER.ALL_COLUMNS).where(ORDER.WORKER_ID.eq(workerId));
qw.select(ORDER.ALL_COLUMNS).where(ORDER.WORKER_ID.eq(workerId)).where(
ORDER.ORDER_STATUS.in(OrderStatus.getFinished())
);
return (ArrayList<Order>) mapper.selectListByQuery(qw);
}

View File

@ -19,4 +19,8 @@ public enum OrderStatus {
public static int[] getCurrent() {
return new int[]{0, 1, 2};
}
public static int[] getFinished() {
return new int[]{2, 3};
}
}

View File

@ -80,6 +80,10 @@
</c:choose>
" readonly>
</div>
<div class="input-group mb-3">
<label for="faultScore" class="input-group-text">评分:</label>
<input class="form-control" type="text" id="faultScore" value="${detail.score}" readonly>
</div>
<div class="input-group mb-3">
<c:if test="${detail.faultImg.length() > 0}">
<c:forEach items="${detail.faultImgArray}" var="img">

View File

@ -19,7 +19,7 @@
}
.aa{float:left;width:26px;height:20px;background:url(${webroot}/images/rating.png) 0 -20px no-repeat;}
.pp{font:24px SimSun;width:130px;margin-left:auto;margin-right:auto;}
.pp{font:24px SimSun;width:140px;margin-left:auto;margin-right:auto;}
</style>
</head>
<body>
@ -29,7 +29,7 @@
<main class="form-signin w-100 m-auto">
<img class="mb-4" src="${webroot}/images/logo.jpg" alt="" width="72" height="72">
<h1 class="h3 mb-3 fw-normal">用户中心</h1>
<form action="/stu/comment.do?id=${id}" method="post">
<form action="${webroot}/stu/comment.do?id=${id}" method="post">
<div class="wrapper">
<input type="hidden" name="rating" id="rating" value="0"> <!-- 用于存储评分值 -->
<a class="aa" href="javascript:;"></a>

View File

@ -67,10 +67,9 @@
<th scope="col">联系电话</th>
<th scope="col">维修地址</th>
<th scope="col">故障描述</th>
<th scope="col">故障图片</th>
<th scope="col">订单状态</th>
<th scope="col">创建时间</th>
<th scope="col">完成时间</th>
<th scope="col">操作</th>
</tr>
</thead>
<tbody>
@ -83,7 +82,6 @@
<td>${order.phone}</td>
<td>${order.address}</td>
<td>${order.faultDesc}</td>
<td>${order.faultImg}</td>
<td>
<a class="aButton" href="${webroot}/worker/updateOrderStatus.do?orderId=${order.orderId}">
${order.orderStatus == 1 ? '未完成' : '已完成'}
@ -91,7 +89,9 @@
</td>
<td>${order.createTime}</td>
<td>${order.finishTime}</td>
<td>
<a href="${webroot}/worker/HistoryList/info.do?id=${order.orderId}" class="aButton">详情</a>
</td>
<!-- 添加其他订单信息的列 -->
</tr>
</c:forEach>

View File

@ -74,10 +74,10 @@
<th scope="col">联系电话</th>
<th scope="col">维修地址</th>
<th scope="col">故障描述</th>
<th scope="col">故障图片</th>
<th scope="col">订单状态</th>
<th scope="col">创建时间</th>
<th scope="col">完成时间</th>
<th scope="col">操作</th>
</tr>
</thead>
<tbody>
@ -90,10 +90,12 @@
<td>${order.phone}</td>
<td>${order.address}</td>
<td>${order.faultDesc}</td>
<td>${order.faultImg}</td>
<td>已完成</td>
<td>${order.createTime}</td>
<td>${order.finishTime}</td>
<td>
<a href="${webroot}/worker/HistoryList/info.do?id=${order.orderId}" class="aButton">详情</a>
</td>
<!-- 添加其他订单信息的列 -->
</tr>
</c:forEach>