From ea95acec2ce7c4c155a6fee592a70b680d16ae40 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Tue, 18 Jun 2024 09:06:29 +0800 Subject: [PATCH] fix: some bugs --- .../controller/admin/AdminMessageController.java | 4 ++-- .../controller/stu/StuMessageController.java | 4 ++-- .../worker/WorkerHistoryListController.java | 14 ++++++++++++++ .../controller/worker/WorkerMessageController.java | 4 ++-- .../cn/edu/cqwu/repair/dao/impl/OrderDaoImpl.java | 4 +++- .../cn/edu/cqwu/repair/entity/OrderStatus.java | 4 ++++ src/main/webapp/stu/detail.jsp | 4 ++++ src/main/webapp/stu/updateScore.jsp | 4 ++-- src/main/webapp/worker/worker_fixList.jsp | 8 ++++---- src/main/webapp/worker/worker_history_fixList.jsp | 6 ++++-- 10 files changed, 41 insertions(+), 15 deletions(-) diff --git a/src/main/java/cn/edu/cqwu/repair/controller/admin/AdminMessageController.java b/src/main/java/cn/edu/cqwu/repair/controller/admin/AdminMessageController.java index e72a9c4..45cff79 100644 --- a/src/main/java/cn/edu/cqwu/repair/controller/admin/AdminMessageController.java +++ b/src/main/java/cn/edu/cqwu/repair/controller/admin/AdminMessageController.java @@ -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"; } diff --git a/src/main/java/cn/edu/cqwu/repair/controller/stu/StuMessageController.java b/src/main/java/cn/edu/cqwu/repair/controller/stu/StuMessageController.java index 33ea3ef..ca9307f 100644 --- a/src/main/java/cn/edu/cqwu/repair/controller/stu/StuMessageController.java +++ b/src/main/java/cn/edu/cqwu/repair/controller/stu/StuMessageController.java @@ -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"; } diff --git a/src/main/java/cn/edu/cqwu/repair/controller/worker/WorkerHistoryListController.java b/src/main/java/cn/edu/cqwu/repair/controller/worker/WorkerHistoryListController.java index 867703a..2bbeb37 100644 --- a/src/main/java/cn/edu/cqwu/repair/controller/worker/WorkerHistoryListController.java +++ b/src/main/java/cn/edu/cqwu/repair/controller/worker/WorkerHistoryListController.java @@ -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"; + } + } diff --git a/src/main/java/cn/edu/cqwu/repair/controller/worker/WorkerMessageController.java b/src/main/java/cn/edu/cqwu/repair/controller/worker/WorkerMessageController.java index ad86a9d..7b17403 100644 --- a/src/main/java/cn/edu/cqwu/repair/controller/worker/WorkerMessageController.java +++ b/src/main/java/cn/edu/cqwu/repair/controller/worker/WorkerMessageController.java @@ -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"; } diff --git a/src/main/java/cn/edu/cqwu/repair/dao/impl/OrderDaoImpl.java b/src/main/java/cn/edu/cqwu/repair/dao/impl/OrderDaoImpl.java index 98f24aa..00f615a 100644 --- a/src/main/java/cn/edu/cqwu/repair/dao/impl/OrderDaoImpl.java +++ b/src/main/java/cn/edu/cqwu/repair/dao/impl/OrderDaoImpl.java @@ -102,7 +102,9 @@ public class OrderDaoImpl implements OrderDao { @Override public ArrayList 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) mapper.selectListByQuery(qw); } diff --git a/src/main/java/cn/edu/cqwu/repair/entity/OrderStatus.java b/src/main/java/cn/edu/cqwu/repair/entity/OrderStatus.java index ba7cb8e..a5401f5 100644 --- a/src/main/java/cn/edu/cqwu/repair/entity/OrderStatus.java +++ b/src/main/java/cn/edu/cqwu/repair/entity/OrderStatus.java @@ -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}; + } } diff --git a/src/main/webapp/stu/detail.jsp b/src/main/webapp/stu/detail.jsp index 57c5b07..72b271b 100644 --- a/src/main/webapp/stu/detail.jsp +++ b/src/main/webapp/stu/detail.jsp @@ -80,6 +80,10 @@ " readonly> +
+ + +
diff --git a/src/main/webapp/stu/updateScore.jsp b/src/main/webapp/stu/updateScore.jsp index 55b16c3..63b18d0 100644 --- a/src/main/webapp/stu/updateScore.jsp +++ b/src/main/webapp/stu/updateScore.jsp @@ -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;} @@ -29,7 +29,7 @@

用户中心

-
+
diff --git a/src/main/webapp/worker/worker_fixList.jsp b/src/main/webapp/worker/worker_fixList.jsp index dcbcdab..5f098a9 100644 --- a/src/main/webapp/worker/worker_fixList.jsp +++ b/src/main/webapp/worker/worker_fixList.jsp @@ -67,10 +67,9 @@ 联系电话 维修地址 故障描述 - 故障图片 订单状态 创建时间 - 完成时间 + 操作 @@ -83,7 +82,6 @@ ${order.phone} ${order.address} ${order.faultDesc} - ${order.faultImg} ${order.orderStatus == 1 ? '未完成' : '已完成'} @@ -91,7 +89,9 @@ ${order.createTime} - ${order.finishTime} + + 详情 + diff --git a/src/main/webapp/worker/worker_history_fixList.jsp b/src/main/webapp/worker/worker_history_fixList.jsp index fb60a4b..3ede5d7 100644 --- a/src/main/webapp/worker/worker_history_fixList.jsp +++ b/src/main/webapp/worker/worker_history_fixList.jsp @@ -74,10 +74,10 @@ 联系电话 维修地址 故障描述 - 故障图片 订单状态 创建时间 完成时间 + 操作 @@ -90,10 +90,12 @@ ${order.phone} ${order.address} ${order.faultDesc} - ${order.faultImg} 已完成 ${order.createTime} ${order.finishTime} + + 详情 +