Compare commits
No commits in common. "815a6c4a7811fd4b78e50621f0a09b031fe46633" and "f3445238b3d3f9a6a7d1fa358ebac1257c7acbc7" have entirely different histories.
815a6c4a78
...
f3445238b3
@ -4,7 +4,6 @@
|
|||||||
<option name="state">
|
<option name="state">
|
||||||
<map>
|
<map>
|
||||||
<entry key="file://$PROJECT_DIR$/src/main/webapp/student/register.jsp" value="file://$PROJECT_DIR$/src/main/webapp/student" />
|
<entry key="file://$PROJECT_DIR$/src/main/webapp/student/register.jsp" value="file://$PROJECT_DIR$/src/main/webapp/student" />
|
||||||
<entry key="file://$PROJECT_DIR$/src/main/webapp/worker/worker_center_index.jsp" value="file://$PROJECT_DIR$/src/main/webapp/worker" />
|
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
package cn.edu.cqwu.repair.controller.worker;
|
|
||||||
|
|
||||||
import cn.edu.cqwu.repair.dao.WorkerDao;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
|
|
||||||
|
|
||||||
import cn.edu.cqwu.repair.dao.OrderDao;
|
|
||||||
|
|
||||||
import javax.servlet.http.*;
|
|
||||||
import cn.edu.cqwu.repair.entity.*;
|
|
||||||
import cn.edu.cqwu.repair.service.RecordService;
|
|
||||||
import cn.edu.cqwu.repair.util.Encrypt;
|
|
||||||
import cn.edu.cqwu.repair.util.Verify;
|
|
||||||
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 java.util.List;import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import javax.servlet.http.HttpSession;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Controller
|
|
||||||
public class WorkerFixListController extends HttpServlet{
|
|
||||||
private OrderDao orderDao;
|
|
||||||
private WorkerDao workerDao;
|
|
||||||
@Autowired
|
|
||||||
public WorkerFixListController(WorkerDao workerDao, OrderDao orderDao) {
|
|
||||||
this.workerDao = workerDao;
|
|
||||||
this.orderDao = orderDao;
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/workerFixList.do")
|
|
||||||
public String getOrders(Model model, HttpSession session,
|
|
||||||
HttpServletRequest request){
|
|
||||||
// 获取Session对象
|
|
||||||
session = request.getSession();
|
|
||||||
|
|
||||||
// 从Session中获取ID数据
|
|
||||||
Worker workerUser = (Worker) session.getAttribute("workerUser");
|
|
||||||
// 调用DAO的方法来获取数据库中的订单数据
|
|
||||||
List<Order> orders = (List<Order>) orderDao.findByWorkerId(workerUser.getUserid());
|
|
||||||
|
|
||||||
// 将订单数据添加到Model中,以便在JSP页面中使用
|
|
||||||
model.addAttribute("orders", orders);
|
|
||||||
|
|
||||||
// 返回到展示订单列表的JSP页面
|
|
||||||
return "/worker/worker_fixList";
|
|
||||||
}
|
|
||||||
}
|
|
@ -51,7 +51,7 @@ public class WorkerLoginController {
|
|||||||
session.setAttribute("workerUser", user);
|
session.setAttribute("workerUser", user);
|
||||||
return "redirect:/worker/worker_center_index.jsp";
|
return "redirect:/worker/worker_center_index.jsp";
|
||||||
} else {
|
} else {
|
||||||
model.addAttribute("workerLoginMess", "* 登录异常!");
|
model.addAttribute("adminLoginMess", "* 登录异常!");
|
||||||
return "/worker_login";
|
return "/worker_login";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
package cn.edu.cqwu.repair.dao;
|
package cn.edu.cqwu.repair.dao;
|
||||||
|
|
||||||
|
import cn.edu.cqwu.repair.entity.AdminUser;
|
||||||
import cn.edu.cqwu.repair.entity.Order;
|
import cn.edu.cqwu.repair.entity.Order;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public interface OrderDao {
|
public interface OrderDao {
|
||||||
|
|
||||||
int add(Order order);
|
int add(Order order);
|
||||||
|
|
||||||
ArrayList<Order> findByWorkerId(int workerId);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,34 +3,18 @@ package cn.edu.cqwu.repair.dao.impl;
|
|||||||
import cn.edu.cqwu.repair.dao.OrderDao;
|
import cn.edu.cqwu.repair.dao.OrderDao;
|
||||||
import cn.edu.cqwu.repair.db.ConnectionFactory;
|
import cn.edu.cqwu.repair.db.ConnectionFactory;
|
||||||
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.mapper.DeviceMapper;
|
import cn.edu.cqwu.repair.entity.mapper.DeviceMapper;
|
||||||
import cn.edu.cqwu.repair.entity.mapper.OrderMapper;
|
import cn.edu.cqwu.repair.entity.mapper.OrderMapper;
|
||||||
import cn.edu.cqwu.repair.entity.mapper.WorkerMapper;
|
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import static cn.edu.cqwu.repair.entity.table.WorkerTableDef.WORKER;
|
|
||||||
import static cn.edu.cqwu.repair.entity.table.OrderTableDef.ORDER;
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class OrderDaoImpl implements OrderDao {
|
public class OrderDaoImpl implements OrderDao {
|
||||||
|
|
||||||
private static final OrderMapper mapper = ConnectionFactory.getMapper(OrderMapper.class);
|
private static final OrderMapper mapper = ConnectionFactory.getMapper(OrderMapper.class);
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int add(Order order) {
|
public int add(Order order) {
|
||||||
|
|
||||||
return mapper.insert(order);
|
return mapper.insert(order);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ArrayList<Order> findByWorkerId(int workerId){
|
|
||||||
QueryWrapper qw = new QueryWrapper();
|
|
||||||
qw.select(ORDER.ALL_COLUMNS).where(ORDER.WORKER_ID.eq(workerId));
|
|
||||||
return (ArrayList<Order>) mapper.selectListByQuery(qw);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import org.springframework.stereotype.Component;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import static cn.edu.cqwu.repair.entity.table.StuTableDef.STU;
|
||||||
import static cn.edu.cqwu.repair.entity.table.WorkerTableDef.WORKER;
|
import static cn.edu.cqwu.repair.entity.table.WorkerTableDef.WORKER;
|
||||||
@Component
|
@Component
|
||||||
public class WorkerDaoImpl implements WorkerDao {
|
public class WorkerDaoImpl implements WorkerDao {
|
||||||
|
@ -64,20 +64,20 @@
|
|||||||
</c:when>
|
</c:when>
|
||||||
<c:when test="${not empty sessionScope.workerUser}">
|
<c:when test="${not empty sessionScope.workerUser}">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="${webroot}/worker/worker_center_index.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
<a href="${webroot}/admin/state.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
>> 个人中心
|
>> 个人中心
|
||||||
</a>
|
</a>
|
||||||
<a href="${webroot}/worker/worker_fixList.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
<a href="${webroot}/admin/state.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
>> 维修列表
|
>> 维修列表
|
||||||
</a>
|
</a>
|
||||||
<a href="${webroot}/worker/worker_history_fixList.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
<a href="${webroot}/admin/state.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
>> 历史维修记录
|
>> 历史维修记录
|
||||||
</a>
|
</a>
|
||||||
<a href="${webroot}/worker/worker_history_loginList.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
<a href="${webroot}/admin/state.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
>> 历史登录记录
|
>> 历史登录记录
|
||||||
</a>
|
</a>
|
||||||
<a href="${webroot}/worker/worker_modify.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
<a href="${webroot}/admin/state.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
>> 修改用户信息
|
>> 个人中心
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</c:when>
|
</c:when>
|
||||||
|
@ -36,10 +36,42 @@
|
|||||||
<a href="${webroot}/"
|
<a href="${webroot}/"
|
||||||
class="d-flex align-items-center mb-3 mb-md-0 me-md-auto link-body-emphasis text-decoration-none">
|
class="d-flex align-items-center mb-3 mb-md-0 me-md-auto link-body-emphasis text-decoration-none">
|
||||||
<img src="${webroot}/images/logo.jpg" alt="" width="32" height="32" class="rounded-circle me-2">
|
<img src="${webroot}/images/logo.jpg" alt="" width="32" height="32" class="rounded-circle me-2">
|
||||||
<span class="fs-4">工人个人中心</span>
|
<span class="fs-4">维修管理系统</span>
|
||||||
</a>
|
</a>
|
||||||
<hr>
|
<hr>
|
||||||
<%@ include file="../includes/menu.jsp" %>
|
<ul class="nav nav-pills flex-column mb-auto">
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${not empty sessionScope.username}">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="${webroot}/stu/notice.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
|
>> 主页
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="${webroot}/xx.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
|
>> 个人中心
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="${webroot}/xx.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
|
>> 已接任务
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="${webroot}/xx.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
|
>> 历史任务
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</c:when>
|
||||||
|
<c:otherwise>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="${webroot}/" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
|
>> 主页
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</c:otherwise>
|
||||||
|
</c:choose>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
@ -47,6 +79,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8 offset-md-2">
|
<div class="col-md-8 offset-md-2">
|
||||||
<!-- 工人个人中心主页内容 -->
|
<!-- 工人个人中心主页内容 -->
|
||||||
|
<h1 class="text-center">工人个人中心</h1>
|
||||||
<div class="highlight"> <!-- 添加了红色边框的容器 -->
|
<div class="highlight"> <!-- 添加了红色边框的容器 -->
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@ -71,6 +104,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<%@ include file="../includes/footer.jsp" %>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
<%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: sobear
|
|
||||||
Date: 2024/5/12
|
|
||||||
Time: 21:41
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>订单列表</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>订单列表</h1>
|
|
||||||
<table border="1">
|
|
||||||
<tr>
|
|
||||||
<th>订单ID</th>
|
|
||||||
<th>设备ID</th>
|
|
||||||
<th>联系人ID</th>
|
|
||||||
<th>联系电话</th>
|
|
||||||
<th>维修地址</th>
|
|
||||||
<th>故障描述</th>
|
|
||||||
<th>故障图片</th>
|
|
||||||
<th>订单状态</th>
|
|
||||||
<th>创建时间</th>
|
|
||||||
<th>完成时间</th>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
<!-- 使用forEach循环来遍历订单列表 -->
|
|
||||||
<c:forEach items="${orders}" var="order">
|
|
||||||
<tr>
|
|
||||||
<td>${order.orderId}</td>
|
|
||||||
<td>${order.deviceId}</td>
|
|
||||||
<td>${order.studentId}</td>
|
|
||||||
<td>${order.phone}</td>
|
|
||||||
<td>${order.address}</td>
|
|
||||||
<td>${order.contact}</td>
|
|
||||||
<td>${order.faultImg}</td>
|
|
||||||
<td>${order.orderStatus}</td>
|
|
||||||
<td>${order.createTime}</td>
|
|
||||||
<td>${order.finishTime}</td>
|
|
||||||
</tr>
|
|
||||||
</c:forEach>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,16 +0,0 @@
|
|||||||
<%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: sobear
|
|
||||||
Date: 2024/5/12
|
|
||||||
Time: 21:41
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Title</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<p>这是历史维修记录</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,16 +0,0 @@
|
|||||||
<%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: sobear
|
|
||||||
Date: 2024/5/12
|
|
||||||
Time: 21:44
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Title</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<p>历史登录记录</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,16 +0,0 @@
|
|||||||
<%--
|
|
||||||
Created by IntelliJ IDEA.
|
|
||||||
User: sobear
|
|
||||||
Date: 2024/5/12
|
|
||||||
Time: 21:45
|
|
||||||
To change this template use File | Settings | File Templates.
|
|
||||||
--%>
|
|
||||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Title</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<p>修改信息</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in New Issue
Block a user