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") @RequestMapping("/admin/message/read.do")
public String read(@SessionAttribute AdminUser adminUser, int messageId, HttpSession session) { public String read(@SessionAttribute AdminUser adminUser, int id, HttpSession session) {
messageService.readAdminMessage(adminUser.getAdminId(), messageId); messageService.readAdminMessage(adminUser.getAdminId(), id);
messageService.updateSessionAdmin(session, adminUser.getAdminId()); messageService.updateSessionAdmin(session, adminUser.getAdminId());
return "redirect:/admin/message.do"; return "redirect:/admin/message.do";
} }

View File

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

View File

@ -1,12 +1,15 @@
package cn.edu.cqwu.repair.controller.worker; package cn.edu.cqwu.repair.controller.worker;
import cn.edu.cqwu.repair.dao.OrderDao; 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.Order;
import cn.edu.cqwu.repair.entity.Worker; import cn.edu.cqwu.repair.entity.Worker;
import cn.edu.cqwu.repair.util.AppInit;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -43,4 +46,15 @@ public class WorkerHistoryListController extends HttpServlet {
return "/worker/worker_history_fixList"; 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") @RequestMapping("/worker/message/read.do")
public String read(@SessionAttribute Worker workerUser, int messageId, HttpSession session) { public String read(@SessionAttribute Worker workerUser, int id, HttpSession session) {
messageService.readWorkerMessage(workerUser.getUserid(), messageId); messageService.readWorkerMessage(workerUser.getUserid(), id);
messageService.updateSessionWorker(session, workerUser.getUserid()); messageService.updateSessionWorker(session, workerUser.getUserid());
return "redirect:/worker/message.do"; return "redirect:/worker/message.do";
} }

View File

@ -102,7 +102,9 @@ public class OrderDaoImpl implements OrderDao {
@Override @Override
public ArrayList<Order> findHistoryList(int workerId) { public ArrayList<Order> findHistoryList(int workerId) {
QueryWrapper qw = new QueryWrapper(); 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); return (ArrayList<Order>) mapper.selectListByQuery(qw);
} }

View File

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

View File

@ -80,6 +80,10 @@
</c:choose> </c:choose>
" readonly> " readonly>
</div> </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"> <div class="input-group mb-3">
<c:if test="${detail.faultImg.length() > 0}"> <c:if test="${detail.faultImg.length() > 0}">
<c:forEach items="${detail.faultImgArray}" var="img"> <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;} .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> </style>
</head> </head>
<body> <body>
@ -29,7 +29,7 @@
<main class="form-signin w-100 m-auto"> <main class="form-signin w-100 m-auto">
<img class="mb-4" src="${webroot}/images/logo.jpg" alt="" width="72" height="72"> <img class="mb-4" src="${webroot}/images/logo.jpg" alt="" width="72" height="72">
<h1 class="h3 mb-3 fw-normal">用户中心</h1> <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"> <div class="wrapper">
<input type="hidden" name="rating" id="rating" value="0"> <!-- 用于存储评分值 --> <input type="hidden" name="rating" id="rating" value="0"> <!-- 用于存储评分值 -->
<a class="aa" href="javascript:;"></a> <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> <th scope="col">订单状态</th>
<th scope="col">创建时间</th> <th scope="col">创建时间</th>
<th scope="col">完成时间</th> <th scope="col">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -83,7 +82,6 @@
<td>${order.phone}</td> <td>${order.phone}</td>
<td>${order.address}</td> <td>${order.address}</td>
<td>${order.faultDesc}</td> <td>${order.faultDesc}</td>
<td>${order.faultImg}</td>
<td> <td>
<a class="aButton" href="${webroot}/worker/updateOrderStatus.do?orderId=${order.orderId}"> <a class="aButton" href="${webroot}/worker/updateOrderStatus.do?orderId=${order.orderId}">
${order.orderStatus == 1 ? '未完成' : '已完成'} ${order.orderStatus == 1 ? '未完成' : '已完成'}
@ -91,7 +89,9 @@
</td> </td>
<td>${order.createTime}</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> </tr>
</c:forEach> </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> <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> </tr>
</thead> </thead>
<tbody> <tbody>
@ -90,10 +90,12 @@
<td>${order.phone}</td> <td>${order.phone}</td>
<td>${order.address}</td> <td>${order.address}</td>
<td>${order.faultDesc}</td> <td>${order.faultDesc}</td>
<td>${order.faultImg}</td>
<td>已完成</td> <td>已完成</td>
<td>${order.createTime}</td> <td>${order.createTime}</td>
<td>${order.finishTime}</td> <td>${order.finishTime}</td>
<td>
<a href="${webroot}/worker/HistoryList/info.do?id=${order.orderId}" class="aButton">详情</a>
</td>
<!-- 添加其他订单信息的列 --> <!-- 添加其他订单信息的列 -->
</tr> </tr>
</c:forEach> </c:forEach>