fix: worker login history
This commit is contained in:
parent
395d43c7a3
commit
9acc5b3d3c
@ -1,5 +1,60 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
<component name="InspectionProjectProfileManager">
|
||||||
<profile version="1.0">
|
<profile version="1.0">
|
||||||
<option name="myName" value="Project Default" />
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="AliAccessStaticViaInstance" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AliControlFlowStatementWithoutBraces" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AliDeprecation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AliEqualsAvoidNull" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AliLongLiteralsEndingWithLowercaseL" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AliMissingOverrideAnnotation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AliWrapperTypeEquality" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAbstractClassShouldStartWithAbstractNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAvoidApacheBeanUtilsCopy" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAvoidCallStaticSimpleDateFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAvoidCommentBehindStatement" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAvoidComplexCondition" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAvoidConcurrentCompetitionRandom" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAvoidDoubleOrFloatEqualCompare" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAvoidManuallyCreateThread" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAvoidMissUseOfMathRandom" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAvoidNegationOperator" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAvoidNewDateGetTime" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAvoidPatternCompileInMethod" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAvoidReturnInFinally" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAvoidStartWithDollarAndUnderLineNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaAvoidUseTimer" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaBooleanPropertyShouldNotStartWithIs" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaClassCastExceptionWithToArray" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaClassMustHaveAuthor" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaClassNamingShouldBeCamel" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaCollectionInitShouldAssignCapacity" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaCommentsMustBeJavadocFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaConcurrentExceptionWithModifyOriginSubList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaCountDownShouldInFinally" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaDontModifyInForeachCircle" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaExceptionClassShouldEndWithException" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaLockShouldWithTryFinally" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaLowerCamelCaseVariableNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaMethodReturnWrapperType" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaMethodTooLong" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaPackageNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaPojoMustOverrideToString" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaPojoMustUsePrimitiveField" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaRemoveCommentedCode" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaSneakyThrowsWithoutExceptionType" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaStringConcat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaSwitchExpression" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaSwitchStatement" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaTestClassShouldEndWithTestNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaThreadLocalShouldRemove" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaThreadPoolCreation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaThreadShouldSetName" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaTransactionMustHaveRollback" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaUndefineMagicConstant" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaUnsupportedExceptionWithModifyAsList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaUseQuietReferenceNotation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="AlibabaUseRightCaseForDateFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
<inspection_tool class="MapOrSetKeyShouldOverrideHashCodeEquals" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
</profile>
|
</profile>
|
||||||
</component>
|
</component>
|
@ -1,17 +1,16 @@
|
|||||||
package cn.edu.cqwu.repair.controller.worker;
|
package cn.edu.cqwu.repair.controller.worker;
|
||||||
|
|
||||||
import cn.edu.cqwu.repair.dao.RecordDao;
|
import cn.edu.cqwu.repair.dao.RecordDao;
|
||||||
import cn.edu.cqwu.repair.entity.Record;
|
|
||||||
import cn.edu.cqwu.repair.entity.Worker;
|
import cn.edu.cqwu.repair.entity.Worker;
|
||||||
|
import cn.edu.cqwu.repair.util.PageModel;
|
||||||
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.SessionAttribute;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServlet;
|
import javax.servlet.http.HttpServlet;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpSession;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author sobear
|
* @author sobear
|
||||||
@ -26,18 +25,19 @@ public class WorkerHistoryLoginController extends HttpServlet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/worker/HistoryLogin.do")
|
@GetMapping("/worker/HistoryLogin.do")
|
||||||
public String getOrders(Model model, HttpSession session,
|
public String adminRecord(
|
||||||
HttpServletRequest request) {
|
@SessionAttribute Worker workerUser, Model model, HttpServletRequest request) {
|
||||||
// 获取Session对象
|
String pageNoS = request.getParameter("pageNo");
|
||||||
session = request.getSession();
|
int pageNo = 1;
|
||||||
|
try {
|
||||||
// 从Session中获取ID数据
|
pageNo = Integer.parseInt(pageNoS);
|
||||||
Worker workerUser = (Worker) session.getAttribute("workerUser");
|
} catch (NumberFormatException ignored) {
|
||||||
// 调用DAO的方法来获取数据库中的历史登录数据
|
}
|
||||||
List<Record> records = (List<Record>) recordDao.findHistoryRecord(workerUser.getUsername());
|
PageModel pm = recordDao.pageByLogname(
|
||||||
|
workerUser.getUsername(), "工人", 10, pageNo
|
||||||
// 将订单数据添加到Model中,以便在JSP页面中使用
|
);
|
||||||
model.addAttribute("records", records);
|
pm.setPageNav("HistoryLogin.do");
|
||||||
|
model.addAttribute("pm", pm);
|
||||||
|
|
||||||
// 返回到展示订单列表的JSP页面
|
// 返回到展示订单列表的JSP页面
|
||||||
return "/worker/worker_history_loginList";
|
return "/worker/worker_history_loginList";
|
||||||
|
@ -3,12 +3,8 @@ package cn.edu.cqwu.repair.dao;
|
|||||||
import cn.edu.cqwu.repair.entity.Record;
|
import cn.edu.cqwu.repair.entity.Record;
|
||||||
import cn.edu.cqwu.repair.util.PageModel;
|
import cn.edu.cqwu.repair.util.PageModel;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public interface RecordDao {
|
public interface RecordDao {
|
||||||
int add(Record record);
|
int add(Record record);
|
||||||
|
|
||||||
PageModel pageByLogname(String logname, String group, int pageSize, int pageNo);
|
PageModel pageByLogname(String logname, String group, int pageSize, int pageNo);
|
||||||
|
|
||||||
public ArrayList<Record> findHistoryRecord(String workername);
|
|
||||||
}
|
}
|
||||||
|
@ -36,11 +36,4 @@ public class RecordDaoImpl implements RecordDao {
|
|||||||
List<Record> recordsList = mapper.selectListByQuery(qw);
|
List<Record> recordsList = mapper.selectListByQuery(qw);
|
||||||
return new PageModel(pageSize, pageNo, recordsList);
|
return new PageModel(pageSize, pageNo, recordsList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ArrayList<Record> findHistoryRecord(String workername){
|
|
||||||
QueryWrapper qw = new QueryWrapper();
|
|
||||||
qw.select(RECORD.ALL_COLUMNS).where(RECORD.LOGNAME.eq(workername));
|
|
||||||
return (ArrayList<Record>) mapper.selectListByQuery(qw);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -81,11 +81,6 @@
|
|||||||
>> 设备管理
|
>> 设备管理
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
|
||||||
<a href="${webroot}/admin/state.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
|
||||||
>> 耗材管理
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="${webroot}/admin/state.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">
|
||||||
>> 统计报表
|
>> 统计报表
|
||||||
@ -108,12 +103,6 @@
|
|||||||
<a href="${webroot}/worker/HistoryList.do" class="nav-link link-body-emphasis" aria-current="page">
|
<a href="${webroot}/worker/HistoryList.do" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
>> 历史维修记录
|
>> 历史维修记录
|
||||||
</a>
|
</a>
|
||||||
<a href="${webroot}/worker/HistoryLogin.do" class="nav-link link-body-emphasis" aria-current="page">
|
|
||||||
>> 历史登录记录
|
|
||||||
</a>
|
|
||||||
<a href="${webroot}/worker/pass.do" class="nav-link link-body-emphasis" aria-current="page">
|
|
||||||
>> 修改用户信息
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:otherwise>
|
<c:otherwise>
|
||||||
|
@ -24,48 +24,35 @@
|
|||||||
<body>
|
<body>
|
||||||
<main class="d-flex flex-nowrap">
|
<main class="d-flex flex-nowrap">
|
||||||
<%@ include file="../includes/header.jsp" %>
|
<%@ include file="../includes/header.jsp" %>
|
||||||
<main class="w-100 m-auto">
|
|
||||||
<c:choose>
|
<main class="form-signin w-100 m-auto" style="max-width: 600px;">
|
||||||
<c:when test="${not empty requestScope.records}">
|
<img class="mb-4" src="${webroot}/images/logo.jpg" alt="" width="72" height="72">
|
||||||
<div class="table-responsive">
|
<h1 class="h3 mb-3 fw-normal">${title}</h1>
|
||||||
<table class="table align-middle">
|
|
||||||
<thead>
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">序号</th>
|
||||||
|
<th scope="col">登录名</th>
|
||||||
|
<th scope="col">用户组</th>
|
||||||
|
<th scope="col">登录时间</th>
|
||||||
|
<th scope="col">登录IP</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<c:forEach items="${pm.data}" var="recode" varStatus="row">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">登录用户</th>
|
<td>${pm.fromIndex + row.index + 1}</td>
|
||||||
<th scope="col">用户类型</th>
|
<td>${recode.logname}</td>
|
||||||
<th scope="col">登录ip</th>
|
<td>${recode.usergroup}</td>
|
||||||
<th scope="col">登录时间</th>
|
<td>${recode.logtime}</td>
|
||||||
|
<td>${recode.logip}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</c:forEach>
|
||||||
<tbody>
|
</tbody>
|
||||||
<c:forEach items="${records}" var="records">
|
</table>
|
||||||
<tr>
|
${pm.pageNav}
|
||||||
<td>${records.logname}</td>
|
|
||||||
<td>${records.usergroup}</td>
|
|
||||||
<td>${records.logip}</td>
|
|
||||||
<td>${records.logtime}</td>
|
|
||||||
<!-- 添加其他订单信息的列 -->
|
|
||||||
</tr>
|
|
||||||
</c:forEach>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</c:when>
|
|
||||||
<c:otherwise>
|
|
||||||
<div class="alert alert-primary square-alert" role="alert">
|
|
||||||
你还没有登录记录哦!!!
|
|
||||||
</div>
|
|
||||||
</c:otherwise>
|
|
||||||
</c:choose>
|
|
||||||
</div>
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
</main>
|
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user